From 56174418e996d4f409467cb1a21b486279c9abd5 Mon Sep 17 00:00:00 2001 From: Julian Locke Date: Mon, 18 Dec 2023 10:39:44 -0500 Subject: [PATCH] Merge 10.0.0 beta (#395) --- .github/workflows/ci.yml | 13 +- .gitignore | 8 +- .swift-version | 1 + .swiftformat | 24 + .../contents.xcworkspacedata | 2 +- .../xcshareddata/IDETemplateMacros.plist | 10 + Cartfile | 1 - Cartfile.resolved | 1 - Format/generate_docs.sh | 2 +- Package.resolved | 16 - Package.swift | 29 +- README.md | 471 +- .../Platform/SwiftyDropbox_iOS/Info.plist | 2 +- .../LoadingViewController.swift | 4 +- .../SwiftyDropbox_iOS/OAuthMobile.swift | 343 +- .../SwiftyDropbox_iOS/UtilitiesMobile.swift | 8 +- .../Platform/SwiftyDropbox_macOS/Info.plist | 2 +- .../SwiftyDropbox_macOS/OAuthDesktop.swift | 115 +- .../Shared/Generated/Account.swift | 259 +- .../Shared/Generated/AccountRoutes.swift | 15 +- .../Shared/Generated/Async.swift | 342 +- .../SwiftyDropbox/Shared/Generated/Auth.swift | 683 +- .../Shared/Generated/AuthAppAuthRoutes.swift | 33 + .../Shared/Generated/AuthRoutes.swift | 23 +- .../SwiftyDropbox/Shared/Generated/Base.swift | 44 +- .../Shared/Generated/BaseApp.swift | 23 + .../Shared/Generated/BaseTeam.swift | 10 +- .../Shared/Generated/Check.swift | 99 +- .../Shared/Generated/CheckAppAuthRoutes.swift | 31 + .../Shared/Generated/CheckRoutes.swift | 33 +- .../Shared/Generated/Common.swift | 329 +- .../Shared/Generated/Contacts.swift | 131 +- .../Shared/Generated/ContactsRoutes.swift | 19 +- .../Generated/DropboxBaseRequestBox.swift | 29 + .../Shared/Generated/FileProperties.swift | 2720 +- .../Generated/FilePropertiesRoutes.swift | 163 +- .../Shared/Generated/FileRequests.swift | 1980 +- .../Shared/Generated/FileRequestsRoutes.swift | 94 +- .../Shared/Generated/Files.swift | 14312 +-- .../Shared/Generated/FilesRoutes.swift | 1495 +- .../Shared/Generated/Openid.swift | 224 +- .../Shared/Generated/OpenidRoutes.swift | 14 +- .../Shared/Generated/Paper.swift | 3360 +- .../Shared/Generated/PaperRoutes.swift | 395 +- .../Generated/ReconnectionHelpers.swift | 178 + .../Shared/Generated/SecondaryEmails.swift | 46 +- .../Shared/Generated/SeenState.swift | 135 +- .../Shared/Generated/Sharing.swift | 13515 +-- .../Shared/Generated/SharingRoutes.swift | 521 +- .../Shared/Generated/StoneBase.swift | 44 +- .../Shared/Generated/StoneSerializers.swift | 250 +- .../Shared/Generated/StoneValidators.swift | 12 +- .../SwiftyDropbox/Shared/Generated/Team.swift | 19898 ++-- .../Shared/Generated/TeamCommon.swift | 355 +- .../Shared/Generated/TeamLog.swift | 77785 +++++++++------- .../Shared/Generated/TeamLogRoutes.swift | 35 +- .../Shared/Generated/TeamPolicies.swift | 2357 +- .../Shared/Generated/TeamRoutes.swift | 1003 +- .../Shared/Generated/Users.swift | 1310 +- .../Shared/Generated/UsersCommon.swift | 75 +- .../Shared/Generated/UsersRoutes.swift | 38 +- .../BackgroundClientSetupInfo.swift | 61 + .../Handwritten/CertificatePinning.swift | 9 + .../{ => Custom}/ChunkInputStream.swift | 4 +- .../Handwritten/{ => Custom}/Custom.swift | 48 +- .../Handwritten/Custom/CustomRoutes.swift | 348 + .../Handwritten/Custom/CustomTasks.swift | 20 + .../Shared/Handwritten/CustomRoutes.swift | 222 - .../Shared/Handwritten/CustomTasks.swift | 20 - .../Shared/Handwritten/DropboxAppClient.swift | 27 + .../Shared/Handwritten/DropboxClient.swift | 110 +- .../Handwritten/DropboxClientsManager.swift | 440 +- .../Handwritten/DropboxTeamClient.swift | 45 +- .../Handwritten/DropboxTransportClient.swift | 984 +- .../DropboxTransportClientInterface.swift | 96 + .../Shared/Handwritten/Errors.swift | 219 + .../Shared/Handwritten/FilesAcccess.swift | 91 + .../Shared/Handwritten/MockApiRequest.swift | 153 + .../MockDropboxTransportClient.swift | 173 + .../Mocks/MockNetworkDataTask.swift | 132 + .../Mocks/MockNetworkSession.swift | 99 + .../NetworkSession/NetworkSession.swift | 89 + .../NetworkSessionConfiguration.swift | 139 + .../NetworkSessionManager.swift | 419 + .../NetworkSession/NetworkTask.swift | 113 + .../Shared/Handwritten/NoopRequest.swift | 60 + .../OAuth/AccessTokenProvider.swift | 16 +- .../Handwritten/OAuth/AuthSession.swift | 22 +- .../Shared/Handwritten/OAuth/OAuth.swift | 585 +- .../Shared/Handwritten/OAuth/OAuthImpl.swift | 459 + .../Handwritten/OAuth/OAuthTokenRequest.swift | 135 +- .../Shared/Handwritten/OAuth/OAuthUtils.swift | 7 +- .../Handwritten/OAuth/Reachability.swift | 37 + .../OAuth/SecureStorageAccess.swift | 146 + .../ReconnectionHelpers+Handwritten.swift | 152 + .../Shared/Handwritten/Request+Async.swift | 51 + .../Handwritten/Request+TokenRefresh.swift | 491 +- .../Shared/Handwritten/Request.swift | 258 + .../Shared/Handwritten/RequestMap.swift | 105 + .../Shared/Handwritten/SDKConstants.swift | 4 +- .../Shared/Handwritten/TransportConfig.swift | 27 - .../Shared/Handwritten/Utilities.swift | 136 + .../SwiftyDropbox.xcodeproj/project.pbxproj | 879 - .../xcschemes/SwiftyDropbox iOS.xcscheme | 80 - .../xcschemes/SwiftyDropbox macOS.xcscheme | 80 - .../SwiftyDropbox_iOS/DBXOAuthMobile.swift | 365 + .../Platform/SwiftyDropbox_iOS/Info.plist | 24 + .../SwiftyDropbox_macOS/DBXOAuthDesktop.swift | 165 + .../Platform/SwiftyDropbox_macOS/Info.plist | 26 + .../Shared/Generated/DBXAccount.swift | 232 + .../Shared/Generated/DBXAccountRoutes.swift | 102 + .../Shared/Generated/DBXAsync.swift | 295 + .../Shared/Generated/DBXAuth.swift | 619 + .../Generated/DBXAuthAppAuthRoutes.swift | 88 + .../Shared/Generated/DBXAuthRoutes.swift | 85 + .../Shared/Generated/DBXBase.swift | 74 + .../Shared/Generated/DBXBaseApp.swift | 34 + .../Shared/Generated/DBXBaseTeam.swift | 30 + .../Shared/Generated/DBXCheck.swift | 55 + .../Generated/DBXCheckAppAuthRoutes.swift | 105 + .../Shared/Generated/DBXCheckRoutes.swift | 109 + .../Shared/Generated/DBXCommon.swift | 250 + .../Shared/Generated/DBXContacts.swift | 91 + .../Shared/Generated/DBXContactsRoutes.swift | 164 + .../Generated/DBXDropboxBaseRequestBox.swift | 53 + .../Shared/Generated/DBXFileProperties.swift | 2200 + .../Generated/DBXFilePropertiesRoutes.swift | 1387 + .../Shared/Generated/DBXFileRequests.swift | 1820 + .../Generated/DBXFileRequestsRoutes.swift | 817 + .../Shared/Generated/DBXFiles.swift | 11362 +++ .../Shared/Generated/DBXFilesRoutes.swift | 7402 ++ .../Shared/Generated/DBXOpenid.swift | 178 + .../Shared/Generated/DBXOpenidRoutes.swift | 102 + .../Shared/Generated/DBXPaper.swift | 2712 + .../Shared/Generated/DBXPaperRoutes.swift | 1228 + .../Shared/Generated/DBXSecondaryEmails.swift | 36 + .../Shared/Generated/DBXSeenState.swift | 165 + .../Shared/Generated/DBXSharing.swift | 11347 +++ .../Shared/Generated/DBXSharingRoutes.swift | 3937 + .../Shared/Generated/DBXTeam.swift | 15723 ++++ .../Shared/Generated/DBXTeamCommon.swift | 318 + .../Shared/Generated/DBXTeamLog.swift | 65961 +++++++++++++ .../Shared/Generated/DBXTeamLogRoutes.swift | 223 + .../Shared/Generated/DBXTeamPolicies.swift | 2197 + .../Shared/Generated/DBXTeamRoutes.swift | 8066 ++ .../Shared/Generated/DBXUsers.swift | 962 + .../Shared/Generated/DBXUsersCommon.swift | 80 + .../Shared/Generated/DBXUsersRoutes.swift | 403 + .../Shared/Handwritten/DBXCallError.swift | 265 + .../Handwritten/DBXCertificatePinning.swift | 36 + .../Handwritten/DBXDropboxAppClient.swift | 28 + .../Shared/Handwritten/DBXDropboxClient.swift | 138 + .../DBXDropboxClientsManager.swift | 244 + .../Handwritten/DBXDropboxTeamClient.swift | 88 + .../DBXDropboxTransportClient.swift | 154 + .../Handwritten/DBXReconnectionHelpers.swift | 95 + .../Shared/Handwritten/DBXRequest.swift | 22 + .../DBXNetworkSessionConfiguration.swift | 109 + .../OAuth/DBXAccessTokenProvider.swift | 68 + .../Handwritten/OAuth/DBXAuthSession.swift | 65 + .../Shared/Handwritten/OAuth/DBXOAuth.swift | 263 + .../Handwritten/OAuth/DBXOAuthImpl.swift | 192 + .../OAuth/DBXSecureStorageAccess.swift | 105 + .../OAuthImplTests.swift | 196 + ...ctionHelperPersistedRequestInfoTests.swift | 51 + .../Request+Async.test.swift | 35 + .../TestAsciiEncoding.swift | 29 + .../TestDropboxTransportClient.swift | 97 + .../TestMockingUtilities.swift | 91 + ...TestNetworkSessionManager+Background.swift | 73 + .../TestNetworkSessionManager.swift | 218 + .../TestOAuthTokenRequest.swift | 197 + .../SwiftyDropboxUnitTests/TestRequest.swift | 117 + .../TestRequestMap.swift | 155 + .../TestRequestWithTokenRefresh.swift | 550 + .../TestSecureStorageAccess.swift | 27 + SwiftyDropbox.podspec | 8 +- SwiftyDropboxObjC.podspec | 24 + .../contents.xcworkspacedata | 7 + .../BackgroundSessionTestClasses.swift | 34 + .../IntegrationTests/ObjC/ObjCTestClasses.h | 175 + .../IntegrationTests/ObjC/ObjCTestClasses.m | 1624 + .../IntegrationTests/ObjC/ObjCTestData.swift | 43 + .../IntegrationTests/TestClasses.swift | 434 +- .../IntegrationTests/TestData.swift | 36 +- TestSwiftyDropbox/Package.swift | 14 + TestSwiftyDropbox/Podfile | 8 +- TestSwiftyDropbox/Podfile.lock | 21 +- .../project.pbxproj | 722 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 ...TestSwiftyDropbox_ActionExtension.xcscheme | 101 + .../xcschemes/TestSwiftyDropbox_iOS.xcscheme | 2 +- .../TestSwiftyDropbox_macOS.xcscheme | 7 +- .../ActionRequestHandler.swift | 140 + .../Info.plist | 31 + ...SwiftyDropbox_ActionExtension.entitlements | 10 + .../iOS/AppDelegate.swift | 22 +- .../iOS/ContentView.swift | 28 +- .../macOS/AppDelegate.swift | 16 +- .../macOS/ContentView.swift | 12 +- .../TestSwiftyDropbox_iOS/AppDelegate.swift | 76 +- .../DebugBackgroundSessionView.swift | 119 + .../DebugBackgroundSessionViewModel.swift | 152 + .../FileBrowserView.swift | 87 + .../TestSwiftyDropbox_iOS/FileTextView.swift | 108 + .../TestSwiftyDropbox_iOS/Info.plist | 36 +- .../TestSwiftyDropbox_iOS/Main.storyboard | 39 +- .../TestSwiftyDropbox_iOS/TestUtilities.swift | 39 + .../ViewController.swift | 93 +- .../CustomRoutesTests.swift | 81 + .../FilesRoutesTests.swift | 19 +- .../ObjCFilesRoutesTests.h | 17 + .../ObjCFilesRoutesTests.m | 103 + .../ObjCTeamRoutesTests.h | 17 + .../ObjCTeamRoutesTests.m | 134 + .../SwiftyDropboxTestExtensions.swift | 64 + .../TeamRoutesTests.swift | 19 +- .../TestSwiftyDropbox_macOS/AppDelegate.swift | 23 +- .../ViewController.swift | 45 +- .../TestUtils/TestTokenAuthGenerator.swift | 9 +- generate_base_client.py | 71 +- spec | 2 +- stone | 2 +- update_version.sh | 27 + 224 files changed, 241195 insertions(+), 62266 deletions(-) create mode 100644 .swift-version create mode 100644 .swiftformat rename {Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.xcworkspace => .swiftpm/xcode/package.xcworkspace}/contents.xcworkspacedata (68%) create mode 100644 .swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist delete mode 100644 Cartfile delete mode 100644 Cartfile.resolved delete mode 100644 Package.resolved create mode 100644 Source/SwiftyDropbox/Shared/Generated/AuthAppAuthRoutes.swift create mode 100644 Source/SwiftyDropbox/Shared/Generated/BaseApp.swift create mode 100644 Source/SwiftyDropbox/Shared/Generated/CheckAppAuthRoutes.swift create mode 100644 Source/SwiftyDropbox/Shared/Generated/DropboxBaseRequestBox.swift create mode 100644 Source/SwiftyDropbox/Shared/Generated/ReconnectionHelpers.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/BackgroundClientSetupInfo.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/CertificatePinning.swift rename Source/SwiftyDropbox/Shared/Handwritten/{ => Custom}/ChunkInputStream.swift (98%) rename Source/SwiftyDropbox/Shared/Handwritten/{ => Custom}/Custom.swift (67%) create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomRoutes.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomTasks.swift delete mode 100644 Source/SwiftyDropbox/Shared/Handwritten/CustomRoutes.swift delete mode 100644 Source/SwiftyDropbox/Shared/Handwritten/CustomTasks.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/DropboxAppClient.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClientInterface.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/Errors.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/FilesAcccess.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/MockApiRequest.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/MockDropboxTransportClient.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkDataTask.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkSession.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSession.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionConfiguration.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionManager.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkTask.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/NoopRequest.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthImpl.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/OAuth/Reachability.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/OAuth/SecureStorageAccess.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/ReconnectionHelpers+Handwritten.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/Request+Async.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/Request.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/RequestMap.swift delete mode 100644 Source/SwiftyDropbox/Shared/Handwritten/TransportConfig.swift create mode 100644 Source/SwiftyDropbox/Shared/Handwritten/Utilities.swift delete mode 100644 Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.pbxproj delete mode 100644 Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox iOS.xcscheme delete mode 100644 Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox macOS.xcscheme create mode 100644 Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/DBXOAuthMobile.swift create mode 100644 Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/Info.plist create mode 100644 Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/DBXOAuthDesktop.swift create mode 100644 Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/Info.plist create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXAccount.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXAccountRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXAsync.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthAppAuthRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXBase.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseApp.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseTeam.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXCheck.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckAppAuthRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXCommon.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXContacts.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXContactsRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXDropboxBaseRequestBox.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXFileProperties.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXFilePropertiesRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequests.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequestsRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenid.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenidRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXPaper.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXPaperRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXSecondaryEmails.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXSeenState.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXSharing.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXSharingRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXTeam.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamCommon.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLogRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamPolicies.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXUsers.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersCommon.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersRoutes.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCallError.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCertificatePinning.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxAppClient.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClient.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClientsManager.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTeamClient.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTransportClient.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXReconnectionHelpers.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/DBXRequest.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/NetworkSession/DBXNetworkSessionConfiguration.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAccessTokenProvider.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAuthSession.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuth.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuthImpl.swift create mode 100644 Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXSecureStorageAccess.swift create mode 100644 Source/SwiftyDropboxUnitTests/OAuthImplTests.swift create mode 100644 Source/SwiftyDropboxUnitTests/ReconnectionHelperPersistedRequestInfoTests.swift create mode 100644 Source/SwiftyDropboxUnitTests/Request+Async.test.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestAsciiEncoding.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestDropboxTransportClient.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestMockingUtilities.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestNetworkSessionManager+Background.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestNetworkSessionManager.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestOAuthTokenRequest.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestRequest.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestRequestMap.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestRequestWithTokenRefresh.swift create mode 100644 Source/SwiftyDropboxUnitTests/TestSecureStorageAccess.swift create mode 100644 SwiftyDropboxObjC.podspec create mode 100644 TestSwiftyDropbox/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata create mode 100644 TestSwiftyDropbox/IntegrationTests/BackgroundSessionTestClasses.swift create mode 100644 TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.h create mode 100644 TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.m create mode 100644 TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestData.swift create mode 100644 TestSwiftyDropbox/Package.swift rename {Source/SwiftyDropbox/SwiftyDropbox.xcodeproj => TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_ActionExtension.xcscheme create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/ActionRequestHandler.swift create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/Info.plist create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/TestSwiftyDropbox_ActionExtension.entitlements create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionView.swift create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionViewModel.swift create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileBrowserView.swift create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileTextView.swift create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOS/TestUtilities.swift create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/CustomRoutesTests.swift create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.h create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.m create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.h create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.m create mode 100644 TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/SwiftyDropboxTestExtensions.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d5638865..1adade383 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,8 @@ on: [pull_request, workflow_dispatch] jobs: test: name: Run Unit Tests - runs-on: macos-latest + runs-on: macos-13 + timeout-minutes: 45 steps: - name: Checkout @@ -24,7 +25,7 @@ jobs: ACCOUNT_ID_2: ${{ secrets.ACCOUNT_ID_2 }} ACCOUNT_ID_3: ${{ secrets.ACCOUNT_ID_3 }} platform: ${{ 'iOS Simulator' }} - device: ${{ 'iPhone 13' }} + device: ${{ 'iPhone 14' }} run: | xcodebuild -workspace TestSwiftyDropbox/TestSwiftyDropbox.xcworkspace/ -scheme TestSwiftyDropbox_iOS -sdk iphonesimulator \ -destination "platform=$platform,name=$device" \ @@ -38,14 +39,6 @@ jobs: ACCOUNT_ID_3=$ACCOUNT_ID_3 \ test - - name: Set up keychain - env: - TEST_KEYCHAIN_PASSWORD: ${{ secrets.TEST_KEYCHAIN_PASSWORD }} - run: | - security create-keychain -p $TEST_KEYCHAIN_PASSWORD build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p $TEST_KEYCHAIN_PASSWORD build.keychain - - name: Test macOS env: FULL_DROPBOX_API_APP_KEY: ${{ secrets.FULL_DROPBOX_API_APP_KEY }} diff --git a/.gitignore b/.gitignore index 5e5f5189f..4aa4d1e0b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,9 +9,9 @@ build/ ## CocoaPods Pods/ -## Carthage -Carthage/ - ## Swift Package Manager Packages/ -.build/ \ No newline at end of file +.build/ +.swiftpm/xcode/xcuserdata +.swiftpm/xcode/package.xcworkspace/xcuserdata + diff --git a/.swift-version b/.swift-version new file mode 100644 index 000000000..2df33d769 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +5.6 diff --git a/.swiftformat b/.swiftformat new file mode 100644 index 000000000..d8536729b --- /dev/null +++ b/.swiftformat @@ -0,0 +1,24 @@ +--exclude stone,spec +--ifdef no-indent +--maxwidth 160 +--trimwhitespace always +--hexliteralcase lowercase +--semicolons never +--stripunusedargs closure-only +--decimalgrouping 3 +--disable trailingClosures +--wraparguments before-first +--wrapcollections before-first +--wrapparameters before-first +--closingparen balanced +--self init-only +--disable andOperator +--disable linebreakAtEndOfFile +--disable hoistPatternLet +--specifierorder public,open,override +--disable extensionAccessControl +--disable wrapMultilineStatementBraces +--disable redundantType +--disable enumNamespaces +--disable redundantClosure +--disable redundantVoidReturnType diff --git a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata similarity index 68% rename from Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata index 6d4e91380..919434a62 100644 --- a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist new file mode 100644 index 000000000..7e381ce6b --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist @@ -0,0 +1,10 @@ + + + + + FILEHEADER + / +/// Copyright (c) ___YEAR___ Dropbox, Inc. All rights reserved. +/// + + diff --git a/Cartfile b/Cartfile deleted file mode 100644 index 6455b115e..000000000 --- a/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "https://github.com/Alamofire/Alamofire.git" ~> 5.4.3 diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index d2014682b..000000000 --- a/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" "5.5.0" diff --git a/Format/generate_docs.sh b/Format/generate_docs.sh index 531adfe8c..8fcd1ce03 100755 --- a/Format/generate_docs.sh +++ b/Format/generate_docs.sh @@ -20,7 +20,7 @@ else mkdir $docs_location echo "Generating documents..." - cd ../Source/SwiftyDropbox + cd .. jazzy --readme $sdk_repo_location/README.md --config $sdk_repo_location/.jazzy.json --github_url https://github.com/dropbox/SwiftyDropbox --module-version $sdk_version --module SwiftyDropbox -o $docs_location cd - diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 20e547a35..000000000 --- a/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "f96b619bcb2383b43d898402283924b80e2c4bae", - "version": "5.4.3" - } - } - ] - }, - "version": 1 -} diff --git a/Package.swift b/Package.swift index 48e7c8a0b..b5d63d5d8 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.6 /// /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// @@ -8,20 +8,27 @@ import PackageDescription let package = Package( name: "SwiftyDropbox", platforms: [ - .macOS(.v10_12), - .iOS(.v10), + .macOS(.v10_13), + .iOS(.v11), ], products: [ - .library(name: "SwiftyDropbox", targets:["SwiftyDropbox"]), - ], - dependencies: [ - .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.4.3")), + .library(name: "SwiftyDropbox", targets: ["SwiftyDropbox"]), + .library(name: "SwiftyDropboxObjC", targets: ["SwiftyDropboxObjC"]), ], targets: [ .target( name: "SwiftyDropbox", - dependencies: ["Alamofire"], - path: "Source" - ) - ] + path: "Source/SwiftyDropbox" + ), + .target( + name: "SwiftyDropboxObjC", + dependencies: ["SwiftyDropbox"], + path: "Source/SwiftyDropboxObjC" + ), + .testTarget( + name: "SwiftyDropboxUnitTests", + dependencies: ["SwiftyDropbox"] + ), + ], + swiftLanguageVersions: [.v5] ) diff --git a/README.md b/README.md index 44896a843..4ac642bd6 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,10 @@ # Dropbox for Swift ---- -### Check out the beta version of a significant update to this SDK: SwiftyDropbox 10.0.0-beta.3 - -### The beta version has several significant improvements, including support for background sessions, as well as compatibility for Objective-C code bases. You can find more information in the beta [release notes](https://github.com/dropbox/SwiftyDropbox/releases/tag/10.0.0-beta.3) and [README file](https://github.com/dropbox/SwiftyDropbox/blob/branch_10.0.0-beta/README.md#dropbox-for-swift). - -### Please try it out and [report any issues or feedback](https://github.com/dropbox/SwiftyDropbox/issues); be sure to include the version number of the SDK you're using when doing so. Thanks! ---- +## Version 10.0.0 beta differs greatly from previous versions of the SDK. See [Changes in version 10.0.0](#changes-in-version-1000) and, if needed, [Migrating from dropbox-sdk-obj-c](#migrating-from-dropbox-sdk-obj-c). The Official Dropbox Swift SDK for integrating with Dropbox [API v2](https://www.dropbox.com/developers/documentation/http/documentation) on iOS or macOS. -Full documentation [here](http://dropbox.github.io/SwiftyDropbox/api-docs/8.2.0/). +Full documentation [here](http://dropbox.github.io/SwiftyDropbox/api-docs/10.0.0-beta.3/). --- @@ -23,8 +17,6 @@ Full documentation [here](http://dropbox.github.io/SwiftyDropbox/api-docs/8.2.0/ * [SDK distribution](#sdk-distribution) * [Swift Package Manager](#swift-package-manager) * [CocoaPods](#cocoapods) - * [Carthage](#carthage) - * [Manually add subproject](#manually-add-subproject) * [Configure your project](#configure-your-project) * [Application `.plist` file](#application-plist-file) * [Handling the authorization flow](#handling-the-authorization-flow) @@ -48,6 +40,11 @@ Full documentation [here](http://dropbox.github.io/SwiftyDropbox/api-docs/8.2.0/ * [`DropboxClientsManager` class](#dropboxclientsmanager-class) * [Single Dropbox user case](#single-dropbox-user-case) * [Multiple Dropbox user case](#multiple-dropbox-user-case) +* [Objective-C](#objective-c) + * [Objective-C Compatibility Layer Distribution](#objective-c-compatibility-layer-distribution) + * [Using the Objective-C Compatbility Layer](#using-the-objective-c-compatbility-layer) + * [Migrating from dropbox-sdk-obj-c](#migrating-from-dropbox-sdk-obj-c) +* [Changes in version 10.0.0](#changes-in-version-1000) * [Examples](#examples) * [Documentation](#documentation) * [Stone](#stone) @@ -60,9 +57,9 @@ Full documentation [here](http://dropbox.github.io/SwiftyDropbox/api-docs/8.2.0/ ## System requirements - iOS 11.0+ -- macOS 10.12+ -- Xcode 10.0+ (11.0+ if you use Carthage) -- Swift 5.1+ +- macOS 10.13+ +- Xcode 13.3+ +- Swift 5.6+ ## Get Started @@ -112,6 +109,7 @@ target '' do pod 'SwiftyDropbox' end ``` +If your project contains Objective-C code that will need to have access to Dropbox SDK there is a separate pod called `SwiftyDropboxObjC` that contains an Objective-C compatibility layer for the SDK. Add this pod to your `Podfile` (in addition to `SwiftyDropbox` or on its own). For more information refer to the [Objective-C](#objective-c) section of this README. Then, run the following command to install the dependency: @@ -125,45 +123,6 @@ Once your project is integrated with the Dropbox Swift SDK, you can pull SDK upd $ pod update ``` -**Note**: SwiftyDropbox requires CocoaPods 1.0.0+ when using Alamofire 4.0.0+. Because of this requirement, the CocoaPods App (which uses CocoaPods 1.0.0) cannot be used. - ---- - -### Carthage - -You can also integrate the Dropbox Swift SDK into your project using [Carthage](https://github.com/Carthage/Carthage), a decentralized dependency manager for Cocoa. Carthage offers more flexibility than CocoaPods, but requires some additional work. Carthage 0.37.0 is required due to XCFramework requirements on Xcode 12. You can install Carthage (with Xcode 11+) via [Homebrew](http://brew.sh/): - -```bash -brew update -brew install carthage -``` - -To install the Dropbox Swift SDK via Carthage, you need to create a `Cartfile` in your project with the following contents: - -``` -# SwiftyDropbox -github "https://github.com/dropbox/SwiftyDropbox" ~> 9.2.0 -``` - -Then, run the following command to install the dependency to checkout and build the Dropbox Swift SDK repository: - -##### iOS - -```bash -carthage update --platform iOS --use-xcframeworks -``` - -Then, in the Project Navigator in Xcode, select your project, and then navigate to your project's build target > **General** > **Frameworks, Libraries, and Embedded Content** then drag both the `SwiftyDropbox.xcframework` and `Alamofire.xcframework` files (from `Carthage/Build`) into the table, choosing `Embed & Sign`. - -##### macOS -```bash -carthage update --platform Mac --use-xcframeworks -``` - -Once you have checked-out out all the necessary code via Carthage, drag the `Carthage/Checkouts/SwiftyDropbox/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj` file into your project as a subproject. - -Then, in the Project Navigator in Xcode, select your project, and then navigate to your project's build target > **General** > **Embedded Binaries** then drag both the `SwiftyDropbox.xcframework` and `Alamofire.xcframework` files (from `Carthage/Build`) into the table, choosing `Embed & Sign`. - --- ## Configure your project @@ -347,7 +306,7 @@ func application(_ app: UIApplication, open url: URL, options: [UIApplication.Op } } } - let canHandleUrl = DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion) + let canHandleUrl = DropboxClientsManager.handleRedirectURL(url, includeBackgroundClient: false, completion: oauthCompletion) return canHandleUrl } @@ -374,7 +333,7 @@ func scene(_ scene: UIScene, openURLContexts URLContexts: Set) for context in URLContexts { // stop iterating after the first handle-able url - if DropboxClientsManager.handleRedirectURL(context.url, completion: oauthCompletion) { break } + if DropboxClientsManager.handleRedirectURL(context.url, includeBackgroundClient: false, completion: oauthCompletion) { break } } } ``` @@ -409,7 +368,7 @@ func handleGetURLEvent(_ event: NSAppleEventDescriptor?, replyEvent: NSAppleEven } } } - DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion) + DropboxClientsManager.handleRedirectURL(url, includeBackgroundClient: false, completion: oauthCompletion) // this brings your application back the foreground on redirect NSApp.activate(ignoringOtherApps: true) } @@ -468,6 +427,14 @@ The response handlers for each request type are similar to one another. The argu Note: Response handlers are required for all endpoints. Progress handlers, on the other hand, are optional for all endpoints. +#### Swift Concurrency + +As of the 10.0.0 release, all of the request types also support Swift Concurrency (`async`/`await`) via the async `response()` function. + +```swift +let response = try await client.files.createFolder(path: "/test/path/in/Dropbox/account").response() +``` + --- ### Request types @@ -514,10 +481,8 @@ if someConditionIsSatisfied { // Download to URL let fileManager = FileManager.default let directoryURL = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] -let destURL = directoryURL.appendingPathComponent("myTestFile") -let destination: (URL, HTTPURLResponse) -> URL = { temporaryURL, response in - return destURL -} +let destination = directoryURL.appendingPathComponent("myTestFile") + client.files.download(path: "/test/path/in/Dropbox/account", overwrite: true, destination: destination) .response { response, error in if let response = response { @@ -711,19 +676,19 @@ In this way, datatypes with subtypes are a hybrid of structs and unions. Only a #### Configure network client -It is possible to configure the networking client used by the SDK to make API requests. You can supply custom fields like a custom user agent or custom delegates to manage response handler code, or a custom server trust policy. See below: +It is possible to configure the networking client used by the SDK to make API requests. You can supply custom fields like a custom user agent or custom session configurations, or a custom auth challenge handler. See below: ##### iOS ```Swift import SwiftyDropbox -let transportClient = DropboxTransportClient(accessToken: "", +let transportClient = DropboxTransportClientImpl(accessToken: "", baseHosts: nil, userAgent: "CustomUserAgent", selectUser: nil, - sessionDelegate: mySessionDelegate, - backgroundSessionDelegate: myBackgroundSessionDelegate, - serverTrustPolicyManager: myServerTrustPolicyManager) + sessionConfiguration: mySessionConfiguration, + longpollSessionConfiguration: myLongpollSessionConfiguration, + authChallengeHandler: nil) DropboxClientsManager.setupWithAppKey("", transportClient: transportClient) ``` @@ -732,13 +697,13 @@ DropboxClientsManager.setupWithAppKey("", transportClient: transportCli ```Swift import SwiftyDropbox -let transportClient = DropboxTransportClient(accessToken: "", +let transportClient = DropboxTransportClientImpl(accessToken: "", baseHosts: nil, userAgent: "CustomUserAgent", selectUser: nil, - sessionDelegate: mySessionDelegate, - backgroundSessionDelegate: myBackgroundSessionDelegate, - serverTrustPolicyManager: myServerTrustPolicyManager) + sessionConfiguration: mySessionConfiguration, + longpollSessionConfiguration: myLongpollSessionConfiguration, + authChallengeHandler: nil) DropboxClientsManager.setupWithAppKeyDesktop("", transportClient: transportClient) ``` @@ -759,8 +724,185 @@ client.files.listFolder(path: "").response(queue: DispatchQueue(label: "MyCustom } ``` +#### Mock API responses in tests + +When testing code that depends upon the SDK, it can be useful to mock arbitrary API responses from JSON fixtures. We recommend using dependency injection rather than accessing the client via the convenience singletons. Note that the mocks are not public, they are only available in tests when SwiftyDropbox is imported using the `@testable` attribute. + +```Swift +@testable import SwiftyDropbox + +let transportClient = MockDropboxTransportClient() +let dropboxClient = DropboxClient(transportClient: transportClient) + +// your feature under test +let commentClient = CommentClient(apiClient: dropboxClient) + +let expectation = expectation(description: "added comment") + +// function of your feature that relies upon Dropbox api response +commentClient.addComment( + forIdentifier: identifier, + commentId: "pendingCommentId", + threadId: nil, + message: "hello world", + mentions: [], + annotation: nil +) { result in + XCTAssertEqual(result.commentId, "thread-1") + XCTAssertNil(result.error) + addCommentExpectation.fulfill() +} + +let mockInput: MockInput = .success( + json: ["id": "thread-1", "status": 1] +) + +let request = try XCTUnwrap(transportClient.getLastRequest()) +try request.handleMockInput(mockInput) + +wait(for: [expectation], timeout: 1.0) +``` + +--- + +### Supporting background networking + +Versions 10.0 and higher support iOS background networking from applications and their extensions. + +#### Initialization + +To create a background client, provide a background session identifier. To use a shared container, specify that as well. + +```Swift +import SwiftyDropbox + +DropboxClientsManager.setupWithAppKey( + "", + backgroundSessionIdentifier: "" +) +``` + +If you're setting up a background client from an app extension, you'll need to specify a shared container identifier and configure and app group or keychain sharing appropriately. +```Swift +DropboxClientsManager.setupWithAppKey( + "", + backgroundSessionIdentifier: "" + sharedContainerIdentifier: "" +) +``` + Apps in an app group automatically have keychain sharing. App groups are required for using a shared container, which is necessary if your applications will be downloading files using background sessions in extensions. See: +- https://developer.apple.com/documentation/xcode/configuring-app-groups +- https://developer.apple.com/documentation/xcode/configuring-keychain-sharing + +#### Making requests +Make requests like you would with a foreground client. + +```Swift +let client = DropboxClientsManager.authorizedBackgroundClient! + +client.files.download(path: path, overwrite: true, destination: destinationUrl) { + if let result = response { + print(result) + } +} +``` + +#### Customizing requests +Set background session related properties on requests for fine-grained control. + +```Swift +client.files.download(path: path, overwrite: true, destination: destinationUrl) + .persistingString(string: "") + .settingEarliestBeginDate(date: .addingTimeInterval(fiveSeconds)) + .response { response, error in +{ + if let result = response { + print(result) + } +}) +``` + +#### Reconnecting to requests across app sessions +As background requests potentially span app sessions, the app will recieve `AppDelegate.application(_:handleEventsForBackgroundURLSession:completionHandler:)` when woken to handle events. SwiftyDropbox can reconnect completion handlers to requests. The application must set up the `authorizedBackgroundClient` prior to attempting reconnection. + +In the reconnection block you're recieving a heterogenous collection of the routes requested on the background session. Handling the response will likely require context that must be persisted across sessions. You can use `.persistingString(string:)` and `.clientPersistedString` on request to store this context. Depending on your use case you may need to persist additional context in your application. + +```Swift + func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) { + DropboxClientsManager.handleEventsForBackgroundURLSession( + with: identifier, + creationInfos: [], + completionHandler: completionHandler, + requestsToReconnect: { requestResults in + processReconnect(requestResults: RequestResults) + } + ) + } + + static func processReconnect(requestResults: ([Result])) { + let successfulReturnedRequests = requestResults.compactMap { result -> DropboxBaseRequestBox? in + switch result { + case .success(let requestBox): + return requestBox + case .failure(let error): + // handle error + return nil + } + } + + for request in successfulReturnedRequests { + switch request { + case .download(let downloadRequest): + downloadRequest.response { response, error in + // handle response + } + case .upload(let uploadRequest): + uploadRequest.response { response, error in + // handle response + } + // or .downloadZip, .paperCreate, .getSharedLinkFile etc. + } + } + } +``` + +In the event that the requests originated from an App Extension, SwiftyDropbox must recreate the extension background client in order to reconnect the requests. + +```Swift + func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) { + let extensionCreationInfo: BackgroundExtensionSessionCreationInfo = .init(defaultInfo: .init( + backgroundSessionIdentifier: "", + sharedContainerIdentifier: "" + )) + + DropboxClientsManager.handleEventsForBackgroundURLSession( + with: identifier, + creationInfos: [extensionCreationInfo], + completionHandler: completionHandler, + requestsToReconnect: { requestResults in + processReconnect(requestResults: RequestResults) + } + ) + } +``` + +#### Debugging +Background sessions are difficult to debug. Both simulators and the Xcode debugger will cause the application to behave in meaningfully different ways–verification of correct reconnection behavior should always take place on a physical device without the debugger connected. Logs to console can be viewed via Xcode -> Window -> Devices and Simulators and are a good bet for gaining insights here. Force quitting the application will disqualify it from continuing to do work in the background. + +For a good discussion of this, see https://developer.apple.com/forums/thread/14855. + +#### Persistence +SwiftyDropbox tracks state and orchestrates reconnection by writing a JSON string to `URLSessionTask.taskDescription` a property that `URLSession` itself persists across app sessions. + +Above, in Customizing Requests, is an example of the ability of a client of SwiftyDropbox to persist its own arbitrary strings alongside SwiftyDropbox's private use of this field. This could be useful for storing the information needed to reconstruct a completion handler for a task after reconnection. + +Depending on the needs of the application, this lightweight solution may be insufficient persistent bookkeeping, and the application may build independate private persistence mapping state to an id stored on the request. This could be useful in the event that a failure occurs where URLSession itself has lost track of the transfer and it must be recreated. + +See https://developer.apple.com/forums/thread/11554 for further discussion. + --- + ### `DropboxClientsManager` class The Swift SDK includes a convenience class, `DropboxClientsManager`, for integrating the different functions of the SDK into one class. @@ -801,6 +943,197 @@ The `DropboxClient` (or `DropboxTeamClient`) is then used to make all of the des * On `DropboxClientsManager` call `resetClients` to logout Dropbox user but not clear any access tokens * if specific access tokens need to be removed, use the `clearStoredAccessToken` method in `DropboxOAuthManager` +--- +## Objective-C + +If you need to interact with the Dropbox SDK in Objective-C code there is an Objective-C compatibility layer for the SDK that can be used. + +### Objective-C Compatibility Layer Distribution + +#### Swift Package Manager + +The Objective-C compatibility layer is in the same package outlined in [SDK distribution](#sdk-distribution). After adding the package you will see a target named `SwiftyDropboxObjC` that can be added in the same way as the Swift SDK and used in its place. + +#### Cocoapods + +For cocoapods, in your Podfile, simply specify `SwiftyDropboxObjC` instead of (or in addition to) `SwiftyDropbox`. + +```ruby +use_frameworks! + +target '' do + pod 'SwiftyDropboxObjC', '~> 10.0.0-beta.3' +end +``` + +### Using the Objective-C Compatbility Layer + +The Objective-C interface was built to mimic the Swift interface as closely as possible while still maintaining good Objective-C patterns and practices (for example full verbose names instead of the namespacing relied on in Swift). Other than the naming and some other small tweaks to accomodate Objective-C the usage of the SDK should be extremely similar in both languages, thus the instructions above should apply even when in Objective-C. + +An example of the differences between Swift and Objective-C: + +Swift: +```Swift +import SwiftyDropbox + +let userSelectArg = Team.UserSelectorArg.email("some@email.com") +DropboxClientsManager.team.membersGetInfo(members: [userSelectArg]).response { response, error in + if let result = response { + // Handle result + } else { + // Handle error + } +} +``` + +Objective-C: +```objc +@import SwiftyDropboxObjC; + +DBXTeamUserSelectorArgEmail *selector = [[DBXTeamUserSelectorArgEmail alloc] init:@"some@email.com"] +[[DBXDropboxClientsManager.authorizedTeamClient.team membersGetInfoWithMembers:@[selector]] responseWithCompletionHandler:^(NSArray * _Nullable result, DBXTeamMembersGetInfoError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + // Handle result + } else { + // Handle error + } +}]; +``` + +### Migrating from dropbox-sdk-obj-c + +If you previously integrated with [dropbox-sdk-obj-c](https://github.com/dropbox/dropbox-sdk-obj-c) migrating to the Swift SDK + Objective-C layer will require code changes but they should be relatively straight forward in most cases. + +In order to maintain as consistent of an interface between Swift and Objective-C as possible in this SDK the interface did have to differ slightly from [dropbox-sdk-obj-c](https://github.com/dropbox/dropbox-sdk-obj-c). The primary differences are as follows: + +1.) Type names are derived from SwiftyDropbox types prefixed with DBX. There are generally some differences in naming from dropbox-sdk-obj-c, and with Swift's more granular access control some previously accessbile types are now internal to the SDK only. See [Common type migration reference](#common-type-migration-reference). + +2.) Some function names have changed slightly to be more verbose about arguments and/or to better match the Swift interface. In the following example note `createFolderV2` vs `createFolderV2WithPath` and `responseWithCompletionHandler` vs `setResponseBlock`: + +dropbox-sdk-obj-c: +```objc +[[[DBClientsManager authorizedClient].filesRoutes createFolderV2:@"/some/folder/path"] + setResponseBlock:^(DBFILESCreateFolderResult * _Nullable result, DBFILESCreateFolderError * _Nullable routeError, DBRequestError * _Nullable networkError) { + // Handle response +}]; +``` +SwiftyDropboxObjC: + +```objc +[[DBXDropboxClientsManager.authorizedClient.files createFolderV2WithPath:@"some/folder/path"] responseWithCompletionHandler:^(DBXFilesCreateFolderResult * _Nullable result, DBXFilesCreateFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + // Handle response +}]; +``` + +3.) Capitalization has changed on many classes. + +dropbox-sdk-obj-c: +`DBUSERSBasicAccount` + +SwiftyDropboxObjC: +`DBXUsersBasicAccount` + +4.) Representation of enums that are passed to or returned from the server are now explicitly typed in the class name: + +dropbox-sdk-obj-c: + +```objc +DBTEAMUserSelectorArg *userSelectArg = [[DBTEAMUserSelectorArg alloc] initWithEmail:@"some@email.com"]; +``` +SwiftyDropboxObjC: + +```objc +DBXTeamUserSelectorArgEmail *userSelectArg = [[DBXTeamUserSelectorArgEmail alloc] init:@"some@email.com"]; +``` + +5.) When working with tasks you no longer need to manually `start` the tasks. They are automatically started on creation. + +6.) SwiftyDropbox relies on generics for typed completion handlers on Requests. This is not bridgeable to Objective-C. Instead, for each route there is an additional Request type with the correctly typed completion handler. E.g., `DownloadRequestFile` is represented in Objective-C as `DBXFilesDownloadDownloadRequestFile`. + +### Common type migration reference +| dropbox-sdk-objc-c | SwiftyDropbox | SwiftyDropboxObjC | +|------------------------------------------------|-------------------------------|------------------------------------------------------------| +| DBAppClient | DropboxAppClient | DBXDropboxAppBase | +| DBClientsManager | DropboxClientsManager | DBXDropboxClientsManager | +| DBTeamClient | DropboxTeamClient | DBXDropboxTeamClient | +| DBUserClient | DropboxClient | DBXDropboxClient | +| DBRequestErrors | CallError | DBXCallError | +| DBRpcTask | RpcRequest | DBXRpcRequest | +| DBUploadTask | UploadRequest | DBXUploadRequest | +| DBDownloadUrlTask | DownloadRequestFile | DBXDownloadRequestFile | +| DBDownloadDataTask | DownloadRequestMemory | DBXDownloadRequestMemory | +| DBTransportBaseClient/DBTransportDefaultClient | DropboxTransportClientImpl | DBXDropboxTransportClient | +| DBTransportBaseHostnameConfig | BaseHosts | DBXBaseHosts | +| DBAccessTokenProvider | AccessTokenProvider | DBXAccessTokenProvider | +| DBLongLivedAccessTokenProvider | LongLivedAccessTokenProvider | DBXLongLivedAccessTokenProvider | +| DBShortLivedAccessTokenProvider | ShortLivedAccessTokenProvider | DBXShortLivedAccessTokenProvider | +| DBLoadingStatusDelegate | LoadingStatusDelegate | DBXLoadingStatusDelegate | +| DBOAuthManager | DropboxOAuthManager | DBXDropboxOAuthManager | +| DBAccessToken | DropboxAccessToken | DBXDropboxAccessToken | +| DBAccessTokenRefreshing | AccessTokenRefreshing | DBXAccessTokenRefreshing | +| DBOAuthResult | DropboxOAuthResult | DBXDropboxOAuthResult | +| DBOAuthResultCompletion | DropboxOAuthCompletion | (DBXDropboxOAuthResult?) -> Void | +| DBScopeRequest | ScopeRequest | DBXScopeRequest | +| DBSDKKeychain | SecureStorageAccess | DBXSecureStorageAccess / DBXSecureStorageAccessDefaultImpl | +| DBDelegate | n/a | n/a | +| DBGlobalErrorResponseHandler | n/a | n/a | +| DBSDKReachability | n/a | n/a | +| DBSessionData | n/a | n/a | +| DBTransportDefaultConfig | n/a | n/a | +| DBURLSessionTaskResponseBlockWrapper | n/a | n/a | +| DBURLSessionTaskWithTokenRefresh | n/a | n/a | +| DBOAuthPKCESession | n/a | n/a | +| DBOAuthTokenRequest | n/a | n/a | + +--- + +## Changes in version 10.0.0 + +Version 10.0.0 of SwiftyDropbox differs significantly from version 9.2.0. It aims to support Objective-C, remove AlamoFire as a dependency, support background networking, replace fatal errors during serialization, add unit tests, and better support testing. + +These additional features are the greatest differences, but even simple upgrades that don't utilize these new features should consider the other notable changes. + +- The destination to which a file is downloaded must now be specified at the time of the call. It's no longer possible to provide a closure that is evaluated after the request is complete. + +- The older API for SSL certificate pinning, provided through AlamoFire, is no longer available. This version exposes the URLSession authentication challenge API. Additionally, the optional SessionDelegate from the previous version of the SDK has been removed without a direct replacement. If your workflows relied on these specific features in ways that are no longer implementable, please [inform us](https://github.com/dropbox/SwiftyDropbox/issues) so that we can better understand and address any potential issues. + +- Serialization inconsistencies that used to cause fatal errors now are represented as errors piped through to the requests' completion handlers. It is up to the calling app to decide how to handle them. + +- Carthage is no longer supported, please use Swift Package Manager or Cocoapods. + +- SDK classes can no longer be subclassed. If this disrupts your usage, please [let us know](https://github.com/dropbox/SwiftyDropbox/issues). + +- Due to the extensive nature of the rewrite and the introduction of new features in the new version of the SDK, when transitioning to the new version of the SDK it is important to perform thorough testing of your codebase. The significant changes and enhancements in the new version of the SDK may introduce subtle behavioral changes or edge cases that were not present in the previous version of the SDK. + +### New Features + +For notes on Objective-C support see [Migrating from dropbox-sdk-obj-c](#migrating-from-dropbox-sdk-obj-c) + +The SDK's background networking support simplifies the reconnection of completion handlers to URLSession tasks. See [`TestSwiftyDropbox/DebugBackgroundSessionViewModel`](https://github.com/dropbox/SwiftyDropbox/tree/branch_10.0.0-beta/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS) for code that exercises various background networking scenarios. See [`TestSwiftDropbox/ActionRequestHandler`](https://github.com/dropbox/SwiftyDropbox/blob/branch_10.0.0-beta/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/ActionRequestHandler.swift) for usage from an app extension. + +### Testing Support + +Initialize a `DropboxClient` with a `MockDropboxTransportClient` to facillitate route response mocking in tests. Supply this client to your code under test, excercise the code, then pipe in responses as illustrated below and assert against your code's behavior. + +``` +let transportClient = MockDropboxTransportClient() + +let client = DropboxClient( + transportClient: transportClient +) + +let feature = SystemUnderTest(client: client) + +let json: [String: Any] = ["fileNames": ["first"]] + +let request = transportClient.getLastRequest() + +request.handleMockInput(.success(json: json)) + +XCTAssert(, ) + +``` + --- ## Examples @@ -843,6 +1176,8 @@ To ensure your changes have not broken any existing functionality, you can run a * open AppDelegate.swift and replace "FULL_DROPBOX_APP_KEY" with the App key as well * run the test app on your device and follow the on-screen instructions +To run and develop against the unit tests instead of the integration tests, open the root of the cloned repository in Xcode. Please run the integration tests after development. + --- ## App Store Connect Privacy Labels diff --git a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/Info.plist b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/Info.plist index ccb923d7e..5cad0e331 100644 --- a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/Info.plist +++ b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 9.2.0 + 10.0.0-beta.3 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/LoadingViewController.swift b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/LoadingViewController.swift index e0ddaffd8..e96979608 100644 --- a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/LoadingViewController.swift +++ b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/LoadingViewController.swift @@ -15,7 +15,7 @@ class LoadingViewController: UIViewController { if #available(iOS 13.0, *) { loadingSpinner = UIActivityIndicatorView(style: .large) } else { - loadingSpinner = UIActivityIndicatorView(style: .whiteLarge) + self.loadingSpinner = UIActivityIndicatorView(style: .whiteLarge) } super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) } @@ -31,7 +31,7 @@ class LoadingViewController: UIViewController { loadingSpinner.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ loadingSpinner.centerXAnchor.constraint(equalTo: view.centerXAnchor), - loadingSpinner.centerYAnchor.constraint(equalTo: view.centerYAnchor) + loadingSpinner.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) loadingSpinner.startAnimating() } diff --git a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/OAuthMobile.swift b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/OAuthMobile.swift index 9fecd30b9..459e51fc2 100644 --- a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/OAuthMobile.swift +++ b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/OAuthMobile.swift @@ -2,9 +2,10 @@ /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// +import Foundation + #if os(iOS) -import Foundation import SafariServices import UIKit import WebKit @@ -20,11 +21,20 @@ extension DropboxClientsManager { /// - sharedApplication: The shared UIApplication instance in your app. /// - controller: A UIViewController to present the auth flow from. Reference is weakly held. /// - openURL: Handler to open a URL. - @available(*, deprecated, message: "This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerV2` instead.") - public static func authorizeFromController(_ sharedApplication: UIApplication, - controller: UIViewController?, - openURL: @escaping ((URL) -> Void)) { - precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method") + @available( + *, + deprecated, + message: "This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerV2` instead." + ) + public static func authorizeFromController( + _ sharedApplication: UIApplication, + controller: UIViewController?, + openURL: @escaping ((URL) -> Void) + ) { + precondition( + DropboxOAuthManager.sharedOAuthManager != nil, + "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method" + ) let sharedMobileApplication = MobileSharedApplication(sharedApplication: sharedApplication, controller: controller, openURL: openURL) MobileSharedApplication.sharedMobileApplication = sharedMobileApplication DropboxOAuthManager.sharedOAuthManager.authorizeFromSharedApplication(sharedMobileApplication) @@ -54,43 +64,238 @@ extension DropboxClientsManager { /// API clients set up by `DropboxClientsManager` will get token refresh logic for free. /// If you need to set up `DropboxClient`/`DropboxTeamClient` without `DropboxClientsManager`, /// you will have to set up the clients with an appropriate `AccessTokenProvider`. - public static func authorizeFromControllerV2(_ sharedApplication: UIApplication, - controller: UIViewController?, - loadingStatusDelegate: LoadingStatusDelegate?, - openURL: @escaping ((URL) -> Void), - scopeRequest: ScopeRequest? + public static func authorizeFromControllerV2( + _ sharedApplication: UIApplication, + controller: UIViewController?, + loadingStatusDelegate: LoadingStatusDelegate?, + openURL: @escaping ((URL) -> Void), + scopeRequest: ScopeRequest? ) { - precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method") + precondition( + DropboxOAuthManager.sharedOAuthManager != nil, + "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method" + ) let sharedMobileApplication = MobileSharedApplication(sharedApplication: sharedApplication, controller: controller, openURL: openURL) sharedMobileApplication.loadingStatusDelegate = loadingStatusDelegate MobileSharedApplication.sharedMobileApplication = sharedMobileApplication DropboxOAuthManager.sharedOAuthManager.authorizeFromSharedApplication(sharedMobileApplication, usePKCE: true, scopeRequest: scopeRequest) } - public static func setupWithAppKey(_ appKey: String, transportClient: DropboxTransportClient? = nil) { - setupWithOAuthManager(appKey, oAuthManager: DropboxMobileOAuthManager(appKey: appKey), transportClient: transportClient) - } - - public static func setupWithAppKeyMultiUser(_ appKey: String, transportClient: DropboxTransportClient? = nil, tokenUid: String?) { - setupWithOAuthManagerMultiUser(appKey, oAuthManager: DropboxMobileOAuthManager(appKey: appKey), transportClient: transportClient, tokenUid: tokenUid) - } - - public static func setupWithTeamAppKey(_ appKey: String, transportClient: DropboxTransportClient? = nil) { - setupWithOAuthManagerTeam(appKey, oAuthManager: DropboxMobileOAuthManager(appKey: appKey), transportClient: transportClient) + public static func setupWithAppKey( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + backgroundTransportClient: DropboxTransportClient? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: RequestsToReconnect? = nil + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: backgroundTransportClient, + oauthSetupIntent: .init(userKind: .single, isTeam: false, includeBackgroundClient: includeBackgroundClient), + requestsToReconnect: requestsToReconnect + ) + } + + public static func setupWithAppKey( + _ appKey: String, + sessionConfiguration: NetworkSessionConfiguration?, + backgroundSessionConfiguration: NetworkSessionConfiguration?, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: RequestsToReconnect? = nil + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + sessionConfiguration: sessionConfiguration, + backgroundSessionConfiguration: backgroundSessionConfiguration, + oauthSetupIntent: .init(userKind: .single, isTeam: false, includeBackgroundClient: includeBackgroundClient), + requestsToReconnect: requestsToReconnect + ) + } + + public static func setupWithAppKey( + _ appKey: String, + backgroundSessionIdentifier: String, + sharedContainerIdentifier: String? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + requestsToReconnect: @escaping RequestsToReconnect + ) { + let backgroundNetworkSessionConfiguration = NetworkSessionConfiguration.background( + withIdentifier: backgroundSessionIdentifier, + sharedContainerIdentifier: sharedContainerIdentifier + ) + setupWithAppKey( + appKey, + sessionConfiguration: nil, + backgroundSessionConfiguration: backgroundNetworkSessionConfiguration, + secureStorageAccess: secureStorageAccess, + includeBackgroundClient: true, + requestsToReconnect: requestsToReconnect + ) + } + + public static func setupWithAppKeyMultiUser( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + backgroundTransportClient: DropboxTransportClient? = nil, + tokenUid: String?, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: RequestsToReconnect? = nil + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: backgroundTransportClient, + oauthSetupIntent: .init(userKind: .multi(tokenUid: tokenUid), isTeam: false, includeBackgroundClient: includeBackgroundClient), + requestsToReconnect: requestsToReconnect + ) + } + + public static func setupWithAppKeyMultiUser( + _ appKey: String, + sessionConfiguration: NetworkSessionConfiguration?, + backgroundSessionConfiguration: NetworkSessionConfiguration?, + tokenUid: String?, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: RequestsToReconnect? = nil + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + sessionConfiguration: sessionConfiguration, + backgroundSessionConfiguration: backgroundSessionConfiguration, + oauthSetupIntent: .init(userKind: .multi(tokenUid: tokenUid), isTeam: false, includeBackgroundClient: includeBackgroundClient), + requestsToReconnect: requestsToReconnect + ) + } + + public static func setupWithAppKeyMultiUser( + _ appKey: String, + backgroundSessionIdentifier: String, + sharedContainerIdentifier: String? = nil, + tokenUid: String?, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + requestsToReconnect: @escaping RequestsToReconnect + ) { + let backgroundNetworkSessionConfiguration = NetworkSessionConfiguration.background( + withIdentifier: backgroundSessionIdentifier, + sharedContainerIdentifier: sharedContainerIdentifier + ) + setupWithAppKeyMultiUser( + appKey, + sessionConfiguration: nil, + backgroundSessionConfiguration: backgroundNetworkSessionConfiguration, + tokenUid: tokenUid, + secureStorageAccess: secureStorageAccess, + includeBackgroundClient: true, + requestsToReconnect: requestsToReconnect + ) + } + + public static func setupWithTeamAppKey( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl() + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: nil, + oauthSetupIntent: .init(userKind: .single, isTeam: true, includeBackgroundClient: false) + ) + } + + public static func setupWithTeamAppKey( + _ appKey: String, + sessionConfiguration: NetworkSessionConfiguration?, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl() + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + sessionConfiguration: sessionConfiguration, + oauthSetupIntent: .init(userKind: .single, isTeam: true, includeBackgroundClient: false) + ) + } + + public static func setupWithTeamAppKeyMultiUser( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: nil, + oauthSetupIntent: .init(userKind: .multi(tokenUid: tokenUid), isTeam: true, includeBackgroundClient: false) + ) + } + + public static func setupWithTeamAppKeyMultiUser( + _ appKey: String, + sessionConfiguration: NetworkSessionConfiguration?, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + setupWithOAuthManager( + appKey, + oAuthManager: oAuthManager(appKey, secureStorageAccess: secureStorageAccess), + sessionConfiguration: sessionConfiguration, + oauthSetupIntent: .init(userKind: .multi(tokenUid: tokenUid), isTeam: true, includeBackgroundClient: false) + ) } - public static func setupWithTeamAppKeyMultiUser(_ appKey: String, transportClient: DropboxTransportClient? = nil, tokenUid: String?) { - setupWithOAuthManagerMultiUserTeam(appKey, oAuthManager: DropboxMobileOAuthManager(appKey: appKey), transportClient: transportClient, tokenUid: tokenUid) + private static func oAuthManager(_ appKey: String, secureStorageAccess: SecureStorageAccess) -> DropboxMobileOAuthManager { + .init(appKey: appKey, secureStorageAccess: secureStorageAccess, dismissSharedAppAuthController: { + if let sharedMobileApplication = MobileSharedApplication.sharedMobileApplication { + sharedMobileApplication.dismissAuthController() + } + }) } } -open class DropboxMobileOAuthManager: DropboxOAuthManager { +#endif + +public class DropboxMobileOAuthManager: DropboxOAuthManager { let dauthRedirectURL: URL - - public override init(appKey: String, host: String) { + let dismissSharedAppAuthController: () -> Void + + public convenience init( + appKey: String, + host: String = "www.dropbox.com", + secureStorageAccess: SecureStorageAccess, + dismissSharedAppAuthController: @escaping () -> Void + ) { + self.init( + appKey: appKey, + host: host, + secureStorageAccess: secureStorageAccess, + networkSession: URLSession(configuration: .default), + dismissSharedAppAuthController: dismissSharedAppAuthController + ) + } + + init( + appKey: String, + host: String = "www.dropbox.com", + secureStorageAccess: SecureStorageAccess, + networkSession: NetworkSession, + dismissSharedAppAuthController: @escaping () -> Void + ) { self.dauthRedirectURL = URL(string: "db-\(appKey)://1/connect")! - super.init(appKey: appKey, host:host) - self.urls.append(self.dauthRedirectURL) + self.dismissSharedAppAuthController = dismissSharedAppAuthController + super.init(appKey: appKey, host: host, secureStorageAccess: secureStorageAccess, networkSession: networkSession) + urls.append(dauthRedirectURL) } internal override func extractFromUrl(_ url: URL, completion: @escaping DropboxOAuthCompletion) { @@ -100,15 +305,16 @@ open class DropboxMobileOAuthManager: DropboxOAuthManager { extractFromRedirectURL(url, completion: completion) } } - + internal override func checkAndPresentPlatformSpecificAuth(_ sharedApplication: SharedApplication) -> Bool { - if !self.hasApplicationQueriesSchemes() { - let message = "DropboxSDK: unable to link; app isn't registered to query for URL schemes dbapi-2 and dbapi-8-emm. Add a dbapi-2 entry and a dbapi-8-emm entry to LSApplicationQueriesSchemes" + if !hasApplicationQueriesSchemes() { + let message = + "DropboxSDK: unable to link; app isn't registered to query for URL schemes dbapi-2 and dbapi-8-emm. Add a dbapi-2 entry and a dbapi-8-emm entry to LSApplicationQueriesSchemes" let title = "SwiftyDropbox Error" sharedApplication.presentErrorMessage(message, title: title) return true } - + if let scheme = dAuthScheme(sharedApplication) { let url: URL if let authSession = authSession { @@ -125,12 +331,10 @@ open class DropboxMobileOAuthManager: DropboxOAuthManager { } return false } - + open override func handleRedirectURL(_ url: URL, completion: @escaping DropboxOAuthCompletion) -> Bool { - super.handleRedirectURL(url, completion: { - if let sharedMobileApplication = MobileSharedApplication.sharedMobileApplication { - sharedMobileApplication.dismissAuthController() - } + super.handleRedirectURL(url, completion: { [weak self] in + self?.dismissSharedAppAuthController() completion($0) }) } @@ -167,7 +371,7 @@ open class DropboxMobileOAuthManager: DropboxOAuthManager { ] return components } - + fileprivate func dAuthScheme(_ sharedApplication: SharedApplication) -> String? { if sharedApplication.canPresentExternalApp(dAuthURL("dbapi-2", nonce: nil)) { return "dbapi-2" @@ -177,7 +381,7 @@ open class DropboxMobileOAuthManager: DropboxOAuthManager { return nil } } - + func extractfromDAuthURL(_ url: URL, completion: @escaping DropboxOAuthCompletion) { switch url.path { case "/connect": @@ -225,7 +429,7 @@ open class DropboxMobileOAuthManager: DropboxOAuthManager { if let code = parametersMap[OAuthConstants.oauthCodeKey] { authCode = code } else if parametersMap[OAuthConstants.oauthTokenKey] == "oauth2code:", - let code = parametersMap[OAuthConstants.oauthSecretKey] { + let code = parametersMap[OAuthConstants.oauthSecretKey] { authCode = code } else { authCode = nil @@ -253,17 +457,17 @@ open class DropboxMobileOAuthManager: DropboxOAuthManager { let parametersMap = OAuthUtils.extractDAuthResponseFromUrl(url) let state = parametersMap[OAuthConstants.stateKey] if let nonce = UserDefaults.standard.object(forKey: kDBLinkNonce) as? String, state == "oauth2:\(nonce)", - let accessToken = parametersMap[OAuthConstants.oauthSecretKey], - let uid = parametersMap[OAuthConstants.uidKey] { + let accessToken = parametersMap[OAuthConstants.oauthSecretKey], + let uid = parametersMap[OAuthConstants.uidKey] { return .success(DropboxAccessToken(accessToken: accessToken, uid: uid)) } else { return .error(.unknown, "Unable to verify link request") } } - + fileprivate func hasApplicationQueriesSchemes() -> Bool { let queriesSchemes = Bundle.main.object(forInfoDictionaryKey: "LSApplicationQueriesSchemes") as? [String] ?? [] - + var foundApi2 = false var foundApi8Emm = false for scheme in queriesSchemes { @@ -298,12 +502,14 @@ open class DropboxMobileOAuthManager: DropboxOAuthManager { } } -open class MobileSharedApplication: SharedApplication { +#if os(iOS) + +public class MobileSharedApplication: SharedApplication { public static var sharedMobileApplication: MobileSharedApplication? let sharedApplication: UIApplication weak var controller: UIViewController? - let openURL: ((URL) -> Void) + let openURL: (URL) -> Void weak var loadingStatusDelegate: LoadingStatusDelegate? @@ -323,29 +529,31 @@ open class MobileSharedApplication: SharedApplication { } } - open func presentErrorMessage(_ message: String, title: String) { + public func presentErrorMessage(_ message: String, title: String) { let alertController = UIAlertController( title: title, message: message, - preferredStyle: UIAlertController.Style.alert) + preferredStyle: UIAlertController.Style.alert + ) if let controller = controller { controller.present(alertController, animated: true, completion: { fatalError(message) }) } } - open func presentErrorMessageWithHandlers(_ message: String, title: String, buttonHandlers: Dictionary Void>) { + public func presentErrorMessageWithHandlers(_ message: String, title: String, buttonHandlers: [String: () -> Void]) { let alertController = UIAlertController( title: title, message: message, - preferredStyle: UIAlertController.Style.alert) + preferredStyle: UIAlertController.Style.alert + ) - alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel) { (_) in + alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel) { _ in if let handler = buttonHandlers["Cancel"] { handler() } }) - alertController.addAction(UIAlertAction(title: "Retry", style: .default) { (_) in + alertController.addAction(UIAlertAction(title: "Retry", style: .default) { _ in if let handler = buttonHandlers["Retry"] { handler() } @@ -356,28 +564,28 @@ open class MobileSharedApplication: SharedApplication { } } - open func presentPlatformSpecificAuth(_ authURL: URL) -> Bool { + public func presentPlatformSpecificAuth(_ authURL: URL) -> Bool { presentExternalApp(authURL) return true } - open func presentAuthChannel(_ authURL: URL, tryIntercept: @escaping ((URL) -> Bool), cancelHandler: @escaping (() -> Void)) { - if let controller = self.controller { + public func presentAuthChannel(_ authURL: URL, tryIntercept: @escaping ((URL) -> Bool), cancelHandler: @escaping (() -> Void)) { + if let controller = controller { let safariViewController = MobileSafariViewController(url: authURL, cancelHandler: cancelHandler) controller.present(safariViewController, animated: true, completion: nil) } } - open func presentExternalApp(_ url: URL) { - self.openURL(url) + public func presentExternalApp(_ url: URL) { + openURL(url) } - open func canPresentExternalApp(_ url: URL) -> Bool { - return self.sharedApplication.canOpenURL(url) + public func canPresentExternalApp(_ url: URL) -> Bool { + sharedApplication.canOpenURL(url) } - open func dismissAuthController() { - if let controller = self.controller { + public func dismissAuthController() { + if let controller = controller { if let presentedViewController = controller.presentedViewController { if presentedViewController.isBeingDismissed == false && presentedViewController is MobileSafariViewController { controller.dismiss(animated: true, completion: nil) @@ -403,7 +611,7 @@ open class MobileSharedApplication: SharedApplication { } private var isWebOAuthFlow: Bool { - return controller?.presentedViewController is MobileSafariViewController + controller?.presentedViewController is MobileSafariViewController } /// Web OAuth flow, present the spinner over the MobileSafariViewController. @@ -444,7 +652,7 @@ open class MobileSharedApplication: SharedApplication { } } -open class MobileSafariViewController: SFSafariViewController, SFSafariViewControllerDelegate { +public class MobileSafariViewController: SFSafariViewController, SFSafariViewControllerDelegate { var cancelHandler: (() -> Void) = {} public init(url: URL, cancelHandler: @escaping (() -> Void)) { @@ -456,19 +664,18 @@ open class MobileSafariViewController: SFSafariViewController, SFSafariViewContr super.init(url: url, entersReaderIfAvailable: false) } self.cancelHandler = cancelHandler - self.delegate = self; + self.delegate = self } public func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) { - if (!didLoadSuccessfully) { + if !didLoadSuccessfully { controller.dismiss(animated: true, completion: nil) } } public func safariViewControllerDidFinish(_ controller: SFSafariViewController) { - self.cancelHandler() + cancelHandler() } - } #endif diff --git a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/UtilitiesMobile.swift b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/UtilitiesMobile.swift index 502ce0414..c469f1065 100644 --- a/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/UtilitiesMobile.swift +++ b/Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/UtilitiesMobile.swift @@ -10,11 +10,11 @@ import UIKit @available(iOS 13.0, *) extension UIApplication { public func findKeyWindow() -> UIWindow? { - return connectedScenes - .filter({$0.activationState == .foregroundActive}) - .compactMap({$0 as? UIWindowScene}) + connectedScenes + .filter({ $0.activationState == .foregroundActive }) + .compactMap({ $0 as? UIWindowScene }) .first?.windows - .filter({$0.isKeyWindow}).first + .filter(\.isKeyWindow).first } } diff --git a/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/Info.plist b/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/Info.plist index bd8c6f49c..3e84d4ccf 100644 --- a/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/Info.plist +++ b/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 9.2.0 + 10.0.0-beta.3 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright diff --git a/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/OAuthDesktop.swift b/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/OAuthDesktop.swift index e0071c587..e7b65d27b 100644 --- a/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/OAuthDesktop.swift +++ b/Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/OAuthDesktop.swift @@ -4,8 +4,8 @@ #if os(macOS) -import Foundation import AppKit +import Foundation import WebKit extension DropboxClientsManager { @@ -18,11 +18,20 @@ extension DropboxClientsManager { /// - sharedApplication: The shared NSApplication instance in your app. /// - controller: An NSViewController to present the auth flow from. Reference is weakly held. /// - openURL: Handler to open a URL. - @available(*, deprecated, message: "This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerV2` instead.") - public static func authorizeFromController(sharedApplication: NSApplication, - controller: NSViewController?, - openURL: @escaping ((URL) -> Void)) { - precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method") + @available( + *, + deprecated, + message: "This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerV2` instead." + ) + public static func authorizeFromController( + sharedApplication: NSApplication, + controller: NSViewController?, + openURL: @escaping ((URL) -> Void) + ) { + precondition( + DropboxOAuthManager.sharedOAuthManager != nil, + "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method" + ) let sharedDesktopApplication = DesktopSharedApplication(sharedApplication: sharedApplication, controller: controller, openURL: openURL) DesktopSharedApplication.sharedDesktopApplication = sharedDesktopApplication DropboxOAuthManager.sharedOAuthManager.authorizeFromSharedApplication(sharedDesktopApplication) @@ -37,7 +46,7 @@ extension DropboxClientsManager { /// code_verifier, which is stored inside this SDK. /// /// - Parameters: - /// - sharedApplication: The shared NSApplication instance in your app. + /// - sharedApplication: The shared NSWorkspace instance in your app. /// - controller: An NSViewController to present the auth flow from. Reference is weakly held. /// - loadingStatusDelegate: An optional delegate to handle loading experience during auth flow. /// e.g. Show a loading spinner and block user interaction while loading/waiting. @@ -51,13 +60,17 @@ extension DropboxClientsManager { /// API clients set up by `DropboxClientsManager` will get token refresh logic for free. /// If you need to set up `DropboxClient`/`DropboxTeamClient` without `DropboxClientsManager`, /// you will have to set up the clients with an appropriate `AccessTokenProvider`. - public static func authorizeFromControllerV2(sharedApplication: NSApplication, - controller: NSViewController?, - loadingStatusDelegate: LoadingStatusDelegate?, - openURL: @escaping ((URL) -> Void), - scopeRequest: ScopeRequest? + public static func authorizeFromControllerV2( + sharedApplication: NSApplication, + controller: NSViewController?, + loadingStatusDelegate: LoadingStatusDelegate?, + openURL: @escaping ((URL) -> Void), + scopeRequest: ScopeRequest? ) { - precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method") + precondition( + DropboxOAuthManager.sharedOAuthManager != nil, + "Call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` before calling this method" + ) let sharedDesktopApplication = DesktopSharedApplication(sharedApplication: sharedApplication, controller: controller, openURL: openURL) sharedDesktopApplication.loadingStatusDelegate = loadingStatusDelegate @@ -69,37 +82,77 @@ extension DropboxClientsManager { ) } - public static func setupWithAppKeyDesktop(_ appKey: String, transportClient: DropboxTransportClient? = nil) { - setupWithOAuthManager(appKey, oAuthManager: DropboxOAuthManager(appKey: appKey), transportClient: transportClient) + public static func setupWithAppKeyDesktop( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl() + ) { + setupWithOAuthManager( + appKey, + oAuthManager: DropboxOAuthManager(appKey: appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: nil, + oauthSetupIntent: .init(userKind: .single, isTeam: false, includeBackgroundClient: false) + ) } - public static func setupWithAppKeyMultiUserDesktop(_ appKey: String, transportClient: DropboxTransportClient? = nil, tokenUid: String?) { - setupWithOAuthManagerMultiUser(appKey, oAuthManager: DropboxOAuthManager(appKey: appKey), transportClient: transportClient, tokenUid: tokenUid) + public static func setupWithAppKeyMultiUserDesktop( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + setupWithOAuthManager( + appKey, + oAuthManager: DropboxOAuthManager(appKey: appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: nil, + oauthSetupIntent: .init(userKind: .multi(tokenUid: tokenUid), isTeam: false, includeBackgroundClient: false) + ) } - public static func setupWithTeamAppKeyDesktop(_ appKey: String, transportClient: DropboxTransportClient? = nil) { - setupWithOAuthManagerTeam(appKey, oAuthManager: DropboxOAuthManager(appKey: appKey), transportClient: transportClient) + public static func setupWithTeamAppKeyDesktop( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl() + ) { + setupWithOAuthManager( + appKey, + oAuthManager: DropboxOAuthManager(appKey: appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: nil, + oauthSetupIntent: .init(userKind: .single, isTeam: true, includeBackgroundClient: false) + ) } - public static func setupWithTeamAppKeyMultiUserDesktop(_ appKey: String, transportClient: DropboxTransportClient? = nil, tokenUid: String?) { - setupWithOAuthManagerMultiUserTeam(appKey, oAuthManager: DropboxOAuthManager(appKey: appKey), transportClient: transportClient, tokenUid: tokenUid) + public static func setupWithTeamAppKeyMultiUserDesktop( + _ appKey: String, + transportClient: DropboxTransportClient? = nil, + secureStorageAccess: SecureStorageAccess = SecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + setupWithOAuthManager( + appKey, + oAuthManager: DropboxOAuthManager(appKey: appKey, secureStorageAccess: secureStorageAccess), + transportClient: transportClient, + backgroundTransportClient: nil, + oauthSetupIntent: .init(userKind: .multi(tokenUid: tokenUid), isTeam: true, includeBackgroundClient: false) + ) } } - public class DesktopSharedApplication: SharedApplication { public static var sharedDesktopApplication: DesktopSharedApplication? let sharedApplication: NSApplication weak var controller: NSViewController? - let openURL: ((URL) -> Void) + let openURL: (URL) -> Void weak var loadingStatusDelegate: LoadingStatusDelegate? /// Reference to controller is weakly held. public init(sharedApplication: NSApplication, controller: NSViewController?, openURL: @escaping ((URL) -> Void)) { self.sharedApplication = sharedApplication - self.controller = controller self.openURL = openURL if let controller = controller { @@ -110,31 +163,31 @@ public class DesktopSharedApplication: SharedApplication { } public func presentErrorMessage(_ message: String, title: String) { - let error = NSError(domain: "", code: 123, userInfo: [NSLocalizedDescriptionKey:message]) - if let controller = self.controller { + let error = NSError(domain: "", code: 123, userInfo: [NSLocalizedDescriptionKey: message]) + if let controller = controller { controller.presentError(error) } } - public func presentErrorMessageWithHandlers(_ message: String, title: String, buttonHandlers: Dictionary Void>) { + public func presentErrorMessageWithHandlers(_ message: String, title: String, buttonHandlers: [String: () -> Void]) { presentErrorMessage(message, title: title) } // no platform-specific auth methods for OS X public func presentPlatformSpecificAuth(_ authURL: URL) -> Bool { - return false + false } public func presentAuthChannel(_ authURL: URL, tryIntercept: @escaping ((URL) -> Bool), cancelHandler: @escaping (() -> Void)) { - self.presentExternalApp(authURL) + presentExternalApp(authURL) } public func presentExternalApp(_ url: URL) { - self.openURL(url) + openURL(url) } public func canPresentExternalApp(_ url: URL) -> Bool { - return true + true } public func presentLoading() { diff --git a/Source/SwiftyDropbox/Shared/Generated/Account.swift b/Source/SwiftyDropbox/Shared/Generated/Account.swift index 4afd53df7..ef80d2f50 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Account.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Account.swift @@ -7,83 +7,104 @@ import Foundation /// Datatypes and serializers for the account namespace -open class Account { +public class Account { /// The PhotoSourceArg union - public enum PhotoSourceArg: CustomStringConvertible { + public enum PhotoSourceArg: CustomStringConvertible, JSONRepresentable { /// Image data in base64-encoded bytes. case base64Data(String) /// An unspecified error. case other + func json() throws -> JSON { + try PhotoSourceArgSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PhotoSourceArgSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PhotoSourceArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PhotoSourceArg: \(error)" + } } } - open class PhotoSourceArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PhotoSourceArg) -> JSON { + + public class PhotoSourceArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PhotoSourceArg) throws -> JSON { switch value { - case .base64Data(let arg): - var d = ["base64_data": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("base64_data") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .base64Data(let arg): + var d = try ["base64_data": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("base64_data") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PhotoSourceArg { + + public func deserialize(_ json: JSON) throws -> PhotoSourceArg { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "base64_data": - let v = Serialization._StringSerializer.deserialize(d["base64_data"] ?? .null) - return PhotoSourceArg.base64Data(v) - case "other": - return PhotoSourceArg.other - default: - return PhotoSourceArg.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "base64_data": + let v = try Serialization._StringSerializer.deserialize(d["base64_data"] ?? .null) + return PhotoSourceArg.base64Data(v) + case "other": + return PhotoSourceArg.other default: - fatalError("Failed to deserialize") + return PhotoSourceArg.other + } + default: + throw JSONSerializerError.deserializeError(type: PhotoSourceArg.self, json: json) } } } /// The SetProfilePhotoArg struct - open class SetProfilePhotoArg: CustomStringConvertible { + public class SetProfilePhotoArg: CustomStringConvertible, JSONRepresentable { /// Image to set as the user's new profile photo. public let photo: Account.PhotoSourceArg public init(photo: Account.PhotoSourceArg) { self.photo = photo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SetProfilePhotoArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SetProfilePhotoArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SetProfilePhotoArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SetProfilePhotoArg: \(error)" + } } } - open class SetProfilePhotoArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SetProfilePhotoArg) -> JSON { - let output = [ - "photo": Account.PhotoSourceArgSerializer().serialize(value.photo), + + public class SetProfilePhotoArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SetProfilePhotoArg) throws -> JSON { + let output = [ + "photo": try Account.PhotoSourceArgSerializer().serialize(value.photo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SetProfilePhotoArg { + + public func deserialize(_ json: JSON) throws -> SetProfilePhotoArg { switch json { - case .dictionary(let dict): - let photo = Account.PhotoSourceArgSerializer().deserialize(dict["photo"] ?? .null) - return SetProfilePhotoArg(photo: photo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let photo = try Account.PhotoSourceArgSerializer().deserialize(dict["photo"] ?? .null) + return SetProfilePhotoArg(photo: photo) + default: + throw JSONSerializerError.deserializeError(type: SetProfilePhotoArg.self, json: json) } } } /// The SetProfilePhotoError union - public enum SetProfilePhotoError: CustomStringConvertible { + public enum SetProfilePhotoError: CustomStringConvertible, JSONRepresentable { /// File cannot be set as profile photo. case fileTypeError /// File cannot exceed 10 MB. @@ -97,98 +118,118 @@ open class Account { /// An unspecified error. case other + func json() throws -> JSON { + try SetProfilePhotoErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SetProfilePhotoErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SetProfilePhotoErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SetProfilePhotoError: \(error)" + } } } - open class SetProfilePhotoErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SetProfilePhotoError) -> JSON { + + public class SetProfilePhotoErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SetProfilePhotoError) throws -> JSON { switch value { - case .fileTypeError: - var d = [String: JSON]() - d[".tag"] = .str("file_type_error") - return .dictionary(d) - case .fileSizeError: - var d = [String: JSON]() - d[".tag"] = .str("file_size_error") - return .dictionary(d) - case .dimensionError: - var d = [String: JSON]() - d[".tag"] = .str("dimension_error") - return .dictionary(d) - case .thumbnailError: - var d = [String: JSON]() - d[".tag"] = .str("thumbnail_error") - return .dictionary(d) - case .transientError: - var d = [String: JSON]() - d[".tag"] = .str("transient_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .fileTypeError: + var d = [String: JSON]() + d[".tag"] = .str("file_type_error") + return .dictionary(d) + case .fileSizeError: + var d = [String: JSON]() + d[".tag"] = .str("file_size_error") + return .dictionary(d) + case .dimensionError: + var d = [String: JSON]() + d[".tag"] = .str("dimension_error") + return .dictionary(d) + case .thumbnailError: + var d = [String: JSON]() + d[".tag"] = .str("thumbnail_error") + return .dictionary(d) + case .transientError: + var d = [String: JSON]() + d[".tag"] = .str("transient_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> SetProfilePhotoError { + + public func deserialize(_ json: JSON) throws -> SetProfilePhotoError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "file_type_error": - return SetProfilePhotoError.fileTypeError - case "file_size_error": - return SetProfilePhotoError.fileSizeError - case "dimension_error": - return SetProfilePhotoError.dimensionError - case "thumbnail_error": - return SetProfilePhotoError.thumbnailError - case "transient_error": - return SetProfilePhotoError.transientError - case "other": - return SetProfilePhotoError.other - default: - return SetProfilePhotoError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "file_type_error": + return SetProfilePhotoError.fileTypeError + case "file_size_error": + return SetProfilePhotoError.fileSizeError + case "dimension_error": + return SetProfilePhotoError.dimensionError + case "thumbnail_error": + return SetProfilePhotoError.thumbnailError + case "transient_error": + return SetProfilePhotoError.transientError + case "other": + return SetProfilePhotoError.other default: - fatalError("Failed to deserialize") + return SetProfilePhotoError.other + } + default: + throw JSONSerializerError.deserializeError(type: SetProfilePhotoError.self, json: json) } } } /// The SetProfilePhotoResult struct - open class SetProfilePhotoResult: CustomStringConvertible { + public class SetProfilePhotoResult: CustomStringConvertible, JSONRepresentable { /// URL for the photo representing the user, if one is set. public let profilePhotoUrl: String public init(profilePhotoUrl: String) { stringValidator()(profilePhotoUrl) self.profilePhotoUrl = profilePhotoUrl } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SetProfilePhotoResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try SetProfilePhotoResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SetProfilePhotoResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SetProfilePhotoResult: \(error)" + } } } - open class SetProfilePhotoResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SetProfilePhotoResult) -> JSON { - let output = [ - "profile_photo_url": Serialization._StringSerializer.serialize(value.profilePhotoUrl), + + public class SetProfilePhotoResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SetProfilePhotoResult) throws -> JSON { + let output = [ + "profile_photo_url": try Serialization._StringSerializer.serialize(value.profilePhotoUrl), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SetProfilePhotoResult { + + public func deserialize(_ json: JSON) throws -> SetProfilePhotoResult { switch json { - case .dictionary(let dict): - let profilePhotoUrl = Serialization._StringSerializer.deserialize(dict["profile_photo_url"] ?? .null) - return SetProfilePhotoResult(profilePhotoUrl: profilePhotoUrl) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let profilePhotoUrl = try Serialization._StringSerializer.deserialize(dict["profile_photo_url"] ?? .null) + return SetProfilePhotoResult(profilePhotoUrl: profilePhotoUrl) + default: + throw JSONSerializerError.deserializeError(type: SetProfilePhotoResult.self, json: json) } } } - /// Stone Route Objects static let setProfilePhoto = Route( @@ -199,8 +240,10 @@ open class Account { argSerializer: Account.SetProfilePhotoArgSerializer(), responseSerializer: Account.SetProfilePhotoResultSerializer(), errorSerializer: Account.SetProfilePhotoErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/AccountRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/AccountRoutes.swift index 423f061fb..65e652830 100644 --- a/Source/SwiftyDropbox/Shared/Generated/AccountRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/AccountRoutes.swift @@ -7,22 +7,27 @@ import Foundation /// Routes for the account namespace -open class AccountRoutes { +/// For Objective-C compatible routes see DBAccountRoutes +public class AccountRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Sets a user's profile photo. /// + /// - scope: account_info.write + /// /// - parameter photo: Image to set as the user's new profile photo. /// - /// - returns: Through the response callback, the caller will receive a `Account.SetProfilePhotoResult` object on + /// - returns: Through the response callback, the caller will receive a `Account.SetProfilePhotoResult` object on /// success or a `Account.SetProfilePhotoError` object on failure. - @discardableResult open func setProfilePhoto(photo: Account.PhotoSourceArg) -> RpcRequest { + @discardableResult public func setProfilePhoto( + photo: Account + .PhotoSourceArg + ) -> RpcRequest { let route = Account.setProfilePhoto let serverArgs = Account.SetProfilePhotoArg(photo: photo) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Async.swift b/Source/SwiftyDropbox/Shared/Generated/Async.swift index f823ce658..104a5a876 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Async.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Async.swift @@ -7,206 +7,257 @@ import Foundation /// Datatypes and serializers for the async namespace -open class Async { +public class Async { /// Result returned by methods that launch an asynchronous job. A method who may either launch an asynchronous job, - /// or complete the request synchronously, can use this union by extending it, and adding a 'complete' field with - /// the type of the synchronous response. See LaunchEmptyResult for an example. - public enum LaunchResultBase: CustomStringConvertible { + /// or complete the request synchronously, can use this union by extending it, and adding a 'complete' field + /// with the type of the synchronous response. See LaunchEmptyResult for an example. + public enum LaunchResultBase: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) + func json() throws -> JSON { + try LaunchResultBaseSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LaunchResultBaseSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LaunchResultBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LaunchResultBase: \(error)" + } } } - open class LaunchResultBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LaunchResultBase) -> JSON { + + public class LaunchResultBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LaunchResultBase) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> LaunchResultBase { + + public func deserialize(_ json: JSON) throws -> LaunchResultBase { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return LaunchResultBase.asyncJobId(v) - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return LaunchResultBase.asyncJobId(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: LaunchResultBase.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LaunchResultBase.self, json: json) } } } /// Result returned by methods that may either launch an asynchronous job or complete synchronously. Upon /// synchronous completion of the job, no additional information is returned. - public enum LaunchEmptyResult: CustomStringConvertible { + public enum LaunchEmptyResult: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) /// The job finished synchronously and successfully. case complete + func json() throws -> JSON { + try LaunchEmptyResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LaunchEmptyResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LaunchEmptyResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LaunchEmptyResult: \(error)" + } } } - open class LaunchEmptyResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LaunchEmptyResult) -> JSON { + + public class LaunchEmptyResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LaunchEmptyResult) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete: - var d = [String: JSON]() - d[".tag"] = .str("complete") - return .dictionary(d) + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete: + var d = [String: JSON]() + d[".tag"] = .str("complete") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> LaunchEmptyResult { + + public func deserialize(_ json: JSON) throws -> LaunchEmptyResult { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return LaunchEmptyResult.asyncJobId(v) - case "complete": - return LaunchEmptyResult.complete - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return LaunchEmptyResult.asyncJobId(v) + case "complete": + return LaunchEmptyResult.complete default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: LaunchEmptyResult.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LaunchEmptyResult.self, json: json) } } } /// Arguments for methods that poll the status of an asynchronous job. - open class PollArg: CustomStringConvertible { + public class PollArg: CustomStringConvertible, JSONRepresentable { /// Id of the asynchronous job. This is the value of a response returned from the method that launched the job. public let asyncJobId: String public init(asyncJobId: String) { stringValidator(minLength: 1)(asyncJobId) self.asyncJobId = asyncJobId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PollArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try PollArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PollArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PollArg: \(error)" + } } } - open class PollArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PollArg) -> JSON { - let output = [ - "async_job_id": Serialization._StringSerializer.serialize(value.asyncJobId), + + public class PollArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PollArg) throws -> JSON { + let output = [ + "async_job_id": try Serialization._StringSerializer.serialize(value.asyncJobId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PollArg { + + public func deserialize(_ json: JSON) throws -> PollArg { switch json { - case .dictionary(let dict): - let asyncJobId = Serialization._StringSerializer.deserialize(dict["async_job_id"] ?? .null) - return PollArg(asyncJobId: asyncJobId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let asyncJobId = try Serialization._StringSerializer.deserialize(dict["async_job_id"] ?? .null) + return PollArg(asyncJobId: asyncJobId) + default: + throw JSONSerializerError.deserializeError(type: PollArg.self, json: json) } } } /// Result returned by methods that poll for the status of an asynchronous job. Unions that extend this union should - /// add a 'complete' field with a type of the information returned upon job completion. See PollEmptyResult for an - /// example. - public enum PollResultBase: CustomStringConvertible { + /// add a 'complete' field with a type of the information returned upon job completion. See PollEmptyResult for + /// an example. + public enum PollResultBase: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress + func json() throws -> JSON { + try PollResultBaseSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PollResultBaseSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PollResultBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PollResultBase: \(error)" + } } } - open class PollResultBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PollResultBase) -> JSON { + + public class PollResultBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PollResultBase) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PollResultBase { + + public func deserialize(_ json: JSON) throws -> PollResultBase { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return PollResultBase.inProgress - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return PollResultBase.inProgress default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: PollResultBase.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PollResultBase.self, json: json) } } } /// Result returned by methods that poll for the status of an asynchronous job. Upon completion of the job, no /// additional information is returned. - public enum PollEmptyResult: CustomStringConvertible { + public enum PollEmptyResult: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The asynchronous job has completed successfully. case complete + func json() throws -> JSON { + try PollEmptyResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PollEmptyResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PollEmptyResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PollEmptyResult: \(error)" + } } } - open class PollEmptyResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PollEmptyResult) -> JSON { + + public class PollEmptyResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PollEmptyResult) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete: - var d = [String: JSON]() - d[".tag"] = .str("complete") - return .dictionary(d) + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete: + var d = [String: JSON]() + d[".tag"] = .str("complete") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PollEmptyResult { + + public func deserialize(_ json: JSON) throws -> PollEmptyResult { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return PollEmptyResult.inProgress - case "complete": - return PollEmptyResult.complete - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return PollEmptyResult.inProgress + case "complete": + return PollEmptyResult.complete default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: PollEmptyResult.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PollEmptyResult.self, json: json) } } } /// Error returned by methods for polling the status of asynchronous job. - public enum PollError: CustomStringConvertible { + public enum PollError: CustomStringConvertible, JSONRepresentable { /// The job ID is invalid. case invalidAsyncJobId /// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking @@ -215,46 +266,55 @@ open class Async { /// An unspecified error. case other + func json() throws -> JSON { + try PollErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PollErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PollErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PollError: \(error)" + } } } - open class PollErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PollError) -> JSON { + + public class PollErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PollError) throws -> JSON { switch value { - case .invalidAsyncJobId: - var d = [String: JSON]() - d[".tag"] = .str("invalid_async_job_id") - return .dictionary(d) - case .internalError: - var d = [String: JSON]() - d[".tag"] = .str("internal_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .invalidAsyncJobId: + var d = [String: JSON]() + d[".tag"] = .str("invalid_async_job_id") + return .dictionary(d) + case .internalError: + var d = [String: JSON]() + d[".tag"] = .str("internal_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PollError { + + public func deserialize(_ json: JSON) throws -> PollError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_async_job_id": - return PollError.invalidAsyncJobId - case "internal_error": - return PollError.internalError - case "other": - return PollError.other - default: - return PollError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_async_job_id": + return PollError.invalidAsyncJobId + case "internal_error": + return PollError.internalError + case "other": + return PollError.other default: - fatalError("Failed to deserialize") + return PollError.other + } + default: + throw JSONSerializerError.deserializeError(type: PollError.self, json: json) } } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Auth.swift b/Source/SwiftyDropbox/Shared/Generated/Auth.swift index 10fe43494..0a368008d 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Auth.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Auth.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the auth namespace -open class Auth { +public class Auth { /// Error occurred because the account doesn't have permission to access the resource. - public enum AccessError: CustomStringConvertible { + public enum AccessError: CustomStringConvertible, JSONRepresentable { /// Current account type cannot access the resource. case invalidAccountType(Auth.InvalidAccountTypeError) /// Current account cannot access Paper. @@ -17,52 +17,62 @@ open class Auth { /// An unspecified error. case other + func json() throws -> JSON { + try AccessErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccessErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccessErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccessError: \(error)" + } } } - open class AccessErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccessError) -> JSON { + + public class AccessErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccessError) throws -> JSON { switch value { - case .invalidAccountType(let arg): - var d = ["invalid_account_type": Auth.InvalidAccountTypeErrorSerializer().serialize(arg)] - d[".tag"] = .str("invalid_account_type") - return .dictionary(d) - case .paperAccessDenied(let arg): - var d = ["paper_access_denied": Auth.PaperAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("paper_access_denied") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .invalidAccountType(let arg): + var d = try ["invalid_account_type": Auth.InvalidAccountTypeErrorSerializer().serialize(arg)] + d[".tag"] = .str("invalid_account_type") + return .dictionary(d) + case .paperAccessDenied(let arg): + var d = try ["paper_access_denied": Auth.PaperAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("paper_access_denied") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> AccessError { + + public func deserialize(_ json: JSON) throws -> AccessError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_account_type": - let v = Auth.InvalidAccountTypeErrorSerializer().deserialize(d["invalid_account_type"] ?? .null) - return AccessError.invalidAccountType(v) - case "paper_access_denied": - let v = Auth.PaperAccessErrorSerializer().deserialize(d["paper_access_denied"] ?? .null) - return AccessError.paperAccessDenied(v) - case "other": - return AccessError.other - default: - return AccessError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_account_type": + let v = try Auth.InvalidAccountTypeErrorSerializer().deserialize(d["invalid_account_type"] ?? .null) + return AccessError.invalidAccountType(v) + case "paper_access_denied": + let v = try Auth.PaperAccessErrorSerializer().deserialize(d["paper_access_denied"] ?? .null) + return AccessError.paperAccessDenied(v) + case "other": + return AccessError.other default: - fatalError("Failed to deserialize") + return AccessError.other + } + default: + throw JSONSerializerError.deserializeError(type: AccessError.self, json: json) } } } /// Errors occurred during authentication. - public enum AuthError: CustomStringConvertible { + public enum AuthError: CustomStringConvertible, JSONRepresentable { /// The access token is invalid. case invalidAccessToken /// The user specified in 'Dropbox-API-Select-User' is no longer on the team. @@ -80,81 +90,91 @@ open class Auth { /// An unspecified error. case other + func json() throws -> JSON { + try AuthErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AuthErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AuthErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AuthError: \(error)" + } } } - open class AuthErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AuthError) -> JSON { + + public class AuthErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AuthError) throws -> JSON { switch value { - case .invalidAccessToken: - var d = [String: JSON]() - d[".tag"] = .str("invalid_access_token") - return .dictionary(d) - case .invalidSelectUser: - var d = [String: JSON]() - d[".tag"] = .str("invalid_select_user") - return .dictionary(d) - case .invalidSelectAdmin: - var d = [String: JSON]() - d[".tag"] = .str("invalid_select_admin") - return .dictionary(d) - case .userSuspended: - var d = [String: JSON]() - d[".tag"] = .str("user_suspended") - return .dictionary(d) - case .expiredAccessToken: - var d = [String: JSON]() - d[".tag"] = .str("expired_access_token") - return .dictionary(d) - case .missingScope(let arg): - var d = Serialization.getFields(Auth.TokenScopeErrorSerializer().serialize(arg)) - d[".tag"] = .str("missing_scope") - return .dictionary(d) - case .routeAccessDenied: - var d = [String: JSON]() - d[".tag"] = .str("route_access_denied") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .invalidAccessToken: + var d = [String: JSON]() + d[".tag"] = .str("invalid_access_token") + return .dictionary(d) + case .invalidSelectUser: + var d = [String: JSON]() + d[".tag"] = .str("invalid_select_user") + return .dictionary(d) + case .invalidSelectAdmin: + var d = [String: JSON]() + d[".tag"] = .str("invalid_select_admin") + return .dictionary(d) + case .userSuspended: + var d = [String: JSON]() + d[".tag"] = .str("user_suspended") + return .dictionary(d) + case .expiredAccessToken: + var d = [String: JSON]() + d[".tag"] = .str("expired_access_token") + return .dictionary(d) + case .missingScope(let arg): + var d = try Serialization.getFields(Auth.TokenScopeErrorSerializer().serialize(arg)) + d[".tag"] = .str("missing_scope") + return .dictionary(d) + case .routeAccessDenied: + var d = [String: JSON]() + d[".tag"] = .str("route_access_denied") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> AuthError { + + public func deserialize(_ json: JSON) throws -> AuthError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_access_token": - return AuthError.invalidAccessToken - case "invalid_select_user": - return AuthError.invalidSelectUser - case "invalid_select_admin": - return AuthError.invalidSelectAdmin - case "user_suspended": - return AuthError.userSuspended - case "expired_access_token": - return AuthError.expiredAccessToken - case "missing_scope": - let v = Auth.TokenScopeErrorSerializer().deserialize(json) - return AuthError.missingScope(v) - case "route_access_denied": - return AuthError.routeAccessDenied - case "other": - return AuthError.other - default: - return AuthError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_access_token": + return AuthError.invalidAccessToken + case "invalid_select_user": + return AuthError.invalidSelectUser + case "invalid_select_admin": + return AuthError.invalidSelectAdmin + case "user_suspended": + return AuthError.userSuspended + case "expired_access_token": + return AuthError.expiredAccessToken + case "missing_scope": + let v = try Auth.TokenScopeErrorSerializer().deserialize(json) + return AuthError.missingScope(v) + case "route_access_denied": + return AuthError.routeAccessDenied + case "other": + return AuthError.other default: - fatalError("Failed to deserialize") + return AuthError.other + } + default: + throw JSONSerializerError.deserializeError(type: AuthError.self, json: json) } } } /// The InvalidAccountTypeError union - public enum InvalidAccountTypeError: CustomStringConvertible { + public enum InvalidAccountTypeError: CustomStringConvertible, JSONRepresentable { /// Current account type doesn't have permission to access this route endpoint. case endpoint /// Current account type doesn't have permission to access this feature. @@ -162,50 +182,60 @@ open class Auth { /// An unspecified error. case other + func json() throws -> JSON { + try InvalidAccountTypeErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InvalidAccountTypeErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InvalidAccountTypeErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InvalidAccountTypeError: \(error)" + } } } - open class InvalidAccountTypeErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InvalidAccountTypeError) -> JSON { + + public class InvalidAccountTypeErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InvalidAccountTypeError) throws -> JSON { switch value { - case .endpoint: - var d = [String: JSON]() - d[".tag"] = .str("endpoint") - return .dictionary(d) - case .feature: - var d = [String: JSON]() - d[".tag"] = .str("feature") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .endpoint: + var d = [String: JSON]() + d[".tag"] = .str("endpoint") + return .dictionary(d) + case .feature: + var d = [String: JSON]() + d[".tag"] = .str("feature") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> InvalidAccountTypeError { + + public func deserialize(_ json: JSON) throws -> InvalidAccountTypeError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "endpoint": - return InvalidAccountTypeError.endpoint - case "feature": - return InvalidAccountTypeError.feature - case "other": - return InvalidAccountTypeError.other - default: - return InvalidAccountTypeError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "endpoint": + return InvalidAccountTypeError.endpoint + case "feature": + return InvalidAccountTypeError.feature + case "other": + return InvalidAccountTypeError.other default: - fatalError("Failed to deserialize") + return InvalidAccountTypeError.other + } + default: + throw JSONSerializerError.deserializeError(type: InvalidAccountTypeError.self, json: json) } } } /// The PaperAccessError union - public enum PaperAccessError: CustomStringConvertible { + public enum PaperAccessError: CustomStringConvertible, JSONRepresentable { /// Paper is disabled. case paperDisabled /// The provided user has not used Paper yet. @@ -213,50 +243,60 @@ open class Auth { /// An unspecified error. case other + func json() throws -> JSON { + try PaperAccessErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperAccessErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperAccessErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperAccessError: \(error)" + } } } - open class PaperAccessErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperAccessError) -> JSON { + + public class PaperAccessErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperAccessError) throws -> JSON { switch value { - case .paperDisabled: - var d = [String: JSON]() - d[".tag"] = .str("paper_disabled") - return .dictionary(d) - case .notPaperUser: - var d = [String: JSON]() - d[".tag"] = .str("not_paper_user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .paperDisabled: + var d = [String: JSON]() + d[".tag"] = .str("paper_disabled") + return .dictionary(d) + case .notPaperUser: + var d = [String: JSON]() + d[".tag"] = .str("not_paper_user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PaperAccessError { + + public func deserialize(_ json: JSON) throws -> PaperAccessError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "paper_disabled": - return PaperAccessError.paperDisabled - case "not_paper_user": - return PaperAccessError.notPaperUser - case "other": - return PaperAccessError.other - default: - return PaperAccessError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "paper_disabled": + return PaperAccessError.paperDisabled + case "not_paper_user": + return PaperAccessError.notPaperUser + case "other": + return PaperAccessError.other default: - fatalError("Failed to deserialize") + return PaperAccessError.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperAccessError.self, json: json) } } } /// Error occurred because the app is being rate limited. - open class RateLimitError: CustomStringConvertible { + public class RateLimitError: CustomStringConvertible, JSONRepresentable { /// The reason why the app is being rate limited. public let reason: Auth.RateLimitReason /// The number of seconds that the app should wait before making another request. @@ -266,33 +306,44 @@ open class Auth { comparableValidator()(retryAfter) self.retryAfter = retryAfter } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RateLimitErrorSerializer().serialize(self)))" + + func json() throws -> JSON { + try RateLimitErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RateLimitErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RateLimitError: \(error)" + } } } - open class RateLimitErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RateLimitError) -> JSON { - let output = [ - "reason": Auth.RateLimitReasonSerializer().serialize(value.reason), - "retry_after": Serialization._UInt64Serializer.serialize(value.retryAfter), + + public class RateLimitErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RateLimitError) throws -> JSON { + let output = [ + "reason": try Auth.RateLimitReasonSerializer().serialize(value.reason), + "retry_after": try Serialization._UInt64Serializer.serialize(value.retryAfter), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RateLimitError { + + public func deserialize(_ json: JSON) throws -> RateLimitError { switch json { - case .dictionary(let dict): - let reason = Auth.RateLimitReasonSerializer().deserialize(dict["reason"] ?? .null) - let retryAfter = Serialization._UInt64Serializer.deserialize(dict["retry_after"] ?? .number(1)) - return RateLimitError(reason: reason, retryAfter: retryAfter) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let reason = try Auth.RateLimitReasonSerializer().deserialize(dict["reason"] ?? .null) + let retryAfter = try Serialization._UInt64Serializer.deserialize(dict["retry_after"] ?? .number(1)) + return RateLimitError(reason: reason, retryAfter: retryAfter) + default: + throw JSONSerializerError.deserializeError(type: RateLimitError.self, json: json) } } } /// The RateLimitReason union - public enum RateLimitReason: CustomStringConvertible { + public enum RateLimitReason: CustomStringConvertible, JSONRepresentable { /// You are making too many requests in the past few minutes. case tooManyRequests /// There are currently too many write operations happening in the user's Dropbox. @@ -300,50 +351,60 @@ open class Auth { /// An unspecified error. case other + func json() throws -> JSON { + try RateLimitReasonSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RateLimitReasonSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RateLimitReasonSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RateLimitReason: \(error)" + } } } - open class RateLimitReasonSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RateLimitReason) -> JSON { + + public class RateLimitReasonSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RateLimitReason) throws -> JSON { switch value { - case .tooManyRequests: - var d = [String: JSON]() - d[".tag"] = .str("too_many_requests") - return .dictionary(d) - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .tooManyRequests: + var d = [String: JSON]() + d[".tag"] = .str("too_many_requests") + return .dictionary(d) + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> RateLimitReason { + + public func deserialize(_ json: JSON) throws -> RateLimitReason { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "too_many_requests": - return RateLimitReason.tooManyRequests - case "too_many_write_operations": - return RateLimitReason.tooManyWriteOperations - case "other": - return RateLimitReason.other - default: - return RateLimitReason.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "too_many_requests": + return RateLimitReason.tooManyRequests + case "too_many_write_operations": + return RateLimitReason.tooManyWriteOperations + case "other": + return RateLimitReason.other default: - fatalError("Failed to deserialize") + return RateLimitReason.other + } + default: + throw JSONSerializerError.deserializeError(type: RateLimitReason.self, json: json) } } } /// The TokenFromOAuth1Arg struct - open class TokenFromOAuth1Arg: CustomStringConvertible { + public class TokenFromOAuth1Arg: CustomStringConvertible, JSONRepresentable { /// The supplied OAuth 1.0 access token. public let oauth1Token: String /// The token secret associated with the supplied access token. @@ -354,33 +415,44 @@ open class Auth { stringValidator(minLength: 1)(oauth1TokenSecret) self.oauth1TokenSecret = oauth1TokenSecret } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TokenFromOAuth1ArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TokenFromOAuth1ArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TokenFromOAuth1ArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TokenFromOAuth1Arg: \(error)" + } } } - open class TokenFromOAuth1ArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TokenFromOAuth1Arg) -> JSON { - let output = [ - "oauth1_token": Serialization._StringSerializer.serialize(value.oauth1Token), - "oauth1_token_secret": Serialization._StringSerializer.serialize(value.oauth1TokenSecret), + + public class TokenFromOAuth1ArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TokenFromOAuth1Arg) throws -> JSON { + let output = [ + "oauth1_token": try Serialization._StringSerializer.serialize(value.oauth1Token), + "oauth1_token_secret": try Serialization._StringSerializer.serialize(value.oauth1TokenSecret), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TokenFromOAuth1Arg { + + public func deserialize(_ json: JSON) throws -> TokenFromOAuth1Arg { switch json { - case .dictionary(let dict): - let oauth1Token = Serialization._StringSerializer.deserialize(dict["oauth1_token"] ?? .null) - let oauth1TokenSecret = Serialization._StringSerializer.deserialize(dict["oauth1_token_secret"] ?? .null) - return TokenFromOAuth1Arg(oauth1Token: oauth1Token, oauth1TokenSecret: oauth1TokenSecret) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let oauth1Token = try Serialization._StringSerializer.deserialize(dict["oauth1_token"] ?? .null) + let oauth1TokenSecret = try Serialization._StringSerializer.deserialize(dict["oauth1_token_secret"] ?? .null) + return TokenFromOAuth1Arg(oauth1Token: oauth1Token, oauth1TokenSecret: oauth1TokenSecret) + default: + throw JSONSerializerError.deserializeError(type: TokenFromOAuth1Arg.self, json: json) } } } /// The TokenFromOAuth1Error union - public enum TokenFromOAuth1Error: CustomStringConvertible { + public enum TokenFromOAuth1Error: CustomStringConvertible, JSONRepresentable { /// Part or all of the OAuth 1.0 access token info is invalid. case invalidOauth1TokenInfo /// The authorized app does not match the app associated with the supplied access token. @@ -388,124 +460,157 @@ open class Auth { /// An unspecified error. case other + func json() throws -> JSON { + try TokenFromOAuth1ErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TokenFromOAuth1ErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TokenFromOAuth1ErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TokenFromOAuth1Error: \(error)" + } } } - open class TokenFromOAuth1ErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TokenFromOAuth1Error) -> JSON { + + public class TokenFromOAuth1ErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TokenFromOAuth1Error) throws -> JSON { switch value { - case .invalidOauth1TokenInfo: - var d = [String: JSON]() - d[".tag"] = .str("invalid_oauth1_token_info") - return .dictionary(d) - case .appIdMismatch: - var d = [String: JSON]() - d[".tag"] = .str("app_id_mismatch") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .invalidOauth1TokenInfo: + var d = [String: JSON]() + d[".tag"] = .str("invalid_oauth1_token_info") + return .dictionary(d) + case .appIdMismatch: + var d = [String: JSON]() + d[".tag"] = .str("app_id_mismatch") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> TokenFromOAuth1Error { + + public func deserialize(_ json: JSON) throws -> TokenFromOAuth1Error { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_oauth1_token_info": - return TokenFromOAuth1Error.invalidOauth1TokenInfo - case "app_id_mismatch": - return TokenFromOAuth1Error.appIdMismatch - case "other": - return TokenFromOAuth1Error.other - default: - return TokenFromOAuth1Error.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_oauth1_token_info": + return TokenFromOAuth1Error.invalidOauth1TokenInfo + case "app_id_mismatch": + return TokenFromOAuth1Error.appIdMismatch + case "other": + return TokenFromOAuth1Error.other default: - fatalError("Failed to deserialize") + return TokenFromOAuth1Error.other + } + default: + throw JSONSerializerError.deserializeError(type: TokenFromOAuth1Error.self, json: json) } } } /// The TokenFromOAuth1Result struct - open class TokenFromOAuth1Result: CustomStringConvertible { + public class TokenFromOAuth1Result: CustomStringConvertible, JSONRepresentable { /// The OAuth 2.0 token generated from the supplied OAuth 1.0 token. public let oauth2Token: String public init(oauth2Token: String) { stringValidator(minLength: 1)(oauth2Token) self.oauth2Token = oauth2Token } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TokenFromOAuth1ResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try TokenFromOAuth1ResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TokenFromOAuth1ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TokenFromOAuth1Result: \(error)" + } } } - open class TokenFromOAuth1ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TokenFromOAuth1Result) -> JSON { - let output = [ - "oauth2_token": Serialization._StringSerializer.serialize(value.oauth2Token), + + public class TokenFromOAuth1ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TokenFromOAuth1Result) throws -> JSON { + let output = [ + "oauth2_token": try Serialization._StringSerializer.serialize(value.oauth2Token), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TokenFromOAuth1Result { + + public func deserialize(_ json: JSON) throws -> TokenFromOAuth1Result { switch json { - case .dictionary(let dict): - let oauth2Token = Serialization._StringSerializer.deserialize(dict["oauth2_token"] ?? .null) - return TokenFromOAuth1Result(oauth2Token: oauth2Token) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let oauth2Token = try Serialization._StringSerializer.deserialize(dict["oauth2_token"] ?? .null) + return TokenFromOAuth1Result(oauth2Token: oauth2Token) + default: + throw JSONSerializerError.deserializeError(type: TokenFromOAuth1Result.self, json: json) } } } /// The TokenScopeError struct - open class TokenScopeError: CustomStringConvertible { + public class TokenScopeError: CustomStringConvertible, JSONRepresentable { /// The required scope to access the route. public let requiredScope: String public init(requiredScope: String) { stringValidator()(requiredScope) self.requiredScope = requiredScope } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TokenScopeErrorSerializer().serialize(self)))" + + func json() throws -> JSON { + try TokenScopeErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TokenScopeErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TokenScopeError: \(error)" + } } } - open class TokenScopeErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TokenScopeError) -> JSON { - let output = [ - "required_scope": Serialization._StringSerializer.serialize(value.requiredScope), + + public class TokenScopeErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TokenScopeError) throws -> JSON { + let output = [ + "required_scope": try Serialization._StringSerializer.serialize(value.requiredScope), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TokenScopeError { + + public func deserialize(_ json: JSON) throws -> TokenScopeError { switch json { - case .dictionary(let dict): - let requiredScope = Serialization._StringSerializer.deserialize(dict["required_scope"] ?? .null) - return TokenScopeError(requiredScope: requiredScope) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let requiredScope = try Serialization._StringSerializer.deserialize(dict["required_scope"] ?? .null) + return TokenScopeError(requiredScope: requiredScope) + default: + throw JSONSerializerError.deserializeError(type: TokenScopeError.self, json: json) } } } - /// Stone Route Objects static let tokenFromOauth1 = Route( name: "token/from_oauth1", version: 1, namespace: "auth", - deprecated: false, + deprecated: true, argSerializer: Auth.TokenFromOAuth1ArgSerializer(), responseSerializer: Auth.TokenFromOAuth1ResultSerializer(), errorSerializer: Auth.TokenFromOAuth1ErrorSerializer(), - attrs: ["auth": "app", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.app], + host: .api, + style: .rpc + ) ) static let tokenRevoke = Route( name: "token/revoke", @@ -515,8 +620,10 @@ open class Auth { argSerializer: Serialization._VoidSerializer, responseSerializer: Serialization._VoidSerializer, errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/AuthAppAuthRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/AuthAppAuthRoutes.swift new file mode 100644 index 000000000..31cbe8f16 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Generated/AuthAppAuthRoutes.swift @@ -0,0 +1,33 @@ +/// +/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation + +/// Routes for the authAppAuth namespace +/// For Objective-C compatible routes see DBAuthRoutes +public class AuthAppAuthRoutes: DropboxTransportClientOwning { + public let client: DropboxTransportClient + required init(client: DropboxTransportClient) { + self.client = client + } + + /// Creates an OAuth 2.0 access token from the supplied OAuth 1.0 access token. + /// + /// - parameter oauth1Token: The supplied OAuth 1.0 access token. + /// - parameter oauth1TokenSecret: The token secret associated with the supplied access token. + /// + /// - returns: Through the response callback, the caller will receive a `Auth.TokenFromOAuth1Result` object on + /// success or a `Auth.TokenFromOAuth1Error` object on failure. + @available(*, unavailable, message: "tokenFromOauth1 is deprecated.") + @discardableResult public func tokenFromOauth1( + oauth1Token: String, + oauth1TokenSecret: String + ) -> RpcRequest { + let route = Auth.tokenFromOauth1 + let serverArgs = Auth.TokenFromOAuth1Arg(oauth1Token: oauth1Token, oauth1TokenSecret: oauth1TokenSecret) + return client.request(route, serverArgs: serverArgs) + } +} diff --git a/Source/SwiftyDropbox/Shared/Generated/AuthRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/AuthRoutes.swift index 90677625b..2ea8c381e 100644 --- a/Source/SwiftyDropbox/Shared/Generated/AuthRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/AuthRoutes.swift @@ -7,34 +7,21 @@ import Foundation /// Routes for the auth namespace -open class AuthRoutes { +/// For Objective-C compatible routes see DBAuthRoutes +public class AuthRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } - /// Creates an OAuth 2.0 access token from the supplied OAuth 1.0 access token. - /// - /// - parameter oauth1Token: The supplied OAuth 1.0 access token. - /// - parameter oauth1TokenSecret: The token secret associated with the supplied access token. - /// - /// - returns: Through the response callback, the caller will receive a `Auth.TokenFromOAuth1Result` object on - /// success or a `Auth.TokenFromOAuth1Error` object on failure. - @discardableResult open func tokenFromOauth1(oauth1Token: String, oauth1TokenSecret: String) -> RpcRequest { - let route = Auth.tokenFromOauth1 - let serverArgs = Auth.TokenFromOAuth1Arg(oauth1Token: oauth1Token, oauth1TokenSecret: oauth1TokenSecret) - return client.request(route, serverArgs: serverArgs) - } - /// Disables the access token used to authenticate the call. If there is a corresponding refresh token for the /// access token, this disables that refresh token, as well as any other access tokens for that refresh token. /// /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a `Void` object + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a `Void` object /// on failure. - @discardableResult open func tokenRevoke() -> RpcRequest { + @discardableResult public func tokenRevoke() -> RpcRequest { let route = Auth.tokenRevoke return client.request(route) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Base.swift b/Source/SwiftyDropbox/Shared/Generated/Base.swift index fbfb500ca..4fe26b57d 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Base.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Base.swift @@ -6,46 +6,48 @@ import Foundation -import Alamofire +public class DropboxBase: DropboxTransportClientOwning { + public var client: DropboxTransportClient -open class DropboxBase { /// Routes within the account namespace. See AccountRoutes for details. - open var account: AccountRoutes! + public var account: AccountRoutes! /// Routes within the auth namespace. See AuthRoutes for details. - open var auth: AuthRoutes! + public var auth: AuthRoutes! /// Routes within the check namespace. See CheckRoutes for details. - open var check: CheckRoutes! + public var check: CheckRoutes! /// Routes within the contacts namespace. See ContactsRoutes for details. - open var contacts: ContactsRoutes! - /// Routes within the file_properties namespace. See FilePropertiesRoutes for details. - open var file_properties: FilePropertiesRoutes! - /// Routes within the file_requests namespace. See FileRequestsRoutes for details. - open var file_requests: FileRequestsRoutes! + public var contacts: ContactsRoutes! + /// Routes within the fileProperties namespace. See FilePropertiesRoutes for details. + public var fileProperties: FilePropertiesRoutes! + /// Routes within the fileRequests namespace. See FileRequestsRoutes for details. + public var fileRequests: FileRequestsRoutes! /// Routes within the files namespace. See FilesRoutes for details. - open var files: FilesRoutes! + public var files: FilesRoutes! /// Routes within the openid namespace. See OpenidRoutes for details. - open var openid: OpenidRoutes! + public var openid: OpenidRoutes! /// Routes within the paper namespace. See PaperRoutes for details. - open var paper: PaperRoutes! + public var paper: PaperRoutes! /// Routes within the sharing namespace. See SharingRoutes for details. - open var sharing: SharingRoutes! - /// Routes within the team_log namespace. See TeamLogRoutes for details. - open var team_log: TeamLogRoutes! + public var sharing: SharingRoutes! + /// Routes within the teamLog namespace. See TeamLogRoutes for details. + public var teamLog: TeamLogRoutes! /// Routes within the users namespace. See UsersRoutes for details. - open var users: UsersRoutes! + public var users: UsersRoutes! + + public required init(client: DropboxTransportClient) { + self.client = client - public init(client: DropboxTransportClient) { self.account = AccountRoutes(client: client) self.auth = AuthRoutes(client: client) self.check = CheckRoutes(client: client) self.contacts = ContactsRoutes(client: client) - self.file_properties = FilePropertiesRoutes(client: client) - self.file_requests = FileRequestsRoutes(client: client) + self.fileProperties = FilePropertiesRoutes(client: client) + self.fileRequests = FileRequestsRoutes(client: client) self.files = FilesRoutes(client: client) self.openid = OpenidRoutes(client: client) self.paper = PaperRoutes(client: client) self.sharing = SharingRoutes(client: client) - self.team_log = TeamLogRoutes(client: client) + self.teamLog = TeamLogRoutes(client: client) self.users = UsersRoutes(client: client) } } diff --git a/Source/SwiftyDropbox/Shared/Generated/BaseApp.swift b/Source/SwiftyDropbox/Shared/Generated/BaseApp.swift new file mode 100644 index 000000000..4cdd60b7d --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Generated/BaseApp.swift @@ -0,0 +1,23 @@ +/// +/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation + +public class DropboxAppBase: DropboxTransportClientOwning { + public var client: DropboxTransportClient + + /// Routes within the auth namespace. See AuthAppAuthRoutes for details. + public var auth: AuthAppAuthRoutes! + /// Routes within the check namespace. See CheckAppAuthRoutes for details. + public var check: CheckAppAuthRoutes! + + public required init(client: DropboxTransportClient) { + self.client = client + + self.auth = AuthAppAuthRoutes(client: client) + self.check = CheckAppAuthRoutes(client: client) + } +} diff --git a/Source/SwiftyDropbox/Shared/Generated/BaseTeam.swift b/Source/SwiftyDropbox/Shared/Generated/BaseTeam.swift index 78bbcfd93..2d0ffc403 100644 --- a/Source/SwiftyDropbox/Shared/Generated/BaseTeam.swift +++ b/Source/SwiftyDropbox/Shared/Generated/BaseTeam.swift @@ -6,13 +6,15 @@ import Foundation -import Alamofire +public class DropboxTeamBase: DropboxTransportClientOwning { + public var client: DropboxTransportClient -open class DropboxTeamBase { /// Routes within the team namespace. See TeamRoutes for details. - open var team: TeamRoutes! + public var team: TeamRoutes! + + public required init(client: DropboxTransportClient) { + self.client = client - public init(client: DropboxTransportClient) { self.team = TeamRoutes(client: client) } } diff --git a/Source/SwiftyDropbox/Shared/Generated/Check.swift b/Source/SwiftyDropbox/Shared/Generated/Check.swift index a38b81b0c..675395f1b 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Check.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Check.swift @@ -7,70 +7,91 @@ import Foundation /// Datatypes and serializers for the check namespace -open class Check { - /// EchoArg contains the arguments to be sent to the Dropbox servers. - open class EchoArg: CustomStringConvertible { +public class Check { + /// Contains the arguments to be sent to the Dropbox servers. + public class EchoArg: CustomStringConvertible, JSONRepresentable { /// The string that you'd like to be echoed back to you. public let query: String public init(query: String = "") { stringValidator(maxLength: 500)(query) self.query = query } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EchoArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try EchoArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EchoArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EchoArg: \(error)" + } } } - open class EchoArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EchoArg) -> JSON { - let output = [ - "query": Serialization._StringSerializer.serialize(value.query), + + public class EchoArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EchoArg) throws -> JSON { + let output = [ + "query": try Serialization._StringSerializer.serialize(value.query), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EchoArg { + + public func deserialize(_ json: JSON) throws -> EchoArg { switch json { - case .dictionary(let dict): - let query = Serialization._StringSerializer.deserialize(dict["query"] ?? .str("")) - return EchoArg(query: query) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let query = try Serialization._StringSerializer.deserialize(dict["query"] ?? .str("")) + return EchoArg(query: query) + default: + throw JSONSerializerError.deserializeError(type: EchoArg.self, json: json) } } } /// EchoResult contains the result returned from the Dropbox servers. - open class EchoResult: CustomStringConvertible { + public class EchoResult: CustomStringConvertible, JSONRepresentable { /// If everything worked correctly, this would be the same as query. public let result: String public init(result: String = "") { stringValidator()(result) self.result = result } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EchoResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try EchoResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EchoResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EchoResult: \(error)" + } } } - open class EchoResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EchoResult) -> JSON { - let output = [ - "result": Serialization._StringSerializer.serialize(value.result), + + public class EchoResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EchoResult) throws -> JSON { + let output = [ + "result": try Serialization._StringSerializer.serialize(value.result), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EchoResult { + + public func deserialize(_ json: JSON) throws -> EchoResult { switch json { - case .dictionary(let dict): - let result = Serialization._StringSerializer.deserialize(dict["result"] ?? .str("")) - return EchoResult(result: result) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let result = try Serialization._StringSerializer.deserialize(dict["result"] ?? .str("")) + return EchoResult(result: result) + default: + throw JSONSerializerError.deserializeError(type: EchoResult.self, json: json) } } } - /// Stone Route Objects static let app = Route( @@ -81,9 +102,11 @@ open class Check { argSerializer: Check.EchoArgSerializer(), responseSerializer: Check.EchoResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "app", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.app], + host: .api, + style: .rpc + ) ) static let user = Route( name: "user", @@ -93,8 +116,10 @@ open class Check { argSerializer: Check.EchoArgSerializer(), responseSerializer: Check.EchoResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/CheckAppAuthRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/CheckAppAuthRoutes.swift new file mode 100644 index 000000000..341209065 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Generated/CheckAppAuthRoutes.swift @@ -0,0 +1,31 @@ +/// +/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation + +/// Routes for the checkAppAuth namespace +/// For Objective-C compatible routes see DBCheckRoutes +public class CheckAppAuthRoutes: DropboxTransportClientOwning { + public let client: DropboxTransportClient + required init(client: DropboxTransportClient) { + self.client = client + } + + /// This endpoint performs App Authentication, validating the supplied app key and secret, and returns the supplied + /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you + /// receive an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API + /// infrastructure is working and that the app key and secret valid. + /// + /// - parameter query: The string that you'd like to be echoed back to you. + /// + /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a + /// `Void` object on failure. + @discardableResult public func app(query: String = "") -> RpcRequest { + let route = Check.app + let serverArgs = Check.EchoArg(query: query) + return client.request(route, serverArgs: serverArgs) + } +} diff --git a/Source/SwiftyDropbox/Shared/Generated/CheckRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/CheckRoutes.swift index c987d6d35..b87f46412 100644 --- a/Source/SwiftyDropbox/Shared/Generated/CheckRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/CheckRoutes.swift @@ -7,40 +7,27 @@ import Foundation /// Routes for the check namespace -open class CheckRoutes { +/// For Objective-C compatible routes see DBCheckRoutes +public class CheckRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } - /// This endpoint performs App Authentication, validating the supplied app key and secret, and returns the supplied - /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you receive - /// an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API infrastructure is - /// working and that the app key and secret valid. - /// - /// - parameter query: The string that you'd like to be echoed back to you. - /// - /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a - /// `Void` object on failure. - @discardableResult open func app(query: String = "") -> RpcRequest { - let route = Check.app - let serverArgs = Check.EchoArg(query: query) - return client.request(route, serverArgs: serverArgs) - } - /// This endpoint performs User Authentication, validating the supplied access token, and returns the supplied - /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you receive - /// an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API infrastructure is - /// working and that the access token is valid. + /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you + /// receive an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API + /// infrastructure is working and that the access token is valid. + /// + /// - scope: account_info.read /// /// - parameter query: The string that you'd like to be echoed back to you. /// - /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a + /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a /// `Void` object on failure. - @discardableResult open func user(query: String = "") -> RpcRequest { + @discardableResult public func user(query: String = "") -> RpcRequest { let route = Check.user let serverArgs = Check.EchoArg(query: query) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Common.swift b/Source/SwiftyDropbox/Shared/Generated/Common.swift index fdf49ff86..acf057423 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Common.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Common.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the common namespace -open class Common { +public class Common { /// The PathRoot union - public enum PathRoot: CustomStringConvertible { + public enum PathRoot: CustomStringConvertible, JSONRepresentable { /// Paths are relative to the authenticating user's home namespace, whether or not that user belongs to a team. case home /// Paths are relative to the authenticating user's root namespace (This results in invalidRoot in PathRootError @@ -21,58 +21,68 @@ open class Common { /// An unspecified error. case other + func json() throws -> JSON { + try PathRootSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PathRootSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PathRootSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PathRoot: \(error)" + } } } - open class PathRootSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PathRoot) -> JSON { + + public class PathRootSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PathRoot) throws -> JSON { switch value { - case .home: - var d = [String: JSON]() - d[".tag"] = .str("home") - return .dictionary(d) - case .root(let arg): - var d = ["root": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("root") - return .dictionary(d) - case .namespaceId(let arg): - var d = ["namespace_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("namespace_id") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .home: + var d = [String: JSON]() + d[".tag"] = .str("home") + return .dictionary(d) + case .root(let arg): + var d = try ["root": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("root") + return .dictionary(d) + case .namespaceId(let arg): + var d = try ["namespace_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("namespace_id") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PathRoot { + + public func deserialize(_ json: JSON) throws -> PathRoot { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "home": - return PathRoot.home - case "root": - let v = Serialization._StringSerializer.deserialize(d["root"] ?? .null) - return PathRoot.root(v) - case "namespace_id": - let v = Serialization._StringSerializer.deserialize(d["namespace_id"] ?? .null) - return PathRoot.namespaceId(v) - case "other": - return PathRoot.other - default: - return PathRoot.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "home": + return PathRoot.home + case "root": + let v = try Serialization._StringSerializer.deserialize(d["root"] ?? .null) + return PathRoot.root(v) + case "namespace_id": + let v = try Serialization._StringSerializer.deserialize(d["namespace_id"] ?? .null) + return PathRoot.namespaceId(v) + case "other": + return PathRoot.other default: - fatalError("Failed to deserialize") + return PathRoot.other + } + default: + throw JSONSerializerError.deserializeError(type: PathRoot.self, json: json) } } } /// The PathRootError union - public enum PathRootError: CustomStringConvertible { + public enum PathRootError: CustomStringConvertible, JSONRepresentable { /// The root namespace id in Dropbox-API-Path-Root header is not valid. The value of this error is the user's /// latest root info. case invalidRoot(Common.RootInfo) @@ -81,53 +91,64 @@ open class Common { /// An unspecified error. case other + func json() throws -> JSON { + try PathRootErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PathRootErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PathRootErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PathRootError: \(error)" + } } } - open class PathRootErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PathRootError) -> JSON { + + public class PathRootErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PathRootError) throws -> JSON { switch value { - case .invalidRoot(let arg): - var d = ["invalid_root": Common.RootInfoSerializer().serialize(arg)] - d[".tag"] = .str("invalid_root") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .invalidRoot(let arg): + var d = try ["invalid_root": Common.RootInfoSerializer().serialize(arg)] + d[".tag"] = .str("invalid_root") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PathRootError { + + public func deserialize(_ json: JSON) throws -> PathRootError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_root": - let v = Common.RootInfoSerializer().deserialize(d["invalid_root"] ?? .null) - return PathRootError.invalidRoot(v) - case "no_permission": - return PathRootError.noPermission - case "other": - return PathRootError.other - default: - return PathRootError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_root": + let v = try Common.RootInfoSerializer().deserialize(d["invalid_root"] ?? .null) + return PathRootError.invalidRoot(v) + case "no_permission": + return PathRootError.noPermission + case "other": + return PathRootError.other default: - fatalError("Failed to deserialize") + return PathRootError.other + } + default: + throw JSONSerializerError.deserializeError(type: PathRootError.self, json: json) } } } /// Information about current user's root. - open class RootInfo: CustomStringConvertible { + public class RootInfo: CustomStringConvertible, JSONRepresentable { /// The namespace ID for user's root namespace. It will be the namespace ID of the shared team root if the user - /// is member of a team with a separate team root. Otherwise it will be same as homeNamespaceId in RootInfo. + /// is member of a team with a separate team root. Otherwise it will be same as homeNamespaceId in + /// RootInfo. public let rootNamespaceId: String /// The namespace ID for user's home namespace. public let homeNamespaceId: String @@ -137,54 +158,66 @@ open class Common { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(homeNamespaceId) self.homeNamespaceId = homeNamespaceId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RootInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try RootInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RootInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RootInfo: \(error)" + } } } - open class RootInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RootInfo) -> JSON { - var output = [ - "root_namespace_id": Serialization._StringSerializer.serialize(value.rootNamespaceId), - "home_namespace_id": Serialization._StringSerializer.serialize(value.homeNamespaceId), + + public class RootInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RootInfo) throws -> JSON { + var output = [ + "root_namespace_id": try Serialization._StringSerializer.serialize(value.rootNamespaceId), + "home_namespace_id": try Serialization._StringSerializer.serialize(value.homeNamespaceId), ] switch value { - case let team as Common.TeamRootInfo: - for (k, v) in Serialization.getFields(Common.TeamRootInfoSerializer().serialize(team)) { - output[k] = v - } - output[".tag"] = .str("team") - case let user as Common.UserRootInfo: - for (k, v) in Serialization.getFields(Common.UserRootInfoSerializer().serialize(user)) { - output[k] = v - } - output[".tag"] = .str("user") - default: fatalError("Tried to serialize unexpected subtype") + case let team as Common.TeamRootInfo: + for (k, v) in try Serialization.getFields(Common.TeamRootInfoSerializer().serialize(team)) { + output[k] = v + } + output[".tag"] = .str("team") + case let user as Common.UserRootInfo: + for (k, v) in try Serialization.getFields(Common.UserRootInfoSerializer().serialize(user)) { + output[k] = v + } + output[".tag"] = .str("user") + default: + throw JSONSerializerError.unexpectedSubtype(type: RootInfo.self, subtype: value) } return .dictionary(output) } - open func deserialize(_ json: JSON) -> RootInfo { + + public func deserialize(_ json: JSON) throws -> RootInfo { switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "team": - return Common.TeamRootInfoSerializer().deserialize(json) - case "user": - return Common.UserRootInfoSerializer().deserialize(json) - default: - let rootNamespaceId = Serialization._StringSerializer.deserialize(dict["root_namespace_id"] ?? .null) - let homeNamespaceId = Serialization._StringSerializer.deserialize(dict["home_namespace_id"] ?? .null) - return RootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId) - } + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "team": + return try Common.TeamRootInfoSerializer().deserialize(json) + case "user": + return try Common.UserRootInfoSerializer().deserialize(json) default: - fatalError("Type error deserializing") + let rootNamespaceId = try Serialization._StringSerializer.deserialize(dict["root_namespace_id"] ?? .null) + let homeNamespaceId = try Serialization._StringSerializer.deserialize(dict["home_namespace_id"] ?? .null) + return RootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId) + } + default: + throw JSONSerializerError.deserializeError(type: RootInfo.self, json: json) } } } /// Root info when user is member of a team with a separate root namespace ID. - open class TeamRootInfo: Common.RootInfo { + public class TeamRootInfo: Common.RootInfo { /// The path for user's home directory under the shared team root. public let homePath: String public init(rootNamespaceId: String, homeNamespaceId: String, homePath: String) { @@ -192,59 +225,71 @@ open class Common { self.homePath = homePath super.init(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamRootInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamRootInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamRootInfo: \(error)" + } } } - open class TeamRootInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamRootInfo) -> JSON { - let output = [ - "root_namespace_id": Serialization._StringSerializer.serialize(value.rootNamespaceId), - "home_namespace_id": Serialization._StringSerializer.serialize(value.homeNamespaceId), - "home_path": Serialization._StringSerializer.serialize(value.homePath), + + public class TeamRootInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamRootInfo) throws -> JSON { + let output = [ + "root_namespace_id": try Serialization._StringSerializer.serialize(value.rootNamespaceId), + "home_namespace_id": try Serialization._StringSerializer.serialize(value.homeNamespaceId), + "home_path": try Serialization._StringSerializer.serialize(value.homePath), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamRootInfo { + + public func deserialize(_ json: JSON) throws -> TeamRootInfo { switch json { - case .dictionary(let dict): - let rootNamespaceId = Serialization._StringSerializer.deserialize(dict["root_namespace_id"] ?? .null) - let homeNamespaceId = Serialization._StringSerializer.deserialize(dict["home_namespace_id"] ?? .null) - let homePath = Serialization._StringSerializer.deserialize(dict["home_path"] ?? .null) - return TeamRootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId, homePath: homePath) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let rootNamespaceId = try Serialization._StringSerializer.deserialize(dict["root_namespace_id"] ?? .null) + let homeNamespaceId = try Serialization._StringSerializer.deserialize(dict["home_namespace_id"] ?? .null) + let homePath = try Serialization._StringSerializer.deserialize(dict["home_path"] ?? .null) + return TeamRootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId, homePath: homePath) + default: + throw JSONSerializerError.deserializeError(type: TeamRootInfo.self, json: json) } } } /// Root info when user is not member of a team or the user is a member of a team and the team does not have a /// separate root namespace. - open class UserRootInfo: Common.RootInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserRootInfoSerializer().serialize(self)))" + public class UserRootInfo: Common.RootInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserRootInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserRootInfo: \(error)" + } } } - open class UserRootInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserRootInfo) -> JSON { - let output = [ - "root_namespace_id": Serialization._StringSerializer.serialize(value.rootNamespaceId), - "home_namespace_id": Serialization._StringSerializer.serialize(value.homeNamespaceId), + + public class UserRootInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserRootInfo) throws -> JSON { + let output = [ + "root_namespace_id": try Serialization._StringSerializer.serialize(value.rootNamespaceId), + "home_namespace_id": try Serialization._StringSerializer.serialize(value.homeNamespaceId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserRootInfo { + + public func deserialize(_ json: JSON) throws -> UserRootInfo { switch json { - case .dictionary(let dict): - let rootNamespaceId = Serialization._StringSerializer.deserialize(dict["root_namespace_id"] ?? .null) - let homeNamespaceId = Serialization._StringSerializer.deserialize(dict["home_namespace_id"] ?? .null) - return UserRootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let rootNamespaceId = try Serialization._StringSerializer.deserialize(dict["root_namespace_id"] ?? .null) + let homeNamespaceId = try Serialization._StringSerializer.deserialize(dict["home_namespace_id"] ?? .null) + return UserRootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId) + default: + throw JSONSerializerError.deserializeError(type: UserRootInfo.self, json: json) } } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Contacts.swift b/Source/SwiftyDropbox/Shared/Generated/Contacts.swift index 05714cd24..8dc2cd330 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Contacts.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Contacts.swift @@ -7,84 +7,107 @@ import Foundation /// Datatypes and serializers for the contacts namespace -open class Contacts { +public class Contacts { /// The DeleteManualContactsArg struct - open class DeleteManualContactsArg: CustomStringConvertible { + public class DeleteManualContactsArg: CustomStringConvertible, JSONRepresentable { /// List of manually added contacts to be deleted. - public let emailAddresses: Array - public init(emailAddresses: Array) { - arrayValidator(itemValidator: stringValidator(maxLength: 255, pattern: "^['#&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$"))(emailAddresses) + public let emailAddresses: [String] + public init(emailAddresses: [String]) { + arrayValidator(itemValidator: stringValidator( + maxLength: 255, + pattern: "^['#&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$" + ))(emailAddresses) self.emailAddresses = emailAddresses } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteManualContactsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteManualContactsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteManualContactsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteManualContactsArg: \(error)" + } } } - open class DeleteManualContactsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteManualContactsArg) -> JSON { - let output = [ - "email_addresses": ArraySerializer(Serialization._StringSerializer).serialize(value.emailAddresses), + + public class DeleteManualContactsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteManualContactsArg) throws -> JSON { + let output = [ + "email_addresses": try ArraySerializer(Serialization._StringSerializer).serialize(value.emailAddresses), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteManualContactsArg { + + public func deserialize(_ json: JSON) throws -> DeleteManualContactsArg { switch json { - case .dictionary(let dict): - let emailAddresses = ArraySerializer(Serialization._StringSerializer).deserialize(dict["email_addresses"] ?? .null) - return DeleteManualContactsArg(emailAddresses: emailAddresses) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let emailAddresses = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["email_addresses"] ?? .null) + return DeleteManualContactsArg(emailAddresses: emailAddresses) + default: + throw JSONSerializerError.deserializeError(type: DeleteManualContactsArg.self, json: json) } } } /// The DeleteManualContactsError union - public enum DeleteManualContactsError: CustomStringConvertible { + public enum DeleteManualContactsError: CustomStringConvertible, JSONRepresentable { /// Can't delete contacts from this list. Make sure the list only has manually added contacts. The deletion was /// cancelled. - case contactsNotFound(Array) + case contactsNotFound([String]) /// An unspecified error. case other + func json() throws -> JSON { + try DeleteManualContactsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteManualContactsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteManualContactsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteManualContactsError: \(error)" + } } } - open class DeleteManualContactsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteManualContactsError) -> JSON { + + public class DeleteManualContactsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteManualContactsError) throws -> JSON { switch value { - case .contactsNotFound(let arg): - var d = ["contacts_not_found": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("contacts_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .contactsNotFound(let arg): + var d = try ["contacts_not_found": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("contacts_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> DeleteManualContactsError { + + public func deserialize(_ json: JSON) throws -> DeleteManualContactsError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "contacts_not_found": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["contacts_not_found"] ?? .null) - return DeleteManualContactsError.contactsNotFound(v) - case "other": - return DeleteManualContactsError.other - default: - return DeleteManualContactsError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "contacts_not_found": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["contacts_not_found"] ?? .null) + return DeleteManualContactsError.contactsNotFound(v) + case "other": + return DeleteManualContactsError.other default: - fatalError("Failed to deserialize") + return DeleteManualContactsError.other + } + default: + throw JSONSerializerError.deserializeError(type: DeleteManualContactsError.self, json: json) } } } - /// Stone Route Objects static let deleteManualContacts = Route( @@ -95,9 +118,11 @@ open class Contacts { argSerializer: Serialization._VoidSerializer, responseSerializer: Serialization._VoidSerializer, errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let deleteManualContactsBatch = Route( name: "delete_manual_contacts_batch", @@ -107,8 +132,10 @@ open class Contacts { argSerializer: Contacts.DeleteManualContactsArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Contacts.DeleteManualContactsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/ContactsRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/ContactsRoutes.swift index cec989464..8491123ad 100644 --- a/Source/SwiftyDropbox/Shared/Generated/ContactsRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/ContactsRoutes.swift @@ -7,33 +7,38 @@ import Foundation /// Routes for the contacts namespace -open class ContactsRoutes { +/// For Objective-C compatible routes see DBContactsRoutes +public class ContactsRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Removes all manually added contacts. You'll still keep contacts who are on your team or who you imported. New /// contacts will be added when you share. /// + /// - scope: contacts.write /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a `Void` object + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a `Void` object /// on failure. - @discardableResult open func deleteManualContacts() -> RpcRequest { + @discardableResult public func deleteManualContacts() -> RpcRequest { let route = Contacts.deleteManualContacts return client.request(route) } /// Removes manually added contacts from the given list. /// + /// - scope: contacts.write + /// /// - parameter emailAddresses: List of manually added contacts to be deleted. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Contacts.DeleteManualContactsError` object on failure. - @discardableResult open func deleteManualContactsBatch(emailAddresses: Array) -> RpcRequest { + @discardableResult public func deleteManualContactsBatch(emailAddresses: [String]) + -> RpcRequest { let route = Contacts.deleteManualContactsBatch let serverArgs = Contacts.DeleteManualContactsArg(emailAddresses: emailAddresses) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/DropboxBaseRequestBox.swift b/Source/SwiftyDropbox/Shared/Generated/DropboxBaseRequestBox.swift new file mode 100644 index 000000000..fc42a867b --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Generated/DropboxBaseRequestBox.swift @@ -0,0 +1,29 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation + +/// Allows for heterogenous collections of typed requests +public enum DropboxBaseRequestBox { + case alphaUpload(UploadRequest) + case download(DownloadRequestFile) + case downloadZip(DownloadRequestFile) + case export(DownloadRequestFile) + case getPreview(DownloadRequestFile) + case getThumbnail(DownloadRequestFile) + case getThumbnailV2(DownloadRequestFile) + case paperCreate(UploadRequest) + case paperUpdate(UploadRequest) + case upload(UploadRequest) + case uploadSessionAppendV2(UploadRequest) + case uploadSessionAppend(UploadRequest) + case uploadSessionFinish(UploadRequest) + case uploadSessionStart(UploadRequest) + case docsCreate(UploadRequest) + case docsDownload(DownloadRequestFile) + case docsUpdate(UploadRequest) + case getSharedLinkFile(DownloadRequestFile) +} diff --git a/Source/SwiftyDropbox/Shared/Generated/FileProperties.swift b/Source/SwiftyDropbox/Shared/Generated/FileProperties.swift index 70befc145..f3c552125 100644 --- a/Source/SwiftyDropbox/Shared/Generated/FileProperties.swift +++ b/Source/SwiftyDropbox/Shared/Generated/FileProperties.swift @@ -7,46 +7,57 @@ import Foundation /// Datatypes and serializers for the file_properties namespace -open class FileProperties { +public class FileProperties { /// The AddPropertiesArg struct - open class AddPropertiesArg: CustomStringConvertible { + public class AddPropertiesArg: CustomStringConvertible, JSONRepresentable { /// A unique identifier for the file or folder. public let path: String /// The property groups which are to be added to a Dropbox file. No two groups in the input should refer to the /// same template. - public let propertyGroups: Array - public init(path: String, propertyGroups: Array) { + public let propertyGroups: [FileProperties.PropertyGroup] + public init(path: String, propertyGroups: [FileProperties.PropertyGroup]) { stringValidator(pattern: "/(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)")(path) self.path = path self.propertyGroups = propertyGroups } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddPropertiesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddPropertiesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddPropertiesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddPropertiesArg: \(error)" + } } } - open class AddPropertiesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddPropertiesArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "property_groups": ArraySerializer(FileProperties.PropertyGroupSerializer()).serialize(value.propertyGroups), + + public class AddPropertiesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddPropertiesArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "property_groups": try ArraySerializer(FileProperties.PropertyGroupSerializer()).serialize(value.propertyGroups), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddPropertiesArg { + + public func deserialize(_ json: JSON) throws -> AddPropertiesArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let propertyGroups = ArraySerializer(FileProperties.PropertyGroupSerializer()).deserialize(dict["property_groups"] ?? .null) - return AddPropertiesArg(path: path, propertyGroups: propertyGroups) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let propertyGroups = try ArraySerializer(FileProperties.PropertyGroupSerializer()).deserialize(dict["property_groups"] ?? .null) + return AddPropertiesArg(path: path, propertyGroups: propertyGroups) + default: + throw JSONSerializerError.deserializeError(type: AddPropertiesArg.self, json: json) } } } /// The TemplateError union - public enum TemplateError: CustomStringConvertible { + public enum TemplateError: CustomStringConvertible, JSONRepresentable { /// Template does not exist for the given identifier. case templateNotFound(String) /// You do not have permission to modify this template. @@ -54,51 +65,61 @@ open class FileProperties { /// An unspecified error. case other + func json() throws -> JSON { + try TemplateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TemplateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TemplateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TemplateError: \(error)" + } } } - open class TemplateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TemplateError) -> JSON { + + public class TemplateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TemplateError) throws -> JSON { switch value { - case .templateNotFound(let arg): - var d = ["template_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("template_not_found") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TemplateError { + case .templateNotFound(let arg): + var d = try ["template_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("template_not_found") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TemplateError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "template_not_found": - let v = Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) - return TemplateError.templateNotFound(v) - case "restricted_content": - return TemplateError.restrictedContent - case "other": - return TemplateError.other - default: - return TemplateError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "template_not_found": + let v = try Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) + return TemplateError.templateNotFound(v) + case "restricted_content": + return TemplateError.restrictedContent + case "other": + return TemplateError.other default: - fatalError("Failed to deserialize") + return TemplateError.other + } + default: + throw JSONSerializerError.deserializeError(type: TemplateError.self, json: json) } } } /// The PropertiesError union - public enum PropertiesError: CustomStringConvertible { + public enum PropertiesError: CustomStringConvertible, JSONRepresentable { /// Template does not exist for the given identifier. case templateNotFound(String) /// You do not have permission to modify this template. @@ -110,64 +131,74 @@ open class FileProperties { /// This folder cannot be tagged. Tagging folders is not supported for team-owned templates. case unsupportedFolder + func json() throws -> JSON { + try PropertiesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesError: \(error)" + } } } - open class PropertiesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesError) -> JSON { + + public class PropertiesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesError) throws -> JSON { switch value { - case .templateNotFound(let arg): - var d = ["template_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("template_not_found") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .path(let arg): - var d = ["path": FileProperties.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedFolder: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_folder") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PropertiesError { + case .templateNotFound(let arg): + var d = try ["template_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("template_not_found") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .path(let arg): + var d = try ["path": FileProperties.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedFolder: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_folder") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PropertiesError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "template_not_found": - let v = Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) - return PropertiesError.templateNotFound(v) - case "restricted_content": - return PropertiesError.restrictedContent - case "other": - return PropertiesError.other - case "path": - let v = FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return PropertiesError.path(v) - case "unsupported_folder": - return PropertiesError.unsupportedFolder - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "template_not_found": + let v = try Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) + return PropertiesError.templateNotFound(v) + case "restricted_content": + return PropertiesError.restrictedContent + case "other": + return PropertiesError.other + case "path": + let v = try FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return PropertiesError.path(v) + case "unsupported_folder": + return PropertiesError.unsupportedFolder default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: PropertiesError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PropertiesError.self, json: json) } } } /// The InvalidPropertyGroupError union - public enum InvalidPropertyGroupError: CustomStringConvertible { + public enum InvalidPropertyGroupError: CustomStringConvertible, JSONRepresentable { /// Template does not exist for the given identifier. case templateNotFound(String) /// You do not have permission to modify this template. @@ -185,82 +216,92 @@ open class FileProperties { /// There are 2 or more property groups referring to the same templates in the input. case duplicatePropertyGroups + func json() throws -> JSON { + try InvalidPropertyGroupErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InvalidPropertyGroupErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InvalidPropertyGroupErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InvalidPropertyGroupError: \(error)" + } } } - open class InvalidPropertyGroupErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InvalidPropertyGroupError) -> JSON { + + public class InvalidPropertyGroupErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InvalidPropertyGroupError) throws -> JSON { switch value { - case .templateNotFound(let arg): - var d = ["template_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("template_not_found") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .path(let arg): - var d = ["path": FileProperties.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedFolder: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_folder") - return .dictionary(d) - case .propertyFieldTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("property_field_too_large") - return .dictionary(d) - case .doesNotFitTemplate: - var d = [String: JSON]() - d[".tag"] = .str("does_not_fit_template") - return .dictionary(d) - case .duplicatePropertyGroups: - var d = [String: JSON]() - d[".tag"] = .str("duplicate_property_groups") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> InvalidPropertyGroupError { + case .templateNotFound(let arg): + var d = try ["template_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("template_not_found") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .path(let arg): + var d = try ["path": FileProperties.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedFolder: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_folder") + return .dictionary(d) + case .propertyFieldTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("property_field_too_large") + return .dictionary(d) + case .doesNotFitTemplate: + var d = [String: JSON]() + d[".tag"] = .str("does_not_fit_template") + return .dictionary(d) + case .duplicatePropertyGroups: + var d = [String: JSON]() + d[".tag"] = .str("duplicate_property_groups") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> InvalidPropertyGroupError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "template_not_found": - let v = Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) - return InvalidPropertyGroupError.templateNotFound(v) - case "restricted_content": - return InvalidPropertyGroupError.restrictedContent - case "other": - return InvalidPropertyGroupError.other - case "path": - let v = FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return InvalidPropertyGroupError.path(v) - case "unsupported_folder": - return InvalidPropertyGroupError.unsupportedFolder - case "property_field_too_large": - return InvalidPropertyGroupError.propertyFieldTooLarge - case "does_not_fit_template": - return InvalidPropertyGroupError.doesNotFitTemplate - case "duplicate_property_groups": - return InvalidPropertyGroupError.duplicatePropertyGroups - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "template_not_found": + let v = try Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) + return InvalidPropertyGroupError.templateNotFound(v) + case "restricted_content": + return InvalidPropertyGroupError.restrictedContent + case "other": + return InvalidPropertyGroupError.other + case "path": + let v = try FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return InvalidPropertyGroupError.path(v) + case "unsupported_folder": + return InvalidPropertyGroupError.unsupportedFolder + case "property_field_too_large": + return InvalidPropertyGroupError.propertyFieldTooLarge + case "does_not_fit_template": + return InvalidPropertyGroupError.doesNotFitTemplate + case "duplicate_property_groups": + return InvalidPropertyGroupError.duplicatePropertyGroups default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: InvalidPropertyGroupError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: InvalidPropertyGroupError.self, json: json) } } } /// The AddPropertiesError union - public enum AddPropertiesError: CustomStringConvertible { + public enum AddPropertiesError: CustomStringConvertible, JSONRepresentable { /// Template does not exist for the given identifier. case templateNotFound(String) /// You do not have permission to modify this template. @@ -280,368 +321,454 @@ open class FileProperties { /// A property group associated with this template and file already exists. case propertyGroupAlreadyExists + func json() throws -> JSON { + try AddPropertiesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddPropertiesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddPropertiesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddPropertiesError: \(error)" + } } } - open class AddPropertiesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddPropertiesError) -> JSON { + + public class AddPropertiesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddPropertiesError) throws -> JSON { switch value { - case .templateNotFound(let arg): - var d = ["template_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("template_not_found") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .path(let arg): - var d = ["path": FileProperties.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedFolder: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_folder") - return .dictionary(d) - case .propertyFieldTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("property_field_too_large") - return .dictionary(d) - case .doesNotFitTemplate: - var d = [String: JSON]() - d[".tag"] = .str("does_not_fit_template") - return .dictionary(d) - case .duplicatePropertyGroups: - var d = [String: JSON]() - d[".tag"] = .str("duplicate_property_groups") - return .dictionary(d) - case .propertyGroupAlreadyExists: - var d = [String: JSON]() - d[".tag"] = .str("property_group_already_exists") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddPropertiesError { + case .templateNotFound(let arg): + var d = try ["template_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("template_not_found") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .path(let arg): + var d = try ["path": FileProperties.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedFolder: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_folder") + return .dictionary(d) + case .propertyFieldTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("property_field_too_large") + return .dictionary(d) + case .doesNotFitTemplate: + var d = [String: JSON]() + d[".tag"] = .str("does_not_fit_template") + return .dictionary(d) + case .duplicatePropertyGroups: + var d = [String: JSON]() + d[".tag"] = .str("duplicate_property_groups") + return .dictionary(d) + case .propertyGroupAlreadyExists: + var d = [String: JSON]() + d[".tag"] = .str("property_group_already_exists") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddPropertiesError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "template_not_found": - let v = Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) - return AddPropertiesError.templateNotFound(v) - case "restricted_content": - return AddPropertiesError.restrictedContent - case "other": - return AddPropertiesError.other - case "path": - let v = FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return AddPropertiesError.path(v) - case "unsupported_folder": - return AddPropertiesError.unsupportedFolder - case "property_field_too_large": - return AddPropertiesError.propertyFieldTooLarge - case "does_not_fit_template": - return AddPropertiesError.doesNotFitTemplate - case "duplicate_property_groups": - return AddPropertiesError.duplicatePropertyGroups - case "property_group_already_exists": - return AddPropertiesError.propertyGroupAlreadyExists - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "template_not_found": + let v = try Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) + return AddPropertiesError.templateNotFound(v) + case "restricted_content": + return AddPropertiesError.restrictedContent + case "other": + return AddPropertiesError.other + case "path": + let v = try FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return AddPropertiesError.path(v) + case "unsupported_folder": + return AddPropertiesError.unsupportedFolder + case "property_field_too_large": + return AddPropertiesError.propertyFieldTooLarge + case "does_not_fit_template": + return AddPropertiesError.doesNotFitTemplate + case "duplicate_property_groups": + return AddPropertiesError.duplicatePropertyGroups + case "property_group_already_exists": + return AddPropertiesError.propertyGroupAlreadyExists default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: AddPropertiesError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: AddPropertiesError.self, json: json) } } } /// Defines how a property group may be structured. - open class PropertyGroupTemplate: CustomStringConvertible { + public class PropertyGroupTemplate: CustomStringConvertible, JSONRepresentable { /// Display name for the template. Template names can be up to 256 bytes. public let name: String /// Description for the template. Template descriptions can be up to 1024 bytes. public let description_: String /// Definitions of the property fields associated with this template. There can be up to 32 properties in a /// single template. - public let fields: Array - public init(name: String, description_: String, fields: Array) { + public let fields: [FileProperties.PropertyFieldTemplate] + public init(name: String, description_: String, fields: [FileProperties.PropertyFieldTemplate]) { stringValidator()(name) self.name = name stringValidator()(description_) self.description_ = description_ self.fields = fields } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertyGroupTemplateSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertyGroupTemplateSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertyGroupTemplateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertyGroupTemplate: \(error)" + } } } - open class PropertyGroupTemplateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertyGroupTemplate) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "description": Serialization._StringSerializer.serialize(value.description_), - "fields": ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).serialize(value.fields), + + public class PropertyGroupTemplateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertyGroupTemplate) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "description": try Serialization._StringSerializer.serialize(value.description_), + "fields": try ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).serialize(value.fields), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertyGroupTemplate { + + public func deserialize(_ json: JSON) throws -> PropertyGroupTemplate { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - let fields = ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).deserialize(dict["fields"] ?? .null) - return PropertyGroupTemplate(name: name, description_: description_, fields: fields) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + let fields = try ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).deserialize(dict["fields"] ?? .null) + return PropertyGroupTemplate(name: name, description_: description_, fields: fields) + default: + throw JSONSerializerError.deserializeError(type: PropertyGroupTemplate.self, json: json) } } } /// The AddTemplateArg struct - open class AddTemplateArg: FileProperties.PropertyGroupTemplate { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddTemplateArgSerializer().serialize(self)))" - } - } - open class AddTemplateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddTemplateArg) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "description": Serialization._StringSerializer.serialize(value.description_), - "fields": ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).serialize(value.fields), + public class AddTemplateArg: FileProperties.PropertyGroupTemplate { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddTemplateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddTemplateArg: \(error)" + } + } + } + + public class AddTemplateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddTemplateArg) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "description": try Serialization._StringSerializer.serialize(value.description_), + "fields": try ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).serialize(value.fields), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddTemplateArg { + + public func deserialize(_ json: JSON) throws -> AddTemplateArg { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - let fields = ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).deserialize(dict["fields"] ?? .null) - return AddTemplateArg(name: name, description_: description_, fields: fields) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + let fields = try ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).deserialize(dict["fields"] ?? .null) + return AddTemplateArg(name: name, description_: description_, fields: fields) + default: + throw JSONSerializerError.deserializeError(type: AddTemplateArg.self, json: json) } } } /// The AddTemplateResult struct - open class AddTemplateResult: CustomStringConvertible { + public class AddTemplateResult: CustomStringConvertible, JSONRepresentable { /// An identifier for template added by See templatesAddForUser or templatesAddForTeam. public let templateId: String public init(templateId: String) { stringValidator(minLength: 1, pattern: "(/|ptid:).*")(templateId) self.templateId = templateId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddTemplateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddTemplateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddTemplateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddTemplateResult: \(error)" + } } } - open class AddTemplateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddTemplateResult) -> JSON { - let output = [ - "template_id": Serialization._StringSerializer.serialize(value.templateId), + + public class AddTemplateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddTemplateResult) throws -> JSON { + let output = [ + "template_id": try Serialization._StringSerializer.serialize(value.templateId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddTemplateResult { + + public func deserialize(_ json: JSON) throws -> AddTemplateResult { switch json { - case .dictionary(let dict): - let templateId = Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) - return AddTemplateResult(templateId: templateId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateId = try Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) + return AddTemplateResult(templateId: templateId) + default: + throw JSONSerializerError.deserializeError(type: AddTemplateResult.self, json: json) } } } /// The GetTemplateArg struct - open class GetTemplateArg: CustomStringConvertible { + public class GetTemplateArg: CustomStringConvertible, JSONRepresentable { /// An identifier for template added by route See templatesAddForUser or templatesAddForTeam. public let templateId: String public init(templateId: String) { stringValidator(minLength: 1, pattern: "(/|ptid:).*")(templateId) self.templateId = templateId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTemplateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTemplateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTemplateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTemplateArg: \(error)" + } } } - open class GetTemplateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTemplateArg) -> JSON { - let output = [ - "template_id": Serialization._StringSerializer.serialize(value.templateId), + + public class GetTemplateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTemplateArg) throws -> JSON { + let output = [ + "template_id": try Serialization._StringSerializer.serialize(value.templateId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTemplateArg { + + public func deserialize(_ json: JSON) throws -> GetTemplateArg { switch json { - case .dictionary(let dict): - let templateId = Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) - return GetTemplateArg(templateId: templateId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateId = try Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) + return GetTemplateArg(templateId: templateId) + default: + throw JSONSerializerError.deserializeError(type: GetTemplateArg.self, json: json) } } } /// The GetTemplateResult struct - open class GetTemplateResult: FileProperties.PropertyGroupTemplate { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTemplateResultSerializer().serialize(self)))" - } - } - open class GetTemplateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTemplateResult) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "description": Serialization._StringSerializer.serialize(value.description_), - "fields": ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).serialize(value.fields), + public class GetTemplateResult: FileProperties.PropertyGroupTemplate { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTemplateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTemplateResult: \(error)" + } + } + } + + public class GetTemplateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTemplateResult) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "description": try Serialization._StringSerializer.serialize(value.description_), + "fields": try ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).serialize(value.fields), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTemplateResult { + + public func deserialize(_ json: JSON) throws -> GetTemplateResult { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - let fields = ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).deserialize(dict["fields"] ?? .null) - return GetTemplateResult(name: name, description_: description_, fields: fields) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + let fields = try ArraySerializer(FileProperties.PropertyFieldTemplateSerializer()).deserialize(dict["fields"] ?? .null) + return GetTemplateResult(name: name, description_: description_, fields: fields) + default: + throw JSONSerializerError.deserializeError(type: GetTemplateResult.self, json: json) } } } /// The ListTemplateResult struct - open class ListTemplateResult: CustomStringConvertible { + public class ListTemplateResult: CustomStringConvertible, JSONRepresentable { /// List of identifiers for templates added by See templatesAddForUser or templatesAddForTeam. - public let templateIds: Array - public init(templateIds: Array) { + public let templateIds: [String] + public init(templateIds: [String]) { arrayValidator(itemValidator: stringValidator(minLength: 1, pattern: "(/|ptid:).*"))(templateIds) self.templateIds = templateIds } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListTemplateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListTemplateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListTemplateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListTemplateResult: \(error)" + } } } - open class ListTemplateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListTemplateResult) -> JSON { - let output = [ - "template_ids": ArraySerializer(Serialization._StringSerializer).serialize(value.templateIds), + + public class ListTemplateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListTemplateResult) throws -> JSON { + let output = [ + "template_ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.templateIds), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListTemplateResult { + + public func deserialize(_ json: JSON) throws -> ListTemplateResult { switch json { - case .dictionary(let dict): - let templateIds = ArraySerializer(Serialization._StringSerializer).deserialize(dict["template_ids"] ?? .null) - return ListTemplateResult(templateIds: templateIds) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateIds = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["template_ids"] ?? .null) + return ListTemplateResult(templateIds: templateIds) + default: + throw JSONSerializerError.deserializeError(type: ListTemplateResult.self, json: json) } } } /// Logical operator to join search queries together. - public enum LogicalOperator: CustomStringConvertible { + public enum LogicalOperator: CustomStringConvertible, JSONRepresentable { /// Append a query with an "or" operator. case orOperator /// An unspecified error. case other + func json() throws -> JSON { + try LogicalOperatorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LogicalOperatorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LogicalOperatorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LogicalOperator: \(error)" + } } } - open class LogicalOperatorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LogicalOperator) -> JSON { + + public class LogicalOperatorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LogicalOperator) throws -> JSON { switch value { - case .orOperator: - var d = [String: JSON]() - d[".tag"] = .str("or_operator") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .orOperator: + var d = [String: JSON]() + d[".tag"] = .str("or_operator") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> LogicalOperator { + + public func deserialize(_ json: JSON) throws -> LogicalOperator { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "or_operator": - return LogicalOperator.orOperator - case "other": - return LogicalOperator.other - default: - return LogicalOperator.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "or_operator": + return LogicalOperator.orOperator + case "other": + return LogicalOperator.other default: - fatalError("Failed to deserialize") + return LogicalOperator.other + } + default: + throw JSONSerializerError.deserializeError(type: LogicalOperator.self, json: json) } } } /// The LookUpPropertiesError union - public enum LookUpPropertiesError: CustomStringConvertible { + public enum LookUpPropertiesError: CustomStringConvertible, JSONRepresentable { /// No property group was found. case propertyGroupNotFound /// An unspecified error. case other + func json() throws -> JSON { + try LookUpPropertiesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LookUpPropertiesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LookUpPropertiesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LookUpPropertiesError: \(error)" + } } } - open class LookUpPropertiesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LookUpPropertiesError) -> JSON { + + public class LookUpPropertiesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LookUpPropertiesError) throws -> JSON { switch value { - case .propertyGroupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("property_group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .propertyGroupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("property_group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> LookUpPropertiesError { + + public func deserialize(_ json: JSON) throws -> LookUpPropertiesError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "property_group_not_found": - return LookUpPropertiesError.propertyGroupNotFound - case "other": - return LookUpPropertiesError.other - default: - return LookUpPropertiesError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "property_group_not_found": + return LookUpPropertiesError.propertyGroupNotFound + case "other": + return LookUpPropertiesError.other default: - fatalError("Failed to deserialize") + return LookUpPropertiesError.other + } + default: + throw JSONSerializerError.deserializeError(type: LookUpPropertiesError.self, json: json) } } } /// The LookupError union - public enum LookupError: CustomStringConvertible { + public enum LookupError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case malformedPath(String) /// There is nothing at the given path. @@ -656,69 +783,79 @@ open class FileProperties { /// An unspecified error. case other + func json() throws -> JSON { + try LookupErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LookupErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LookupErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LookupError: \(error)" + } } } - open class LookupErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LookupError) -> JSON { + + public class LookupErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LookupError) throws -> JSON { switch value { - case .malformedPath(let arg): - var d = ["malformed_path": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("malformed_path") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notFile: - var d = [String: JSON]() - d[".tag"] = .str("not_file") - return .dictionary(d) - case .notFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_folder") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LookupError { + case .malformedPath(let arg): + var d = try ["malformed_path": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("malformed_path") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notFile: + var d = [String: JSON]() + d[".tag"] = .str("not_file") + return .dictionary(d) + case .notFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_folder") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LookupError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "malformed_path": - let v = Serialization._StringSerializer.deserialize(d["malformed_path"] ?? .null) - return LookupError.malformedPath(v) - case "not_found": - return LookupError.notFound - case "not_file": - return LookupError.notFile - case "not_folder": - return LookupError.notFolder - case "restricted_content": - return LookupError.restrictedContent - case "other": - return LookupError.other - default: - return LookupError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "malformed_path": + let v = try Serialization._StringSerializer.deserialize(d["malformed_path"] ?? .null) + return LookupError.malformedPath(v) + case "not_found": + return LookupError.notFound + case "not_file": + return LookupError.notFile + case "not_folder": + return LookupError.notFolder + case "restricted_content": + return LookupError.restrictedContent + case "other": + return LookupError.other default: - fatalError("Failed to deserialize") + return LookupError.other + } + default: + throw JSONSerializerError.deserializeError(type: LookupError.self, json: json) } } } /// The ModifyTemplateError union - public enum ModifyTemplateError: CustomStringConvertible { + public enum ModifyTemplateError: CustomStringConvertible, JSONRepresentable { /// Template does not exist for the given identifier. case templateNotFound(String) /// You do not have permission to modify this template. @@ -734,265 +871,329 @@ open class FileProperties { /// The template name, description or one or more of the property field keys is too large. case templateAttributeTooLarge + func json() throws -> JSON { + try ModifyTemplateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ModifyTemplateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ModifyTemplateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ModifyTemplateError: \(error)" + } } } - open class ModifyTemplateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ModifyTemplateError) -> JSON { + + public class ModifyTemplateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ModifyTemplateError) throws -> JSON { switch value { - case .templateNotFound(let arg): - var d = ["template_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("template_not_found") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .conflictingPropertyNames: - var d = [String: JSON]() - d[".tag"] = .str("conflicting_property_names") - return .dictionary(d) - case .tooManyProperties: - var d = [String: JSON]() - d[".tag"] = .str("too_many_properties") - return .dictionary(d) - case .tooManyTemplates: - var d = [String: JSON]() - d[".tag"] = .str("too_many_templates") - return .dictionary(d) - case .templateAttributeTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("template_attribute_too_large") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ModifyTemplateError { + case .templateNotFound(let arg): + var d = try ["template_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("template_not_found") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .conflictingPropertyNames: + var d = [String: JSON]() + d[".tag"] = .str("conflicting_property_names") + return .dictionary(d) + case .tooManyProperties: + var d = [String: JSON]() + d[".tag"] = .str("too_many_properties") + return .dictionary(d) + case .tooManyTemplates: + var d = [String: JSON]() + d[".tag"] = .str("too_many_templates") + return .dictionary(d) + case .templateAttributeTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("template_attribute_too_large") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ModifyTemplateError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "template_not_found": - let v = Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) - return ModifyTemplateError.templateNotFound(v) - case "restricted_content": - return ModifyTemplateError.restrictedContent - case "other": - return ModifyTemplateError.other - case "conflicting_property_names": - return ModifyTemplateError.conflictingPropertyNames - case "too_many_properties": - return ModifyTemplateError.tooManyProperties - case "too_many_templates": - return ModifyTemplateError.tooManyTemplates - case "template_attribute_too_large": - return ModifyTemplateError.templateAttributeTooLarge - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "template_not_found": + let v = try Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) + return ModifyTemplateError.templateNotFound(v) + case "restricted_content": + return ModifyTemplateError.restrictedContent + case "other": + return ModifyTemplateError.other + case "conflicting_property_names": + return ModifyTemplateError.conflictingPropertyNames + case "too_many_properties": + return ModifyTemplateError.tooManyProperties + case "too_many_templates": + return ModifyTemplateError.tooManyTemplates + case "template_attribute_too_large": + return ModifyTemplateError.templateAttributeTooLarge default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ModifyTemplateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ModifyTemplateError.self, json: json) } } } /// The OverwritePropertyGroupArg struct - open class OverwritePropertyGroupArg: CustomStringConvertible { + public class OverwritePropertyGroupArg: CustomStringConvertible, JSONRepresentable { /// A unique identifier for the file or folder. public let path: String /// The property groups "snapshot" updates to force apply. No two groups in the input should refer to the same /// template. - public let propertyGroups: Array - public init(path: String, propertyGroups: Array) { + public let propertyGroups: [FileProperties.PropertyGroup] + public init(path: String, propertyGroups: [FileProperties.PropertyGroup]) { stringValidator(pattern: "/(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)")(path) self.path = path self.propertyGroups = propertyGroups } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OverwritePropertyGroupArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try OverwritePropertyGroupArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OverwritePropertyGroupArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OverwritePropertyGroupArg: \(error)" + } } } - open class OverwritePropertyGroupArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OverwritePropertyGroupArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "property_groups": ArraySerializer(FileProperties.PropertyGroupSerializer()).serialize(value.propertyGroups), + + public class OverwritePropertyGroupArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OverwritePropertyGroupArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "property_groups": try ArraySerializer(FileProperties.PropertyGroupSerializer()).serialize(value.propertyGroups), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OverwritePropertyGroupArg { + + public func deserialize(_ json: JSON) throws -> OverwritePropertyGroupArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let propertyGroups = ArraySerializer(FileProperties.PropertyGroupSerializer()).deserialize(dict["property_groups"] ?? .null) - return OverwritePropertyGroupArg(path: path, propertyGroups: propertyGroups) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let propertyGroups = try ArraySerializer(FileProperties.PropertyGroupSerializer()).deserialize(dict["property_groups"] ?? .null) + return OverwritePropertyGroupArg(path: path, propertyGroups: propertyGroups) + default: + throw JSONSerializerError.deserializeError(type: OverwritePropertyGroupArg.self, json: json) } } } /// The PropertiesSearchArg struct - open class PropertiesSearchArg: CustomStringConvertible { + public class PropertiesSearchArg: CustomStringConvertible, JSONRepresentable { /// Queries to search. - public let queries: Array + public let queries: [FileProperties.PropertiesSearchQuery] /// Filter results to contain only properties associated with these template IDs. public let templateFilter: FileProperties.TemplateFilter - public init(queries: Array, templateFilter: FileProperties.TemplateFilter = .filterNone) { + public init(queries: [FileProperties.PropertiesSearchQuery], templateFilter: FileProperties.TemplateFilter = .filterNone) { self.queries = queries self.templateFilter = templateFilter } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertiesSearchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchArg: \(error)" + } } } - open class PropertiesSearchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchArg) -> JSON { - let output = [ - "queries": ArraySerializer(FileProperties.PropertiesSearchQuerySerializer()).serialize(value.queries), - "template_filter": FileProperties.TemplateFilterSerializer().serialize(value.templateFilter), + + public class PropertiesSearchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchArg) throws -> JSON { + let output = [ + "queries": try ArraySerializer(FileProperties.PropertiesSearchQuerySerializer()).serialize(value.queries), + "template_filter": try FileProperties.TemplateFilterSerializer().serialize(value.templateFilter), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertiesSearchArg { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchArg { switch json { - case .dictionary(let dict): - let queries = ArraySerializer(FileProperties.PropertiesSearchQuerySerializer()).deserialize(dict["queries"] ?? .null) - let templateFilter = FileProperties.TemplateFilterSerializer().deserialize(dict["template_filter"] ?? FileProperties.TemplateFilterSerializer().serialize(.filterNone)) - return PropertiesSearchArg(queries: queries, templateFilter: templateFilter) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let queries = try ArraySerializer(FileProperties.PropertiesSearchQuerySerializer()).deserialize(dict["queries"] ?? .null) + let templateFilter = try FileProperties.TemplateFilterSerializer() + .deserialize(dict["template_filter"] ?? FileProperties.TemplateFilterSerializer().serialize(.filterNone)) + return PropertiesSearchArg(queries: queries, templateFilter: templateFilter) + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchArg.self, json: json) } } } /// The PropertiesSearchContinueArg struct - open class PropertiesSearchContinueArg: CustomStringConvertible { + public class PropertiesSearchContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned by your last call to propertiesSearch or propertiesSearchContinue. public let cursor: String public init(cursor: String) { stringValidator(minLength: 1)(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertiesSearchContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchContinueArg: \(error)" + } } } - open class PropertiesSearchContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class PropertiesSearchContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertiesSearchContinueArg { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return PropertiesSearchContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return PropertiesSearchContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchContinueArg.self, json: json) } } } /// The PropertiesSearchContinueError union - public enum PropertiesSearchContinueError: CustomStringConvertible { + public enum PropertiesSearchContinueError: CustomStringConvertible, JSONRepresentable { /// Indicates that the cursor has been invalidated. Call propertiesSearch to obtain a new cursor. case reset /// An unspecified error. case other + func json() throws -> JSON { + try PropertiesSearchContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchContinueError: \(error)" + } } } - open class PropertiesSearchContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchContinueError) -> JSON { + + public class PropertiesSearchContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchContinueError) throws -> JSON { switch value { - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PropertiesSearchContinueError { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchContinueError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "reset": - return PropertiesSearchContinueError.reset - case "other": - return PropertiesSearchContinueError.other - default: - return PropertiesSearchContinueError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "reset": + return PropertiesSearchContinueError.reset + case "other": + return PropertiesSearchContinueError.other default: - fatalError("Failed to deserialize") + return PropertiesSearchContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchContinueError.self, json: json) } } } /// The PropertiesSearchError union - public enum PropertiesSearchError: CustomStringConvertible { + public enum PropertiesSearchError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case propertyGroupLookup(FileProperties.LookUpPropertiesError) /// An unspecified error. case other + func json() throws -> JSON { + try PropertiesSearchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchError: \(error)" + } } } - open class PropertiesSearchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchError) -> JSON { + + public class PropertiesSearchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchError) throws -> JSON { switch value { - case .propertyGroupLookup(let arg): - var d = ["property_group_lookup": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] - d[".tag"] = .str("property_group_lookup") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .propertyGroupLookup(let arg): + var d = try ["property_group_lookup": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] + d[".tag"] = .str("property_group_lookup") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PropertiesSearchError { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "property_group_lookup": - let v = FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["property_group_lookup"] ?? .null) - return PropertiesSearchError.propertyGroupLookup(v) - case "other": - return PropertiesSearchError.other - default: - return PropertiesSearchError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "property_group_lookup": + let v = try FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["property_group_lookup"] ?? .null) + return PropertiesSearchError.propertyGroupLookup(v) + case "other": + return PropertiesSearchError.other default: - fatalError("Failed to deserialize") + return PropertiesSearchError.other + } + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchError.self, json: json) } } } /// The PropertiesSearchMatch struct - open class PropertiesSearchMatch: CustomStringConvertible { + public class PropertiesSearchMatch: CustomStringConvertible, JSONRepresentable { /// The ID for the matched file or folder. public let id: String /// The path for the matched file or folder. @@ -1000,8 +1201,8 @@ open class FileProperties { /// Whether the file or folder is deleted. public let isDeleted: Bool /// List of custom property groups associated with the file. - public let propertyGroups: Array - public init(id: String, path: String, isDeleted: Bool, propertyGroups: Array) { + public let propertyGroups: [FileProperties.PropertyGroup] + public init(id: String, path: String, isDeleted: Bool, propertyGroups: [FileProperties.PropertyGroup]) { stringValidator(minLength: 1)(id) self.id = id stringValidator()(path) @@ -1009,81 +1210,102 @@ open class FileProperties { self.isDeleted = isDeleted self.propertyGroups = propertyGroups } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchMatchSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertiesSearchMatchSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchMatchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchMatch: \(error)" + } } } - open class PropertiesSearchMatchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchMatch) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "path": Serialization._StringSerializer.serialize(value.path), - "is_deleted": Serialization._BoolSerializer.serialize(value.isDeleted), - "property_groups": ArraySerializer(FileProperties.PropertyGroupSerializer()).serialize(value.propertyGroups), + + public class PropertiesSearchMatchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchMatch) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "path": try Serialization._StringSerializer.serialize(value.path), + "is_deleted": try Serialization._BoolSerializer.serialize(value.isDeleted), + "property_groups": try ArraySerializer(FileProperties.PropertyGroupSerializer()).serialize(value.propertyGroups), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertiesSearchMatch { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchMatch { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let isDeleted = Serialization._BoolSerializer.deserialize(dict["is_deleted"] ?? .null) - let propertyGroups = ArraySerializer(FileProperties.PropertyGroupSerializer()).deserialize(dict["property_groups"] ?? .null) - return PropertiesSearchMatch(id: id, path: path, isDeleted: isDeleted, propertyGroups: propertyGroups) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let isDeleted = try Serialization._BoolSerializer.deserialize(dict["is_deleted"] ?? .null) + let propertyGroups = try ArraySerializer(FileProperties.PropertyGroupSerializer()).deserialize(dict["property_groups"] ?? .null) + return PropertiesSearchMatch(id: id, path: path, isDeleted: isDeleted, propertyGroups: propertyGroups) + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchMatch.self, json: json) } } } /// The PropertiesSearchMode union - public enum PropertiesSearchMode: CustomStringConvertible { + public enum PropertiesSearchMode: CustomStringConvertible, JSONRepresentable { /// Search for a value associated with this field name. case fieldName(String) /// An unspecified error. case other + func json() throws -> JSON { + try PropertiesSearchModeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchModeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchModeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchMode: \(error)" + } } } - open class PropertiesSearchModeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchMode) -> JSON { + + public class PropertiesSearchModeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchMode) throws -> JSON { switch value { - case .fieldName(let arg): - var d = ["field_name": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("field_name") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .fieldName(let arg): + var d = try ["field_name": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("field_name") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PropertiesSearchMode { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchMode { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "field_name": - let v = Serialization._StringSerializer.deserialize(d["field_name"] ?? .null) - return PropertiesSearchMode.fieldName(v) - case "other": - return PropertiesSearchMode.other - default: - return PropertiesSearchMode.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "field_name": + let v = try Serialization._StringSerializer.deserialize(d["field_name"] ?? .null) + return PropertiesSearchMode.fieldName(v) + case "other": + return PropertiesSearchMode.other default: - fatalError("Failed to deserialize") + return PropertiesSearchMode.other + } + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchMode.self, json: json) } } } /// The PropertiesSearchQuery struct - open class PropertiesSearchQuery: CustomStringConvertible { + public class PropertiesSearchQuery: CustomStringConvertible, JSONRepresentable { /// The property field value for which to search across templates. public let query: String /// The mode with which to perform the search. @@ -1096,73 +1318,96 @@ open class FileProperties { self.mode = mode self.logicalOperator = logicalOperator } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchQuerySerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertiesSearchQuerySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchQuerySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchQuery: \(error)" + } } } - open class PropertiesSearchQuerySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchQuery) -> JSON { - let output = [ - "query": Serialization._StringSerializer.serialize(value.query), - "mode": FileProperties.PropertiesSearchModeSerializer().serialize(value.mode), - "logical_operator": FileProperties.LogicalOperatorSerializer().serialize(value.logicalOperator), + + public class PropertiesSearchQuerySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchQuery) throws -> JSON { + let output = [ + "query": try Serialization._StringSerializer.serialize(value.query), + "mode": try FileProperties.PropertiesSearchModeSerializer().serialize(value.mode), + "logical_operator": try FileProperties.LogicalOperatorSerializer().serialize(value.logicalOperator), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertiesSearchQuery { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchQuery { switch json { - case .dictionary(let dict): - let query = Serialization._StringSerializer.deserialize(dict["query"] ?? .null) - let mode = FileProperties.PropertiesSearchModeSerializer().deserialize(dict["mode"] ?? .null) - let logicalOperator = FileProperties.LogicalOperatorSerializer().deserialize(dict["logical_operator"] ?? FileProperties.LogicalOperatorSerializer().serialize(.orOperator)) - return PropertiesSearchQuery(query: query, mode: mode, logicalOperator: logicalOperator) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let query = try Serialization._StringSerializer.deserialize(dict["query"] ?? .null) + let mode = try FileProperties.PropertiesSearchModeSerializer().deserialize(dict["mode"] ?? .null) + let logicalOperator = try FileProperties.LogicalOperatorSerializer() + .deserialize(dict["logical_operator"] ?? FileProperties.LogicalOperatorSerializer().serialize(.orOperator)) + return PropertiesSearchQuery(query: query, mode: mode, logicalOperator: logicalOperator) + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchQuery.self, json: json) } } } /// The PropertiesSearchResult struct - open class PropertiesSearchResult: CustomStringConvertible { + public class PropertiesSearchResult: CustomStringConvertible, JSONRepresentable { /// A list (possibly empty) of matches for the query. - public let matches: Array + public let matches: [FileProperties.PropertiesSearchMatch] /// Pass the cursor into propertiesSearchContinue to continue to receive search results. Cursor will be null /// when there are no more results. public let cursor: String? - public init(matches: Array, cursor: String? = nil) { + public init(matches: [FileProperties.PropertiesSearchMatch], cursor: String? = nil) { self.matches = matches nullableValidator(stringValidator(minLength: 1))(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertiesSearchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertiesSearchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertiesSearchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertiesSearchResult: \(error)" + } } } - open class PropertiesSearchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertiesSearchResult) -> JSON { - let output = [ - "matches": ArraySerializer(FileProperties.PropertiesSearchMatchSerializer()).serialize(value.matches), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class PropertiesSearchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertiesSearchResult) throws -> JSON { + let output = [ + "matches": try ArraySerializer(FileProperties.PropertiesSearchMatchSerializer()).serialize(value.matches), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertiesSearchResult { + + public func deserialize(_ json: JSON) throws -> PropertiesSearchResult { switch json { - case .dictionary(let dict): - let matches = ArraySerializer(FileProperties.PropertiesSearchMatchSerializer()).deserialize(dict["matches"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return PropertiesSearchResult(matches: matches, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let matches = try ArraySerializer(FileProperties.PropertiesSearchMatchSerializer()).deserialize(dict["matches"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return PropertiesSearchResult(matches: matches, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: PropertiesSearchResult.self, json: json) } } } /// Raw key/value data to be associated with a Dropbox file. Property fields are added to Dropbox files as a /// PropertyGroup. - open class PropertyField: CustomStringConvertible { + public class PropertyField: CustomStringConvertible, JSONRepresentable { /// Key of the property field associated with a file and template. Keys can be up to 256 bytes. public let name: String /// Value of the property field associated with a file and template. Values can be up to 1024 bytes. @@ -1173,33 +1418,44 @@ open class FileProperties { stringValidator()(value) self.value = value } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertyFieldSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertyFieldSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertyFieldSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertyField: \(error)" + } } } - open class PropertyFieldSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertyField) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "value": Serialization._StringSerializer.serialize(value.value), + + public class PropertyFieldSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertyField) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "value": try Serialization._StringSerializer.serialize(value.value), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertyField { + + public func deserialize(_ json: JSON) throws -> PropertyField { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let value = Serialization._StringSerializer.deserialize(dict["value"] ?? .null) - return PropertyField(name: name, value: value) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let value = try Serialization._StringSerializer.deserialize(dict["value"] ?? .null) + return PropertyField(name: name, value: value) + default: + throw JSONSerializerError.deserializeError(type: PropertyField.self, json: json) } } } /// Defines how a single property field may be structured. Used exclusively by PropertyGroupTemplate. - open class PropertyFieldTemplate: CustomStringConvertible { + public class PropertyFieldTemplate: CustomStringConvertible, JSONRepresentable { /// Key of the property field being described. Property field keys can be up to 256 bytes. public let name: String /// Description of the property field. Property field descriptions can be up to 1024 bytes. @@ -1214,196 +1470,251 @@ open class FileProperties { self.description_ = description_ self.type = type } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertyFieldTemplateSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertyFieldTemplateSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertyFieldTemplateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertyFieldTemplate: \(error)" + } } } - open class PropertyFieldTemplateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertyFieldTemplate) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "description": Serialization._StringSerializer.serialize(value.description_), - "type": FileProperties.PropertyTypeSerializer().serialize(value.type), + + public class PropertyFieldTemplateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertyFieldTemplate) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "description": try Serialization._StringSerializer.serialize(value.description_), + "type": try FileProperties.PropertyTypeSerializer().serialize(value.type), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertyFieldTemplate { + + public func deserialize(_ json: JSON) throws -> PropertyFieldTemplate { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - let type = FileProperties.PropertyTypeSerializer().deserialize(dict["type"] ?? .null) - return PropertyFieldTemplate(name: name, description_: description_, type: type) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + let type = try FileProperties.PropertyTypeSerializer().deserialize(dict["type"] ?? .null) + return PropertyFieldTemplate(name: name, description_: description_, type: type) + default: + throw JSONSerializerError.deserializeError(type: PropertyFieldTemplate.self, json: json) } } } /// A subset of the property fields described by the corresponding PropertyGroupTemplate. Properties are always - /// added to a Dropbox file as a PropertyGroup. The possible key names and value types in this group are defined by - /// the corresponding PropertyGroupTemplate. - open class PropertyGroup: CustomStringConvertible { + /// added to a Dropbox file as a PropertyGroup. The possible key names and value types in this group are defined + /// by the corresponding PropertyGroupTemplate. + public class PropertyGroup: CustomStringConvertible, JSONRepresentable { /// A unique identifier for the associated template. public let templateId: String /// The actual properties associated with the template. There can be up to 32 property types per template. - public let fields: Array - public init(templateId: String, fields: Array) { + public let fields: [FileProperties.PropertyField] + public init(templateId: String, fields: [FileProperties.PropertyField]) { stringValidator(minLength: 1, pattern: "(/|ptid:).*")(templateId) self.templateId = templateId self.fields = fields } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertyGroupSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertyGroupSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertyGroupSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertyGroup: \(error)" + } } } - open class PropertyGroupSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertyGroup) -> JSON { - let output = [ - "template_id": Serialization._StringSerializer.serialize(value.templateId), - "fields": ArraySerializer(FileProperties.PropertyFieldSerializer()).serialize(value.fields), + + public class PropertyGroupSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertyGroup) throws -> JSON { + let output = [ + "template_id": try Serialization._StringSerializer.serialize(value.templateId), + "fields": try ArraySerializer(FileProperties.PropertyFieldSerializer()).serialize(value.fields), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertyGroup { + + public func deserialize(_ json: JSON) throws -> PropertyGroup { switch json { - case .dictionary(let dict): - let templateId = Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) - let fields = ArraySerializer(FileProperties.PropertyFieldSerializer()).deserialize(dict["fields"] ?? .null) - return PropertyGroup(templateId: templateId, fields: fields) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateId = try Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) + let fields = try ArraySerializer(FileProperties.PropertyFieldSerializer()).deserialize(dict["fields"] ?? .null) + return PropertyGroup(templateId: templateId, fields: fields) + default: + throw JSONSerializerError.deserializeError(type: PropertyGroup.self, json: json) } } } /// The PropertyGroupUpdate struct - open class PropertyGroupUpdate: CustomStringConvertible { + public class PropertyGroupUpdate: CustomStringConvertible, JSONRepresentable { /// A unique identifier for a property template. public let templateId: String /// Property fields to update. If the property field already exists, it is updated. If the property field /// doesn't exist, the property group is added. - public let addOrUpdateFields: Array? + public let addOrUpdateFields: [FileProperties.PropertyField]? /// Property fields to remove (by name), provided they exist. - public let removeFields: Array? - public init(templateId: String, addOrUpdateFields: Array? = nil, removeFields: Array? = nil) { + public let removeFields: [String]? + public init(templateId: String, addOrUpdateFields: [FileProperties.PropertyField]? = nil, removeFields: [String]? = nil) { stringValidator(minLength: 1, pattern: "(/|ptid:).*")(templateId) self.templateId = templateId self.addOrUpdateFields = addOrUpdateFields nullableValidator(arrayValidator(itemValidator: stringValidator()))(removeFields) self.removeFields = removeFields } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertyGroupUpdateSerializer().serialize(self)))" + + func json() throws -> JSON { + try PropertyGroupUpdateSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertyGroupUpdateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertyGroupUpdate: \(error)" + } } } - open class PropertyGroupUpdateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertyGroupUpdate) -> JSON { - let output = [ - "template_id": Serialization._StringSerializer.serialize(value.templateId), - "add_or_update_fields": NullableSerializer(ArraySerializer(FileProperties.PropertyFieldSerializer())).serialize(value.addOrUpdateFields), - "remove_fields": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.removeFields), + + public class PropertyGroupUpdateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertyGroupUpdate) throws -> JSON { + let output = [ + "template_id": try Serialization._StringSerializer.serialize(value.templateId), + "add_or_update_fields": try NullableSerializer(ArraySerializer(FileProperties.PropertyFieldSerializer())).serialize(value.addOrUpdateFields), + "remove_fields": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.removeFields), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PropertyGroupUpdate { + + public func deserialize(_ json: JSON) throws -> PropertyGroupUpdate { switch json { - case .dictionary(let dict): - let templateId = Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) - let addOrUpdateFields = NullableSerializer(ArraySerializer(FileProperties.PropertyFieldSerializer())).deserialize(dict["add_or_update_fields"] ?? .null) - let removeFields = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["remove_fields"] ?? .null) - return PropertyGroupUpdate(templateId: templateId, addOrUpdateFields: addOrUpdateFields, removeFields: removeFields) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateId = try Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) + let addOrUpdateFields = try NullableSerializer(ArraySerializer(FileProperties.PropertyFieldSerializer())) + .deserialize(dict["add_or_update_fields"] ?? .null) + let removeFields = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["remove_fields"] ?? .null) + return PropertyGroupUpdate(templateId: templateId, addOrUpdateFields: addOrUpdateFields, removeFields: removeFields) + default: + throw JSONSerializerError.deserializeError(type: PropertyGroupUpdate.self, json: json) } } } /// Data type of the given property field added. - public enum PropertyType: CustomStringConvertible { + public enum PropertyType: CustomStringConvertible, JSONRepresentable { /// The associated property field will be of type string. Unicode is supported. case string_ /// An unspecified error. case other + func json() throws -> JSON { + try PropertyTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PropertyTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PropertyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PropertyType: \(error)" + } } } - open class PropertyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PropertyType) -> JSON { + + public class PropertyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PropertyType) throws -> JSON { switch value { - case .string_: - var d = [String: JSON]() - d[".tag"] = .str("string") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .string_: + var d = [String: JSON]() + d[".tag"] = .str("string") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PropertyType { + + public func deserialize(_ json: JSON) throws -> PropertyType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "string": - return PropertyType.string_ - case "other": - return PropertyType.other - default: - return PropertyType.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "string": + return PropertyType.string_ + case "other": + return PropertyType.other default: - fatalError("Failed to deserialize") + return PropertyType.other + } + default: + throw JSONSerializerError.deserializeError(type: PropertyType.self, json: json) } } } /// The RemovePropertiesArg struct - open class RemovePropertiesArg: CustomStringConvertible { + public class RemovePropertiesArg: CustomStringConvertible, JSONRepresentable { /// A unique identifier for the file or folder. public let path: String /// A list of identifiers for a template created by templatesAddForUser or templatesAddForTeam. - public let propertyTemplateIds: Array - public init(path: String, propertyTemplateIds: Array) { + public let propertyTemplateIds: [String] + public init(path: String, propertyTemplateIds: [String]) { stringValidator(pattern: "/(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)")(path) self.path = path arrayValidator(itemValidator: stringValidator(minLength: 1, pattern: "(/|ptid:).*"))(propertyTemplateIds) self.propertyTemplateIds = propertyTemplateIds } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemovePropertiesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RemovePropertiesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemovePropertiesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemovePropertiesArg: \(error)" + } } } - open class RemovePropertiesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemovePropertiesArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "property_template_ids": ArraySerializer(Serialization._StringSerializer).serialize(value.propertyTemplateIds), + + public class RemovePropertiesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemovePropertiesArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "property_template_ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.propertyTemplateIds), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RemovePropertiesArg { + + public func deserialize(_ json: JSON) throws -> RemovePropertiesArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let propertyTemplateIds = ArraySerializer(Serialization._StringSerializer).deserialize(dict["property_template_ids"] ?? .null) - return RemovePropertiesArg(path: path, propertyTemplateIds: propertyTemplateIds) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let propertyTemplateIds = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["property_template_ids"] ?? .null) + return RemovePropertiesArg(path: path, propertyTemplateIds: propertyTemplateIds) + default: + throw JSONSerializerError.deserializeError(type: RemovePropertiesArg.self, json: json) } } } /// The RemovePropertiesError union - public enum RemovePropertiesError: CustomStringConvertible { + public enum RemovePropertiesError: CustomStringConvertible, JSONRepresentable { /// Template does not exist for the given identifier. case templateNotFound(String) /// You do not have permission to modify this template. @@ -1417,198 +1728,239 @@ open class FileProperties { /// An unspecified error. case propertyGroupLookup(FileProperties.LookUpPropertiesError) + func json() throws -> JSON { + try RemovePropertiesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemovePropertiesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemovePropertiesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemovePropertiesError: \(error)" + } } } - open class RemovePropertiesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemovePropertiesError) -> JSON { + + public class RemovePropertiesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemovePropertiesError) throws -> JSON { switch value { - case .templateNotFound(let arg): - var d = ["template_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("template_not_found") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .path(let arg): - var d = ["path": FileProperties.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedFolder: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_folder") - return .dictionary(d) - case .propertyGroupLookup(let arg): - var d = ["property_group_lookup": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] - d[".tag"] = .str("property_group_lookup") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RemovePropertiesError { + case .templateNotFound(let arg): + var d = try ["template_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("template_not_found") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .path(let arg): + var d = try ["path": FileProperties.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedFolder: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_folder") + return .dictionary(d) + case .propertyGroupLookup(let arg): + var d = try ["property_group_lookup": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] + d[".tag"] = .str("property_group_lookup") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RemovePropertiesError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "template_not_found": - let v = Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) - return RemovePropertiesError.templateNotFound(v) - case "restricted_content": - return RemovePropertiesError.restrictedContent - case "other": - return RemovePropertiesError.other - case "path": - let v = FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return RemovePropertiesError.path(v) - case "unsupported_folder": - return RemovePropertiesError.unsupportedFolder - case "property_group_lookup": - let v = FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["property_group_lookup"] ?? .null) - return RemovePropertiesError.propertyGroupLookup(v) - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "template_not_found": + let v = try Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) + return RemovePropertiesError.templateNotFound(v) + case "restricted_content": + return RemovePropertiesError.restrictedContent + case "other": + return RemovePropertiesError.other + case "path": + let v = try FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return RemovePropertiesError.path(v) + case "unsupported_folder": + return RemovePropertiesError.unsupportedFolder + case "property_group_lookup": + let v = try FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["property_group_lookup"] ?? .null) + return RemovePropertiesError.propertyGroupLookup(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RemovePropertiesError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RemovePropertiesError.self, json: json) } } } /// The RemoveTemplateArg struct - open class RemoveTemplateArg: CustomStringConvertible { + public class RemoveTemplateArg: CustomStringConvertible, JSONRepresentable { /// An identifier for a template created by templatesAddForUser or templatesAddForTeam. public let templateId: String public init(templateId: String) { stringValidator(minLength: 1, pattern: "(/|ptid:).*")(templateId) self.templateId = templateId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveTemplateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RemoveTemplateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveTemplateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveTemplateArg: \(error)" + } } } - open class RemoveTemplateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveTemplateArg) -> JSON { - let output = [ - "template_id": Serialization._StringSerializer.serialize(value.templateId), + + public class RemoveTemplateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveTemplateArg) throws -> JSON { + let output = [ + "template_id": try Serialization._StringSerializer.serialize(value.templateId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RemoveTemplateArg { + + public func deserialize(_ json: JSON) throws -> RemoveTemplateArg { switch json { - case .dictionary(let dict): - let templateId = Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) - return RemoveTemplateArg(templateId: templateId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateId = try Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) + return RemoveTemplateArg(templateId: templateId) + default: + throw JSONSerializerError.deserializeError(type: RemoveTemplateArg.self, json: json) } } } /// The TemplateFilterBase union - public enum TemplateFilterBase: CustomStringConvertible { + public enum TemplateFilterBase: CustomStringConvertible, JSONRepresentable { /// Only templates with an ID in the supplied list will be returned (a subset of templates will be returned). - case filterSome(Array) + case filterSome([String]) /// An unspecified error. case other + func json() throws -> JSON { + try TemplateFilterBaseSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TemplateFilterBaseSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TemplateFilterBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TemplateFilterBase: \(error)" + } } } - open class TemplateFilterBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TemplateFilterBase) -> JSON { + + public class TemplateFilterBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TemplateFilterBase) throws -> JSON { switch value { - case .filterSome(let arg): - var d = ["filter_some": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("filter_some") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .filterSome(let arg): + var d = try ["filter_some": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("filter_some") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> TemplateFilterBase { + + public func deserialize(_ json: JSON) throws -> TemplateFilterBase { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "filter_some": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["filter_some"] ?? .null) - return TemplateFilterBase.filterSome(v) - case "other": - return TemplateFilterBase.other - default: - return TemplateFilterBase.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "filter_some": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["filter_some"] ?? .null) + return TemplateFilterBase.filterSome(v) + case "other": + return TemplateFilterBase.other default: - fatalError("Failed to deserialize") + return TemplateFilterBase.other + } + default: + throw JSONSerializerError.deserializeError(type: TemplateFilterBase.self, json: json) } } } /// The TemplateFilter union - public enum TemplateFilter: CustomStringConvertible { + public enum TemplateFilter: CustomStringConvertible, JSONRepresentable { /// Only templates with an ID in the supplied list will be returned (a subset of templates will be returned). - case filterSome(Array) + case filterSome([String]) /// An unspecified error. case other /// No templates will be filtered from the result (all templates will be returned). case filterNone + func json() throws -> JSON { + try TemplateFilterSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TemplateFilterSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TemplateFilterSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TemplateFilter: \(error)" + } } } - open class TemplateFilterSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TemplateFilter) -> JSON { + + public class TemplateFilterSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TemplateFilter) throws -> JSON { switch value { - case .filterSome(let arg): - var d = ["filter_some": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("filter_some") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .filterNone: - var d = [String: JSON]() - d[".tag"] = .str("filter_none") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TemplateFilter { + case .filterSome(let arg): + var d = try ["filter_some": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("filter_some") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .filterNone: + var d = [String: JSON]() + d[".tag"] = .str("filter_none") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TemplateFilter { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "filter_some": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["filter_some"] ?? .null) - return TemplateFilter.filterSome(v) - case "other": - return TemplateFilter.other - case "filter_none": - return TemplateFilter.filterNone - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "filter_some": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["filter_some"] ?? .null) + return TemplateFilter.filterSome(v) + case "other": + return TemplateFilter.other + case "filter_none": + return TemplateFilter.filterNone default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: TemplateFilter.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TemplateFilter.self, json: json) } } } /// The TemplateOwnerType union - public enum TemplateOwnerType: CustomStringConvertible { + public enum TemplateOwnerType: CustomStringConvertible, JSONRepresentable { /// Template will be associated with a user. case user /// Template will be associated with a team. @@ -1616,86 +1968,108 @@ open class FileProperties { /// An unspecified error. case other + func json() throws -> JSON { + try TemplateOwnerTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TemplateOwnerTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TemplateOwnerTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TemplateOwnerType: \(error)" + } } } - open class TemplateOwnerTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TemplateOwnerType) -> JSON { + + public class TemplateOwnerTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TemplateOwnerType) throws -> JSON { switch value { - case .user: - var d = [String: JSON]() - d[".tag"] = .str("user") - return .dictionary(d) - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TemplateOwnerType { + case .user: + var d = [String: JSON]() + d[".tag"] = .str("user") + return .dictionary(d) + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TemplateOwnerType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user": - return TemplateOwnerType.user - case "team": - return TemplateOwnerType.team - case "other": - return TemplateOwnerType.other - default: - return TemplateOwnerType.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user": + return TemplateOwnerType.user + case "team": + return TemplateOwnerType.team + case "other": + return TemplateOwnerType.other default: - fatalError("Failed to deserialize") + return TemplateOwnerType.other + } + default: + throw JSONSerializerError.deserializeError(type: TemplateOwnerType.self, json: json) } } } /// The UpdatePropertiesArg struct - open class UpdatePropertiesArg: CustomStringConvertible { + public class UpdatePropertiesArg: CustomStringConvertible, JSONRepresentable { /// A unique identifier for the file or folder. public let path: String /// The property groups "delta" updates to apply. - public let updatePropertyGroups: Array - public init(path: String, updatePropertyGroups: Array) { + public let updatePropertyGroups: [FileProperties.PropertyGroupUpdate] + public init(path: String, updatePropertyGroups: [FileProperties.PropertyGroupUpdate]) { stringValidator(pattern: "/(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)")(path) self.path = path self.updatePropertyGroups = updatePropertyGroups } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdatePropertiesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UpdatePropertiesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdatePropertiesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdatePropertiesArg: \(error)" + } } } - open class UpdatePropertiesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdatePropertiesArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "update_property_groups": ArraySerializer(FileProperties.PropertyGroupUpdateSerializer()).serialize(value.updatePropertyGroups), + + public class UpdatePropertiesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdatePropertiesArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "update_property_groups": try ArraySerializer(FileProperties.PropertyGroupUpdateSerializer()).serialize(value.updatePropertyGroups), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UpdatePropertiesArg { + + public func deserialize(_ json: JSON) throws -> UpdatePropertiesArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let updatePropertyGroups = ArraySerializer(FileProperties.PropertyGroupUpdateSerializer()).deserialize(dict["update_property_groups"] ?? .null) - return UpdatePropertiesArg(path: path, updatePropertyGroups: updatePropertyGroups) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let updatePropertyGroups = try ArraySerializer(FileProperties.PropertyGroupUpdateSerializer()) + .deserialize(dict["update_property_groups"] ?? .null) + return UpdatePropertiesArg(path: path, updatePropertyGroups: updatePropertyGroups) + default: + throw JSONSerializerError.deserializeError(type: UpdatePropertiesArg.self, json: json) } } } /// The UpdatePropertiesError union - public enum UpdatePropertiesError: CustomStringConvertible { + public enum UpdatePropertiesError: CustomStringConvertible, JSONRepresentable { /// Template does not exist for the given identifier. case templateNotFound(String) /// You do not have permission to modify this template. @@ -1715,89 +2089,99 @@ open class FileProperties { /// An unspecified error. case propertyGroupLookup(FileProperties.LookUpPropertiesError) + func json() throws -> JSON { + try UpdatePropertiesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdatePropertiesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdatePropertiesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdatePropertiesError: \(error)" + } } } - open class UpdatePropertiesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdatePropertiesError) -> JSON { + + public class UpdatePropertiesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdatePropertiesError) throws -> JSON { switch value { - case .templateNotFound(let arg): - var d = ["template_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("template_not_found") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .path(let arg): - var d = ["path": FileProperties.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedFolder: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_folder") - return .dictionary(d) - case .propertyFieldTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("property_field_too_large") - return .dictionary(d) - case .doesNotFitTemplate: - var d = [String: JSON]() - d[".tag"] = .str("does_not_fit_template") - return .dictionary(d) - case .duplicatePropertyGroups: - var d = [String: JSON]() - d[".tag"] = .str("duplicate_property_groups") - return .dictionary(d) - case .propertyGroupLookup(let arg): - var d = ["property_group_lookup": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] - d[".tag"] = .str("property_group_lookup") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UpdatePropertiesError { + case .templateNotFound(let arg): + var d = try ["template_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("template_not_found") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .path(let arg): + var d = try ["path": FileProperties.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedFolder: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_folder") + return .dictionary(d) + case .propertyFieldTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("property_field_too_large") + return .dictionary(d) + case .doesNotFitTemplate: + var d = [String: JSON]() + d[".tag"] = .str("does_not_fit_template") + return .dictionary(d) + case .duplicatePropertyGroups: + var d = [String: JSON]() + d[".tag"] = .str("duplicate_property_groups") + return .dictionary(d) + case .propertyGroupLookup(let arg): + var d = try ["property_group_lookup": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] + d[".tag"] = .str("property_group_lookup") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UpdatePropertiesError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "template_not_found": - let v = Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) - return UpdatePropertiesError.templateNotFound(v) - case "restricted_content": - return UpdatePropertiesError.restrictedContent - case "other": - return UpdatePropertiesError.other - case "path": - let v = FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return UpdatePropertiesError.path(v) - case "unsupported_folder": - return UpdatePropertiesError.unsupportedFolder - case "property_field_too_large": - return UpdatePropertiesError.propertyFieldTooLarge - case "does_not_fit_template": - return UpdatePropertiesError.doesNotFitTemplate - case "duplicate_property_groups": - return UpdatePropertiesError.duplicatePropertyGroups - case "property_group_lookup": - let v = FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["property_group_lookup"] ?? .null) - return UpdatePropertiesError.propertyGroupLookup(v) - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "template_not_found": + let v = try Serialization._StringSerializer.deserialize(d["template_not_found"] ?? .null) + return UpdatePropertiesError.templateNotFound(v) + case "restricted_content": + return UpdatePropertiesError.restrictedContent + case "other": + return UpdatePropertiesError.other + case "path": + let v = try FileProperties.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return UpdatePropertiesError.path(v) + case "unsupported_folder": + return UpdatePropertiesError.unsupportedFolder + case "property_field_too_large": + return UpdatePropertiesError.propertyFieldTooLarge + case "does_not_fit_template": + return UpdatePropertiesError.doesNotFitTemplate + case "duplicate_property_groups": + return UpdatePropertiesError.duplicatePropertyGroups + case "property_group_lookup": + let v = try FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["property_group_lookup"] ?? .null) + return UpdatePropertiesError.propertyGroupLookup(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: UpdatePropertiesError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UpdatePropertiesError.self, json: json) } } } /// The UpdateTemplateArg struct - open class UpdateTemplateArg: CustomStringConvertible { + public class UpdateTemplateArg: CustomStringConvertible, JSONRepresentable { /// An identifier for template added by See templatesAddForUser or templatesAddForTeam. public let templateId: String /// A display name for the template. template names can be up to 256 bytes. @@ -1806,8 +2190,8 @@ open class FileProperties { public let description_: String? /// Property field templates to be added to the group template. There can be up to 32 properties in a single /// template. - public let addFields: Array? - public init(templateId: String, name: String? = nil, description_: String? = nil, addFields: Array? = nil) { + public let addFields: [FileProperties.PropertyFieldTemplate]? + public init(templateId: String, name: String? = nil, description_: String? = nil, addFields: [FileProperties.PropertyFieldTemplate]? = nil) { stringValidator(minLength: 1, pattern: "(/|ptid:).*")(templateId) self.templateId = templateId nullableValidator(stringValidator())(name) @@ -1816,67 +2200,89 @@ open class FileProperties { self.description_ = description_ self.addFields = addFields } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateTemplateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UpdateTemplateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateTemplateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateTemplateArg: \(error)" + } } } - open class UpdateTemplateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateTemplateArg) -> JSON { - let output = [ - "template_id": Serialization._StringSerializer.serialize(value.templateId), - "name": NullableSerializer(Serialization._StringSerializer).serialize(value.name), - "description": NullableSerializer(Serialization._StringSerializer).serialize(value.description_), - "add_fields": NullableSerializer(ArraySerializer(FileProperties.PropertyFieldTemplateSerializer())).serialize(value.addFields), + + public class UpdateTemplateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateTemplateArg) throws -> JSON { + let output = [ + "template_id": try Serialization._StringSerializer.serialize(value.templateId), + "name": try NullableSerializer(Serialization._StringSerializer).serialize(value.name), + "description": try NullableSerializer(Serialization._StringSerializer).serialize(value.description_), + "add_fields": try NullableSerializer(ArraySerializer(FileProperties.PropertyFieldTemplateSerializer())).serialize(value.addFields), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UpdateTemplateArg { + + public func deserialize(_ json: JSON) throws -> UpdateTemplateArg { switch json { - case .dictionary(let dict): - let templateId = Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) - let name = NullableSerializer(Serialization._StringSerializer).deserialize(dict["name"] ?? .null) - let description_ = NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) - let addFields = NullableSerializer(ArraySerializer(FileProperties.PropertyFieldTemplateSerializer())).deserialize(dict["add_fields"] ?? .null) - return UpdateTemplateArg(templateId: templateId, name: name, description_: description_, addFields: addFields) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateId = try Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) + let name = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["name"] ?? .null) + let description_ = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) + let addFields = try NullableSerializer(ArraySerializer(FileProperties.PropertyFieldTemplateSerializer())) + .deserialize(dict["add_fields"] ?? .null) + return UpdateTemplateArg(templateId: templateId, name: name, description_: description_, addFields: addFields) + default: + throw JSONSerializerError.deserializeError(type: UpdateTemplateArg.self, json: json) } } } /// The UpdateTemplateResult struct - open class UpdateTemplateResult: CustomStringConvertible { + public class UpdateTemplateResult: CustomStringConvertible, JSONRepresentable { /// An identifier for template added by route See templatesAddForUser or templatesAddForTeam. public let templateId: String public init(templateId: String) { stringValidator(minLength: 1, pattern: "(/|ptid:).*")(templateId) self.templateId = templateId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateTemplateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UpdateTemplateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateTemplateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateTemplateResult: \(error)" + } } } - open class UpdateTemplateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateTemplateResult) -> JSON { - let output = [ - "template_id": Serialization._StringSerializer.serialize(value.templateId), + + public class UpdateTemplateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateTemplateResult) throws -> JSON { + let output = [ + "template_id": try Serialization._StringSerializer.serialize(value.templateId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UpdateTemplateResult { + + public func deserialize(_ json: JSON) throws -> UpdateTemplateResult { switch json { - case .dictionary(let dict): - let templateId = Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) - return UpdateTemplateResult(templateId: templateId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let templateId = try Serialization._StringSerializer.deserialize(dict["template_id"] ?? .null) + return UpdateTemplateResult(templateId: templateId) + default: + throw JSONSerializerError.deserializeError(type: UpdateTemplateResult.self, json: json) } } } - /// Stone Route Objects static let propertiesAdd = Route( @@ -1887,9 +2293,11 @@ open class FileProperties { argSerializer: FileProperties.AddPropertiesArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.AddPropertiesErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesOverwrite = Route( name: "properties/overwrite", @@ -1899,9 +2307,11 @@ open class FileProperties { argSerializer: FileProperties.OverwritePropertyGroupArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.InvalidPropertyGroupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesRemove = Route( name: "properties/remove", @@ -1911,9 +2321,11 @@ open class FileProperties { argSerializer: FileProperties.RemovePropertiesArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.RemovePropertiesErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesSearch = Route( name: "properties/search", @@ -1923,9 +2335,11 @@ open class FileProperties { argSerializer: FileProperties.PropertiesSearchArgSerializer(), responseSerializer: FileProperties.PropertiesSearchResultSerializer(), errorSerializer: FileProperties.PropertiesSearchErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesSearchContinue = Route( name: "properties/search/continue", @@ -1935,9 +2349,11 @@ open class FileProperties { argSerializer: FileProperties.PropertiesSearchContinueArgSerializer(), responseSerializer: FileProperties.PropertiesSearchResultSerializer(), errorSerializer: FileProperties.PropertiesSearchContinueErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesUpdate = Route( name: "properties/update", @@ -1947,9 +2363,11 @@ open class FileProperties { argSerializer: FileProperties.UpdatePropertiesArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.UpdatePropertiesErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let templatesAddForTeam = Route( name: "templates/add_for_team", @@ -1959,9 +2377,11 @@ open class FileProperties { argSerializer: FileProperties.AddTemplateArgSerializer(), responseSerializer: FileProperties.AddTemplateResultSerializer(), errorSerializer: FileProperties.ModifyTemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let templatesAddForUser = Route( name: "templates/add_for_user", @@ -1971,9 +2391,11 @@ open class FileProperties { argSerializer: FileProperties.AddTemplateArgSerializer(), responseSerializer: FileProperties.AddTemplateResultSerializer(), errorSerializer: FileProperties.ModifyTemplateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let templatesGetForTeam = Route( name: "templates/get_for_team", @@ -1983,9 +2405,11 @@ open class FileProperties { argSerializer: FileProperties.GetTemplateArgSerializer(), responseSerializer: FileProperties.GetTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let templatesGetForUser = Route( name: "templates/get_for_user", @@ -1995,9 +2419,11 @@ open class FileProperties { argSerializer: FileProperties.GetTemplateArgSerializer(), responseSerializer: FileProperties.GetTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let templatesListForTeam = Route( name: "templates/list_for_team", @@ -2007,9 +2433,11 @@ open class FileProperties { argSerializer: Serialization._VoidSerializer, responseSerializer: FileProperties.ListTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let templatesListForUser = Route( name: "templates/list_for_user", @@ -2019,9 +2447,11 @@ open class FileProperties { argSerializer: Serialization._VoidSerializer, responseSerializer: FileProperties.ListTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let templatesRemoveForTeam = Route( name: "templates/remove_for_team", @@ -2031,9 +2461,11 @@ open class FileProperties { argSerializer: FileProperties.RemoveTemplateArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let templatesRemoveForUser = Route( name: "templates/remove_for_user", @@ -2043,9 +2475,11 @@ open class FileProperties { argSerializer: FileProperties.RemoveTemplateArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let templatesUpdateForTeam = Route( name: "templates/update_for_team", @@ -2055,9 +2489,11 @@ open class FileProperties { argSerializer: FileProperties.UpdateTemplateArgSerializer(), responseSerializer: FileProperties.UpdateTemplateResultSerializer(), errorSerializer: FileProperties.ModifyTemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let templatesUpdateForUser = Route( name: "templates/update_for_user", @@ -2067,8 +2503,10 @@ open class FileProperties { argSerializer: FileProperties.UpdateTemplateArgSerializer(), responseSerializer: FileProperties.UpdateTemplateResultSerializer(), errorSerializer: FileProperties.ModifyTemplateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/FilePropertiesRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/FilePropertiesRoutes.swift index 30e814b96..47132f705 100644 --- a/Source/SwiftyDropbox/Shared/Generated/FilePropertiesRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/FilePropertiesRoutes.swift @@ -7,38 +7,49 @@ import Foundation /// Routes for the file_properties namespace -open class FilePropertiesRoutes { +/// For Objective-C compatible routes see DBFilePropertiesRoutes +public class FilePropertiesRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Add property groups to a Dropbox file. See templatesAddForUser or templatesAddForTeam to create new templates. /// + /// - scope: files.metadata.write + /// /// - parameter path: A unique identifier for the file or folder. /// - parameter propertyGroups: The property groups which are to be added to a Dropbox file. No two groups in the /// input should refer to the same template. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.AddPropertiesError` object on failure. - @discardableResult open func propertiesAdd(path: String, propertyGroups: Array) -> RpcRequest { + @discardableResult public func propertiesAdd( + path: String, + propertyGroups: [FileProperties.PropertyGroup] + ) -> RpcRequest { let route = FileProperties.propertiesAdd let serverArgs = FileProperties.AddPropertiesArg(path: path, propertyGroups: propertyGroups) return client.request(route, serverArgs: serverArgs) } /// Overwrite property groups associated with a file. This endpoint should be used instead of propertiesUpdate when - /// property groups are being updated via a "snapshot" instead of via a "delta". In other words, this endpoint will - /// delete all omitted fields from a property group, whereas propertiesUpdate will only delete fields that are - /// explicitly marked for deletion. + /// property groups are being updated via a "snapshot" instead of via a "delta". In other words, this endpoint + /// will delete all omitted fields from a property group, whereas propertiesUpdate will only delete fields that + /// are explicitly marked for deletion. + /// + /// - scope: files.metadata.write /// /// - parameter path: A unique identifier for the file or folder. /// - parameter propertyGroups: The property groups "snapshot" updates to force apply. No two groups in the input /// should refer to the same template. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.InvalidPropertyGroupError` object on failure. - @discardableResult open func propertiesOverwrite(path: String, propertyGroups: Array) -> RpcRequest { + @discardableResult public func propertiesOverwrite( + path: String, + propertyGroups: [FileProperties.PropertyGroup] + ) -> RpcRequest { let route = FileProperties.propertiesOverwrite let serverArgs = FileProperties.OverwritePropertyGroupArg(path: path, propertyGroups: propertyGroups) return client.request(route, serverArgs: serverArgs) @@ -48,13 +59,18 @@ open class FilePropertiesRoutes { /// pairs, see propertiesUpdate. To update a template, see templatesUpdateForUser or templatesUpdateForTeam. To /// remove a template, see templatesRemoveForUser or templatesRemoveForTeam. /// + /// - scope: files.metadata.write + /// /// - parameter path: A unique identifier for the file or folder. /// - parameter propertyTemplateIds: A list of identifiers for a template created by templatesAddForUser or /// templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.RemovePropertiesError` object on failure. - @discardableResult open func propertiesRemove(path: String, propertyTemplateIds: Array) -> RpcRequest { + @discardableResult public func propertiesRemove( + path: String, + propertyTemplateIds: [String] + ) -> RpcRequest { let route = FileProperties.propertiesRemove let serverArgs = FileProperties.RemovePropertiesArg(path: path, propertyTemplateIds: propertyTemplateIds) return client.request(route, serverArgs: serverArgs) @@ -62,12 +78,18 @@ open class FilePropertiesRoutes { /// Search across property templates for particular property field values. /// + /// - scope: files.metadata.read + /// /// - parameter queries: Queries to search. /// - parameter templateFilter: Filter results to contain only properties associated with these template IDs. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.PropertiesSearchResult` + /// - returns: Through the response callback, the caller will receive a `FileProperties.PropertiesSearchResult` /// object on success or a `FileProperties.PropertiesSearchError` object on failure. - @discardableResult open func propertiesSearch(queries: Array, templateFilter: FileProperties.TemplateFilter = .filterNone) -> RpcRequest { + @discardableResult public func propertiesSearch( + queries: [FileProperties.PropertiesSearchQuery], + templateFilter: FileProperties + .TemplateFilter = .filterNone + ) -> RpcRequest { let route = FileProperties.propertiesSearch let serverArgs = FileProperties.PropertiesSearchArg(queries: queries, templateFilter: templateFilter) return client.request(route, serverArgs: serverArgs) @@ -75,27 +97,35 @@ open class FilePropertiesRoutes { /// Once a cursor has been retrieved from propertiesSearch, use this to paginate through all search results. /// + /// - scope: files.metadata.read + /// /// - parameter cursor: The cursor returned by your last call to propertiesSearch or propertiesSearchContinue. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.PropertiesSearchResult` + /// - returns: Through the response callback, the caller will receive a `FileProperties.PropertiesSearchResult` /// object on success or a `FileProperties.PropertiesSearchContinueError` object on failure. - @discardableResult open func propertiesSearchContinue(cursor: String) -> RpcRequest { + @discardableResult public func propertiesSearchContinue(cursor: String) + -> RpcRequest { let route = FileProperties.propertiesSearchContinue let serverArgs = FileProperties.PropertiesSearchContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) } /// Add, update or remove properties associated with the supplied file and templates. This endpoint should be used - /// instead of propertiesOverwrite when property groups are being updated via a "delta" instead of via a "snapshot" - /// . In other words, this endpoint will not delete any omitted fields from a property group, whereas + /// instead of propertiesOverwrite when property groups are being updated via a "delta" instead of via a + /// "snapshot" . In other words, this endpoint will not delete any omitted fields from a property group, whereas /// propertiesOverwrite will delete any fields that are omitted from a property group. /// + /// - scope: files.metadata.write + /// /// - parameter path: A unique identifier for the file or folder. /// - parameter updatePropertyGroups: The property groups "delta" updates to apply. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.UpdatePropertiesError` object on failure. - @discardableResult open func propertiesUpdate(path: String, updatePropertyGroups: Array) -> RpcRequest { + @discardableResult public func propertiesUpdate( + path: String, + updatePropertyGroups: [FileProperties.PropertyGroupUpdate] + ) -> RpcRequest { let route = FileProperties.propertiesUpdate let serverArgs = FileProperties.UpdatePropertiesArg(path: path, updatePropertyGroups: updatePropertyGroups) return client.request(route, serverArgs: serverArgs) @@ -104,10 +134,17 @@ open class FilePropertiesRoutes { /// Add a template associated with a team. See propertiesAdd to add properties to a file or folder. Note: this /// endpoint will create team-owned templates. /// + /// - scope: files.team_metadata.write /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object - /// on success or a `FileProperties.ModifyTemplateError` object on failure. - @discardableResult open func templatesAddForTeam(name: String, description_: String, fields: Array) -> RpcRequest { + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object on + /// success or a `FileProperties.ModifyTemplateError` object on failure. + @discardableResult public func templatesAddForTeam( + name: String, + description_: String, + fields: [FileProperties.PropertyFieldTemplate] + ) + -> RpcRequest { let route = FileProperties.templatesAddForTeam let serverArgs = FileProperties.AddTemplateArg(name: name, description_: description_, fields: fields) return client.request(route, serverArgs: serverArgs) @@ -116,10 +153,17 @@ open class FilePropertiesRoutes { /// Add a template associated with a user. See propertiesAdd to add properties to a file. This endpoint can't be /// called on a team member or admin's behalf. /// + /// - scope: files.metadata.write /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object - /// on success or a `FileProperties.ModifyTemplateError` object on failure. - @discardableResult open func templatesAddForUser(name: String, description_: String, fields: Array) -> RpcRequest { + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object on + /// success or a `FileProperties.ModifyTemplateError` object on failure. + @discardableResult public func templatesAddForUser( + name: String, + description_: String, + fields: [FileProperties.PropertyFieldTemplate] + ) + -> RpcRequest { let route = FileProperties.templatesAddForUser let serverArgs = FileProperties.AddTemplateArg(name: name, description_: description_, fields: fields) return client.request(route, serverArgs: serverArgs) @@ -127,12 +171,15 @@ open class FilePropertiesRoutes { /// Get the schema for a specified template. /// + /// - scope: files.team_metadata.write + /// /// - parameter templateId: An identifier for template added by route See templatesAddForUser or /// templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object - /// on success or a `FileProperties.TemplateError` object on failure. - @discardableResult open func templatesGetForTeam(templateId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object on + /// success or a `FileProperties.TemplateError` object on failure. + @discardableResult public func templatesGetForTeam(templateId: String) + -> RpcRequest { let route = FileProperties.templatesGetForTeam let serverArgs = FileProperties.GetTemplateArg(templateId: templateId) return client.request(route, serverArgs: serverArgs) @@ -140,12 +187,15 @@ open class FilePropertiesRoutes { /// Get the schema for a specified template. This endpoint can't be called on a team member or admin's behalf. /// + /// - scope: files.metadata.read + /// /// - parameter templateId: An identifier for template added by route See templatesAddForUser or /// templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object - /// on success or a `FileProperties.TemplateError` object on failure. - @discardableResult open func templatesGetForUser(templateId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object on + /// success or a `FileProperties.TemplateError` object on failure. + @discardableResult public func templatesGetForUser(templateId: String) + -> RpcRequest { let route = FileProperties.templatesGetForUser let serverArgs = FileProperties.GetTemplateArg(templateId: templateId) return client.request(route, serverArgs: serverArgs) @@ -153,10 +203,12 @@ open class FilePropertiesRoutes { /// Get the template identifiers for a team. To get the schema of each template use templatesGetForTeam. /// + /// - scope: files.team_metadata.write + /// /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object + /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object /// on success or a `FileProperties.TemplateError` object on failure. - @discardableResult open func templatesListForTeam() -> RpcRequest { + @discardableResult public func templatesListForTeam() -> RpcRequest { let route = FileProperties.templatesListForTeam return client.request(route) } @@ -164,10 +216,12 @@ open class FilePropertiesRoutes { /// Get the template identifiers for a team. To get the schema of each template use templatesGetForUser. This /// endpoint can't be called on a team member or admin's behalf. /// + /// - scope: files.metadata.read /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object /// on success or a `FileProperties.TemplateError` object on failure. - @discardableResult open func templatesListForUser() -> RpcRequest { + @discardableResult public func templatesListForUser() -> RpcRequest { let route = FileProperties.templatesListForUser return client.request(route) } @@ -175,11 +229,13 @@ open class FilePropertiesRoutes { /// Permanently removes the specified template created from templatesAddForUser. All properties associated with the /// template will also be removed. This action cannot be undone. /// + /// - scope: files.team_metadata.write + /// /// - parameter templateId: An identifier for a template created by templatesAddForUser or templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.TemplateError` object on failure. - @discardableResult open func templatesRemoveForTeam(templateId: String) -> RpcRequest { + @discardableResult public func templatesRemoveForTeam(templateId: String) -> RpcRequest { let route = FileProperties.templatesRemoveForTeam let serverArgs = FileProperties.RemoveTemplateArg(templateId: templateId) return client.request(route, serverArgs: serverArgs) @@ -188,11 +244,13 @@ open class FilePropertiesRoutes { /// Permanently removes the specified template created from templatesAddForUser. All properties associated with the /// template will also be removed. This action cannot be undone. /// + /// - scope: files.metadata.write + /// /// - parameter templateId: An identifier for a template created by templatesAddForUser or templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.TemplateError` object on failure. - @discardableResult open func templatesRemoveForUser(templateId: String) -> RpcRequest { + @discardableResult public func templatesRemoveForUser(templateId: String) -> RpcRequest { let route = FileProperties.templatesRemoveForUser let serverArgs = FileProperties.RemoveTemplateArg(templateId: templateId) return client.request(route, serverArgs: serverArgs) @@ -201,15 +259,22 @@ open class FilePropertiesRoutes { /// Update a template associated with a team. This route can update the template name, the template description and /// add optional properties to templates. /// + /// - scope: files.team_metadata.write + /// /// - parameter templateId: An identifier for template added by See templatesAddForUser or templatesAddForTeam. /// - parameter name: A display name for the template. template names can be up to 256 bytes. /// - parameter description_: Description for the new template. Template descriptions can be up to 1024 bytes. /// - parameter addFields: Property field templates to be added to the group template. There can be up to 32 /// properties in a single template. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` - /// object on success or a `FileProperties.ModifyTemplateError` object on failure. - @discardableResult open func templatesUpdateForTeam(templateId: String, name: String? = nil, description_: String? = nil, addFields: Array? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` object + /// on success or a `FileProperties.ModifyTemplateError` object on failure. + @discardableResult public func templatesUpdateForTeam( + templateId: String, + name: String? = nil, + description_: String? = nil, + addFields: [FileProperties.PropertyFieldTemplate]? = nil + ) -> RpcRequest { let route = FileProperties.templatesUpdateForTeam let serverArgs = FileProperties.UpdateTemplateArg(templateId: templateId, name: name, description_: description_, addFields: addFields) return client.request(route, serverArgs: serverArgs) @@ -218,18 +283,24 @@ open class FilePropertiesRoutes { /// Update a template associated with a user. This route can update the template name, the template description and /// add optional properties to templates. This endpoint can't be called on a team member or admin's behalf. /// + /// - scope: files.metadata.write + /// /// - parameter templateId: An identifier for template added by See templatesAddForUser or templatesAddForTeam. /// - parameter name: A display name for the template. template names can be up to 256 bytes. /// - parameter description_: Description for the new template. Template descriptions can be up to 1024 bytes. /// - parameter addFields: Property field templates to be added to the group template. There can be up to 32 /// properties in a single template. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` - /// object on success or a `FileProperties.ModifyTemplateError` object on failure. - @discardableResult open func templatesUpdateForUser(templateId: String, name: String? = nil, description_: String? = nil, addFields: Array? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` object + /// on success or a `FileProperties.ModifyTemplateError` object on failure. + @discardableResult public func templatesUpdateForUser( + templateId: String, + name: String? = nil, + description_: String? = nil, + addFields: [FileProperties.PropertyFieldTemplate]? = nil + ) -> RpcRequest { let route = FileProperties.templatesUpdateForUser let serverArgs = FileProperties.UpdateTemplateArg(templateId: templateId, name: name, description_: description_, addFields: addFields) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/FileRequests.swift b/Source/SwiftyDropbox/Shared/Generated/FileRequests.swift index 7fe53b70d..640619880 100644 --- a/Source/SwiftyDropbox/Shared/Generated/FileRequests.swift +++ b/Source/SwiftyDropbox/Shared/Generated/FileRequests.swift @@ -7,126 +7,157 @@ import Foundation /// Datatypes and serializers for the file_requests namespace -open class FileRequests { +public class FileRequests { /// There is an error accessing the file requests functionality. - public enum GeneralFileRequestsError: CustomStringConvertible { + public enum GeneralFileRequestsError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. case other + func json() throws -> JSON { + try GeneralFileRequestsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GeneralFileRequestsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GeneralFileRequestsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GeneralFileRequestsError: \(error)" + } } } - open class GeneralFileRequestsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GeneralFileRequestsError) -> JSON { + + public class GeneralFileRequestsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GeneralFileRequestsError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GeneralFileRequestsError { + + public func deserialize(_ json: JSON) throws -> GeneralFileRequestsError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return GeneralFileRequestsError.disabledForTeam - case "other": - return GeneralFileRequestsError.other - default: - return GeneralFileRequestsError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return GeneralFileRequestsError.disabledForTeam + case "other": + return GeneralFileRequestsError.other default: - fatalError("Failed to deserialize") + return GeneralFileRequestsError.other + } + default: + throw JSONSerializerError.deserializeError(type: GeneralFileRequestsError.self, json: json) } } } /// There was an error counting the file requests. - public enum CountFileRequestsError: CustomStringConvertible { + public enum CountFileRequestsError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. case other + func json() throws -> JSON { + try CountFileRequestsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CountFileRequestsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CountFileRequestsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CountFileRequestsError: \(error)" + } } } - open class CountFileRequestsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CountFileRequestsError) -> JSON { + + public class CountFileRequestsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CountFileRequestsError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> CountFileRequestsError { + + public func deserialize(_ json: JSON) throws -> CountFileRequestsError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return CountFileRequestsError.disabledForTeam - case "other": - return CountFileRequestsError.other - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return CountFileRequestsError.disabledForTeam + case "other": + return CountFileRequestsError.other default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: CountFileRequestsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: CountFileRequestsError.self, json: json) } } } /// Result for count. - open class CountFileRequestsResult: CustomStringConvertible { + public class CountFileRequestsResult: CustomStringConvertible, JSONRepresentable { /// The number file requests owner by this user. public let fileRequestCount: UInt64 public init(fileRequestCount: UInt64) { comparableValidator()(fileRequestCount) self.fileRequestCount = fileRequestCount } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CountFileRequestsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try CountFileRequestsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CountFileRequestsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CountFileRequestsResult: \(error)" + } } } - open class CountFileRequestsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CountFileRequestsResult) -> JSON { - let output = [ - "file_request_count": Serialization._UInt64Serializer.serialize(value.fileRequestCount), + + public class CountFileRequestsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CountFileRequestsResult) throws -> JSON { + let output = [ + "file_request_count": try Serialization._UInt64Serializer.serialize(value.fileRequestCount), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CountFileRequestsResult { + + public func deserialize(_ json: JSON) throws -> CountFileRequestsResult { switch json { - case .dictionary(let dict): - let fileRequestCount = Serialization._UInt64Serializer.deserialize(dict["file_request_count"] ?? .null) - return CountFileRequestsResult(fileRequestCount: fileRequestCount) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequestCount = try Serialization._UInt64Serializer.deserialize(dict["file_request_count"] ?? .null) + return CountFileRequestsResult(fileRequestCount: fileRequestCount) + default: + throw JSONSerializerError.deserializeError(type: CountFileRequestsResult.self, json: json) } } } /// Arguments for create. - open class CreateFileRequestArgs: CustomStringConvertible { + public class CreateFileRequestArgs: CustomStringConvertible, JSONRepresentable { /// The title of the file request. Must not be empty. public let title: String /// The path of the folder in the Dropbox where uploaded files will be sent. For apps with the app folder @@ -149,39 +180,50 @@ open class FileRequests { nullableValidator(stringValidator())(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFileRequestArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateFileRequestArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFileRequestArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFileRequestArgs: \(error)" + } } } - open class CreateFileRequestArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFileRequestArgs) -> JSON { - let output = [ - "title": Serialization._StringSerializer.serialize(value.title), - "destination": Serialization._StringSerializer.serialize(value.destination), - "deadline": NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).serialize(value.deadline), - "open": Serialization._BoolSerializer.serialize(value.open), - "description": NullableSerializer(Serialization._StringSerializer).serialize(value.description_), + + public class CreateFileRequestArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFileRequestArgs) throws -> JSON { + let output = [ + "title": try Serialization._StringSerializer.serialize(value.title), + "destination": try Serialization._StringSerializer.serialize(value.destination), + "deadline": try NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).serialize(value.deadline), + "open": try Serialization._BoolSerializer.serialize(value.open), + "description": try NullableSerializer(Serialization._StringSerializer).serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFileRequestArgs { + + public func deserialize(_ json: JSON) throws -> CreateFileRequestArgs { switch json { - case .dictionary(let dict): - let title = Serialization._StringSerializer.deserialize(dict["title"] ?? .null) - let destination = Serialization._StringSerializer.deserialize(dict["destination"] ?? .null) - let deadline = NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).deserialize(dict["deadline"] ?? .null) - let open = Serialization._BoolSerializer.deserialize(dict["open"] ?? .number(1)) - let description_ = NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) - return CreateFileRequestArgs(title: title, destination: destination, deadline: deadline, open: open, description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let title = try Serialization._StringSerializer.deserialize(dict["title"] ?? .null) + let destination = try Serialization._StringSerializer.deserialize(dict["destination"] ?? .null) + let deadline = try NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).deserialize(dict["deadline"] ?? .null) + let open = try Serialization._BoolSerializer.deserialize(dict["open"] ?? .number(1)) + let description_ = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) + return CreateFileRequestArgs(title: title, destination: destination, deadline: deadline, open: open, description_: description_) + default: + throw JSONSerializerError.deserializeError(type: CreateFileRequestArgs.self, json: json) } } } /// There is an error with the file request. - public enum FileRequestError: CustomStringConvertible { + public enum FileRequestError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. @@ -202,80 +244,90 @@ open class FileRequests { /// characters in the destination path. case validationError + func json() throws -> JSON { + try FileRequestErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestError: \(error)" + } } } - open class FileRequestErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestError) -> JSON { + + public class FileRequestErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notAFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_a_folder") - return .dictionary(d) - case .appLacksAccess: - var d = [String: JSON]() - d[".tag"] = .str("app_lacks_access") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .validationError: - var d = [String: JSON]() - d[".tag"] = .str("validation_error") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notAFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_a_folder") + return .dictionary(d) + case .appLacksAccess: + var d = [String: JSON]() + d[".tag"] = .str("app_lacks_access") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .validationError: + var d = [String: JSON]() + d[".tag"] = .str("validation_error") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> FileRequestError { + + public func deserialize(_ json: JSON) throws -> FileRequestError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return FileRequestError.disabledForTeam - case "other": - return FileRequestError.other - case "not_found": - return FileRequestError.notFound - case "not_a_folder": - return FileRequestError.notAFolder - case "app_lacks_access": - return FileRequestError.appLacksAccess - case "no_permission": - return FileRequestError.noPermission - case "email_unverified": - return FileRequestError.emailUnverified - case "validation_error": - return FileRequestError.validationError - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return FileRequestError.disabledForTeam + case "other": + return FileRequestError.other + case "not_found": + return FileRequestError.notFound + case "not_a_folder": + return FileRequestError.notAFolder + case "app_lacks_access": + return FileRequestError.appLacksAccess + case "no_permission": + return FileRequestError.noPermission + case "email_unverified": + return FileRequestError.emailUnverified + case "validation_error": + return FileRequestError.validationError default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: FileRequestError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: FileRequestError.self, json: json) } } } /// There was an error creating the file request. - public enum CreateFileRequestError: CustomStringConvertible { + public enum CreateFileRequestError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. @@ -301,92 +353,102 @@ open class FileRequests { /// total. case rateLimit + func json() throws -> JSON { + try CreateFileRequestErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFileRequestErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFileRequestErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFileRequestError: \(error)" + } } } - open class CreateFileRequestErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFileRequestError) -> JSON { + + public class CreateFileRequestErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFileRequestError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notAFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_a_folder") - return .dictionary(d) - case .appLacksAccess: - var d = [String: JSON]() - d[".tag"] = .str("app_lacks_access") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .validationError: - var d = [String: JSON]() - d[".tag"] = .str("validation_error") - return .dictionary(d) - case .invalidLocation: - var d = [String: JSON]() - d[".tag"] = .str("invalid_location") - return .dictionary(d) - case .rateLimit: - var d = [String: JSON]() - d[".tag"] = .str("rate_limit") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notAFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_a_folder") + return .dictionary(d) + case .appLacksAccess: + var d = [String: JSON]() + d[".tag"] = .str("app_lacks_access") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .validationError: + var d = [String: JSON]() + d[".tag"] = .str("validation_error") + return .dictionary(d) + case .invalidLocation: + var d = [String: JSON]() + d[".tag"] = .str("invalid_location") + return .dictionary(d) + case .rateLimit: + var d = [String: JSON]() + d[".tag"] = .str("rate_limit") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> CreateFileRequestError { + + public func deserialize(_ json: JSON) throws -> CreateFileRequestError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return CreateFileRequestError.disabledForTeam - case "other": - return CreateFileRequestError.other - case "not_found": - return CreateFileRequestError.notFound - case "not_a_folder": - return CreateFileRequestError.notAFolder - case "app_lacks_access": - return CreateFileRequestError.appLacksAccess - case "no_permission": - return CreateFileRequestError.noPermission - case "email_unverified": - return CreateFileRequestError.emailUnverified - case "validation_error": - return CreateFileRequestError.validationError - case "invalid_location": - return CreateFileRequestError.invalidLocation - case "rate_limit": - return CreateFileRequestError.rateLimit - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return CreateFileRequestError.disabledForTeam + case "other": + return CreateFileRequestError.other + case "not_found": + return CreateFileRequestError.notFound + case "not_a_folder": + return CreateFileRequestError.notAFolder + case "app_lacks_access": + return CreateFileRequestError.appLacksAccess + case "no_permission": + return CreateFileRequestError.noPermission + case "email_unverified": + return CreateFileRequestError.emailUnverified + case "validation_error": + return CreateFileRequestError.validationError + case "invalid_location": + return CreateFileRequestError.invalidLocation + case "rate_limit": + return CreateFileRequestError.rateLimit default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: CreateFileRequestError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: CreateFileRequestError.self, json: json) } } } /// There was an error deleting all closed file requests. - public enum DeleteAllClosedFileRequestsError: CustomStringConvertible { + public enum DeleteAllClosedFileRequestsError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. @@ -407,141 +469,173 @@ open class FileRequests { /// characters in the destination path. case validationError + func json() throws -> JSON { + try DeleteAllClosedFileRequestsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteAllClosedFileRequestsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteAllClosedFileRequestsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteAllClosedFileRequestsError: \(error)" + } } } - open class DeleteAllClosedFileRequestsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteAllClosedFileRequestsError) -> JSON { + + public class DeleteAllClosedFileRequestsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteAllClosedFileRequestsError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notAFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_a_folder") - return .dictionary(d) - case .appLacksAccess: - var d = [String: JSON]() - d[".tag"] = .str("app_lacks_access") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .validationError: - var d = [String: JSON]() - d[".tag"] = .str("validation_error") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notAFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_a_folder") + return .dictionary(d) + case .appLacksAccess: + var d = [String: JSON]() + d[".tag"] = .str("app_lacks_access") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .validationError: + var d = [String: JSON]() + d[".tag"] = .str("validation_error") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> DeleteAllClosedFileRequestsError { + + public func deserialize(_ json: JSON) throws -> DeleteAllClosedFileRequestsError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return DeleteAllClosedFileRequestsError.disabledForTeam - case "other": - return DeleteAllClosedFileRequestsError.other - case "not_found": - return DeleteAllClosedFileRequestsError.notFound - case "not_a_folder": - return DeleteAllClosedFileRequestsError.notAFolder - case "app_lacks_access": - return DeleteAllClosedFileRequestsError.appLacksAccess - case "no_permission": - return DeleteAllClosedFileRequestsError.noPermission - case "email_unverified": - return DeleteAllClosedFileRequestsError.emailUnverified - case "validation_error": - return DeleteAllClosedFileRequestsError.validationError - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return DeleteAllClosedFileRequestsError.disabledForTeam + case "other": + return DeleteAllClosedFileRequestsError.other + case "not_found": + return DeleteAllClosedFileRequestsError.notFound + case "not_a_folder": + return DeleteAllClosedFileRequestsError.notAFolder + case "app_lacks_access": + return DeleteAllClosedFileRequestsError.appLacksAccess + case "no_permission": + return DeleteAllClosedFileRequestsError.noPermission + case "email_unverified": + return DeleteAllClosedFileRequestsError.emailUnverified + case "validation_error": + return DeleteAllClosedFileRequestsError.validationError default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: DeleteAllClosedFileRequestsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: DeleteAllClosedFileRequestsError.self, json: json) } } } /// Result for deleteAllClosed. - open class DeleteAllClosedFileRequestsResult: CustomStringConvertible { + public class DeleteAllClosedFileRequestsResult: CustomStringConvertible, JSONRepresentable { /// The file requests deleted for this user. - public let fileRequests: Array - public init(fileRequests: Array) { + public let fileRequests: [FileRequests.FileRequest] + public init(fileRequests: [FileRequests.FileRequest]) { self.fileRequests = fileRequests } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteAllClosedFileRequestsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteAllClosedFileRequestsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteAllClosedFileRequestsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteAllClosedFileRequestsResult: \(error)" + } } } - open class DeleteAllClosedFileRequestsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteAllClosedFileRequestsResult) -> JSON { - let output = [ - "file_requests": ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), + + public class DeleteAllClosedFileRequestsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteAllClosedFileRequestsResult) throws -> JSON { + let output = [ + "file_requests": try ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteAllClosedFileRequestsResult { + + public func deserialize(_ json: JSON) throws -> DeleteAllClosedFileRequestsResult { switch json { - case .dictionary(let dict): - let fileRequests = ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) - return DeleteAllClosedFileRequestsResult(fileRequests: fileRequests) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequests = try ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) + return DeleteAllClosedFileRequestsResult(fileRequests: fileRequests) + default: + throw JSONSerializerError.deserializeError(type: DeleteAllClosedFileRequestsResult.self, json: json) } } } /// Arguments for delete. - open class DeleteFileRequestArgs: CustomStringConvertible { + public class DeleteFileRequestArgs: CustomStringConvertible, JSONRepresentable { /// List IDs of the file requests to delete. - public let ids: Array - public init(ids: Array) { + public let ids: [String] + public init(ids: [String]) { arrayValidator(itemValidator: stringValidator(minLength: 1, pattern: "[-_0-9a-zA-Z]+"))(ids) self.ids = ids } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteFileRequestArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteFileRequestArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteFileRequestArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteFileRequestArgs: \(error)" + } } } - open class DeleteFileRequestArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteFileRequestArgs) -> JSON { - let output = [ - "ids": ArraySerializer(Serialization._StringSerializer).serialize(value.ids), + + public class DeleteFileRequestArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteFileRequestArgs) throws -> JSON { + let output = [ + "ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.ids), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteFileRequestArgs { + + public func deserialize(_ json: JSON) throws -> DeleteFileRequestArgs { switch json { - case .dictionary(let dict): - let ids = ArraySerializer(Serialization._StringSerializer).deserialize(dict["ids"] ?? .null) - return DeleteFileRequestArgs(ids: ids) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let ids = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["ids"] ?? .null) + return DeleteFileRequestArgs(ids: ids) + default: + throw JSONSerializerError.deserializeError(type: DeleteFileRequestArgs.self, json: json) } } } /// There was an error deleting these file requests. - public enum DeleteFileRequestError: CustomStringConvertible { + public enum DeleteFileRequestError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. @@ -564,116 +658,137 @@ open class FileRequests { /// One or more file requests currently open. case fileRequestOpen + func json() throws -> JSON { + try DeleteFileRequestErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteFileRequestErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteFileRequestErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteFileRequestError: \(error)" + } } } - open class DeleteFileRequestErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteFileRequestError) -> JSON { + + public class DeleteFileRequestErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteFileRequestError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notAFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_a_folder") - return .dictionary(d) - case .appLacksAccess: - var d = [String: JSON]() - d[".tag"] = .str("app_lacks_access") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .validationError: - var d = [String: JSON]() - d[".tag"] = .str("validation_error") - return .dictionary(d) - case .fileRequestOpen: - var d = [String: JSON]() - d[".tag"] = .str("file_request_open") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notAFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_a_folder") + return .dictionary(d) + case .appLacksAccess: + var d = [String: JSON]() + d[".tag"] = .str("app_lacks_access") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .validationError: + var d = [String: JSON]() + d[".tag"] = .str("validation_error") + return .dictionary(d) + case .fileRequestOpen: + var d = [String: JSON]() + d[".tag"] = .str("file_request_open") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> DeleteFileRequestError { + + public func deserialize(_ json: JSON) throws -> DeleteFileRequestError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return DeleteFileRequestError.disabledForTeam - case "other": - return DeleteFileRequestError.other - case "not_found": - return DeleteFileRequestError.notFound - case "not_a_folder": - return DeleteFileRequestError.notAFolder - case "app_lacks_access": - return DeleteFileRequestError.appLacksAccess - case "no_permission": - return DeleteFileRequestError.noPermission - case "email_unverified": - return DeleteFileRequestError.emailUnverified - case "validation_error": - return DeleteFileRequestError.validationError - case "file_request_open": - return DeleteFileRequestError.fileRequestOpen - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return DeleteFileRequestError.disabledForTeam + case "other": + return DeleteFileRequestError.other + case "not_found": + return DeleteFileRequestError.notFound + case "not_a_folder": + return DeleteFileRequestError.notAFolder + case "app_lacks_access": + return DeleteFileRequestError.appLacksAccess + case "no_permission": + return DeleteFileRequestError.noPermission + case "email_unverified": + return DeleteFileRequestError.emailUnverified + case "validation_error": + return DeleteFileRequestError.validationError + case "file_request_open": + return DeleteFileRequestError.fileRequestOpen default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: DeleteFileRequestError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: DeleteFileRequestError.self, json: json) } } } /// Result for delete. - open class DeleteFileRequestsResult: CustomStringConvertible { + public class DeleteFileRequestsResult: CustomStringConvertible, JSONRepresentable { /// The file requests deleted by the request. - public let fileRequests: Array - public init(fileRequests: Array) { + public let fileRequests: [FileRequests.FileRequest] + public init(fileRequests: [FileRequests.FileRequest]) { self.fileRequests = fileRequests } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteFileRequestsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteFileRequestsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteFileRequestsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteFileRequestsResult: \(error)" + } } } - open class DeleteFileRequestsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteFileRequestsResult) -> JSON { - let output = [ - "file_requests": ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), + + public class DeleteFileRequestsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteFileRequestsResult) throws -> JSON { + let output = [ + "file_requests": try ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteFileRequestsResult { + + public func deserialize(_ json: JSON) throws -> DeleteFileRequestsResult { switch json { - case .dictionary(let dict): - let fileRequests = ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) - return DeleteFileRequestsResult(fileRequests: fileRequests) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequests = try ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) + return DeleteFileRequestsResult(fileRequests: fileRequests) + default: + throw JSONSerializerError.deserializeError(type: DeleteFileRequestsResult.self, json: json) } } } /// A file request https://www.dropbox.com/help/9090 for receiving files into the user's Dropbox account. - open class FileRequest: CustomStringConvertible { + public class FileRequest: CustomStringConvertible, JSONRepresentable { /// The ID of the file request. public let id: String /// The URL of the file request. @@ -694,7 +809,17 @@ open class FileRequests { public let fileCount: Int64 /// A description of the file request. public let description_: String? - public init(id: String, url: String, title: String, created: Date, isOpen: Bool, fileCount: Int64, destination: String? = nil, deadline: FileRequests.FileRequestDeadline? = nil, description_: String? = nil) { + public init( + id: String, + url: String, + title: String, + created: Date, + isOpen: Bool, + fileCount: Int64, + destination: String? = nil, + deadline: FileRequests.FileRequestDeadline? = nil, + description_: String? = nil + ) { stringValidator(minLength: 1, pattern: "[-_0-9a-zA-Z]+")(id) self.id = id stringValidator(minLength: 1)(url) @@ -711,47 +836,68 @@ open class FileRequests { nullableValidator(stringValidator())(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequest: \(error)" + } } } - open class FileRequestSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequest) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "url": Serialization._StringSerializer.serialize(value.url), - "title": Serialization._StringSerializer.serialize(value.title), - "created": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.created), - "is_open": Serialization._BoolSerializer.serialize(value.isOpen), - "file_count": Serialization._Int64Serializer.serialize(value.fileCount), - "destination": NullableSerializer(Serialization._StringSerializer).serialize(value.destination), - "deadline": NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).serialize(value.deadline), - "description": NullableSerializer(Serialization._StringSerializer).serialize(value.description_), + + public class FileRequestSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequest) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "url": try Serialization._StringSerializer.serialize(value.url), + "title": try Serialization._StringSerializer.serialize(value.title), + "created": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.created), + "is_open": try Serialization._BoolSerializer.serialize(value.isOpen), + "file_count": try Serialization._Int64Serializer.serialize(value.fileCount), + "destination": try NullableSerializer(Serialization._StringSerializer).serialize(value.destination), + "deadline": try NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).serialize(value.deadline), + "description": try NullableSerializer(Serialization._StringSerializer).serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequest { + + public func deserialize(_ json: JSON) throws -> FileRequest { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let title = Serialization._StringSerializer.deserialize(dict["title"] ?? .null) - let created = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["created"] ?? .null) - let isOpen = Serialization._BoolSerializer.deserialize(dict["is_open"] ?? .null) - let fileCount = Serialization._Int64Serializer.deserialize(dict["file_count"] ?? .null) - let destination = NullableSerializer(Serialization._StringSerializer).deserialize(dict["destination"] ?? .null) - let deadline = NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).deserialize(dict["deadline"] ?? .null) - let description_ = NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) - return FileRequest(id: id, url: url, title: title, created: created, isOpen: isOpen, fileCount: fileCount, destination: destination, deadline: deadline, description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let title = try Serialization._StringSerializer.deserialize(dict["title"] ?? .null) + let created = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["created"] ?? .null) + let isOpen = try Serialization._BoolSerializer.deserialize(dict["is_open"] ?? .null) + let fileCount = try Serialization._Int64Serializer.deserialize(dict["file_count"] ?? .null) + let destination = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["destination"] ?? .null) + let deadline = try NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).deserialize(dict["deadline"] ?? .null) + let description_ = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) + return FileRequest( + id: id, + url: url, + title: title, + created: created, + isOpen: isOpen, + fileCount: fileCount, + destination: destination, + deadline: deadline, + description_: description_ + ) + default: + throw JSONSerializerError.deserializeError(type: FileRequest.self, json: json) } } } /// The FileRequestDeadline struct - open class FileRequestDeadline: CustomStringConvertible { + public class FileRequestDeadline: CustomStringConvertible, JSONRepresentable { /// The deadline for this file request. public let deadline: Date /// If set, allow uploads after the deadline has passed. These uploads will be marked overdue. @@ -760,64 +906,86 @@ open class FileRequests { self.deadline = deadline self.allowLateUploads = allowLateUploads } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestDeadlineSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestDeadlineSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestDeadlineSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestDeadline: \(error)" + } } } - open class FileRequestDeadlineSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestDeadline) -> JSON { - let output = [ - "deadline": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.deadline), - "allow_late_uploads": NullableSerializer(FileRequests.GracePeriodSerializer()).serialize(value.allowLateUploads), + + public class FileRequestDeadlineSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestDeadline) throws -> JSON { + let output = [ + "deadline": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.deadline), + "allow_late_uploads": try NullableSerializer(FileRequests.GracePeriodSerializer()).serialize(value.allowLateUploads), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestDeadline { + + public func deserialize(_ json: JSON) throws -> FileRequestDeadline { switch json { - case .dictionary(let dict): - let deadline = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["deadline"] ?? .null) - let allowLateUploads = NullableSerializer(FileRequests.GracePeriodSerializer()).deserialize(dict["allow_late_uploads"] ?? .null) - return FileRequestDeadline(deadline: deadline, allowLateUploads: allowLateUploads) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let deadline = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["deadline"] ?? .null) + let allowLateUploads = try NullableSerializer(FileRequests.GracePeriodSerializer()).deserialize(dict["allow_late_uploads"] ?? .null) + return FileRequestDeadline(deadline: deadline, allowLateUploads: allowLateUploads) + default: + throw JSONSerializerError.deserializeError(type: FileRequestDeadline.self, json: json) } } } /// Arguments for get. - open class GetFileRequestArgs: CustomStringConvertible { + public class GetFileRequestArgs: CustomStringConvertible, JSONRepresentable { /// The ID of the file request to retrieve. public let id: String public init(id: String) { stringValidator(minLength: 1, pattern: "[-_0-9a-zA-Z]+")(id) self.id = id } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetFileRequestArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetFileRequestArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetFileRequestArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetFileRequestArgs: \(error)" + } } } - open class GetFileRequestArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetFileRequestArgs) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), + + public class GetFileRequestArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetFileRequestArgs) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetFileRequestArgs { + + public func deserialize(_ json: JSON) throws -> GetFileRequestArgs { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - return GetFileRequestArgs(id: id) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + return GetFileRequestArgs(id: id) + default: + throw JSONSerializerError.deserializeError(type: GetFileRequestArgs.self, json: json) } } } /// There was an error retrieving the specified file request. - public enum GetFileRequestError: CustomStringConvertible { + public enum GetFileRequestError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. @@ -838,80 +1006,90 @@ open class FileRequests { /// characters in the destination path. case validationError + func json() throws -> JSON { + try GetFileRequestErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetFileRequestErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetFileRequestErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetFileRequestError: \(error)" + } } } - open class GetFileRequestErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetFileRequestError) -> JSON { + + public class GetFileRequestErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetFileRequestError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notAFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_a_folder") - return .dictionary(d) - case .appLacksAccess: - var d = [String: JSON]() - d[".tag"] = .str("app_lacks_access") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .validationError: - var d = [String: JSON]() - d[".tag"] = .str("validation_error") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notAFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_a_folder") + return .dictionary(d) + case .appLacksAccess: + var d = [String: JSON]() + d[".tag"] = .str("app_lacks_access") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .validationError: + var d = [String: JSON]() + d[".tag"] = .str("validation_error") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GetFileRequestError { + + public func deserialize(_ json: JSON) throws -> GetFileRequestError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return GetFileRequestError.disabledForTeam - case "other": - return GetFileRequestError.other - case "not_found": - return GetFileRequestError.notFound - case "not_a_folder": - return GetFileRequestError.notAFolder - case "app_lacks_access": - return GetFileRequestError.appLacksAccess - case "no_permission": - return GetFileRequestError.noPermission - case "email_unverified": - return GetFileRequestError.emailUnverified - case "validation_error": - return GetFileRequestError.validationError - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return GetFileRequestError.disabledForTeam + case "other": + return GetFileRequestError.other + case "not_found": + return GetFileRequestError.notFound + case "not_a_folder": + return GetFileRequestError.notAFolder + case "app_lacks_access": + return GetFileRequestError.appLacksAccess + case "no_permission": + return GetFileRequestError.noPermission + case "email_unverified": + return GetFileRequestError.emailUnverified + case "validation_error": + return GetFileRequestError.validationError default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GetFileRequestError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GetFileRequestError.self, json: json) } } } /// The GracePeriod union - public enum GracePeriod: CustomStringConvertible { + public enum GracePeriod: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case oneDay /// An unspecified error. @@ -925,130 +1103,162 @@ open class FileRequests { /// An unspecified error. case other + func json() throws -> JSON { + try GracePeriodSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GracePeriodSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GracePeriodSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GracePeriod: \(error)" + } } } - open class GracePeriodSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GracePeriod) -> JSON { + + public class GracePeriodSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GracePeriod) throws -> JSON { switch value { - case .oneDay: - var d = [String: JSON]() - d[".tag"] = .str("one_day") - return .dictionary(d) - case .twoDays: - var d = [String: JSON]() - d[".tag"] = .str("two_days") - return .dictionary(d) - case .sevenDays: - var d = [String: JSON]() - d[".tag"] = .str("seven_days") - return .dictionary(d) - case .thirtyDays: - var d = [String: JSON]() - d[".tag"] = .str("thirty_days") - return .dictionary(d) - case .always: - var d = [String: JSON]() - d[".tag"] = .str("always") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .oneDay: + var d = [String: JSON]() + d[".tag"] = .str("one_day") + return .dictionary(d) + case .twoDays: + var d = [String: JSON]() + d[".tag"] = .str("two_days") + return .dictionary(d) + case .sevenDays: + var d = [String: JSON]() + d[".tag"] = .str("seven_days") + return .dictionary(d) + case .thirtyDays: + var d = [String: JSON]() + d[".tag"] = .str("thirty_days") + return .dictionary(d) + case .always: + var d = [String: JSON]() + d[".tag"] = .str("always") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GracePeriod { + + public func deserialize(_ json: JSON) throws -> GracePeriod { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "one_day": - return GracePeriod.oneDay - case "two_days": - return GracePeriod.twoDays - case "seven_days": - return GracePeriod.sevenDays - case "thirty_days": - return GracePeriod.thirtyDays - case "always": - return GracePeriod.always - case "other": - return GracePeriod.other - default: - return GracePeriod.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "one_day": + return GracePeriod.oneDay + case "two_days": + return GracePeriod.twoDays + case "seven_days": + return GracePeriod.sevenDays + case "thirty_days": + return GracePeriod.thirtyDays + case "always": + return GracePeriod.always + case "other": + return GracePeriod.other default: - fatalError("Failed to deserialize") + return GracePeriod.other + } + default: + throw JSONSerializerError.deserializeError(type: GracePeriod.self, json: json) } } } /// Arguments for listV2. - open class ListFileRequestsArg: CustomStringConvertible { + public class ListFileRequestsArg: CustomStringConvertible, JSONRepresentable { /// The maximum number of file requests that should be returned per request. public let limit: UInt64 - public init(limit: UInt64 = 1000) { + public init(limit: UInt64 = 1_000) { comparableValidator()(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileRequestsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileRequestsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileRequestsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileRequestsArg: \(error)" + } } } - open class ListFileRequestsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileRequestsArg) -> JSON { - let output = [ - "limit": Serialization._UInt64Serializer.serialize(value.limit), + + public class ListFileRequestsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileRequestsArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt64Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileRequestsArg { + + public func deserialize(_ json: JSON) throws -> ListFileRequestsArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt64Serializer.deserialize(dict["limit"] ?? .number(1000)) - return ListFileRequestsArg(limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt64Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return ListFileRequestsArg(limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListFileRequestsArg.self, json: json) } } } /// The ListFileRequestsContinueArg struct - open class ListFileRequestsContinueArg: CustomStringConvertible { + public class ListFileRequestsContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned by the previous API call specified in the endpoint description. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileRequestsContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileRequestsContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileRequestsContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileRequestsContinueArg: \(error)" + } } } - open class ListFileRequestsContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileRequestsContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListFileRequestsContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileRequestsContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileRequestsContinueArg { + + public func deserialize(_ json: JSON) throws -> ListFileRequestsContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListFileRequestsContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListFileRequestsContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFileRequestsContinueArg.self, json: json) } } } /// There was an error retrieving the file requests. - public enum ListFileRequestsContinueError: CustomStringConvertible { + public enum ListFileRequestsContinueError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. @@ -1056,167 +1266,209 @@ open class FileRequests { /// The cursor is invalid. case invalidCursor + func json() throws -> JSON { + try ListFileRequestsContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileRequestsContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileRequestsContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileRequestsContinueError: \(error)" + } } } - open class ListFileRequestsContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileRequestsContinueError) -> JSON { + + public class ListFileRequestsContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileRequestsContinueError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> ListFileRequestsContinueError { + + public func deserialize(_ json: JSON) throws -> ListFileRequestsContinueError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return ListFileRequestsContinueError.disabledForTeam - case "other": - return ListFileRequestsContinueError.other - case "invalid_cursor": - return ListFileRequestsContinueError.invalidCursor - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return ListFileRequestsContinueError.disabledForTeam + case "other": + return ListFileRequestsContinueError.other + case "invalid_cursor": + return ListFileRequestsContinueError.invalidCursor default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ListFileRequestsContinueError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ListFileRequestsContinueError.self, json: json) } } } /// There was an error retrieving the file requests. - public enum ListFileRequestsError: CustomStringConvertible { + public enum ListFileRequestsError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. case other + func json() throws -> JSON { + try ListFileRequestsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileRequestsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileRequestsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileRequestsError: \(error)" + } } } - open class ListFileRequestsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileRequestsError) -> JSON { + + public class ListFileRequestsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileRequestsError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> ListFileRequestsError { + + public func deserialize(_ json: JSON) throws -> ListFileRequestsError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return ListFileRequestsError.disabledForTeam - case "other": - return ListFileRequestsError.other - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return ListFileRequestsError.disabledForTeam + case "other": + return ListFileRequestsError.other default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ListFileRequestsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ListFileRequestsError.self, json: json) } } } /// Result for list_. - open class ListFileRequestsResult: CustomStringConvertible { + public class ListFileRequestsResult: CustomStringConvertible, JSONRepresentable { /// The file requests owned by this user. Apps with the app folder permission will only see file requests in /// their app folder. - public let fileRequests: Array - public init(fileRequests: Array) { + public let fileRequests: [FileRequests.FileRequest] + public init(fileRequests: [FileRequests.FileRequest]) { self.fileRequests = fileRequests } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileRequestsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileRequestsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileRequestsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileRequestsResult: \(error)" + } } } - open class ListFileRequestsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileRequestsResult) -> JSON { - let output = [ - "file_requests": ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), + + public class ListFileRequestsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileRequestsResult) throws -> JSON { + let output = [ + "file_requests": try ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileRequestsResult { + + public func deserialize(_ json: JSON) throws -> ListFileRequestsResult { switch json { - case .dictionary(let dict): - let fileRequests = ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) - return ListFileRequestsResult(fileRequests: fileRequests) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequests = try ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) + return ListFileRequestsResult(fileRequests: fileRequests) + default: + throw JSONSerializerError.deserializeError(type: ListFileRequestsResult.self, json: json) } } } /// Result for listV2 and listContinue. - open class ListFileRequestsV2Result: CustomStringConvertible { + public class ListFileRequestsV2Result: CustomStringConvertible, JSONRepresentable { /// The file requests owned by this user. Apps with the app folder permission will only see file requests in /// their app folder. - public let fileRequests: Array + public let fileRequests: [FileRequests.FileRequest] /// Pass the cursor into listContinue to obtain additional file requests. public let cursor: String /// Is true if there are additional file requests that have not been returned yet. An additional call to /// :route:list/continue` can retrieve them. public let hasMore: Bool - public init(fileRequests: Array, cursor: String, hasMore: Bool) { + public init(fileRequests: [FileRequests.FileRequest], cursor: String, hasMore: Bool) { self.fileRequests = fileRequests stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileRequestsV2ResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileRequestsV2ResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileRequestsV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileRequestsV2Result: \(error)" + } } } - open class ListFileRequestsV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileRequestsV2Result) -> JSON { - let output = [ - "file_requests": ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class ListFileRequestsV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileRequestsV2Result) throws -> JSON { + let output = [ + "file_requests": try ArraySerializer(FileRequests.FileRequestSerializer()).serialize(value.fileRequests), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileRequestsV2Result { + + public func deserialize(_ json: JSON) throws -> ListFileRequestsV2Result { switch json { - case .dictionary(let dict): - let fileRequests = ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return ListFileRequestsV2Result(fileRequests: fileRequests, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequests = try ArraySerializer(FileRequests.FileRequestSerializer()).deserialize(dict["file_requests"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return ListFileRequestsV2Result(fileRequests: fileRequests, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: ListFileRequestsV2Result.self, json: json) } } } /// Arguments for update. - open class UpdateFileRequestArgs: CustomStringConvertible { + public class UpdateFileRequestArgs: CustomStringConvertible, JSONRepresentable { /// The ID of the file request to update. public let id: String /// The new title of the file request. Must not be empty. @@ -1230,7 +1482,14 @@ open class FileRequests { public let open: Bool? /// The description of the file request. public let description_: String? - public init(id: String, title: String? = nil, destination: String? = nil, deadline: FileRequests.UpdateFileRequestDeadline = .noUpdate, open: Bool? = nil, description_: String? = nil) { + public init( + id: String, + title: String? = nil, + destination: String? = nil, + deadline: FileRequests.UpdateFileRequestDeadline = .noUpdate, + open: Bool? = nil, + description_: String? = nil + ) { stringValidator(minLength: 1, pattern: "[-_0-9a-zA-Z]+")(id) self.id = id nullableValidator(stringValidator(minLength: 1))(title) @@ -1242,41 +1501,53 @@ open class FileRequests { nullableValidator(stringValidator())(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFileRequestArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try UpdateFileRequestArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFileRequestArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFileRequestArgs: \(error)" + } } } - open class UpdateFileRequestArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFileRequestArgs) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "title": NullableSerializer(Serialization._StringSerializer).serialize(value.title), - "destination": NullableSerializer(Serialization._StringSerializer).serialize(value.destination), - "deadline": FileRequests.UpdateFileRequestDeadlineSerializer().serialize(value.deadline), - "open": NullableSerializer(Serialization._BoolSerializer).serialize(value.open), - "description": NullableSerializer(Serialization._StringSerializer).serialize(value.description_), + + public class UpdateFileRequestArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFileRequestArgs) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "title": try NullableSerializer(Serialization._StringSerializer).serialize(value.title), + "destination": try NullableSerializer(Serialization._StringSerializer).serialize(value.destination), + "deadline": try FileRequests.UpdateFileRequestDeadlineSerializer().serialize(value.deadline), + "open": try NullableSerializer(Serialization._BoolSerializer).serialize(value.open), + "description": try NullableSerializer(Serialization._StringSerializer).serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UpdateFileRequestArgs { + + public func deserialize(_ json: JSON) throws -> UpdateFileRequestArgs { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let title = NullableSerializer(Serialization._StringSerializer).deserialize(dict["title"] ?? .null) - let destination = NullableSerializer(Serialization._StringSerializer).deserialize(dict["destination"] ?? .null) - let deadline = FileRequests.UpdateFileRequestDeadlineSerializer().deserialize(dict["deadline"] ?? FileRequests.UpdateFileRequestDeadlineSerializer().serialize(.noUpdate)) - let open = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["open"] ?? .null) - let description_ = NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) - return UpdateFileRequestArgs(id: id, title: title, destination: destination, deadline: deadline, open: open, description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let title = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["title"] ?? .null) + let destination = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["destination"] ?? .null) + let deadline = try FileRequests.UpdateFileRequestDeadlineSerializer() + .deserialize(dict["deadline"] ?? FileRequests.UpdateFileRequestDeadlineSerializer().serialize(.noUpdate)) + let open = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["open"] ?? .null) + let description_ = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) + return UpdateFileRequestArgs(id: id, title: title, destination: destination, deadline: deadline, open: open, description_: description_) + default: + throw JSONSerializerError.deserializeError(type: UpdateFileRequestArgs.self, json: json) } } } /// The UpdateFileRequestDeadline union - public enum UpdateFileRequestDeadline: CustomStringConvertible { + public enum UpdateFileRequestDeadline: CustomStringConvertible, JSONRepresentable { /// Do not change the file request's deadline. case noUpdate /// If null, the file request's deadline is cleared. @@ -1284,51 +1555,61 @@ open class FileRequests { /// An unspecified error. case other + func json() throws -> JSON { + try UpdateFileRequestDeadlineSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFileRequestDeadlineSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFileRequestDeadlineSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFileRequestDeadline: \(error)" + } } } - open class UpdateFileRequestDeadlineSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFileRequestDeadline) -> JSON { + + public class UpdateFileRequestDeadlineSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFileRequestDeadline) throws -> JSON { switch value { - case .noUpdate: - var d = [String: JSON]() - d[".tag"] = .str("no_update") - return .dictionary(d) - case .update(let arg): - var d = ["update": NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).serialize(arg)] - d[".tag"] = .str("update") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .noUpdate: + var d = [String: JSON]() + d[".tag"] = .str("no_update") + return .dictionary(d) + case .update(let arg): + var d = try ["update": NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).serialize(arg)] + d[".tag"] = .str("update") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> UpdateFileRequestDeadline { + + public func deserialize(_ json: JSON) throws -> UpdateFileRequestDeadline { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "no_update": - return UpdateFileRequestDeadline.noUpdate - case "update": - let v = NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).deserialize(d["update"] ?? .null) - return UpdateFileRequestDeadline.update(v) - case "other": - return UpdateFileRequestDeadline.other - default: - return UpdateFileRequestDeadline.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "no_update": + return UpdateFileRequestDeadline.noUpdate + case "update": + let v = try NullableSerializer(FileRequests.FileRequestDeadlineSerializer()).deserialize(d["update"] ?? .null) + return UpdateFileRequestDeadline.update(v) + case "other": + return UpdateFileRequestDeadline.other default: - fatalError("Failed to deserialize") + return UpdateFileRequestDeadline.other + } + default: + throw JSONSerializerError.deserializeError(type: UpdateFileRequestDeadline.self, json: json) } } } /// There is an error updating the file request. - public enum UpdateFileRequestError: CustomStringConvertible { + public enum UpdateFileRequestError: CustomStringConvertible, JSONRepresentable { /// This user's Dropbox Business team doesn't allow file requests. case disabledForTeam /// An unspecified error. @@ -1349,79 +1630,88 @@ open class FileRequests { /// characters in the destination path. case validationError + func json() throws -> JSON { + try UpdateFileRequestErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFileRequestErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFileRequestErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFileRequestError: \(error)" + } } } - open class UpdateFileRequestErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFileRequestError) -> JSON { + + public class UpdateFileRequestErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFileRequestError) throws -> JSON { switch value { - case .disabledForTeam: - var d = [String: JSON]() - d[".tag"] = .str("disabled_for_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notAFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_a_folder") - return .dictionary(d) - case .appLacksAccess: - var d = [String: JSON]() - d[".tag"] = .str("app_lacks_access") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .validationError: - var d = [String: JSON]() - d[".tag"] = .str("validation_error") - return .dictionary(d) + case .disabledForTeam: + var d = [String: JSON]() + d[".tag"] = .str("disabled_for_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notAFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_a_folder") + return .dictionary(d) + case .appLacksAccess: + var d = [String: JSON]() + d[".tag"] = .str("app_lacks_access") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .validationError: + var d = [String: JSON]() + d[".tag"] = .str("validation_error") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> UpdateFileRequestError { + + public func deserialize(_ json: JSON) throws -> UpdateFileRequestError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled_for_team": - return UpdateFileRequestError.disabledForTeam - case "other": - return UpdateFileRequestError.other - case "not_found": - return UpdateFileRequestError.notFound - case "not_a_folder": - return UpdateFileRequestError.notAFolder - case "app_lacks_access": - return UpdateFileRequestError.appLacksAccess - case "no_permission": - return UpdateFileRequestError.noPermission - case "email_unverified": - return UpdateFileRequestError.emailUnverified - case "validation_error": - return UpdateFileRequestError.validationError - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled_for_team": + return UpdateFileRequestError.disabledForTeam + case "other": + return UpdateFileRequestError.other + case "not_found": + return UpdateFileRequestError.notFound + case "not_a_folder": + return UpdateFileRequestError.notAFolder + case "app_lacks_access": + return UpdateFileRequestError.appLacksAccess + case "no_permission": + return UpdateFileRequestError.noPermission + case "email_unverified": + return UpdateFileRequestError.emailUnverified + case "validation_error": + return UpdateFileRequestError.validationError default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: UpdateFileRequestError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UpdateFileRequestError.self, json: json) } } } - /// Stone Route Objects static let count = Route( @@ -1432,9 +1722,11 @@ open class FileRequests { argSerializer: Serialization._VoidSerializer, responseSerializer: FileRequests.CountFileRequestsResultSerializer(), errorSerializer: FileRequests.CountFileRequestsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let create = Route( name: "create", @@ -1444,9 +1736,11 @@ open class FileRequests { argSerializer: FileRequests.CreateFileRequestArgsSerializer(), responseSerializer: FileRequests.FileRequestSerializer(), errorSerializer: FileRequests.CreateFileRequestErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let delete = Route( name: "delete", @@ -1456,9 +1750,11 @@ open class FileRequests { argSerializer: FileRequests.DeleteFileRequestArgsSerializer(), responseSerializer: FileRequests.DeleteFileRequestsResultSerializer(), errorSerializer: FileRequests.DeleteFileRequestErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let deleteAllClosed = Route( name: "delete_all_closed", @@ -1468,9 +1764,11 @@ open class FileRequests { argSerializer: Serialization._VoidSerializer, responseSerializer: FileRequests.DeleteAllClosedFileRequestsResultSerializer(), errorSerializer: FileRequests.DeleteAllClosedFileRequestsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let get = Route( name: "get", @@ -1480,21 +1778,25 @@ open class FileRequests { argSerializer: FileRequests.GetFileRequestArgsSerializer(), responseSerializer: FileRequests.FileRequestSerializer(), errorSerializer: FileRequests.GetFileRequestErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listV2 = Route( - name: "list", + name: "list_v2", version: 2, namespace: "file_requests", deprecated: false, argSerializer: FileRequests.ListFileRequestsArgSerializer(), responseSerializer: FileRequests.ListFileRequestsV2ResultSerializer(), errorSerializer: FileRequests.ListFileRequestsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let list_ = Route( name: "list", @@ -1504,9 +1806,11 @@ open class FileRequests { argSerializer: Serialization._VoidSerializer, responseSerializer: FileRequests.ListFileRequestsResultSerializer(), errorSerializer: FileRequests.ListFileRequestsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listContinue = Route( name: "list/continue", @@ -1516,9 +1820,11 @@ open class FileRequests { argSerializer: FileRequests.ListFileRequestsContinueArgSerializer(), responseSerializer: FileRequests.ListFileRequestsV2ResultSerializer(), errorSerializer: FileRequests.ListFileRequestsContinueErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let update = Route( name: "update", @@ -1528,8 +1834,10 @@ open class FileRequests { argSerializer: FileRequests.UpdateFileRequestArgsSerializer(), responseSerializer: FileRequests.FileRequestSerializer(), errorSerializer: FileRequests.UpdateFileRequestErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/FileRequestsRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/FileRequestsRoutes.swift index 790d983cd..6ea345af3 100644 --- a/Source/SwiftyDropbox/Shared/Generated/FileRequestsRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/FileRequestsRoutes.swift @@ -7,24 +7,29 @@ import Foundation /// Routes for the file_requests namespace -open class FileRequestsRoutes { +/// For Objective-C compatible routes see DBFileRequestsRoutes +public class FileRequestsRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Returns the total number of file requests owned by this user. Includes both open and closed file requests. /// + /// - scope: file_requests.read /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.CountFileRequestsResult` + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.CountFileRequestsResult` /// object on success or a `FileRequests.CountFileRequestsError` object on failure. - @discardableResult open func count() -> RpcRequest { + @discardableResult public func count() -> RpcRequest { let route = FileRequests.count return client.request(route) } /// Creates a file request for this user. /// + /// - scope: file_requests.write + /// /// - parameter title: The title of the file request. Must not be empty. /// - parameter destination: The path of the folder in the Dropbox where uploaded files will be sent. For apps with /// the app folder permission, this will be relative to the app folder. @@ -34,9 +39,15 @@ open class FileRequestsRoutes { /// accept any file submissions, but it can be opened later. /// - parameter description_: A description of the file request. /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on - /// success or a `FileRequests.CreateFileRequestError` object on failure. - @discardableResult open func create(title: String, destination: String, deadline: FileRequests.FileRequestDeadline? = nil, open: Bool = true, description_: String? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.CreateFileRequestError` object on failure. + @discardableResult public func create( + title: String, + destination: String, + deadline: FileRequests.FileRequestDeadline? = nil, + open: Bool = true, + description_: String? = nil + ) -> RpcRequest { let route = FileRequests.create let serverArgs = FileRequests.CreateFileRequestArgs(title: title, destination: destination, deadline: deadline, open: open, description_: description_) return client.request(route, serverArgs: serverArgs) @@ -44,11 +55,14 @@ open class FileRequestsRoutes { /// Delete a batch of closed file requests. /// + /// - scope: file_requests.write + /// /// - parameter ids: List IDs of the file requests to delete. /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.DeleteFileRequestsResult` + /// - returns: Through the response callback, the caller will receive a `FileRequests.DeleteFileRequestsResult` /// object on success or a `FileRequests.DeleteFileRequestError` object on failure. - @discardableResult open func delete(ids: Array) -> RpcRequest { + @discardableResult public func delete(ids: [String]) + -> RpcRequest { let route = FileRequests.delete let serverArgs = FileRequests.DeleteFileRequestArgs(ids: ids) return client.request(route, serverArgs: serverArgs) @@ -56,22 +70,27 @@ open class FileRequestsRoutes { /// Delete all closed file requests owned by this user. /// + /// - scope: file_requests.write /// - /// - returns: Through the response callback, the caller will receive a + /// + /// - returns: Through the response callback, the caller will receive a /// `FileRequests.DeleteAllClosedFileRequestsResult` object on success or a /// `FileRequests.DeleteAllClosedFileRequestsError` object on failure. - @discardableResult open func deleteAllClosed() -> RpcRequest { + @discardableResult public func deleteAllClosed() + -> RpcRequest { let route = FileRequests.deleteAllClosed return client.request(route) } /// Returns the specified file request. /// + /// - scope: file_requests.read + /// /// - parameter id: The ID of the file request to retrieve. /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on - /// success or a `FileRequests.GetFileRequestError` object on failure. - @discardableResult open func get(id: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.GetFileRequestError` object on failure. + @discardableResult public func get(id: String) -> RpcRequest { let route = FileRequests.get let serverArgs = FileRequests.GetFileRequestArgs(id: id) return client.request(route, serverArgs: serverArgs) @@ -80,11 +99,14 @@ open class FileRequestsRoutes { /// Returns a list of file requests owned by this user. For apps with the app folder permission, this will only /// return file requests with destinations in the app folder. /// + /// - scope: file_requests.read + /// /// - parameter limit: The maximum number of file requests that should be returned per request. /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsV2Result` + /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsV2Result` /// object on success or a `FileRequests.ListFileRequestsError` object on failure. - @discardableResult open func listV2(limit: UInt64 = 1000) -> RpcRequest { + @discardableResult public func listV2(limit: UInt64 = 1_000) + -> RpcRequest { let route = FileRequests.listV2 let serverArgs = FileRequests.ListFileRequestsArg(limit: limit) return client.request(route, serverArgs: serverArgs) @@ -93,10 +115,12 @@ open class FileRequestsRoutes { /// Returns a list of file requests owned by this user. For apps with the app folder permission, this will only /// return file requests with destinations in the app folder. /// + /// - scope: file_requests.read /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsResult` - /// object on success or a `FileRequests.ListFileRequestsError` object on failure. - @discardableResult open func list_() -> RpcRequest { + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsResult` object + /// on success or a `FileRequests.ListFileRequestsError` object on failure. + @discardableResult public func list_() -> RpcRequest { let route = FileRequests.list_ return client.request(route) } @@ -104,11 +128,14 @@ open class FileRequestsRoutes { /// Once a cursor has been retrieved from listV2, use this to paginate through all file requests. The cursor must /// come from a previous call to listV2 or listContinue. /// + /// - scope: file_requests.read + /// /// - parameter cursor: The cursor returned by the previous API call specified in the endpoint description. /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsV2Result` + /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsV2Result` /// object on success or a `FileRequests.ListFileRequestsContinueError` object on failure. - @discardableResult open func listContinue(cursor: String) -> RpcRequest { + @discardableResult public func listContinue(cursor: String) + -> RpcRequest { let route = FileRequests.listContinue let serverArgs = FileRequests.ListFileRequestsContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -116,6 +143,8 @@ open class FileRequestsRoutes { /// Update a file request. /// + /// - scope: file_requests.write + /// /// - parameter id: The ID of the file request to update. /// - parameter title: The new title of the file request. Must not be empty. /// - parameter destination: The new path of the folder in the Dropbox where uploaded files will be sent. For apps @@ -125,12 +154,25 @@ open class FileRequestsRoutes { /// - parameter open: Whether to set this file request as open or closed. /// - parameter description_: The description of the file request. /// - /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on - /// success or a `FileRequests.UpdateFileRequestError` object on failure. - @discardableResult open func update(id: String, title: String? = nil, destination: String? = nil, deadline: FileRequests.UpdateFileRequestDeadline = .noUpdate, open: Bool? = nil, description_: String? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.UpdateFileRequestError` object on failure. + @discardableResult public func update( + id: String, + title: String? = nil, + destination: String? = nil, + deadline: FileRequests.UpdateFileRequestDeadline = .noUpdate, + open: Bool? = nil, + description_: String? = nil + ) -> RpcRequest { let route = FileRequests.update - let serverArgs = FileRequests.UpdateFileRequestArgs(id: id, title: title, destination: destination, deadline: deadline, open: open, description_: description_) + let serverArgs = FileRequests.UpdateFileRequestArgs( + id: id, + title: title, + destination: destination, + deadline: deadline, + open: open, + description_: description_ + ) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Files.swift b/Source/SwiftyDropbox/Shared/Generated/Files.swift index 0b4aad737..52dd2f0db 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Files.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Files.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the files namespace -open class Files { +public class Files { /// The AddTagArg struct - open class AddTagArg: CustomStringConvertible { + public class AddTagArg: CustomStringConvertible, JSONRepresentable { /// Path to the item to be tagged. public let path: String /// The value of the tag to add. Will be automatically converted to lowercase letters. @@ -17,80 +17,101 @@ open class Files { public init(path: String, tagText: String) { stringValidator(pattern: "/(.|[\\r\\n])*")(path) self.path = path - stringValidator(minLength: 1, maxLength: 32, pattern: "[A-Za-z0-9_]+")(tagText) + stringValidator(minLength: 1, maxLength: 32, pattern: "[\\w]+")(tagText) self.tagText = tagText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddTagArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddTagArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddTagArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddTagArg: \(error)" + } } } - open class AddTagArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddTagArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "tag_text": Serialization._StringSerializer.serialize(value.tagText), + + public class AddTagArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddTagArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "tag_text": try Serialization._StringSerializer.serialize(value.tagText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddTagArg { + + public func deserialize(_ json: JSON) throws -> AddTagArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let tagText = Serialization._StringSerializer.deserialize(dict["tag_text"] ?? .null) - return AddTagArg(path: path, tagText: tagText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let tagText = try Serialization._StringSerializer.deserialize(dict["tag_text"] ?? .null) + return AddTagArg(path: path, tagText: tagText) + default: + throw JSONSerializerError.deserializeError(type: AddTagArg.self, json: json) } } } /// The BaseTagError union - public enum BaseTagError: CustomStringConvertible { + public enum BaseTagError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. case other + func json() throws -> JSON { + try BaseTagErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BaseTagErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BaseTagErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BaseTagError: \(error)" + } } } - open class BaseTagErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BaseTagError) -> JSON { + + public class BaseTagErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BaseTagError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> BaseTagError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return BaseTagError.path(v) - case "other": - return BaseTagError.other - default: - return BaseTagError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> BaseTagError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return BaseTagError.path(v) + case "other": + return BaseTagError.other default: - fatalError("Failed to deserialize") + return BaseTagError.other + } + default: + throw JSONSerializerError.deserializeError(type: BaseTagError.self, json: json) } } } /// The AddTagError union - public enum AddTagError: CustomStringConvertible { + public enum AddTagError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. @@ -98,51 +119,61 @@ open class Files { /// The item already has the maximum supported number of tags. case tooManyTags + func json() throws -> JSON { + try AddTagErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddTagErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddTagErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddTagError: \(error)" + } } } - open class AddTagErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddTagError) -> JSON { + + public class AddTagErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddTagError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .tooManyTags: - var d = [String: JSON]() - d[".tag"] = .str("too_many_tags") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddTagError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return AddTagError.path(v) - case "other": - return AddTagError.other - case "too_many_tags": - return AddTagError.tooManyTags - default: - fatalError("Unknown tag \(tag)") - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .tooManyTags: + var d = [String: JSON]() + d[".tag"] = .str("too_many_tags") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddTagError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return AddTagError.path(v) + case "other": + return AddTagError.other + case "too_many_tags": + return AddTagError.tooManyTags default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: AddTagError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: AddTagError.self, json: json) } } } /// The GetMetadataArg struct - open class GetMetadataArg: CustomStringConvertible { + public class GetMetadataArg: CustomStringConvertible, JSONRepresentable { /// The path of a file or folder on Dropbox. public let path: String /// If true, mediaInfo in FileMetadata is set for photo and video. @@ -156,7 +187,13 @@ open class Files { /// If set to a valid list of template IDs, propertyGroups in FileMetadata is set if there exists property data /// associated with the file and each of the listed templates. public let includePropertyGroups: FileProperties.TemplateFilterBase? - public init(path: String, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includePropertyGroups: FileProperties.TemplateFilterBase? = nil) { + public init( + path: String, + includeMediaInfo: Bool = false, + includeDeleted: Bool = false, + includeHasExplicitSharedMembers: Bool = false, + includePropertyGroups: FileProperties.TemplateFilterBase? = nil + ) { stringValidator(pattern: "(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)")(path) self.path = path self.includeMediaInfo = includeMediaInfo @@ -164,163 +201,233 @@ open class Files { self.includeHasExplicitSharedMembers = includeHasExplicitSharedMembers self.includePropertyGroups = includePropertyGroups } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetMetadataArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetMetadataArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetMetadataArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetMetadataArg: \(error)" + } } } - open class GetMetadataArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetMetadataArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "include_media_info": Serialization._BoolSerializer.serialize(value.includeMediaInfo), - "include_deleted": Serialization._BoolSerializer.serialize(value.includeDeleted), - "include_has_explicit_shared_members": Serialization._BoolSerializer.serialize(value.includeHasExplicitSharedMembers), - "include_property_groups": NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).serialize(value.includePropertyGroups), + + public class GetMetadataArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetMetadataArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "include_media_info": try Serialization._BoolSerializer.serialize(value.includeMediaInfo), + "include_deleted": try Serialization._BoolSerializer.serialize(value.includeDeleted), + "include_has_explicit_shared_members": try Serialization._BoolSerializer.serialize(value.includeHasExplicitSharedMembers), + "include_property_groups": try NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).serialize(value.includePropertyGroups), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetMetadataArg { + + public func deserialize(_ json: JSON) throws -> GetMetadataArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let includeMediaInfo = Serialization._BoolSerializer.deserialize(dict["include_media_info"] ?? .number(0)) - let includeDeleted = Serialization._BoolSerializer.deserialize(dict["include_deleted"] ?? .number(0)) - let includeHasExplicitSharedMembers = Serialization._BoolSerializer.deserialize(dict["include_has_explicit_shared_members"] ?? .number(0)) - let includePropertyGroups = NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).deserialize(dict["include_property_groups"] ?? .null) - return GetMetadataArg(path: path, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includePropertyGroups: includePropertyGroups) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let includeMediaInfo = try Serialization._BoolSerializer.deserialize(dict["include_media_info"] ?? .number(0)) + let includeDeleted = try Serialization._BoolSerializer.deserialize(dict["include_deleted"] ?? .number(0)) + let includeHasExplicitSharedMembers = try Serialization._BoolSerializer + .deserialize(dict["include_has_explicit_shared_members"] ?? .number(0)) + let includePropertyGroups = try NullableSerializer(FileProperties.TemplateFilterBaseSerializer()) + .deserialize(dict["include_property_groups"] ?? .null) + return GetMetadataArg( + path: path, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includePropertyGroups: includePropertyGroups + ) + default: + throw JSONSerializerError.deserializeError(type: GetMetadataArg.self, json: json) } } } /// The AlphaGetMetadataArg struct - open class AlphaGetMetadataArg: Files.GetMetadataArg { + public class AlphaGetMetadataArg: Files.GetMetadataArg { /// If set to a valid list of template IDs, propertyGroups in FileMetadata is set for files with custom /// properties. - public let includePropertyTemplates: Array? - public init(path: String, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includePropertyGroups: FileProperties.TemplateFilterBase? = nil, includePropertyTemplates: Array? = nil) { + public let includePropertyTemplates: [String]? + public init( + path: String, + includeMediaInfo: Bool = false, + includeDeleted: Bool = false, + includeHasExplicitSharedMembers: Bool = false, + includePropertyGroups: FileProperties.TemplateFilterBase? = nil, + includePropertyTemplates: [String]? = nil + ) { nullableValidator(arrayValidator(itemValidator: stringValidator(minLength: 1, pattern: "(/|ptid:).*")))(includePropertyTemplates) self.includePropertyTemplates = includePropertyTemplates - super.init(path: path, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includePropertyGroups: includePropertyGroups) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AlphaGetMetadataArgSerializer().serialize(self)))" - } - } - open class AlphaGetMetadataArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AlphaGetMetadataArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "include_media_info": Serialization._BoolSerializer.serialize(value.includeMediaInfo), - "include_deleted": Serialization._BoolSerializer.serialize(value.includeDeleted), - "include_has_explicit_shared_members": Serialization._BoolSerializer.serialize(value.includeHasExplicitSharedMembers), - "include_property_groups": NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).serialize(value.includePropertyGroups), - "include_property_templates": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.includePropertyTemplates), + super.init( + path: path, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includePropertyGroups: includePropertyGroups + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AlphaGetMetadataArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AlphaGetMetadataArg: \(error)" + } + } + } + + public class AlphaGetMetadataArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AlphaGetMetadataArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "include_media_info": try Serialization._BoolSerializer.serialize(value.includeMediaInfo), + "include_deleted": try Serialization._BoolSerializer.serialize(value.includeDeleted), + "include_has_explicit_shared_members": try Serialization._BoolSerializer.serialize(value.includeHasExplicitSharedMembers), + "include_property_groups": try NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).serialize(value.includePropertyGroups), + "include_property_templates": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)) + .serialize(value.includePropertyTemplates), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AlphaGetMetadataArg { + + public func deserialize(_ json: JSON) throws -> AlphaGetMetadataArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let includeMediaInfo = Serialization._BoolSerializer.deserialize(dict["include_media_info"] ?? .number(0)) - let includeDeleted = Serialization._BoolSerializer.deserialize(dict["include_deleted"] ?? .number(0)) - let includeHasExplicitSharedMembers = Serialization._BoolSerializer.deserialize(dict["include_has_explicit_shared_members"] ?? .number(0)) - let includePropertyGroups = NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).deserialize(dict["include_property_groups"] ?? .null) - let includePropertyTemplates = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["include_property_templates"] ?? .null) - return AlphaGetMetadataArg(path: path, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includePropertyGroups: includePropertyGroups, includePropertyTemplates: includePropertyTemplates) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let includeMediaInfo = try Serialization._BoolSerializer.deserialize(dict["include_media_info"] ?? .number(0)) + let includeDeleted = try Serialization._BoolSerializer.deserialize(dict["include_deleted"] ?? .number(0)) + let includeHasExplicitSharedMembers = try Serialization._BoolSerializer + .deserialize(dict["include_has_explicit_shared_members"] ?? .number(0)) + let includePropertyGroups = try NullableSerializer(FileProperties.TemplateFilterBaseSerializer()) + .deserialize(dict["include_property_groups"] ?? .null) + let includePropertyTemplates = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)) + .deserialize(dict["include_property_templates"] ?? .null) + return AlphaGetMetadataArg( + path: path, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includePropertyGroups: includePropertyGroups, + includePropertyTemplates: includePropertyTemplates + ) + default: + throw JSONSerializerError.deserializeError(type: AlphaGetMetadataArg.self, json: json) } } } /// The GetMetadataError union - public enum GetMetadataError: CustomStringConvertible { + public enum GetMetadataError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) + func json() throws -> JSON { + try GetMetadataErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetMetadataErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetMetadataErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetMetadataError: \(error)" + } } } - open class GetMetadataErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetMetadataError) -> JSON { + + public class GetMetadataErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetMetadataError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetMetadataError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return GetMetadataError.path(v) - default: - fatalError("Unknown tag \(tag)") - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetMetadataError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return GetMetadataError.path(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GetMetadataError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GetMetadataError.self, json: json) } } } /// The AlphaGetMetadataError union - public enum AlphaGetMetadataError: CustomStringConvertible { + public enum AlphaGetMetadataError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. case propertiesError(FileProperties.LookUpPropertiesError) + func json() throws -> JSON { + try AlphaGetMetadataErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AlphaGetMetadataErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AlphaGetMetadataErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AlphaGetMetadataError: \(error)" + } } } - open class AlphaGetMetadataErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AlphaGetMetadataError) -> JSON { + + public class AlphaGetMetadataErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AlphaGetMetadataError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .propertiesError(let arg): - var d = ["properties_error": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] - d[".tag"] = .str("properties_error") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AlphaGetMetadataError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return AlphaGetMetadataError.path(v) - case "properties_error": - let v = FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["properties_error"] ?? .null) - return AlphaGetMetadataError.propertiesError(v) - default: - fatalError("Unknown tag \(tag)") - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .propertiesError(let arg): + var d = try ["properties_error": FileProperties.LookUpPropertiesErrorSerializer().serialize(arg)] + d[".tag"] = .str("properties_error") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AlphaGetMetadataError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return AlphaGetMetadataError.path(v) + case "properties_error": + let v = try FileProperties.LookUpPropertiesErrorSerializer().deserialize(d["properties_error"] ?? .null) + return AlphaGetMetadataError.propertiesError(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: AlphaGetMetadataError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: AlphaGetMetadataError.self, json: json) } } } /// The CommitInfo struct - open class CommitInfo: CustomStringConvertible { + public class CommitInfo: CustomStringConvertible, JSONRepresentable { /// Path in the user's Dropbox to save the file. public let path: String /// Selects what to do if the file already exists. @@ -329,21 +436,29 @@ open class Files { /// conflict. public let autorename: Bool /// The value to store as the clientModified timestamp. Dropbox automatically records the time at which the file - /// was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox desktop - /// clients, mobile clients, and API apps of when the file was actually created or modified. + /// was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox + /// desktop clients, mobile clients, and API apps of when the file was actually created or modified. public let clientModified: Date? /// Normally, users are made aware of any file modifications in their Dropbox account via notifications in the /// client software. If true, this tells the clients that this modification shouldn't result in a user /// notification. public let mute: Bool /// List of custom properties to add to file. - public let propertyGroups: Array? + public let propertyGroups: [FileProperties.PropertyGroup]? /// Be more strict about how each WriteMode detects conflict. For example, always return a conflict error when - /// mode = update in WriteMode and the given "rev" doesn't match the existing file's "rev", even if the existing - /// file has been deleted. This also forces a conflict even when the target path refers to a file with identical - /// contents. + /// mode = update in WriteMode and the given "rev" doesn't match the existing file's "rev", even if the + /// existing file has been deleted. This also forces a conflict even when the target path refers to a + /// file with identical contents. public let strictConflict: Bool - public init(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false) { + public init( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false + ) { stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)")(path) self.path = path self.mode = mode @@ -353,43 +468,63 @@ open class Files { self.propertyGroups = propertyGroups self.strictConflict = strictConflict } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CommitInfoSerializer().serialize(self)))" - } - } - open class CommitInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CommitInfo) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "mode": Files.WriteModeSerializer().serialize(value.mode), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), - "client_modified": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.clientModified), - "mute": Serialization._BoolSerializer.serialize(value.mute), - "property_groups": NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), - "strict_conflict": Serialization._BoolSerializer.serialize(value.strictConflict), + + func json() throws -> JSON { + try CommitInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CommitInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CommitInfo: \(error)" + } + } + } + + public class CommitInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CommitInfo) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "mode": try Files.WriteModeSerializer().serialize(value.mode), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), + "client_modified": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.clientModified), + "mute": try Serialization._BoolSerializer.serialize(value.mute), + "property_groups": try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), + "strict_conflict": try Serialization._BoolSerializer.serialize(value.strictConflict), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CommitInfo { - switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let mode = Files.WriteModeSerializer().deserialize(dict["mode"] ?? Files.WriteModeSerializer().serialize(.add)) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - let clientModified = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["client_modified"] ?? .null) - let mute = Serialization._BoolSerializer.deserialize(dict["mute"] ?? .number(0)) - let propertyGroups = NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).deserialize(dict["property_groups"] ?? .null) - let strictConflict = Serialization._BoolSerializer.deserialize(dict["strict_conflict"] ?? .number(0)) - return CommitInfo(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> CommitInfo { + switch json { + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let mode = try Files.WriteModeSerializer().deserialize(dict["mode"] ?? Files.WriteModeSerializer().serialize(.add)) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + let clientModified = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["client_modified"] ?? .null) + let mute = try Serialization._BoolSerializer.deserialize(dict["mute"] ?? .number(0)) + let propertyGroups = try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())) + .deserialize(dict["property_groups"] ?? .null) + let strictConflict = try Serialization._BoolSerializer.deserialize(dict["strict_conflict"] ?? .number(0)) + return CommitInfo( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict + ) + default: + throw JSONSerializerError.deserializeError(type: CommitInfo.self, json: json) } } } /// The ContentSyncSetting struct - open class ContentSyncSetting: CustomStringConvertible { + public class ContentSyncSetting: CustomStringConvertible, JSONRepresentable { /// Id of the item this setting is applied to. public let id: String /// Setting for this item. @@ -399,33 +534,44 @@ open class Files { self.id = id self.syncSetting = syncSetting } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ContentSyncSettingSerializer().serialize(self)))" + + func json() throws -> JSON { + try ContentSyncSettingSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ContentSyncSettingSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ContentSyncSetting: \(error)" + } } } - open class ContentSyncSettingSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ContentSyncSetting) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "sync_setting": Files.SyncSettingSerializer().serialize(value.syncSetting), + + public class ContentSyncSettingSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ContentSyncSetting) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "sync_setting": try Files.SyncSettingSerializer().serialize(value.syncSetting), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ContentSyncSetting { + + public func deserialize(_ json: JSON) throws -> ContentSyncSetting { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let syncSetting = Files.SyncSettingSerializer().deserialize(dict["sync_setting"] ?? .null) - return ContentSyncSetting(id: id, syncSetting: syncSetting) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let syncSetting = try Files.SyncSettingSerializer().deserialize(dict["sync_setting"] ?? .null) + return ContentSyncSetting(id: id, syncSetting: syncSetting) + default: + throw JSONSerializerError.deserializeError(type: ContentSyncSetting.self, json: json) } } } /// The ContentSyncSettingArg struct - open class ContentSyncSettingArg: CustomStringConvertible { + public class ContentSyncSettingArg: CustomStringConvertible, JSONRepresentable { /// Id of the item this setting is applied to. public let id: String /// Setting for this item. @@ -435,33 +581,44 @@ open class Files { self.id = id self.syncSetting = syncSetting } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ContentSyncSettingArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ContentSyncSettingArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ContentSyncSettingArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ContentSyncSettingArg: \(error)" + } } } - open class ContentSyncSettingArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ContentSyncSettingArg) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "sync_setting": Files.SyncSettingArgSerializer().serialize(value.syncSetting), + + public class ContentSyncSettingArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ContentSyncSettingArg) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "sync_setting": try Files.SyncSettingArgSerializer().serialize(value.syncSetting), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ContentSyncSettingArg { + + public func deserialize(_ json: JSON) throws -> ContentSyncSettingArg { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let syncSetting = Files.SyncSettingArgSerializer().deserialize(dict["sync_setting"] ?? .null) - return ContentSyncSettingArg(id: id, syncSetting: syncSetting) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let syncSetting = try Files.SyncSettingArgSerializer().deserialize(dict["sync_setting"] ?? .null) + return ContentSyncSettingArg(id: id, syncSetting: syncSetting) + default: + throw JSONSerializerError.deserializeError(type: ContentSyncSettingArg.self, json: json) } } } /// The CreateFolderArg struct - open class CreateFolderArg: CustomStringConvertible { + public class CreateFolderArg: CustomStringConvertible, JSONRepresentable { /// Path in the user's Dropbox to create. public let path: String /// If there's a conflict, have the Dropbox server try to autorename the folder to avoid the conflict. @@ -471,118 +628,150 @@ open class Files { self.path = path self.autorename = autorename } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateFolderArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderArg: \(error)" + } } } - open class CreateFolderArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), + + public class CreateFolderArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFolderArg { + + public func deserialize(_ json: JSON) throws -> CreateFolderArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - return CreateFolderArg(path: path, autorename: autorename) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + return CreateFolderArg(path: path, autorename: autorename) + default: + throw JSONSerializerError.deserializeError(type: CreateFolderArg.self, json: json) } } } /// The CreateFolderBatchArg struct - open class CreateFolderBatchArg: CustomStringConvertible { + public class CreateFolderBatchArg: CustomStringConvertible, JSONRepresentable { /// List of paths to be created in the user's Dropbox. Duplicate path arguments in the batch are considered only /// once. - public let paths: Array + public let paths: [String] /// If there's a conflict, have the Dropbox server try to autorename the folder to avoid the conflict. public let autorename: Bool /// Whether to force the create to happen asynchronously. public let forceAsync: Bool - public init(paths: Array, autorename: Bool = false, forceAsync: Bool = false) { - arrayValidator(maxItems: 10000, itemValidator: stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)"))(paths) + public init(paths: [String], autorename: Bool = false, forceAsync: Bool = false) { + arrayValidator(maxItems: 10_000, itemValidator: stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)"))(paths) self.paths = paths self.autorename = autorename self.forceAsync = forceAsync } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateFolderBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderBatchArg: \(error)" + } } } - open class CreateFolderBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderBatchArg) -> JSON { - let output = [ - "paths": ArraySerializer(Serialization._StringSerializer).serialize(value.paths), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), - "force_async": Serialization._BoolSerializer.serialize(value.forceAsync), + + public class CreateFolderBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderBatchArg) throws -> JSON { + let output = [ + "paths": try ArraySerializer(Serialization._StringSerializer).serialize(value.paths), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), + "force_async": try Serialization._BoolSerializer.serialize(value.forceAsync), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFolderBatchArg { + + public func deserialize(_ json: JSON) throws -> CreateFolderBatchArg { switch json { - case .dictionary(let dict): - let paths = ArraySerializer(Serialization._StringSerializer).deserialize(dict["paths"] ?? .null) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - let forceAsync = Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) - return CreateFolderBatchArg(paths: paths, autorename: autorename, forceAsync: forceAsync) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let paths = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["paths"] ?? .null) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + let forceAsync = try Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) + return CreateFolderBatchArg(paths: paths, autorename: autorename, forceAsync: forceAsync) + default: + throw JSONSerializerError.deserializeError(type: CreateFolderBatchArg.self, json: json) } } } /// The CreateFolderBatchError union - public enum CreateFolderBatchError: CustomStringConvertible { + public enum CreateFolderBatchError: CustomStringConvertible, JSONRepresentable { /// The operation would involve too many files or folders. case tooManyFiles /// An unspecified error. case other + func json() throws -> JSON { + try CreateFolderBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderBatchError: \(error)" + } } } - open class CreateFolderBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderBatchError) -> JSON { + + public class CreateFolderBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderBatchError) throws -> JSON { switch value { - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateFolderBatchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "too_many_files": - return CreateFolderBatchError.tooManyFiles - case "other": - return CreateFolderBatchError.other - default: - return CreateFolderBatchError.other - } + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CreateFolderBatchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "too_many_files": + return CreateFolderBatchError.tooManyFiles + case "other": + return CreateFolderBatchError.other default: - fatalError("Failed to deserialize") + return CreateFolderBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: CreateFolderBatchError.self, json: json) } } } /// The CreateFolderBatchJobStatus union - public enum CreateFolderBatchJobStatus: CustomStringConvertible { + public enum CreateFolderBatchJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The batch create folder has finished. @@ -592,58 +781,68 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try CreateFolderBatchJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderBatchJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderBatchJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderBatchJobStatus: \(error)" + } } } - open class CreateFolderBatchJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderBatchJobStatus) -> JSON { + + public class CreateFolderBatchJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderBatchJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.CreateFolderBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Files.CreateFolderBatchErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateFolderBatchJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return CreateFolderBatchJobStatus.inProgress - case "complete": - let v = Files.CreateFolderBatchResultSerializer().deserialize(json) - return CreateFolderBatchJobStatus.complete(v) - case "failed": - let v = Files.CreateFolderBatchErrorSerializer().deserialize(d["failed"] ?? .null) - return CreateFolderBatchJobStatus.failed(v) - case "other": - return CreateFolderBatchJobStatus.other - default: - return CreateFolderBatchJobStatus.other - } - default: - fatalError("Failed to deserialize") + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.CreateFolderBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Files.CreateFolderBatchErrorSerializer().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 -> CreateFolderBatchJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return CreateFolderBatchJobStatus.inProgress + case "complete": + let v = try Files.CreateFolderBatchResultSerializer().deserialize(json) + return CreateFolderBatchJobStatus.complete(v) + case "failed": + let v = try Files.CreateFolderBatchErrorSerializer().deserialize(d["failed"] ?? .null) + return CreateFolderBatchJobStatus.failed(v) + case "other": + return CreateFolderBatchJobStatus.other + default: + return CreateFolderBatchJobStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: CreateFolderBatchJobStatus.self, json: json) } } } /// Result returned by createFolderBatch that may either launch an asynchronous job or complete synchronously. - public enum CreateFolderBatchLaunch: CustomStringConvertible { + public enum CreateFolderBatchLaunch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) @@ -652,294 +851,367 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try CreateFolderBatchLaunchSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderBatchLaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderBatchLaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderBatchLaunch: \(error)" + } } } - open class CreateFolderBatchLaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderBatchLaunch) -> JSON { + + public class CreateFolderBatchLaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderBatchLaunch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.CreateFolderBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateFolderBatchLaunch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return CreateFolderBatchLaunch.asyncJobId(v) - case "complete": - let v = Files.CreateFolderBatchResultSerializer().deserialize(json) - return CreateFolderBatchLaunch.complete(v) - case "other": - return CreateFolderBatchLaunch.other - default: - return CreateFolderBatchLaunch.other - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.CreateFolderBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CreateFolderBatchLaunch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return CreateFolderBatchLaunch.asyncJobId(v) + case "complete": + let v = try Files.CreateFolderBatchResultSerializer().deserialize(json) + return CreateFolderBatchLaunch.complete(v) + case "other": + return CreateFolderBatchLaunch.other default: - fatalError("Failed to deserialize") + return CreateFolderBatchLaunch.other + } + default: + throw JSONSerializerError.deserializeError(type: CreateFolderBatchLaunch.self, json: json) } } } /// The FileOpsResult struct - open class FileOpsResult: CustomStringConvertible { - public init() { + public class FileOpsResult: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileOpsResultSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileOpsResultSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileOpsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileOpsResult: \(error)" + } } } - open class FileOpsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileOpsResult) -> JSON { + + public class FileOpsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileOpsResult) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileOpsResult { + + public func deserialize(_ json: JSON) throws -> FileOpsResult { switch json { - case .dictionary(_): - return FileOpsResult() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileOpsResult() + default: + throw JSONSerializerError.deserializeError(type: FileOpsResult.self, json: json) } } } /// The CreateFolderBatchResult struct - open class CreateFolderBatchResult: Files.FileOpsResult { + public class CreateFolderBatchResult: Files.FileOpsResult { /// Each entry in paths in CreateFolderBatchArg will appear at the same position inside entries in /// CreateFolderBatchResult. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.CreateFolderBatchResultEntry] + public init(entries: [Files.CreateFolderBatchResultEntry]) { self.entries = entries super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderBatchResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderBatchResult: \(error)" + } } } - open class CreateFolderBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderBatchResult) -> JSON { - let output = [ - "entries": ArraySerializer(Files.CreateFolderBatchResultEntrySerializer()).serialize(value.entries), + + public class CreateFolderBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderBatchResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.CreateFolderBatchResultEntrySerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFolderBatchResult { + + public func deserialize(_ json: JSON) throws -> CreateFolderBatchResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.CreateFolderBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) - return CreateFolderBatchResult(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.CreateFolderBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) + return CreateFolderBatchResult(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: CreateFolderBatchResult.self, json: json) } } } /// The CreateFolderBatchResultEntry union - public enum CreateFolderBatchResultEntry: CustomStringConvertible { + public enum CreateFolderBatchResultEntry: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case success(Files.CreateFolderEntryResult) /// An unspecified error. case failure(Files.CreateFolderEntryError) + func json() throws -> JSON { + try CreateFolderBatchResultEntrySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderBatchResultEntrySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderBatchResultEntrySerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderBatchResultEntry: \(error)" + } } } - open class CreateFolderBatchResultEntrySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderBatchResultEntry) -> JSON { + + public class CreateFolderBatchResultEntrySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderBatchResultEntry) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Files.CreateFolderEntryResultSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .failure(let arg): - var d = ["failure": Files.CreateFolderEntryErrorSerializer().serialize(arg)] - d[".tag"] = .str("failure") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateFolderBatchResultEntry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Files.CreateFolderEntryResultSerializer().deserialize(json) - return CreateFolderBatchResultEntry.success(v) - case "failure": - let v = Files.CreateFolderEntryErrorSerializer().deserialize(d["failure"] ?? .null) - return CreateFolderBatchResultEntry.failure(v) - default: - fatalError("Unknown tag \(tag)") - } + case .success(let arg): + var d = try Serialization.getFields(Files.CreateFolderEntryResultSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .failure(let arg): + var d = try ["failure": Files.CreateFolderEntryErrorSerializer().serialize(arg)] + d[".tag"] = .str("failure") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CreateFolderBatchResultEntry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Files.CreateFolderEntryResultSerializer().deserialize(json) + return CreateFolderBatchResultEntry.success(v) + case "failure": + let v = try Files.CreateFolderEntryErrorSerializer().deserialize(d["failure"] ?? .null) + return CreateFolderBatchResultEntry.failure(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: CreateFolderBatchResultEntry.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: CreateFolderBatchResultEntry.self, json: json) } } } /// The CreateFolderEntryError union - public enum CreateFolderEntryError: CustomStringConvertible { + public enum CreateFolderEntryError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.WriteError) /// An unspecified error. case other + func json() throws -> JSON { + try CreateFolderEntryErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderEntryErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderEntryErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderEntryError: \(error)" + } } } - open class CreateFolderEntryErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderEntryError) -> JSON { + + public class CreateFolderEntryErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderEntryError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateFolderEntryError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) - return CreateFolderEntryError.path(v) - case "other": - return CreateFolderEntryError.other - default: - return CreateFolderEntryError.other - } + case .path(let arg): + var d = try ["path": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CreateFolderEntryError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) + return CreateFolderEntryError.path(v) + case "other": + return CreateFolderEntryError.other default: - fatalError("Failed to deserialize") + return CreateFolderEntryError.other + } + default: + throw JSONSerializerError.deserializeError(type: CreateFolderEntryError.self, json: json) } } } /// The CreateFolderEntryResult struct - open class CreateFolderEntryResult: CustomStringConvertible { + public class CreateFolderEntryResult: CustomStringConvertible, JSONRepresentable { /// Metadata of the created folder. public let metadata: Files.FolderMetadata public init(metadata: Files.FolderMetadata) { self.metadata = metadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderEntryResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateFolderEntryResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderEntryResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderEntryResult: \(error)" + } } } - open class CreateFolderEntryResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderEntryResult) -> JSON { - let output = [ - "metadata": Files.FolderMetadataSerializer().serialize(value.metadata), + + public class CreateFolderEntryResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderEntryResult) throws -> JSON { + let output = [ + "metadata": try Files.FolderMetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFolderEntryResult { + + public func deserialize(_ json: JSON) throws -> CreateFolderEntryResult { switch json { - case .dictionary(let dict): - let metadata = Files.FolderMetadataSerializer().deserialize(dict["metadata"] ?? .null) - return CreateFolderEntryResult(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.FolderMetadataSerializer().deserialize(dict["metadata"] ?? .null) + return CreateFolderEntryResult(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: CreateFolderEntryResult.self, json: json) } } } /// The CreateFolderError union - public enum CreateFolderError: CustomStringConvertible { + public enum CreateFolderError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.WriteError) + func json() throws -> JSON { + try CreateFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderError: \(error)" + } } } - open class CreateFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderError) -> JSON { + + public class CreateFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) - return CreateFolderError.path(v) - default: - fatalError("Unknown tag \(tag)") - } + case .path(let arg): + var d = try ["path": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CreateFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) + return CreateFolderError.path(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: CreateFolderError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: CreateFolderError.self, json: json) } } } /// The CreateFolderResult struct - open class CreateFolderResult: Files.FileOpsResult { + public class CreateFolderResult: Files.FileOpsResult { /// Metadata of the created folder. public let metadata: Files.FolderMetadata public init(metadata: Files.FolderMetadata) { self.metadata = metadata super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderResult: \(error)" + } } } - open class CreateFolderResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderResult) -> JSON { - let output = [ - "metadata": Files.FolderMetadataSerializer().serialize(value.metadata), + + public class CreateFolderResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderResult) throws -> JSON { + let output = [ + "metadata": try Files.FolderMetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFolderResult { + + public func deserialize(_ json: JSON) throws -> CreateFolderResult { switch json { - case .dictionary(let dict): - let metadata = Files.FolderMetadataSerializer().deserialize(dict["metadata"] ?? .null) - return CreateFolderResult(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.FolderMetadataSerializer().deserialize(dict["metadata"] ?? .null) + return CreateFolderResult(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: CreateFolderResult.self, json: json) } } } /// The DeleteArg struct - open class DeleteArg: CustomStringConvertible { + public class DeleteArg: CustomStringConvertible, JSONRepresentable { /// Path in the user's Dropbox to delete. public let path: String /// Perform delete if given "rev" matches the existing file's latest "rev". This field does not support deleting @@ -951,107 +1223,139 @@ open class Files { nullableValidator(stringValidator(minLength: 9, pattern: "[0-9a-f]+"))(parentRev) self.parentRev = parentRev } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteArg: \(error)" + } } } - open class DeleteArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "parent_rev": NullableSerializer(Serialization._StringSerializer).serialize(value.parentRev), + + public class DeleteArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "parent_rev": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentRev), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteArg { + + public func deserialize(_ json: JSON) throws -> DeleteArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let parentRev = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_rev"] ?? .null) - return DeleteArg(path: path, parentRev: parentRev) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let parentRev = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_rev"] ?? .null) + return DeleteArg(path: path, parentRev: parentRev) + default: + throw JSONSerializerError.deserializeError(type: DeleteArg.self, json: json) } } } /// The DeleteBatchArg struct - open class DeleteBatchArg: CustomStringConvertible { + public class DeleteBatchArg: CustomStringConvertible, JSONRepresentable { /// (no description) - public let entries: Array - public init(entries: Array) { + public let entries: [Files.DeleteArg] + public init(entries: [Files.DeleteArg]) { self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteBatchArg: \(error)" + } } } - open class DeleteBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteBatchArg) -> JSON { - let output = [ - "entries": ArraySerializer(Files.DeleteArgSerializer()).serialize(value.entries), + + public class DeleteBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteBatchArg) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.DeleteArgSerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteBatchArg { + + public func deserialize(_ json: JSON) throws -> DeleteBatchArg { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.DeleteArgSerializer()).deserialize(dict["entries"] ?? .null) - return DeleteBatchArg(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.DeleteArgSerializer()).deserialize(dict["entries"] ?? .null) + return DeleteBatchArg(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: DeleteBatchArg.self, json: json) } } } /// The DeleteBatchError union - public enum DeleteBatchError: CustomStringConvertible { + public enum DeleteBatchError: CustomStringConvertible, JSONRepresentable { /// Use tooManyWriteOperations in DeleteError. deleteBatch now provides smaller granularity about which entry /// has failed because of this. case tooManyWriteOperations /// An unspecified error. case other + func json() throws -> JSON { + try DeleteBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteBatchError: \(error)" + } } } - open class DeleteBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteBatchError) -> JSON { + + public class DeleteBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteBatchError) throws -> JSON { switch value { - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeleteBatchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "too_many_write_operations": - return DeleteBatchError.tooManyWriteOperations - case "other": - return DeleteBatchError.other - default: - return DeleteBatchError.other - } + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeleteBatchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "too_many_write_operations": + return DeleteBatchError.tooManyWriteOperations + case "other": + return DeleteBatchError.other default: - fatalError("Failed to deserialize") + return DeleteBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: DeleteBatchError.self, json: json) } } } /// The DeleteBatchJobStatus union - public enum DeleteBatchJobStatus: CustomStringConvertible { + public enum DeleteBatchJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The batch delete has finished. @@ -1061,58 +1365,68 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try DeleteBatchJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteBatchJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteBatchJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteBatchJobStatus: \(error)" + } } } - open class DeleteBatchJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteBatchJobStatus) -> JSON { + + public class DeleteBatchJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteBatchJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.DeleteBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Files.DeleteBatchErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeleteBatchJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return DeleteBatchJobStatus.inProgress - case "complete": - let v = Files.DeleteBatchResultSerializer().deserialize(json) - return DeleteBatchJobStatus.complete(v) - case "failed": - let v = Files.DeleteBatchErrorSerializer().deserialize(d["failed"] ?? .null) - return DeleteBatchJobStatus.failed(v) - case "other": - return DeleteBatchJobStatus.other - default: - return DeleteBatchJobStatus.other - } - default: - fatalError("Failed to deserialize") + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.DeleteBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Files.DeleteBatchErrorSerializer().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 -> DeleteBatchJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return DeleteBatchJobStatus.inProgress + case "complete": + let v = try Files.DeleteBatchResultSerializer().deserialize(json) + return DeleteBatchJobStatus.complete(v) + case "failed": + let v = try Files.DeleteBatchErrorSerializer().deserialize(d["failed"] ?? .null) + return DeleteBatchJobStatus.failed(v) + case "other": + return DeleteBatchJobStatus.other + default: + return DeleteBatchJobStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: DeleteBatchJobStatus.self, json: json) } } } /// Result returned by deleteBatch that may either launch an asynchronous job or complete synchronously. - public enum DeleteBatchLaunch: CustomStringConvertible { + public enum DeleteBatchLaunch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) @@ -1121,159 +1435,197 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try DeleteBatchLaunchSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteBatchLaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteBatchLaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteBatchLaunch: \(error)" + } } } - open class DeleteBatchLaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteBatchLaunch) -> JSON { + + public class DeleteBatchLaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteBatchLaunch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.DeleteBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeleteBatchLaunch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return DeleteBatchLaunch.asyncJobId(v) - case "complete": - let v = Files.DeleteBatchResultSerializer().deserialize(json) - return DeleteBatchLaunch.complete(v) - case "other": - return DeleteBatchLaunch.other - default: - return DeleteBatchLaunch.other - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.DeleteBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeleteBatchLaunch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return DeleteBatchLaunch.asyncJobId(v) + case "complete": + let v = try Files.DeleteBatchResultSerializer().deserialize(json) + return DeleteBatchLaunch.complete(v) + case "other": + return DeleteBatchLaunch.other default: - fatalError("Failed to deserialize") + return DeleteBatchLaunch.other + } + default: + throw JSONSerializerError.deserializeError(type: DeleteBatchLaunch.self, json: json) } } } /// The DeleteBatchResult struct - open class DeleteBatchResult: Files.FileOpsResult { + public class DeleteBatchResult: Files.FileOpsResult { /// Each entry in entries in DeleteBatchArg will appear at the same position inside entries in /// DeleteBatchResult. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.DeleteBatchResultEntry] + public init(entries: [Files.DeleteBatchResultEntry]) { self.entries = entries super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteBatchResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteBatchResult: \(error)" + } } } - open class DeleteBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteBatchResult) -> JSON { - let output = [ - "entries": ArraySerializer(Files.DeleteBatchResultEntrySerializer()).serialize(value.entries), + + public class DeleteBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteBatchResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.DeleteBatchResultEntrySerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteBatchResult { + + public func deserialize(_ json: JSON) throws -> DeleteBatchResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.DeleteBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) - return DeleteBatchResult(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.DeleteBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) + return DeleteBatchResult(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: DeleteBatchResult.self, json: json) } } } /// The DeleteBatchResultData struct - open class DeleteBatchResultData: CustomStringConvertible { + public class DeleteBatchResultData: CustomStringConvertible, JSONRepresentable { /// Metadata of the deleted object. public let metadata: Files.Metadata public init(metadata: Files.Metadata) { self.metadata = metadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteBatchResultDataSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteBatchResultDataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteBatchResultDataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteBatchResultData: \(error)" + } } } - open class DeleteBatchResultDataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteBatchResultData) -> JSON { - let output = [ - "metadata": Files.MetadataSerializer().serialize(value.metadata), + + public class DeleteBatchResultDataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteBatchResultData) throws -> JSON { + let output = [ + "metadata": try Files.MetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteBatchResultData { + + public func deserialize(_ json: JSON) throws -> DeleteBatchResultData { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - return DeleteBatchResultData(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + return DeleteBatchResultData(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: DeleteBatchResultData.self, json: json) } } } /// The DeleteBatchResultEntry union - public enum DeleteBatchResultEntry: CustomStringConvertible { + public enum DeleteBatchResultEntry: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case success(Files.DeleteBatchResultData) /// An unspecified error. case failure(Files.DeleteError) + func json() throws -> JSON { + try DeleteBatchResultEntrySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteBatchResultEntrySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteBatchResultEntrySerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteBatchResultEntry: \(error)" + } } } - open class DeleteBatchResultEntrySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteBatchResultEntry) -> JSON { + + public class DeleteBatchResultEntrySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteBatchResultEntry) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Files.DeleteBatchResultDataSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .failure(let arg): - var d = ["failure": Files.DeleteErrorSerializer().serialize(arg)] - d[".tag"] = .str("failure") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeleteBatchResultEntry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Files.DeleteBatchResultDataSerializer().deserialize(json) - return DeleteBatchResultEntry.success(v) - case "failure": - let v = Files.DeleteErrorSerializer().deserialize(d["failure"] ?? .null) - return DeleteBatchResultEntry.failure(v) - default: - fatalError("Unknown tag \(tag)") - } + case .success(let arg): + var d = try Serialization.getFields(Files.DeleteBatchResultDataSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .failure(let arg): + var d = try ["failure": Files.DeleteErrorSerializer().serialize(arg)] + d[".tag"] = .str("failure") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeleteBatchResultEntry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Files.DeleteBatchResultDataSerializer().deserialize(json) + return DeleteBatchResultEntry.success(v) + case "failure": + let v = try Files.DeleteErrorSerializer().deserialize(d["failure"] ?? .null) + return DeleteBatchResultEntry.failure(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: DeleteBatchResultEntry.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: DeleteBatchResultEntry.self, json: json) } } } /// The DeleteError union - public enum DeleteError: CustomStringConvertible { + public enum DeleteError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case pathLookup(Files.LookupError) /// An unspecified error. @@ -1285,104 +1637,122 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try DeleteErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteError: \(error)" + } } } - open class DeleteErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteError) -> JSON { + + public class DeleteErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteError) throws -> JSON { switch value { - case .pathLookup(let arg): - var d = ["path_lookup": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path_lookup") - return .dictionary(d) - case .pathWrite(let arg): - var d = ["path_write": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("path_write") - return .dictionary(d) - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeleteError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path_lookup": - let v = Files.LookupErrorSerializer().deserialize(d["path_lookup"] ?? .null) - return DeleteError.pathLookup(v) - case "path_write": - let v = Files.WriteErrorSerializer().deserialize(d["path_write"] ?? .null) - return DeleteError.pathWrite(v) - case "too_many_write_operations": - return DeleteError.tooManyWriteOperations - case "too_many_files": - return DeleteError.tooManyFiles - case "other": - return DeleteError.other - default: - return DeleteError.other - } - default: - fatalError("Failed to deserialize") + case .pathLookup(let arg): + var d = try ["path_lookup": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path_lookup") + return .dictionary(d) + case .pathWrite(let arg): + var d = try ["path_write": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("path_write") + return .dictionary(d) + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeleteError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path_lookup": + let v = try Files.LookupErrorSerializer().deserialize(d["path_lookup"] ?? .null) + return DeleteError.pathLookup(v) + case "path_write": + let v = try Files.WriteErrorSerializer().deserialize(d["path_write"] ?? .null) + return DeleteError.pathWrite(v) + case "too_many_write_operations": + return DeleteError.tooManyWriteOperations + case "too_many_files": + return DeleteError.tooManyFiles + case "other": + return DeleteError.other + default: + return DeleteError.other + } + default: + throw JSONSerializerError.deserializeError(type: DeleteError.self, json: json) } } } /// The DeleteResult struct - open class DeleteResult: Files.FileOpsResult { + public class DeleteResult: Files.FileOpsResult { /// Metadata of the deleted object. public let metadata: Files.Metadata public init(metadata: Files.Metadata) { self.metadata = metadata super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteResult: \(error)" + } } } - open class DeleteResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteResult) -> JSON { - let output = [ - "metadata": Files.MetadataSerializer().serialize(value.metadata), + + public class DeleteResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteResult) throws -> JSON { + let output = [ + "metadata": try Files.MetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteResult { + + public func deserialize(_ json: JSON) throws -> DeleteResult { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - return DeleteResult(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + return DeleteResult(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: DeleteResult.self, json: json) } } } /// Metadata for a file or folder. - open class Metadata: CustomStringConvertible { + public class Metadata: CustomStringConvertible, JSONRepresentable { /// The last component of the path (including extension). This never contains a slash. public let name: String /// The lowercased full path in the user's Dropbox. This always starts with a slash. This field will be null if /// the file or folder is not mounted. public let pathLower: String? /// The cased path to be used for display purposes only. In rare instances the casing will not correctly match - /// the user's filesystem, but this behavior will match the path provided in the Core API v1, and at least the - /// last path component will have the correct casing. Changes to only the casing of paths won't be returned by - /// listFolderContinue. This field will be null if the file or folder is not mounted. + /// the user's filesystem, but this behavior will match the path provided in the Core API v1, and at + /// least the last path component will have the correct casing. Changes to only the casing of paths + /// won't be returned by listFolderContinue. This field will be null if the file or folder is not + /// mounted. public let pathDisplay: String? /// Please use parentSharedFolderId in FileSharingInfo or parentSharedFolderId in FolderSharingInfo instead. public let parentSharedFolderId: String? @@ -1400,95 +1770,119 @@ open class Files { nullableValidator(stringValidator())(previewUrl) self.previewUrl = previewUrl } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try MetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Metadata: \(error)" + } } } - open class MetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Metadata) -> JSON { - var output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "path_display": NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "preview_url": NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), + + public class MetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Metadata) throws -> JSON { + var output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "path_display": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "preview_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), ] switch value { - case let file as Files.FileMetadata: - for (k, v) in Serialization.getFields(Files.FileMetadataSerializer().serialize(file)) { - output[k] = v - } - output[".tag"] = .str("file") - case let folder as Files.FolderMetadata: - for (k, v) in Serialization.getFields(Files.FolderMetadataSerializer().serialize(folder)) { - output[k] = v - } - output[".tag"] = .str("folder") - case let deleted as Files.DeletedMetadata: - for (k, v) in Serialization.getFields(Files.DeletedMetadataSerializer().serialize(deleted)) { - output[k] = v - } - output[".tag"] = .str("deleted") - default: fatalError("Tried to serialize unexpected subtype") + case let file as Files.FileMetadata: + for (k, v) in try Serialization.getFields(Files.FileMetadataSerializer().serialize(file)) { + output[k] = v + } + output[".tag"] = .str("file") + case let folder as Files.FolderMetadata: + for (k, v) in try Serialization.getFields(Files.FolderMetadataSerializer().serialize(folder)) { + output[k] = v + } + output[".tag"] = .str("folder") + case let deleted as Files.DeletedMetadata: + for (k, v) in try Serialization.getFields(Files.DeletedMetadataSerializer().serialize(deleted)) { + output[k] = v + } + output[".tag"] = .str("deleted") + default: + throw JSONSerializerError.unexpectedSubtype(type: Metadata.self, subtype: value) } return .dictionary(output) } - open func deserialize(_ json: JSON) -> Metadata { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "file": - return Files.FileMetadataSerializer().deserialize(json) - case "folder": - return Files.FolderMetadataSerializer().deserialize(json) - case "deleted": - return Files.DeletedMetadataSerializer().deserialize(json) - default: - fatalError("Unknown tag \(tag)") - } + + public func deserialize(_ json: JSON) throws -> Metadata { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "file": + return try Files.FileMetadataSerializer().deserialize(json) + case "folder": + return try Files.FolderMetadataSerializer().deserialize(json) + case "deleted": + return try Files.DeletedMetadataSerializer().deserialize(json) default: - fatalError("Type error deserializing") + throw JSONSerializerError.unknownTag(type: Metadata.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: Metadata.self, json: json) } } } /// Indicates that there used to be a file or folder at this path, but it no longer exists. - open class DeletedMetadata: Files.Metadata { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeletedMetadataSerializer().serialize(self)))" - } - } - open class DeletedMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeletedMetadata) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "path_display": NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "preview_url": NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), + public class DeletedMetadata: Files.Metadata { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeletedMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeletedMetadata: \(error)" + } + } + } + + public class DeletedMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeletedMetadata) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "path_display": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "preview_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeletedMetadata { + + public func deserialize(_ json: JSON) throws -> DeletedMetadata { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let pathDisplay = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) - let parentSharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) - let previewUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["preview_url"] ?? .null) - return DeletedMetadata(name: name, pathLower: pathLower, pathDisplay: pathDisplay, parentSharedFolderId: parentSharedFolderId, previewUrl: previewUrl) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let pathDisplay = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) + let parentSharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) + let previewUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["preview_url"] ?? .null) + return DeletedMetadata( + name: name, + pathLower: pathLower, + pathDisplay: pathDisplay, + parentSharedFolderId: parentSharedFolderId, + previewUrl: previewUrl + ) + default: + throw JSONSerializerError.deserializeError(type: DeletedMetadata.self, json: json) } } } /// Dimensions for a photo or video. - open class Dimensions: CustomStringConvertible { + public class Dimensions: CustomStringConvertible, JSONRepresentable { /// Height of the photo/video. public let height: UInt64 /// Width of the photo/video. @@ -1499,33 +1893,44 @@ open class Files { comparableValidator()(width) self.width = width } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DimensionsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DimensionsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DimensionsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Dimensions: \(error)" + } } } - open class DimensionsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Dimensions) -> JSON { - let output = [ - "height": Serialization._UInt64Serializer.serialize(value.height), - "width": Serialization._UInt64Serializer.serialize(value.width), + + public class DimensionsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Dimensions) throws -> JSON { + let output = [ + "height": try Serialization._UInt64Serializer.serialize(value.height), + "width": try Serialization._UInt64Serializer.serialize(value.width), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> Dimensions { + + public func deserialize(_ json: JSON) throws -> Dimensions { switch json { - case .dictionary(let dict): - let height = Serialization._UInt64Serializer.deserialize(dict["height"] ?? .null) - let width = Serialization._UInt64Serializer.deserialize(dict["width"] ?? .null) - return Dimensions(height: height, width: width) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let height = try Serialization._UInt64Serializer.deserialize(dict["height"] ?? .null) + let width = try Serialization._UInt64Serializer.deserialize(dict["width"] ?? .null) + return Dimensions(height: height, width: width) + default: + throw JSONSerializerError.deserializeError(type: Dimensions.self, json: json) } } } /// The DownloadArg struct - open class DownloadArg: CustomStringConvertible { + public class DownloadArg: CustomStringConvertible, JSONRepresentable { /// The path of the file to download. public let path: String /// Please specify revision in path instead. @@ -1536,33 +1941,44 @@ open class Files { nullableValidator(stringValidator(minLength: 9, pattern: "[0-9a-f]+"))(rev) self.rev = rev } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DownloadArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try DownloadArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DownloadArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DownloadArg: \(error)" + } } } - open class DownloadArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DownloadArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "rev": NullableSerializer(Serialization._StringSerializer).serialize(value.rev), + + public class DownloadArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DownloadArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "rev": try NullableSerializer(Serialization._StringSerializer).serialize(value.rev), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DownloadArg { + + public func deserialize(_ json: JSON) throws -> DownloadArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let rev = NullableSerializer(Serialization._StringSerializer).deserialize(dict["rev"] ?? .null) - return DownloadArg(path: path, rev: rev) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let rev = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["rev"] ?? .null) + return DownloadArg(path: path, rev: rev) + default: + throw JSONSerializerError.deserializeError(type: DownloadArg.self, json: json) } } } /// The DownloadError union - public enum DownloadError: CustomStringConvertible { + public enum DownloadError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// This file type cannot be downloaded directly; use export instead. @@ -1570,82 +1986,103 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try DownloadErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DownloadErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DownloadErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DownloadError: \(error)" + } } } - open class DownloadErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DownloadError) -> JSON { + + public class DownloadErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DownloadError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedFile: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_file") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DownloadError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return DownloadError.path(v) - case "unsupported_file": - return DownloadError.unsupportedFile - case "other": - return DownloadError.other - default: - return DownloadError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedFile: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_file") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DownloadError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return DownloadError.path(v) + case "unsupported_file": + return DownloadError.unsupportedFile + case "other": + return DownloadError.other default: - fatalError("Failed to deserialize") + return DownloadError.other + } + default: + throw JSONSerializerError.deserializeError(type: DownloadError.self, json: json) } } } /// The DownloadZipArg struct - open class DownloadZipArg: CustomStringConvertible { + public class DownloadZipArg: CustomStringConvertible, JSONRepresentable { /// The path of the folder to download. public let path: String public init(path: String) { stringValidator(pattern: "(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)")(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DownloadZipArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try DownloadZipArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DownloadZipArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DownloadZipArg: \(error)" + } } } - open class DownloadZipArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DownloadZipArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), + + public class DownloadZipArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DownloadZipArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DownloadZipArg { + + public func deserialize(_ json: JSON) throws -> DownloadZipArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - return DownloadZipArg(path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + return DownloadZipArg(path: path) + default: + throw JSONSerializerError.deserializeError(type: DownloadZipArg.self, json: json) } } } /// The DownloadZipError union - public enum DownloadZipError: CustomStringConvertible { + public enum DownloadZipError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// The folder or a file is too large to download. @@ -1655,92 +2092,113 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try DownloadZipErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DownloadZipErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DownloadZipErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DownloadZipError: \(error)" + } } } - open class DownloadZipErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DownloadZipError) -> JSON { + + public class DownloadZipErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DownloadZipError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .tooLarge: - var d = [String: JSON]() - d[".tag"] = .str("too_large") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DownloadZipError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return DownloadZipError.path(v) - case "too_large": - return DownloadZipError.tooLarge - case "too_many_files": - return DownloadZipError.tooManyFiles - case "other": - return DownloadZipError.other - default: - return DownloadZipError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .tooLarge: + var d = [String: JSON]() + d[".tag"] = .str("too_large") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DownloadZipError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return DownloadZipError.path(v) + case "too_large": + return DownloadZipError.tooLarge + case "too_many_files": + return DownloadZipError.tooManyFiles + case "other": + return DownloadZipError.other + default: + return DownloadZipError.other + } + default: + throw JSONSerializerError.deserializeError(type: DownloadZipError.self, json: json) } } } /// The DownloadZipResult struct - open class DownloadZipResult: CustomStringConvertible { + public class DownloadZipResult: CustomStringConvertible, JSONRepresentable { /// (no description) public let metadata: Files.FolderMetadata public init(metadata: Files.FolderMetadata) { self.metadata = metadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DownloadZipResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try DownloadZipResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DownloadZipResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DownloadZipResult: \(error)" + } } } - open class DownloadZipResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DownloadZipResult) -> JSON { - let output = [ - "metadata": Files.FolderMetadataSerializer().serialize(value.metadata), + + public class DownloadZipResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DownloadZipResult) throws -> JSON { + let output = [ + "metadata": try Files.FolderMetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DownloadZipResult { + + public func deserialize(_ json: JSON) throws -> DownloadZipResult { switch json { - case .dictionary(let dict): - let metadata = Files.FolderMetadataSerializer().deserialize(dict["metadata"] ?? .null) - return DownloadZipResult(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.FolderMetadataSerializer().deserialize(dict["metadata"] ?? .null) + return DownloadZipResult(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: DownloadZipResult.self, json: json) } } } /// The ExportArg struct - open class ExportArg: CustomStringConvertible { + public class ExportArg: CustomStringConvertible, JSONRepresentable { /// The path of the file to be exported. public let path: String /// The file format to which the file should be exported. This must be one of the formats listed in the file's - /// export_options returned by getMetadata. If none is specified, the default format (specified in export_as in - /// file metadata) will be used. + /// export_options returned by getMetadata. If none is specified, the default format (specified in + /// export_as in file metadata) will be used. public let exportFormat: String? public init(path: String, exportFormat: String? = nil) { stringValidator(pattern: "(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)")(path) @@ -1748,33 +2206,44 @@ open class Files { nullableValidator(stringValidator())(exportFormat) self.exportFormat = exportFormat } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExportArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportArg: \(error)" + } } } - open class ExportArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "export_format": NullableSerializer(Serialization._StringSerializer).serialize(value.exportFormat), + + public class ExportArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "export_format": try NullableSerializer(Serialization._StringSerializer).serialize(value.exportFormat), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportArg { + + public func deserialize(_ json: JSON) throws -> ExportArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let exportFormat = NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_format"] ?? .null) - return ExportArg(path: path, exportFormat: exportFormat) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let exportFormat = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_format"] ?? .null) + return ExportArg(path: path, exportFormat: exportFormat) + default: + throw JSONSerializerError.deserializeError(type: ExportArg.self, json: json) } } } /// The ExportError union - public enum ExportError: CustomStringConvertible { + public enum ExportError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// This file type cannot be exported. Use download instead. @@ -1786,101 +2255,122 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try ExportErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportError: \(error)" + } } } - open class ExportErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportError) -> JSON { + + public class ExportErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .nonExportable: - var d = [String: JSON]() - d[".tag"] = .str("non_exportable") - return .dictionary(d) - case .invalidExportFormat: - var d = [String: JSON]() - d[".tag"] = .str("invalid_export_format") - return .dictionary(d) - case .retryError: - var d = [String: JSON]() - d[".tag"] = .str("retry_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExportError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return ExportError.path(v) - case "non_exportable": - return ExportError.nonExportable - case "invalid_export_format": - return ExportError.invalidExportFormat - case "retry_error": - return ExportError.retryError - case "other": - return ExportError.other - default: - return ExportError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .nonExportable: + var d = [String: JSON]() + d[".tag"] = .str("non_exportable") + return .dictionary(d) + case .invalidExportFormat: + var d = [String: JSON]() + d[".tag"] = .str("invalid_export_format") + return .dictionary(d) + case .retryError: + var d = [String: JSON]() + d[".tag"] = .str("retry_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExportError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return ExportError.path(v) + case "non_exportable": + return ExportError.nonExportable + case "invalid_export_format": + return ExportError.invalidExportFormat + case "retry_error": + return ExportError.retryError + case "other": + return ExportError.other + default: + return ExportError.other + } + default: + throw JSONSerializerError.deserializeError(type: ExportError.self, json: json) } } } /// Export information for a file. - open class ExportInfo: CustomStringConvertible { + public class ExportInfo: CustomStringConvertible, JSONRepresentable { /// Format to which the file can be exported to. public let exportAs: String? /// Additional formats to which the file can be exported. These values can be specified as the export_format in /// /files/export. - public let exportOptions: Array? - public init(exportAs: String? = nil, exportOptions: Array? = nil) { + public let exportOptions: [String]? + public init(exportAs: String? = nil, exportOptions: [String]? = nil) { nullableValidator(stringValidator())(exportAs) self.exportAs = exportAs nullableValidator(arrayValidator(itemValidator: stringValidator()))(exportOptions) self.exportOptions = exportOptions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExportInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportInfo: \(error)" + } } } - open class ExportInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportInfo) -> JSON { - let output = [ - "export_as": NullableSerializer(Serialization._StringSerializer).serialize(value.exportAs), - "export_options": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.exportOptions), + + public class ExportInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportInfo) throws -> JSON { + let output = [ + "export_as": try NullableSerializer(Serialization._StringSerializer).serialize(value.exportAs), + "export_options": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.exportOptions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportInfo { + + public func deserialize(_ json: JSON) throws -> ExportInfo { switch json { - case .dictionary(let dict): - let exportAs = NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_as"] ?? .null) - let exportOptions = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["export_options"] ?? .null) - return ExportInfo(exportAs: exportAs, exportOptions: exportOptions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let exportAs = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_as"] ?? .null) + let exportOptions = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["export_options"] ?? .null) + return ExportInfo(exportAs: exportAs, exportOptions: exportOptions) + default: + throw JSONSerializerError.deserializeError(type: ExportInfo.self, json: json) } } } /// The ExportMetadata struct - open class ExportMetadata: CustomStringConvertible { + public class ExportMetadata: CustomStringConvertible, JSONRepresentable { /// The last component of the path (including extension). This never contains a slash. public let name: String /// The file size in bytes. @@ -1901,37 +2391,48 @@ open class Files { nullableValidator(comparableValidator())(paperRevision) self.paperRevision = paperRevision } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportMetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExportMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportMetadata: \(error)" + } } } - open class ExportMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportMetadata) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "size": Serialization._UInt64Serializer.serialize(value.size), - "export_hash": NullableSerializer(Serialization._StringSerializer).serialize(value.exportHash), - "paper_revision": NullableSerializer(Serialization._Int64Serializer).serialize(value.paperRevision), + + public class ExportMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportMetadata) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "size": try Serialization._UInt64Serializer.serialize(value.size), + "export_hash": try NullableSerializer(Serialization._StringSerializer).serialize(value.exportHash), + "paper_revision": try NullableSerializer(Serialization._Int64Serializer).serialize(value.paperRevision), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportMetadata { + + public func deserialize(_ json: JSON) throws -> ExportMetadata { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let size = Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) - let exportHash = NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_hash"] ?? .null) - let paperRevision = NullableSerializer(Serialization._Int64Serializer).deserialize(dict["paper_revision"] ?? .null) - return ExportMetadata(name: name, size: size, exportHash: exportHash, paperRevision: paperRevision) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let size = try Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) + let exportHash = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_hash"] ?? .null) + let paperRevision = try NullableSerializer(Serialization._Int64Serializer).deserialize(dict["paper_revision"] ?? .null) + return ExportMetadata(name: name, size: size, exportHash: exportHash, paperRevision: paperRevision) + default: + throw JSONSerializerError.deserializeError(type: ExportMetadata.self, json: json) } } } /// The ExportResult struct - open class ExportResult: CustomStringConvertible { + public class ExportResult: CustomStringConvertible, JSONRepresentable { /// Metadata for the exported version of the file. public let exportMetadata: Files.ExportMetadata /// Metadata for the original file. @@ -1940,33 +2441,44 @@ open class Files { self.exportMetadata = exportMetadata self.fileMetadata = fileMetadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExportResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportResult: \(error)" + } } } - open class ExportResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportResult) -> JSON { - let output = [ - "export_metadata": Files.ExportMetadataSerializer().serialize(value.exportMetadata), - "file_metadata": Files.FileMetadataSerializer().serialize(value.fileMetadata), + + public class ExportResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportResult) throws -> JSON { + let output = [ + "export_metadata": try Files.ExportMetadataSerializer().serialize(value.exportMetadata), + "file_metadata": try Files.FileMetadataSerializer().serialize(value.fileMetadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportResult { + + public func deserialize(_ json: JSON) throws -> ExportResult { switch json { - case .dictionary(let dict): - let exportMetadata = Files.ExportMetadataSerializer().deserialize(dict["export_metadata"] ?? .null) - let fileMetadata = Files.FileMetadataSerializer().deserialize(dict["file_metadata"] ?? .null) - return ExportResult(exportMetadata: exportMetadata, fileMetadata: fileMetadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let exportMetadata = try Files.ExportMetadataSerializer().deserialize(dict["export_metadata"] ?? .null) + let fileMetadata = try Files.FileMetadataSerializer().deserialize(dict["file_metadata"] ?? .null) + return ExportResult(exportMetadata: exportMetadata, fileMetadata: fileMetadata) + default: + throw JSONSerializerError.deserializeError(type: ExportResult.self, json: json) } } } /// The FileCategory union - public enum FileCategory: CustomStringConvertible { + public enum FileCategory: CustomStringConvertible, JSONRepresentable { /// jpg, png, gif, and more. case image /// doc, docx, txt, and more. @@ -1990,128 +2502,149 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try FileCategorySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileCategorySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileCategorySerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileCategory: \(error)" + } } } - open class FileCategorySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileCategory) -> JSON { + + public class FileCategorySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileCategory) throws -> JSON { switch value { - case .image: - var d = [String: JSON]() - d[".tag"] = .str("image") - return .dictionary(d) - case .document: - var d = [String: JSON]() - d[".tag"] = .str("document") - return .dictionary(d) - case .pdf: - var d = [String: JSON]() - d[".tag"] = .str("pdf") - return .dictionary(d) - case .spreadsheet: - var d = [String: JSON]() - d[".tag"] = .str("spreadsheet") - return .dictionary(d) - case .presentation: - var d = [String: JSON]() - d[".tag"] = .str("presentation") - return .dictionary(d) - case .audio: - var d = [String: JSON]() - d[".tag"] = .str("audio") - return .dictionary(d) - case .video: - var d = [String: JSON]() - d[".tag"] = .str("video") - return .dictionary(d) - case .folder: - var d = [String: JSON]() - d[".tag"] = .str("folder") - return .dictionary(d) - case .paper: - var d = [String: JSON]() - d[".tag"] = .str("paper") - return .dictionary(d) - case .others: - var d = [String: JSON]() - d[".tag"] = .str("others") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileCategory { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "image": - return FileCategory.image - case "document": - return FileCategory.document - case "pdf": - return FileCategory.pdf - case "spreadsheet": - return FileCategory.spreadsheet - case "presentation": - return FileCategory.presentation - case "audio": - return FileCategory.audio - case "video": - return FileCategory.video - case "folder": - return FileCategory.folder - case "paper": - return FileCategory.paper - case "others": - return FileCategory.others - case "other": - return FileCategory.other - default: - return FileCategory.other - } - default: - fatalError("Failed to deserialize") + case .image: + var d = [String: JSON]() + d[".tag"] = .str("image") + return .dictionary(d) + case .document: + var d = [String: JSON]() + d[".tag"] = .str("document") + return .dictionary(d) + case .pdf: + var d = [String: JSON]() + d[".tag"] = .str("pdf") + return .dictionary(d) + case .spreadsheet: + var d = [String: JSON]() + d[".tag"] = .str("spreadsheet") + return .dictionary(d) + case .presentation: + var d = [String: JSON]() + d[".tag"] = .str("presentation") + return .dictionary(d) + case .audio: + var d = [String: JSON]() + d[".tag"] = .str("audio") + return .dictionary(d) + case .video: + var d = [String: JSON]() + d[".tag"] = .str("video") + return .dictionary(d) + case .folder: + var d = [String: JSON]() + d[".tag"] = .str("folder") + return .dictionary(d) + case .paper: + var d = [String: JSON]() + d[".tag"] = .str("paper") + return .dictionary(d) + case .others: + var d = [String: JSON]() + d[".tag"] = .str("others") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileCategory { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "image": + return FileCategory.image + case "document": + return FileCategory.document + case "pdf": + return FileCategory.pdf + case "spreadsheet": + return FileCategory.spreadsheet + case "presentation": + return FileCategory.presentation + case "audio": + return FileCategory.audio + case "video": + return FileCategory.video + case "folder": + return FileCategory.folder + case "paper": + return FileCategory.paper + case "others": + return FileCategory.others + case "other": + return FileCategory.other + default: + return FileCategory.other + } + default: + throw JSONSerializerError.deserializeError(type: FileCategory.self, json: json) } } } /// The FileLock struct - open class FileLock: CustomStringConvertible { + public class FileLock: CustomStringConvertible, JSONRepresentable { /// The lock description. public let content: Files.FileLockContent public init(content: Files.FileLockContent) { self.content = content } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLockSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLock: \(error)" + } } } - open class FileLockSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLock) -> JSON { - let output = [ - "content": Files.FileLockContentSerializer().serialize(value.content), + + public class FileLockSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLock) throws -> JSON { + let output = [ + "content": try Files.FileLockContentSerializer().serialize(value.content), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLock { + + public func deserialize(_ json: JSON) throws -> FileLock { switch json { - case .dictionary(let dict): - let content = Files.FileLockContentSerializer().deserialize(dict["content"] ?? .null) - return FileLock(content: content) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let content = try Files.FileLockContentSerializer().deserialize(dict["content"] ?? .null) + return FileLock(content: content) + default: + throw JSONSerializerError.deserializeError(type: FileLock.self, json: json) } } } /// The FileLockContent union - public enum FileLockContent: CustomStringConvertible { + public enum FileLockContent: CustomStringConvertible, JSONRepresentable { /// Empty type to indicate no lock. case unlocked /// A lock held by a single user. @@ -2119,51 +2652,61 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try FileLockContentSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockContentSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockContentSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockContent: \(error)" + } } } - open class FileLockContentSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockContent) -> JSON { + + public class FileLockContentSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockContent) throws -> JSON { switch value { - case .unlocked: - var d = [String: JSON]() - d[".tag"] = .str("unlocked") - return .dictionary(d) - case .singleUser(let arg): - var d = Serialization.getFields(Files.SingleUserLockSerializer().serialize(arg)) - d[".tag"] = .str("single_user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileLockContent { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unlocked": - return FileLockContent.unlocked - case "single_user": - let v = Files.SingleUserLockSerializer().deserialize(json) - return FileLockContent.singleUser(v) - case "other": - return FileLockContent.other - default: - return FileLockContent.other - } + case .unlocked: + var d = [String: JSON]() + d[".tag"] = .str("unlocked") + return .dictionary(d) + case .singleUser(let arg): + var d = try Serialization.getFields(Files.SingleUserLockSerializer().serialize(arg)) + d[".tag"] = .str("single_user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileLockContent { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unlocked": + return FileLockContent.unlocked + case "single_user": + let v = try Files.SingleUserLockSerializer().deserialize(json) + return FileLockContent.singleUser(v) + case "other": + return FileLockContent.other default: - fatalError("Failed to deserialize") + return FileLockContent.other + } + default: + throw JSONSerializerError.deserializeError(type: FileLockContent.self, json: json) } } } /// The FileLockMetadata struct - open class FileLockMetadata: CustomStringConvertible { + public class FileLockMetadata: CustomStringConvertible, JSONRepresentable { /// True if caller holds the file lock. public let isLockholder: Bool? /// The display name of the lock holder. @@ -2180,43 +2723,59 @@ open class Files { self.lockholderAccountId = lockholderAccountId self.created = created } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockMetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLockMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockMetadata: \(error)" + } } } - open class FileLockMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockMetadata) -> JSON { - let output = [ - "is_lockholder": NullableSerializer(Serialization._BoolSerializer).serialize(value.isLockholder), - "lockholder_name": NullableSerializer(Serialization._StringSerializer).serialize(value.lockholderName), - "lockholder_account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.lockholderAccountId), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + + public class FileLockMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockMetadata) throws -> JSON { + let output = [ + "is_lockholder": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isLockholder), + "lockholder_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.lockholderName), + "lockholder_account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.lockholderAccountId), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLockMetadata { + + public func deserialize(_ json: JSON) throws -> FileLockMetadata { switch json { - case .dictionary(let dict): - let isLockholder = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_lockholder"] ?? .null) - let lockholderName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["lockholder_name"] ?? .null) - let lockholderAccountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["lockholder_account_id"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - return FileLockMetadata(isLockholder: isLockholder, lockholderName: lockholderName, lockholderAccountId: lockholderAccountId, created: created) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isLockholder = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_lockholder"] ?? .null) + let lockholderName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["lockholder_name"] ?? .null) + let lockholderAccountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["lockholder_account_id"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + return FileLockMetadata( + isLockholder: isLockholder, + lockholderName: lockholderName, + lockholderAccountId: lockholderAccountId, + created: created + ) + default: + throw JSONSerializerError.deserializeError(type: FileLockMetadata.self, json: json) } } } /// The FileMetadata struct - open class FileMetadata: Files.Metadata { + public class FileMetadata: Files.Metadata { /// A unique identifier for the file. public let id: String /// For files, this is the modification time set by the desktop client when the file was added to Dropbox. Since - /// this time is not verified (the Dropbox server stores whatever the desktop client sends up), this should only - /// be used for display purposes (such as sorting) and not, for example, to determine if a file has changed or - /// not. + /// this time is not verified (the Dropbox server stores whatever the desktop client sends up), this + /// should only be used for display purposes (such as sorting) and not, for example, to determine if a + /// file has changed or not. public let clientModified: Date /// The last time the file was modified on Dropbox. public let serverModified: Date @@ -2238,18 +2797,38 @@ open class Files { /// false. public let exportInfo: Files.ExportInfo? /// Additional information if the file has custom properties with the property template specified. - public let propertyGroups: Array? + public let propertyGroups: [FileProperties.PropertyGroup]? /// This flag will only be present if include_has_explicit_shared_members is true in listFolder or getMetadata. - /// If this flag is present, it will be true if this file has any explicit shared members. This is different - /// from sharing_info in that this could be true in the case where a file has explicit members but is not - /// contained within a shared folder. + /// If this flag is present, it will be true if this file has any explicit shared members. This is + /// different from sharing_info in that this could be true in the case where a file has explicit + /// members but is not contained within a shared folder. public let hasExplicitSharedMembers: Bool? /// A hash of the file content. This field can be used to verify data integrity. For more information see our /// Content hash https://www.dropbox.com/developers/reference/content-hash page. public let contentHash: String? /// If present, the metadata associated with the file's current lock. public let fileLockInfo: Files.FileLockMetadata? - public init(name: String, id: String, clientModified: Date, serverModified: Date, rev: String, size: UInt64, pathLower: String? = nil, pathDisplay: String? = nil, parentSharedFolderId: String? = nil, previewUrl: String? = nil, mediaInfo: Files.MediaInfo? = nil, symlinkInfo: Files.SymlinkInfo? = nil, sharingInfo: Files.FileSharingInfo? = nil, isDownloadable: Bool = true, exportInfo: Files.ExportInfo? = nil, propertyGroups: Array? = nil, hasExplicitSharedMembers: Bool? = nil, contentHash: String? = nil, fileLockInfo: Files.FileLockMetadata? = nil) { + public init( + name: String, + id: String, + clientModified: Date, + serverModified: Date, + rev: String, + size: UInt64, + pathLower: String? = nil, + pathDisplay: String? = nil, + parentSharedFolderId: String? = nil, + previewUrl: String? = nil, + mediaInfo: Files.MediaInfo? = nil, + symlinkInfo: Files.SymlinkInfo? = nil, + sharingInfo: Files.FileSharingInfo? = nil, + isDownloadable: Bool = true, + exportInfo: Files.ExportInfo? = nil, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + hasExplicitSharedMembers: Bool? = nil, + contentHash: String? = nil, + fileLockInfo: Files.FileLockMetadata? = nil + ) { stringValidator(minLength: 1)(id) self.id = id self.clientModified = clientModified @@ -2270,97 +2849,137 @@ open class Files { self.fileLockInfo = fileLockInfo super.init(name: name, pathLower: pathLower, pathDisplay: pathDisplay, parentSharedFolderId: parentSharedFolderId, previewUrl: previewUrl) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileMetadataSerializer().serialize(self)))" - } - } - open class FileMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileMetadata) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "id": Serialization._StringSerializer.serialize(value.id), - "client_modified": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.clientModified), - "server_modified": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.serverModified), - "rev": Serialization._StringSerializer.serialize(value.rev), - "size": Serialization._UInt64Serializer.serialize(value.size), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "path_display": NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "preview_url": NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), - "media_info": NullableSerializer(Files.MediaInfoSerializer()).serialize(value.mediaInfo), - "symlink_info": NullableSerializer(Files.SymlinkInfoSerializer()).serialize(value.symlinkInfo), - "sharing_info": NullableSerializer(Files.FileSharingInfoSerializer()).serialize(value.sharingInfo), - "is_downloadable": Serialization._BoolSerializer.serialize(value.isDownloadable), - "export_info": NullableSerializer(Files.ExportInfoSerializer()).serialize(value.exportInfo), - "property_groups": NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), - "has_explicit_shared_members": NullableSerializer(Serialization._BoolSerializer).serialize(value.hasExplicitSharedMembers), - "content_hash": NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), - "file_lock_info": NullableSerializer(Files.FileLockMetadataSerializer()).serialize(value.fileLockInfo), + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileMetadata: \(error)" + } + } + } + + public class FileMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileMetadata) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "id": try Serialization._StringSerializer.serialize(value.id), + "client_modified": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.clientModified), + "server_modified": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.serverModified), + "rev": try Serialization._StringSerializer.serialize(value.rev), + "size": try Serialization._UInt64Serializer.serialize(value.size), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "path_display": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "preview_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), + "media_info": try NullableSerializer(Files.MediaInfoSerializer()).serialize(value.mediaInfo), + "symlink_info": try NullableSerializer(Files.SymlinkInfoSerializer()).serialize(value.symlinkInfo), + "sharing_info": try NullableSerializer(Files.FileSharingInfoSerializer()).serialize(value.sharingInfo), + "is_downloadable": try Serialization._BoolSerializer.serialize(value.isDownloadable), + "export_info": try NullableSerializer(Files.ExportInfoSerializer()).serialize(value.exportInfo), + "property_groups": try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), + "has_explicit_shared_members": try NullableSerializer(Serialization._BoolSerializer).serialize(value.hasExplicitSharedMembers), + "content_hash": try NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), + "file_lock_info": try NullableSerializer(Files.FileLockMetadataSerializer()).serialize(value.fileLockInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileMetadata { - switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let clientModified = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["client_modified"] ?? .null) - let serverModified = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["server_modified"] ?? .null) - let rev = Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) - let size = Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let pathDisplay = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) - let parentSharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) - let previewUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["preview_url"] ?? .null) - let mediaInfo = NullableSerializer(Files.MediaInfoSerializer()).deserialize(dict["media_info"] ?? .null) - let symlinkInfo = NullableSerializer(Files.SymlinkInfoSerializer()).deserialize(dict["symlink_info"] ?? .null) - let sharingInfo = NullableSerializer(Files.FileSharingInfoSerializer()).deserialize(dict["sharing_info"] ?? .null) - let isDownloadable = Serialization._BoolSerializer.deserialize(dict["is_downloadable"] ?? .number(1)) - let exportInfo = NullableSerializer(Files.ExportInfoSerializer()).deserialize(dict["export_info"] ?? .null) - let propertyGroups = NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).deserialize(dict["property_groups"] ?? .null) - let hasExplicitSharedMembers = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["has_explicit_shared_members"] ?? .null) - let contentHash = NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) - let fileLockInfo = NullableSerializer(Files.FileLockMetadataSerializer()).deserialize(dict["file_lock_info"] ?? .null) - return FileMetadata(name: name, id: id, clientModified: clientModified, serverModified: serverModified, rev: rev, size: size, pathLower: pathLower, pathDisplay: pathDisplay, parentSharedFolderId: parentSharedFolderId, previewUrl: previewUrl, mediaInfo: mediaInfo, symlinkInfo: symlinkInfo, sharingInfo: sharingInfo, isDownloadable: isDownloadable, exportInfo: exportInfo, propertyGroups: propertyGroups, hasExplicitSharedMembers: hasExplicitSharedMembers, contentHash: contentHash, fileLockInfo: fileLockInfo) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> FileMetadata { + switch json { + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let clientModified = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["client_modified"] ?? .null) + let serverModified = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["server_modified"] ?? .null) + let rev = try Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) + let size = try Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let pathDisplay = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) + let parentSharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) + let previewUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["preview_url"] ?? .null) + let mediaInfo = try NullableSerializer(Files.MediaInfoSerializer()).deserialize(dict["media_info"] ?? .null) + let symlinkInfo = try NullableSerializer(Files.SymlinkInfoSerializer()).deserialize(dict["symlink_info"] ?? .null) + let sharingInfo = try NullableSerializer(Files.FileSharingInfoSerializer()).deserialize(dict["sharing_info"] ?? .null) + let isDownloadable = try Serialization._BoolSerializer.deserialize(dict["is_downloadable"] ?? .number(1)) + let exportInfo = try NullableSerializer(Files.ExportInfoSerializer()).deserialize(dict["export_info"] ?? .null) + let propertyGroups = try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())) + .deserialize(dict["property_groups"] ?? .null) + let hasExplicitSharedMembers = try NullableSerializer(Serialization._BoolSerializer) + .deserialize(dict["has_explicit_shared_members"] ?? .null) + let contentHash = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) + let fileLockInfo = try NullableSerializer(Files.FileLockMetadataSerializer()).deserialize(dict["file_lock_info"] ?? .null) + return FileMetadata( + name: name, + id: id, + clientModified: clientModified, + serverModified: serverModified, + rev: rev, + size: size, + pathLower: pathLower, + pathDisplay: pathDisplay, + parentSharedFolderId: parentSharedFolderId, + previewUrl: previewUrl, + mediaInfo: mediaInfo, + symlinkInfo: symlinkInfo, + sharingInfo: sharingInfo, + isDownloadable: isDownloadable, + exportInfo: exportInfo, + propertyGroups: propertyGroups, + hasExplicitSharedMembers: hasExplicitSharedMembers, + contentHash: contentHash, + fileLockInfo: fileLockInfo + ) + default: + throw JSONSerializerError.deserializeError(type: FileMetadata.self, json: json) } } } /// Sharing info for a file or folder. - open class SharingInfo: CustomStringConvertible { + public class SharingInfo: CustomStringConvertible, JSONRepresentable { /// True if the file or folder is inside a read-only shared folder. public let readOnly: Bool public init(readOnly: Bool) { self.readOnly = readOnly } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingInfo: \(error)" + } } } - open class SharingInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingInfo) -> JSON { - let output = [ - "read_only": Serialization._BoolSerializer.serialize(value.readOnly), + + public class SharingInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingInfo) throws -> JSON { + let output = [ + "read_only": try Serialization._BoolSerializer.serialize(value.readOnly), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingInfo { + + public func deserialize(_ json: JSON) throws -> SharingInfo { switch json { - case .dictionary(let dict): - let readOnly = Serialization._BoolSerializer.deserialize(dict["read_only"] ?? .null) - return SharingInfo(readOnly: readOnly) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let readOnly = try Serialization._BoolSerializer.deserialize(dict["read_only"] ?? .null) + return SharingInfo(readOnly: readOnly) + default: + throw JSONSerializerError.deserializeError(type: SharingInfo.self, json: json) } } } /// Sharing info for a file which is contained by a shared folder. - open class FileSharingInfo: Files.SharingInfo { + public class FileSharingInfo: Files.SharingInfo { /// ID of shared folder that holds this file. public let parentSharedFolderId: String /// The last user who modified the file. This field will be null if the user's account has been deleted. @@ -2372,35 +2991,42 @@ open class Files { self.modifiedBy = modifiedBy super.init(readOnly: readOnly) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileSharingInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileSharingInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileSharingInfo: \(error)" + } } } - open class FileSharingInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileSharingInfo) -> JSON { - let output = [ - "read_only": Serialization._BoolSerializer.serialize(value.readOnly), - "parent_shared_folder_id": Serialization._StringSerializer.serialize(value.parentSharedFolderId), - "modified_by": NullableSerializer(Serialization._StringSerializer).serialize(value.modifiedBy), + + public class FileSharingInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileSharingInfo) throws -> JSON { + let output = [ + "read_only": try Serialization._BoolSerializer.serialize(value.readOnly), + "parent_shared_folder_id": try Serialization._StringSerializer.serialize(value.parentSharedFolderId), + "modified_by": try NullableSerializer(Serialization._StringSerializer).serialize(value.modifiedBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileSharingInfo { + + public func deserialize(_ json: JSON) throws -> FileSharingInfo { switch json { - case .dictionary(let dict): - let readOnly = Serialization._BoolSerializer.deserialize(dict["read_only"] ?? .null) - let parentSharedFolderId = Serialization._StringSerializer.deserialize(dict["parent_shared_folder_id"] ?? .null) - let modifiedBy = NullableSerializer(Serialization._StringSerializer).deserialize(dict["modified_by"] ?? .null) - return FileSharingInfo(readOnly: readOnly, parentSharedFolderId: parentSharedFolderId, modifiedBy: modifiedBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let readOnly = try Serialization._BoolSerializer.deserialize(dict["read_only"] ?? .null) + let parentSharedFolderId = try Serialization._StringSerializer.deserialize(dict["parent_shared_folder_id"] ?? .null) + let modifiedBy = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["modified_by"] ?? .null) + return FileSharingInfo(readOnly: readOnly, parentSharedFolderId: parentSharedFolderId, modifiedBy: modifiedBy) + default: + throw JSONSerializerError.deserializeError(type: FileSharingInfo.self, json: json) } } } /// The FileStatus union - public enum FileStatus: CustomStringConvertible { + public enum FileStatus: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case active /// An unspecified error. @@ -2408,50 +3034,60 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try FileStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileStatus: \(error)" + } } } - open class FileStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileStatus) -> JSON { + + public class FileStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileStatus) throws -> JSON { switch value { - case .active: - var d = [String: JSON]() - d[".tag"] = .str("active") - return .dictionary(d) - case .deleted: - var d = [String: JSON]() - d[".tag"] = .str("deleted") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "active": - return FileStatus.active - case "deleted": - return FileStatus.deleted - case "other": - return FileStatus.other - default: - return FileStatus.other - } + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .deleted: + var d = [String: JSON]() + d[".tag"] = .str("deleted") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return FileStatus.active + case "deleted": + return FileStatus.deleted + case "other": + return FileStatus.other default: - fatalError("Failed to deserialize") + return FileStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: FileStatus.self, json: json) } } } /// The FolderMetadata struct - open class FolderMetadata: Files.Metadata { + public class FolderMetadata: Files.Metadata { /// A unique identifier for the folder. public let id: String /// Please use sharingInfo instead. @@ -2459,9 +3095,20 @@ open class Files { /// Set if the folder is contained in a shared folder or is a shared folder mount point. public let sharingInfo: Files.FolderSharingInfo? /// Additional information if the file has custom properties with the property template specified. Note that - /// only properties associated with user-owned templates, not team-owned templates, can be attached to folders. - public let propertyGroups: Array? - public init(name: String, id: String, pathLower: String? = nil, pathDisplay: String? = nil, parentSharedFolderId: String? = nil, previewUrl: String? = nil, sharedFolderId: String? = nil, sharingInfo: Files.FolderSharingInfo? = nil, propertyGroups: Array? = nil) { + /// only properties associated with user-owned templates, not team-owned templates, can be attached to + /// folders. + public let propertyGroups: [FileProperties.PropertyGroup]? + public init( + name: String, + id: String, + pathLower: String? = nil, + pathDisplay: String? = nil, + parentSharedFolderId: String? = nil, + previewUrl: String? = nil, + sharedFolderId: String? = nil, + sharingInfo: Files.FolderSharingInfo? = nil, + propertyGroups: [FileProperties.PropertyGroup]? = nil + ) { stringValidator(minLength: 1)(id) self.id = id nullableValidator(stringValidator(pattern: "[-_0-9a-zA-Z:]+"))(sharedFolderId) @@ -2470,54 +3117,72 @@ open class Files { self.propertyGroups = propertyGroups super.init(name: name, pathLower: pathLower, pathDisplay: pathDisplay, parentSharedFolderId: parentSharedFolderId, previewUrl: previewUrl) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderMetadataSerializer().serialize(self)))" - } - } - open class FolderMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderMetadata) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "id": Serialization._StringSerializer.serialize(value.id), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "path_display": NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "preview_url": NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), - "shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedFolderId), - "sharing_info": NullableSerializer(Files.FolderSharingInfoSerializer()).serialize(value.sharingInfo), - "property_groups": NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderMetadata: \(error)" + } + } + } + + public class FolderMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderMetadata) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "id": try Serialization._StringSerializer.serialize(value.id), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "path_display": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "preview_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.previewUrl), + "shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedFolderId), + "sharing_info": try NullableSerializer(Files.FolderSharingInfoSerializer()).serialize(value.sharingInfo), + "property_groups": try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderMetadata { - switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let pathDisplay = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) - let parentSharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) - let previewUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["preview_url"] ?? .null) - let sharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_folder_id"] ?? .null) - let sharingInfo = NullableSerializer(Files.FolderSharingInfoSerializer()).deserialize(dict["sharing_info"] ?? .null) - let propertyGroups = NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).deserialize(dict["property_groups"] ?? .null) - return FolderMetadata(name: name, id: id, pathLower: pathLower, pathDisplay: pathDisplay, parentSharedFolderId: parentSharedFolderId, previewUrl: previewUrl, sharedFolderId: sharedFolderId, sharingInfo: sharingInfo, propertyGroups: propertyGroups) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> FolderMetadata { + switch json { + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let pathDisplay = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) + let parentSharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) + let previewUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["preview_url"] ?? .null) + let sharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_folder_id"] ?? .null) + let sharingInfo = try NullableSerializer(Files.FolderSharingInfoSerializer()).deserialize(dict["sharing_info"] ?? .null) + let propertyGroups = try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())) + .deserialize(dict["property_groups"] ?? .null) + return FolderMetadata( + name: name, + id: id, + pathLower: pathLower, + pathDisplay: pathDisplay, + parentSharedFolderId: parentSharedFolderId, + previewUrl: previewUrl, + sharedFolderId: sharedFolderId, + sharingInfo: sharingInfo, + propertyGroups: propertyGroups + ) + default: + throw JSONSerializerError.deserializeError(type: FolderMetadata.self, json: json) } } } /// Sharing info for a folder which is contained in a shared folder or is a shared folder mount point. - open class FolderSharingInfo: Files.SharingInfo { + public class FolderSharingInfo: Files.SharingInfo { /// Set if the folder is contained by a shared folder. public let parentSharedFolderId: String? /// If this folder is a shared folder mount point, the ID of the shared folder mounted at this location. public let sharedFolderId: String? /// Specifies that the folder can only be traversed and the user can only see a limited subset of the contents - /// of this folder because they don't have read access to this folder. They do, however, have access to some sub - /// folder. + /// of this folder because they don't have read access to this folder. They do, however, have access to + /// some sub folder. public let traverseOnly: Bool /// Specifies that the folder cannot be accessed by the user. public let noAccess: Bool @@ -2530,114 +3195,148 @@ open class Files { self.noAccess = noAccess super.init(readOnly: readOnly) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderSharingInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderSharingInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderSharingInfo: \(error)" + } } } - open class FolderSharingInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderSharingInfo) -> JSON { - let output = [ - "read_only": Serialization._BoolSerializer.serialize(value.readOnly), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedFolderId), - "traverse_only": Serialization._BoolSerializer.serialize(value.traverseOnly), - "no_access": Serialization._BoolSerializer.serialize(value.noAccess), + + public class FolderSharingInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderSharingInfo) throws -> JSON { + let output = [ + "read_only": try Serialization._BoolSerializer.serialize(value.readOnly), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedFolderId), + "traverse_only": try Serialization._BoolSerializer.serialize(value.traverseOnly), + "no_access": try Serialization._BoolSerializer.serialize(value.noAccess), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderSharingInfo { + + public func deserialize(_ json: JSON) throws -> FolderSharingInfo { switch json { - case .dictionary(let dict): - let readOnly = Serialization._BoolSerializer.deserialize(dict["read_only"] ?? .null) - let parentSharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) - let sharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_folder_id"] ?? .null) - let traverseOnly = Serialization._BoolSerializer.deserialize(dict["traverse_only"] ?? .number(0)) - let noAccess = Serialization._BoolSerializer.deserialize(dict["no_access"] ?? .number(0)) - return FolderSharingInfo(readOnly: readOnly, parentSharedFolderId: parentSharedFolderId, sharedFolderId: sharedFolderId, traverseOnly: traverseOnly, noAccess: noAccess) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let readOnly = try Serialization._BoolSerializer.deserialize(dict["read_only"] ?? .null) + let parentSharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) + let sharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_folder_id"] ?? .null) + let traverseOnly = try Serialization._BoolSerializer.deserialize(dict["traverse_only"] ?? .number(0)) + let noAccess = try Serialization._BoolSerializer.deserialize(dict["no_access"] ?? .number(0)) + return FolderSharingInfo( + readOnly: readOnly, + parentSharedFolderId: parentSharedFolderId, + sharedFolderId: sharedFolderId, + traverseOnly: traverseOnly, + noAccess: noAccess + ) + default: + throw JSONSerializerError.deserializeError(type: FolderSharingInfo.self, json: json) } } } /// The GetCopyReferenceArg struct - open class GetCopyReferenceArg: CustomStringConvertible { + public class GetCopyReferenceArg: CustomStringConvertible, JSONRepresentable { /// The path to the file or folder you want to get a copy reference to. public let path: String public init(path: String) { stringValidator(pattern: "(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)")(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetCopyReferenceArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetCopyReferenceArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetCopyReferenceArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetCopyReferenceArg: \(error)" + } } } - open class GetCopyReferenceArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetCopyReferenceArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), + + public class GetCopyReferenceArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetCopyReferenceArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetCopyReferenceArg { + + public func deserialize(_ json: JSON) throws -> GetCopyReferenceArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - return GetCopyReferenceArg(path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + return GetCopyReferenceArg(path: path) + default: + throw JSONSerializerError.deserializeError(type: GetCopyReferenceArg.self, json: json) } } } /// The GetCopyReferenceError union - public enum GetCopyReferenceError: CustomStringConvertible { + public enum GetCopyReferenceError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. case other + func json() throws -> JSON { + try GetCopyReferenceErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetCopyReferenceErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetCopyReferenceErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetCopyReferenceError: \(error)" + } } } - open class GetCopyReferenceErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetCopyReferenceError) -> JSON { + + public class GetCopyReferenceErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetCopyReferenceError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetCopyReferenceError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return GetCopyReferenceError.path(v) - case "other": - return GetCopyReferenceError.other - default: - return GetCopyReferenceError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetCopyReferenceError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return GetCopyReferenceError.path(v) + case "other": + return GetCopyReferenceError.other default: - fatalError("Failed to deserialize") + return GetCopyReferenceError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetCopyReferenceError.self, json: json) } } } /// The GetCopyReferenceResult struct - open class GetCopyReferenceResult: CustomStringConvertible { + public class GetCopyReferenceResult: CustomStringConvertible, JSONRepresentable { /// Metadata of the file or folder. public let metadata: Files.Metadata /// A copy reference to the file or folder. @@ -2651,127 +3350,171 @@ open class Files { self.copyReference = copyReference self.expires = expires } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetCopyReferenceResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetCopyReferenceResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetCopyReferenceResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetCopyReferenceResult: \(error)" + } } } - open class GetCopyReferenceResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetCopyReferenceResult) -> JSON { - let output = [ - "metadata": Files.MetadataSerializer().serialize(value.metadata), - "copy_reference": Serialization._StringSerializer.serialize(value.copyReference), - "expires": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.expires), + + public class GetCopyReferenceResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetCopyReferenceResult) throws -> JSON { + let output = [ + "metadata": try Files.MetadataSerializer().serialize(value.metadata), + "copy_reference": try Serialization._StringSerializer.serialize(value.copyReference), + "expires": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.expires), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetCopyReferenceResult { + + public func deserialize(_ json: JSON) throws -> GetCopyReferenceResult { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - let copyReference = Serialization._StringSerializer.deserialize(dict["copy_reference"] ?? .null) - let expires = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["expires"] ?? .null) - return GetCopyReferenceResult(metadata: metadata, copyReference: copyReference, expires: expires) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + let copyReference = try Serialization._StringSerializer.deserialize(dict["copy_reference"] ?? .null) + let expires = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["expires"] ?? .null) + return GetCopyReferenceResult(metadata: metadata, copyReference: copyReference, expires: expires) + default: + throw JSONSerializerError.deserializeError(type: GetCopyReferenceResult.self, json: json) } } } /// The GetTagsArg struct - open class GetTagsArg: CustomStringConvertible { + public class GetTagsArg: CustomStringConvertible, JSONRepresentable { /// Path to the items. - public let paths: Array - public init(paths: Array) { + public let paths: [String] + public init(paths: [String]) { arrayValidator(itemValidator: stringValidator(pattern: "/(.|[\\r\\n])*"))(paths) self.paths = paths } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTagsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTagsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTagsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTagsArg: \(error)" + } } } - open class GetTagsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTagsArg) -> JSON { - let output = [ - "paths": ArraySerializer(Serialization._StringSerializer).serialize(value.paths), + + public class GetTagsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTagsArg) throws -> JSON { + let output = [ + "paths": try ArraySerializer(Serialization._StringSerializer).serialize(value.paths), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTagsArg { + + public func deserialize(_ json: JSON) throws -> GetTagsArg { switch json { - case .dictionary(let dict): - let paths = ArraySerializer(Serialization._StringSerializer).deserialize(dict["paths"] ?? .null) - return GetTagsArg(paths: paths) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let paths = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["paths"] ?? .null) + return GetTagsArg(paths: paths) + default: + throw JSONSerializerError.deserializeError(type: GetTagsArg.self, json: json) } } } /// The GetTagsResult struct - open class GetTagsResult: CustomStringConvertible { + public class GetTagsResult: CustomStringConvertible, JSONRepresentable { /// List of paths and their corresponding tags. - public let pathsToTags: Array - public init(pathsToTags: Array) { + public let pathsToTags: [Files.PathToTags] + public init(pathsToTags: [Files.PathToTags]) { self.pathsToTags = pathsToTags } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTagsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTagsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTagsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTagsResult: \(error)" + } } } - open class GetTagsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTagsResult) -> JSON { - let output = [ - "paths_to_tags": ArraySerializer(Files.PathToTagsSerializer()).serialize(value.pathsToTags), + + public class GetTagsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTagsResult) throws -> JSON { + let output = [ + "paths_to_tags": try ArraySerializer(Files.PathToTagsSerializer()).serialize(value.pathsToTags), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTagsResult { + + public func deserialize(_ json: JSON) throws -> GetTagsResult { switch json { - case .dictionary(let dict): - let pathsToTags = ArraySerializer(Files.PathToTagsSerializer()).deserialize(dict["paths_to_tags"] ?? .null) - return GetTagsResult(pathsToTags: pathsToTags) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let pathsToTags = try ArraySerializer(Files.PathToTagsSerializer()).deserialize(dict["paths_to_tags"] ?? .null) + return GetTagsResult(pathsToTags: pathsToTags) + default: + throw JSONSerializerError.deserializeError(type: GetTagsResult.self, json: json) } } } /// The GetTemporaryLinkArg struct - open class GetTemporaryLinkArg: CustomStringConvertible { + public class GetTemporaryLinkArg: CustomStringConvertible, JSONRepresentable { /// The path to the file you want a temporary link to. public let path: String public init(path: String) { stringValidator(pattern: "(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)")(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTemporaryLinkArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTemporaryLinkArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTemporaryLinkArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTemporaryLinkArg: \(error)" + } } } - open class GetTemporaryLinkArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTemporaryLinkArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), + + public class GetTemporaryLinkArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTemporaryLinkArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTemporaryLinkArg { + + public func deserialize(_ json: JSON) throws -> GetTemporaryLinkArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - return GetTemporaryLinkArg(path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + return GetTemporaryLinkArg(path: path) + default: + throw JSONSerializerError.deserializeError(type: GetTemporaryLinkArg.self, json: json) } } } /// The GetTemporaryLinkError union - public enum GetTemporaryLinkError: CustomStringConvertible { + public enum GetTemporaryLinkError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// This user's email address is not verified. This functionality is only available on accounts with a verified @@ -2786,63 +3529,73 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try GetTemporaryLinkErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTemporaryLinkErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTemporaryLinkErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTemporaryLinkError: \(error)" + } } } - open class GetTemporaryLinkErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTemporaryLinkError) -> JSON { + + public class GetTemporaryLinkErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTemporaryLinkError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .emailNotVerified: - var d = [String: JSON]() - d[".tag"] = .str("email_not_verified") - return .dictionary(d) - case .unsupportedFile: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_file") - return .dictionary(d) - case .notAllowed: - var d = [String: JSON]() - d[".tag"] = .str("not_allowed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetTemporaryLinkError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return GetTemporaryLinkError.path(v) - case "email_not_verified": - return GetTemporaryLinkError.emailNotVerified - case "unsupported_file": - return GetTemporaryLinkError.unsupportedFile - case "not_allowed": - return GetTemporaryLinkError.notAllowed - case "other": - return GetTemporaryLinkError.other - default: - return GetTemporaryLinkError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .emailNotVerified: + var d = [String: JSON]() + d[".tag"] = .str("email_not_verified") + return .dictionary(d) + case .unsupportedFile: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_file") + return .dictionary(d) + case .notAllowed: + var d = [String: JSON]() + d[".tag"] = .str("not_allowed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetTemporaryLinkError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return GetTemporaryLinkError.path(v) + case "email_not_verified": + return GetTemporaryLinkError.emailNotVerified + case "unsupported_file": + return GetTemporaryLinkError.unsupportedFile + case "not_allowed": + return GetTemporaryLinkError.notAllowed + case "other": + return GetTemporaryLinkError.other + default: + return GetTemporaryLinkError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetTemporaryLinkError.self, json: json) } } } /// The GetTemporaryLinkResult struct - open class GetTemporaryLinkResult: CustomStringConvertible { + public class GetTemporaryLinkResult: CustomStringConvertible, JSONRepresentable { /// Metadata of the file. public let metadata: Files.FileMetadata /// The temporary link which can be used to stream content the file. @@ -2852,205 +3605,270 @@ open class Files { stringValidator()(link) self.link = link } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTemporaryLinkResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTemporaryLinkResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTemporaryLinkResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTemporaryLinkResult: \(error)" + } } } - open class GetTemporaryLinkResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTemporaryLinkResult) -> JSON { - let output = [ - "metadata": Files.FileMetadataSerializer().serialize(value.metadata), - "link": Serialization._StringSerializer.serialize(value.link), + + public class GetTemporaryLinkResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTemporaryLinkResult) throws -> JSON { + let output = [ + "metadata": try Files.FileMetadataSerializer().serialize(value.metadata), + "link": try Serialization._StringSerializer.serialize(value.link), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTemporaryLinkResult { + + public func deserialize(_ json: JSON) throws -> GetTemporaryLinkResult { switch json { - case .dictionary(let dict): - let metadata = Files.FileMetadataSerializer().deserialize(dict["metadata"] ?? .null) - let link = Serialization._StringSerializer.deserialize(dict["link"] ?? .null) - return GetTemporaryLinkResult(metadata: metadata, link: link) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.FileMetadataSerializer().deserialize(dict["metadata"] ?? .null) + let link = try Serialization._StringSerializer.deserialize(dict["link"] ?? .null) + return GetTemporaryLinkResult(metadata: metadata, link: link) + default: + throw JSONSerializerError.deserializeError(type: GetTemporaryLinkResult.self, json: json) } } } /// The GetTemporaryUploadLinkArg struct - open class GetTemporaryUploadLinkArg: CustomStringConvertible { + public class GetTemporaryUploadLinkArg: CustomStringConvertible, JSONRepresentable { /// Contains the path and other optional modifiers for the future upload commit. Equivalent to the parameters /// provided to upload. public let commitInfo: Files.CommitInfo /// How long before this link expires, in seconds. Attempting to start an upload with this link longer than /// this period of time after link creation will result in an error. public let duration: Double - public init(commitInfo: Files.CommitInfo, duration: Double = 14400.0) { + public init(commitInfo: Files.CommitInfo, duration: Double = 14_400.0) { self.commitInfo = commitInfo - comparableValidator(minValue: 60.0, maxValue: 14400.0)(duration) + comparableValidator(minValue: 60.0, maxValue: 14_400.0)(duration) self.duration = duration } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTemporaryUploadLinkArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTemporaryUploadLinkArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTemporaryUploadLinkArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTemporaryUploadLinkArg: \(error)" + } } } - open class GetTemporaryUploadLinkArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTemporaryUploadLinkArg) -> JSON { - let output = [ - "commit_info": Files.CommitInfoSerializer().serialize(value.commitInfo), - "duration": Serialization._DoubleSerializer.serialize(value.duration), + + public class GetTemporaryUploadLinkArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTemporaryUploadLinkArg) throws -> JSON { + let output = [ + "commit_info": try Files.CommitInfoSerializer().serialize(value.commitInfo), + "duration": try Serialization._DoubleSerializer.serialize(value.duration), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTemporaryUploadLinkArg { + + public func deserialize(_ json: JSON) throws -> GetTemporaryUploadLinkArg { switch json { - case .dictionary(let dict): - let commitInfo = Files.CommitInfoSerializer().deserialize(dict["commit_info"] ?? .null) - let duration = Serialization._DoubleSerializer.deserialize(dict["duration"] ?? .number(14400.0)) - return GetTemporaryUploadLinkArg(commitInfo: commitInfo, duration: duration) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let commitInfo = try Files.CommitInfoSerializer().deserialize(dict["commit_info"] ?? .null) + let duration = try Serialization._DoubleSerializer.deserialize(dict["duration"] ?? .number(14_400.0)) + return GetTemporaryUploadLinkArg(commitInfo: commitInfo, duration: duration) + default: + throw JSONSerializerError.deserializeError(type: GetTemporaryUploadLinkArg.self, json: json) } } } /// The GetTemporaryUploadLinkResult struct - open class GetTemporaryUploadLinkResult: CustomStringConvertible { + public class GetTemporaryUploadLinkResult: CustomStringConvertible, JSONRepresentable { /// The temporary link which can be used to stream a file to a Dropbox location. public let link: String public init(link: String) { stringValidator()(link) self.link = link } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTemporaryUploadLinkResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTemporaryUploadLinkResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTemporaryUploadLinkResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTemporaryUploadLinkResult: \(error)" + } } } - open class GetTemporaryUploadLinkResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTemporaryUploadLinkResult) -> JSON { - let output = [ - "link": Serialization._StringSerializer.serialize(value.link), + + public class GetTemporaryUploadLinkResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTemporaryUploadLinkResult) throws -> JSON { + let output = [ + "link": try Serialization._StringSerializer.serialize(value.link), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTemporaryUploadLinkResult { + + public func deserialize(_ json: JSON) throws -> GetTemporaryUploadLinkResult { switch json { - case .dictionary(let dict): - let link = Serialization._StringSerializer.deserialize(dict["link"] ?? .null) - return GetTemporaryUploadLinkResult(link: link) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let link = try Serialization._StringSerializer.deserialize(dict["link"] ?? .null) + return GetTemporaryUploadLinkResult(link: link) + default: + throw JSONSerializerError.deserializeError(type: GetTemporaryUploadLinkResult.self, json: json) } } } /// Arguments for getThumbnailBatch. - open class GetThumbnailBatchArg: CustomStringConvertible { + public class GetThumbnailBatchArg: CustomStringConvertible, JSONRepresentable { /// List of files to get thumbnails. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.ThumbnailArg] + public init(entries: [Files.ThumbnailArg]) { self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetThumbnailBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetThumbnailBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetThumbnailBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetThumbnailBatchArg: \(error)" + } } } - open class GetThumbnailBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetThumbnailBatchArg) -> JSON { - let output = [ - "entries": ArraySerializer(Files.ThumbnailArgSerializer()).serialize(value.entries), + + public class GetThumbnailBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetThumbnailBatchArg) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.ThumbnailArgSerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetThumbnailBatchArg { + + public func deserialize(_ json: JSON) throws -> GetThumbnailBatchArg { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.ThumbnailArgSerializer()).deserialize(dict["entries"] ?? .null) - return GetThumbnailBatchArg(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.ThumbnailArgSerializer()).deserialize(dict["entries"] ?? .null) + return GetThumbnailBatchArg(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: GetThumbnailBatchArg.self, json: json) } } } /// The GetThumbnailBatchError union - public enum GetThumbnailBatchError: CustomStringConvertible { + public enum GetThumbnailBatchError: CustomStringConvertible, JSONRepresentable { /// The operation involves more than 25 files. case tooManyFiles /// An unspecified error. case other + func json() throws -> JSON { + try GetThumbnailBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetThumbnailBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetThumbnailBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetThumbnailBatchError: \(error)" + } } } - open class GetThumbnailBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetThumbnailBatchError) -> JSON { + + public class GetThumbnailBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetThumbnailBatchError) throws -> JSON { switch value { - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetThumbnailBatchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "too_many_files": - return GetThumbnailBatchError.tooManyFiles - case "other": - return GetThumbnailBatchError.other - default: - return GetThumbnailBatchError.other - } + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetThumbnailBatchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "too_many_files": + return GetThumbnailBatchError.tooManyFiles + case "other": + return GetThumbnailBatchError.other default: - fatalError("Failed to deserialize") + return GetThumbnailBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetThumbnailBatchError.self, json: json) } } } /// The GetThumbnailBatchResult struct - open class GetThumbnailBatchResult: CustomStringConvertible { + public class GetThumbnailBatchResult: CustomStringConvertible, JSONRepresentable { /// List of files and their thumbnails. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.GetThumbnailBatchResultEntry] + public init(entries: [Files.GetThumbnailBatchResultEntry]) { self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetThumbnailBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetThumbnailBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetThumbnailBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetThumbnailBatchResult: \(error)" + } } } - open class GetThumbnailBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetThumbnailBatchResult) -> JSON { - let output = [ - "entries": ArraySerializer(Files.GetThumbnailBatchResultEntrySerializer()).serialize(value.entries), + + public class GetThumbnailBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetThumbnailBatchResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.GetThumbnailBatchResultEntrySerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetThumbnailBatchResult { + + public func deserialize(_ json: JSON) throws -> GetThumbnailBatchResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.GetThumbnailBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) - return GetThumbnailBatchResult(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.GetThumbnailBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) + return GetThumbnailBatchResult(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: GetThumbnailBatchResult.self, json: json) } } } /// The GetThumbnailBatchResultData struct - open class GetThumbnailBatchResultData: CustomStringConvertible { + public class GetThumbnailBatchResultData: CustomStringConvertible, JSONRepresentable { /// (no description) public let metadata: Files.FileMetadata /// A string containing the base64-encoded thumbnail data for this file. @@ -3060,33 +3878,44 @@ open class Files { stringValidator()(thumbnail) self.thumbnail = thumbnail } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetThumbnailBatchResultDataSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetThumbnailBatchResultDataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetThumbnailBatchResultDataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetThumbnailBatchResultData: \(error)" + } } } - open class GetThumbnailBatchResultDataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetThumbnailBatchResultData) -> JSON { - let output = [ - "metadata": Files.FileMetadataSerializer().serialize(value.metadata), - "thumbnail": Serialization._StringSerializer.serialize(value.thumbnail), + + public class GetThumbnailBatchResultDataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetThumbnailBatchResultData) throws -> JSON { + let output = [ + "metadata": try Files.FileMetadataSerializer().serialize(value.metadata), + "thumbnail": try Serialization._StringSerializer.serialize(value.thumbnail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetThumbnailBatchResultData { + + public func deserialize(_ json: JSON) throws -> GetThumbnailBatchResultData { switch json { - case .dictionary(let dict): - let metadata = Files.FileMetadataSerializer().deserialize(dict["metadata"] ?? .null) - let thumbnail = Serialization._StringSerializer.deserialize(dict["thumbnail"] ?? .null) - return GetThumbnailBatchResultData(metadata: metadata, thumbnail: thumbnail) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.FileMetadataSerializer().deserialize(dict["metadata"] ?? .null) + let thumbnail = try Serialization._StringSerializer.deserialize(dict["thumbnail"] ?? .null) + return GetThumbnailBatchResultData(metadata: metadata, thumbnail: thumbnail) + default: + throw JSONSerializerError.deserializeError(type: GetThumbnailBatchResultData.self, json: json) } } } /// The GetThumbnailBatchResultEntry union - public enum GetThumbnailBatchResultEntry: CustomStringConvertible { + public enum GetThumbnailBatchResultEntry: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case success(Files.GetThumbnailBatchResultData) /// The result for this file if it was an error. @@ -3094,52 +3923,62 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try GetThumbnailBatchResultEntrySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetThumbnailBatchResultEntrySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetThumbnailBatchResultEntrySerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetThumbnailBatchResultEntry: \(error)" + } } } - open class GetThumbnailBatchResultEntrySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetThumbnailBatchResultEntry) -> JSON { + + public class GetThumbnailBatchResultEntrySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetThumbnailBatchResultEntry) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Files.GetThumbnailBatchResultDataSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .failure(let arg): - var d = ["failure": Files.ThumbnailErrorSerializer().serialize(arg)] - d[".tag"] = .str("failure") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetThumbnailBatchResultEntry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Files.GetThumbnailBatchResultDataSerializer().deserialize(json) - return GetThumbnailBatchResultEntry.success(v) - case "failure": - let v = Files.ThumbnailErrorSerializer().deserialize(d["failure"] ?? .null) - return GetThumbnailBatchResultEntry.failure(v) - case "other": - return GetThumbnailBatchResultEntry.other - default: - return GetThumbnailBatchResultEntry.other - } + case .success(let arg): + var d = try Serialization.getFields(Files.GetThumbnailBatchResultDataSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .failure(let arg): + var d = try ["failure": Files.ThumbnailErrorSerializer().serialize(arg)] + d[".tag"] = .str("failure") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetThumbnailBatchResultEntry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Files.GetThumbnailBatchResultDataSerializer().deserialize(json) + return GetThumbnailBatchResultEntry.success(v) + case "failure": + let v = try Files.ThumbnailErrorSerializer().deserialize(d["failure"] ?? .null) + return GetThumbnailBatchResultEntry.failure(v) + case "other": + return GetThumbnailBatchResultEntry.other default: - fatalError("Failed to deserialize") + return GetThumbnailBatchResultEntry.other + } + default: + throw JSONSerializerError.deserializeError(type: GetThumbnailBatchResultEntry.self, json: json) } } } /// GPS coordinates for a photo or video. - open class GpsCoordinates: CustomStringConvertible { + public class GpsCoordinates: CustomStringConvertible, JSONRepresentable { /// Latitude of the GPS coordinates. public let latitude: Double /// Longitude of the GPS coordinates. @@ -3150,33 +3989,44 @@ open class Files { comparableValidator()(longitude) self.longitude = longitude } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GpsCoordinatesSerializer().serialize(self)))" + + func json() throws -> JSON { + try GpsCoordinatesSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GpsCoordinatesSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GpsCoordinates: \(error)" + } } } - open class GpsCoordinatesSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GpsCoordinates) -> JSON { - let output = [ - "latitude": Serialization._DoubleSerializer.serialize(value.latitude), - "longitude": Serialization._DoubleSerializer.serialize(value.longitude), + + public class GpsCoordinatesSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GpsCoordinates) throws -> JSON { + let output = [ + "latitude": try Serialization._DoubleSerializer.serialize(value.latitude), + "longitude": try Serialization._DoubleSerializer.serialize(value.longitude), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GpsCoordinates { + + public func deserialize(_ json: JSON) throws -> GpsCoordinates { switch json { - case .dictionary(let dict): - let latitude = Serialization._DoubleSerializer.deserialize(dict["latitude"] ?? .null) - let longitude = Serialization._DoubleSerializer.deserialize(dict["longitude"] ?? .null) - return GpsCoordinates(latitude: latitude, longitude: longitude) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let latitude = try Serialization._DoubleSerializer.deserialize(dict["latitude"] ?? .null) + let longitude = try Serialization._DoubleSerializer.deserialize(dict["longitude"] ?? .null) + return GpsCoordinates(latitude: latitude, longitude: longitude) + default: + throw JSONSerializerError.deserializeError(type: GpsCoordinates.self, json: json) } } } /// The HighlightSpan struct - open class HighlightSpan: CustomStringConvertible { + public class HighlightSpan: CustomStringConvertible, JSONRepresentable { /// String to be determined whether it should be highlighted or not. public let highlightStr: String /// The string should be highlighted or not. @@ -3186,33 +4036,44 @@ open class Files { self.highlightStr = highlightStr self.isHighlighted = isHighlighted } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(HighlightSpanSerializer().serialize(self)))" + + func json() throws -> JSON { + try HighlightSpanSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try HighlightSpanSerializer().serialize(self)))" + } catch { + return "Failed to generate description for HighlightSpan: \(error)" + } } } - open class HighlightSpanSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: HighlightSpan) -> JSON { - let output = [ - "highlight_str": Serialization._StringSerializer.serialize(value.highlightStr), - "is_highlighted": Serialization._BoolSerializer.serialize(value.isHighlighted), + + public class HighlightSpanSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: HighlightSpan) throws -> JSON { + let output = [ + "highlight_str": try Serialization._StringSerializer.serialize(value.highlightStr), + "is_highlighted": try Serialization._BoolSerializer.serialize(value.isHighlighted), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> HighlightSpan { + + public func deserialize(_ json: JSON) throws -> HighlightSpan { switch json { - case .dictionary(let dict): - let highlightStr = Serialization._StringSerializer.deserialize(dict["highlight_str"] ?? .null) - let isHighlighted = Serialization._BoolSerializer.deserialize(dict["is_highlighted"] ?? .null) - return HighlightSpan(highlightStr: highlightStr, isHighlighted: isHighlighted) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let highlightStr = try Serialization._StringSerializer.deserialize(dict["highlight_str"] ?? .null) + let isHighlighted = try Serialization._BoolSerializer.deserialize(dict["is_highlighted"] ?? .null) + return HighlightSpan(highlightStr: highlightStr, isHighlighted: isHighlighted) + default: + throw JSONSerializerError.deserializeError(type: HighlightSpan.self, json: json) } } } /// The import format of the incoming Paper doc content. - public enum ImportFormat: CustomStringConvertible { + public enum ImportFormat: CustomStringConvertible, JSONRepresentable { /// The provided data is interpreted as standard HTML. case html /// The provided data is interpreted as markdown. @@ -3222,56 +4083,66 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try ImportFormatSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ImportFormatSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ImportFormatSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ImportFormat: \(error)" + } } } - open class ImportFormatSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ImportFormat) -> JSON { + + public class ImportFormatSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ImportFormat) throws -> JSON { switch value { - case .html: - var d = [String: JSON]() - d[".tag"] = .str("html") - return .dictionary(d) - case .markdown: - var d = [String: JSON]() - d[".tag"] = .str("markdown") - return .dictionary(d) - case .plainText: - var d = [String: JSON]() - d[".tag"] = .str("plain_text") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ImportFormat { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "html": - return ImportFormat.html - case "markdown": - return ImportFormat.markdown - case "plain_text": - return ImportFormat.plainText - case "other": - return ImportFormat.other - default: - return ImportFormat.other - } - default: - fatalError("Failed to deserialize") + case .html: + var d = [String: JSON]() + d[".tag"] = .str("html") + return .dictionary(d) + case .markdown: + var d = [String: JSON]() + d[".tag"] = .str("markdown") + return .dictionary(d) + case .plainText: + var d = [String: JSON]() + d[".tag"] = .str("plain_text") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ImportFormat { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "html": + return ImportFormat.html + case "markdown": + return ImportFormat.markdown + case "plain_text": + return ImportFormat.plainText + case "other": + return ImportFormat.other + default: + return ImportFormat.other + } + default: + throw JSONSerializerError.deserializeError(type: ImportFormat.self, json: json) } } } /// The ListFolderArg struct - open class ListFolderArg: CustomStringConvertible { + public class ListFolderArg: CustomStringConvertible, JSONRepresentable { /// A unique identifier for the file. public let path: String /// If true, the list folder operation will be applied recursively to all subfolders and the response will @@ -3292,15 +4163,26 @@ open class Files { /// slightly more entries returned in some cases. public let limit: UInt32? /// A shared link to list the contents of. If the link is password-protected, the password must be provided. If - /// this field is present, path in ListFolderArg will be relative to root of the shared link. Only non-recursive - /// mode is supported for shared link. + /// this field is present, path in ListFolderArg will be relative to root of the shared link. Only + /// non-recursive mode is supported for shared link. public let sharedLink: Files.SharedLink? /// If set to a valid list of template IDs, propertyGroups in FileMetadata is set if there exists property data /// associated with the file and each of the listed templates. public let includePropertyGroups: FileProperties.TemplateFilterBase? /// If true, include files that are not downloadable, i.e. Google Docs. public let includeNonDownloadableFiles: Bool - public init(path: String, recursive: Bool = false, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includeMountedFolders: Bool = true, limit: UInt32? = nil, sharedLink: Files.SharedLink? = nil, includePropertyGroups: FileProperties.TemplateFilterBase? = nil, includeNonDownloadableFiles: Bool = true) { + public init( + path: String, + recursive: Bool = false, + includeMediaInfo: Bool = false, + includeDeleted: Bool = false, + includeHasExplicitSharedMembers: Bool = false, + includeMountedFolders: Bool = true, + limit: UInt32? = nil, + sharedLink: Files.SharedLink? = nil, + includePropertyGroups: FileProperties.TemplateFilterBase? = nil, + includeNonDownloadableFiles: Bool = true + ) { stringValidator(pattern: "(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/.*)?)")(path) self.path = path self.recursive = recursive @@ -3308,86 +4190,121 @@ open class Files { self.includeDeleted = includeDeleted self.includeHasExplicitSharedMembers = includeHasExplicitSharedMembers self.includeMountedFolders = includeMountedFolders - nullableValidator(comparableValidator(minValue: 1, maxValue: 2000))(limit) + nullableValidator(comparableValidator(minValue: 1, maxValue: 2_000))(limit) self.limit = limit self.sharedLink = sharedLink self.includePropertyGroups = includePropertyGroups self.includeNonDownloadableFiles = includeNonDownloadableFiles } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderArgSerializer().serialize(self)))" - } - } - open class ListFolderArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "recursive": Serialization._BoolSerializer.serialize(value.recursive), - "include_media_info": Serialization._BoolSerializer.serialize(value.includeMediaInfo), - "include_deleted": Serialization._BoolSerializer.serialize(value.includeDeleted), - "include_has_explicit_shared_members": Serialization._BoolSerializer.serialize(value.includeHasExplicitSharedMembers), - "include_mounted_folders": Serialization._BoolSerializer.serialize(value.includeMountedFolders), - "limit": NullableSerializer(Serialization._UInt32Serializer).serialize(value.limit), - "shared_link": NullableSerializer(Files.SharedLinkSerializer()).serialize(value.sharedLink), - "include_property_groups": NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).serialize(value.includePropertyGroups), - "include_non_downloadable_files": Serialization._BoolSerializer.serialize(value.includeNonDownloadableFiles), + + func json() throws -> JSON { + try ListFolderArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderArg: \(error)" + } + } + } + + public class ListFolderArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "recursive": try Serialization._BoolSerializer.serialize(value.recursive), + "include_media_info": try Serialization._BoolSerializer.serialize(value.includeMediaInfo), + "include_deleted": try Serialization._BoolSerializer.serialize(value.includeDeleted), + "include_has_explicit_shared_members": try Serialization._BoolSerializer.serialize(value.includeHasExplicitSharedMembers), + "include_mounted_folders": try Serialization._BoolSerializer.serialize(value.includeMountedFolders), + "limit": try NullableSerializer(Serialization._UInt32Serializer).serialize(value.limit), + "shared_link": try NullableSerializer(Files.SharedLinkSerializer()).serialize(value.sharedLink), + "include_property_groups": try NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).serialize(value.includePropertyGroups), + "include_non_downloadable_files": try Serialization._BoolSerializer.serialize(value.includeNonDownloadableFiles), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderArg { - switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let recursive = Serialization._BoolSerializer.deserialize(dict["recursive"] ?? .number(0)) - let includeMediaInfo = Serialization._BoolSerializer.deserialize(dict["include_media_info"] ?? .number(0)) - let includeDeleted = Serialization._BoolSerializer.deserialize(dict["include_deleted"] ?? .number(0)) - let includeHasExplicitSharedMembers = Serialization._BoolSerializer.deserialize(dict["include_has_explicit_shared_members"] ?? .number(0)) - let includeMountedFolders = Serialization._BoolSerializer.deserialize(dict["include_mounted_folders"] ?? .number(1)) - let limit = NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["limit"] ?? .null) - let sharedLink = NullableSerializer(Files.SharedLinkSerializer()).deserialize(dict["shared_link"] ?? .null) - let includePropertyGroups = NullableSerializer(FileProperties.TemplateFilterBaseSerializer()).deserialize(dict["include_property_groups"] ?? .null) - let includeNonDownloadableFiles = Serialization._BoolSerializer.deserialize(dict["include_non_downloadable_files"] ?? .number(1)) - return ListFolderArg(path: path, recursive: recursive, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includeMountedFolders: includeMountedFolders, limit: limit, sharedLink: sharedLink, includePropertyGroups: includePropertyGroups, includeNonDownloadableFiles: includeNonDownloadableFiles) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> ListFolderArg { + switch json { + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let recursive = try Serialization._BoolSerializer.deserialize(dict["recursive"] ?? .number(0)) + let includeMediaInfo = try Serialization._BoolSerializer.deserialize(dict["include_media_info"] ?? .number(0)) + let includeDeleted = try Serialization._BoolSerializer.deserialize(dict["include_deleted"] ?? .number(0)) + let includeHasExplicitSharedMembers = try Serialization._BoolSerializer + .deserialize(dict["include_has_explicit_shared_members"] ?? .number(0)) + let includeMountedFolders = try Serialization._BoolSerializer.deserialize(dict["include_mounted_folders"] ?? .number(1)) + let limit = try NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["limit"] ?? .null) + let sharedLink = try NullableSerializer(Files.SharedLinkSerializer()).deserialize(dict["shared_link"] ?? .null) + let includePropertyGroups = try NullableSerializer(FileProperties.TemplateFilterBaseSerializer()) + .deserialize(dict["include_property_groups"] ?? .null) + let includeNonDownloadableFiles = try Serialization._BoolSerializer.deserialize(dict["include_non_downloadable_files"] ?? .number(1)) + return ListFolderArg( + path: path, + recursive: recursive, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includeMountedFolders: includeMountedFolders, + limit: limit, + sharedLink: sharedLink, + includePropertyGroups: includePropertyGroups, + includeNonDownloadableFiles: includeNonDownloadableFiles + ) + default: + throw JSONSerializerError.deserializeError(type: ListFolderArg.self, json: json) } } } /// The ListFolderContinueArg struct - open class ListFolderContinueArg: CustomStringConvertible { + public class ListFolderContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned by your last call to listFolder or listFolderContinue. public let cursor: String public init(cursor: String) { stringValidator(minLength: 1)(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFolderContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderContinueArg: \(error)" + } } } - open class ListFolderContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListFolderContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderContinueArg { + + public func deserialize(_ json: JSON) throws -> ListFolderContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListFolderContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListFolderContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFolderContinueArg.self, json: json) } } } /// The ListFolderContinueError union - public enum ListFolderContinueError: CustomStringConvertible { + public enum ListFolderContinueError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// Indicates that the cursor has been invalidated. Call listFolder to obtain a new cursor. @@ -3395,51 +4312,61 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try ListFolderContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderContinueError: \(error)" + } } } - open class ListFolderContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderContinueError) -> JSON { + + public class ListFolderContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderContinueError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFolderContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return ListFolderContinueError.path(v) - case "reset": - return ListFolderContinueError.reset - case "other": - return ListFolderContinueError.other - default: - return ListFolderContinueError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFolderContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return ListFolderContinueError.path(v) + case "reset": + return ListFolderContinueError.reset + case "other": + return ListFolderContinueError.other default: - fatalError("Failed to deserialize") + return ListFolderContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFolderContinueError.self, json: json) } } } /// The ListFolderError union - public enum ListFolderError: CustomStringConvertible { + public enum ListFolderError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. @@ -3447,89 +4374,110 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try ListFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderError: \(error)" + } } } - open class ListFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderError) -> JSON { + + public class ListFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .templateError(let arg): - var d = ["template_error": FileProperties.TemplateErrorSerializer().serialize(arg)] - d[".tag"] = .str("template_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return ListFolderError.path(v) - case "template_error": - let v = FileProperties.TemplateErrorSerializer().deserialize(d["template_error"] ?? .null) - return ListFolderError.templateError(v) - case "other": - return ListFolderError.other - default: - return ListFolderError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .templateError(let arg): + var d = try ["template_error": FileProperties.TemplateErrorSerializer().serialize(arg)] + d[".tag"] = .str("template_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return ListFolderError.path(v) + case "template_error": + let v = try FileProperties.TemplateErrorSerializer().deserialize(d["template_error"] ?? .null) + return ListFolderError.templateError(v) + case "other": + return ListFolderError.other default: - fatalError("Failed to deserialize") + return ListFolderError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFolderError.self, json: json) } } } /// The ListFolderGetLatestCursorResult struct - open class ListFolderGetLatestCursorResult: CustomStringConvertible { + public class ListFolderGetLatestCursorResult: CustomStringConvertible, JSONRepresentable { /// Pass the cursor into listFolderContinue to see what's changed in the folder since your previous query. public let cursor: String public init(cursor: String) { stringValidator(minLength: 1)(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderGetLatestCursorResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFolderGetLatestCursorResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderGetLatestCursorResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderGetLatestCursorResult: \(error)" + } } } - open class ListFolderGetLatestCursorResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderGetLatestCursorResult) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListFolderGetLatestCursorResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderGetLatestCursorResult) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderGetLatestCursorResult { + + public func deserialize(_ json: JSON) throws -> ListFolderGetLatestCursorResult { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListFolderGetLatestCursorResult(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListFolderGetLatestCursorResult(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFolderGetLatestCursorResult.self, json: json) } } } /// The ListFolderLongpollArg struct - open class ListFolderLongpollArg: CustomStringConvertible { + public class ListFolderLongpollArg: CustomStringConvertible, JSONRepresentable { /// A cursor as returned by listFolder or listFolderContinue. Cursors retrieved by setting includeMediaInfo in /// ListFolderArg to true are not supported. public let cursor: String /// A timeout in seconds. The request will block for at most this length of time, plus up to 90 seconds of - /// random jitter added to avoid the thundering herd problem. Care should be taken when using this parameter, as - /// some network infrastructure does not support long timeouts. + /// random jitter added to avoid the thundering herd problem. Care should be taken when using this + /// parameter, as some network infrastructure does not support long timeouts. public let timeout: UInt64 public init(cursor: String, timeout: UInt64 = 30) { stringValidator(minLength: 1)(cursor) @@ -3537,76 +4485,97 @@ open class Files { comparableValidator(minValue: 30, maxValue: 480)(timeout) self.timeout = timeout } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderLongpollArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFolderLongpollArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderLongpollArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderLongpollArg: \(error)" + } } } - open class ListFolderLongpollArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderLongpollArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "timeout": Serialization._UInt64Serializer.serialize(value.timeout), + + public class ListFolderLongpollArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderLongpollArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "timeout": try Serialization._UInt64Serializer.serialize(value.timeout), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderLongpollArg { + + public func deserialize(_ json: JSON) throws -> ListFolderLongpollArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let timeout = Serialization._UInt64Serializer.deserialize(dict["timeout"] ?? .number(30)) - return ListFolderLongpollArg(cursor: cursor, timeout: timeout) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let timeout = try Serialization._UInt64Serializer.deserialize(dict["timeout"] ?? .number(30)) + return ListFolderLongpollArg(cursor: cursor, timeout: timeout) + default: + throw JSONSerializerError.deserializeError(type: ListFolderLongpollArg.self, json: json) } } } /// The ListFolderLongpollError union - public enum ListFolderLongpollError: CustomStringConvertible { + public enum ListFolderLongpollError: CustomStringConvertible, JSONRepresentable { /// Indicates that the cursor has been invalidated. Call listFolder to obtain a new cursor. case reset /// An unspecified error. case other + func json() throws -> JSON { + try ListFolderLongpollErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderLongpollErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderLongpollErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderLongpollError: \(error)" + } } } - open class ListFolderLongpollErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderLongpollError) -> JSON { + + public class ListFolderLongpollErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderLongpollError) throws -> JSON { switch value { - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFolderLongpollError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "reset": - return ListFolderLongpollError.reset - case "other": - return ListFolderLongpollError.other - default: - return ListFolderLongpollError.other - } + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFolderLongpollError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "reset": + return ListFolderLongpollError.reset + case "other": + return ListFolderLongpollError.other default: - fatalError("Failed to deserialize") + return ListFolderLongpollError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFolderLongpollError.self, json: json) } } } /// The ListFolderLongpollResult struct - open class ListFolderLongpollResult: CustomStringConvertible { + public class ListFolderLongpollResult: CustomStringConvertible, JSONRepresentable { /// Indicates whether new changes are available. If true, call listFolderContinue to retrieve the changes. public let changes: Bool /// If present, backoff for at least this many seconds before calling listFolderLongpoll again. @@ -3616,74 +4585,96 @@ open class Files { nullableValidator(comparableValidator())(backoff) self.backoff = backoff } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderLongpollResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFolderLongpollResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderLongpollResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderLongpollResult: \(error)" + } } } - open class ListFolderLongpollResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderLongpollResult) -> JSON { - let output = [ - "changes": Serialization._BoolSerializer.serialize(value.changes), - "backoff": NullableSerializer(Serialization._UInt64Serializer).serialize(value.backoff), + + public class ListFolderLongpollResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderLongpollResult) throws -> JSON { + let output = [ + "changes": try Serialization._BoolSerializer.serialize(value.changes), + "backoff": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.backoff), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderLongpollResult { + + public func deserialize(_ json: JSON) throws -> ListFolderLongpollResult { switch json { - case .dictionary(let dict): - let changes = Serialization._BoolSerializer.deserialize(dict["changes"] ?? .null) - let backoff = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["backoff"] ?? .null) - return ListFolderLongpollResult(changes: changes, backoff: backoff) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let changes = try Serialization._BoolSerializer.deserialize(dict["changes"] ?? .null) + let backoff = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["backoff"] ?? .null) + return ListFolderLongpollResult(changes: changes, backoff: backoff) + default: + throw JSONSerializerError.deserializeError(type: ListFolderLongpollResult.self, json: json) } } } /// The ListFolderResult struct - open class ListFolderResult: CustomStringConvertible { + public class ListFolderResult: CustomStringConvertible, JSONRepresentable { /// The files and (direct) subfolders in the folder. - public let entries: Array + public let entries: [Files.Metadata] /// Pass the cursor into listFolderContinue to see what's changed in the folder since your previous query. public let cursor: String /// If true, then there are more entries available. Pass the cursor to listFolderContinue to retrieve the rest. public let hasMore: Bool - public init(entries: Array, cursor: String, hasMore: Bool) { + public init(entries: [Files.Metadata], cursor: String, hasMore: Bool) { self.entries = entries stringValidator(minLength: 1)(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFolderResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderResult: \(error)" + } } } - open class ListFolderResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderResult) -> JSON { - let output = [ - "entries": ArraySerializer(Files.MetadataSerializer()).serialize(value.entries), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class ListFolderResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.MetadataSerializer()).serialize(value.entries), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderResult { + + public func deserialize(_ json: JSON) throws -> ListFolderResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.MetadataSerializer()).deserialize(dict["entries"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return ListFolderResult(entries: entries, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.MetadataSerializer()).deserialize(dict["entries"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return ListFolderResult(entries: entries, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: ListFolderResult.self, json: json) } } } /// The ListRevisionsArg struct - open class ListRevisionsArg: CustomStringConvertible { + public class ListRevisionsArg: CustomStringConvertible, JSONRepresentable { /// The path to the file you want to see the revisions of. public let path: String /// Determines the behavior of the API in listing the revisions for a given file path or id. @@ -3697,79 +4688,100 @@ open class Files { comparableValidator(minValue: 1, maxValue: 100)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListRevisionsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListRevisionsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListRevisionsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListRevisionsArg: \(error)" + } } } - open class ListRevisionsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListRevisionsArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "mode": Files.ListRevisionsModeSerializer().serialize(value.mode), - "limit": Serialization._UInt64Serializer.serialize(value.limit), + + public class ListRevisionsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListRevisionsArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "mode": try Files.ListRevisionsModeSerializer().serialize(value.mode), + "limit": try Serialization._UInt64Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListRevisionsArg { + + public func deserialize(_ json: JSON) throws -> ListRevisionsArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let mode = Files.ListRevisionsModeSerializer().deserialize(dict["mode"] ?? Files.ListRevisionsModeSerializer().serialize(.path)) - let limit = Serialization._UInt64Serializer.deserialize(dict["limit"] ?? .number(10)) - return ListRevisionsArg(path: path, mode: mode, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let mode = try Files.ListRevisionsModeSerializer().deserialize(dict["mode"] ?? Files.ListRevisionsModeSerializer().serialize(.path)) + let limit = try Serialization._UInt64Serializer.deserialize(dict["limit"] ?? .number(10)) + return ListRevisionsArg(path: path, mode: mode, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListRevisionsArg.self, json: json) } } } /// The ListRevisionsError union - public enum ListRevisionsError: CustomStringConvertible { + public enum ListRevisionsError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. case other + func json() throws -> JSON { + try ListRevisionsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListRevisionsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListRevisionsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListRevisionsError: \(error)" + } } } - open class ListRevisionsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListRevisionsError) -> JSON { + + public class ListRevisionsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListRevisionsError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListRevisionsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return ListRevisionsError.path(v) - case "other": - return ListRevisionsError.other - default: - return ListRevisionsError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListRevisionsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return ListRevisionsError.path(v) + case "other": + return ListRevisionsError.other default: - fatalError("Failed to deserialize") + return ListRevisionsError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListRevisionsError.self, json: json) } } } /// The ListRevisionsMode union - public enum ListRevisionsMode: CustomStringConvertible { + public enum ListRevisionsMode: CustomStringConvertible, JSONRepresentable { /// Returns revisions with the same file path as identified by the latest file entry at the given file path or /// id. case path @@ -3778,214 +4790,275 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try ListRevisionsModeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListRevisionsModeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListRevisionsModeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListRevisionsMode: \(error)" + } } } - open class ListRevisionsModeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListRevisionsMode) -> JSON { + + public class ListRevisionsModeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListRevisionsMode) throws -> JSON { switch value { - case .path: - var d = [String: JSON]() - d[".tag"] = .str("path") - return .dictionary(d) - case .id: - var d = [String: JSON]() - d[".tag"] = .str("id") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListRevisionsMode { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - return ListRevisionsMode.path - case "id": - return ListRevisionsMode.id - case "other": - return ListRevisionsMode.other - default: - return ListRevisionsMode.other - } + case .path: + var d = [String: JSON]() + d[".tag"] = .str("path") + return .dictionary(d) + case .id: + var d = [String: JSON]() + d[".tag"] = .str("id") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListRevisionsMode { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + return ListRevisionsMode.path + case "id": + return ListRevisionsMode.id + case "other": + return ListRevisionsMode.other default: - fatalError("Failed to deserialize") + return ListRevisionsMode.other + } + default: + throw JSONSerializerError.deserializeError(type: ListRevisionsMode.self, json: json) } } } /// The ListRevisionsResult struct - open class ListRevisionsResult: CustomStringConvertible { + public class ListRevisionsResult: CustomStringConvertible, JSONRepresentable { /// If the file identified by the latest revision in the response is either deleted or moved. public let isDeleted: Bool /// The time of deletion if the file was deleted. public let serverDeleted: Date? /// The revisions for the file. Only revisions that are not deleted will show up here. - public let entries: Array - public init(isDeleted: Bool, entries: Array, serverDeleted: Date? = nil) { + public let entries: [Files.FileMetadata] + public init(isDeleted: Bool, entries: [Files.FileMetadata], serverDeleted: Date? = nil) { self.isDeleted = isDeleted self.serverDeleted = serverDeleted self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListRevisionsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListRevisionsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListRevisionsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListRevisionsResult: \(error)" + } } } - open class ListRevisionsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListRevisionsResult) -> JSON { - let output = [ - "is_deleted": Serialization._BoolSerializer.serialize(value.isDeleted), - "entries": ArraySerializer(Files.FileMetadataSerializer()).serialize(value.entries), - "server_deleted": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.serverDeleted), + + public class ListRevisionsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListRevisionsResult) throws -> JSON { + let output = [ + "is_deleted": try Serialization._BoolSerializer.serialize(value.isDeleted), + "entries": try ArraySerializer(Files.FileMetadataSerializer()).serialize(value.entries), + "server_deleted": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.serverDeleted), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListRevisionsResult { + + public func deserialize(_ json: JSON) throws -> ListRevisionsResult { switch json { - case .dictionary(let dict): - let isDeleted = Serialization._BoolSerializer.deserialize(dict["is_deleted"] ?? .null) - let entries = ArraySerializer(Files.FileMetadataSerializer()).deserialize(dict["entries"] ?? .null) - let serverDeleted = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["server_deleted"] ?? .null) - return ListRevisionsResult(isDeleted: isDeleted, entries: entries, serverDeleted: serverDeleted) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isDeleted = try Serialization._BoolSerializer.deserialize(dict["is_deleted"] ?? .null) + let entries = try ArraySerializer(Files.FileMetadataSerializer()).deserialize(dict["entries"] ?? .null) + let serverDeleted = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["server_deleted"] ?? .null) + return ListRevisionsResult(isDeleted: isDeleted, entries: entries, serverDeleted: serverDeleted) + default: + throw JSONSerializerError.deserializeError(type: ListRevisionsResult.self, json: json) } } } /// The LockConflictError struct - open class LockConflictError: CustomStringConvertible { + public class LockConflictError: CustomStringConvertible, JSONRepresentable { /// The lock that caused the conflict. public let lock: Files.FileLock public init(lock: Files.FileLock) { self.lock = lock } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockConflictErrorSerializer().serialize(self)))" + + func json() throws -> JSON { + try LockConflictErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockConflictErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockConflictError: \(error)" + } } } - open class LockConflictErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockConflictError) -> JSON { - let output = [ - "lock": Files.FileLockSerializer().serialize(value.lock), + + public class LockConflictErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockConflictError) throws -> JSON { + let output = [ + "lock": try Files.FileLockSerializer().serialize(value.lock), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LockConflictError { + + public func deserialize(_ json: JSON) throws -> LockConflictError { switch json { - case .dictionary(let dict): - let lock = Files.FileLockSerializer().deserialize(dict["lock"] ?? .null) - return LockConflictError(lock: lock) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let lock = try Files.FileLockSerializer().deserialize(dict["lock"] ?? .null) + return LockConflictError(lock: lock) + default: + throw JSONSerializerError.deserializeError(type: LockConflictError.self, json: json) } } } /// The LockFileArg struct - open class LockFileArg: CustomStringConvertible { + public class LockFileArg: CustomStringConvertible, JSONRepresentable { /// Path in the user's Dropbox to a file. public let path: String public init(path: String) { stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)")(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockFileArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LockFileArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockFileArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockFileArg: \(error)" + } } } - open class LockFileArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockFileArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), + + public class LockFileArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockFileArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LockFileArg { + + public func deserialize(_ json: JSON) throws -> LockFileArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - return LockFileArg(path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + return LockFileArg(path: path) + default: + throw JSONSerializerError.deserializeError(type: LockFileArg.self, json: json) } } } /// The LockFileBatchArg struct - open class LockFileBatchArg: CustomStringConvertible { + public class LockFileBatchArg: CustomStringConvertible, JSONRepresentable { /// List of 'entries'. Each 'entry' contains a path of the file which will be locked or queried. Duplicate path /// arguments in the batch are considered only once. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.LockFileArg] + public init(entries: [Files.LockFileArg]) { self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockFileBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LockFileBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockFileBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockFileBatchArg: \(error)" + } } } - open class LockFileBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockFileBatchArg) -> JSON { - let output = [ - "entries": ArraySerializer(Files.LockFileArgSerializer()).serialize(value.entries), + + public class LockFileBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockFileBatchArg) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.LockFileArgSerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LockFileBatchArg { + + public func deserialize(_ json: JSON) throws -> LockFileBatchArg { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.LockFileArgSerializer()).deserialize(dict["entries"] ?? .null) - return LockFileBatchArg(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.LockFileArgSerializer()).deserialize(dict["entries"] ?? .null) + return LockFileBatchArg(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: LockFileBatchArg.self, json: json) } } } /// The LockFileBatchResult struct - open class LockFileBatchResult: Files.FileOpsResult { + public class LockFileBatchResult: Files.FileOpsResult { /// Each Entry in the 'entries' will have '.tag' with the operation status (e.g. success), the metadata for the /// file and the lock state after the operation. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.LockFileResultEntry] + public init(entries: [Files.LockFileResultEntry]) { self.entries = entries super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockFileBatchResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockFileBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockFileBatchResult: \(error)" + } } } - open class LockFileBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockFileBatchResult) -> JSON { - let output = [ - "entries": ArraySerializer(Files.LockFileResultEntrySerializer()).serialize(value.entries), + + public class LockFileBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockFileBatchResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.LockFileResultEntrySerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LockFileBatchResult { + + public func deserialize(_ json: JSON) throws -> LockFileBatchResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.LockFileResultEntrySerializer()).deserialize(dict["entries"] ?? .null) - return LockFileBatchResult(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.LockFileResultEntrySerializer()).deserialize(dict["entries"] ?? .null) + return LockFileBatchResult(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: LockFileBatchResult.self, json: json) } } } /// The LockFileError union - public enum LockFileError: CustomStringConvertible { + public enum LockFileError: CustomStringConvertible, JSONRepresentable { /// Could not find the specified resource. case pathLookup(Files.LookupError) /// There are too many write operations in user's Dropbox. Please retry this request. @@ -4006,88 +5079,98 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try LockFileErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockFileErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockFileErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockFileError: \(error)" + } } } - open class LockFileErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockFileError) -> JSON { + + public class LockFileErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockFileError) throws -> JSON { switch value { - case .pathLookup(let arg): - var d = ["path_lookup": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path_lookup") - return .dictionary(d) - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .noWritePermission: - var d = [String: JSON]() - d[".tag"] = .str("no_write_permission") - return .dictionary(d) - case .cannotBeLocked: - var d = [String: JSON]() - d[".tag"] = .str("cannot_be_locked") - return .dictionary(d) - case .fileNotShared: - var d = [String: JSON]() - d[".tag"] = .str("file_not_shared") - return .dictionary(d) - case .lockConflict(let arg): - var d = Serialization.getFields(Files.LockConflictErrorSerializer().serialize(arg)) - d[".tag"] = .str("lock_conflict") - return .dictionary(d) - case .internalError: - var d = [String: JSON]() - d[".tag"] = .str("internal_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LockFileError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path_lookup": - let v = Files.LookupErrorSerializer().deserialize(d["path_lookup"] ?? .null) - return LockFileError.pathLookup(v) - case "too_many_write_operations": - return LockFileError.tooManyWriteOperations - case "too_many_files": - return LockFileError.tooManyFiles - case "no_write_permission": - return LockFileError.noWritePermission - case "cannot_be_locked": - return LockFileError.cannotBeLocked - case "file_not_shared": - return LockFileError.fileNotShared - case "lock_conflict": - let v = Files.LockConflictErrorSerializer().deserialize(json) - return LockFileError.lockConflict(v) - case "internal_error": - return LockFileError.internalError - case "other": - return LockFileError.other - default: - return LockFileError.other - } - default: - fatalError("Failed to deserialize") + case .pathLookup(let arg): + var d = try ["path_lookup": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path_lookup") + return .dictionary(d) + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .noWritePermission: + var d = [String: JSON]() + d[".tag"] = .str("no_write_permission") + return .dictionary(d) + case .cannotBeLocked: + var d = [String: JSON]() + d[".tag"] = .str("cannot_be_locked") + return .dictionary(d) + case .fileNotShared: + var d = [String: JSON]() + d[".tag"] = .str("file_not_shared") + return .dictionary(d) + case .lockConflict(let arg): + var d = try Serialization.getFields(Files.LockConflictErrorSerializer().serialize(arg)) + d[".tag"] = .str("lock_conflict") + return .dictionary(d) + case .internalError: + var d = [String: JSON]() + d[".tag"] = .str("internal_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LockFileError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path_lookup": + let v = try Files.LookupErrorSerializer().deserialize(d["path_lookup"] ?? .null) + return LockFileError.pathLookup(v) + case "too_many_write_operations": + return LockFileError.tooManyWriteOperations + case "too_many_files": + return LockFileError.tooManyFiles + case "no_write_permission": + return LockFileError.noWritePermission + case "cannot_be_locked": + return LockFileError.cannotBeLocked + case "file_not_shared": + return LockFileError.fileNotShared + case "lock_conflict": + let v = try Files.LockConflictErrorSerializer().deserialize(json) + return LockFileError.lockConflict(v) + case "internal_error": + return LockFileError.internalError + case "other": + return LockFileError.other + default: + return LockFileError.other + } + default: + throw JSONSerializerError.deserializeError(type: LockFileError.self, json: json) } } } /// The LockFileResult struct - open class LockFileResult: CustomStringConvertible { + public class LockFileResult: CustomStringConvertible, JSONRepresentable { /// Metadata of the file. public let metadata: Files.Metadata /// The file lock state after the operation. @@ -4096,80 +5179,102 @@ open class Files { self.metadata = metadata self.lock = lock } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockFileResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try LockFileResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockFileResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockFileResult: \(error)" + } } } - open class LockFileResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockFileResult) -> JSON { - let output = [ - "metadata": Files.MetadataSerializer().serialize(value.metadata), - "lock": Files.FileLockSerializer().serialize(value.lock), + + public class LockFileResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockFileResult) throws -> JSON { + let output = [ + "metadata": try Files.MetadataSerializer().serialize(value.metadata), + "lock": try Files.FileLockSerializer().serialize(value.lock), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LockFileResult { + + public func deserialize(_ json: JSON) throws -> LockFileResult { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - let lock = Files.FileLockSerializer().deserialize(dict["lock"] ?? .null) - return LockFileResult(metadata: metadata, lock: lock) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + let lock = try Files.FileLockSerializer().deserialize(dict["lock"] ?? .null) + return LockFileResult(metadata: metadata, lock: lock) + default: + throw JSONSerializerError.deserializeError(type: LockFileResult.self, json: json) } } } /// The LockFileResultEntry union - public enum LockFileResultEntry: CustomStringConvertible { + public enum LockFileResultEntry: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case success(Files.LockFileResult) /// An unspecified error. case failure(Files.LockFileError) + func json() throws -> JSON { + try LockFileResultEntrySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockFileResultEntrySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockFileResultEntrySerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockFileResultEntry: \(error)" + } } } - open class LockFileResultEntrySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockFileResultEntry) -> JSON { + + public class LockFileResultEntrySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockFileResultEntry) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Files.LockFileResultSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .failure(let arg): - var d = ["failure": Files.LockFileErrorSerializer().serialize(arg)] - d[".tag"] = .str("failure") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LockFileResultEntry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Files.LockFileResultSerializer().deserialize(json) - return LockFileResultEntry.success(v) - case "failure": - let v = Files.LockFileErrorSerializer().deserialize(d["failure"] ?? .null) - return LockFileResultEntry.failure(v) - default: - fatalError("Unknown tag \(tag)") - } + case .success(let arg): + var d = try Serialization.getFields(Files.LockFileResultSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .failure(let arg): + var d = try ["failure": Files.LockFileErrorSerializer().serialize(arg)] + d[".tag"] = .str("failure") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LockFileResultEntry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Files.LockFileResultSerializer().deserialize(json) + return LockFileResultEntry.success(v) + case "failure": + let v = try Files.LockFileErrorSerializer().deserialize(d["failure"] ?? .null) + return LockFileResultEntry.failure(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: LockFileResultEntry.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LockFileResultEntry.self, json: json) } } } /// The LookupError union - public enum LookupError: CustomStringConvertible { + public enum LookupError: CustomStringConvertible, JSONRepresentable { /// The given path does not satisfy the required path format. Please refer to the Path formats documentation - /// https://www.dropbox.com/developers/documentation/http/documentation#path-formats for more information. + /// https://www.dropbox.com/developers/documentation/http/documentation#path-formats for more + /// information. case malformedPath(String?) /// There is nothing at the given path. case notFound @@ -4187,125 +5292,145 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try LookupErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LookupErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LookupErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LookupError: \(error)" + } } } - open class LookupErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LookupError) -> JSON { + + public class LookupErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LookupError) throws -> JSON { switch value { - case .malformedPath(let arg): - var d = ["malformed_path": NullableSerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("malformed_path") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .notFile: - var d = [String: JSON]() - d[".tag"] = .str("not_file") - return .dictionary(d) - case .notFolder: - var d = [String: JSON]() - d[".tag"] = .str("not_folder") - return .dictionary(d) - case .restrictedContent: - var d = [String: JSON]() - d[".tag"] = .str("restricted_content") - return .dictionary(d) - case .unsupportedContentType: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_content_type") - return .dictionary(d) - case .locked: - var d = [String: JSON]() - d[".tag"] = .str("locked") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LookupError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "malformed_path": - let v = NullableSerializer(Serialization._StringSerializer).deserialize(d["malformed_path"] ?? .null) - return LookupError.malformedPath(v) - case "not_found": - return LookupError.notFound - case "not_file": - return LookupError.notFile - case "not_folder": - return LookupError.notFolder - case "restricted_content": - return LookupError.restrictedContent - case "unsupported_content_type": - return LookupError.unsupportedContentType - case "locked": - return LookupError.locked - case "other": - return LookupError.other - default: - return LookupError.other - } - default: - fatalError("Failed to deserialize") + case .malformedPath(let arg): + var d = try ["malformed_path": NullableSerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("malformed_path") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .notFile: + var d = [String: JSON]() + d[".tag"] = .str("not_file") + return .dictionary(d) + case .notFolder: + var d = [String: JSON]() + d[".tag"] = .str("not_folder") + return .dictionary(d) + case .restrictedContent: + var d = [String: JSON]() + d[".tag"] = .str("restricted_content") + return .dictionary(d) + case .unsupportedContentType: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_content_type") + return .dictionary(d) + case .locked: + var d = [String: JSON]() + d[".tag"] = .str("locked") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LookupError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "malformed_path": + let v = try NullableSerializer(Serialization._StringSerializer).deserialize(d["malformed_path"] ?? .null) + return LookupError.malformedPath(v) + case "not_found": + return LookupError.notFound + case "not_file": + return LookupError.notFile + case "not_folder": + return LookupError.notFolder + case "restricted_content": + return LookupError.restrictedContent + case "unsupported_content_type": + return LookupError.unsupportedContentType + case "locked": + return LookupError.locked + case "other": + return LookupError.other + default: + return LookupError.other + } + default: + throw JSONSerializerError.deserializeError(type: LookupError.self, json: json) } } } /// The MediaInfo union - public enum MediaInfo: CustomStringConvertible { + public enum MediaInfo: CustomStringConvertible, JSONRepresentable { /// Indicate the photo/video is still under processing and metadata is not available yet. case pending /// The metadata for the photo/video. case metadata(Files.MediaMetadata) + func json() throws -> JSON { + try MediaInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MediaInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MediaInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MediaInfo: \(error)" + } } } - open class MediaInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MediaInfo) -> JSON { + + public class MediaInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MediaInfo) throws -> JSON { switch value { - case .pending: - var d = [String: JSON]() - d[".tag"] = .str("pending") - return .dictionary(d) - case .metadata(let arg): - var d = ["metadata": Files.MediaMetadataSerializer().serialize(arg)] - d[".tag"] = .str("metadata") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MediaInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "pending": - return MediaInfo.pending - case "metadata": - let v = Files.MediaMetadataSerializer().deserialize(d["metadata"] ?? .null) - return MediaInfo.metadata(v) - default: - fatalError("Unknown tag \(tag)") - } + case .pending: + var d = [String: JSON]() + d[".tag"] = .str("pending") + return .dictionary(d) + case .metadata(let arg): + var d = try ["metadata": Files.MediaMetadataSerializer().serialize(arg)] + d[".tag"] = .str("metadata") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MediaInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "pending": + return MediaInfo.pending + case "metadata": + let v = try Files.MediaMetadataSerializer().deserialize(d["metadata"] ?? .null) + return MediaInfo.metadata(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: MediaInfo.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MediaInfo.self, json: json) } } } /// Metadata for a photo or video. - open class MediaMetadata: CustomStringConvertible { + public class MediaMetadata: CustomStringConvertible, JSONRepresentable { /// Dimension of the photo/video. public let dimensions: Files.Dimensions? /// The GPS coordinate of the photo/video. @@ -4317,97 +5442,119 @@ open class Files { self.location = location self.timeTaken = timeTaken } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MediaMetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try MediaMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MediaMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MediaMetadata: \(error)" + } } } - open class MediaMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MediaMetadata) -> JSON { - var output = [ - "dimensions": NullableSerializer(Files.DimensionsSerializer()).serialize(value.dimensions), - "location": NullableSerializer(Files.GpsCoordinatesSerializer()).serialize(value.location), - "time_taken": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeTaken), + + public class MediaMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MediaMetadata) throws -> JSON { + var output = [ + "dimensions": try NullableSerializer(Files.DimensionsSerializer()).serialize(value.dimensions), + "location": try NullableSerializer(Files.GpsCoordinatesSerializer()).serialize(value.location), + "time_taken": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeTaken), ] switch value { - case let photo as Files.PhotoMetadata: - for (k, v) in Serialization.getFields(Files.PhotoMetadataSerializer().serialize(photo)) { - output[k] = v - } - output[".tag"] = .str("photo") - case let video as Files.VideoMetadata: - for (k, v) in Serialization.getFields(Files.VideoMetadataSerializer().serialize(video)) { - output[k] = v - } - output[".tag"] = .str("video") - default: fatalError("Tried to serialize unexpected subtype") + case let photo as Files.PhotoMetadata: + for (k, v) in try Serialization.getFields(Files.PhotoMetadataSerializer().serialize(photo)) { + output[k] = v + } + output[".tag"] = .str("photo") + case let video as Files.VideoMetadata: + for (k, v) in try Serialization.getFields(Files.VideoMetadataSerializer().serialize(video)) { + output[k] = v + } + output[".tag"] = .str("video") + default: + throw JSONSerializerError.unexpectedSubtype(type: MediaMetadata.self, subtype: value) } return .dictionary(output) } - open func deserialize(_ json: JSON) -> MediaMetadata { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "photo": - return Files.PhotoMetadataSerializer().deserialize(json) - case "video": - return Files.VideoMetadataSerializer().deserialize(json) - default: - fatalError("Unknown tag \(tag)") - } + + public func deserialize(_ json: JSON) throws -> MediaMetadata { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "photo": + return try Files.PhotoMetadataSerializer().deserialize(json) + case "video": + return try Files.VideoMetadataSerializer().deserialize(json) default: - fatalError("Type error deserializing") + throw JSONSerializerError.unknownTag(type: MediaMetadata.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MediaMetadata.self, json: json) } } } /// Metadata for a file, folder or other resource types. - public enum MetadataV2: CustomStringConvertible { + public enum MetadataV2: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case metadata(Files.Metadata) /// An unspecified error. case other + func json() throws -> JSON { + try MetadataV2Serializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MetadataV2Serializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MetadataV2Serializer().serialize(self)))" + } catch { + return "Failed to generate description for MetadataV2: \(error)" + } } } - open class MetadataV2Serializer: JSONSerializer { - public init() { } - open func serialize(_ value: MetadataV2) -> JSON { + + public class MetadataV2Serializer: JSONSerializer { + public init() {} + public func serialize(_ value: MetadataV2) throws -> JSON { switch value { - case .metadata(let arg): - var d = ["metadata": Files.MetadataSerializer().serialize(arg)] - d[".tag"] = .str("metadata") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MetadataV2 { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "metadata": - let v = Files.MetadataSerializer().deserialize(d["metadata"] ?? .null) - return MetadataV2.metadata(v) - case "other": - return MetadataV2.other - default: - return MetadataV2.other - } + case .metadata(let arg): + var d = try ["metadata": Files.MetadataSerializer().serialize(arg)] + d[".tag"] = .str("metadata") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MetadataV2 { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "metadata": + let v = try Files.MetadataSerializer().deserialize(d["metadata"] ?? .null) + return MetadataV2.metadata(v) + case "other": + return MetadataV2.other default: - fatalError("Failed to deserialize") + return MetadataV2.other + } + default: + throw JSONSerializerError.deserializeError(type: MetadataV2.self, json: json) } } } /// The MinimalFileLinkMetadata struct - open class MinimalFileLinkMetadata: CustomStringConvertible { + public class MinimalFileLinkMetadata: CustomStringConvertible, JSONRepresentable { /// URL of the shared link. public let url: String /// Unique identifier for the linked file. @@ -4428,195 +5575,244 @@ open class Files { stringValidator(minLength: 9, pattern: "[0-9a-f]+")(rev) self.rev = rev } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MinimalFileLinkMetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try MinimalFileLinkMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MinimalFileLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MinimalFileLinkMetadata: \(error)" + } } } - open class MinimalFileLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MinimalFileLinkMetadata) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "rev": Serialization._StringSerializer.serialize(value.rev), - "id": NullableSerializer(Serialization._StringSerializer).serialize(value.id), - "path": NullableSerializer(Serialization._StringSerializer).serialize(value.path), + + public class MinimalFileLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MinimalFileLinkMetadata) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "rev": try Serialization._StringSerializer.serialize(value.rev), + "id": try NullableSerializer(Serialization._StringSerializer).serialize(value.id), + "path": try NullableSerializer(Serialization._StringSerializer).serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MinimalFileLinkMetadata { + + public func deserialize(_ json: JSON) throws -> MinimalFileLinkMetadata { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let rev = Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) - let id = NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) - let path = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) - return MinimalFileLinkMetadata(url: url, rev: rev, id: id, path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let rev = try Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) + let id = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) + let path = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) + return MinimalFileLinkMetadata(url: url, rev: rev, id: id, path: path) + default: + throw JSONSerializerError.deserializeError(type: MinimalFileLinkMetadata.self, json: json) } } } /// The RelocationBatchArgBase struct - open class RelocationBatchArgBase: CustomStringConvertible { + public class RelocationBatchArgBase: CustomStringConvertible, JSONRepresentable { /// List of entries to be moved or copied. Each entry is RelocationPath. - public let entries: Array + public let entries: [Files.RelocationPath] /// If there's a conflict with any file, have the Dropbox server try to autorename that file to avoid the /// conflict. public let autorename: Bool - public init(entries: Array, autorename: Bool = false) { + public init(entries: [Files.RelocationPath], autorename: Bool = false) { self.entries = entries self.autorename = autorename } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchArgBaseSerializer().serialize(self)))" + + func json() throws -> JSON { + try RelocationBatchArgBaseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchArgBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchArgBase: \(error)" + } } } - open class RelocationBatchArgBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchArgBase) -> JSON { - let output = [ - "entries": ArraySerializer(Files.RelocationPathSerializer()).serialize(value.entries), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), + + public class RelocationBatchArgBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchArgBase) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.RelocationPathSerializer()).serialize(value.entries), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationBatchArgBase { + + public func deserialize(_ json: JSON) throws -> RelocationBatchArgBase { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.RelocationPathSerializer()).deserialize(dict["entries"] ?? .null) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - return RelocationBatchArgBase(entries: entries, autorename: autorename) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.RelocationPathSerializer()).deserialize(dict["entries"] ?? .null) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + return RelocationBatchArgBase(entries: entries, autorename: autorename) + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchArgBase.self, json: json) } } } /// The MoveBatchArg struct - open class MoveBatchArg: Files.RelocationBatchArgBase { + public class MoveBatchArg: Files.RelocationBatchArgBase { /// Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does /// not apply to copies. public let allowOwnershipTransfer: Bool - public init(entries: Array, autorename: Bool = false, allowOwnershipTransfer: Bool = false) { + public init(entries: [Files.RelocationPath], autorename: Bool = false, allowOwnershipTransfer: Bool = false) { self.allowOwnershipTransfer = allowOwnershipTransfer super.init(entries: entries, autorename: autorename) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MoveBatchArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MoveBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MoveBatchArg: \(error)" + } } } - open class MoveBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MoveBatchArg) -> JSON { - let output = [ - "entries": ArraySerializer(Files.RelocationPathSerializer()).serialize(value.entries), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), - "allow_ownership_transfer": Serialization._BoolSerializer.serialize(value.allowOwnershipTransfer), + + public class MoveBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MoveBatchArg) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.RelocationPathSerializer()).serialize(value.entries), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), + "allow_ownership_transfer": try Serialization._BoolSerializer.serialize(value.allowOwnershipTransfer), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MoveBatchArg { + + public func deserialize(_ json: JSON) throws -> MoveBatchArg { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.RelocationPathSerializer()).deserialize(dict["entries"] ?? .null) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - let allowOwnershipTransfer = Serialization._BoolSerializer.deserialize(dict["allow_ownership_transfer"] ?? .number(0)) - return MoveBatchArg(entries: entries, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.RelocationPathSerializer()).deserialize(dict["entries"] ?? .null) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + let allowOwnershipTransfer = try Serialization._BoolSerializer.deserialize(dict["allow_ownership_transfer"] ?? .number(0)) + return MoveBatchArg(entries: entries, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) + default: + throw JSONSerializerError.deserializeError(type: MoveBatchArg.self, json: json) } } } /// The MoveIntoFamilyError union - public enum MoveIntoFamilyError: CustomStringConvertible { + public enum MoveIntoFamilyError: CustomStringConvertible, JSONRepresentable { /// Moving shared folder into Family Room folder is not allowed. case isSharedFolder /// An unspecified error. case other + func json() throws -> JSON { + try MoveIntoFamilyErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MoveIntoFamilyErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MoveIntoFamilyErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MoveIntoFamilyError: \(error)" + } } } - open class MoveIntoFamilyErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MoveIntoFamilyError) -> JSON { + + public class MoveIntoFamilyErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MoveIntoFamilyError) throws -> JSON { switch value { - case .isSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("is_shared_folder") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MoveIntoFamilyError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "is_shared_folder": - return MoveIntoFamilyError.isSharedFolder - case "other": - return MoveIntoFamilyError.other - default: - return MoveIntoFamilyError.other - } + case .isSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("is_shared_folder") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MoveIntoFamilyError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "is_shared_folder": + return MoveIntoFamilyError.isSharedFolder + case "other": + return MoveIntoFamilyError.other default: - fatalError("Failed to deserialize") + return MoveIntoFamilyError.other + } + default: + throw JSONSerializerError.deserializeError(type: MoveIntoFamilyError.self, json: json) } } } /// The MoveIntoVaultError union - public enum MoveIntoVaultError: CustomStringConvertible { + public enum MoveIntoVaultError: CustomStringConvertible, JSONRepresentable { /// Moving shared folder into Vault is not allowed. case isSharedFolder /// An unspecified error. case other + func json() throws -> JSON { + try MoveIntoVaultErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MoveIntoVaultErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MoveIntoVaultErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MoveIntoVaultError: \(error)" + } } } - open class MoveIntoVaultErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MoveIntoVaultError) -> JSON { + + public class MoveIntoVaultErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MoveIntoVaultError) throws -> JSON { switch value { - case .isSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("is_shared_folder") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MoveIntoVaultError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "is_shared_folder": - return MoveIntoVaultError.isSharedFolder - case "other": - return MoveIntoVaultError.other - default: - return MoveIntoVaultError.other - } + case .isSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("is_shared_folder") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MoveIntoVaultError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "is_shared_folder": + return MoveIntoVaultError.isSharedFolder + case "other": + return MoveIntoVaultError.other default: - fatalError("Failed to deserialize") + return MoveIntoVaultError.other + } + default: + throw JSONSerializerError.deserializeError(type: MoveIntoVaultError.self, json: json) } } } /// The PaperContentError union - public enum PaperContentError: CustomStringConvertible { + public enum PaperContentError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to edit Paper docs. case insufficientPermissions /// The provided content was malformed and cannot be imported to Paper. @@ -4629,62 +5825,72 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try PaperContentErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentError: \(error)" + } } } - open class PaperContentErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentError) -> JSON { + + public class PaperContentErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .contentMalformed: - var d = [String: JSON]() - d[".tag"] = .str("content_malformed") - return .dictionary(d) - case .docLengthExceeded: - var d = [String: JSON]() - d[".tag"] = .str("doc_length_exceeded") - return .dictionary(d) - case .imageSizeExceeded: - var d = [String: JSON]() - d[".tag"] = .str("image_size_exceeded") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperContentError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return PaperContentError.insufficientPermissions - case "content_malformed": - return PaperContentError.contentMalformed - case "doc_length_exceeded": - return PaperContentError.docLengthExceeded - case "image_size_exceeded": - return PaperContentError.imageSizeExceeded - case "other": - return PaperContentError.other - default: - return PaperContentError.other - } - default: - fatalError("Failed to deserialize") + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .contentMalformed: + var d = [String: JSON]() + d[".tag"] = .str("content_malformed") + return .dictionary(d) + case .docLengthExceeded: + var d = [String: JSON]() + d[".tag"] = .str("doc_length_exceeded") + return .dictionary(d) + case .imageSizeExceeded: + var d = [String: JSON]() + d[".tag"] = .str("image_size_exceeded") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperContentError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return PaperContentError.insufficientPermissions + case "content_malformed": + return PaperContentError.contentMalformed + case "doc_length_exceeded": + return PaperContentError.docLengthExceeded + case "image_size_exceeded": + return PaperContentError.imageSizeExceeded + case "other": + return PaperContentError.other + default: + return PaperContentError.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperContentError.self, json: json) } } } /// The PaperCreateArg struct - open class PaperCreateArg: CustomStringConvertible { + public class PaperCreateArg: CustomStringConvertible, JSONRepresentable { /// The fully qualified path to the location in the user's Dropbox where the Paper Doc should be created. This /// should include the document's title and end with .paper. public let path: String @@ -4695,33 +5901,44 @@ open class Files { self.path = path self.importFormat = importFormat } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperCreateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperCreateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperCreateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperCreateArg: \(error)" + } } } - open class PaperCreateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperCreateArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "import_format": Files.ImportFormatSerializer().serialize(value.importFormat), + + public class PaperCreateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperCreateArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "import_format": try Files.ImportFormatSerializer().serialize(value.importFormat), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperCreateArg { + + public func deserialize(_ json: JSON) throws -> PaperCreateArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let importFormat = Files.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) - return PaperCreateArg(path: path, importFormat: importFormat) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let importFormat = try Files.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) + return PaperCreateArg(path: path, importFormat: importFormat) + default: + throw JSONSerializerError.deserializeError(type: PaperCreateArg.self, json: json) } } } /// The PaperCreateError union - public enum PaperCreateError: CustomStringConvertible { + public enum PaperCreateError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to edit Paper docs. case insufficientPermissions /// The provided content was malformed and cannot be imported to Paper. @@ -4742,86 +5959,96 @@ open class Files { /// Paper is disabled for your team. case paperDisabled + func json() throws -> JSON { + try PaperCreateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperCreateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperCreateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperCreateError: \(error)" + } } } - open class PaperCreateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperCreateError) -> JSON { + + public class PaperCreateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperCreateError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .contentMalformed: - var d = [String: JSON]() - d[".tag"] = .str("content_malformed") - return .dictionary(d) - case .docLengthExceeded: - var d = [String: JSON]() - d[".tag"] = .str("doc_length_exceeded") - return .dictionary(d) - case .imageSizeExceeded: - var d = [String: JSON]() - d[".tag"] = .str("image_size_exceeded") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .invalidPath: - var d = [String: JSON]() - d[".tag"] = .str("invalid_path") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .invalidFileExtension: - var d = [String: JSON]() - d[".tag"] = .str("invalid_file_extension") - return .dictionary(d) - case .paperDisabled: - var d = [String: JSON]() - d[".tag"] = .str("paper_disabled") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperCreateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return PaperCreateError.insufficientPermissions - case "content_malformed": - return PaperCreateError.contentMalformed - case "doc_length_exceeded": - return PaperCreateError.docLengthExceeded - case "image_size_exceeded": - return PaperCreateError.imageSizeExceeded - case "other": - return PaperCreateError.other - case "invalid_path": - return PaperCreateError.invalidPath - case "email_unverified": - return PaperCreateError.emailUnverified - case "invalid_file_extension": - return PaperCreateError.invalidFileExtension - case "paper_disabled": - return PaperCreateError.paperDisabled - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .contentMalformed: + var d = [String: JSON]() + d[".tag"] = .str("content_malformed") + return .dictionary(d) + case .docLengthExceeded: + var d = [String: JSON]() + d[".tag"] = .str("doc_length_exceeded") + return .dictionary(d) + case .imageSizeExceeded: + var d = [String: JSON]() + d[".tag"] = .str("image_size_exceeded") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .invalidPath: + var d = [String: JSON]() + d[".tag"] = .str("invalid_path") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .invalidFileExtension: + var d = [String: JSON]() + d[".tag"] = .str("invalid_file_extension") + return .dictionary(d) + case .paperDisabled: + var d = [String: JSON]() + d[".tag"] = .str("paper_disabled") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperCreateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return PaperCreateError.insufficientPermissions + case "content_malformed": + return PaperCreateError.contentMalformed + case "doc_length_exceeded": + return PaperCreateError.docLengthExceeded + case "image_size_exceeded": + return PaperCreateError.imageSizeExceeded + case "other": + return PaperCreateError.other + case "invalid_path": + return PaperCreateError.invalidPath + case "email_unverified": + return PaperCreateError.emailUnverified + case "invalid_file_extension": + return PaperCreateError.invalidFileExtension + case "paper_disabled": + return PaperCreateError.paperDisabled + default: + throw JSONSerializerError.unknownTag(type: PaperCreateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PaperCreateError.self, json: json) } } } /// The PaperCreateResult struct - open class PaperCreateResult: CustomStringConvertible { + public class PaperCreateResult: CustomStringConvertible, JSONRepresentable { /// URL to open the Paper Doc. public let url: String /// The fully qualified path the Paper Doc was actually created at. @@ -4840,37 +6067,48 @@ open class Files { comparableValidator()(paperRevision) self.paperRevision = paperRevision } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperCreateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperCreateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperCreateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperCreateResult: \(error)" + } } } - open class PaperCreateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperCreateResult) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "result_path": Serialization._StringSerializer.serialize(value.resultPath), - "file_id": Serialization._StringSerializer.serialize(value.fileId), - "paper_revision": Serialization._Int64Serializer.serialize(value.paperRevision), + + public class PaperCreateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperCreateResult) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "result_path": try Serialization._StringSerializer.serialize(value.resultPath), + "file_id": try Serialization._StringSerializer.serialize(value.fileId), + "paper_revision": try Serialization._Int64Serializer.serialize(value.paperRevision), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperCreateResult { + + public func deserialize(_ json: JSON) throws -> PaperCreateResult { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let resultPath = Serialization._StringSerializer.deserialize(dict["result_path"] ?? .null) - let fileId = Serialization._StringSerializer.deserialize(dict["file_id"] ?? .null) - let paperRevision = Serialization._Int64Serializer.deserialize(dict["paper_revision"] ?? .null) - return PaperCreateResult(url: url, resultPath: resultPath, fileId: fileId, paperRevision: paperRevision) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let resultPath = try Serialization._StringSerializer.deserialize(dict["result_path"] ?? .null) + let fileId = try Serialization._StringSerializer.deserialize(dict["file_id"] ?? .null) + let paperRevision = try Serialization._Int64Serializer.deserialize(dict["paper_revision"] ?? .null) + return PaperCreateResult(url: url, resultPath: resultPath, fileId: fileId, paperRevision: paperRevision) + default: + throw JSONSerializerError.deserializeError(type: PaperCreateResult.self, json: json) } } } /// The PaperDocUpdatePolicy union - public enum PaperDocUpdatePolicy: CustomStringConvertible { + public enum PaperDocUpdatePolicy: CustomStringConvertible, JSONRepresentable { /// Sets the doc content to the provided content if the provided paper_revision matches the latest doc revision. /// Otherwise, returns an error. case update @@ -4883,62 +6121,72 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDocUpdatePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUpdatePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUpdatePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUpdatePolicy: \(error)" + } } } - open class PaperDocUpdatePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUpdatePolicy) -> JSON { + + public class PaperDocUpdatePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUpdatePolicy) throws -> JSON { switch value { - case .update: - var d = [String: JSON]() - d[".tag"] = .str("update") - return .dictionary(d) - case .overwrite: - var d = [String: JSON]() - d[".tag"] = .str("overwrite") - return .dictionary(d) - case .prepend: - var d = [String: JSON]() - d[".tag"] = .str("prepend") - return .dictionary(d) - case .append: - var d = [String: JSON]() - d[".tag"] = .str("append") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDocUpdatePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "update": - return PaperDocUpdatePolicy.update - case "overwrite": - return PaperDocUpdatePolicy.overwrite - case "prepend": - return PaperDocUpdatePolicy.prepend - case "append": - return PaperDocUpdatePolicy.append - case "other": - return PaperDocUpdatePolicy.other - default: - return PaperDocUpdatePolicy.other - } - default: - fatalError("Failed to deserialize") + case .update: + var d = [String: JSON]() + d[".tag"] = .str("update") + return .dictionary(d) + case .overwrite: + var d = [String: JSON]() + d[".tag"] = .str("overwrite") + return .dictionary(d) + case .prepend: + var d = [String: JSON]() + d[".tag"] = .str("prepend") + return .dictionary(d) + case .append: + var d = [String: JSON]() + d[".tag"] = .str("append") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDocUpdatePolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "update": + return PaperDocUpdatePolicy.update + case "overwrite": + return PaperDocUpdatePolicy.overwrite + case "prepend": + return PaperDocUpdatePolicy.prepend + case "append": + return PaperDocUpdatePolicy.append + case "other": + return PaperDocUpdatePolicy.other + default: + return PaperDocUpdatePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDocUpdatePolicy.self, json: json) } } } /// The PaperUpdateArg struct - open class PaperUpdateArg: CustomStringConvertible { + public class PaperUpdateArg: CustomStringConvertible, JSONRepresentable { /// Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will be returned. public let path: String /// The format of the provided data. @@ -4956,37 +6204,48 @@ open class Files { nullableValidator(comparableValidator())(paperRevision) self.paperRevision = paperRevision } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperUpdateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperUpdateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperUpdateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperUpdateArg: \(error)" + } } } - open class PaperUpdateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperUpdateArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "import_format": Files.ImportFormatSerializer().serialize(value.importFormat), - "doc_update_policy": Files.PaperDocUpdatePolicySerializer().serialize(value.docUpdatePolicy), - "paper_revision": NullableSerializer(Serialization._Int64Serializer).serialize(value.paperRevision), + + public class PaperUpdateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperUpdateArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "import_format": try Files.ImportFormatSerializer().serialize(value.importFormat), + "doc_update_policy": try Files.PaperDocUpdatePolicySerializer().serialize(value.docUpdatePolicy), + "paper_revision": try NullableSerializer(Serialization._Int64Serializer).serialize(value.paperRevision), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperUpdateArg { + + public func deserialize(_ json: JSON) throws -> PaperUpdateArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let importFormat = Files.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) - let docUpdatePolicy = Files.PaperDocUpdatePolicySerializer().deserialize(dict["doc_update_policy"] ?? .null) - let paperRevision = NullableSerializer(Serialization._Int64Serializer).deserialize(dict["paper_revision"] ?? .null) - return PaperUpdateArg(path: path, importFormat: importFormat, docUpdatePolicy: docUpdatePolicy, paperRevision: paperRevision) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let importFormat = try Files.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) + let docUpdatePolicy = try Files.PaperDocUpdatePolicySerializer().deserialize(dict["doc_update_policy"] ?? .null) + let paperRevision = try NullableSerializer(Serialization._Int64Serializer).deserialize(dict["paper_revision"] ?? .null) + return PaperUpdateArg(path: path, importFormat: importFormat, docUpdatePolicy: docUpdatePolicy, paperRevision: paperRevision) + default: + throw JSONSerializerError.deserializeError(type: PaperUpdateArg.self, json: json) } } } /// The PaperUpdateError union - public enum PaperUpdateError: CustomStringConvertible { + public enum PaperUpdateError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to edit Paper docs. case insufficientPermissions /// The provided content was malformed and cannot be imported to Paper. @@ -5007,118 +6266,139 @@ open class Files { /// This operation is not allowed on deleted Paper docs. case docDeleted + func json() throws -> JSON { + try PaperUpdateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperUpdateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperUpdateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperUpdateError: \(error)" + } } } - open class PaperUpdateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperUpdateError) -> JSON { + + public class PaperUpdateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperUpdateError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .contentMalformed: - var d = [String: JSON]() - d[".tag"] = .str("content_malformed") - return .dictionary(d) - case .docLengthExceeded: - var d = [String: JSON]() - d[".tag"] = .str("doc_length_exceeded") - return .dictionary(d) - case .imageSizeExceeded: - var d = [String: JSON]() - d[".tag"] = .str("image_size_exceeded") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .revisionMismatch: - var d = [String: JSON]() - d[".tag"] = .str("revision_mismatch") - return .dictionary(d) - case .docArchived: - var d = [String: JSON]() - d[".tag"] = .str("doc_archived") - return .dictionary(d) - case .docDeleted: - var d = [String: JSON]() - d[".tag"] = .str("doc_deleted") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperUpdateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return PaperUpdateError.insufficientPermissions - case "content_malformed": - return PaperUpdateError.contentMalformed - case "doc_length_exceeded": - return PaperUpdateError.docLengthExceeded - case "image_size_exceeded": - return PaperUpdateError.imageSizeExceeded - case "other": - return PaperUpdateError.other - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return PaperUpdateError.path(v) - case "revision_mismatch": - return PaperUpdateError.revisionMismatch - case "doc_archived": - return PaperUpdateError.docArchived - case "doc_deleted": - return PaperUpdateError.docDeleted - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .contentMalformed: + var d = [String: JSON]() + d[".tag"] = .str("content_malformed") + return .dictionary(d) + case .docLengthExceeded: + var d = [String: JSON]() + d[".tag"] = .str("doc_length_exceeded") + return .dictionary(d) + case .imageSizeExceeded: + var d = [String: JSON]() + d[".tag"] = .str("image_size_exceeded") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .revisionMismatch: + var d = [String: JSON]() + d[".tag"] = .str("revision_mismatch") + return .dictionary(d) + case .docArchived: + var d = [String: JSON]() + d[".tag"] = .str("doc_archived") + return .dictionary(d) + case .docDeleted: + var d = [String: JSON]() + d[".tag"] = .str("doc_deleted") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperUpdateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return PaperUpdateError.insufficientPermissions + case "content_malformed": + return PaperUpdateError.contentMalformed + case "doc_length_exceeded": + return PaperUpdateError.docLengthExceeded + case "image_size_exceeded": + return PaperUpdateError.imageSizeExceeded + case "other": + return PaperUpdateError.other + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return PaperUpdateError.path(v) + case "revision_mismatch": + return PaperUpdateError.revisionMismatch + case "doc_archived": + return PaperUpdateError.docArchived + case "doc_deleted": + return PaperUpdateError.docDeleted + default: + throw JSONSerializerError.unknownTag(type: PaperUpdateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PaperUpdateError.self, json: json) } } } /// The PaperUpdateResult struct - open class PaperUpdateResult: CustomStringConvertible { + public class PaperUpdateResult: CustomStringConvertible, JSONRepresentable { /// The current doc revision. public let paperRevision: Int64 public init(paperRevision: Int64) { comparableValidator()(paperRevision) self.paperRevision = paperRevision } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperUpdateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperUpdateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperUpdateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperUpdateResult: \(error)" + } } } - open class PaperUpdateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperUpdateResult) -> JSON { - let output = [ - "paper_revision": Serialization._Int64Serializer.serialize(value.paperRevision), + + public class PaperUpdateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperUpdateResult) throws -> JSON { + let output = [ + "paper_revision": try Serialization._Int64Serializer.serialize(value.paperRevision), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperUpdateResult { + + public func deserialize(_ json: JSON) throws -> PaperUpdateResult { switch json { - case .dictionary(let dict): - let paperRevision = Serialization._Int64Serializer.deserialize(dict["paper_revision"] ?? .null) - return PaperUpdateResult(paperRevision: paperRevision) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let paperRevision = try Serialization._Int64Serializer.deserialize(dict["paper_revision"] ?? .null) + return PaperUpdateResult(paperRevision: paperRevision) + default: + throw JSONSerializerError.deserializeError(type: PaperUpdateResult.self, json: json) } } } /// The PathOrLink union - public enum PathOrLink: CustomStringConvertible { + public enum PathOrLink: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(String) /// An unspecified error. @@ -5126,117 +6406,144 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try PathOrLinkSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PathOrLinkSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PathOrLinkSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PathOrLink: \(error)" + } } } - open class PathOrLinkSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PathOrLink) -> JSON { + + public class PathOrLinkSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PathOrLink) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .link(let arg): - var d = Serialization.getFields(Files.SharedLinkFileInfoSerializer().serialize(arg)) - d[".tag"] = .str("link") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PathOrLink { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Serialization._StringSerializer.deserialize(d["path"] ?? .null) - return PathOrLink.path(v) - case "link": - let v = Files.SharedLinkFileInfoSerializer().deserialize(json) - return PathOrLink.link(v) - case "other": - return PathOrLink.other - default: - return PathOrLink.other - } + case .path(let arg): + var d = try ["path": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .link(let arg): + var d = try Serialization.getFields(Files.SharedLinkFileInfoSerializer().serialize(arg)) + d[".tag"] = .str("link") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PathOrLink { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Serialization._StringSerializer.deserialize(d["path"] ?? .null) + return PathOrLink.path(v) + case "link": + let v = try Files.SharedLinkFileInfoSerializer().deserialize(json) + return PathOrLink.link(v) + case "other": + return PathOrLink.other default: - fatalError("Failed to deserialize") + return PathOrLink.other + } + default: + throw JSONSerializerError.deserializeError(type: PathOrLink.self, json: json) } } } /// The PathToTags struct - open class PathToTags: CustomStringConvertible { + public class PathToTags: CustomStringConvertible, JSONRepresentable { /// Path of the item. public let path: String /// Tags assigned to this item. - public let tags: Array - public init(path: String, tags: Array) { + public let tags: [Files.Tag] + public init(path: String, tags: [Files.Tag]) { stringValidator(pattern: "/(.|[\\r\\n])*")(path) self.path = path self.tags = tags } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PathToTagsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PathToTagsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PathToTagsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PathToTags: \(error)" + } } } - open class PathToTagsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PathToTags) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "tags": ArraySerializer(Files.TagSerializer()).serialize(value.tags), + + public class PathToTagsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PathToTags) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "tags": try ArraySerializer(Files.TagSerializer()).serialize(value.tags), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PathToTags { + + public func deserialize(_ json: JSON) throws -> PathToTags { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let tags = ArraySerializer(Files.TagSerializer()).deserialize(dict["tags"] ?? .null) - return PathToTags(path: path, tags: tags) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let tags = try ArraySerializer(Files.TagSerializer()).deserialize(dict["tags"] ?? .null) + return PathToTags(path: path, tags: tags) + default: + throw JSONSerializerError.deserializeError(type: PathToTags.self, json: json) } } } /// Metadata for a photo. - open class PhotoMetadata: Files.MediaMetadata { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PhotoMetadataSerializer().serialize(self)))" - } - } - open class PhotoMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PhotoMetadata) -> JSON { - let output = [ - "dimensions": NullableSerializer(Files.DimensionsSerializer()).serialize(value.dimensions), - "location": NullableSerializer(Files.GpsCoordinatesSerializer()).serialize(value.location), - "time_taken": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeTaken), + public class PhotoMetadata: Files.MediaMetadata { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PhotoMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PhotoMetadata: \(error)" + } + } + } + + public class PhotoMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PhotoMetadata) throws -> JSON { + let output = [ + "dimensions": try NullableSerializer(Files.DimensionsSerializer()).serialize(value.dimensions), + "location": try NullableSerializer(Files.GpsCoordinatesSerializer()).serialize(value.location), + "time_taken": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeTaken), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PhotoMetadata { + + public func deserialize(_ json: JSON) throws -> PhotoMetadata { switch json { - case .dictionary(let dict): - let dimensions = NullableSerializer(Files.DimensionsSerializer()).deserialize(dict["dimensions"] ?? .null) - let location = NullableSerializer(Files.GpsCoordinatesSerializer()).deserialize(dict["location"] ?? .null) - let timeTaken = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_taken"] ?? .null) - return PhotoMetadata(dimensions: dimensions, location: location, timeTaken: timeTaken) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let dimensions = try NullableSerializer(Files.DimensionsSerializer()).deserialize(dict["dimensions"] ?? .null) + let location = try NullableSerializer(Files.GpsCoordinatesSerializer()).deserialize(dict["location"] ?? .null) + let timeTaken = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_taken"] ?? .null) + return PhotoMetadata(dimensions: dimensions, location: location, timeTaken: timeTaken) + default: + throw JSONSerializerError.deserializeError(type: PhotoMetadata.self, json: json) } } } /// The PreviewArg struct - open class PreviewArg: CustomStringConvertible { + public class PreviewArg: CustomStringConvertible, JSONRepresentable { /// The path of the file to preview. public let path: String /// Please specify revision in path instead. @@ -5247,33 +6554,44 @@ open class Files { nullableValidator(stringValidator(minLength: 9, pattern: "[0-9a-f]+"))(rev) self.rev = rev } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PreviewArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try PreviewArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PreviewArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PreviewArg: \(error)" + } } } - open class PreviewArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PreviewArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "rev": NullableSerializer(Serialization._StringSerializer).serialize(value.rev), + + public class PreviewArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PreviewArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "rev": try NullableSerializer(Serialization._StringSerializer).serialize(value.rev), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PreviewArg { + + public func deserialize(_ json: JSON) throws -> PreviewArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let rev = NullableSerializer(Serialization._StringSerializer).deserialize(dict["rev"] ?? .null) - return PreviewArg(path: path, rev: rev) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let rev = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["rev"] ?? .null) + return PreviewArg(path: path, rev: rev) + default: + throw JSONSerializerError.deserializeError(type: PreviewArg.self, json: json) } } } /// The PreviewError union - public enum PreviewError: CustomStringConvertible { + public enum PreviewError: CustomStringConvertible, JSONRepresentable { /// An error occurs when downloading metadata for the file. case path(Files.LookupError) /// This preview generation is still in progress and the file is not ready for preview yet. @@ -5283,57 +6601,67 @@ open class Files { /// The file content is not supported for preview generation. case unsupportedContent + func json() throws -> JSON { + try PreviewErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PreviewErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PreviewErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PreviewError: \(error)" + } } } - open class PreviewErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PreviewError) -> JSON { + + public class PreviewErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PreviewError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .unsupportedExtension: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_extension") - return .dictionary(d) - case .unsupportedContent: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_content") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PreviewError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return PreviewError.path(v) - case "in_progress": - return PreviewError.inProgress - case "unsupported_extension": - return PreviewError.unsupportedExtension - case "unsupported_content": - return PreviewError.unsupportedContent - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .unsupportedExtension: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_extension") + return .dictionary(d) + case .unsupportedContent: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_content") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PreviewError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return PreviewError.path(v) + case "in_progress": + return PreviewError.inProgress + case "unsupported_extension": + return PreviewError.unsupportedExtension + case "unsupported_content": + return PreviewError.unsupportedContent + default: + throw JSONSerializerError.unknownTag(type: PreviewError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PreviewError.self, json: json) } } } /// The PreviewResult struct - open class PreviewResult: CustomStringConvertible { + public class PreviewResult: CustomStringConvertible, JSONRepresentable { /// Metadata corresponding to the file received as an argument. Will be populated if the endpoint is called with /// a path (ReadPath). public let fileMetadata: Files.FileMetadata? @@ -5344,33 +6672,44 @@ open class Files { self.fileMetadata = fileMetadata self.linkMetadata = linkMetadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PreviewResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try PreviewResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PreviewResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PreviewResult: \(error)" + } } } - open class PreviewResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PreviewResult) -> JSON { - let output = [ - "file_metadata": NullableSerializer(Files.FileMetadataSerializer()).serialize(value.fileMetadata), - "link_metadata": NullableSerializer(Files.MinimalFileLinkMetadataSerializer()).serialize(value.linkMetadata), + + public class PreviewResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PreviewResult) throws -> JSON { + let output = [ + "file_metadata": try NullableSerializer(Files.FileMetadataSerializer()).serialize(value.fileMetadata), + "link_metadata": try NullableSerializer(Files.MinimalFileLinkMetadataSerializer()).serialize(value.linkMetadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PreviewResult { + + public func deserialize(_ json: JSON) throws -> PreviewResult { switch json { - case .dictionary(let dict): - let fileMetadata = NullableSerializer(Files.FileMetadataSerializer()).deserialize(dict["file_metadata"] ?? .null) - let linkMetadata = NullableSerializer(Files.MinimalFileLinkMetadataSerializer()).deserialize(dict["link_metadata"] ?? .null) - return PreviewResult(fileMetadata: fileMetadata, linkMetadata: linkMetadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileMetadata = try NullableSerializer(Files.FileMetadataSerializer()).deserialize(dict["file_metadata"] ?? .null) + let linkMetadata = try NullableSerializer(Files.MinimalFileLinkMetadataSerializer()).deserialize(dict["link_metadata"] ?? .null) + return PreviewResult(fileMetadata: fileMetadata, linkMetadata: linkMetadata) + default: + throw JSONSerializerError.deserializeError(type: PreviewResult.self, json: json) } } } /// The RelocationPath struct - open class RelocationPath: CustomStringConvertible { + public class RelocationPath: CustomStringConvertible, JSONRepresentable { /// Path in the user's Dropbox to be copied or moved. public let fromPath: String /// Path in the user's Dropbox that is the destination. @@ -5381,33 +6720,44 @@ open class Files { stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)")(toPath) self.toPath = toPath } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationPathSerializer().serialize(self)))" + + func json() throws -> JSON { + try RelocationPathSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationPathSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationPath: \(error)" + } } } - open class RelocationPathSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationPath) -> JSON { - let output = [ - "from_path": Serialization._StringSerializer.serialize(value.fromPath), - "to_path": Serialization._StringSerializer.serialize(value.toPath), + + public class RelocationPathSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationPath) throws -> JSON { + let output = [ + "from_path": try Serialization._StringSerializer.serialize(value.fromPath), + "to_path": try Serialization._StringSerializer.serialize(value.toPath), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationPath { + + public func deserialize(_ json: JSON) throws -> RelocationPath { switch json { - case .dictionary(let dict): - let fromPath = Serialization._StringSerializer.deserialize(dict["from_path"] ?? .null) - let toPath = Serialization._StringSerializer.deserialize(dict["to_path"] ?? .null) - return RelocationPath(fromPath: fromPath, toPath: toPath) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fromPath = try Serialization._StringSerializer.deserialize(dict["from_path"] ?? .null) + let toPath = try Serialization._StringSerializer.deserialize(dict["to_path"] ?? .null) + return RelocationPath(fromPath: fromPath, toPath: toPath) + default: + throw JSONSerializerError.deserializeError(type: RelocationPath.self, json: json) } } } /// The RelocationArg struct - open class RelocationArg: Files.RelocationPath { + public class RelocationArg: Files.RelocationPath { /// This flag has no effect. public let allowSharedFolder: Bool /// If there's a conflict, have the Dropbox server try to autorename the file to avoid the conflict. @@ -5421,80 +6771,105 @@ open class Files { self.allowOwnershipTransfer = allowOwnershipTransfer super.init(fromPath: fromPath, toPath: toPath) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationArg: \(error)" + } } } - open class RelocationArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationArg) -> JSON { - let output = [ - "from_path": Serialization._StringSerializer.serialize(value.fromPath), - "to_path": Serialization._StringSerializer.serialize(value.toPath), - "allow_shared_folder": Serialization._BoolSerializer.serialize(value.allowSharedFolder), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), - "allow_ownership_transfer": Serialization._BoolSerializer.serialize(value.allowOwnershipTransfer), + + public class RelocationArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationArg) throws -> JSON { + let output = [ + "from_path": try Serialization._StringSerializer.serialize(value.fromPath), + "to_path": try Serialization._StringSerializer.serialize(value.toPath), + "allow_shared_folder": try Serialization._BoolSerializer.serialize(value.allowSharedFolder), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), + "allow_ownership_transfer": try Serialization._BoolSerializer.serialize(value.allowOwnershipTransfer), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationArg { + + public func deserialize(_ json: JSON) throws -> RelocationArg { switch json { - case .dictionary(let dict): - let fromPath = Serialization._StringSerializer.deserialize(dict["from_path"] ?? .null) - let toPath = Serialization._StringSerializer.deserialize(dict["to_path"] ?? .null) - let allowSharedFolder = Serialization._BoolSerializer.deserialize(dict["allow_shared_folder"] ?? .number(0)) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - let allowOwnershipTransfer = Serialization._BoolSerializer.deserialize(dict["allow_ownership_transfer"] ?? .number(0)) - return RelocationArg(fromPath: fromPath, toPath: toPath, allowSharedFolder: allowSharedFolder, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fromPath = try Serialization._StringSerializer.deserialize(dict["from_path"] ?? .null) + let toPath = try Serialization._StringSerializer.deserialize(dict["to_path"] ?? .null) + let allowSharedFolder = try Serialization._BoolSerializer.deserialize(dict["allow_shared_folder"] ?? .number(0)) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + let allowOwnershipTransfer = try Serialization._BoolSerializer.deserialize(dict["allow_ownership_transfer"] ?? .number(0)) + return RelocationArg( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder, + autorename: autorename, + allowOwnershipTransfer: allowOwnershipTransfer + ) + default: + throw JSONSerializerError.deserializeError(type: RelocationArg.self, json: json) } } } /// The RelocationBatchArg struct - open class RelocationBatchArg: Files.RelocationBatchArgBase { + public class RelocationBatchArg: Files.RelocationBatchArgBase { /// This flag has no effect. public let allowSharedFolder: Bool /// Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does /// not apply to copies. public let allowOwnershipTransfer: Bool - public init(entries: Array, autorename: Bool = false, allowSharedFolder: Bool = false, allowOwnershipTransfer: Bool = false) { + public init(entries: [Files.RelocationPath], autorename: Bool = false, allowSharedFolder: Bool = false, allowOwnershipTransfer: Bool = false) { self.allowSharedFolder = allowSharedFolder self.allowOwnershipTransfer = allowOwnershipTransfer super.init(entries: entries, autorename: autorename) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchArg: \(error)" + } } } - open class RelocationBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchArg) -> JSON { - let output = [ - "entries": ArraySerializer(Files.RelocationPathSerializer()).serialize(value.entries), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), - "allow_shared_folder": Serialization._BoolSerializer.serialize(value.allowSharedFolder), - "allow_ownership_transfer": Serialization._BoolSerializer.serialize(value.allowOwnershipTransfer), + + public class RelocationBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchArg) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.RelocationPathSerializer()).serialize(value.entries), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), + "allow_shared_folder": try Serialization._BoolSerializer.serialize(value.allowSharedFolder), + "allow_ownership_transfer": try Serialization._BoolSerializer.serialize(value.allowOwnershipTransfer), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationBatchArg { + + public func deserialize(_ json: JSON) throws -> RelocationBatchArg { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.RelocationPathSerializer()).deserialize(dict["entries"] ?? .null) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - let allowSharedFolder = Serialization._BoolSerializer.deserialize(dict["allow_shared_folder"] ?? .number(0)) - let allowOwnershipTransfer = Serialization._BoolSerializer.deserialize(dict["allow_ownership_transfer"] ?? .number(0)) - return RelocationBatchArg(entries: entries, autorename: autorename, allowSharedFolder: allowSharedFolder, allowOwnershipTransfer: allowOwnershipTransfer) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.RelocationPathSerializer()).deserialize(dict["entries"] ?? .null) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + let allowSharedFolder = try Serialization._BoolSerializer.deserialize(dict["allow_shared_folder"] ?? .number(0)) + let allowOwnershipTransfer = try Serialization._BoolSerializer.deserialize(dict["allow_ownership_transfer"] ?? .number(0)) + return RelocationBatchArg( + entries: entries, + autorename: autorename, + allowSharedFolder: allowSharedFolder, + allowOwnershipTransfer: allowOwnershipTransfer + ) + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchArg.self, json: json) } } } /// The RelocationError union - public enum RelocationError: CustomStringConvertible { + public enum RelocationError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case fromLookup(Files.LookupError) /// An unspecified error. @@ -5528,127 +6903,137 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try RelocationErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationError: \(error)" + } } } - open class RelocationErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationError) -> JSON { + + public class RelocationErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationError) throws -> JSON { switch value { - case .fromLookup(let arg): - var d = ["from_lookup": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("from_lookup") - return .dictionary(d) - case .fromWrite(let arg): - var d = ["from_write": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("from_write") - return .dictionary(d) - case .to(let arg): - var d = ["to": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("to") - return .dictionary(d) - case .cantCopySharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("cant_copy_shared_folder") - return .dictionary(d) - case .cantNestSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("cant_nest_shared_folder") - return .dictionary(d) - case .cantMoveFolderIntoItself: - var d = [String: JSON]() - d[".tag"] = .str("cant_move_folder_into_itself") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .duplicatedOrNestedPaths: - var d = [String: JSON]() - d[".tag"] = .str("duplicated_or_nested_paths") - return .dictionary(d) - case .cantTransferOwnership: - var d = [String: JSON]() - d[".tag"] = .str("cant_transfer_ownership") - return .dictionary(d) - case .insufficientQuota: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_quota") - return .dictionary(d) - case .internalError: - var d = [String: JSON]() - d[".tag"] = .str("internal_error") - return .dictionary(d) - case .cantMoveSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("cant_move_shared_folder") - return .dictionary(d) - case .cantMoveIntoVault(let arg): - var d = ["cant_move_into_vault": Files.MoveIntoVaultErrorSerializer().serialize(arg)] - d[".tag"] = .str("cant_move_into_vault") - return .dictionary(d) - case .cantMoveIntoFamily(let arg): - var d = ["cant_move_into_family": Files.MoveIntoFamilyErrorSerializer().serialize(arg)] - d[".tag"] = .str("cant_move_into_family") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "from_lookup": - let v = Files.LookupErrorSerializer().deserialize(d["from_lookup"] ?? .null) - return RelocationError.fromLookup(v) - case "from_write": - let v = Files.WriteErrorSerializer().deserialize(d["from_write"] ?? .null) - return RelocationError.fromWrite(v) - case "to": - let v = Files.WriteErrorSerializer().deserialize(d["to"] ?? .null) - return RelocationError.to(v) - case "cant_copy_shared_folder": - return RelocationError.cantCopySharedFolder - case "cant_nest_shared_folder": - return RelocationError.cantNestSharedFolder - case "cant_move_folder_into_itself": - return RelocationError.cantMoveFolderIntoItself - case "too_many_files": - return RelocationError.tooManyFiles - case "duplicated_or_nested_paths": - return RelocationError.duplicatedOrNestedPaths - case "cant_transfer_ownership": - return RelocationError.cantTransferOwnership - case "insufficient_quota": - return RelocationError.insufficientQuota - case "internal_error": - return RelocationError.internalError - case "cant_move_shared_folder": - return RelocationError.cantMoveSharedFolder - case "cant_move_into_vault": - let v = Files.MoveIntoVaultErrorSerializer().deserialize(d["cant_move_into_vault"] ?? .null) - return RelocationError.cantMoveIntoVault(v) - case "cant_move_into_family": - let v = Files.MoveIntoFamilyErrorSerializer().deserialize(d["cant_move_into_family"] ?? .null) - return RelocationError.cantMoveIntoFamily(v) - case "other": - return RelocationError.other - default: - return RelocationError.other - } - default: - fatalError("Failed to deserialize") + case .fromLookup(let arg): + var d = try ["from_lookup": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("from_lookup") + return .dictionary(d) + case .fromWrite(let arg): + var d = try ["from_write": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("from_write") + return .dictionary(d) + case .to(let arg): + var d = try ["to": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("to") + return .dictionary(d) + case .cantCopySharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("cant_copy_shared_folder") + return .dictionary(d) + case .cantNestSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("cant_nest_shared_folder") + return .dictionary(d) + case .cantMoveFolderIntoItself: + var d = [String: JSON]() + d[".tag"] = .str("cant_move_folder_into_itself") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .duplicatedOrNestedPaths: + var d = [String: JSON]() + d[".tag"] = .str("duplicated_or_nested_paths") + return .dictionary(d) + case .cantTransferOwnership: + var d = [String: JSON]() + d[".tag"] = .str("cant_transfer_ownership") + return .dictionary(d) + case .insufficientQuota: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_quota") + return .dictionary(d) + case .internalError: + var d = [String: JSON]() + d[".tag"] = .str("internal_error") + return .dictionary(d) + case .cantMoveSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("cant_move_shared_folder") + return .dictionary(d) + case .cantMoveIntoVault(let arg): + var d = try ["cant_move_into_vault": Files.MoveIntoVaultErrorSerializer().serialize(arg)] + d[".tag"] = .str("cant_move_into_vault") + return .dictionary(d) + case .cantMoveIntoFamily(let arg): + var d = try ["cant_move_into_family": Files.MoveIntoFamilyErrorSerializer().serialize(arg)] + d[".tag"] = .str("cant_move_into_family") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "from_lookup": + let v = try Files.LookupErrorSerializer().deserialize(d["from_lookup"] ?? .null) + return RelocationError.fromLookup(v) + case "from_write": + let v = try Files.WriteErrorSerializer().deserialize(d["from_write"] ?? .null) + return RelocationError.fromWrite(v) + case "to": + let v = try Files.WriteErrorSerializer().deserialize(d["to"] ?? .null) + return RelocationError.to(v) + case "cant_copy_shared_folder": + return RelocationError.cantCopySharedFolder + case "cant_nest_shared_folder": + return RelocationError.cantNestSharedFolder + case "cant_move_folder_into_itself": + return RelocationError.cantMoveFolderIntoItself + case "too_many_files": + return RelocationError.tooManyFiles + case "duplicated_or_nested_paths": + return RelocationError.duplicatedOrNestedPaths + case "cant_transfer_ownership": + return RelocationError.cantTransferOwnership + case "insufficient_quota": + return RelocationError.insufficientQuota + case "internal_error": + return RelocationError.internalError + case "cant_move_shared_folder": + return RelocationError.cantMoveSharedFolder + case "cant_move_into_vault": + let v = try Files.MoveIntoVaultErrorSerializer().deserialize(d["cant_move_into_vault"] ?? .null) + return RelocationError.cantMoveIntoVault(v) + case "cant_move_into_family": + let v = try Files.MoveIntoFamilyErrorSerializer().deserialize(d["cant_move_into_family"] ?? .null) + return RelocationError.cantMoveIntoFamily(v) + case "other": + return RelocationError.other + default: + return RelocationError.other + } + default: + throw JSONSerializerError.deserializeError(type: RelocationError.self, json: json) } } } /// The RelocationBatchError union - public enum RelocationBatchError: CustomStringConvertible { + public enum RelocationBatchError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case fromLookup(Files.LookupError) /// An unspecified error. @@ -5684,133 +7069,143 @@ open class Files { /// There are too many write operations in user's Dropbox. Please retry this request. case tooManyWriteOperations + func json() throws -> JSON { + try RelocationBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchError: \(error)" + } } } - open class RelocationBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchError) -> JSON { + + public class RelocationBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchError) throws -> JSON { switch value { - case .fromLookup(let arg): - var d = ["from_lookup": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("from_lookup") - return .dictionary(d) - case .fromWrite(let arg): - var d = ["from_write": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("from_write") - return .dictionary(d) - case .to(let arg): - var d = ["to": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("to") - return .dictionary(d) - case .cantCopySharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("cant_copy_shared_folder") - return .dictionary(d) - case .cantNestSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("cant_nest_shared_folder") - return .dictionary(d) - case .cantMoveFolderIntoItself: - var d = [String: JSON]() - d[".tag"] = .str("cant_move_folder_into_itself") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .duplicatedOrNestedPaths: - var d = [String: JSON]() - d[".tag"] = .str("duplicated_or_nested_paths") - return .dictionary(d) - case .cantTransferOwnership: - var d = [String: JSON]() - d[".tag"] = .str("cant_transfer_ownership") - return .dictionary(d) - case .insufficientQuota: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_quota") - return .dictionary(d) - case .internalError: - var d = [String: JSON]() - d[".tag"] = .str("internal_error") - return .dictionary(d) - case .cantMoveSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("cant_move_shared_folder") - return .dictionary(d) - case .cantMoveIntoVault(let arg): - var d = ["cant_move_into_vault": Files.MoveIntoVaultErrorSerializer().serialize(arg)] - d[".tag"] = .str("cant_move_into_vault") - return .dictionary(d) - case .cantMoveIntoFamily(let arg): - var d = ["cant_move_into_family": Files.MoveIntoFamilyErrorSerializer().serialize(arg)] - d[".tag"] = .str("cant_move_into_family") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationBatchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "from_lookup": - let v = Files.LookupErrorSerializer().deserialize(d["from_lookup"] ?? .null) - return RelocationBatchError.fromLookup(v) - case "from_write": - let v = Files.WriteErrorSerializer().deserialize(d["from_write"] ?? .null) - return RelocationBatchError.fromWrite(v) - case "to": - let v = Files.WriteErrorSerializer().deserialize(d["to"] ?? .null) - return RelocationBatchError.to(v) - case "cant_copy_shared_folder": - return RelocationBatchError.cantCopySharedFolder - case "cant_nest_shared_folder": - return RelocationBatchError.cantNestSharedFolder - case "cant_move_folder_into_itself": - return RelocationBatchError.cantMoveFolderIntoItself - case "too_many_files": - return RelocationBatchError.tooManyFiles - case "duplicated_or_nested_paths": - return RelocationBatchError.duplicatedOrNestedPaths - case "cant_transfer_ownership": - return RelocationBatchError.cantTransferOwnership - case "insufficient_quota": - return RelocationBatchError.insufficientQuota - case "internal_error": - return RelocationBatchError.internalError - case "cant_move_shared_folder": - return RelocationBatchError.cantMoveSharedFolder - case "cant_move_into_vault": - let v = Files.MoveIntoVaultErrorSerializer().deserialize(d["cant_move_into_vault"] ?? .null) - return RelocationBatchError.cantMoveIntoVault(v) - case "cant_move_into_family": - let v = Files.MoveIntoFamilyErrorSerializer().deserialize(d["cant_move_into_family"] ?? .null) - return RelocationBatchError.cantMoveIntoFamily(v) - case "other": - return RelocationBatchError.other - case "too_many_write_operations": - return RelocationBatchError.tooManyWriteOperations - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .fromLookup(let arg): + var d = try ["from_lookup": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("from_lookup") + return .dictionary(d) + case .fromWrite(let arg): + var d = try ["from_write": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("from_write") + return .dictionary(d) + case .to(let arg): + var d = try ["to": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("to") + return .dictionary(d) + case .cantCopySharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("cant_copy_shared_folder") + return .dictionary(d) + case .cantNestSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("cant_nest_shared_folder") + return .dictionary(d) + case .cantMoveFolderIntoItself: + var d = [String: JSON]() + d[".tag"] = .str("cant_move_folder_into_itself") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .duplicatedOrNestedPaths: + var d = [String: JSON]() + d[".tag"] = .str("duplicated_or_nested_paths") + return .dictionary(d) + case .cantTransferOwnership: + var d = [String: JSON]() + d[".tag"] = .str("cant_transfer_ownership") + return .dictionary(d) + case .insufficientQuota: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_quota") + return .dictionary(d) + case .internalError: + var d = [String: JSON]() + d[".tag"] = .str("internal_error") + return .dictionary(d) + case .cantMoveSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("cant_move_shared_folder") + return .dictionary(d) + case .cantMoveIntoVault(let arg): + var d = try ["cant_move_into_vault": Files.MoveIntoVaultErrorSerializer().serialize(arg)] + d[".tag"] = .str("cant_move_into_vault") + return .dictionary(d) + case .cantMoveIntoFamily(let arg): + var d = try ["cant_move_into_family": Files.MoveIntoFamilyErrorSerializer().serialize(arg)] + d[".tag"] = .str("cant_move_into_family") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationBatchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "from_lookup": + let v = try Files.LookupErrorSerializer().deserialize(d["from_lookup"] ?? .null) + return RelocationBatchError.fromLookup(v) + case "from_write": + let v = try Files.WriteErrorSerializer().deserialize(d["from_write"] ?? .null) + return RelocationBatchError.fromWrite(v) + case "to": + let v = try Files.WriteErrorSerializer().deserialize(d["to"] ?? .null) + return RelocationBatchError.to(v) + case "cant_copy_shared_folder": + return RelocationBatchError.cantCopySharedFolder + case "cant_nest_shared_folder": + return RelocationBatchError.cantNestSharedFolder + case "cant_move_folder_into_itself": + return RelocationBatchError.cantMoveFolderIntoItself + case "too_many_files": + return RelocationBatchError.tooManyFiles + case "duplicated_or_nested_paths": + return RelocationBatchError.duplicatedOrNestedPaths + case "cant_transfer_ownership": + return RelocationBatchError.cantTransferOwnership + case "insufficient_quota": + return RelocationBatchError.insufficientQuota + case "internal_error": + return RelocationBatchError.internalError + case "cant_move_shared_folder": + return RelocationBatchError.cantMoveSharedFolder + case "cant_move_into_vault": + let v = try Files.MoveIntoVaultErrorSerializer().deserialize(d["cant_move_into_vault"] ?? .null) + return RelocationBatchError.cantMoveIntoVault(v) + case "cant_move_into_family": + let v = try Files.MoveIntoFamilyErrorSerializer().deserialize(d["cant_move_into_family"] ?? .null) + return RelocationBatchError.cantMoveIntoFamily(v) + case "other": + return RelocationBatchError.other + case "too_many_write_operations": + return RelocationBatchError.tooManyWriteOperations + default: + throw JSONSerializerError.unknownTag(type: RelocationBatchError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchError.self, json: json) } } } /// The RelocationBatchErrorEntry union - public enum RelocationBatchErrorEntry: CustomStringConvertible { + public enum RelocationBatchErrorEntry: CustomStringConvertible, JSONRepresentable { /// User errors that retry won't help. case relocationError(Files.RelocationError) /// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking @@ -5821,57 +7216,67 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try RelocationBatchErrorEntrySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchErrorEntrySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchErrorEntrySerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchErrorEntry: \(error)" + } } } - open class RelocationBatchErrorEntrySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchErrorEntry) -> JSON { + + public class RelocationBatchErrorEntrySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchErrorEntry) throws -> JSON { switch value { - case .relocationError(let arg): - var d = ["relocation_error": Files.RelocationErrorSerializer().serialize(arg)] - d[".tag"] = .str("relocation_error") - return .dictionary(d) - case .internalError: - var d = [String: JSON]() - d[".tag"] = .str("internal_error") - return .dictionary(d) - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationBatchErrorEntry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "relocation_error": - let v = Files.RelocationErrorSerializer().deserialize(d["relocation_error"] ?? .null) - return RelocationBatchErrorEntry.relocationError(v) - case "internal_error": - return RelocationBatchErrorEntry.internalError - case "too_many_write_operations": - return RelocationBatchErrorEntry.tooManyWriteOperations - case "other": - return RelocationBatchErrorEntry.other - default: - return RelocationBatchErrorEntry.other - } - default: - fatalError("Failed to deserialize") + case .relocationError(let arg): + var d = try ["relocation_error": Files.RelocationErrorSerializer().serialize(arg)] + d[".tag"] = .str("relocation_error") + return .dictionary(d) + case .internalError: + var d = [String: JSON]() + d[".tag"] = .str("internal_error") + return .dictionary(d) + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationBatchErrorEntry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "relocation_error": + let v = try Files.RelocationErrorSerializer().deserialize(d["relocation_error"] ?? .null) + return RelocationBatchErrorEntry.relocationError(v) + case "internal_error": + return RelocationBatchErrorEntry.internalError + case "too_many_write_operations": + return RelocationBatchErrorEntry.tooManyWriteOperations + case "other": + return RelocationBatchErrorEntry.other + default: + return RelocationBatchErrorEntry.other + } + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchErrorEntry.self, json: json) } } } /// The RelocationBatchJobStatus union - public enum RelocationBatchJobStatus: CustomStringConvertible { + public enum RelocationBatchJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The copy or move batch job has finished. @@ -5879,52 +7284,62 @@ open class Files { /// The copy or move batch job has failed with exception. case failed(Files.RelocationBatchError) + func json() throws -> JSON { + try RelocationBatchJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchJobStatus: \(error)" + } } } - open class RelocationBatchJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchJobStatus) -> JSON { + + public class RelocationBatchJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.RelocationBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Files.RelocationBatchErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationBatchJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return RelocationBatchJobStatus.inProgress - case "complete": - let v = Files.RelocationBatchResultSerializer().deserialize(json) - return RelocationBatchJobStatus.complete(v) - case "failed": - let v = Files.RelocationBatchErrorSerializer().deserialize(d["failed"] ?? .null) - return RelocationBatchJobStatus.failed(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.RelocationBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Files.RelocationBatchErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationBatchJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return RelocationBatchJobStatus.inProgress + case "complete": + let v = try Files.RelocationBatchResultSerializer().deserialize(json) + return RelocationBatchJobStatus.complete(v) + case "failed": + let v = try Files.RelocationBatchErrorSerializer().deserialize(d["failed"] ?? .null) + return RelocationBatchJobStatus.failed(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RelocationBatchJobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchJobStatus.self, json: json) } } } /// Result returned by copyBatch or moveBatch that may either launch an asynchronous job or complete synchronously. - public enum RelocationBatchLaunch: CustomStringConvertible { + public enum RelocationBatchLaunch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) @@ -5933,113 +7348,141 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try RelocationBatchLaunchSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchLaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchLaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchLaunch: \(error)" + } } } - open class RelocationBatchLaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchLaunch) -> JSON { + + public class RelocationBatchLaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchLaunch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.RelocationBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationBatchLaunch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return RelocationBatchLaunch.asyncJobId(v) - case "complete": - let v = Files.RelocationBatchResultSerializer().deserialize(json) - return RelocationBatchLaunch.complete(v) - case "other": - return RelocationBatchLaunch.other - default: - return RelocationBatchLaunch.other - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.RelocationBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationBatchLaunch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return RelocationBatchLaunch.asyncJobId(v) + case "complete": + let v = try Files.RelocationBatchResultSerializer().deserialize(json) + return RelocationBatchLaunch.complete(v) + case "other": + return RelocationBatchLaunch.other default: - fatalError("Failed to deserialize") + return RelocationBatchLaunch.other + } + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchLaunch.self, json: json) } } } /// The RelocationBatchResult struct - open class RelocationBatchResult: Files.FileOpsResult { + public class RelocationBatchResult: Files.FileOpsResult { /// (no description) - public let entries: Array - public init(entries: Array) { + public let entries: [Files.RelocationBatchResultData] + public init(entries: [Files.RelocationBatchResultData]) { self.entries = entries super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchResult: \(error)" + } } } - open class RelocationBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchResult) -> JSON { - let output = [ - "entries": ArraySerializer(Files.RelocationBatchResultDataSerializer()).serialize(value.entries), + + public class RelocationBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.RelocationBatchResultDataSerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationBatchResult { + + public func deserialize(_ json: JSON) throws -> RelocationBatchResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.RelocationBatchResultDataSerializer()).deserialize(dict["entries"] ?? .null) - return RelocationBatchResult(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.RelocationBatchResultDataSerializer()).deserialize(dict["entries"] ?? .null) + return RelocationBatchResult(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchResult.self, json: json) } } } /// The RelocationBatchResultData struct - open class RelocationBatchResultData: CustomStringConvertible { + public class RelocationBatchResultData: CustomStringConvertible, JSONRepresentable { /// Metadata of the relocated object. public let metadata: Files.Metadata public init(metadata: Files.Metadata) { self.metadata = metadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchResultDataSerializer().serialize(self)))" + + func json() throws -> JSON { + try RelocationBatchResultDataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchResultDataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchResultData: \(error)" + } } } - open class RelocationBatchResultDataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchResultData) -> JSON { - let output = [ - "metadata": Files.MetadataSerializer().serialize(value.metadata), + + public class RelocationBatchResultDataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchResultData) throws -> JSON { + let output = [ + "metadata": try Files.MetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationBatchResultData { + + public func deserialize(_ json: JSON) throws -> RelocationBatchResultData { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - return RelocationBatchResultData(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + return RelocationBatchResultData(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchResultData.self, json: json) } } } /// The RelocationBatchResultEntry union - public enum RelocationBatchResultEntry: CustomStringConvertible { + public enum RelocationBatchResultEntry: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case success(Files.Metadata) /// An unspecified error. @@ -6047,207 +7490,251 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try RelocationBatchResultEntrySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchResultEntrySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchResultEntrySerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchResultEntry: \(error)" + } } } - open class RelocationBatchResultEntrySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchResultEntry) -> JSON { + + public class RelocationBatchResultEntrySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchResultEntry) throws -> JSON { switch value { - case .success(let arg): - var d = ["success": Files.MetadataSerializer().serialize(arg)] - d[".tag"] = .str("success") - return .dictionary(d) - case .failure(let arg): - var d = ["failure": Files.RelocationBatchErrorEntrySerializer().serialize(arg)] - d[".tag"] = .str("failure") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationBatchResultEntry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Files.MetadataSerializer().deserialize(d["success"] ?? .null) - return RelocationBatchResultEntry.success(v) - case "failure": - let v = Files.RelocationBatchErrorEntrySerializer().deserialize(d["failure"] ?? .null) - return RelocationBatchResultEntry.failure(v) - case "other": - return RelocationBatchResultEntry.other - default: - return RelocationBatchResultEntry.other - } + case .success(let arg): + var d = try ["success": Files.MetadataSerializer().serialize(arg)] + d[".tag"] = .str("success") + return .dictionary(d) + case .failure(let arg): + var d = try ["failure": Files.RelocationBatchErrorEntrySerializer().serialize(arg)] + d[".tag"] = .str("failure") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationBatchResultEntry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Files.MetadataSerializer().deserialize(d["success"] ?? .null) + return RelocationBatchResultEntry.success(v) + case "failure": + let v = try Files.RelocationBatchErrorEntrySerializer().deserialize(d["failure"] ?? .null) + return RelocationBatchResultEntry.failure(v) + case "other": + return RelocationBatchResultEntry.other default: - fatalError("Failed to deserialize") + return RelocationBatchResultEntry.other + } + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchResultEntry.self, json: json) } } } /// Result returned by copyBatchCheckV2 or moveBatchCheckV2 that may either be in progress or completed with result /// for each entry. - public enum RelocationBatchV2JobStatus: CustomStringConvertible { + public enum RelocationBatchV2JobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The copy or move batch job has finished. case complete(Files.RelocationBatchV2Result) + func json() throws -> JSON { + try RelocationBatchV2JobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchV2JobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchV2JobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchV2JobStatus: \(error)" + } } } - open class RelocationBatchV2JobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchV2JobStatus) -> JSON { + + public class RelocationBatchV2JobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchV2JobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.RelocationBatchV2ResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationBatchV2JobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return RelocationBatchV2JobStatus.inProgress - case "complete": - let v = Files.RelocationBatchV2ResultSerializer().deserialize(json) - return RelocationBatchV2JobStatus.complete(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.RelocationBatchV2ResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationBatchV2JobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return RelocationBatchV2JobStatus.inProgress + case "complete": + let v = try Files.RelocationBatchV2ResultSerializer().deserialize(json) + return RelocationBatchV2JobStatus.complete(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RelocationBatchV2JobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchV2JobStatus.self, json: json) } } } /// Result returned by copyBatchV2 or moveBatchV2 that may either launch an asynchronous job or complete /// synchronously. - public enum RelocationBatchV2Launch: CustomStringConvertible { + public enum RelocationBatchV2Launch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) /// An unspecified error. case complete(Files.RelocationBatchV2Result) + func json() throws -> JSON { + try RelocationBatchV2LaunchSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchV2LaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchV2LaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchV2Launch: \(error)" + } } } - open class RelocationBatchV2LaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchV2Launch) -> JSON { + + public class RelocationBatchV2LaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchV2Launch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.RelocationBatchV2ResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelocationBatchV2Launch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return RelocationBatchV2Launch.asyncJobId(v) - case "complete": - let v = Files.RelocationBatchV2ResultSerializer().deserialize(json) - return RelocationBatchV2Launch.complete(v) - default: - fatalError("Unknown tag \(tag)") - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.RelocationBatchV2ResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelocationBatchV2Launch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return RelocationBatchV2Launch.asyncJobId(v) + case "complete": + let v = try Files.RelocationBatchV2ResultSerializer().deserialize(json) + return RelocationBatchV2Launch.complete(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RelocationBatchV2Launch.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchV2Launch.self, json: json) } } } /// The RelocationBatchV2Result struct - open class RelocationBatchV2Result: Files.FileOpsResult { + public class RelocationBatchV2Result: Files.FileOpsResult { /// Each entry in CopyBatchArg.entries or entries in MoveBatchArg will appear at the same position inside /// entries in RelocationBatchV2Result. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.RelocationBatchResultEntry] + public init(entries: [Files.RelocationBatchResultEntry]) { self.entries = entries super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationBatchV2ResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationBatchV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationBatchV2Result: \(error)" + } } } - open class RelocationBatchV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationBatchV2Result) -> JSON { - let output = [ - "entries": ArraySerializer(Files.RelocationBatchResultEntrySerializer()).serialize(value.entries), + + public class RelocationBatchV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationBatchV2Result) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.RelocationBatchResultEntrySerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationBatchV2Result { + + public func deserialize(_ json: JSON) throws -> RelocationBatchV2Result { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.RelocationBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) - return RelocationBatchV2Result(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.RelocationBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) + return RelocationBatchV2Result(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: RelocationBatchV2Result.self, json: json) } } } /// The RelocationResult struct - open class RelocationResult: Files.FileOpsResult { + public class RelocationResult: Files.FileOpsResult { /// Metadata of the relocated object. public let metadata: Files.Metadata public init(metadata: Files.Metadata) { self.metadata = metadata super.init() } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocationResultSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocationResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocationResult: \(error)" + } } } - open class RelocationResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocationResult) -> JSON { - let output = [ - "metadata": Files.MetadataSerializer().serialize(value.metadata), + + public class RelocationResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocationResult) throws -> JSON { + let output = [ + "metadata": try Files.MetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocationResult { + + public func deserialize(_ json: JSON) throws -> RelocationResult { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - return RelocationResult(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + return RelocationResult(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: RelocationResult.self, json: json) } } } /// The RemoveTagArg struct - open class RemoveTagArg: CustomStringConvertible { + public class RemoveTagArg: CustomStringConvertible, JSONRepresentable { /// Path to the item to tag. public let path: String /// The tag to remove. Will be automatically converted to lowercase letters. @@ -6255,36 +7742,47 @@ open class Files { public init(path: String, tagText: String) { stringValidator(pattern: "/(.|[\\r\\n])*")(path) self.path = path - stringValidator(minLength: 1, maxLength: 32, pattern: "[A-Za-z0-9_]+")(tagText) + stringValidator(minLength: 1, maxLength: 32, pattern: "[\\w]+")(tagText) self.tagText = tagText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveTagArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RemoveTagArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveTagArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveTagArg: \(error)" + } } } - open class RemoveTagArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveTagArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "tag_text": Serialization._StringSerializer.serialize(value.tagText), + + public class RemoveTagArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveTagArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "tag_text": try Serialization._StringSerializer.serialize(value.tagText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RemoveTagArg { + + public func deserialize(_ json: JSON) throws -> RemoveTagArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let tagText = Serialization._StringSerializer.deserialize(dict["tag_text"] ?? .null) - return RemoveTagArg(path: path, tagText: tagText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let tagText = try Serialization._StringSerializer.deserialize(dict["tag_text"] ?? .null) + return RemoveTagArg(path: path, tagText: tagText) + default: + throw JSONSerializerError.deserializeError(type: RemoveTagArg.self, json: json) } } } /// The RemoveTagError union - public enum RemoveTagError: CustomStringConvertible { + public enum RemoveTagError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. @@ -6292,51 +7790,61 @@ open class Files { /// That tag doesn't exist at this path. case tagNotPresent + func json() throws -> JSON { + try RemoveTagErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveTagErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveTagErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveTagError: \(error)" + } } } - open class RemoveTagErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveTagError) -> JSON { + + public class RemoveTagErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveTagError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .tagNotPresent: - var d = [String: JSON]() - d[".tag"] = .str("tag_not_present") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RemoveTagError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return RemoveTagError.path(v) - case "other": - return RemoveTagError.other - case "tag_not_present": - return RemoveTagError.tagNotPresent - default: - fatalError("Unknown tag \(tag)") - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .tagNotPresent: + var d = [String: JSON]() + d[".tag"] = .str("tag_not_present") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RemoveTagError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return RemoveTagError.path(v) + case "other": + return RemoveTagError.other + case "tag_not_present": + return RemoveTagError.tagNotPresent default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RemoveTagError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RemoveTagError.self, json: json) } } } /// The RestoreArg struct - open class RestoreArg: CustomStringConvertible { + public class RestoreArg: CustomStringConvertible, JSONRepresentable { /// The path to save the restored file. public let path: String /// The revision to restore. @@ -6347,33 +7855,44 @@ open class Files { stringValidator(minLength: 9, pattern: "[0-9a-f]+")(rev) self.rev = rev } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RestoreArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RestoreArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RestoreArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RestoreArg: \(error)" + } } } - open class RestoreArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RestoreArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "rev": Serialization._StringSerializer.serialize(value.rev), + + public class RestoreArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RestoreArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "rev": try Serialization._StringSerializer.serialize(value.rev), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RestoreArg { + + public func deserialize(_ json: JSON) throws -> RestoreArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let rev = Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) - return RestoreArg(path: path, rev: rev) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let rev = try Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) + return RestoreArg(path: path, rev: rev) + default: + throw JSONSerializerError.deserializeError(type: RestoreArg.self, json: json) } } } /// The RestoreError union - public enum RestoreError: CustomStringConvertible { + public enum RestoreError: CustomStringConvertible, JSONRepresentable { /// An error occurs when downloading metadata for the file. case pathLookup(Files.LookupError) /// An error occurs when trying to restore the file to that path. @@ -6385,64 +7904,74 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try RestoreErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RestoreErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RestoreErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RestoreError: \(error)" + } } } - open class RestoreErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RestoreError) -> JSON { + + public class RestoreErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RestoreError) throws -> JSON { switch value { - case .pathLookup(let arg): - var d = ["path_lookup": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path_lookup") - return .dictionary(d) - case .pathWrite(let arg): - var d = ["path_write": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("path_write") - return .dictionary(d) - case .invalidRevision: - var d = [String: JSON]() - d[".tag"] = .str("invalid_revision") - return .dictionary(d) - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RestoreError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path_lookup": - let v = Files.LookupErrorSerializer().deserialize(d["path_lookup"] ?? .null) - return RestoreError.pathLookup(v) - case "path_write": - let v = Files.WriteErrorSerializer().deserialize(d["path_write"] ?? .null) - return RestoreError.pathWrite(v) - case "invalid_revision": - return RestoreError.invalidRevision - case "in_progress": - return RestoreError.inProgress - case "other": - return RestoreError.other - default: - return RestoreError.other - } - default: - fatalError("Failed to deserialize") + case .pathLookup(let arg): + var d = try ["path_lookup": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path_lookup") + return .dictionary(d) + case .pathWrite(let arg): + var d = try ["path_write": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("path_write") + return .dictionary(d) + case .invalidRevision: + var d = [String: JSON]() + d[".tag"] = .str("invalid_revision") + return .dictionary(d) + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RestoreError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path_lookup": + let v = try Files.LookupErrorSerializer().deserialize(d["path_lookup"] ?? .null) + return RestoreError.pathLookup(v) + case "path_write": + let v = try Files.WriteErrorSerializer().deserialize(d["path_write"] ?? .null) + return RestoreError.pathWrite(v) + case "invalid_revision": + return RestoreError.invalidRevision + case "in_progress": + return RestoreError.inProgress + case "other": + return RestoreError.other + default: + return RestoreError.other + } + default: + throw JSONSerializerError.deserializeError(type: RestoreError.self, json: json) } } } /// The SaveCopyReferenceArg struct - open class SaveCopyReferenceArg: CustomStringConvertible { + public class SaveCopyReferenceArg: CustomStringConvertible, JSONRepresentable { /// A copy reference returned by copyReferenceGet. public let copyReference: String /// Path in the user's Dropbox that is the destination. @@ -6453,33 +7982,44 @@ open class Files { stringValidator(pattern: "/(.|[\\r\\n])*")(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SaveCopyReferenceArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SaveCopyReferenceArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SaveCopyReferenceArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SaveCopyReferenceArg: \(error)" + } } } - open class SaveCopyReferenceArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SaveCopyReferenceArg) -> JSON { - let output = [ - "copy_reference": Serialization._StringSerializer.serialize(value.copyReference), - "path": Serialization._StringSerializer.serialize(value.path), + + public class SaveCopyReferenceArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SaveCopyReferenceArg) throws -> JSON { + let output = [ + "copy_reference": try Serialization._StringSerializer.serialize(value.copyReference), + "path": try Serialization._StringSerializer.serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SaveCopyReferenceArg { + + public func deserialize(_ json: JSON) throws -> SaveCopyReferenceArg { switch json { - case .dictionary(let dict): - let copyReference = Serialization._StringSerializer.deserialize(dict["copy_reference"] ?? .null) - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - return SaveCopyReferenceArg(copyReference: copyReference, path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let copyReference = try Serialization._StringSerializer.deserialize(dict["copy_reference"] ?? .null) + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + return SaveCopyReferenceArg(copyReference: copyReference, path: path) + default: + throw JSONSerializerError.deserializeError(type: SaveCopyReferenceArg.self, json: json) } } } /// The SaveCopyReferenceError union - public enum SaveCopyReferenceError: CustomStringConvertible { + public enum SaveCopyReferenceError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.WriteError) /// The copy reference is invalid. @@ -6494,99 +8034,120 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SaveCopyReferenceErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SaveCopyReferenceErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SaveCopyReferenceErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SaveCopyReferenceError: \(error)" + } } } - open class SaveCopyReferenceErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SaveCopyReferenceError) -> JSON { + + public class SaveCopyReferenceErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SaveCopyReferenceError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .invalidCopyReference: - var d = [String: JSON]() - d[".tag"] = .str("invalid_copy_reference") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SaveCopyReferenceError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) - return SaveCopyReferenceError.path(v) - case "invalid_copy_reference": - return SaveCopyReferenceError.invalidCopyReference - case "no_permission": - return SaveCopyReferenceError.noPermission - case "not_found": - return SaveCopyReferenceError.notFound - case "too_many_files": - return SaveCopyReferenceError.tooManyFiles - case "other": - return SaveCopyReferenceError.other - default: - return SaveCopyReferenceError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .invalidCopyReference: + var d = [String: JSON]() + d[".tag"] = .str("invalid_copy_reference") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SaveCopyReferenceError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) + return SaveCopyReferenceError.path(v) + case "invalid_copy_reference": + return SaveCopyReferenceError.invalidCopyReference + case "no_permission": + return SaveCopyReferenceError.noPermission + case "not_found": + return SaveCopyReferenceError.notFound + case "too_many_files": + return SaveCopyReferenceError.tooManyFiles + case "other": + return SaveCopyReferenceError.other + default: + return SaveCopyReferenceError.other + } + default: + throw JSONSerializerError.deserializeError(type: SaveCopyReferenceError.self, json: json) } } } /// The SaveCopyReferenceResult struct - open class SaveCopyReferenceResult: CustomStringConvertible { + public class SaveCopyReferenceResult: CustomStringConvertible, JSONRepresentable { /// The metadata of the saved file or folder in the user's Dropbox. public let metadata: Files.Metadata public init(metadata: Files.Metadata) { self.metadata = metadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SaveCopyReferenceResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try SaveCopyReferenceResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SaveCopyReferenceResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SaveCopyReferenceResult: \(error)" + } } } - open class SaveCopyReferenceResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SaveCopyReferenceResult) -> JSON { - let output = [ - "metadata": Files.MetadataSerializer().serialize(value.metadata), + + public class SaveCopyReferenceResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SaveCopyReferenceResult) throws -> JSON { + let output = [ + "metadata": try Files.MetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SaveCopyReferenceResult { + + public func deserialize(_ json: JSON) throws -> SaveCopyReferenceResult { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - return SaveCopyReferenceResult(metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + return SaveCopyReferenceResult(metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: SaveCopyReferenceResult.self, json: json) } } } /// The SaveUrlArg struct - open class SaveUrlArg: CustomStringConvertible { + public class SaveUrlArg: CustomStringConvertible, JSONRepresentable { /// The path in Dropbox where the URL will be saved to. public let path: String /// The URL to be saved. @@ -6597,33 +8158,44 @@ open class Files { stringValidator()(url) self.url = url } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SaveUrlArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SaveUrlArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SaveUrlArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SaveUrlArg: \(error)" + } } } - open class SaveUrlArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SaveUrlArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "url": Serialization._StringSerializer.serialize(value.url), + + public class SaveUrlArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SaveUrlArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "url": try Serialization._StringSerializer.serialize(value.url), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SaveUrlArg { + + public func deserialize(_ json: JSON) throws -> SaveUrlArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - return SaveUrlArg(path: path, url: url) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + return SaveUrlArg(path: path, url: url) + default: + throw JSONSerializerError.deserializeError(type: SaveUrlArg.self, json: json) } } } /// The SaveUrlError union - public enum SaveUrlError: CustomStringConvertible { + public enum SaveUrlError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.WriteError) /// Failed downloading the given URL. The URL may be password-protected and the password provided was @@ -6636,63 +8208,73 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SaveUrlErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SaveUrlErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SaveUrlErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SaveUrlError: \(error)" + } } } - open class SaveUrlErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SaveUrlError) -> JSON { + + public class SaveUrlErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SaveUrlError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .downloadFailed: - var d = [String: JSON]() - d[".tag"] = .str("download_failed") - return .dictionary(d) - case .invalidUrl: - var d = [String: JSON]() - d[".tag"] = .str("invalid_url") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SaveUrlError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) - return SaveUrlError.path(v) - case "download_failed": - return SaveUrlError.downloadFailed - case "invalid_url": - return SaveUrlError.invalidUrl - case "not_found": - return SaveUrlError.notFound - case "other": - return SaveUrlError.other - default: - return SaveUrlError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .downloadFailed: + var d = [String: JSON]() + d[".tag"] = .str("download_failed") + return .dictionary(d) + case .invalidUrl: + var d = [String: JSON]() + d[".tag"] = .str("invalid_url") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SaveUrlError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) + return SaveUrlError.path(v) + case "download_failed": + return SaveUrlError.downloadFailed + case "invalid_url": + return SaveUrlError.invalidUrl + case "not_found": + return SaveUrlError.notFound + case "other": + return SaveUrlError.other + default: + return SaveUrlError.other + } + default: + throw JSONSerializerError.deserializeError(type: SaveUrlError.self, json: json) } } } /// The SaveUrlJobStatus union - public enum SaveUrlJobStatus: CustomStringConvertible { + public enum SaveUrlJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// Metadata of the file where the URL is saved to. @@ -6700,103 +8282,123 @@ open class Files { /// An unspecified error. case failed(Files.SaveUrlError) + func json() throws -> JSON { + try SaveUrlJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SaveUrlJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SaveUrlJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SaveUrlJobStatus: \(error)" + } } } - open class SaveUrlJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SaveUrlJobStatus) -> JSON { + + public class SaveUrlJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SaveUrlJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.FileMetadataSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Files.SaveUrlErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SaveUrlJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return SaveUrlJobStatus.inProgress - case "complete": - let v = Files.FileMetadataSerializer().deserialize(json) - return SaveUrlJobStatus.complete(v) - case "failed": - let v = Files.SaveUrlErrorSerializer().deserialize(d["failed"] ?? .null) - return SaveUrlJobStatus.failed(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.FileMetadataSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Files.SaveUrlErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SaveUrlJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return SaveUrlJobStatus.inProgress + case "complete": + let v = try Files.FileMetadataSerializer().deserialize(json) + return SaveUrlJobStatus.complete(v) + case "failed": + let v = try Files.SaveUrlErrorSerializer().deserialize(d["failed"] ?? .null) + return SaveUrlJobStatus.failed(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SaveUrlJobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SaveUrlJobStatus.self, json: json) } } } /// The SaveUrlResult union - public enum SaveUrlResult: CustomStringConvertible { + public enum SaveUrlResult: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) /// Metadata of the file where the URL is saved to. case complete(Files.FileMetadata) + func json() throws -> JSON { + try SaveUrlResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SaveUrlResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SaveUrlResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SaveUrlResult: \(error)" + } } } - open class SaveUrlResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SaveUrlResult) -> JSON { + + public class SaveUrlResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SaveUrlResult) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.FileMetadataSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SaveUrlResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return SaveUrlResult.asyncJobId(v) - case "complete": - let v = Files.FileMetadataSerializer().deserialize(json) - return SaveUrlResult.complete(v) - default: - fatalError("Unknown tag \(tag)") - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.FileMetadataSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SaveUrlResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return SaveUrlResult.asyncJobId(v) + case "complete": + let v = try Files.FileMetadataSerializer().deserialize(json) + return SaveUrlResult.complete(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SaveUrlResult.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SaveUrlResult.self, json: json) } } } /// The SearchArg struct - open class SearchArg: CustomStringConvertible { + public class SearchArg: CustomStringConvertible, JSONRepresentable { /// The path in the user's Dropbox to search. Should probably be a folder. public let path: String /// The string to search for. Query string may be rewritten to improve relevance of results. The string is split - /// on spaces into multiple tokens. For file name searching, the last token is used for prefix matching (i.e. - /// "bat c" matches "bat cave" but not "batman car"). + /// on spaces into multiple tokens. For file name searching, the last token is used for prefix matching + /// (i.e. "bat c" matches "bat cave" but not "batman car"). public let query: String /// The starting index within the search results (used for paging). public let start: UInt64 @@ -6808,47 +8410,58 @@ open class Files { public init(path: String, query: String, start: UInt64 = 0, maxResults: UInt64 = 100, mode: Files.SearchMode = .filename) { stringValidator(pattern: "(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/.*)?)")(path) self.path = path - stringValidator(maxLength: 1000)(query) + stringValidator(maxLength: 1_000)(query) self.query = query - comparableValidator(maxValue: 9999)(start) + comparableValidator(maxValue: 9_999)(start) self.start = start - comparableValidator(minValue: 1, maxValue: 1000)(maxResults) + comparableValidator(minValue: 1, maxValue: 1_000)(maxResults) self.maxResults = maxResults self.mode = mode } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SearchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchArg: \(error)" + } } } - open class SearchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "query": Serialization._StringSerializer.serialize(value.query), - "start": Serialization._UInt64Serializer.serialize(value.start), - "max_results": Serialization._UInt64Serializer.serialize(value.maxResults), - "mode": Files.SearchModeSerializer().serialize(value.mode), + + public class SearchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "query": try Serialization._StringSerializer.serialize(value.query), + "start": try Serialization._UInt64Serializer.serialize(value.start), + "max_results": try Serialization._UInt64Serializer.serialize(value.maxResults), + "mode": try Files.SearchModeSerializer().serialize(value.mode), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchArg { + + public func deserialize(_ json: JSON) throws -> SearchArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let query = Serialization._StringSerializer.deserialize(dict["query"] ?? .null) - let start = Serialization._UInt64Serializer.deserialize(dict["start"] ?? .number(0)) - let maxResults = Serialization._UInt64Serializer.deserialize(dict["max_results"] ?? .number(100)) - let mode = Files.SearchModeSerializer().deserialize(dict["mode"] ?? Files.SearchModeSerializer().serialize(.filename)) - return SearchArg(path: path, query: query, start: start, maxResults: maxResults, mode: mode) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let query = try Serialization._StringSerializer.deserialize(dict["query"] ?? .null) + let start = try Serialization._UInt64Serializer.deserialize(dict["start"] ?? .number(0)) + let maxResults = try Serialization._UInt64Serializer.deserialize(dict["max_results"] ?? .number(100)) + let mode = try Files.SearchModeSerializer().deserialize(dict["mode"] ?? Files.SearchModeSerializer().serialize(.filename)) + return SearchArg(path: path, query: query, start: start, maxResults: maxResults, mode: mode) + default: + throw JSONSerializerError.deserializeError(type: SearchArg.self, json: json) } } } /// The SearchError union - public enum SearchError: CustomStringConvertible { + public enum SearchError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. @@ -6858,58 +8471,68 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SearchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchError: \(error)" + } } } - open class SearchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchError) -> JSON { + + public class SearchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .invalidArgument(let arg): - var d = ["invalid_argument": NullableSerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("invalid_argument") - return .dictionary(d) - case .internalError: - var d = [String: JSON]() - d[".tag"] = .str("internal_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SearchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return SearchError.path(v) - case "invalid_argument": - let v = NullableSerializer(Serialization._StringSerializer).deserialize(d["invalid_argument"] ?? .null) - return SearchError.invalidArgument(v) - case "internal_error": - return SearchError.internalError - case "other": - return SearchError.other - default: - return SearchError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .invalidArgument(let arg): + var d = try ["invalid_argument": NullableSerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("invalid_argument") + return .dictionary(d) + case .internalError: + var d = [String: JSON]() + d[".tag"] = .str("internal_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SearchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return SearchError.path(v) + case "invalid_argument": + let v = try NullableSerializer(Serialization._StringSerializer).deserialize(d["invalid_argument"] ?? .null) + return SearchError.invalidArgument(v) + case "internal_error": + return SearchError.internalError + case "other": + return SearchError.other + default: + return SearchError.other + } + default: + throw JSONSerializerError.deserializeError(type: SearchError.self, json: json) } } } /// The SearchMatch struct - open class SearchMatch: CustomStringConvertible { + public class SearchMatch: CustomStringConvertible, JSONRepresentable { /// The type of the match. public let matchType: Files.SearchMatchType /// The metadata for the matched file or folder. @@ -6918,63 +8541,85 @@ open class Files { self.matchType = matchType self.metadata = metadata } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchMatchSerializer().serialize(self)))" + + func json() throws -> JSON { + try SearchMatchSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchMatchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchMatch: \(error)" + } } } - open class SearchMatchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchMatch) -> JSON { - let output = [ - "match_type": Files.SearchMatchTypeSerializer().serialize(value.matchType), - "metadata": Files.MetadataSerializer().serialize(value.metadata), + + public class SearchMatchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchMatch) throws -> JSON { + let output = [ + "match_type": try Files.SearchMatchTypeSerializer().serialize(value.matchType), + "metadata": try Files.MetadataSerializer().serialize(value.metadata), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchMatch { + + public func deserialize(_ json: JSON) throws -> SearchMatch { switch json { - case .dictionary(let dict): - let matchType = Files.SearchMatchTypeSerializer().deserialize(dict["match_type"] ?? .null) - let metadata = Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) - return SearchMatch(matchType: matchType, metadata: metadata) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let matchType = try Files.SearchMatchTypeSerializer().deserialize(dict["match_type"] ?? .null) + let metadata = try Files.MetadataSerializer().deserialize(dict["metadata"] ?? .null) + return SearchMatch(matchType: matchType, metadata: metadata) + default: + throw JSONSerializerError.deserializeError(type: SearchMatch.self, json: json) } } } /// The SearchMatchFieldOptions struct - open class SearchMatchFieldOptions: CustomStringConvertible { + public class SearchMatchFieldOptions: CustomStringConvertible, JSONRepresentable { /// Whether to include highlight span from file title. public let includeHighlights: Bool public init(includeHighlights: Bool = false) { self.includeHighlights = includeHighlights } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchMatchFieldOptionsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SearchMatchFieldOptionsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchMatchFieldOptionsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchMatchFieldOptions: \(error)" + } } } - open class SearchMatchFieldOptionsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchMatchFieldOptions) -> JSON { - let output = [ - "include_highlights": Serialization._BoolSerializer.serialize(value.includeHighlights), + + public class SearchMatchFieldOptionsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchMatchFieldOptions) throws -> JSON { + let output = [ + "include_highlights": try Serialization._BoolSerializer.serialize(value.includeHighlights), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchMatchFieldOptions { + + public func deserialize(_ json: JSON) throws -> SearchMatchFieldOptions { switch json { - case .dictionary(let dict): - let includeHighlights = Serialization._BoolSerializer.deserialize(dict["include_highlights"] ?? .number(0)) - return SearchMatchFieldOptions(includeHighlights: includeHighlights) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let includeHighlights = try Serialization._BoolSerializer.deserialize(dict["include_highlights"] ?? .number(0)) + return SearchMatchFieldOptions(includeHighlights: includeHighlights) + default: + throw JSONSerializerError.deserializeError(type: SearchMatchFieldOptions.self, json: json) } } } /// Indicates what type of match was found for a given item. - public enum SearchMatchType: CustomStringConvertible { + public enum SearchMatchType: CustomStringConvertible, JSONRepresentable { /// This item was matched on its file or folder name. case filename /// This item was matched based on its file contents. @@ -6982,50 +8627,60 @@ open class Files { /// This item was matched based on both its contents and its file name. case both + func json() throws -> JSON { + try SearchMatchTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchMatchTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchMatchTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchMatchType: \(error)" + } } } - open class SearchMatchTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchMatchType) -> JSON { + + public class SearchMatchTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchMatchType) throws -> JSON { switch value { - case .filename: - var d = [String: JSON]() - d[".tag"] = .str("filename") - return .dictionary(d) - case .content: - var d = [String: JSON]() - d[".tag"] = .str("content") - return .dictionary(d) - case .both: - var d = [String: JSON]() - d[".tag"] = .str("both") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SearchMatchType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "filename": - return SearchMatchType.filename - case "content": - return SearchMatchType.content - case "both": - return SearchMatchType.both - default: - fatalError("Unknown tag \(tag)") - } + case .filename: + var d = [String: JSON]() + d[".tag"] = .str("filename") + return .dictionary(d) + case .content: + var d = [String: JSON]() + d[".tag"] = .str("content") + return .dictionary(d) + case .both: + var d = [String: JSON]() + d[".tag"] = .str("both") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SearchMatchType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "filename": + return SearchMatchType.filename + case "content": + return SearchMatchType.content + case "both": + return SearchMatchType.both default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SearchMatchType.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SearchMatchType.self, json: json) } } } /// Indicates what type of match was found for a given item. - public enum SearchMatchTypeV2: CustomStringConvertible { + public enum SearchMatchTypeV2: CustomStringConvertible, JSONRepresentable { /// This item was matched on its file or folder name. case filename /// This item was matched based on its file contents. @@ -7037,102 +8692,123 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SearchMatchTypeV2Serializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchMatchTypeV2Serializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchMatchTypeV2Serializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchMatchTypeV2: \(error)" + } } } - open class SearchMatchTypeV2Serializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchMatchTypeV2) -> JSON { + + public class SearchMatchTypeV2Serializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchMatchTypeV2) throws -> JSON { switch value { - case .filename: - var d = [String: JSON]() - d[".tag"] = .str("filename") - return .dictionary(d) - case .fileContent: - var d = [String: JSON]() - d[".tag"] = .str("file_content") - return .dictionary(d) - case .filenameAndContent: - var d = [String: JSON]() - d[".tag"] = .str("filename_and_content") - return .dictionary(d) - case .imageContent: - var d = [String: JSON]() - d[".tag"] = .str("image_content") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SearchMatchTypeV2 { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "filename": - return SearchMatchTypeV2.filename - case "file_content": - return SearchMatchTypeV2.fileContent - case "filename_and_content": - return SearchMatchTypeV2.filenameAndContent - case "image_content": - return SearchMatchTypeV2.imageContent - case "other": - return SearchMatchTypeV2.other - default: - return SearchMatchTypeV2.other - } - default: - fatalError("Failed to deserialize") + case .filename: + var d = [String: JSON]() + d[".tag"] = .str("filename") + return .dictionary(d) + case .fileContent: + var d = [String: JSON]() + d[".tag"] = .str("file_content") + return .dictionary(d) + case .filenameAndContent: + var d = [String: JSON]() + d[".tag"] = .str("filename_and_content") + return .dictionary(d) + case .imageContent: + var d = [String: JSON]() + d[".tag"] = .str("image_content") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SearchMatchTypeV2 { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "filename": + return SearchMatchTypeV2.filename + case "file_content": + return SearchMatchTypeV2.fileContent + case "filename_and_content": + return SearchMatchTypeV2.filenameAndContent + case "image_content": + return SearchMatchTypeV2.imageContent + case "other": + return SearchMatchTypeV2.other + default: + return SearchMatchTypeV2.other + } + default: + throw JSONSerializerError.deserializeError(type: SearchMatchTypeV2.self, json: json) } } } /// The SearchMatchV2 struct - open class SearchMatchV2: CustomStringConvertible { + public class SearchMatchV2: CustomStringConvertible, JSONRepresentable { /// The metadata for the matched file or folder. public let metadata: Files.MetadataV2 /// The type of the match. public let matchType: Files.SearchMatchTypeV2? /// The list of HighlightSpan determines which parts of the file title should be highlighted. - public let highlightSpans: Array? - public init(metadata: Files.MetadataV2, matchType: Files.SearchMatchTypeV2? = nil, highlightSpans: Array? = nil) { + public let highlightSpans: [Files.HighlightSpan]? + public init(metadata: Files.MetadataV2, matchType: Files.SearchMatchTypeV2? = nil, highlightSpans: [Files.HighlightSpan]? = nil) { self.metadata = metadata self.matchType = matchType self.highlightSpans = highlightSpans } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchMatchV2Serializer().serialize(self)))" + + func json() throws -> JSON { + try SearchMatchV2Serializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchMatchV2Serializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchMatchV2: \(error)" + } } } - open class SearchMatchV2Serializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchMatchV2) -> JSON { - let output = [ - "metadata": Files.MetadataV2Serializer().serialize(value.metadata), - "match_type": NullableSerializer(Files.SearchMatchTypeV2Serializer()).serialize(value.matchType), - "highlight_spans": NullableSerializer(ArraySerializer(Files.HighlightSpanSerializer())).serialize(value.highlightSpans), + + public class SearchMatchV2Serializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchMatchV2) throws -> JSON { + let output = [ + "metadata": try Files.MetadataV2Serializer().serialize(value.metadata), + "match_type": try NullableSerializer(Files.SearchMatchTypeV2Serializer()).serialize(value.matchType), + "highlight_spans": try NullableSerializer(ArraySerializer(Files.HighlightSpanSerializer())).serialize(value.highlightSpans), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchMatchV2 { + + public func deserialize(_ json: JSON) throws -> SearchMatchV2 { switch json { - case .dictionary(let dict): - let metadata = Files.MetadataV2Serializer().deserialize(dict["metadata"] ?? .null) - let matchType = NullableSerializer(Files.SearchMatchTypeV2Serializer()).deserialize(dict["match_type"] ?? .null) - let highlightSpans = NullableSerializer(ArraySerializer(Files.HighlightSpanSerializer())).deserialize(dict["highlight_spans"] ?? .null) - return SearchMatchV2(metadata: metadata, matchType: matchType, highlightSpans: highlightSpans) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let metadata = try Files.MetadataV2Serializer().deserialize(dict["metadata"] ?? .null) + let matchType = try NullableSerializer(Files.SearchMatchTypeV2Serializer()).deserialize(dict["match_type"] ?? .null) + let highlightSpans = try NullableSerializer(ArraySerializer(Files.HighlightSpanSerializer())).deserialize(dict["highlight_spans"] ?? .null) + return SearchMatchV2(metadata: metadata, matchType: matchType, highlightSpans: highlightSpans) + default: + throw JSONSerializerError.deserializeError(type: SearchMatchV2.self, json: json) } } } /// The SearchMode union - public enum SearchMode: CustomStringConvertible { + public enum SearchMode: CustomStringConvertible, JSONRepresentable { /// Search file and folder names. case filename /// Search file and folder names as well as file contents. @@ -7140,50 +8816,60 @@ open class Files { /// Search for deleted file and folder names. case deletedFilename + func json() throws -> JSON { + try SearchModeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchModeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchModeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchMode: \(error)" + } } } - open class SearchModeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchMode) -> JSON { + + public class SearchModeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchMode) throws -> JSON { switch value { - case .filename: - var d = [String: JSON]() - d[".tag"] = .str("filename") - return .dictionary(d) - case .filenameAndContent: - var d = [String: JSON]() - d[".tag"] = .str("filename_and_content") - return .dictionary(d) - case .deletedFilename: - var d = [String: JSON]() - d[".tag"] = .str("deleted_filename") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SearchMode { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "filename": - return SearchMode.filename - case "filename_and_content": - return SearchMode.filenameAndContent - case "deleted_filename": - return SearchMode.deletedFilename - default: - fatalError("Unknown tag \(tag)") - } + case .filename: + var d = [String: JSON]() + d[".tag"] = .str("filename") + return .dictionary(d) + case .filenameAndContent: + var d = [String: JSON]() + d[".tag"] = .str("filename_and_content") + return .dictionary(d) + case .deletedFilename: + var d = [String: JSON]() + d[".tag"] = .str("deleted_filename") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SearchMode { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "filename": + return SearchMode.filename + case "filename_and_content": + return SearchMode.filenameAndContent + case "deleted_filename": + return SearchMode.deletedFilename default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SearchMode.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SearchMode.self, json: json) } } } /// The SearchOptions struct - open class SearchOptions: CustomStringConvertible { + public class SearchOptions: CustomStringConvertible, JSONRepresentable { /// Scopes the search to a path in the user's Dropbox. Searches the entire Dropbox if not specified. public let path: String? /// The maximum number of search results to return. @@ -7195,15 +8881,24 @@ open class Files { /// Restricts search to only match on filenames. public let filenameOnly: Bool /// Restricts search to only the extensions specified. Only supported for active file search. - public let fileExtensions: Array? + public let fileExtensions: [String]? /// Restricts search to only the file categories specified. Only supported for active file search. - public let fileCategories: Array? + public let fileCategories: [Files.FileCategory]? /// Restricts results to the given account id. public let accountId: String? - public init(path: String? = nil, maxResults: UInt64 = 100, orderBy: Files.SearchOrderBy? = nil, fileStatus: Files.FileStatus = .active, filenameOnly: Bool = false, fileExtensions: Array? = nil, fileCategories: Array? = nil, accountId: String? = nil) { + public init( + path: String? = nil, + maxResults: UInt64 = 100, + orderBy: Files.SearchOrderBy? = nil, + fileStatus: Files.FileStatus = .active, + filenameOnly: Bool = false, + fileExtensions: [String]? = nil, + fileCategories: [Files.FileCategory]? = nil, + accountId: String? = nil + ) { nullableValidator(stringValidator(pattern: "(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/.*)?)"))(path) self.path = path - comparableValidator(minValue: 1, maxValue: 1000)(maxResults) + comparableValidator(minValue: 1, maxValue: 1_000)(maxResults) self.maxResults = maxResults self.orderBy = orderBy self.fileStatus = fileStatus @@ -7214,45 +8909,65 @@ open class Files { nullableValidator(stringValidator(minLength: 40, maxLength: 40))(accountId) self.accountId = accountId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchOptionsSerializer().serialize(self)))" - } - } - open class SearchOptionsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchOptions) -> JSON { - let output = [ - "path": NullableSerializer(Serialization._StringSerializer).serialize(value.path), - "max_results": Serialization._UInt64Serializer.serialize(value.maxResults), - "order_by": NullableSerializer(Files.SearchOrderBySerializer()).serialize(value.orderBy), - "file_status": Files.FileStatusSerializer().serialize(value.fileStatus), - "filename_only": Serialization._BoolSerializer.serialize(value.filenameOnly), - "file_extensions": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.fileExtensions), - "file_categories": NullableSerializer(ArraySerializer(Files.FileCategorySerializer())).serialize(value.fileCategories), - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + + func json() throws -> JSON { + try SearchOptionsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchOptionsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchOptions: \(error)" + } + } + } + + public class SearchOptionsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchOptions) throws -> JSON { + let output = [ + "path": try NullableSerializer(Serialization._StringSerializer).serialize(value.path), + "max_results": try Serialization._UInt64Serializer.serialize(value.maxResults), + "order_by": try NullableSerializer(Files.SearchOrderBySerializer()).serialize(value.orderBy), + "file_status": try Files.FileStatusSerializer().serialize(value.fileStatus), + "filename_only": try Serialization._BoolSerializer.serialize(value.filenameOnly), + "file_extensions": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.fileExtensions), + "file_categories": try NullableSerializer(ArraySerializer(Files.FileCategorySerializer())).serialize(value.fileCategories), + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchOptions { - switch json { - case .dictionary(let dict): - let path = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) - let maxResults = Serialization._UInt64Serializer.deserialize(dict["max_results"] ?? .number(100)) - let orderBy = NullableSerializer(Files.SearchOrderBySerializer()).deserialize(dict["order_by"] ?? .null) - let fileStatus = Files.FileStatusSerializer().deserialize(dict["file_status"] ?? Files.FileStatusSerializer().serialize(.active)) - let filenameOnly = Serialization._BoolSerializer.deserialize(dict["filename_only"] ?? .number(0)) - let fileExtensions = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["file_extensions"] ?? .null) - let fileCategories = NullableSerializer(ArraySerializer(Files.FileCategorySerializer())).deserialize(dict["file_categories"] ?? .null) - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - return SearchOptions(path: path, maxResults: maxResults, orderBy: orderBy, fileStatus: fileStatus, filenameOnly: filenameOnly, fileExtensions: fileExtensions, fileCategories: fileCategories, accountId: accountId) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SearchOptions { + switch json { + case .dictionary(let dict): + let path = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) + let maxResults = try Serialization._UInt64Serializer.deserialize(dict["max_results"] ?? .number(100)) + let orderBy = try NullableSerializer(Files.SearchOrderBySerializer()).deserialize(dict["order_by"] ?? .null) + let fileStatus = try Files.FileStatusSerializer().deserialize(dict["file_status"] ?? Files.FileStatusSerializer().serialize(.active)) + let filenameOnly = try Serialization._BoolSerializer.deserialize(dict["filename_only"] ?? .number(0)) + let fileExtensions = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["file_extensions"] ?? .null) + let fileCategories = try NullableSerializer(ArraySerializer(Files.FileCategorySerializer())).deserialize(dict["file_categories"] ?? .null) + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + return SearchOptions( + path: path, + maxResults: maxResults, + orderBy: orderBy, + fileStatus: fileStatus, + filenameOnly: filenameOnly, + fileExtensions: fileExtensions, + fileCategories: fileCategories, + accountId: accountId + ) + default: + throw JSONSerializerError.deserializeError(type: SearchOptions.self, json: json) } } } /// The SearchOrderBy union - public enum SearchOrderBy: CustomStringConvertible { + public enum SearchOrderBy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case relevance /// An unspecified error. @@ -7260,92 +8975,113 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SearchOrderBySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchOrderBySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchOrderBySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchOrderBy: \(error)" + } } } - open class SearchOrderBySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchOrderBy) -> JSON { + + public class SearchOrderBySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchOrderBy) throws -> JSON { switch value { - case .relevance: - var d = [String: JSON]() - d[".tag"] = .str("relevance") - return .dictionary(d) - case .lastModifiedTime: - var d = [String: JSON]() - d[".tag"] = .str("last_modified_time") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SearchOrderBy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "relevance": - return SearchOrderBy.relevance - case "last_modified_time": - return SearchOrderBy.lastModifiedTime - case "other": - return SearchOrderBy.other - default: - return SearchOrderBy.other - } + case .relevance: + var d = [String: JSON]() + d[".tag"] = .str("relevance") + return .dictionary(d) + case .lastModifiedTime: + var d = [String: JSON]() + d[".tag"] = .str("last_modified_time") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SearchOrderBy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "relevance": + return SearchOrderBy.relevance + case "last_modified_time": + return SearchOrderBy.lastModifiedTime + case "other": + return SearchOrderBy.other default: - fatalError("Failed to deserialize") + return SearchOrderBy.other + } + default: + throw JSONSerializerError.deserializeError(type: SearchOrderBy.self, json: json) } } } /// The SearchResult struct - open class SearchResult: CustomStringConvertible { + public class SearchResult: CustomStringConvertible, JSONRepresentable { /// A list (possibly empty) of matches for the query. - public let matches: Array + public let matches: [Files.SearchMatch] /// Used for paging. If true, indicates there is another page of results available that can be fetched by /// calling search again. public let more: Bool /// Used for paging. Value to set the start argument to when calling search to fetch the next page of results. public let start: UInt64 - public init(matches: Array, more: Bool, start: UInt64) { + public init(matches: [Files.SearchMatch], more: Bool, start: UInt64) { self.matches = matches self.more = more comparableValidator()(start) self.start = start } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try SearchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchResult: \(error)" + } } } - open class SearchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchResult) -> JSON { - let output = [ - "matches": ArraySerializer(Files.SearchMatchSerializer()).serialize(value.matches), - "more": Serialization._BoolSerializer.serialize(value.more), - "start": Serialization._UInt64Serializer.serialize(value.start), + + public class SearchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchResult) throws -> JSON { + let output = [ + "matches": try ArraySerializer(Files.SearchMatchSerializer()).serialize(value.matches), + "more": try Serialization._BoolSerializer.serialize(value.more), + "start": try Serialization._UInt64Serializer.serialize(value.start), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchResult { + + public func deserialize(_ json: JSON) throws -> SearchResult { switch json { - case .dictionary(let dict): - let matches = ArraySerializer(Files.SearchMatchSerializer()).deserialize(dict["matches"] ?? .null) - let more = Serialization._BoolSerializer.deserialize(dict["more"] ?? .null) - let start = Serialization._UInt64Serializer.deserialize(dict["start"] ?? .null) - return SearchResult(matches: matches, more: more, start: start) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let matches = try ArraySerializer(Files.SearchMatchSerializer()).deserialize(dict["matches"] ?? .null) + let more = try Serialization._BoolSerializer.deserialize(dict["more"] ?? .null) + let start = try Serialization._UInt64Serializer.deserialize(dict["start"] ?? .null) + return SearchResult(matches: matches, more: more, start: start) + default: + throw JSONSerializerError.deserializeError(type: SearchResult.self, json: json) } } } /// The SearchV2Arg struct - open class SearchV2Arg: CustomStringConvertible { + public class SearchV2Arg: CustomStringConvertible, JSONRepresentable { /// The string to search for. May match across multiple fields based on the request arguments. public let query: String /// Options for more targeted search results. @@ -7354,117 +9090,155 @@ open class Files { public let matchFieldOptions: Files.SearchMatchFieldOptions? /// Deprecated and moved this option to SearchMatchFieldOptions. public let includeHighlights: Bool? - public init(query: String, options: Files.SearchOptions? = nil, matchFieldOptions: Files.SearchMatchFieldOptions? = nil, includeHighlights: Bool? = nil) { - stringValidator(maxLength: 1000)(query) + public init( + query: String, + options: Files.SearchOptions? = nil, + matchFieldOptions: Files.SearchMatchFieldOptions? = nil, + includeHighlights: Bool? = nil + ) { + stringValidator(maxLength: 1_000)(query) self.query = query self.options = options self.matchFieldOptions = matchFieldOptions self.includeHighlights = includeHighlights } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchV2ArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SearchV2ArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchV2ArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchV2Arg: \(error)" + } } } - open class SearchV2ArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchV2Arg) -> JSON { - let output = [ - "query": Serialization._StringSerializer.serialize(value.query), - "options": NullableSerializer(Files.SearchOptionsSerializer()).serialize(value.options), - "match_field_options": NullableSerializer(Files.SearchMatchFieldOptionsSerializer()).serialize(value.matchFieldOptions), - "include_highlights": NullableSerializer(Serialization._BoolSerializer).serialize(value.includeHighlights), + + public class SearchV2ArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchV2Arg) throws -> JSON { + let output = [ + "query": try Serialization._StringSerializer.serialize(value.query), + "options": try NullableSerializer(Files.SearchOptionsSerializer()).serialize(value.options), + "match_field_options": try NullableSerializer(Files.SearchMatchFieldOptionsSerializer()).serialize(value.matchFieldOptions), + "include_highlights": try NullableSerializer(Serialization._BoolSerializer).serialize(value.includeHighlights), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchV2Arg { + + public func deserialize(_ json: JSON) throws -> SearchV2Arg { switch json { - case .dictionary(let dict): - let query = Serialization._StringSerializer.deserialize(dict["query"] ?? .null) - let options = NullableSerializer(Files.SearchOptionsSerializer()).deserialize(dict["options"] ?? .null) - let matchFieldOptions = NullableSerializer(Files.SearchMatchFieldOptionsSerializer()).deserialize(dict["match_field_options"] ?? .null) - let includeHighlights = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["include_highlights"] ?? .null) - return SearchV2Arg(query: query, options: options, matchFieldOptions: matchFieldOptions, includeHighlights: includeHighlights) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let query = try Serialization._StringSerializer.deserialize(dict["query"] ?? .null) + let options = try NullableSerializer(Files.SearchOptionsSerializer()).deserialize(dict["options"] ?? .null) + let matchFieldOptions = try NullableSerializer(Files.SearchMatchFieldOptionsSerializer()).deserialize(dict["match_field_options"] ?? .null) + let includeHighlights = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["include_highlights"] ?? .null) + return SearchV2Arg(query: query, options: options, matchFieldOptions: matchFieldOptions, includeHighlights: includeHighlights) + default: + throw JSONSerializerError.deserializeError(type: SearchV2Arg.self, json: json) } } } /// The SearchV2ContinueArg struct - open class SearchV2ContinueArg: CustomStringConvertible { + public class SearchV2ContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned by your last call to searchV2. Used to fetch the next page of results. public let cursor: String public init(cursor: String) { stringValidator(minLength: 1)(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchV2ContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SearchV2ContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchV2ContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchV2ContinueArg: \(error)" + } } } - open class SearchV2ContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchV2ContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class SearchV2ContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchV2ContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchV2ContinueArg { + + public func deserialize(_ json: JSON) throws -> SearchV2ContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return SearchV2ContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return SearchV2ContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: SearchV2ContinueArg.self, json: json) } } } /// The SearchV2Result struct - open class SearchV2Result: CustomStringConvertible { + public class SearchV2Result: CustomStringConvertible, JSONRepresentable { /// A list (possibly empty) of matches for the query. - public let matches: Array + public let matches: [Files.SearchMatchV2] /// Used for paging. If true, indicates there is another page of results available that can be fetched by /// calling searchContinueV2 with the cursor. public let hasMore: Bool /// Pass the cursor into searchContinueV2 to fetch the next page of results. public let cursor: String? - public init(matches: Array, hasMore: Bool, cursor: String? = nil) { + public init(matches: [Files.SearchMatchV2], hasMore: Bool, cursor: String? = nil) { self.matches = matches self.hasMore = hasMore nullableValidator(stringValidator(minLength: 1))(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SearchV2ResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try SearchV2ResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SearchV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SearchV2Result: \(error)" + } } } - open class SearchV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SearchV2Result) -> JSON { - let output = [ - "matches": ArraySerializer(Files.SearchMatchV2Serializer()).serialize(value.matches), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class SearchV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SearchV2Result) throws -> JSON { + let output = [ + "matches": try ArraySerializer(Files.SearchMatchV2Serializer()).serialize(value.matches), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SearchV2Result { + + public func deserialize(_ json: JSON) throws -> SearchV2Result { switch json { - case .dictionary(let dict): - let matches = ArraySerializer(Files.SearchMatchV2Serializer()).deserialize(dict["matches"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return SearchV2Result(matches: matches, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let matches = try ArraySerializer(Files.SearchMatchV2Serializer()).deserialize(dict["matches"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return SearchV2Result(matches: matches, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: SearchV2Result.self, json: json) } } } /// The SharedLink struct - open class SharedLink: CustomStringConvertible { + public class SharedLink: CustomStringConvertible, JSONRepresentable { /// Shared link url. public let url: String /// Password for the shared link. @@ -7475,33 +9249,44 @@ open class Files { nullableValidator(stringValidator())(password) self.password = password } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLink: \(error)" + } } } - open class SharedLinkSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLink) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "password": NullableSerializer(Serialization._StringSerializer).serialize(value.password), + + public class SharedLinkSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLink) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "password": try NullableSerializer(Serialization._StringSerializer).serialize(value.password), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLink { + + public func deserialize(_ json: JSON) throws -> SharedLink { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let password = NullableSerializer(Serialization._StringSerializer).deserialize(dict["password"] ?? .null) - return SharedLink(url: url, password: password) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let password = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["password"] ?? .null) + return SharedLink(url: url, password: password) + default: + throw JSONSerializerError.deserializeError(type: SharedLink.self, json: json) } } } /// The SharedLinkFileInfo struct - open class SharedLinkFileInfo: CustomStringConvertible { + public class SharedLinkFileInfo: CustomStringConvertible, JSONRepresentable { /// The shared link corresponding to either a file or shared link to a folder. If it is for a folder shared /// link, we use the path param to determine for which file in the folder the view is for. public let url: String @@ -7518,35 +9303,46 @@ open class Files { nullableValidator(stringValidator())(password) self.password = password } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkFileInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkFileInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkFileInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkFileInfo: \(error)" + } } } - open class SharedLinkFileInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkFileInfo) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "path": NullableSerializer(Serialization._StringSerializer).serialize(value.path), - "password": NullableSerializer(Serialization._StringSerializer).serialize(value.password), + + public class SharedLinkFileInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkFileInfo) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "path": try NullableSerializer(Serialization._StringSerializer).serialize(value.path), + "password": try NullableSerializer(Serialization._StringSerializer).serialize(value.password), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkFileInfo { + + public func deserialize(_ json: JSON) throws -> SharedLinkFileInfo { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let path = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) - let password = NullableSerializer(Serialization._StringSerializer).deserialize(dict["password"] ?? .null) - return SharedLinkFileInfo(url: url, path: path, password: password) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let path = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) + let password = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["password"] ?? .null) + return SharedLinkFileInfo(url: url, path: path, password: password) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkFileInfo.self, json: json) } } } /// The SingleUserLock struct - open class SingleUserLock: CustomStringConvertible { + public class SingleUserLock: CustomStringConvertible, JSONRepresentable { /// The time the lock was created. public let created: Date /// The account ID of the lock holder if known. @@ -7560,66 +9356,88 @@ open class Files { nullableValidator(stringValidator())(lockHolderTeamId) self.lockHolderTeamId = lockHolderTeamId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SingleUserLockSerializer().serialize(self)))" + + func json() throws -> JSON { + try SingleUserLockSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SingleUserLockSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SingleUserLock: \(error)" + } } } - open class SingleUserLockSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SingleUserLock) -> JSON { - let output = [ - "created": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.created), - "lock_holder_account_id": Serialization._StringSerializer.serialize(value.lockHolderAccountId), - "lock_holder_team_id": NullableSerializer(Serialization._StringSerializer).serialize(value.lockHolderTeamId), + + public class SingleUserLockSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SingleUserLock) throws -> JSON { + let output = [ + "created": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.created), + "lock_holder_account_id": try Serialization._StringSerializer.serialize(value.lockHolderAccountId), + "lock_holder_team_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.lockHolderTeamId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SingleUserLock { + + public func deserialize(_ json: JSON) throws -> SingleUserLock { switch json { - case .dictionary(let dict): - let created = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["created"] ?? .null) - let lockHolderAccountId = Serialization._StringSerializer.deserialize(dict["lock_holder_account_id"] ?? .null) - let lockHolderTeamId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["lock_holder_team_id"] ?? .null) - return SingleUserLock(created: created, lockHolderAccountId: lockHolderAccountId, lockHolderTeamId: lockHolderTeamId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let created = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["created"] ?? .null) + let lockHolderAccountId = try Serialization._StringSerializer.deserialize(dict["lock_holder_account_id"] ?? .null) + let lockHolderTeamId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["lock_holder_team_id"] ?? .null) + return SingleUserLock(created: created, lockHolderAccountId: lockHolderAccountId, lockHolderTeamId: lockHolderTeamId) + default: + throw JSONSerializerError.deserializeError(type: SingleUserLock.self, json: json) } } } /// The SymlinkInfo struct - open class SymlinkInfo: CustomStringConvertible { + public class SymlinkInfo: CustomStringConvertible, JSONRepresentable { /// The target this symlink points to. public let target: String public init(target: String) { stringValidator()(target) self.target = target } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SymlinkInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try SymlinkInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SymlinkInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SymlinkInfo: \(error)" + } } } - open class SymlinkInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SymlinkInfo) -> JSON { - let output = [ - "target": Serialization._StringSerializer.serialize(value.target), + + public class SymlinkInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SymlinkInfo) throws -> JSON { + let output = [ + "target": try Serialization._StringSerializer.serialize(value.target), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SymlinkInfo { + + public func deserialize(_ json: JSON) throws -> SymlinkInfo { switch json { - case .dictionary(let dict): - let target = Serialization._StringSerializer.deserialize(dict["target"] ?? .null) - return SymlinkInfo(target: target) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let target = try Serialization._StringSerializer.deserialize(dict["target"] ?? .null) + return SymlinkInfo(target: target) + default: + throw JSONSerializerError.deserializeError(type: SymlinkInfo.self, json: json) } } } /// The SyncSetting union - public enum SyncSetting: CustomStringConvertible { + public enum SyncSetting: CustomStringConvertible, JSONRepresentable { /// On first sync to members' computers, the specified folder will follow its parent folder's setting or /// otherwise follow default sync behavior. case default_ @@ -7631,56 +9449,66 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SyncSettingSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SyncSettingSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SyncSettingSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SyncSetting: \(error)" + } } } - open class SyncSettingSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SyncSetting) -> JSON { + + public class SyncSettingSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SyncSetting) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .notSynced: - var d = [String: JSON]() - d[".tag"] = .str("not_synced") - return .dictionary(d) - case .notSyncedInactive: - var d = [String: JSON]() - d[".tag"] = .str("not_synced_inactive") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SyncSetting { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return SyncSetting.default_ - case "not_synced": - return SyncSetting.notSynced - case "not_synced_inactive": - return SyncSetting.notSyncedInactive - case "other": - return SyncSetting.other - default: - return SyncSetting.other - } - default: - fatalError("Failed to deserialize") + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .notSynced: + var d = [String: JSON]() + d[".tag"] = .str("not_synced") + return .dictionary(d) + case .notSyncedInactive: + var d = [String: JSON]() + d[".tag"] = .str("not_synced_inactive") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SyncSetting { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return SyncSetting.default_ + case "not_synced": + return SyncSetting.notSynced + case "not_synced_inactive": + return SyncSetting.notSyncedInactive + case "other": + return SyncSetting.other + default: + return SyncSetting.other + } + default: + throw JSONSerializerError.deserializeError(type: SyncSetting.self, json: json) } } } /// The SyncSettingArg union - public enum SyncSettingArg: CustomStringConvertible { + public enum SyncSettingArg: CustomStringConvertible, JSONRepresentable { /// On first sync to members' computers, the specified folder will follow its parent folder's setting or /// otherwise follow default sync behavior. case default_ @@ -7689,50 +9517,60 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SyncSettingArgSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SyncSettingArgSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SyncSettingArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SyncSettingArg: \(error)" + } } } - open class SyncSettingArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SyncSettingArg) -> JSON { + + public class SyncSettingArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SyncSettingArg) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .notSynced: - var d = [String: JSON]() - d[".tag"] = .str("not_synced") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SyncSettingArg { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return SyncSettingArg.default_ - case "not_synced": - return SyncSettingArg.notSynced - case "other": - return SyncSettingArg.other - default: - return SyncSettingArg.other - } + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .notSynced: + var d = [String: JSON]() + d[".tag"] = .str("not_synced") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SyncSettingArg { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return SyncSettingArg.default_ + case "not_synced": + return SyncSettingArg.notSynced + case "other": + return SyncSettingArg.other default: - fatalError("Failed to deserialize") + return SyncSettingArg.other + } + default: + throw JSONSerializerError.deserializeError(type: SyncSettingArg.self, json: json) } } } /// The SyncSettingsError union - public enum SyncSettingsError: CustomStringConvertible { + public enum SyncSettingsError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// Setting this combination of sync settings simultaneously is not supported. @@ -7742,101 +9580,121 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try SyncSettingsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SyncSettingsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SyncSettingsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SyncSettingsError: \(error)" + } } } - open class SyncSettingsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SyncSettingsError) -> JSON { + + public class SyncSettingsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SyncSettingsError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedCombination: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_combination") - return .dictionary(d) - case .unsupportedConfiguration: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_configuration") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SyncSettingsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return SyncSettingsError.path(v) - case "unsupported_combination": - return SyncSettingsError.unsupportedCombination - case "unsupported_configuration": - return SyncSettingsError.unsupportedConfiguration - case "other": - return SyncSettingsError.other - default: - return SyncSettingsError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedCombination: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_combination") + return .dictionary(d) + case .unsupportedConfiguration: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_configuration") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SyncSettingsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return SyncSettingsError.path(v) + case "unsupported_combination": + return SyncSettingsError.unsupportedCombination + case "unsupported_configuration": + return SyncSettingsError.unsupportedConfiguration + case "other": + return SyncSettingsError.other + default: + return SyncSettingsError.other + } + default: + throw JSONSerializerError.deserializeError(type: SyncSettingsError.self, json: json) } } } /// Tag that can be added in multiple ways. - public enum Tag: CustomStringConvertible { + public enum Tag: CustomStringConvertible, JSONRepresentable { /// Tag generated by the user. case userGeneratedTag(Files.UserGeneratedTag) /// An unspecified error. case other + func json() throws -> JSON { + try TagSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TagSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TagSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Tag: \(error)" + } } } - open class TagSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Tag) -> JSON { + + public class TagSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Tag) throws -> JSON { switch value { - case .userGeneratedTag(let arg): - var d = Serialization.getFields(Files.UserGeneratedTagSerializer().serialize(arg)) - d[".tag"] = .str("user_generated_tag") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> Tag { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_generated_tag": - let v = Files.UserGeneratedTagSerializer().deserialize(json) - return Tag.userGeneratedTag(v) - case "other": - return Tag.other - default: - return Tag.other - } + case .userGeneratedTag(let arg): + var d = try Serialization.getFields(Files.UserGeneratedTagSerializer().serialize(arg)) + d[".tag"] = .str("user_generated_tag") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> Tag { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_generated_tag": + let v = try Files.UserGeneratedTagSerializer().deserialize(json) + return Tag.userGeneratedTag(v) + case "other": + return Tag.other default: - fatalError("Failed to deserialize") + return Tag.other + } + default: + throw JSONSerializerError.deserializeError(type: Tag.self, json: json) } } } /// The ThumbnailArg struct - open class ThumbnailArg: CustomStringConvertible { + public class ThumbnailArg: CustomStringConvertible, JSONRepresentable { /// The path to the image file you want to thumbnail. public let path: String /// The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg should be @@ -7853,37 +9711,48 @@ open class Files { self.size = size self.mode = mode } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ThumbnailArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ThumbnailArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ThumbnailArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ThumbnailArg: \(error)" + } } } - open class ThumbnailArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ThumbnailArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "format": Files.ThumbnailFormatSerializer().serialize(value.format), - "size": Files.ThumbnailSizeSerializer().serialize(value.size), - "mode": Files.ThumbnailModeSerializer().serialize(value.mode), + + public class ThumbnailArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ThumbnailArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "format": try Files.ThumbnailFormatSerializer().serialize(value.format), + "size": try Files.ThumbnailSizeSerializer().serialize(value.size), + "mode": try Files.ThumbnailModeSerializer().serialize(value.mode), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ThumbnailArg { + + public func deserialize(_ json: JSON) throws -> ThumbnailArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let format = Files.ThumbnailFormatSerializer().deserialize(dict["format"] ?? Files.ThumbnailFormatSerializer().serialize(.jpeg)) - let size = Files.ThumbnailSizeSerializer().deserialize(dict["size"] ?? Files.ThumbnailSizeSerializer().serialize(.w64h64)) - let mode = Files.ThumbnailModeSerializer().deserialize(dict["mode"] ?? Files.ThumbnailModeSerializer().serialize(.strict)) - return ThumbnailArg(path: path, format: format, size: size, mode: mode) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let format = try Files.ThumbnailFormatSerializer().deserialize(dict["format"] ?? Files.ThumbnailFormatSerializer().serialize(.jpeg)) + let size = try Files.ThumbnailSizeSerializer().deserialize(dict["size"] ?? Files.ThumbnailSizeSerializer().serialize(.w64h64)) + let mode = try Files.ThumbnailModeSerializer().deserialize(dict["mode"] ?? Files.ThumbnailModeSerializer().serialize(.strict)) + return ThumbnailArg(path: path, format: format, size: size, mode: mode) + default: + throw JSONSerializerError.deserializeError(type: ThumbnailArg.self, json: json) } } } /// The ThumbnailError union - public enum ThumbnailError: CustomStringConvertible { + public enum ThumbnailError: CustomStringConvertible, JSONRepresentable { /// An error occurs when downloading metadata for the image. case path(Files.LookupError) /// The file extension doesn't allow conversion to a thumbnail. @@ -7893,100 +9762,120 @@ open class Files { /// An error occurs during thumbnail conversion. case conversionError + func json() throws -> JSON { + try ThumbnailErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ThumbnailErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ThumbnailErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ThumbnailError: \(error)" + } } } - open class ThumbnailErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ThumbnailError) -> JSON { + + public class ThumbnailErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ThumbnailError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedExtension: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_extension") - return .dictionary(d) - case .unsupportedImage: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_image") - return .dictionary(d) - case .conversionError: - var d = [String: JSON]() - d[".tag"] = .str("conversion_error") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ThumbnailError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return ThumbnailError.path(v) - case "unsupported_extension": - return ThumbnailError.unsupportedExtension - case "unsupported_image": - return ThumbnailError.unsupportedImage - case "conversion_error": - return ThumbnailError.conversionError - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedExtension: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_extension") + return .dictionary(d) + case .unsupportedImage: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_image") + return .dictionary(d) + case .conversionError: + var d = [String: JSON]() + d[".tag"] = .str("conversion_error") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ThumbnailError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return ThumbnailError.path(v) + case "unsupported_extension": + return ThumbnailError.unsupportedExtension + case "unsupported_image": + return ThumbnailError.unsupportedImage + case "conversion_error": + return ThumbnailError.conversionError + default: + throw JSONSerializerError.unknownTag(type: ThumbnailError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ThumbnailError.self, json: json) } } } /// The ThumbnailFormat union - public enum ThumbnailFormat: CustomStringConvertible { + public enum ThumbnailFormat: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case jpeg /// An unspecified error. case png + func json() throws -> JSON { + try ThumbnailFormatSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ThumbnailFormatSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ThumbnailFormatSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ThumbnailFormat: \(error)" + } } } - open class ThumbnailFormatSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ThumbnailFormat) -> JSON { + + public class ThumbnailFormatSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ThumbnailFormat) throws -> JSON { switch value { - case .jpeg: - var d = [String: JSON]() - d[".tag"] = .str("jpeg") - return .dictionary(d) - case .png: - var d = [String: JSON]() - d[".tag"] = .str("png") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ThumbnailFormat { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "jpeg": - return ThumbnailFormat.jpeg - case "png": - return ThumbnailFormat.png - default: - fatalError("Unknown tag \(tag)") - } + case .jpeg: + var d = [String: JSON]() + d[".tag"] = .str("jpeg") + return .dictionary(d) + case .png: + var d = [String: JSON]() + d[".tag"] = .str("png") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ThumbnailFormat { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "jpeg": + return ThumbnailFormat.jpeg + case "png": + return ThumbnailFormat.png default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ThumbnailFormat.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ThumbnailFormat.self, json: json) } } } /// The ThumbnailMode union - public enum ThumbnailMode: CustomStringConvertible { + public enum ThumbnailMode: CustomStringConvertible, JSONRepresentable { /// Scale down the image to fit within the given size. case strict /// Scale down the image to fit within the given size or its transpose. @@ -7994,50 +9883,60 @@ open class Files { /// Scale down the image to completely cover the given size or its transpose. case fitoneBestfit + func json() throws -> JSON { + try ThumbnailModeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ThumbnailModeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ThumbnailModeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ThumbnailMode: \(error)" + } } } - open class ThumbnailModeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ThumbnailMode) -> JSON { + + public class ThumbnailModeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ThumbnailMode) throws -> JSON { switch value { - case .strict: - var d = [String: JSON]() - d[".tag"] = .str("strict") - return .dictionary(d) - case .bestfit: - var d = [String: JSON]() - d[".tag"] = .str("bestfit") - return .dictionary(d) - case .fitoneBestfit: - var d = [String: JSON]() - d[".tag"] = .str("fitone_bestfit") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ThumbnailMode { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "strict": - return ThumbnailMode.strict - case "bestfit": - return ThumbnailMode.bestfit - case "fitone_bestfit": - return ThumbnailMode.fitoneBestfit - default: - fatalError("Unknown tag \(tag)") - } + case .strict: + var d = [String: JSON]() + d[".tag"] = .str("strict") + return .dictionary(d) + case .bestfit: + var d = [String: JSON]() + d[".tag"] = .str("bestfit") + return .dictionary(d) + case .fitoneBestfit: + var d = [String: JSON]() + d[".tag"] = .str("fitone_bestfit") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ThumbnailMode { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "strict": + return ThumbnailMode.strict + case "bestfit": + return ThumbnailMode.bestfit + case "fitone_bestfit": + return ThumbnailMode.fitoneBestfit default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ThumbnailMode.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ThumbnailMode.self, json: json) } } } /// The ThumbnailSize union - public enum ThumbnailSize: CustomStringConvertible { + public enum ThumbnailSize: CustomStringConvertible, JSONRepresentable { /// 32 by 32 px. case w32h32 /// 64 by 64 px. @@ -8057,86 +9956,96 @@ open class Files { /// 2048 by 1536 px. case w2048h1536 + func json() throws -> JSON { + try ThumbnailSizeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ThumbnailSizeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ThumbnailSizeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ThumbnailSize: \(error)" + } } } - open class ThumbnailSizeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ThumbnailSize) -> JSON { + + public class ThumbnailSizeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ThumbnailSize) throws -> JSON { switch value { - case .w32h32: - var d = [String: JSON]() - d[".tag"] = .str("w32h32") - return .dictionary(d) - case .w64h64: - var d = [String: JSON]() - d[".tag"] = .str("w64h64") - return .dictionary(d) - case .w128h128: - var d = [String: JSON]() - d[".tag"] = .str("w128h128") - return .dictionary(d) - case .w256h256: - var d = [String: JSON]() - d[".tag"] = .str("w256h256") - return .dictionary(d) - case .w480h320: - var d = [String: JSON]() - d[".tag"] = .str("w480h320") - return .dictionary(d) - case .w640h480: - var d = [String: JSON]() - d[".tag"] = .str("w640h480") - return .dictionary(d) - case .w960h640: - var d = [String: JSON]() - d[".tag"] = .str("w960h640") - return .dictionary(d) - case .w1024h768: - var d = [String: JSON]() - d[".tag"] = .str("w1024h768") - return .dictionary(d) - case .w2048h1536: - var d = [String: JSON]() - d[".tag"] = .str("w2048h1536") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ThumbnailSize { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "w32h32": - return ThumbnailSize.w32h32 - case "w64h64": - return ThumbnailSize.w64h64 - case "w128h128": - return ThumbnailSize.w128h128 - case "w256h256": - return ThumbnailSize.w256h256 - case "w480h320": - return ThumbnailSize.w480h320 - case "w640h480": - return ThumbnailSize.w640h480 - case "w960h640": - return ThumbnailSize.w960h640 - case "w1024h768": - return ThumbnailSize.w1024h768 - case "w2048h1536": - return ThumbnailSize.w2048h1536 - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .w32h32: + var d = [String: JSON]() + d[".tag"] = .str("w32h32") + return .dictionary(d) + case .w64h64: + var d = [String: JSON]() + d[".tag"] = .str("w64h64") + return .dictionary(d) + case .w128h128: + var d = [String: JSON]() + d[".tag"] = .str("w128h128") + return .dictionary(d) + case .w256h256: + var d = [String: JSON]() + d[".tag"] = .str("w256h256") + return .dictionary(d) + case .w480h320: + var d = [String: JSON]() + d[".tag"] = .str("w480h320") + return .dictionary(d) + case .w640h480: + var d = [String: JSON]() + d[".tag"] = .str("w640h480") + return .dictionary(d) + case .w960h640: + var d = [String: JSON]() + d[".tag"] = .str("w960h640") + return .dictionary(d) + case .w1024h768: + var d = [String: JSON]() + d[".tag"] = .str("w1024h768") + return .dictionary(d) + case .w2048h1536: + var d = [String: JSON]() + d[".tag"] = .str("w2048h1536") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ThumbnailSize { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "w32h32": + return ThumbnailSize.w32h32 + case "w64h64": + return ThumbnailSize.w64h64 + case "w128h128": + return ThumbnailSize.w128h128 + case "w256h256": + return ThumbnailSize.w256h256 + case "w480h320": + return ThumbnailSize.w480h320 + case "w640h480": + return ThumbnailSize.w640h480 + case "w960h640": + return ThumbnailSize.w960h640 + case "w1024h768": + return ThumbnailSize.w1024h768 + case "w2048h1536": + return ThumbnailSize.w2048h1536 + default: + throw JSONSerializerError.unknownTag(type: ThumbnailSize.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ThumbnailSize.self, json: json) } } } /// The ThumbnailV2Arg struct - open class ThumbnailV2Arg: CustomStringConvertible { + public class ThumbnailV2Arg: CustomStringConvertible, JSONRepresentable { /// Information specifying which file to preview. This could be a path to a file, a shared link pointing to a /// file, or a shared link pointing to a folder, with a relative path. public let resource: Files.PathOrLink @@ -8147,43 +10056,59 @@ open class Files { public let size: Files.ThumbnailSize /// How to resize and crop the image to achieve the desired size. public let mode: Files.ThumbnailMode - public init(resource: Files.PathOrLink, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict) { + public init( + resource: Files.PathOrLink, + format: Files.ThumbnailFormat = .jpeg, + size: Files.ThumbnailSize = .w64h64, + mode: Files.ThumbnailMode = .strict + ) { self.resource = resource self.format = format self.size = size self.mode = mode } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ThumbnailV2ArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ThumbnailV2ArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ThumbnailV2ArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ThumbnailV2Arg: \(error)" + } } } - open class ThumbnailV2ArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ThumbnailV2Arg) -> JSON { - let output = [ - "resource": Files.PathOrLinkSerializer().serialize(value.resource), - "format": Files.ThumbnailFormatSerializer().serialize(value.format), - "size": Files.ThumbnailSizeSerializer().serialize(value.size), - "mode": Files.ThumbnailModeSerializer().serialize(value.mode), + + public class ThumbnailV2ArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ThumbnailV2Arg) throws -> JSON { + let output = [ + "resource": try Files.PathOrLinkSerializer().serialize(value.resource), + "format": try Files.ThumbnailFormatSerializer().serialize(value.format), + "size": try Files.ThumbnailSizeSerializer().serialize(value.size), + "mode": try Files.ThumbnailModeSerializer().serialize(value.mode), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ThumbnailV2Arg { + + public func deserialize(_ json: JSON) throws -> ThumbnailV2Arg { switch json { - case .dictionary(let dict): - let resource = Files.PathOrLinkSerializer().deserialize(dict["resource"] ?? .null) - let format = Files.ThumbnailFormatSerializer().deserialize(dict["format"] ?? Files.ThumbnailFormatSerializer().serialize(.jpeg)) - let size = Files.ThumbnailSizeSerializer().deserialize(dict["size"] ?? Files.ThumbnailSizeSerializer().serialize(.w64h64)) - let mode = Files.ThumbnailModeSerializer().deserialize(dict["mode"] ?? Files.ThumbnailModeSerializer().serialize(.strict)) - return ThumbnailV2Arg(resource: resource, format: format, size: size, mode: mode) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let resource = try Files.PathOrLinkSerializer().deserialize(dict["resource"] ?? .null) + let format = try Files.ThumbnailFormatSerializer().deserialize(dict["format"] ?? Files.ThumbnailFormatSerializer().serialize(.jpeg)) + let size = try Files.ThumbnailSizeSerializer().deserialize(dict["size"] ?? Files.ThumbnailSizeSerializer().serialize(.w64h64)) + let mode = try Files.ThumbnailModeSerializer().deserialize(dict["mode"] ?? Files.ThumbnailModeSerializer().serialize(.strict)) + return ThumbnailV2Arg(resource: resource, format: format, size: size, mode: mode) + default: + throw JSONSerializerError.deserializeError(type: ThumbnailV2Arg.self, json: json) } } } /// The ThumbnailV2Error union - public enum ThumbnailV2Error: CustomStringConvertible { + public enum ThumbnailV2Error: CustomStringConvertible, JSONRepresentable { /// An error occurred when downloading metadata for the image. case path(Files.LookupError) /// The file extension doesn't allow conversion to a thumbnail. @@ -8199,185 +10124,251 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try ThumbnailV2ErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ThumbnailV2ErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ThumbnailV2ErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ThumbnailV2Error: \(error)" + } } } - open class ThumbnailV2ErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ThumbnailV2Error) -> JSON { + + public class ThumbnailV2ErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ThumbnailV2Error) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .unsupportedExtension: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_extension") - return .dictionary(d) - case .unsupportedImage: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_image") - return .dictionary(d) - case .conversionError: - var d = [String: JSON]() - d[".tag"] = .str("conversion_error") - return .dictionary(d) - case .accessDenied: - var d = [String: JSON]() - d[".tag"] = .str("access_denied") - return .dictionary(d) - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ThumbnailV2Error { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return ThumbnailV2Error.path(v) - case "unsupported_extension": - return ThumbnailV2Error.unsupportedExtension - case "unsupported_image": - return ThumbnailV2Error.unsupportedImage - case "conversion_error": - return ThumbnailV2Error.conversionError - case "access_denied": - return ThumbnailV2Error.accessDenied - case "not_found": - return ThumbnailV2Error.notFound - case "other": - return ThumbnailV2Error.other - default: - return ThumbnailV2Error.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .unsupportedExtension: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_extension") + return .dictionary(d) + case .unsupportedImage: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_image") + return .dictionary(d) + case .conversionError: + var d = [String: JSON]() + d[".tag"] = .str("conversion_error") + return .dictionary(d) + case .accessDenied: + var d = [String: JSON]() + d[".tag"] = .str("access_denied") + return .dictionary(d) + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ThumbnailV2Error { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return ThumbnailV2Error.path(v) + case "unsupported_extension": + return ThumbnailV2Error.unsupportedExtension + case "unsupported_image": + return ThumbnailV2Error.unsupportedImage + case "conversion_error": + return ThumbnailV2Error.conversionError + case "access_denied": + return ThumbnailV2Error.accessDenied + case "not_found": + return ThumbnailV2Error.notFound + case "other": + return ThumbnailV2Error.other + default: + return ThumbnailV2Error.other + } + default: + throw JSONSerializerError.deserializeError(type: ThumbnailV2Error.self, json: json) } } } /// The UnlockFileArg struct - open class UnlockFileArg: CustomStringConvertible { + public class UnlockFileArg: CustomStringConvertible, JSONRepresentable { /// Path in the user's Dropbox to a file. public let path: String public init(path: String) { stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)")(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnlockFileArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UnlockFileArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnlockFileArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnlockFileArg: \(error)" + } } } - open class UnlockFileArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnlockFileArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), + + public class UnlockFileArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnlockFileArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UnlockFileArg { + + public func deserialize(_ json: JSON) throws -> UnlockFileArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - return UnlockFileArg(path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + return UnlockFileArg(path: path) + default: + throw JSONSerializerError.deserializeError(type: UnlockFileArg.self, json: json) } } } /// The UnlockFileBatchArg struct - open class UnlockFileBatchArg: CustomStringConvertible { + public class UnlockFileBatchArg: CustomStringConvertible, JSONRepresentable { /// List of 'entries'. Each 'entry' contains a path of the file which will be unlocked. Duplicate path arguments /// in the batch are considered only once. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.UnlockFileArg] + public init(entries: [Files.UnlockFileArg]) { self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnlockFileBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UnlockFileBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnlockFileBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnlockFileBatchArg: \(error)" + } } } - open class UnlockFileBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnlockFileBatchArg) -> JSON { - let output = [ - "entries": ArraySerializer(Files.UnlockFileArgSerializer()).serialize(value.entries), + + public class UnlockFileBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnlockFileBatchArg) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.UnlockFileArgSerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UnlockFileBatchArg { + + public func deserialize(_ json: JSON) throws -> UnlockFileBatchArg { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.UnlockFileArgSerializer()).deserialize(dict["entries"] ?? .null) - return UnlockFileBatchArg(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.UnlockFileArgSerializer()).deserialize(dict["entries"] ?? .null) + return UnlockFileBatchArg(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: UnlockFileBatchArg.self, json: json) } } } /// The UploadArg struct - open class UploadArg: Files.CommitInfo { + public class UploadArg: Files.CommitInfo { /// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this /// hash, an error will be returned. For more information see our Content hash /// https://www.dropbox.com/developers/reference/content-hash page. public let contentHash: String? - public init(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false, contentHash: String? = nil) { + public init( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false, + contentHash: String? = nil + ) { nullableValidator(stringValidator(minLength: 64, maxLength: 64))(contentHash) self.contentHash = contentHash - super.init(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadArgSerializer().serialize(self)))" - } - } - open class UploadArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "mode": Files.WriteModeSerializer().serialize(value.mode), - "autorename": Serialization._BoolSerializer.serialize(value.autorename), - "client_modified": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.clientModified), - "mute": Serialization._BoolSerializer.serialize(value.mute), - "property_groups": NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), - "strict_conflict": Serialization._BoolSerializer.serialize(value.strictConflict), - "content_hash": NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), + super.init( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadArg: \(error)" + } + } + } + + public class UploadArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "mode": try Files.WriteModeSerializer().serialize(value.mode), + "autorename": try Serialization._BoolSerializer.serialize(value.autorename), + "client_modified": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.clientModified), + "mute": try Serialization._BoolSerializer.serialize(value.mute), + "property_groups": try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).serialize(value.propertyGroups), + "strict_conflict": try Serialization._BoolSerializer.serialize(value.strictConflict), + "content_hash": try NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadArg { - switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let mode = Files.WriteModeSerializer().deserialize(dict["mode"] ?? Files.WriteModeSerializer().serialize(.add)) - let autorename = Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) - let clientModified = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["client_modified"] ?? .null) - let mute = Serialization._BoolSerializer.deserialize(dict["mute"] ?? .number(0)) - let propertyGroups = NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())).deserialize(dict["property_groups"] ?? .null) - let strictConflict = Serialization._BoolSerializer.deserialize(dict["strict_conflict"] ?? .number(0)) - let contentHash = NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) - return UploadArg(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict, contentHash: contentHash) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> UploadArg { + switch json { + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let mode = try Files.WriteModeSerializer().deserialize(dict["mode"] ?? Files.WriteModeSerializer().serialize(.add)) + let autorename = try Serialization._BoolSerializer.deserialize(dict["autorename"] ?? .number(0)) + let clientModified = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["client_modified"] ?? .null) + let mute = try Serialization._BoolSerializer.deserialize(dict["mute"] ?? .number(0)) + let propertyGroups = try NullableSerializer(ArraySerializer(FileProperties.PropertyGroupSerializer())) + .deserialize(dict["property_groups"] ?? .null) + let strictConflict = try Serialization._BoolSerializer.deserialize(dict["strict_conflict"] ?? .number(0)) + let contentHash = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) + return UploadArg( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict, + contentHash: contentHash + ) + default: + throw JSONSerializerError.deserializeError(type: UploadArg.self, json: json) } } } /// The UploadError union - public enum UploadError: CustomStringConvertible { + public enum UploadError: CustomStringConvertible, JSONRepresentable { /// Unable to save the uploaded contents to a file. case path(Files.UploadWriteFailed) /// The supplied property group is invalid. The file has uploaded without property groups. @@ -8389,64 +10380,74 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try UploadErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadError: \(error)" + } } } - open class UploadErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadError) -> JSON { + + public class UploadErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadError) throws -> JSON { switch value { - case .path(let arg): - var d = Serialization.getFields(Files.UploadWriteFailedSerializer().serialize(arg)) - d[".tag"] = .str("path") - return .dictionary(d) - case .propertiesError(let arg): - var d = ["properties_error": FileProperties.InvalidPropertyGroupErrorSerializer().serialize(arg)] - d[".tag"] = .str("properties_error") - return .dictionary(d) - case .payloadTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("payload_too_large") - return .dictionary(d) - case .contentHashMismatch: - var d = [String: JSON]() - d[".tag"] = .str("content_hash_mismatch") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.UploadWriteFailedSerializer().deserialize(json) - return UploadError.path(v) - case "properties_error": - let v = FileProperties.InvalidPropertyGroupErrorSerializer().deserialize(d["properties_error"] ?? .null) - return UploadError.propertiesError(v) - case "payload_too_large": - return UploadError.payloadTooLarge - case "content_hash_mismatch": - return UploadError.contentHashMismatch - case "other": - return UploadError.other - default: - return UploadError.other - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try Serialization.getFields(Files.UploadWriteFailedSerializer().serialize(arg)) + d[".tag"] = .str("path") + return .dictionary(d) + case .propertiesError(let arg): + var d = try ["properties_error": FileProperties.InvalidPropertyGroupErrorSerializer().serialize(arg)] + d[".tag"] = .str("properties_error") + return .dictionary(d) + case .payloadTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("payload_too_large") + return .dictionary(d) + case .contentHashMismatch: + var d = [String: JSON]() + d[".tag"] = .str("content_hash_mismatch") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.UploadWriteFailedSerializer().deserialize(json) + return UploadError.path(v) + case "properties_error": + let v = try FileProperties.InvalidPropertyGroupErrorSerializer().deserialize(d["properties_error"] ?? .null) + return UploadError.propertiesError(v) + case "payload_too_large": + return UploadError.payloadTooLarge + case "content_hash_mismatch": + return UploadError.contentHashMismatch + case "other": + return UploadError.other + default: + return UploadError.other + } + default: + throw JSONSerializerError.deserializeError(type: UploadError.self, json: json) } } } /// The UploadSessionAppendArg struct - open class UploadSessionAppendArg: CustomStringConvertible { + public class UploadSessionAppendArg: CustomStringConvertible, JSONRepresentable { /// Contains the upload session ID and the offset. public let cursor: Files.UploadSessionCursor /// If true, the current session will be closed, at which point you won't be able to call uploadSessionAppendV2 @@ -8462,40 +10463,51 @@ open class Files { nullableValidator(stringValidator(minLength: 64, maxLength: 64))(contentHash) self.contentHash = contentHash } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionAppendArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionAppendArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionAppendArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionAppendArg: \(error)" + } } } - open class UploadSessionAppendArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionAppendArg) -> JSON { - let output = [ - "cursor": Files.UploadSessionCursorSerializer().serialize(value.cursor), - "close": Serialization._BoolSerializer.serialize(value.close), - "content_hash": NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), + + public class UploadSessionAppendArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionAppendArg) throws -> JSON { + let output = [ + "cursor": try Files.UploadSessionCursorSerializer().serialize(value.cursor), + "close": try Serialization._BoolSerializer.serialize(value.close), + "content_hash": try NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionAppendArg { + + public func deserialize(_ json: JSON) throws -> UploadSessionAppendArg { switch json { - case .dictionary(let dict): - let cursor = Files.UploadSessionCursorSerializer().deserialize(dict["cursor"] ?? .null) - let close = Serialization._BoolSerializer.deserialize(dict["close"] ?? .number(0)) - let contentHash = NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) - return UploadSessionAppendArg(cursor: cursor, close: close, contentHash: contentHash) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Files.UploadSessionCursorSerializer().deserialize(dict["cursor"] ?? .null) + let close = try Serialization._BoolSerializer.deserialize(dict["close"] ?? .number(0)) + let contentHash = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) + return UploadSessionAppendArg(cursor: cursor, close: close, contentHash: contentHash) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionAppendArg.self, json: json) } } } /// The UploadSessionLookupError union - public enum UploadSessionLookupError: CustomStringConvertible { + public enum UploadSessionLookupError: CustomStringConvertible, JSONRepresentable { /// The upload session ID was not found or has expired. Upload sessions are valid for 7 days. case notFound /// The specified offset was incorrect. See the value for the correct offset. This error may occur when a - /// previous request was received and processed successfully but the client did not receive the response, e.g. - /// due to a network error. + /// previous request was received and processed successfully but the client did not receive the + /// response, e.g. due to a network error. case incorrectOffset(Files.UploadSessionOffsetError) /// You are attempting to append data to an upload session that has already been closed (i.e. committed). case closed @@ -8513,92 +10525,102 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try UploadSessionLookupErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionLookupErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionLookupErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionLookupError: \(error)" + } } } - open class UploadSessionLookupErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionLookupError) -> JSON { + + public class UploadSessionLookupErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionLookupError) throws -> JSON { switch value { - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .incorrectOffset(let arg): - var d = Serialization.getFields(Files.UploadSessionOffsetErrorSerializer().serialize(arg)) - d[".tag"] = .str("incorrect_offset") - return .dictionary(d) - case .closed: - var d = [String: JSON]() - d[".tag"] = .str("closed") - return .dictionary(d) - case .notClosed: - var d = [String: JSON]() - d[".tag"] = .str("not_closed") - return .dictionary(d) - case .tooLarge: - var d = [String: JSON]() - d[".tag"] = .str("too_large") - return .dictionary(d) - case .concurrentSessionInvalidOffset: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_invalid_offset") - return .dictionary(d) - case .concurrentSessionInvalidDataSize: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_invalid_data_size") - return .dictionary(d) - case .payloadTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("payload_too_large") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionLookupError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "not_found": - return UploadSessionLookupError.notFound - case "incorrect_offset": - let v = Files.UploadSessionOffsetErrorSerializer().deserialize(json) - return UploadSessionLookupError.incorrectOffset(v) - case "closed": - return UploadSessionLookupError.closed - case "not_closed": - return UploadSessionLookupError.notClosed - case "too_large": - return UploadSessionLookupError.tooLarge - case "concurrent_session_invalid_offset": - return UploadSessionLookupError.concurrentSessionInvalidOffset - case "concurrent_session_invalid_data_size": - return UploadSessionLookupError.concurrentSessionInvalidDataSize - case "payload_too_large": - return UploadSessionLookupError.payloadTooLarge - case "other": - return UploadSessionLookupError.other - default: - return UploadSessionLookupError.other - } - default: - fatalError("Failed to deserialize") + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .incorrectOffset(let arg): + var d = try Serialization.getFields(Files.UploadSessionOffsetErrorSerializer().serialize(arg)) + d[".tag"] = .str("incorrect_offset") + return .dictionary(d) + case .closed: + var d = [String: JSON]() + d[".tag"] = .str("closed") + return .dictionary(d) + case .notClosed: + var d = [String: JSON]() + d[".tag"] = .str("not_closed") + return .dictionary(d) + case .tooLarge: + var d = [String: JSON]() + d[".tag"] = .str("too_large") + return .dictionary(d) + case .concurrentSessionInvalidOffset: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_invalid_offset") + return .dictionary(d) + case .concurrentSessionInvalidDataSize: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_invalid_data_size") + return .dictionary(d) + case .payloadTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("payload_too_large") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionLookupError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "not_found": + return UploadSessionLookupError.notFound + case "incorrect_offset": + let v = try Files.UploadSessionOffsetErrorSerializer().deserialize(json) + return UploadSessionLookupError.incorrectOffset(v) + case "closed": + return UploadSessionLookupError.closed + case "not_closed": + return UploadSessionLookupError.notClosed + case "too_large": + return UploadSessionLookupError.tooLarge + case "concurrent_session_invalid_offset": + return UploadSessionLookupError.concurrentSessionInvalidOffset + case "concurrent_session_invalid_data_size": + return UploadSessionLookupError.concurrentSessionInvalidDataSize + case "payload_too_large": + return UploadSessionLookupError.payloadTooLarge + case "other": + return UploadSessionLookupError.other + default: + return UploadSessionLookupError.other + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionLookupError.self, json: json) } } } /// The UploadSessionAppendError union - public enum UploadSessionAppendError: CustomStringConvertible { + public enum UploadSessionAppendError: CustomStringConvertible, JSONRepresentable { /// The upload session ID was not found or has expired. Upload sessions are valid for 7 days. case notFound /// The specified offset was incorrect. See the value for the correct offset. This error may occur when a - /// previous request was received and processed successfully but the client did not receive the response, e.g. - /// due to a network error. + /// previous request was received and processed successfully but the client did not receive the + /// response, e.g. due to a network error. case incorrectOffset(Files.UploadSessionOffsetError) /// You are attempting to append data to an upload session that has already been closed (i.e. committed). case closed @@ -8618,93 +10640,103 @@ open class Files { /// The content received by the Dropbox server in this call does not match the provided content hash. case contentHashMismatch + func json() throws -> JSON { + try UploadSessionAppendErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionAppendErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionAppendErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionAppendError: \(error)" + } } } - open class UploadSessionAppendErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionAppendError) -> JSON { + + public class UploadSessionAppendErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionAppendError) throws -> JSON { switch value { - case .notFound: - var d = [String: JSON]() - d[".tag"] = .str("not_found") - return .dictionary(d) - case .incorrectOffset(let arg): - var d = Serialization.getFields(Files.UploadSessionOffsetErrorSerializer().serialize(arg)) - d[".tag"] = .str("incorrect_offset") - return .dictionary(d) - case .closed: - var d = [String: JSON]() - d[".tag"] = .str("closed") - return .dictionary(d) - case .notClosed: - var d = [String: JSON]() - d[".tag"] = .str("not_closed") - return .dictionary(d) - case .tooLarge: - var d = [String: JSON]() - d[".tag"] = .str("too_large") - return .dictionary(d) - case .concurrentSessionInvalidOffset: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_invalid_offset") - return .dictionary(d) - case .concurrentSessionInvalidDataSize: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_invalid_data_size") - return .dictionary(d) - case .payloadTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("payload_too_large") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .contentHashMismatch: - var d = [String: JSON]() - d[".tag"] = .str("content_hash_mismatch") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionAppendError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "not_found": - return UploadSessionAppendError.notFound - case "incorrect_offset": - let v = Files.UploadSessionOffsetErrorSerializer().deserialize(json) - return UploadSessionAppendError.incorrectOffset(v) - case "closed": - return UploadSessionAppendError.closed - case "not_closed": - return UploadSessionAppendError.notClosed - case "too_large": - return UploadSessionAppendError.tooLarge - case "concurrent_session_invalid_offset": - return UploadSessionAppendError.concurrentSessionInvalidOffset - case "concurrent_session_invalid_data_size": - return UploadSessionAppendError.concurrentSessionInvalidDataSize - case "payload_too_large": - return UploadSessionAppendError.payloadTooLarge - case "other": - return UploadSessionAppendError.other - case "content_hash_mismatch": - return UploadSessionAppendError.contentHashMismatch - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .notFound: + var d = [String: JSON]() + d[".tag"] = .str("not_found") + return .dictionary(d) + case .incorrectOffset(let arg): + var d = try Serialization.getFields(Files.UploadSessionOffsetErrorSerializer().serialize(arg)) + d[".tag"] = .str("incorrect_offset") + return .dictionary(d) + case .closed: + var d = [String: JSON]() + d[".tag"] = .str("closed") + return .dictionary(d) + case .notClosed: + var d = [String: JSON]() + d[".tag"] = .str("not_closed") + return .dictionary(d) + case .tooLarge: + var d = [String: JSON]() + d[".tag"] = .str("too_large") + return .dictionary(d) + case .concurrentSessionInvalidOffset: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_invalid_offset") + return .dictionary(d) + case .concurrentSessionInvalidDataSize: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_invalid_data_size") + return .dictionary(d) + case .payloadTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("payload_too_large") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .contentHashMismatch: + var d = [String: JSON]() + d[".tag"] = .str("content_hash_mismatch") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionAppendError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "not_found": + return UploadSessionAppendError.notFound + case "incorrect_offset": + let v = try Files.UploadSessionOffsetErrorSerializer().deserialize(json) + return UploadSessionAppendError.incorrectOffset(v) + case "closed": + return UploadSessionAppendError.closed + case "not_closed": + return UploadSessionAppendError.notClosed + case "too_large": + return UploadSessionAppendError.tooLarge + case "concurrent_session_invalid_offset": + return UploadSessionAppendError.concurrentSessionInvalidOffset + case "concurrent_session_invalid_data_size": + return UploadSessionAppendError.concurrentSessionInvalidDataSize + case "payload_too_large": + return UploadSessionAppendError.payloadTooLarge + case "other": + return UploadSessionAppendError.other + case "content_hash_mismatch": + return UploadSessionAppendError.contentHashMismatch + default: + throw JSONSerializerError.unknownTag(type: UploadSessionAppendError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionAppendError.self, json: json) } } } /// The UploadSessionCursor struct - open class UploadSessionCursor: CustomStringConvertible { + public class UploadSessionCursor: CustomStringConvertible, JSONRepresentable { /// The upload session ID (returned by uploadSessionStart). public let sessionId: String /// Offset in bytes at which data should be appended. We use this to make sure upload data isn't lost or @@ -8716,33 +10748,44 @@ open class Files { comparableValidator()(offset) self.offset = offset } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionCursorSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionCursorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionCursorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionCursor: \(error)" + } } } - open class UploadSessionCursorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionCursor) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), - "offset": Serialization._UInt64Serializer.serialize(value.offset), + + public class UploadSessionCursorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionCursor) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), + "offset": try Serialization._UInt64Serializer.serialize(value.offset), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionCursor { + + public func deserialize(_ json: JSON) throws -> UploadSessionCursor { switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - let offset = Serialization._UInt64Serializer.deserialize(dict["offset"] ?? .null) - return UploadSessionCursor(sessionId: sessionId, offset: offset) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + let offset = try Serialization._UInt64Serializer.deserialize(dict["offset"] ?? .null) + return UploadSessionCursor(sessionId: sessionId, offset: offset) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionCursor.self, json: json) } } } /// The UploadSessionFinishArg struct - open class UploadSessionFinishArg: CustomStringConvertible { + public class UploadSessionFinishArg: CustomStringConvertible, JSONRepresentable { /// Contains the upload session ID and the offset. public let cursor: Files.UploadSessionCursor /// Contains the path and other optional modifiers for the commit. @@ -8757,110 +10800,142 @@ open class Files { nullableValidator(stringValidator(minLength: 64, maxLength: 64))(contentHash) self.contentHash = contentHash } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionFinishArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionFinishArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionFinishArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionFinishArg: \(error)" + } } } - open class UploadSessionFinishArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionFinishArg) -> JSON { - let output = [ - "cursor": Files.UploadSessionCursorSerializer().serialize(value.cursor), - "commit": Files.CommitInfoSerializer().serialize(value.commit), - "content_hash": NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), + + public class UploadSessionFinishArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionFinishArg) throws -> JSON { + let output = [ + "cursor": try Files.UploadSessionCursorSerializer().serialize(value.cursor), + "commit": try Files.CommitInfoSerializer().serialize(value.commit), + "content_hash": try NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionFinishArg { + + public func deserialize(_ json: JSON) throws -> UploadSessionFinishArg { switch json { - case .dictionary(let dict): - let cursor = Files.UploadSessionCursorSerializer().deserialize(dict["cursor"] ?? .null) - let commit = Files.CommitInfoSerializer().deserialize(dict["commit"] ?? .null) - let contentHash = NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) - return UploadSessionFinishArg(cursor: cursor, commit: commit, contentHash: contentHash) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Files.UploadSessionCursorSerializer().deserialize(dict["cursor"] ?? .null) + let commit = try Files.CommitInfoSerializer().deserialize(dict["commit"] ?? .null) + let contentHash = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) + return UploadSessionFinishArg(cursor: cursor, commit: commit, contentHash: contentHash) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionFinishArg.self, json: json) } } } /// The UploadSessionFinishBatchArg struct - open class UploadSessionFinishBatchArg: CustomStringConvertible { + public class UploadSessionFinishBatchArg: CustomStringConvertible, JSONRepresentable { /// Commit information for each file in the batch. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.UploadSessionFinishArg] + public init(entries: [Files.UploadSessionFinishArg]) { self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionFinishBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionFinishBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionFinishBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionFinishBatchArg: \(error)" + } } } - open class UploadSessionFinishBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionFinishBatchArg) -> JSON { - let output = [ - "entries": ArraySerializer(Files.UploadSessionFinishArgSerializer()).serialize(value.entries), + + public class UploadSessionFinishBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionFinishBatchArg) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.UploadSessionFinishArgSerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionFinishBatchArg { + + public func deserialize(_ json: JSON) throws -> UploadSessionFinishBatchArg { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.UploadSessionFinishArgSerializer()).deserialize(dict["entries"] ?? .null) - return UploadSessionFinishBatchArg(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.UploadSessionFinishArgSerializer()).deserialize(dict["entries"] ?? .null) + return UploadSessionFinishBatchArg(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionFinishBatchArg.self, json: json) } } } /// The UploadSessionFinishBatchJobStatus union - public enum UploadSessionFinishBatchJobStatus: CustomStringConvertible { + public enum UploadSessionFinishBatchJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The uploadSessionFinishBatch has finished. case complete(Files.UploadSessionFinishBatchResult) + func json() throws -> JSON { + try UploadSessionFinishBatchJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionFinishBatchJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionFinishBatchJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionFinishBatchJobStatus: \(error)" + } } } - open class UploadSessionFinishBatchJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionFinishBatchJobStatus) -> JSON { + + public class UploadSessionFinishBatchJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionFinishBatchJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.UploadSessionFinishBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionFinishBatchJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return UploadSessionFinishBatchJobStatus.inProgress - case "complete": - let v = Files.UploadSessionFinishBatchResultSerializer().deserialize(json) - return UploadSessionFinishBatchJobStatus.complete(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.UploadSessionFinishBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionFinishBatchJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return UploadSessionFinishBatchJobStatus.inProgress + case "complete": + let v = try Files.UploadSessionFinishBatchResultSerializer().deserialize(json) + return UploadSessionFinishBatchJobStatus.complete(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: UploadSessionFinishBatchJobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionFinishBatchJobStatus.self, json: json) } } } /// Result returned by uploadSessionFinishBatch that may either launch an asynchronous job or complete /// synchronously. - public enum UploadSessionFinishBatchLaunch: CustomStringConvertible { + public enum UploadSessionFinishBatchLaunch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) @@ -8869,128 +10944,159 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try UploadSessionFinishBatchLaunchSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionFinishBatchLaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionFinishBatchLaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionFinishBatchLaunch: \(error)" + } } } - open class UploadSessionFinishBatchLaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionFinishBatchLaunch) -> JSON { + + public class UploadSessionFinishBatchLaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionFinishBatchLaunch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Files.UploadSessionFinishBatchResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionFinishBatchLaunch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return UploadSessionFinishBatchLaunch.asyncJobId(v) - case "complete": - let v = Files.UploadSessionFinishBatchResultSerializer().deserialize(json) - return UploadSessionFinishBatchLaunch.complete(v) - case "other": - return UploadSessionFinishBatchLaunch.other - default: - return UploadSessionFinishBatchLaunch.other - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Files.UploadSessionFinishBatchResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionFinishBatchLaunch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return UploadSessionFinishBatchLaunch.asyncJobId(v) + case "complete": + let v = try Files.UploadSessionFinishBatchResultSerializer().deserialize(json) + return UploadSessionFinishBatchLaunch.complete(v) + case "other": + return UploadSessionFinishBatchLaunch.other default: - fatalError("Failed to deserialize") + return UploadSessionFinishBatchLaunch.other + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionFinishBatchLaunch.self, json: json) } } } /// The UploadSessionFinishBatchResult struct - open class UploadSessionFinishBatchResult: CustomStringConvertible { + public class UploadSessionFinishBatchResult: CustomStringConvertible, JSONRepresentable { /// Each entry in entries in UploadSessionFinishBatchArg will appear at the same position inside entries in /// UploadSessionFinishBatchResult. - public let entries: Array - public init(entries: Array) { + public let entries: [Files.UploadSessionFinishBatchResultEntry] + public init(entries: [Files.UploadSessionFinishBatchResultEntry]) { self.entries = entries } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionFinishBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionFinishBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionFinishBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionFinishBatchResult: \(error)" + } } } - open class UploadSessionFinishBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionFinishBatchResult) -> JSON { - let output = [ - "entries": ArraySerializer(Files.UploadSessionFinishBatchResultEntrySerializer()).serialize(value.entries), + + public class UploadSessionFinishBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionFinishBatchResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Files.UploadSessionFinishBatchResultEntrySerializer()).serialize(value.entries), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionFinishBatchResult { + + public func deserialize(_ json: JSON) throws -> UploadSessionFinishBatchResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Files.UploadSessionFinishBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) - return UploadSessionFinishBatchResult(entries: entries) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Files.UploadSessionFinishBatchResultEntrySerializer()).deserialize(dict["entries"] ?? .null) + return UploadSessionFinishBatchResult(entries: entries) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionFinishBatchResult.self, json: json) } } } /// The UploadSessionFinishBatchResultEntry union - public enum UploadSessionFinishBatchResultEntry: CustomStringConvertible { + public enum UploadSessionFinishBatchResultEntry: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case success(Files.FileMetadata) /// An unspecified error. case failure(Files.UploadSessionFinishError) + func json() throws -> JSON { + try UploadSessionFinishBatchResultEntrySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionFinishBatchResultEntrySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionFinishBatchResultEntrySerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionFinishBatchResultEntry: \(error)" + } } } - open class UploadSessionFinishBatchResultEntrySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionFinishBatchResultEntry) -> JSON { + + public class UploadSessionFinishBatchResultEntrySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionFinishBatchResultEntry) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Files.FileMetadataSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .failure(let arg): - var d = ["failure": Files.UploadSessionFinishErrorSerializer().serialize(arg)] - d[".tag"] = .str("failure") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionFinishBatchResultEntry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Files.FileMetadataSerializer().deserialize(json) - return UploadSessionFinishBatchResultEntry.success(v) - case "failure": - let v = Files.UploadSessionFinishErrorSerializer().deserialize(d["failure"] ?? .null) - return UploadSessionFinishBatchResultEntry.failure(v) - default: - fatalError("Unknown tag \(tag)") - } + case .success(let arg): + var d = try Serialization.getFields(Files.FileMetadataSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .failure(let arg): + var d = try ["failure": Files.UploadSessionFinishErrorSerializer().serialize(arg)] + d[".tag"] = .str("failure") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionFinishBatchResultEntry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Files.FileMetadataSerializer().deserialize(json) + return UploadSessionFinishBatchResultEntry.success(v) + case "failure": + let v = try Files.UploadSessionFinishErrorSerializer().deserialize(d["failure"] ?? .null) + return UploadSessionFinishBatchResultEntry.failure(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: UploadSessionFinishBatchResultEntry.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionFinishBatchResultEntry.self, json: json) } } } /// The UploadSessionFinishError union - public enum UploadSessionFinishError: CustomStringConvertible { + public enum UploadSessionFinishError: CustomStringConvertible, JSONRepresentable { /// The session arguments are incorrect; the value explains the reason. case lookupFailed(Files.UploadSessionLookupError) /// Unable to save the uploaded contents to a file. Data has already been appended to the upload session. Please @@ -9016,132 +11122,153 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try UploadSessionFinishErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionFinishErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionFinishErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionFinishError: \(error)" + } } } - open class UploadSessionFinishErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionFinishError) -> JSON { + + public class UploadSessionFinishErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionFinishError) throws -> JSON { switch value { - case .lookupFailed(let arg): - var d = ["lookup_failed": Files.UploadSessionLookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("lookup_failed") - return .dictionary(d) - case .path(let arg): - var d = ["path": Files.WriteErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .propertiesError(let arg): - var d = ["properties_error": FileProperties.InvalidPropertyGroupErrorSerializer().serialize(arg)] - d[".tag"] = .str("properties_error") - return .dictionary(d) - case .tooManySharedFolderTargets: - var d = [String: JSON]() - d[".tag"] = .str("too_many_shared_folder_targets") - return .dictionary(d) - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - case .concurrentSessionDataNotAllowed: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_data_not_allowed") - return .dictionary(d) - case .concurrentSessionNotClosed: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_not_closed") - return .dictionary(d) - case .concurrentSessionMissingData: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_missing_data") - return .dictionary(d) - case .payloadTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("payload_too_large") - return .dictionary(d) - case .contentHashMismatch: - var d = [String: JSON]() - d[".tag"] = .str("content_hash_mismatch") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionFinishError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "lookup_failed": - let v = Files.UploadSessionLookupErrorSerializer().deserialize(d["lookup_failed"] ?? .null) - return UploadSessionFinishError.lookupFailed(v) - case "path": - let v = Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) - return UploadSessionFinishError.path(v) - case "properties_error": - let v = FileProperties.InvalidPropertyGroupErrorSerializer().deserialize(d["properties_error"] ?? .null) - return UploadSessionFinishError.propertiesError(v) - case "too_many_shared_folder_targets": - return UploadSessionFinishError.tooManySharedFolderTargets - case "too_many_write_operations": - return UploadSessionFinishError.tooManyWriteOperations - case "concurrent_session_data_not_allowed": - return UploadSessionFinishError.concurrentSessionDataNotAllowed - case "concurrent_session_not_closed": - return UploadSessionFinishError.concurrentSessionNotClosed - case "concurrent_session_missing_data": - return UploadSessionFinishError.concurrentSessionMissingData - case "payload_too_large": - return UploadSessionFinishError.payloadTooLarge - case "content_hash_mismatch": - return UploadSessionFinishError.contentHashMismatch - case "other": - return UploadSessionFinishError.other - default: - return UploadSessionFinishError.other - } - default: - fatalError("Failed to deserialize") + case .lookupFailed(let arg): + var d = try ["lookup_failed": Files.UploadSessionLookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("lookup_failed") + return .dictionary(d) + case .path(let arg): + var d = try ["path": Files.WriteErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .propertiesError(let arg): + var d = try ["properties_error": FileProperties.InvalidPropertyGroupErrorSerializer().serialize(arg)] + d[".tag"] = .str("properties_error") + return .dictionary(d) + case .tooManySharedFolderTargets: + var d = [String: JSON]() + d[".tag"] = .str("too_many_shared_folder_targets") + return .dictionary(d) + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + case .concurrentSessionDataNotAllowed: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_data_not_allowed") + return .dictionary(d) + case .concurrentSessionNotClosed: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_not_closed") + return .dictionary(d) + case .concurrentSessionMissingData: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_missing_data") + return .dictionary(d) + case .payloadTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("payload_too_large") + return .dictionary(d) + case .contentHashMismatch: + var d = [String: JSON]() + d[".tag"] = .str("content_hash_mismatch") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionFinishError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "lookup_failed": + let v = try Files.UploadSessionLookupErrorSerializer().deserialize(d["lookup_failed"] ?? .null) + return UploadSessionFinishError.lookupFailed(v) + case "path": + let v = try Files.WriteErrorSerializer().deserialize(d["path"] ?? .null) + return UploadSessionFinishError.path(v) + case "properties_error": + let v = try FileProperties.InvalidPropertyGroupErrorSerializer().deserialize(d["properties_error"] ?? .null) + return UploadSessionFinishError.propertiesError(v) + case "too_many_shared_folder_targets": + return UploadSessionFinishError.tooManySharedFolderTargets + case "too_many_write_operations": + return UploadSessionFinishError.tooManyWriteOperations + case "concurrent_session_data_not_allowed": + return UploadSessionFinishError.concurrentSessionDataNotAllowed + case "concurrent_session_not_closed": + return UploadSessionFinishError.concurrentSessionNotClosed + case "concurrent_session_missing_data": + return UploadSessionFinishError.concurrentSessionMissingData + case "payload_too_large": + return UploadSessionFinishError.payloadTooLarge + case "content_hash_mismatch": + return UploadSessionFinishError.contentHashMismatch + case "other": + return UploadSessionFinishError.other + default: + return UploadSessionFinishError.other + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionFinishError.self, json: json) } } } /// The UploadSessionOffsetError struct - open class UploadSessionOffsetError: CustomStringConvertible { + public class UploadSessionOffsetError: CustomStringConvertible, JSONRepresentable { /// The offset up to which data has been collected. public let correctOffset: UInt64 public init(correctOffset: UInt64) { comparableValidator()(correctOffset) self.correctOffset = correctOffset } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionOffsetErrorSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionOffsetErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionOffsetErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionOffsetError: \(error)" + } } } - open class UploadSessionOffsetErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionOffsetError) -> JSON { - let output = [ - "correct_offset": Serialization._UInt64Serializer.serialize(value.correctOffset), + + public class UploadSessionOffsetErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionOffsetError) throws -> JSON { + let output = [ + "correct_offset": try Serialization._UInt64Serializer.serialize(value.correctOffset), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionOffsetError { + + public func deserialize(_ json: JSON) throws -> UploadSessionOffsetError { switch json { - case .dictionary(let dict): - let correctOffset = Serialization._UInt64Serializer.deserialize(dict["correct_offset"] ?? .null) - return UploadSessionOffsetError(correctOffset: correctOffset) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let correctOffset = try Serialization._UInt64Serializer.deserialize(dict["correct_offset"] ?? .null) + return UploadSessionOffsetError(correctOffset: correctOffset) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionOffsetError.self, json: json) } } } /// The UploadSessionStartArg struct - open class UploadSessionStartArg: CustomStringConvertible { + public class UploadSessionStartArg: CustomStringConvertible, JSONRepresentable { /// If true, the current session will be closed, at which point you won't be able to call uploadSessionAppendV2 /// anymore with the current session. public let close: Bool @@ -9157,103 +11284,136 @@ open class Files { nullableValidator(stringValidator(minLength: 64, maxLength: 64))(contentHash) self.contentHash = contentHash } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionStartArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionStartArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionStartArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionStartArg: \(error)" + } } } - open class UploadSessionStartArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionStartArg) -> JSON { - let output = [ - "close": Serialization._BoolSerializer.serialize(value.close), - "session_type": NullableSerializer(Files.UploadSessionTypeSerializer()).serialize(value.sessionType), - "content_hash": NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), + + public class UploadSessionStartArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionStartArg) throws -> JSON { + let output = [ + "close": try Serialization._BoolSerializer.serialize(value.close), + "session_type": try NullableSerializer(Files.UploadSessionTypeSerializer()).serialize(value.sessionType), + "content_hash": try NullableSerializer(Serialization._StringSerializer).serialize(value.contentHash), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionStartArg { + + public func deserialize(_ json: JSON) throws -> UploadSessionStartArg { switch json { - case .dictionary(let dict): - let close = Serialization._BoolSerializer.deserialize(dict["close"] ?? .number(0)) - let sessionType = NullableSerializer(Files.UploadSessionTypeSerializer()).deserialize(dict["session_type"] ?? .null) - let contentHash = NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) - return UploadSessionStartArg(close: close, sessionType: sessionType, contentHash: contentHash) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let close = try Serialization._BoolSerializer.deserialize(dict["close"] ?? .number(0)) + let sessionType = try NullableSerializer(Files.UploadSessionTypeSerializer()).deserialize(dict["session_type"] ?? .null) + let contentHash = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["content_hash"] ?? .null) + return UploadSessionStartArg(close: close, sessionType: sessionType, contentHash: contentHash) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionStartArg.self, json: json) } } } /// The UploadSessionStartBatchArg struct - open class UploadSessionStartBatchArg: CustomStringConvertible { + public class UploadSessionStartBatchArg: CustomStringConvertible, JSONRepresentable { /// Type of upload session you want to start. If not specified, default is sequential in UploadSessionType. public let sessionType: Files.UploadSessionType? /// The number of upload sessions to start. public let numSessions: UInt64 public init(numSessions: UInt64, sessionType: Files.UploadSessionType? = nil) { self.sessionType = sessionType - comparableValidator(minValue: 1, maxValue: 1000)(numSessions) + comparableValidator(minValue: 1, maxValue: 1_000)(numSessions) self.numSessions = numSessions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionStartBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionStartBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionStartBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionStartBatchArg: \(error)" + } } } - open class UploadSessionStartBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionStartBatchArg) -> JSON { - let output = [ - "num_sessions": Serialization._UInt64Serializer.serialize(value.numSessions), - "session_type": NullableSerializer(Files.UploadSessionTypeSerializer()).serialize(value.sessionType), + + public class UploadSessionStartBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionStartBatchArg) throws -> JSON { + let output = [ + "num_sessions": try Serialization._UInt64Serializer.serialize(value.numSessions), + "session_type": try NullableSerializer(Files.UploadSessionTypeSerializer()).serialize(value.sessionType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionStartBatchArg { + + public func deserialize(_ json: JSON) throws -> UploadSessionStartBatchArg { switch json { - case .dictionary(let dict): - let numSessions = Serialization._UInt64Serializer.deserialize(dict["num_sessions"] ?? .null) - let sessionType = NullableSerializer(Files.UploadSessionTypeSerializer()).deserialize(dict["session_type"] ?? .null) - return UploadSessionStartBatchArg(numSessions: numSessions, sessionType: sessionType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let numSessions = try Serialization._UInt64Serializer.deserialize(dict["num_sessions"] ?? .null) + let sessionType = try NullableSerializer(Files.UploadSessionTypeSerializer()).deserialize(dict["session_type"] ?? .null) + return UploadSessionStartBatchArg(numSessions: numSessions, sessionType: sessionType) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionStartBatchArg.self, json: json) } } } /// The UploadSessionStartBatchResult struct - open class UploadSessionStartBatchResult: CustomStringConvertible { + public class UploadSessionStartBatchResult: CustomStringConvertible, JSONRepresentable { /// A List of unique identifiers for the upload session. Pass each session_id to uploadSessionAppendV2 and /// uploadSessionFinish. - public let sessionIds: Array - public init(sessionIds: Array) { + public let sessionIds: [String] + public init(sessionIds: [String]) { arrayValidator(itemValidator: stringValidator())(sessionIds) self.sessionIds = sessionIds } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionStartBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionStartBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionStartBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionStartBatchResult: \(error)" + } } } - open class UploadSessionStartBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionStartBatchResult) -> JSON { - let output = [ - "session_ids": ArraySerializer(Serialization._StringSerializer).serialize(value.sessionIds), + + public class UploadSessionStartBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionStartBatchResult) throws -> JSON { + let output = [ + "session_ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.sessionIds), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionStartBatchResult { + + public func deserialize(_ json: JSON) throws -> UploadSessionStartBatchResult { switch json { - case .dictionary(let dict): - let sessionIds = ArraySerializer(Serialization._StringSerializer).deserialize(dict["session_ids"] ?? .null) - return UploadSessionStartBatchResult(sessionIds: sessionIds) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionIds = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["session_ids"] ?? .null) + return UploadSessionStartBatchResult(sessionIds: sessionIds) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionStartBatchResult.self, json: json) } } } /// The UploadSessionStartError union - public enum UploadSessionStartError: CustomStringConvertible { + public enum UploadSessionStartError: CustomStringConvertible, JSONRepresentable { /// Uploading data not allowed when starting concurrent upload session. case concurrentSessionDataNotAllowed /// Can not start a closed concurrent upload session. @@ -9265,93 +11425,114 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try UploadSessionStartErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionStartErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionStartErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionStartError: \(error)" + } } } - open class UploadSessionStartErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionStartError) -> JSON { + + public class UploadSessionStartErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionStartError) throws -> JSON { switch value { - case .concurrentSessionDataNotAllowed: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_data_not_allowed") - return .dictionary(d) - case .concurrentSessionCloseNotAllowed: - var d = [String: JSON]() - d[".tag"] = .str("concurrent_session_close_not_allowed") - return .dictionary(d) - case .payloadTooLarge: - var d = [String: JSON]() - d[".tag"] = .str("payload_too_large") - return .dictionary(d) - case .contentHashMismatch: - var d = [String: JSON]() - d[".tag"] = .str("content_hash_mismatch") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionStartError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "concurrent_session_data_not_allowed": - return UploadSessionStartError.concurrentSessionDataNotAllowed - case "concurrent_session_close_not_allowed": - return UploadSessionStartError.concurrentSessionCloseNotAllowed - case "payload_too_large": - return UploadSessionStartError.payloadTooLarge - case "content_hash_mismatch": - return UploadSessionStartError.contentHashMismatch - case "other": - return UploadSessionStartError.other - default: - return UploadSessionStartError.other - } - default: - fatalError("Failed to deserialize") + case .concurrentSessionDataNotAllowed: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_data_not_allowed") + return .dictionary(d) + case .concurrentSessionCloseNotAllowed: + var d = [String: JSON]() + d[".tag"] = .str("concurrent_session_close_not_allowed") + return .dictionary(d) + case .payloadTooLarge: + var d = [String: JSON]() + d[".tag"] = .str("payload_too_large") + return .dictionary(d) + case .contentHashMismatch: + var d = [String: JSON]() + d[".tag"] = .str("content_hash_mismatch") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionStartError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "concurrent_session_data_not_allowed": + return UploadSessionStartError.concurrentSessionDataNotAllowed + case "concurrent_session_close_not_allowed": + return UploadSessionStartError.concurrentSessionCloseNotAllowed + case "payload_too_large": + return UploadSessionStartError.payloadTooLarge + case "content_hash_mismatch": + return UploadSessionStartError.contentHashMismatch + case "other": + return UploadSessionStartError.other + default: + return UploadSessionStartError.other + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionStartError.self, json: json) } } } /// The UploadSessionStartResult struct - open class UploadSessionStartResult: CustomStringConvertible { + public class UploadSessionStartResult: CustomStringConvertible, JSONRepresentable { /// A unique identifier for the upload session. Pass this to uploadSessionAppendV2 and uploadSessionFinish. public let sessionId: String public init(sessionId: String) { stringValidator()(sessionId) self.sessionId = sessionId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionStartResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadSessionStartResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionStartResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionStartResult: \(error)" + } } } - open class UploadSessionStartResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionStartResult) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), + + public class UploadSessionStartResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionStartResult) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadSessionStartResult { + + public func deserialize(_ json: JSON) throws -> UploadSessionStartResult { switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - return UploadSessionStartResult(sessionId: sessionId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + return UploadSessionStartResult(sessionId: sessionId) + default: + throw JSONSerializerError.deserializeError(type: UploadSessionStartResult.self, json: json) } } } /// The UploadSessionType union - public enum UploadSessionType: CustomStringConvertible { + public enum UploadSessionType: CustomStringConvertible, JSONRepresentable { /// Pieces of data are uploaded sequentially one after another. This is the default behavior. case sequential /// Pieces of data can be uploaded in concurrent RPCs in any order. @@ -9359,50 +11540,60 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try UploadSessionTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadSessionTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadSessionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadSessionType: \(error)" + } } } - open class UploadSessionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadSessionType) -> JSON { + + public class UploadSessionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadSessionType) throws -> JSON { switch value { - case .sequential: - var d = [String: JSON]() - d[".tag"] = .str("sequential") - return .dictionary(d) - case .concurrent: - var d = [String: JSON]() - d[".tag"] = .str("concurrent") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadSessionType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "sequential": - return UploadSessionType.sequential - case "concurrent": - return UploadSessionType.concurrent - case "other": - return UploadSessionType.other - default: - return UploadSessionType.other - } + case .sequential: + var d = [String: JSON]() + d[".tag"] = .str("sequential") + return .dictionary(d) + case .concurrent: + var d = [String: JSON]() + d[".tag"] = .str("concurrent") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadSessionType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "sequential": + return UploadSessionType.sequential + case "concurrent": + return UploadSessionType.concurrent + case "other": + return UploadSessionType.other default: - fatalError("Failed to deserialize") + return UploadSessionType.other + } + default: + throw JSONSerializerError.deserializeError(type: UploadSessionType.self, json: json) } } } /// The UploadWriteFailed struct - open class UploadWriteFailed: CustomStringConvertible { + public class UploadWriteFailed: CustomStringConvertible, JSONRepresentable { /// The reason why the file couldn't be saved. public let reason: Files.WriteError /// The upload session ID; data has already been uploaded to the corresponding upload session and this ID may be @@ -9413,64 +11604,86 @@ open class Files { stringValidator()(uploadSessionId) self.uploadSessionId = uploadSessionId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadWriteFailedSerializer().serialize(self)))" + + func json() throws -> JSON { + try UploadWriteFailedSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadWriteFailedSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadWriteFailed: \(error)" + } } } - open class UploadWriteFailedSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadWriteFailed) -> JSON { - let output = [ - "reason": Files.WriteErrorSerializer().serialize(value.reason), - "upload_session_id": Serialization._StringSerializer.serialize(value.uploadSessionId), + + public class UploadWriteFailedSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadWriteFailed) throws -> JSON { + let output = [ + "reason": try Files.WriteErrorSerializer().serialize(value.reason), + "upload_session_id": try Serialization._StringSerializer.serialize(value.uploadSessionId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UploadWriteFailed { + + public func deserialize(_ json: JSON) throws -> UploadWriteFailed { switch json { - case .dictionary(let dict): - let reason = Files.WriteErrorSerializer().deserialize(dict["reason"] ?? .null) - let uploadSessionId = Serialization._StringSerializer.deserialize(dict["upload_session_id"] ?? .null) - return UploadWriteFailed(reason: reason, uploadSessionId: uploadSessionId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let reason = try Files.WriteErrorSerializer().deserialize(dict["reason"] ?? .null) + let uploadSessionId = try Serialization._StringSerializer.deserialize(dict["upload_session_id"] ?? .null) + return UploadWriteFailed(reason: reason, uploadSessionId: uploadSessionId) + default: + throw JSONSerializerError.deserializeError(type: UploadWriteFailed.self, json: json) } } } /// The UserGeneratedTag struct - open class UserGeneratedTag: CustomStringConvertible { + public class UserGeneratedTag: CustomStringConvertible, JSONRepresentable { /// (no description) public let tagText: String public init(tagText: String) { - stringValidator(minLength: 1, maxLength: 32, pattern: "[A-Za-z0-9_]+")(tagText) + stringValidator(minLength: 1, maxLength: 32, pattern: "[\\w]+")(tagText) self.tagText = tagText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserGeneratedTagSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserGeneratedTagSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserGeneratedTagSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserGeneratedTag: \(error)" + } } } - open class UserGeneratedTagSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserGeneratedTag) -> JSON { - let output = [ - "tag_text": Serialization._StringSerializer.serialize(value.tagText), + + public class UserGeneratedTagSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserGeneratedTag) throws -> JSON { + let output = [ + "tag_text": try Serialization._StringSerializer.serialize(value.tagText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserGeneratedTag { + + public func deserialize(_ json: JSON) throws -> UserGeneratedTag { switch json { - case .dictionary(let dict): - let tagText = Serialization._StringSerializer.deserialize(dict["tag_text"] ?? .null) - return UserGeneratedTag(tagText: tagText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let tagText = try Serialization._StringSerializer.deserialize(dict["tag_text"] ?? .null) + return UserGeneratedTag(tagText: tagText) + default: + throw JSONSerializerError.deserializeError(type: UserGeneratedTag.self, json: json) } } } /// Metadata for a video. - open class VideoMetadata: Files.MediaMetadata { + public class VideoMetadata: Files.MediaMetadata { /// The duration of the video in milliseconds. public let duration: UInt64? public init(dimensions: Files.Dimensions? = nil, location: Files.GpsCoordinates? = nil, timeTaken: Date? = nil, duration: UInt64? = nil) { @@ -9478,37 +11691,44 @@ open class Files { self.duration = duration super.init(dimensions: dimensions, location: location, timeTaken: timeTaken) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(VideoMetadataSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try VideoMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for VideoMetadata: \(error)" + } } } - open class VideoMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: VideoMetadata) -> JSON { - let output = [ - "dimensions": NullableSerializer(Files.DimensionsSerializer()).serialize(value.dimensions), - "location": NullableSerializer(Files.GpsCoordinatesSerializer()).serialize(value.location), - "time_taken": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeTaken), - "duration": NullableSerializer(Serialization._UInt64Serializer).serialize(value.duration), + + public class VideoMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: VideoMetadata) throws -> JSON { + let output = [ + "dimensions": try NullableSerializer(Files.DimensionsSerializer()).serialize(value.dimensions), + "location": try NullableSerializer(Files.GpsCoordinatesSerializer()).serialize(value.location), + "time_taken": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeTaken), + "duration": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.duration), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> VideoMetadata { + + public func deserialize(_ json: JSON) throws -> VideoMetadata { switch json { - case .dictionary(let dict): - let dimensions = NullableSerializer(Files.DimensionsSerializer()).deserialize(dict["dimensions"] ?? .null) - let location = NullableSerializer(Files.GpsCoordinatesSerializer()).deserialize(dict["location"] ?? .null) - let timeTaken = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_taken"] ?? .null) - let duration = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["duration"] ?? .null) - return VideoMetadata(dimensions: dimensions, location: location, timeTaken: timeTaken, duration: duration) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let dimensions = try NullableSerializer(Files.DimensionsSerializer()).deserialize(dict["dimensions"] ?? .null) + let location = try NullableSerializer(Files.GpsCoordinatesSerializer()).deserialize(dict["location"] ?? .null) + let timeTaken = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_taken"] ?? .null) + let duration = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["duration"] ?? .null) + return VideoMetadata(dimensions: dimensions, location: location, timeTaken: timeTaken, duration: duration) + default: + throw JSONSerializerError.deserializeError(type: VideoMetadata.self, json: json) } } } /// The WriteConflictError union - public enum WriteConflictError: CustomStringConvertible { + public enum WriteConflictError: CustomStringConvertible, JSONRepresentable { /// There's a file in the way. case file /// There's a folder in the way. @@ -9518,58 +11738,69 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try WriteConflictErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WriteConflictErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WriteConflictErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WriteConflictError: \(error)" + } } } - open class WriteConflictErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WriteConflictError) -> JSON { + + public class WriteConflictErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WriteConflictError) throws -> JSON { switch value { - case .file: - var d = [String: JSON]() - d[".tag"] = .str("file") - return .dictionary(d) - case .folder: - var d = [String: JSON]() - d[".tag"] = .str("folder") - return .dictionary(d) - case .fileAncestor: - var d = [String: JSON]() - d[".tag"] = .str("file_ancestor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> WriteConflictError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "file": - return WriteConflictError.file - case "folder": - return WriteConflictError.folder - case "file_ancestor": - return WriteConflictError.fileAncestor - case "other": - return WriteConflictError.other - default: - return WriteConflictError.other - } - default: - fatalError("Failed to deserialize") + case .file: + var d = [String: JSON]() + d[".tag"] = .str("file") + return .dictionary(d) + case .folder: + var d = [String: JSON]() + d[".tag"] = .str("folder") + return .dictionary(d) + case .fileAncestor: + var d = [String: JSON]() + d[".tag"] = .str("file_ancestor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> WriteConflictError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "file": + return WriteConflictError.file + case "folder": + return WriteConflictError.folder + case "file_ancestor": + return WriteConflictError.fileAncestor + case "other": + return WriteConflictError.other + default: + return WriteConflictError.other + } + default: + throw JSONSerializerError.deserializeError(type: WriteConflictError.self, json: json) } } } /// The WriteError union - public enum WriteError: CustomStringConvertible { + public enum WriteError: CustomStringConvertible, JSONRepresentable { /// The given path does not satisfy the required path format. Please refer to the Path formats documentation - /// https://www.dropbox.com/developers/documentation/http/documentation#path-formats for more information. + /// https://www.dropbox.com/developers/documentation/http/documentation#path-formats for more + /// information. case malformedPath(String?) /// Couldn't write to the target path because there was something in the way. case conflict(Files.WriteConflictError) @@ -9588,150 +11819,169 @@ open class Files { /// An unspecified error. case other + func json() throws -> JSON { + try WriteErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WriteErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WriteErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WriteError: \(error)" + } } } - open class WriteErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WriteError) -> JSON { + + public class WriteErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WriteError) throws -> JSON { switch value { - case .malformedPath(let arg): - var d = ["malformed_path": NullableSerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("malformed_path") - return .dictionary(d) - case .conflict(let arg): - var d = ["conflict": Files.WriteConflictErrorSerializer().serialize(arg)] - d[".tag"] = .str("conflict") - return .dictionary(d) - case .noWritePermission: - var d = [String: JSON]() - d[".tag"] = .str("no_write_permission") - return .dictionary(d) - case .insufficientSpace: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_space") - return .dictionary(d) - case .disallowedName: - var d = [String: JSON]() - d[".tag"] = .str("disallowed_name") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .operationSuppressed: - var d = [String: JSON]() - d[".tag"] = .str("operation_suppressed") - return .dictionary(d) - case .tooManyWriteOperations: - var d = [String: JSON]() - d[".tag"] = .str("too_many_write_operations") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> WriteError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "malformed_path": - let v = NullableSerializer(Serialization._StringSerializer).deserialize(d["malformed_path"] ?? .null) - return WriteError.malformedPath(v) - case "conflict": - let v = Files.WriteConflictErrorSerializer().deserialize(d["conflict"] ?? .null) - return WriteError.conflict(v) - case "no_write_permission": - return WriteError.noWritePermission - case "insufficient_space": - return WriteError.insufficientSpace - case "disallowed_name": - return WriteError.disallowedName - case "team_folder": - return WriteError.teamFolder - case "operation_suppressed": - return WriteError.operationSuppressed - case "too_many_write_operations": - return WriteError.tooManyWriteOperations - case "other": - return WriteError.other - default: - return WriteError.other - } - default: - fatalError("Failed to deserialize") + case .malformedPath(let arg): + var d = try ["malformed_path": NullableSerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("malformed_path") + return .dictionary(d) + case .conflict(let arg): + var d = try ["conflict": Files.WriteConflictErrorSerializer().serialize(arg)] + d[".tag"] = .str("conflict") + return .dictionary(d) + case .noWritePermission: + var d = [String: JSON]() + d[".tag"] = .str("no_write_permission") + return .dictionary(d) + case .insufficientSpace: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_space") + return .dictionary(d) + case .disallowedName: + var d = [String: JSON]() + d[".tag"] = .str("disallowed_name") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .operationSuppressed: + var d = [String: JSON]() + d[".tag"] = .str("operation_suppressed") + return .dictionary(d) + case .tooManyWriteOperations: + var d = [String: JSON]() + d[".tag"] = .str("too_many_write_operations") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> WriteError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "malformed_path": + let v = try NullableSerializer(Serialization._StringSerializer).deserialize(d["malformed_path"] ?? .null) + return WriteError.malformedPath(v) + case "conflict": + let v = try Files.WriteConflictErrorSerializer().deserialize(d["conflict"] ?? .null) + return WriteError.conflict(v) + case "no_write_permission": + return WriteError.noWritePermission + case "insufficient_space": + return WriteError.insufficientSpace + case "disallowed_name": + return WriteError.disallowedName + case "team_folder": + return WriteError.teamFolder + case "operation_suppressed": + return WriteError.operationSuppressed + case "too_many_write_operations": + return WriteError.tooManyWriteOperations + case "other": + return WriteError.other + default: + return WriteError.other + } + default: + throw JSONSerializerError.deserializeError(type: WriteError.self, json: json) } } } /// Your intent when writing a file to some path. This is used to determine what constitutes a conflict and what the - /// autorename strategy is. In some situations, the conflict behavior is identical: (a) If the target path doesn't - /// refer to anything, the file is always written; no conflict. (b) If the target path refers to a folder, it's - /// always a conflict. (c) If the target path refers to a file with identical contents, nothing gets written; no - /// conflict. The conflict checking differs in the case where there's a file at the target path with contents - /// different from the contents you're trying to write. - public enum WriteMode: CustomStringConvertible { + /// autorename strategy is. In some situations, the conflict behavior is identical: (a) If the target path + /// doesn't refer to anything, the file is always written; no conflict. (b) If the target path refers to a + /// folder, it's always a conflict. (c) If the target path refers to a file with identical contents, nothing + /// gets written; no conflict. The conflict checking differs in the case where there's a file at the target path + /// with contents different from the contents you're trying to write. + public enum WriteMode: CustomStringConvertible, JSONRepresentable { /// Do not overwrite an existing file if there is a conflict. The autorename strategy is to append a number to /// the file name. For example, "document.txt" might become "document (2).txt". case add /// Always overwrite the existing file. The autorename strategy is the same as it is for add. case overwrite /// Overwrite if the given "rev" matches the existing file's "rev". The supplied value should be the latest - /// known "rev" of the file, for example, from FileMetadata, from when the file was last downloaded by the app. - /// This will cause the file on the Dropbox servers to be overwritten if the given "rev" matches the existing - /// file's current "rev" on the Dropbox servers. The autorename strategy is to append the string "conflicted - /// copy" to the file name. For example, "document.txt" might become "document (conflicted copy).txt" or - /// "document (Panda's conflicted copy).txt". + /// known "rev" of the file, for example, from FileMetadata, from when the file was last downloaded by + /// the app. This will cause the file on the Dropbox servers to be overwritten if the given "rev" + /// matches the existing file's current "rev" on the Dropbox servers. The autorename strategy is to + /// append the string "conflicted copy" to the file name. For example, "document.txt" might become + /// "document (conflicted copy).txt" or "document (Panda's conflicted copy).txt". case update(String) + func json() throws -> JSON { + try WriteModeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WriteModeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WriteModeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WriteMode: \(error)" + } } } - open class WriteModeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WriteMode) -> JSON { + + public class WriteModeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WriteMode) throws -> JSON { switch value { - case .add: - var d = [String: JSON]() - d[".tag"] = .str("add") - return .dictionary(d) - case .overwrite: - var d = [String: JSON]() - d[".tag"] = .str("overwrite") - return .dictionary(d) - case .update(let arg): - var d = ["update": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("update") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> WriteMode { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "add": - return WriteMode.add - case "overwrite": - return WriteMode.overwrite - case "update": - let v = Serialization._StringSerializer.deserialize(d["update"] ?? .null) - return WriteMode.update(v) - default: - fatalError("Unknown tag \(tag)") - } + case .add: + var d = [String: JSON]() + d[".tag"] = .str("add") + return .dictionary(d) + case .overwrite: + var d = [String: JSON]() + d[".tag"] = .str("overwrite") + return .dictionary(d) + case .update(let arg): + var d = try ["update": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("update") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> WriteMode { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "add": + return WriteMode.add + case "overwrite": + return WriteMode.overwrite + case "update": + let v = try Serialization._StringSerializer.deserialize(d["update"] ?? .null) + return WriteMode.update(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: WriteMode.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: WriteMode.self, json: json) } } } - /// Stone Route Objects static let alphaGetMetadata = Route( @@ -9742,9 +11992,11 @@ open class Files { argSerializer: Files.AlphaGetMetadataArgSerializer(), responseSerializer: Files.MetadataSerializer(), errorSerializer: Files.AlphaGetMetadataErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let alphaUpload = Route( name: "alpha/upload", @@ -9754,21 +12006,25 @@ open class Files { argSerializer: Files.UploadArgSerializer(), responseSerializer: Files.FileMetadataSerializer(), errorSerializer: Files.UploadErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .upload + ) ) static let copyV2 = Route( - name: "copy", + name: "copy_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.RelocationArgSerializer(), responseSerializer: Files.RelocationResultSerializer(), errorSerializer: Files.RelocationErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let copy = Route( name: "copy", @@ -9778,21 +12034,25 @@ open class Files { argSerializer: Files.RelocationArgSerializer(), responseSerializer: Files.MetadataSerializer(), errorSerializer: Files.RelocationErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let copyBatchV2 = Route( - name: "copy_batch", + name: "copy_batch_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.RelocationBatchArgBaseSerializer(), responseSerializer: Files.RelocationBatchV2LaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let copyBatch = Route( name: "copy_batch", @@ -9802,21 +12062,25 @@ open class Files { argSerializer: Files.RelocationBatchArgSerializer(), responseSerializer: Files.RelocationBatchLaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let copyBatchCheckV2 = Route( - name: "copy_batch/check", + name: "copy_batch/check_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Async.PollArgSerializer(), responseSerializer: Files.RelocationBatchV2JobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let copyBatchCheck = Route( name: "copy_batch/check", @@ -9826,9 +12090,11 @@ open class Files { argSerializer: Async.PollArgSerializer(), responseSerializer: Files.RelocationBatchJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let copyReferenceGet = Route( name: "copy_reference/get", @@ -9838,9 +12104,11 @@ open class Files { argSerializer: Files.GetCopyReferenceArgSerializer(), responseSerializer: Files.GetCopyReferenceResultSerializer(), errorSerializer: Files.GetCopyReferenceErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let copyReferenceSave = Route( name: "copy_reference/save", @@ -9850,21 +12118,25 @@ open class Files { argSerializer: Files.SaveCopyReferenceArgSerializer(), responseSerializer: Files.SaveCopyReferenceResultSerializer(), errorSerializer: Files.SaveCopyReferenceErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let createFolderV2 = Route( - name: "create_folder", + name: "create_folder_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.CreateFolderArgSerializer(), responseSerializer: Files.CreateFolderResultSerializer(), errorSerializer: Files.CreateFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let createFolder = Route( name: "create_folder", @@ -9874,9 +12146,11 @@ open class Files { argSerializer: Files.CreateFolderArgSerializer(), responseSerializer: Files.FolderMetadataSerializer(), errorSerializer: Files.CreateFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let createFolderBatch = Route( name: "create_folder_batch", @@ -9886,9 +12160,11 @@ open class Files { argSerializer: Files.CreateFolderBatchArgSerializer(), responseSerializer: Files.CreateFolderBatchLaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let createFolderBatchCheck = Route( name: "create_folder_batch/check", @@ -9898,21 +12174,25 @@ open class Files { argSerializer: Async.PollArgSerializer(), responseSerializer: Files.CreateFolderBatchJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let deleteV2 = Route( - name: "delete", + name: "delete_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.DeleteArgSerializer(), responseSerializer: Files.DeleteResultSerializer(), errorSerializer: Files.DeleteErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let delete = Route( name: "delete", @@ -9922,9 +12202,11 @@ open class Files { argSerializer: Files.DeleteArgSerializer(), responseSerializer: Files.MetadataSerializer(), errorSerializer: Files.DeleteErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let deleteBatch = Route( name: "delete_batch", @@ -9934,9 +12216,11 @@ open class Files { argSerializer: Files.DeleteBatchArgSerializer(), responseSerializer: Files.DeleteBatchLaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let deleteBatchCheck = Route( name: "delete_batch/check", @@ -9946,9 +12230,11 @@ open class Files { argSerializer: Async.PollArgSerializer(), responseSerializer: Files.DeleteBatchJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let download = Route( name: "download", @@ -9958,9 +12244,11 @@ open class Files { argSerializer: Files.DownloadArgSerializer(), responseSerializer: Files.FileMetadataSerializer(), errorSerializer: Files.DownloadErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "download"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .download + ) ) static let downloadZip = Route( name: "download_zip", @@ -9970,9 +12258,11 @@ open class Files { argSerializer: Files.DownloadZipArgSerializer(), responseSerializer: Files.DownloadZipResultSerializer(), errorSerializer: Files.DownloadZipErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "download"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .download + ) ) static let export = Route( name: "export", @@ -9982,9 +12272,11 @@ open class Files { argSerializer: Files.ExportArgSerializer(), responseSerializer: Files.ExportResultSerializer(), errorSerializer: Files.ExportErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "download"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .download + ) ) static let getFileLockBatch = Route( name: "get_file_lock_batch", @@ -9994,9 +12286,11 @@ open class Files { argSerializer: Files.LockFileBatchArgSerializer(), responseSerializer: Files.LockFileBatchResultSerializer(), errorSerializer: Files.LockFileErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getMetadata = Route( name: "get_metadata", @@ -10006,9 +12300,11 @@ open class Files { argSerializer: Files.GetMetadataArgSerializer(), responseSerializer: Files.MetadataSerializer(), errorSerializer: Files.GetMetadataErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getPreview = Route( name: "get_preview", @@ -10018,9 +12314,11 @@ open class Files { argSerializer: Files.PreviewArgSerializer(), responseSerializer: Files.FileMetadataSerializer(), errorSerializer: Files.PreviewErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "download"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .download + ) ) static let getTemporaryLink = Route( name: "get_temporary_link", @@ -10030,9 +12328,11 @@ open class Files { argSerializer: Files.GetTemporaryLinkArgSerializer(), responseSerializer: Files.GetTemporaryLinkResultSerializer(), errorSerializer: Files.GetTemporaryLinkErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getTemporaryUploadLink = Route( name: "get_temporary_upload_link", @@ -10042,9 +12342,11 @@ open class Files { argSerializer: Files.GetTemporaryUploadLinkArgSerializer(), responseSerializer: Files.GetTemporaryUploadLinkResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getThumbnail = Route( name: "get_thumbnail", @@ -10054,21 +12356,25 @@ open class Files { argSerializer: Files.ThumbnailArgSerializer(), responseSerializer: Files.FileMetadataSerializer(), errorSerializer: Files.ThumbnailErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "download"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .download + ) ) static let getThumbnailV2 = Route( - name: "get_thumbnail", + name: "get_thumbnail_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.ThumbnailV2ArgSerializer(), responseSerializer: Files.PreviewResultSerializer(), errorSerializer: Files.ThumbnailV2ErrorSerializer(), - attrs: ["auth": "app, user", - "host": "content", - "style": "download"] + attributes: RouteAttributes( + auth: [.app, .user], + host: .content, + style: .download + ) ) static let getThumbnailBatch = Route( name: "get_thumbnail_batch", @@ -10078,9 +12384,11 @@ open class Files { argSerializer: Files.GetThumbnailBatchArgSerializer(), responseSerializer: Files.GetThumbnailBatchResultSerializer(), errorSerializer: Files.GetThumbnailBatchErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .rpc + ) ) static let listFolder = Route( name: "list_folder", @@ -10090,9 +12398,11 @@ open class Files { argSerializer: Files.ListFolderArgSerializer(), responseSerializer: Files.ListFolderResultSerializer(), errorSerializer: Files.ListFolderErrorSerializer(), - attrs: ["auth": "app, user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) ) static let listFolderContinue = Route( name: "list_folder/continue", @@ -10102,9 +12412,11 @@ open class Files { argSerializer: Files.ListFolderContinueArgSerializer(), responseSerializer: Files.ListFolderResultSerializer(), errorSerializer: Files.ListFolderContinueErrorSerializer(), - attrs: ["auth": "app, user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) ) static let listFolderGetLatestCursor = Route( name: "list_folder/get_latest_cursor", @@ -10114,9 +12426,11 @@ open class Files { argSerializer: Files.ListFolderArgSerializer(), responseSerializer: Files.ListFolderGetLatestCursorResultSerializer(), errorSerializer: Files.ListFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFolderLongpoll = Route( name: "list_folder/longpoll", @@ -10126,9 +12440,11 @@ open class Files { argSerializer: Files.ListFolderLongpollArgSerializer(), responseSerializer: Files.ListFolderLongpollResultSerializer(), errorSerializer: Files.ListFolderLongpollErrorSerializer(), - attrs: ["auth": "noauth", - "host": "notify", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.noauth], + host: .notify, + style: .rpc + ) ) static let listRevisions = Route( name: "list_revisions", @@ -10138,9 +12454,11 @@ open class Files { argSerializer: Files.ListRevisionsArgSerializer(), responseSerializer: Files.ListRevisionsResultSerializer(), errorSerializer: Files.ListRevisionsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let lockFileBatch = Route( name: "lock_file_batch", @@ -10150,21 +12468,25 @@ open class Files { argSerializer: Files.LockFileBatchArgSerializer(), responseSerializer: Files.LockFileBatchResultSerializer(), errorSerializer: Files.LockFileErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let moveV2 = Route( - name: "move", + name: "move_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.RelocationArgSerializer(), responseSerializer: Files.RelocationResultSerializer(), errorSerializer: Files.RelocationErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let move = Route( name: "move", @@ -10174,21 +12496,25 @@ open class Files { argSerializer: Files.RelocationArgSerializer(), responseSerializer: Files.MetadataSerializer(), errorSerializer: Files.RelocationErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let moveBatchV2 = Route( - name: "move_batch", + name: "move_batch_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.MoveBatchArgSerializer(), responseSerializer: Files.RelocationBatchV2LaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let moveBatch = Route( name: "move_batch", @@ -10198,21 +12524,25 @@ open class Files { argSerializer: Files.RelocationBatchArgSerializer(), responseSerializer: Files.RelocationBatchLaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let moveBatchCheckV2 = Route( - name: "move_batch/check", + name: "move_batch/check_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Async.PollArgSerializer(), responseSerializer: Files.RelocationBatchV2JobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let moveBatchCheck = Route( name: "move_batch/check", @@ -10222,9 +12552,11 @@ open class Files { argSerializer: Async.PollArgSerializer(), responseSerializer: Files.RelocationBatchJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let paperCreate = Route( name: "paper/create", @@ -10234,9 +12566,11 @@ open class Files { argSerializer: Files.PaperCreateArgSerializer(), responseSerializer: Files.PaperCreateResultSerializer(), errorSerializer: Files.PaperCreateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .upload + ) ) static let paperUpdate = Route( name: "paper/update", @@ -10246,9 +12580,11 @@ open class Files { argSerializer: Files.PaperUpdateArgSerializer(), responseSerializer: Files.PaperUpdateResultSerializer(), errorSerializer: Files.PaperUpdateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .upload + ) ) static let permanentlyDelete = Route( name: "permanently_delete", @@ -10258,9 +12594,11 @@ open class Files { argSerializer: Files.DeleteArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Files.DeleteErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesAdd = Route( name: "properties/add", @@ -10270,9 +12608,11 @@ open class Files { argSerializer: FileProperties.AddPropertiesArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.AddPropertiesErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesOverwrite = Route( name: "properties/overwrite", @@ -10282,9 +12622,11 @@ open class Files { argSerializer: FileProperties.OverwritePropertyGroupArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.InvalidPropertyGroupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesRemove = Route( name: "properties/remove", @@ -10294,9 +12636,11 @@ open class Files { argSerializer: FileProperties.RemovePropertiesArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.RemovePropertiesErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesTemplateGet = Route( name: "properties/template/get", @@ -10306,9 +12650,11 @@ open class Files { argSerializer: FileProperties.GetTemplateArgSerializer(), responseSerializer: FileProperties.GetTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesTemplateList = Route( name: "properties/template/list", @@ -10318,9 +12664,11 @@ open class Files { argSerializer: Serialization._VoidSerializer, responseSerializer: FileProperties.ListTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let propertiesUpdate = Route( name: "properties/update", @@ -10330,9 +12678,11 @@ open class Files { argSerializer: FileProperties.UpdatePropertiesArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: FileProperties.UpdatePropertiesErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let restore = Route( name: "restore", @@ -10342,9 +12692,11 @@ open class Files { argSerializer: Files.RestoreArgSerializer(), responseSerializer: Files.FileMetadataSerializer(), errorSerializer: Files.RestoreErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let saveUrl = Route( name: "save_url", @@ -10354,9 +12706,11 @@ open class Files { argSerializer: Files.SaveUrlArgSerializer(), responseSerializer: Files.SaveUrlResultSerializer(), errorSerializer: Files.SaveUrlErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let saveUrlCheckJobStatus = Route( name: "save_url/check_job_status", @@ -10366,9 +12720,11 @@ open class Files { argSerializer: Async.PollArgSerializer(), responseSerializer: Files.SaveUrlJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let search = Route( name: "search", @@ -10378,33 +12734,39 @@ open class Files { argSerializer: Files.SearchArgSerializer(), responseSerializer: Files.SearchResultSerializer(), errorSerializer: Files.SearchErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let searchV2 = Route( - name: "search", + name: "search_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.SearchV2ArgSerializer(), responseSerializer: Files.SearchV2ResultSerializer(), errorSerializer: Files.SearchErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let searchContinueV2 = Route( - name: "search/continue", + name: "search/continue_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.SearchV2ContinueArgSerializer(), responseSerializer: Files.SearchV2ResultSerializer(), errorSerializer: Files.SearchErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let tagsAdd = Route( name: "tags/add", @@ -10414,9 +12776,11 @@ open class Files { argSerializer: Files.AddTagArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Files.AddTagErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let tagsGet = Route( name: "tags/get", @@ -10426,9 +12790,11 @@ open class Files { argSerializer: Files.GetTagsArgSerializer(), responseSerializer: Files.GetTagsResultSerializer(), errorSerializer: Files.BaseTagErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let tagsRemove = Route( name: "tags/remove", @@ -10438,9 +12804,11 @@ open class Files { argSerializer: Files.RemoveTagArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Files.RemoveTagErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let unlockFileBatch = Route( name: "unlock_file_batch", @@ -10450,9 +12818,11 @@ open class Files { argSerializer: Files.UnlockFileBatchArgSerializer(), responseSerializer: Files.LockFileBatchResultSerializer(), errorSerializer: Files.LockFileErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let upload = Route( name: "upload", @@ -10462,21 +12832,25 @@ open class Files { argSerializer: Files.UploadArgSerializer(), responseSerializer: Files.FileMetadataSerializer(), errorSerializer: Files.UploadErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .upload + ) ) static let uploadSessionAppendV2 = Route( - name: "upload_session/append", + name: "upload_session/append_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.UploadSessionAppendArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Files.UploadSessionAppendErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .upload + ) ) static let uploadSessionAppend = Route( name: "upload_session/append", @@ -10486,9 +12860,11 @@ open class Files { argSerializer: Files.UploadSessionCursorSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Files.UploadSessionAppendErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .upload + ) ) static let uploadSessionFinish = Route( name: "upload_session/finish", @@ -10498,9 +12874,11 @@ open class Files { argSerializer: Files.UploadSessionFinishArgSerializer(), responseSerializer: Files.FileMetadataSerializer(), errorSerializer: Files.UploadSessionFinishErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .upload + ) ) static let uploadSessionFinishBatch = Route( name: "upload_session/finish_batch", @@ -10510,21 +12888,25 @@ open class Files { argSerializer: Files.UploadSessionFinishBatchArgSerializer(), responseSerializer: Files.UploadSessionFinishBatchLaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let uploadSessionFinishBatchV2 = Route( - name: "upload_session/finish_batch", + name: "upload_session/finish_batch_v2", version: 2, namespace: "files", deprecated: false, argSerializer: Files.UploadSessionFinishBatchArgSerializer(), responseSerializer: Files.UploadSessionFinishBatchResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let uploadSessionFinishBatchCheck = Route( name: "upload_session/finish_batch/check", @@ -10534,9 +12916,11 @@ open class Files { argSerializer: Async.PollArgSerializer(), responseSerializer: Files.UploadSessionFinishBatchJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let uploadSessionStart = Route( name: "upload_session/start", @@ -10546,9 +12930,11 @@ open class Files { argSerializer: Files.UploadSessionStartArgSerializer(), responseSerializer: Files.UploadSessionStartResultSerializer(), errorSerializer: Files.UploadSessionStartErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .upload + ) ) static let uploadSessionStartBatch = Route( name: "upload_session/start_batch", @@ -10558,8 +12944,10 @@ open class Files { argSerializer: Files.UploadSessionStartBatchArgSerializer(), responseSerializer: Files.UploadSessionStartBatchResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift index 0ce6492fd..e5ca7d5bc 100644 --- a/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift @@ -7,128 +7,241 @@ import Foundation /// Routes for the files namespace -open class FilesRoutes { +/// For Objective-C compatible routes see DBFilesRoutes +public class FilesRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Returns the metadata for a file or folder. This is an alpha endpoint compatible with the properties API. Note: /// Metadata for the root folder is unsupported. /// + /// - scope: files.metadata.read + /// /// - parameter includePropertyTemplates: If set to a valid list of template IDs, propertyGroups in FileMetadata is /// set for files with custom properties. /// - /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a /// `Files.AlphaGetMetadataError` object on failure. - @available(*, unavailable, message:"alphaGetMetadata is deprecated. Use getMetadata.") - @discardableResult open func alphaGetMetadata(path: String, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includePropertyGroups: FileProperties.TemplateFilterBase? = nil, includePropertyTemplates: Array? = nil) -> RpcRequest { + @available(*, unavailable, message: "alphaGetMetadata is deprecated. Use getMetadata.") + @discardableResult public func alphaGetMetadata( + path: String, + includeMediaInfo: Bool = false, + includeDeleted: Bool = false, + includeHasExplicitSharedMembers: Bool = false, + includePropertyGroups: FileProperties.TemplateFilterBase? = nil, + includePropertyTemplates: [String]? = nil + ) -> RpcRequest { let route = Files.alphaGetMetadata - let serverArgs = Files.AlphaGetMetadataArg(path: path, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includePropertyGroups: includePropertyGroups, includePropertyTemplates: includePropertyTemplates) + let serverArgs = Files.AlphaGetMetadataArg( + path: path, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includePropertyGroups: includePropertyGroups, + includePropertyTemplates: includePropertyTemplates + ) return client.request(route, serverArgs: serverArgs) } /// Create a new file with the contents provided in the request. Note that the behavior of this alpha endpoint is - /// unstable and subject to change. Do not use this to upload a file larger than 150 MB. Instead, create an upload - /// session with uploadSessionStart. + /// unstable and subject to change. Do not use this to upload a file larger than 150 MB. Instead, create an + /// upload session with uploadSessionStart. + /// + /// - scope: files.content.write /// /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content /// does not match this hash, an error will be returned. For more information see our Content hash /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadError` object on failure. - @available(*, unavailable, message:"alphaUpload is deprecated. Use upload.") - @discardableResult open func alphaUpload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false, contentHash: String? = nil, input: Data) -> UploadRequest { + @available(*, unavailable, message: "alphaUpload is deprecated. Use upload.") + @discardableResult public func alphaUpload( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false, + contentHash: String? = nil, + input: Data + ) -> UploadRequest { let route = Files.alphaUpload - let serverArgs = Files.UploadArg(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict, contentHash: contentHash) + let serverArgs = Files.UploadArg( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict, + contentHash: contentHash + ) return client.request(route, serverArgs: serverArgs, input: .data(input)) } /// Create a new file with the contents provided in the request. Note that the behavior of this alpha endpoint is - /// unstable and subject to change. Do not use this to upload a file larger than 150 MB. Instead, create an upload - /// session with uploadSessionStart. + /// unstable and subject to change. Do not use this to upload a file larger than 150 MB. Instead, create an + /// upload session with uploadSessionStart. + /// + /// - scope: files.content.write /// /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content /// does not match this hash, an error will be returned. For more information see our Content hash /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadError` object on failure. - @available(*, unavailable, message:"alphaUpload is deprecated. Use upload.") - @discardableResult open func alphaUpload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false, contentHash: String? = nil, input: URL) -> UploadRequest { + @available(*, unavailable, message: "alphaUpload is deprecated. Use upload.") + @discardableResult public func alphaUpload( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false, + contentHash: String? = nil, + input: URL + ) -> UploadRequest { let route = Files.alphaUpload - let serverArgs = Files.UploadArg(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict, contentHash: contentHash) + let serverArgs = Files.UploadArg( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict, + contentHash: contentHash + ) return client.request(route, serverArgs: serverArgs, input: .file(input)) } /// Create a new file with the contents provided in the request. Note that the behavior of this alpha endpoint is - /// unstable and subject to change. Do not use this to upload a file larger than 150 MB. Instead, create an upload - /// session with uploadSessionStart. + /// unstable and subject to change. Do not use this to upload a file larger than 150 MB. Instead, create an + /// upload session with uploadSessionStart. + /// + /// - scope: files.content.write /// /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content /// does not match this hash, an error will be returned. For more information see our Content hash /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadError` object on failure. - @available(*, unavailable, message:"alphaUpload is deprecated. Use upload.") - @discardableResult open func alphaUpload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false, contentHash: String? = nil, input: InputStream) -> UploadRequest { + @available(*, unavailable, message: "alphaUpload is deprecated. Use upload.") + @discardableResult public func alphaUpload( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false, + contentHash: String? = nil, + input: InputStream + ) -> UploadRequest { let route = Files.alphaUpload - let serverArgs = Files.UploadArg(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict, contentHash: contentHash) + let serverArgs = Files.UploadArg( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict, + contentHash: contentHash + ) return client.request(route, serverArgs: serverArgs, input: .stream(input)) } /// Copy a file or folder to a different location in the user's Dropbox. If the source path is a folder all its /// contents will be copied. /// + /// - scope: files.content.write + /// /// - parameter allowSharedFolder: This flag has no effect. /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the file to avoid the /// conflict. /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for /// the content being moved. This does not apply to copies. /// - /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success /// or a `Files.RelocationError` object on failure. - @discardableResult open func copyV2(fromPath: String, toPath: String, allowSharedFolder: Bool = false, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest { + @discardableResult public func copyV2( + fromPath: String, + toPath: String, + allowSharedFolder: Bool = false, + autorename: Bool = false, + allowOwnershipTransfer: Bool = false + ) -> RpcRequest { let route = Files.copyV2 - let serverArgs = Files.RelocationArg(fromPath: fromPath, toPath: toPath, allowSharedFolder: allowSharedFolder, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) + let serverArgs = Files.RelocationArg( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder, + autorename: autorename, + allowOwnershipTransfer: allowOwnershipTransfer + ) return client.request(route, serverArgs: serverArgs) } /// Copy a file or folder to a different location in the user's Dropbox. If the source path is a folder all its /// contents will be copied. /// + /// - scope: files.content.write + /// /// - parameter allowSharedFolder: This flag has no effect. /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the file to avoid the /// conflict. /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for /// the content being moved. This does not apply to copies. /// - /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a /// `Files.RelocationError` object on failure. - @available(*, unavailable, message:"copy is deprecated. Use copyV2.") - @discardableResult open func copy(fromPath: String, toPath: String, allowSharedFolder: Bool = false, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest { + @available(*, unavailable, message: "copy is deprecated. Use copyV2.") + @discardableResult public func copy( + fromPath: String, + toPath: String, + allowSharedFolder: Bool = false, + autorename: Bool = false, + allowOwnershipTransfer: Bool = false + ) -> RpcRequest { let route = Files.copy - let serverArgs = Files.RelocationArg(fromPath: fromPath, toPath: toPath, allowSharedFolder: allowSharedFolder, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) + let serverArgs = Files.RelocationArg( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder, + autorename: autorename, + allowOwnershipTransfer: allowOwnershipTransfer + ) return client.request(route, serverArgs: serverArgs) } /// Copy multiple files or folders to different locations at once in the user's Dropbox. This route will replace - /// copyBatch. The main difference is this route will return status for each entry, while copyBatch raises failure - /// if any entry fails. This route will either finish synchronously, or return a job ID and do the async copy job in - /// background. Please use copyBatchCheckV2 to check the job status. + /// copyBatch. The main difference is this route will return status for each entry, while copyBatch raises + /// failure if any entry fails. This route will either finish synchronously, or return a job ID and do the async + /// copy job in background. Please use copyBatchCheckV2 to check the job status. + /// + /// - scope: files.content.write /// /// - parameter entries: List of entries to be moved or copied. Each entry is RelocationPath. /// - parameter autorename: If there's a conflict with any file, have the Dropbox server try to autorename that file /// to avoid the conflict. /// - /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on /// success or a `Void` object on failure. - @discardableResult open func copyBatchV2(entries: Array, autorename: Bool = false) -> RpcRequest { + @discardableResult public func copyBatchV2( + entries: [Files.RelocationPath], + autorename: Bool = false + ) -> RpcRequest { let route = Files.copyBatchV2 let serverArgs = Files.RelocationBatchArgBase(entries: entries, autorename: autorename) return client.request(route, serverArgs: serverArgs) @@ -137,27 +250,41 @@ open class FilesRoutes { /// Copy multiple files or folders to different locations at once in the user's Dropbox. This route will return job /// ID immediately and do the async copy job in background. Please use copyBatchCheck to check the job status. /// + /// - scope: files.content.write + /// /// - parameter allowSharedFolder: This flag has no effect. /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for /// the content being moved. This does not apply to copies. /// - /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchLaunch` object on + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchLaunch` object on /// success or a `Void` object on failure. - @available(*, unavailable, message:"copyBatch is deprecated. Use copyBatchV2.") - @discardableResult open func copyBatch(entries: Array, autorename: Bool = false, allowSharedFolder: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest { + @available(*, unavailable, message: "copyBatch is deprecated. Use copyBatchV2.") + @discardableResult public func copyBatch( + entries: [Files.RelocationPath], + autorename: Bool = false, + allowSharedFolder: Bool = false, + allowOwnershipTransfer: Bool = false + ) -> RpcRequest { let route = Files.copyBatch - let serverArgs = Files.RelocationBatchArg(entries: entries, autorename: autorename, allowSharedFolder: allowSharedFolder, allowOwnershipTransfer: allowOwnershipTransfer) + let serverArgs = Files.RelocationBatchArg( + entries: entries, + autorename: autorename, + allowSharedFolder: allowSharedFolder, + allowOwnershipTransfer: allowOwnershipTransfer + ) return client.request(route, serverArgs: serverArgs) } /// Returns the status of an asynchronous job for copyBatchV2. It returns list of results for each entry. /// + /// - scope: files.content.write + /// /// - 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 `Files.RelocationBatchV2JobStatus` object - /// on success or a `Async.PollError` object on failure. - @discardableResult open func copyBatchCheckV2(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2JobStatus` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func copyBatchCheckV2(asyncJobId: String) -> RpcRequest { let route = Files.copyBatchCheckV2 let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -165,13 +292,15 @@ open class FilesRoutes { /// Returns the status of an asynchronous job for copyBatch. If success, it returns list of results for each entry. /// + /// - scope: files.content.write + /// /// - 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 `Files.RelocationBatchJobStatus` object on + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchJobStatus` object on /// success or a `Async.PollError` object on failure. - @available(*, unavailable, message:"copyBatchCheck is deprecated. Use copyBatchCheckV2.") - @discardableResult open func copyBatchCheck(asyncJobId: String) -> RpcRequest { + @available(*, unavailable, message: "copyBatchCheck is deprecated. Use copyBatchCheckV2.") + @discardableResult public func copyBatchCheck(asyncJobId: String) -> RpcRequest { let route = Files.copyBatchCheck let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -180,11 +309,13 @@ open class FilesRoutes { /// Get a copy reference to a file or folder. This reference string can be used to save that file or folder to /// another user's Dropbox by passing it to copyReferenceSave. /// + /// - scope: files.content.write + /// /// - parameter path: The path to the file or folder you want to get a copy reference to. /// - /// - returns: Through the response callback, the caller will receive a `Files.GetCopyReferenceResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.GetCopyReferenceResult` object on /// success or a `Files.GetCopyReferenceError` object on failure. - @discardableResult open func copyReferenceGet(path: String) -> RpcRequest { + @discardableResult public func copyReferenceGet(path: String) -> RpcRequest { let route = Files.copyReferenceGet let serverArgs = Files.GetCopyReferenceArg(path: path) return client.request(route, serverArgs: serverArgs) @@ -192,12 +323,17 @@ open class FilesRoutes { /// Save a copy reference returned by copyReferenceGet to the user's Dropbox. /// + /// - scope: files.content.write + /// /// - parameter copyReference: A copy reference returned by copyReferenceGet. /// - parameter path: Path in the user's Dropbox that is the destination. /// - /// - returns: Through the response callback, the caller will receive a `Files.SaveCopyReferenceResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.SaveCopyReferenceResult` object on /// success or a `Files.SaveCopyReferenceError` object on failure. - @discardableResult open func copyReferenceSave(copyReference: String, path: String) -> RpcRequest { + @discardableResult public func copyReferenceSave( + copyReference: String, + path: String + ) -> RpcRequest { let route = Files.copyReferenceSave let serverArgs = Files.SaveCopyReferenceArg(copyReference: copyReference, path: path) return client.request(route, serverArgs: serverArgs) @@ -205,13 +341,18 @@ open class FilesRoutes { /// Create a folder at a given path. /// + /// - scope: files.content.write + /// /// - parameter path: Path in the user's Dropbox to create. /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the folder to avoid the /// conflict. /// - /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderResult` object on - /// success or a `Files.CreateFolderError` object on failure. - @discardableResult open func createFolderV2(path: String, autorename: Bool = false) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderResult` object on success + /// or a `Files.CreateFolderError` object on failure. + @discardableResult public func createFolderV2( + path: String, + autorename: Bool = false + ) -> RpcRequest { let route = Files.createFolderV2 let serverArgs = Files.CreateFolderArg(path: path, autorename: autorename) return client.request(route, serverArgs: serverArgs) @@ -219,14 +360,19 @@ open class FilesRoutes { /// Create a folder at a given path. /// + /// - scope: files.content.write + /// /// - parameter path: Path in the user's Dropbox to create. /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the folder to avoid the /// conflict. /// - /// - returns: Through the response callback, the caller will receive a `Files.FolderMetadata` object on success or + /// - returns: Through the response callback, the caller will receive a `Files.FolderMetadata` object on success or /// a `Files.CreateFolderError` object on failure. - @available(*, unavailable, message:"createFolder is deprecated. Use createFolderV2.") - @discardableResult open func createFolder(path: String, autorename: Bool = false) -> RpcRequest { + @available(*, unavailable, message: "createFolder is deprecated. Use createFolderV2.") + @discardableResult public func createFolder( + path: String, + autorename: Bool = false + ) -> RpcRequest { let route = Files.createFolder let serverArgs = Files.CreateFolderArg(path: path, autorename: autorename) return client.request(route, serverArgs: serverArgs) @@ -237,15 +383,21 @@ open class FilesRoutes { /// result synchronously for smaller inputs. You can force asynchronous behaviour by using the forceAsync in /// CreateFolderBatchArg flag. Use createFolderBatchCheck to check the job status. /// + /// - scope: files.content.write + /// /// - parameter paths: List of paths to be created in the user's Dropbox. Duplicate path arguments in the batch are /// considered only once. /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the folder to avoid the /// conflict. /// - parameter forceAsync: Whether to force the create to happen asynchronously. /// - /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderBatchLaunch` object on + /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderBatchLaunch` object on /// success or a `Void` object on failure. - @discardableResult open func createFolderBatch(paths: Array, autorename: Bool = false, forceAsync: Bool = false) -> RpcRequest { + @discardableResult public func createFolderBatch( + paths: [String], + autorename: Bool = false, + forceAsync: Bool = false + ) -> RpcRequest { let route = Files.createFolderBatch let serverArgs = Files.CreateFolderBatchArg(paths: paths, autorename: autorename, forceAsync: forceAsync) return client.request(route, serverArgs: serverArgs) @@ -254,12 +406,15 @@ open class FilesRoutes { /// Returns the status of an asynchronous job for createFolderBatch. If success, it returns list of result for each /// entry. /// + /// - scope: files.content.write + /// /// - 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 `Files.CreateFolderBatchJobStatus` object - /// on success or a `Async.PollError` object on failure. - @discardableResult open func createFolderBatchCheck(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderBatchJobStatus` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func createFolderBatchCheck(asyncJobId: String) + -> RpcRequest { let route = Files.createFolderBatchCheck let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -267,15 +422,18 @@ open class FilesRoutes { /// Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too. A /// successful response indicates that the file or folder was deleted. The returned metadata will be the - /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata object. + /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata + /// object. + /// + /// - scope: files.content.write /// /// - parameter path: Path in the user's Dropbox to delete. /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does /// not support deleting a folder. /// - /// - returns: Through the response callback, the caller will receive a `Files.DeleteResult` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.DeleteResult` object on success or a /// `Files.DeleteError` object on failure. - @discardableResult open func deleteV2(path: String, parentRev: String? = nil) -> RpcRequest { + @discardableResult public func deleteV2(path: String, parentRev: String? = nil) -> RpcRequest { let route = Files.deleteV2 let serverArgs = Files.DeleteArg(path: path, parentRev: parentRev) return client.request(route, serverArgs: serverArgs) @@ -283,16 +441,19 @@ open class FilesRoutes { /// Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too. A /// successful response indicates that the file or folder was deleted. The returned metadata will be the - /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata object. + /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata + /// object. + /// + /// - scope: files.content.write /// /// - parameter path: Path in the user's Dropbox to delete. /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does /// not support deleting a folder. /// - /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a /// `Files.DeleteError` object on failure. - @available(*, unavailable, message:"delete is deprecated. Use deleteV2.") - @discardableResult open func delete(path: String, parentRev: String? = nil) -> RpcRequest { + @available(*, unavailable, message: "delete is deprecated. Use deleteV2.") + @discardableResult public func delete(path: String, parentRev: String? = nil) -> RpcRequest { let route = Files.delete let serverArgs = Files.DeleteArg(path: path, parentRev: parentRev) return client.request(route, serverArgs: serverArgs) @@ -301,10 +462,12 @@ open class FilesRoutes { /// Delete multiple files/folders at once. This route is asynchronous, which returns a job ID immediately and runs /// the delete batch asynchronously. Use deleteBatchCheck to check the job status. /// + /// - scope: files.content.write + /// /// - /// - returns: Through the response callback, the caller will receive a `Files.DeleteBatchLaunch` object on success + /// - returns: Through the response callback, the caller will receive a `Files.DeleteBatchLaunch` object on success /// or a `Void` object on failure. - @discardableResult open func deleteBatch(entries: Array) -> RpcRequest { + @discardableResult public func deleteBatch(entries: [Files.DeleteArg]) -> RpcRequest { let route = Files.deleteBatch let serverArgs = Files.DeleteBatchArg(entries: entries) return client.request(route, serverArgs: serverArgs) @@ -312,12 +475,14 @@ open class FilesRoutes { /// Returns the status of an asynchronous job for deleteBatch. If success, it returns list of result for each entry. /// + /// - scope: files.content.write + /// /// - 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 `Files.DeleteBatchJobStatus` object on + /// - returns: Through the response callback, the caller will receive a `Files.DeleteBatchJobStatus` object on /// success or a `Async.PollError` object on failure. - @discardableResult open func deleteBatchCheck(asyncJobId: String) -> RpcRequest { + @discardableResult public func deleteBatchCheck(asyncJobId: String) -> RpcRequest { let route = Files.deleteBatchCheck let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -325,17 +490,23 @@ open class FilesRoutes { /// Download a file from a user's Dropbox. /// + /// - scope: files.content.read + /// /// - parameter path: The path of the file to download. /// - parameter rev: Please specify revision in path instead. /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.DownloadError` object on failure. - @discardableResult open func download(path: String, rev: String? = nil, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + @discardableResult public func download( + path: String, + rev: String? = nil, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Files.download let serverArgs = Files.DownloadArg(path: path, rev: rev) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) @@ -343,47 +514,59 @@ open class FilesRoutes { /// Download a file from a user's Dropbox. /// + /// - scope: files.content.read + /// /// - parameter path: The path of the file to download. /// - parameter rev: Please specify revision in path instead. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.DownloadError` object on failure. - @discardableResult open func download(path: String, rev: String? = nil) -> DownloadRequestMemory { + @discardableResult public func download( + path: String, + rev: String? = nil + ) -> DownloadRequestMemory { let route = Files.download let serverArgs = Files.DownloadArg(path: path, rev: rev) return client.request(route, serverArgs: serverArgs) } /// Download a folder from the user's Dropbox, as a zip file. The folder must be less than 20 GB in size and any - /// single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file and - /// folder entries, including the top level folder. The input cannot be a single file. Note: this endpoint does not - /// support HTTP range requests. + /// single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file + /// and folder entries, including the top level folder. The input cannot be a single file. Note: this endpoint + /// does not support HTTP range requests. + /// + /// - scope: files.content.read /// /// - parameter path: The path of the folder to download. /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. /// - /// - returns: Through the response callback, the caller will receive a `Files.DownloadZipResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.DownloadZipResult` object on success /// or a `Files.DownloadZipError` object on failure. - @discardableResult open func downloadZip(path: String, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + @discardableResult public func downloadZip( + path: String, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Files.downloadZip let serverArgs = Files.DownloadZipArg(path: path) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) } /// Download a folder from the user's Dropbox, as a zip file. The folder must be less than 20 GB in size and any - /// single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file and - /// folder entries, including the top level folder. The input cannot be a single file. Note: this endpoint does not - /// support HTTP range requests. + /// single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file + /// and folder entries, including the top level folder. The input cannot be a single file. Note: this endpoint + /// does not support HTTP range requests. + /// + /// - scope: files.content.read /// /// - parameter path: The path of the folder to download. /// - /// - returns: Through the response callback, the caller will receive a `Files.DownloadZipResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.DownloadZipResult` object on success /// or a `Files.DownloadZipError` object on failure. - @discardableResult open func downloadZip(path: String) -> DownloadRequestMemory { + @discardableResult public func downloadZip(path: String) -> DownloadRequestMemory { let route = Files.downloadZip let serverArgs = Files.DownloadZipArg(path: path) return client.request(route, serverArgs: serverArgs) @@ -392,19 +575,25 @@ open class FilesRoutes { /// Export a file from a user's Dropbox. This route only supports exporting files that cannot be downloaded directly /// and whose fileMetadata in ExportResult has exportAs in ExportInfo populated. /// + /// - scope: files.content.read + /// /// - parameter path: The path of the file to be exported. /// - parameter exportFormat: The file format to which the file should be exported. This must be one of the formats - /// listed in the file's export_options returned by getMetadata. If none is specified, the default format (specified - /// in export_as in file metadata) will be used. + /// listed in the file's export_options returned by getMetadata. If none is specified, the default format + /// (specified in export_as in file metadata) will be used. /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. /// - /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a /// `Files.ExportError` object on failure. - @discardableResult open func export(path: String, exportFormat: String? = nil, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + @discardableResult public func export( + path: String, + exportFormat: String? = nil, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Files.export let serverArgs = Files.ExportArg(path: path, exportFormat: exportFormat) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) @@ -413,14 +602,19 @@ open class FilesRoutes { /// Export a file from a user's Dropbox. This route only supports exporting files that cannot be downloaded directly /// and whose fileMetadata in ExportResult has exportAs in ExportInfo populated. /// + /// - scope: files.content.read + /// /// - parameter path: The path of the file to be exported. /// - parameter exportFormat: The file format to which the file should be exported. This must be one of the formats - /// listed in the file's export_options returned by getMetadata. If none is specified, the default format (specified - /// in export_as in file metadata) will be used. + /// listed in the file's export_options returned by getMetadata. If none is specified, the default format + /// (specified in export_as in file metadata) will be used. /// - /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a /// `Files.ExportError` object on failure. - @discardableResult open func export(path: String, exportFormat: String? = nil) -> DownloadRequestMemory { + @discardableResult public func export( + path: String, + exportFormat: String? = nil + ) -> DownloadRequestMemory { let route = Files.export let serverArgs = Files.ExportArg(path: path, exportFormat: exportFormat) return client.request(route, serverArgs: serverArgs) @@ -428,12 +622,15 @@ open class FilesRoutes { /// Return the lock metadata for the given list of paths. /// + /// - scope: files.content.read + /// /// - parameter entries: List of 'entries'. Each 'entry' contains a path of the file which will be locked or /// queried. Duplicate path arguments in the batch are considered only once. /// - /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on /// success or a `Files.LockFileError` object on failure. - @discardableResult open func getFileLockBatch(entries: Array) -> RpcRequest { + @discardableResult public func getFileLockBatch(entries: [Files.LockFileArg]) + -> RpcRequest { let route = Files.getFileLockBatch let serverArgs = Files.LockFileBatchArg(entries: entries) return client.request(route, serverArgs: serverArgs) @@ -441,6 +638,8 @@ open class FilesRoutes { /// Returns the metadata for a file or folder. Note: Metadata for the root folder is unsupported. /// + /// - scope: files.metadata.read + /// /// - parameter path: The path of a file or folder on Dropbox. /// - parameter includeMediaInfo: If true, mediaInfo in FileMetadata is set for photo and video. /// - parameter includeDeleted: If true, DeletedMetadata will be returned for deleted file or folder, otherwise @@ -450,30 +649,48 @@ open class FilesRoutes { /// - parameter includePropertyGroups: If set to a valid list of template IDs, propertyGroups in FileMetadata is set /// if there exists property data associated with the file and each of the listed templates. /// - /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a /// `Files.GetMetadataError` object on failure. - @discardableResult open func getMetadata(path: String, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includePropertyGroups: FileProperties.TemplateFilterBase? = nil) -> RpcRequest { + @discardableResult public func getMetadata( + path: String, + includeMediaInfo: Bool = false, + includeDeleted: Bool = false, + includeHasExplicitSharedMembers: Bool = false, + includePropertyGroups: FileProperties.TemplateFilterBase? = nil + ) -> RpcRequest { let route = Files.getMetadata - let serverArgs = Files.GetMetadataArg(path: path, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includePropertyGroups: includePropertyGroups) + let serverArgs = Files.GetMetadataArg( + path: path, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includePropertyGroups: includePropertyGroups + ) return client.request(route, serverArgs: serverArgs) } /// Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, /// .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML - /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. Other - /// formats will return an unsupported extension error. + /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. + /// Other formats will return an unsupported extension error. + /// + /// - scope: files.content.read /// /// - parameter path: The path of the file to preview. /// - parameter rev: Please specify revision in path instead. /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.PreviewError` object on failure. - @discardableResult open func getPreview(path: String, rev: String? = nil, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + @discardableResult public func getPreview( + path: String, + rev: String? = nil, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Files.getPreview let serverArgs = Files.PreviewArg(path: path, rev: rev) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) @@ -481,29 +698,36 @@ open class FilesRoutes { /// Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, /// .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML - /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. Other - /// formats will return an unsupported extension error. + /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. + /// Other formats will return an unsupported extension error. + /// + /// - scope: files.content.read /// /// - parameter path: The path of the file to preview. /// - parameter rev: Please specify revision in path instead. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.PreviewError` object on failure. - @discardableResult open func getPreview(path: String, rev: String? = nil) -> DownloadRequestMemory { + @discardableResult public func getPreview( + path: String, + rev: String? = nil + ) -> DownloadRequestMemory { let route = Files.getPreview let serverArgs = Files.PreviewArg(path: path, rev: rev) return client.request(route, serverArgs: serverArgs) } /// Get a temporary link to stream content of a file. This link will expire in four hours and afterwards you will - /// get 410 Gone. This URL should not be used to display content directly in the browser. The Content-Type of the - /// link is determined automatically by the file's mime type. + /// get 410 Gone. This URL should not be used to display content directly in the browser. The Content-Type of + /// the link is determined automatically by the file's mime type. + /// + /// - scope: files.content.read /// /// - parameter path: The path to the file you want a temporary link to. /// - /// - returns: Through the response callback, the caller will receive a `Files.GetTemporaryLinkResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.GetTemporaryLinkResult` object on /// success or a `Files.GetTemporaryLinkError` object on failure. - @discardableResult open func getTemporaryLink(path: String) -> RpcRequest { + @discardableResult public func getTemporaryLink(path: String) -> RpcRequest { let route = Files.getTemporaryLink let serverArgs = Files.GetTemporaryLinkArg(path: path) return client.request(route, serverArgs: serverArgs) @@ -511,39 +735,46 @@ open class FilesRoutes { /// Get a one-time use temporary upload link to upload a file to a Dropbox location. This endpoint acts as a /// delayed upload. The returned temporary upload link may be used to make a POST request with the data to be - /// uploaded. The upload will then be perfomed with the CommitInfo previously provided to getTemporaryUploadLink but - /// evaluated only upon consumption. Hence, errors stemming from invalid CommitInfo with respect to the state of the - /// user's Dropbox will only be communicated at consumption time. Additionally, these errors are surfaced as generic - /// HTTP 409 Conflict responses, potentially hiding issue details. The maximum temporary upload link duration is 4 - /// hours. Upon consumption or expiration, a new link will have to be generated. Multiple links may exist for a - /// specific upload path at any given time. The POST request on the temporary upload link must have its - /// Content-Type set to "application/octet-stream". Example temporary upload link consumption request: curl -X - /// POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND --header "Content-Type: application/octet-stream" - /// --data-binary @local_file.txt A successful temporary upload link consumption request returns the content hash - /// of the uploaded data in JSON format. Example successful temporary upload link consumption response: - /// {"content-hash": "599d71033d700ac892a0e48fa61b125d2f5994"} An unsuccessful temporary upload link consumption - /// request returns any of the following status codes: HTTP 400 Bad Request: Content-Type is not one of - /// application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: The temporary upload link does - /// not exist or is currently unavailable, the upload failed, or another error happened. HTTP 410 Gone: The - /// temporary upload link is expired or consumed. Example unsuccessful temporary upload link consumption response: - /// Temporary upload link has been recently consumed. + /// uploaded. The upload will then be perfomed with the CommitInfo previously provided to getTemporaryUploadLink + /// but evaluated only upon consumption. Hence, errors stemming from invalid CommitInfo with respect to the + /// state of the user's Dropbox will only be communicated at consumption time. Additionally, these errors are + /// surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum temporary + /// upload link duration is 4 hours. Upon consumption or expiration, a new link will have to be generated. + /// Multiple links may exist for a specific upload path at any given time. The POST request on the temporary + /// upload link must have its Content-Type set to "application/octet-stream". Example temporary upload link + /// consumption request: curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND --header + /// "Content-Type: application/octet-stream" --data-binary @local_file.txt A successful temporary upload link + /// consumption request returns the content hash of the uploaded data in JSON format. Example successful + /// temporary upload link consumption response: {"content-hash": "599d71033d700ac892a0e48fa61b125d2f5994"} An + /// unsuccessful temporary upload link consumption request returns any of the following status codes: HTTP 400 + /// Bad Request: Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP + /// 409 Conflict: The temporary upload link does not exist or is currently unavailable, the upload failed, or + /// another error happened. HTTP 410 Gone: The temporary upload link is expired or consumed. Example + /// unsuccessful temporary upload link consumption response: Temporary upload link has been recently consumed. + /// + /// - scope: files.content.write /// /// - parameter commitInfo: Contains the path and other optional modifiers for the future upload commit. Equivalent /// to the parameters provided to upload. /// - parameter duration: How long before this link expires, in seconds. Attempting to start an upload with this /// link longer than this period of time after link creation will result in an error. /// - /// - returns: Through the response callback, the caller will receive a `Files.GetTemporaryUploadLinkResult` object + /// - returns: Through the response callback, the caller will receive a `Files.GetTemporaryUploadLinkResult` object /// on success or a `Void` object on failure. - @discardableResult open func getTemporaryUploadLink(commitInfo: Files.CommitInfo, duration: Double = 14400.0) -> RpcRequest { + @discardableResult public func getTemporaryUploadLink( + commitInfo: Files.CommitInfo, + duration: Double = 14_400.0 + ) -> RpcRequest { let route = Files.getTemporaryUploadLink let serverArgs = Files.GetTemporaryUploadLinkArg(commitInfo: commitInfo, duration: duration) return client.request(route, serverArgs: serverArgs) } /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, - /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to a - /// thumbnail. + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read /// /// - parameter path: The path to the image file you want to thumbnail. /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg @@ -551,22 +782,30 @@ open class FilesRoutes { /// - parameter size: The size for the thumbnail image. /// - parameter mode: How to resize and crop the image to achieve the desired size. /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.ThumbnailError` object on failure. - @discardableResult open func getThumbnail(path: String, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + @discardableResult public func getThumbnail( + path: String, + format: Files.ThumbnailFormat = .jpeg, + size: Files.ThumbnailSize = .w64h64, + mode: Files.ThumbnailMode = .strict, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Files.getThumbnail let serverArgs = Files.ThumbnailArg(path: path, format: format, size: size, mode: mode) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) } /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, - /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to a - /// thumbnail. + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read /// /// - parameter path: The path to the image file you want to thumbnail. /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg @@ -574,17 +813,24 @@ open class FilesRoutes { /// - parameter size: The size for the thumbnail image. /// - parameter mode: How to resize and crop the image to achieve the desired size. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.ThumbnailError` object on failure. - @discardableResult open func getThumbnail(path: String, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict) -> DownloadRequestMemory { + @discardableResult public func getThumbnail( + path: String, + format: Files.ThumbnailFormat = .jpeg, + size: Files.ThumbnailSize = .w64h64, + mode: Files.ThumbnailMode = .strict + ) -> DownloadRequestMemory { let route = Files.getThumbnail let serverArgs = Files.ThumbnailArg(path: path, format: format, size: size, mode: mode) return client.request(route, serverArgs: serverArgs) } /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, - /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to a - /// thumbnail. + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read /// /// - parameter resource: Information specifying which file to preview. This could be a path to a file, a shared /// link pointing to a file, or a shared link pointing to a folder, with a relative path. @@ -593,22 +839,30 @@ open class FilesRoutes { /// - parameter size: The size for the thumbnail image. /// - parameter mode: How to resize and crop the image to achieve the desired size. /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. - /// - /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or - /// a `Files.ThumbnailV2Error` object on failure. - @discardableResult open func getThumbnailV2(resource: Files.PathOrLink, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or a + /// `Files.ThumbnailV2Error` object on failure. + @discardableResult public func getThumbnailV2( + resource: Files.PathOrLink, + format: Files.ThumbnailFormat = .jpeg, + size: Files.ThumbnailSize = .w64h64, + mode: Files.ThumbnailMode = .strict, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Files.getThumbnailV2 let serverArgs = Files.ThumbnailV2Arg(resource: resource, format: format, size: size, mode: mode) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) } /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, - /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to a - /// thumbnail. + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read /// /// - parameter resource: Information specifying which file to preview. This could be a path to a file, a shared /// link pointing to a file, or a shared link pointing to a folder, with a relative path. @@ -617,9 +871,14 @@ open class FilesRoutes { /// - parameter size: The size for the thumbnail image. /// - parameter mode: How to resize and crop the image to achieve the desired size. /// - /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or - /// a `Files.ThumbnailV2Error` object on failure. - @discardableResult open func getThumbnailV2(resource: Files.PathOrLink, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict) -> DownloadRequestMemory { + /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or a + /// `Files.ThumbnailV2Error` object on failure. + @discardableResult public func getThumbnailV2( + resource: Files.PathOrLink, + format: Files.ThumbnailFormat = .jpeg, + size: Files.ThumbnailSize = .w64h64, + mode: Files.ThumbnailMode = .strict + ) -> DownloadRequestMemory { let route = Files.getThumbnailV2 let serverArgs = Files.ThumbnailV2Arg(resource: resource, format: format, size: size, mode: mode) return client.request(route, serverArgs: serverArgs) @@ -629,11 +888,14 @@ open class FilesRoutes { /// supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos /// that are larger than 20MB in size won't be converted to a thumbnail. /// + /// - scope: files.content.read + /// /// - parameter entries: List of files to get thumbnails. /// - /// - returns: Through the response callback, the caller will receive a `Files.GetThumbnailBatchResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.GetThumbnailBatchResult` object on /// success or a `Files.GetThumbnailBatchError` object on failure. - @discardableResult open func getThumbnailBatch(entries: Array) -> RpcRequest { + @discardableResult public func getThumbnailBatch(entries: [Files.ThumbnailArg]) + -> RpcRequest { let route = Files.getThumbnailBatch let serverArgs = Files.GetThumbnailBatchArg(entries: entries) return client.request(route, serverArgs: serverArgs) @@ -642,17 +904,19 @@ open class FilesRoutes { /// Starts returning the contents of a folder. If the result's hasMore in ListFolderResult field is true, call /// listFolderContinue with the returned cursor in ListFolderResult to retrieve more entries. If you're using /// recursive in ListFolderArg set to true to keep a local cache of the contents of a Dropbox account, iterate - /// through each entry in order and process them as follows to keep your local state in sync: For each FileMetadata, - /// store the new entry at the given path in your local state. If the required parent folders don't exist yet, - /// create them. If there's already something else at the given path, replace it and remove all its children. For - /// each FolderMetadata, store the new entry at the given path in your local state. If the required parent folders - /// don't exist yet, create them. If there's already something else at the given path, replace it but leave the - /// children as they are. Check the new entry's readOnly in FolderSharingInfo and set all its children's read-only - /// statuses to match. For each DeletedMetadata, if your local state has something at the given path, remove it and - /// all its children. If there's nothing at the given path, ignore this entry. Note: auth.RateLimitError may be - /// returned if multiple listFolder or listFolderContinue calls with same parameters are made simultaneously by same - /// API app for same user. If your app implements retry logic, please hold off the retry until the previous request - /// finishes. + /// through each entry in order and process them as follows to keep your local state in sync: For each + /// FileMetadata, store the new entry at the given path in your local state. If the required parent folders + /// don't exist yet, create them. If there's already something else at the given path, replace it and remove all + /// its children. For each FolderMetadata, store the new entry at the given path in your local state. If the + /// required parent folders don't exist yet, create them. If there's already something else at the given path, + /// replace it but leave the children as they are. Check the new entry's readOnly in FolderSharingInfo and set + /// all its children's read-only statuses to match. For each DeletedMetadata, if your local state has something + /// at the given path, remove it and all its children. If there's nothing at the given path, ignore this entry. + /// Note: auth.RateLimitError may be returned if multiple listFolder or listFolderContinue calls with same + /// parameters are made simultaneously by same API app for same user. If your app implements retry logic, please + /// hold off the retry until the previous request finishes. + /// + /// - scope: files.metadata.read /// /// - parameter path: A unique identifier for the file. /// - parameter recursive: If true, the list folder operation will be applied recursively to all subfolders and the @@ -668,28 +932,52 @@ open class FilesRoutes { /// - parameter limit: The maximum number of results to return per request. Note: This is an approximate number and /// there can be slightly more entries returned in some cases. /// - parameter sharedLink: A shared link to list the contents of. If the link is password-protected, the password - /// must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared link. - /// Only non-recursive mode is supported for shared link. + /// must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared + /// link. Only non-recursive mode is supported for shared link. /// - parameter includePropertyGroups: If set to a valid list of template IDs, propertyGroups in FileMetadata is set /// if there exists property data associated with the file and each of the listed templates. /// - parameter includeNonDownloadableFiles: If true, include files that are not downloadable, i.e. Google Docs. /// - /// - returns: Through the response callback, the caller will receive a `Files.ListFolderResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderResult` object on success /// or a `Files.ListFolderError` object on failure. - @discardableResult open func listFolder(path: String, recursive: Bool = false, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includeMountedFolders: Bool = true, limit: UInt32? = nil, sharedLink: Files.SharedLink? = nil, includePropertyGroups: FileProperties.TemplateFilterBase? = nil, includeNonDownloadableFiles: Bool = true) -> RpcRequest { + @discardableResult public func listFolder( + path: String, + recursive: Bool = false, + includeMediaInfo: Bool = false, + includeDeleted: Bool = false, + includeHasExplicitSharedMembers: Bool = false, + includeMountedFolders: Bool = true, + limit: UInt32? = nil, + sharedLink: Files.SharedLink? = nil, + includePropertyGroups: FileProperties.TemplateFilterBase? = nil, + includeNonDownloadableFiles: Bool = true + ) -> RpcRequest { let route = Files.listFolder - let serverArgs = Files.ListFolderArg(path: path, recursive: recursive, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includeMountedFolders: includeMountedFolders, limit: limit, sharedLink: sharedLink, includePropertyGroups: includePropertyGroups, includeNonDownloadableFiles: includeNonDownloadableFiles) + let serverArgs = Files.ListFolderArg( + path: path, + recursive: recursive, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includeMountedFolders: includeMountedFolders, + limit: limit, + sharedLink: sharedLink, + includePropertyGroups: includePropertyGroups, + includeNonDownloadableFiles: includeNonDownloadableFiles + ) return client.request(route, serverArgs: serverArgs) } /// Once a cursor has been retrieved from listFolder, use this to paginate through all files and retrieve updates to /// the folder, following the same rules as documented for listFolder. /// + /// - scope: files.metadata.read + /// /// - parameter cursor: The cursor returned by your last call to listFolder or listFolderContinue. /// - /// - returns: Through the response callback, the caller will receive a `Files.ListFolderResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderResult` object on success /// or a `Files.ListFolderContinueError` object on failure. - @discardableResult open func listFolderContinue(cursor: String) -> RpcRequest { + @discardableResult public func listFolderContinue(cursor: String) -> RpcRequest { let route = Files.listFolderContinue let serverArgs = Files.ListFolderContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -699,6 +987,8 @@ open class FilesRoutes { /// return any entries. This endpoint is for app which only needs to know about new files and modifications and /// doesn't need to know about files that already exist in Dropbox. /// + /// - scope: files.metadata.read + /// /// - parameter path: A unique identifier for the file. /// - parameter recursive: If true, the list folder operation will be applied recursively to all subfolders and the /// response will contain contents of all subfolders. @@ -713,69 +1003,105 @@ open class FilesRoutes { /// - parameter limit: The maximum number of results to return per request. Note: This is an approximate number and /// there can be slightly more entries returned in some cases. /// - parameter sharedLink: A shared link to list the contents of. If the link is password-protected, the password - /// must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared link. - /// Only non-recursive mode is supported for shared link. + /// must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared + /// link. Only non-recursive mode is supported for shared link. /// - parameter includePropertyGroups: If set to a valid list of template IDs, propertyGroups in FileMetadata is set /// if there exists property data associated with the file and each of the listed templates. /// - parameter includeNonDownloadableFiles: If true, include files that are not downloadable, i.e. Google Docs. /// - /// - returns: Through the response callback, the caller will receive a `Files.ListFolderGetLatestCursorResult` + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderGetLatestCursorResult` /// object on success or a `Files.ListFolderError` object on failure. - @discardableResult open func listFolderGetLatestCursor(path: String, recursive: Bool = false, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includeMountedFolders: Bool = true, limit: UInt32? = nil, sharedLink: Files.SharedLink? = nil, includePropertyGroups: FileProperties.TemplateFilterBase? = nil, includeNonDownloadableFiles: Bool = true) -> RpcRequest { + @discardableResult public func listFolderGetLatestCursor( + path: String, + recursive: Bool = false, + includeMediaInfo: Bool = false, + includeDeleted: Bool = false, + includeHasExplicitSharedMembers: Bool = false, + includeMountedFolders: Bool = true, + limit: UInt32? = nil, + sharedLink: Files.SharedLink? = nil, + includePropertyGroups: FileProperties.TemplateFilterBase? = nil, + includeNonDownloadableFiles: Bool = true + ) -> RpcRequest { let route = Files.listFolderGetLatestCursor - let serverArgs = Files.ListFolderArg(path: path, recursive: recursive, includeMediaInfo: includeMediaInfo, includeDeleted: includeDeleted, includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, includeMountedFolders: includeMountedFolders, limit: limit, sharedLink: sharedLink, includePropertyGroups: includePropertyGroups, includeNonDownloadableFiles: includeNonDownloadableFiles) + let serverArgs = Files.ListFolderArg( + path: path, + recursive: recursive, + includeMediaInfo: includeMediaInfo, + includeDeleted: includeDeleted, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers, + includeMountedFolders: includeMountedFolders, + limit: limit, + sharedLink: sharedLink, + includePropertyGroups: includePropertyGroups, + includeNonDownloadableFiles: includeNonDownloadableFiles + ) return client.request(route, serverArgs: serverArgs) } /// A longpoll endpoint to wait for changes on an account. In conjunction with listFolderContinue, this call gives - /// you a low-latency way to monitor an account for file changes. The connection will block until there are changes - /// available or a timeout occurs. This endpoint is useful mostly for client-side apps. If you're looking for - /// server-side notifications, check out our webhooks documentation + /// you a low-latency way to monitor an account for file changes. The connection will block until there are + /// changes available or a timeout occurs. This endpoint is useful mostly for client-side apps. If you're + /// looking for server-side notifications, check out our webhooks documentation /// https://www.dropbox.com/developers/reference/webhooks. /// + /// - scope: files.metadata.read + /// /// - parameter cursor: A cursor as returned by listFolder or listFolderContinue. Cursors retrieved by setting /// includeMediaInfo in ListFolderArg to true are not supported. /// - parameter timeout: A timeout in seconds. The request will block for at most this length of time, plus up to 90 /// seconds of random jitter added to avoid the thundering herd problem. Care should be taken when using this /// parameter, as some network infrastructure does not support long timeouts. /// - /// - returns: Through the response callback, the caller will receive a `Files.ListFolderLongpollResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderLongpollResult` object on /// success or a `Files.ListFolderLongpollError` object on failure. - @discardableResult open func listFolderLongpoll(cursor: String, timeout: UInt64 = 30) -> RpcRequest { + @discardableResult public func listFolderLongpoll( + cursor: String, + timeout: UInt64 = 30 + ) -> RpcRequest { let route = Files.listFolderLongpoll let serverArgs = Files.ListFolderLongpollArg(cursor: cursor, timeout: timeout) return client.request(route, serverArgs: serverArgs) } /// Returns revisions for files based on a file path or a file id. The file path or file id is identified from the - /// latest file entry at the given file path or id. This end point allows your app to query either by file path or - /// file id by setting the mode parameter appropriately. In the path in ListRevisionsMode (default) mode, all - /// revisions at the same file path as the latest file entry are returned. If revisions with the same file id are - /// desired, then mode must be set to id in ListRevisionsMode. The id in ListRevisionsMode mode is useful to + /// latest file entry at the given file path or id. This end point allows your app to query either by file path + /// or file id by setting the mode parameter appropriately. In the path in ListRevisionsMode (default) mode, all + /// revisions at the same file path as the latest file entry are returned. If revisions with the same file id + /// are desired, then mode must be set to id in ListRevisionsMode. The id in ListRevisionsMode mode is useful to /// retrieve revisions for a given file across moves or renames. /// + /// - scope: files.metadata.read + /// /// - parameter path: The path to the file you want to see the revisions of. /// - parameter mode: Determines the behavior of the API in listing the revisions for a given file path or id. /// - parameter limit: The maximum number of revision entries returned. /// - /// - returns: Through the response callback, the caller will receive a `Files.ListRevisionsResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.ListRevisionsResult` object on /// success or a `Files.ListRevisionsError` object on failure. - @discardableResult open func listRevisions(path: String, mode: Files.ListRevisionsMode = .path, limit: UInt64 = 10) -> RpcRequest { + @discardableResult public func listRevisions( + path: String, + mode: Files.ListRevisionsMode = .path, + limit: UInt64 = 10 + ) -> RpcRequest { let route = Files.listRevisions let serverArgs = Files.ListRevisionsArg(path: path, mode: mode, limit: limit) return client.request(route, serverArgs: serverArgs) } /// Lock the files at the given paths. A locked file will be writable only by the lock holder. A successful response - /// indicates that the file has been locked. Returns a list of the locked file paths and their metadata after this - /// operation. + /// indicates that the file has been locked. Returns a list of the locked file paths and their metadata after + /// this operation. + /// + /// - scope: files.content.write /// /// - parameter entries: List of 'entries'. Each 'entry' contains a path of the file which will be locked or /// queried. Duplicate path arguments in the batch are considered only once. /// - /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on /// success or a `Files.LockFileError` object on failure. - @discardableResult open func lockFileBatch(entries: Array) -> RpcRequest { + @discardableResult public func lockFileBatch(entries: [Files.LockFileArg]) + -> RpcRequest { let route = Files.lockFileBatch let serverArgs = Files.LockFileBatchArg(entries: entries) return client.request(route, serverArgs: serverArgs) @@ -784,50 +1110,84 @@ open class FilesRoutes { /// Move a file or folder to a different location in the user's Dropbox. If the source path is a folder all its /// contents will be moved. Note that we do not currently support case-only renaming. /// + /// - scope: files.content.write + /// /// - parameter allowSharedFolder: This flag has no effect. /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the file to avoid the /// conflict. /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for /// the content being moved. This does not apply to copies. /// - /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success /// or a `Files.RelocationError` object on failure. - @discardableResult open func moveV2(fromPath: String, toPath: String, allowSharedFolder: Bool = false, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest { + @discardableResult public func moveV2( + fromPath: String, + toPath: String, + allowSharedFolder: Bool = false, + autorename: Bool = false, + allowOwnershipTransfer: Bool = false + ) -> RpcRequest { let route = Files.moveV2 - let serverArgs = Files.RelocationArg(fromPath: fromPath, toPath: toPath, allowSharedFolder: allowSharedFolder, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) + let serverArgs = Files.RelocationArg( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder, + autorename: autorename, + allowOwnershipTransfer: allowOwnershipTransfer + ) return client.request(route, serverArgs: serverArgs) } /// Move a file or folder to a different location in the user's Dropbox. If the source path is a folder all its /// contents will be moved. /// + /// - scope: files.content.write + /// /// - parameter allowSharedFolder: This flag has no effect. /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the file to avoid the /// conflict. /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for /// the content being moved. This does not apply to copies. /// - /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a /// `Files.RelocationError` object on failure. - @available(*, unavailable, message:"move is deprecated. Use moveV2.") - @discardableResult open func move(fromPath: String, toPath: String, allowSharedFolder: Bool = false, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest { + @available(*, unavailable, message: "move is deprecated. Use moveV2.") + @discardableResult public func move( + fromPath: String, + toPath: String, + allowSharedFolder: Bool = false, + autorename: Bool = false, + allowOwnershipTransfer: Bool = false + ) -> RpcRequest { let route = Files.move - let serverArgs = Files.RelocationArg(fromPath: fromPath, toPath: toPath, allowSharedFolder: allowSharedFolder, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) + let serverArgs = Files.RelocationArg( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder, + autorename: autorename, + allowOwnershipTransfer: allowOwnershipTransfer + ) return client.request(route, serverArgs: serverArgs) } /// Move multiple files or folders to different locations at once in the user's Dropbox. Note that we do not - /// currently support case-only renaming. This route will replace moveBatch. The main difference is this route will - /// return status for each entry, while moveBatch raises failure if any entry fails. This route will either finish - /// synchronously, or return a job ID and do the async move job in background. Please use moveBatchCheckV2 to check - /// the job status. + /// currently support case-only renaming. This route will replace moveBatch. The main difference is this route + /// will return status for each entry, while moveBatch raises failure if any entry fails. This route will either + /// finish synchronously, or return a job ID and do the async move job in background. Please use + /// moveBatchCheckV2 to check the job status. + /// + /// - scope: files.content.write /// /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for /// the content being moved. This does not apply to copies. /// - /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on /// success or a `Void` object on failure. - @discardableResult open func moveBatchV2(entries: Array, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest { + @discardableResult public func moveBatchV2( + entries: [Files.RelocationPath], + autorename: Bool = false, + allowOwnershipTransfer: Bool = false + ) -> RpcRequest { let route = Files.moveBatchV2 let serverArgs = Files.MoveBatchArg(entries: entries, autorename: autorename, allowOwnershipTransfer: allowOwnershipTransfer) return client.request(route, serverArgs: serverArgs) @@ -836,27 +1196,41 @@ open class FilesRoutes { /// Move multiple files or folders to different locations at once in the user's Dropbox. This route will return job /// ID immediately and do the async moving job in background. Please use moveBatchCheck to check the job status. /// + /// - scope: files.content.write + /// /// - parameter allowSharedFolder: This flag has no effect. /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for /// the content being moved. This does not apply to copies. /// - /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchLaunch` object on + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchLaunch` object on /// success or a `Void` object on failure. - @available(*, unavailable, message:"moveBatch is deprecated. Use moveBatchV2.") - @discardableResult open func moveBatch(entries: Array, autorename: Bool = false, allowSharedFolder: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest { + @available(*, unavailable, message: "moveBatch is deprecated. Use moveBatchV2.") + @discardableResult public func moveBatch( + entries: [Files.RelocationPath], + autorename: Bool = false, + allowSharedFolder: Bool = false, + allowOwnershipTransfer: Bool = false + ) -> RpcRequest { let route = Files.moveBatch - let serverArgs = Files.RelocationBatchArg(entries: entries, autorename: autorename, allowSharedFolder: allowSharedFolder, allowOwnershipTransfer: allowOwnershipTransfer) + let serverArgs = Files.RelocationBatchArg( + entries: entries, + autorename: autorename, + allowSharedFolder: allowSharedFolder, + allowOwnershipTransfer: allowOwnershipTransfer + ) return client.request(route, serverArgs: serverArgs) } /// Returns the status of an asynchronous job for moveBatchV2. It returns list of results for each entry. /// + /// - scope: files.content.write + /// /// - 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 `Files.RelocationBatchV2JobStatus` object - /// on success or a `Async.PollError` object on failure. - @discardableResult open func moveBatchCheckV2(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2JobStatus` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func moveBatchCheckV2(asyncJobId: String) -> RpcRequest { let route = Files.moveBatchCheckV2 let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -864,13 +1238,15 @@ open class FilesRoutes { /// Returns the status of an asynchronous job for moveBatch. If success, it returns list of results for each entry. /// + /// - scope: files.content.write + /// /// - 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 `Files.RelocationBatchJobStatus` object on + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchJobStatus` object on /// success or a `Async.PollError` object on failure. - @available(*, unavailable, message:"moveBatchCheck is deprecated. Use moveBatchCheckV2.") - @discardableResult open func moveBatchCheck(asyncJobId: String) -> RpcRequest { + @available(*, unavailable, message: "moveBatchCheck is deprecated. Use moveBatchCheckV2.") + @discardableResult public func moveBatchCheck(asyncJobId: String) -> RpcRequest { let route = Files.moveBatchCheck let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -878,14 +1254,20 @@ open class FilesRoutes { /// Creates a new Paper doc with the provided content. /// + /// - scope: files.content.write + /// /// - parameter path: The fully qualified path to the location in the user's Dropbox where the Paper Doc should be /// created. This should include the document's title and end with .paper. /// - parameter importFormat: The format of the provided data. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success /// or a `Files.PaperCreateError` object on failure. - @discardableResult open func paperCreate(path: String, importFormat: Files.ImportFormat, input: Data) -> UploadRequest { + @discardableResult public func paperCreate( + path: String, + importFormat: Files.ImportFormat, + input: Data + ) -> UploadRequest { let route = Files.paperCreate let serverArgs = Files.PaperCreateArg(path: path, importFormat: importFormat) return client.request(route, serverArgs: serverArgs, input: .data(input)) @@ -893,14 +1275,20 @@ open class FilesRoutes { /// Creates a new Paper doc with the provided content. /// + /// - scope: files.content.write + /// /// - parameter path: The fully qualified path to the location in the user's Dropbox where the Paper Doc should be /// created. This should include the document's title and end with .paper. /// - parameter importFormat: The format of the provided data. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success /// or a `Files.PaperCreateError` object on failure. - @discardableResult open func paperCreate(path: String, importFormat: Files.ImportFormat, input: URL) -> UploadRequest { + @discardableResult public func paperCreate( + path: String, + importFormat: Files.ImportFormat, + input: URL + ) -> UploadRequest { let route = Files.paperCreate let serverArgs = Files.PaperCreateArg(path: path, importFormat: importFormat) return client.request(route, serverArgs: serverArgs, input: .file(input)) @@ -908,14 +1296,20 @@ open class FilesRoutes { /// Creates a new Paper doc with the provided content. /// + /// - scope: files.content.write + /// /// - parameter path: The fully qualified path to the location in the user's Dropbox where the Paper Doc should be /// created. This should include the document's title and end with .paper. /// - parameter importFormat: The format of the provided data. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success /// or a `Files.PaperCreateError` object on failure. - @discardableResult open func paperCreate(path: String, importFormat: Files.ImportFormat, input: InputStream) -> UploadRequest { + @discardableResult public func paperCreate( + path: String, + importFormat: Files.ImportFormat, + input: InputStream + ) -> UploadRequest { let route = Files.paperCreate let serverArgs = Files.PaperCreateArg(path: path, importFormat: importFormat) return client.request(route, serverArgs: serverArgs, input: .stream(input)) @@ -923,6 +1317,8 @@ open class FilesRoutes { /// Updates an existing Paper doc with the provided content. /// + /// - scope: files.content.write + /// /// - parameter path: Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will /// be returned. /// - parameter importFormat: The format of the provided data. @@ -931,9 +1327,15 @@ open class FilesRoutes { /// match the current revision of the doc or error revision_mismatch will be returned. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success /// or a `Files.PaperUpdateError` object on failure. - @discardableResult open func paperUpdate(path: String, importFormat: Files.ImportFormat, docUpdatePolicy: Files.PaperDocUpdatePolicy, paperRevision: Int64? = nil, input: Data) -> UploadRequest { + @discardableResult public func paperUpdate( + path: String, + importFormat: Files.ImportFormat, + docUpdatePolicy: Files.PaperDocUpdatePolicy, + paperRevision: Int64? = nil, + input: Data + ) -> UploadRequest { let route = Files.paperUpdate let serverArgs = Files.PaperUpdateArg(path: path, importFormat: importFormat, docUpdatePolicy: docUpdatePolicy, paperRevision: paperRevision) return client.request(route, serverArgs: serverArgs, input: .data(input)) @@ -941,6 +1343,8 @@ open class FilesRoutes { /// Updates an existing Paper doc with the provided content. /// + /// - scope: files.content.write + /// /// - parameter path: Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will /// be returned. /// - parameter importFormat: The format of the provided data. @@ -949,9 +1353,15 @@ open class FilesRoutes { /// match the current revision of the doc or error revision_mismatch will be returned. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success /// or a `Files.PaperUpdateError` object on failure. - @discardableResult open func paperUpdate(path: String, importFormat: Files.ImportFormat, docUpdatePolicy: Files.PaperDocUpdatePolicy, paperRevision: Int64? = nil, input: URL) -> UploadRequest { + @discardableResult public func paperUpdate( + path: String, + importFormat: Files.ImportFormat, + docUpdatePolicy: Files.PaperDocUpdatePolicy, + paperRevision: Int64? = nil, + input: URL + ) -> UploadRequest { let route = Files.paperUpdate let serverArgs = Files.PaperUpdateArg(path: path, importFormat: importFormat, docUpdatePolicy: docUpdatePolicy, paperRevision: paperRevision) return client.request(route, serverArgs: serverArgs, input: .file(input)) @@ -959,6 +1369,8 @@ open class FilesRoutes { /// Updates an existing Paper doc with the provided content. /// + /// - scope: files.content.write + /// /// - parameter path: Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will /// be returned. /// - parameter importFormat: The format of the provided data. @@ -967,9 +1379,15 @@ open class FilesRoutes { /// match the current revision of the doc or error revision_mismatch will be returned. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success /// or a `Files.PaperUpdateError` object on failure. - @discardableResult open func paperUpdate(path: String, importFormat: Files.ImportFormat, docUpdatePolicy: Files.PaperDocUpdatePolicy, paperRevision: Int64? = nil, input: InputStream) -> UploadRequest { + @discardableResult public func paperUpdate( + path: String, + importFormat: Files.ImportFormat, + docUpdatePolicy: Files.PaperDocUpdatePolicy, + paperRevision: Int64? = nil, + input: InputStream + ) -> UploadRequest { let route = Files.paperUpdate let serverArgs = Files.PaperUpdateArg(path: path, importFormat: importFormat, docUpdatePolicy: docUpdatePolicy, paperRevision: paperRevision) return client.request(route, serverArgs: serverArgs, input: .stream(input)) @@ -977,16 +1395,18 @@ open class FilesRoutes { /// Permanently delete the file or folder at a given path (see https://www.dropbox.com/en/help/40). If the given /// file or folder is not yet deleted, this route will first delete it. It is possible for this route to - /// successfully delete, then fail to permanently delete. Note: This endpoint is only available for Dropbox Business - /// apps. + /// successfully delete, then fail to permanently delete. Note: This endpoint is only available for Dropbox + /// Business apps. + /// + /// - scope: files.permanent_delete /// /// - parameter path: Path in the user's Dropbox to delete. /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does /// not support deleting a folder. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.DeleteError` object on failure. - @discardableResult open func permanentlyDelete(path: String, parentRev: String? = nil) -> RpcRequest { + @discardableResult public func permanentlyDelete(path: String, parentRev: String? = nil) -> RpcRequest { let route = Files.permanentlyDelete let serverArgs = Files.DeleteArg(path: path, parentRev: parentRev) return client.request(route, serverArgs: serverArgs) @@ -994,14 +1414,19 @@ open class FilesRoutes { /// The propertiesAdd route /// + /// - scope: files.metadata.write + /// /// - parameter path: A unique identifier for the file or folder. /// - parameter propertyGroups: The property groups which are to be added to a Dropbox file. No two groups in the /// input should refer to the same template. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.AddPropertiesError` object on failure. - @available(*, unavailable, message:"propertiesAdd is deprecated.") - @discardableResult open func propertiesAdd(path: String, propertyGroups: Array) -> RpcRequest { + @available(*, unavailable, message: "propertiesAdd is deprecated.") + @discardableResult public func propertiesAdd( + path: String, + propertyGroups: [FileProperties.PropertyGroup] + ) -> RpcRequest { let route = Files.propertiesAdd let serverArgs = FileProperties.AddPropertiesArg(path: path, propertyGroups: propertyGroups) return client.request(route, serverArgs: serverArgs) @@ -1009,14 +1434,19 @@ open class FilesRoutes { /// The propertiesOverwrite route /// + /// - scope: files.metadata.write + /// /// - parameter path: A unique identifier for the file or folder. /// - parameter propertyGroups: The property groups "snapshot" updates to force apply. No two groups in the input /// should refer to the same template. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.InvalidPropertyGroupError` object on failure. - @available(*, unavailable, message:"propertiesOverwrite is deprecated.") - @discardableResult open func propertiesOverwrite(path: String, propertyGroups: Array) -> RpcRequest { + @available(*, unavailable, message: "propertiesOverwrite is deprecated.") + @discardableResult public func propertiesOverwrite( + path: String, + propertyGroups: [FileProperties.PropertyGroup] + ) -> RpcRequest { let route = Files.propertiesOverwrite let serverArgs = FileProperties.OverwritePropertyGroupArg(path: path, propertyGroups: propertyGroups) return client.request(route, serverArgs: serverArgs) @@ -1024,14 +1454,19 @@ open class FilesRoutes { /// The propertiesRemove route /// + /// - scope: files.metadata.write + /// /// - parameter path: A unique identifier for the file or folder. /// - parameter propertyTemplateIds: A list of identifiers for a template created by templatesAddForUser or /// templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.RemovePropertiesError` object on failure. - @available(*, unavailable, message:"propertiesRemove is deprecated.") - @discardableResult open func propertiesRemove(path: String, propertyTemplateIds: Array) -> RpcRequest { + @available(*, unavailable, message: "propertiesRemove is deprecated.") + @discardableResult public func propertiesRemove( + path: String, + propertyTemplateIds: [String] + ) -> RpcRequest { let route = Files.propertiesRemove let serverArgs = FileProperties.RemovePropertiesArg(path: path, propertyTemplateIds: propertyTemplateIds) return client.request(route, serverArgs: serverArgs) @@ -1039,13 +1474,16 @@ open class FilesRoutes { /// The propertiesTemplateGet route /// + /// - scope: files.metadata.read + /// /// - parameter templateId: An identifier for template added by route See templatesAddForUser or /// templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object - /// on success or a `FileProperties.TemplateError` object on failure. - @available(*, unavailable, message:"propertiesTemplateGet is deprecated.") - @discardableResult open func propertiesTemplateGet(templateId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object on + /// success or a `FileProperties.TemplateError` object on failure. + @available(*, unavailable, message: "propertiesTemplateGet is deprecated.") + @discardableResult public func propertiesTemplateGet(templateId: String) + -> RpcRequest { let route = Files.propertiesTemplateGet let serverArgs = FileProperties.GetTemplateArg(templateId: templateId) return client.request(route, serverArgs: serverArgs) @@ -1053,24 +1491,31 @@ open class FilesRoutes { /// The propertiesTemplateList route /// + /// - scope: files.metadata.read + /// /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object + /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object /// on success or a `FileProperties.TemplateError` object on failure. - @available(*, unavailable, message:"propertiesTemplateList is deprecated.") - @discardableResult open func propertiesTemplateList() -> RpcRequest { + @available(*, unavailable, message: "propertiesTemplateList is deprecated.") + @discardableResult public func propertiesTemplateList() -> RpcRequest { let route = Files.propertiesTemplateList return client.request(route) } /// The propertiesUpdate route /// + /// - scope: files.metadata.write + /// /// - parameter path: A unique identifier for the file or folder. /// - parameter updatePropertyGroups: The property groups "delta" updates to apply. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `FileProperties.UpdatePropertiesError` object on failure. - @available(*, unavailable, message:"propertiesUpdate is deprecated.") - @discardableResult open func propertiesUpdate(path: String, updatePropertyGroups: Array) -> RpcRequest { + @available(*, unavailable, message: "propertiesUpdate is deprecated.") + @discardableResult public func propertiesUpdate( + path: String, + updatePropertyGroups: [FileProperties.PropertyGroupUpdate] + ) -> RpcRequest { let route = Files.propertiesUpdate let serverArgs = FileProperties.UpdatePropertiesArg(path: path, updatePropertyGroups: updatePropertyGroups) return client.request(route, serverArgs: serverArgs) @@ -1078,27 +1523,31 @@ open class FilesRoutes { /// Restore a specific revision of a file to the given path. /// + /// - scope: files.content.write + /// /// - parameter path: The path to save the restored file. /// - parameter rev: The revision to restore. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.RestoreError` object on failure. - @discardableResult open func restore(path: String, rev: String) -> RpcRequest { + @discardableResult public func restore(path: String, rev: String) -> RpcRequest { let route = Files.restore let serverArgs = Files.RestoreArg(path: path, rev: rev) return client.request(route, serverArgs: serverArgs) } /// Save the data from a specified URL into a file in user's Dropbox. Note that the transfer from the URL must - /// complete within 5 minutes, or the operation will time out and the job will fail. If the given path already + /// complete within 15 minutes, or the operation will time out and the job will fail. If the given path already /// exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt). /// + /// - scope: files.content.write + /// /// - parameter path: The path in Dropbox where the URL will be saved to. /// - parameter url: The URL to be saved. /// - /// - returns: Through the response callback, the caller will receive a `Files.SaveUrlResult` object on success or - /// a `Files.SaveUrlError` object on failure. - @discardableResult open func saveUrl(path: String, url: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Files.SaveUrlResult` object on success or a + /// `Files.SaveUrlError` object on failure. + @discardableResult public func saveUrl(path: String, url: String) -> RpcRequest { let route = Files.saveUrl let serverArgs = Files.SaveUrlArg(path: path, url: url) return client.request(route, serverArgs: serverArgs) @@ -1106,12 +1555,14 @@ open class FilesRoutes { /// Check the status of a saveUrl job. /// + /// - scope: files.content.write + /// /// - 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 `Files.SaveUrlJobStatus` object on success + /// - returns: Through the response callback, the caller will receive a `Files.SaveUrlJobStatus` object on success /// or a `Async.PollError` object on failure. - @discardableResult open func saveUrlCheckJobStatus(asyncJobId: String) -> RpcRequest { + @discardableResult public func saveUrlCheckJobStatus(asyncJobId: String) -> RpcRequest { let route = Files.saveUrlCheckJobStatus let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -1120,6 +1571,8 @@ open class FilesRoutes { /// Searches for files and folders. Note: Recent changes will be reflected in search results within a few seconds /// and older revisions of existing files may still match your query for up to a few days. /// + /// - scope: files.metadata.read + /// /// - parameter path: The path in the user's Dropbox to search. Should probably be a folder. /// - parameter query: The string to search for. Query string may be rewritten to improve relevance of results. The /// string is split on spaces into multiple tokens. For file name searching, the last token is used for prefix @@ -1129,10 +1582,16 @@ open class FilesRoutes { /// - parameter mode: The search mode (filename, filename_and_content, or deleted_filename). Note that searching /// file content is only available for Dropbox Business accounts. /// - /// - returns: Through the response callback, the caller will receive a `Files.SearchResult` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.SearchResult` object on success or a /// `Files.SearchError` object on failure. - @available(*, unavailable, message:"search is deprecated. Use searchV2.") - @discardableResult open func search(path: String, query: String, start: UInt64 = 0, maxResults: UInt64 = 100, mode: Files.SearchMode = .filename) -> RpcRequest { + @available(*, unavailable, message: "search is deprecated. Use searchV2.") + @discardableResult public func search( + path: String, + query: String, + start: UInt64 = 0, + maxResults: UInt64 = 100, + mode: Files.SearchMode = .filename + ) -> RpcRequest { let route = Files.search let serverArgs = Files.SearchArg(path: path, query: query, start: start, maxResults: maxResults, mode: mode) return client.request(route, serverArgs: serverArgs) @@ -1142,29 +1601,38 @@ open class FilesRoutes { /// maximum of 10,000 matches. Recent changes may not immediately be reflected in search results due to a short /// delay in indexing. Duplicate results may be returned across pages. Some results may not be returned. /// + /// - scope: files.metadata.read + /// /// - parameter query: The string to search for. May match across multiple fields based on the request arguments. /// - parameter options: Options for more targeted search results. /// - parameter matchFieldOptions: Options for search results match fields. /// - parameter includeHighlights: Deprecated and moved this option to SearchMatchFieldOptions. /// - /// - returns: Through the response callback, the caller will receive a `Files.SearchV2Result` object on success or + /// - returns: Through the response callback, the caller will receive a `Files.SearchV2Result` object on success or /// a `Files.SearchError` object on failure. - @discardableResult open func searchV2(query: String, options: Files.SearchOptions? = nil, matchFieldOptions: Files.SearchMatchFieldOptions? = nil, includeHighlights: Bool? = nil) -> RpcRequest { + @discardableResult public func searchV2( + query: String, + options: Files.SearchOptions? = nil, + matchFieldOptions: Files.SearchMatchFieldOptions? = nil, + includeHighlights: Bool? = nil + ) -> RpcRequest { let route = Files.searchV2 let serverArgs = Files.SearchV2Arg(query: query, options: options, matchFieldOptions: matchFieldOptions, includeHighlights: includeHighlights) return client.request(route, serverArgs: serverArgs) } /// Fetches the next page of search results returned from searchV2. Note: searchV2 along with searchContinueV2 can - /// only be used to retrieve a maximum of 10,000 matches. Recent changes may not immediately be reflected in search - /// results due to a short delay in indexing. Duplicate results may be returned across pages. Some results may not - /// be returned. + /// only be used to retrieve a maximum of 10,000 matches. Recent changes may not immediately be reflected in + /// search results due to a short delay in indexing. Duplicate results may be returned across pages. Some + /// results may not be returned. + /// + /// - scope: files.metadata.read /// /// - parameter cursor: The cursor returned by your last call to searchV2. Used to fetch the next page of results. /// - /// - returns: Through the response callback, the caller will receive a `Files.SearchV2Result` object on success or + /// - returns: Through the response callback, the caller will receive a `Files.SearchV2Result` object on success or /// a `Files.SearchError` object on failure. - @discardableResult open func searchContinueV2(cursor: String) -> RpcRequest { + @discardableResult public func searchContinueV2(cursor: String) -> RpcRequest { let route = Files.searchContinueV2 let serverArgs = Files.SearchV2ContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -1173,12 +1641,14 @@ open class FilesRoutes { /// Add a tag to an item. A tag is a string. The strings are automatically converted to lowercase letters. No more /// than 20 tags can be added to a given item. /// + /// - scope: files.metadata.write + /// /// - parameter path: Path to the item to be tagged. /// - parameter tagText: The value of the tag to add. Will be automatically converted to lowercase letters. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.AddTagError` object on failure. - @discardableResult open func tagsAdd(path: String, tagText: String) -> RpcRequest { + @discardableResult public func tagsAdd(path: String, tagText: String) -> RpcRequest { let route = Files.tagsAdd let serverArgs = Files.AddTagArg(path: path, tagText: tagText) return client.request(route, serverArgs: serverArgs) @@ -1186,11 +1656,13 @@ open class FilesRoutes { /// Get list of tags assigned to items. /// + /// - scope: files.metadata.read + /// /// - parameter paths: Path to the items. /// - /// - returns: Through the response callback, the caller will receive a `Files.GetTagsResult` object on success or - /// a `Files.BaseTagError` object on failure. - @discardableResult open func tagsGet(paths: Array) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Files.GetTagsResult` object on success or a + /// `Files.BaseTagError` object on failure. + @discardableResult public func tagsGet(paths: [String]) -> RpcRequest { let route = Files.tagsGet let serverArgs = Files.GetTagsArg(paths: paths) return client.request(route, serverArgs: serverArgs) @@ -1198,27 +1670,32 @@ open class FilesRoutes { /// Remove a tag from an item. /// + /// - scope: files.metadata.write + /// /// - parameter path: Path to the item to tag. /// - parameter tagText: The tag to remove. Will be automatically converted to lowercase letters. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.RemoveTagError` object on failure. - @discardableResult open func tagsRemove(path: String, tagText: String) -> RpcRequest { + @discardableResult public func tagsRemove(path: String, tagText: String) -> RpcRequest { let route = Files.tagsRemove let serverArgs = Files.RemoveTagArg(path: path, tagText: tagText) return client.request(route, serverArgs: serverArgs) } /// Unlock the files at the given paths. A locked file can only be unlocked by the lock holder or, if a business - /// account, a team admin. A successful response indicates that the file has been unlocked. Returns a list of the - /// unlocked file paths and their metadata after this operation. + /// account, a team admin. A successful response indicates that the file has been unlocked. Returns a list of + /// the unlocked file paths and their metadata after this operation. + /// + /// - scope: files.content.write /// /// - parameter entries: List of 'entries'. Each 'entry' contains a path of the file which will be unlocked. /// Duplicate path arguments in the batch are considered only once. /// - /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on /// success or a `Files.LockFileError` object on failure. - @discardableResult open func unlockFileBatch(entries: Array) -> RpcRequest { + @discardableResult public func unlockFileBatch(entries: [Files.UnlockFileArg]) + -> RpcRequest { let route = Files.unlockFileBatch let serverArgs = Files.UnlockFileBatchArg(entries: entries) return client.request(route, serverArgs: serverArgs) @@ -1226,66 +1703,131 @@ open class FilesRoutes { /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data - /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per - /// month. For more information, see the Data transport limit page + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content /// does not match this hash, an error will be returned. For more information see our Content hash /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadError` object on failure. - @discardableResult open func upload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false, contentHash: String? = nil, input: Data) -> UploadRequest { + @discardableResult public func upload( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false, + contentHash: String? = nil, + input: Data + ) -> UploadRequest { let route = Files.upload - let serverArgs = Files.UploadArg(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict, contentHash: contentHash) + let serverArgs = Files.UploadArg( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict, + contentHash: contentHash + ) return client.request(route, serverArgs: serverArgs, input: .data(input)) } /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data - /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per - /// month. For more information, see the Data transport limit page + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content /// does not match this hash, an error will be returned. For more information see our Content hash /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadError` object on failure. - @discardableResult open func upload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false, contentHash: String? = nil, input: URL) -> UploadRequest { + @discardableResult public func upload( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false, + contentHash: String? = nil, + input: URL + ) -> UploadRequest { let route = Files.upload - let serverArgs = Files.UploadArg(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict, contentHash: contentHash) + let serverArgs = Files.UploadArg( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict, + contentHash: contentHash + ) return client.request(route, serverArgs: serverArgs, input: .file(input)) } /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data - /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per - /// month. For more information, see the Data transport limit page + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content /// does not match this hash, an error will be returned. For more information see our Content hash /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadError` object on failure. - @discardableResult open func upload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array? = nil, strictConflict: Bool = false, contentHash: String? = nil, input: InputStream) -> UploadRequest { + @discardableResult public func upload( + path: String, + mode: Files.WriteMode = .add, + autorename: Bool = false, + clientModified: Date? = nil, + mute: Bool = false, + propertyGroups: [FileProperties.PropertyGroup]? = nil, + strictConflict: Bool = false, + contentHash: String? = nil, + input: InputStream + ) -> UploadRequest { let route = Files.upload - let serverArgs = Files.UploadArg(path: path, mode: mode, autorename: autorename, clientModified: clientModified, mute: mute, propertyGroups: propertyGroups, strictConflict: strictConflict, contentHash: contentHash) + let serverArgs = Files.UploadArg( + path: path, + mode: mode, + autorename: autorename, + clientModified: clientModified, + mute: mute, + propertyGroups: propertyGroups, + strictConflict: strictConflict, + contentHash: contentHash + ) return client.request(route, serverArgs: serverArgs, input: .stream(input)) } /// Append more data to an upload session. When the parameter close is set, this call will close the session. A /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload - /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with - /// a limit on the number of data transport calls allowed per month. For more information, see the Data transport - /// limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write /// /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter close: If true, the current session will be closed, at which point you won't be able to call @@ -1295,9 +1837,14 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.UploadSessionAppendError` object on failure. - @discardableResult open func uploadSessionAppendV2(cursor: Files.UploadSessionCursor, close: Bool = false, contentHash: String? = nil, input: Data) -> UploadRequest { + @discardableResult public func uploadSessionAppendV2( + cursor: Files.UploadSessionCursor, + close: Bool = false, + contentHash: String? = nil, + input: Data + ) -> UploadRequest { let route = Files.uploadSessionAppendV2 let serverArgs = Files.UploadSessionAppendArg(cursor: cursor, close: close, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .data(input)) @@ -1305,9 +1852,11 @@ open class FilesRoutes { /// Append more data to an upload session. When the parameter close is set, this call will close the session. A /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload - /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with - /// a limit on the number of data transport calls allowed per month. For more information, see the Data transport - /// limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write /// /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter close: If true, the current session will be closed, at which point you won't be able to call @@ -1317,9 +1866,14 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.UploadSessionAppendError` object on failure. - @discardableResult open func uploadSessionAppendV2(cursor: Files.UploadSessionCursor, close: Bool = false, contentHash: String? = nil, input: URL) -> UploadRequest { + @discardableResult public func uploadSessionAppendV2( + cursor: Files.UploadSessionCursor, + close: Bool = false, + contentHash: String? = nil, + input: URL + ) -> UploadRequest { let route = Files.uploadSessionAppendV2 let serverArgs = Files.UploadSessionAppendArg(cursor: cursor, close: close, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .file(input)) @@ -1327,9 +1881,11 @@ open class FilesRoutes { /// Append more data to an upload session. When the parameter close is set, this call will close the session. A /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload - /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with - /// a limit on the number of data transport calls allowed per month. For more information, see the Data transport - /// limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write /// /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter close: If true, the current session will be closed, at which point you won't be able to call @@ -1339,69 +1895,92 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.UploadSessionAppendError` object on failure. - @discardableResult open func uploadSessionAppendV2(cursor: Files.UploadSessionCursor, close: Bool = false, contentHash: String? = nil, input: InputStream) -> UploadRequest { + @discardableResult public func uploadSessionAppendV2( + cursor: Files.UploadSessionCursor, + close: Bool = false, + contentHash: String? = nil, + input: InputStream + ) -> UploadRequest { let route = Files.uploadSessionAppendV2 let serverArgs = Files.UploadSessionAppendArg(cursor: cursor, close: close, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .stream(input)) } /// Append more data to an upload session. A single request should not upload more than 150 MB. The maximum size of - /// a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls - /// for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more - /// information, see the Data transport limit page + /// a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport + /// calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. + /// For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter sessionId: The upload session ID (returned by uploadSessionStart). /// - parameter offset: Offset in bytes at which data should be appended. We use this to make sure upload data isn't /// lost or duplicated in the event of a network error. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.UploadSessionAppendError` object on failure. - @available(*, unavailable, message:"uploadSessionAppend is deprecated. Use uploadSessionAppendV2.") - @discardableResult open func uploadSessionAppend(sessionId: String, offset: UInt64, input: Data) -> UploadRequest { + @available(*, unavailable, message: "uploadSessionAppend is deprecated. Use uploadSessionAppendV2.") + @discardableResult public func uploadSessionAppend( + sessionId: String, + offset: UInt64, + input: Data + ) -> UploadRequest { let route = Files.uploadSessionAppend let serverArgs = Files.UploadSessionCursor(sessionId: sessionId, offset: offset) return client.request(route, serverArgs: serverArgs, input: .data(input)) } /// Append more data to an upload session. A single request should not upload more than 150 MB. The maximum size of - /// a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls - /// for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more - /// information, see the Data transport limit page + /// a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport + /// calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. + /// For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter sessionId: The upload session ID (returned by uploadSessionStart). /// - parameter offset: Offset in bytes at which data should be appended. We use this to make sure upload data isn't /// lost or duplicated in the event of a network error. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.UploadSessionAppendError` object on failure. - @available(*, unavailable, message:"uploadSessionAppend is deprecated. Use uploadSessionAppendV2.") - @discardableResult open func uploadSessionAppend(sessionId: String, offset: UInt64, input: URL) -> UploadRequest { + @available(*, unavailable, message: "uploadSessionAppend is deprecated. Use uploadSessionAppendV2.") + @discardableResult public func uploadSessionAppend( + sessionId: String, + offset: UInt64, + input: URL + ) -> UploadRequest { let route = Files.uploadSessionAppend let serverArgs = Files.UploadSessionCursor(sessionId: sessionId, offset: offset) return client.request(route, serverArgs: serverArgs, input: .file(input)) } /// Append more data to an upload session. A single request should not upload more than 150 MB. The maximum size of - /// a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls - /// for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more - /// information, see the Data transport limit page + /// a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport + /// calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. + /// For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter sessionId: The upload session ID (returned by uploadSessionStart). /// - parameter offset: Offset in bytes at which data should be appended. We use this to make sure upload data isn't /// lost or duplicated in the event of a network error. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Files.UploadSessionAppendError` object on failure. - @available(*, unavailable, message:"uploadSessionAppend is deprecated. Use uploadSessionAppendV2.") - @discardableResult open func uploadSessionAppend(sessionId: String, offset: UInt64, input: InputStream) -> UploadRequest { + @available(*, unavailable, message: "uploadSessionAppend is deprecated. Use uploadSessionAppendV2.") + @discardableResult public func uploadSessionAppend( + sessionId: String, + offset: UInt64, + input: InputStream + ) -> UploadRequest { let route = Files.uploadSessionAppend let serverArgs = Files.UploadSessionCursor(sessionId: sessionId, offset: offset) return client.request(route, serverArgs: serverArgs, input: .stream(input)) @@ -1409,10 +1988,12 @@ open class FilesRoutes { /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this - /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data - /// transport calls allowed per month. For more information, see the Data transport limit page + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content @@ -1420,9 +2001,14 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadSessionFinishError` object on failure. - @discardableResult open func uploadSessionFinish(cursor: Files.UploadSessionCursor, commit: Files.CommitInfo, contentHash: String? = nil, input: Data) -> UploadRequest { + @discardableResult public func uploadSessionFinish( + cursor: Files.UploadSessionCursor, + commit: Files.CommitInfo, + contentHash: String? = nil, + input: Data + ) -> UploadRequest { let route = Files.uploadSessionFinish let serverArgs = Files.UploadSessionFinishArg(cursor: cursor, commit: commit, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .data(input)) @@ -1430,10 +2016,12 @@ open class FilesRoutes { /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this - /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data - /// transport calls allowed per month. For more information, see the Data transport limit page + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content @@ -1441,9 +2029,14 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadSessionFinishError` object on failure. - @discardableResult open func uploadSessionFinish(cursor: Files.UploadSessionCursor, commit: Files.CommitInfo, contentHash: String? = nil, input: URL) -> UploadRequest { + @discardableResult public func uploadSessionFinish( + cursor: Files.UploadSessionCursor, + commit: Files.CommitInfo, + contentHash: String? = nil, + input: URL + ) -> UploadRequest { let route = Files.uploadSessionFinish let serverArgs = Files.UploadSessionFinishArg(cursor: cursor, commit: commit, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .file(input)) @@ -1451,10 +2044,12 @@ open class FilesRoutes { /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this - /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data - /// transport calls allowed per month. For more information, see the Data transport limit page + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content @@ -1462,9 +2057,14 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a /// `Files.UploadSessionFinishError` object on failure. - @discardableResult open func uploadSessionFinish(cursor: Files.UploadSessionCursor, commit: Files.CommitInfo, contentHash: String? = nil, input: InputStream) -> UploadRequest { + @discardableResult public func uploadSessionFinish( + cursor: Files.UploadSessionCursor, + commit: Files.CommitInfo, + contentHash: String? = nil, + input: InputStream + ) -> UploadRequest { let route = Files.uploadSessionFinish let serverArgs = Files.UploadSessionFinishArg(cursor: cursor, commit: commit, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .stream(input)) @@ -1472,23 +2072,26 @@ open class FilesRoutes { /// This route helps you commit many files at once into a user's Dropbox. Use uploadSessionStart and /// uploadSessionAppendV2 to upload file contents. We recommend uploading many files in parallel to increase - /// throughput. Once the file contents have been uploaded, rather than calling uploadSessionFinish, use this route - /// to finish all your upload sessions in a single request. close in UploadSessionStartArg or close in + /// throughput. Once the file contents have been uploaded, rather than calling uploadSessionFinish, use this + /// route to finish all your upload sessions in a single request. close in UploadSessionStartArg or close in /// UploadSessionAppendArg needs to be true for the last uploadSessionStart or uploadSessionAppendV2 call. The /// maximum size of a file one can upload to an upload session is 350 GB. This route will return a job_id /// immediately and do the async commit job in background. Use uploadSessionFinishBatchCheck to check the job - /// status. For the same account, this route should be executed serially. That means you should not start the next - /// job before current job finishes. We allow up to 1000 entries in a single request. Calls to this endpoint will - /// count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls - /// allowed per month. For more information, see the Data transport limit page + /// status. For the same account, this route should be executed serially. That means you should not start the + /// next job before current job finishes. We allow up to 1000 entries in a single request. Calls to this + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter entries: Commit information for each file in the batch. /// - /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionFinishBatchLaunch` + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionFinishBatchLaunch` /// object on success or a `Void` object on failure. - @available(*, unavailable, message:"uploadSessionFinishBatch is deprecated. Use uploadSessionFinishBatchV2.") - @discardableResult open func uploadSessionFinishBatch(entries: Array) -> RpcRequest { + @available(*, unavailable, message: "uploadSessionFinishBatch is deprecated. Use uploadSessionFinishBatchV2.") + @discardableResult public func uploadSessionFinishBatch(entries: [Files.UploadSessionFinishArg]) + -> RpcRequest { let route = Files.uploadSessionFinishBatch let serverArgs = Files.UploadSessionFinishBatchArg(entries: entries) return client.request(route, serverArgs: serverArgs) @@ -1496,19 +2099,23 @@ open class FilesRoutes { /// This route helps you commit many files at once into a user's Dropbox. Use uploadSessionStart and /// uploadSessionAppendV2 to upload file contents. We recommend uploading many files in parallel to increase - /// throughput. Once the file contents have been uploaded, rather than calling uploadSessionFinish, use this route - /// to finish all your upload sessions in a single request. close in UploadSessionStartArg or close in - /// UploadSessionAppendArg needs to be true for the last uploadSessionStart or uploadSessionAppendV2 call of each - /// upload session. The maximum size of a file one can upload to an upload session is 350 GB. We allow up to 1000 - /// entries in a single request. Calls to this endpoint will count as data transport calls for any Dropbox Business - /// teams with a limit on the number of data transport calls allowed per month. For more information, see the Data - /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// throughput. Once the file contents have been uploaded, rather than calling uploadSessionFinish, use this + /// route to finish all your upload sessions in a single request. close in UploadSessionStartArg or close in + /// UploadSessionAppendArg needs to be true for the last uploadSessionStart or uploadSessionAppendV2 call of + /// each upload session. The maximum size of a file one can upload to an upload session is 350 GB. We allow up + /// to 1000 entries in a single request. Calls to this endpoint will count as data transport calls for any + /// Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more + /// information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write /// /// - parameter entries: Commit information for each file in the batch. /// - /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionFinishBatchResult` + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionFinishBatchResult` /// object on success or a `Void` object on failure. - @discardableResult open func uploadSessionFinishBatchV2(entries: Array) -> RpcRequest { + @discardableResult public func uploadSessionFinishBatchV2(entries: [Files.UploadSessionFinishArg]) + -> RpcRequest { let route = Files.uploadSessionFinishBatchV2 let serverArgs = Files.UploadSessionFinishBatchArg(entries: entries) return client.request(route, serverArgs: serverArgs) @@ -1517,12 +2124,15 @@ open class FilesRoutes { /// Returns the status of an asynchronous job for uploadSessionFinishBatch. If success, it returns list of result /// for each entry. /// + /// - scope: files.content.write + /// /// - 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 `Files.UploadSessionFinishBatchJobStatus` + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionFinishBatchJobStatus` /// object on success or a `Async.PollError` object on failure. - @discardableResult open func uploadSessionFinishBatchCheck(asyncJobId: String) -> RpcRequest { + @discardableResult public func uploadSessionFinishBatchCheck(asyncJobId: String) + -> RpcRequest { let route = Files.uploadSessionFinishBatchCheck let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -1533,20 +2143,22 @@ open class FilesRoutes { /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in - /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its creation - /// will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data transport calls - /// for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more - /// information, see the Data transport limit page - /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you to - /// send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in - /// UploadSessionType upload session. To start a new concurrent session, set sessionType in UploadSessionStartArg to - /// concurrent in UploadSessionType. After that, you can send file data in concurrent uploadSessionAppendV2 - /// requests. Finally finish the session with uploadSessionFinish. There are couple of constraints with concurrent - /// sessions to make them work. You can not send data with uploadSessionStart or uploadSessionFinish call, only with - /// uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 call must be multiple of 4194304 bytes - /// (except for last uploadSessionAppendV2 with close in UploadSessionStartArg to true, that may contain any - /// remaining data). + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write /// /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. @@ -1557,9 +2169,14 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on /// success or a `Files.UploadSessionStartError` object on failure. - @discardableResult open func uploadSessionStart(close: Bool = false, sessionType: Files.UploadSessionType? = nil, contentHash: String? = nil, input: Data) -> UploadRequest { + @discardableResult public func uploadSessionStart( + close: Bool = false, + sessionType: Files.UploadSessionType? = nil, + contentHash: String? = nil, + input: Data + ) -> UploadRequest { let route = Files.uploadSessionStart let serverArgs = Files.UploadSessionStartArg(close: close, sessionType: sessionType, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .data(input)) @@ -1570,20 +2187,22 @@ open class FilesRoutes { /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in - /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its creation - /// will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data transport calls - /// for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more - /// information, see the Data transport limit page - /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you to - /// send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in - /// UploadSessionType upload session. To start a new concurrent session, set sessionType in UploadSessionStartArg to - /// concurrent in UploadSessionType. After that, you can send file data in concurrent uploadSessionAppendV2 - /// requests. Finally finish the session with uploadSessionFinish. There are couple of constraints with concurrent - /// sessions to make them work. You can not send data with uploadSessionStart or uploadSessionFinish call, only with - /// uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 call must be multiple of 4194304 bytes - /// (except for last uploadSessionAppendV2 with close in UploadSessionStartArg to true, that may contain any - /// remaining data). + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write /// /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. @@ -1594,9 +2213,14 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on /// success or a `Files.UploadSessionStartError` object on failure. - @discardableResult open func uploadSessionStart(close: Bool = false, sessionType: Files.UploadSessionType? = nil, contentHash: String? = nil, input: URL) -> UploadRequest { + @discardableResult public func uploadSessionStart( + close: Bool = false, + sessionType: Files.UploadSessionType? = nil, + contentHash: String? = nil, + input: URL + ) -> UploadRequest { let route = Files.uploadSessionStart let serverArgs = Files.UploadSessionStartArg(close: close, sessionType: sessionType, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .file(input)) @@ -1607,20 +2231,22 @@ open class FilesRoutes { /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in - /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its creation - /// will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data transport calls - /// for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more - /// information, see the Data transport limit page - /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you to - /// send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in - /// UploadSessionType upload session. To start a new concurrent session, set sessionType in UploadSessionStartArg to - /// concurrent in UploadSessionType. After that, you can send file data in concurrent uploadSessionAppendV2 - /// requests. Finally finish the session with uploadSessionFinish. There are couple of constraints with concurrent - /// sessions to make them work. You can not send data with uploadSessionStart or uploadSessionFinish call, only with - /// uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 call must be multiple of 4194304 bytes - /// (except for last uploadSessionAppendV2 with close in UploadSessionStartArg to true, that may contain any - /// remaining data). + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write /// /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. @@ -1631,29 +2257,38 @@ open class FilesRoutes { /// https://www.dropbox.com/developers/reference/content-hash page. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on /// success or a `Files.UploadSessionStartError` object on failure. - @discardableResult open func uploadSessionStart(close: Bool = false, sessionType: Files.UploadSessionType? = nil, contentHash: String? = nil, input: InputStream) -> UploadRequest { + @discardableResult public func uploadSessionStart( + close: Bool = false, + sessionType: Files.UploadSessionType? = nil, + contentHash: String? = nil, + input: InputStream + ) -> UploadRequest { let route = Files.uploadSessionStart let serverArgs = Files.UploadSessionStartArg(close: close, sessionType: sessionType, contentHash: contentHash) return client.request(route, serverArgs: serverArgs, input: .stream(input)) } /// This route starts batch of upload_sessions. Please refer to `upload_session/start` usage. Calls to this endpoint - /// will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport - /// calls allowed per month. For more information, see the Data transport limit page + /// will count as data transport calls for any Dropbox Business teams with a limit on the number of data + /// transport calls allowed per month. For more information, see the Data transport limit page /// https://www.dropbox.com/developers/reference/data-transport-limit. /// + /// - scope: files.content.write + /// /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in /// UploadSessionType. /// - parameter numSessions: The number of upload sessions to start. /// - /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartBatchResult` - /// object on success or a `Void` object on failure. - @discardableResult open func uploadSessionStartBatch(numSessions: UInt64, sessionType: Files.UploadSessionType? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartBatchResult` object + /// on success or a `Void` object on failure. + @discardableResult public func uploadSessionStartBatch( + numSessions: UInt64, + sessionType: Files.UploadSessionType? = nil + ) -> RpcRequest { let route = Files.uploadSessionStartBatch let serverArgs = Files.UploadSessionStartBatchArg(numSessions: numSessions, sessionType: sessionType) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Openid.swift b/Source/SwiftyDropbox/Shared/Generated/Openid.swift index d27017995..c594937ba 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Openid.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Openid.swift @@ -7,120 +7,148 @@ import Foundation /// Datatypes and serializers for the openid namespace -open class Openid { +public class Openid { /// The OpenIdError union - public enum OpenIdError: CustomStringConvertible { + public enum OpenIdError: CustomStringConvertible, JSONRepresentable { /// Missing openid claims for the associated access token. case incorrectOpenidScopes /// An unspecified error. case other + func json() throws -> JSON { + try OpenIdErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OpenIdErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OpenIdErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OpenIdError: \(error)" + } } } - open class OpenIdErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OpenIdError) -> JSON { + + public class OpenIdErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OpenIdError) throws -> JSON { switch value { - case .incorrectOpenidScopes: - var d = [String: JSON]() - d[".tag"] = .str("incorrect_openid_scopes") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .incorrectOpenidScopes: + var d = [String: JSON]() + d[".tag"] = .str("incorrect_openid_scopes") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> OpenIdError { + + public func deserialize(_ json: JSON) throws -> OpenIdError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "incorrect_openid_scopes": - return OpenIdError.incorrectOpenidScopes - case "other": - return OpenIdError.other - default: - return OpenIdError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "incorrect_openid_scopes": + return OpenIdError.incorrectOpenidScopes + case "other": + return OpenIdError.other default: - fatalError("Failed to deserialize") + return OpenIdError.other + } + default: + throw JSONSerializerError.deserializeError(type: OpenIdError.self, json: json) } } } /// No Parameters - open class UserInfoArgs: CustomStringConvertible { - public init() { + public class UserInfoArgs: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try UserInfoArgsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserInfoArgsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserInfoArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserInfoArgs: \(error)" + } } } - open class UserInfoArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserInfoArgs) -> JSON { + + public class UserInfoArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserInfoArgs) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserInfoArgs { + + public func deserialize(_ json: JSON) throws -> UserInfoArgs { switch json { - case .dictionary(_): - return UserInfoArgs() - default: - fatalError("Type error deserializing") + case .dictionary: + return UserInfoArgs() + default: + throw JSONSerializerError.deserializeError(type: UserInfoArgs.self, json: json) } } } /// The UserInfoError union - public enum UserInfoError: CustomStringConvertible { + public enum UserInfoError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case openidError(Openid.OpenIdError) /// An unspecified error. case other + func json() throws -> JSON { + try UserInfoErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserInfoErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserInfoErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserInfoError: \(error)" + } } } - open class UserInfoErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserInfoError) -> JSON { + + public class UserInfoErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserInfoError) throws -> JSON { switch value { - case .openidError(let arg): - var d = ["openid_error": Openid.OpenIdErrorSerializer().serialize(arg)] - d[".tag"] = .str("openid_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .openidError(let arg): + var d = try ["openid_error": Openid.OpenIdErrorSerializer().serialize(arg)] + d[".tag"] = .str("openid_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> UserInfoError { + + public func deserialize(_ json: JSON) throws -> UserInfoError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "openid_error": - let v = Openid.OpenIdErrorSerializer().deserialize(d["openid_error"] ?? .null) - return UserInfoError.openidError(v) - case "other": - return UserInfoError.other - default: - return UserInfoError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "openid_error": + let v = try Openid.OpenIdErrorSerializer().deserialize(d["openid_error"] ?? .null) + return UserInfoError.openidError(v) + case "other": + return UserInfoError.other default: - fatalError("Failed to deserialize") + return UserInfoError.other + } + default: + throw JSONSerializerError.deserializeError(type: UserInfoError.self, json: json) } } } /// The UserInfoResult struct - open class UserInfoResult: CustomStringConvertible { + public class UserInfoResult: CustomStringConvertible, JSONRepresentable { /// Last name of user. public let familyName: String? /// First name of user. @@ -147,40 +175,50 @@ open class Openid { stringValidator()(sub) self.sub = sub } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserInfoResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserInfoResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserInfoResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserInfoResult: \(error)" + } } } - open class UserInfoResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserInfoResult) -> JSON { - let output = [ - "family_name": NullableSerializer(Serialization._StringSerializer).serialize(value.familyName), - "given_name": NullableSerializer(Serialization._StringSerializer).serialize(value.givenName), - "email": NullableSerializer(Serialization._StringSerializer).serialize(value.email), - "email_verified": NullableSerializer(Serialization._BoolSerializer).serialize(value.emailVerified), - "iss": Serialization._StringSerializer.serialize(value.iss), - "sub": Serialization._StringSerializer.serialize(value.sub), + + public class UserInfoResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserInfoResult) throws -> JSON { + let output = [ + "family_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.familyName), + "given_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.givenName), + "email": try NullableSerializer(Serialization._StringSerializer).serialize(value.email), + "email_verified": try NullableSerializer(Serialization._BoolSerializer).serialize(value.emailVerified), + "iss": try Serialization._StringSerializer.serialize(value.iss), + "sub": try Serialization._StringSerializer.serialize(value.sub), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserInfoResult { + + public func deserialize(_ json: JSON) throws -> UserInfoResult { switch json { - case .dictionary(let dict): - let familyName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["family_name"] ?? .null) - let givenName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["given_name"] ?? .null) - let email = NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) - let emailVerified = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["email_verified"] ?? .null) - let iss = Serialization._StringSerializer.deserialize(dict["iss"] ?? .str("")) - let sub = Serialization._StringSerializer.deserialize(dict["sub"] ?? .str("")) - return UserInfoResult(familyName: familyName, givenName: givenName, email: email, emailVerified: emailVerified, iss: iss, sub: sub) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let familyName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["family_name"] ?? .null) + let givenName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["given_name"] ?? .null) + let email = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) + let emailVerified = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["email_verified"] ?? .null) + let iss = try Serialization._StringSerializer.deserialize(dict["iss"] ?? .str("")) + let sub = try Serialization._StringSerializer.deserialize(dict["sub"] ?? .str("")) + return UserInfoResult(familyName: familyName, givenName: givenName, email: email, emailVerified: emailVerified, iss: iss, sub: sub) + default: + throw JSONSerializerError.deserializeError(type: UserInfoResult.self, json: json) } } } - /// Stone Route Objects static let userinfo = Route( @@ -191,8 +229,10 @@ open class Openid { argSerializer: Openid.UserInfoArgsSerializer(), responseSerializer: Openid.UserInfoResultSerializer(), errorSerializer: Openid.UserInfoErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/OpenidRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/OpenidRoutes.swift index 51e95e5d4..186c997fc 100644 --- a/Source/SwiftyDropbox/Shared/Generated/OpenidRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/OpenidRoutes.swift @@ -7,22 +7,24 @@ import Foundation /// Routes for the openid namespace -open class OpenidRoutes { +/// For Objective-C compatible routes see DBOpenidRoutes +public class OpenidRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// This route is used for refreshing the info that is found in the id_token during the OIDC flow. This route /// doesn't require any arguments and will use the scopes approved for the given access token. /// + /// - scope: openid /// - /// - returns: Through the response callback, the caller will receive a `Openid.UserInfoResult` object on success - /// or a `Openid.UserInfoError` object on failure. - @discardableResult open func userinfo() -> RpcRequest { + /// + /// - returns: Through the response callback, the caller will receive a `Openid.UserInfoResult` object on success or + /// a `Openid.UserInfoError` object on failure. + @discardableResult public func userinfo() -> RpcRequest { let route = Openid.userinfo let serverArgs = Openid.UserInfoArgs() return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Paper.swift b/Source/SwiftyDropbox/Shared/Generated/Paper.swift index 48b3f70a0..5f525bf39 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Paper.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Paper.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the paper namespace -open class Paper { +public class Paper { /// The AddMember struct - open class AddMember: CustomStringConvertible { + public class AddMember: CustomStringConvertible, JSONRepresentable { /// Permission for the user. public let permissionLevel: Paper.PaperDocPermissionLevel /// User which should be added to the Paper doc. Specify only email address or Dropbox account ID. @@ -18,108 +18,138 @@ open class Paper { self.permissionLevel = permissionLevel self.member = member } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddMemberSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddMemberSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddMemberSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddMember: \(error)" + } } } - open class AddMemberSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddMember) -> JSON { - let output = [ - "member": Sharing.MemberSelectorSerializer().serialize(value.member), - "permission_level": Paper.PaperDocPermissionLevelSerializer().serialize(value.permissionLevel), + + public class AddMemberSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddMember) throws -> JSON { + let output = [ + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), + "permission_level": try Paper.PaperDocPermissionLevelSerializer().serialize(value.permissionLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddMember { + + public func deserialize(_ json: JSON) throws -> AddMember { switch json { - case .dictionary(let dict): - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - let permissionLevel = Paper.PaperDocPermissionLevelSerializer().deserialize(dict["permission_level"] ?? Paper.PaperDocPermissionLevelSerializer().serialize(.edit)) - return AddMember(member: member, permissionLevel: permissionLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + let permissionLevel = try Paper.PaperDocPermissionLevelSerializer() + .deserialize(dict["permission_level"] ?? Paper.PaperDocPermissionLevelSerializer().serialize(.edit)) + return AddMember(member: member, permissionLevel: permissionLevel) + default: + throw JSONSerializerError.deserializeError(type: AddMember.self, json: json) } } } /// The RefPaperDoc struct - open class RefPaperDoc: CustomStringConvertible { + public class RefPaperDoc: CustomStringConvertible, JSONRepresentable { /// The Paper doc ID. public let docId: String public init(docId: String) { stringValidator()(docId) self.docId = docId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RefPaperDocSerializer().serialize(self)))" + + func json() throws -> JSON { + try RefPaperDocSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RefPaperDocSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RefPaperDoc: \(error)" + } } } - open class RefPaperDocSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RefPaperDoc) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), + + public class RefPaperDocSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RefPaperDoc) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RefPaperDoc { + + public func deserialize(_ json: JSON) throws -> RefPaperDoc { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - return RefPaperDoc(docId: docId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + return RefPaperDoc(docId: docId) + default: + throw JSONSerializerError.deserializeError(type: RefPaperDoc.self, json: json) } } } /// The AddPaperDocUser struct - open class AddPaperDocUser: Paper.RefPaperDoc { + public class AddPaperDocUser: Paper.RefPaperDoc { /// User which should be added to the Paper doc. Specify only email address or Dropbox account ID. - public let members: Array + public let members: [Paper.AddMember] /// A personal message that will be emailed to each successfully added member. public let customMessage: String? /// Clients should set this to true if no email message shall be sent to added users. public let quiet: Bool - public init(docId: String, members: Array, customMessage: String? = nil, quiet: Bool = false) { + public init(docId: String, members: [Paper.AddMember], customMessage: String? = nil, quiet: Bool = false) { self.members = members nullableValidator(stringValidator())(customMessage) self.customMessage = customMessage self.quiet = quiet super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddPaperDocUserSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddPaperDocUserSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddPaperDocUser: \(error)" + } } } - open class AddPaperDocUserSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddPaperDocUser) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "members": ArraySerializer(Paper.AddMemberSerializer()).serialize(value.members), - "custom_message": NullableSerializer(Serialization._StringSerializer).serialize(value.customMessage), - "quiet": Serialization._BoolSerializer.serialize(value.quiet), + + public class AddPaperDocUserSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddPaperDocUser) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "members": try ArraySerializer(Paper.AddMemberSerializer()).serialize(value.members), + "custom_message": try NullableSerializer(Serialization._StringSerializer).serialize(value.customMessage), + "quiet": try Serialization._BoolSerializer.serialize(value.quiet), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddPaperDocUser { + + public func deserialize(_ json: JSON) throws -> AddPaperDocUser { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let members = ArraySerializer(Paper.AddMemberSerializer()).deserialize(dict["members"] ?? .null) - let customMessage = NullableSerializer(Serialization._StringSerializer).deserialize(dict["custom_message"] ?? .null) - let quiet = Serialization._BoolSerializer.deserialize(dict["quiet"] ?? .number(0)) - return AddPaperDocUser(docId: docId, members: members, customMessage: customMessage, quiet: quiet) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let members = try ArraySerializer(Paper.AddMemberSerializer()).deserialize(dict["members"] ?? .null) + let customMessage = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["custom_message"] ?? .null) + let quiet = try Serialization._BoolSerializer.deserialize(dict["quiet"] ?? .number(0)) + return AddPaperDocUser(docId: docId, members: members, customMessage: customMessage, quiet: quiet) + default: + throw JSONSerializerError.deserializeError(type: AddPaperDocUser.self, json: json) } } } /// Per-member result for docsUsersAdd. - open class AddPaperDocUserMemberResult: CustomStringConvertible { + public class AddPaperDocUserMemberResult: CustomStringConvertible, JSONRepresentable { /// One of specified input members. public let member: Sharing.MemberSelector /// The outcome of the action on this member. @@ -128,33 +158,44 @@ open class Paper { self.member = member self.result = result } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddPaperDocUserMemberResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddPaperDocUserMemberResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddPaperDocUserMemberResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddPaperDocUserMemberResult: \(error)" + } } } - open class AddPaperDocUserMemberResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddPaperDocUserMemberResult) -> JSON { - let output = [ - "member": Sharing.MemberSelectorSerializer().serialize(value.member), - "result": Paper.AddPaperDocUserResultSerializer().serialize(value.result), + + public class AddPaperDocUserMemberResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddPaperDocUserMemberResult) throws -> JSON { + let output = [ + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), + "result": try Paper.AddPaperDocUserResultSerializer().serialize(value.result), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddPaperDocUserMemberResult { + + public func deserialize(_ json: JSON) throws -> AddPaperDocUserMemberResult { switch json { - case .dictionary(let dict): - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - let result = Paper.AddPaperDocUserResultSerializer().deserialize(dict["result"] ?? .null) - return AddPaperDocUserMemberResult(member: member, result: result) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + let result = try Paper.AddPaperDocUserResultSerializer().deserialize(dict["result"] ?? .null) + return AddPaperDocUserMemberResult(member: member, result: result) + default: + throw JSONSerializerError.deserializeError(type: AddPaperDocUserMemberResult.self, json: json) } } } /// The AddPaperDocUserResult union - public enum AddPaperDocUserResult: CustomStringConvertible { + public enum AddPaperDocUserResult: CustomStringConvertible, JSONRepresentable { /// User was successfully added to the Paper doc. case success /// Something unexpected happened when trying to add the user to the Paper doc. @@ -172,124 +213,145 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try AddPaperDocUserResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddPaperDocUserResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddPaperDocUserResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddPaperDocUserResult: \(error)" + } } } - open class AddPaperDocUserResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddPaperDocUserResult) -> JSON { + + public class AddPaperDocUserResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddPaperDocUserResult) throws -> JSON { switch value { - case .success: - var d = [String: JSON]() - d[".tag"] = .str("success") - return .dictionary(d) - case .unknownError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_error") - return .dictionary(d) - case .sharingOutsideTeamDisabled: - var d = [String: JSON]() - d[".tag"] = .str("sharing_outside_team_disabled") - return .dictionary(d) - case .dailyLimitReached: - var d = [String: JSON]() - d[".tag"] = .str("daily_limit_reached") - return .dictionary(d) - case .userIsOwner: - var d = [String: JSON]() - d[".tag"] = .str("user_is_owner") - return .dictionary(d) - case .failedUserDataRetrieval: - var d = [String: JSON]() - d[".tag"] = .str("failed_user_data_retrieval") - return .dictionary(d) - case .permissionAlreadyGranted: - var d = [String: JSON]() - d[".tag"] = .str("permission_already_granted") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddPaperDocUserResult { + case .success: + var d = [String: JSON]() + d[".tag"] = .str("success") + return .dictionary(d) + case .unknownError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_error") + return .dictionary(d) + case .sharingOutsideTeamDisabled: + var d = [String: JSON]() + d[".tag"] = .str("sharing_outside_team_disabled") + return .dictionary(d) + case .dailyLimitReached: + var d = [String: JSON]() + d[".tag"] = .str("daily_limit_reached") + return .dictionary(d) + case .userIsOwner: + var d = [String: JSON]() + d[".tag"] = .str("user_is_owner") + return .dictionary(d) + case .failedUserDataRetrieval: + var d = [String: JSON]() + d[".tag"] = .str("failed_user_data_retrieval") + return .dictionary(d) + case .permissionAlreadyGranted: + var d = [String: JSON]() + d[".tag"] = .str("permission_already_granted") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddPaperDocUserResult { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - return AddPaperDocUserResult.success - case "unknown_error": - return AddPaperDocUserResult.unknownError - case "sharing_outside_team_disabled": - return AddPaperDocUserResult.sharingOutsideTeamDisabled - case "daily_limit_reached": - return AddPaperDocUserResult.dailyLimitReached - case "user_is_owner": - return AddPaperDocUserResult.userIsOwner - case "failed_user_data_retrieval": - return AddPaperDocUserResult.failedUserDataRetrieval - case "permission_already_granted": - return AddPaperDocUserResult.permissionAlreadyGranted - case "other": - return AddPaperDocUserResult.other - default: - return AddPaperDocUserResult.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + return AddPaperDocUserResult.success + case "unknown_error": + return AddPaperDocUserResult.unknownError + case "sharing_outside_team_disabled": + return AddPaperDocUserResult.sharingOutsideTeamDisabled + case "daily_limit_reached": + return AddPaperDocUserResult.dailyLimitReached + case "user_is_owner": + return AddPaperDocUserResult.userIsOwner + case "failed_user_data_retrieval": + return AddPaperDocUserResult.failedUserDataRetrieval + case "permission_already_granted": + return AddPaperDocUserResult.permissionAlreadyGranted + case "other": + return AddPaperDocUserResult.other default: - fatalError("Failed to deserialize") + return AddPaperDocUserResult.other + } + default: + throw JSONSerializerError.deserializeError(type: AddPaperDocUserResult.self, json: json) } } } /// The Cursor struct - open class Cursor: CustomStringConvertible { + public class Cursor: CustomStringConvertible, JSONRepresentable { /// The actual cursor value. public let value: String /// Expiration time of value. Some cursors might have expiration time assigned. This is a UTC value after which - /// the cursor is no longer valid and the API starts returning an error. If cursor expires a new one needs to be - /// obtained and pagination needs to be restarted. Some cursors might be short-lived some cursors might be - /// long-lived. This really depends on the sorting type and order, e.g.: 1. on one hand, listing docs created by - /// the user, sorted by the created time ascending will have undefinite expiration because the results cannot - /// change while the iteration is happening. This cursor would be suitable for long term polling. 2. on the - /// other hand, listing docs sorted by the last modified time will have a very short expiration as docs do get - /// modified very often and the modified time can be changed while the iteration is happening thus altering the - /// results. + /// the cursor is no longer valid and the API starts returning an error. If cursor expires a new one + /// needs to be obtained and pagination needs to be restarted. Some cursors might be short-lived some + /// cursors might be long-lived. This really depends on the sorting type and order, e.g.: 1. on one + /// hand, listing docs created by the user, sorted by the created time ascending will have undefinite + /// expiration because the results cannot change while the iteration is happening. This cursor would be + /// suitable for long term polling. 2. on the other hand, listing docs sorted by the last modified time + /// will have a very short expiration as docs do get modified very often and the modified time can be + /// changed while the iteration is happening thus altering the results. public let expiration: Date? public init(value: String, expiration: Date? = nil) { stringValidator()(value) self.value = value self.expiration = expiration } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CursorSerializer().serialize(self)))" + + func json() throws -> JSON { + try CursorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CursorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Cursor: \(error)" + } } } - open class CursorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Cursor) -> JSON { - let output = [ - "value": Serialization._StringSerializer.serialize(value.value), - "expiration": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiration), + + public class CursorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Cursor) throws -> JSON { + let output = [ + "value": try Serialization._StringSerializer.serialize(value.value), + "expiration": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiration), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> Cursor { + + public func deserialize(_ json: JSON) throws -> Cursor { switch json { - case .dictionary(let dict): - let value = Serialization._StringSerializer.deserialize(dict["value"] ?? .null) - let expiration = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiration"] ?? .null) - return Cursor(value: value, expiration: expiration) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let value = try Serialization._StringSerializer.deserialize(dict["value"] ?? .null) + let expiration = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiration"] ?? .null) + return Cursor(value: value, expiration: expiration) + default: + throw JSONSerializerError.deserializeError(type: Cursor.self, json: json) } } } /// The PaperApiBaseError union - public enum PaperApiBaseError: CustomStringConvertible { + public enum PaperApiBaseError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to perform this action. This may be due to it only having access to /// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. @@ -297,44 +359,54 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try PaperApiBaseErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperApiBaseErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperApiBaseErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperApiBaseError: \(error)" + } } } - open class PaperApiBaseErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperApiBaseError) -> JSON { + + public class PaperApiBaseErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperApiBaseError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PaperApiBaseError { + + public func deserialize(_ json: JSON) throws -> PaperApiBaseError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return PaperApiBaseError.insufficientPermissions - case "other": - return PaperApiBaseError.other - default: - return PaperApiBaseError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return PaperApiBaseError.insufficientPermissions + case "other": + return PaperApiBaseError.other default: - fatalError("Failed to deserialize") + return PaperApiBaseError.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperApiBaseError.self, json: json) } } } /// The DocLookupError union - public enum DocLookupError: CustomStringConvertible { + public enum DocLookupError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to perform this action. This may be due to it only having access to /// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. @@ -344,50 +416,60 @@ open class Paper { /// The required doc was not found. case docNotFound + func json() throws -> JSON { + try DocLookupErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DocLookupErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DocLookupErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DocLookupError: \(error)" + } } } - open class DocLookupErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DocLookupError) -> JSON { + + public class DocLookupErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DocLookupError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .docNotFound: - var d = [String: JSON]() - d[".tag"] = .str("doc_not_found") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DocLookupError { + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .docNotFound: + var d = [String: JSON]() + d[".tag"] = .str("doc_not_found") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DocLookupError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return DocLookupError.insufficientPermissions - case "other": - return DocLookupError.other - case "doc_not_found": - return DocLookupError.docNotFound - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return DocLookupError.insufficientPermissions + case "other": + return DocLookupError.other + case "doc_not_found": + return DocLookupError.docNotFound default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: DocLookupError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: DocLookupError.self, json: json) } } } /// The subscription level of a Paper doc. - public enum DocSubscriptionLevel: CustomStringConvertible { + public enum DocSubscriptionLevel: CustomStringConvertible, JSONRepresentable { /// No change email messages unless you're the creator. case default_ /// Ignored: Not shown in pad lists or activity and no email message is sent. @@ -397,56 +479,66 @@ open class Paper { /// Unsubscribed: Shown in pad lists, but not in activity and no change email messages are sent. case noEmail + func json() throws -> JSON { + try DocSubscriptionLevelSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DocSubscriptionLevelSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DocSubscriptionLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DocSubscriptionLevel: \(error)" + } } } - open class DocSubscriptionLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DocSubscriptionLevel) -> JSON { + + public class DocSubscriptionLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DocSubscriptionLevel) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .ignore: - var d = [String: JSON]() - d[".tag"] = .str("ignore") - return .dictionary(d) - case .every: - var d = [String: JSON]() - d[".tag"] = .str("every") - return .dictionary(d) - case .noEmail: - var d = [String: JSON]() - d[".tag"] = .str("no_email") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DocSubscriptionLevel { + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .ignore: + var d = [String: JSON]() + d[".tag"] = .str("ignore") + return .dictionary(d) + case .every: + var d = [String: JSON]() + d[".tag"] = .str("every") + return .dictionary(d) + case .noEmail: + var d = [String: JSON]() + d[".tag"] = .str("no_email") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DocSubscriptionLevel { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return DocSubscriptionLevel.default_ - case "ignore": - return DocSubscriptionLevel.ignore - case "every": - return DocSubscriptionLevel.every - case "no_email": - return DocSubscriptionLevel.noEmail - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return DocSubscriptionLevel.default_ + case "ignore": + return DocSubscriptionLevel.ignore + case "every": + return DocSubscriptionLevel.every + case "no_email": + return DocSubscriptionLevel.noEmail default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: DocSubscriptionLevel.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: DocSubscriptionLevel.self, json: json) } } } /// The desired export format of the Paper doc. - public enum ExportFormat: CustomStringConvertible { + public enum ExportFormat: CustomStringConvertible, JSONRepresentable { /// The HTML export format. case html /// The markdown export format. @@ -454,50 +546,60 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try ExportFormatSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportFormatSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportFormatSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportFormat: \(error)" + } } } - open class ExportFormatSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportFormat) -> JSON { + + public class ExportFormatSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportFormat) throws -> JSON { switch value { - case .html: - var d = [String: JSON]() - d[".tag"] = .str("html") - return .dictionary(d) - case .markdown: - var d = [String: JSON]() - d[".tag"] = .str("markdown") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExportFormat { + case .html: + var d = [String: JSON]() + d[".tag"] = .str("html") + return .dictionary(d) + case .markdown: + var d = [String: JSON]() + d[".tag"] = .str("markdown") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExportFormat { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "html": - return ExportFormat.html - case "markdown": - return ExportFormat.markdown - case "other": - return ExportFormat.other - default: - return ExportFormat.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "html": + return ExportFormat.html + case "markdown": + return ExportFormat.markdown + case "other": + return ExportFormat.other default: - fatalError("Failed to deserialize") + return ExportFormat.other + } + default: + throw JSONSerializerError.deserializeError(type: ExportFormat.self, json: json) } } } /// Data structure representing a Paper folder. - open class Folder: CustomStringConvertible { + public class Folder: CustomStringConvertible, JSONRepresentable { /// Paper folder ID. This ID uniquely identifies the folder. public let id: String /// Paper folder name. @@ -508,76 +610,97 @@ open class Paper { stringValidator()(name) self.name = name } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Folder: \(error)" + } } } - open class FolderSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Folder) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "name": Serialization._StringSerializer.serialize(value.name), + + public class FolderSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Folder) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> Folder { + + public func deserialize(_ json: JSON) throws -> Folder { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return Folder(id: id, name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return Folder(id: id, name: name) + default: + throw JSONSerializerError.deserializeError(type: Folder.self, json: json) } } } /// The sharing policy of a Paper folder. The sharing policy of subfolders is inherited from the root folder. - public enum FolderSharingPolicyType: CustomStringConvertible { + public enum FolderSharingPolicyType: CustomStringConvertible, JSONRepresentable { /// Everyone in your team and anyone directly invited can access this folder. case team /// Only people directly invited can access this folder. case inviteOnly + func json() throws -> JSON { + try FolderSharingPolicyTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderSharingPolicyTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderSharingPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderSharingPolicyType: \(error)" + } } } - open class FolderSharingPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderSharingPolicyType) -> JSON { + + public class FolderSharingPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderSharingPolicyType) throws -> JSON { switch value { - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .inviteOnly: - var d = [String: JSON]() - d[".tag"] = .str("invite_only") - return .dictionary(d) + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .inviteOnly: + var d = [String: JSON]() + d[".tag"] = .str("invite_only") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> FolderSharingPolicyType { + + public func deserialize(_ json: JSON) throws -> FolderSharingPolicyType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team": - return FolderSharingPolicyType.team - case "invite_only": - return FolderSharingPolicyType.inviteOnly - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team": + return FolderSharingPolicyType.team + case "invite_only": + return FolderSharingPolicyType.inviteOnly default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: FolderSharingPolicyType.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: FolderSharingPolicyType.self, json: json) } } } /// The subscription level of a Paper folder. - public enum FolderSubscriptionLevel: CustomStringConvertible { + public enum FolderSubscriptionLevel: CustomStringConvertible, JSONRepresentable { /// Not shown in activity, no email messages. case none /// Shown in activity, no email messages. @@ -587,91 +710,113 @@ open class Paper { /// Shown in activity, weekly email messages. case weeklyEmails + func json() throws -> JSON { + try FolderSubscriptionLevelSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderSubscriptionLevelSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderSubscriptionLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderSubscriptionLevel: \(error)" + } } } - open class FolderSubscriptionLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderSubscriptionLevel) -> JSON { + + public class FolderSubscriptionLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderSubscriptionLevel) throws -> JSON { switch value { - case .none: - var d = [String: JSON]() - d[".tag"] = .str("none") - return .dictionary(d) - case .activityOnly: - var d = [String: JSON]() - d[".tag"] = .str("activity_only") - return .dictionary(d) - case .dailyEmails: - var d = [String: JSON]() - d[".tag"] = .str("daily_emails") - return .dictionary(d) - case .weeklyEmails: - var d = [String: JSON]() - d[".tag"] = .str("weekly_emails") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FolderSubscriptionLevel { + case .none: + var d = [String: JSON]() + d[".tag"] = .str("none") + return .dictionary(d) + case .activityOnly: + var d = [String: JSON]() + d[".tag"] = .str("activity_only") + return .dictionary(d) + case .dailyEmails: + var d = [String: JSON]() + d[".tag"] = .str("daily_emails") + return .dictionary(d) + case .weeklyEmails: + var d = [String: JSON]() + d[".tag"] = .str("weekly_emails") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FolderSubscriptionLevel { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "none": - return FolderSubscriptionLevel.none - case "activity_only": - return FolderSubscriptionLevel.activityOnly - case "daily_emails": - return FolderSubscriptionLevel.dailyEmails - case "weekly_emails": - return FolderSubscriptionLevel.weeklyEmails - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "none": + return FolderSubscriptionLevel.none + case "activity_only": + return FolderSubscriptionLevel.activityOnly + case "daily_emails": + return FolderSubscriptionLevel.dailyEmails + case "weekly_emails": + return FolderSubscriptionLevel.weeklyEmails default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: FolderSubscriptionLevel.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: FolderSubscriptionLevel.self, json: json) } } } /// Metadata about Paper folders containing the specififed Paper doc. - open class FoldersContainingPaperDoc: CustomStringConvertible { + public class FoldersContainingPaperDoc: CustomStringConvertible, JSONRepresentable { /// The sharing policy of the folder containing the Paper doc. public let folderSharingPolicyType: Paper.FolderSharingPolicyType? /// The folder path. If present the first folder is the root folder. - public let folders: Array? - public init(folderSharingPolicyType: Paper.FolderSharingPolicyType? = nil, folders: Array? = nil) { + public let folders: [Paper.Folder]? + public init(folderSharingPolicyType: Paper.FolderSharingPolicyType? = nil, folders: [Paper.Folder]? = nil) { self.folderSharingPolicyType = folderSharingPolicyType self.folders = folders } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FoldersContainingPaperDocSerializer().serialize(self)))" + + func json() throws -> JSON { + try FoldersContainingPaperDocSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FoldersContainingPaperDocSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FoldersContainingPaperDoc: \(error)" + } } } - open class FoldersContainingPaperDocSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FoldersContainingPaperDoc) -> JSON { - let output = [ - "folder_sharing_policy_type": NullableSerializer(Paper.FolderSharingPolicyTypeSerializer()).serialize(value.folderSharingPolicyType), - "folders": NullableSerializer(ArraySerializer(Paper.FolderSerializer())).serialize(value.folders), + + public class FoldersContainingPaperDocSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FoldersContainingPaperDoc) throws -> JSON { + let output = [ + "folder_sharing_policy_type": try NullableSerializer(Paper.FolderSharingPolicyTypeSerializer()).serialize(value.folderSharingPolicyType), + "folders": try NullableSerializer(ArraySerializer(Paper.FolderSerializer())).serialize(value.folders), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FoldersContainingPaperDoc { + + public func deserialize(_ json: JSON) throws -> FoldersContainingPaperDoc { switch json { - case .dictionary(let dict): - let folderSharingPolicyType = NullableSerializer(Paper.FolderSharingPolicyTypeSerializer()).deserialize(dict["folder_sharing_policy_type"] ?? .null) - let folders = NullableSerializer(ArraySerializer(Paper.FolderSerializer())).deserialize(dict["folders"] ?? .null) - return FoldersContainingPaperDoc(folderSharingPolicyType: folderSharingPolicyType, folders: folders) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let folderSharingPolicyType = try NullableSerializer(Paper.FolderSharingPolicyTypeSerializer()) + .deserialize(dict["folder_sharing_policy_type"] ?? .null) + let folders = try NullableSerializer(ArraySerializer(Paper.FolderSerializer())).deserialize(dict["folders"] ?? .null) + return FoldersContainingPaperDoc(folderSharingPolicyType: folderSharingPolicyType, folders: folders) + default: + throw JSONSerializerError.deserializeError(type: FoldersContainingPaperDoc.self, json: json) } } } /// The import format of the incoming data. - public enum ImportFormat: CustomStringConvertible { + public enum ImportFormat: CustomStringConvertible, JSONRepresentable { /// The provided data is interpreted as standard HTML. case html /// The provided data is interpreted as markdown. The first line of the provided document will be used as the @@ -683,56 +828,66 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try ImportFormatSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ImportFormatSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ImportFormatSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ImportFormat: \(error)" + } } } - open class ImportFormatSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ImportFormat) -> JSON { + + public class ImportFormatSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ImportFormat) throws -> JSON { switch value { - case .html: - var d = [String: JSON]() - d[".tag"] = .str("html") - return .dictionary(d) - case .markdown: - var d = [String: JSON]() - d[".tag"] = .str("markdown") - return .dictionary(d) - case .plainText: - var d = [String: JSON]() - d[".tag"] = .str("plain_text") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ImportFormat { + case .html: + var d = [String: JSON]() + d[".tag"] = .str("html") + return .dictionary(d) + case .markdown: + var d = [String: JSON]() + d[".tag"] = .str("markdown") + return .dictionary(d) + case .plainText: + var d = [String: JSON]() + d[".tag"] = .str("plain_text") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ImportFormat { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "html": - return ImportFormat.html - case "markdown": - return ImportFormat.markdown - case "plain_text": - return ImportFormat.plainText - case "other": - return ImportFormat.other - default: - return ImportFormat.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "html": + return ImportFormat.html + case "markdown": + return ImportFormat.markdown + case "plain_text": + return ImportFormat.plainText + case "other": + return ImportFormat.other default: - fatalError("Failed to deserialize") + return ImportFormat.other + } + default: + throw JSONSerializerError.deserializeError(type: ImportFormat.self, json: json) } } } /// The InviteeInfoWithPermissionLevel struct - open class InviteeInfoWithPermissionLevel: CustomStringConvertible { + public class InviteeInfoWithPermissionLevel: CustomStringConvertible, JSONRepresentable { /// Email address invited to the Paper doc. public let invitee: Sharing.InviteeInfo /// Permission level for the invitee. @@ -741,77 +896,98 @@ open class Paper { self.invitee = invitee self.permissionLevel = permissionLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InviteeInfoWithPermissionLevelSerializer().serialize(self)))" + + func json() throws -> JSON { + try InviteeInfoWithPermissionLevelSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InviteeInfoWithPermissionLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InviteeInfoWithPermissionLevel: \(error)" + } } } - open class InviteeInfoWithPermissionLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InviteeInfoWithPermissionLevel) -> JSON { - let output = [ - "invitee": Sharing.InviteeInfoSerializer().serialize(value.invitee), - "permission_level": Paper.PaperDocPermissionLevelSerializer().serialize(value.permissionLevel), + + public class InviteeInfoWithPermissionLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InviteeInfoWithPermissionLevel) throws -> JSON { + let output = [ + "invitee": try Sharing.InviteeInfoSerializer().serialize(value.invitee), + "permission_level": try Paper.PaperDocPermissionLevelSerializer().serialize(value.permissionLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> InviteeInfoWithPermissionLevel { + + public func deserialize(_ json: JSON) throws -> InviteeInfoWithPermissionLevel { switch json { - case .dictionary(let dict): - let invitee = Sharing.InviteeInfoSerializer().deserialize(dict["invitee"] ?? .null) - let permissionLevel = Paper.PaperDocPermissionLevelSerializer().deserialize(dict["permission_level"] ?? .null) - return InviteeInfoWithPermissionLevel(invitee: invitee, permissionLevel: permissionLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let invitee = try Sharing.InviteeInfoSerializer().deserialize(dict["invitee"] ?? .null) + let permissionLevel = try Paper.PaperDocPermissionLevelSerializer().deserialize(dict["permission_level"] ?? .null) + return InviteeInfoWithPermissionLevel(invitee: invitee, permissionLevel: permissionLevel) + default: + throw JSONSerializerError.deserializeError(type: InviteeInfoWithPermissionLevel.self, json: json) } } } /// The ListDocsCursorError union - public enum ListDocsCursorError: CustomStringConvertible { + public enum ListDocsCursorError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case cursorError(Paper.PaperApiCursorError) /// An unspecified error. case other + func json() throws -> JSON { + try ListDocsCursorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListDocsCursorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListDocsCursorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListDocsCursorError: \(error)" + } } } - open class ListDocsCursorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListDocsCursorError) -> JSON { + + public class ListDocsCursorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListDocsCursorError) throws -> JSON { switch value { - case .cursorError(let arg): - var d = ["cursor_error": Paper.PaperApiCursorErrorSerializer().serialize(arg)] - d[".tag"] = .str("cursor_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .cursorError(let arg): + var d = try ["cursor_error": Paper.PaperApiCursorErrorSerializer().serialize(arg)] + d[".tag"] = .str("cursor_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> ListDocsCursorError { + + public func deserialize(_ json: JSON) throws -> ListDocsCursorError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "cursor_error": - let v = Paper.PaperApiCursorErrorSerializer().deserialize(d["cursor_error"] ?? .null) - return ListDocsCursorError.cursorError(v) - case "other": - return ListDocsCursorError.other - default: - return ListDocsCursorError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "cursor_error": + let v = try Paper.PaperApiCursorErrorSerializer().deserialize(d["cursor_error"] ?? .null) + return ListDocsCursorError.cursorError(v) + case "other": + return ListDocsCursorError.other default: - fatalError("Failed to deserialize") + return ListDocsCursorError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListDocsCursorError.self, json: json) } } } /// The ListPaperDocsArgs struct - open class ListPaperDocsArgs: CustomStringConvertible { + public class ListPaperDocsArgs: CustomStringConvertible, JSONRepresentable { /// Allows user to specify how the Paper docs should be filtered. public let filterBy: Paper.ListPaperDocsFilterBy /// Allows user to specify how the Paper docs should be sorted. @@ -821,75 +997,105 @@ open class Paper { /// Size limit per batch. The maximum number of docs that can be retrieved per batch is 1000. Higher value /// results in invalid arguments error. public let limit: Int32 - public init(filterBy: Paper.ListPaperDocsFilterBy = .docsAccessed, sortBy: Paper.ListPaperDocsSortBy = .accessed, sortOrder: Paper.ListPaperDocsSortOrder = .ascending, limit: Int32 = 1000) { + public init( + filterBy: Paper.ListPaperDocsFilterBy = .docsAccessed, + sortBy: Paper.ListPaperDocsSortBy = .accessed, + sortOrder: Paper.ListPaperDocsSortOrder = .ascending, + limit: Int32 = 1_000 + ) { self.filterBy = filterBy self.sortBy = sortBy self.sortOrder = sortOrder - comparableValidator(minValue: 1, maxValue: 1000)(limit) + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListPaperDocsArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListPaperDocsArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListPaperDocsArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListPaperDocsArgs: \(error)" + } } } - open class ListPaperDocsArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListPaperDocsArgs) -> JSON { - let output = [ - "filter_by": Paper.ListPaperDocsFilterBySerializer().serialize(value.filterBy), - "sort_by": Paper.ListPaperDocsSortBySerializer().serialize(value.sortBy), - "sort_order": Paper.ListPaperDocsSortOrderSerializer().serialize(value.sortOrder), - "limit": Serialization._Int32Serializer.serialize(value.limit), + + public class ListPaperDocsArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListPaperDocsArgs) throws -> JSON { + let output = [ + "filter_by": try Paper.ListPaperDocsFilterBySerializer().serialize(value.filterBy), + "sort_by": try Paper.ListPaperDocsSortBySerializer().serialize(value.sortBy), + "sort_order": try Paper.ListPaperDocsSortOrderSerializer().serialize(value.sortOrder), + "limit": try Serialization._Int32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListPaperDocsArgs { + + public func deserialize(_ json: JSON) throws -> ListPaperDocsArgs { switch json { - case .dictionary(let dict): - let filterBy = Paper.ListPaperDocsFilterBySerializer().deserialize(dict["filter_by"] ?? Paper.ListPaperDocsFilterBySerializer().serialize(.docsAccessed)) - let sortBy = Paper.ListPaperDocsSortBySerializer().deserialize(dict["sort_by"] ?? Paper.ListPaperDocsSortBySerializer().serialize(.accessed)) - let sortOrder = Paper.ListPaperDocsSortOrderSerializer().deserialize(dict["sort_order"] ?? Paper.ListPaperDocsSortOrderSerializer().serialize(.ascending)) - let limit = Serialization._Int32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return ListPaperDocsArgs(filterBy: filterBy, sortBy: sortBy, sortOrder: sortOrder, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let filterBy = try Paper.ListPaperDocsFilterBySerializer() + .deserialize(dict["filter_by"] ?? Paper.ListPaperDocsFilterBySerializer().serialize(.docsAccessed)) + let sortBy = try Paper.ListPaperDocsSortBySerializer() + .deserialize(dict["sort_by"] ?? Paper.ListPaperDocsSortBySerializer().serialize(.accessed)) + let sortOrder = try Paper.ListPaperDocsSortOrderSerializer() + .deserialize(dict["sort_order"] ?? Paper.ListPaperDocsSortOrderSerializer().serialize(.ascending)) + let limit = try Serialization._Int32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return ListPaperDocsArgs(filterBy: filterBy, sortBy: sortBy, sortOrder: sortOrder, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListPaperDocsArgs.self, json: json) } } } /// The ListPaperDocsContinueArgs struct - open class ListPaperDocsContinueArgs: CustomStringConvertible { + public class ListPaperDocsContinueArgs: CustomStringConvertible, JSONRepresentable { /// The cursor obtained from docsList or docsListContinue. Allows for pagination. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListPaperDocsContinueArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListPaperDocsContinueArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListPaperDocsContinueArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListPaperDocsContinueArgs: \(error)" + } } } - open class ListPaperDocsContinueArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListPaperDocsContinueArgs) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListPaperDocsContinueArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListPaperDocsContinueArgs) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListPaperDocsContinueArgs { + + public func deserialize(_ json: JSON) throws -> ListPaperDocsContinueArgs { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListPaperDocsContinueArgs(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListPaperDocsContinueArgs(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListPaperDocsContinueArgs.self, json: json) } } } /// The ListPaperDocsFilterBy union - public enum ListPaperDocsFilterBy: CustomStringConvertible { + public enum ListPaperDocsFilterBy: CustomStringConvertible, JSONRepresentable { /// Fetches all Paper doc IDs that the user has ever accessed. case docsAccessed /// Fetches only the Paper doc IDs that the user has created. @@ -897,94 +1103,116 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try ListPaperDocsFilterBySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListPaperDocsFilterBySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListPaperDocsFilterBySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListPaperDocsFilterBy: \(error)" + } } } - open class ListPaperDocsFilterBySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListPaperDocsFilterBy) -> JSON { + + public class ListPaperDocsFilterBySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListPaperDocsFilterBy) throws -> JSON { switch value { - case .docsAccessed: - var d = [String: JSON]() - d[".tag"] = .str("docs_accessed") - return .dictionary(d) - case .docsCreated: - var d = [String: JSON]() - d[".tag"] = .str("docs_created") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListPaperDocsFilterBy { + case .docsAccessed: + var d = [String: JSON]() + d[".tag"] = .str("docs_accessed") + return .dictionary(d) + case .docsCreated: + var d = [String: JSON]() + d[".tag"] = .str("docs_created") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListPaperDocsFilterBy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "docs_accessed": - return ListPaperDocsFilterBy.docsAccessed - case "docs_created": - return ListPaperDocsFilterBy.docsCreated - case "other": - return ListPaperDocsFilterBy.other - default: - return ListPaperDocsFilterBy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "docs_accessed": + return ListPaperDocsFilterBy.docsAccessed + case "docs_created": + return ListPaperDocsFilterBy.docsCreated + case "other": + return ListPaperDocsFilterBy.other default: - fatalError("Failed to deserialize") + return ListPaperDocsFilterBy.other + } + default: + throw JSONSerializerError.deserializeError(type: ListPaperDocsFilterBy.self, json: json) } } } /// The ListPaperDocsResponse struct - open class ListPaperDocsResponse: CustomStringConvertible { + public class ListPaperDocsResponse: CustomStringConvertible, JSONRepresentable { /// The list of Paper doc IDs that can be used to access the given Paper docs or supplied to other API methods. /// The list is sorted in the order specified by the initial call to docsList. - public let docIds: Array + public let docIds: [String] /// Pass the cursor into docsListContinue to paginate through all files. The cursor preserves all properties as /// specified in the original call to docsList. public let cursor: Paper.Cursor /// Will be set to True if a subsequent call with the provided cursor to docsListContinue returns immediately - /// with some results. If set to False please allow some delay before making another call to docsListContinue. + /// with some results. If set to False please allow some delay before making another call to + /// docsListContinue. public let hasMore: Bool - public init(docIds: Array, cursor: Paper.Cursor, hasMore: Bool) { + public init(docIds: [String], cursor: Paper.Cursor, hasMore: Bool) { arrayValidator(itemValidator: stringValidator())(docIds) self.docIds = docIds self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListPaperDocsResponseSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListPaperDocsResponseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListPaperDocsResponseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListPaperDocsResponse: \(error)" + } } } - open class ListPaperDocsResponseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListPaperDocsResponse) -> JSON { - let output = [ - "doc_ids": ArraySerializer(Serialization._StringSerializer).serialize(value.docIds), - "cursor": Paper.CursorSerializer().serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class ListPaperDocsResponseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListPaperDocsResponse) throws -> JSON { + let output = [ + "doc_ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.docIds), + "cursor": try Paper.CursorSerializer().serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListPaperDocsResponse { + + public func deserialize(_ json: JSON) throws -> ListPaperDocsResponse { switch json { - case .dictionary(let dict): - let docIds = ArraySerializer(Serialization._StringSerializer).deserialize(dict["doc_ids"] ?? .null) - let cursor = Paper.CursorSerializer().deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return ListPaperDocsResponse(docIds: docIds, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docIds = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["doc_ids"] ?? .null) + let cursor = try Paper.CursorSerializer().deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return ListPaperDocsResponse(docIds: docIds, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: ListPaperDocsResponse.self, json: json) } } } /// The ListPaperDocsSortBy union - public enum ListPaperDocsSortBy: CustomStringConvertible { + public enum ListPaperDocsSortBy: CustomStringConvertible, JSONRepresentable { /// Sorts the Paper docs by the time they were last accessed. case accessed /// Sorts the Paper docs by the time they were last modified. @@ -994,56 +1222,66 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try ListPaperDocsSortBySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListPaperDocsSortBySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListPaperDocsSortBySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListPaperDocsSortBy: \(error)" + } } } - open class ListPaperDocsSortBySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListPaperDocsSortBy) -> JSON { + + public class ListPaperDocsSortBySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListPaperDocsSortBy) throws -> JSON { switch value { - case .accessed: - var d = [String: JSON]() - d[".tag"] = .str("accessed") - return .dictionary(d) - case .modified: - var d = [String: JSON]() - d[".tag"] = .str("modified") - return .dictionary(d) - case .created: - var d = [String: JSON]() - d[".tag"] = .str("created") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListPaperDocsSortBy { + case .accessed: + var d = [String: JSON]() + d[".tag"] = .str("accessed") + return .dictionary(d) + case .modified: + var d = [String: JSON]() + d[".tag"] = .str("modified") + return .dictionary(d) + case .created: + var d = [String: JSON]() + d[".tag"] = .str("created") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListPaperDocsSortBy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "accessed": - return ListPaperDocsSortBy.accessed - case "modified": - return ListPaperDocsSortBy.modified - case "created": - return ListPaperDocsSortBy.created - case "other": - return ListPaperDocsSortBy.other - default: - return ListPaperDocsSortBy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "accessed": + return ListPaperDocsSortBy.accessed + case "modified": + return ListPaperDocsSortBy.modified + case "created": + return ListPaperDocsSortBy.created + case "other": + return ListPaperDocsSortBy.other default: - fatalError("Failed to deserialize") + return ListPaperDocsSortBy.other + } + default: + throw JSONSerializerError.deserializeError(type: ListPaperDocsSortBy.self, json: json) } } } /// The ListPaperDocsSortOrder union - public enum ListPaperDocsSortOrder: CustomStringConvertible { + public enum ListPaperDocsSortOrder: CustomStringConvertible, JSONRepresentable { /// Sorts the search result in ascending order. case ascending /// Sorts the search result in descending order. @@ -1051,50 +1289,60 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try ListPaperDocsSortOrderSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListPaperDocsSortOrderSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListPaperDocsSortOrderSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListPaperDocsSortOrder: \(error)" + } } } - open class ListPaperDocsSortOrderSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListPaperDocsSortOrder) -> JSON { + + public class ListPaperDocsSortOrderSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListPaperDocsSortOrder) throws -> JSON { switch value { - case .ascending: - var d = [String: JSON]() - d[".tag"] = .str("ascending") - return .dictionary(d) - case .descending: - var d = [String: JSON]() - d[".tag"] = .str("descending") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListPaperDocsSortOrder { + case .ascending: + var d = [String: JSON]() + d[".tag"] = .str("ascending") + return .dictionary(d) + case .descending: + var d = [String: JSON]() + d[".tag"] = .str("descending") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListPaperDocsSortOrder { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "ascending": - return ListPaperDocsSortOrder.ascending - case "descending": - return ListPaperDocsSortOrder.descending - case "other": - return ListPaperDocsSortOrder.other - default: - return ListPaperDocsSortOrder.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "ascending": + return ListPaperDocsSortOrder.ascending + case "descending": + return ListPaperDocsSortOrder.descending + case "other": + return ListPaperDocsSortOrder.other default: - fatalError("Failed to deserialize") + return ListPaperDocsSortOrder.other + } + default: + throw JSONSerializerError.deserializeError(type: ListPaperDocsSortOrder.self, json: json) } } } /// The ListUsersCursorError union - public enum ListUsersCursorError: CustomStringConvertible { + public enum ListUsersCursorError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to perform this action. This may be due to it only having access to /// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. @@ -1106,92 +1354,109 @@ open class Paper { /// An unspecified error. case cursorError(Paper.PaperApiCursorError) + func json() throws -> JSON { + try ListUsersCursorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListUsersCursorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListUsersCursorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListUsersCursorError: \(error)" + } } } - open class ListUsersCursorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListUsersCursorError) -> JSON { + + public class ListUsersCursorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListUsersCursorError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .docNotFound: - var d = [String: JSON]() - d[".tag"] = .str("doc_not_found") - return .dictionary(d) - case .cursorError(let arg): - var d = ["cursor_error": Paper.PaperApiCursorErrorSerializer().serialize(arg)] - d[".tag"] = .str("cursor_error") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListUsersCursorError { + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .docNotFound: + var d = [String: JSON]() + d[".tag"] = .str("doc_not_found") + return .dictionary(d) + case .cursorError(let arg): + var d = try ["cursor_error": Paper.PaperApiCursorErrorSerializer().serialize(arg)] + d[".tag"] = .str("cursor_error") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListUsersCursorError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return ListUsersCursorError.insufficientPermissions - case "other": - return ListUsersCursorError.other - case "doc_not_found": - return ListUsersCursorError.docNotFound - case "cursor_error": - let v = Paper.PaperApiCursorErrorSerializer().deserialize(d["cursor_error"] ?? .null) - return ListUsersCursorError.cursorError(v) - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return ListUsersCursorError.insufficientPermissions + case "other": + return ListUsersCursorError.other + case "doc_not_found": + return ListUsersCursorError.docNotFound + case "cursor_error": + let v = try Paper.PaperApiCursorErrorSerializer().deserialize(d["cursor_error"] ?? .null) + return ListUsersCursorError.cursorError(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ListUsersCursorError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ListUsersCursorError.self, json: json) } } } /// The ListUsersOnFolderArgs struct - open class ListUsersOnFolderArgs: Paper.RefPaperDoc { + public class ListUsersOnFolderArgs: Paper.RefPaperDoc { /// Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. Higher value /// results in invalid arguments error. public let limit: Int32 - public init(docId: String, limit: Int32 = 1000) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(docId: String, limit: Int32 = 1_000) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListUsersOnFolderArgsSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListUsersOnFolderArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListUsersOnFolderArgs: \(error)" + } } } - open class ListUsersOnFolderArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListUsersOnFolderArgs) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "limit": Serialization._Int32Serializer.serialize(value.limit), + + public class ListUsersOnFolderArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListUsersOnFolderArgs) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "limit": try Serialization._Int32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListUsersOnFolderArgs { + + public func deserialize(_ json: JSON) throws -> ListUsersOnFolderArgs { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let limit = Serialization._Int32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return ListUsersOnFolderArgs(docId: docId, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let limit = try Serialization._Int32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return ListUsersOnFolderArgs(docId: docId, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListUsersOnFolderArgs.self, json: json) } } } /// The ListUsersOnFolderContinueArgs struct - open class ListUsersOnFolderContinueArgs: Paper.RefPaperDoc { + public class ListUsersOnFolderContinueArgs: Paper.RefPaperDoc { /// The cursor obtained from docsFolderUsersList or docsFolderUsersListContinue. Allows for pagination. public let cursor: String public init(docId: String, cursor: String) { @@ -1199,37 +1464,44 @@ open class Paper { self.cursor = cursor super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListUsersOnFolderContinueArgsSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListUsersOnFolderContinueArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListUsersOnFolderContinueArgs: \(error)" + } } } - open class ListUsersOnFolderContinueArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListUsersOnFolderContinueArgs) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListUsersOnFolderContinueArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListUsersOnFolderContinueArgs) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListUsersOnFolderContinueArgs { + + public func deserialize(_ json: JSON) throws -> ListUsersOnFolderContinueArgs { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListUsersOnFolderContinueArgs(docId: docId, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListUsersOnFolderContinueArgs(docId: docId, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListUsersOnFolderContinueArgs.self, json: json) } } } /// The ListUsersOnFolderResponse struct - open class ListUsersOnFolderResponse: CustomStringConvertible { + public class ListUsersOnFolderResponse: CustomStringConvertible, JSONRepresentable { /// List of email addresses that are invited on the Paper folder. - public let invitees: Array + public let invitees: [Sharing.InviteeInfo] /// List of users that are invited on the Paper folder. - public let users: Array + public let users: [Sharing.UserInfo] /// Pass the cursor into docsFolderUsersListContinue to paginate through all users. The cursor preserves all /// properties as specified in the original call to docsFolderUsersList. public let cursor: Paper.Cursor @@ -1237,83 +1509,102 @@ open class Paper { /// immediately with some results. If set to False please allow some delay before making another call to /// docsFolderUsersListContinue. public let hasMore: Bool - public init(invitees: Array, users: Array, cursor: Paper.Cursor, hasMore: Bool) { + public init(invitees: [Sharing.InviteeInfo], users: [Sharing.UserInfo], cursor: Paper.Cursor, hasMore: Bool) { self.invitees = invitees self.users = users self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListUsersOnFolderResponseSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListUsersOnFolderResponseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListUsersOnFolderResponseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListUsersOnFolderResponse: \(error)" + } } } - open class ListUsersOnFolderResponseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListUsersOnFolderResponse) -> JSON { - let output = [ - "invitees": ArraySerializer(Sharing.InviteeInfoSerializer()).serialize(value.invitees), - "users": ArraySerializer(Sharing.UserInfoSerializer()).serialize(value.users), - "cursor": Paper.CursorSerializer().serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class ListUsersOnFolderResponseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListUsersOnFolderResponse) throws -> JSON { + let output = [ + "invitees": try ArraySerializer(Sharing.InviteeInfoSerializer()).serialize(value.invitees), + "users": try ArraySerializer(Sharing.UserInfoSerializer()).serialize(value.users), + "cursor": try Paper.CursorSerializer().serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListUsersOnFolderResponse { + + public func deserialize(_ json: JSON) throws -> ListUsersOnFolderResponse { switch json { - case .dictionary(let dict): - let invitees = ArraySerializer(Sharing.InviteeInfoSerializer()).deserialize(dict["invitees"] ?? .null) - let users = ArraySerializer(Sharing.UserInfoSerializer()).deserialize(dict["users"] ?? .null) - let cursor = Paper.CursorSerializer().deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return ListUsersOnFolderResponse(invitees: invitees, users: users, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let invitees = try ArraySerializer(Sharing.InviteeInfoSerializer()).deserialize(dict["invitees"] ?? .null) + let users = try ArraySerializer(Sharing.UserInfoSerializer()).deserialize(dict["users"] ?? .null) + let cursor = try Paper.CursorSerializer().deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return ListUsersOnFolderResponse(invitees: invitees, users: users, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: ListUsersOnFolderResponse.self, json: json) } } } /// The ListUsersOnPaperDocArgs struct - open class ListUsersOnPaperDocArgs: Paper.RefPaperDoc { + public class ListUsersOnPaperDocArgs: Paper.RefPaperDoc { /// Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. Higher value /// results in invalid arguments error. public let limit: Int32 /// Specify this attribute if you want to obtain users that have already accessed the Paper doc. public let filterBy: Paper.UserOnPaperDocFilter - public init(docId: String, limit: Int32 = 1000, filterBy: Paper.UserOnPaperDocFilter = .shared) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(docId: String, limit: Int32 = 1_000, filterBy: Paper.UserOnPaperDocFilter = .shared) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit self.filterBy = filterBy super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListUsersOnPaperDocArgsSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListUsersOnPaperDocArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListUsersOnPaperDocArgs: \(error)" + } } } - open class ListUsersOnPaperDocArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListUsersOnPaperDocArgs) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "limit": Serialization._Int32Serializer.serialize(value.limit), - "filter_by": Paper.UserOnPaperDocFilterSerializer().serialize(value.filterBy), + + public class ListUsersOnPaperDocArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListUsersOnPaperDocArgs) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "limit": try Serialization._Int32Serializer.serialize(value.limit), + "filter_by": try Paper.UserOnPaperDocFilterSerializer().serialize(value.filterBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListUsersOnPaperDocArgs { + + public func deserialize(_ json: JSON) throws -> ListUsersOnPaperDocArgs { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let limit = Serialization._Int32Serializer.deserialize(dict["limit"] ?? .number(1000)) - let filterBy = Paper.UserOnPaperDocFilterSerializer().deserialize(dict["filter_by"] ?? Paper.UserOnPaperDocFilterSerializer().serialize(.shared)) - return ListUsersOnPaperDocArgs(docId: docId, limit: limit, filterBy: filterBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let limit = try Serialization._Int32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + let filterBy = try Paper.UserOnPaperDocFilterSerializer() + .deserialize(dict["filter_by"] ?? Paper.UserOnPaperDocFilterSerializer().serialize(.shared)) + return ListUsersOnPaperDocArgs(docId: docId, limit: limit, filterBy: filterBy) + default: + throw JSONSerializerError.deserializeError(type: ListUsersOnPaperDocArgs.self, json: json) } } } /// The ListUsersOnPaperDocContinueArgs struct - open class ListUsersOnPaperDocContinueArgs: Paper.RefPaperDoc { + public class ListUsersOnPaperDocContinueArgs: Paper.RefPaperDoc { /// The cursor obtained from docsUsersList or docsUsersListContinue. Allows for pagination. public let cursor: String public init(docId: String, cursor: String) { @@ -1321,37 +1612,44 @@ open class Paper { self.cursor = cursor super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListUsersOnPaperDocContinueArgsSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListUsersOnPaperDocContinueArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListUsersOnPaperDocContinueArgs: \(error)" + } } } - open class ListUsersOnPaperDocContinueArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListUsersOnPaperDocContinueArgs) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListUsersOnPaperDocContinueArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListUsersOnPaperDocContinueArgs) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListUsersOnPaperDocContinueArgs { + + public func deserialize(_ json: JSON) throws -> ListUsersOnPaperDocContinueArgs { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListUsersOnPaperDocContinueArgs(docId: docId, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListUsersOnPaperDocContinueArgs(docId: docId, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListUsersOnPaperDocContinueArgs.self, json: json) } } } /// The ListUsersOnPaperDocResponse struct - open class ListUsersOnPaperDocResponse: CustomStringConvertible { + public class ListUsersOnPaperDocResponse: CustomStringConvertible, JSONRepresentable { /// List of email addresses with their respective permission levels that are invited on the Paper doc. - public let invitees: Array + public let invitees: [Paper.InviteeInfoWithPermissionLevel] /// List of users with their respective permission levels that are invited on the Paper folder. - public let users: Array + public let users: [Paper.UserInfoWithPermissionLevel] /// The Paper doc owner. This field is populated on every single response. public let docOwner: Sharing.UserInfo /// Pass the cursor into docsUsersListContinue to paginate through all users. The cursor preserves all @@ -1361,46 +1659,63 @@ open class Paper { /// immediately with some results. If set to False please allow some delay before making another call to /// docsUsersListContinue. public let hasMore: Bool - public init(invitees: Array, users: Array, docOwner: Sharing.UserInfo, cursor: Paper.Cursor, hasMore: Bool) { + public init( + invitees: [Paper.InviteeInfoWithPermissionLevel], + users: [Paper.UserInfoWithPermissionLevel], + docOwner: Sharing.UserInfo, + cursor: Paper.Cursor, + hasMore: Bool + ) { self.invitees = invitees self.users = users self.docOwner = docOwner self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListUsersOnPaperDocResponseSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListUsersOnPaperDocResponseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListUsersOnPaperDocResponseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListUsersOnPaperDocResponse: \(error)" + } } } - open class ListUsersOnPaperDocResponseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListUsersOnPaperDocResponse) -> JSON { - let output = [ - "invitees": ArraySerializer(Paper.InviteeInfoWithPermissionLevelSerializer()).serialize(value.invitees), - "users": ArraySerializer(Paper.UserInfoWithPermissionLevelSerializer()).serialize(value.users), - "doc_owner": Sharing.UserInfoSerializer().serialize(value.docOwner), - "cursor": Paper.CursorSerializer().serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class ListUsersOnPaperDocResponseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListUsersOnPaperDocResponse) throws -> JSON { + let output = [ + "invitees": try ArraySerializer(Paper.InviteeInfoWithPermissionLevelSerializer()).serialize(value.invitees), + "users": try ArraySerializer(Paper.UserInfoWithPermissionLevelSerializer()).serialize(value.users), + "doc_owner": try Sharing.UserInfoSerializer().serialize(value.docOwner), + "cursor": try Paper.CursorSerializer().serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListUsersOnPaperDocResponse { + + public func deserialize(_ json: JSON) throws -> ListUsersOnPaperDocResponse { switch json { - case .dictionary(let dict): - let invitees = ArraySerializer(Paper.InviteeInfoWithPermissionLevelSerializer()).deserialize(dict["invitees"] ?? .null) - let users = ArraySerializer(Paper.UserInfoWithPermissionLevelSerializer()).deserialize(dict["users"] ?? .null) - let docOwner = Sharing.UserInfoSerializer().deserialize(dict["doc_owner"] ?? .null) - let cursor = Paper.CursorSerializer().deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return ListUsersOnPaperDocResponse(invitees: invitees, users: users, docOwner: docOwner, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let invitees = try ArraySerializer(Paper.InviteeInfoWithPermissionLevelSerializer()).deserialize(dict["invitees"] ?? .null) + let users = try ArraySerializer(Paper.UserInfoWithPermissionLevelSerializer()).deserialize(dict["users"] ?? .null) + let docOwner = try Sharing.UserInfoSerializer().deserialize(dict["doc_owner"] ?? .null) + let cursor = try Paper.CursorSerializer().deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return ListUsersOnPaperDocResponse(invitees: invitees, users: users, docOwner: docOwner, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: ListUsersOnPaperDocResponse.self, json: json) } } } /// The PaperApiCursorError union - public enum PaperApiCursorError: CustomStringConvertible { + public enum PaperApiCursorError: CustomStringConvertible, JSONRepresentable { /// The provided cursor is expired. case expiredCursor /// The provided cursor is invalid. @@ -1413,62 +1728,72 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try PaperApiCursorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperApiCursorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperApiCursorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperApiCursorError: \(error)" + } } } - open class PaperApiCursorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperApiCursorError) -> JSON { + + public class PaperApiCursorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperApiCursorError) throws -> JSON { switch value { - case .expiredCursor: - var d = [String: JSON]() - d[".tag"] = .str("expired_cursor") - return .dictionary(d) - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .wrongUserInCursor: - var d = [String: JSON]() - d[".tag"] = .str("wrong_user_in_cursor") - return .dictionary(d) - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperApiCursorError { + case .expiredCursor: + var d = [String: JSON]() + d[".tag"] = .str("expired_cursor") + return .dictionary(d) + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .wrongUserInCursor: + var d = [String: JSON]() + d[".tag"] = .str("wrong_user_in_cursor") + return .dictionary(d) + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperApiCursorError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "expired_cursor": - return PaperApiCursorError.expiredCursor - case "invalid_cursor": - return PaperApiCursorError.invalidCursor - case "wrong_user_in_cursor": - return PaperApiCursorError.wrongUserInCursor - case "reset": - return PaperApiCursorError.reset - case "other": - return PaperApiCursorError.other - default: - return PaperApiCursorError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "expired_cursor": + return PaperApiCursorError.expiredCursor + case "invalid_cursor": + return PaperApiCursorError.invalidCursor + case "wrong_user_in_cursor": + return PaperApiCursorError.wrongUserInCursor + case "reset": + return PaperApiCursorError.reset + case "other": + return PaperApiCursorError.other default: - fatalError("Failed to deserialize") + return PaperApiCursorError.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperApiCursorError.self, json: json) } } } /// The PaperDocCreateArgs struct - open class PaperDocCreateArgs: CustomStringConvertible { + public class PaperDocCreateArgs: CustomStringConvertible, JSONRepresentable { /// The Paper folder ID where the Paper document should be created. The API user has to have write access to /// this folder or error is thrown. public let parentFolderId: String? @@ -1479,33 +1804,44 @@ open class Paper { self.parentFolderId = parentFolderId self.importFormat = importFormat } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocCreateArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocCreateArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocCreateArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocCreateArgs: \(error)" + } } } - open class PaperDocCreateArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocCreateArgs) -> JSON { - let output = [ - "import_format": Paper.ImportFormatSerializer().serialize(value.importFormat), - "parent_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderId), + + public class PaperDocCreateArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocCreateArgs) throws -> JSON { + let output = [ + "import_format": try Paper.ImportFormatSerializer().serialize(value.importFormat), + "parent_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocCreateArgs { + + public func deserialize(_ json: JSON) throws -> PaperDocCreateArgs { switch json { - case .dictionary(let dict): - let importFormat = Paper.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) - let parentFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_id"] ?? .null) - return PaperDocCreateArgs(importFormat: importFormat, parentFolderId: parentFolderId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let importFormat = try Paper.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) + let parentFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_id"] ?? .null) + return PaperDocCreateArgs(importFormat: importFormat, parentFolderId: parentFolderId) + default: + throw JSONSerializerError.deserializeError(type: PaperDocCreateArgs.self, json: json) } } } /// The PaperDocCreateError union - public enum PaperDocCreateError: CustomStringConvertible { + public enum PaperDocCreateError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to perform this action. This may be due to it only having access to /// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. @@ -1522,68 +1858,78 @@ open class Paper { /// HTML with data URI. case imageSizeExceeded + func json() throws -> JSON { + try PaperDocCreateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocCreateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocCreateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocCreateError: \(error)" + } } } - open class PaperDocCreateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocCreateError) -> JSON { + + public class PaperDocCreateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocCreateError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .contentMalformed: - var d = [String: JSON]() - d[".tag"] = .str("content_malformed") - return .dictionary(d) - case .folderNotFound: - var d = [String: JSON]() - d[".tag"] = .str("folder_not_found") - return .dictionary(d) - case .docLengthExceeded: - var d = [String: JSON]() - d[".tag"] = .str("doc_length_exceeded") - return .dictionary(d) - case .imageSizeExceeded: - var d = [String: JSON]() - d[".tag"] = .str("image_size_exceeded") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDocCreateError { + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .contentMalformed: + var d = [String: JSON]() + d[".tag"] = .str("content_malformed") + return .dictionary(d) + case .folderNotFound: + var d = [String: JSON]() + d[".tag"] = .str("folder_not_found") + return .dictionary(d) + case .docLengthExceeded: + var d = [String: JSON]() + d[".tag"] = .str("doc_length_exceeded") + return .dictionary(d) + case .imageSizeExceeded: + var d = [String: JSON]() + d[".tag"] = .str("image_size_exceeded") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDocCreateError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return PaperDocCreateError.insufficientPermissions - case "other": - return PaperDocCreateError.other - case "content_malformed": - return PaperDocCreateError.contentMalformed - case "folder_not_found": - return PaperDocCreateError.folderNotFound - case "doc_length_exceeded": - return PaperDocCreateError.docLengthExceeded - case "image_size_exceeded": - return PaperDocCreateError.imageSizeExceeded - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return PaperDocCreateError.insufficientPermissions + case "other": + return PaperDocCreateError.other + case "content_malformed": + return PaperDocCreateError.contentMalformed + case "folder_not_found": + return PaperDocCreateError.folderNotFound + case "doc_length_exceeded": + return PaperDocCreateError.docLengthExceeded + case "image_size_exceeded": + return PaperDocCreateError.imageSizeExceeded default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: PaperDocCreateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PaperDocCreateError.self, json: json) } } } /// The PaperDocCreateUpdateResult struct - open class PaperDocCreateUpdateResult: CustomStringConvertible { + public class PaperDocCreateUpdateResult: CustomStringConvertible, JSONRepresentable { /// Doc ID of the newly created doc. public let docId: String /// The Paper doc revision. Simply an ever increasing number. @@ -1598,68 +1944,86 @@ open class Paper { stringValidator()(title) self.title = title } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocCreateUpdateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocCreateUpdateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocCreateUpdateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocCreateUpdateResult: \(error)" + } } } - open class PaperDocCreateUpdateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocCreateUpdateResult) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "revision": Serialization._Int64Serializer.serialize(value.revision), - "title": Serialization._StringSerializer.serialize(value.title), + + public class PaperDocCreateUpdateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocCreateUpdateResult) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "revision": try Serialization._Int64Serializer.serialize(value.revision), + "title": try Serialization._StringSerializer.serialize(value.title), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocCreateUpdateResult { + + public func deserialize(_ json: JSON) throws -> PaperDocCreateUpdateResult { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let revision = Serialization._Int64Serializer.deserialize(dict["revision"] ?? .null) - let title = Serialization._StringSerializer.deserialize(dict["title"] ?? .null) - return PaperDocCreateUpdateResult(docId: docId, revision: revision, title: title) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let revision = try Serialization._Int64Serializer.deserialize(dict["revision"] ?? .null) + let title = try Serialization._StringSerializer.deserialize(dict["title"] ?? .null) + return PaperDocCreateUpdateResult(docId: docId, revision: revision, title: title) + default: + throw JSONSerializerError.deserializeError(type: PaperDocCreateUpdateResult.self, json: json) } } } /// The PaperDocExport struct - open class PaperDocExport: Paper.RefPaperDoc { + public class PaperDocExport: Paper.RefPaperDoc { /// (no description) public let exportFormat: Paper.ExportFormat public init(docId: String, exportFormat: Paper.ExportFormat) { self.exportFormat = exportFormat super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocExportSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocExportSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocExport: \(error)" + } } } - open class PaperDocExportSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocExport) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "export_format": Paper.ExportFormatSerializer().serialize(value.exportFormat), + + public class PaperDocExportSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocExport) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "export_format": try Paper.ExportFormatSerializer().serialize(value.exportFormat), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocExport { + + public func deserialize(_ json: JSON) throws -> PaperDocExport { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let exportFormat = Paper.ExportFormatSerializer().deserialize(dict["export_format"] ?? .null) - return PaperDocExport(docId: docId, exportFormat: exportFormat) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let exportFormat = try Paper.ExportFormatSerializer().deserialize(dict["export_format"] ?? .null) + return PaperDocExport(docId: docId, exportFormat: exportFormat) + default: + throw JSONSerializerError.deserializeError(type: PaperDocExport.self, json: json) } } } /// The PaperDocExportResult struct - open class PaperDocExportResult: CustomStringConvertible { + public class PaperDocExportResult: CustomStringConvertible, JSONRepresentable { /// The Paper doc owner's email address. public let owner: String /// The Paper doc title. @@ -1678,37 +2042,48 @@ open class Paper { stringValidator()(mimeType) self.mimeType = mimeType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocExportResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocExportResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocExportResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocExportResult: \(error)" + } } } - open class PaperDocExportResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocExportResult) -> JSON { - let output = [ - "owner": Serialization._StringSerializer.serialize(value.owner), - "title": Serialization._StringSerializer.serialize(value.title), - "revision": Serialization._Int64Serializer.serialize(value.revision), - "mime_type": Serialization._StringSerializer.serialize(value.mimeType), + + public class PaperDocExportResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocExportResult) throws -> JSON { + let output = [ + "owner": try Serialization._StringSerializer.serialize(value.owner), + "title": try Serialization._StringSerializer.serialize(value.title), + "revision": try Serialization._Int64Serializer.serialize(value.revision), + "mime_type": try Serialization._StringSerializer.serialize(value.mimeType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocExportResult { + + public func deserialize(_ json: JSON) throws -> PaperDocExportResult { switch json { - case .dictionary(let dict): - let owner = Serialization._StringSerializer.deserialize(dict["owner"] ?? .null) - let title = Serialization._StringSerializer.deserialize(dict["title"] ?? .null) - let revision = Serialization._Int64Serializer.deserialize(dict["revision"] ?? .null) - let mimeType = Serialization._StringSerializer.deserialize(dict["mime_type"] ?? .null) - return PaperDocExportResult(owner: owner, title: title, revision: revision, mimeType: mimeType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let owner = try Serialization._StringSerializer.deserialize(dict["owner"] ?? .null) + let title = try Serialization._StringSerializer.deserialize(dict["title"] ?? .null) + let revision = try Serialization._Int64Serializer.deserialize(dict["revision"] ?? .null) + let mimeType = try Serialization._StringSerializer.deserialize(dict["mime_type"] ?? .null) + return PaperDocExportResult(owner: owner, title: title, revision: revision, mimeType: mimeType) + default: + throw JSONSerializerError.deserializeError(type: PaperDocExportResult.self, json: json) } } } /// The PaperDocPermissionLevel union - public enum PaperDocPermissionLevel: CustomStringConvertible { + public enum PaperDocPermissionLevel: CustomStringConvertible, JSONRepresentable { /// User will be granted edit permissions. case edit /// User will be granted view and comment permissions. @@ -1716,83 +2091,100 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDocPermissionLevelSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocPermissionLevelSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocPermissionLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocPermissionLevel: \(error)" + } } } - open class PaperDocPermissionLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocPermissionLevel) -> JSON { + + public class PaperDocPermissionLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocPermissionLevel) throws -> JSON { switch value { - case .edit: - var d = [String: JSON]() - d[".tag"] = .str("edit") - return .dictionary(d) - case .viewAndComment: - var d = [String: JSON]() - d[".tag"] = .str("view_and_comment") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDocPermissionLevel { + case .edit: + var d = [String: JSON]() + d[".tag"] = .str("edit") + return .dictionary(d) + case .viewAndComment: + var d = [String: JSON]() + d[".tag"] = .str("view_and_comment") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDocPermissionLevel { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "edit": - return PaperDocPermissionLevel.edit - case "view_and_comment": - return PaperDocPermissionLevel.viewAndComment - case "other": - return PaperDocPermissionLevel.other - default: - return PaperDocPermissionLevel.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "edit": + return PaperDocPermissionLevel.edit + case "view_and_comment": + return PaperDocPermissionLevel.viewAndComment + case "other": + return PaperDocPermissionLevel.other default: - fatalError("Failed to deserialize") + return PaperDocPermissionLevel.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDocPermissionLevel.self, json: json) } } } /// The PaperDocSharingPolicy struct - open class PaperDocSharingPolicy: Paper.RefPaperDoc { + public class PaperDocSharingPolicy: Paper.RefPaperDoc { /// The default sharing policy to be set for the Paper doc. public let sharingPolicy: Paper.SharingPolicy public init(docId: String, sharingPolicy: Paper.SharingPolicy) { self.sharingPolicy = sharingPolicy super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocSharingPolicySerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocSharingPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocSharingPolicy: \(error)" + } } } - open class PaperDocSharingPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocSharingPolicy) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "sharing_policy": Paper.SharingPolicySerializer().serialize(value.sharingPolicy), + + public class PaperDocSharingPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocSharingPolicy) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "sharing_policy": try Paper.SharingPolicySerializer().serialize(value.sharingPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocSharingPolicy { + + public func deserialize(_ json: JSON) throws -> PaperDocSharingPolicy { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let sharingPolicy = Paper.SharingPolicySerializer().deserialize(dict["sharing_policy"] ?? .null) - return PaperDocSharingPolicy(docId: docId, sharingPolicy: sharingPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let sharingPolicy = try Paper.SharingPolicySerializer().deserialize(dict["sharing_policy"] ?? .null) + return PaperDocSharingPolicy(docId: docId, sharingPolicy: sharingPolicy) + default: + throw JSONSerializerError.deserializeError(type: PaperDocSharingPolicy.self, json: json) } } } /// The PaperDocUpdateArgs struct - open class PaperDocUpdateArgs: Paper.RefPaperDoc { + public class PaperDocUpdateArgs: Paper.RefPaperDoc { /// The policy used for the current update call. public let docUpdatePolicy: Paper.PaperDocUpdatePolicy /// The latest doc revision. This value must match the head revision or an error code will be returned. This is @@ -1807,37 +2199,44 @@ open class Paper { self.importFormat = importFormat super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUpdateArgsSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUpdateArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUpdateArgs: \(error)" + } } } - open class PaperDocUpdateArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUpdateArgs) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "doc_update_policy": Paper.PaperDocUpdatePolicySerializer().serialize(value.docUpdatePolicy), - "revision": Serialization._Int64Serializer.serialize(value.revision), - "import_format": Paper.ImportFormatSerializer().serialize(value.importFormat), + + public class PaperDocUpdateArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUpdateArgs) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "doc_update_policy": try Paper.PaperDocUpdatePolicySerializer().serialize(value.docUpdatePolicy), + "revision": try Serialization._Int64Serializer.serialize(value.revision), + "import_format": try Paper.ImportFormatSerializer().serialize(value.importFormat), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocUpdateArgs { + + public func deserialize(_ json: JSON) throws -> PaperDocUpdateArgs { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let docUpdatePolicy = Paper.PaperDocUpdatePolicySerializer().deserialize(dict["doc_update_policy"] ?? .null) - let revision = Serialization._Int64Serializer.deserialize(dict["revision"] ?? .null) - let importFormat = Paper.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) - return PaperDocUpdateArgs(docId: docId, docUpdatePolicy: docUpdatePolicy, revision: revision, importFormat: importFormat) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let docUpdatePolicy = try Paper.PaperDocUpdatePolicySerializer().deserialize(dict["doc_update_policy"] ?? .null) + let revision = try Serialization._Int64Serializer.deserialize(dict["revision"] ?? .null) + let importFormat = try Paper.ImportFormatSerializer().deserialize(dict["import_format"] ?? .null) + return PaperDocUpdateArgs(docId: docId, docUpdatePolicy: docUpdatePolicy, revision: revision, importFormat: importFormat) + default: + throw JSONSerializerError.deserializeError(type: PaperDocUpdateArgs.self, json: json) } } } /// The PaperDocUpdateError union - public enum PaperDocUpdateError: CustomStringConvertible { + public enum PaperDocUpdateError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to perform this action. This may be due to it only having access to /// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. @@ -1860,86 +2259,96 @@ open class Paper { /// This operation is not allowed on deleted Paper docs. case docDeleted + func json() throws -> JSON { + try PaperDocUpdateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUpdateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUpdateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUpdateError: \(error)" + } } } - open class PaperDocUpdateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUpdateError) -> JSON { + + public class PaperDocUpdateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUpdateError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .docNotFound: - var d = [String: JSON]() - d[".tag"] = .str("doc_not_found") - return .dictionary(d) - case .contentMalformed: - var d = [String: JSON]() - d[".tag"] = .str("content_malformed") - return .dictionary(d) - case .revisionMismatch: - var d = [String: JSON]() - d[".tag"] = .str("revision_mismatch") - return .dictionary(d) - case .docLengthExceeded: - var d = [String: JSON]() - d[".tag"] = .str("doc_length_exceeded") - return .dictionary(d) - case .imageSizeExceeded: - var d = [String: JSON]() - d[".tag"] = .str("image_size_exceeded") - return .dictionary(d) - case .docArchived: - var d = [String: JSON]() - d[".tag"] = .str("doc_archived") - return .dictionary(d) - case .docDeleted: - var d = [String: JSON]() - d[".tag"] = .str("doc_deleted") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDocUpdateError { + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .docNotFound: + var d = [String: JSON]() + d[".tag"] = .str("doc_not_found") + return .dictionary(d) + case .contentMalformed: + var d = [String: JSON]() + d[".tag"] = .str("content_malformed") + return .dictionary(d) + case .revisionMismatch: + var d = [String: JSON]() + d[".tag"] = .str("revision_mismatch") + return .dictionary(d) + case .docLengthExceeded: + var d = [String: JSON]() + d[".tag"] = .str("doc_length_exceeded") + return .dictionary(d) + case .imageSizeExceeded: + var d = [String: JSON]() + d[".tag"] = .str("image_size_exceeded") + return .dictionary(d) + case .docArchived: + var d = [String: JSON]() + d[".tag"] = .str("doc_archived") + return .dictionary(d) + case .docDeleted: + var d = [String: JSON]() + d[".tag"] = .str("doc_deleted") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDocUpdateError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return PaperDocUpdateError.insufficientPermissions - case "other": - return PaperDocUpdateError.other - case "doc_not_found": - return PaperDocUpdateError.docNotFound - case "content_malformed": - return PaperDocUpdateError.contentMalformed - case "revision_mismatch": - return PaperDocUpdateError.revisionMismatch - case "doc_length_exceeded": - return PaperDocUpdateError.docLengthExceeded - case "image_size_exceeded": - return PaperDocUpdateError.imageSizeExceeded - case "doc_archived": - return PaperDocUpdateError.docArchived - case "doc_deleted": - return PaperDocUpdateError.docDeleted - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return PaperDocUpdateError.insufficientPermissions + case "other": + return PaperDocUpdateError.other + case "doc_not_found": + return PaperDocUpdateError.docNotFound + case "content_malformed": + return PaperDocUpdateError.contentMalformed + case "revision_mismatch": + return PaperDocUpdateError.revisionMismatch + case "doc_length_exceeded": + return PaperDocUpdateError.docLengthExceeded + case "image_size_exceeded": + return PaperDocUpdateError.imageSizeExceeded + case "doc_archived": + return PaperDocUpdateError.docArchived + case "doc_deleted": + return PaperDocUpdateError.docDeleted default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: PaperDocUpdateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PaperDocUpdateError.self, json: json) } } } /// The PaperDocUpdatePolicy union - public enum PaperDocUpdatePolicy: CustomStringConvertible { + public enum PaperDocUpdatePolicy: CustomStringConvertible, JSONRepresentable { /// The content will be appended to the doc. case append /// The content will be prepended to the doc. The doc title will not be affected. @@ -1949,64 +2358,76 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDocUpdatePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUpdatePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUpdatePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUpdatePolicy: \(error)" + } } } - open class PaperDocUpdatePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUpdatePolicy) -> JSON { + + public class PaperDocUpdatePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUpdatePolicy) throws -> JSON { switch value { - case .append: - var d = [String: JSON]() - d[".tag"] = .str("append") - return .dictionary(d) - case .prepend: - var d = [String: JSON]() - d[".tag"] = .str("prepend") - return .dictionary(d) - case .overwriteAll: - var d = [String: JSON]() - d[".tag"] = .str("overwrite_all") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDocUpdatePolicy { + case .append: + var d = [String: JSON]() + d[".tag"] = .str("append") + return .dictionary(d) + case .prepend: + var d = [String: JSON]() + d[".tag"] = .str("prepend") + return .dictionary(d) + case .overwriteAll: + var d = [String: JSON]() + d[".tag"] = .str("overwrite_all") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDocUpdatePolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "append": - return PaperDocUpdatePolicy.append - case "prepend": - return PaperDocUpdatePolicy.prepend - case "overwrite_all": - return PaperDocUpdatePolicy.overwriteAll - case "other": - return PaperDocUpdatePolicy.other - default: - return PaperDocUpdatePolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "append": + return PaperDocUpdatePolicy.append + case "prepend": + return PaperDocUpdatePolicy.prepend + case "overwrite_all": + return PaperDocUpdatePolicy.overwriteAll + case "other": + return PaperDocUpdatePolicy.other default: - fatalError("Failed to deserialize") + return PaperDocUpdatePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDocUpdatePolicy.self, json: json) } } } /// The PaperFolderCreateArg struct - open class PaperFolderCreateArg: CustomStringConvertible { + public class PaperFolderCreateArg: CustomStringConvertible, JSONRepresentable { /// The name of the new Paper folder. public let name: String /// The encrypted Paper folder Id where the new Paper folder should be created. The API user has to have write - /// access to this folder or error is thrown. If not supplied, the new folder will be created at top level. + /// access to this folder or error is thrown. If not supplied, the new folder will be created at top + /// level. public let parentFolderId: String? /// Whether the folder to be created should be a team folder. This value will be ignored if parent_folder_id is - /// supplied, as the new folder will inherit the type (private or team folder) from its parent. We will by - /// default create a top-level private folder if both parent_folder_id and is_team_folder are not supplied. + /// supplied, as the new folder will inherit the type (private or team folder) from its parent. We will + /// by default create a top-level private folder if both parent_folder_id and is_team_folder are not + /// supplied. public let isTeamFolder: Bool? public init(name: String, parentFolderId: String? = nil, isTeamFolder: Bool? = nil) { stringValidator()(name) @@ -2015,35 +2436,46 @@ open class Paper { self.parentFolderId = parentFolderId self.isTeamFolder = isTeamFolder } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderCreateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderCreateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderCreateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderCreateArg: \(error)" + } } } - open class PaperFolderCreateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderCreateArg) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "parent_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderId), - "is_team_folder": NullableSerializer(Serialization._BoolSerializer).serialize(value.isTeamFolder), + + public class PaperFolderCreateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderCreateArg) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "parent_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderId), + "is_team_folder": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isTeamFolder), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderCreateArg { + + public func deserialize(_ json: JSON) throws -> PaperFolderCreateArg { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let parentFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_id"] ?? .null) - let isTeamFolder = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_team_folder"] ?? .null) - return PaperFolderCreateArg(name: name, parentFolderId: parentFolderId, isTeamFolder: isTeamFolder) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let parentFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_id"] ?? .null) + let isTeamFolder = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_team_folder"] ?? .null) + return PaperFolderCreateArg(name: name, parentFolderId: parentFolderId, isTeamFolder: isTeamFolder) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderCreateArg.self, json: json) } } } /// The PaperFolderCreateError union - public enum PaperFolderCreateError: CustomStringConvertible { + public enum PaperFolderCreateError: CustomStringConvertible, JSONRepresentable { /// Your account does not have permissions to perform this action. This may be due to it only having access to /// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. @@ -2055,120 +2487,148 @@ open class Paper { /// The folder id cannot be decrypted to valid folder id. case invalidFolderId + func json() throws -> JSON { + try PaperFolderCreateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderCreateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderCreateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderCreateError: \(error)" + } } } - open class PaperFolderCreateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderCreateError) -> JSON { + + public class PaperFolderCreateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderCreateError) throws -> JSON { switch value { - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .folderNotFound: - var d = [String: JSON]() - d[".tag"] = .str("folder_not_found") - return .dictionary(d) - case .invalidFolderId: - var d = [String: JSON]() - d[".tag"] = .str("invalid_folder_id") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperFolderCreateError { + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .folderNotFound: + var d = [String: JSON]() + d[".tag"] = .str("folder_not_found") + return .dictionary(d) + case .invalidFolderId: + var d = [String: JSON]() + d[".tag"] = .str("invalid_folder_id") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperFolderCreateError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "insufficient_permissions": - return PaperFolderCreateError.insufficientPermissions - case "other": - return PaperFolderCreateError.other - case "folder_not_found": - return PaperFolderCreateError.folderNotFound - case "invalid_folder_id": - return PaperFolderCreateError.invalidFolderId - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "insufficient_permissions": + return PaperFolderCreateError.insufficientPermissions + case "other": + return PaperFolderCreateError.other + case "folder_not_found": + return PaperFolderCreateError.folderNotFound + case "invalid_folder_id": + return PaperFolderCreateError.invalidFolderId default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: PaperFolderCreateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PaperFolderCreateError.self, json: json) } } } /// The PaperFolderCreateResult struct - open class PaperFolderCreateResult: CustomStringConvertible { + public class PaperFolderCreateResult: CustomStringConvertible, JSONRepresentable { /// Folder ID of the newly created folder. public let folderId: String public init(folderId: String) { stringValidator()(folderId) self.folderId = folderId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderCreateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderCreateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderCreateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderCreateResult: \(error)" + } } } - open class PaperFolderCreateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderCreateResult) -> JSON { - let output = [ - "folder_id": Serialization._StringSerializer.serialize(value.folderId), + + public class PaperFolderCreateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderCreateResult) throws -> JSON { + let output = [ + "folder_id": try Serialization._StringSerializer.serialize(value.folderId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderCreateResult { + + public func deserialize(_ json: JSON) throws -> PaperFolderCreateResult { switch json { - case .dictionary(let dict): - let folderId = Serialization._StringSerializer.deserialize(dict["folder_id"] ?? .null) - return PaperFolderCreateResult(folderId: folderId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let folderId = try Serialization._StringSerializer.deserialize(dict["folder_id"] ?? .null) + return PaperFolderCreateResult(folderId: folderId) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderCreateResult.self, json: json) } } } /// The RemovePaperDocUser struct - open class RemovePaperDocUser: Paper.RefPaperDoc { + public class RemovePaperDocUser: Paper.RefPaperDoc { /// User which should be removed from the Paper doc. Specify only email address or Dropbox account ID. public let member: Sharing.MemberSelector public init(docId: String, member: Sharing.MemberSelector) { self.member = member super.init(docId: docId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemovePaperDocUserSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemovePaperDocUserSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemovePaperDocUser: \(error)" + } } } - open class RemovePaperDocUserSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemovePaperDocUser) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "member": Sharing.MemberSelectorSerializer().serialize(value.member), + + public class RemovePaperDocUserSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemovePaperDocUser) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RemovePaperDocUser { + + public func deserialize(_ json: JSON) throws -> RemovePaperDocUser { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - return RemovePaperDocUser(docId: docId, member: member) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + return RemovePaperDocUser(docId: docId, member: member) + default: + throw JSONSerializerError.deserializeError(type: RemovePaperDocUser.self, json: json) } } } /// Sharing policy of Paper doc. - open class SharingPolicy: CustomStringConvertible { + public class SharingPolicy: CustomStringConvertible, JSONRepresentable { /// This value applies to the non-team members. public let publicSharingPolicy: Paper.SharingPublicPolicyType? /// This value applies to the team members only. The value is null for all personal accounts. @@ -2177,33 +2637,45 @@ open class Paper { self.publicSharingPolicy = publicSharingPolicy self.teamSharingPolicy = teamSharingPolicy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingPolicySerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingPolicy: \(error)" + } } } - open class SharingPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingPolicy) -> JSON { - let output = [ - "public_sharing_policy": NullableSerializer(Paper.SharingPublicPolicyTypeSerializer()).serialize(value.publicSharingPolicy), - "team_sharing_policy": NullableSerializer(Paper.SharingTeamPolicyTypeSerializer()).serialize(value.teamSharingPolicy), + + public class SharingPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingPolicy) throws -> JSON { + let output = [ + "public_sharing_policy": try NullableSerializer(Paper.SharingPublicPolicyTypeSerializer()).serialize(value.publicSharingPolicy), + "team_sharing_policy": try NullableSerializer(Paper.SharingTeamPolicyTypeSerializer()).serialize(value.teamSharingPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingPolicy { + + public func deserialize(_ json: JSON) throws -> SharingPolicy { switch json { - case .dictionary(let dict): - let publicSharingPolicy = NullableSerializer(Paper.SharingPublicPolicyTypeSerializer()).deserialize(dict["public_sharing_policy"] ?? .null) - let teamSharingPolicy = NullableSerializer(Paper.SharingTeamPolicyTypeSerializer()).deserialize(dict["team_sharing_policy"] ?? .null) - return SharingPolicy(publicSharingPolicy: publicSharingPolicy, teamSharingPolicy: teamSharingPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let publicSharingPolicy = try NullableSerializer(Paper.SharingPublicPolicyTypeSerializer()) + .deserialize(dict["public_sharing_policy"] ?? .null) + let teamSharingPolicy = try NullableSerializer(Paper.SharingTeamPolicyTypeSerializer()).deserialize(dict["team_sharing_policy"] ?? .null) + return SharingPolicy(publicSharingPolicy: publicSharingPolicy, teamSharingPolicy: teamSharingPolicy) + default: + throw JSONSerializerError.deserializeError(type: SharingPolicy.self, json: json) } } } /// The sharing policy type of the Paper doc. - public enum SharingTeamPolicyType: CustomStringConvertible { + public enum SharingTeamPolicyType: CustomStringConvertible, JSONRepresentable { /// Users who have a link to this doc can edit it. case peopleWithLinkCanEdit /// Users who have a link to this doc can view and comment on it. @@ -2211,50 +2683,60 @@ open class Paper { /// Users must be explicitly invited to this doc. case inviteOnly + func json() throws -> JSON { + try SharingTeamPolicyTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingTeamPolicyTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingTeamPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingTeamPolicyType: \(error)" + } } } - open class SharingTeamPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingTeamPolicyType) -> JSON { + + public class SharingTeamPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingTeamPolicyType) throws -> JSON { switch value { - case .peopleWithLinkCanEdit: - var d = [String: JSON]() - d[".tag"] = .str("people_with_link_can_edit") - return .dictionary(d) - case .peopleWithLinkCanViewAndComment: - var d = [String: JSON]() - d[".tag"] = .str("people_with_link_can_view_and_comment") - return .dictionary(d) - case .inviteOnly: - var d = [String: JSON]() - d[".tag"] = .str("invite_only") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingTeamPolicyType { + case .peopleWithLinkCanEdit: + var d = [String: JSON]() + d[".tag"] = .str("people_with_link_can_edit") + return .dictionary(d) + case .peopleWithLinkCanViewAndComment: + var d = [String: JSON]() + d[".tag"] = .str("people_with_link_can_view_and_comment") + return .dictionary(d) + case .inviteOnly: + var d = [String: JSON]() + d[".tag"] = .str("invite_only") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingTeamPolicyType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "people_with_link_can_edit": - return SharingTeamPolicyType.peopleWithLinkCanEdit - case "people_with_link_can_view_and_comment": - return SharingTeamPolicyType.peopleWithLinkCanViewAndComment - case "invite_only": - return SharingTeamPolicyType.inviteOnly - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "people_with_link_can_edit": + return SharingTeamPolicyType.peopleWithLinkCanEdit + case "people_with_link_can_view_and_comment": + return SharingTeamPolicyType.peopleWithLinkCanViewAndComment + case "invite_only": + return SharingTeamPolicyType.inviteOnly default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SharingTeamPolicyType.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SharingTeamPolicyType.self, json: json) } } } /// The SharingPublicPolicyType union - public enum SharingPublicPolicyType: CustomStringConvertible { + public enum SharingPublicPolicyType: CustomStringConvertible, JSONRepresentable { /// Users who have a link to this doc can edit it. case peopleWithLinkCanEdit /// Users who have a link to this doc can view and comment on it. @@ -2264,56 +2746,66 @@ open class Paper { /// Value used to indicate that doc sharing is enabled only within team. case disabled + func json() throws -> JSON { + try SharingPublicPolicyTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingPublicPolicyTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingPublicPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingPublicPolicyType: \(error)" + } } } - open class SharingPublicPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingPublicPolicyType) -> JSON { + + public class SharingPublicPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingPublicPolicyType) throws -> JSON { switch value { - case .peopleWithLinkCanEdit: - var d = [String: JSON]() - d[".tag"] = .str("people_with_link_can_edit") - return .dictionary(d) - case .peopleWithLinkCanViewAndComment: - var d = [String: JSON]() - d[".tag"] = .str("people_with_link_can_view_and_comment") - return .dictionary(d) - case .inviteOnly: - var d = [String: JSON]() - d[".tag"] = .str("invite_only") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingPublicPolicyType { + case .peopleWithLinkCanEdit: + var d = [String: JSON]() + d[".tag"] = .str("people_with_link_can_edit") + return .dictionary(d) + case .peopleWithLinkCanViewAndComment: + var d = [String: JSON]() + d[".tag"] = .str("people_with_link_can_view_and_comment") + return .dictionary(d) + case .inviteOnly: + var d = [String: JSON]() + d[".tag"] = .str("invite_only") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingPublicPolicyType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "people_with_link_can_edit": - return SharingPublicPolicyType.peopleWithLinkCanEdit - case "people_with_link_can_view_and_comment": - return SharingPublicPolicyType.peopleWithLinkCanViewAndComment - case "invite_only": - return SharingPublicPolicyType.inviteOnly - case "disabled": - return SharingPublicPolicyType.disabled - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "people_with_link_can_edit": + return SharingPublicPolicyType.peopleWithLinkCanEdit + case "people_with_link_can_view_and_comment": + return SharingPublicPolicyType.peopleWithLinkCanViewAndComment + case "invite_only": + return SharingPublicPolicyType.inviteOnly + case "disabled": + return SharingPublicPolicyType.disabled default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SharingPublicPolicyType.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SharingPublicPolicyType.self, json: json) } } } /// The UserInfoWithPermissionLevel struct - open class UserInfoWithPermissionLevel: CustomStringConvertible { + public class UserInfoWithPermissionLevel: CustomStringConvertible, JSONRepresentable { /// User shared on the Paper doc. public let user: Sharing.UserInfo /// Permission level for the user. @@ -2322,33 +2814,44 @@ open class Paper { self.user = user self.permissionLevel = permissionLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserInfoWithPermissionLevelSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserInfoWithPermissionLevelSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserInfoWithPermissionLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserInfoWithPermissionLevel: \(error)" + } } } - open class UserInfoWithPermissionLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserInfoWithPermissionLevel) -> JSON { - let output = [ - "user": Sharing.UserInfoSerializer().serialize(value.user), - "permission_level": Paper.PaperDocPermissionLevelSerializer().serialize(value.permissionLevel), + + public class UserInfoWithPermissionLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserInfoWithPermissionLevel) throws -> JSON { + let output = [ + "user": try Sharing.UserInfoSerializer().serialize(value.user), + "permission_level": try Paper.PaperDocPermissionLevelSerializer().serialize(value.permissionLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserInfoWithPermissionLevel { + + public func deserialize(_ json: JSON) throws -> UserInfoWithPermissionLevel { switch json { - case .dictionary(let dict): - let user = Sharing.UserInfoSerializer().deserialize(dict["user"] ?? .null) - let permissionLevel = Paper.PaperDocPermissionLevelSerializer().deserialize(dict["permission_level"] ?? .null) - return UserInfoWithPermissionLevel(user: user, permissionLevel: permissionLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Sharing.UserInfoSerializer().deserialize(dict["user"] ?? .null) + let permissionLevel = try Paper.PaperDocPermissionLevelSerializer().deserialize(dict["permission_level"] ?? .null) + return UserInfoWithPermissionLevel(user: user, permissionLevel: permissionLevel) + default: + throw JSONSerializerError.deserializeError(type: UserInfoWithPermissionLevel.self, json: json) } } } /// The UserOnPaperDocFilter union - public enum UserOnPaperDocFilter: CustomStringConvertible { + public enum UserOnPaperDocFilter: CustomStringConvertible, JSONRepresentable { /// all users who have visited the Paper doc. case visited /// All uses who are shared on the Paper doc. This includes all users who have visited the Paper doc as well as @@ -2357,49 +2860,58 @@ open class Paper { /// An unspecified error. case other + func json() throws -> JSON { + try UserOnPaperDocFilterSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserOnPaperDocFilterSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserOnPaperDocFilterSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserOnPaperDocFilter: \(error)" + } } } - open class UserOnPaperDocFilterSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserOnPaperDocFilter) -> JSON { + + public class UserOnPaperDocFilterSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserOnPaperDocFilter) throws -> JSON { switch value { - case .visited: - var d = [String: JSON]() - d[".tag"] = .str("visited") - return .dictionary(d) - case .shared: - var d = [String: JSON]() - d[".tag"] = .str("shared") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UserOnPaperDocFilter { + case .visited: + var d = [String: JSON]() + d[".tag"] = .str("visited") + return .dictionary(d) + case .shared: + var d = [String: JSON]() + d[".tag"] = .str("shared") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UserOnPaperDocFilter { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "visited": - return UserOnPaperDocFilter.visited - case "shared": - return UserOnPaperDocFilter.shared - case "other": - return UserOnPaperDocFilter.other - default: - return UserOnPaperDocFilter.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "visited": + return UserOnPaperDocFilter.visited + case "shared": + return UserOnPaperDocFilter.shared + case "other": + return UserOnPaperDocFilter.other default: - fatalError("Failed to deserialize") + return UserOnPaperDocFilter.other + } + default: + throw JSONSerializerError.deserializeError(type: UserOnPaperDocFilter.self, json: json) } } } - /// Stone Route Objects static let docsArchive = Route( @@ -2410,9 +2922,11 @@ open class Paper { argSerializer: Paper.RefPaperDocSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsCreate = Route( name: "docs/create", @@ -2422,9 +2936,11 @@ open class Paper { argSerializer: Paper.PaperDocCreateArgsSerializer(), responseSerializer: Paper.PaperDocCreateUpdateResultSerializer(), errorSerializer: Paper.PaperDocCreateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .upload + ) ) static let docsDownload = Route( name: "docs/download", @@ -2434,9 +2950,11 @@ open class Paper { argSerializer: Paper.PaperDocExportSerializer(), responseSerializer: Paper.PaperDocExportResultSerializer(), errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "download"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .download + ) ) static let docsFolderUsersList = Route( name: "docs/folder_users/list", @@ -2446,9 +2964,11 @@ open class Paper { argSerializer: Paper.ListUsersOnFolderArgsSerializer(), responseSerializer: Paper.ListUsersOnFolderResponseSerializer(), errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsFolderUsersListContinue = Route( name: "docs/folder_users/list/continue", @@ -2458,9 +2978,11 @@ open class Paper { argSerializer: Paper.ListUsersOnFolderContinueArgsSerializer(), responseSerializer: Paper.ListUsersOnFolderResponseSerializer(), errorSerializer: Paper.ListUsersCursorErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsGetFolderInfo = Route( name: "docs/get_folder_info", @@ -2470,9 +2992,11 @@ open class Paper { argSerializer: Paper.RefPaperDocSerializer(), responseSerializer: Paper.FoldersContainingPaperDocSerializer(), errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsList = Route( name: "docs/list", @@ -2482,9 +3006,11 @@ open class Paper { argSerializer: Paper.ListPaperDocsArgsSerializer(), responseSerializer: Paper.ListPaperDocsResponseSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsListContinue = Route( name: "docs/list/continue", @@ -2494,9 +3020,11 @@ open class Paper { argSerializer: Paper.ListPaperDocsContinueArgsSerializer(), responseSerializer: Paper.ListPaperDocsResponseSerializer(), errorSerializer: Paper.ListDocsCursorErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsPermanentlyDelete = Route( name: "docs/permanently_delete", @@ -2506,9 +3034,11 @@ open class Paper { argSerializer: Paper.RefPaperDocSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsSharingPolicyGet = Route( name: "docs/sharing_policy/get", @@ -2518,9 +3048,11 @@ open class Paper { argSerializer: Paper.RefPaperDocSerializer(), responseSerializer: Paper.SharingPolicySerializer(), errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsSharingPolicySet = Route( name: "docs/sharing_policy/set", @@ -2530,9 +3062,11 @@ open class Paper { argSerializer: Paper.PaperDocSharingPolicySerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsUpdate = Route( name: "docs/update", @@ -2542,9 +3076,11 @@ open class Paper { argSerializer: Paper.PaperDocUpdateArgsSerializer(), responseSerializer: Paper.PaperDocCreateUpdateResultSerializer(), errorSerializer: Paper.PaperDocUpdateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "upload"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .upload + ) ) static let docsUsersAdd = Route( name: "docs/users/add", @@ -2554,9 +3090,11 @@ open class Paper { argSerializer: Paper.AddPaperDocUserSerializer(), responseSerializer: ArraySerializer(Paper.AddPaperDocUserMemberResultSerializer()), errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsUsersList = Route( name: "docs/users/list", @@ -2566,9 +3104,11 @@ open class Paper { argSerializer: Paper.ListUsersOnPaperDocArgsSerializer(), responseSerializer: Paper.ListUsersOnPaperDocResponseSerializer(), errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsUsersListContinue = Route( name: "docs/users/list/continue", @@ -2578,9 +3118,11 @@ open class Paper { argSerializer: Paper.ListUsersOnPaperDocContinueArgsSerializer(), responseSerializer: Paper.ListUsersOnPaperDocResponseSerializer(), errorSerializer: Paper.ListUsersCursorErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let docsUsersRemove = Route( name: "docs/users/remove", @@ -2590,9 +3132,11 @@ open class Paper { argSerializer: Paper.RemovePaperDocUserSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Paper.DocLookupErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let foldersCreate = Route( name: "folders/create", @@ -2602,8 +3146,10 @@ open class Paper { argSerializer: Paper.PaperFolderCreateArgSerializer(), responseSerializer: Paper.PaperFolderCreateResultSerializer(), errorSerializer: Paper.PaperFolderCreateErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/PaperRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/PaperRoutes.swift index 0086a4df6..f582edeeb 100644 --- a/Source/SwiftyDropbox/Shared/Generated/PaperRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/PaperRoutes.swift @@ -7,9 +7,10 @@ import Foundation /// Routes for the paper namespace -open class PaperRoutes { +/// For Objective-C compatible routes see DBPaperRoutes +public class PaperRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } @@ -20,12 +21,14 @@ open class PaperRoutes { /// September 2020. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for more information. /// + /// - scope: files.content.write + /// /// - parameter docId: The Paper doc ID. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsArchive is deprecated.") - @discardableResult open func docsArchive(docId: String) -> RpcRequest { + @available(*, unavailable, message: "docsArchive is deprecated.") + @discardableResult public func docsArchive(docId: String) -> RpcRequest { let route = Paper.docsArchive let serverArgs = Paper.RefPaperDoc(docId: docId) return client.request(route, serverArgs: serverArgs) @@ -33,19 +36,25 @@ open class PaperRoutes { /// Creates a new Paper doc with the provided content. Note that this endpoint will continue to work for content /// created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for more information. /// + /// - scope: files.content.write + /// /// - parameter parentFolderId: The Paper folder ID where the Paper document should be created. The API user has to /// have write access to this folder or error is thrown. /// - parameter importFormat: The format of provided data. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object - /// on success or a `Paper.PaperDocCreateError` object on failure. - @available(*, unavailable, message:"docsCreate is deprecated.") - @discardableResult open func docsCreate(importFormat: Paper.ImportFormat, parentFolderId: String? = nil, input: Data) -> UploadRequest { + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object on + /// success or a `Paper.PaperDocCreateError` object on failure. + @available(*, unavailable, message: "docsCreate is deprecated.") + @discardableResult public func docsCreate( + importFormat: Paper.ImportFormat, + parentFolderId: String? = nil, + input: Data + ) -> UploadRequest { let route = Paper.docsCreate let serverArgs = Paper.PaperDocCreateArgs(importFormat: importFormat, parentFolderId: parentFolderId) return client.request(route, serverArgs: serverArgs, input: .data(input)) @@ -53,19 +62,25 @@ open class PaperRoutes { /// Creates a new Paper doc with the provided content. Note that this endpoint will continue to work for content /// created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for more information. /// + /// - scope: files.content.write + /// /// - parameter parentFolderId: The Paper folder ID where the Paper document should be created. The API user has to /// have write access to this folder or error is thrown. /// - parameter importFormat: The format of provided data. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object - /// on success or a `Paper.PaperDocCreateError` object on failure. - @available(*, unavailable, message:"docsCreate is deprecated.") - @discardableResult open func docsCreate(importFormat: Paper.ImportFormat, parentFolderId: String? = nil, input: URL) -> UploadRequest { + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object on + /// success or a `Paper.PaperDocCreateError` object on failure. + @available(*, unavailable, message: "docsCreate is deprecated.") + @discardableResult public func docsCreate( + importFormat: Paper.ImportFormat, + parentFolderId: String? = nil, + input: URL + ) -> UploadRequest { let route = Paper.docsCreate let serverArgs = Paper.PaperDocCreateArgs(importFormat: importFormat, parentFolderId: parentFolderId) return client.request(route, serverArgs: serverArgs, input: .file(input)) @@ -73,19 +88,25 @@ open class PaperRoutes { /// Creates a new Paper doc with the provided content. Note that this endpoint will continue to work for content /// created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for more information. /// + /// - scope: files.content.write + /// /// - parameter parentFolderId: The Paper folder ID where the Paper document should be created. The API user has to /// have write access to this folder or error is thrown. /// - parameter importFormat: The format of provided data. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object - /// on success or a `Paper.PaperDocCreateError` object on failure. - @available(*, unavailable, message:"docsCreate is deprecated.") - @discardableResult open func docsCreate(importFormat: Paper.ImportFormat, parentFolderId: String? = nil, input: InputStream) -> UploadRequest { + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object on + /// success or a `Paper.PaperDocCreateError` object on failure. + @available(*, unavailable, message: "docsCreate is deprecated.") + @discardableResult public func docsCreate( + importFormat: Paper.ImportFormat, + parentFolderId: String? = nil, + input: InputStream + ) -> UploadRequest { let route = Paper.docsCreate let serverArgs = Paper.PaperDocCreateArgs(importFormat: importFormat, parentFolderId: parentFolderId) return client.request(route, serverArgs: serverArgs, input: .stream(input)) @@ -93,20 +114,26 @@ open class PaperRoutes { /// Exports and downloads Paper doc either as HTML or markdown. Note that this endpoint will continue to work for /// content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: files.content.read + /// /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocExportResult` object on + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocExportResult` object on /// success or a `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsDownload is deprecated.") - @discardableResult open func docsDownload(docId: String, exportFormat: Paper.ExportFormat, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + @available(*, unavailable, message: "docsDownload is deprecated.") + @discardableResult public func docsDownload( + docId: String, + exportFormat: Paper.ExportFormat, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Paper.docsDownload let serverArgs = Paper.PaperDocExport(docId: docId, exportFormat: exportFormat) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) @@ -114,15 +141,20 @@ open class PaperRoutes { /// Exports and downloads Paper doc either as HTML or markdown. Note that this endpoint will continue to work for /// content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: files.content.read + /// /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocExportResult` object on + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocExportResult` object on /// success or a `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsDownload is deprecated.") - @discardableResult open func docsDownload(docId: String, exportFormat: Paper.ExportFormat) -> DownloadRequestMemory { + @available(*, unavailable, message: "docsDownload is deprecated.") + @discardableResult public func docsDownload( + docId: String, + exportFormat: Paper.ExportFormat + ) -> DownloadRequestMemory { let route = Paper.docsDownload let serverArgs = Paper.PaperDocExport(docId: docId, exportFormat: exportFormat) return client.request(route, serverArgs: serverArgs) @@ -130,18 +162,24 @@ open class PaperRoutes { /// Lists the users who are explicitly invited to the Paper folder in which the Paper doc is contained. For private /// folders all users (including owner) shared on the folder are listed and for team folders all non-team users - /// shared on the folder are returned. Note that this endpoint will continue to work for content created by users on - /// the older version of Paper. To check which version of Paper a user is on, use /users/features/get_values. If the - /// paper_as_files feature is enabled, then the user is running the new version of Paper. Refer to the Paper - /// Migration Guide https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. + /// shared on the folder are returned. Note that this endpoint will continue to work for content created by + /// users on the older version of Paper. To check which version of Paper a user is on, use + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide + /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. + /// + /// - scope: sharing.read /// /// - parameter limit: Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. /// Higher value results in invalid arguments error. /// - /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnFolderResponse` object on + /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnFolderResponse` object on /// success or a `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsFolderUsersList is deprecated.") - @discardableResult open func docsFolderUsersList(docId: String, limit: Int32 = 1000) -> RpcRequest { + @available(*, unavailable, message: "docsFolderUsersList is deprecated.") + @discardableResult public func docsFolderUsersList( + docId: String, + limit: Int32 = 1_000 + ) -> RpcRequest { let route = Paper.docsFolderUsersList let serverArgs = Paper.ListUsersOnFolderArgs(docId: docId, limit: limit) return client.request(route, serverArgs: serverArgs) @@ -153,13 +191,18 @@ open class PaperRoutes { /// feature is enabled, then the user is running the new version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: sharing.read + /// /// - parameter cursor: The cursor obtained from docsFolderUsersList or docsFolderUsersListContinue. Allows for /// pagination. /// - /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnFolderResponse` object on + /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnFolderResponse` object on /// success or a `Paper.ListUsersCursorError` object on failure. - @available(*, unavailable, message:"docsFolderUsersListContinue is deprecated.") - @discardableResult open func docsFolderUsersListContinue(docId: String, cursor: String) -> RpcRequest { + @available(*, unavailable, message: "docsFolderUsersListContinue is deprecated.") + @discardableResult public func docsFolderUsersListContinue( + docId: String, + cursor: String + ) -> RpcRequest { let route = Paper.docsFolderUsersListContinue let serverArgs = Paper.ListUsersOnFolderContinueArgs(docId: docId, cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -167,19 +210,21 @@ open class PaperRoutes { /// Retrieves folder information for the given Paper doc. This includes: - folder sharing policy; permissions for /// subfolders are set by the top-level folder. - full 'filepath', i.e. the list of folders (both folderId and - /// folderName) from the root folder to the folder directly containing the Paper doc. If the Paper doc is not - /// in any folder (aka unfiled) the response will be empty. Note that this endpoint will continue to work for - /// content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. Refer to the Paper Migration Guide + /// folderName) from the root folder to the folder directly containing the Paper doc. If the Paper doc is + /// not in any folder (aka unfiled) the response will be empty. Note that this endpoint will continue to work + /// for content created by users on the older version of Paper. To check which version of Paper a user is on, + /// use /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: sharing.read + /// /// - parameter docId: The Paper doc ID. /// - /// - returns: Through the response callback, the caller will receive a `Paper.FoldersContainingPaperDoc` object on + /// - returns: Through the response callback, the caller will receive a `Paper.FoldersContainingPaperDoc` object on /// success or a `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsGetFolderInfo is deprecated.") - @discardableResult open func docsGetFolderInfo(docId: String) -> RpcRequest { + @available(*, unavailable, message: "docsGetFolderInfo is deprecated.") + @discardableResult public func docsGetFolderInfo(docId: String) -> RpcRequest { let route = Paper.docsGetFolderInfo let serverArgs = Paper.RefPaperDoc(docId: docId) return client.request(route, serverArgs: serverArgs) @@ -188,20 +233,27 @@ open class PaperRoutes { /// Return the list of all Paper docs according to the argument specifications. To iterate over through the full /// pagination, pass the cursor to docsListContinue. Note that this endpoint will continue to work for content /// created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: files.metadata.read + /// /// - parameter filterBy: Allows user to specify how the Paper docs should be filtered. /// - parameter sortBy: Allows user to specify how the Paper docs should be sorted. /// - parameter sortOrder: Allows user to specify the sort order of the result. /// - parameter limit: Size limit per batch. The maximum number of docs that can be retrieved per batch is 1000. /// Higher value results in invalid arguments error. /// - /// - returns: Through the response callback, the caller will receive a `Paper.ListPaperDocsResponse` object on + /// - returns: Through the response callback, the caller will receive a `Paper.ListPaperDocsResponse` object on /// success or a `Void` object on failure. - @available(*, unavailable, message:"docsList is deprecated.") - @discardableResult open func docsList(filterBy: Paper.ListPaperDocsFilterBy = .docsAccessed, sortBy: Paper.ListPaperDocsSortBy = .accessed, sortOrder: Paper.ListPaperDocsSortOrder = .ascending, limit: Int32 = 1000) -> RpcRequest { + @available(*, unavailable, message: "docsList is deprecated.") + @discardableResult public func docsList( + filterBy: Paper.ListPaperDocsFilterBy = .docsAccessed, + sortBy: Paper.ListPaperDocsSortBy = .accessed, + sortOrder: Paper.ListPaperDocsSortOrder = .ascending, + limit: Int32 = 1_000 + ) -> RpcRequest { let route = Paper.docsList let serverArgs = Paper.ListPaperDocsArgs(filterBy: filterBy, sortBy: sortBy, sortOrder: sortOrder, limit: limit) return client.request(route, serverArgs: serverArgs) @@ -209,33 +261,38 @@ open class PaperRoutes { /// Once a cursor has been retrieved from docsList, use this to paginate through all Paper doc. Note that this /// endpoint will continue to work for content created by users on the older version of Paper. To check which - /// version of Paper a user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then - /// the user is running the new version of Paper. Refer to the Paper Migration Guide + /// version of Paper a user is on, use /users/features/get_values. If the paper_as_files feature is enabled, + /// then the user is running the new version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: files.metadata.read + /// /// - parameter cursor: The cursor obtained from docsList or docsListContinue. Allows for pagination. /// - /// - returns: Through the response callback, the caller will receive a `Paper.ListPaperDocsResponse` object on + /// - returns: Through the response callback, the caller will receive a `Paper.ListPaperDocsResponse` object on /// success or a `Paper.ListDocsCursorError` object on failure. - @available(*, unavailable, message:"docsListContinue is deprecated.") - @discardableResult open func docsListContinue(cursor: String) -> RpcRequest { + @available(*, unavailable, message: "docsListContinue is deprecated.") + @discardableResult public func docsListContinue(cursor: String) -> RpcRequest { let route = Paper.docsListContinue let serverArgs = Paper.ListPaperDocsContinueArgs(cursor: cursor) return client.request(route, serverArgs: serverArgs) } /// Permanently deletes the given Paper doc. This operation is final as the doc cannot be recovered. This action can - /// be performed only by the doc owner. Note that this endpoint will continue to work for content created by users - /// on the older version of Paper. To check which version of Paper a user is on, use /users/features/get_values. If - /// the paper_as_files feature is enabled, then the user is running the new version of Paper. Refer to the Paper - /// Migration Guide https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. + /// be performed only by the doc owner. Note that this endpoint will continue to work for content created by + /// users on the older version of Paper. To check which version of Paper a user is on, use + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide + /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. + /// + /// - scope: files.permanent_delete /// /// - parameter docId: The Paper doc ID. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsPermanentlyDelete is deprecated.") - @discardableResult open func docsPermanentlyDelete(docId: String) -> RpcRequest { + @available(*, unavailable, message: "docsPermanentlyDelete is deprecated.") + @discardableResult public func docsPermanentlyDelete(docId: String) -> RpcRequest { let route = Paper.docsPermanentlyDelete let serverArgs = Paper.RefPaperDoc(docId: docId) return client.request(route, serverArgs: serverArgs) @@ -243,35 +300,42 @@ open class PaperRoutes { /// Gets the default sharing policy for the given Paper doc. Note that this endpoint will continue to work for /// content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: sharing.read + /// /// - parameter docId: The Paper doc ID. /// - /// - returns: Through the response callback, the caller will receive a `Paper.SharingPolicy` object on success or - /// a `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsSharingPolicyGet is deprecated.") - @discardableResult open func docsSharingPolicyGet(docId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Paper.SharingPolicy` object on success or a + /// `Paper.DocLookupError` object on failure. + @available(*, unavailable, message: "docsSharingPolicyGet is deprecated.") + @discardableResult public func docsSharingPolicyGet(docId: String) -> RpcRequest { let route = Paper.docsSharingPolicyGet let serverArgs = Paper.RefPaperDoc(docId: docId) return client.request(route, serverArgs: serverArgs) } /// Sets the default sharing policy for the given Paper doc. The default 'team_sharing_policy' can be changed only - /// by teams, omit this field for personal accounts. The 'public_sharing_policy' policy can't be set to the value - /// 'disabled' because this setting can be changed only via the team admin console. Note that this endpoint will - /// continue to work for content created by users on the older version of Paper. To check which version of Paper a - /// user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the user is running - /// the new version of Paper. Refer to the Paper Migration Guide + /// by teams, omit this field for personal accounts. The 'public_sharing_policy' policy can't be set to the + /// value 'disabled' because this setting can be changed only via the team admin console. Note that this + /// endpoint will continue to work for content created by users on the older version of Paper. To check which + /// version of Paper a user is on, use /users/features/get_values. If the paper_as_files feature is enabled, + /// then the user is running the new version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: sharing.write + /// /// - parameter sharingPolicy: The default sharing policy to be set for the Paper doc. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsSharingPolicySet is deprecated.") - @discardableResult open func docsSharingPolicySet(docId: String, sharingPolicy: Paper.SharingPolicy) -> RpcRequest { + @available(*, unavailable, message: "docsSharingPolicySet is deprecated.") + @discardableResult public func docsSharingPolicySet( + docId: String, + sharingPolicy: Paper.SharingPolicy + ) -> RpcRequest { let route = Paper.docsSharingPolicySet let serverArgs = Paper.PaperDocSharingPolicy(docId: docId, sharingPolicy: sharingPolicy) return client.request(route, serverArgs: serverArgs) @@ -279,20 +343,28 @@ open class PaperRoutes { /// Updates an existing Paper doc with the provided content. Note that this endpoint will continue to work for /// content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for more information. /// + /// - scope: files.content.write + /// /// - parameter docUpdatePolicy: The policy used for the current update call. /// - parameter revision: The latest doc revision. This value must match the head revision or an error code will be /// returned. This is to prevent colliding writes. /// - parameter importFormat: The format of provided data. /// - parameter input: The file to upload, as an Data object. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object - /// on success or a `Paper.PaperDocUpdateError` object on failure. - @available(*, unavailable, message:"docsUpdate is deprecated.") - @discardableResult open func docsUpdate(docId: String, docUpdatePolicy: Paper.PaperDocUpdatePolicy, revision: Int64, importFormat: Paper.ImportFormat, input: Data) -> UploadRequest { + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object on + /// success or a `Paper.PaperDocUpdateError` object on failure. + @available(*, unavailable, message: "docsUpdate is deprecated.") + @discardableResult public func docsUpdate( + docId: String, + docUpdatePolicy: Paper.PaperDocUpdatePolicy, + revision: Int64, + importFormat: Paper.ImportFormat, + input: Data + ) -> UploadRequest { let route = Paper.docsUpdate let serverArgs = Paper.PaperDocUpdateArgs(docId: docId, docUpdatePolicy: docUpdatePolicy, revision: revision, importFormat: importFormat) return client.request(route, serverArgs: serverArgs, input: .data(input)) @@ -300,20 +372,28 @@ open class PaperRoutes { /// Updates an existing Paper doc with the provided content. Note that this endpoint will continue to work for /// content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for more information. /// + /// - scope: files.content.write + /// /// - parameter docUpdatePolicy: The policy used for the current update call. /// - parameter revision: The latest doc revision. This value must match the head revision or an error code will be /// returned. This is to prevent colliding writes. /// - parameter importFormat: The format of provided data. /// - parameter input: The file to upload, as an URL object. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object - /// on success or a `Paper.PaperDocUpdateError` object on failure. - @available(*, unavailable, message:"docsUpdate is deprecated.") - @discardableResult open func docsUpdate(docId: String, docUpdatePolicy: Paper.PaperDocUpdatePolicy, revision: Int64, importFormat: Paper.ImportFormat, input: URL) -> UploadRequest { + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object on + /// success or a `Paper.PaperDocUpdateError` object on failure. + @available(*, unavailable, message: "docsUpdate is deprecated.") + @discardableResult public func docsUpdate( + docId: String, + docUpdatePolicy: Paper.PaperDocUpdatePolicy, + revision: Int64, + importFormat: Paper.ImportFormat, + input: URL + ) -> UploadRequest { let route = Paper.docsUpdate let serverArgs = Paper.PaperDocUpdateArgs(docId: docId, docUpdatePolicy: docUpdatePolicy, revision: revision, importFormat: importFormat) return client.request(route, serverArgs: serverArgs, input: .file(input)) @@ -321,63 +401,84 @@ open class PaperRoutes { /// Updates an existing Paper doc with the provided content. Note that this endpoint will continue to work for /// content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. This endpoint will be retired in September 2020. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for more information. /// + /// - scope: files.content.write + /// /// - parameter docUpdatePolicy: The policy used for the current update call. /// - parameter revision: The latest doc revision. This value must match the head revision or an error code will be /// returned. This is to prevent colliding writes. /// - parameter importFormat: The format of provided data. /// - parameter input: The file to upload, as an InputStream object. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object - /// on success or a `Paper.PaperDocUpdateError` object on failure. - @available(*, unavailable, message:"docsUpdate is deprecated.") - @discardableResult open func docsUpdate(docId: String, docUpdatePolicy: Paper.PaperDocUpdatePolicy, revision: Int64, importFormat: Paper.ImportFormat, input: InputStream) -> UploadRequest { + /// - returns: Through the response callback, the caller will receive a `Paper.PaperDocCreateUpdateResult` object on + /// success or a `Paper.PaperDocUpdateError` object on failure. + @available(*, unavailable, message: "docsUpdate is deprecated.") + @discardableResult public func docsUpdate( + docId: String, + docUpdatePolicy: Paper.PaperDocUpdatePolicy, + revision: Int64, + importFormat: Paper.ImportFormat, + input: InputStream + ) -> UploadRequest { let route = Paper.docsUpdate let serverArgs = Paper.PaperDocUpdateArgs(docId: docId, docUpdatePolicy: docUpdatePolicy, revision: revision, importFormat: importFormat) return client.request(route, serverArgs: serverArgs, input: .stream(input)) } /// Allows an owner or editor to add users to a Paper doc or change their permissions using their email address or - /// Dropbox account ID. The doc owner's permissions cannot be changed. Note that this endpoint will continue to work - /// for content created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. Refer to the Paper Migration Guide + /// Dropbox account ID. The doc owner's permissions cannot be changed. Note that this endpoint will continue to + /// work for content created by users on the older version of Paper. To check which version of Paper a user is + /// on, use /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the + /// new version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: sharing.write + /// /// - parameter members: User which should be added to the Paper doc. Specify only email address or Dropbox account /// ID. /// - parameter customMessage: A personal message that will be emailed to each successfully added member. /// - parameter quiet: Clients should set this to true if no email message shall be sent to added users. /// - /// - returns: Through the response callback, the caller will receive a `Array` + /// - returns: Through the response callback, the caller will receive a `Array` /// object on success or a `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsUsersAdd is deprecated.") - @discardableResult open func docsUsersAdd(docId: String, members: Array, customMessage: String? = nil, quiet: Bool = false) -> RpcRequest, Paper.DocLookupErrorSerializer> { + @available(*, unavailable, message: "docsUsersAdd is deprecated.") + @discardableResult public func docsUsersAdd( + docId: String, + members: [Paper.AddMember], + customMessage: String? = nil, + quiet: Bool = false + ) -> RpcRequest, Paper.DocLookupErrorSerializer> { let route = Paper.docsUsersAdd let serverArgs = Paper.AddPaperDocUser(docId: docId, members: members, customMessage: customMessage, quiet: quiet) return client.request(route, serverArgs: serverArgs) } /// Lists all users who visited the Paper doc or users with explicit access. This call excludes users who have been - /// removed. The list is sorted by the date of the visit or the share date. The list will include both users, the - /// explicitly shared ones as well as those who came in using the Paper url link. Note that this endpoint will - /// continue to work for content created by users on the older version of Paper. To check which version of Paper a - /// user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the user is running - /// the new version of Paper. Refer to the Paper Migration Guide + /// removed. The list is sorted by the date of the visit or the share date. The list will include both users, + /// the explicitly shared ones as well as those who came in using the Paper url link. Note that this endpoint + /// will continue to work for content created by users on the older version of Paper. To check which version of + /// Paper a user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the user + /// is running the new version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: sharing.read + /// /// - parameter limit: Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. /// Higher value results in invalid arguments error. /// - parameter filterBy: Specify this attribute if you want to obtain users that have already accessed the Paper /// doc. /// - /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnPaperDocResponse` object + /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnPaperDocResponse` object /// on success or a `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsUsersList is deprecated.") - @discardableResult open func docsUsersList(docId: String, limit: Int32 = 1000, filterBy: Paper.UserOnPaperDocFilter = .shared) -> RpcRequest { + @available(*, unavailable, message: "docsUsersList is deprecated.") + @discardableResult public func docsUsersList( + docId: String, + limit: Int32 = 1_000, + filterBy: Paper.UserOnPaperDocFilter = .shared + ) -> RpcRequest { let route = Paper.docsUsersList let serverArgs = Paper.ListUsersOnPaperDocArgs(docId: docId, limit: limit, filterBy: filterBy) return client.request(route, serverArgs: serverArgs) @@ -389,30 +490,41 @@ open class PaperRoutes { /// enabled, then the user is running the new version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: sharing.read + /// /// - parameter cursor: The cursor obtained from docsUsersList or docsUsersListContinue. Allows for pagination. /// - /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnPaperDocResponse` object + /// - returns: Through the response callback, the caller will receive a `Paper.ListUsersOnPaperDocResponse` object /// on success or a `Paper.ListUsersCursorError` object on failure. - @available(*, unavailable, message:"docsUsersListContinue is deprecated.") - @discardableResult open func docsUsersListContinue(docId: String, cursor: String) -> RpcRequest { + @available(*, unavailable, message: "docsUsersListContinue is deprecated.") + @discardableResult public func docsUsersListContinue( + docId: String, + cursor: String + ) -> RpcRequest { let route = Paper.docsUsersListContinue let serverArgs = Paper.ListUsersOnPaperDocContinueArgs(docId: docId, cursor: cursor) return client.request(route, serverArgs: serverArgs) } /// Allows an owner or editor to remove users from a Paper doc using their email address or Dropbox account ID. The - /// doc owner cannot be removed. Note that this endpoint will continue to work for content created by users on the - /// older version of Paper. To check which version of Paper a user is on, use /users/features/get_values. If the - /// paper_as_files feature is enabled, then the user is running the new version of Paper. Refer to the Paper - /// Migration Guide https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. + /// doc owner cannot be removed. Note that this endpoint will continue to work for content created by users on + /// the older version of Paper. To check which version of Paper a user is on, use /users/features/get_values. If + /// the paper_as_files feature is enabled, then the user is running the new version of Paper. Refer to the Paper + /// Migration Guide https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration + /// information. + /// + /// - scope: sharing.write /// /// - parameter member: User which should be removed from the Paper doc. Specify only email address or Dropbox /// account ID. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Paper.DocLookupError` object on failure. - @available(*, unavailable, message:"docsUsersRemove is deprecated.") - @discardableResult open func docsUsersRemove(docId: String, member: Sharing.MemberSelector) -> RpcRequest { + @available(*, unavailable, message: "docsUsersRemove is deprecated.") + @discardableResult public func docsUsersRemove( + docId: String, + member: Sharing.MemberSelector + ) -> RpcRequest { let route = Paper.docsUsersRemove let serverArgs = Paper.RemovePaperDocUser(docId: docId, member: member) return client.request(route, serverArgs: serverArgs) @@ -420,26 +532,31 @@ open class PaperRoutes { /// Create a new Paper folder with the provided info. Note that this endpoint will continue to work for content /// created by users on the older version of Paper. To check which version of Paper a user is on, use - /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new version - /// of Paper. Refer to the Paper Migration Guide + /// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running the new + /// version of Paper. Refer to the Paper Migration Guide /// https://www.dropbox.com/lp/developers/reference/paper-migration-guide for migration information. /// + /// - scope: files.content.write + /// /// - parameter name: The name of the new Paper folder. /// - parameter parentFolderId: The encrypted Paper folder Id where the new Paper folder should be created. The API - /// user has to have write access to this folder or error is thrown. If not supplied, the new folder will be created - /// at top level. + /// user has to have write access to this folder or error is thrown. If not supplied, the new folder will be + /// created at top level. /// - parameter isTeamFolder: Whether the folder to be created should be a team folder. This value will be ignored /// if parent_folder_id is supplied, as the new folder will inherit the type (private or team folder) from its - /// parent. We will by default create a top-level private folder if both parent_folder_id and is_team_folder are not - /// supplied. + /// parent. We will by default create a top-level private folder if both parent_folder_id and is_team_folder are + /// not supplied. /// - /// - returns: Through the response callback, the caller will receive a `Paper.PaperFolderCreateResult` object on + /// - returns: Through the response callback, the caller will receive a `Paper.PaperFolderCreateResult` object on /// success or a `Paper.PaperFolderCreateError` object on failure. - @available(*, unavailable, message:"foldersCreate is deprecated.") - @discardableResult open func foldersCreate(name: String, parentFolderId: String? = nil, isTeamFolder: Bool? = nil) -> RpcRequest { + @available(*, unavailable, message: "foldersCreate is deprecated.") + @discardableResult public func foldersCreate( + name: String, + parentFolderId: String? = nil, + isTeamFolder: Bool? = nil + ) -> RpcRequest { let route = Paper.foldersCreate let serverArgs = Paper.PaperFolderCreateArg(name: name, parentFolderId: parentFolderId, isTeamFolder: isTeamFolder) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/ReconnectionHelpers.swift b/Source/SwiftyDropbox/Shared/Generated/ReconnectionHelpers.swift new file mode 100644 index 000000000..f97f24c4b --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Generated/ReconnectionHelpers.swift @@ -0,0 +1,178 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +enum ReconnectionHelpers { + static func rebuildRequest(apiRequest: ApiRequest, client: DropboxTransportClientInternal) throws -> DropboxBaseRequestBox { + let info = try persistedRequestInfo(from: apiRequest) + + switch info.routeName { + case "alphaUpload": + return .alphaUpload( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.alphaUpload, + client: client + ) + ) + case "download": + return .download( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.download, + client: client + ) + ) + case "downloadZip": + return .downloadZip( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.downloadZip, + client: client + ) + ) + case "export": + return .export( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.export, + client: client + ) + ) + case "getPreview": + return .getPreview( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.getPreview, + client: client + ) + ) + case "getThumbnail": + return .getThumbnail( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.getThumbnail, + client: client + ) + ) + case "getThumbnailV2": + return .getThumbnailV2( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.getThumbnailV2, + client: client + ) + ) + case "paperCreate": + return .paperCreate( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.paperCreate, + client: client + ) + ) + case "paperUpdate": + return .paperUpdate( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.paperUpdate, + client: client + ) + ) + case "upload": + return .upload( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.upload, + client: client + ) + ) + case "uploadSessionAppendV2": + return .uploadSessionAppendV2( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.uploadSessionAppendV2, + client: client + ) + ) + case "uploadSessionAppend": + return .uploadSessionAppend( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.uploadSessionAppend, + client: client + ) + ) + case "uploadSessionFinish": + return .uploadSessionFinish( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.uploadSessionFinish, + client: client + ) + ) + case "uploadSessionStart": + return .uploadSessionStart( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Files.uploadSessionStart, + client: client + ) + ) + case "docsCreate": + return .docsCreate( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Paper.docsCreate, + client: client + ) + ) + case "docsDownload": + return .docsDownload( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Paper.docsDownload, + client: client + ) + ) + case "docsUpdate": + return .docsUpdate( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Paper.docsUpdate, + client: client + ) + ) + case "getSharedLinkFile": + return .getSharedLinkFile( + rebuildRequest( + apiRequest: apiRequest, + info: info, + route: Sharing.getSharedLinkFile, + client: client + ) + ) + default: + throw ReconnectionErrorKind.missingReconnectionCase + } + } +} diff --git a/Source/SwiftyDropbox/Shared/Generated/SecondaryEmails.swift b/Source/SwiftyDropbox/Shared/Generated/SecondaryEmails.swift index ba42063c1..d9e58ecd9 100644 --- a/Source/SwiftyDropbox/Shared/Generated/SecondaryEmails.swift +++ b/Source/SwiftyDropbox/Shared/Generated/SecondaryEmails.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the secondary_emails namespace -open class SecondaryEmails { +public class SecondaryEmails { /// The SecondaryEmail struct - open class SecondaryEmail: CustomStringConvertible { + public class SecondaryEmail: CustomStringConvertible, JSONRepresentable { /// Secondary email address. public let email: String /// Whether or not the secondary email address is verified to be owned by a user. @@ -19,29 +19,39 @@ open class SecondaryEmails { self.email = email self.isVerified = isVerified } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryEmailSerializer().serialize(self)))" + + func json() throws -> JSON { + try SecondaryEmailSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryEmailSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryEmail: \(error)" + } } } - open class SecondaryEmailSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryEmail) -> JSON { - let output = [ - "email": Serialization._StringSerializer.serialize(value.email), - "is_verified": Serialization._BoolSerializer.serialize(value.isVerified), + + public class SecondaryEmailSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryEmail) throws -> JSON { + let output = [ + "email": try Serialization._StringSerializer.serialize(value.email), + "is_verified": try Serialization._BoolSerializer.serialize(value.isVerified), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryEmail { + + public func deserialize(_ json: JSON) throws -> SecondaryEmail { switch json { - case .dictionary(let dict): - let email = Serialization._StringSerializer.deserialize(dict["email"] ?? .null) - let isVerified = Serialization._BoolSerializer.deserialize(dict["is_verified"] ?? .null) - return SecondaryEmail(email: email, isVerified: isVerified) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let email = try Serialization._StringSerializer.deserialize(dict["email"] ?? .null) + let isVerified = try Serialization._BoolSerializer.deserialize(dict["is_verified"] ?? .null) + return SecondaryEmail(email: email, isVerified: isVerified) + default: + throw JSONSerializerError.deserializeError(type: SecondaryEmail.self, json: json) } } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/SeenState.swift b/Source/SwiftyDropbox/Shared/Generated/SeenState.swift index d673f5cc0..7ab8736a4 100644 --- a/Source/SwiftyDropbox/Shared/Generated/SeenState.swift +++ b/Source/SwiftyDropbox/Shared/Generated/SeenState.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the seen_state namespace -open class SeenState { +public class SeenState { /// Possible platforms on which a user may view content. - public enum PlatformType: CustomStringConvertible { + public enum PlatformType: CustomStringConvertible, JSONRepresentable { /// The content was viewed on the web. case web /// The content was viewed on a desktop client. @@ -27,76 +27,85 @@ open class SeenState { /// An unspecified error. case other + func json() throws -> JSON { + try PlatformTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PlatformTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PlatformTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PlatformType: \(error)" + } } } - open class PlatformTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PlatformType) -> JSON { + + public class PlatformTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PlatformType) throws -> JSON { switch value { - case .web: - var d = [String: JSON]() - d[".tag"] = .str("web") - return .dictionary(d) - case .desktop: - var d = [String: JSON]() - d[".tag"] = .str("desktop") - return .dictionary(d) - case .mobileIos: - var d = [String: JSON]() - d[".tag"] = .str("mobile_ios") - return .dictionary(d) - case .mobileAndroid: - var d = [String: JSON]() - d[".tag"] = .str("mobile_android") - return .dictionary(d) - case .api: - var d = [String: JSON]() - d[".tag"] = .str("api") - return .dictionary(d) - case .unknown: - var d = [String: JSON]() - d[".tag"] = .str("unknown") - return .dictionary(d) - case .mobile: - var d = [String: JSON]() - d[".tag"] = .str("mobile") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .web: + var d = [String: JSON]() + d[".tag"] = .str("web") + return .dictionary(d) + case .desktop: + var d = [String: JSON]() + d[".tag"] = .str("desktop") + return .dictionary(d) + case .mobileIos: + var d = [String: JSON]() + d[".tag"] = .str("mobile_ios") + return .dictionary(d) + case .mobileAndroid: + var d = [String: JSON]() + d[".tag"] = .str("mobile_android") + return .dictionary(d) + case .api: + var d = [String: JSON]() + d[".tag"] = .str("api") + return .dictionary(d) + case .unknown: + var d = [String: JSON]() + d[".tag"] = .str("unknown") + return .dictionary(d) + case .mobile: + var d = [String: JSON]() + d[".tag"] = .str("mobile") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PlatformType { + + public func deserialize(_ json: JSON) throws -> PlatformType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "web": - return PlatformType.web - case "desktop": - return PlatformType.desktop - case "mobile_ios": - return PlatformType.mobileIos - case "mobile_android": - return PlatformType.mobileAndroid - case "api": - return PlatformType.api - case "unknown": - return PlatformType.unknown - case "mobile": - return PlatformType.mobile - case "other": - return PlatformType.other - default: - return PlatformType.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "web": + return PlatformType.web + case "desktop": + return PlatformType.desktop + case "mobile_ios": + return PlatformType.mobileIos + case "mobile_android": + return PlatformType.mobileAndroid + case "api": + return PlatformType.api + case "unknown": + return PlatformType.unknown + case "mobile": + return PlatformType.mobile + case "other": + return PlatformType.other default: - fatalError("Failed to deserialize") + return PlatformType.other + } + default: + throw JSONSerializerError.deserializeError(type: PlatformType.self, json: json) } } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Sharing.swift b/Source/SwiftyDropbox/Shared/Generated/Sharing.swift index afe4a64fc..352fdde7a 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Sharing.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Sharing.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the sharing namespace -open class Sharing { +public class Sharing { /// Information about the inheritance policy of a shared folder. - public enum AccessInheritance: CustomStringConvertible { + public enum AccessInheritance: CustomStringConvertible, JSONRepresentable { /// The shared folder inherits its members from the parent folder. case inherit /// The shared folder does not inherit its members from the parent folder. @@ -17,50 +17,60 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try AccessInheritanceSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccessInheritanceSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccessInheritanceSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccessInheritance: \(error)" + } } } - open class AccessInheritanceSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccessInheritance) -> JSON { + + public class AccessInheritanceSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccessInheritance) throws -> JSON { switch value { - case .inherit: - var d = [String: JSON]() - d[".tag"] = .str("inherit") - return .dictionary(d) - case .noInherit: - var d = [String: JSON]() - d[".tag"] = .str("no_inherit") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AccessInheritance { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "inherit": - return AccessInheritance.inherit - case "no_inherit": - return AccessInheritance.noInherit - case "other": - return AccessInheritance.other - default: - return AccessInheritance.other - } + case .inherit: + var d = [String: JSON]() + d[".tag"] = .str("inherit") + return .dictionary(d) + case .noInherit: + var d = [String: JSON]() + d[".tag"] = .str("no_inherit") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AccessInheritance { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "inherit": + return AccessInheritance.inherit + case "no_inherit": + return AccessInheritance.noInherit + case "other": + return AccessInheritance.other default: - fatalError("Failed to deserialize") + return AccessInheritance.other + } + default: + throw JSONSerializerError.deserializeError(type: AccessInheritance.self, json: json) } } } /// Defines the access levels for collaborators. - public enum AccessLevel: CustomStringConvertible { + public enum AccessLevel: CustomStringConvertible, JSONRepresentable { /// The collaborator is the owner of the shared folder. Owners can view and edit the shared folder as well as /// set the folder's policies using updateFolderPolicy. case owner @@ -72,72 +82,92 @@ open class Sharing { case viewerNoComment /// The collaborator can only view the shared folder that they have access to. case traverse + /// If there is a Righteous Link on the folder which grants access and the user has visited such link, they are + /// allowed to perform certain action (i.e. add themselves to the folder) via the link access even + /// though the user themselves are not a member on the shared folder yet. + case noAccess /// An unspecified error. case other + func json() throws -> JSON { + try AccessLevelSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccessLevelSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccessLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccessLevel: \(error)" + } } } - open class AccessLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccessLevel) -> JSON { + + public class AccessLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccessLevel) throws -> JSON { switch value { - case .owner: - var d = [String: JSON]() - d[".tag"] = .str("owner") - return .dictionary(d) - case .editor: - var d = [String: JSON]() - d[".tag"] = .str("editor") - return .dictionary(d) - case .viewer: - var d = [String: JSON]() - d[".tag"] = .str("viewer") - return .dictionary(d) - case .viewerNoComment: - var d = [String: JSON]() - d[".tag"] = .str("viewer_no_comment") - return .dictionary(d) - case .traverse: - var d = [String: JSON]() - d[".tag"] = .str("traverse") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AccessLevel { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "owner": - return AccessLevel.owner - case "editor": - return AccessLevel.editor - case "viewer": - return AccessLevel.viewer - case "viewer_no_comment": - return AccessLevel.viewerNoComment - case "traverse": - return AccessLevel.traverse - case "other": - return AccessLevel.other - default: - return AccessLevel.other - } - default: - fatalError("Failed to deserialize") + case .owner: + var d = [String: JSON]() + d[".tag"] = .str("owner") + return .dictionary(d) + case .editor: + var d = [String: JSON]() + d[".tag"] = .str("editor") + return .dictionary(d) + case .viewer: + var d = [String: JSON]() + d[".tag"] = .str("viewer") + return .dictionary(d) + case .viewerNoComment: + var d = [String: JSON]() + d[".tag"] = .str("viewer_no_comment") + return .dictionary(d) + case .traverse: + var d = [String: JSON]() + d[".tag"] = .str("traverse") + return .dictionary(d) + case .noAccess: + var d = [String: JSON]() + d[".tag"] = .str("no_access") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AccessLevel { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "owner": + return AccessLevel.owner + case "editor": + return AccessLevel.editor + case "viewer": + return AccessLevel.viewer + case "viewer_no_comment": + return AccessLevel.viewerNoComment + case "traverse": + return AccessLevel.traverse + case "no_access": + return AccessLevel.noAccess + case "other": + return AccessLevel.other + default: + return AccessLevel.other + } + default: + throw JSONSerializerError.deserializeError(type: AccessLevel.self, json: json) } } } /// Who can change a shared folder's access control list (ACL). In other words, who can add, remove, or change the /// privileges of members. - public enum AclUpdatePolicy: CustomStringConvertible { + public enum AclUpdatePolicy: CustomStringConvertible, JSONRepresentable { /// Only the owner can update the ACL. case owner /// Any editor can update the ACL. This may be further restricted to editors on the same team. @@ -145,55 +175,65 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try AclUpdatePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AclUpdatePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AclUpdatePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AclUpdatePolicy: \(error)" + } } } - open class AclUpdatePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AclUpdatePolicy) -> JSON { + + public class AclUpdatePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AclUpdatePolicy) throws -> JSON { switch value { - case .owner: - var d = [String: JSON]() - d[".tag"] = .str("owner") - return .dictionary(d) - case .editors: - var d = [String: JSON]() - d[".tag"] = .str("editors") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AclUpdatePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "owner": - return AclUpdatePolicy.owner - case "editors": - return AclUpdatePolicy.editors - case "other": - return AclUpdatePolicy.other - default: - return AclUpdatePolicy.other - } + case .owner: + var d = [String: JSON]() + d[".tag"] = .str("owner") + return .dictionary(d) + case .editors: + var d = [String: JSON]() + d[".tag"] = .str("editors") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AclUpdatePolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "owner": + return AclUpdatePolicy.owner + case "editors": + return AclUpdatePolicy.editors + case "other": + return AclUpdatePolicy.other default: - fatalError("Failed to deserialize") + return AclUpdatePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: AclUpdatePolicy.self, json: json) } } } /// Arguments for addFileMember. - open class AddFileMemberArgs: CustomStringConvertible { + public class AddFileMemberArgs: CustomStringConvertible, JSONRepresentable { /// File to which to add members. public let file: String /// Members to add. Note that even an email address is given, this may result in a user being directly added to /// the membership if that email is the user's main account email. - public let members: Array + public let members: [Sharing.MemberSelector] /// Message to send to added members in their invitation. public let customMessage: String? /// Whether added members should be notified via email and device notifications of their invitation. @@ -202,7 +242,14 @@ open class Sharing { public let accessLevel: Sharing.AccessLevel /// If the custom message should be added as a comment on the file. public let addMessageAsComment: Bool - public init(file: String, members: Array, customMessage: String? = nil, quiet: Bool = false, accessLevel: Sharing.AccessLevel = .viewer, addMessageAsComment: Bool = false) { + public init( + file: String, + members: [Sharing.MemberSelector], + customMessage: String? = nil, + quiet: Bool = false, + accessLevel: Sharing.AccessLevel = .viewer, + addMessageAsComment: Bool = false + ) { stringValidator(minLength: 1, pattern: "((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?")(file) self.file = file self.members = members @@ -212,41 +259,60 @@ open class Sharing { self.accessLevel = accessLevel self.addMessageAsComment = addMessageAsComment } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddFileMemberArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddFileMemberArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddFileMemberArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddFileMemberArgs: \(error)" + } } } - open class AddFileMemberArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddFileMemberArgs) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), - "members": ArraySerializer(Sharing.MemberSelectorSerializer()).serialize(value.members), - "custom_message": NullableSerializer(Serialization._StringSerializer).serialize(value.customMessage), - "quiet": Serialization._BoolSerializer.serialize(value.quiet), - "access_level": Sharing.AccessLevelSerializer().serialize(value.accessLevel), - "add_message_as_comment": Serialization._BoolSerializer.serialize(value.addMessageAsComment), + + public class AddFileMemberArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddFileMemberArgs) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), + "members": try ArraySerializer(Sharing.MemberSelectorSerializer()).serialize(value.members), + "custom_message": try NullableSerializer(Serialization._StringSerializer).serialize(value.customMessage), + "quiet": try Serialization._BoolSerializer.serialize(value.quiet), + "access_level": try Sharing.AccessLevelSerializer().serialize(value.accessLevel), + "add_message_as_comment": try Serialization._BoolSerializer.serialize(value.addMessageAsComment), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddFileMemberArgs { + + public func deserialize(_ json: JSON) throws -> AddFileMemberArgs { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - let members = ArraySerializer(Sharing.MemberSelectorSerializer()).deserialize(dict["members"] ?? .null) - let customMessage = NullableSerializer(Serialization._StringSerializer).deserialize(dict["custom_message"] ?? .null) - let quiet = Serialization._BoolSerializer.deserialize(dict["quiet"] ?? .number(0)) - let accessLevel = Sharing.AccessLevelSerializer().deserialize(dict["access_level"] ?? Sharing.AccessLevelSerializer().serialize(.viewer)) - let addMessageAsComment = Serialization._BoolSerializer.deserialize(dict["add_message_as_comment"] ?? .number(0)) - return AddFileMemberArgs(file: file, members: members, customMessage: customMessage, quiet: quiet, accessLevel: accessLevel, addMessageAsComment: addMessageAsComment) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + let members = try ArraySerializer(Sharing.MemberSelectorSerializer()).deserialize(dict["members"] ?? .null) + let customMessage = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["custom_message"] ?? .null) + let quiet = try Serialization._BoolSerializer.deserialize(dict["quiet"] ?? .number(0)) + let accessLevel = try Sharing.AccessLevelSerializer() + .deserialize(dict["access_level"] ?? Sharing.AccessLevelSerializer().serialize(.viewer)) + let addMessageAsComment = try Serialization._BoolSerializer.deserialize(dict["add_message_as_comment"] ?? .number(0)) + return AddFileMemberArgs( + file: file, + members: members, + customMessage: customMessage, + quiet: quiet, + accessLevel: accessLevel, + addMessageAsComment: addMessageAsComment + ) + default: + throw JSONSerializerError.deserializeError(type: AddFileMemberArgs.self, json: json) } } } /// Errors for addFileMember. - public enum AddFileMemberError: CustomStringConvertible { + public enum AddFileMemberError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case userError(Sharing.SharingUserError) /// An unspecified error. @@ -258,73 +324,83 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try AddFileMemberErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddFileMemberErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddFileMemberErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddFileMemberError: \(error)" + } } } - open class AddFileMemberErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddFileMemberError) -> JSON { + + public class AddFileMemberErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddFileMemberError) throws -> JSON { switch value { - case .userError(let arg): - var d = ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] - d[".tag"] = .str("user_error") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .rateLimit: - var d = [String: JSON]() - d[".tag"] = .str("rate_limit") - return .dictionary(d) - case .invalidComment: - var d = [String: JSON]() - d[".tag"] = .str("invalid_comment") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddFileMemberError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_error": - let v = Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) - return AddFileMemberError.userError(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return AddFileMemberError.accessError(v) - case "rate_limit": - return AddFileMemberError.rateLimit - case "invalid_comment": - return AddFileMemberError.invalidComment - case "other": - return AddFileMemberError.other - default: - return AddFileMemberError.other - } - default: - fatalError("Failed to deserialize") + case .userError(let arg): + var d = try ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .rateLimit: + var d = [String: JSON]() + d[".tag"] = .str("rate_limit") + return .dictionary(d) + case .invalidComment: + var d = [String: JSON]() + d[".tag"] = .str("invalid_comment") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddFileMemberError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_error": + let v = try Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) + return AddFileMemberError.userError(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return AddFileMemberError.accessError(v) + case "rate_limit": + return AddFileMemberError.rateLimit + case "invalid_comment": + return AddFileMemberError.invalidComment + case "other": + return AddFileMemberError.other + default: + return AddFileMemberError.other + } + default: + throw JSONSerializerError.deserializeError(type: AddFileMemberError.self, json: json) } } } /// The AddFolderMemberArg struct - open class AddFolderMemberArg: CustomStringConvertible { + public class AddFolderMemberArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// The intended list of members to add. Added members will receive invites to join the shared folder. - public let members: Array + public let members: [Sharing.AddMember] /// Whether added members should be notified via email and device notifications of their invite. public let quiet: Bool /// Optional message to display to added members in their invitation. public let customMessage: String? - public init(sharedFolderId: String, members: Array, quiet: Bool = false, customMessage: String? = nil) { + public init(sharedFolderId: String, members: [Sharing.AddMember], quiet: Bool = false, customMessage: String? = nil) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId self.members = members @@ -332,37 +408,48 @@ open class Sharing { nullableValidator(stringValidator(minLength: 1))(customMessage) self.customMessage = customMessage } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddFolderMemberArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddFolderMemberArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddFolderMemberArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddFolderMemberArg: \(error)" + } } } - open class AddFolderMemberArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddFolderMemberArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "members": ArraySerializer(Sharing.AddMemberSerializer()).serialize(value.members), - "quiet": Serialization._BoolSerializer.serialize(value.quiet), - "custom_message": NullableSerializer(Serialization._StringSerializer).serialize(value.customMessage), + + public class AddFolderMemberArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddFolderMemberArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "members": try ArraySerializer(Sharing.AddMemberSerializer()).serialize(value.members), + "quiet": try Serialization._BoolSerializer.serialize(value.quiet), + "custom_message": try NullableSerializer(Serialization._StringSerializer).serialize(value.customMessage), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddFolderMemberArg { + + public func deserialize(_ json: JSON) throws -> AddFolderMemberArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let members = ArraySerializer(Sharing.AddMemberSerializer()).deserialize(dict["members"] ?? .null) - let quiet = Serialization._BoolSerializer.deserialize(dict["quiet"] ?? .number(0)) - let customMessage = NullableSerializer(Serialization._StringSerializer).deserialize(dict["custom_message"] ?? .null) - return AddFolderMemberArg(sharedFolderId: sharedFolderId, members: members, quiet: quiet, customMessage: customMessage) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let members = try ArraySerializer(Sharing.AddMemberSerializer()).deserialize(dict["members"] ?? .null) + let quiet = try Serialization._BoolSerializer.deserialize(dict["quiet"] ?? .number(0)) + let customMessage = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["custom_message"] ?? .null) + return AddFolderMemberArg(sharedFolderId: sharedFolderId, members: members, quiet: quiet, customMessage: customMessage) + default: + throw JSONSerializerError.deserializeError(type: AddFolderMemberArg.self, json: json) } } } /// The AddFolderMemberError union - public enum AddFolderMemberError: CustomStringConvertible { + public enum AddFolderMemberError: CustomStringConvertible, JSONRepresentable { /// Unable to access shared folder. case accessError(Sharing.SharedFolderAccessError) /// This user's email address is not verified. This functionality is only available on accounts with a verified @@ -394,120 +481,130 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try AddFolderMemberErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddFolderMemberErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddFolderMemberErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddFolderMemberError: \(error)" + } } } - open class AddFolderMemberErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddFolderMemberError) -> JSON { + + public class AddFolderMemberErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddFolderMemberError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .bannedMember: - var d = [String: JSON]() - d[".tag"] = .str("banned_member") - return .dictionary(d) - case .badMember(let arg): - var d = ["bad_member": Sharing.AddMemberSelectorErrorSerializer().serialize(arg)] - d[".tag"] = .str("bad_member") - return .dictionary(d) - case .cantShareOutsideTeam: - var d = [String: JSON]() - d[".tag"] = .str("cant_share_outside_team") - return .dictionary(d) - case .tooManyMembers(let arg): - var d = ["too_many_members": Serialization._UInt64Serializer.serialize(arg)] - d[".tag"] = .str("too_many_members") - return .dictionary(d) - case .tooManyPendingInvites(let arg): - var d = ["too_many_pending_invites": Serialization._UInt64Serializer.serialize(arg)] - d[".tag"] = .str("too_many_pending_invites") - return .dictionary(d) - case .rateLimit: - var d = [String: JSON]() - d[".tag"] = .str("rate_limit") - return .dictionary(d) - case .tooManyInvitees: - var d = [String: JSON]() - d[".tag"] = .str("too_many_invitees") - return .dictionary(d) - case .insufficientPlan: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_plan") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .invalidSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("invalid_shared_folder") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddFolderMemberError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return AddFolderMemberError.accessError(v) - case "email_unverified": - return AddFolderMemberError.emailUnverified - case "banned_member": - return AddFolderMemberError.bannedMember - case "bad_member": - let v = Sharing.AddMemberSelectorErrorSerializer().deserialize(d["bad_member"] ?? .null) - return AddFolderMemberError.badMember(v) - case "cant_share_outside_team": - return AddFolderMemberError.cantShareOutsideTeam - case "too_many_members": - let v = Serialization._UInt64Serializer.deserialize(d["too_many_members"] ?? .null) - return AddFolderMemberError.tooManyMembers(v) - case "too_many_pending_invites": - let v = Serialization._UInt64Serializer.deserialize(d["too_many_pending_invites"] ?? .null) - return AddFolderMemberError.tooManyPendingInvites(v) - case "rate_limit": - return AddFolderMemberError.rateLimit - case "too_many_invitees": - return AddFolderMemberError.tooManyInvitees - case "insufficient_plan": - return AddFolderMemberError.insufficientPlan - case "team_folder": - return AddFolderMemberError.teamFolder - case "no_permission": - return AddFolderMemberError.noPermission - case "invalid_shared_folder": - return AddFolderMemberError.invalidSharedFolder - case "other": - return AddFolderMemberError.other - default: - return AddFolderMemberError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .bannedMember: + var d = [String: JSON]() + d[".tag"] = .str("banned_member") + return .dictionary(d) + case .badMember(let arg): + var d = try ["bad_member": Sharing.AddMemberSelectorErrorSerializer().serialize(arg)] + d[".tag"] = .str("bad_member") + return .dictionary(d) + case .cantShareOutsideTeam: + var d = [String: JSON]() + d[".tag"] = .str("cant_share_outside_team") + return .dictionary(d) + case .tooManyMembers(let arg): + var d = try ["too_many_members": Serialization._UInt64Serializer.serialize(arg)] + d[".tag"] = .str("too_many_members") + return .dictionary(d) + case .tooManyPendingInvites(let arg): + var d = try ["too_many_pending_invites": Serialization._UInt64Serializer.serialize(arg)] + d[".tag"] = .str("too_many_pending_invites") + return .dictionary(d) + case .rateLimit: + var d = [String: JSON]() + d[".tag"] = .str("rate_limit") + return .dictionary(d) + case .tooManyInvitees: + var d = [String: JSON]() + d[".tag"] = .str("too_many_invitees") + return .dictionary(d) + case .insufficientPlan: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_plan") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .invalidSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("invalid_shared_folder") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddFolderMemberError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return AddFolderMemberError.accessError(v) + case "email_unverified": + return AddFolderMemberError.emailUnverified + case "banned_member": + return AddFolderMemberError.bannedMember + case "bad_member": + let v = try Sharing.AddMemberSelectorErrorSerializer().deserialize(d["bad_member"] ?? .null) + return AddFolderMemberError.badMember(v) + case "cant_share_outside_team": + return AddFolderMemberError.cantShareOutsideTeam + case "too_many_members": + let v = try Serialization._UInt64Serializer.deserialize(d["too_many_members"] ?? .null) + return AddFolderMemberError.tooManyMembers(v) + case "too_many_pending_invites": + let v = try Serialization._UInt64Serializer.deserialize(d["too_many_pending_invites"] ?? .null) + return AddFolderMemberError.tooManyPendingInvites(v) + case "rate_limit": + return AddFolderMemberError.rateLimit + case "too_many_invitees": + return AddFolderMemberError.tooManyInvitees + case "insufficient_plan": + return AddFolderMemberError.insufficientPlan + case "team_folder": + return AddFolderMemberError.teamFolder + case "no_permission": + return AddFolderMemberError.noPermission + case "invalid_shared_folder": + return AddFolderMemberError.invalidSharedFolder + case "other": + return AddFolderMemberError.other + default: + return AddFolderMemberError.other + } + default: + throw JSONSerializerError.deserializeError(type: AddFolderMemberError.self, json: json) } } } /// The member and type of access the member should have when added to a shared folder. - open class AddMember: CustomStringConvertible { + public class AddMember: CustomStringConvertible, JSONRepresentable { /// The member to add to the shared folder. public let member: Sharing.MemberSelector /// The access level to grant member to the shared folder. owner in AccessLevel is disallowed. @@ -516,33 +613,45 @@ open class Sharing { self.member = member self.accessLevel = accessLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddMemberSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddMemberSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddMemberSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddMember: \(error)" + } } } - open class AddMemberSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddMember) -> JSON { - let output = [ - "member": Sharing.MemberSelectorSerializer().serialize(value.member), - "access_level": Sharing.AccessLevelSerializer().serialize(value.accessLevel), + + public class AddMemberSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddMember) throws -> JSON { + let output = [ + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), + "access_level": try Sharing.AccessLevelSerializer().serialize(value.accessLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddMember { + + public func deserialize(_ json: JSON) throws -> AddMember { switch json { - case .dictionary(let dict): - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - let accessLevel = Sharing.AccessLevelSerializer().deserialize(dict["access_level"] ?? Sharing.AccessLevelSerializer().serialize(.viewer)) - return AddMember(member: member, accessLevel: accessLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + let accessLevel = try Sharing.AccessLevelSerializer() + .deserialize(dict["access_level"] ?? Sharing.AccessLevelSerializer().serialize(.viewer)) + return AddMember(member: member, accessLevel: accessLevel) + default: + throw JSONSerializerError.deserializeError(type: AddMember.self, json: json) } } } /// The AddMemberSelectorError union - public enum AddMemberSelectorError: CustomStringConvertible { + public enum AddMemberSelectorError: CustomStringConvertible, JSONRepresentable { /// Automatically created groups can only be added to team folders. case automaticGroup /// The value is the ID that could not be identified. @@ -559,79 +668,89 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try AddMemberSelectorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddMemberSelectorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddMemberSelectorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddMemberSelectorError: \(error)" + } } } - open class AddMemberSelectorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddMemberSelectorError) -> JSON { + + public class AddMemberSelectorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddMemberSelectorError) throws -> JSON { switch value { - case .automaticGroup: - var d = [String: JSON]() - d[".tag"] = .str("automatic_group") - return .dictionary(d) - case .invalidDropboxId(let arg): - var d = ["invalid_dropbox_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("invalid_dropbox_id") - return .dictionary(d) - case .invalidEmail(let arg): - var d = ["invalid_email": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("invalid_email") - return .dictionary(d) - case .unverifiedDropboxId(let arg): - var d = ["unverified_dropbox_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("unverified_dropbox_id") - return .dictionary(d) - case .groupDeleted: - var d = [String: JSON]() - d[".tag"] = .str("group_deleted") - return .dictionary(d) - case .groupNotOnTeam: - var d = [String: JSON]() - d[".tag"] = .str("group_not_on_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddMemberSelectorError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "automatic_group": - return AddMemberSelectorError.automaticGroup - case "invalid_dropbox_id": - let v = Serialization._StringSerializer.deserialize(d["invalid_dropbox_id"] ?? .null) - return AddMemberSelectorError.invalidDropboxId(v) - case "invalid_email": - let v = Serialization._StringSerializer.deserialize(d["invalid_email"] ?? .null) - return AddMemberSelectorError.invalidEmail(v) - case "unverified_dropbox_id": - let v = Serialization._StringSerializer.deserialize(d["unverified_dropbox_id"] ?? .null) - return AddMemberSelectorError.unverifiedDropboxId(v) - case "group_deleted": - return AddMemberSelectorError.groupDeleted - case "group_not_on_team": - return AddMemberSelectorError.groupNotOnTeam - case "other": - return AddMemberSelectorError.other - default: - return AddMemberSelectorError.other - } - default: - fatalError("Failed to deserialize") + case .automaticGroup: + var d = [String: JSON]() + d[".tag"] = .str("automatic_group") + return .dictionary(d) + case .invalidDropboxId(let arg): + var d = try ["invalid_dropbox_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("invalid_dropbox_id") + return .dictionary(d) + case .invalidEmail(let arg): + var d = try ["invalid_email": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("invalid_email") + return .dictionary(d) + case .unverifiedDropboxId(let arg): + var d = try ["unverified_dropbox_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("unverified_dropbox_id") + return .dictionary(d) + case .groupDeleted: + var d = [String: JSON]() + d[".tag"] = .str("group_deleted") + return .dictionary(d) + case .groupNotOnTeam: + var d = [String: JSON]() + d[".tag"] = .str("group_not_on_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddMemberSelectorError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "automatic_group": + return AddMemberSelectorError.automaticGroup + case "invalid_dropbox_id": + let v = try Serialization._StringSerializer.deserialize(d["invalid_dropbox_id"] ?? .null) + return AddMemberSelectorError.invalidDropboxId(v) + case "invalid_email": + let v = try Serialization._StringSerializer.deserialize(d["invalid_email"] ?? .null) + return AddMemberSelectorError.invalidEmail(v) + case "unverified_dropbox_id": + let v = try Serialization._StringSerializer.deserialize(d["unverified_dropbox_id"] ?? .null) + return AddMemberSelectorError.unverifiedDropboxId(v) + case "group_deleted": + return AddMemberSelectorError.groupDeleted + case "group_not_on_team": + return AddMemberSelectorError.groupNotOnTeam + case "other": + return AddMemberSelectorError.other + default: + return AddMemberSelectorError.other + } + default: + throw JSONSerializerError.deserializeError(type: AddMemberSelectorError.self, json: json) } } } /// The access permission that can be requested by the caller for the shared link. Note that the final resolved - /// visibility of the shared link takes into account other aspects, such as team and shared folder settings. Check - /// the ResolvedVisibility for more info on the possible resolved visibility values of shared links. - public enum RequestedVisibility: CustomStringConvertible { + /// visibility of the shared link takes into account other aspects, such as team and shared folder settings. + /// Check the ResolvedVisibility for more info on the possible resolved visibility values of shared links. + public enum RequestedVisibility: CustomStringConvertible, JSONRepresentable { /// Anyone who has received the link can access it. No login required. case public_ /// Only members of the same team can access the link. Login is required. @@ -639,52 +758,62 @@ open class Sharing { /// A link-specific password is required to access the link. Login is not required. case password + func json() throws -> JSON { + try RequestedVisibilitySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RequestedVisibilitySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RequestedVisibilitySerializer().serialize(self)))" + } catch { + return "Failed to generate description for RequestedVisibility: \(error)" + } } } - open class RequestedVisibilitySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RequestedVisibility) -> JSON { + + public class RequestedVisibilitySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RequestedVisibility) throws -> JSON { switch value { - case .public_: - var d = [String: JSON]() - d[".tag"] = .str("public") - return .dictionary(d) - case .teamOnly: - var d = [String: JSON]() - d[".tag"] = .str("team_only") - return .dictionary(d) - case .password: - var d = [String: JSON]() - d[".tag"] = .str("password") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RequestedVisibility { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "public": - return RequestedVisibility.public_ - case "team_only": - return RequestedVisibility.teamOnly - case "password": - return RequestedVisibility.password - default: - fatalError("Unknown tag \(tag)") - } + case .public_: + var d = [String: JSON]() + d[".tag"] = .str("public") + return .dictionary(d) + case .teamOnly: + var d = [String: JSON]() + d[".tag"] = .str("team_only") + return .dictionary(d) + case .password: + var d = [String: JSON]() + d[".tag"] = .str("password") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RequestedVisibility { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "public": + return RequestedVisibility.public_ + case "team_only": + return RequestedVisibility.teamOnly + case "password": + return RequestedVisibility.password default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RequestedVisibility.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RequestedVisibility.self, json: json) } } } /// The actual access permissions values of shared links after taking into account user preferences and the team and - /// shared folder settings. Check the RequestedVisibility for more info on the possible visibility values that can - /// be set by the shared link's owner. - public enum ResolvedVisibility: CustomStringConvertible { + /// shared folder settings. Check the RequestedVisibility for more info on the possible visibility values that + /// can be set by the shared link's owner. + public enum ResolvedVisibility: CustomStringConvertible, JSONRepresentable { /// Anyone who has received the link can access it. No login required. case public_ /// Only members of the same team can access the link. Login is required. @@ -696,88 +825,98 @@ open class Sharing { /// Only members of the shared folder containing the linked file can access the link. Login is required. case sharedFolderOnly /// The link merely points the user to the content, and does not grant any additional rights. Existing members - /// of the content who use this link can only access the content with their pre-existing access rights. Either - /// on the file directly, or inherited from a parent folder. + /// of the content who use this link can only access the content with their pre-existing access rights. + /// Either on the file directly, or inherited from a parent folder. case noOne /// Only the current user can view this link. case onlyYou /// An unspecified error. case other + func json() throws -> JSON { + try ResolvedVisibilitySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResolvedVisibilitySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResolvedVisibilitySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResolvedVisibility: \(error)" + } } } - open class ResolvedVisibilitySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResolvedVisibility) -> JSON { + + public class ResolvedVisibilitySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResolvedVisibility) throws -> JSON { switch value { - case .public_: - var d = [String: JSON]() - d[".tag"] = .str("public") - return .dictionary(d) - case .teamOnly: - var d = [String: JSON]() - d[".tag"] = .str("team_only") - return .dictionary(d) - case .password: - var d = [String: JSON]() - d[".tag"] = .str("password") - return .dictionary(d) - case .teamAndPassword: - var d = [String: JSON]() - d[".tag"] = .str("team_and_password") - return .dictionary(d) - case .sharedFolderOnly: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_only") - return .dictionary(d) - case .noOne: - var d = [String: JSON]() - d[".tag"] = .str("no_one") - return .dictionary(d) - case .onlyYou: - var d = [String: JSON]() - d[".tag"] = .str("only_you") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ResolvedVisibility { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "public": - return ResolvedVisibility.public_ - case "team_only": - return ResolvedVisibility.teamOnly - case "password": - return ResolvedVisibility.password - case "team_and_password": - return ResolvedVisibility.teamAndPassword - case "shared_folder_only": - return ResolvedVisibility.sharedFolderOnly - case "no_one": - return ResolvedVisibility.noOne - case "only_you": - return ResolvedVisibility.onlyYou - case "other": - return ResolvedVisibility.other - default: - return ResolvedVisibility.other - } - default: - fatalError("Failed to deserialize") + case .public_: + var d = [String: JSON]() + d[".tag"] = .str("public") + return .dictionary(d) + case .teamOnly: + var d = [String: JSON]() + d[".tag"] = .str("team_only") + return .dictionary(d) + case .password: + var d = [String: JSON]() + d[".tag"] = .str("password") + return .dictionary(d) + case .teamAndPassword: + var d = [String: JSON]() + d[".tag"] = .str("team_and_password") + return .dictionary(d) + case .sharedFolderOnly: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_only") + return .dictionary(d) + case .noOne: + var d = [String: JSON]() + d[".tag"] = .str("no_one") + return .dictionary(d) + case .onlyYou: + var d = [String: JSON]() + d[".tag"] = .str("only_you") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ResolvedVisibility { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "public": + return ResolvedVisibility.public_ + case "team_only": + return ResolvedVisibility.teamOnly + case "password": + return ResolvedVisibility.password + case "team_and_password": + return ResolvedVisibility.teamAndPassword + case "shared_folder_only": + return ResolvedVisibility.sharedFolderOnly + case "no_one": + return ResolvedVisibility.noOne + case "only_you": + return ResolvedVisibility.onlyYou + case "other": + return ResolvedVisibility.other + default: + return ResolvedVisibility.other + } + default: + throw JSONSerializerError.deserializeError(type: ResolvedVisibility.self, json: json) } } } /// check documentation for ResolvedVisibility. - public enum AlphaResolvedVisibility: CustomStringConvertible { + public enum AlphaResolvedVisibility: CustomStringConvertible, JSONRepresentable { /// Anyone who has received the link can access it. No login required. case public_ /// Only members of the same team can access the link. Login is required. @@ -789,157 +928,189 @@ open class Sharing { /// Only members of the shared folder containing the linked file can access the link. Login is required. case sharedFolderOnly /// The link merely points the user to the content, and does not grant any additional rights. Existing members - /// of the content who use this link can only access the content with their pre-existing access rights. Either - /// on the file directly, or inherited from a parent folder. + /// of the content who use this link can only access the content with their pre-existing access rights. + /// Either on the file directly, or inherited from a parent folder. case noOne /// Only the current user can view this link. case onlyYou /// An unspecified error. case other + func json() throws -> JSON { + try AlphaResolvedVisibilitySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AlphaResolvedVisibilitySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AlphaResolvedVisibilitySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AlphaResolvedVisibility: \(error)" + } } } - open class AlphaResolvedVisibilitySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AlphaResolvedVisibility) -> JSON { + + public class AlphaResolvedVisibilitySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AlphaResolvedVisibility) throws -> JSON { switch value { - case .public_: - var d = [String: JSON]() - d[".tag"] = .str("public") - return .dictionary(d) - case .teamOnly: - var d = [String: JSON]() - d[".tag"] = .str("team_only") - return .dictionary(d) - case .password: - var d = [String: JSON]() - d[".tag"] = .str("password") - return .dictionary(d) - case .teamAndPassword: - var d = [String: JSON]() - d[".tag"] = .str("team_and_password") - return .dictionary(d) - case .sharedFolderOnly: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_only") - return .dictionary(d) - case .noOne: - var d = [String: JSON]() - d[".tag"] = .str("no_one") - return .dictionary(d) - case .onlyYou: - var d = [String: JSON]() - d[".tag"] = .str("only_you") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AlphaResolvedVisibility { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "public": - return AlphaResolvedVisibility.public_ - case "team_only": - return AlphaResolvedVisibility.teamOnly - case "password": - return AlphaResolvedVisibility.password - case "team_and_password": - return AlphaResolvedVisibility.teamAndPassword - case "shared_folder_only": - return AlphaResolvedVisibility.sharedFolderOnly - case "no_one": - return AlphaResolvedVisibility.noOne - case "only_you": - return AlphaResolvedVisibility.onlyYou - case "other": - return AlphaResolvedVisibility.other - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .public_: + var d = [String: JSON]() + d[".tag"] = .str("public") + return .dictionary(d) + case .teamOnly: + var d = [String: JSON]() + d[".tag"] = .str("team_only") + return .dictionary(d) + case .password: + var d = [String: JSON]() + d[".tag"] = .str("password") + return .dictionary(d) + case .teamAndPassword: + var d = [String: JSON]() + d[".tag"] = .str("team_and_password") + return .dictionary(d) + case .sharedFolderOnly: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_only") + return .dictionary(d) + case .noOne: + var d = [String: JSON]() + d[".tag"] = .str("no_one") + return .dictionary(d) + case .onlyYou: + var d = [String: JSON]() + d[".tag"] = .str("only_you") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AlphaResolvedVisibility { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "public": + return AlphaResolvedVisibility.public_ + case "team_only": + return AlphaResolvedVisibility.teamOnly + case "password": + return AlphaResolvedVisibility.password + case "team_and_password": + return AlphaResolvedVisibility.teamAndPassword + case "shared_folder_only": + return AlphaResolvedVisibility.sharedFolderOnly + case "no_one": + return AlphaResolvedVisibility.noOne + case "only_you": + return AlphaResolvedVisibility.onlyYou + case "other": + return AlphaResolvedVisibility.other + default: + throw JSONSerializerError.unknownTag(type: AlphaResolvedVisibility.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: AlphaResolvedVisibility.self, json: json) } } } /// Information about the content that has a link audience different than that of this folder. - open class AudienceExceptionContentInfo: CustomStringConvertible { + public class AudienceExceptionContentInfo: CustomStringConvertible, JSONRepresentable { /// The name of the content, which is either a file or a folder. public let name: String public init(name: String) { stringValidator()(name) self.name = name } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AudienceExceptionContentInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try AudienceExceptionContentInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AudienceExceptionContentInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AudienceExceptionContentInfo: \(error)" + } } } - open class AudienceExceptionContentInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AudienceExceptionContentInfo) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), + + public class AudienceExceptionContentInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AudienceExceptionContentInfo) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AudienceExceptionContentInfo { + + public func deserialize(_ json: JSON) throws -> AudienceExceptionContentInfo { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return AudienceExceptionContentInfo(name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return AudienceExceptionContentInfo(name: name) + default: + throw JSONSerializerError.deserializeError(type: AudienceExceptionContentInfo.self, json: json) } } } /// The total count and truncated list of information of content inside this folder that has a different audience /// than the link on this folder. This is only returned for folders. - open class AudienceExceptions: CustomStringConvertible { + public class AudienceExceptions: CustomStringConvertible, JSONRepresentable { /// (no description) public let count: UInt32 /// A truncated list of some of the content that is an exception. The length of this list could be smaller than /// the count since it is only a sample but will not be empty as long as count is not 0. - public let exceptions: Array - public init(count: UInt32, exceptions: Array) { + public let exceptions: [Sharing.AudienceExceptionContentInfo] + public init(count: UInt32, exceptions: [Sharing.AudienceExceptionContentInfo]) { comparableValidator()(count) self.count = count self.exceptions = exceptions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AudienceExceptionsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AudienceExceptionsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AudienceExceptionsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AudienceExceptions: \(error)" + } } } - open class AudienceExceptionsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AudienceExceptions) -> JSON { - let output = [ - "count": Serialization._UInt32Serializer.serialize(value.count), - "exceptions": ArraySerializer(Sharing.AudienceExceptionContentInfoSerializer()).serialize(value.exceptions), + + public class AudienceExceptionsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AudienceExceptions) throws -> JSON { + let output = [ + "count": try Serialization._UInt32Serializer.serialize(value.count), + "exceptions": try ArraySerializer(Sharing.AudienceExceptionContentInfoSerializer()).serialize(value.exceptions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AudienceExceptions { + + public func deserialize(_ json: JSON) throws -> AudienceExceptions { switch json { - case .dictionary(let dict): - let count = Serialization._UInt32Serializer.deserialize(dict["count"] ?? .null) - let exceptions = ArraySerializer(Sharing.AudienceExceptionContentInfoSerializer()).deserialize(dict["exceptions"] ?? .null) - return AudienceExceptions(count: count, exceptions: exceptions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let count = try Serialization._UInt32Serializer.deserialize(dict["count"] ?? .null) + let exceptions = try ArraySerializer(Sharing.AudienceExceptionContentInfoSerializer()).deserialize(dict["exceptions"] ?? .null) + return AudienceExceptions(count: count, exceptions: exceptions) + default: + throw JSONSerializerError.deserializeError(type: AudienceExceptions.self, json: json) } } } /// Information about the shared folder that prevents the link audience for this link from being more restrictive. - open class AudienceRestrictingSharedFolder: CustomStringConvertible { + public class AudienceRestrictingSharedFolder: CustomStringConvertible, JSONRepresentable { /// The ID of the shared folder. public let sharedFolderId: String /// The name of the shared folder. @@ -953,35 +1124,46 @@ open class Sharing { self.name = name self.audience = audience } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AudienceRestrictingSharedFolderSerializer().serialize(self)))" + + func json() throws -> JSON { + try AudienceRestrictingSharedFolderSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AudienceRestrictingSharedFolderSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AudienceRestrictingSharedFolder: \(error)" + } } } - open class AudienceRestrictingSharedFolderSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AudienceRestrictingSharedFolder) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "name": Serialization._StringSerializer.serialize(value.name), - "audience": Sharing.LinkAudienceSerializer().serialize(value.audience), + + public class AudienceRestrictingSharedFolderSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AudienceRestrictingSharedFolder) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "name": try Serialization._StringSerializer.serialize(value.name), + "audience": try Sharing.LinkAudienceSerializer().serialize(value.audience), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AudienceRestrictingSharedFolder { + + public func deserialize(_ json: JSON) throws -> AudienceRestrictingSharedFolder { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let audience = Sharing.LinkAudienceSerializer().deserialize(dict["audience"] ?? .null) - return AudienceRestrictingSharedFolder(sharedFolderId: sharedFolderId, name: name, audience: audience) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let audience = try Sharing.LinkAudienceSerializer().deserialize(dict["audience"] ?? .null) + return AudienceRestrictingSharedFolder(sharedFolderId: sharedFolderId, name: name, audience: audience) + default: + throw JSONSerializerError.deserializeError(type: AudienceRestrictingSharedFolder.self, json: json) } } } /// Metadata for a shared link. This can be either a PathLinkMetadata or CollectionLinkMetadata. - open class LinkMetadata: CustomStringConvertible { + public class LinkMetadata: CustomStringConvertible, JSONRepresentable { /// URL of the shared link. public let url: String /// Who can access the link. @@ -994,85 +1176,103 @@ open class Sharing { self.visibility = visibility self.expires = expires } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkMetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try LinkMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkMetadata: \(error)" + } } } - open class LinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkMetadata) -> JSON { - var output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "visibility": Sharing.VisibilitySerializer().serialize(value.visibility), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + + public class LinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkMetadata) throws -> JSON { + var output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "visibility": try Sharing.VisibilitySerializer().serialize(value.visibility), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), ] switch value { - case let path as Sharing.PathLinkMetadata: - for (k, v) in Serialization.getFields(Sharing.PathLinkMetadataSerializer().serialize(path)) { - output[k] = v - } - output[".tag"] = .str("path") - case let collection as Sharing.CollectionLinkMetadata: - for (k, v) in Serialization.getFields(Sharing.CollectionLinkMetadataSerializer().serialize(collection)) { - output[k] = v - } - output[".tag"] = .str("collection") - default: fatalError("Tried to serialize unexpected subtype") + case let path as Sharing.PathLinkMetadata: + for (k, v) in try Serialization.getFields(Sharing.PathLinkMetadataSerializer().serialize(path)) { + output[k] = v + } + output[".tag"] = .str("path") + case let collection as Sharing.CollectionLinkMetadata: + for (k, v) in try Serialization.getFields(Sharing.CollectionLinkMetadataSerializer().serialize(collection)) { + output[k] = v + } + output[".tag"] = .str("collection") + default: + throw JSONSerializerError.unexpectedSubtype(type: LinkMetadata.self, subtype: value) } return .dictionary(output) } - open func deserialize(_ json: JSON) -> LinkMetadata { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "path": - return Sharing.PathLinkMetadataSerializer().deserialize(json) - case "collection": - return Sharing.CollectionLinkMetadataSerializer().deserialize(json) - default: - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let visibility = Sharing.VisibilitySerializer().deserialize(dict["visibility"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - return LinkMetadata(url: url, visibility: visibility, expires: expires) - } + + public func deserialize(_ json: JSON) throws -> LinkMetadata { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "path": + return try Sharing.PathLinkMetadataSerializer().deserialize(json) + case "collection": + return try Sharing.CollectionLinkMetadataSerializer().deserialize(json) default: - fatalError("Type error deserializing") + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let visibility = try Sharing.VisibilitySerializer().deserialize(dict["visibility"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + return LinkMetadata(url: url, visibility: visibility, expires: expires) + } + default: + throw JSONSerializerError.deserializeError(type: LinkMetadata.self, json: json) } } } /// Metadata for a collection-based shared link. - open class CollectionLinkMetadata: Sharing.LinkMetadata { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CollectionLinkMetadataSerializer().serialize(self)))" - } - } - open class CollectionLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CollectionLinkMetadata) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "visibility": Sharing.VisibilitySerializer().serialize(value.visibility), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + public class CollectionLinkMetadata: Sharing.LinkMetadata { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CollectionLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CollectionLinkMetadata: \(error)" + } + } + } + + public class CollectionLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CollectionLinkMetadata) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "visibility": try Sharing.VisibilitySerializer().serialize(value.visibility), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CollectionLinkMetadata { + + public func deserialize(_ json: JSON) throws -> CollectionLinkMetadata { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let visibility = Sharing.VisibilitySerializer().deserialize(dict["visibility"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - return CollectionLinkMetadata(url: url, visibility: visibility, expires: expires) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let visibility = try Sharing.VisibilitySerializer().deserialize(dict["visibility"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + return CollectionLinkMetadata(url: url, visibility: visibility, expires: expires) + default: + throw JSONSerializerError.deserializeError(type: CollectionLinkMetadata.self, json: json) } } } /// The CreateSharedLinkArg struct - open class CreateSharedLinkArg: CustomStringConvertible { + public class CreateSharedLinkArg: CustomStringConvertible, JSONRepresentable { /// The path to share. public let path: String /// (no description) @@ -1086,79 +1286,100 @@ open class Sharing { self.shortUrl = shortUrl self.pendingUpload = pendingUpload } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateSharedLinkArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateSharedLinkArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateSharedLinkArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateSharedLinkArg: \(error)" + } } } - open class CreateSharedLinkArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateSharedLinkArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "short_url": Serialization._BoolSerializer.serialize(value.shortUrl), - "pending_upload": NullableSerializer(Sharing.PendingUploadModeSerializer()).serialize(value.pendingUpload), + + public class CreateSharedLinkArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateSharedLinkArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "short_url": try Serialization._BoolSerializer.serialize(value.shortUrl), + "pending_upload": try NullableSerializer(Sharing.PendingUploadModeSerializer()).serialize(value.pendingUpload), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateSharedLinkArg { + + public func deserialize(_ json: JSON) throws -> CreateSharedLinkArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let shortUrl = Serialization._BoolSerializer.deserialize(dict["short_url"] ?? .number(0)) - let pendingUpload = NullableSerializer(Sharing.PendingUploadModeSerializer()).deserialize(dict["pending_upload"] ?? .null) - return CreateSharedLinkArg(path: path, shortUrl: shortUrl, pendingUpload: pendingUpload) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let shortUrl = try Serialization._BoolSerializer.deserialize(dict["short_url"] ?? .number(0)) + let pendingUpload = try NullableSerializer(Sharing.PendingUploadModeSerializer()).deserialize(dict["pending_upload"] ?? .null) + return CreateSharedLinkArg(path: path, shortUrl: shortUrl, pendingUpload: pendingUpload) + default: + throw JSONSerializerError.deserializeError(type: CreateSharedLinkArg.self, json: json) } } } /// The CreateSharedLinkError union - public enum CreateSharedLinkError: CustomStringConvertible { + public enum CreateSharedLinkError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// An unspecified error. case other + func json() throws -> JSON { + try CreateSharedLinkErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateSharedLinkErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateSharedLinkErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateSharedLinkError: \(error)" + } } } - open class CreateSharedLinkErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateSharedLinkError) -> JSON { + + public class CreateSharedLinkErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateSharedLinkError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateSharedLinkError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return CreateSharedLinkError.path(v) - case "other": - return CreateSharedLinkError.other - default: - return CreateSharedLinkError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CreateSharedLinkError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return CreateSharedLinkError.path(v) + case "other": + return CreateSharedLinkError.other default: - fatalError("Failed to deserialize") + return CreateSharedLinkError.other + } + default: + throw JSONSerializerError.deserializeError(type: CreateSharedLinkError.self, json: json) } } } /// The CreateSharedLinkWithSettingsArg struct - open class CreateSharedLinkWithSettingsArg: CustomStringConvertible { + public class CreateSharedLinkWithSettingsArg: CustomStringConvertible, JSONRepresentable { /// The path to be shared by the shared link. public let path: String /// The requested settings for the newly created shared link. @@ -1168,33 +1389,44 @@ open class Sharing { self.path = path self.settings = settings } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateSharedLinkWithSettingsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateSharedLinkWithSettingsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateSharedLinkWithSettingsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateSharedLinkWithSettingsArg: \(error)" + } } } - open class CreateSharedLinkWithSettingsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateSharedLinkWithSettingsArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "settings": NullableSerializer(Sharing.SharedLinkSettingsSerializer()).serialize(value.settings), + + public class CreateSharedLinkWithSettingsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateSharedLinkWithSettingsArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "settings": try NullableSerializer(Sharing.SharedLinkSettingsSerializer()).serialize(value.settings), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateSharedLinkWithSettingsArg { + + public func deserialize(_ json: JSON) throws -> CreateSharedLinkWithSettingsArg { switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let settings = NullableSerializer(Sharing.SharedLinkSettingsSerializer()).deserialize(dict["settings"] ?? .null) - return CreateSharedLinkWithSettingsArg(path: path, settings: settings) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let settings = try NullableSerializer(Sharing.SharedLinkSettingsSerializer()).deserialize(dict["settings"] ?? .null) + return CreateSharedLinkWithSettingsArg(path: path, settings: settings) + default: + throw JSONSerializerError.deserializeError(type: CreateSharedLinkWithSettingsArg.self, json: json) } } } /// The CreateSharedLinkWithSettingsError union - public enum CreateSharedLinkWithSettingsError: CustomStringConvertible { + public enum CreateSharedLinkWithSettingsError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// This user's email address is not verified. This functionality is only available on accounts with a verified @@ -1210,71 +1442,82 @@ open class Sharing { /// https://help.dropbox.com/files-folders/share/banned-links. case accessDenied + func json() throws -> JSON { + try CreateSharedLinkWithSettingsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateSharedLinkWithSettingsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateSharedLinkWithSettingsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateSharedLinkWithSettingsError: \(error)" + } } } - open class CreateSharedLinkWithSettingsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateSharedLinkWithSettingsError) -> JSON { + + public class CreateSharedLinkWithSettingsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateSharedLinkWithSettingsError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .emailNotVerified: - var d = [String: JSON]() - d[".tag"] = .str("email_not_verified") - return .dictionary(d) - case .sharedLinkAlreadyExists(let arg): - var d = ["shared_link_already_exists": NullableSerializer(Sharing.SharedLinkAlreadyExistsMetadataSerializer()).serialize(arg)] - d[".tag"] = .str("shared_link_already_exists") - return .dictionary(d) - case .settingsError(let arg): - var d = ["settings_error": Sharing.SharedLinkSettingsErrorSerializer().serialize(arg)] - d[".tag"] = .str("settings_error") - return .dictionary(d) - case .accessDenied: - var d = [String: JSON]() - d[".tag"] = .str("access_denied") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CreateSharedLinkWithSettingsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return CreateSharedLinkWithSettingsError.path(v) - case "email_not_verified": - return CreateSharedLinkWithSettingsError.emailNotVerified - case "shared_link_already_exists": - let v = NullableSerializer(Sharing.SharedLinkAlreadyExistsMetadataSerializer()).deserialize(d["shared_link_already_exists"] ?? .null) - return CreateSharedLinkWithSettingsError.sharedLinkAlreadyExists(v) - case "settings_error": - let v = Sharing.SharedLinkSettingsErrorSerializer().deserialize(d["settings_error"] ?? .null) - return CreateSharedLinkWithSettingsError.settingsError(v) - case "access_denied": - return CreateSharedLinkWithSettingsError.accessDenied - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .emailNotVerified: + var d = [String: JSON]() + d[".tag"] = .str("email_not_verified") + return .dictionary(d) + case .sharedLinkAlreadyExists(let arg): + var d = try ["shared_link_already_exists": NullableSerializer(Sharing.SharedLinkAlreadyExistsMetadataSerializer()).serialize(arg)] + d[".tag"] = .str("shared_link_already_exists") + return .dictionary(d) + case .settingsError(let arg): + var d = try ["settings_error": Sharing.SharedLinkSettingsErrorSerializer().serialize(arg)] + d[".tag"] = .str("settings_error") + return .dictionary(d) + case .accessDenied: + var d = [String: JSON]() + d[".tag"] = .str("access_denied") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CreateSharedLinkWithSettingsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return CreateSharedLinkWithSettingsError.path(v) + case "email_not_verified": + return CreateSharedLinkWithSettingsError.emailNotVerified + case "shared_link_already_exists": + let v = try NullableSerializer(Sharing.SharedLinkAlreadyExistsMetadataSerializer()) + .deserialize(d["shared_link_already_exists"] ?? .null) + return CreateSharedLinkWithSettingsError.sharedLinkAlreadyExists(v) + case "settings_error": + let v = try Sharing.SharedLinkSettingsErrorSerializer().deserialize(d["settings_error"] ?? .null) + return CreateSharedLinkWithSettingsError.settingsError(v) + case "access_denied": + return CreateSharedLinkWithSettingsError.accessDenied + default: + throw JSONSerializerError.unknownTag(type: CreateSharedLinkWithSettingsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: CreateSharedLinkWithSettingsError.self, json: json) } } } /// The SharedContentLinkMetadataBase struct - open class SharedContentLinkMetadataBase: CustomStringConvertible { + public class SharedContentLinkMetadataBase: CustomStringConvertible, JSONRepresentable { /// The access level on the link for this file. public let accessLevel: Sharing.AccessLevel? /// The audience options that are available for the content. Some audience options may be unavailable. For /// example, team_only may be unavailable if the content is not owned by a user on a team. The 'default' /// audience option is always available if the user can modify link settings. - public let audienceOptions: Array + public let audienceOptions: [Sharing.LinkAudience] /// The shared folder that prevents the link audience for this link from being more restrictive. public let audienceRestrictingSharedFolder: Sharing.AudienceRestrictingSharedFolder? /// The current audience of the link. @@ -1283,10 +1526,18 @@ open class Sharing { /// when the expiry is reached. public let expiry: Date? /// A list of permissions for actions you can perform on the link. - public let linkPermissions: Array + public let linkPermissions: [Sharing.LinkPermission] /// Whether the link is protected by a password. public let passwordProtected: Bool - public init(audienceOptions: Array, currentAudience: Sharing.LinkAudience, linkPermissions: Array, passwordProtected: Bool, accessLevel: Sharing.AccessLevel? = nil, audienceRestrictingSharedFolder: Sharing.AudienceRestrictingSharedFolder? = nil, expiry: Date? = nil) { + public init( + audienceOptions: [Sharing.LinkAudience], + currentAudience: Sharing.LinkAudience, + linkPermissions: [Sharing.LinkPermission], + passwordProtected: Bool, + accessLevel: Sharing.AccessLevel? = nil, + audienceRestrictingSharedFolder: Sharing.AudienceRestrictingSharedFolder? = nil, + expiry: Date? = nil + ) { self.accessLevel = accessLevel self.audienceOptions = audienceOptions self.audienceRestrictingSharedFolder = audienceRestrictingSharedFolder @@ -1295,81 +1546,118 @@ open class Sharing { self.linkPermissions = linkPermissions self.passwordProtected = passwordProtected } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentLinkMetadataBaseSerializer().serialize(self)))" - } - } - open class SharedContentLinkMetadataBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentLinkMetadataBase) -> JSON { - let output = [ - "audience_options": ArraySerializer(Sharing.LinkAudienceSerializer()).serialize(value.audienceOptions), - "current_audience": Sharing.LinkAudienceSerializer().serialize(value.currentAudience), - "link_permissions": ArraySerializer(Sharing.LinkPermissionSerializer()).serialize(value.linkPermissions), - "password_protected": Serialization._BoolSerializer.serialize(value.passwordProtected), - "access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), - "audience_restricting_shared_folder": NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()).serialize(value.audienceRestrictingSharedFolder), - "expiry": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiry), + + func json() throws -> JSON { + try SharedContentLinkMetadataBaseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentLinkMetadataBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentLinkMetadataBase: \(error)" + } + } + } + + public class SharedContentLinkMetadataBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentLinkMetadataBase) throws -> JSON { + let output = [ + "audience_options": try ArraySerializer(Sharing.LinkAudienceSerializer()).serialize(value.audienceOptions), + "current_audience": try Sharing.LinkAudienceSerializer().serialize(value.currentAudience), + "link_permissions": try ArraySerializer(Sharing.LinkPermissionSerializer()).serialize(value.linkPermissions), + "password_protected": try Serialization._BoolSerializer.serialize(value.passwordProtected), + "access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), + "audience_restricting_shared_folder": try NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()) + .serialize(value.audienceRestrictingSharedFolder), + "expiry": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiry), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentLinkMetadataBase { - switch json { - case .dictionary(let dict): - let audienceOptions = ArraySerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience_options"] ?? .null) - let currentAudience = Sharing.LinkAudienceSerializer().deserialize(dict["current_audience"] ?? .null) - let linkPermissions = ArraySerializer(Sharing.LinkPermissionSerializer()).deserialize(dict["link_permissions"] ?? .null) - let passwordProtected = Serialization._BoolSerializer.deserialize(dict["password_protected"] ?? .null) - let accessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) - let audienceRestrictingSharedFolder = NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()).deserialize(dict["audience_restricting_shared_folder"] ?? .null) - let expiry = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiry"] ?? .null) - return SharedContentLinkMetadataBase(audienceOptions: audienceOptions, currentAudience: currentAudience, linkPermissions: linkPermissions, passwordProtected: passwordProtected, accessLevel: accessLevel, audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, expiry: expiry) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SharedContentLinkMetadataBase { + switch json { + case .dictionary(let dict): + let audienceOptions = try ArraySerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience_options"] ?? .null) + let currentAudience = try Sharing.LinkAudienceSerializer().deserialize(dict["current_audience"] ?? .null) + let linkPermissions = try ArraySerializer(Sharing.LinkPermissionSerializer()).deserialize(dict["link_permissions"] ?? .null) + let passwordProtected = try Serialization._BoolSerializer.deserialize(dict["password_protected"] ?? .null) + let accessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) + let audienceRestrictingSharedFolder = try NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()) + .deserialize(dict["audience_restricting_shared_folder"] ?? .null) + let expiry = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiry"] ?? .null) + return SharedContentLinkMetadataBase( + audienceOptions: audienceOptions, + currentAudience: currentAudience, + linkPermissions: linkPermissions, + passwordProtected: passwordProtected, + accessLevel: accessLevel, + audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, + expiry: expiry + ) + default: + throw JSONSerializerError.deserializeError(type: SharedContentLinkMetadataBase.self, json: json) } } } /// The expected metadata of a shared link for a file or folder when a link is first created for the content. Absent /// if the link already exists. - open class ExpectedSharedContentLinkMetadata: Sharing.SharedContentLinkMetadataBase { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExpectedSharedContentLinkMetadataSerializer().serialize(self)))" - } - } - open class ExpectedSharedContentLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExpectedSharedContentLinkMetadata) -> JSON { - let output = [ - "audience_options": ArraySerializer(Sharing.LinkAudienceSerializer()).serialize(value.audienceOptions), - "current_audience": Sharing.LinkAudienceSerializer().serialize(value.currentAudience), - "link_permissions": ArraySerializer(Sharing.LinkPermissionSerializer()).serialize(value.linkPermissions), - "password_protected": Serialization._BoolSerializer.serialize(value.passwordProtected), - "access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), - "audience_restricting_shared_folder": NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()).serialize(value.audienceRestrictingSharedFolder), - "expiry": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiry), + public class ExpectedSharedContentLinkMetadata: Sharing.SharedContentLinkMetadataBase { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExpectedSharedContentLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExpectedSharedContentLinkMetadata: \(error)" + } + } + } + + public class ExpectedSharedContentLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExpectedSharedContentLinkMetadata) throws -> JSON { + let output = [ + "audience_options": try ArraySerializer(Sharing.LinkAudienceSerializer()).serialize(value.audienceOptions), + "current_audience": try Sharing.LinkAudienceSerializer().serialize(value.currentAudience), + "link_permissions": try ArraySerializer(Sharing.LinkPermissionSerializer()).serialize(value.linkPermissions), + "password_protected": try Serialization._BoolSerializer.serialize(value.passwordProtected), + "access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), + "audience_restricting_shared_folder": try NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()) + .serialize(value.audienceRestrictingSharedFolder), + "expiry": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiry), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExpectedSharedContentLinkMetadata { - switch json { - case .dictionary(let dict): - let audienceOptions = ArraySerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience_options"] ?? .null) - let currentAudience = Sharing.LinkAudienceSerializer().deserialize(dict["current_audience"] ?? .null) - let linkPermissions = ArraySerializer(Sharing.LinkPermissionSerializer()).deserialize(dict["link_permissions"] ?? .null) - let passwordProtected = Serialization._BoolSerializer.deserialize(dict["password_protected"] ?? .null) - let accessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) - let audienceRestrictingSharedFolder = NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()).deserialize(dict["audience_restricting_shared_folder"] ?? .null) - let expiry = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiry"] ?? .null) - return ExpectedSharedContentLinkMetadata(audienceOptions: audienceOptions, currentAudience: currentAudience, linkPermissions: linkPermissions, passwordProtected: passwordProtected, accessLevel: accessLevel, audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, expiry: expiry) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> ExpectedSharedContentLinkMetadata { + switch json { + case .dictionary(let dict): + let audienceOptions = try ArraySerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience_options"] ?? .null) + let currentAudience = try Sharing.LinkAudienceSerializer().deserialize(dict["current_audience"] ?? .null) + let linkPermissions = try ArraySerializer(Sharing.LinkPermissionSerializer()).deserialize(dict["link_permissions"] ?? .null) + let passwordProtected = try Serialization._BoolSerializer.deserialize(dict["password_protected"] ?? .null) + let accessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) + let audienceRestrictingSharedFolder = try NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()) + .deserialize(dict["audience_restricting_shared_folder"] ?? .null) + let expiry = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiry"] ?? .null) + return ExpectedSharedContentLinkMetadata( + audienceOptions: audienceOptions, + currentAudience: currentAudience, + linkPermissions: linkPermissions, + passwordProtected: passwordProtected, + accessLevel: accessLevel, + audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, + expiry: expiry + ) + default: + throw JSONSerializerError.deserializeError(type: ExpectedSharedContentLinkMetadata.self, json: json) } } } /// Sharing actions that may be taken on files. - public enum FileAction: CustomStringConvertible { + public enum FileAction: CustomStringConvertible, JSONRepresentable { /// Disable viewer information on the file. case disableViewerInfo /// Change or edit contents of the file. @@ -1397,110 +1685,120 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try FileActionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileActionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileActionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileAction: \(error)" + } } } - open class FileActionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileAction) -> JSON { + + public class FileActionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileAction) throws -> JSON { switch value { - case .disableViewerInfo: - var d = [String: JSON]() - d[".tag"] = .str("disable_viewer_info") - return .dictionary(d) - case .editContents: - var d = [String: JSON]() - d[".tag"] = .str("edit_contents") - return .dictionary(d) - case .enableViewerInfo: - var d = [String: JSON]() - d[".tag"] = .str("enable_viewer_info") - return .dictionary(d) - case .inviteViewer: - var d = [String: JSON]() - d[".tag"] = .str("invite_viewer") - return .dictionary(d) - case .inviteViewerNoComment: - var d = [String: JSON]() - d[".tag"] = .str("invite_viewer_no_comment") - return .dictionary(d) - case .inviteEditor: - var d = [String: JSON]() - d[".tag"] = .str("invite_editor") - return .dictionary(d) - case .unshare: - var d = [String: JSON]() - d[".tag"] = .str("unshare") - return .dictionary(d) - case .relinquishMembership: - var d = [String: JSON]() - d[".tag"] = .str("relinquish_membership") - return .dictionary(d) - case .shareLink: - var d = [String: JSON]() - d[".tag"] = .str("share_link") - return .dictionary(d) - case .createLink: - var d = [String: JSON]() - d[".tag"] = .str("create_link") - return .dictionary(d) - case .createViewLink: - var d = [String: JSON]() - d[".tag"] = .str("create_view_link") - return .dictionary(d) - case .createEditLink: - var d = [String: JSON]() - d[".tag"] = .str("create_edit_link") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileAction { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disable_viewer_info": - return FileAction.disableViewerInfo - case "edit_contents": - return FileAction.editContents - case "enable_viewer_info": - return FileAction.enableViewerInfo - case "invite_viewer": - return FileAction.inviteViewer - case "invite_viewer_no_comment": - return FileAction.inviteViewerNoComment - case "invite_editor": - return FileAction.inviteEditor - case "unshare": - return FileAction.unshare - case "relinquish_membership": - return FileAction.relinquishMembership - case "share_link": - return FileAction.shareLink - case "create_link": - return FileAction.createLink - case "create_view_link": - return FileAction.createViewLink - case "create_edit_link": - return FileAction.createEditLink - case "other": - return FileAction.other - default: - return FileAction.other - } - default: - fatalError("Failed to deserialize") + case .disableViewerInfo: + var d = [String: JSON]() + d[".tag"] = .str("disable_viewer_info") + return .dictionary(d) + case .editContents: + var d = [String: JSON]() + d[".tag"] = .str("edit_contents") + return .dictionary(d) + case .enableViewerInfo: + var d = [String: JSON]() + d[".tag"] = .str("enable_viewer_info") + return .dictionary(d) + case .inviteViewer: + var d = [String: JSON]() + d[".tag"] = .str("invite_viewer") + return .dictionary(d) + case .inviteViewerNoComment: + var d = [String: JSON]() + d[".tag"] = .str("invite_viewer_no_comment") + return .dictionary(d) + case .inviteEditor: + var d = [String: JSON]() + d[".tag"] = .str("invite_editor") + return .dictionary(d) + case .unshare: + var d = [String: JSON]() + d[".tag"] = .str("unshare") + return .dictionary(d) + case .relinquishMembership: + var d = [String: JSON]() + d[".tag"] = .str("relinquish_membership") + return .dictionary(d) + case .shareLink: + var d = [String: JSON]() + d[".tag"] = .str("share_link") + return .dictionary(d) + case .createLink: + var d = [String: JSON]() + d[".tag"] = .str("create_link") + return .dictionary(d) + case .createViewLink: + var d = [String: JSON]() + d[".tag"] = .str("create_view_link") + return .dictionary(d) + case .createEditLink: + var d = [String: JSON]() + d[".tag"] = .str("create_edit_link") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileAction { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disable_viewer_info": + return FileAction.disableViewerInfo + case "edit_contents": + return FileAction.editContents + case "enable_viewer_info": + return FileAction.enableViewerInfo + case "invite_viewer": + return FileAction.inviteViewer + case "invite_viewer_no_comment": + return FileAction.inviteViewerNoComment + case "invite_editor": + return FileAction.inviteEditor + case "unshare": + return FileAction.unshare + case "relinquish_membership": + return FileAction.relinquishMembership + case "share_link": + return FileAction.shareLink + case "create_link": + return FileAction.createLink + case "create_view_link": + return FileAction.createViewLink + case "create_edit_link": + return FileAction.createEditLink + case "other": + return FileAction.other + default: + return FileAction.other + } + default: + throw JSONSerializerError.deserializeError(type: FileAction.self, json: json) } } } /// The FileErrorResult union - public enum FileErrorResult: CustomStringConvertible { + public enum FileErrorResult: CustomStringConvertible, JSONRepresentable { /// File specified by id was not found. case fileNotFoundError(String) /// User does not have permission to take the specified action on the file. @@ -1510,59 +1808,69 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try FileErrorResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileErrorResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileErrorResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileErrorResult: \(error)" + } } } - open class FileErrorResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileErrorResult) -> JSON { + + public class FileErrorResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileErrorResult) throws -> JSON { switch value { - case .fileNotFoundError(let arg): - var d = ["file_not_found_error": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("file_not_found_error") - return .dictionary(d) - case .invalidFileActionError(let arg): - var d = ["invalid_file_action_error": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("invalid_file_action_error") - return .dictionary(d) - case .permissionDeniedError(let arg): - var d = ["permission_denied_error": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("permission_denied_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileErrorResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "file_not_found_error": - let v = Serialization._StringSerializer.deserialize(d["file_not_found_error"] ?? .null) - return FileErrorResult.fileNotFoundError(v) - case "invalid_file_action_error": - let v = Serialization._StringSerializer.deserialize(d["invalid_file_action_error"] ?? .null) - return FileErrorResult.invalidFileActionError(v) - case "permission_denied_error": - let v = Serialization._StringSerializer.deserialize(d["permission_denied_error"] ?? .null) - return FileErrorResult.permissionDeniedError(v) - case "other": - return FileErrorResult.other - default: - return FileErrorResult.other - } - default: - fatalError("Failed to deserialize") + case .fileNotFoundError(let arg): + var d = try ["file_not_found_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("file_not_found_error") + return .dictionary(d) + case .invalidFileActionError(let arg): + var d = try ["invalid_file_action_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("invalid_file_action_error") + return .dictionary(d) + case .permissionDeniedError(let arg): + var d = try ["permission_denied_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("permission_denied_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileErrorResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "file_not_found_error": + let v = try Serialization._StringSerializer.deserialize(d["file_not_found_error"] ?? .null) + return FileErrorResult.fileNotFoundError(v) + case "invalid_file_action_error": + let v = try Serialization._StringSerializer.deserialize(d["invalid_file_action_error"] ?? .null) + return FileErrorResult.invalidFileActionError(v) + case "permission_denied_error": + let v = try Serialization._StringSerializer.deserialize(d["permission_denied_error"] ?? .null) + return FileErrorResult.permissionDeniedError(v) + case "other": + return FileErrorResult.other + default: + return FileErrorResult.other + } + default: + throw JSONSerializerError.deserializeError(type: FileErrorResult.self, json: json) } } } /// The metadata of a shared link. - open class SharedLinkMetadata: CustomStringConvertible { + public class SharedLinkMetadata: CustomStringConvertible, JSONRepresentable { /// URL of the shared link. public let url: String /// A unique identifier for the linked file. @@ -1582,7 +1890,16 @@ open class Sharing { /// The team information of the content's owner. This field will only be present if the content's owner is a /// team member and the content's owner team is different from the link's owner team. public let contentOwnerTeamInfo: Users.Team? - public init(url: String, name: String, linkPermissions: Sharing.LinkPermissions, id: String? = nil, expires: Date? = nil, pathLower: String? = nil, teamMemberInfo: Sharing.TeamMemberInfo? = nil, contentOwnerTeamInfo: Users.Team? = nil) { + public init( + url: String, + name: String, + linkPermissions: Sharing.LinkPermissions, + id: String? = nil, + expires: Date? = nil, + pathLower: String? = nil, + teamMemberInfo: Sharing.TeamMemberInfo? = nil, + contentOwnerTeamInfo: Users.Team? = nil + ) { stringValidator()(url) self.url = url nullableValidator(stringValidator(minLength: 1))(id) @@ -1596,69 +1913,91 @@ open class Sharing { self.teamMemberInfo = teamMemberInfo self.contentOwnerTeamInfo = contentOwnerTeamInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkMetadataSerializer().serialize(self)))" - } - } - open class SharedLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkMetadata) -> JSON { - var output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "name": Serialization._StringSerializer.serialize(value.name), - "link_permissions": Sharing.LinkPermissionsSerializer().serialize(value.linkPermissions), - "id": NullableSerializer(Serialization._StringSerializer).serialize(value.id), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "team_member_info": NullableSerializer(Sharing.TeamMemberInfoSerializer()).serialize(value.teamMemberInfo), - "content_owner_team_info": NullableSerializer(Users.TeamSerializer()).serialize(value.contentOwnerTeamInfo), + + func json() throws -> JSON { + try SharedLinkMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkMetadata: \(error)" + } + } + } + + public class SharedLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkMetadata) throws -> JSON { + var output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "name": try Serialization._StringSerializer.serialize(value.name), + "link_permissions": try Sharing.LinkPermissionsSerializer().serialize(value.linkPermissions), + "id": try NullableSerializer(Serialization._StringSerializer).serialize(value.id), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "team_member_info": try NullableSerializer(Sharing.TeamMemberInfoSerializer()).serialize(value.teamMemberInfo), + "content_owner_team_info": try NullableSerializer(Users.TeamSerializer()).serialize(value.contentOwnerTeamInfo), ] switch value { - case let file as Sharing.FileLinkMetadata: - for (k, v) in Serialization.getFields(Sharing.FileLinkMetadataSerializer().serialize(file)) { - output[k] = v - } - output[".tag"] = .str("file") - case let folder as Sharing.FolderLinkMetadata: - for (k, v) in Serialization.getFields(Sharing.FolderLinkMetadataSerializer().serialize(folder)) { - output[k] = v - } - output[".tag"] = .str("folder") - default: fatalError("Tried to serialize unexpected subtype") + case let file as Sharing.FileLinkMetadata: + for (k, v) in try Serialization.getFields(Sharing.FileLinkMetadataSerializer().serialize(file)) { + output[k] = v + } + output[".tag"] = .str("file") + case let folder as Sharing.FolderLinkMetadata: + for (k, v) in try Serialization.getFields(Sharing.FolderLinkMetadataSerializer().serialize(folder)) { + output[k] = v + } + output[".tag"] = .str("folder") + default: + throw JSONSerializerError.unexpectedSubtype(type: SharedLinkMetadata.self, subtype: value) } return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkMetadata { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "file": - return Sharing.FileLinkMetadataSerializer().deserialize(json) - case "folder": - return Sharing.FolderLinkMetadataSerializer().deserialize(json) - default: - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let linkPermissions = Sharing.LinkPermissionsSerializer().deserialize(dict["link_permissions"] ?? .null) - let id = NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let teamMemberInfo = NullableSerializer(Sharing.TeamMemberInfoSerializer()).deserialize(dict["team_member_info"] ?? .null) - let contentOwnerTeamInfo = NullableSerializer(Users.TeamSerializer()).deserialize(dict["content_owner_team_info"] ?? .null) - return SharedLinkMetadata(url: url, name: name, linkPermissions: linkPermissions, id: id, expires: expires, pathLower: pathLower, teamMemberInfo: teamMemberInfo, contentOwnerTeamInfo: contentOwnerTeamInfo) - } - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SharedLinkMetadata { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "file": + return try Sharing.FileLinkMetadataSerializer().deserialize(json) + case "folder": + return try Sharing.FolderLinkMetadataSerializer().deserialize(json) + default: + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let linkPermissions = try Sharing.LinkPermissionsSerializer().deserialize(dict["link_permissions"] ?? .null) + let id = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let teamMemberInfo = try NullableSerializer(Sharing.TeamMemberInfoSerializer()).deserialize(dict["team_member_info"] ?? .null) + let contentOwnerTeamInfo = try NullableSerializer(Users.TeamSerializer()).deserialize(dict["content_owner_team_info"] ?? .null) + return SharedLinkMetadata( + url: url, + name: name, + linkPermissions: linkPermissions, + id: id, + expires: expires, + pathLower: pathLower, + teamMemberInfo: teamMemberInfo, + contentOwnerTeamInfo: contentOwnerTeamInfo + ) + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkMetadata.self, json: json) } } } /// The metadata of a file shared link. - open class FileLinkMetadata: Sharing.SharedLinkMetadata { + public class FileLinkMetadata: Sharing.SharedLinkMetadata { /// The modification time set by the desktop client when the file was added to Dropbox. Since this time is not - /// verified (the Dropbox server stores whatever the desktop client sends up), this should only be used for - /// display purposes (such as sorting) and not, for example, to determine if a file has changed or not. + /// verified (the Dropbox server stores whatever the desktop client sends up), this should only be used + /// for display purposes (such as sorting) and not, for example, to determine if a file has changed or + /// not. public let clientModified: Date /// The last time the file was modified on Dropbox. public let serverModified: Date @@ -1667,62 +2006,104 @@ open class Sharing { public let rev: String /// The file size in bytes. public let size: UInt64 - public init(url: String, name: String, linkPermissions: Sharing.LinkPermissions, clientModified: Date, serverModified: Date, rev: String, size: UInt64, id: String? = nil, expires: Date? = nil, pathLower: String? = nil, teamMemberInfo: Sharing.TeamMemberInfo? = nil, contentOwnerTeamInfo: Users.Team? = nil) { + public init( + url: String, + name: String, + linkPermissions: Sharing.LinkPermissions, + clientModified: Date, + serverModified: Date, + rev: String, + size: UInt64, + id: String? = nil, + expires: Date? = nil, + pathLower: String? = nil, + teamMemberInfo: Sharing.TeamMemberInfo? = nil, + contentOwnerTeamInfo: Users.Team? = nil + ) { self.clientModified = clientModified self.serverModified = serverModified stringValidator(minLength: 9, pattern: "[0-9a-f]+")(rev) self.rev = rev comparableValidator()(size) self.size = size - super.init(url: url, name: name, linkPermissions: linkPermissions, id: id, expires: expires, pathLower: pathLower, teamMemberInfo: teamMemberInfo, contentOwnerTeamInfo: contentOwnerTeamInfo) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLinkMetadataSerializer().serialize(self)))" - } - } - open class FileLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLinkMetadata) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "name": Serialization._StringSerializer.serialize(value.name), - "link_permissions": Sharing.LinkPermissionsSerializer().serialize(value.linkPermissions), - "client_modified": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.clientModified), - "server_modified": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.serverModified), - "rev": Serialization._StringSerializer.serialize(value.rev), - "size": Serialization._UInt64Serializer.serialize(value.size), - "id": NullableSerializer(Serialization._StringSerializer).serialize(value.id), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "team_member_info": NullableSerializer(Sharing.TeamMemberInfoSerializer()).serialize(value.teamMemberInfo), - "content_owner_team_info": NullableSerializer(Users.TeamSerializer()).serialize(value.contentOwnerTeamInfo), + super.init( + url: url, + name: name, + linkPermissions: linkPermissions, + id: id, + expires: expires, + pathLower: pathLower, + teamMemberInfo: teamMemberInfo, + contentOwnerTeamInfo: contentOwnerTeamInfo + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLinkMetadata: \(error)" + } + } + } + + public class FileLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLinkMetadata) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "name": try Serialization._StringSerializer.serialize(value.name), + "link_permissions": try Sharing.LinkPermissionsSerializer().serialize(value.linkPermissions), + "client_modified": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.clientModified), + "server_modified": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.serverModified), + "rev": try Serialization._StringSerializer.serialize(value.rev), + "size": try Serialization._UInt64Serializer.serialize(value.size), + "id": try NullableSerializer(Serialization._StringSerializer).serialize(value.id), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "team_member_info": try NullableSerializer(Sharing.TeamMemberInfoSerializer()).serialize(value.teamMemberInfo), + "content_owner_team_info": try NullableSerializer(Users.TeamSerializer()).serialize(value.contentOwnerTeamInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLinkMetadata { - switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let linkPermissions = Sharing.LinkPermissionsSerializer().deserialize(dict["link_permissions"] ?? .null) - let clientModified = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["client_modified"] ?? .null) - let serverModified = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["server_modified"] ?? .null) - let rev = Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) - let size = Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) - let id = NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let teamMemberInfo = NullableSerializer(Sharing.TeamMemberInfoSerializer()).deserialize(dict["team_member_info"] ?? .null) - let contentOwnerTeamInfo = NullableSerializer(Users.TeamSerializer()).deserialize(dict["content_owner_team_info"] ?? .null) - return FileLinkMetadata(url: url, name: name, linkPermissions: linkPermissions, clientModified: clientModified, serverModified: serverModified, rev: rev, size: size, id: id, expires: expires, pathLower: pathLower, teamMemberInfo: teamMemberInfo, contentOwnerTeamInfo: contentOwnerTeamInfo) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> FileLinkMetadata { + switch json { + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let linkPermissions = try Sharing.LinkPermissionsSerializer().deserialize(dict["link_permissions"] ?? .null) + let clientModified = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["client_modified"] ?? .null) + let serverModified = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["server_modified"] ?? .null) + let rev = try Serialization._StringSerializer.deserialize(dict["rev"] ?? .null) + let size = try Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) + let id = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let teamMemberInfo = try NullableSerializer(Sharing.TeamMemberInfoSerializer()).deserialize(dict["team_member_info"] ?? .null) + let contentOwnerTeamInfo = try NullableSerializer(Users.TeamSerializer()).deserialize(dict["content_owner_team_info"] ?? .null) + return FileLinkMetadata( + url: url, + name: name, + linkPermissions: linkPermissions, + clientModified: clientModified, + serverModified: serverModified, + rev: rev, + size: size, + id: id, + expires: expires, + pathLower: pathLower, + teamMemberInfo: teamMemberInfo, + contentOwnerTeamInfo: contentOwnerTeamInfo + ) + default: + throw JSONSerializerError.deserializeError(type: FileLinkMetadata.self, json: json) } } } /// The FileMemberActionError union - public enum FileMemberActionError: CustomStringConvertible { + public enum FileMemberActionError: CustomStringConvertible, JSONRepresentable { /// Specified member was not found. case invalidMember /// User does not have permission to perform this action on this member. @@ -1735,112 +2116,132 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try FileMemberActionErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileMemberActionErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileMemberActionErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileMemberActionError: \(error)" + } } } - open class FileMemberActionErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileMemberActionError) -> JSON { + + public class FileMemberActionErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileMemberActionError) throws -> JSON { switch value { - case .invalidMember: - var d = [String: JSON]() - d[".tag"] = .str("invalid_member") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .noExplicitAccess(let arg): - var d = Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) - d[".tag"] = .str("no_explicit_access") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileMemberActionError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_member": - return FileMemberActionError.invalidMember - case "no_permission": - return FileMemberActionError.noPermission - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return FileMemberActionError.accessError(v) - case "no_explicit_access": - let v = Sharing.MemberAccessLevelResultSerializer().deserialize(json) - return FileMemberActionError.noExplicitAccess(v) - case "other": - return FileMemberActionError.other - default: - return FileMemberActionError.other - } - default: - fatalError("Failed to deserialize") + case .invalidMember: + var d = [String: JSON]() + d[".tag"] = .str("invalid_member") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .noExplicitAccess(let arg): + var d = try Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) + d[".tag"] = .str("no_explicit_access") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileMemberActionError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_member": + return FileMemberActionError.invalidMember + case "no_permission": + return FileMemberActionError.noPermission + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return FileMemberActionError.accessError(v) + case "no_explicit_access": + let v = try Sharing.MemberAccessLevelResultSerializer().deserialize(json) + return FileMemberActionError.noExplicitAccess(v) + case "other": + return FileMemberActionError.other + default: + return FileMemberActionError.other + } + default: + throw JSONSerializerError.deserializeError(type: FileMemberActionError.self, json: json) } } } /// The FileMemberActionIndividualResult union - public enum FileMemberActionIndividualResult: CustomStringConvertible { + public enum FileMemberActionIndividualResult: CustomStringConvertible, JSONRepresentable { /// Part of the response for both add_file_member and remove_file_member_v1 (deprecated). For add_file_member, - /// indicates giving access was successful and at what AccessLevel. For remove_file_member_v1, indicates member - /// was successfully removed from the file. If AccessLevel is given, the member still has access via a parent - /// shared folder. + /// indicates giving access was successful and at what AccessLevel. For remove_file_member_v1, indicates + /// member was successfully removed from the file. If AccessLevel is given, the member still has access + /// via a parent shared folder. case success(Sharing.AccessLevel?) /// User was not able to perform this action. case memberError(Sharing.FileMemberActionError) + func json() throws -> JSON { + try FileMemberActionIndividualResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileMemberActionIndividualResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileMemberActionIndividualResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileMemberActionIndividualResult: \(error)" + } } } - open class FileMemberActionIndividualResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileMemberActionIndividualResult) -> JSON { + + public class FileMemberActionIndividualResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileMemberActionIndividualResult) throws -> JSON { switch value { - case .success(let arg): - var d = ["success": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(arg)] - d[".tag"] = .str("success") - return .dictionary(d) - case .memberError(let arg): - var d = ["member_error": Sharing.FileMemberActionErrorSerializer().serialize(arg)] - d[".tag"] = .str("member_error") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileMemberActionIndividualResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(d["success"] ?? .null) - return FileMemberActionIndividualResult.success(v) - case "member_error": - let v = Sharing.FileMemberActionErrorSerializer().deserialize(d["member_error"] ?? .null) - return FileMemberActionIndividualResult.memberError(v) - default: - fatalError("Unknown tag \(tag)") - } + case .success(let arg): + var d = try ["success": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(arg)] + d[".tag"] = .str("success") + return .dictionary(d) + case .memberError(let arg): + var d = try ["member_error": Sharing.FileMemberActionErrorSerializer().serialize(arg)] + d[".tag"] = .str("member_error") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileMemberActionIndividualResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(d["success"] ?? .null) + return FileMemberActionIndividualResult.success(v) + case "member_error": + let v = try Sharing.FileMemberActionErrorSerializer().deserialize(d["member_error"] ?? .null) + return FileMemberActionIndividualResult.memberError(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: FileMemberActionIndividualResult.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: FileMemberActionIndividualResult.self, json: json) } } } /// Per-member result for addFileMember. - open class FileMemberActionResult: CustomStringConvertible { + public class FileMemberActionResult: CustomStringConvertible, JSONRepresentable { /// One of specified input members. public let member: Sharing.MemberSelector /// The outcome of the action on this member. @@ -1849,8 +2250,13 @@ open class Sharing { public let sckeySha1: String? /// The sharing sender-recipient invitation signatures for the input member_id. A member_id can be a group and /// thus have multiple users and multiple invitation signatures. - public let invitationSignature: Array? - public init(member: Sharing.MemberSelector, result: Sharing.FileMemberActionIndividualResult, sckeySha1: String? = nil, invitationSignature: Array? = nil) { + public let invitationSignature: [String]? + public init( + member: Sharing.MemberSelector, + result: Sharing.FileMemberActionIndividualResult, + sckeySha1: String? = nil, + invitationSignature: [String]? = nil + ) { self.member = member self.result = result nullableValidator(stringValidator())(sckeySha1) @@ -1858,37 +2264,49 @@ open class Sharing { nullableValidator(arrayValidator(itemValidator: stringValidator()))(invitationSignature) self.invitationSignature = invitationSignature } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileMemberActionResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileMemberActionResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileMemberActionResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileMemberActionResult: \(error)" + } } } - open class FileMemberActionResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileMemberActionResult) -> JSON { - let output = [ - "member": Sharing.MemberSelectorSerializer().serialize(value.member), - "result": Sharing.FileMemberActionIndividualResultSerializer().serialize(value.result), - "sckey_sha1": NullableSerializer(Serialization._StringSerializer).serialize(value.sckeySha1), - "invitation_signature": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.invitationSignature), + + public class FileMemberActionResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileMemberActionResult) throws -> JSON { + let output = [ + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), + "result": try Sharing.FileMemberActionIndividualResultSerializer().serialize(value.result), + "sckey_sha1": try NullableSerializer(Serialization._StringSerializer).serialize(value.sckeySha1), + "invitation_signature": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.invitationSignature), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileMemberActionResult { + + public func deserialize(_ json: JSON) throws -> FileMemberActionResult { switch json { - case .dictionary(let dict): - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - let result = Sharing.FileMemberActionIndividualResultSerializer().deserialize(dict["result"] ?? .null) - let sckeySha1 = NullableSerializer(Serialization._StringSerializer).deserialize(dict["sckey_sha1"] ?? .null) - let invitationSignature = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["invitation_signature"] ?? .null) - return FileMemberActionResult(member: member, result: result, sckeySha1: sckeySha1, invitationSignature: invitationSignature) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + let result = try Sharing.FileMemberActionIndividualResultSerializer().deserialize(dict["result"] ?? .null) + let sckeySha1 = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["sckey_sha1"] ?? .null) + let invitationSignature = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)) + .deserialize(dict["invitation_signature"] ?? .null) + return FileMemberActionResult(member: member, result: result, sckeySha1: sckeySha1, invitationSignature: invitationSignature) + default: + throw JSONSerializerError.deserializeError(type: FileMemberActionResult.self, json: json) } } } /// The FileMemberRemoveActionResult union - public enum FileMemberRemoveActionResult: CustomStringConvertible { + public enum FileMemberRemoveActionResult: CustomStringConvertible, JSONRepresentable { /// Member was successfully removed from this file. case success(Sharing.MemberAccessLevelResult) /// User was not able to remove this member. @@ -1896,52 +2314,62 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try FileMemberRemoveActionResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileMemberRemoveActionResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileMemberRemoveActionResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileMemberRemoveActionResult: \(error)" + } } } - open class FileMemberRemoveActionResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileMemberRemoveActionResult) -> JSON { + + public class FileMemberRemoveActionResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileMemberRemoveActionResult) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .memberError(let arg): - var d = ["member_error": Sharing.FileMemberActionErrorSerializer().serialize(arg)] - d[".tag"] = .str("member_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileMemberRemoveActionResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Sharing.MemberAccessLevelResultSerializer().deserialize(json) - return FileMemberRemoveActionResult.success(v) - case "member_error": - let v = Sharing.FileMemberActionErrorSerializer().deserialize(d["member_error"] ?? .null) - return FileMemberRemoveActionResult.memberError(v) - case "other": - return FileMemberRemoveActionResult.other - default: - return FileMemberRemoveActionResult.other - } + case .success(let arg): + var d = try Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .memberError(let arg): + var d = try ["member_error": Sharing.FileMemberActionErrorSerializer().serialize(arg)] + d[".tag"] = .str("member_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileMemberRemoveActionResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Sharing.MemberAccessLevelResultSerializer().deserialize(json) + return FileMemberRemoveActionResult.success(v) + case "member_error": + let v = try Sharing.FileMemberActionErrorSerializer().deserialize(d["member_error"] ?? .null) + return FileMemberRemoveActionResult.memberError(v) + case "other": + return FileMemberRemoveActionResult.other default: - fatalError("Failed to deserialize") + return FileMemberRemoveActionResult.other + } + default: + throw JSONSerializerError.deserializeError(type: FileMemberRemoveActionResult.self, json: json) } } } /// Whether the user is allowed to take the sharing action on the file. - open class FilePermission: CustomStringConvertible { + public class FilePermission: CustomStringConvertible, JSONRepresentable { /// The action that the user may wish to take on the file. public let action: Sharing.FileAction /// True if the user is allowed to take the action. @@ -1953,35 +2381,46 @@ open class Sharing { self.allow = allow self.reason = reason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FilePermissionSerializer().serialize(self)))" + + func json() throws -> JSON { + try FilePermissionSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FilePermissionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FilePermission: \(error)" + } } } - open class FilePermissionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FilePermission) -> JSON { - let output = [ - "action": Sharing.FileActionSerializer().serialize(value.action), - "allow": Serialization._BoolSerializer.serialize(value.allow), - "reason": NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), + + public class FilePermissionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FilePermission) throws -> JSON { + let output = [ + "action": try Sharing.FileActionSerializer().serialize(value.action), + "allow": try Serialization._BoolSerializer.serialize(value.allow), + "reason": try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FilePermission { + + public func deserialize(_ json: JSON) throws -> FilePermission { switch json { - case .dictionary(let dict): - let action = Sharing.FileActionSerializer().deserialize(dict["action"] ?? .null) - let allow = Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) - let reason = NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) - return FilePermission(action: action, allow: allow, reason: reason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let action = try Sharing.FileActionSerializer().deserialize(dict["action"] ?? .null) + let allow = try Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) + let reason = try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) + return FilePermission(action: action, allow: allow, reason: reason) + default: + throw JSONSerializerError.deserializeError(type: FilePermission.self, json: json) } } } /// Actions that may be taken on shared folders. - public enum FolderAction: CustomStringConvertible { + public enum FolderAction: CustomStringConvertible, JSONRepresentable { /// Change folder options, such as who can be invited to join the folder. case changeOptions /// Disable viewer information for this folder. @@ -2013,161 +2452,186 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try FolderActionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderActionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderActionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderAction: \(error)" + } } } - open class FolderActionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderAction) -> JSON { + + public class FolderActionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderAction) throws -> JSON { switch value { - case .changeOptions: - var d = [String: JSON]() - d[".tag"] = .str("change_options") - return .dictionary(d) - case .disableViewerInfo: - var d = [String: JSON]() - d[".tag"] = .str("disable_viewer_info") - return .dictionary(d) - case .editContents: - var d = [String: JSON]() - d[".tag"] = .str("edit_contents") - return .dictionary(d) - case .enableViewerInfo: - var d = [String: JSON]() - d[".tag"] = .str("enable_viewer_info") - return .dictionary(d) - case .inviteEditor: - var d = [String: JSON]() - d[".tag"] = .str("invite_editor") - return .dictionary(d) - case .inviteViewer: - var d = [String: JSON]() - d[".tag"] = .str("invite_viewer") - return .dictionary(d) - case .inviteViewerNoComment: - var d = [String: JSON]() - d[".tag"] = .str("invite_viewer_no_comment") - return .dictionary(d) - case .relinquishMembership: - var d = [String: JSON]() - d[".tag"] = .str("relinquish_membership") - return .dictionary(d) - case .unmount: - var d = [String: JSON]() - d[".tag"] = .str("unmount") - return .dictionary(d) - case .unshare: - var d = [String: JSON]() - d[".tag"] = .str("unshare") - return .dictionary(d) - case .leaveACopy: - var d = [String: JSON]() - d[".tag"] = .str("leave_a_copy") - return .dictionary(d) - case .shareLink: - var d = [String: JSON]() - d[".tag"] = .str("share_link") - return .dictionary(d) - case .createLink: - var d = [String: JSON]() - d[".tag"] = .str("create_link") - return .dictionary(d) - case .setAccessInheritance: - var d = [String: JSON]() - d[".tag"] = .str("set_access_inheritance") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FolderAction { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "change_options": - return FolderAction.changeOptions - case "disable_viewer_info": - return FolderAction.disableViewerInfo - case "edit_contents": - return FolderAction.editContents - case "enable_viewer_info": - return FolderAction.enableViewerInfo - case "invite_editor": - return FolderAction.inviteEditor - case "invite_viewer": - return FolderAction.inviteViewer - case "invite_viewer_no_comment": - return FolderAction.inviteViewerNoComment - case "relinquish_membership": - return FolderAction.relinquishMembership - case "unmount": - return FolderAction.unmount - case "unshare": - return FolderAction.unshare - case "leave_a_copy": - return FolderAction.leaveACopy - case "share_link": - return FolderAction.shareLink - case "create_link": - return FolderAction.createLink - case "set_access_inheritance": - return FolderAction.setAccessInheritance - case "other": - return FolderAction.other - default: - return FolderAction.other - } - default: - fatalError("Failed to deserialize") + case .changeOptions: + var d = [String: JSON]() + d[".tag"] = .str("change_options") + return .dictionary(d) + case .disableViewerInfo: + var d = [String: JSON]() + d[".tag"] = .str("disable_viewer_info") + return .dictionary(d) + case .editContents: + var d = [String: JSON]() + d[".tag"] = .str("edit_contents") + return .dictionary(d) + case .enableViewerInfo: + var d = [String: JSON]() + d[".tag"] = .str("enable_viewer_info") + return .dictionary(d) + case .inviteEditor: + var d = [String: JSON]() + d[".tag"] = .str("invite_editor") + return .dictionary(d) + case .inviteViewer: + var d = [String: JSON]() + d[".tag"] = .str("invite_viewer") + return .dictionary(d) + case .inviteViewerNoComment: + var d = [String: JSON]() + d[".tag"] = .str("invite_viewer_no_comment") + return .dictionary(d) + case .relinquishMembership: + var d = [String: JSON]() + d[".tag"] = .str("relinquish_membership") + return .dictionary(d) + case .unmount: + var d = [String: JSON]() + d[".tag"] = .str("unmount") + return .dictionary(d) + case .unshare: + var d = [String: JSON]() + d[".tag"] = .str("unshare") + return .dictionary(d) + case .leaveACopy: + var d = [String: JSON]() + d[".tag"] = .str("leave_a_copy") + return .dictionary(d) + case .shareLink: + var d = [String: JSON]() + d[".tag"] = .str("share_link") + return .dictionary(d) + case .createLink: + var d = [String: JSON]() + d[".tag"] = .str("create_link") + return .dictionary(d) + case .setAccessInheritance: + var d = [String: JSON]() + d[".tag"] = .str("set_access_inheritance") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FolderAction { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "change_options": + return FolderAction.changeOptions + case "disable_viewer_info": + return FolderAction.disableViewerInfo + case "edit_contents": + return FolderAction.editContents + case "enable_viewer_info": + return FolderAction.enableViewerInfo + case "invite_editor": + return FolderAction.inviteEditor + case "invite_viewer": + return FolderAction.inviteViewer + case "invite_viewer_no_comment": + return FolderAction.inviteViewerNoComment + case "relinquish_membership": + return FolderAction.relinquishMembership + case "unmount": + return FolderAction.unmount + case "unshare": + return FolderAction.unshare + case "leave_a_copy": + return FolderAction.leaveACopy + case "share_link": + return FolderAction.shareLink + case "create_link": + return FolderAction.createLink + case "set_access_inheritance": + return FolderAction.setAccessInheritance + case "other": + return FolderAction.other + default: + return FolderAction.other + } + default: + throw JSONSerializerError.deserializeError(type: FolderAction.self, json: json) } } } /// The metadata of a folder shared link. - open class FolderLinkMetadata: Sharing.SharedLinkMetadata { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderLinkMetadataSerializer().serialize(self)))" - } - } - open class FolderLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderLinkMetadata) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "name": Serialization._StringSerializer.serialize(value.name), - "link_permissions": Sharing.LinkPermissionsSerializer().serialize(value.linkPermissions), - "id": NullableSerializer(Serialization._StringSerializer).serialize(value.id), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "team_member_info": NullableSerializer(Sharing.TeamMemberInfoSerializer()).serialize(value.teamMemberInfo), - "content_owner_team_info": NullableSerializer(Users.TeamSerializer()).serialize(value.contentOwnerTeamInfo), + public class FolderLinkMetadata: Sharing.SharedLinkMetadata { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderLinkMetadata: \(error)" + } + } + } + + public class FolderLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderLinkMetadata) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "name": try Serialization._StringSerializer.serialize(value.name), + "link_permissions": try Sharing.LinkPermissionsSerializer().serialize(value.linkPermissions), + "id": try NullableSerializer(Serialization._StringSerializer).serialize(value.id), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "team_member_info": try NullableSerializer(Sharing.TeamMemberInfoSerializer()).serialize(value.teamMemberInfo), + "content_owner_team_info": try NullableSerializer(Users.TeamSerializer()).serialize(value.contentOwnerTeamInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderLinkMetadata { - switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let linkPermissions = Sharing.LinkPermissionsSerializer().deserialize(dict["link_permissions"] ?? .null) - let id = NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let teamMemberInfo = NullableSerializer(Sharing.TeamMemberInfoSerializer()).deserialize(dict["team_member_info"] ?? .null) - let contentOwnerTeamInfo = NullableSerializer(Users.TeamSerializer()).deserialize(dict["content_owner_team_info"] ?? .null) - return FolderLinkMetadata(url: url, name: name, linkPermissions: linkPermissions, id: id, expires: expires, pathLower: pathLower, teamMemberInfo: teamMemberInfo, contentOwnerTeamInfo: contentOwnerTeamInfo) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> FolderLinkMetadata { + switch json { + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let linkPermissions = try Sharing.LinkPermissionsSerializer().deserialize(dict["link_permissions"] ?? .null) + let id = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["id"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let teamMemberInfo = try NullableSerializer(Sharing.TeamMemberInfoSerializer()).deserialize(dict["team_member_info"] ?? .null) + let contentOwnerTeamInfo = try NullableSerializer(Users.TeamSerializer()).deserialize(dict["content_owner_team_info"] ?? .null) + return FolderLinkMetadata( + url: url, + name: name, + linkPermissions: linkPermissions, + id: id, + expires: expires, + pathLower: pathLower, + teamMemberInfo: teamMemberInfo, + contentOwnerTeamInfo: contentOwnerTeamInfo + ) + default: + throw JSONSerializerError.deserializeError(type: FolderLinkMetadata.self, json: json) } } } /// Whether the user is allowed to take the action on the shared folder. - open class FolderPermission: CustomStringConvertible { + public class FolderPermission: CustomStringConvertible, JSONRepresentable { /// The action that the user may wish to take on the folder. public let action: Sharing.FolderAction /// True if the user is allowed to take the action. @@ -2180,41 +2644,53 @@ open class Sharing { self.allow = allow self.reason = reason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderPermissionSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderPermissionSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderPermissionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderPermission: \(error)" + } } } - open class FolderPermissionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderPermission) -> JSON { - let output = [ - "action": Sharing.FolderActionSerializer().serialize(value.action), - "allow": Serialization._BoolSerializer.serialize(value.allow), - "reason": NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), + + public class FolderPermissionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderPermission) throws -> JSON { + let output = [ + "action": try Sharing.FolderActionSerializer().serialize(value.action), + "allow": try Serialization._BoolSerializer.serialize(value.allow), + "reason": try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderPermission { + + public func deserialize(_ json: JSON) throws -> FolderPermission { switch json { - case .dictionary(let dict): - let action = Sharing.FolderActionSerializer().deserialize(dict["action"] ?? .null) - let allow = Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) - let reason = NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) - return FolderPermission(action: action, allow: allow, reason: reason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let action = try Sharing.FolderActionSerializer().deserialize(dict["action"] ?? .null) + let allow = try Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) + let reason = try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) + return FolderPermission(action: action, allow: allow, reason: reason) + default: + throw JSONSerializerError.deserializeError(type: FolderPermission.self, json: json) } } } /// A set of policies governing membership and privileges for a shared folder. - open class FolderPolicy: CustomStringConvertible { + public class FolderPolicy: CustomStringConvertible, JSONRepresentable { /// Who can be a member of this shared folder, as set on the folder itself. The effective policy may differ from - /// this value if the team-wide policy is more restrictive. Present only if the folder is owned by a team. + /// this value if the team-wide policy is more restrictive. Present only if the folder is owned by a + /// team. public let memberPolicy: Sharing.MemberPolicy? /// Who can be a member of this shared folder, taking into account both the folder and the team-wide policy. - /// This value may differ from that of member_policy if the team-wide policy is more restrictive than the folder - /// policy. Present only if the folder is owned by a team. + /// This value may differ from that of member_policy if the team-wide policy is more restrictive than + /// the folder policy. Present only if the folder is owned by a team. public let resolvedMemberPolicy: Sharing.MemberPolicy? /// Who can add and remove members from this shared folder. public let aclUpdatePolicy: Sharing.AclUpdatePolicy @@ -2222,120 +2698,165 @@ open class Sharing { public let sharedLinkPolicy: Sharing.SharedLinkPolicy /// Who can enable/disable viewer info for this shared folder. public let viewerInfoPolicy: Sharing.ViewerInfoPolicy? - public init(aclUpdatePolicy: Sharing.AclUpdatePolicy, sharedLinkPolicy: Sharing.SharedLinkPolicy, memberPolicy: Sharing.MemberPolicy? = nil, resolvedMemberPolicy: Sharing.MemberPolicy? = nil, viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil) { + public init( + aclUpdatePolicy: Sharing.AclUpdatePolicy, + sharedLinkPolicy: Sharing.SharedLinkPolicy, + memberPolicy: Sharing.MemberPolicy? = nil, + resolvedMemberPolicy: Sharing.MemberPolicy? = nil, + viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil + ) { self.memberPolicy = memberPolicy self.resolvedMemberPolicy = resolvedMemberPolicy self.aclUpdatePolicy = aclUpdatePolicy self.sharedLinkPolicy = sharedLinkPolicy self.viewerInfoPolicy = viewerInfoPolicy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderPolicySerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderPolicy: \(error)" + } } } - open class FolderPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderPolicy) -> JSON { - let output = [ - "acl_update_policy": Sharing.AclUpdatePolicySerializer().serialize(value.aclUpdatePolicy), - "shared_link_policy": Sharing.SharedLinkPolicySerializer().serialize(value.sharedLinkPolicy), - "member_policy": NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), - "resolved_member_policy": NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.resolvedMemberPolicy), - "viewer_info_policy": NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), + + public class FolderPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderPolicy) throws -> JSON { + let output = [ + "acl_update_policy": try Sharing.AclUpdatePolicySerializer().serialize(value.aclUpdatePolicy), + "shared_link_policy": try Sharing.SharedLinkPolicySerializer().serialize(value.sharedLinkPolicy), + "member_policy": try NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), + "resolved_member_policy": try NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.resolvedMemberPolicy), + "viewer_info_policy": try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderPolicy { + + public func deserialize(_ json: JSON) throws -> FolderPolicy { switch json { - case .dictionary(let dict): - let aclUpdatePolicy = Sharing.AclUpdatePolicySerializer().deserialize(dict["acl_update_policy"] ?? .null) - let sharedLinkPolicy = Sharing.SharedLinkPolicySerializer().deserialize(dict["shared_link_policy"] ?? .null) - let memberPolicy = NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) - let resolvedMemberPolicy = NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["resolved_member_policy"] ?? .null) - let viewerInfoPolicy = NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) - return FolderPolicy(aclUpdatePolicy: aclUpdatePolicy, sharedLinkPolicy: sharedLinkPolicy, memberPolicy: memberPolicy, resolvedMemberPolicy: resolvedMemberPolicy, viewerInfoPolicy: viewerInfoPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let aclUpdatePolicy = try Sharing.AclUpdatePolicySerializer().deserialize(dict["acl_update_policy"] ?? .null) + let sharedLinkPolicy = try Sharing.SharedLinkPolicySerializer().deserialize(dict["shared_link_policy"] ?? .null) + let memberPolicy = try NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) + let resolvedMemberPolicy = try NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["resolved_member_policy"] ?? .null) + let viewerInfoPolicy = try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) + return FolderPolicy( + aclUpdatePolicy: aclUpdatePolicy, + sharedLinkPolicy: sharedLinkPolicy, + memberPolicy: memberPolicy, + resolvedMemberPolicy: resolvedMemberPolicy, + viewerInfoPolicy: viewerInfoPolicy + ) + default: + throw JSONSerializerError.deserializeError(type: FolderPolicy.self, json: json) } } } /// Arguments of getFileMetadata. - open class GetFileMetadataArg: CustomStringConvertible { + public class GetFileMetadataArg: CustomStringConvertible, JSONRepresentable { /// The file to query. public let file: String /// A list of `FileAction`s corresponding to `FilePermission`s that should appear in the response's permissions /// in SharedFileMetadata field describing the actions the authenticated user can perform on the file. - public let actions: Array? - public init(file: String, actions: Array? = nil) { + public let actions: [Sharing.FileAction]? + public init(file: String, actions: [Sharing.FileAction]? = nil) { stringValidator(minLength: 1, pattern: "((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?")(file) self.file = file self.actions = actions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetFileMetadataArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetFileMetadataArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetFileMetadataArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetFileMetadataArg: \(error)" + } } } - open class GetFileMetadataArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetFileMetadataArg) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), - "actions": NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).serialize(value.actions), + + public class GetFileMetadataArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetFileMetadataArg) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), + "actions": try NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).serialize(value.actions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetFileMetadataArg { + + public func deserialize(_ json: JSON) throws -> GetFileMetadataArg { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - let actions = NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).deserialize(dict["actions"] ?? .null) - return GetFileMetadataArg(file: file, actions: actions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + let actions = try NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).deserialize(dict["actions"] ?? .null) + return GetFileMetadataArg(file: file, actions: actions) + default: + throw JSONSerializerError.deserializeError(type: GetFileMetadataArg.self, json: json) } } } /// Arguments of getFileMetadataBatch. - open class GetFileMetadataBatchArg: CustomStringConvertible { + public class GetFileMetadataBatchArg: CustomStringConvertible, JSONRepresentable { /// The files to query. - public let files: Array + public let files: [String] /// A list of `FileAction`s corresponding to `FilePermission`s that should appear in the response's permissions /// in SharedFileMetadata field describing the actions the authenticated user can perform on the file. - public let actions: Array? - public init(files: Array, actions: Array? = nil) { + public let actions: [Sharing.FileAction]? + public init(files: [String], actions: [Sharing.FileAction]? = nil) { arrayValidator(maxItems: 100, itemValidator: stringValidator(minLength: 1, pattern: "((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?"))(files) self.files = files self.actions = actions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetFileMetadataBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetFileMetadataBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetFileMetadataBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetFileMetadataBatchArg: \(error)" + } } } - open class GetFileMetadataBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetFileMetadataBatchArg) -> JSON { - let output = [ - "files": ArraySerializer(Serialization._StringSerializer).serialize(value.files), - "actions": NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).serialize(value.actions), + + public class GetFileMetadataBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetFileMetadataBatchArg) throws -> JSON { + let output = [ + "files": try ArraySerializer(Serialization._StringSerializer).serialize(value.files), + "actions": try NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).serialize(value.actions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetFileMetadataBatchArg { + + public func deserialize(_ json: JSON) throws -> GetFileMetadataBatchArg { switch json { - case .dictionary(let dict): - let files = ArraySerializer(Serialization._StringSerializer).deserialize(dict["files"] ?? .null) - let actions = NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).deserialize(dict["actions"] ?? .null) - return GetFileMetadataBatchArg(files: files, actions: actions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let files = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["files"] ?? .null) + let actions = try NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).deserialize(dict["actions"] ?? .null) + return GetFileMetadataBatchArg(files: files, actions: actions) + default: + throw JSONSerializerError.deserializeError(type: GetFileMetadataBatchArg.self, json: json) } } } /// Per file results of getFileMetadataBatch. - open class GetFileMetadataBatchResult: CustomStringConvertible { + public class GetFileMetadataBatchResult: CustomStringConvertible, JSONRepresentable { /// This is the input file identifier corresponding to one of files in GetFileMetadataBatchArg. public let file: String /// The result for this particular file. @@ -2345,33 +2866,44 @@ open class Sharing { self.file = file self.result = result } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetFileMetadataBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetFileMetadataBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetFileMetadataBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetFileMetadataBatchResult: \(error)" + } } } - open class GetFileMetadataBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetFileMetadataBatchResult) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), - "result": Sharing.GetFileMetadataIndividualResultSerializer().serialize(value.result), + + public class GetFileMetadataBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetFileMetadataBatchResult) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), + "result": try Sharing.GetFileMetadataIndividualResultSerializer().serialize(value.result), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetFileMetadataBatchResult { + + public func deserialize(_ json: JSON) throws -> GetFileMetadataBatchResult { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - let result = Sharing.GetFileMetadataIndividualResultSerializer().deserialize(dict["result"] ?? .null) - return GetFileMetadataBatchResult(file: file, result: result) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + let result = try Sharing.GetFileMetadataIndividualResultSerializer().deserialize(dict["result"] ?? .null) + return GetFileMetadataBatchResult(file: file, result: result) + default: + throw JSONSerializerError.deserializeError(type: GetFileMetadataBatchResult.self, json: json) } } } /// Error result for getFileMetadata. - public enum GetFileMetadataError: CustomStringConvertible { + public enum GetFileMetadataError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case userError(Sharing.SharingUserError) /// An unspecified error. @@ -2379,52 +2911,62 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try GetFileMetadataErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetFileMetadataErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetFileMetadataErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetFileMetadataError: \(error)" + } } } - open class GetFileMetadataErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetFileMetadataError) -> JSON { + + public class GetFileMetadataErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetFileMetadataError) throws -> JSON { switch value { - case .userError(let arg): - var d = ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] - d[".tag"] = .str("user_error") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetFileMetadataError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_error": - let v = Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) - return GetFileMetadataError.userError(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return GetFileMetadataError.accessError(v) - case "other": - return GetFileMetadataError.other - default: - return GetFileMetadataError.other - } + case .userError(let arg): + var d = try ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetFileMetadataError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_error": + let v = try Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) + return GetFileMetadataError.userError(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return GetFileMetadataError.accessError(v) + case "other": + return GetFileMetadataError.other default: - fatalError("Failed to deserialize") + return GetFileMetadataError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetFileMetadataError.self, json: json) } } } /// The GetFileMetadataIndividualResult union - public enum GetFileMetadataIndividualResult: CustomStringConvertible { + public enum GetFileMetadataIndividualResult: CustomStringConvertible, JSONRepresentable { /// The result for this file if it was successful. case metadata(Sharing.SharedFileMetadata) /// The result for this file if it was an error. @@ -2432,90 +2974,111 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try GetFileMetadataIndividualResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetFileMetadataIndividualResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetFileMetadataIndividualResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetFileMetadataIndividualResult: \(error)" + } } } - open class GetFileMetadataIndividualResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetFileMetadataIndividualResult) -> JSON { + + public class GetFileMetadataIndividualResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetFileMetadataIndividualResult) throws -> JSON { switch value { - case .metadata(let arg): - var d = Serialization.getFields(Sharing.SharedFileMetadataSerializer().serialize(arg)) - d[".tag"] = .str("metadata") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetFileMetadataIndividualResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "metadata": - let v = Sharing.SharedFileMetadataSerializer().deserialize(json) - return GetFileMetadataIndividualResult.metadata(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return GetFileMetadataIndividualResult.accessError(v) - case "other": - return GetFileMetadataIndividualResult.other - default: - return GetFileMetadataIndividualResult.other - } + case .metadata(let arg): + var d = try Serialization.getFields(Sharing.SharedFileMetadataSerializer().serialize(arg)) + d[".tag"] = .str("metadata") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetFileMetadataIndividualResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "metadata": + let v = try Sharing.SharedFileMetadataSerializer().deserialize(json) + return GetFileMetadataIndividualResult.metadata(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return GetFileMetadataIndividualResult.accessError(v) + case "other": + return GetFileMetadataIndividualResult.other default: - fatalError("Failed to deserialize") + return GetFileMetadataIndividualResult.other + } + default: + throw JSONSerializerError.deserializeError(type: GetFileMetadataIndividualResult.self, json: json) } } } /// The GetMetadataArgs struct - open class GetMetadataArgs: CustomStringConvertible { + public class GetMetadataArgs: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's - /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the - /// folder. - public let actions: Array? - public init(sharedFolderId: String, actions: Array? = nil) { + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform + /// on the folder. + public let actions: [Sharing.FolderAction]? + public init(sharedFolderId: String, actions: [Sharing.FolderAction]? = nil) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId self.actions = actions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetMetadataArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetMetadataArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetMetadataArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetMetadataArgs: \(error)" + } } } - open class GetMetadataArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetMetadataArgs) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "actions": NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), + + public class GetMetadataArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetMetadataArgs) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "actions": try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetMetadataArgs { + + public func deserialize(_ json: JSON) throws -> GetMetadataArgs { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let actions = NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) - return GetMetadataArgs(sharedFolderId: sharedFolderId, actions: actions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let actions = try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) + return GetMetadataArgs(sharedFolderId: sharedFolderId, actions: actions) + default: + throw JSONSerializerError.deserializeError(type: GetMetadataArgs.self, json: json) } } } /// The SharedLinkError union - public enum SharedLinkError: CustomStringConvertible { + public enum SharedLinkError: CustomStringConvertible, JSONRepresentable { /// The shared link wasn't found. case sharedLinkNotFound /// The caller is not allowed to access this shared link. @@ -2525,56 +3088,66 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SharedLinkErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkError: \(error)" + } } } - open class SharedLinkErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkError) -> JSON { + + public class SharedLinkErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkError) throws -> JSON { switch value { - case .sharedLinkNotFound: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_not_found") - return .dictionary(d) - case .sharedLinkAccessDenied: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_access_denied") - return .dictionary(d) - case .unsupportedLinkType: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_link_type") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "shared_link_not_found": - return SharedLinkError.sharedLinkNotFound - case "shared_link_access_denied": - return SharedLinkError.sharedLinkAccessDenied - case "unsupported_link_type": - return SharedLinkError.unsupportedLinkType - case "other": - return SharedLinkError.other - default: - return SharedLinkError.other - } - default: - fatalError("Failed to deserialize") + case .sharedLinkNotFound: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_not_found") + return .dictionary(d) + case .sharedLinkAccessDenied: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_access_denied") + return .dictionary(d) + case .unsupportedLinkType: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_link_type") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "shared_link_not_found": + return SharedLinkError.sharedLinkNotFound + case "shared_link_access_denied": + return SharedLinkError.sharedLinkAccessDenied + case "unsupported_link_type": + return SharedLinkError.unsupportedLinkType + case "other": + return SharedLinkError.other + default: + return SharedLinkError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkError.self, json: json) } } } /// The GetSharedLinkFileError union - public enum GetSharedLinkFileError: CustomStringConvertible { + public enum GetSharedLinkFileError: CustomStringConvertible, JSONRepresentable { /// The shared link wasn't found. case sharedLinkNotFound /// The caller is not allowed to access this shared link. @@ -2586,62 +3159,72 @@ open class Sharing { /// Directories cannot be retrieved by this endpoint. case sharedLinkIsDirectory + func json() throws -> JSON { + try GetSharedLinkFileErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetSharedLinkFileErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetSharedLinkFileErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetSharedLinkFileError: \(error)" + } } } - open class GetSharedLinkFileErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetSharedLinkFileError) -> JSON { + + public class GetSharedLinkFileErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetSharedLinkFileError) throws -> JSON { switch value { - case .sharedLinkNotFound: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_not_found") - return .dictionary(d) - case .sharedLinkAccessDenied: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_access_denied") - return .dictionary(d) - case .unsupportedLinkType: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_link_type") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .sharedLinkIsDirectory: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_is_directory") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetSharedLinkFileError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "shared_link_not_found": - return GetSharedLinkFileError.sharedLinkNotFound - case "shared_link_access_denied": - return GetSharedLinkFileError.sharedLinkAccessDenied - case "unsupported_link_type": - return GetSharedLinkFileError.unsupportedLinkType - case "other": - return GetSharedLinkFileError.other - case "shared_link_is_directory": - return GetSharedLinkFileError.sharedLinkIsDirectory - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .sharedLinkNotFound: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_not_found") + return .dictionary(d) + case .sharedLinkAccessDenied: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_access_denied") + return .dictionary(d) + case .unsupportedLinkType: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_link_type") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .sharedLinkIsDirectory: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_is_directory") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetSharedLinkFileError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "shared_link_not_found": + return GetSharedLinkFileError.sharedLinkNotFound + case "shared_link_access_denied": + return GetSharedLinkFileError.sharedLinkAccessDenied + case "unsupported_link_type": + return GetSharedLinkFileError.unsupportedLinkType + case "other": + return GetSharedLinkFileError.other + case "shared_link_is_directory": + return GetSharedLinkFileError.sharedLinkIsDirectory + default: + throw JSONSerializerError.unknownTag(type: GetSharedLinkFileError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GetSharedLinkFileError.self, json: json) } } } /// The GetSharedLinkMetadataArg struct - open class GetSharedLinkMetadataArg: CustomStringConvertible { + public class GetSharedLinkMetadataArg: CustomStringConvertible, JSONRepresentable { /// URL of the shared link. public let url: String /// If the shared link is to a folder, this parameter can be used to retrieve the metadata for a specific file @@ -2657,141 +3240,184 @@ open class Sharing { nullableValidator(stringValidator())(linkPassword) self.linkPassword = linkPassword } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetSharedLinkMetadataArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetSharedLinkMetadataArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetSharedLinkMetadataArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetSharedLinkMetadataArg: \(error)" + } } } - open class GetSharedLinkMetadataArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetSharedLinkMetadataArg) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "path": NullableSerializer(Serialization._StringSerializer).serialize(value.path), - "link_password": NullableSerializer(Serialization._StringSerializer).serialize(value.linkPassword), + + public class GetSharedLinkMetadataArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetSharedLinkMetadataArg) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "path": try NullableSerializer(Serialization._StringSerializer).serialize(value.path), + "link_password": try NullableSerializer(Serialization._StringSerializer).serialize(value.linkPassword), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetSharedLinkMetadataArg { + + public func deserialize(_ json: JSON) throws -> GetSharedLinkMetadataArg { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let path = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) - let linkPassword = NullableSerializer(Serialization._StringSerializer).deserialize(dict["link_password"] ?? .null) - return GetSharedLinkMetadataArg(url: url, path: path, linkPassword: linkPassword) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let path = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) + let linkPassword = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["link_password"] ?? .null) + return GetSharedLinkMetadataArg(url: url, path: path, linkPassword: linkPassword) + default: + throw JSONSerializerError.deserializeError(type: GetSharedLinkMetadataArg.self, json: json) } } } /// The GetSharedLinksArg struct - open class GetSharedLinksArg: CustomStringConvertible { + public class GetSharedLinksArg: CustomStringConvertible, JSONRepresentable { /// See getSharedLinks description. public let path: String? public init(path: String? = nil) { nullableValidator(stringValidator())(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetSharedLinksArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetSharedLinksArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetSharedLinksArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetSharedLinksArg: \(error)" + } } } - open class GetSharedLinksArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetSharedLinksArg) -> JSON { - let output = [ - "path": NullableSerializer(Serialization._StringSerializer).serialize(value.path), + + public class GetSharedLinksArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetSharedLinksArg) throws -> JSON { + let output = [ + "path": try NullableSerializer(Serialization._StringSerializer).serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetSharedLinksArg { + + public func deserialize(_ json: JSON) throws -> GetSharedLinksArg { switch json { - case .dictionary(let dict): - let path = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) - return GetSharedLinksArg(path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) + return GetSharedLinksArg(path: path) + default: + throw JSONSerializerError.deserializeError(type: GetSharedLinksArg.self, json: json) } } } /// The GetSharedLinksError union - public enum GetSharedLinksError: CustomStringConvertible { + public enum GetSharedLinksError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(String?) /// An unspecified error. case other + func json() throws -> JSON { + try GetSharedLinksErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetSharedLinksErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetSharedLinksErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetSharedLinksError: \(error)" + } } } - open class GetSharedLinksErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetSharedLinksError) -> JSON { + + public class GetSharedLinksErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetSharedLinksError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": NullableSerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetSharedLinksError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = NullableSerializer(Serialization._StringSerializer).deserialize(d["path"] ?? .null) - return GetSharedLinksError.path(v) - case "other": - return GetSharedLinksError.other - default: - return GetSharedLinksError.other - } + case .path(let arg): + var d = try ["path": NullableSerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetSharedLinksError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try NullableSerializer(Serialization._StringSerializer).deserialize(d["path"] ?? .null) + return GetSharedLinksError.path(v) + case "other": + return GetSharedLinksError.other default: - fatalError("Failed to deserialize") + return GetSharedLinksError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetSharedLinksError.self, json: json) } } } /// The GetSharedLinksResult struct - open class GetSharedLinksResult: CustomStringConvertible { + public class GetSharedLinksResult: CustomStringConvertible, JSONRepresentable { /// Shared links applicable to the path argument. - public let links: Array - public init(links: Array) { + public let links: [Sharing.LinkMetadata] + public init(links: [Sharing.LinkMetadata]) { self.links = links } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetSharedLinksResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetSharedLinksResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetSharedLinksResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetSharedLinksResult: \(error)" + } } } - open class GetSharedLinksResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetSharedLinksResult) -> JSON { - let output = [ - "links": ArraySerializer(Sharing.LinkMetadataSerializer()).serialize(value.links), + + public class GetSharedLinksResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetSharedLinksResult) throws -> JSON { + let output = [ + "links": try ArraySerializer(Sharing.LinkMetadataSerializer()).serialize(value.links), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetSharedLinksResult { + + public func deserialize(_ json: JSON) throws -> GetSharedLinksResult { switch json { - case .dictionary(let dict): - let links = ArraySerializer(Sharing.LinkMetadataSerializer()).deserialize(dict["links"] ?? .null) - return GetSharedLinksResult(links: links) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let links = try ArraySerializer(Sharing.LinkMetadataSerializer()).deserialize(dict["links"] ?? .null) + return GetSharedLinksResult(links: links) + default: + throw JSONSerializerError.deserializeError(type: GetSharedLinksResult.self, json: json) } } } /// The information about a group. Groups is a way to manage a list of users who need same access permission to the /// shared folder. - open class GroupInfo: TeamCommon.GroupSummary { + public class GroupInfo: TeamCommon.GroupSummary { /// The type of group. public let groupType: TeamCommon.GroupType /// If the current user is a member of the group. @@ -2800,141 +3426,198 @@ open class Sharing { public let isOwner: Bool /// If the group is owned by the current user's team. public let sameTeam: Bool - public init(groupName: String, groupId: String, groupManagementType: TeamCommon.GroupManagementType, groupType: TeamCommon.GroupType, isMember: Bool, isOwner: Bool, sameTeam: Bool, groupExternalId: String? = nil, memberCount: UInt32? = nil) { + public init( + groupName: String, + groupId: String, + groupManagementType: TeamCommon.GroupManagementType, + groupType: TeamCommon.GroupType, + isMember: Bool, + isOwner: Bool, + sameTeam: Bool, + groupExternalId: String? = nil, + memberCount: UInt32? = nil + ) { self.groupType = groupType self.isMember = isMember self.isOwner = isOwner self.sameTeam = sameTeam - super.init(groupName: groupName, groupId: groupId, groupManagementType: groupManagementType, groupExternalId: groupExternalId, memberCount: memberCount) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupInfoSerializer().serialize(self)))" - } - } - open class GroupInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupInfo) -> JSON { - let output = [ - "group_name": Serialization._StringSerializer.serialize(value.groupName), - "group_id": Serialization._StringSerializer.serialize(value.groupId), - "group_management_type": TeamCommon.GroupManagementTypeSerializer().serialize(value.groupManagementType), - "group_type": TeamCommon.GroupTypeSerializer().serialize(value.groupType), - "is_member": Serialization._BoolSerializer.serialize(value.isMember), - "is_owner": Serialization._BoolSerializer.serialize(value.isOwner), - "same_team": Serialization._BoolSerializer.serialize(value.sameTeam), - "group_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), - "member_count": NullableSerializer(Serialization._UInt32Serializer).serialize(value.memberCount), + super.init( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType, + groupExternalId: groupExternalId, + memberCount: memberCount + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupInfo: \(error)" + } + } + } + + public class GroupInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupInfo) throws -> JSON { + let output = [ + "group_name": try Serialization._StringSerializer.serialize(value.groupName), + "group_id": try Serialization._StringSerializer.serialize(value.groupId), + "group_management_type": try TeamCommon.GroupManagementTypeSerializer().serialize(value.groupManagementType), + "group_type": try TeamCommon.GroupTypeSerializer().serialize(value.groupType), + "is_member": try Serialization._BoolSerializer.serialize(value.isMember), + "is_owner": try Serialization._BoolSerializer.serialize(value.isOwner), + "same_team": try Serialization._BoolSerializer.serialize(value.sameTeam), + "group_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), + "member_count": try NullableSerializer(Serialization._UInt32Serializer).serialize(value.memberCount), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupInfo { - switch json { - case .dictionary(let dict): - let groupName = Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) - let groupId = Serialization._StringSerializer.deserialize(dict["group_id"] ?? .null) - let groupManagementType = TeamCommon.GroupManagementTypeSerializer().deserialize(dict["group_management_type"] ?? .null) - let groupType = TeamCommon.GroupTypeSerializer().deserialize(dict["group_type"] ?? .null) - let isMember = Serialization._BoolSerializer.deserialize(dict["is_member"] ?? .null) - let isOwner = Serialization._BoolSerializer.deserialize(dict["is_owner"] ?? .null) - let sameTeam = Serialization._BoolSerializer.deserialize(dict["same_team"] ?? .null) - let groupExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) - let memberCount = NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["member_count"] ?? .null) - return GroupInfo(groupName: groupName, groupId: groupId, groupManagementType: groupManagementType, groupType: groupType, isMember: isMember, isOwner: isOwner, sameTeam: sameTeam, groupExternalId: groupExternalId, memberCount: memberCount) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> GroupInfo { + switch json { + case .dictionary(let dict): + let groupName = try Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) + let groupId = try Serialization._StringSerializer.deserialize(dict["group_id"] ?? .null) + let groupManagementType = try TeamCommon.GroupManagementTypeSerializer().deserialize(dict["group_management_type"] ?? .null) + let groupType = try TeamCommon.GroupTypeSerializer().deserialize(dict["group_type"] ?? .null) + let isMember = try Serialization._BoolSerializer.deserialize(dict["is_member"] ?? .null) + let isOwner = try Serialization._BoolSerializer.deserialize(dict["is_owner"] ?? .null) + let sameTeam = try Serialization._BoolSerializer.deserialize(dict["same_team"] ?? .null) + let groupExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) + let memberCount = try NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["member_count"] ?? .null) + return GroupInfo( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType, + groupType: groupType, + isMember: isMember, + isOwner: isOwner, + sameTeam: sameTeam, + groupExternalId: groupExternalId, + memberCount: memberCount + ) + default: + throw JSONSerializerError.deserializeError(type: GroupInfo.self, json: json) } } } /// The information about a member of the shared content. - open class MembershipInfo: CustomStringConvertible { + public class MembershipInfo: CustomStringConvertible, JSONRepresentable { /// The access type for this member. It contains inherited access type from parent folder, and acquired access /// type from this folder. public let accessType: Sharing.AccessLevel /// The permissions that requesting user has on this member. The set of permissions corresponds to the /// MemberActions in the request. - public let permissions: Array? + public let permissions: [Sharing.MemberPermission]? /// Never set. public let initials: String? /// True if the member has access from a parent folder. public let isInherited: Bool - public init(accessType: Sharing.AccessLevel, permissions: Array? = nil, initials: String? = nil, isInherited: Bool = false) { + public init(accessType: Sharing.AccessLevel, permissions: [Sharing.MemberPermission]? = nil, initials: String? = nil, isInherited: Bool = false) { self.accessType = accessType self.permissions = permissions nullableValidator(stringValidator())(initials) self.initials = initials self.isInherited = isInherited } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembershipInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembershipInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembershipInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembershipInfo: \(error)" + } } } - open class MembershipInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembershipInfo) -> JSON { - let output = [ - "access_type": Sharing.AccessLevelSerializer().serialize(value.accessType), - "permissions": NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), - "initials": NullableSerializer(Serialization._StringSerializer).serialize(value.initials), - "is_inherited": Serialization._BoolSerializer.serialize(value.isInherited), + + public class MembershipInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembershipInfo) throws -> JSON { + let output = [ + "access_type": try Sharing.AccessLevelSerializer().serialize(value.accessType), + "permissions": try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), + "initials": try NullableSerializer(Serialization._StringSerializer).serialize(value.initials), + "is_inherited": try Serialization._BoolSerializer.serialize(value.isInherited), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembershipInfo { + + public func deserialize(_ json: JSON) throws -> MembershipInfo { switch json { - case .dictionary(let dict): - let accessType = Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) - let permissions = NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) - let initials = NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) - let isInherited = Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) - return MembershipInfo(accessType: accessType, permissions: permissions, initials: initials, isInherited: isInherited) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessType = try Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) + let permissions = try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) + let initials = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) + let isInherited = try Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) + return MembershipInfo(accessType: accessType, permissions: permissions, initials: initials, isInherited: isInherited) + default: + throw JSONSerializerError.deserializeError(type: MembershipInfo.self, json: json) } } } /// The information about a group member of the shared content. - open class GroupMembershipInfo: Sharing.MembershipInfo { + public class GroupMembershipInfo: Sharing.MembershipInfo { /// The information about the membership group. public let group: Sharing.GroupInfo - public init(accessType: Sharing.AccessLevel, group: Sharing.GroupInfo, permissions: Array? = nil, initials: String? = nil, isInherited: Bool = false) { + public init( + accessType: Sharing.AccessLevel, + group: Sharing.GroupInfo, + permissions: [Sharing.MemberPermission]? = nil, + initials: String? = nil, + isInherited: Bool = false + ) { self.group = group super.init(accessType: accessType, permissions: permissions, initials: initials, isInherited: isInherited) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembershipInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembershipInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembershipInfo: \(error)" + } } } - open class GroupMembershipInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembershipInfo) -> JSON { - let output = [ - "access_type": Sharing.AccessLevelSerializer().serialize(value.accessType), - "group": Sharing.GroupInfoSerializer().serialize(value.group), - "permissions": NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), - "initials": NullableSerializer(Serialization._StringSerializer).serialize(value.initials), - "is_inherited": Serialization._BoolSerializer.serialize(value.isInherited), + + public class GroupMembershipInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembershipInfo) throws -> JSON { + let output = [ + "access_type": try Sharing.AccessLevelSerializer().serialize(value.accessType), + "group": try Sharing.GroupInfoSerializer().serialize(value.group), + "permissions": try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), + "initials": try NullableSerializer(Serialization._StringSerializer).serialize(value.initials), + "is_inherited": try Serialization._BoolSerializer.serialize(value.isInherited), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMembershipInfo { + + public func deserialize(_ json: JSON) throws -> GroupMembershipInfo { switch json { - case .dictionary(let dict): - let accessType = Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) - let group = Sharing.GroupInfoSerializer().deserialize(dict["group"] ?? .null) - let permissions = NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) - let initials = NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) - let isInherited = Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) - return GroupMembershipInfo(accessType: accessType, group: group, permissions: permissions, initials: initials, isInherited: isInherited) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessType = try Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) + let group = try Sharing.GroupInfoSerializer().deserialize(dict["group"] ?? .null) + let permissions = try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) + let initials = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) + let isInherited = try Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) + return GroupMembershipInfo(accessType: accessType, group: group, permissions: permissions, initials: initials, isInherited: isInherited) + default: + throw JSONSerializerError.deserializeError(type: GroupMembershipInfo.self, json: json) } } } /// The InsufficientPlan struct - open class InsufficientPlan: CustomStringConvertible { + public class InsufficientPlan: CustomStringConvertible, JSONRepresentable { /// A message to tell the user to upgrade in order to support expected action. public let message: String /// A URL to send the user to in order to obtain the account type they need, e.g. upgrading. Absent if there is @@ -2946,33 +3629,44 @@ open class Sharing { nullableValidator(stringValidator())(upsellUrl) self.upsellUrl = upsellUrl } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InsufficientPlanSerializer().serialize(self)))" + + func json() throws -> JSON { + try InsufficientPlanSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InsufficientPlanSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InsufficientPlan: \(error)" + } } } - open class InsufficientPlanSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InsufficientPlan) -> JSON { - let output = [ - "message": Serialization._StringSerializer.serialize(value.message), - "upsell_url": NullableSerializer(Serialization._StringSerializer).serialize(value.upsellUrl), + + public class InsufficientPlanSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InsufficientPlan) throws -> JSON { + let output = [ + "message": try Serialization._StringSerializer.serialize(value.message), + "upsell_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.upsellUrl), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> InsufficientPlan { + + public func deserialize(_ json: JSON) throws -> InsufficientPlan { switch json { - case .dictionary(let dict): - let message = Serialization._StringSerializer.deserialize(dict["message"] ?? .null) - let upsellUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["upsell_url"] ?? .null) - return InsufficientPlan(message: message, upsellUrl: upsellUrl) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let message = try Serialization._StringSerializer.deserialize(dict["message"] ?? .null) + let upsellUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["upsell_url"] ?? .null) + return InsufficientPlan(message: message, upsellUrl: upsellUrl) + default: + throw JSONSerializerError.deserializeError(type: InsufficientPlan.self, json: json) } } } /// The InsufficientQuotaAmounts struct - open class InsufficientQuotaAmounts: CustomStringConvertible { + public class InsufficientQuotaAmounts: CustomStringConvertible, JSONRepresentable { /// The amount of space needed to add the item (the size of the item). public let spaceNeeded: UInt64 /// The amount of extra space needed to add the item. @@ -2987,123 +3681,165 @@ open class Sharing { comparableValidator()(spaceLeft) self.spaceLeft = spaceLeft } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InsufficientQuotaAmountsSerializer().serialize(self)))" + + func json() throws -> JSON { + try InsufficientQuotaAmountsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InsufficientQuotaAmountsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InsufficientQuotaAmounts: \(error)" + } } } - open class InsufficientQuotaAmountsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InsufficientQuotaAmounts) -> JSON { - let output = [ - "space_needed": Serialization._UInt64Serializer.serialize(value.spaceNeeded), - "space_shortage": Serialization._UInt64Serializer.serialize(value.spaceShortage), - "space_left": Serialization._UInt64Serializer.serialize(value.spaceLeft), + + public class InsufficientQuotaAmountsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InsufficientQuotaAmounts) throws -> JSON { + let output = [ + "space_needed": try Serialization._UInt64Serializer.serialize(value.spaceNeeded), + "space_shortage": try Serialization._UInt64Serializer.serialize(value.spaceShortage), + "space_left": try Serialization._UInt64Serializer.serialize(value.spaceLeft), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> InsufficientQuotaAmounts { + + public func deserialize(_ json: JSON) throws -> InsufficientQuotaAmounts { switch json { - case .dictionary(let dict): - let spaceNeeded = Serialization._UInt64Serializer.deserialize(dict["space_needed"] ?? .null) - let spaceShortage = Serialization._UInt64Serializer.deserialize(dict["space_shortage"] ?? .null) - let spaceLeft = Serialization._UInt64Serializer.deserialize(dict["space_left"] ?? .null) - return InsufficientQuotaAmounts(spaceNeeded: spaceNeeded, spaceShortage: spaceShortage, spaceLeft: spaceLeft) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let spaceNeeded = try Serialization._UInt64Serializer.deserialize(dict["space_needed"] ?? .null) + let spaceShortage = try Serialization._UInt64Serializer.deserialize(dict["space_shortage"] ?? .null) + let spaceLeft = try Serialization._UInt64Serializer.deserialize(dict["space_left"] ?? .null) + return InsufficientQuotaAmounts(spaceNeeded: spaceNeeded, spaceShortage: spaceShortage, spaceLeft: spaceLeft) + default: + throw JSONSerializerError.deserializeError(type: InsufficientQuotaAmounts.self, json: json) } } } /// Information about the recipient of a shared content invitation. - public enum InviteeInfo: CustomStringConvertible { + public enum InviteeInfo: CustomStringConvertible, JSONRepresentable { /// Email address of invited user. case email(String) /// An unspecified error. case other + func json() throws -> JSON { + try InviteeInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InviteeInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InviteeInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InviteeInfo: \(error)" + } } } - open class InviteeInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InviteeInfo) -> JSON { + + public class InviteeInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InviteeInfo) throws -> JSON { switch value { - case .email(let arg): - var d = ["email": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("email") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> InviteeInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "email": - let v = Serialization._StringSerializer.deserialize(d["email"] ?? .null) - return InviteeInfo.email(v) - case "other": - return InviteeInfo.other - default: - return InviteeInfo.other - } + case .email(let arg): + var d = try ["email": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("email") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> InviteeInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "email": + let v = try Serialization._StringSerializer.deserialize(d["email"] ?? .null) + return InviteeInfo.email(v) + case "other": + return InviteeInfo.other default: - fatalError("Failed to deserialize") + return InviteeInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: InviteeInfo.self, json: json) } } } /// Information about an invited member of a shared content. - open class InviteeMembershipInfo: Sharing.MembershipInfo { + public class InviteeMembershipInfo: Sharing.MembershipInfo { /// Recipient of the invitation. public let invitee: Sharing.InviteeInfo /// The user this invitation is tied to, if available. public let user: Sharing.UserInfo? - public init(accessType: Sharing.AccessLevel, invitee: Sharing.InviteeInfo, permissions: Array? = nil, initials: String? = nil, isInherited: Bool = false, user: Sharing.UserInfo? = nil) { + public init( + accessType: Sharing.AccessLevel, + invitee: Sharing.InviteeInfo, + permissions: [Sharing.MemberPermission]? = nil, + initials: String? = nil, + isInherited: Bool = false, + user: Sharing.UserInfo? = nil + ) { self.invitee = invitee self.user = user super.init(accessType: accessType, permissions: permissions, initials: initials, isInherited: isInherited) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InviteeMembershipInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InviteeMembershipInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InviteeMembershipInfo: \(error)" + } } } - open class InviteeMembershipInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InviteeMembershipInfo) -> JSON { - let output = [ - "access_type": Sharing.AccessLevelSerializer().serialize(value.accessType), - "invitee": Sharing.InviteeInfoSerializer().serialize(value.invitee), - "permissions": NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), - "initials": NullableSerializer(Serialization._StringSerializer).serialize(value.initials), - "is_inherited": Serialization._BoolSerializer.serialize(value.isInherited), - "user": NullableSerializer(Sharing.UserInfoSerializer()).serialize(value.user), + + public class InviteeMembershipInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InviteeMembershipInfo) throws -> JSON { + let output = [ + "access_type": try Sharing.AccessLevelSerializer().serialize(value.accessType), + "invitee": try Sharing.InviteeInfoSerializer().serialize(value.invitee), + "permissions": try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), + "initials": try NullableSerializer(Serialization._StringSerializer).serialize(value.initials), + "is_inherited": try Serialization._BoolSerializer.serialize(value.isInherited), + "user": try NullableSerializer(Sharing.UserInfoSerializer()).serialize(value.user), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> InviteeMembershipInfo { + + public func deserialize(_ json: JSON) throws -> InviteeMembershipInfo { switch json { - case .dictionary(let dict): - let accessType = Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) - let invitee = Sharing.InviteeInfoSerializer().deserialize(dict["invitee"] ?? .null) - let permissions = NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) - let initials = NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) - let isInherited = Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) - let user = NullableSerializer(Sharing.UserInfoSerializer()).deserialize(dict["user"] ?? .null) - return InviteeMembershipInfo(accessType: accessType, invitee: invitee, permissions: permissions, initials: initials, isInherited: isInherited, user: user) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessType = try Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) + let invitee = try Sharing.InviteeInfoSerializer().deserialize(dict["invitee"] ?? .null) + let permissions = try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) + let initials = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) + let isInherited = try Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) + let user = try NullableSerializer(Sharing.UserInfoSerializer()).deserialize(dict["user"] ?? .null) + return InviteeMembershipInfo( + accessType: accessType, + invitee: invitee, + permissions: permissions, + initials: initials, + isInherited: isInherited, + user: user + ) + default: + throw JSONSerializerError.deserializeError(type: InviteeMembershipInfo.self, json: json) } } } /// Error occurred while performing an asynchronous job from unshareFolder or removeFolderMember. - public enum JobError: CustomStringConvertible { + public enum JobError: CustomStringConvertible, JSONRepresentable { /// Error occurred while performing unshareFolder action. case unshareFolderError(Sharing.UnshareFolderError) /// Error occurred while performing removeFolderMember action. @@ -3113,59 +3849,69 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try JobErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(JobErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try JobErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for JobError: \(error)" + } } } - open class JobErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: JobError) -> JSON { + + public class JobErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: JobError) throws -> JSON { switch value { - case .unshareFolderError(let arg): - var d = ["unshare_folder_error": Sharing.UnshareFolderErrorSerializer().serialize(arg)] - d[".tag"] = .str("unshare_folder_error") - return .dictionary(d) - case .removeFolderMemberError(let arg): - var d = ["remove_folder_member_error": Sharing.RemoveFolderMemberErrorSerializer().serialize(arg)] - d[".tag"] = .str("remove_folder_member_error") - return .dictionary(d) - case .relinquishFolderMembershipError(let arg): - var d = ["relinquish_folder_membership_error": Sharing.RelinquishFolderMembershipErrorSerializer().serialize(arg)] - d[".tag"] = .str("relinquish_folder_membership_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> JobError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unshare_folder_error": - let v = Sharing.UnshareFolderErrorSerializer().deserialize(d["unshare_folder_error"] ?? .null) - return JobError.unshareFolderError(v) - case "remove_folder_member_error": - let v = Sharing.RemoveFolderMemberErrorSerializer().deserialize(d["remove_folder_member_error"] ?? .null) - return JobError.removeFolderMemberError(v) - case "relinquish_folder_membership_error": - let v = Sharing.RelinquishFolderMembershipErrorSerializer().deserialize(d["relinquish_folder_membership_error"] ?? .null) - return JobError.relinquishFolderMembershipError(v) - case "other": - return JobError.other - default: - return JobError.other - } - default: - fatalError("Failed to deserialize") + case .unshareFolderError(let arg): + var d = try ["unshare_folder_error": Sharing.UnshareFolderErrorSerializer().serialize(arg)] + d[".tag"] = .str("unshare_folder_error") + return .dictionary(d) + case .removeFolderMemberError(let arg): + var d = try ["remove_folder_member_error": Sharing.RemoveFolderMemberErrorSerializer().serialize(arg)] + d[".tag"] = .str("remove_folder_member_error") + return .dictionary(d) + case .relinquishFolderMembershipError(let arg): + var d = try ["relinquish_folder_membership_error": Sharing.RelinquishFolderMembershipErrorSerializer().serialize(arg)] + d[".tag"] = .str("relinquish_folder_membership_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> JobError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unshare_folder_error": + let v = try Sharing.UnshareFolderErrorSerializer().deserialize(d["unshare_folder_error"] ?? .null) + return JobError.unshareFolderError(v) + case "remove_folder_member_error": + let v = try Sharing.RemoveFolderMemberErrorSerializer().deserialize(d["remove_folder_member_error"] ?? .null) + return JobError.removeFolderMemberError(v) + case "relinquish_folder_membership_error": + let v = try Sharing.RelinquishFolderMembershipErrorSerializer().deserialize(d["relinquish_folder_membership_error"] ?? .null) + return JobError.relinquishFolderMembershipError(v) + case "other": + return JobError.other + default: + return JobError.other + } + default: + throw JSONSerializerError.deserializeError(type: JobError.self, json: json) } } } /// The JobStatus union - public enum JobStatus: CustomStringConvertible { + public enum JobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The asynchronous job has finished. @@ -3173,51 +3919,61 @@ open class Sharing { /// The asynchronous job returned an error. case failed(Sharing.JobError) + func json() throws -> JSON { + try JobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(JobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try JobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for JobStatus: \(error)" + } } } - open class JobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: JobStatus) -> JSON { + + public class JobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: JobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete: - var d = [String: JSON]() - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Sharing.JobErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> JobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return JobStatus.inProgress - case "complete": - return JobStatus.complete - case "failed": - let v = Sharing.JobErrorSerializer().deserialize(d["failed"] ?? .null) - return JobStatus.failed(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete: + var d = [String: JSON]() + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Sharing.JobErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> JobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return JobStatus.inProgress + case "complete": + return JobStatus.complete + case "failed": + let v = try Sharing.JobErrorSerializer().deserialize(d["failed"] ?? .null) + return JobStatus.failed(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: JobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: JobStatus.self, json: json) } } } /// The LinkAccessLevel union - public enum LinkAccessLevel: CustomStringConvertible { + public enum LinkAccessLevel: CustomStringConvertible, JSONRepresentable { /// Users who use the link can view and comment on the content. case viewer /// Users who use the link can edit, view and comment on the content. @@ -3225,50 +3981,60 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try LinkAccessLevelSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkAccessLevelSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkAccessLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkAccessLevel: \(error)" + } } } - open class LinkAccessLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkAccessLevel) -> JSON { + + public class LinkAccessLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkAccessLevel) throws -> JSON { switch value { - case .viewer: - var d = [String: JSON]() - d[".tag"] = .str("viewer") - return .dictionary(d) - case .editor: - var d = [String: JSON]() - d[".tag"] = .str("editor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LinkAccessLevel { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "viewer": - return LinkAccessLevel.viewer - case "editor": - return LinkAccessLevel.editor - case "other": - return LinkAccessLevel.other - default: - return LinkAccessLevel.other - } + case .viewer: + var d = [String: JSON]() + d[".tag"] = .str("viewer") + return .dictionary(d) + case .editor: + var d = [String: JSON]() + d[".tag"] = .str("editor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LinkAccessLevel { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "viewer": + return LinkAccessLevel.viewer + case "editor": + return LinkAccessLevel.editor + case "other": + return LinkAccessLevel.other default: - fatalError("Failed to deserialize") + return LinkAccessLevel.other + } + default: + throw JSONSerializerError.deserializeError(type: LinkAccessLevel.self, json: json) } } } /// Actions that can be performed on a link. - public enum LinkAction: CustomStringConvertible { + public enum LinkAction: CustomStringConvertible, JSONRepresentable { /// Change the access level of the link. case changeAccessLevel /// Change the audience of the link. @@ -3284,81 +4050,91 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try LinkActionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkActionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkActionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkAction: \(error)" + } } } - open class LinkActionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkAction) -> JSON { + + public class LinkActionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkAction) throws -> JSON { switch value { - case .changeAccessLevel: - var d = [String: JSON]() - d[".tag"] = .str("change_access_level") - return .dictionary(d) - case .changeAudience: - var d = [String: JSON]() - d[".tag"] = .str("change_audience") - return .dictionary(d) - case .removeExpiry: - var d = [String: JSON]() - d[".tag"] = .str("remove_expiry") - return .dictionary(d) - case .removePassword: - var d = [String: JSON]() - d[".tag"] = .str("remove_password") - return .dictionary(d) - case .setExpiry: - var d = [String: JSON]() - d[".tag"] = .str("set_expiry") - return .dictionary(d) - case .setPassword: - var d = [String: JSON]() - d[".tag"] = .str("set_password") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LinkAction { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "change_access_level": - return LinkAction.changeAccessLevel - case "change_audience": - return LinkAction.changeAudience - case "remove_expiry": - return LinkAction.removeExpiry - case "remove_password": - return LinkAction.removePassword - case "set_expiry": - return LinkAction.setExpiry - case "set_password": - return LinkAction.setPassword - case "other": - return LinkAction.other - default: - return LinkAction.other - } - default: - fatalError("Failed to deserialize") + case .changeAccessLevel: + var d = [String: JSON]() + d[".tag"] = .str("change_access_level") + return .dictionary(d) + case .changeAudience: + var d = [String: JSON]() + d[".tag"] = .str("change_audience") + return .dictionary(d) + case .removeExpiry: + var d = [String: JSON]() + d[".tag"] = .str("remove_expiry") + return .dictionary(d) + case .removePassword: + var d = [String: JSON]() + d[".tag"] = .str("remove_password") + return .dictionary(d) + case .setExpiry: + var d = [String: JSON]() + d[".tag"] = .str("set_expiry") + return .dictionary(d) + case .setPassword: + var d = [String: JSON]() + d[".tag"] = .str("set_password") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LinkAction { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "change_access_level": + return LinkAction.changeAccessLevel + case "change_audience": + return LinkAction.changeAudience + case "remove_expiry": + return LinkAction.removeExpiry + case "remove_password": + return LinkAction.removePassword + case "set_expiry": + return LinkAction.setExpiry + case "set_password": + return LinkAction.setPassword + case "other": + return LinkAction.other + default: + return LinkAction.other + } + default: + throw JSONSerializerError.deserializeError(type: LinkAction.self, json: json) } } } /// The LinkAudience union - public enum LinkAudience: CustomStringConvertible { + public enum LinkAudience: CustomStringConvertible, JSONRepresentable { /// Link is accessible by anyone. case public_ /// Link is accessible only by team members. case team /// The link can be used by no one. The link merely points the user to the content, and does not grant - /// additional rights to the user. Members of the content who use this link can only access the content with - /// their pre-existing access rights. + /// additional rights to the user. Members of the content who use this link can only access the content + /// with their pre-existing access rights. case noOne /// Use `require_password` instead. A link-specific password is required to access the link. Login is not /// required. @@ -3368,68 +4144,78 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try LinkAudienceSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkAudienceSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkAudienceSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkAudience: \(error)" + } } } - open class LinkAudienceSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkAudience) -> JSON { + + public class LinkAudienceSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkAudience) throws -> JSON { switch value { - case .public_: - var d = [String: JSON]() - d[".tag"] = .str("public") - return .dictionary(d) - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .noOne: - var d = [String: JSON]() - d[".tag"] = .str("no_one") - return .dictionary(d) - case .password: - var d = [String: JSON]() - d[".tag"] = .str("password") - return .dictionary(d) - case .members: - var d = [String: JSON]() - d[".tag"] = .str("members") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LinkAudience { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "public": - return LinkAudience.public_ - case "team": - return LinkAudience.team - case "no_one": - return LinkAudience.noOne - case "password": - return LinkAudience.password - case "members": - return LinkAudience.members - case "other": - return LinkAudience.other - default: - return LinkAudience.other - } - default: - fatalError("Failed to deserialize") + case .public_: + var d = [String: JSON]() + d[".tag"] = .str("public") + return .dictionary(d) + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .noOne: + var d = [String: JSON]() + d[".tag"] = .str("no_one") + return .dictionary(d) + case .password: + var d = [String: JSON]() + d[".tag"] = .str("password") + return .dictionary(d) + case .members: + var d = [String: JSON]() + d[".tag"] = .str("members") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LinkAudience { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "public": + return LinkAudience.public_ + case "team": + return LinkAudience.team + case "no_one": + return LinkAudience.noOne + case "password": + return LinkAudience.password + case "members": + return LinkAudience.members + case "other": + return LinkAudience.other + default: + return LinkAudience.other + } + default: + throw JSONSerializerError.deserializeError(type: LinkAudience.self, json: json) } } } /// The VisibilityPolicyDisallowedReason union - public enum VisibilityPolicyDisallowedReason: CustomStringConvertible { + public enum VisibilityPolicyDisallowedReason: CustomStringConvertible, JSONRepresentable { /// The user needs to delete and recreate the link to change the visibility policy. case deleteAndRecreate /// The parent shared folder restricts sharing of links outside the shared folder. To change the visibility @@ -3446,74 +4232,84 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try VisibilityPolicyDisallowedReasonSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(VisibilityPolicyDisallowedReasonSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try VisibilityPolicyDisallowedReasonSerializer().serialize(self)))" + } catch { + return "Failed to generate description for VisibilityPolicyDisallowedReason: \(error)" + } } } - open class VisibilityPolicyDisallowedReasonSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: VisibilityPolicyDisallowedReason) -> JSON { + + public class VisibilityPolicyDisallowedReasonSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: VisibilityPolicyDisallowedReason) throws -> JSON { switch value { - case .deleteAndRecreate: - var d = [String: JSON]() - d[".tag"] = .str("delete_and_recreate") - return .dictionary(d) - case .restrictedBySharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("restricted_by_shared_folder") - return .dictionary(d) - case .restrictedByTeam: - var d = [String: JSON]() - d[".tag"] = .str("restricted_by_team") - return .dictionary(d) - case .userNotOnTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_on_team") - return .dictionary(d) - case .userAccountType: - var d = [String: JSON]() - d[".tag"] = .str("user_account_type") - return .dictionary(d) - case .permissionDenied: - var d = [String: JSON]() - d[".tag"] = .str("permission_denied") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> VisibilityPolicyDisallowedReason { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "delete_and_recreate": - return VisibilityPolicyDisallowedReason.deleteAndRecreate - case "restricted_by_shared_folder": - return VisibilityPolicyDisallowedReason.restrictedBySharedFolder - case "restricted_by_team": - return VisibilityPolicyDisallowedReason.restrictedByTeam - case "user_not_on_team": - return VisibilityPolicyDisallowedReason.userNotOnTeam - case "user_account_type": - return VisibilityPolicyDisallowedReason.userAccountType - case "permission_denied": - return VisibilityPolicyDisallowedReason.permissionDenied - case "other": - return VisibilityPolicyDisallowedReason.other - default: - return VisibilityPolicyDisallowedReason.other - } - default: - fatalError("Failed to deserialize") + case .deleteAndRecreate: + var d = [String: JSON]() + d[".tag"] = .str("delete_and_recreate") + return .dictionary(d) + case .restrictedBySharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("restricted_by_shared_folder") + return .dictionary(d) + case .restrictedByTeam: + var d = [String: JSON]() + d[".tag"] = .str("restricted_by_team") + return .dictionary(d) + case .userNotOnTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_on_team") + return .dictionary(d) + case .userAccountType: + var d = [String: JSON]() + d[".tag"] = .str("user_account_type") + return .dictionary(d) + case .permissionDenied: + var d = [String: JSON]() + d[".tag"] = .str("permission_denied") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> VisibilityPolicyDisallowedReason { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "delete_and_recreate": + return VisibilityPolicyDisallowedReason.deleteAndRecreate + case "restricted_by_shared_folder": + return VisibilityPolicyDisallowedReason.restrictedBySharedFolder + case "restricted_by_team": + return VisibilityPolicyDisallowedReason.restrictedByTeam + case "user_not_on_team": + return VisibilityPolicyDisallowedReason.userNotOnTeam + case "user_account_type": + return VisibilityPolicyDisallowedReason.userAccountType + case "permission_denied": + return VisibilityPolicyDisallowedReason.permissionDenied + case "other": + return VisibilityPolicyDisallowedReason.other + default: + return VisibilityPolicyDisallowedReason.other + } + default: + throw JSONSerializerError.deserializeError(type: VisibilityPolicyDisallowedReason.self, json: json) } } } /// check documentation for VisibilityPolicyDisallowedReason. - public enum LinkAudienceDisallowedReason: CustomStringConvertible { + public enum LinkAudienceDisallowedReason: CustomStringConvertible, JSONRepresentable { /// The user needs to delete and recreate the link to change the visibility policy. case deleteAndRecreate /// The parent shared folder restricts sharing of links outside the shared folder. To change the visibility @@ -3530,74 +4326,84 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try LinkAudienceDisallowedReasonSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkAudienceDisallowedReasonSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkAudienceDisallowedReasonSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkAudienceDisallowedReason: \(error)" + } } } - open class LinkAudienceDisallowedReasonSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkAudienceDisallowedReason) -> JSON { + + public class LinkAudienceDisallowedReasonSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkAudienceDisallowedReason) throws -> JSON { switch value { - case .deleteAndRecreate: - var d = [String: JSON]() - d[".tag"] = .str("delete_and_recreate") - return .dictionary(d) - case .restrictedBySharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("restricted_by_shared_folder") - return .dictionary(d) - case .restrictedByTeam: - var d = [String: JSON]() - d[".tag"] = .str("restricted_by_team") - return .dictionary(d) - case .userNotOnTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_on_team") - return .dictionary(d) - case .userAccountType: - var d = [String: JSON]() - d[".tag"] = .str("user_account_type") - return .dictionary(d) - case .permissionDenied: - var d = [String: JSON]() - d[".tag"] = .str("permission_denied") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LinkAudienceDisallowedReason { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "delete_and_recreate": - return LinkAudienceDisallowedReason.deleteAndRecreate - case "restricted_by_shared_folder": - return LinkAudienceDisallowedReason.restrictedBySharedFolder - case "restricted_by_team": - return LinkAudienceDisallowedReason.restrictedByTeam - case "user_not_on_team": - return LinkAudienceDisallowedReason.userNotOnTeam - case "user_account_type": - return LinkAudienceDisallowedReason.userAccountType - case "permission_denied": - return LinkAudienceDisallowedReason.permissionDenied - case "other": - return LinkAudienceDisallowedReason.other - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .deleteAndRecreate: + var d = [String: JSON]() + d[".tag"] = .str("delete_and_recreate") + return .dictionary(d) + case .restrictedBySharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("restricted_by_shared_folder") + return .dictionary(d) + case .restrictedByTeam: + var d = [String: JSON]() + d[".tag"] = .str("restricted_by_team") + return .dictionary(d) + case .userNotOnTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_on_team") + return .dictionary(d) + case .userAccountType: + var d = [String: JSON]() + d[".tag"] = .str("user_account_type") + return .dictionary(d) + case .permissionDenied: + var d = [String: JSON]() + d[".tag"] = .str("permission_denied") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LinkAudienceDisallowedReason { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "delete_and_recreate": + return LinkAudienceDisallowedReason.deleteAndRecreate + case "restricted_by_shared_folder": + return LinkAudienceDisallowedReason.restrictedBySharedFolder + case "restricted_by_team": + return LinkAudienceDisallowedReason.restrictedByTeam + case "user_not_on_team": + return LinkAudienceDisallowedReason.userNotOnTeam + case "user_account_type": + return LinkAudienceDisallowedReason.userAccountType + case "permission_denied": + return LinkAudienceDisallowedReason.permissionDenied + case "other": + return LinkAudienceDisallowedReason.other + default: + throw JSONSerializerError.unknownTag(type: LinkAudienceDisallowedReason.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LinkAudienceDisallowedReason.self, json: json) } } } /// The LinkAudienceOption struct - open class LinkAudienceOption: CustomStringConvertible { + public class LinkAudienceOption: CustomStringConvertible, JSONRepresentable { /// Specifies who can access the link. public let audience: Sharing.LinkAudience /// Whether the user calling this API can select this audience option. @@ -3610,35 +4416,47 @@ open class Sharing { self.allowed = allowed self.disallowedReason = disallowedReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkAudienceOptionSerializer().serialize(self)))" + + func json() throws -> JSON { + try LinkAudienceOptionSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkAudienceOptionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkAudienceOption: \(error)" + } } } - open class LinkAudienceOptionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkAudienceOption) -> JSON { - let output = [ - "audience": Sharing.LinkAudienceSerializer().serialize(value.audience), - "allowed": Serialization._BoolSerializer.serialize(value.allowed), - "disallowed_reason": NullableSerializer(Sharing.LinkAudienceDisallowedReasonSerializer()).serialize(value.disallowedReason), + + public class LinkAudienceOptionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkAudienceOption) throws -> JSON { + let output = [ + "audience": try Sharing.LinkAudienceSerializer().serialize(value.audience), + "allowed": try Serialization._BoolSerializer.serialize(value.allowed), + "disallowed_reason": try NullableSerializer(Sharing.LinkAudienceDisallowedReasonSerializer()).serialize(value.disallowedReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LinkAudienceOption { + + public func deserialize(_ json: JSON) throws -> LinkAudienceOption { switch json { - case .dictionary(let dict): - let audience = Sharing.LinkAudienceSerializer().deserialize(dict["audience"] ?? .null) - let allowed = Serialization._BoolSerializer.deserialize(dict["allowed"] ?? .null) - let disallowedReason = NullableSerializer(Sharing.LinkAudienceDisallowedReasonSerializer()).deserialize(dict["disallowed_reason"] ?? .null) - return LinkAudienceOption(audience: audience, allowed: allowed, disallowedReason: disallowedReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let audience = try Sharing.LinkAudienceSerializer().deserialize(dict["audience"] ?? .null) + let allowed = try Serialization._BoolSerializer.deserialize(dict["allowed"] ?? .null) + let disallowedReason = try NullableSerializer(Sharing.LinkAudienceDisallowedReasonSerializer()) + .deserialize(dict["disallowed_reason"] ?? .null) + return LinkAudienceOption(audience: audience, allowed: allowed, disallowedReason: disallowedReason) + default: + throw JSONSerializerError.deserializeError(type: LinkAudienceOption.self, json: json) } } } /// The LinkExpiry union - public enum LinkExpiry: CustomStringConvertible { + public enum LinkExpiry: CustomStringConvertible, JSONRepresentable { /// Remove the currently set expiry for the link. case removeExpiry /// Set a new expiry or change an existing expiry. @@ -3646,51 +4464,61 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try LinkExpirySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkExpirySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkExpirySerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkExpiry: \(error)" + } } } - open class LinkExpirySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkExpiry) -> JSON { + + public class LinkExpirySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkExpiry) throws -> JSON { switch value { - case .removeExpiry: - var d = [String: JSON]() - d[".tag"] = .str("remove_expiry") - return .dictionary(d) - case .setExpiry(let arg): - var d = ["set_expiry": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(arg)] - d[".tag"] = .str("set_expiry") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LinkExpiry { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "remove_expiry": - return LinkExpiry.removeExpiry - case "set_expiry": - let v = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(d["set_expiry"] ?? .null) - return LinkExpiry.setExpiry(v) - case "other": - return LinkExpiry.other - default: - return LinkExpiry.other - } + case .removeExpiry: + var d = [String: JSON]() + d[".tag"] = .str("remove_expiry") + return .dictionary(d) + case .setExpiry(let arg): + var d = try ["set_expiry": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(arg)] + d[".tag"] = .str("set_expiry") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LinkExpiry { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "remove_expiry": + return LinkExpiry.removeExpiry + case "set_expiry": + let v = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(d["set_expiry"] ?? .null) + return LinkExpiry.setExpiry(v) + case "other": + return LinkExpiry.other default: - fatalError("Failed to deserialize") + return LinkExpiry.other + } + default: + throw JSONSerializerError.deserializeError(type: LinkExpiry.self, json: json) } } } /// The LinkPassword union - public enum LinkPassword: CustomStringConvertible { + public enum LinkPassword: CustomStringConvertible, JSONRepresentable { /// Remove the currently set password for the link. case removePassword /// Set a new password or change an existing password. @@ -3698,51 +4526,61 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try LinkPasswordSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkPasswordSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkPasswordSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkPassword: \(error)" + } } } - open class LinkPasswordSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkPassword) -> JSON { + + public class LinkPasswordSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkPassword) throws -> JSON { switch value { - case .removePassword: - var d = [String: JSON]() - d[".tag"] = .str("remove_password") - return .dictionary(d) - case .setPassword(let arg): - var d = ["set_password": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("set_password") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LinkPassword { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "remove_password": - return LinkPassword.removePassword - case "set_password": - let v = Serialization._StringSerializer.deserialize(d["set_password"] ?? .null) - return LinkPassword.setPassword(v) - case "other": - return LinkPassword.other - default: - return LinkPassword.other - } + case .removePassword: + var d = [String: JSON]() + d[".tag"] = .str("remove_password") + return .dictionary(d) + case .setPassword(let arg): + var d = try ["set_password": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("set_password") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LinkPassword { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "remove_password": + return LinkPassword.removePassword + case "set_password": + let v = try Serialization._StringSerializer.deserialize(d["set_password"] ?? .null) + return LinkPassword.setPassword(v) + case "other": + return LinkPassword.other default: - fatalError("Failed to deserialize") + return LinkPassword.other + } + default: + throw JSONSerializerError.deserializeError(type: LinkPassword.self, json: json) } } } /// Permissions for actions that can be performed on a link. - open class LinkPermission: CustomStringConvertible { + public class LinkPermission: CustomStringConvertible, JSONRepresentable { /// (no description) public let action: Sharing.LinkAction /// (no description) @@ -3754,43 +4592,55 @@ open class Sharing { self.allow = allow self.reason = reason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkPermissionSerializer().serialize(self)))" + + func json() throws -> JSON { + try LinkPermissionSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkPermissionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkPermission: \(error)" + } } } - open class LinkPermissionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkPermission) -> JSON { - let output = [ - "action": Sharing.LinkActionSerializer().serialize(value.action), - "allow": Serialization._BoolSerializer.serialize(value.allow), - "reason": NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), + + public class LinkPermissionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkPermission) throws -> JSON { + let output = [ + "action": try Sharing.LinkActionSerializer().serialize(value.action), + "allow": try Serialization._BoolSerializer.serialize(value.allow), + "reason": try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LinkPermission { + + public func deserialize(_ json: JSON) throws -> LinkPermission { switch json { - case .dictionary(let dict): - let action = Sharing.LinkActionSerializer().deserialize(dict["action"] ?? .null) - let allow = Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) - let reason = NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) - return LinkPermission(action: action, allow: allow, reason: reason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let action = try Sharing.LinkActionSerializer().deserialize(dict["action"] ?? .null) + let allow = try Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) + let reason = try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) + return LinkPermission(action: action, allow: allow, reason: reason) + default: + throw JSONSerializerError.deserializeError(type: LinkPermission.self, json: json) } } } /// The LinkPermissions struct - open class LinkPermissions: CustomStringConvertible { + public class LinkPermissions: CustomStringConvertible, JSONRepresentable { /// The current visibility of the link after considering the shared links policies of the the team (in case the - /// link's owner is part of a team) and the shared folder (in case the linked file is part of a shared folder). - /// This field is shown only if the caller has access to this info (the link's owner always has access to this - /// data). For some links, an effective_audience value is returned instead. + /// link's owner is part of a team) and the shared folder (in case the linked file is part of a shared + /// folder). This field is shown only if the caller has access to this info (the link's owner always has + /// access to this data). For some links, an effective_audience value is returned instead. public let resolvedVisibility: Sharing.ResolvedVisibility? /// The shared link's requested visibility. This can be overridden by the team and shared folder policies. The - /// final visibility, after considering these policies, can be found in resolvedVisibility. This is shown only - /// if the caller is the link's owner and resolved_visibility is returned instead of effective_audience. + /// final visibility, after considering these policies, can be found in resolvedVisibility. This is + /// shown only if the caller is the link's owner and resolved_visibility is returned instead of + /// effective_audience. public let requestedVisibility: Sharing.RequestedVisibility? /// Whether the caller can revoke the shared link. public let canRevoke: Bool @@ -3799,13 +4649,14 @@ open class Sharing { /// The type of audience who can benefit from the access level specified by the `link_access_level` field. public let effectiveAudience: Sharing.LinkAudience? /// The access level that the link will grant to its users. A link can grant additional rights to a user beyond - /// their current access level. For example, if a user was invited as a viewer to a file, and then opens a link - /// with `link_access_level` set to `editor`, then they will gain editor privileges. The `link_access_level` is - /// a property of the link, and does not depend on who is calling this API. In particular, `link_access_level` - /// does not take into account the API caller's current permissions to the content. + /// their current access level. For example, if a user was invited as a viewer to a file, and then opens + /// a link with `link_access_level` set to `editor`, then they will gain editor privileges. The + /// `link_access_level` is a property of the link, and does not depend on who is calling this API. In + /// particular, `link_access_level` does not take into account the API caller's current permissions to + /// the content. public let linkAccessLevel: Sharing.LinkAccessLevel? /// A list of policies that the user might be able to set for the visibility. - public let visibilityPolicies: Array + public let visibilityPolicies: [Sharing.VisibilityPolicy] /// Whether the user can set the expiry settings of the link. This refers to the ability to create a new expiry /// and modify an existing expiry. public let canSetExpiry: Bool @@ -3824,7 +4675,7 @@ open class Sharing { /// Whether the team has disabled commenting globally. public let teamRestrictsComments: Bool /// A list of link audience options the user might be able to set as the new audience. - public let audienceOptions: Array? + public let audienceOptions: [Sharing.LinkAudienceOption]? /// Whether the user can set a password for the link. public let canSetPassword: Bool? /// Whether the user can remove the password of the link. @@ -3833,7 +4684,27 @@ open class Sharing { public let requirePassword: Bool? /// Whether the user can use extended sharing controls, based on their account type. public let canUseExtendedSharingControls: Bool? - public init(canRevoke: Bool, visibilityPolicies: Array, canSetExpiry: Bool, canRemoveExpiry: Bool, allowDownload: Bool, canAllowDownload: Bool, canDisallowDownload: Bool, allowComments: Bool, teamRestrictsComments: Bool, resolvedVisibility: Sharing.ResolvedVisibility? = nil, requestedVisibility: Sharing.RequestedVisibility? = nil, revokeFailureReason: Sharing.SharedLinkAccessFailureReason? = nil, effectiveAudience: Sharing.LinkAudience? = nil, linkAccessLevel: Sharing.LinkAccessLevel? = nil, audienceOptions: Array? = nil, canSetPassword: Bool? = nil, canRemovePassword: Bool? = nil, requirePassword: Bool? = nil, canUseExtendedSharingControls: Bool? = nil) { + public init( + canRevoke: Bool, + visibilityPolicies: [Sharing.VisibilityPolicy], + canSetExpiry: Bool, + canRemoveExpiry: Bool, + allowDownload: Bool, + canAllowDownload: Bool, + canDisallowDownload: Bool, + allowComments: Bool, + teamRestrictsComments: Bool, + resolvedVisibility: Sharing.ResolvedVisibility? = nil, + requestedVisibility: Sharing.RequestedVisibility? = nil, + revokeFailureReason: Sharing.SharedLinkAccessFailureReason? = nil, + effectiveAudience: Sharing.LinkAudience? = nil, + linkAccessLevel: Sharing.LinkAccessLevel? = nil, + audienceOptions: [Sharing.LinkAudienceOption]? = nil, + canSetPassword: Bool? = nil, + canRemovePassword: Bool? = nil, + requirePassword: Bool? = nil, + canUseExtendedSharingControls: Bool? = nil + ) { self.resolvedVisibility = resolvedVisibility self.requestedVisibility = requestedVisibility self.canRevoke = canRevoke @@ -3854,67 +4725,101 @@ open class Sharing { self.requirePassword = requirePassword self.canUseExtendedSharingControls = canUseExtendedSharingControls } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkPermissionsSerializer().serialize(self)))" - } - } - open class LinkPermissionsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkPermissions) -> JSON { - let output = [ - "can_revoke": Serialization._BoolSerializer.serialize(value.canRevoke), - "visibility_policies": ArraySerializer(Sharing.VisibilityPolicySerializer()).serialize(value.visibilityPolicies), - "can_set_expiry": Serialization._BoolSerializer.serialize(value.canSetExpiry), - "can_remove_expiry": Serialization._BoolSerializer.serialize(value.canRemoveExpiry), - "allow_download": Serialization._BoolSerializer.serialize(value.allowDownload), - "can_allow_download": Serialization._BoolSerializer.serialize(value.canAllowDownload), - "can_disallow_download": Serialization._BoolSerializer.serialize(value.canDisallowDownload), - "allow_comments": Serialization._BoolSerializer.serialize(value.allowComments), - "team_restricts_comments": Serialization._BoolSerializer.serialize(value.teamRestrictsComments), - "resolved_visibility": NullableSerializer(Sharing.ResolvedVisibilitySerializer()).serialize(value.resolvedVisibility), - "requested_visibility": NullableSerializer(Sharing.RequestedVisibilitySerializer()).serialize(value.requestedVisibility), - "revoke_failure_reason": NullableSerializer(Sharing.SharedLinkAccessFailureReasonSerializer()).serialize(value.revokeFailureReason), - "effective_audience": NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.effectiveAudience), - "link_access_level": NullableSerializer(Sharing.LinkAccessLevelSerializer()).serialize(value.linkAccessLevel), - "audience_options": NullableSerializer(ArraySerializer(Sharing.LinkAudienceOptionSerializer())).serialize(value.audienceOptions), - "can_set_password": NullableSerializer(Serialization._BoolSerializer).serialize(value.canSetPassword), - "can_remove_password": NullableSerializer(Serialization._BoolSerializer).serialize(value.canRemovePassword), - "require_password": NullableSerializer(Serialization._BoolSerializer).serialize(value.requirePassword), - "can_use_extended_sharing_controls": NullableSerializer(Serialization._BoolSerializer).serialize(value.canUseExtendedSharingControls), + + func json() throws -> JSON { + try LinkPermissionsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkPermissionsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkPermissions: \(error)" + } + } + } + + public class LinkPermissionsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkPermissions) throws -> JSON { + let output = [ + "can_revoke": try Serialization._BoolSerializer.serialize(value.canRevoke), + "visibility_policies": try ArraySerializer(Sharing.VisibilityPolicySerializer()).serialize(value.visibilityPolicies), + "can_set_expiry": try Serialization._BoolSerializer.serialize(value.canSetExpiry), + "can_remove_expiry": try Serialization._BoolSerializer.serialize(value.canRemoveExpiry), + "allow_download": try Serialization._BoolSerializer.serialize(value.allowDownload), + "can_allow_download": try Serialization._BoolSerializer.serialize(value.canAllowDownload), + "can_disallow_download": try Serialization._BoolSerializer.serialize(value.canDisallowDownload), + "allow_comments": try Serialization._BoolSerializer.serialize(value.allowComments), + "team_restricts_comments": try Serialization._BoolSerializer.serialize(value.teamRestrictsComments), + "resolved_visibility": try NullableSerializer(Sharing.ResolvedVisibilitySerializer()).serialize(value.resolvedVisibility), + "requested_visibility": try NullableSerializer(Sharing.RequestedVisibilitySerializer()).serialize(value.requestedVisibility), + "revoke_failure_reason": try NullableSerializer(Sharing.SharedLinkAccessFailureReasonSerializer()).serialize(value.revokeFailureReason), + "effective_audience": try NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.effectiveAudience), + "link_access_level": try NullableSerializer(Sharing.LinkAccessLevelSerializer()).serialize(value.linkAccessLevel), + "audience_options": try NullableSerializer(ArraySerializer(Sharing.LinkAudienceOptionSerializer())).serialize(value.audienceOptions), + "can_set_password": try NullableSerializer(Serialization._BoolSerializer).serialize(value.canSetPassword), + "can_remove_password": try NullableSerializer(Serialization._BoolSerializer).serialize(value.canRemovePassword), + "require_password": try NullableSerializer(Serialization._BoolSerializer).serialize(value.requirePassword), + "can_use_extended_sharing_controls": try NullableSerializer(Serialization._BoolSerializer).serialize(value.canUseExtendedSharingControls), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LinkPermissions { - switch json { - case .dictionary(let dict): - let canRevoke = Serialization._BoolSerializer.deserialize(dict["can_revoke"] ?? .null) - let visibilityPolicies = ArraySerializer(Sharing.VisibilityPolicySerializer()).deserialize(dict["visibility_policies"] ?? .null) - let canSetExpiry = Serialization._BoolSerializer.deserialize(dict["can_set_expiry"] ?? .null) - let canRemoveExpiry = Serialization._BoolSerializer.deserialize(dict["can_remove_expiry"] ?? .null) - let allowDownload = Serialization._BoolSerializer.deserialize(dict["allow_download"] ?? .null) - let canAllowDownload = Serialization._BoolSerializer.deserialize(dict["can_allow_download"] ?? .null) - let canDisallowDownload = Serialization._BoolSerializer.deserialize(dict["can_disallow_download"] ?? .null) - let allowComments = Serialization._BoolSerializer.deserialize(dict["allow_comments"] ?? .null) - let teamRestrictsComments = Serialization._BoolSerializer.deserialize(dict["team_restricts_comments"] ?? .null) - let resolvedVisibility = NullableSerializer(Sharing.ResolvedVisibilitySerializer()).deserialize(dict["resolved_visibility"] ?? .null) - let requestedVisibility = NullableSerializer(Sharing.RequestedVisibilitySerializer()).deserialize(dict["requested_visibility"] ?? .null) - let revokeFailureReason = NullableSerializer(Sharing.SharedLinkAccessFailureReasonSerializer()).deserialize(dict["revoke_failure_reason"] ?? .null) - let effectiveAudience = NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["effective_audience"] ?? .null) - let linkAccessLevel = NullableSerializer(Sharing.LinkAccessLevelSerializer()).deserialize(dict["link_access_level"] ?? .null) - let audienceOptions = NullableSerializer(ArraySerializer(Sharing.LinkAudienceOptionSerializer())).deserialize(dict["audience_options"] ?? .null) - let canSetPassword = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["can_set_password"] ?? .null) - let canRemovePassword = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["can_remove_password"] ?? .null) - let requirePassword = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["require_password"] ?? .null) - let canUseExtendedSharingControls = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["can_use_extended_sharing_controls"] ?? .null) - return LinkPermissions(canRevoke: canRevoke, visibilityPolicies: visibilityPolicies, canSetExpiry: canSetExpiry, canRemoveExpiry: canRemoveExpiry, allowDownload: allowDownload, canAllowDownload: canAllowDownload, canDisallowDownload: canDisallowDownload, allowComments: allowComments, teamRestrictsComments: teamRestrictsComments, resolvedVisibility: resolvedVisibility, requestedVisibility: requestedVisibility, revokeFailureReason: revokeFailureReason, effectiveAudience: effectiveAudience, linkAccessLevel: linkAccessLevel, audienceOptions: audienceOptions, canSetPassword: canSetPassword, canRemovePassword: canRemovePassword, requirePassword: requirePassword, canUseExtendedSharingControls: canUseExtendedSharingControls) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> LinkPermissions { + switch json { + case .dictionary(let dict): + let canRevoke = try Serialization._BoolSerializer.deserialize(dict["can_revoke"] ?? .null) + let visibilityPolicies = try ArraySerializer(Sharing.VisibilityPolicySerializer()).deserialize(dict["visibility_policies"] ?? .null) + let canSetExpiry = try Serialization._BoolSerializer.deserialize(dict["can_set_expiry"] ?? .null) + let canRemoveExpiry = try Serialization._BoolSerializer.deserialize(dict["can_remove_expiry"] ?? .null) + let allowDownload = try Serialization._BoolSerializer.deserialize(dict["allow_download"] ?? .null) + let canAllowDownload = try Serialization._BoolSerializer.deserialize(dict["can_allow_download"] ?? .null) + let canDisallowDownload = try Serialization._BoolSerializer.deserialize(dict["can_disallow_download"] ?? .null) + let allowComments = try Serialization._BoolSerializer.deserialize(dict["allow_comments"] ?? .null) + let teamRestrictsComments = try Serialization._BoolSerializer.deserialize(dict["team_restricts_comments"] ?? .null) + let resolvedVisibility = try NullableSerializer(Sharing.ResolvedVisibilitySerializer()).deserialize(dict["resolved_visibility"] ?? .null) + let requestedVisibility = try NullableSerializer(Sharing.RequestedVisibilitySerializer()).deserialize(dict["requested_visibility"] ?? .null) + let revokeFailureReason = try NullableSerializer(Sharing.SharedLinkAccessFailureReasonSerializer()) + .deserialize(dict["revoke_failure_reason"] ?? .null) + let effectiveAudience = try NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["effective_audience"] ?? .null) + let linkAccessLevel = try NullableSerializer(Sharing.LinkAccessLevelSerializer()).deserialize(dict["link_access_level"] ?? .null) + let audienceOptions = try NullableSerializer(ArraySerializer(Sharing.LinkAudienceOptionSerializer())) + .deserialize(dict["audience_options"] ?? .null) + let canSetPassword = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["can_set_password"] ?? .null) + let canRemovePassword = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["can_remove_password"] ?? .null) + let requirePassword = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["require_password"] ?? .null) + let canUseExtendedSharingControls = try NullableSerializer(Serialization._BoolSerializer) + .deserialize(dict["can_use_extended_sharing_controls"] ?? .null) + return LinkPermissions( + canRevoke: canRevoke, + visibilityPolicies: visibilityPolicies, + canSetExpiry: canSetExpiry, + canRemoveExpiry: canRemoveExpiry, + allowDownload: allowDownload, + canAllowDownload: canAllowDownload, + canDisallowDownload: canDisallowDownload, + allowComments: allowComments, + teamRestrictsComments: teamRestrictsComments, + resolvedVisibility: resolvedVisibility, + requestedVisibility: requestedVisibility, + revokeFailureReason: revokeFailureReason, + effectiveAudience: effectiveAudience, + linkAccessLevel: linkAccessLevel, + audienceOptions: audienceOptions, + canSetPassword: canSetPassword, + canRemovePassword: canRemovePassword, + requirePassword: requirePassword, + canUseExtendedSharingControls: canUseExtendedSharingControls + ) + default: + throw JSONSerializerError.deserializeError(type: LinkPermissions.self, json: json) } } } /// Settings that apply to a link. - open class LinkSettings: CustomStringConvertible { + public class LinkSettings: CustomStringConvertible, JSONRepresentable { /// The access level on the link for this file. Currently, it only accepts 'viewer' and 'viewer_no_comment'. public let accessLevel: Sharing.AccessLevel? /// The type of audience on the link for this file. @@ -3923,52 +4828,68 @@ open class Sharing { public let expiry: Sharing.LinkExpiry? /// The password for the link. public let password: Sharing.LinkPassword? - public init(accessLevel: Sharing.AccessLevel? = nil, audience: Sharing.LinkAudience? = nil, expiry: Sharing.LinkExpiry? = nil, password: Sharing.LinkPassword? = nil) { + public init( + accessLevel: Sharing.AccessLevel? = nil, + audience: Sharing.LinkAudience? = nil, + expiry: Sharing.LinkExpiry? = nil, + password: Sharing.LinkPassword? = nil + ) { self.accessLevel = accessLevel self.audience = audience self.expiry = expiry self.password = password } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkSettingsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LinkSettingsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkSettingsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkSettings: \(error)" + } } } - open class LinkSettingsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkSettings) -> JSON { - let output = [ - "access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), - "audience": NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.audience), - "expiry": NullableSerializer(Sharing.LinkExpirySerializer()).serialize(value.expiry), - "password": NullableSerializer(Sharing.LinkPasswordSerializer()).serialize(value.password), + + public class LinkSettingsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkSettings) throws -> JSON { + let output = [ + "access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), + "audience": try NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.audience), + "expiry": try NullableSerializer(Sharing.LinkExpirySerializer()).serialize(value.expiry), + "password": try NullableSerializer(Sharing.LinkPasswordSerializer()).serialize(value.password), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LinkSettings { + + public func deserialize(_ json: JSON) throws -> LinkSettings { switch json { - case .dictionary(let dict): - let accessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) - let audience = NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience"] ?? .null) - let expiry = NullableSerializer(Sharing.LinkExpirySerializer()).deserialize(dict["expiry"] ?? .null) - let password = NullableSerializer(Sharing.LinkPasswordSerializer()).deserialize(dict["password"] ?? .null) - return LinkSettings(accessLevel: accessLevel, audience: audience, expiry: expiry, password: password) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) + let audience = try NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience"] ?? .null) + let expiry = try NullableSerializer(Sharing.LinkExpirySerializer()).deserialize(dict["expiry"] ?? .null) + let password = try NullableSerializer(Sharing.LinkPasswordSerializer()).deserialize(dict["password"] ?? .null) + return LinkSettings(accessLevel: accessLevel, audience: audience, expiry: expiry, password: password) + default: + throw JSONSerializerError.deserializeError(type: LinkSettings.self, json: json) } } } /// Arguments for listFileMembers. - open class ListFileMembersArg: CustomStringConvertible { + public class ListFileMembersArg: CustomStringConvertible, JSONRepresentable { /// The file for which you want to see members. public let file: String /// The actions for which to return permissions on a member. - public let actions: Array? + public let actions: [Sharing.MemberAction]? /// Whether to include members who only have access from a parent shared folder. public let includeInherited: Bool /// Number of members to return max per query. Defaults to 100 if no limit is specified. public let limit: UInt32 - public init(file: String, actions: Array? = nil, includeInherited: Bool = true, limit: UInt32 = 100) { + public init(file: String, actions: [Sharing.MemberAction]? = nil, includeInherited: Bool = true, limit: UInt32 = 100) { stringValidator(minLength: 1, pattern: "((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?")(file) self.file = file self.actions = actions @@ -3976,74 +4897,96 @@ open class Sharing { comparableValidator(minValue: 1, maxValue: 300)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileMembersArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersArg: \(error)" + } } } - open class ListFileMembersArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersArg) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), - "actions": NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).serialize(value.actions), - "include_inherited": Serialization._BoolSerializer.serialize(value.includeInherited), - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class ListFileMembersArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersArg) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), + "actions": try NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).serialize(value.actions), + "include_inherited": try Serialization._BoolSerializer.serialize(value.includeInherited), + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileMembersArg { + + public func deserialize(_ json: JSON) throws -> ListFileMembersArg { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - let actions = NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).deserialize(dict["actions"] ?? .null) - let includeInherited = Serialization._BoolSerializer.deserialize(dict["include_inherited"] ?? .number(1)) - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(100)) - return ListFileMembersArg(file: file, actions: actions, includeInherited: includeInherited, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + let actions = try NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).deserialize(dict["actions"] ?? .null) + let includeInherited = try Serialization._BoolSerializer.deserialize(dict["include_inherited"] ?? .number(1)) + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(100)) + return ListFileMembersArg(file: file, actions: actions, includeInherited: includeInherited, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersArg.self, json: json) } } } /// Arguments for listFileMembersBatch. - open class ListFileMembersBatchArg: CustomStringConvertible { + public class ListFileMembersBatchArg: CustomStringConvertible, JSONRepresentable { /// Files for which to return members. - public let files: Array + public let files: [String] /// Number of members to return max per query. Defaults to 10 if no limit is specified. public let limit: UInt32 - public init(files: Array, limit: UInt32 = 10) { + public init(files: [String], limit: UInt32 = 10) { arrayValidator(maxItems: 100, itemValidator: stringValidator(minLength: 1, pattern: "((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?"))(files) self.files = files comparableValidator(maxValue: 20)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileMembersBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersBatchArg: \(error)" + } } } - open class ListFileMembersBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersBatchArg) -> JSON { - let output = [ - "files": ArraySerializer(Serialization._StringSerializer).serialize(value.files), - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class ListFileMembersBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersBatchArg) throws -> JSON { + let output = [ + "files": try ArraySerializer(Serialization._StringSerializer).serialize(value.files), + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileMembersBatchArg { + + public func deserialize(_ json: JSON) throws -> ListFileMembersBatchArg { switch json { - case .dictionary(let dict): - let files = ArraySerializer(Serialization._StringSerializer).deserialize(dict["files"] ?? .null) - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(10)) - return ListFileMembersBatchArg(files: files, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let files = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["files"] ?? .null) + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(10)) + return ListFileMembersBatchArg(files: files, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersBatchArg.self, json: json) } } } /// Per-file result for listFileMembersBatch. - open class ListFileMembersBatchResult: CustomStringConvertible { + public class ListFileMembersBatchResult: CustomStringConvertible, JSONRepresentable { /// This is the input file identifier, whether an ID or a path. public let file: String /// The result for this particular file. @@ -4053,64 +4996,86 @@ open class Sharing { self.file = file self.result = result } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileMembersBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersBatchResult: \(error)" + } } } - open class ListFileMembersBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersBatchResult) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), - "result": Sharing.ListFileMembersIndividualResultSerializer().serialize(value.result), + + public class ListFileMembersBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersBatchResult) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), + "result": try Sharing.ListFileMembersIndividualResultSerializer().serialize(value.result), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileMembersBatchResult { + + public func deserialize(_ json: JSON) throws -> ListFileMembersBatchResult { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - let result = Sharing.ListFileMembersIndividualResultSerializer().deserialize(dict["result"] ?? .null) - return ListFileMembersBatchResult(file: file, result: result) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + let result = try Sharing.ListFileMembersIndividualResultSerializer().deserialize(dict["result"] ?? .null) + return ListFileMembersBatchResult(file: file, result: result) + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersBatchResult.self, json: json) } } } /// Arguments for listFileMembersContinue. - open class ListFileMembersContinueArg: CustomStringConvertible { + public class ListFileMembersContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned by your last call to listFileMembers, listFileMembersContinue, or listFileMembersBatch. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileMembersContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersContinueArg: \(error)" + } } } - open class ListFileMembersContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListFileMembersContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileMembersContinueArg { + + public func deserialize(_ json: JSON) throws -> ListFileMembersContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListFileMembersContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListFileMembersContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersContinueArg.self, json: json) } } } /// Error for listFileMembersContinue. - public enum ListFileMembersContinueError: CustomStringConvertible { + public enum ListFileMembersContinueError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case userError(Sharing.SharingUserError) /// An unspecified error. @@ -4120,58 +5085,68 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ListFileMembersContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersContinueError: \(error)" + } } } - open class ListFileMembersContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersContinueError) -> JSON { + + public class ListFileMembersContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersContinueError) throws -> JSON { switch value { - case .userError(let arg): - var d = ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] - d[".tag"] = .str("user_error") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFileMembersContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_error": - let v = Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) - return ListFileMembersContinueError.userError(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return ListFileMembersContinueError.accessError(v) - case "invalid_cursor": - return ListFileMembersContinueError.invalidCursor - case "other": - return ListFileMembersContinueError.other - default: - return ListFileMembersContinueError.other - } - default: - fatalError("Failed to deserialize") + case .userError(let arg): + var d = try ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFileMembersContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_error": + let v = try Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) + return ListFileMembersContinueError.userError(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return ListFileMembersContinueError.accessError(v) + case "invalid_cursor": + return ListFileMembersContinueError.invalidCursor + case "other": + return ListFileMembersContinueError.other + default: + return ListFileMembersContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersContinueError.self, json: json) } } } /// The ListFileMembersCountResult struct - open class ListFileMembersCountResult: CustomStringConvertible { + public class ListFileMembersCountResult: CustomStringConvertible, JSONRepresentable { /// A list of members on this file. public let members: Sharing.SharedFileMembers /// The number of members on this file. This does not include inherited members. @@ -4181,33 +5156,44 @@ open class Sharing { comparableValidator()(memberCount) self.memberCount = memberCount } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersCountResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFileMembersCountResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersCountResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersCountResult: \(error)" + } } } - open class ListFileMembersCountResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersCountResult) -> JSON { - let output = [ - "members": Sharing.SharedFileMembersSerializer().serialize(value.members), - "member_count": Serialization._UInt32Serializer.serialize(value.memberCount), + + public class ListFileMembersCountResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersCountResult) throws -> JSON { + let output = [ + "members": try Sharing.SharedFileMembersSerializer().serialize(value.members), + "member_count": try Serialization._UInt32Serializer.serialize(value.memberCount), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFileMembersCountResult { + + public func deserialize(_ json: JSON) throws -> ListFileMembersCountResult { switch json { - case .dictionary(let dict): - let members = Sharing.SharedFileMembersSerializer().deserialize(dict["members"] ?? .null) - let memberCount = Serialization._UInt32Serializer.deserialize(dict["member_count"] ?? .null) - return ListFileMembersCountResult(members: members, memberCount: memberCount) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let members = try Sharing.SharedFileMembersSerializer().deserialize(dict["members"] ?? .null) + let memberCount = try Serialization._UInt32Serializer.deserialize(dict["member_count"] ?? .null) + return ListFileMembersCountResult(members: members, memberCount: memberCount) + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersCountResult.self, json: json) } } } /// Error for listFileMembers. - public enum ListFileMembersError: CustomStringConvertible { + public enum ListFileMembersError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case userError(Sharing.SharingUserError) /// An unspecified error. @@ -4215,52 +5201,62 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ListFileMembersErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersError: \(error)" + } } } - open class ListFileMembersErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersError) -> JSON { + + public class ListFileMembersErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersError) throws -> JSON { switch value { - case .userError(let arg): - var d = ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] - d[".tag"] = .str("user_error") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFileMembersError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_error": - let v = Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) - return ListFileMembersError.userError(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return ListFileMembersError.accessError(v) - case "other": - return ListFileMembersError.other - default: - return ListFileMembersError.other - } + case .userError(let arg): + var d = try ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFileMembersError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_error": + let v = try Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) + return ListFileMembersError.userError(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return ListFileMembersError.accessError(v) + case "other": + return ListFileMembersError.other default: - fatalError("Failed to deserialize") + return ListFileMembersError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersError.self, json: json) } } } /// The ListFileMembersIndividualResult union - public enum ListFileMembersIndividualResult: CustomStringConvertible { + public enum ListFileMembersIndividualResult: CustomStringConvertible, JSONRepresentable { /// The results of the query for this file if it was successful. case result(Sharing.ListFileMembersCountResult) /// The result of the query for this file if it was an error. @@ -4268,120 +5264,152 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ListFileMembersIndividualResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFileMembersIndividualResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFileMembersIndividualResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFileMembersIndividualResult: \(error)" + } } } - open class ListFileMembersIndividualResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFileMembersIndividualResult) -> JSON { + + public class ListFileMembersIndividualResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFileMembersIndividualResult) throws -> JSON { switch value { - case .result(let arg): - var d = Serialization.getFields(Sharing.ListFileMembersCountResultSerializer().serialize(arg)) - d[".tag"] = .str("result") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFileMembersIndividualResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "result": - let v = Sharing.ListFileMembersCountResultSerializer().deserialize(json) - return ListFileMembersIndividualResult.result(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return ListFileMembersIndividualResult.accessError(v) - case "other": - return ListFileMembersIndividualResult.other - default: - return ListFileMembersIndividualResult.other - } + case .result(let arg): + var d = try Serialization.getFields(Sharing.ListFileMembersCountResultSerializer().serialize(arg)) + d[".tag"] = .str("result") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFileMembersIndividualResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "result": + let v = try Sharing.ListFileMembersCountResultSerializer().deserialize(json) + return ListFileMembersIndividualResult.result(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return ListFileMembersIndividualResult.accessError(v) + case "other": + return ListFileMembersIndividualResult.other default: - fatalError("Failed to deserialize") + return ListFileMembersIndividualResult.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFileMembersIndividualResult.self, json: json) } } } /// Arguments for listReceivedFiles. - open class ListFilesArg: CustomStringConvertible { + public class ListFilesArg: CustomStringConvertible, JSONRepresentable { /// Number of files to return max per query. Defaults to 100 if no limit is specified. public let limit: UInt32 /// A list of `FileAction`s corresponding to `FilePermission`s that should appear in the response's permissions /// in SharedFileMetadata field describing the actions the authenticated user can perform on the file. - public let actions: Array? - public init(limit: UInt32 = 100, actions: Array? = nil) { + public let actions: [Sharing.FileAction]? + public init(limit: UInt32 = 100, actions: [Sharing.FileAction]? = nil) { comparableValidator(minValue: 1, maxValue: 300)(limit) self.limit = limit self.actions = actions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFilesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFilesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFilesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFilesArg: \(error)" + } } } - open class ListFilesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFilesArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), - "actions": NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).serialize(value.actions), + + public class ListFilesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFilesArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), + "actions": try NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).serialize(value.actions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFilesArg { + + public func deserialize(_ json: JSON) throws -> ListFilesArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(100)) - let actions = NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).deserialize(dict["actions"] ?? .null) - return ListFilesArg(limit: limit, actions: actions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(100)) + let actions = try NullableSerializer(ArraySerializer(Sharing.FileActionSerializer())).deserialize(dict["actions"] ?? .null) + return ListFilesArg(limit: limit, actions: actions) + default: + throw JSONSerializerError.deserializeError(type: ListFilesArg.self, json: json) } } } /// Arguments for listReceivedFilesContinue. - open class ListFilesContinueArg: CustomStringConvertible { + public class ListFilesContinueArg: CustomStringConvertible, JSONRepresentable { /// Cursor in cursor in ListFilesResult. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFilesContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFilesContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFilesContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFilesContinueArg: \(error)" + } } } - open class ListFilesContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFilesContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListFilesContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFilesContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFilesContinueArg { + + public func deserialize(_ json: JSON) throws -> ListFilesContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListFilesContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListFilesContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFilesContinueArg.self, json: json) } } } /// Error results for listReceivedFilesContinue. - public enum ListFilesContinueError: CustomStringConvertible { + public enum ListFilesContinueError: CustomStringConvertible, JSONRepresentable { /// User account had a problem. case userError(Sharing.SharingUserError) /// cursor in ListFilesContinueArg is invalid. @@ -4389,191 +5417,241 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ListFilesContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFilesContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFilesContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFilesContinueError: \(error)" + } } } - open class ListFilesContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFilesContinueError) -> JSON { + + public class ListFilesContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFilesContinueError) throws -> JSON { switch value { - case .userError(let arg): - var d = ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] - d[".tag"] = .str("user_error") - return .dictionary(d) - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFilesContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_error": - let v = Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) - return ListFilesContinueError.userError(v) - case "invalid_cursor": - return ListFilesContinueError.invalidCursor - case "other": - return ListFilesContinueError.other - default: - return ListFilesContinueError.other - } + case .userError(let arg): + var d = try ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFilesContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_error": + let v = try Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) + return ListFilesContinueError.userError(v) + case "invalid_cursor": + return ListFilesContinueError.invalidCursor + case "other": + return ListFilesContinueError.other default: - fatalError("Failed to deserialize") + return ListFilesContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFilesContinueError.self, json: json) } } } /// Success results for listReceivedFiles. - open class ListFilesResult: CustomStringConvertible { + public class ListFilesResult: CustomStringConvertible, JSONRepresentable { /// Information about the files shared with current user. - public let entries: Array + public let entries: [Sharing.SharedFileMetadata] /// Cursor used to obtain additional shared files. public let cursor: String? - public init(entries: Array, cursor: String? = nil) { + public init(entries: [Sharing.SharedFileMetadata], cursor: String? = nil) { self.entries = entries nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFilesResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFilesResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFilesResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFilesResult: \(error)" + } } } - open class ListFilesResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFilesResult) -> JSON { - let output = [ - "entries": ArraySerializer(Sharing.SharedFileMetadataSerializer()).serialize(value.entries), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListFilesResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFilesResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Sharing.SharedFileMetadataSerializer()).serialize(value.entries), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFilesResult { + + public func deserialize(_ json: JSON) throws -> ListFilesResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Sharing.SharedFileMetadataSerializer()).deserialize(dict["entries"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListFilesResult(entries: entries, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Sharing.SharedFileMetadataSerializer()).deserialize(dict["entries"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListFilesResult(entries: entries, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFilesResult.self, json: json) } } } /// The ListFolderMembersCursorArg struct - open class ListFolderMembersCursorArg: CustomStringConvertible { + public class ListFolderMembersCursorArg: CustomStringConvertible, JSONRepresentable { /// This is a list indicating whether each returned member will include a boolean value allow in /// MemberPermission that describes whether the current user can perform the MemberAction on the member. - public let actions: Array? + public let actions: [Sharing.MemberAction]? /// The maximum number of results that include members, groups and invitees to return per request. public let limit: UInt32 - public init(actions: Array? = nil, limit: UInt32 = 1000) { + public init(actions: [Sharing.MemberAction]? = nil, limit: UInt32 = 1_000) { self.actions = actions - comparableValidator(minValue: 1, maxValue: 1000)(limit) + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderMembersCursorArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFolderMembersCursorArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderMembersCursorArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderMembersCursorArg: \(error)" + } } } - open class ListFolderMembersCursorArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderMembersCursorArg) -> JSON { - let output = [ - "actions": NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).serialize(value.actions), - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class ListFolderMembersCursorArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderMembersCursorArg) throws -> JSON { + let output = [ + "actions": try NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).serialize(value.actions), + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderMembersCursorArg { + + public func deserialize(_ json: JSON) throws -> ListFolderMembersCursorArg { switch json { - case .dictionary(let dict): - let actions = NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).deserialize(dict["actions"] ?? .null) - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return ListFolderMembersCursorArg(actions: actions, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let actions = try NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).deserialize(dict["actions"] ?? .null) + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return ListFolderMembersCursorArg(actions: actions, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListFolderMembersCursorArg.self, json: json) } } } /// The ListFolderMembersArgs struct - open class ListFolderMembersArgs: Sharing.ListFolderMembersCursorArg { + public class ListFolderMembersArgs: Sharing.ListFolderMembersCursorArg { /// The ID for the shared folder. public let sharedFolderId: String - public init(sharedFolderId: String, actions: Array? = nil, limit: UInt32 = 1000) { + public init(sharedFolderId: String, actions: [Sharing.MemberAction]? = nil, limit: UInt32 = 1_000) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId super.init(actions: actions, limit: limit) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderMembersArgsSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderMembersArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderMembersArgs: \(error)" + } } } - open class ListFolderMembersArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderMembersArgs) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "actions": NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).serialize(value.actions), - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class ListFolderMembersArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderMembersArgs) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "actions": try NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).serialize(value.actions), + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderMembersArgs { + + public func deserialize(_ json: JSON) throws -> ListFolderMembersArgs { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let actions = NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).deserialize(dict["actions"] ?? .null) - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return ListFolderMembersArgs(sharedFolderId: sharedFolderId, actions: actions, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let actions = try NullableSerializer(ArraySerializer(Sharing.MemberActionSerializer())).deserialize(dict["actions"] ?? .null) + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return ListFolderMembersArgs(sharedFolderId: sharedFolderId, actions: actions, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ListFolderMembersArgs.self, json: json) } } } /// The ListFolderMembersContinueArg struct - open class ListFolderMembersContinueArg: CustomStringConvertible { + public class ListFolderMembersContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned by your last call to listFolderMembers or listFolderMembersContinue. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderMembersContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFolderMembersContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderMembersContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderMembersContinueArg: \(error)" + } } } - open class ListFolderMembersContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderMembersContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListFolderMembersContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderMembersContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFolderMembersContinueArg { + + public func deserialize(_ json: JSON) throws -> ListFolderMembersContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListFolderMembersContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListFolderMembersContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFolderMembersContinueArg.self, json: json) } } } /// The ListFolderMembersContinueError union - public enum ListFolderMembersContinueError: CustomStringConvertible { + public enum ListFolderMembersContinueError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// cursor in ListFolderMembersContinueArg is invalid. @@ -4581,202 +5659,255 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ListFolderMembersContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFolderMembersContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFolderMembersContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFolderMembersContinueError: \(error)" + } } } - open class ListFolderMembersContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFolderMembersContinueError) -> JSON { + + public class ListFolderMembersContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFolderMembersContinueError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFolderMembersContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return ListFolderMembersContinueError.accessError(v) - case "invalid_cursor": - return ListFolderMembersContinueError.invalidCursor - case "other": - return ListFolderMembersContinueError.other - default: - return ListFolderMembersContinueError.other - } + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFolderMembersContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return ListFolderMembersContinueError.accessError(v) + case "invalid_cursor": + return ListFolderMembersContinueError.invalidCursor + case "other": + return ListFolderMembersContinueError.other default: - fatalError("Failed to deserialize") + return ListFolderMembersContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFolderMembersContinueError.self, json: json) } } } /// The ListFoldersArgs struct - open class ListFoldersArgs: CustomStringConvertible { + public class ListFoldersArgs: CustomStringConvertible, JSONRepresentable { /// The maximum number of results to return per request. public let limit: UInt32 /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's - /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the - /// folder. - public let actions: Array? - public init(limit: UInt32 = 1000, actions: Array? = nil) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform + /// on the folder. + public let actions: [Sharing.FolderAction]? + public init(limit: UInt32 = 1_000, actions: [Sharing.FolderAction]? = nil) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit self.actions = actions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFoldersArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFoldersArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFoldersArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFoldersArgs: \(error)" + } } } - open class ListFoldersArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFoldersArgs) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), - "actions": NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), + + public class ListFoldersArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFoldersArgs) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), + "actions": try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFoldersArgs { + + public func deserialize(_ json: JSON) throws -> ListFoldersArgs { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - let actions = NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) - return ListFoldersArgs(limit: limit, actions: actions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + let actions = try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) + return ListFoldersArgs(limit: limit, actions: actions) + default: + throw JSONSerializerError.deserializeError(type: ListFoldersArgs.self, json: json) } } } /// The ListFoldersContinueArg struct - open class ListFoldersContinueArg: CustomStringConvertible { + public class ListFoldersContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned by the previous API call specified in the endpoint description. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFoldersContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFoldersContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFoldersContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFoldersContinueArg: \(error)" + } } } - open class ListFoldersContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFoldersContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ListFoldersContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFoldersContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFoldersContinueArg { + + public func deserialize(_ json: JSON) throws -> ListFoldersContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ListFoldersContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ListFoldersContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFoldersContinueArg.self, json: json) } } } /// The ListFoldersContinueError union - public enum ListFoldersContinueError: CustomStringConvertible { + public enum ListFoldersContinueError: CustomStringConvertible, JSONRepresentable { /// cursor in ListFoldersContinueArg is invalid. case invalidCursor /// An unspecified error. case other + func json() throws -> JSON { + try ListFoldersContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFoldersContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFoldersContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFoldersContinueError: \(error)" + } } } - open class ListFoldersContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFoldersContinueError) -> JSON { + + public class ListFoldersContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFoldersContinueError) throws -> JSON { switch value { - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListFoldersContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_cursor": - return ListFoldersContinueError.invalidCursor - case "other": - return ListFoldersContinueError.other - default: - return ListFoldersContinueError.other - } + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListFoldersContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_cursor": + return ListFoldersContinueError.invalidCursor + case "other": + return ListFoldersContinueError.other default: - fatalError("Failed to deserialize") + return ListFoldersContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListFoldersContinueError.self, json: json) } } } /// Result for listFolders or listMountableFolders, depending on which endpoint was requested. Unmounted shared /// folders can be identified by the absence of pathLower in SharedFolderMetadata. - open class ListFoldersResult: CustomStringConvertible { + public class ListFoldersResult: CustomStringConvertible, JSONRepresentable { /// List of all shared folders the authenticated user has access to. - public let entries: Array + public let entries: [Sharing.SharedFolderMetadata] /// Present if there are additional shared folders that have not been returned yet. Pass the cursor into the /// corresponding continue endpoint (either listFoldersContinue or listMountableFoldersContinue) to list /// additional folders. public let cursor: String? - public init(entries: Array, cursor: String? = nil) { + public init(entries: [Sharing.SharedFolderMetadata], cursor: String? = nil) { self.entries = entries nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListFoldersResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListFoldersResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListFoldersResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListFoldersResult: \(error)" + } } } - open class ListFoldersResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListFoldersResult) -> JSON { - let output = [ - "entries": ArraySerializer(Sharing.SharedFolderMetadataSerializer()).serialize(value.entries), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListFoldersResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListFoldersResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Sharing.SharedFolderMetadataSerializer()).serialize(value.entries), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListFoldersResult { + + public func deserialize(_ json: JSON) throws -> ListFoldersResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Sharing.SharedFolderMetadataSerializer()).deserialize(dict["entries"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListFoldersResult(entries: entries, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Sharing.SharedFolderMetadataSerializer()).deserialize(dict["entries"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListFoldersResult(entries: entries, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListFoldersResult.self, json: json) } } } /// The ListSharedLinksArg struct - open class ListSharedLinksArg: CustomStringConvertible { + public class ListSharedLinksArg: CustomStringConvertible, JSONRepresentable { /// See listSharedLinks description. public let path: String? /// The cursor returned by your last call to listSharedLinks. @@ -4790,35 +5921,46 @@ open class Sharing { self.cursor = cursor self.directOnly = directOnly } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListSharedLinksArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListSharedLinksArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListSharedLinksArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListSharedLinksArg: \(error)" + } } } - open class ListSharedLinksArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListSharedLinksArg) -> JSON { - let output = [ - "path": NullableSerializer(Serialization._StringSerializer).serialize(value.path), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), - "direct_only": NullableSerializer(Serialization._BoolSerializer).serialize(value.directOnly), + + public class ListSharedLinksArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListSharedLinksArg) throws -> JSON { + let output = [ + "path": try NullableSerializer(Serialization._StringSerializer).serialize(value.path), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + "direct_only": try NullableSerializer(Serialization._BoolSerializer).serialize(value.directOnly), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListSharedLinksArg { + + public func deserialize(_ json: JSON) throws -> ListSharedLinksArg { switch json { - case .dictionary(let dict): - let path = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - let directOnly = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["direct_only"] ?? .null) - return ListSharedLinksArg(path: path, cursor: cursor, directOnly: directOnly) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + let directOnly = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["direct_only"] ?? .null) + return ListSharedLinksArg(path: path, cursor: cursor, directOnly: directOnly) + default: + throw JSONSerializerError.deserializeError(type: ListSharedLinksArg.self, json: json) } } } /// The ListSharedLinksError union - public enum ListSharedLinksError: CustomStringConvertible { + public enum ListSharedLinksError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case path(Files.LookupError) /// Indicates that the cursor has been invalidated. Call listSharedLinks to obtain a new cursor. @@ -4826,136 +5968,169 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ListSharedLinksErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListSharedLinksErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListSharedLinksErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListSharedLinksError: \(error)" + } } } - open class ListSharedLinksErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListSharedLinksError) -> JSON { + + public class ListSharedLinksErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListSharedLinksError) throws -> JSON { switch value { - case .path(let arg): - var d = ["path": Files.LookupErrorSerializer().serialize(arg)] - d[".tag"] = .str("path") - return .dictionary(d) - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListSharedLinksError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "path": - let v = Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) - return ListSharedLinksError.path(v) - case "reset": - return ListSharedLinksError.reset - case "other": - return ListSharedLinksError.other - default: - return ListSharedLinksError.other - } + case .path(let arg): + var d = try ["path": Files.LookupErrorSerializer().serialize(arg)] + d[".tag"] = .str("path") + return .dictionary(d) + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListSharedLinksError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "path": + let v = try Files.LookupErrorSerializer().deserialize(d["path"] ?? .null) + return ListSharedLinksError.path(v) + case "reset": + return ListSharedLinksError.reset + case "other": + return ListSharedLinksError.other default: - fatalError("Failed to deserialize") + return ListSharedLinksError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListSharedLinksError.self, json: json) } } } /// The ListSharedLinksResult struct - open class ListSharedLinksResult: CustomStringConvertible { + public class ListSharedLinksResult: CustomStringConvertible, JSONRepresentable { /// Shared links applicable to the path argument. - public let links: Array + public let links: [Sharing.SharedLinkMetadata] /// Is true if there are additional shared links that have not been returned yet. Pass the cursor into /// listSharedLinks to retrieve them. public let hasMore: Bool /// Pass the cursor into listSharedLinks to obtain the additional links. Cursor is returned only if no path is /// given. public let cursor: String? - public init(links: Array, hasMore: Bool, cursor: String? = nil) { + public init(links: [Sharing.SharedLinkMetadata], hasMore: Bool, cursor: String? = nil) { self.links = links self.hasMore = hasMore nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListSharedLinksResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListSharedLinksResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListSharedLinksResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListSharedLinksResult: \(error)" + } } } - open class ListSharedLinksResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListSharedLinksResult) -> JSON { - let output = [ - "links": ArraySerializer(Sharing.SharedLinkMetadataSerializer()).serialize(value.links), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListSharedLinksResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListSharedLinksResult) throws -> JSON { + let output = [ + "links": try ArraySerializer(Sharing.SharedLinkMetadataSerializer()).serialize(value.links), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListSharedLinksResult { + + public func deserialize(_ json: JSON) throws -> ListSharedLinksResult { switch json { - case .dictionary(let dict): - let links = ArraySerializer(Sharing.SharedLinkMetadataSerializer()).deserialize(dict["links"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListSharedLinksResult(links: links, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let links = try ArraySerializer(Sharing.SharedLinkMetadataSerializer()).deserialize(dict["links"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListSharedLinksResult(links: links, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListSharedLinksResult.self, json: json) } } } /// Contains information about a member's access level to content after an operation. - open class MemberAccessLevelResult: CustomStringConvertible { + public class MemberAccessLevelResult: CustomStringConvertible, JSONRepresentable { /// The member still has this level of access to the content through a parent folder. public let accessLevel: Sharing.AccessLevel? /// A localized string with additional information about why the user has this access level to the content. public let warning: String? /// The parent folders that a member has access to. The field is present if the user has access to the first /// parent folder where the member gains access. - public let accessDetails: Array? - public init(accessLevel: Sharing.AccessLevel? = nil, warning: String? = nil, accessDetails: Array? = nil) { + public let accessDetails: [Sharing.ParentFolderAccessInfo]? + public init(accessLevel: Sharing.AccessLevel? = nil, warning: String? = nil, accessDetails: [Sharing.ParentFolderAccessInfo]? = nil) { self.accessLevel = accessLevel nullableValidator(stringValidator())(warning) self.warning = warning self.accessDetails = accessDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAccessLevelResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberAccessLevelResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAccessLevelResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAccessLevelResult: \(error)" + } } } - open class MemberAccessLevelResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAccessLevelResult) -> JSON { - let output = [ - "access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), - "warning": NullableSerializer(Serialization._StringSerializer).serialize(value.warning), - "access_details": NullableSerializer(ArraySerializer(Sharing.ParentFolderAccessInfoSerializer())).serialize(value.accessDetails), + + public class MemberAccessLevelResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAccessLevelResult) throws -> JSON { + let output = [ + "access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), + "warning": try NullableSerializer(Serialization._StringSerializer).serialize(value.warning), + "access_details": try NullableSerializer(ArraySerializer(Sharing.ParentFolderAccessInfoSerializer())).serialize(value.accessDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberAccessLevelResult { + + public func deserialize(_ json: JSON) throws -> MemberAccessLevelResult { switch json { - case .dictionary(let dict): - let accessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) - let warning = NullableSerializer(Serialization._StringSerializer).deserialize(dict["warning"] ?? .null) - let accessDetails = NullableSerializer(ArraySerializer(Sharing.ParentFolderAccessInfoSerializer())).deserialize(dict["access_details"] ?? .null) - return MemberAccessLevelResult(accessLevel: accessLevel, warning: warning, accessDetails: accessDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) + let warning = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["warning"] ?? .null) + let accessDetails = try NullableSerializer(ArraySerializer(Sharing.ParentFolderAccessInfoSerializer())) + .deserialize(dict["access_details"] ?? .null) + return MemberAccessLevelResult(accessLevel: accessLevel, warning: warning, accessDetails: accessDetails) + default: + throw JSONSerializerError.deserializeError(type: MemberAccessLevelResult.self, json: json) } } } /// Actions that may be taken on members of a shared folder. - public enum MemberAction: CustomStringConvertible { + public enum MemberAction: CustomStringConvertible, JSONRepresentable { /// Allow the member to keep a copy of the folder when removing. case leaveACopy /// Make the member an editor of the folder. @@ -4971,74 +6146,84 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try MemberActionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberActionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberActionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAction: \(error)" + } } } - open class MemberActionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAction) -> JSON { + + public class MemberActionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAction) throws -> JSON { switch value { - case .leaveACopy: - var d = [String: JSON]() - d[".tag"] = .str("leave_a_copy") - return .dictionary(d) - case .makeEditor: - var d = [String: JSON]() - d[".tag"] = .str("make_editor") - return .dictionary(d) - case .makeOwner: - var d = [String: JSON]() - d[".tag"] = .str("make_owner") - return .dictionary(d) - case .makeViewer: - var d = [String: JSON]() - d[".tag"] = .str("make_viewer") - return .dictionary(d) - case .makeViewerNoComment: - var d = [String: JSON]() - d[".tag"] = .str("make_viewer_no_comment") - return .dictionary(d) - case .remove: - var d = [String: JSON]() - d[".tag"] = .str("remove") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberAction { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "leave_a_copy": - return MemberAction.leaveACopy - case "make_editor": - return MemberAction.makeEditor - case "make_owner": - return MemberAction.makeOwner - case "make_viewer": - return MemberAction.makeViewer - case "make_viewer_no_comment": - return MemberAction.makeViewerNoComment - case "remove": - return MemberAction.remove - case "other": - return MemberAction.other - default: - return MemberAction.other - } - default: - fatalError("Failed to deserialize") + case .leaveACopy: + var d = [String: JSON]() + d[".tag"] = .str("leave_a_copy") + return .dictionary(d) + case .makeEditor: + var d = [String: JSON]() + d[".tag"] = .str("make_editor") + return .dictionary(d) + case .makeOwner: + var d = [String: JSON]() + d[".tag"] = .str("make_owner") + return .dictionary(d) + case .makeViewer: + var d = [String: JSON]() + d[".tag"] = .str("make_viewer") + return .dictionary(d) + case .makeViewerNoComment: + var d = [String: JSON]() + d[".tag"] = .str("make_viewer_no_comment") + return .dictionary(d) + case .remove: + var d = [String: JSON]() + d[".tag"] = .str("remove") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberAction { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "leave_a_copy": + return MemberAction.leaveACopy + case "make_editor": + return MemberAction.makeEditor + case "make_owner": + return MemberAction.makeOwner + case "make_viewer": + return MemberAction.makeViewer + case "make_viewer_no_comment": + return MemberAction.makeViewerNoComment + case "remove": + return MemberAction.remove + case "other": + return MemberAction.other + default: + return MemberAction.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberAction.self, json: json) } } } /// Whether the user is allowed to take the action on the associated member. - open class MemberPermission: CustomStringConvertible { + public class MemberPermission: CustomStringConvertible, JSONRepresentable { /// The action that the user may wish to take on the member. public let action: Sharing.MemberAction /// True if the user is allowed to take the action. @@ -5050,35 +6235,46 @@ open class Sharing { self.allow = allow self.reason = reason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberPermissionSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberPermissionSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberPermissionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberPermission: \(error)" + } } } - open class MemberPermissionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberPermission) -> JSON { - let output = [ - "action": Sharing.MemberActionSerializer().serialize(value.action), - "allow": Serialization._BoolSerializer.serialize(value.allow), - "reason": NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), + + public class MemberPermissionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberPermission) throws -> JSON { + let output = [ + "action": try Sharing.MemberActionSerializer().serialize(value.action), + "allow": try Serialization._BoolSerializer.serialize(value.allow), + "reason": try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).serialize(value.reason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberPermission { + + public func deserialize(_ json: JSON) throws -> MemberPermission { switch json { - case .dictionary(let dict): - let action = Sharing.MemberActionSerializer().deserialize(dict["action"] ?? .null) - let allow = Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) - let reason = NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) - return MemberPermission(action: action, allow: allow, reason: reason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let action = try Sharing.MemberActionSerializer().deserialize(dict["action"] ?? .null) + let allow = try Serialization._BoolSerializer.deserialize(dict["allow"] ?? .null) + let reason = try NullableSerializer(Sharing.PermissionDeniedReasonSerializer()).deserialize(dict["reason"] ?? .null) + return MemberPermission(action: action, allow: allow, reason: reason) + default: + throw JSONSerializerError.deserializeError(type: MemberPermission.self, json: json) } } } /// Policy governing who can be a member of a shared folder. Only applicable to folders owned by a user on a team. - public enum MemberPolicy: CustomStringConvertible { + public enum MemberPolicy: CustomStringConvertible, JSONRepresentable { /// Only a teammate can become a member. case team /// Anyone can become a member. @@ -5086,50 +6282,60 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try MemberPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberPolicy: \(error)" + } } } - open class MemberPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberPolicy) -> JSON { + + public class MemberPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberPolicy) throws -> JSON { switch value { - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .anyone: - var d = [String: JSON]() - d[".tag"] = .str("anyone") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team": - return MemberPolicy.team - case "anyone": - return MemberPolicy.anyone - case "other": - return MemberPolicy.other - default: - return MemberPolicy.other - } + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .anyone: + var d = [String: JSON]() + d[".tag"] = .str("anyone") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team": + return MemberPolicy.team + case "anyone": + return MemberPolicy.anyone + case "other": + return MemberPolicy.other default: - fatalError("Failed to deserialize") + return MemberPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberPolicy.self, json: json) } } } /// Includes different ways to identify a member of a shared folder. - public enum MemberSelector: CustomStringConvertible { + public enum MemberSelector: CustomStringConvertible, JSONRepresentable { /// Dropbox account, team member, or group ID of member. case dropboxId(String) /// Email address of member. @@ -5137,52 +6343,62 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try MemberSelectorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSelectorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSelectorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSelector: \(error)" + } } } - open class MemberSelectorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSelector) -> JSON { + + public class MemberSelectorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSelector) throws -> JSON { switch value { - case .dropboxId(let arg): - var d = ["dropbox_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("dropbox_id") - return .dictionary(d) - case .email(let arg): - var d = ["email": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("email") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberSelector { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "dropbox_id": - let v = Serialization._StringSerializer.deserialize(d["dropbox_id"] ?? .null) - return MemberSelector.dropboxId(v) - case "email": - let v = Serialization._StringSerializer.deserialize(d["email"] ?? .null) - return MemberSelector.email(v) - case "other": - return MemberSelector.other - default: - return MemberSelector.other - } + case .dropboxId(let arg): + var d = try ["dropbox_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("dropbox_id") + return .dictionary(d) + case .email(let arg): + var d = try ["email": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("email") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberSelector { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "dropbox_id": + let v = try Serialization._StringSerializer.deserialize(d["dropbox_id"] ?? .null) + return MemberSelector.dropboxId(v) + case "email": + let v = try Serialization._StringSerializer.deserialize(d["email"] ?? .null) + return MemberSelector.email(v) + case "other": + return MemberSelector.other default: - fatalError("Failed to deserialize") + return MemberSelector.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberSelector.self, json: json) } } } /// The ModifySharedLinkSettingsArgs struct - open class ModifySharedLinkSettingsArgs: CustomStringConvertible { + public class ModifySharedLinkSettingsArgs: CustomStringConvertible, JSONRepresentable { /// URL of the shared link to change its settings. public let url: String /// Set of settings for the shared link. @@ -5195,35 +6411,46 @@ open class Sharing { self.settings = settings self.removeExpiration = removeExpiration } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ModifySharedLinkSettingsArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ModifySharedLinkSettingsArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ModifySharedLinkSettingsArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ModifySharedLinkSettingsArgs: \(error)" + } } } - open class ModifySharedLinkSettingsArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ModifySharedLinkSettingsArgs) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "settings": Sharing.SharedLinkSettingsSerializer().serialize(value.settings), - "remove_expiration": Serialization._BoolSerializer.serialize(value.removeExpiration), + + public class ModifySharedLinkSettingsArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ModifySharedLinkSettingsArgs) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "settings": try Sharing.SharedLinkSettingsSerializer().serialize(value.settings), + "remove_expiration": try Serialization._BoolSerializer.serialize(value.removeExpiration), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ModifySharedLinkSettingsArgs { + + public func deserialize(_ json: JSON) throws -> ModifySharedLinkSettingsArgs { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let settings = Sharing.SharedLinkSettingsSerializer().deserialize(dict["settings"] ?? .null) - let removeExpiration = Serialization._BoolSerializer.deserialize(dict["remove_expiration"] ?? .number(0)) - return ModifySharedLinkSettingsArgs(url: url, settings: settings, removeExpiration: removeExpiration) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let settings = try Sharing.SharedLinkSettingsSerializer().deserialize(dict["settings"] ?? .null) + let removeExpiration = try Serialization._BoolSerializer.deserialize(dict["remove_expiration"] ?? .number(0)) + return ModifySharedLinkSettingsArgs(url: url, settings: settings, removeExpiration: removeExpiration) + default: + throw JSONSerializerError.deserializeError(type: ModifySharedLinkSettingsArgs.self, json: json) } } } /// The ModifySharedLinkSettingsError union - public enum ModifySharedLinkSettingsError: CustomStringConvertible { + public enum ModifySharedLinkSettingsError: CustomStringConvertible, JSONRepresentable { /// The shared link wasn't found. case sharedLinkNotFound /// The caller is not allowed to access this shared link. @@ -5238,100 +6465,121 @@ open class Sharing { /// email address. Users can verify their email address here https://www.dropbox.com/help/317. case emailNotVerified + func json() throws -> JSON { + try ModifySharedLinkSettingsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ModifySharedLinkSettingsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ModifySharedLinkSettingsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ModifySharedLinkSettingsError: \(error)" + } } } - open class ModifySharedLinkSettingsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ModifySharedLinkSettingsError) -> JSON { + + public class ModifySharedLinkSettingsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ModifySharedLinkSettingsError) throws -> JSON { switch value { - case .sharedLinkNotFound: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_not_found") - return .dictionary(d) - case .sharedLinkAccessDenied: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_access_denied") - return .dictionary(d) - case .unsupportedLinkType: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_link_type") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .settingsError(let arg): - var d = ["settings_error": Sharing.SharedLinkSettingsErrorSerializer().serialize(arg)] - d[".tag"] = .str("settings_error") - return .dictionary(d) - case .emailNotVerified: - var d = [String: JSON]() - d[".tag"] = .str("email_not_verified") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ModifySharedLinkSettingsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "shared_link_not_found": - return ModifySharedLinkSettingsError.sharedLinkNotFound - case "shared_link_access_denied": - return ModifySharedLinkSettingsError.sharedLinkAccessDenied - case "unsupported_link_type": - return ModifySharedLinkSettingsError.unsupportedLinkType - case "other": - return ModifySharedLinkSettingsError.other - case "settings_error": - let v = Sharing.SharedLinkSettingsErrorSerializer().deserialize(d["settings_error"] ?? .null) - return ModifySharedLinkSettingsError.settingsError(v) - case "email_not_verified": - return ModifySharedLinkSettingsError.emailNotVerified - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .sharedLinkNotFound: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_not_found") + return .dictionary(d) + case .sharedLinkAccessDenied: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_access_denied") + return .dictionary(d) + case .unsupportedLinkType: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_link_type") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .settingsError(let arg): + var d = try ["settings_error": Sharing.SharedLinkSettingsErrorSerializer().serialize(arg)] + d[".tag"] = .str("settings_error") + return .dictionary(d) + case .emailNotVerified: + var d = [String: JSON]() + d[".tag"] = .str("email_not_verified") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ModifySharedLinkSettingsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "shared_link_not_found": + return ModifySharedLinkSettingsError.sharedLinkNotFound + case "shared_link_access_denied": + return ModifySharedLinkSettingsError.sharedLinkAccessDenied + case "unsupported_link_type": + return ModifySharedLinkSettingsError.unsupportedLinkType + case "other": + return ModifySharedLinkSettingsError.other + case "settings_error": + let v = try Sharing.SharedLinkSettingsErrorSerializer().deserialize(d["settings_error"] ?? .null) + return ModifySharedLinkSettingsError.settingsError(v) + case "email_not_verified": + return ModifySharedLinkSettingsError.emailNotVerified + default: + throw JSONSerializerError.unknownTag(type: ModifySharedLinkSettingsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ModifySharedLinkSettingsError.self, json: json) } } } /// The MountFolderArg struct - open class MountFolderArg: CustomStringConvertible { + public class MountFolderArg: CustomStringConvertible, JSONRepresentable { /// The ID of the shared folder to mount. public let sharedFolderId: String public init(sharedFolderId: String) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MountFolderArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MountFolderArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MountFolderArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MountFolderArg: \(error)" + } } } - open class MountFolderArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MountFolderArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), + + public class MountFolderArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MountFolderArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MountFolderArg { + + public func deserialize(_ json: JSON) throws -> MountFolderArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - return MountFolderArg(sharedFolderId: sharedFolderId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + return MountFolderArg(sharedFolderId: sharedFolderId) + default: + throw JSONSerializerError.deserializeError(type: MountFolderArg.self, json: json) } } } /// The MountFolderError union - public enum MountFolderError: CustomStringConvertible { + public enum MountFolderError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// Mounting would cause a shared folder to be inside another, which is disallowed. @@ -5348,85 +6596,95 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try MountFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MountFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MountFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MountFolderError: \(error)" + } } } - open class MountFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MountFolderError) -> JSON { + + public class MountFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MountFolderError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .insideSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("inside_shared_folder") - return .dictionary(d) - case .insufficientQuota(let arg): - var d = Serialization.getFields(Sharing.InsufficientQuotaAmountsSerializer().serialize(arg)) - d[".tag"] = .str("insufficient_quota") - return .dictionary(d) - case .alreadyMounted: - var d = [String: JSON]() - d[".tag"] = .str("already_mounted") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .notMountable: - var d = [String: JSON]() - d[".tag"] = .str("not_mountable") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MountFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return MountFolderError.accessError(v) - case "inside_shared_folder": - return MountFolderError.insideSharedFolder - case "insufficient_quota": - let v = Sharing.InsufficientQuotaAmountsSerializer().deserialize(json) - return MountFolderError.insufficientQuota(v) - case "already_mounted": - return MountFolderError.alreadyMounted - case "no_permission": - return MountFolderError.noPermission - case "not_mountable": - return MountFolderError.notMountable - case "other": - return MountFolderError.other - default: - return MountFolderError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .insideSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("inside_shared_folder") + return .dictionary(d) + case .insufficientQuota(let arg): + var d = try Serialization.getFields(Sharing.InsufficientQuotaAmountsSerializer().serialize(arg)) + d[".tag"] = .str("insufficient_quota") + return .dictionary(d) + case .alreadyMounted: + var d = [String: JSON]() + d[".tag"] = .str("already_mounted") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .notMountable: + var d = [String: JSON]() + d[".tag"] = .str("not_mountable") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MountFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return MountFolderError.accessError(v) + case "inside_shared_folder": + return MountFolderError.insideSharedFolder + case "insufficient_quota": + let v = try Sharing.InsufficientQuotaAmountsSerializer().deserialize(json) + return MountFolderError.insufficientQuota(v) + case "already_mounted": + return MountFolderError.alreadyMounted + case "no_permission": + return MountFolderError.noPermission + case "not_mountable": + return MountFolderError.notMountable + case "other": + return MountFolderError.other + default: + return MountFolderError.other + } + default: + throw JSONSerializerError.deserializeError(type: MountFolderError.self, json: json) } } } /// Contains information about a parent folder that a member has access to. - open class ParentFolderAccessInfo: CustomStringConvertible { + public class ParentFolderAccessInfo: CustomStringConvertible, JSONRepresentable { /// Display name for the folder. public let folderName: String /// The identifier of the parent shared folder. public let sharedFolderId: String /// The user's permissions for the parent shared folder. - public let permissions: Array + public let permissions: [Sharing.MemberPermission] /// The full path to the parent shared folder relative to the acting user's root. public let path: String - public init(folderName: String, sharedFolderId: String, permissions: Array, path: String) { + public init(folderName: String, sharedFolderId: String, permissions: [Sharing.MemberPermission], path: String) { stringValidator()(folderName) self.folderName = folderName stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) @@ -5435,37 +6693,48 @@ open class Sharing { stringValidator()(path) self.path = path } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ParentFolderAccessInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try ParentFolderAccessInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ParentFolderAccessInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ParentFolderAccessInfo: \(error)" + } } } - open class ParentFolderAccessInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ParentFolderAccessInfo) -> JSON { - let output = [ - "folder_name": Serialization._StringSerializer.serialize(value.folderName), - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "permissions": ArraySerializer(Sharing.MemberPermissionSerializer()).serialize(value.permissions), - "path": Serialization._StringSerializer.serialize(value.path), + + public class ParentFolderAccessInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ParentFolderAccessInfo) throws -> JSON { + let output = [ + "folder_name": try Serialization._StringSerializer.serialize(value.folderName), + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "permissions": try ArraySerializer(Sharing.MemberPermissionSerializer()).serialize(value.permissions), + "path": try Serialization._StringSerializer.serialize(value.path), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ParentFolderAccessInfo { + + public func deserialize(_ json: JSON) throws -> ParentFolderAccessInfo { switch json { - case .dictionary(let dict): - let folderName = Serialization._StringSerializer.deserialize(dict["folder_name"] ?? .null) - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let permissions = ArraySerializer(Sharing.MemberPermissionSerializer()).deserialize(dict["permissions"] ?? .null) - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - return ParentFolderAccessInfo(folderName: folderName, sharedFolderId: sharedFolderId, permissions: permissions, path: path) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let folderName = try Serialization._StringSerializer.deserialize(dict["folder_name"] ?? .null) + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let permissions = try ArraySerializer(Sharing.MemberPermissionSerializer()).deserialize(dict["permissions"] ?? .null) + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + return ParentFolderAccessInfo(folderName: folderName, sharedFolderId: sharedFolderId, permissions: permissions, path: path) + default: + throw JSONSerializerError.deserializeError(type: ParentFolderAccessInfo.self, json: json) } } } /// Metadata for a path-based shared link. - open class PathLinkMetadata: Sharing.LinkMetadata { + public class PathLinkMetadata: Sharing.LinkMetadata { /// Path in user's Dropbox. public let path: String public init(url: String, visibility: Sharing.Visibility, path: String, expires: Date? = nil) { @@ -5473,80 +6742,97 @@ open class Sharing { self.path = path super.init(url: url, visibility: visibility, expires: expires) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PathLinkMetadataSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PathLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PathLinkMetadata: \(error)" + } } } - open class PathLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PathLinkMetadata) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), - "visibility": Sharing.VisibilitySerializer().serialize(value.visibility), - "path": Serialization._StringSerializer.serialize(value.path), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + + public class PathLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PathLinkMetadata) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), + "visibility": try Sharing.VisibilitySerializer().serialize(value.visibility), + "path": try Serialization._StringSerializer.serialize(value.path), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PathLinkMetadata { + + public func deserialize(_ json: JSON) throws -> PathLinkMetadata { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let visibility = Sharing.VisibilitySerializer().deserialize(dict["visibility"] ?? .null) - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - return PathLinkMetadata(url: url, visibility: visibility, path: path, expires: expires) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let visibility = try Sharing.VisibilitySerializer().deserialize(dict["visibility"] ?? .null) + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + return PathLinkMetadata(url: url, visibility: visibility, path: path, expires: expires) + default: + throw JSONSerializerError.deserializeError(type: PathLinkMetadata.self, json: json) } } } /// Flag to indicate pending upload default (for linking to not-yet-existing paths). - public enum PendingUploadMode: CustomStringConvertible { + public enum PendingUploadMode: CustomStringConvertible, JSONRepresentable { /// Assume pending uploads are files. case file /// Assume pending uploads are folders. case folder + func json() throws -> JSON { + try PendingUploadModeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PendingUploadModeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PendingUploadModeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PendingUploadMode: \(error)" + } } } - open class PendingUploadModeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PendingUploadMode) -> JSON { + + public class PendingUploadModeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PendingUploadMode) throws -> JSON { switch value { - case .file: - var d = [String: JSON]() - d[".tag"] = .str("file") - return .dictionary(d) - case .folder: - var d = [String: JSON]() - d[".tag"] = .str("folder") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PendingUploadMode { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "file": - return PendingUploadMode.file - case "folder": - return PendingUploadMode.folder - default: - fatalError("Unknown tag \(tag)") - } + case .file: + var d = [String: JSON]() + d[".tag"] = .str("file") + return .dictionary(d) + case .folder: + var d = [String: JSON]() + d[".tag"] = .str("folder") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PendingUploadMode { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "file": + return PendingUploadMode.file + case "folder": + return PendingUploadMode.folder default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: PendingUploadMode.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: PendingUploadMode.self, json: json) } } } /// Possible reasons the user is denied a permission. - public enum PermissionDeniedReason: CustomStringConvertible { + public enum PermissionDeniedReason: CustomStringConvertible, JSONRepresentable { /// User is not on the same team as the folder owner. case userNotSameTeamAsOwner /// User is prohibited by the owner from taking the action. @@ -5580,160 +6866,181 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try PermissionDeniedReasonSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PermissionDeniedReasonSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PermissionDeniedReasonSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PermissionDeniedReason: \(error)" + } } } - open class PermissionDeniedReasonSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PermissionDeniedReason) -> JSON { + + public class PermissionDeniedReasonSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PermissionDeniedReason) throws -> JSON { switch value { - case .userNotSameTeamAsOwner: - var d = [String: JSON]() - d[".tag"] = .str("user_not_same_team_as_owner") - return .dictionary(d) - case .userNotAllowedByOwner: - var d = [String: JSON]() - d[".tag"] = .str("user_not_allowed_by_owner") - return .dictionary(d) - case .targetIsIndirectMember: - var d = [String: JSON]() - d[".tag"] = .str("target_is_indirect_member") - return .dictionary(d) - case .targetIsOwner: - var d = [String: JSON]() - d[".tag"] = .str("target_is_owner") - return .dictionary(d) - case .targetIsSelf: - var d = [String: JSON]() - d[".tag"] = .str("target_is_self") - return .dictionary(d) - case .targetNotActive: - var d = [String: JSON]() - d[".tag"] = .str("target_not_active") - return .dictionary(d) - case .folderIsLimitedTeamFolder: - var d = [String: JSON]() - d[".tag"] = .str("folder_is_limited_team_folder") - return .dictionary(d) - case .ownerNotOnTeam: - var d = [String: JSON]() - d[".tag"] = .str("owner_not_on_team") - return .dictionary(d) - case .permissionDenied: - var d = [String: JSON]() - d[".tag"] = .str("permission_denied") - return .dictionary(d) - case .restrictedByTeam: - var d = [String: JSON]() - d[".tag"] = .str("restricted_by_team") - return .dictionary(d) - case .userAccountType: - var d = [String: JSON]() - d[".tag"] = .str("user_account_type") - return .dictionary(d) - case .userNotOnTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_on_team") - return .dictionary(d) - case .folderIsInsideSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("folder_is_inside_shared_folder") - return .dictionary(d) - case .restrictedByParentFolder: - var d = [String: JSON]() - d[".tag"] = .str("restricted_by_parent_folder") - return .dictionary(d) - case .insufficientPlan(let arg): - var d = Serialization.getFields(Sharing.InsufficientPlanSerializer().serialize(arg)) - d[".tag"] = .str("insufficient_plan") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PermissionDeniedReason { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_same_team_as_owner": - return PermissionDeniedReason.userNotSameTeamAsOwner - case "user_not_allowed_by_owner": - return PermissionDeniedReason.userNotAllowedByOwner - case "target_is_indirect_member": - return PermissionDeniedReason.targetIsIndirectMember - case "target_is_owner": - return PermissionDeniedReason.targetIsOwner - case "target_is_self": - return PermissionDeniedReason.targetIsSelf - case "target_not_active": - return PermissionDeniedReason.targetNotActive - case "folder_is_limited_team_folder": - return PermissionDeniedReason.folderIsLimitedTeamFolder - case "owner_not_on_team": - return PermissionDeniedReason.ownerNotOnTeam - case "permission_denied": - return PermissionDeniedReason.permissionDenied - case "restricted_by_team": - return PermissionDeniedReason.restrictedByTeam - case "user_account_type": - return PermissionDeniedReason.userAccountType - case "user_not_on_team": - return PermissionDeniedReason.userNotOnTeam - case "folder_is_inside_shared_folder": - return PermissionDeniedReason.folderIsInsideSharedFolder - case "restricted_by_parent_folder": - return PermissionDeniedReason.restrictedByParentFolder - case "insufficient_plan": - let v = Sharing.InsufficientPlanSerializer().deserialize(json) - return PermissionDeniedReason.insufficientPlan(v) - case "other": - return PermissionDeniedReason.other - default: - return PermissionDeniedReason.other - } - default: - fatalError("Failed to deserialize") + case .userNotSameTeamAsOwner: + var d = [String: JSON]() + d[".tag"] = .str("user_not_same_team_as_owner") + return .dictionary(d) + case .userNotAllowedByOwner: + var d = [String: JSON]() + d[".tag"] = .str("user_not_allowed_by_owner") + return .dictionary(d) + case .targetIsIndirectMember: + var d = [String: JSON]() + d[".tag"] = .str("target_is_indirect_member") + return .dictionary(d) + case .targetIsOwner: + var d = [String: JSON]() + d[".tag"] = .str("target_is_owner") + return .dictionary(d) + case .targetIsSelf: + var d = [String: JSON]() + d[".tag"] = .str("target_is_self") + return .dictionary(d) + case .targetNotActive: + var d = [String: JSON]() + d[".tag"] = .str("target_not_active") + return .dictionary(d) + case .folderIsLimitedTeamFolder: + var d = [String: JSON]() + d[".tag"] = .str("folder_is_limited_team_folder") + return .dictionary(d) + case .ownerNotOnTeam: + var d = [String: JSON]() + d[".tag"] = .str("owner_not_on_team") + return .dictionary(d) + case .permissionDenied: + var d = [String: JSON]() + d[".tag"] = .str("permission_denied") + return .dictionary(d) + case .restrictedByTeam: + var d = [String: JSON]() + d[".tag"] = .str("restricted_by_team") + return .dictionary(d) + case .userAccountType: + var d = [String: JSON]() + d[".tag"] = .str("user_account_type") + return .dictionary(d) + case .userNotOnTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_on_team") + return .dictionary(d) + case .folderIsInsideSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("folder_is_inside_shared_folder") + return .dictionary(d) + case .restrictedByParentFolder: + var d = [String: JSON]() + d[".tag"] = .str("restricted_by_parent_folder") + return .dictionary(d) + case .insufficientPlan(let arg): + var d = try Serialization.getFields(Sharing.InsufficientPlanSerializer().serialize(arg)) + d[".tag"] = .str("insufficient_plan") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PermissionDeniedReason { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_same_team_as_owner": + return PermissionDeniedReason.userNotSameTeamAsOwner + case "user_not_allowed_by_owner": + return PermissionDeniedReason.userNotAllowedByOwner + case "target_is_indirect_member": + return PermissionDeniedReason.targetIsIndirectMember + case "target_is_owner": + return PermissionDeniedReason.targetIsOwner + case "target_is_self": + return PermissionDeniedReason.targetIsSelf + case "target_not_active": + return PermissionDeniedReason.targetNotActive + case "folder_is_limited_team_folder": + return PermissionDeniedReason.folderIsLimitedTeamFolder + case "owner_not_on_team": + return PermissionDeniedReason.ownerNotOnTeam + case "permission_denied": + return PermissionDeniedReason.permissionDenied + case "restricted_by_team": + return PermissionDeniedReason.restrictedByTeam + case "user_account_type": + return PermissionDeniedReason.userAccountType + case "user_not_on_team": + return PermissionDeniedReason.userNotOnTeam + case "folder_is_inside_shared_folder": + return PermissionDeniedReason.folderIsInsideSharedFolder + case "restricted_by_parent_folder": + return PermissionDeniedReason.restrictedByParentFolder + case "insufficient_plan": + let v = try Sharing.InsufficientPlanSerializer().deserialize(json) + return PermissionDeniedReason.insufficientPlan(v) + case "other": + return PermissionDeniedReason.other + default: + return PermissionDeniedReason.other + } + default: + throw JSONSerializerError.deserializeError(type: PermissionDeniedReason.self, json: json) } } } /// The RelinquishFileMembershipArg struct - open class RelinquishFileMembershipArg: CustomStringConvertible { + public class RelinquishFileMembershipArg: CustomStringConvertible, JSONRepresentable { /// The path or id for the file. public let file: String public init(file: String) { stringValidator(minLength: 1, pattern: "((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?")(file) self.file = file } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelinquishFileMembershipArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RelinquishFileMembershipArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelinquishFileMembershipArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelinquishFileMembershipArg: \(error)" + } } } - open class RelinquishFileMembershipArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelinquishFileMembershipArg) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), + + public class RelinquishFileMembershipArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelinquishFileMembershipArg) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelinquishFileMembershipArg { + + public func deserialize(_ json: JSON) throws -> RelinquishFileMembershipArg { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - return RelinquishFileMembershipArg(file: file) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + return RelinquishFileMembershipArg(file: file) + default: + throw JSONSerializerError.deserializeError(type: RelinquishFileMembershipArg.self, json: json) } } } /// The RelinquishFileMembershipError union - public enum RelinquishFileMembershipError: CustomStringConvertible { + public enum RelinquishFileMembershipError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharingFileAccessError) /// The current user has access to the shared file via a group. You can't relinquish membership to a file @@ -5744,57 +7051,67 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try RelinquishFileMembershipErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelinquishFileMembershipErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelinquishFileMembershipErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelinquishFileMembershipError: \(error)" + } } } - open class RelinquishFileMembershipErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelinquishFileMembershipError) -> JSON { + + public class RelinquishFileMembershipErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelinquishFileMembershipError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .groupAccess: - var d = [String: JSON]() - d[".tag"] = .str("group_access") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelinquishFileMembershipError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return RelinquishFileMembershipError.accessError(v) - case "group_access": - return RelinquishFileMembershipError.groupAccess - case "no_permission": - return RelinquishFileMembershipError.noPermission - case "other": - return RelinquishFileMembershipError.other - default: - return RelinquishFileMembershipError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .groupAccess: + var d = [String: JSON]() + d[".tag"] = .str("group_access") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelinquishFileMembershipError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return RelinquishFileMembershipError.accessError(v) + case "group_access": + return RelinquishFileMembershipError.groupAccess + case "no_permission": + return RelinquishFileMembershipError.noPermission + case "other": + return RelinquishFileMembershipError.other + default: + return RelinquishFileMembershipError.other + } + default: + throw JSONSerializerError.deserializeError(type: RelinquishFileMembershipError.self, json: json) } } } /// The RelinquishFolderMembershipArg struct - open class RelinquishFolderMembershipArg: CustomStringConvertible { + public class RelinquishFolderMembershipArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// Keep a copy of the folder's contents upon relinquishing membership. This must be set to false when the @@ -5805,33 +7122,44 @@ open class Sharing { self.sharedFolderId = sharedFolderId self.leaveACopy = leaveACopy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelinquishFolderMembershipArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RelinquishFolderMembershipArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelinquishFolderMembershipArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelinquishFolderMembershipArg: \(error)" + } } } - open class RelinquishFolderMembershipArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelinquishFolderMembershipArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "leave_a_copy": Serialization._BoolSerializer.serialize(value.leaveACopy), + + public class RelinquishFolderMembershipArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelinquishFolderMembershipArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "leave_a_copy": try Serialization._BoolSerializer.serialize(value.leaveACopy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelinquishFolderMembershipArg { + + public func deserialize(_ json: JSON) throws -> RelinquishFolderMembershipArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let leaveACopy = Serialization._BoolSerializer.deserialize(dict["leave_a_copy"] ?? .number(0)) - return RelinquishFolderMembershipArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let leaveACopy = try Serialization._BoolSerializer.deserialize(dict["leave_a_copy"] ?? .number(0)) + return RelinquishFolderMembershipArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy) + default: + throw JSONSerializerError.deserializeError(type: RelinquishFolderMembershipArg.self, json: json) } } } /// The RelinquishFolderMembershipError union - public enum RelinquishFolderMembershipError: CustomStringConvertible { + public enum RelinquishFolderMembershipError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// The current user is the owner of the shared folder. Owners cannot relinquish membership to their own @@ -5852,81 +7180,91 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try RelinquishFolderMembershipErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelinquishFolderMembershipErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelinquishFolderMembershipErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelinquishFolderMembershipError: \(error)" + } } } - open class RelinquishFolderMembershipErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelinquishFolderMembershipError) -> JSON { + + public class RelinquishFolderMembershipErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelinquishFolderMembershipError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .folderOwner: - var d = [String: JSON]() - d[".tag"] = .str("folder_owner") - return .dictionary(d) - case .mounted: - var d = [String: JSON]() - d[".tag"] = .str("mounted") - return .dictionary(d) - case .groupAccess: - var d = [String: JSON]() - d[".tag"] = .str("group_access") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .noExplicitAccess: - var d = [String: JSON]() - d[".tag"] = .str("no_explicit_access") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RelinquishFolderMembershipError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return RelinquishFolderMembershipError.accessError(v) - case "folder_owner": - return RelinquishFolderMembershipError.folderOwner - case "mounted": - return RelinquishFolderMembershipError.mounted - case "group_access": - return RelinquishFolderMembershipError.groupAccess - case "team_folder": - return RelinquishFolderMembershipError.teamFolder - case "no_permission": - return RelinquishFolderMembershipError.noPermission - case "no_explicit_access": - return RelinquishFolderMembershipError.noExplicitAccess - case "other": - return RelinquishFolderMembershipError.other - default: - return RelinquishFolderMembershipError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .folderOwner: + var d = [String: JSON]() + d[".tag"] = .str("folder_owner") + return .dictionary(d) + case .mounted: + var d = [String: JSON]() + d[".tag"] = .str("mounted") + return .dictionary(d) + case .groupAccess: + var d = [String: JSON]() + d[".tag"] = .str("group_access") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .noExplicitAccess: + var d = [String: JSON]() + d[".tag"] = .str("no_explicit_access") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RelinquishFolderMembershipError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return RelinquishFolderMembershipError.accessError(v) + case "folder_owner": + return RelinquishFolderMembershipError.folderOwner + case "mounted": + return RelinquishFolderMembershipError.mounted + case "group_access": + return RelinquishFolderMembershipError.groupAccess + case "team_folder": + return RelinquishFolderMembershipError.teamFolder + case "no_permission": + return RelinquishFolderMembershipError.noPermission + case "no_explicit_access": + return RelinquishFolderMembershipError.noExplicitAccess + case "other": + return RelinquishFolderMembershipError.other + default: + return RelinquishFolderMembershipError.other + } + default: + throw JSONSerializerError.deserializeError(type: RelinquishFolderMembershipError.self, json: json) } } } /// Arguments for removeFileMember2. - open class RemoveFileMemberArg: CustomStringConvertible { + public class RemoveFileMemberArg: CustomStringConvertible, JSONRepresentable { /// File from which to remove members. public let file: String /// Member to remove from this file. Note that even if an email is specified, it may result in the removal of a @@ -5937,33 +7275,44 @@ open class Sharing { self.file = file self.member = member } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveFileMemberArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RemoveFileMemberArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveFileMemberArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveFileMemberArg: \(error)" + } } } - open class RemoveFileMemberArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveFileMemberArg) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), - "member": Sharing.MemberSelectorSerializer().serialize(value.member), + + public class RemoveFileMemberArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveFileMemberArg) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RemoveFileMemberArg { + + public func deserialize(_ json: JSON) throws -> RemoveFileMemberArg { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - return RemoveFileMemberArg(file: file, member: member) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + return RemoveFileMemberArg(file: file, member: member) + default: + throw JSONSerializerError.deserializeError(type: RemoveFileMemberArg.self, json: json) } } } /// Errors for removeFileMember2. - public enum RemoveFileMemberError: CustomStringConvertible { + public enum RemoveFileMemberError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case userError(Sharing.SharingUserError) /// An unspecified error. @@ -5974,66 +7323,76 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try RemoveFileMemberErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveFileMemberErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveFileMemberErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveFileMemberError: \(error)" + } } } - open class RemoveFileMemberErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveFileMemberError) -> JSON { + + public class RemoveFileMemberErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveFileMemberError) throws -> JSON { switch value { - case .userError(let arg): - var d = ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] - d[".tag"] = .str("user_error") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .noExplicitAccess(let arg): - var d = Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) - d[".tag"] = .str("no_explicit_access") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RemoveFileMemberError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_error": - let v = Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) - return RemoveFileMemberError.userError(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return RemoveFileMemberError.accessError(v) - case "no_explicit_access": - let v = Sharing.MemberAccessLevelResultSerializer().deserialize(json) - return RemoveFileMemberError.noExplicitAccess(v) - case "other": - return RemoveFileMemberError.other - default: - return RemoveFileMemberError.other - } - default: - fatalError("Failed to deserialize") + case .userError(let arg): + var d = try ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .noExplicitAccess(let arg): + var d = try Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) + d[".tag"] = .str("no_explicit_access") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RemoveFileMemberError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_error": + let v = try Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) + return RemoveFileMemberError.userError(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return RemoveFileMemberError.accessError(v) + case "no_explicit_access": + let v = try Sharing.MemberAccessLevelResultSerializer().deserialize(json) + return RemoveFileMemberError.noExplicitAccess(v) + case "other": + return RemoveFileMemberError.other + default: + return RemoveFileMemberError.other + } + default: + throw JSONSerializerError.deserializeError(type: RemoveFileMemberError.self, json: json) } } } /// The RemoveFolderMemberArg struct - open class RemoveFolderMemberArg: CustomStringConvertible { + public class RemoveFolderMemberArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// The member to remove from the folder. public let member: Sharing.MemberSelector /// If true, the removed user will keep their copy of the folder after it's unshared, assuming it was mounted. - /// Otherwise, it will be removed from their Dropbox. This must be set to false when removing a group, or when - /// the folder is within a team folder or another shared folder. + /// Otherwise, it will be removed from their Dropbox. This must be set to false when removing a group, + /// or when the folder is within a team folder or another shared folder. public let leaveACopy: Bool public init(sharedFolderId: String, member: Sharing.MemberSelector, leaveACopy: Bool) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) @@ -6041,35 +7400,46 @@ open class Sharing { self.member = member self.leaveACopy = leaveACopy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveFolderMemberArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RemoveFolderMemberArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveFolderMemberArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveFolderMemberArg: \(error)" + } } } - open class RemoveFolderMemberArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveFolderMemberArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "member": Sharing.MemberSelectorSerializer().serialize(value.member), - "leave_a_copy": Serialization._BoolSerializer.serialize(value.leaveACopy), + + public class RemoveFolderMemberArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveFolderMemberArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), + "leave_a_copy": try Serialization._BoolSerializer.serialize(value.leaveACopy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RemoveFolderMemberArg { + + public func deserialize(_ json: JSON) throws -> RemoveFolderMemberArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - let leaveACopy = Serialization._BoolSerializer.deserialize(dict["leave_a_copy"] ?? .null) - return RemoveFolderMemberArg(sharedFolderId: sharedFolderId, member: member, leaveACopy: leaveACopy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + let leaveACopy = try Serialization._BoolSerializer.deserialize(dict["leave_a_copy"] ?? .null) + return RemoveFolderMemberArg(sharedFolderId: sharedFolderId, member: member, leaveACopy: leaveACopy) + default: + throw JSONSerializerError.deserializeError(type: RemoveFolderMemberArg.self, json: json) } } } /// The RemoveFolderMemberError union - public enum RemoveFolderMemberError: CustomStringConvertible { + public enum RemoveFolderMemberError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// An unspecified error. @@ -6089,82 +7459,92 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try RemoveFolderMemberErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveFolderMemberErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveFolderMemberErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveFolderMemberError: \(error)" + } } } - open class RemoveFolderMemberErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveFolderMemberError) -> JSON { + + public class RemoveFolderMemberErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveFolderMemberError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .memberError(let arg): - var d = ["member_error": Sharing.SharedFolderMemberErrorSerializer().serialize(arg)] - d[".tag"] = .str("member_error") - return .dictionary(d) - case .folderOwner: - var d = [String: JSON]() - d[".tag"] = .str("folder_owner") - return .dictionary(d) - case .groupAccess: - var d = [String: JSON]() - d[".tag"] = .str("group_access") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RemoveFolderMemberError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return RemoveFolderMemberError.accessError(v) - case "member_error": - let v = Sharing.SharedFolderMemberErrorSerializer().deserialize(d["member_error"] ?? .null) - return RemoveFolderMemberError.memberError(v) - case "folder_owner": - return RemoveFolderMemberError.folderOwner - case "group_access": - return RemoveFolderMemberError.groupAccess - case "team_folder": - return RemoveFolderMemberError.teamFolder - case "no_permission": - return RemoveFolderMemberError.noPermission - case "too_many_files": - return RemoveFolderMemberError.tooManyFiles - case "other": - return RemoveFolderMemberError.other - default: - return RemoveFolderMemberError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .memberError(let arg): + var d = try ["member_error": Sharing.SharedFolderMemberErrorSerializer().serialize(arg)] + d[".tag"] = .str("member_error") + return .dictionary(d) + case .folderOwner: + var d = [String: JSON]() + d[".tag"] = .str("folder_owner") + return .dictionary(d) + case .groupAccess: + var d = [String: JSON]() + d[".tag"] = .str("group_access") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RemoveFolderMemberError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return RemoveFolderMemberError.accessError(v) + case "member_error": + let v = try Sharing.SharedFolderMemberErrorSerializer().deserialize(d["member_error"] ?? .null) + return RemoveFolderMemberError.memberError(v) + case "folder_owner": + return RemoveFolderMemberError.folderOwner + case "group_access": + return RemoveFolderMemberError.groupAccess + case "team_folder": + return RemoveFolderMemberError.teamFolder + case "no_permission": + return RemoveFolderMemberError.noPermission + case "too_many_files": + return RemoveFolderMemberError.tooManyFiles + case "other": + return RemoveFolderMemberError.other + default: + return RemoveFolderMemberError.other + } + default: + throw JSONSerializerError.deserializeError(type: RemoveFolderMemberError.self, json: json) } } } /// The RemoveMemberJobStatus union - public enum RemoveMemberJobStatus: CustomStringConvertible { + public enum RemoveMemberJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// Removing the folder member has finished. The value is information about whether the member has another form @@ -6173,52 +7553,62 @@ open class Sharing { /// An unspecified error. case failed(Sharing.RemoveFolderMemberError) + func json() throws -> JSON { + try RemoveMemberJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveMemberJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveMemberJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveMemberJobStatus: \(error)" + } } } - open class RemoveMemberJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveMemberJobStatus) -> JSON { + + public class RemoveMemberJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveMemberJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Sharing.RemoveFolderMemberErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RemoveMemberJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return RemoveMemberJobStatus.inProgress - case "complete": - let v = Sharing.MemberAccessLevelResultSerializer().deserialize(json) - return RemoveMemberJobStatus.complete(v) - case "failed": - let v = Sharing.RemoveFolderMemberErrorSerializer().deserialize(d["failed"] ?? .null) - return RemoveMemberJobStatus.failed(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Sharing.RemoveFolderMemberErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RemoveMemberJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return RemoveMemberJobStatus.inProgress + case "complete": + let v = try Sharing.MemberAccessLevelResultSerializer().deserialize(json) + return RemoveMemberJobStatus.complete(v) + case "failed": + let v = try Sharing.RemoveFolderMemberErrorSerializer().deserialize(d["failed"] ?? .null) + return RemoveMemberJobStatus.failed(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RemoveMemberJobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RemoveMemberJobStatus.self, json: json) } } } /// The RequestedLinkAccessLevel union - public enum RequestedLinkAccessLevel: CustomStringConvertible { + public enum RequestedLinkAccessLevel: CustomStringConvertible, JSONRepresentable { /// Users who use the link can view and comment on the content. case viewer /// Users who use the link can edit, view and comment on the content. Note not all file types support edit links @@ -6231,93 +7621,114 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try RequestedLinkAccessLevelSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RequestedLinkAccessLevelSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RequestedLinkAccessLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RequestedLinkAccessLevel: \(error)" + } } } - open class RequestedLinkAccessLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RequestedLinkAccessLevel) -> JSON { + + public class RequestedLinkAccessLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RequestedLinkAccessLevel) throws -> JSON { switch value { - case .viewer: - var d = [String: JSON]() - d[".tag"] = .str("viewer") - return .dictionary(d) - case .editor: - var d = [String: JSON]() - d[".tag"] = .str("editor") - return .dictionary(d) - case .max: - var d = [String: JSON]() - d[".tag"] = .str("max") - return .dictionary(d) - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RequestedLinkAccessLevel { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "viewer": - return RequestedLinkAccessLevel.viewer - case "editor": - return RequestedLinkAccessLevel.editor - case "max": - return RequestedLinkAccessLevel.max - case "default": - return RequestedLinkAccessLevel.default_ - case "other": - return RequestedLinkAccessLevel.other - default: - return RequestedLinkAccessLevel.other - } - default: - fatalError("Failed to deserialize") + case .viewer: + var d = [String: JSON]() + d[".tag"] = .str("viewer") + return .dictionary(d) + case .editor: + var d = [String: JSON]() + d[".tag"] = .str("editor") + return .dictionary(d) + case .max: + var d = [String: JSON]() + d[".tag"] = .str("max") + return .dictionary(d) + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RequestedLinkAccessLevel { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "viewer": + return RequestedLinkAccessLevel.viewer + case "editor": + return RequestedLinkAccessLevel.editor + case "max": + return RequestedLinkAccessLevel.max + case "default": + return RequestedLinkAccessLevel.default_ + case "other": + return RequestedLinkAccessLevel.other + default: + return RequestedLinkAccessLevel.other + } + default: + throw JSONSerializerError.deserializeError(type: RequestedLinkAccessLevel.self, json: json) } } } /// The RevokeSharedLinkArg struct - open class RevokeSharedLinkArg: CustomStringConvertible { + public class RevokeSharedLinkArg: CustomStringConvertible, JSONRepresentable { /// URL of the shared link. public let url: String public init(url: String) { stringValidator()(url) self.url = url } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeSharedLinkArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeSharedLinkArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeSharedLinkArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeSharedLinkArg: \(error)" + } } } - open class RevokeSharedLinkArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeSharedLinkArg) -> JSON { - let output = [ - "url": Serialization._StringSerializer.serialize(value.url), + + public class RevokeSharedLinkArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeSharedLinkArg) throws -> JSON { + let output = [ + "url": try Serialization._StringSerializer.serialize(value.url), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeSharedLinkArg { + + public func deserialize(_ json: JSON) throws -> RevokeSharedLinkArg { switch json { - case .dictionary(let dict): - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - return RevokeSharedLinkArg(url: url) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + return RevokeSharedLinkArg(url: url) + default: + throw JSONSerializerError.deserializeError(type: RevokeSharedLinkArg.self, json: json) } } } /// The RevokeSharedLinkError union - public enum RevokeSharedLinkError: CustomStringConvertible { + public enum RevokeSharedLinkError: CustomStringConvertible, JSONRepresentable { /// The shared link wasn't found. case sharedLinkNotFound /// The caller is not allowed to access this shared link. @@ -6329,62 +7740,72 @@ open class Sharing { /// Shared link is malformed. case sharedLinkMalformed + func json() throws -> JSON { + try RevokeSharedLinkErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeSharedLinkErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeSharedLinkErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeSharedLinkError: \(error)" + } } } - open class RevokeSharedLinkErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeSharedLinkError) -> JSON { + + public class RevokeSharedLinkErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeSharedLinkError) throws -> JSON { switch value { - case .sharedLinkNotFound: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_not_found") - return .dictionary(d) - case .sharedLinkAccessDenied: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_access_denied") - return .dictionary(d) - case .unsupportedLinkType: - var d = [String: JSON]() - d[".tag"] = .str("unsupported_link_type") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .sharedLinkMalformed: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_malformed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RevokeSharedLinkError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "shared_link_not_found": - return RevokeSharedLinkError.sharedLinkNotFound - case "shared_link_access_denied": - return RevokeSharedLinkError.sharedLinkAccessDenied - case "unsupported_link_type": - return RevokeSharedLinkError.unsupportedLinkType - case "other": - return RevokeSharedLinkError.other - case "shared_link_malformed": - return RevokeSharedLinkError.sharedLinkMalformed - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .sharedLinkNotFound: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_not_found") + return .dictionary(d) + case .sharedLinkAccessDenied: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_access_denied") + return .dictionary(d) + case .unsupportedLinkType: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_link_type") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .sharedLinkMalformed: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_malformed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RevokeSharedLinkError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "shared_link_not_found": + return RevokeSharedLinkError.sharedLinkNotFound + case "shared_link_access_denied": + return RevokeSharedLinkError.sharedLinkAccessDenied + case "unsupported_link_type": + return RevokeSharedLinkError.unsupportedLinkType + case "other": + return RevokeSharedLinkError.other + case "shared_link_malformed": + return RevokeSharedLinkError.sharedLinkMalformed + default: + throw JSONSerializerError.unknownTag(type: RevokeSharedLinkError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RevokeSharedLinkError.self, json: json) } } } /// The SetAccessInheritanceArg struct - open class SetAccessInheritanceArg: CustomStringConvertible { + public class SetAccessInheritanceArg: CustomStringConvertible, JSONRepresentable { /// The access inheritance settings for the folder. public let accessInheritance: Sharing.AccessInheritance /// The ID for the shared folder. @@ -6394,33 +7815,45 @@ open class Sharing { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SetAccessInheritanceArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SetAccessInheritanceArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SetAccessInheritanceArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SetAccessInheritanceArg: \(error)" + } } } - open class SetAccessInheritanceArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SetAccessInheritanceArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "access_inheritance": Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), + + public class SetAccessInheritanceArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SetAccessInheritanceArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "access_inheritance": try Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SetAccessInheritanceArg { + + public func deserialize(_ json: JSON) throws -> SetAccessInheritanceArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let accessInheritance = Sharing.AccessInheritanceSerializer().deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) - return SetAccessInheritanceArg(sharedFolderId: sharedFolderId, accessInheritance: accessInheritance) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let accessInheritance = try Sharing.AccessInheritanceSerializer() + .deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) + return SetAccessInheritanceArg(sharedFolderId: sharedFolderId, accessInheritance: accessInheritance) + default: + throw JSONSerializerError.deserializeError(type: SetAccessInheritanceArg.self, json: json) } } } /// The SetAccessInheritanceError union - public enum SetAccessInheritanceError: CustomStringConvertible { + public enum SetAccessInheritanceError: CustomStringConvertible, JSONRepresentable { /// Unable to access shared folder. case accessError(Sharing.SharedFolderAccessError) /// The current user does not have permission to perform this action. @@ -6428,58 +7861,68 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SetAccessInheritanceErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SetAccessInheritanceErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SetAccessInheritanceErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SetAccessInheritanceError: \(error)" + } } } - open class SetAccessInheritanceErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SetAccessInheritanceError) -> JSON { + + public class SetAccessInheritanceErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SetAccessInheritanceError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SetAccessInheritanceError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return SetAccessInheritanceError.accessError(v) - case "no_permission": - return SetAccessInheritanceError.noPermission - case "other": - return SetAccessInheritanceError.other - default: - return SetAccessInheritanceError.other - } + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SetAccessInheritanceError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return SetAccessInheritanceError.accessError(v) + case "no_permission": + return SetAccessInheritanceError.noPermission + case "other": + return SetAccessInheritanceError.other default: - fatalError("Failed to deserialize") + return SetAccessInheritanceError.other + } + default: + throw JSONSerializerError.deserializeError(type: SetAccessInheritanceError.self, json: json) } } } /// The ShareFolderArgBase struct - open class ShareFolderArgBase: CustomStringConvertible { + public class ShareFolderArgBase: CustomStringConvertible, JSONRepresentable { /// Who can add and remove members of this shared folder. public let aclUpdatePolicy: Sharing.AclUpdatePolicy? /// Whether to force the share to happen asynchronously. public let forceAsync: Bool /// Who can be a member of this shared folder. Only applicable if the current user is on a team. public let memberPolicy: Sharing.MemberPolicy? - /// The path to the folder to share. If it does not exist, then a new one is created. + /// The path or the file id to the folder to share. If it does not exist, then a new one is created. public let path: String /// The policy to apply to shared links created for content inside this shared folder. The current user must be /// on a team to set this policy to members in SharedLinkPolicy. @@ -6488,105 +7931,169 @@ open class Sharing { public let viewerInfoPolicy: Sharing.ViewerInfoPolicy? /// The access inheritance settings for the folder. public let accessInheritance: Sharing.AccessInheritance - public init(path: String, aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, forceAsync: Bool = false, memberPolicy: Sharing.MemberPolicy? = nil, sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, accessInheritance: Sharing.AccessInheritance = .inherit) { + public init( + path: String, + aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, + forceAsync: Bool = false, + memberPolicy: Sharing.MemberPolicy? = nil, + sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, + viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, + accessInheritance: Sharing.AccessInheritance = .inherit + ) { self.aclUpdatePolicy = aclUpdatePolicy self.forceAsync = forceAsync self.memberPolicy = memberPolicy - stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)")(path) + stringValidator(pattern: "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)")(path) self.path = path self.sharedLinkPolicy = sharedLinkPolicy self.viewerInfoPolicy = viewerInfoPolicy self.accessInheritance = accessInheritance } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShareFolderArgBaseSerializer().serialize(self)))" - } - } - open class ShareFolderArgBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShareFolderArgBase) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "acl_update_policy": NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.aclUpdatePolicy), - "force_async": Serialization._BoolSerializer.serialize(value.forceAsync), - "member_policy": NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), - "shared_link_policy": NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.sharedLinkPolicy), - "viewer_info_policy": NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), - "access_inheritance": Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), + + func json() throws -> JSON { + try ShareFolderArgBaseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShareFolderArgBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShareFolderArgBase: \(error)" + } + } + } + + public class ShareFolderArgBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShareFolderArgBase) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "acl_update_policy": try NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.aclUpdatePolicy), + "force_async": try Serialization._BoolSerializer.serialize(value.forceAsync), + "member_policy": try NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), + "shared_link_policy": try NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.sharedLinkPolicy), + "viewer_info_policy": try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), + "access_inheritance": try Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShareFolderArgBase { - switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let aclUpdatePolicy = NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["acl_update_policy"] ?? .null) - let forceAsync = Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) - let memberPolicy = NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) - let sharedLinkPolicy = NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["shared_link_policy"] ?? .null) - let viewerInfoPolicy = NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) - let accessInheritance = Sharing.AccessInheritanceSerializer().deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) - return ShareFolderArgBase(path: path, aclUpdatePolicy: aclUpdatePolicy, forceAsync: forceAsync, memberPolicy: memberPolicy, sharedLinkPolicy: sharedLinkPolicy, viewerInfoPolicy: viewerInfoPolicy, accessInheritance: accessInheritance) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> ShareFolderArgBase { + switch json { + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let aclUpdatePolicy = try NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["acl_update_policy"] ?? .null) + let forceAsync = try Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) + let memberPolicy = try NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) + let sharedLinkPolicy = try NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["shared_link_policy"] ?? .null) + let viewerInfoPolicy = try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) + let accessInheritance = try Sharing.AccessInheritanceSerializer() + .deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) + return ShareFolderArgBase( + path: path, + aclUpdatePolicy: aclUpdatePolicy, + forceAsync: forceAsync, + memberPolicy: memberPolicy, + sharedLinkPolicy: sharedLinkPolicy, + viewerInfoPolicy: viewerInfoPolicy, + accessInheritance: accessInheritance + ) + default: + throw JSONSerializerError.deserializeError(type: ShareFolderArgBase.self, json: json) } } } /// The ShareFolderArg struct - open class ShareFolderArg: Sharing.ShareFolderArgBase { + public class ShareFolderArg: Sharing.ShareFolderArgBase { /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's - /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the - /// folder. - public let actions: Array? + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform + /// on the folder. + public let actions: [Sharing.FolderAction]? /// Settings on the link for this folder. public let linkSettings: Sharing.LinkSettings? - public init(path: String, aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, forceAsync: Bool = false, memberPolicy: Sharing.MemberPolicy? = nil, sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, accessInheritance: Sharing.AccessInheritance = .inherit, actions: Array? = nil, linkSettings: Sharing.LinkSettings? = nil) { + public init( + path: String, + aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, + forceAsync: Bool = false, + memberPolicy: Sharing.MemberPolicy? = nil, + sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, + viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, + accessInheritance: Sharing.AccessInheritance = .inherit, + actions: [Sharing.FolderAction]? = nil, + linkSettings: Sharing.LinkSettings? = nil + ) { self.actions = actions self.linkSettings = linkSettings - super.init(path: path, aclUpdatePolicy: aclUpdatePolicy, forceAsync: forceAsync, memberPolicy: memberPolicy, sharedLinkPolicy: sharedLinkPolicy, viewerInfoPolicy: viewerInfoPolicy, accessInheritance: accessInheritance) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShareFolderArgSerializer().serialize(self)))" - } - } - open class ShareFolderArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShareFolderArg) -> JSON { - let output = [ - "path": Serialization._StringSerializer.serialize(value.path), - "acl_update_policy": NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.aclUpdatePolicy), - "force_async": Serialization._BoolSerializer.serialize(value.forceAsync), - "member_policy": NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), - "shared_link_policy": NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.sharedLinkPolicy), - "viewer_info_policy": NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), - "access_inheritance": Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), - "actions": NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), - "link_settings": NullableSerializer(Sharing.LinkSettingsSerializer()).serialize(value.linkSettings), + super.init( + path: path, + aclUpdatePolicy: aclUpdatePolicy, + forceAsync: forceAsync, + memberPolicy: memberPolicy, + sharedLinkPolicy: sharedLinkPolicy, + viewerInfoPolicy: viewerInfoPolicy, + accessInheritance: accessInheritance + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShareFolderArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShareFolderArg: \(error)" + } + } + } + + public class ShareFolderArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShareFolderArg) throws -> JSON { + let output = [ + "path": try Serialization._StringSerializer.serialize(value.path), + "acl_update_policy": try NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.aclUpdatePolicy), + "force_async": try Serialization._BoolSerializer.serialize(value.forceAsync), + "member_policy": try NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), + "shared_link_policy": try NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.sharedLinkPolicy), + "viewer_info_policy": try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), + "access_inheritance": try Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), + "actions": try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), + "link_settings": try NullableSerializer(Sharing.LinkSettingsSerializer()).serialize(value.linkSettings), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShareFolderArg { - switch json { - case .dictionary(let dict): - let path = Serialization._StringSerializer.deserialize(dict["path"] ?? .null) - let aclUpdatePolicy = NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["acl_update_policy"] ?? .null) - let forceAsync = Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) - let memberPolicy = NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) - let sharedLinkPolicy = NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["shared_link_policy"] ?? .null) - let viewerInfoPolicy = NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) - let accessInheritance = Sharing.AccessInheritanceSerializer().deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) - let actions = NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) - let linkSettings = NullableSerializer(Sharing.LinkSettingsSerializer()).deserialize(dict["link_settings"] ?? .null) - return ShareFolderArg(path: path, aclUpdatePolicy: aclUpdatePolicy, forceAsync: forceAsync, memberPolicy: memberPolicy, sharedLinkPolicy: sharedLinkPolicy, viewerInfoPolicy: viewerInfoPolicy, accessInheritance: accessInheritance, actions: actions, linkSettings: linkSettings) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> ShareFolderArg { + switch json { + case .dictionary(let dict): + let path = try Serialization._StringSerializer.deserialize(dict["path"] ?? .null) + let aclUpdatePolicy = try NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["acl_update_policy"] ?? .null) + let forceAsync = try Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) + let memberPolicy = try NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) + let sharedLinkPolicy = try NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["shared_link_policy"] ?? .null) + let viewerInfoPolicy = try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) + let accessInheritance = try Sharing.AccessInheritanceSerializer() + .deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) + let actions = try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) + let linkSettings = try NullableSerializer(Sharing.LinkSettingsSerializer()).deserialize(dict["link_settings"] ?? .null) + return ShareFolderArg( + path: path, + aclUpdatePolicy: aclUpdatePolicy, + forceAsync: forceAsync, + memberPolicy: memberPolicy, + sharedLinkPolicy: sharedLinkPolicy, + viewerInfoPolicy: viewerInfoPolicy, + accessInheritance: accessInheritance, + actions: actions, + linkSettings: linkSettings + ) + default: + throw JSONSerializerError.deserializeError(type: ShareFolderArg.self, json: json) } } } /// The ShareFolderErrorBase union - public enum ShareFolderErrorBase: CustomStringConvertible { + public enum ShareFolderErrorBase: CustomStringConvertible, JSONRepresentable { /// This user's email address is not verified. This functionality is only available on accounts with a verified /// email address. Users can verify their email address here https://www.dropbox.com/help/317. case emailUnverified @@ -6599,63 +8106,73 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ShareFolderErrorBaseSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShareFolderErrorBaseSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShareFolderErrorBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShareFolderErrorBase: \(error)" + } } } - open class ShareFolderErrorBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShareFolderErrorBase) -> JSON { + + public class ShareFolderErrorBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShareFolderErrorBase) throws -> JSON { switch value { - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .badPath(let arg): - var d = ["bad_path": Sharing.SharePathErrorSerializer().serialize(arg)] - d[".tag"] = .str("bad_path") - return .dictionary(d) - case .teamPolicyDisallowsMemberPolicy: - var d = [String: JSON]() - d[".tag"] = .str("team_policy_disallows_member_policy") - return .dictionary(d) - case .disallowedSharedLinkPolicy: - var d = [String: JSON]() - d[".tag"] = .str("disallowed_shared_link_policy") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShareFolderErrorBase { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "email_unverified": - return ShareFolderErrorBase.emailUnverified - case "bad_path": - let v = Sharing.SharePathErrorSerializer().deserialize(d["bad_path"] ?? .null) - return ShareFolderErrorBase.badPath(v) - case "team_policy_disallows_member_policy": - return ShareFolderErrorBase.teamPolicyDisallowsMemberPolicy - case "disallowed_shared_link_policy": - return ShareFolderErrorBase.disallowedSharedLinkPolicy - case "other": - return ShareFolderErrorBase.other - default: - return ShareFolderErrorBase.other - } - default: - fatalError("Failed to deserialize") + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .badPath(let arg): + var d = try ["bad_path": Sharing.SharePathErrorSerializer().serialize(arg)] + d[".tag"] = .str("bad_path") + return .dictionary(d) + case .teamPolicyDisallowsMemberPolicy: + var d = [String: JSON]() + d[".tag"] = .str("team_policy_disallows_member_policy") + return .dictionary(d) + case .disallowedSharedLinkPolicy: + var d = [String: JSON]() + d[".tag"] = .str("disallowed_shared_link_policy") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShareFolderErrorBase { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "email_unverified": + return ShareFolderErrorBase.emailUnverified + case "bad_path": + let v = try Sharing.SharePathErrorSerializer().deserialize(d["bad_path"] ?? .null) + return ShareFolderErrorBase.badPath(v) + case "team_policy_disallows_member_policy": + return ShareFolderErrorBase.teamPolicyDisallowsMemberPolicy + case "disallowed_shared_link_policy": + return ShareFolderErrorBase.disallowedSharedLinkPolicy + case "other": + return ShareFolderErrorBase.other + default: + return ShareFolderErrorBase.other + } + default: + throw JSONSerializerError.deserializeError(type: ShareFolderErrorBase.self, json: json) } } } /// The ShareFolderError union - public enum ShareFolderError: CustomStringConvertible { + public enum ShareFolderError: CustomStringConvertible, JSONRepresentable { /// This user's email address is not verified. This functionality is only available on accounts with a verified /// email address. Users can verify their email address here https://www.dropbox.com/help/317. case emailUnverified @@ -6670,69 +8187,79 @@ open class Sharing { /// The current user does not have permission to perform this action. case noPermission + func json() throws -> JSON { + try ShareFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShareFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShareFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShareFolderError: \(error)" + } } } - open class ShareFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShareFolderError) -> JSON { + + public class ShareFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShareFolderError) throws -> JSON { switch value { - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .badPath(let arg): - var d = ["bad_path": Sharing.SharePathErrorSerializer().serialize(arg)] - d[".tag"] = .str("bad_path") - return .dictionary(d) - case .teamPolicyDisallowsMemberPolicy: - var d = [String: JSON]() - d[".tag"] = .str("team_policy_disallows_member_policy") - return .dictionary(d) - case .disallowedSharedLinkPolicy: - var d = [String: JSON]() - d[".tag"] = .str("disallowed_shared_link_policy") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShareFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "email_unverified": - return ShareFolderError.emailUnverified - case "bad_path": - let v = Sharing.SharePathErrorSerializer().deserialize(d["bad_path"] ?? .null) - return ShareFolderError.badPath(v) - case "team_policy_disallows_member_policy": - return ShareFolderError.teamPolicyDisallowsMemberPolicy - case "disallowed_shared_link_policy": - return ShareFolderError.disallowedSharedLinkPolicy - case "other": - return ShareFolderError.other - case "no_permission": - return ShareFolderError.noPermission - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .badPath(let arg): + var d = try ["bad_path": Sharing.SharePathErrorSerializer().serialize(arg)] + d[".tag"] = .str("bad_path") + return .dictionary(d) + case .teamPolicyDisallowsMemberPolicy: + var d = [String: JSON]() + d[".tag"] = .str("team_policy_disallows_member_policy") + return .dictionary(d) + case .disallowedSharedLinkPolicy: + var d = [String: JSON]() + d[".tag"] = .str("disallowed_shared_link_policy") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShareFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "email_unverified": + return ShareFolderError.emailUnverified + case "bad_path": + let v = try Sharing.SharePathErrorSerializer().deserialize(d["bad_path"] ?? .null) + return ShareFolderError.badPath(v) + case "team_policy_disallows_member_policy": + return ShareFolderError.teamPolicyDisallowsMemberPolicy + case "disallowed_shared_link_policy": + return ShareFolderError.disallowedSharedLinkPolicy + case "other": + return ShareFolderError.other + case "no_permission": + return ShareFolderError.noPermission + default: + throw JSONSerializerError.unknownTag(type: ShareFolderError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ShareFolderError.self, json: json) } } } /// The ShareFolderJobStatus union - public enum ShareFolderJobStatus: CustomStringConvertible { + public enum ShareFolderJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The share job has finished. The value is the metadata for the folder. @@ -6740,98 +8267,118 @@ open class Sharing { /// An unspecified error. case failed(Sharing.ShareFolderError) + func json() throws -> JSON { + try ShareFolderJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShareFolderJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShareFolderJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShareFolderJobStatus: \(error)" + } } } - open class ShareFolderJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShareFolderJobStatus) -> JSON { + + public class ShareFolderJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShareFolderJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Sharing.SharedFolderMetadataSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Sharing.ShareFolderErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShareFolderJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return ShareFolderJobStatus.inProgress - case "complete": - let v = Sharing.SharedFolderMetadataSerializer().deserialize(json) - return ShareFolderJobStatus.complete(v) - case "failed": - let v = Sharing.ShareFolderErrorSerializer().deserialize(d["failed"] ?? .null) - return ShareFolderJobStatus.failed(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Sharing.SharedFolderMetadataSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Sharing.ShareFolderErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShareFolderJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return ShareFolderJobStatus.inProgress + case "complete": + let v = try Sharing.SharedFolderMetadataSerializer().deserialize(json) + return ShareFolderJobStatus.complete(v) + case "failed": + let v = try Sharing.ShareFolderErrorSerializer().deserialize(d["failed"] ?? .null) + return ShareFolderJobStatus.failed(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ShareFolderJobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ShareFolderJobStatus.self, json: json) } } } /// The ShareFolderLaunch union - public enum ShareFolderLaunch: CustomStringConvertible { + public enum ShareFolderLaunch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) /// An unspecified error. case complete(Sharing.SharedFolderMetadata) + func json() throws -> JSON { + try ShareFolderLaunchSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShareFolderLaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShareFolderLaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShareFolderLaunch: \(error)" + } } } - open class ShareFolderLaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShareFolderLaunch) -> JSON { + + public class ShareFolderLaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShareFolderLaunch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Sharing.SharedFolderMetadataSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShareFolderLaunch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return ShareFolderLaunch.asyncJobId(v) - case "complete": - let v = Sharing.SharedFolderMetadataSerializer().deserialize(json) - return ShareFolderLaunch.complete(v) - default: - fatalError("Unknown tag \(tag)") - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Sharing.SharedFolderMetadataSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShareFolderLaunch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return ShareFolderLaunch.asyncJobId(v) + case "complete": + let v = try Sharing.SharedFolderMetadataSerializer().deserialize(json) + return ShareFolderLaunch.complete(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: ShareFolderLaunch.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: ShareFolderLaunch.self, json: json) } } } /// The SharePathError union - public enum SharePathError: CustomStringConvertible { + public enum SharePathError: CustomStringConvertible, JSONRepresentable { /// A file is at the specified path. case isFile /// We do not support sharing a folder inside a shared folder. @@ -6867,235 +8414,298 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SharePathErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharePathErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharePathErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharePathError: \(error)" + } } } - open class SharePathErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharePathError) -> JSON { + + public class SharePathErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharePathError) throws -> JSON { switch value { - case .isFile: - var d = [String: JSON]() - d[".tag"] = .str("is_file") - return .dictionary(d) - case .insideSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("inside_shared_folder") - return .dictionary(d) - case .containsSharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("contains_shared_folder") - return .dictionary(d) - case .containsAppFolder: - var d = [String: JSON]() - d[".tag"] = .str("contains_app_folder") - return .dictionary(d) - case .containsTeamFolder: - var d = [String: JSON]() - d[".tag"] = .str("contains_team_folder") - return .dictionary(d) - case .isAppFolder: - var d = [String: JSON]() - d[".tag"] = .str("is_app_folder") - return .dictionary(d) - case .insideAppFolder: - var d = [String: JSON]() - d[".tag"] = .str("inside_app_folder") - return .dictionary(d) - case .isPublicFolder: - var d = [String: JSON]() - d[".tag"] = .str("is_public_folder") - return .dictionary(d) - case .insidePublicFolder: - var d = [String: JSON]() - d[".tag"] = .str("inside_public_folder") - return .dictionary(d) - case .alreadyShared(let arg): - var d = Serialization.getFields(Sharing.SharedFolderMetadataSerializer().serialize(arg)) - d[".tag"] = .str("already_shared") - return .dictionary(d) - case .invalidPath: - var d = [String: JSON]() - d[".tag"] = .str("invalid_path") - return .dictionary(d) - case .isOsxPackage: - var d = [String: JSON]() - d[".tag"] = .str("is_osx_package") - return .dictionary(d) - case .insideOsxPackage: - var d = [String: JSON]() - d[".tag"] = .str("inside_osx_package") - return .dictionary(d) - case .isVault: - var d = [String: JSON]() - d[".tag"] = .str("is_vault") - return .dictionary(d) - case .isVaultLocked: - var d = [String: JSON]() - d[".tag"] = .str("is_vault_locked") - return .dictionary(d) - case .isFamily: - var d = [String: JSON]() - d[".tag"] = .str("is_family") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharePathError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "is_file": - return SharePathError.isFile - case "inside_shared_folder": - return SharePathError.insideSharedFolder - case "contains_shared_folder": - return SharePathError.containsSharedFolder - case "contains_app_folder": - return SharePathError.containsAppFolder - case "contains_team_folder": - return SharePathError.containsTeamFolder - case "is_app_folder": - return SharePathError.isAppFolder - case "inside_app_folder": - return SharePathError.insideAppFolder - case "is_public_folder": - return SharePathError.isPublicFolder - case "inside_public_folder": - return SharePathError.insidePublicFolder - case "already_shared": - let v = Sharing.SharedFolderMetadataSerializer().deserialize(json) - return SharePathError.alreadyShared(v) - case "invalid_path": - return SharePathError.invalidPath - case "is_osx_package": - return SharePathError.isOsxPackage - case "inside_osx_package": - return SharePathError.insideOsxPackage - case "is_vault": - return SharePathError.isVault - case "is_vault_locked": - return SharePathError.isVaultLocked - case "is_family": - return SharePathError.isFamily - case "other": - return SharePathError.other - default: - return SharePathError.other - } - default: - fatalError("Failed to deserialize") + case .isFile: + var d = [String: JSON]() + d[".tag"] = .str("is_file") + return .dictionary(d) + case .insideSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("inside_shared_folder") + return .dictionary(d) + case .containsSharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("contains_shared_folder") + return .dictionary(d) + case .containsAppFolder: + var d = [String: JSON]() + d[".tag"] = .str("contains_app_folder") + return .dictionary(d) + case .containsTeamFolder: + var d = [String: JSON]() + d[".tag"] = .str("contains_team_folder") + return .dictionary(d) + case .isAppFolder: + var d = [String: JSON]() + d[".tag"] = .str("is_app_folder") + return .dictionary(d) + case .insideAppFolder: + var d = [String: JSON]() + d[".tag"] = .str("inside_app_folder") + return .dictionary(d) + case .isPublicFolder: + var d = [String: JSON]() + d[".tag"] = .str("is_public_folder") + return .dictionary(d) + case .insidePublicFolder: + var d = [String: JSON]() + d[".tag"] = .str("inside_public_folder") + return .dictionary(d) + case .alreadyShared(let arg): + var d = try Serialization.getFields(Sharing.SharedFolderMetadataSerializer().serialize(arg)) + d[".tag"] = .str("already_shared") + return .dictionary(d) + case .invalidPath: + var d = [String: JSON]() + d[".tag"] = .str("invalid_path") + return .dictionary(d) + case .isOsxPackage: + var d = [String: JSON]() + d[".tag"] = .str("is_osx_package") + return .dictionary(d) + case .insideOsxPackage: + var d = [String: JSON]() + d[".tag"] = .str("inside_osx_package") + return .dictionary(d) + case .isVault: + var d = [String: JSON]() + d[".tag"] = .str("is_vault") + return .dictionary(d) + case .isVaultLocked: + var d = [String: JSON]() + d[".tag"] = .str("is_vault_locked") + return .dictionary(d) + case .isFamily: + var d = [String: JSON]() + d[".tag"] = .str("is_family") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharePathError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "is_file": + return SharePathError.isFile + case "inside_shared_folder": + return SharePathError.insideSharedFolder + case "contains_shared_folder": + return SharePathError.containsSharedFolder + case "contains_app_folder": + return SharePathError.containsAppFolder + case "contains_team_folder": + return SharePathError.containsTeamFolder + case "is_app_folder": + return SharePathError.isAppFolder + case "inside_app_folder": + return SharePathError.insideAppFolder + case "is_public_folder": + return SharePathError.isPublicFolder + case "inside_public_folder": + return SharePathError.insidePublicFolder + case "already_shared": + let v = try Sharing.SharedFolderMetadataSerializer().deserialize(json) + return SharePathError.alreadyShared(v) + case "invalid_path": + return SharePathError.invalidPath + case "is_osx_package": + return SharePathError.isOsxPackage + case "inside_osx_package": + return SharePathError.insideOsxPackage + case "is_vault": + return SharePathError.isVault + case "is_vault_locked": + return SharePathError.isVaultLocked + case "is_family": + return SharePathError.isFamily + case "other": + return SharePathError.other + default: + return SharePathError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharePathError.self, json: json) } } } /// Metadata of a shared link for a file or folder. - open class SharedContentLinkMetadata: Sharing.SharedContentLinkMetadataBase { + public class SharedContentLinkMetadata: Sharing.SharedContentLinkMetadataBase { /// The content inside this folder with link audience different than this folder's. This is only returned when /// an endpoint that returns metadata for a single shared folder is called, e.g. /get_folder_metadata. public let audienceExceptions: Sharing.AudienceExceptions? /// The URL of the link. public let url: String - public init(audienceOptions: Array, currentAudience: Sharing.LinkAudience, linkPermissions: Array, passwordProtected: Bool, url: String, accessLevel: Sharing.AccessLevel? = nil, audienceRestrictingSharedFolder: Sharing.AudienceRestrictingSharedFolder? = nil, expiry: Date? = nil, audienceExceptions: Sharing.AudienceExceptions? = nil) { + public init( + audienceOptions: [Sharing.LinkAudience], + currentAudience: Sharing.LinkAudience, + linkPermissions: [Sharing.LinkPermission], + passwordProtected: Bool, + url: String, + accessLevel: Sharing.AccessLevel? = nil, + audienceRestrictingSharedFolder: Sharing.AudienceRestrictingSharedFolder? = nil, + expiry: Date? = nil, + audienceExceptions: Sharing.AudienceExceptions? = nil + ) { self.audienceExceptions = audienceExceptions stringValidator()(url) self.url = url - super.init(audienceOptions: audienceOptions, currentAudience: currentAudience, linkPermissions: linkPermissions, passwordProtected: passwordProtected, accessLevel: accessLevel, audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, expiry: expiry) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentLinkMetadataSerializer().serialize(self)))" - } - } - open class SharedContentLinkMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentLinkMetadata) -> JSON { - let output = [ - "audience_options": ArraySerializer(Sharing.LinkAudienceSerializer()).serialize(value.audienceOptions), - "current_audience": Sharing.LinkAudienceSerializer().serialize(value.currentAudience), - "link_permissions": ArraySerializer(Sharing.LinkPermissionSerializer()).serialize(value.linkPermissions), - "password_protected": Serialization._BoolSerializer.serialize(value.passwordProtected), - "url": Serialization._StringSerializer.serialize(value.url), - "access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), - "audience_restricting_shared_folder": NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()).serialize(value.audienceRestrictingSharedFolder), - "expiry": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiry), - "audience_exceptions": NullableSerializer(Sharing.AudienceExceptionsSerializer()).serialize(value.audienceExceptions), + super.init( + audienceOptions: audienceOptions, + currentAudience: currentAudience, + linkPermissions: linkPermissions, + passwordProtected: passwordProtected, + accessLevel: accessLevel, + audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, + expiry: expiry + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentLinkMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentLinkMetadata: \(error)" + } + } + } + + public class SharedContentLinkMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentLinkMetadata) throws -> JSON { + let output = [ + "audience_options": try ArraySerializer(Sharing.LinkAudienceSerializer()).serialize(value.audienceOptions), + "current_audience": try Sharing.LinkAudienceSerializer().serialize(value.currentAudience), + "link_permissions": try ArraySerializer(Sharing.LinkPermissionSerializer()).serialize(value.linkPermissions), + "password_protected": try Serialization._BoolSerializer.serialize(value.passwordProtected), + "url": try Serialization._StringSerializer.serialize(value.url), + "access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessLevel), + "audience_restricting_shared_folder": try NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()) + .serialize(value.audienceRestrictingSharedFolder), + "expiry": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expiry), + "audience_exceptions": try NullableSerializer(Sharing.AudienceExceptionsSerializer()).serialize(value.audienceExceptions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentLinkMetadata { - switch json { - case .dictionary(let dict): - let audienceOptions = ArraySerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience_options"] ?? .null) - let currentAudience = Sharing.LinkAudienceSerializer().deserialize(dict["current_audience"] ?? .null) - let linkPermissions = ArraySerializer(Sharing.LinkPermissionSerializer()).deserialize(dict["link_permissions"] ?? .null) - let passwordProtected = Serialization._BoolSerializer.deserialize(dict["password_protected"] ?? .null) - let url = Serialization._StringSerializer.deserialize(dict["url"] ?? .null) - let accessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) - let audienceRestrictingSharedFolder = NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()).deserialize(dict["audience_restricting_shared_folder"] ?? .null) - let expiry = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiry"] ?? .null) - let audienceExceptions = NullableSerializer(Sharing.AudienceExceptionsSerializer()).deserialize(dict["audience_exceptions"] ?? .null) - return SharedContentLinkMetadata(audienceOptions: audienceOptions, currentAudience: currentAudience, linkPermissions: linkPermissions, passwordProtected: passwordProtected, url: url, accessLevel: accessLevel, audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, expiry: expiry, audienceExceptions: audienceExceptions) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SharedContentLinkMetadata { + switch json { + case .dictionary(let dict): + let audienceOptions = try ArraySerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience_options"] ?? .null) + let currentAudience = try Sharing.LinkAudienceSerializer().deserialize(dict["current_audience"] ?? .null) + let linkPermissions = try ArraySerializer(Sharing.LinkPermissionSerializer()).deserialize(dict["link_permissions"] ?? .null) + let passwordProtected = try Serialization._BoolSerializer.deserialize(dict["password_protected"] ?? .null) + let url = try Serialization._StringSerializer.deserialize(dict["url"] ?? .null) + let accessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_level"] ?? .null) + let audienceRestrictingSharedFolder = try NullableSerializer(Sharing.AudienceRestrictingSharedFolderSerializer()) + .deserialize(dict["audience_restricting_shared_folder"] ?? .null) + let expiry = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expiry"] ?? .null) + let audienceExceptions = try NullableSerializer(Sharing.AudienceExceptionsSerializer()).deserialize(dict["audience_exceptions"] ?? .null) + return SharedContentLinkMetadata( + audienceOptions: audienceOptions, + currentAudience: currentAudience, + linkPermissions: linkPermissions, + passwordProtected: passwordProtected, + url: url, + accessLevel: accessLevel, + audienceRestrictingSharedFolder: audienceRestrictingSharedFolder, + expiry: expiry, + audienceExceptions: audienceExceptions + ) + default: + throw JSONSerializerError.deserializeError(type: SharedContentLinkMetadata.self, json: json) } } } /// Shared file user, group, and invitee membership. Used for the results of listFileMembers and /// listFileMembersContinue, and used as part of the results for listFileMembersBatch. - open class SharedFileMembers: CustomStringConvertible { + public class SharedFileMembers: CustomStringConvertible, JSONRepresentable { /// The list of user members of the shared file. - public let users: Array + public let users: [Sharing.UserFileMembershipInfo] /// The list of group members of the shared file. - public let groups: Array + public let groups: [Sharing.GroupMembershipInfo] /// The list of invited members of a file, but have not logged in and claimed this. - public let invitees: Array + public let invitees: [Sharing.InviteeMembershipInfo] /// Present if there are additional shared file members that have not been returned yet. Pass the cursor into /// listFileMembersContinue to list additional members. public let cursor: String? - public init(users: Array, groups: Array, invitees: Array, cursor: String? = nil) { + public init( + users: [Sharing.UserFileMembershipInfo], + groups: [Sharing.GroupMembershipInfo], + invitees: [Sharing.InviteeMembershipInfo], + cursor: String? = nil + ) { self.users = users self.groups = groups self.invitees = invitees nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFileMembersSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFileMembersSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFileMembersSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFileMembers: \(error)" + } } } - open class SharedFileMembersSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFileMembers) -> JSON { - let output = [ - "users": ArraySerializer(Sharing.UserFileMembershipInfoSerializer()).serialize(value.users), - "groups": ArraySerializer(Sharing.GroupMembershipInfoSerializer()).serialize(value.groups), - "invitees": ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).serialize(value.invitees), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class SharedFileMembersSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFileMembers) throws -> JSON { + let output = [ + "users": try ArraySerializer(Sharing.UserFileMembershipInfoSerializer()).serialize(value.users), + "groups": try ArraySerializer(Sharing.GroupMembershipInfoSerializer()).serialize(value.groups), + "invitees": try ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).serialize(value.invitees), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFileMembers { + + public func deserialize(_ json: JSON) throws -> SharedFileMembers { switch json { - case .dictionary(let dict): - let users = ArraySerializer(Sharing.UserFileMembershipInfoSerializer()).deserialize(dict["users"] ?? .null) - let groups = ArraySerializer(Sharing.GroupMembershipInfoSerializer()).deserialize(dict["groups"] ?? .null) - let invitees = ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).deserialize(dict["invitees"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return SharedFileMembers(users: users, groups: groups, invitees: invitees, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let users = try ArraySerializer(Sharing.UserFileMembershipInfoSerializer()).deserialize(dict["users"] ?? .null) + let groups = try ArraySerializer(Sharing.GroupMembershipInfoSerializer()).deserialize(dict["groups"] ?? .null) + let invitees = try ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).deserialize(dict["invitees"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return SharedFileMembers(users: users, groups: groups, invitees: invitees, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: SharedFileMembers.self, json: json) } } } /// Properties of the shared file. - open class SharedFileMetadata: CustomStringConvertible { + public class SharedFileMetadata: CustomStringConvertible, JSONRepresentable { /// The current user's access level for this shared file. public let accessType: Sharing.AccessLevel? /// The ID of the file. @@ -7110,7 +8720,7 @@ open class Sharing { public let name: String /// The display names of the users that own the file. If the file is part of a team folder, the display names of /// the team admins are also included. Absent if the owner display names cannot be fetched. - public let ownerDisplayNames: Array? + public let ownerDisplayNames: [String]? /// The team that owns the file. This field is not present if the file is not owned by a team. public let ownerTeam: Users.Team? /// The ID of the parent shared folder. This field is present only if the file is contained within a shared @@ -7124,16 +8734,31 @@ open class Sharing { public let pathLower: String? /// The sharing permissions that requesting user has on this file. This corresponds to the entries given in /// actions in GetFileMetadataBatchArg or actions in GetFileMetadataArg. - public let permissions: Array? + public let permissions: [Sharing.FilePermission]? /// Policies governing this shared file. public let policy: Sharing.FolderPolicy /// URL for displaying a web preview of the shared file. public let previewUrl: String /// Timestamp indicating when the current user was invited to this shared file. If the user was not invited to - /// the shared file, the timestamp will indicate when the user was invited to the parent shared folder. This - /// value may be absent. + /// the shared file, the timestamp will indicate when the user was invited to the parent shared folder. + /// This value may be absent. public let timeInvited: Date? - public init(id: String, name: String, policy: Sharing.FolderPolicy, previewUrl: String, accessType: Sharing.AccessLevel? = nil, expectedLinkMetadata: Sharing.ExpectedSharedContentLinkMetadata? = nil, linkMetadata: Sharing.SharedContentLinkMetadata? = nil, ownerDisplayNames: Array? = nil, ownerTeam: Users.Team? = nil, parentSharedFolderId: String? = nil, pathDisplay: String? = nil, pathLower: String? = nil, permissions: Array? = nil, timeInvited: Date? = nil) { + public init( + id: String, + name: String, + policy: Sharing.FolderPolicy, + previewUrl: String, + accessType: Sharing.AccessLevel? = nil, + expectedLinkMetadata: Sharing.ExpectedSharedContentLinkMetadata? = nil, + linkMetadata: Sharing.SharedContentLinkMetadata? = nil, + ownerDisplayNames: [String]? = nil, + ownerTeam: Users.Team? = nil, + parentSharedFolderId: String? = nil, + pathDisplay: String? = nil, + pathLower: String? = nil, + permissions: [Sharing.FilePermission]? = nil, + timeInvited: Date? = nil + ) { self.accessType = accessType stringValidator(minLength: 4, pattern: "id:.+")(id) self.id = id @@ -7156,61 +8781,91 @@ open class Sharing { self.previewUrl = previewUrl self.timeInvited = timeInvited } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFileMetadataSerializer().serialize(self)))" - } - } - open class SharedFileMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFileMetadata) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "name": Serialization._StringSerializer.serialize(value.name), - "policy": Sharing.FolderPolicySerializer().serialize(value.policy), - "preview_url": Serialization._StringSerializer.serialize(value.previewUrl), - "access_type": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessType), - "expected_link_metadata": NullableSerializer(Sharing.ExpectedSharedContentLinkMetadataSerializer()).serialize(value.expectedLinkMetadata), - "link_metadata": NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).serialize(value.linkMetadata), - "owner_display_names": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.ownerDisplayNames), - "owner_team": NullableSerializer(Users.TeamSerializer()).serialize(value.ownerTeam), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "path_display": NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "permissions": NullableSerializer(ArraySerializer(Sharing.FilePermissionSerializer())).serialize(value.permissions), - "time_invited": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeInvited), + + func json() throws -> JSON { + try SharedFileMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFileMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFileMetadata: \(error)" + } + } + } + + public class SharedFileMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFileMetadata) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "name": try Serialization._StringSerializer.serialize(value.name), + "policy": try Sharing.FolderPolicySerializer().serialize(value.policy), + "preview_url": try Serialization._StringSerializer.serialize(value.previewUrl), + "access_type": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.accessType), + "expected_link_metadata": try NullableSerializer(Sharing.ExpectedSharedContentLinkMetadataSerializer()).serialize(value.expectedLinkMetadata), + "link_metadata": try NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).serialize(value.linkMetadata), + "owner_display_names": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.ownerDisplayNames), + "owner_team": try NullableSerializer(Users.TeamSerializer()).serialize(value.ownerTeam), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "path_display": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "permissions": try NullableSerializer(ArraySerializer(Sharing.FilePermissionSerializer())).serialize(value.permissions), + "time_invited": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeInvited), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFileMetadata { - switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let policy = Sharing.FolderPolicySerializer().deserialize(dict["policy"] ?? .null) - let previewUrl = Serialization._StringSerializer.deserialize(dict["preview_url"] ?? .null) - let accessType = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_type"] ?? .null) - let expectedLinkMetadata = NullableSerializer(Sharing.ExpectedSharedContentLinkMetadataSerializer()).deserialize(dict["expected_link_metadata"] ?? .null) - let linkMetadata = NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).deserialize(dict["link_metadata"] ?? .null) - let ownerDisplayNames = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["owner_display_names"] ?? .null) - let ownerTeam = NullableSerializer(Users.TeamSerializer()).deserialize(dict["owner_team"] ?? .null) - let parentSharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) - let pathDisplay = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let permissions = NullableSerializer(ArraySerializer(Sharing.FilePermissionSerializer())).deserialize(dict["permissions"] ?? .null) - let timeInvited = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_invited"] ?? .null) - return SharedFileMetadata(id: id, name: name, policy: policy, previewUrl: previewUrl, accessType: accessType, expectedLinkMetadata: expectedLinkMetadata, linkMetadata: linkMetadata, ownerDisplayNames: ownerDisplayNames, ownerTeam: ownerTeam, parentSharedFolderId: parentSharedFolderId, pathDisplay: pathDisplay, pathLower: pathLower, permissions: permissions, timeInvited: timeInvited) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SharedFileMetadata { + switch json { + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let policy = try Sharing.FolderPolicySerializer().deserialize(dict["policy"] ?? .null) + let previewUrl = try Serialization._StringSerializer.deserialize(dict["preview_url"] ?? .null) + let accessType = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["access_type"] ?? .null) + let expectedLinkMetadata = try NullableSerializer(Sharing.ExpectedSharedContentLinkMetadataSerializer()) + .deserialize(dict["expected_link_metadata"] ?? .null) + let linkMetadata = try NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).deserialize(dict["link_metadata"] ?? .null) + let ownerDisplayNames = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)) + .deserialize(dict["owner_display_names"] ?? .null) + let ownerTeam = try NullableSerializer(Users.TeamSerializer()).deserialize(dict["owner_team"] ?? .null) + let parentSharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) + let pathDisplay = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let permissions = try NullableSerializer(ArraySerializer(Sharing.FilePermissionSerializer())).deserialize(dict["permissions"] ?? .null) + let timeInvited = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_invited"] ?? .null) + return SharedFileMetadata( + id: id, + name: name, + policy: policy, + previewUrl: previewUrl, + accessType: accessType, + expectedLinkMetadata: expectedLinkMetadata, + linkMetadata: linkMetadata, + ownerDisplayNames: ownerDisplayNames, + ownerTeam: ownerTeam, + parentSharedFolderId: parentSharedFolderId, + pathDisplay: pathDisplay, + pathLower: pathLower, + permissions: permissions, + timeInvited: timeInvited + ) + default: + throw JSONSerializerError.deserializeError(type: SharedFileMetadata.self, json: json) } } } /// There is an error accessing the shared folder. - public enum SharedFolderAccessError: CustomStringConvertible { + public enum SharedFolderAccessError: CustomStringConvertible, JSONRepresentable { /// This shared folder ID is invalid. case invalidId /// The user is not a member of the shared folder thus cannot access it. case notAMember + /// The user does not exist or their account is disabled. + case invalidMember /// Never set. case emailUnverified /// The shared folder is unmounted. @@ -7218,62 +8873,78 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SharedFolderAccessErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderAccessErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderAccessErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderAccessError: \(error)" + } } } - open class SharedFolderAccessErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderAccessError) -> JSON { + + public class SharedFolderAccessErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderAccessError) throws -> JSON { switch value { - case .invalidId: - var d = [String: JSON]() - d[".tag"] = .str("invalid_id") - return .dictionary(d) - case .notAMember: - var d = [String: JSON]() - d[".tag"] = .str("not_a_member") - return .dictionary(d) - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .unmounted: - var d = [String: JSON]() - d[".tag"] = .str("unmounted") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedFolderAccessError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_id": - return SharedFolderAccessError.invalidId - case "not_a_member": - return SharedFolderAccessError.notAMember - case "email_unverified": - return SharedFolderAccessError.emailUnverified - case "unmounted": - return SharedFolderAccessError.unmounted - case "other": - return SharedFolderAccessError.other - default: - return SharedFolderAccessError.other - } - default: - fatalError("Failed to deserialize") + case .invalidId: + var d = [String: JSON]() + d[".tag"] = .str("invalid_id") + return .dictionary(d) + case .notAMember: + var d = [String: JSON]() + d[".tag"] = .str("not_a_member") + return .dictionary(d) + case .invalidMember: + var d = [String: JSON]() + d[".tag"] = .str("invalid_member") + return .dictionary(d) + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .unmounted: + var d = [String: JSON]() + d[".tag"] = .str("unmounted") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedFolderAccessError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_id": + return SharedFolderAccessError.invalidId + case "not_a_member": + return SharedFolderAccessError.notAMember + case "invalid_member": + return SharedFolderAccessError.invalidMember + case "email_unverified": + return SharedFolderAccessError.emailUnverified + case "unmounted": + return SharedFolderAccessError.unmounted + case "other": + return SharedFolderAccessError.other + default: + return SharedFolderAccessError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedFolderAccessError.self, json: json) } } } /// The SharedFolderMemberError union - public enum SharedFolderMemberError: CustomStringConvertible { + public enum SharedFolderMemberError: CustomStringConvertible, JSONRepresentable { /// The target dropbox_id is invalid. case invalidDropboxId /// The target dropbox_id is not a member of the shared folder. @@ -7283,104 +8954,130 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SharedFolderMemberErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMemberErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMemberErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMemberError: \(error)" + } } } - open class SharedFolderMemberErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMemberError) -> JSON { + + public class SharedFolderMemberErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMemberError) throws -> JSON { switch value { - case .invalidDropboxId: - var d = [String: JSON]() - d[".tag"] = .str("invalid_dropbox_id") - return .dictionary(d) - case .notAMember: - var d = [String: JSON]() - d[".tag"] = .str("not_a_member") - return .dictionary(d) - case .noExplicitAccess(let arg): - var d = Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) - d[".tag"] = .str("no_explicit_access") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedFolderMemberError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_dropbox_id": - return SharedFolderMemberError.invalidDropboxId - case "not_a_member": - return SharedFolderMemberError.notAMember - case "no_explicit_access": - let v = Sharing.MemberAccessLevelResultSerializer().deserialize(json) - return SharedFolderMemberError.noExplicitAccess(v) - case "other": - return SharedFolderMemberError.other - default: - return SharedFolderMemberError.other - } - default: - fatalError("Failed to deserialize") + case .invalidDropboxId: + var d = [String: JSON]() + d[".tag"] = .str("invalid_dropbox_id") + return .dictionary(d) + case .notAMember: + var d = [String: JSON]() + d[".tag"] = .str("not_a_member") + return .dictionary(d) + case .noExplicitAccess(let arg): + var d = try Serialization.getFields(Sharing.MemberAccessLevelResultSerializer().serialize(arg)) + d[".tag"] = .str("no_explicit_access") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedFolderMemberError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_dropbox_id": + return SharedFolderMemberError.invalidDropboxId + case "not_a_member": + return SharedFolderMemberError.notAMember + case "no_explicit_access": + let v = try Sharing.MemberAccessLevelResultSerializer().deserialize(json) + return SharedFolderMemberError.noExplicitAccess(v) + case "other": + return SharedFolderMemberError.other + default: + return SharedFolderMemberError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMemberError.self, json: json) } } } /// Shared folder user and group membership. - open class SharedFolderMembers: CustomStringConvertible { + public class SharedFolderMembers: CustomStringConvertible, JSONRepresentable { /// The list of user members of the shared folder. - public let users: Array + public let users: [Sharing.UserMembershipInfo] /// The list of group members of the shared folder. - public let groups: Array + public let groups: [Sharing.GroupMembershipInfo] /// The list of invitees to the shared folder. - public let invitees: Array + public let invitees: [Sharing.InviteeMembershipInfo] /// Present if there are additional shared folder members that have not been returned yet. Pass the cursor into /// listFolderMembersContinue to list additional members. public let cursor: String? - public init(users: Array, groups: Array, invitees: Array, cursor: String? = nil) { + public init( + users: [Sharing.UserMembershipInfo], + groups: [Sharing.GroupMembershipInfo], + invitees: [Sharing.InviteeMembershipInfo], + cursor: String? = nil + ) { self.users = users self.groups = groups self.invitees = invitees nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMembersSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderMembersSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMembersSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMembers: \(error)" + } } } - open class SharedFolderMembersSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMembers) -> JSON { - let output = [ - "users": ArraySerializer(Sharing.UserMembershipInfoSerializer()).serialize(value.users), - "groups": ArraySerializer(Sharing.GroupMembershipInfoSerializer()).serialize(value.groups), - "invitees": ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).serialize(value.invitees), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class SharedFolderMembersSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMembers) throws -> JSON { + let output = [ + "users": try ArraySerializer(Sharing.UserMembershipInfoSerializer()).serialize(value.users), + "groups": try ArraySerializer(Sharing.GroupMembershipInfoSerializer()).serialize(value.groups), + "invitees": try ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).serialize(value.invitees), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderMembers { + + public func deserialize(_ json: JSON) throws -> SharedFolderMembers { switch json { - case .dictionary(let dict): - let users = ArraySerializer(Sharing.UserMembershipInfoSerializer()).deserialize(dict["users"] ?? .null) - let groups = ArraySerializer(Sharing.GroupMembershipInfoSerializer()).deserialize(dict["groups"] ?? .null) - let invitees = ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).deserialize(dict["invitees"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return SharedFolderMembers(users: users, groups: groups, invitees: invitees, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let users = try ArraySerializer(Sharing.UserMembershipInfoSerializer()).deserialize(dict["users"] ?? .null) + let groups = try ArraySerializer(Sharing.GroupMembershipInfoSerializer()).deserialize(dict["groups"] ?? .null) + let invitees = try ArraySerializer(Sharing.InviteeMembershipInfoSerializer()).deserialize(dict["invitees"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return SharedFolderMembers(users: users, groups: groups, invitees: invitees, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMembers.self, json: json) } } } /// Properties of the shared folder. - open class SharedFolderMetadataBase: CustomStringConvertible { + public class SharedFolderMetadataBase: CustomStringConvertible, JSONRepresentable { /// The current user's access level for this shared folder. public let accessType: Sharing.AccessLevel /// Whether this folder is inside of a team folder. @@ -7389,17 +9086,29 @@ open class Sharing { public let isTeamFolder: Bool /// The display names of the users that own the folder. If the folder is part of a team folder, the display /// names of the team admins are also included. Absent if the owner display names cannot be fetched. - public let ownerDisplayNames: Array? + public let ownerDisplayNames: [String]? /// The team that owns the folder. This field is not present if the folder is not owned by a team. public let ownerTeam: Users.Team? /// The ID of the parent shared folder. This field is present only if the folder is contained within another /// shared folder. public let parentSharedFolderId: String? + /// The full path of this shared folder. Absent for unmounted folders. + public let pathDisplay: String? /// The lower-cased full path of this shared folder. Absent for unmounted folders. public let pathLower: String? /// Display name for the parent folder. public let parentFolderName: String? - public init(accessType: Sharing.AccessLevel, isInsideTeamFolder: Bool, isTeamFolder: Bool, ownerDisplayNames: Array? = nil, ownerTeam: Users.Team? = nil, parentSharedFolderId: String? = nil, pathLower: String? = nil, parentFolderName: String? = nil) { + public init( + accessType: Sharing.AccessLevel, + isInsideTeamFolder: Bool, + isTeamFolder: Bool, + ownerDisplayNames: [String]? = nil, + ownerTeam: Users.Team? = nil, + parentSharedFolderId: String? = nil, + pathDisplay: String? = nil, + pathLower: String? = nil, + parentFolderName: String? = nil + ) { self.accessType = accessType self.isInsideTeamFolder = isInsideTeamFolder self.isTeamFolder = isTeamFolder @@ -7408,50 +9117,76 @@ open class Sharing { self.ownerTeam = ownerTeam nullableValidator(stringValidator(pattern: "[-_0-9a-zA-Z:]+"))(parentSharedFolderId) self.parentSharedFolderId = parentSharedFolderId + nullableValidator(stringValidator())(pathDisplay) + self.pathDisplay = pathDisplay nullableValidator(stringValidator())(pathLower) self.pathLower = pathLower nullableValidator(stringValidator())(parentFolderName) self.parentFolderName = parentFolderName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMetadataBaseSerializer().serialize(self)))" - } - } - open class SharedFolderMetadataBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMetadataBase) -> JSON { - let output = [ - "access_type": Sharing.AccessLevelSerializer().serialize(value.accessType), - "is_inside_team_folder": Serialization._BoolSerializer.serialize(value.isInsideTeamFolder), - "is_team_folder": Serialization._BoolSerializer.serialize(value.isTeamFolder), - "owner_display_names": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.ownerDisplayNames), - "owner_team": NullableSerializer(Users.TeamSerializer()).serialize(value.ownerTeam), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "parent_folder_name": NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderName), + + func json() throws -> JSON { + try SharedFolderMetadataBaseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMetadataBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMetadataBase: \(error)" + } + } + } + + public class SharedFolderMetadataBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMetadataBase) throws -> JSON { + let output = [ + "access_type": try Sharing.AccessLevelSerializer().serialize(value.accessType), + "is_inside_team_folder": try Serialization._BoolSerializer.serialize(value.isInsideTeamFolder), + "is_team_folder": try Serialization._BoolSerializer.serialize(value.isTeamFolder), + "owner_display_names": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.ownerDisplayNames), + "owner_team": try NullableSerializer(Users.TeamSerializer()).serialize(value.ownerTeam), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "path_display": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "parent_folder_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderMetadataBase { - switch json { - case .dictionary(let dict): - let accessType = Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) - let isInsideTeamFolder = Serialization._BoolSerializer.deserialize(dict["is_inside_team_folder"] ?? .null) - let isTeamFolder = Serialization._BoolSerializer.deserialize(dict["is_team_folder"] ?? .null) - let ownerDisplayNames = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["owner_display_names"] ?? .null) - let ownerTeam = NullableSerializer(Users.TeamSerializer()).deserialize(dict["owner_team"] ?? .null) - let parentSharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let parentFolderName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_name"] ?? .null) - return SharedFolderMetadataBase(accessType: accessType, isInsideTeamFolder: isInsideTeamFolder, isTeamFolder: isTeamFolder, ownerDisplayNames: ownerDisplayNames, ownerTeam: ownerTeam, parentSharedFolderId: parentSharedFolderId, pathLower: pathLower, parentFolderName: parentFolderName) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SharedFolderMetadataBase { + switch json { + case .dictionary(let dict): + let accessType = try Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) + let isInsideTeamFolder = try Serialization._BoolSerializer.deserialize(dict["is_inside_team_folder"] ?? .null) + let isTeamFolder = try Serialization._BoolSerializer.deserialize(dict["is_team_folder"] ?? .null) + let ownerDisplayNames = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)) + .deserialize(dict["owner_display_names"] ?? .null) + let ownerTeam = try NullableSerializer(Users.TeamSerializer()).deserialize(dict["owner_team"] ?? .null) + let parentSharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) + let pathDisplay = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let parentFolderName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_name"] ?? .null) + return SharedFolderMetadataBase( + accessType: accessType, + isInsideTeamFolder: isInsideTeamFolder, + isTeamFolder: isTeamFolder, + ownerDisplayNames: ownerDisplayNames, + ownerTeam: ownerTeam, + parentSharedFolderId: parentSharedFolderId, + pathDisplay: pathDisplay, + pathLower: pathLower, + parentFolderName: parentFolderName + ) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMetadataBase.self, json: json) } } } /// The metadata which includes basic information about the shared folder. - open class SharedFolderMetadata: Sharing.SharedFolderMetadataBase { + public class SharedFolderMetadata: Sharing.SharedFolderMetadataBase { /// The metadata of the shared content link to this shared folder. Absent if there is no link on the folder. /// This is for an unreleased feature so it may not be returned yet. public let linkMetadata: Sharing.SharedContentLinkMetadata? @@ -7459,7 +9194,7 @@ open class Sharing { public let name: String /// Actions the current user may perform on the folder and its contents. The set of permissions corresponds to /// the FolderActions in the request. - public let permissions: Array? + public let permissions: [Sharing.FolderPermission]? /// Policies governing this shared folder. public let policy: Sharing.FolderPolicy /// URL for displaying a web preview of the shared folder. @@ -7470,7 +9205,25 @@ open class Sharing { public let timeInvited: Date /// Whether the folder inherits its members from its parent. public let accessInheritance: Sharing.AccessInheritance - public init(accessType: Sharing.AccessLevel, isInsideTeamFolder: Bool, isTeamFolder: Bool, name: String, policy: Sharing.FolderPolicy, previewUrl: String, sharedFolderId: String, timeInvited: Date, ownerDisplayNames: Array? = nil, ownerTeam: Users.Team? = nil, parentSharedFolderId: String? = nil, pathLower: String? = nil, parentFolderName: String? = nil, linkMetadata: Sharing.SharedContentLinkMetadata? = nil, permissions: Array? = nil, accessInheritance: Sharing.AccessInheritance = .inherit) { + public init( + accessType: Sharing.AccessLevel, + isInsideTeamFolder: Bool, + isTeamFolder: Bool, + name: String, + policy: Sharing.FolderPolicy, + previewUrl: String, + sharedFolderId: String, + timeInvited: Date, + ownerDisplayNames: [String]? = nil, + ownerTeam: Users.Team? = nil, + parentSharedFolderId: String? = nil, + pathDisplay: String? = nil, + pathLower: String? = nil, + parentFolderName: String? = nil, + linkMetadata: Sharing.SharedContentLinkMetadata? = nil, + permissions: [Sharing.FolderPermission]? = nil, + accessInheritance: Sharing.AccessInheritance = .inherit + ) { self.linkMetadata = linkMetadata stringValidator()(name) self.name = name @@ -7482,63 +9235,102 @@ open class Sharing { self.sharedFolderId = sharedFolderId self.timeInvited = timeInvited self.accessInheritance = accessInheritance - super.init(accessType: accessType, isInsideTeamFolder: isInsideTeamFolder, isTeamFolder: isTeamFolder, ownerDisplayNames: ownerDisplayNames, ownerTeam: ownerTeam, parentSharedFolderId: parentSharedFolderId, pathLower: pathLower, parentFolderName: parentFolderName) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMetadataSerializer().serialize(self)))" - } - } - open class SharedFolderMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMetadata) -> JSON { - let output = [ - "access_type": Sharing.AccessLevelSerializer().serialize(value.accessType), - "is_inside_team_folder": Serialization._BoolSerializer.serialize(value.isInsideTeamFolder), - "is_team_folder": Serialization._BoolSerializer.serialize(value.isTeamFolder), - "name": Serialization._StringSerializer.serialize(value.name), - "policy": Sharing.FolderPolicySerializer().serialize(value.policy), - "preview_url": Serialization._StringSerializer.serialize(value.previewUrl), - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "time_invited": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.timeInvited), - "owner_display_names": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.ownerDisplayNames), - "owner_team": NullableSerializer(Users.TeamSerializer()).serialize(value.ownerTeam), - "parent_shared_folder_id": NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), - "path_lower": NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), - "parent_folder_name": NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderName), - "link_metadata": NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).serialize(value.linkMetadata), - "permissions": NullableSerializer(ArraySerializer(Sharing.FolderPermissionSerializer())).serialize(value.permissions), - "access_inheritance": Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), + super.init( + accessType: accessType, + isInsideTeamFolder: isInsideTeamFolder, + isTeamFolder: isTeamFolder, + ownerDisplayNames: ownerDisplayNames, + ownerTeam: ownerTeam, + parentSharedFolderId: parentSharedFolderId, + pathDisplay: pathDisplay, + pathLower: pathLower, + parentFolderName: parentFolderName + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMetadata: \(error)" + } + } + } + + public class SharedFolderMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMetadata) throws -> JSON { + let output = [ + "access_type": try Sharing.AccessLevelSerializer().serialize(value.accessType), + "is_inside_team_folder": try Serialization._BoolSerializer.serialize(value.isInsideTeamFolder), + "is_team_folder": try Serialization._BoolSerializer.serialize(value.isTeamFolder), + "name": try Serialization._StringSerializer.serialize(value.name), + "policy": try Sharing.FolderPolicySerializer().serialize(value.policy), + "preview_url": try Serialization._StringSerializer.serialize(value.previewUrl), + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "time_invited": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.timeInvited), + "owner_display_names": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.ownerDisplayNames), + "owner_team": try NullableSerializer(Users.TeamSerializer()).serialize(value.ownerTeam), + "parent_shared_folder_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentSharedFolderId), + "path_display": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathDisplay), + "path_lower": try NullableSerializer(Serialization._StringSerializer).serialize(value.pathLower), + "parent_folder_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.parentFolderName), + "link_metadata": try NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).serialize(value.linkMetadata), + "permissions": try NullableSerializer(ArraySerializer(Sharing.FolderPermissionSerializer())).serialize(value.permissions), + "access_inheritance": try Sharing.AccessInheritanceSerializer().serialize(value.accessInheritance), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderMetadata { - switch json { - case .dictionary(let dict): - let accessType = Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) - let isInsideTeamFolder = Serialization._BoolSerializer.deserialize(dict["is_inside_team_folder"] ?? .null) - let isTeamFolder = Serialization._BoolSerializer.deserialize(dict["is_team_folder"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let policy = Sharing.FolderPolicySerializer().deserialize(dict["policy"] ?? .null) - let previewUrl = Serialization._StringSerializer.deserialize(dict["preview_url"] ?? .null) - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let timeInvited = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["time_invited"] ?? .null) - let ownerDisplayNames = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["owner_display_names"] ?? .null) - let ownerTeam = NullableSerializer(Users.TeamSerializer()).deserialize(dict["owner_team"] ?? .null) - let parentSharedFolderId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) - let pathLower = NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) - let parentFolderName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_name"] ?? .null) - let linkMetadata = NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).deserialize(dict["link_metadata"] ?? .null) - let permissions = NullableSerializer(ArraySerializer(Sharing.FolderPermissionSerializer())).deserialize(dict["permissions"] ?? .null) - let accessInheritance = Sharing.AccessInheritanceSerializer().deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) - return SharedFolderMetadata(accessType: accessType, isInsideTeamFolder: isInsideTeamFolder, isTeamFolder: isTeamFolder, name: name, policy: policy, previewUrl: previewUrl, sharedFolderId: sharedFolderId, timeInvited: timeInvited, ownerDisplayNames: ownerDisplayNames, ownerTeam: ownerTeam, parentSharedFolderId: parentSharedFolderId, pathLower: pathLower, parentFolderName: parentFolderName, linkMetadata: linkMetadata, permissions: permissions, accessInheritance: accessInheritance) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SharedFolderMetadata { + switch json { + case .dictionary(let dict): + let accessType = try Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) + let isInsideTeamFolder = try Serialization._BoolSerializer.deserialize(dict["is_inside_team_folder"] ?? .null) + let isTeamFolder = try Serialization._BoolSerializer.deserialize(dict["is_team_folder"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let policy = try Sharing.FolderPolicySerializer().deserialize(dict["policy"] ?? .null) + let previewUrl = try Serialization._StringSerializer.deserialize(dict["preview_url"] ?? .null) + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let timeInvited = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["time_invited"] ?? .null) + let ownerDisplayNames = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)) + .deserialize(dict["owner_display_names"] ?? .null) + let ownerTeam = try NullableSerializer(Users.TeamSerializer()).deserialize(dict["owner_team"] ?? .null) + let parentSharedFolderId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_shared_folder_id"] ?? .null) + let pathDisplay = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_display"] ?? .null) + let pathLower = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["path_lower"] ?? .null) + let parentFolderName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["parent_folder_name"] ?? .null) + let linkMetadata = try NullableSerializer(Sharing.SharedContentLinkMetadataSerializer()).deserialize(dict["link_metadata"] ?? .null) + let permissions = try NullableSerializer(ArraySerializer(Sharing.FolderPermissionSerializer())).deserialize(dict["permissions"] ?? .null) + let accessInheritance = try Sharing.AccessInheritanceSerializer() + .deserialize(dict["access_inheritance"] ?? Sharing.AccessInheritanceSerializer().serialize(.inherit)) + return SharedFolderMetadata( + accessType: accessType, + isInsideTeamFolder: isInsideTeamFolder, + isTeamFolder: isTeamFolder, + name: name, + policy: policy, + previewUrl: previewUrl, + sharedFolderId: sharedFolderId, + timeInvited: timeInvited, + ownerDisplayNames: ownerDisplayNames, + ownerTeam: ownerTeam, + parentSharedFolderId: parentSharedFolderId, + pathDisplay: pathDisplay, + pathLower: pathLower, + parentFolderName: parentFolderName, + linkMetadata: linkMetadata, + permissions: permissions, + accessInheritance: accessInheritance + ) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMetadata.self, json: json) } } } /// The SharedLinkAccessFailureReason union - public enum SharedLinkAccessFailureReason: CustomStringConvertible { + public enum SharedLinkAccessFailureReason: CustomStringConvertible, JSONRepresentable { /// User is not logged in. case loginRequired /// This user's email address is not verified. This functionality is only available on accounts with a verified @@ -7553,112 +9345,132 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SharedLinkAccessFailureReasonSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkAccessFailureReasonSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkAccessFailureReasonSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkAccessFailureReason: \(error)" + } } } - open class SharedLinkAccessFailureReasonSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkAccessFailureReason) -> JSON { + + public class SharedLinkAccessFailureReasonSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkAccessFailureReason) throws -> JSON { switch value { - case .loginRequired: - var d = [String: JSON]() - d[".tag"] = .str("login_required") - return .dictionary(d) - case .emailVerifyRequired: - var d = [String: JSON]() - d[".tag"] = .str("email_verify_required") - return .dictionary(d) - case .passwordRequired: - var d = [String: JSON]() - d[".tag"] = .str("password_required") - return .dictionary(d) - case .teamOnly: - var d = [String: JSON]() - d[".tag"] = .str("team_only") - return .dictionary(d) - case .ownerOnly: - var d = [String: JSON]() - d[".tag"] = .str("owner_only") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkAccessFailureReason { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "login_required": - return SharedLinkAccessFailureReason.loginRequired - case "email_verify_required": - return SharedLinkAccessFailureReason.emailVerifyRequired - case "password_required": - return SharedLinkAccessFailureReason.passwordRequired - case "team_only": - return SharedLinkAccessFailureReason.teamOnly - case "owner_only": - return SharedLinkAccessFailureReason.ownerOnly - case "other": - return SharedLinkAccessFailureReason.other - default: - return SharedLinkAccessFailureReason.other - } - default: - fatalError("Failed to deserialize") + case .loginRequired: + var d = [String: JSON]() + d[".tag"] = .str("login_required") + return .dictionary(d) + case .emailVerifyRequired: + var d = [String: JSON]() + d[".tag"] = .str("email_verify_required") + return .dictionary(d) + case .passwordRequired: + var d = [String: JSON]() + d[".tag"] = .str("password_required") + return .dictionary(d) + case .teamOnly: + var d = [String: JSON]() + d[".tag"] = .str("team_only") + return .dictionary(d) + case .ownerOnly: + var d = [String: JSON]() + d[".tag"] = .str("owner_only") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkAccessFailureReason { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "login_required": + return SharedLinkAccessFailureReason.loginRequired + case "email_verify_required": + return SharedLinkAccessFailureReason.emailVerifyRequired + case "password_required": + return SharedLinkAccessFailureReason.passwordRequired + case "team_only": + return SharedLinkAccessFailureReason.teamOnly + case "owner_only": + return SharedLinkAccessFailureReason.ownerOnly + case "other": + return SharedLinkAccessFailureReason.other + default: + return SharedLinkAccessFailureReason.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkAccessFailureReason.self, json: json) } } } /// The SharedLinkAlreadyExistsMetadata union - public enum SharedLinkAlreadyExistsMetadata: CustomStringConvertible { + public enum SharedLinkAlreadyExistsMetadata: CustomStringConvertible, JSONRepresentable { /// Metadata of the shared link that already exists. case metadata(Sharing.SharedLinkMetadata) /// An unspecified error. case other + func json() throws -> JSON { + try SharedLinkAlreadyExistsMetadataSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkAlreadyExistsMetadataSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkAlreadyExistsMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkAlreadyExistsMetadata: \(error)" + } } } - open class SharedLinkAlreadyExistsMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkAlreadyExistsMetadata) -> JSON { + + public class SharedLinkAlreadyExistsMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkAlreadyExistsMetadata) throws -> JSON { switch value { - case .metadata(let arg): - var d = ["metadata": Sharing.SharedLinkMetadataSerializer().serialize(arg)] - d[".tag"] = .str("metadata") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkAlreadyExistsMetadata { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "metadata": - let v = Sharing.SharedLinkMetadataSerializer().deserialize(d["metadata"] ?? .null) - return SharedLinkAlreadyExistsMetadata.metadata(v) - case "other": - return SharedLinkAlreadyExistsMetadata.other - default: - return SharedLinkAlreadyExistsMetadata.other - } + case .metadata(let arg): + var d = try ["metadata": Sharing.SharedLinkMetadataSerializer().serialize(arg)] + d[".tag"] = .str("metadata") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkAlreadyExistsMetadata { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "metadata": + let v = try Sharing.SharedLinkMetadataSerializer().deserialize(d["metadata"] ?? .null) + return SharedLinkAlreadyExistsMetadata.metadata(v) + case "other": + return SharedLinkAlreadyExistsMetadata.other default: - fatalError("Failed to deserialize") + return SharedLinkAlreadyExistsMetadata.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkAlreadyExistsMetadata.self, json: json) } } } /// Who can view shared links in this folder. - public enum SharedLinkPolicy: CustomStringConvertible { + public enum SharedLinkPolicy: CustomStringConvertible, JSONRepresentable { /// Links can be shared with anyone. case anyone /// Links can be shared with anyone on the same team as the owner. @@ -7668,56 +9480,66 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SharedLinkPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkPolicy: \(error)" + } } } - open class SharedLinkPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkPolicy) -> JSON { + + public class SharedLinkPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkPolicy) throws -> JSON { switch value { - case .anyone: - var d = [String: JSON]() - d[".tag"] = .str("anyone") - return .dictionary(d) - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .members: - var d = [String: JSON]() - d[".tag"] = .str("members") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "anyone": - return SharedLinkPolicy.anyone - case "team": - return SharedLinkPolicy.team - case "members": - return SharedLinkPolicy.members - case "other": - return SharedLinkPolicy.other - default: - return SharedLinkPolicy.other - } - default: - fatalError("Failed to deserialize") + case .anyone: + var d = [String: JSON]() + d[".tag"] = .str("anyone") + return .dictionary(d) + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .members: + var d = [String: JSON]() + d[".tag"] = .str("members") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "anyone": + return SharedLinkPolicy.anyone + case "team": + return SharedLinkPolicy.team + case "members": + return SharedLinkPolicy.members + case "other": + return SharedLinkPolicy.other + default: + return SharedLinkPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkPolicy.self, json: json) } } } /// The SharedLinkSettings struct - open class SharedLinkSettings: CustomStringConvertible { + public class SharedLinkSettings: CustomStringConvertible, JSONRepresentable { /// Boolean flag to enable or disable password protection. public let requirePassword: Bool? /// If requirePassword is true, this is needed to specify the password to access the link. @@ -7725,9 +9547,9 @@ open class Sharing { /// Expiration time of the shared link. By default the link won't expire. public let expires: Date? /// The new audience who can benefit from the access level specified by the link's access level specified in the - /// `link_access_level` field of `LinkPermissions`. This is used in conjunction with team policies and shared - /// folder policies to determine the final effective audience type in the `effective_audience` field of - /// `LinkPermissions. + /// `link_access_level` field of `LinkPermissions`. This is used in conjunction with team policies and + /// shared folder policies to determine the final effective audience type in the `effective_audience` + /// field of `LinkPermissions. public let audience: Sharing.LinkAudience? /// Requested access level you want the audience to gain from this link. Note, modifying access level for an /// existing link is not supported. @@ -7736,7 +9558,15 @@ open class Sharing { public let requestedVisibility: Sharing.RequestedVisibility? /// Boolean flag to allow or not download capabilities for shared links. public let allowDownload: Bool? - public init(requirePassword: Bool? = nil, linkPassword: String? = nil, expires: Date? = nil, audience: Sharing.LinkAudience? = nil, access: Sharing.RequestedLinkAccessLevel? = nil, requestedVisibility: Sharing.RequestedVisibility? = nil, allowDownload: Bool? = nil) { + public init( + requirePassword: Bool? = nil, + linkPassword: String? = nil, + expires: Date? = nil, + audience: Sharing.LinkAudience? = nil, + access: Sharing.RequestedLinkAccessLevel? = nil, + requestedVisibility: Sharing.RequestedVisibility? = nil, + allowDownload: Bool? = nil + ) { self.requirePassword = requirePassword nullableValidator(stringValidator())(linkPassword) self.linkPassword = linkPassword @@ -7746,90 +9576,119 @@ open class Sharing { self.requestedVisibility = requestedVisibility self.allowDownload = allowDownload } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsSerializer().serialize(self)))" - } - } - open class SharedLinkSettingsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettings) -> JSON { - let output = [ - "require_password": NullableSerializer(Serialization._BoolSerializer).serialize(value.requirePassword), - "link_password": NullableSerializer(Serialization._StringSerializer).serialize(value.linkPassword), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), - "audience": NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.audience), - "access": NullableSerializer(Sharing.RequestedLinkAccessLevelSerializer()).serialize(value.access), - "requested_visibility": NullableSerializer(Sharing.RequestedVisibilitySerializer()).serialize(value.requestedVisibility), - "allow_download": NullableSerializer(Serialization._BoolSerializer).serialize(value.allowDownload), + + func json() throws -> JSON { + try SharedLinkSettingsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettings: \(error)" + } + } + } + + public class SharedLinkSettingsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettings) throws -> JSON { + let output = [ + "require_password": try NullableSerializer(Serialization._BoolSerializer).serialize(value.requirePassword), + "link_password": try NullableSerializer(Serialization._StringSerializer).serialize(value.linkPassword), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + "audience": try NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.audience), + "access": try NullableSerializer(Sharing.RequestedLinkAccessLevelSerializer()).serialize(value.access), + "requested_visibility": try NullableSerializer(Sharing.RequestedVisibilitySerializer()).serialize(value.requestedVisibility), + "allow_download": try NullableSerializer(Serialization._BoolSerializer).serialize(value.allowDownload), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettings { - switch json { - case .dictionary(let dict): - let requirePassword = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["require_password"] ?? .null) - let linkPassword = NullableSerializer(Serialization._StringSerializer).deserialize(dict["link_password"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - let audience = NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience"] ?? .null) - let access = NullableSerializer(Sharing.RequestedLinkAccessLevelSerializer()).deserialize(dict["access"] ?? .null) - let requestedVisibility = NullableSerializer(Sharing.RequestedVisibilitySerializer()).deserialize(dict["requested_visibility"] ?? .null) - let allowDownload = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["allow_download"] ?? .null) - return SharedLinkSettings(requirePassword: requirePassword, linkPassword: linkPassword, expires: expires, audience: audience, access: access, requestedVisibility: requestedVisibility, allowDownload: allowDownload) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> SharedLinkSettings { + switch json { + case .dictionary(let dict): + let requirePassword = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["require_password"] ?? .null) + let linkPassword = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["link_password"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + let audience = try NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["audience"] ?? .null) + let access = try NullableSerializer(Sharing.RequestedLinkAccessLevelSerializer()).deserialize(dict["access"] ?? .null) + let requestedVisibility = try NullableSerializer(Sharing.RequestedVisibilitySerializer()).deserialize(dict["requested_visibility"] ?? .null) + let allowDownload = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["allow_download"] ?? .null) + return SharedLinkSettings( + requirePassword: requirePassword, + linkPassword: linkPassword, + expires: expires, + audience: audience, + access: access, + requestedVisibility: requestedVisibility, + allowDownload: allowDownload + ) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettings.self, json: json) } } } /// The SharedLinkSettingsError union - public enum SharedLinkSettingsError: CustomStringConvertible { + public enum SharedLinkSettingsError: CustomStringConvertible, JSONRepresentable { /// The given settings are invalid (for example, all attributes of the SharedLinkSettings are empty, the - /// requested visibility is password in RequestedVisibility but the linkPassword in SharedLinkSettings is - /// missing, expires in SharedLinkSettings is set to the past, etc.). + /// requested visibility is password in RequestedVisibility but the linkPassword in SharedLinkSettings + /// is missing, expires in SharedLinkSettings is set to the past, etc.). case invalidSettings /// User is not allowed to modify the settings of this link. Note that basic users can only set public_ in /// RequestedVisibility as the requestedVisibility in SharedLinkSettings and cannot set expires in /// SharedLinkSettings. case notAuthorized + func json() throws -> JSON { + try SharedLinkSettingsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsError: \(error)" + } } } - open class SharedLinkSettingsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsError) -> JSON { + + public class SharedLinkSettingsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsError) throws -> JSON { switch value { - case .invalidSettings: - var d = [String: JSON]() - d[".tag"] = .str("invalid_settings") - return .dictionary(d) - case .notAuthorized: - var d = [String: JSON]() - d[".tag"] = .str("not_authorized") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkSettingsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_settings": - return SharedLinkSettingsError.invalidSettings - case "not_authorized": - return SharedLinkSettingsError.notAuthorized - default: - fatalError("Unknown tag \(tag)") - } + case .invalidSettings: + var d = [String: JSON]() + d[".tag"] = .str("invalid_settings") + return .dictionary(d) + case .notAuthorized: + var d = [String: JSON]() + d[".tag"] = .str("not_authorized") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_settings": + return SharedLinkSettingsError.invalidSettings + case "not_authorized": + return SharedLinkSettingsError.notAuthorized default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SharedLinkSettingsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsError.self, json: json) } } } /// User could not access this file. - public enum SharingFileAccessError: CustomStringConvertible { + public enum SharingFileAccessError: CustomStringConvertible, JSONRepresentable { /// Current user does not have sufficient privileges to perform the desired action. case noPermission /// File specified was not found. @@ -7843,112 +9702,132 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try SharingFileAccessErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingFileAccessErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingFileAccessErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingFileAccessError: \(error)" + } } } - open class SharingFileAccessErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingFileAccessError) -> JSON { + + public class SharingFileAccessErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingFileAccessError) throws -> JSON { switch value { - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .invalidFile: - var d = [String: JSON]() - d[".tag"] = .str("invalid_file") - return .dictionary(d) - case .isFolder: - var d = [String: JSON]() - d[".tag"] = .str("is_folder") - return .dictionary(d) - case .insidePublicFolder: - var d = [String: JSON]() - d[".tag"] = .str("inside_public_folder") - return .dictionary(d) - case .insideOsxPackage: - var d = [String: JSON]() - d[".tag"] = .str("inside_osx_package") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingFileAccessError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "no_permission": - return SharingFileAccessError.noPermission - case "invalid_file": - return SharingFileAccessError.invalidFile - case "is_folder": - return SharingFileAccessError.isFolder - case "inside_public_folder": - return SharingFileAccessError.insidePublicFolder - case "inside_osx_package": - return SharingFileAccessError.insideOsxPackage - case "other": - return SharingFileAccessError.other - default: - return SharingFileAccessError.other - } - default: - fatalError("Failed to deserialize") + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .invalidFile: + var d = [String: JSON]() + d[".tag"] = .str("invalid_file") + return .dictionary(d) + case .isFolder: + var d = [String: JSON]() + d[".tag"] = .str("is_folder") + return .dictionary(d) + case .insidePublicFolder: + var d = [String: JSON]() + d[".tag"] = .str("inside_public_folder") + return .dictionary(d) + case .insideOsxPackage: + var d = [String: JSON]() + d[".tag"] = .str("inside_osx_package") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingFileAccessError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "no_permission": + return SharingFileAccessError.noPermission + case "invalid_file": + return SharingFileAccessError.invalidFile + case "is_folder": + return SharingFileAccessError.isFolder + case "inside_public_folder": + return SharingFileAccessError.insidePublicFolder + case "inside_osx_package": + return SharingFileAccessError.insideOsxPackage + case "other": + return SharingFileAccessError.other + default: + return SharingFileAccessError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingFileAccessError.self, json: json) } } } /// User account had a problem preventing this action. - public enum SharingUserError: CustomStringConvertible { + public enum SharingUserError: CustomStringConvertible, JSONRepresentable { /// This user's email address is not verified. This functionality is only available on accounts with a verified /// email address. Users can verify their email address here https://www.dropbox.com/help/317. case emailUnverified /// An unspecified error. case other + func json() throws -> JSON { + try SharingUserErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingUserErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingUserErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingUserError: \(error)" + } } } - open class SharingUserErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingUserError) -> JSON { + + public class SharingUserErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingUserError) throws -> JSON { switch value { - case .emailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("email_unverified") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingUserError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "email_unverified": - return SharingUserError.emailUnverified - case "other": - return SharingUserError.other - default: - return SharingUserError.other - } + case .emailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("email_unverified") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingUserError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "email_unverified": + return SharingUserError.emailUnverified + case "other": + return SharingUserError.other default: - fatalError("Failed to deserialize") + return SharingUserError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingUserError.self, json: json) } } } /// Information about a team member. - open class TeamMemberInfo: CustomStringConvertible { + public class TeamMemberInfo: CustomStringConvertible, JSONRepresentable { /// Information about the member's team. public let teamInfo: Users.Team /// The display name of the user. @@ -7963,35 +9842,46 @@ open class Sharing { nullableValidator(stringValidator())(memberId) self.memberId = memberId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMemberInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberInfo: \(error)" + } } } - open class TeamMemberInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberInfo) -> JSON { - let output = [ - "team_info": Users.TeamSerializer().serialize(value.teamInfo), - "display_name": Serialization._StringSerializer.serialize(value.displayName), - "member_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberId), + + public class TeamMemberInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberInfo) throws -> JSON { + let output = [ + "team_info": try Users.TeamSerializer().serialize(value.teamInfo), + "display_name": try Serialization._StringSerializer.serialize(value.displayName), + "member_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMemberInfo { + + public func deserialize(_ json: JSON) throws -> TeamMemberInfo { switch json { - case .dictionary(let dict): - let teamInfo = Users.TeamSerializer().deserialize(dict["team_info"] ?? .null) - let displayName = Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) - let memberId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_id"] ?? .null) - return TeamMemberInfo(teamInfo: teamInfo, displayName: displayName, memberId: memberId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamInfo = try Users.TeamSerializer().deserialize(dict["team_info"] ?? .null) + let displayName = try Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) + let memberId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_id"] ?? .null) + return TeamMemberInfo(teamInfo: teamInfo, displayName: displayName, memberId: memberId) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberInfo.self, json: json) } } } /// The TransferFolderArg struct - open class TransferFolderArg: CustomStringConvertible { + public class TransferFolderArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// A account or team member ID to transfer ownership to. @@ -8002,33 +9892,44 @@ open class Sharing { stringValidator(minLength: 1)(toDropboxId) self.toDropboxId = toDropboxId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TransferFolderArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TransferFolderArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TransferFolderArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TransferFolderArg: \(error)" + } } } - open class TransferFolderArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TransferFolderArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "to_dropbox_id": Serialization._StringSerializer.serialize(value.toDropboxId), + + public class TransferFolderArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TransferFolderArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "to_dropbox_id": try Serialization._StringSerializer.serialize(value.toDropboxId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TransferFolderArg { + + public func deserialize(_ json: JSON) throws -> TransferFolderArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let toDropboxId = Serialization._StringSerializer.deserialize(dict["to_dropbox_id"] ?? .null) - return TransferFolderArg(sharedFolderId: sharedFolderId, toDropboxId: toDropboxId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let toDropboxId = try Serialization._StringSerializer.deserialize(dict["to_dropbox_id"] ?? .null) + return TransferFolderArg(sharedFolderId: sharedFolderId, toDropboxId: toDropboxId) + default: + throw JSONSerializerError.deserializeError(type: TransferFolderArg.self, json: json) } } } /// The TransferFolderError union - public enum TransferFolderError: CustomStringConvertible { + public enum TransferFolderError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// toDropboxId in TransferFolderArg is invalid. @@ -8038,7 +9939,8 @@ open class Sharing { /// The new designated owner has not added the folder to their Dropbox. case newOwnerUnmounted /// The new designated owner's email address is not verified. This functionality is only available on accounts - /// with a verified email address. Users can verify their email address here https://www.dropbox.com/help/317. + /// with a verified email address. Users can verify their email address here + /// https://www.dropbox.com/help/317. case newOwnerEmailUnverified /// This action cannot be performed on a team shared folder. case teamFolder @@ -8047,112 +9949,133 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try TransferFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TransferFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TransferFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TransferFolderError: \(error)" + } } } - open class TransferFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TransferFolderError) -> JSON { + + public class TransferFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TransferFolderError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .invalidDropboxId: - var d = [String: JSON]() - d[".tag"] = .str("invalid_dropbox_id") - return .dictionary(d) - case .newOwnerNotAMember: - var d = [String: JSON]() - d[".tag"] = .str("new_owner_not_a_member") - return .dictionary(d) - case .newOwnerUnmounted: - var d = [String: JSON]() - d[".tag"] = .str("new_owner_unmounted") - return .dictionary(d) - case .newOwnerEmailUnverified: - var d = [String: JSON]() - d[".tag"] = .str("new_owner_email_unverified") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TransferFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return TransferFolderError.accessError(v) - case "invalid_dropbox_id": - return TransferFolderError.invalidDropboxId - case "new_owner_not_a_member": - return TransferFolderError.newOwnerNotAMember - case "new_owner_unmounted": - return TransferFolderError.newOwnerUnmounted - case "new_owner_email_unverified": - return TransferFolderError.newOwnerEmailUnverified - case "team_folder": - return TransferFolderError.teamFolder - case "no_permission": - return TransferFolderError.noPermission - case "other": - return TransferFolderError.other - default: - return TransferFolderError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .invalidDropboxId: + var d = [String: JSON]() + d[".tag"] = .str("invalid_dropbox_id") + return .dictionary(d) + case .newOwnerNotAMember: + var d = [String: JSON]() + d[".tag"] = .str("new_owner_not_a_member") + return .dictionary(d) + case .newOwnerUnmounted: + var d = [String: JSON]() + d[".tag"] = .str("new_owner_unmounted") + return .dictionary(d) + case .newOwnerEmailUnverified: + var d = [String: JSON]() + d[".tag"] = .str("new_owner_email_unverified") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TransferFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return TransferFolderError.accessError(v) + case "invalid_dropbox_id": + return TransferFolderError.invalidDropboxId + case "new_owner_not_a_member": + return TransferFolderError.newOwnerNotAMember + case "new_owner_unmounted": + return TransferFolderError.newOwnerUnmounted + case "new_owner_email_unverified": + return TransferFolderError.newOwnerEmailUnverified + case "team_folder": + return TransferFolderError.teamFolder + case "no_permission": + return TransferFolderError.noPermission + case "other": + return TransferFolderError.other + default: + return TransferFolderError.other + } + default: + throw JSONSerializerError.deserializeError(type: TransferFolderError.self, json: json) } } } /// The UnmountFolderArg struct - open class UnmountFolderArg: CustomStringConvertible { + public class UnmountFolderArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String public init(sharedFolderId: String) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnmountFolderArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UnmountFolderArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnmountFolderArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnmountFolderArg: \(error)" + } } } - open class UnmountFolderArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnmountFolderArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), + + public class UnmountFolderArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnmountFolderArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UnmountFolderArg { + + public func deserialize(_ json: JSON) throws -> UnmountFolderArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - return UnmountFolderArg(sharedFolderId: sharedFolderId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + return UnmountFolderArg(sharedFolderId: sharedFolderId) + default: + throw JSONSerializerError.deserializeError(type: UnmountFolderArg.self, json: json) } } } /// The UnmountFolderError union - public enum UnmountFolderError: CustomStringConvertible { + public enum UnmountFolderError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// The current user does not have permission to perform this action. @@ -8163,88 +10086,109 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try UnmountFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnmountFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnmountFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnmountFolderError: \(error)" + } } } - open class UnmountFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnmountFolderError) -> JSON { + + public class UnmountFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnmountFolderError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .notUnmountable: - var d = [String: JSON]() - d[".tag"] = .str("not_unmountable") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UnmountFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return UnmountFolderError.accessError(v) - case "no_permission": - return UnmountFolderError.noPermission - case "not_unmountable": - return UnmountFolderError.notUnmountable - case "other": - return UnmountFolderError.other - default: - return UnmountFolderError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .notUnmountable: + var d = [String: JSON]() + d[".tag"] = .str("not_unmountable") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UnmountFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return UnmountFolderError.accessError(v) + case "no_permission": + return UnmountFolderError.noPermission + case "not_unmountable": + return UnmountFolderError.notUnmountable + case "other": + return UnmountFolderError.other + default: + return UnmountFolderError.other + } + default: + throw JSONSerializerError.deserializeError(type: UnmountFolderError.self, json: json) } } } /// Arguments for unshareFile. - open class UnshareFileArg: CustomStringConvertible { + public class UnshareFileArg: CustomStringConvertible, JSONRepresentable { /// The file to unshare. public let file: String public init(file: String) { stringValidator(minLength: 1, pattern: "((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?")(file) self.file = file } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnshareFileArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UnshareFileArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnshareFileArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnshareFileArg: \(error)" + } } } - open class UnshareFileArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnshareFileArg) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), + + public class UnshareFileArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnshareFileArg) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UnshareFileArg { + + public func deserialize(_ json: JSON) throws -> UnshareFileArg { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - return UnshareFileArg(file: file) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + return UnshareFileArg(file: file) + default: + throw JSONSerializerError.deserializeError(type: UnshareFileArg.self, json: json) } } } /// Error result for unshareFile. - public enum UnshareFileError: CustomStringConvertible { + public enum UnshareFileError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case userError(Sharing.SharingUserError) /// An unspecified error. @@ -8252,89 +10196,111 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try UnshareFileErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnshareFileErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnshareFileErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnshareFileError: \(error)" + } } } - open class UnshareFileErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnshareFileError) -> JSON { + + public class UnshareFileErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnshareFileError) throws -> JSON { switch value { - case .userError(let arg): - var d = ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] - d[".tag"] = .str("user_error") - return .dictionary(d) - case .accessError(let arg): - var d = ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UnshareFileError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_error": - let v = Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) - return UnshareFileError.userError(v) - case "access_error": - let v = Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return UnshareFileError.accessError(v) - case "other": - return UnshareFileError.other - default: - return UnshareFileError.other - } + case .userError(let arg): + var d = try ["user_error": Sharing.SharingUserErrorSerializer().serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .accessError(let arg): + var d = try ["access_error": Sharing.SharingFileAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UnshareFileError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_error": + let v = try Sharing.SharingUserErrorSerializer().deserialize(d["user_error"] ?? .null) + return UnshareFileError.userError(v) + case "access_error": + let v = try Sharing.SharingFileAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return UnshareFileError.accessError(v) + case "other": + return UnshareFileError.other default: - fatalError("Failed to deserialize") + return UnshareFileError.other + } + default: + throw JSONSerializerError.deserializeError(type: UnshareFileError.self, json: json) } } } /// The UnshareFolderArg struct - open class UnshareFolderArg: CustomStringConvertible { + public class UnshareFolderArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// If true, members of this shared folder will get a copy of this folder after it's unshared. Otherwise, it - /// will be removed from their Dropbox. The current user, who is an owner, will always retain their copy. + /// will be removed from their Dropbox. The current user, who is an owner, will always retain their + /// copy. public let leaveACopy: Bool public init(sharedFolderId: String, leaveACopy: Bool = false) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId self.leaveACopy = leaveACopy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnshareFolderArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UnshareFolderArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnshareFolderArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnshareFolderArg: \(error)" + } } } - open class UnshareFolderArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnshareFolderArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "leave_a_copy": Serialization._BoolSerializer.serialize(value.leaveACopy), + + public class UnshareFolderArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnshareFolderArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "leave_a_copy": try Serialization._BoolSerializer.serialize(value.leaveACopy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UnshareFolderArg { + + public func deserialize(_ json: JSON) throws -> UnshareFolderArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let leaveACopy = Serialization._BoolSerializer.deserialize(dict["leave_a_copy"] ?? .number(0)) - return UnshareFolderArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let leaveACopy = try Serialization._BoolSerializer.deserialize(dict["leave_a_copy"] ?? .number(0)) + return UnshareFolderArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy) + default: + throw JSONSerializerError.deserializeError(type: UnshareFolderArg.self, json: json) } } } /// The UnshareFolderError union - public enum UnshareFolderError: CustomStringConvertible { + public enum UnshareFolderError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// This action cannot be performed on a team shared folder. @@ -8346,63 +10312,73 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try UnshareFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UnshareFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UnshareFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UnshareFolderError: \(error)" + } } } - open class UnshareFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UnshareFolderError) -> JSON { + + public class UnshareFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UnshareFolderError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .tooManyFiles: - var d = [String: JSON]() - d[".tag"] = .str("too_many_files") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UnshareFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return UnshareFolderError.accessError(v) - case "team_folder": - return UnshareFolderError.teamFolder - case "no_permission": - return UnshareFolderError.noPermission - case "too_many_files": - return UnshareFolderError.tooManyFiles - case "other": - return UnshareFolderError.other - default: - return UnshareFolderError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .tooManyFiles: + var d = [String: JSON]() + d[".tag"] = .str("too_many_files") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UnshareFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return UnshareFolderError.accessError(v) + case "team_folder": + return UnshareFolderError.teamFolder + case "no_permission": + return UnshareFolderError.noPermission + case "too_many_files": + return UnshareFolderError.tooManyFiles + case "other": + return UnshareFolderError.other + default: + return UnshareFolderError.other + } + default: + throw JSONSerializerError.deserializeError(type: UnshareFolderError.self, json: json) } } } /// Arguments for updateFileMember. - open class UpdateFileMemberArgs: CustomStringConvertible { + public class UpdateFileMemberArgs: CustomStringConvertible, JSONRepresentable { /// File for which we are changing a member's access. public let file: String /// The member whose access we are changing. @@ -8415,35 +10391,46 @@ open class Sharing { self.member = member self.accessLevel = accessLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFileMemberArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try UpdateFileMemberArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFileMemberArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFileMemberArgs: \(error)" + } } } - open class UpdateFileMemberArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFileMemberArgs) -> JSON { - let output = [ - "file": Serialization._StringSerializer.serialize(value.file), - "member": Sharing.MemberSelectorSerializer().serialize(value.member), - "access_level": Sharing.AccessLevelSerializer().serialize(value.accessLevel), + + public class UpdateFileMemberArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFileMemberArgs) throws -> JSON { + let output = [ + "file": try Serialization._StringSerializer.serialize(value.file), + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), + "access_level": try Sharing.AccessLevelSerializer().serialize(value.accessLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UpdateFileMemberArgs { + + public func deserialize(_ json: JSON) throws -> UpdateFileMemberArgs { switch json { - case .dictionary(let dict): - let file = Serialization._StringSerializer.deserialize(dict["file"] ?? .null) - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - let accessLevel = Sharing.AccessLevelSerializer().deserialize(dict["access_level"] ?? .null) - return UpdateFileMemberArgs(file: file, member: member, accessLevel: accessLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let file = try Serialization._StringSerializer.deserialize(dict["file"] ?? .null) + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + let accessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["access_level"] ?? .null) + return UpdateFileMemberArgs(file: file, member: member, accessLevel: accessLevel) + default: + throw JSONSerializerError.deserializeError(type: UpdateFileMemberArgs.self, json: json) } } } /// The UpdateFolderMemberArg struct - open class UpdateFolderMemberArg: CustomStringConvertible { + public class UpdateFolderMemberArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// The member of the shared folder to update. Only the dropboxId in MemberSelector may be set at this time. @@ -8456,35 +10443,46 @@ open class Sharing { self.member = member self.accessLevel = accessLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFolderMemberArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UpdateFolderMemberArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFolderMemberArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFolderMemberArg: \(error)" + } } } - open class UpdateFolderMemberArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFolderMemberArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "member": Sharing.MemberSelectorSerializer().serialize(value.member), - "access_level": Sharing.AccessLevelSerializer().serialize(value.accessLevel), + + public class UpdateFolderMemberArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFolderMemberArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "member": try Sharing.MemberSelectorSerializer().serialize(value.member), + "access_level": try Sharing.AccessLevelSerializer().serialize(value.accessLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UpdateFolderMemberArg { + + public func deserialize(_ json: JSON) throws -> UpdateFolderMemberArg { switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let member = Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) - let accessLevel = Sharing.AccessLevelSerializer().deserialize(dict["access_level"] ?? .null) - return UpdateFolderMemberArg(sharedFolderId: sharedFolderId, member: member, accessLevel: accessLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let member = try Sharing.MemberSelectorSerializer().deserialize(dict["member"] ?? .null) + let accessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["access_level"] ?? .null) + return UpdateFolderMemberArg(sharedFolderId: sharedFolderId, member: member, accessLevel: accessLevel) + default: + throw JSONSerializerError.deserializeError(type: UpdateFolderMemberArg.self, json: json) } } } /// The UpdateFolderMemberError union - public enum UpdateFolderMemberError: CustomStringConvertible { + public enum UpdateFolderMemberError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// An unspecified error. @@ -8493,78 +10491,89 @@ open class Sharing { /// adding the member. case noExplicitAccess(Sharing.AddFolderMemberError) /// The current user's account doesn't support this action. An example of this is when downgrading a member from - /// editor to viewer. This action can only be performed by users that have upgraded to a Pro or Business plan. + /// editor to viewer. This action can only be performed by users that have upgraded to a Pro or Business + /// plan. case insufficientPlan /// The current user does not have permission to perform this action. case noPermission /// An unspecified error. case other + func json() throws -> JSON { + try UpdateFolderMemberErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFolderMemberErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFolderMemberErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFolderMemberError: \(error)" + } } } - open class UpdateFolderMemberErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFolderMemberError) -> JSON { + + public class UpdateFolderMemberErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFolderMemberError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .memberError(let arg): - var d = ["member_error": Sharing.SharedFolderMemberErrorSerializer().serialize(arg)] - d[".tag"] = .str("member_error") - return .dictionary(d) - case .noExplicitAccess(let arg): - var d = ["no_explicit_access": Sharing.AddFolderMemberErrorSerializer().serialize(arg)] - d[".tag"] = .str("no_explicit_access") - return .dictionary(d) - case .insufficientPlan: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_plan") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UpdateFolderMemberError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return UpdateFolderMemberError.accessError(v) - case "member_error": - let v = Sharing.SharedFolderMemberErrorSerializer().deserialize(d["member_error"] ?? .null) - return UpdateFolderMemberError.memberError(v) - case "no_explicit_access": - let v = Sharing.AddFolderMemberErrorSerializer().deserialize(d["no_explicit_access"] ?? .null) - return UpdateFolderMemberError.noExplicitAccess(v) - case "insufficient_plan": - return UpdateFolderMemberError.insufficientPlan - case "no_permission": - return UpdateFolderMemberError.noPermission - case "other": - return UpdateFolderMemberError.other - default: - return UpdateFolderMemberError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .memberError(let arg): + var d = try ["member_error": Sharing.SharedFolderMemberErrorSerializer().serialize(arg)] + d[".tag"] = .str("member_error") + return .dictionary(d) + case .noExplicitAccess(let arg): + var d = try ["no_explicit_access": Sharing.AddFolderMemberErrorSerializer().serialize(arg)] + d[".tag"] = .str("no_explicit_access") + return .dictionary(d) + case .insufficientPlan: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_plan") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UpdateFolderMemberError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return UpdateFolderMemberError.accessError(v) + case "member_error": + let v = try Sharing.SharedFolderMemberErrorSerializer().deserialize(d["member_error"] ?? .null) + return UpdateFolderMemberError.memberError(v) + case "no_explicit_access": + let v = try Sharing.AddFolderMemberErrorSerializer().deserialize(d["no_explicit_access"] ?? .null) + return UpdateFolderMemberError.noExplicitAccess(v) + case "insufficient_plan": + return UpdateFolderMemberError.insufficientPlan + case "no_permission": + return UpdateFolderMemberError.noPermission + case "other": + return UpdateFolderMemberError.other + default: + return UpdateFolderMemberError.other + } + default: + throw JSONSerializerError.deserializeError(type: UpdateFolderMemberError.self, json: json) } } } /// If any of the policies are unset, then they retain their current setting. - open class UpdateFolderPolicyArg: CustomStringConvertible { + public class UpdateFolderPolicyArg: CustomStringConvertible, JSONRepresentable { /// The ID for the shared folder. public let sharedFolderId: String /// Who can be a member of this shared folder. Only applicable if the current user is on a team. @@ -8579,10 +10588,18 @@ open class Sharing { /// Settings on the link for this folder. public let linkSettings: Sharing.LinkSettings? /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's - /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the - /// folder. - public let actions: Array? - public init(sharedFolderId: String, memberPolicy: Sharing.MemberPolicy? = nil, aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, linkSettings: Sharing.LinkSettings? = nil, actions: Array? = nil) { + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform + /// on the folder. + public let actions: [Sharing.FolderAction]? + public init( + sharedFolderId: String, + memberPolicy: Sharing.MemberPolicy? = nil, + aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, + viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, + sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, + linkSettings: Sharing.LinkSettings? = nil, + actions: [Sharing.FolderAction]? = nil + ) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(sharedFolderId) self.sharedFolderId = sharedFolderId self.memberPolicy = memberPolicy @@ -8592,43 +10609,62 @@ open class Sharing { self.linkSettings = linkSettings self.actions = actions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFolderPolicyArgSerializer().serialize(self)))" - } - } - open class UpdateFolderPolicyArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFolderPolicyArg) -> JSON { - let output = [ - "shared_folder_id": Serialization._StringSerializer.serialize(value.sharedFolderId), - "member_policy": NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), - "acl_update_policy": NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.aclUpdatePolicy), - "viewer_info_policy": NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), - "shared_link_policy": NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.sharedLinkPolicy), - "link_settings": NullableSerializer(Sharing.LinkSettingsSerializer()).serialize(value.linkSettings), - "actions": NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), + + func json() throws -> JSON { + try UpdateFolderPolicyArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFolderPolicyArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFolderPolicyArg: \(error)" + } + } + } + + public class UpdateFolderPolicyArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFolderPolicyArg) throws -> JSON { + let output = [ + "shared_folder_id": try Serialization._StringSerializer.serialize(value.sharedFolderId), + "member_policy": try NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.memberPolicy), + "acl_update_policy": try NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.aclUpdatePolicy), + "viewer_info_policy": try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.viewerInfoPolicy), + "shared_link_policy": try NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.sharedLinkPolicy), + "link_settings": try NullableSerializer(Sharing.LinkSettingsSerializer()).serialize(value.linkSettings), + "actions": try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).serialize(value.actions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UpdateFolderPolicyArg { - switch json { - case .dictionary(let dict): - let sharedFolderId = Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) - let memberPolicy = NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) - let aclUpdatePolicy = NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["acl_update_policy"] ?? .null) - let viewerInfoPolicy = NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) - let sharedLinkPolicy = NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["shared_link_policy"] ?? .null) - let linkSettings = NullableSerializer(Sharing.LinkSettingsSerializer()).deserialize(dict["link_settings"] ?? .null) - let actions = NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) - return UpdateFolderPolicyArg(sharedFolderId: sharedFolderId, memberPolicy: memberPolicy, aclUpdatePolicy: aclUpdatePolicy, viewerInfoPolicy: viewerInfoPolicy, sharedLinkPolicy: sharedLinkPolicy, linkSettings: linkSettings, actions: actions) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> UpdateFolderPolicyArg { + switch json { + case .dictionary(let dict): + let sharedFolderId = try Serialization._StringSerializer.deserialize(dict["shared_folder_id"] ?? .null) + let memberPolicy = try NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["member_policy"] ?? .null) + let aclUpdatePolicy = try NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["acl_update_policy"] ?? .null) + let viewerInfoPolicy = try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["viewer_info_policy"] ?? .null) + let sharedLinkPolicy = try NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["shared_link_policy"] ?? .null) + let linkSettings = try NullableSerializer(Sharing.LinkSettingsSerializer()).deserialize(dict["link_settings"] ?? .null) + let actions = try NullableSerializer(ArraySerializer(Sharing.FolderActionSerializer())).deserialize(dict["actions"] ?? .null) + return UpdateFolderPolicyArg( + sharedFolderId: sharedFolderId, + memberPolicy: memberPolicy, + aclUpdatePolicy: aclUpdatePolicy, + viewerInfoPolicy: viewerInfoPolicy, + sharedLinkPolicy: sharedLinkPolicy, + linkSettings: linkSettings, + actions: actions + ) + default: + throw JSONSerializerError.deserializeError(type: UpdateFolderPolicyArg.self, json: json) } } } /// The UpdateFolderPolicyError union - public enum UpdateFolderPolicyError: CustomStringConvertible { + public enum UpdateFolderPolicyError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Sharing.SharedFolderAccessError) /// memberPolicy in UpdateFolderPolicyArg was set even though user is not on a team. @@ -8644,161 +10680,207 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try UpdateFolderPolicyErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UpdateFolderPolicyErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UpdateFolderPolicyErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UpdateFolderPolicyError: \(error)" + } } } - open class UpdateFolderPolicyErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UpdateFolderPolicyError) -> JSON { + + public class UpdateFolderPolicyErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UpdateFolderPolicyError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .notOnTeam: - var d = [String: JSON]() - d[".tag"] = .str("not_on_team") - return .dictionary(d) - case .teamPolicyDisallowsMemberPolicy: - var d = [String: JSON]() - d[".tag"] = .str("team_policy_disallows_member_policy") - return .dictionary(d) - case .disallowedSharedLinkPolicy: - var d = [String: JSON]() - d[".tag"] = .str("disallowed_shared_link_policy") - return .dictionary(d) - case .noPermission: - var d = [String: JSON]() - d[".tag"] = .str("no_permission") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UpdateFolderPolicyError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return UpdateFolderPolicyError.accessError(v) - case "not_on_team": - return UpdateFolderPolicyError.notOnTeam - case "team_policy_disallows_member_policy": - return UpdateFolderPolicyError.teamPolicyDisallowsMemberPolicy - case "disallowed_shared_link_policy": - return UpdateFolderPolicyError.disallowedSharedLinkPolicy - case "no_permission": - return UpdateFolderPolicyError.noPermission - case "team_folder": - return UpdateFolderPolicyError.teamFolder - case "other": - return UpdateFolderPolicyError.other - default: - return UpdateFolderPolicyError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Sharing.SharedFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .notOnTeam: + var d = [String: JSON]() + d[".tag"] = .str("not_on_team") + return .dictionary(d) + case .teamPolicyDisallowsMemberPolicy: + var d = [String: JSON]() + d[".tag"] = .str("team_policy_disallows_member_policy") + return .dictionary(d) + case .disallowedSharedLinkPolicy: + var d = [String: JSON]() + d[".tag"] = .str("disallowed_shared_link_policy") + return .dictionary(d) + case .noPermission: + var d = [String: JSON]() + d[".tag"] = .str("no_permission") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UpdateFolderPolicyError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Sharing.SharedFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return UpdateFolderPolicyError.accessError(v) + case "not_on_team": + return UpdateFolderPolicyError.notOnTeam + case "team_policy_disallows_member_policy": + return UpdateFolderPolicyError.teamPolicyDisallowsMemberPolicy + case "disallowed_shared_link_policy": + return UpdateFolderPolicyError.disallowedSharedLinkPolicy + case "no_permission": + return UpdateFolderPolicyError.noPermission + case "team_folder": + return UpdateFolderPolicyError.teamFolder + case "other": + return UpdateFolderPolicyError.other + default: + return UpdateFolderPolicyError.other + } + default: + throw JSONSerializerError.deserializeError(type: UpdateFolderPolicyError.self, json: json) } } } /// The information about a user member of the shared content. - open class UserMembershipInfo: Sharing.MembershipInfo { + public class UserMembershipInfo: Sharing.MembershipInfo { /// The account information for the membership user. public let user: Sharing.UserInfo - public init(accessType: Sharing.AccessLevel, user: Sharing.UserInfo, permissions: Array? = nil, initials: String? = nil, isInherited: Bool = false) { + public init( + accessType: Sharing.AccessLevel, + user: Sharing.UserInfo, + permissions: [Sharing.MemberPermission]? = nil, + initials: String? = nil, + isInherited: Bool = false + ) { self.user = user super.init(accessType: accessType, permissions: permissions, initials: initials, isInherited: isInherited) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserMembershipInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserMembershipInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserMembershipInfo: \(error)" + } } } - open class UserMembershipInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserMembershipInfo) -> JSON { - let output = [ - "access_type": Sharing.AccessLevelSerializer().serialize(value.accessType), - "user": Sharing.UserInfoSerializer().serialize(value.user), - "permissions": NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), - "initials": NullableSerializer(Serialization._StringSerializer).serialize(value.initials), - "is_inherited": Serialization._BoolSerializer.serialize(value.isInherited), + + public class UserMembershipInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserMembershipInfo) throws -> JSON { + let output = [ + "access_type": try Sharing.AccessLevelSerializer().serialize(value.accessType), + "user": try Sharing.UserInfoSerializer().serialize(value.user), + "permissions": try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), + "initials": try NullableSerializer(Serialization._StringSerializer).serialize(value.initials), + "is_inherited": try Serialization._BoolSerializer.serialize(value.isInherited), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserMembershipInfo { + + public func deserialize(_ json: JSON) throws -> UserMembershipInfo { switch json { - case .dictionary(let dict): - let accessType = Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) - let user = Sharing.UserInfoSerializer().deserialize(dict["user"] ?? .null) - let permissions = NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) - let initials = NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) - let isInherited = Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) - return UserMembershipInfo(accessType: accessType, user: user, permissions: permissions, initials: initials, isInherited: isInherited) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessType = try Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) + let user = try Sharing.UserInfoSerializer().deserialize(dict["user"] ?? .null) + let permissions = try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) + let initials = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) + let isInherited = try Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) + return UserMembershipInfo(accessType: accessType, user: user, permissions: permissions, initials: initials, isInherited: isInherited) + default: + throw JSONSerializerError.deserializeError(type: UserMembershipInfo.self, json: json) } } } /// The information about a user member of the shared content with an appended last seen timestamp. - open class UserFileMembershipInfo: Sharing.UserMembershipInfo { + public class UserFileMembershipInfo: Sharing.UserMembershipInfo { /// The UTC timestamp of when the user has last seen the content. Only populated if the user has seen the /// content and the caller has a plan that includes viewer history. public let timeLastSeen: Date? /// The platform on which the user has last seen the content, or unknown. public let platformType: SeenState.PlatformType? - public init(accessType: Sharing.AccessLevel, user: Sharing.UserInfo, permissions: Array? = nil, initials: String? = nil, isInherited: Bool = false, timeLastSeen: Date? = nil, platformType: SeenState.PlatformType? = nil) { + public init( + accessType: Sharing.AccessLevel, + user: Sharing.UserInfo, + permissions: [Sharing.MemberPermission]? = nil, + initials: String? = nil, + isInherited: Bool = false, + timeLastSeen: Date? = nil, + platformType: SeenState.PlatformType? = nil + ) { self.timeLastSeen = timeLastSeen self.platformType = platformType super.init(accessType: accessType, user: user, permissions: permissions, initials: initials, isInherited: isInherited) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserFileMembershipInfoSerializer().serialize(self)))" - } - } - open class UserFileMembershipInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserFileMembershipInfo) -> JSON { - let output = [ - "access_type": Sharing.AccessLevelSerializer().serialize(value.accessType), - "user": Sharing.UserInfoSerializer().serialize(value.user), - "permissions": NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), - "initials": NullableSerializer(Serialization._StringSerializer).serialize(value.initials), - "is_inherited": Serialization._BoolSerializer.serialize(value.isInherited), - "time_last_seen": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeLastSeen), - "platform_type": NullableSerializer(SeenState.PlatformTypeSerializer()).serialize(value.platformType), + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserFileMembershipInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserFileMembershipInfo: \(error)" + } + } + } + + public class UserFileMembershipInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserFileMembershipInfo) throws -> JSON { + let output = [ + "access_type": try Sharing.AccessLevelSerializer().serialize(value.accessType), + "user": try Sharing.UserInfoSerializer().serialize(value.user), + "permissions": try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).serialize(value.permissions), + "initials": try NullableSerializer(Serialization._StringSerializer).serialize(value.initials), + "is_inherited": try Serialization._BoolSerializer.serialize(value.isInherited), + "time_last_seen": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.timeLastSeen), + "platform_type": try NullableSerializer(SeenState.PlatformTypeSerializer()).serialize(value.platformType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserFileMembershipInfo { - switch json { - case .dictionary(let dict): - let accessType = Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) - let user = Sharing.UserInfoSerializer().deserialize(dict["user"] ?? .null) - let permissions = NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) - let initials = NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) - let isInherited = Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) - let timeLastSeen = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_last_seen"] ?? .null) - let platformType = NullableSerializer(SeenState.PlatformTypeSerializer()).deserialize(dict["platform_type"] ?? .null) - return UserFileMembershipInfo(accessType: accessType, user: user, permissions: permissions, initials: initials, isInherited: isInherited, timeLastSeen: timeLastSeen, platformType: platformType) - default: - fatalError("Type error deserializing") + + public func deserialize(_ json: JSON) throws -> UserFileMembershipInfo { + switch json { + case .dictionary(let dict): + let accessType = try Sharing.AccessLevelSerializer().deserialize(dict["access_type"] ?? .null) + let user = try Sharing.UserInfoSerializer().deserialize(dict["user"] ?? .null) + let permissions = try NullableSerializer(ArraySerializer(Sharing.MemberPermissionSerializer())).deserialize(dict["permissions"] ?? .null) + let initials = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["initials"] ?? .null) + let isInherited = try Serialization._BoolSerializer.deserialize(dict["is_inherited"] ?? .number(0)) + let timeLastSeen = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["time_last_seen"] ?? .null) + let platformType = try NullableSerializer(SeenState.PlatformTypeSerializer()).deserialize(dict["platform_type"] ?? .null) + return UserFileMembershipInfo( + accessType: accessType, + user: user, + permissions: permissions, + initials: initials, + isInherited: isInherited, + timeLastSeen: timeLastSeen, + platformType: platformType + ) + default: + throw JSONSerializerError.deserializeError(type: UserFileMembershipInfo.self, json: json) } } } /// Basic information about a user. Use usersAccount and usersAccountBatch to obtain more detailed information. - open class UserInfo: CustomStringConvertible { + public class UserInfo: CustomStringConvertible, JSONRepresentable { /// The account ID of the user. public let accountId: String /// Email address of user. @@ -8820,39 +10902,50 @@ open class Sharing { nullableValidator(stringValidator())(teamMemberId) self.teamMemberId = teamMemberId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserInfo: \(error)" + } } } - open class UserInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserInfo) -> JSON { - let output = [ - "account_id": Serialization._StringSerializer.serialize(value.accountId), - "email": Serialization._StringSerializer.serialize(value.email), - "display_name": Serialization._StringSerializer.serialize(value.displayName), - "same_team": Serialization._BoolSerializer.serialize(value.sameTeam), - "team_member_id": NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), + + public class UserInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserInfo) throws -> JSON { + let output = [ + "account_id": try Serialization._StringSerializer.serialize(value.accountId), + "email": try Serialization._StringSerializer.serialize(value.email), + "display_name": try Serialization._StringSerializer.serialize(value.displayName), + "same_team": try Serialization._BoolSerializer.serialize(value.sameTeam), + "team_member_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserInfo { + + public func deserialize(_ json: JSON) throws -> UserInfo { switch json { - case .dictionary(let dict): - let accountId = Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) - let email = Serialization._StringSerializer.deserialize(dict["email"] ?? .null) - let displayName = Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) - let sameTeam = Serialization._BoolSerializer.deserialize(dict["same_team"] ?? .null) - let teamMemberId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) - return UserInfo(accountId: accountId, email: email, displayName: displayName, sameTeam: sameTeam, teamMemberId: teamMemberId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountId = try Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) + let email = try Serialization._StringSerializer.deserialize(dict["email"] ?? .null) + let displayName = try Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) + let sameTeam = try Serialization._BoolSerializer.deserialize(dict["same_team"] ?? .null) + let teamMemberId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) + return UserInfo(accountId: accountId, email: email, displayName: displayName, sameTeam: sameTeam, teamMemberId: teamMemberId) + default: + throw JSONSerializerError.deserializeError(type: UserInfo.self, json: json) } } } /// The ViewerInfoPolicy union - public enum ViewerInfoPolicy: CustomStringConvertible { + public enum ViewerInfoPolicy: CustomStringConvertible, JSONRepresentable { /// Viewer information is available on this file. case enabled /// Viewer information is disabled on this file. @@ -8860,51 +10953,61 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try ViewerInfoPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ViewerInfoPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ViewerInfoPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ViewerInfoPolicy: \(error)" + } } } - open class ViewerInfoPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ViewerInfoPolicy) -> JSON { + + public class ViewerInfoPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ViewerInfoPolicy) throws -> JSON { switch value { - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ViewerInfoPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "enabled": - return ViewerInfoPolicy.enabled - case "disabled": - return ViewerInfoPolicy.disabled - case "other": - return ViewerInfoPolicy.other - default: - return ViewerInfoPolicy.other - } + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ViewerInfoPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "enabled": + return ViewerInfoPolicy.enabled + case "disabled": + return ViewerInfoPolicy.disabled + case "other": + return ViewerInfoPolicy.other default: - fatalError("Failed to deserialize") + return ViewerInfoPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ViewerInfoPolicy.self, json: json) } } } /// Who can access a shared link. The most open visibility is public_. The default depends on many aspects, such as /// team and user preferences and shared folder settings. - public enum Visibility: CustomStringConvertible { + public enum Visibility: CustomStringConvertible, JSONRepresentable { /// Anyone who has received the link can access it. No login required. case public_ /// Only members of the same team can access the link. Login is required. @@ -8918,115 +11021,141 @@ open class Sharing { /// An unspecified error. case other + func json() throws -> JSON { + try VisibilitySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(VisibilitySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try VisibilitySerializer().serialize(self)))" + } catch { + return "Failed to generate description for Visibility: \(error)" + } } } - open class VisibilitySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Visibility) -> JSON { + + public class VisibilitySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Visibility) throws -> JSON { switch value { - case .public_: - var d = [String: JSON]() - d[".tag"] = .str("public") - return .dictionary(d) - case .teamOnly: - var d = [String: JSON]() - d[".tag"] = .str("team_only") - return .dictionary(d) - case .password: - var d = [String: JSON]() - d[".tag"] = .str("password") - return .dictionary(d) - case .teamAndPassword: - var d = [String: JSON]() - d[".tag"] = .str("team_and_password") - return .dictionary(d) - case .sharedFolderOnly: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_only") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> Visibility { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "public": - return Visibility.public_ - case "team_only": - return Visibility.teamOnly - case "password": - return Visibility.password - case "team_and_password": - return Visibility.teamAndPassword - case "shared_folder_only": - return Visibility.sharedFolderOnly - case "other": - return Visibility.other - default: - return Visibility.other - } - default: - fatalError("Failed to deserialize") + case .public_: + var d = [String: JSON]() + d[".tag"] = .str("public") + return .dictionary(d) + case .teamOnly: + var d = [String: JSON]() + d[".tag"] = .str("team_only") + return .dictionary(d) + case .password: + var d = [String: JSON]() + d[".tag"] = .str("password") + return .dictionary(d) + case .teamAndPassword: + var d = [String: JSON]() + d[".tag"] = .str("team_and_password") + return .dictionary(d) + case .sharedFolderOnly: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_only") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> Visibility { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "public": + return Visibility.public_ + case "team_only": + return Visibility.teamOnly + case "password": + return Visibility.password + case "team_and_password": + return Visibility.teamAndPassword + case "shared_folder_only": + return Visibility.sharedFolderOnly + case "other": + return Visibility.other + default: + return Visibility.other + } + default: + throw JSONSerializerError.deserializeError(type: Visibility.self, json: json) } } } /// The VisibilityPolicy struct - open class VisibilityPolicy: CustomStringConvertible { + public class VisibilityPolicy: CustomStringConvertible, JSONRepresentable { /// This is the value to submit when saving the visibility setting. public let policy: Sharing.RequestedVisibility /// This is what the effective policy would be, if you selected this option. The resolved policy is obtained - /// after considering external effects such as shared folder settings and team policy. This value is guaranteed - /// to be provided. + /// after considering external effects such as shared folder settings and team policy. This value is + /// guaranteed to be provided. public let resolvedPolicy: Sharing.AlphaResolvedVisibility /// Whether the user is permitted to set the visibility to this policy. public let allowed: Bool /// If allowed is false, this will provide the reason that the user is not permitted to set the visibility to /// this policy. public let disallowedReason: Sharing.VisibilityPolicyDisallowedReason? - public init(policy: Sharing.RequestedVisibility, resolvedPolicy: Sharing.AlphaResolvedVisibility, allowed: Bool, disallowedReason: Sharing.VisibilityPolicyDisallowedReason? = nil) { + public init( + policy: Sharing.RequestedVisibility, + resolvedPolicy: Sharing.AlphaResolvedVisibility, + allowed: Bool, + disallowedReason: Sharing.VisibilityPolicyDisallowedReason? = nil + ) { self.policy = policy self.resolvedPolicy = resolvedPolicy self.allowed = allowed self.disallowedReason = disallowedReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(VisibilityPolicySerializer().serialize(self)))" + + func json() throws -> JSON { + try VisibilityPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try VisibilityPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for VisibilityPolicy: \(error)" + } } } - open class VisibilityPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: VisibilityPolicy) -> JSON { - let output = [ - "policy": Sharing.RequestedVisibilitySerializer().serialize(value.policy), - "resolved_policy": Sharing.AlphaResolvedVisibilitySerializer().serialize(value.resolvedPolicy), - "allowed": Serialization._BoolSerializer.serialize(value.allowed), - "disallowed_reason": NullableSerializer(Sharing.VisibilityPolicyDisallowedReasonSerializer()).serialize(value.disallowedReason), + + public class VisibilityPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: VisibilityPolicy) throws -> JSON { + let output = [ + "policy": try Sharing.RequestedVisibilitySerializer().serialize(value.policy), + "resolved_policy": try Sharing.AlphaResolvedVisibilitySerializer().serialize(value.resolvedPolicy), + "allowed": try Serialization._BoolSerializer.serialize(value.allowed), + "disallowed_reason": try NullableSerializer(Sharing.VisibilityPolicyDisallowedReasonSerializer()).serialize(value.disallowedReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> VisibilityPolicy { + + public func deserialize(_ json: JSON) throws -> VisibilityPolicy { switch json { - case .dictionary(let dict): - let policy = Sharing.RequestedVisibilitySerializer().deserialize(dict["policy"] ?? .null) - let resolvedPolicy = Sharing.AlphaResolvedVisibilitySerializer().deserialize(dict["resolved_policy"] ?? .null) - let allowed = Serialization._BoolSerializer.deserialize(dict["allowed"] ?? .null) - let disallowedReason = NullableSerializer(Sharing.VisibilityPolicyDisallowedReasonSerializer()).deserialize(dict["disallowed_reason"] ?? .null) - return VisibilityPolicy(policy: policy, resolvedPolicy: resolvedPolicy, allowed: allowed, disallowedReason: disallowedReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let policy = try Sharing.RequestedVisibilitySerializer().deserialize(dict["policy"] ?? .null) + let resolvedPolicy = try Sharing.AlphaResolvedVisibilitySerializer().deserialize(dict["resolved_policy"] ?? .null) + let allowed = try Serialization._BoolSerializer.deserialize(dict["allowed"] ?? .null) + let disallowedReason = try NullableSerializer(Sharing.VisibilityPolicyDisallowedReasonSerializer()) + .deserialize(dict["disallowed_reason"] ?? .null) + return VisibilityPolicy(policy: policy, resolvedPolicy: resolvedPolicy, allowed: allowed, disallowedReason: disallowedReason) + default: + throw JSONSerializerError.deserializeError(type: VisibilityPolicy.self, json: json) } } } - /// Stone Route Objects static let addFileMember = Route( @@ -9037,9 +11166,11 @@ open class Sharing { argSerializer: Sharing.AddFileMemberArgsSerializer(), responseSerializer: ArraySerializer(Sharing.FileMemberActionResultSerializer()), errorSerializer: Sharing.AddFileMemberErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let addFolderMember = Route( name: "add_folder_member", @@ -9049,9 +11180,11 @@ open class Sharing { argSerializer: Sharing.AddFolderMemberArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Sharing.AddFolderMemberErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let checkJobStatus = Route( name: "check_job_status", @@ -9061,9 +11194,11 @@ open class Sharing { argSerializer: Async.PollArgSerializer(), responseSerializer: Sharing.JobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let checkRemoveMemberJobStatus = Route( name: "check_remove_member_job_status", @@ -9073,9 +11208,11 @@ open class Sharing { argSerializer: Async.PollArgSerializer(), responseSerializer: Sharing.RemoveMemberJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let checkShareJobStatus = Route( name: "check_share_job_status", @@ -9085,9 +11222,11 @@ open class Sharing { argSerializer: Async.PollArgSerializer(), responseSerializer: Sharing.ShareFolderJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let createSharedLink = Route( name: "create_shared_link", @@ -9097,9 +11236,11 @@ open class Sharing { argSerializer: Sharing.CreateSharedLinkArgSerializer(), responseSerializer: Sharing.PathLinkMetadataSerializer(), errorSerializer: Sharing.CreateSharedLinkErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let createSharedLinkWithSettings = Route( name: "create_shared_link_with_settings", @@ -9109,9 +11250,11 @@ open class Sharing { argSerializer: Sharing.CreateSharedLinkWithSettingsArgSerializer(), responseSerializer: Sharing.SharedLinkMetadataSerializer(), errorSerializer: Sharing.CreateSharedLinkWithSettingsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getFileMetadata = Route( name: "get_file_metadata", @@ -9121,9 +11264,11 @@ open class Sharing { argSerializer: Sharing.GetFileMetadataArgSerializer(), responseSerializer: Sharing.SharedFileMetadataSerializer(), errorSerializer: Sharing.GetFileMetadataErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getFileMetadataBatch = Route( name: "get_file_metadata/batch", @@ -9133,9 +11278,11 @@ open class Sharing { argSerializer: Sharing.GetFileMetadataBatchArgSerializer(), responseSerializer: ArraySerializer(Sharing.GetFileMetadataBatchResultSerializer()), errorSerializer: Sharing.SharingUserErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getFolderMetadata = Route( name: "get_folder_metadata", @@ -9145,9 +11292,11 @@ open class Sharing { argSerializer: Sharing.GetMetadataArgsSerializer(), responseSerializer: Sharing.SharedFolderMetadataSerializer(), errorSerializer: Sharing.SharedFolderAccessErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getSharedLinkFile = Route( name: "get_shared_link_file", @@ -9157,9 +11306,11 @@ open class Sharing { argSerializer: Sharing.GetSharedLinkMetadataArgSerializer(), responseSerializer: Sharing.SharedLinkMetadataSerializer(), errorSerializer: Sharing.GetSharedLinkFileErrorSerializer(), - attrs: ["auth": "user", - "host": "content", - "style": "download"] + attributes: RouteAttributes( + auth: [.user], + host: .content, + style: .download + ) ) static let getSharedLinkMetadata = Route( name: "get_shared_link_metadata", @@ -9169,9 +11320,11 @@ open class Sharing { argSerializer: Sharing.GetSharedLinkMetadataArgSerializer(), responseSerializer: Sharing.SharedLinkMetadataSerializer(), errorSerializer: Sharing.SharedLinkErrorSerializer(), - attrs: ["auth": "app, user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) ) static let getSharedLinks = Route( name: "get_shared_links", @@ -9181,9 +11334,11 @@ open class Sharing { argSerializer: Sharing.GetSharedLinksArgSerializer(), responseSerializer: Sharing.GetSharedLinksResultSerializer(), errorSerializer: Sharing.GetSharedLinksErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFileMembers = Route( name: "list_file_members", @@ -9193,9 +11348,11 @@ open class Sharing { argSerializer: Sharing.ListFileMembersArgSerializer(), responseSerializer: Sharing.SharedFileMembersSerializer(), errorSerializer: Sharing.ListFileMembersErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFileMembersBatch = Route( name: "list_file_members/batch", @@ -9205,9 +11362,11 @@ open class Sharing { argSerializer: Sharing.ListFileMembersBatchArgSerializer(), responseSerializer: ArraySerializer(Sharing.ListFileMembersBatchResultSerializer()), errorSerializer: Sharing.SharingUserErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFileMembersContinue = Route( name: "list_file_members/continue", @@ -9217,9 +11376,11 @@ open class Sharing { argSerializer: Sharing.ListFileMembersContinueArgSerializer(), responseSerializer: Sharing.SharedFileMembersSerializer(), errorSerializer: Sharing.ListFileMembersContinueErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFolderMembers = Route( name: "list_folder_members", @@ -9229,9 +11390,11 @@ open class Sharing { argSerializer: Sharing.ListFolderMembersArgsSerializer(), responseSerializer: Sharing.SharedFolderMembersSerializer(), errorSerializer: Sharing.SharedFolderAccessErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFolderMembersContinue = Route( name: "list_folder_members/continue", @@ -9241,9 +11404,11 @@ open class Sharing { argSerializer: Sharing.ListFolderMembersContinueArgSerializer(), responseSerializer: Sharing.SharedFolderMembersSerializer(), errorSerializer: Sharing.ListFolderMembersContinueErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFolders = Route( name: "list_folders", @@ -9253,9 +11418,11 @@ open class Sharing { argSerializer: Sharing.ListFoldersArgsSerializer(), responseSerializer: Sharing.ListFoldersResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listFoldersContinue = Route( name: "list_folders/continue", @@ -9265,9 +11432,11 @@ open class Sharing { argSerializer: Sharing.ListFoldersContinueArgSerializer(), responseSerializer: Sharing.ListFoldersResultSerializer(), errorSerializer: Sharing.ListFoldersContinueErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listMountableFolders = Route( name: "list_mountable_folders", @@ -9277,9 +11446,11 @@ open class Sharing { argSerializer: Sharing.ListFoldersArgsSerializer(), responseSerializer: Sharing.ListFoldersResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listMountableFoldersContinue = Route( name: "list_mountable_folders/continue", @@ -9289,9 +11460,11 @@ open class Sharing { argSerializer: Sharing.ListFoldersContinueArgSerializer(), responseSerializer: Sharing.ListFoldersResultSerializer(), errorSerializer: Sharing.ListFoldersContinueErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listReceivedFiles = Route( name: "list_received_files", @@ -9301,9 +11474,11 @@ open class Sharing { argSerializer: Sharing.ListFilesArgSerializer(), responseSerializer: Sharing.ListFilesResultSerializer(), errorSerializer: Sharing.SharingUserErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listReceivedFilesContinue = Route( name: "list_received_files/continue", @@ -9313,9 +11488,11 @@ open class Sharing { argSerializer: Sharing.ListFilesContinueArgSerializer(), responseSerializer: Sharing.ListFilesResultSerializer(), errorSerializer: Sharing.ListFilesContinueErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let listSharedLinks = Route( name: "list_shared_links", @@ -9325,9 +11502,11 @@ open class Sharing { argSerializer: Sharing.ListSharedLinksArgSerializer(), responseSerializer: Sharing.ListSharedLinksResultSerializer(), errorSerializer: Sharing.ListSharedLinksErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let modifySharedLinkSettings = Route( name: "modify_shared_link_settings", @@ -9337,9 +11516,11 @@ open class Sharing { argSerializer: Sharing.ModifySharedLinkSettingsArgsSerializer(), responseSerializer: Sharing.SharedLinkMetadataSerializer(), errorSerializer: Sharing.ModifySharedLinkSettingsErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let mountFolder = Route( name: "mount_folder", @@ -9349,9 +11530,11 @@ open class Sharing { argSerializer: Sharing.MountFolderArgSerializer(), responseSerializer: Sharing.SharedFolderMetadataSerializer(), errorSerializer: Sharing.MountFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let relinquishFileMembership = Route( name: "relinquish_file_membership", @@ -9361,9 +11544,11 @@ open class Sharing { argSerializer: Sharing.RelinquishFileMembershipArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Sharing.RelinquishFileMembershipErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let relinquishFolderMembership = Route( name: "relinquish_folder_membership", @@ -9373,9 +11558,11 @@ open class Sharing { argSerializer: Sharing.RelinquishFolderMembershipArgSerializer(), responseSerializer: Async.LaunchEmptyResultSerializer(), errorSerializer: Sharing.RelinquishFolderMembershipErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let removeFileMember = Route( name: "remove_file_member", @@ -9385,9 +11572,11 @@ open class Sharing { argSerializer: Sharing.RemoveFileMemberArgSerializer(), responseSerializer: Sharing.FileMemberActionIndividualResultSerializer(), errorSerializer: Sharing.RemoveFileMemberErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let removeFileMember2 = Route( name: "remove_file_member_2", @@ -9397,9 +11586,11 @@ open class Sharing { argSerializer: Sharing.RemoveFileMemberArgSerializer(), responseSerializer: Sharing.FileMemberRemoveActionResultSerializer(), errorSerializer: Sharing.RemoveFileMemberErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let removeFolderMember = Route( name: "remove_folder_member", @@ -9409,9 +11600,11 @@ open class Sharing { argSerializer: Sharing.RemoveFolderMemberArgSerializer(), responseSerializer: Async.LaunchResultBaseSerializer(), errorSerializer: Sharing.RemoveFolderMemberErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let revokeSharedLink = Route( name: "revoke_shared_link", @@ -9421,9 +11614,11 @@ open class Sharing { argSerializer: Sharing.RevokeSharedLinkArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Sharing.RevokeSharedLinkErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let setAccessInheritance = Route( name: "set_access_inheritance", @@ -9433,9 +11628,11 @@ open class Sharing { argSerializer: Sharing.SetAccessInheritanceArgSerializer(), responseSerializer: Sharing.ShareFolderLaunchSerializer(), errorSerializer: Sharing.SetAccessInheritanceErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let shareFolder = Route( name: "share_folder", @@ -9445,9 +11642,11 @@ open class Sharing { argSerializer: Sharing.ShareFolderArgSerializer(), responseSerializer: Sharing.ShareFolderLaunchSerializer(), errorSerializer: Sharing.ShareFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let transferFolder = Route( name: "transfer_folder", @@ -9457,9 +11656,11 @@ open class Sharing { argSerializer: Sharing.TransferFolderArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Sharing.TransferFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let unmountFolder = Route( name: "unmount_folder", @@ -9469,9 +11670,11 @@ open class Sharing { argSerializer: Sharing.UnmountFolderArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Sharing.UnmountFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let unshareFile = Route( name: "unshare_file", @@ -9481,9 +11684,11 @@ open class Sharing { argSerializer: Sharing.UnshareFileArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Sharing.UnshareFileErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let unshareFolder = Route( name: "unshare_folder", @@ -9493,9 +11698,11 @@ open class Sharing { argSerializer: Sharing.UnshareFolderArgSerializer(), responseSerializer: Async.LaunchEmptyResultSerializer(), errorSerializer: Sharing.UnshareFolderErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let updateFileMember = Route( name: "update_file_member", @@ -9505,9 +11712,11 @@ open class Sharing { argSerializer: Sharing.UpdateFileMemberArgsSerializer(), responseSerializer: Sharing.MemberAccessLevelResultSerializer(), errorSerializer: Sharing.FileMemberActionErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let updateFolderMember = Route( name: "update_folder_member", @@ -9517,9 +11726,11 @@ open class Sharing { argSerializer: Sharing.UpdateFolderMemberArgSerializer(), responseSerializer: Sharing.MemberAccessLevelResultSerializer(), errorSerializer: Sharing.UpdateFolderMemberErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let updateFolderPolicy = Route( name: "update_folder_policy", @@ -9529,8 +11740,10 @@ open class Sharing { argSerializer: Sharing.UpdateFolderPolicyArgSerializer(), responseSerializer: Sharing.SharedFolderMetadataSerializer(), errorSerializer: Sharing.UpdateFolderPolicyErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/SharingRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/SharingRoutes.swift index 88cb8ece2..edf81ea35 100644 --- a/Source/SwiftyDropbox/Shared/Generated/SharingRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/SharingRoutes.swift @@ -7,14 +7,17 @@ import Foundation /// Routes for the sharing namespace -open class SharingRoutes { +/// For Objective-C compatible routes see DBSharingRoutes +public class SharingRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Adds specified members to a file. /// + /// - scope: sharing.write + /// /// - parameter file: File to which to add members. /// - parameter members: Members to add. Note that even an email address is given, this may result in a user being /// directly added to the membership if that email is the user's main account email. @@ -24,17 +27,33 @@ open class SharingRoutes { /// - parameter accessLevel: AccessLevel union object, describing what access level we want to give new members. /// - parameter addMessageAsComment: If the custom message should be added as a comment on the file. /// - /// - returns: Through the response callback, the caller will receive a `Array` + /// - returns: Through the response callback, the caller will receive a `Array` /// object on success or a `Sharing.AddFileMemberError` object on failure. - @discardableResult open func addFileMember(file: String, members: Array, customMessage: String? = nil, quiet: Bool = false, accessLevel: Sharing.AccessLevel = .viewer, addMessageAsComment: Bool = false) -> RpcRequest, Sharing.AddFileMemberErrorSerializer> { + @discardableResult public func addFileMember( + file: String, + members: [Sharing.MemberSelector], + customMessage: String? = nil, + quiet: Bool = false, + accessLevel: Sharing.AccessLevel = .viewer, + addMessageAsComment: Bool = false + ) -> RpcRequest, Sharing.AddFileMemberErrorSerializer> { let route = Sharing.addFileMember - let serverArgs = Sharing.AddFileMemberArgs(file: file, members: members, customMessage: customMessage, quiet: quiet, accessLevel: accessLevel, addMessageAsComment: addMessageAsComment) + let serverArgs = Sharing.AddFileMemberArgs( + file: file, + members: members, + customMessage: customMessage, + quiet: quiet, + accessLevel: accessLevel, + addMessageAsComment: addMessageAsComment + ) return client.request(route, serverArgs: serverArgs) } /// Allows an owner or editor (if the ACL update policy allows) of a shared folder to add another member. For the - /// new member to get access to all the functionality for this folder, you will need to call mountFolder on their - /// behalf. + /// new member to get access to all the functionality for this folder, you will need to call mountFolder on + /// their behalf. + /// + /// - scope: sharing.write /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter members: The intended list of members to add. Added members will receive invites to join the shared @@ -42,9 +61,14 @@ open class SharingRoutes { /// - parameter quiet: Whether added members should be notified via email and device notifications of their invite. /// - parameter customMessage: Optional message to display to added members in their invitation. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Sharing.AddFolderMemberError` object on failure. - @discardableResult open func addFolderMember(sharedFolderId: String, members: Array, quiet: Bool = false, customMessage: String? = nil) -> RpcRequest { + @discardableResult public func addFolderMember( + sharedFolderId: String, + members: [Sharing.AddMember], + quiet: Bool = false, + customMessage: String? = nil + ) -> RpcRequest { let route = Sharing.addFolderMember let serverArgs = Sharing.AddFolderMemberArg(sharedFolderId: sharedFolderId, members: members, quiet: quiet, customMessage: customMessage) return client.request(route, serverArgs: serverArgs) @@ -52,12 +76,14 @@ open class SharingRoutes { /// Returns the status of an asynchronous job. /// + /// - scope: sharing.write + /// /// - 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 `Sharing.JobStatus` object on success or a + /// - returns: Through the response callback, the caller will receive a `Sharing.JobStatus` object on success or a /// `Async.PollError` object on failure. - @discardableResult open func checkJobStatus(asyncJobId: String) -> RpcRequest { + @discardableResult public func checkJobStatus(asyncJobId: String) -> RpcRequest { let route = Sharing.checkJobStatus let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -65,12 +91,15 @@ open class SharingRoutes { /// Returns the status of an asynchronous job for sharing a folder. /// + /// - scope: sharing.write + /// /// - 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 `Sharing.RemoveMemberJobStatus` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.RemoveMemberJobStatus` object on /// success or a `Async.PollError` object on failure. - @discardableResult open func checkRemoveMemberJobStatus(asyncJobId: String) -> RpcRequest { + @discardableResult public func checkRemoveMemberJobStatus(asyncJobId: String) + -> RpcRequest { let route = Sharing.checkRemoveMemberJobStatus let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -78,45 +107,58 @@ open class SharingRoutes { /// Returns the status of an asynchronous job for sharing a folder. /// + /// - scope: sharing.write + /// /// - 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 `Sharing.ShareFolderJobStatus` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderJobStatus` object on /// success or a `Async.PollError` object on failure. - @discardableResult open func checkShareJobStatus(asyncJobId: String) -> RpcRequest { + @discardableResult public func checkShareJobStatus(asyncJobId: String) -> RpcRequest { let route = Sharing.checkShareJobStatus let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) } /// Create a shared link. If a shared link already exists for the given path, that link is returned. Previously, it - /// was technically possible to break a shared link by moving or renaming the corresponding file or folder. In the - /// future, this will no longer be the case, so your app shouldn't rely on this behavior. Instead, if your app needs - /// to revoke a shared link, use revokeSharedLink. + /// was technically possible to break a shared link by moving or renaming the corresponding file or folder. In + /// the future, this will no longer be the case, so your app shouldn't rely on this behavior. Instead, if your + /// app needs to revoke a shared link, use revokeSharedLink. + /// + /// - scope: sharing.write /// /// - parameter path: The path to share. /// - parameter pendingUpload: If it's okay to share a path that does not yet exist, set this to either file in /// PendingUploadMode or folder in PendingUploadMode to indicate whether to assume it's a file or folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.PathLinkMetadata` object on - /// success or a `Sharing.CreateSharedLinkError` object on failure. - @available(*, unavailable, message:"createSharedLink is deprecated. Use createSharedLinkWithSettings.") - @discardableResult open func createSharedLink(path: String, shortUrl: Bool = false, pendingUpload: Sharing.PendingUploadMode? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Sharing.PathLinkMetadata` object on success + /// or a `Sharing.CreateSharedLinkError` object on failure. + @available(*, unavailable, message: "createSharedLink is deprecated. Use createSharedLinkWithSettings.") + @discardableResult public func createSharedLink( + path: String, + shortUrl: Bool = false, + pendingUpload: Sharing.PendingUploadMode? = nil + ) -> RpcRequest { let route = Sharing.createSharedLink let serverArgs = Sharing.CreateSharedLinkArg(path: path, shortUrl: shortUrl, pendingUpload: pendingUpload) return client.request(route, serverArgs: serverArgs) } /// Create a shared link with custom settings. If no settings are given then the default visibility is public_ in - /// RequestedVisibility (The resolved visibility, though, may depend on other aspects such as team and shared folder - /// settings). + /// RequestedVisibility (The resolved visibility, though, may depend on other aspects such as team and shared + /// folder settings). + /// + /// - scope: sharing.write /// /// - parameter path: The path to be shared by the shared link. /// - parameter settings: The requested settings for the newly created shared link. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on /// success or a `Sharing.CreateSharedLinkWithSettingsError` object on failure. - @discardableResult open func createSharedLinkWithSettings(path: String, settings: Sharing.SharedLinkSettings? = nil) -> RpcRequest { + @discardableResult public func createSharedLinkWithSettings( + path: String, + settings: Sharing.SharedLinkSettings? = nil + ) -> RpcRequest { let route = Sharing.createSharedLinkWithSettings let serverArgs = Sharing.CreateSharedLinkWithSettingsArg(path: path, settings: settings) return client.request(route, serverArgs: serverArgs) @@ -124,14 +166,19 @@ open class SharingRoutes { /// Returns shared file metadata. /// + /// - scope: sharing.read + /// /// - parameter file: The file to query. /// - parameter actions: A list of `FileAction`s corresponding to `FilePermission`s that should appear in the - /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can perform on - /// the file. + /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can + /// perform on the file. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMetadata` object on /// success or a `Sharing.GetFileMetadataError` object on failure. - @discardableResult open func getFileMetadata(file: String, actions: Array? = nil) -> RpcRequest { + @discardableResult public func getFileMetadata( + file: String, + actions: [Sharing.FileAction]? = nil + ) -> RpcRequest { let route = Sharing.getFileMetadata let serverArgs = Sharing.GetFileMetadataArg(file: file, actions: actions) return client.request(route, serverArgs: serverArgs) @@ -139,14 +186,19 @@ open class SharingRoutes { /// Returns shared file metadata. /// + /// - scope: sharing.read + /// /// - parameter files: The files to query. /// - parameter actions: A list of `FileAction`s corresponding to `FilePermission`s that should appear in the - /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can perform on - /// the file. + /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can + /// perform on the file. /// - /// - returns: Through the response callback, the caller will receive a `Array` + /// - returns: Through the response callback, the caller will receive a `Array` /// object on success or a `Sharing.SharingUserError` object on failure. - @discardableResult open func getFileMetadataBatch(files: Array, actions: Array? = nil) -> RpcRequest, Sharing.SharingUserErrorSerializer> { + @discardableResult public func getFileMetadataBatch( + files: [String], + actions: [Sharing.FileAction]? = nil + ) -> RpcRequest, Sharing.SharingUserErrorSerializer> { let route = Sharing.getFileMetadataBatch let serverArgs = Sharing.GetFileMetadataBatchArg(files: files, actions: actions) return client.request(route, serverArgs: serverArgs) @@ -154,14 +206,19 @@ open class SharingRoutes { /// Returns shared folder metadata by its folder ID. /// + /// - scope: sharing.read + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the - /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can perform - /// on the folder. + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on /// success or a `Sharing.SharedFolderAccessError` object on failure. - @discardableResult open func getFolderMetadata(sharedFolderId: String, actions: Array? = nil) -> RpcRequest { + @discardableResult public func getFolderMetadata( + sharedFolderId: String, + actions: [Sharing.FolderAction]? = nil + ) -> RpcRequest { let route = Sharing.getFolderMetadata let serverArgs = Sharing.GetMetadataArgs(sharedFolderId: sharedFolderId, actions: actions) return client.request(route, serverArgs: serverArgs) @@ -169,19 +226,26 @@ open class SharingRoutes { /// Download the shared link's file from a user's Dropbox. /// + /// - scope: sharing.read + /// /// - parameter url: URL of the shared link. /// - parameter path: If the shared link is to a folder, this parameter can be used to retrieve the metadata for a /// specific file or sub-folder in this folder. A relative path should be used. /// - parameter linkPassword: If the shared link has a password, this parameter can be used. /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite - /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an - /// NSError will be thrown). - /// - parameter destination: A closure used to compute the destination, given the temporary file location and the - /// response. + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on /// success or a `Sharing.GetSharedLinkFileError` object on failure. - @discardableResult open func getSharedLinkFile(url: String, path: String? = nil, linkPassword: String? = nil, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile { + @discardableResult public func getSharedLinkFile( + url: String, + path: String? = nil, + linkPassword: String? = nil, + overwrite: Bool = false, + destination: URL + ) -> DownloadRequestFile { let route = Sharing.getSharedLinkFile let serverArgs = Sharing.GetSharedLinkMetadataArg(url: url, path: path, linkPassword: linkPassword) return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) @@ -189,14 +253,20 @@ open class SharingRoutes { /// Download the shared link's file from a user's Dropbox. /// + /// - scope: sharing.read + /// /// - parameter url: URL of the shared link. /// - parameter path: If the shared link is to a folder, this parameter can be used to retrieve the metadata for a /// specific file or sub-folder in this folder. A relative path should be used. /// - parameter linkPassword: If the shared link has a password, this parameter can be used. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on /// success or a `Sharing.GetSharedLinkFileError` object on failure. - @discardableResult open func getSharedLinkFile(url: String, path: String? = nil, linkPassword: String? = nil) -> DownloadRequestMemory { + @discardableResult public func getSharedLinkFile( + url: String, + path: String? = nil, + linkPassword: String? = nil + ) -> DownloadRequestMemory { let route = Sharing.getSharedLinkFile let serverArgs = Sharing.GetSharedLinkMetadataArg(url: url, path: path, linkPassword: linkPassword) return client.request(route, serverArgs: serverArgs) @@ -204,30 +274,39 @@ open class SharingRoutes { /// Get the shared link's metadata. /// + /// - scope: sharing.read + /// /// - parameter url: URL of the shared link. /// - parameter path: If the shared link is to a folder, this parameter can be used to retrieve the metadata for a /// specific file or sub-folder in this folder. A relative path should be used. /// - parameter linkPassword: If the shared link has a password, this parameter can be used. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on /// success or a `Sharing.SharedLinkError` object on failure. - @discardableResult open func getSharedLinkMetadata(url: String, path: String? = nil, linkPassword: String? = nil) -> RpcRequest { + @discardableResult public func getSharedLinkMetadata( + url: String, + path: String? = nil, + linkPassword: String? = nil + ) -> RpcRequest { let route = Sharing.getSharedLinkMetadata let serverArgs = Sharing.GetSharedLinkMetadataArg(url: url, path: path, linkPassword: linkPassword) return client.request(route, serverArgs: serverArgs) } /// Returns a list of LinkMetadata objects for this user, including collection links. If no path is given, returns a - /// list of all shared links for the current user, including collection links, up to a maximum of 1000 links. If a - /// non-empty path is given, returns a list of all shared links that allow access to the given path. Collection - /// links are never returned in this case. + /// list of all shared links for the current user, including collection links, up to a maximum of 1000 links. If + /// a non-empty path is given, returns a list of all shared links that allow access to the given path. + /// Collection links are never returned in this case. + /// + /// - scope: sharing.read /// /// - parameter path: See getSharedLinks description. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.GetSharedLinksResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.GetSharedLinksResult` object on /// success or a `Sharing.GetSharedLinksError` object on failure. - @available(*, unavailable, message:"getSharedLinks is deprecated. Use listSharedLinks.") - @discardableResult open func getSharedLinks(path: String? = nil) -> RpcRequest { + @available(*, unavailable, message: "getSharedLinks is deprecated. Use listSharedLinks.") + @discardableResult public func getSharedLinks(path: String? = nil) + -> RpcRequest { let route = Sharing.getSharedLinks let serverArgs = Sharing.GetSharedLinksArg(path: path) return client.request(route, serverArgs: serverArgs) @@ -235,29 +314,42 @@ open class SharingRoutes { /// Use to obtain the members who have been invited to a file, both inherited and uninherited members. /// + /// - scope: sharing.read + /// /// - parameter file: The file for which you want to see members. /// - parameter actions: The actions for which to return permissions on a member. /// - parameter includeInherited: Whether to include members who only have access from a parent shared folder. /// - parameter limit: Number of members to return max per query. Defaults to 100 if no limit is specified. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMembers` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMembers` object on /// success or a `Sharing.ListFileMembersError` object on failure. - @discardableResult open func listFileMembers(file: String, actions: Array? = nil, includeInherited: Bool = true, limit: UInt32 = 100) -> RpcRequest { + @discardableResult public func listFileMembers( + file: String, + actions: [Sharing.MemberAction]? = nil, + includeInherited: Bool = true, + limit: UInt32 = 100 + ) -> RpcRequest { let route = Sharing.listFileMembers let serverArgs = Sharing.ListFileMembersArg(file: file, actions: actions, includeInherited: includeInherited, limit: limit) return client.request(route, serverArgs: serverArgs) } /// Get members of multiple files at once. The arguments to this route are more limited, and the limit on query - /// result size per file is more strict. To customize the results more, use the individual file endpoint. Inherited - /// users and groups are not included in the result, and permissions are not returned for this endpoint. + /// result size per file is more strict. To customize the results more, use the individual file endpoint. + /// Inherited users and groups are not included in the result, and permissions are not returned for this + /// endpoint. + /// + /// - scope: sharing.read /// /// - parameter files: Files for which to return members. /// - parameter limit: Number of members to return max per query. Defaults to 10 if no limit is specified. /// - /// - returns: Through the response callback, the caller will receive a `Array` + /// - returns: Through the response callback, the caller will receive a `Array` /// object on success or a `Sharing.SharingUserError` object on failure. - @discardableResult open func listFileMembersBatch(files: Array, limit: UInt32 = 10) -> RpcRequest, Sharing.SharingUserErrorSerializer> { + @discardableResult public func listFileMembersBatch( + files: [String], + limit: UInt32 = 10 + ) -> RpcRequest, Sharing.SharingUserErrorSerializer> { let route = Sharing.listFileMembersBatch let serverArgs = Sharing.ListFileMembersBatchArg(files: files, limit: limit) return client.request(route, serverArgs: serverArgs) @@ -266,12 +358,15 @@ open class SharingRoutes { /// Once a cursor has been retrieved from listFileMembers or listFileMembersBatch, use this to paginate through all /// shared file members. /// + /// - scope: sharing.read + /// /// - parameter cursor: The cursor returned by your last call to listFileMembers, listFileMembersContinue, or /// listFileMembersBatch. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMembers` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMembers` object on /// success or a `Sharing.ListFileMembersContinueError` object on failure. - @discardableResult open func listFileMembersContinue(cursor: String) -> RpcRequest { + @discardableResult public func listFileMembersContinue(cursor: String) + -> RpcRequest { let route = Sharing.listFileMembersContinue let serverArgs = Sharing.ListFileMembersContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -279,11 +374,17 @@ open class SharingRoutes { /// Returns shared folder membership by its folder ID. /// + /// - scope: sharing.read + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMembers` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMembers` object on /// success or a `Sharing.SharedFolderAccessError` object on failure. - @discardableResult open func listFolderMembers(sharedFolderId: String, actions: Array? = nil, limit: UInt32 = 1000) -> RpcRequest { + @discardableResult public func listFolderMembers( + sharedFolderId: String, + actions: [Sharing.MemberAction]? = nil, + limit: UInt32 = 1_000 + ) -> RpcRequest { let route = Sharing.listFolderMembers let serverArgs = Sharing.ListFolderMembersArgs(sharedFolderId: sharedFolderId, actions: actions, limit: limit) return client.request(route, serverArgs: serverArgs) @@ -291,11 +392,14 @@ open class SharingRoutes { /// Once a cursor has been retrieved from listFolderMembers, use this to paginate through all shared folder members. /// + /// - scope: sharing.read + /// /// - parameter cursor: The cursor returned by your last call to listFolderMembers or listFolderMembersContinue. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMembers` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMembers` object on /// success or a `Sharing.ListFolderMembersContinueError` object on failure. - @discardableResult open func listFolderMembersContinue(cursor: String) -> RpcRequest { + @discardableResult public func listFolderMembersContinue(cursor: String) + -> RpcRequest { let route = Sharing.listFolderMembersContinue let serverArgs = Sharing.ListFolderMembersContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -303,14 +407,19 @@ open class SharingRoutes { /// Return the list of all shared folders the current user has access to. /// + /// - scope: sharing.read + /// /// - parameter limit: The maximum number of results to return per request. /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the - /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can perform - /// on the folder. + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on /// success or a `Void` object on failure. - @discardableResult open func listFolders(limit: UInt32 = 1000, actions: Array? = nil) -> RpcRequest { + @discardableResult public func listFolders( + limit: UInt32 = 1_000, + actions: [Sharing.FolderAction]? = nil + ) -> RpcRequest { let route = Sharing.listFolders let serverArgs = Sharing.ListFoldersArgs(limit: limit, actions: actions) return client.request(route, serverArgs: serverArgs) @@ -319,11 +428,14 @@ open class SharingRoutes { /// Once a cursor has been retrieved from listFolders, use this to paginate through all shared folders. The cursor /// must come from a previous call to listFolders or listFoldersContinue. /// + /// - scope: sharing.read + /// /// - parameter cursor: The cursor returned by the previous API call specified in the endpoint description. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on /// success or a `Sharing.ListFoldersContinueError` object on failure. - @discardableResult open func listFoldersContinue(cursor: String) -> RpcRequest { + @discardableResult public func listFoldersContinue(cursor: String) + -> RpcRequest { let route = Sharing.listFoldersContinue let serverArgs = Sharing.ListFoldersContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -331,14 +443,19 @@ open class SharingRoutes { /// Return the list of all shared folders the current user can mount or unmount. /// + /// - scope: sharing.read + /// /// - parameter limit: The maximum number of results to return per request. /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the - /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can perform - /// on the folder. + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on /// success or a `Void` object on failure. - @discardableResult open func listMountableFolders(limit: UInt32 = 1000, actions: Array? = nil) -> RpcRequest { + @discardableResult public func listMountableFolders( + limit: UInt32 = 1_000, + actions: [Sharing.FolderAction]? = nil + ) -> RpcRequest { let route = Sharing.listMountableFolders let serverArgs = Sharing.ListFoldersArgs(limit: limit, actions: actions) return client.request(route, serverArgs: serverArgs) @@ -347,11 +464,14 @@ open class SharingRoutes { /// Once a cursor has been retrieved from listMountableFolders, use this to paginate through all mountable shared /// folders. The cursor must come from a previous call to listMountableFolders or listMountableFoldersContinue. /// + /// - scope: sharing.read + /// /// - parameter cursor: The cursor returned by the previous API call specified in the endpoint description. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on /// success or a `Sharing.ListFoldersContinueError` object on failure. - @discardableResult open func listMountableFoldersContinue(cursor: String) -> RpcRequest { + @discardableResult public func listMountableFoldersContinue(cursor: String) + -> RpcRequest { let route = Sharing.listMountableFoldersContinue let serverArgs = Sharing.ListFoldersContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -360,14 +480,19 @@ open class SharingRoutes { /// Returns a list of all files shared with current user. Does not include files the user has received via shared /// folders, and does not include unclaimed invitations. /// + /// - scope: sharing.read + /// /// - parameter limit: Number of files to return max per query. Defaults to 100 if no limit is specified. /// - parameter actions: A list of `FileAction`s corresponding to `FilePermission`s that should appear in the - /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can perform on - /// the file. + /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can + /// perform on the file. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ListFilesResult` object on success + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFilesResult` object on success /// or a `Sharing.SharingUserError` object on failure. - @discardableResult open func listReceivedFiles(limit: UInt32 = 100, actions: Array? = nil) -> RpcRequest { + @discardableResult public func listReceivedFiles( + limit: UInt32 = 100, + actions: [Sharing.FileAction]? = nil + ) -> RpcRequest { let route = Sharing.listReceivedFiles let serverArgs = Sharing.ListFilesArg(limit: limit, actions: actions) return client.request(route, serverArgs: serverArgs) @@ -375,31 +500,40 @@ open class SharingRoutes { /// Get more results with a cursor from listReceivedFiles. /// + /// - scope: sharing.read + /// /// - parameter cursor: Cursor in cursor in ListFilesResult. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ListFilesResult` object on success + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFilesResult` object on success /// or a `Sharing.ListFilesContinueError` object on failure. - @discardableResult open func listReceivedFilesContinue(cursor: String) -> RpcRequest { + @discardableResult public func listReceivedFilesContinue(cursor: String) + -> RpcRequest { let route = Sharing.listReceivedFilesContinue let serverArgs = Sharing.ListFilesContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) } /// List shared links of this user. If no path is given, returns a list of all shared links for the current user. - /// For members of business teams using team space and member folders, returns all shared links in the team member's - /// home folder unless the team space ID is specified in the request header. For more information, refer to the - /// Namespace Guide https://www.dropbox.com/developers/reference/namespace-guide. If a non-empty path is given, - /// returns a list of all shared links that allow access to the given path - direct links to the given path and - /// links to parent folders of the given path. Links to parent folders can be suppressed by setting direct_only to - /// true. + /// For members of business teams using team space and member folders, returns all shared links in the team + /// member's home folder unless the team space ID is specified in the request header. For more information, + /// refer to the Namespace Guide https://www.dropbox.com/developers/reference/namespace-guide. If a non-empty + /// path is given, returns a list of all shared links that allow access to the given path - direct links to the + /// given path and links to parent folders of the given path. Links to parent folders can be suppressed by + /// setting direct_only to true. + /// + /// - scope: sharing.read /// /// - parameter path: See listSharedLinks description. /// - parameter cursor: The cursor returned by your last call to listSharedLinks. /// - parameter directOnly: See listSharedLinks description. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ListSharedLinksResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ListSharedLinksResult` object on /// success or a `Sharing.ListSharedLinksError` object on failure. - @discardableResult open func listSharedLinks(path: String? = nil, cursor: String? = nil, directOnly: Bool? = nil) -> RpcRequest { + @discardableResult public func listSharedLinks( + path: String? = nil, + cursor: String? = nil, + directOnly: Bool? = nil + ) -> RpcRequest { let route = Sharing.listSharedLinks let serverArgs = Sharing.ListSharedLinksArg(path: path, cursor: cursor, directOnly: directOnly) return client.request(route, serverArgs: serverArgs) @@ -407,16 +541,22 @@ open class SharingRoutes { /// Modify the shared link's settings. If the requested visibility conflict with the shared links policy of the team /// or the shared folder (in case the linked file is part of a shared folder) then the resolvedVisibility in - /// LinkPermissions of the returned SharedLinkMetadata will reflect the actual visibility of the shared link and the - /// requestedVisibility in LinkPermissions will reflect the requested visibility. + /// LinkPermissions of the returned SharedLinkMetadata will reflect the actual visibility of the shared link and + /// the requestedVisibility in LinkPermissions will reflect the requested visibility. + /// + /// - scope: sharing.write /// /// - parameter url: URL of the shared link to change its settings. /// - parameter settings: Set of settings for the shared link. /// - parameter removeExpiration: If set to true, removes the expiration of the shared link. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on /// success or a `Sharing.ModifySharedLinkSettingsError` object on failure. - @discardableResult open func modifySharedLinkSettings(url: String, settings: Sharing.SharedLinkSettings, removeExpiration: Bool = false) -> RpcRequest { + @discardableResult public func modifySharedLinkSettings( + url: String, + settings: Sharing.SharedLinkSettings, + removeExpiration: Bool = false + ) -> RpcRequest { let route = Sharing.modifySharedLinkSettings let serverArgs = Sharing.ModifySharedLinkSettingsArgs(url: url, settings: settings, removeExpiration: removeExpiration) return client.request(route, serverArgs: serverArgs) @@ -425,11 +565,14 @@ open class SharingRoutes { /// The current user mounts the designated folder. Mount a shared folder for a user after they have been added as a /// member. Once mounted, the shared folder will appear in their Dropbox. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID of the shared folder to mount. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on /// success or a `Sharing.MountFolderError` object on failure. - @discardableResult open func mountFolder(sharedFolderId: String) -> RpcRequest { + @discardableResult public func mountFolder(sharedFolderId: String) + -> RpcRequest { let route = Sharing.mountFolder let serverArgs = Sharing.MountFolderArg(sharedFolderId: sharedFolderId) return client.request(route, serverArgs: serverArgs) @@ -438,11 +581,13 @@ open class SharingRoutes { /// The current user relinquishes their membership in the designated file. Note that the current user may still have /// inherited access to this file through the parent folder. /// + /// - scope: sharing.write + /// /// - parameter file: The path or id for the file. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Sharing.RelinquishFileMembershipError` object on failure. - @discardableResult open func relinquishFileMembership(file: String) -> RpcRequest { + @discardableResult public func relinquishFileMembership(file: String) -> RpcRequest { let route = Sharing.relinquishFileMembership let serverArgs = Sharing.RelinquishFileMembershipArg(file: file) return client.request(route, serverArgs: serverArgs) @@ -452,13 +597,18 @@ open class SharingRoutes { /// the folder. A folder owner cannot relinquish membership in their own folder. This will run synchronously if /// leave_a_copy is false, and asynchronously if leave_a_copy is true. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter leaveACopy: Keep a copy of the folder's contents upon relinquishing membership. This must be set to /// false when the folder is within a team folder or another shared folder. /// - /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success /// or a `Sharing.RelinquishFolderMembershipError` object on failure. - @discardableResult open func relinquishFolderMembership(sharedFolderId: String, leaveACopy: Bool = false) -> RpcRequest { + @discardableResult public func relinquishFolderMembership( + sharedFolderId: String, + leaveACopy: Bool = false + ) -> RpcRequest { let route = Sharing.relinquishFolderMembership let serverArgs = Sharing.RelinquishFolderMembershipArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy) return client.request(route, serverArgs: serverArgs) @@ -466,14 +616,19 @@ open class SharingRoutes { /// Identical to remove_file_member_2 but with less information returned. /// + /// - scope: sharing.write + /// /// - parameter file: File from which to remove members. /// - parameter member: Member to remove from this file. Note that even if an email is specified, it may result in /// the removal of a user (not an invitee) if the user's main account corresponds to that email address. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.FileMemberActionIndividualResult` + /// - returns: Through the response callback, the caller will receive a `Sharing.FileMemberActionIndividualResult` /// object on success or a `Sharing.RemoveFileMemberError` object on failure. - @available(*, unavailable, message:"removeFileMember is deprecated. Use removeFileMember2.") - @discardableResult open func removeFileMember(file: String, member: Sharing.MemberSelector) -> RpcRequest { + @available(*, unavailable, message: "removeFileMember is deprecated. Use removeFileMember2.") + @discardableResult public func removeFileMember( + file: String, + member: Sharing.MemberSelector + ) -> RpcRequest { let route = Sharing.removeFileMember let serverArgs = Sharing.RemoveFileMemberArg(file: file, member: member) return client.request(route, serverArgs: serverArgs) @@ -481,13 +636,18 @@ open class SharingRoutes { /// Removes a specified member from the file. /// + /// - scope: sharing.write + /// /// - parameter file: File from which to remove members. /// - parameter member: Member to remove from this file. Note that even if an email is specified, it may result in /// the removal of a user (not an invitee) if the user's main account corresponds to that email address. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.FileMemberRemoveActionResult` + /// - returns: Through the response callback, the caller will receive a `Sharing.FileMemberRemoveActionResult` /// object on success or a `Sharing.RemoveFileMemberError` object on failure. - @discardableResult open func removeFileMember2(file: String, member: Sharing.MemberSelector) -> RpcRequest { + @discardableResult public func removeFileMember2( + file: String, + member: Sharing.MemberSelector + ) -> RpcRequest { let route = Sharing.removeFileMember2 let serverArgs = Sharing.RemoveFileMemberArg(file: file, member: member) return client.request(route, serverArgs: serverArgs) @@ -495,15 +655,21 @@ open class SharingRoutes { /// Allows an owner or editor (if the ACL update policy allows) of a shared folder to remove another member. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter member: The member to remove from the folder. /// - parameter leaveACopy: If true, the removed user will keep their copy of the folder after it's unshared, /// assuming it was mounted. Otherwise, it will be removed from their Dropbox. This must be set to false when /// removing a group, or when the folder is within a team folder or another shared folder. /// - /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Sharing.RemoveFolderMemberError` object on failure. - @discardableResult open func removeFolderMember(sharedFolderId: String, member: Sharing.MemberSelector, leaveACopy: Bool) -> RpcRequest { + @discardableResult public func removeFolderMember( + sharedFolderId: String, + member: Sharing.MemberSelector, + leaveACopy: Bool + ) -> RpcRequest { let route = Sharing.removeFolderMember let serverArgs = Sharing.RemoveFolderMemberArg(sharedFolderId: sharedFolderId, member: member, leaveACopy: leaveACopy) return client.request(route, serverArgs: serverArgs) @@ -513,58 +679,93 @@ open class SharingRoutes { /// are shared links leading to any of the file parent folders. To list all shared links that enable access to a /// specific file, you can use the listSharedLinks with the file as the path in ListSharedLinksArg argument. /// + /// - scope: sharing.write + /// /// - parameter url: URL of the shared link. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Sharing.RevokeSharedLinkError` object on failure. - @discardableResult open func revokeSharedLink(url: String) -> RpcRequest { + @discardableResult public func revokeSharedLink(url: String) -> RpcRequest { let route = Sharing.revokeSharedLink let serverArgs = Sharing.RevokeSharedLinkArg(url: url) return client.request(route, serverArgs: serverArgs) } /// Change the inheritance policy of an existing Shared Folder. Only permitted for shared folders in a shared team - /// root. If a asyncJobId in ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the action - /// completes to get the metadata for the folder. + /// root. If a asyncJobId in ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the + /// action completes to get the metadata for the folder. + /// + /// - scope: sharing.write /// /// - parameter accessInheritance: The access inheritance settings for the folder. /// - parameter sharedFolderId: The ID for the shared folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on /// success or a `Sharing.SetAccessInheritanceError` object on failure. - @discardableResult open func setAccessInheritance(sharedFolderId: String, accessInheritance: Sharing.AccessInheritance = .inherit) -> RpcRequest { + @discardableResult public func setAccessInheritance( + sharedFolderId: String, + accessInheritance: Sharing + .AccessInheritance = .inherit + ) -> RpcRequest { let route = Sharing.setAccessInheritance let serverArgs = Sharing.SetAccessInheritanceArg(sharedFolderId: sharedFolderId, accessInheritance: accessInheritance) return client.request(route, serverArgs: serverArgs) } /// Share a folder with collaborators. Most sharing will be completed synchronously. Large folders will be completed - /// asynchronously. To make testing the async case repeatable, set `ShareFolderArg.force_async`. If a asyncJobId in - /// ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the action completes to get the - /// metadata for the folder. + /// asynchronously. To make testing the async case repeatable, set `ShareFolderArg.force_async`. If a asyncJobId + /// in ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the action completes to get + /// the metadata for the folder. + /// + /// - scope: sharing.write /// /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the - /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can perform - /// on the folder. + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. /// - parameter linkSettings: Settings on the link for this folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on /// success or a `Sharing.ShareFolderError` object on failure. - @discardableResult open func shareFolder(path: String, aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, forceAsync: Bool = false, memberPolicy: Sharing.MemberPolicy? = nil, sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, accessInheritance: Sharing.AccessInheritance = .inherit, actions: Array? = nil, linkSettings: Sharing.LinkSettings? = nil) -> RpcRequest { + @discardableResult public func shareFolder( + path: String, + aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, + forceAsync: Bool = false, + memberPolicy: Sharing.MemberPolicy? = nil, + sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, + viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, + accessInheritance: Sharing.AccessInheritance = .inherit, + actions: [Sharing.FolderAction]? = nil, + linkSettings: Sharing.LinkSettings? = nil + ) -> RpcRequest { let route = Sharing.shareFolder - let serverArgs = Sharing.ShareFolderArg(path: path, aclUpdatePolicy: aclUpdatePolicy, forceAsync: forceAsync, memberPolicy: memberPolicy, sharedLinkPolicy: sharedLinkPolicy, viewerInfoPolicy: viewerInfoPolicy, accessInheritance: accessInheritance, actions: actions, linkSettings: linkSettings) + let serverArgs = Sharing.ShareFolderArg( + path: path, + aclUpdatePolicy: aclUpdatePolicy, + forceAsync: forceAsync, + memberPolicy: memberPolicy, + sharedLinkPolicy: sharedLinkPolicy, + viewerInfoPolicy: viewerInfoPolicy, + accessInheritance: accessInheritance, + actions: actions, + linkSettings: linkSettings + ) return client.request(route, serverArgs: serverArgs) } /// Transfer ownership of a shared folder to a member of the shared folder. User must have owner in AccessLevel /// access to the shared folder to perform a transfer. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter toDropboxId: A account or team member ID to transfer ownership to. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Sharing.TransferFolderError` object on failure. - @discardableResult open func transferFolder(sharedFolderId: String, toDropboxId: String) -> RpcRequest { + @discardableResult public func transferFolder( + sharedFolderId: String, + toDropboxId: String + ) -> RpcRequest { let route = Sharing.transferFolder let serverArgs = Sharing.TransferFolderArg(sharedFolderId: sharedFolderId, toDropboxId: toDropboxId) return client.request(route, serverArgs: serverArgs) @@ -572,11 +773,13 @@ open class SharingRoutes { /// The current user unmounts the designated folder. They can re-mount the folder at a later time using mountFolder. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Sharing.UnmountFolderError` object on failure. - @discardableResult open func unmountFolder(sharedFolderId: String) -> RpcRequest { + @discardableResult public func unmountFolder(sharedFolderId: String) -> RpcRequest { let route = Sharing.unmountFolder let serverArgs = Sharing.UnmountFolderArg(sharedFolderId: sharedFolderId) return client.request(route, serverArgs: serverArgs) @@ -584,11 +787,13 @@ open class SharingRoutes { /// Remove all members from this file. Does not remove inherited members. /// + /// - scope: sharing.write + /// /// - parameter file: The file to unshare. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Sharing.UnshareFileError` object on failure. - @discardableResult open func unshareFile(file: String) -> RpcRequest { + @discardableResult public func unshareFile(file: String) -> RpcRequest { let route = Sharing.unshareFile let serverArgs = Sharing.UnshareFileArg(file: file) return client.request(route, serverArgs: serverArgs) @@ -597,14 +802,19 @@ open class SharingRoutes { /// Allows a shared folder owner to unshare the folder. You'll need to call checkJobStatus to determine if the /// action has completed successfully. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter leaveACopy: If true, members of this shared folder will get a copy of this folder after it's /// unshared. Otherwise, it will be removed from their Dropbox. The current user, who is an owner, will always /// retain their copy. /// - /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success /// or a `Sharing.UnshareFolderError` object on failure. - @discardableResult open func unshareFolder(sharedFolderId: String, leaveACopy: Bool = false) -> RpcRequest { + @discardableResult public func unshareFolder( + sharedFolderId: String, + leaveACopy: Bool = false + ) -> RpcRequest { let route = Sharing.unshareFolder let serverArgs = Sharing.UnshareFolderArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy) return client.request(route, serverArgs: serverArgs) @@ -612,13 +822,19 @@ open class SharingRoutes { /// Changes a member's access on a shared file. /// + /// - scope: sharing.write + /// /// - parameter file: File for which we are changing a member's access. /// - parameter member: The member whose access we are changing. /// - parameter accessLevel: The new access level for the member. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.MemberAccessLevelResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.MemberAccessLevelResult` object on /// success or a `Sharing.FileMemberActionError` object on failure. - @discardableResult open func updateFileMember(file: String, member: Sharing.MemberSelector, accessLevel: Sharing.AccessLevel) -> RpcRequest { + @discardableResult public func updateFileMember( + file: String, + member: Sharing.MemberSelector, + accessLevel: Sharing.AccessLevel + ) -> RpcRequest { let route = Sharing.updateFileMember let serverArgs = Sharing.UpdateFileMemberArgs(file: file, member: member, accessLevel: accessLevel) return client.request(route, serverArgs: serverArgs) @@ -626,14 +842,20 @@ open class SharingRoutes { /// Allows an owner or editor of a shared folder to update another member's permissions. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter member: The member of the shared folder to update. Only the dropboxId in MemberSelector may be set /// at this time. /// - parameter accessLevel: The new access level for member. owner in AccessLevel is disallowed. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.MemberAccessLevelResult` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.MemberAccessLevelResult` object on /// success or a `Sharing.UpdateFolderMemberError` object on failure. - @discardableResult open func updateFolderMember(sharedFolderId: String, member: Sharing.MemberSelector, accessLevel: Sharing.AccessLevel) -> RpcRequest { + @discardableResult public func updateFolderMember( + sharedFolderId: String, + member: Sharing.MemberSelector, + accessLevel: Sharing.AccessLevel + ) -> RpcRequest { let route = Sharing.updateFolderMember let serverArgs = Sharing.UpdateFolderMemberArg(sharedFolderId: sharedFolderId, member: member, accessLevel: accessLevel) return client.request(route, serverArgs: serverArgs) @@ -642,6 +864,8 @@ open class SharingRoutes { /// Update the sharing policies for a shared folder. User must have owner in AccessLevel access to the shared folder /// to update its policies. /// + /// - scope: sharing.write + /// /// - parameter sharedFolderId: The ID for the shared folder. /// - parameter memberPolicy: Who can be a member of this shared folder. Only applicable if the current user is on a /// team. @@ -651,15 +875,30 @@ open class SharingRoutes { /// The current user must be on a team to set this policy to members in SharedLinkPolicy. /// - parameter linkSettings: Settings on the link for this folder. /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the - /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can perform - /// on the folder. + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. /// - /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on /// success or a `Sharing.UpdateFolderPolicyError` object on failure. - @discardableResult open func updateFolderPolicy(sharedFolderId: String, memberPolicy: Sharing.MemberPolicy? = nil, aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, linkSettings: Sharing.LinkSettings? = nil, actions: Array? = nil) -> RpcRequest { + @discardableResult public func updateFolderPolicy( + sharedFolderId: String, + memberPolicy: Sharing.MemberPolicy? = nil, + aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil, + viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil, + sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil, + linkSettings: Sharing.LinkSettings? = nil, + actions: [Sharing.FolderAction]? = nil + ) -> RpcRequest { let route = Sharing.updateFolderPolicy - let serverArgs = Sharing.UpdateFolderPolicyArg(sharedFolderId: sharedFolderId, memberPolicy: memberPolicy, aclUpdatePolicy: aclUpdatePolicy, viewerInfoPolicy: viewerInfoPolicy, sharedLinkPolicy: sharedLinkPolicy, linkSettings: linkSettings, actions: actions) + let serverArgs = Sharing.UpdateFolderPolicyArg( + sharedFolderId: sharedFolderId, + memberPolicy: memberPolicy, + aclUpdatePolicy: aclUpdatePolicy, + viewerInfoPolicy: viewerInfoPolicy, + sharedLinkPolicy: sharedLinkPolicy, + linkSettings: linkSettings, + actions: actions + ) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/StoneBase.swift b/Source/SwiftyDropbox/Shared/Generated/StoneBase.swift index e81d5708e..7ee7e910c 100644 --- a/Source/SwiftyDropbox/Shared/Generated/StoneBase.swift +++ b/Source/SwiftyDropbox/Shared/Generated/StoneBase.swift @@ -6,7 +6,32 @@ import Foundation // The objects in this file are used by generated code and should not need to be invoked manually. -open class Route { +public enum RouteAuth: String { + case app + case user + case team + case noauth +} + +public enum RouteHost: String { + case api + case content + case notify +} + +public enum RouteStyle: String { + case rpc + case upload + case download +} + +public struct RouteAttributes { + let auth: [RouteAuth] + let host: RouteHost + let style: RouteStyle +} + +public class Route { public let name: String public let version: Int32 public let namespace: String @@ -14,11 +39,18 @@ open class Route JSON { - +public class SerializeUtil { + public class func objectToJSON(_ json: AnyObject) throws -> JSON { switch json { case _ as NSNull: return .null @@ -27,17 +26,17 @@ open class SerializeUtil { case let dict as [String: AnyObject]: var ret = [String: JSON]() for (k, v) in dict { - ret[k] = objectToJSON(v) + ret[k] = try objectToJSON(v) } return .dictionary(ret) case let array as [AnyObject]: - return .array(array.map(objectToJSON)) + return try .array(array.map(objectToJSON)) default: - fatalError("Unknown type trying to parse JSON.") + throw JSONSerializerError.unknownTypeOfJSON(json: json) } } - open class func prepareJSONForSerialization(_ json: JSON) -> AnyObject { + public class func prepareJSONForSerialization(_ json: JSON) -> AnyObject { switch json { case .array(let array): return array.map(prepareJSONForSerialization) as AnyObject @@ -62,89 +61,115 @@ open class SerializeUtil { } } - open class func dumpJSON(_ json: JSON) -> Data? { + public class func dumpJSON(_ json: JSON) throws -> Data? { switch json { case .null: return "null".data(using: String.Encoding.utf8, allowLossyConversion: false) default: let obj: AnyObject = prepareJSONForSerialization(json) if JSONSerialization.isValidJSONObject(obj) { - return try! JSONSerialization.data(withJSONObject: obj, options: JSONSerialization.WritingOptions()) + return try JSONSerialization.data(withJSONObject: obj, options: JSONSerialization.WritingOptions()) } else { - fatalError("Invalid JSON toplevel type") + throw JSONSerializerError.invalidTopLevelType(json: json, object: obj) } } } - open class func parseJSON(_ data: Data) -> JSON { - let obj: AnyObject = try! JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.allowFragments) as AnyObject - return objectToJSON(obj) + public class func parseJSON(_ data: Data) throws -> JSON { + let obj: AnyObject = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.allowFragments) as AnyObject + return try objectToJSON(obj) } } - public protocol JSONSerializer { associatedtype ValueType - func serialize(_: ValueType) -> JSON - func deserialize(_: JSON) -> ValueType + func serialize(_: ValueType) throws -> JSON + func deserialize(_: JSON) throws -> ValueType +} + +enum JSONSerializerError: Error { + case unknownTypeOfJSON(json: AnyObject) + case invalidTopLevelType(json: JSON, object: AnyObject) + case deserializeError(type: T.Type, json: JSON) + case missingOrMalformedFields(json: JSON) + case missingOrMalformedTag(dict: [String: JSON], tag: JSON?) + case unknownTag(type: T.Type, json: JSON, tag: String) + case unexpectedSubtype(type: T.Type, subtype: Any) } -open class VoidSerializer: JSONSerializer { - open func serialize(_ value: Void) -> JSON { - return .null +public class VoidSerializer: JSONSerializer { + public func serialize(_ value: Void) throws -> JSON { + .null } - open func deserialize(_ json: JSON) -> Void { + public func deserialize(_ json: JSON) throws -> Void { switch json { case .null: return default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } - } } - -open class ArraySerializer: JSONSerializer { - +public class ArraySerializer: JSONSerializer { var elementSerializer: T init(_ elementSerializer: T) { self.elementSerializer = elementSerializer } - open func serialize(_ arr: Array) -> JSON { - return .array(arr.map { self.elementSerializer.serialize($0) }) + public func serialize(_ arr: [T.ValueType]) throws -> JSON { + .array(try arr.map { try self.elementSerializer.serialize($0) }) } - open func deserialize(_ json: JSON) -> Array { + public func deserialize(_ json: JSON) throws -> [T.ValueType] { switch json { case .array(let arr): - return arr.map { self.elementSerializer.deserialize($0) } + return try arr.map { try self.elementSerializer.deserialize($0) } + default: + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) + } + } +} + +public class DictionarySerializer: JSONSerializer { + var valueSerializer: T + + init(_ elementSerializer: T) { + self.valueSerializer = elementSerializer + } + + public func serialize(_ dict: [String: T.ValueType]) throws -> JSON { + .dictionary(try dict.mapValues { try self.valueSerializer.serialize($0) }) + } + + public func deserialize(_ json: JSON) throws -> [String: T.ValueType] { + switch json { + case .dictionary(let dict): + return try dict.mapValues { try self.valueSerializer.deserialize($0) } default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class StringSerializer: JSONSerializer { - open func serialize(_ value: String) -> JSON { - return .str(value) +public class StringSerializer: JSONSerializer { + public func serialize(_ value: String) throws -> JSON { + .str(value) } - open func deserialize(_ json: JSON) -> String { - switch (json) { + public func deserialize(_ json: JSON) throws -> String { + switch json { case .str(let s): return s default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class NSDateSerializer: JSONSerializer { - +public class NSDateSerializer: JSONSerializer { var dateFormatter: DateFormatter fileprivate func convertFormat(_ format: String) -> String? { @@ -236,153 +261,174 @@ open class NSDateSerializer: JSONSerializer { return newFormat } - init(_ dateFormat: String) { self.dateFormatter = DateFormatter() - self.dateFormatter.timeZone = TimeZone(identifier: "UTC") - self.dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.dateFormat = self.convertFormat(dateFormat) + dateFormatter.timeZone = TimeZone(identifier: "UTC") + dateFormatter.locale = Locale(identifier: "en_US_POSIX") + dateFormatter.dateFormat = convertFormat(dateFormat) } - open func serialize(_ value: Date) -> JSON { - return .str(self.dateFormatter.string(from: value)) + + public func serialize(_ value: Date) throws -> JSON { + .str(dateFormatter.string(from: value)) } - open func deserialize(_ json: JSON) -> Date { + public func deserialize(_ json: JSON) throws -> Date { switch json { case .str(let s): - return self.dateFormatter.date(from: s)! + guard let date = dateFormatter.date(from: s) else { + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) + } + return date default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class BoolSerializer: JSONSerializer { - open func serialize(_ value: Bool) -> JSON { - return .number(NSNumber(value: value as Bool)) +public class BoolSerializer: JSONSerializer { + public func serialize(_ value: Bool) throws -> JSON { + .number(NSNumber(value: value as Bool)) } - open func deserialize(_ json: JSON) -> Bool { + + public func deserialize(_ json: JSON) throws -> Bool { switch json { case .number(let b): return b.boolValue default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class UInt64Serializer: JSONSerializer { - open func serialize(_ value: UInt64) -> JSON { - return .number(NSNumber(value: value as UInt64)) +public class UInt64Serializer: JSONSerializer { + public func serialize(_ value: UInt64) throws -> JSON { + .number(NSNumber(value: value as UInt64)) } - open func deserialize(_ json: JSON) -> UInt64 { + public func deserialize(_ json: JSON) throws -> UInt64 { switch json { case .number(let n): return n.uint64Value default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class Int64Serializer: JSONSerializer { - open func serialize(_ value: Int64) -> JSON { - return .number(NSNumber(value: value as Int64)) +public class Int64Serializer: JSONSerializer { + public func serialize(_ value: Int64) throws -> JSON { + .number(NSNumber(value: value as Int64)) } - open func deserialize(_ json: JSON) -> Int64 { + public func deserialize(_ json: JSON) throws -> Int64 { switch json { case .number(let n): return n.int64Value default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class Int32Serializer: JSONSerializer { - open func serialize(_ value: Int32) -> JSON { - return .number(NSNumber(value: value as Int32)) +public class Int32Serializer: JSONSerializer { + public func serialize(_ value: Int32) throws -> JSON { + .number(NSNumber(value: value as Int32)) } - open func deserialize(_ json: JSON) -> Int32 { + public func deserialize(_ json: JSON) throws -> Int32 { switch json { case .number(let n): return n.int32Value default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class UInt32Serializer: JSONSerializer { - open func serialize(_ value: UInt32) -> JSON { - return .number(NSNumber(value: value as UInt32)) + +public class UInt32Serializer: JSONSerializer { + public func serialize(_ value: UInt32) throws -> JSON { + .number(NSNumber(value: value as UInt32)) } - open func deserialize(_ json: JSON) -> UInt32 { + public func deserialize(_ json: JSON) throws -> UInt32 { switch json { case .number(let n): return n.uint32Value default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class NSDataSerializer: JSONSerializer { - open func serialize(_ value: Data) -> JSON { - return .str(value.base64EncodedString(options: [])) +public class NSDataSerializer: JSONSerializer { + public func serialize(_ value: Data) throws -> JSON { + .str(value.base64EncodedString(options: [])) } - open func deserialize(_ json: JSON) -> Data { - switch(json) { + public func deserialize(_ json: JSON) throws -> Data { + switch json { case .str(let s): - return Data(base64Encoded: s, options: [])! + guard let data = Data(base64Encoded: s, options: []) else { + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) + } + return data default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } -open class DoubleSerializer: JSONSerializer { - open func serialize(_ value: Double) -> JSON { - return .number(NSNumber(value: value as Double)) +public class FloatSerializer: JSONSerializer { + public func serialize(_ value: Float) throws -> JSON { + .number(NSNumber(value: value as Float)) } - open func deserialize(_ json: JSON) -> Double { + public func deserialize(_ json: JSON) throws -> Float { switch json { case .number(let n): - return n.doubleValue + return n.floatValue default: - fatalError("Type error deserializing") + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) } } } +public class DoubleSerializer: JSONSerializer { + public func serialize(_ value: Double) throws -> JSON { + .number(NSNumber(value: value as Double)) + } -open class NullableSerializer: JSONSerializer { + public func deserialize(_ json: JSON) throws -> Double { + switch json { + case .number(let n): + return n.doubleValue + default: + throw JSONSerializerError.deserializeError(type: ValueType.self, json: json) + } + } +} +public class NullableSerializer: JSONSerializer { var internalSerializer: T init(_ serializer: T) { self.internalSerializer = serializer } - open func serialize(_ value: Optional) -> JSON { + public func serialize(_ value: T.ValueType?) throws -> JSON { if let v = value { - return internalSerializer.serialize(v) + return try internalSerializer.serialize(v) } else { return .null } } - open func deserialize(_ json: JSON) -> Optional { + public func deserialize(_ json: JSON) throws -> T.ValueType? { switch json { case .null: return nil default: - return internalSerializer.deserialize(json) + return try internalSerializer.deserialize(json) } } } @@ -397,19 +443,25 @@ struct Serialization { static var _VoidSerializer = VoidSerializer() static var _NSDataSerializer = NSDataSerializer() + static var _FloatSerializer = FloatSerializer() static var _DoubleSerializer = DoubleSerializer() - static func getFields(_ json: JSON) -> [String: JSON] { + static func getFields(_ json: JSON) throws -> [String: JSON] { switch json { - case .dictionary(let dict): - return dict - default: - fatalError("Type error") + case .dictionary(let dict): + return dict + default: + throw JSONSerializerError.missingOrMalformedFields(json: json) } } - static func getTag(_ d: [String: JSON]) -> String { - return _StringSerializer.deserialize(d[".tag"]!) + static func getTag(_ d: [String: JSON]) throws -> String { + let tag = d[".tag"] + switch tag { + case .str(let str): + return str + default: + throw JSONSerializerError.missingOrMalformedTag(dict: d, tag: tag) + } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/StoneValidators.swift b/Source/SwiftyDropbox/Shared/Generated/StoneValidators.swift index 2929f77d6..d79852487 100644 --- a/Source/SwiftyDropbox/Shared/Generated/StoneValidators.swift +++ b/Source/SwiftyDropbox/Shared/Generated/StoneValidators.swift @@ -12,8 +12,8 @@ public func setAssertFunc(_ assertFunc: @escaping (Bool, String) -> Void) { _assertFunc = assertFunc } -public func arrayValidator(minItems: Int? = nil, maxItems: Int? = nil, itemValidator: @escaping (T) -> Void) -> (Array) -> Void { - return { (value: Array) -> Void in +public func arrayValidator(minItems: Int? = nil, maxItems: Int? = nil, itemValidator: @escaping (T) -> Void) -> ([T]) -> Void { + { (value: [T]) -> Void in if let minItems = minItems { _assertFunc(value.count >= minItems, "\(value) must have at least \(minItems) items") } @@ -29,7 +29,7 @@ public func arrayValidator(minItems: Int? = nil, maxItems: Int? = nil, itemVa } public func stringValidator(minLength: Int? = nil, maxLength: Int? = nil, pattern: String? = nil) -> (String) -> Void { - return { (value: String) -> Void in + { (value: String) -> Void in let length = value.count if let minLength = minLength { _assertFunc(length >= minLength, "\"\(value)\" must be at least \(minLength) characters") @@ -48,7 +48,7 @@ public func stringValidator(minLength: Int? = nil, maxLength: Int? = nil, patter } public func comparableValidator(minValue: T? = nil, maxValue: T? = nil) -> (T) -> Void { - return { (value: T) -> Void in + { (value: T) -> Void in if let minValue = minValue { _assertFunc(minValue <= value, "\(value) must be at least \(minValue)") } @@ -60,7 +60,7 @@ public func comparableValidator(minValue: T? = nil, maxValue: T? } public func nullableValidator(_ internalValidator: @escaping (T) -> Void) -> (T?) -> Void { - return { (value: T?) -> Void in + { (value: T?) -> Void in if let value = value { internalValidator(value) } @@ -68,7 +68,7 @@ public func nullableValidator(_ internalValidator: @escaping (T) -> Void) -> } public func binaryValidator(minLength: Int?, maxLength: Int?) -> (Data) -> Void { - return { (value: Data) -> Void in + { (value: Data) -> Void in let length = value.count if let minLength = minLength { _assertFunc(length >= minLength, "\"\(value)\" must be at least \(minLength) bytes") diff --git a/Source/SwiftyDropbox/Shared/Generated/Team.swift b/Source/SwiftyDropbox/Shared/Generated/Team.swift index 9a10cf5b4..2cf40989d 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Team.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Team.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the team namespace -open class Team { +public class Team { /// The DeviceSession struct - open class DeviceSession: CustomStringConvertible { + public class DeviceSession: CustomStringConvertible, JSONRepresentable { /// The session id. public let sessionId: String /// The IP address of the last activity from this session. @@ -30,39 +30,50 @@ open class Team { self.created = created self.updated = updated } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceSessionSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceSessionSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceSessionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceSession: \(error)" + } } } - open class DeviceSessionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceSession) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "country": NullableSerializer(Serialization._StringSerializer).serialize(value.country), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + + public class DeviceSessionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceSession) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "country": try NullableSerializer(Serialization._StringSerializer).serialize(value.country), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceSession { + + public func deserialize(_ json: JSON) throws -> DeviceSession { switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let country = NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - return DeviceSession(sessionId: sessionId, ipAddress: ipAddress, country: country, created: created, updated: updated) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let country = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + return DeviceSession(sessionId: sessionId, ipAddress: ipAddress, country: country, created: created, updated: updated) + default: + throw JSONSerializerError.deserializeError(type: DeviceSession.self, json: json) } } } /// Information on active web sessions. - open class ActiveWebSession: Team.DeviceSession { + public class ActiveWebSession: Team.DeviceSession { /// Information on the hosting device. public let userAgent: String /// Information on the hosting operating system. @@ -71,7 +82,17 @@ open class Team { public let browser: String /// The time this session expires. public let expires: Date? - public init(sessionId: String, userAgent: String, os: String, browser: String, ipAddress: String? = nil, country: String? = nil, created: Date? = nil, updated: Date? = nil, expires: Date? = nil) { + public init( + sessionId: String, + userAgent: String, + os: String, + browser: String, + ipAddress: String? = nil, + country: String? = nil, + created: Date? = nil, + updated: Date? = nil, + expires: Date? = nil + ) { stringValidator()(userAgent) self.userAgent = userAgent stringValidator()(os) @@ -81,49 +102,66 @@ open class Team { self.expires = expires super.init(sessionId: sessionId, ipAddress: ipAddress, country: country, created: created, updated: updated) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ActiveWebSessionSerializer().serialize(self)))" - } - } - open class ActiveWebSessionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ActiveWebSession) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), - "user_agent": Serialization._StringSerializer.serialize(value.userAgent), - "os": Serialization._StringSerializer.serialize(value.os), - "browser": Serialization._StringSerializer.serialize(value.browser), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "country": NullableSerializer(Serialization._StringSerializer).serialize(value.country), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), - "expires": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> ActiveWebSession { - switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - let userAgent = Serialization._StringSerializer.deserialize(dict["user_agent"] ?? .null) - let os = Serialization._StringSerializer.deserialize(dict["os"] ?? .null) - let browser = Serialization._StringSerializer.deserialize(dict["browser"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let country = NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - let expires = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) - return ActiveWebSession(sessionId: sessionId, userAgent: userAgent, os: os, browser: browser, ipAddress: ipAddress, country: country, created: created, updated: updated, expires: expires) - default: - fatalError("Type error deserializing") + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ActiveWebSessionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ActiveWebSession: \(error)" + } + } + } + + public class ActiveWebSessionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ActiveWebSession) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), + "user_agent": try Serialization._StringSerializer.serialize(value.userAgent), + "os": try Serialization._StringSerializer.serialize(value.os), + "browser": try Serialization._StringSerializer.serialize(value.browser), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "country": try NullableSerializer(Serialization._StringSerializer).serialize(value.country), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + "expires": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.expires), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> ActiveWebSession { + switch json { + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + let userAgent = try Serialization._StringSerializer.deserialize(dict["user_agent"] ?? .null) + let os = try Serialization._StringSerializer.deserialize(dict["os"] ?? .null) + let browser = try Serialization._StringSerializer.deserialize(dict["browser"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let country = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + let expires = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["expires"] ?? .null) + return ActiveWebSession( + sessionId: sessionId, + userAgent: userAgent, + os: os, + browser: browser, + ipAddress: ipAddress, + country: country, + created: created, + updated: updated, + expires: expires + ) + default: + throw JSONSerializerError.deserializeError(type: ActiveWebSession.self, json: json) } } } /// Result of trying to add a secondary email to a user. 'success' is the only value indicating that a secondary - /// email was successfully added to a user. The other values explain the type of error that occurred, and include - /// the email for which the error occurred. - public enum AddSecondaryEmailResult: CustomStringConvertible { + /// email was successfully added to a user. The other values explain the type of error that occurred, and + /// include the email for which the error occurred. + public enum AddSecondaryEmailResult: CustomStringConvertible, JSONRepresentable { /// Describes a secondary email that was successfully added to a user. case success(SecondaryEmails.SecondaryEmail) /// Secondary email is not available to be claimed by the user. @@ -145,131 +183,152 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try AddSecondaryEmailResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddSecondaryEmailResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddSecondaryEmailResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddSecondaryEmailResult: \(error)" + } } } - open class AddSecondaryEmailResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddSecondaryEmailResult) -> JSON { + + public class AddSecondaryEmailResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddSecondaryEmailResult) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(SecondaryEmails.SecondaryEmailSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .unavailable(let arg): - var d = ["unavailable": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("unavailable") - return .dictionary(d) - case .alreadyPending(let arg): - var d = ["already_pending": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("already_pending") - return .dictionary(d) - case .alreadyOwnedByUser(let arg): - var d = ["already_owned_by_user": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("already_owned_by_user") - return .dictionary(d) - case .reachedLimit(let arg): - var d = ["reached_limit": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("reached_limit") - return .dictionary(d) - case .transientError(let arg): - var d = ["transient_error": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("transient_error") - return .dictionary(d) - case .tooManyUpdates(let arg): - var d = ["too_many_updates": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("too_many_updates") - return .dictionary(d) - case .unknownError(let arg): - var d = ["unknown_error": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("unknown_error") - return .dictionary(d) - case .rateLimited(let arg): - var d = ["rate_limited": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("rate_limited") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddSecondaryEmailResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = SecondaryEmails.SecondaryEmailSerializer().deserialize(json) - return AddSecondaryEmailResult.success(v) - case "unavailable": - let v = Serialization._StringSerializer.deserialize(d["unavailable"] ?? .null) - return AddSecondaryEmailResult.unavailable(v) - case "already_pending": - let v = Serialization._StringSerializer.deserialize(d["already_pending"] ?? .null) - return AddSecondaryEmailResult.alreadyPending(v) - case "already_owned_by_user": - let v = Serialization._StringSerializer.deserialize(d["already_owned_by_user"] ?? .null) - return AddSecondaryEmailResult.alreadyOwnedByUser(v) - case "reached_limit": - let v = Serialization._StringSerializer.deserialize(d["reached_limit"] ?? .null) - return AddSecondaryEmailResult.reachedLimit(v) - case "transient_error": - let v = Serialization._StringSerializer.deserialize(d["transient_error"] ?? .null) - return AddSecondaryEmailResult.transientError(v) - case "too_many_updates": - let v = Serialization._StringSerializer.deserialize(d["too_many_updates"] ?? .null) - return AddSecondaryEmailResult.tooManyUpdates(v) - case "unknown_error": - let v = Serialization._StringSerializer.deserialize(d["unknown_error"] ?? .null) - return AddSecondaryEmailResult.unknownError(v) - case "rate_limited": - let v = Serialization._StringSerializer.deserialize(d["rate_limited"] ?? .null) - return AddSecondaryEmailResult.rateLimited(v) - case "other": - return AddSecondaryEmailResult.other - default: - return AddSecondaryEmailResult.other - } - default: - fatalError("Failed to deserialize") + case .success(let arg): + var d = try Serialization.getFields(SecondaryEmails.SecondaryEmailSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .unavailable(let arg): + var d = try ["unavailable": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("unavailable") + return .dictionary(d) + case .alreadyPending(let arg): + var d = try ["already_pending": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("already_pending") + return .dictionary(d) + case .alreadyOwnedByUser(let arg): + var d = try ["already_owned_by_user": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("already_owned_by_user") + return .dictionary(d) + case .reachedLimit(let arg): + var d = try ["reached_limit": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("reached_limit") + return .dictionary(d) + case .transientError(let arg): + var d = try ["transient_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("transient_error") + return .dictionary(d) + case .tooManyUpdates(let arg): + var d = try ["too_many_updates": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("too_many_updates") + return .dictionary(d) + case .unknownError(let arg): + var d = try ["unknown_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("unknown_error") + return .dictionary(d) + case .rateLimited(let arg): + var d = try ["rate_limited": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("rate_limited") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddSecondaryEmailResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try SecondaryEmails.SecondaryEmailSerializer().deserialize(json) + return AddSecondaryEmailResult.success(v) + case "unavailable": + let v = try Serialization._StringSerializer.deserialize(d["unavailable"] ?? .null) + return AddSecondaryEmailResult.unavailable(v) + case "already_pending": + let v = try Serialization._StringSerializer.deserialize(d["already_pending"] ?? .null) + return AddSecondaryEmailResult.alreadyPending(v) + case "already_owned_by_user": + let v = try Serialization._StringSerializer.deserialize(d["already_owned_by_user"] ?? .null) + return AddSecondaryEmailResult.alreadyOwnedByUser(v) + case "reached_limit": + let v = try Serialization._StringSerializer.deserialize(d["reached_limit"] ?? .null) + return AddSecondaryEmailResult.reachedLimit(v) + case "transient_error": + let v = try Serialization._StringSerializer.deserialize(d["transient_error"] ?? .null) + return AddSecondaryEmailResult.transientError(v) + case "too_many_updates": + let v = try Serialization._StringSerializer.deserialize(d["too_many_updates"] ?? .null) + return AddSecondaryEmailResult.tooManyUpdates(v) + case "unknown_error": + let v = try Serialization._StringSerializer.deserialize(d["unknown_error"] ?? .null) + return AddSecondaryEmailResult.unknownError(v) + case "rate_limited": + let v = try Serialization._StringSerializer.deserialize(d["rate_limited"] ?? .null) + return AddSecondaryEmailResult.rateLimited(v) + case "other": + return AddSecondaryEmailResult.other + default: + return AddSecondaryEmailResult.other + } + default: + throw JSONSerializerError.deserializeError(type: AddSecondaryEmailResult.self, json: json) } } } /// The AddSecondaryEmailsArg struct - open class AddSecondaryEmailsArg: CustomStringConvertible { + public class AddSecondaryEmailsArg: CustomStringConvertible, JSONRepresentable { /// List of users and secondary emails to add. - public let newSecondaryEmails: Array - public init(newSecondaryEmails: Array) { + public let newSecondaryEmails: [Team.UserSecondaryEmailsArg] + public init(newSecondaryEmails: [Team.UserSecondaryEmailsArg]) { self.newSecondaryEmails = newSecondaryEmails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddSecondaryEmailsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddSecondaryEmailsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddSecondaryEmailsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddSecondaryEmailsArg: \(error)" + } } } - open class AddSecondaryEmailsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddSecondaryEmailsArg) -> JSON { - let output = [ - "new_secondary_emails": ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).serialize(value.newSecondaryEmails), + + public class AddSecondaryEmailsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddSecondaryEmailsArg) throws -> JSON { + let output = [ + "new_secondary_emails": try ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).serialize(value.newSecondaryEmails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddSecondaryEmailsArg { + + public func deserialize(_ json: JSON) throws -> AddSecondaryEmailsArg { switch json { - case .dictionary(let dict): - let newSecondaryEmails = ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).deserialize(dict["new_secondary_emails"] ?? .null) - return AddSecondaryEmailsArg(newSecondaryEmails: newSecondaryEmails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newSecondaryEmails = try ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).deserialize(dict["new_secondary_emails"] ?? .null) + return AddSecondaryEmailsArg(newSecondaryEmails: newSecondaryEmails) + default: + throw JSONSerializerError.deserializeError(type: AddSecondaryEmailsArg.self, json: json) } } } /// Error returned when adding secondary emails fails. - public enum AddSecondaryEmailsError: CustomStringConvertible { + public enum AddSecondaryEmailsError: CustomStringConvertible, JSONRepresentable { /// Secondary emails are disabled for the team. case secondaryEmailsDisabled /// A maximum of 20 secondary emails can be added in a single call. @@ -277,80 +336,101 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try AddSecondaryEmailsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddSecondaryEmailsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddSecondaryEmailsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddSecondaryEmailsError: \(error)" + } } } - open class AddSecondaryEmailsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddSecondaryEmailsError) -> JSON { + + public class AddSecondaryEmailsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddSecondaryEmailsError) throws -> JSON { switch value { - case .secondaryEmailsDisabled: - var d = [String: JSON]() - d[".tag"] = .str("secondary_emails_disabled") - return .dictionary(d) - case .tooManyEmails: - var d = [String: JSON]() - d[".tag"] = .str("too_many_emails") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AddSecondaryEmailsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "secondary_emails_disabled": - return AddSecondaryEmailsError.secondaryEmailsDisabled - case "too_many_emails": - return AddSecondaryEmailsError.tooManyEmails - case "other": - return AddSecondaryEmailsError.other - default: - return AddSecondaryEmailsError.other - } + case .secondaryEmailsDisabled: + var d = [String: JSON]() + d[".tag"] = .str("secondary_emails_disabled") + return .dictionary(d) + case .tooManyEmails: + var d = [String: JSON]() + d[".tag"] = .str("too_many_emails") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AddSecondaryEmailsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "secondary_emails_disabled": + return AddSecondaryEmailsError.secondaryEmailsDisabled + case "too_many_emails": + return AddSecondaryEmailsError.tooManyEmails + case "other": + return AddSecondaryEmailsError.other default: - fatalError("Failed to deserialize") + return AddSecondaryEmailsError.other + } + default: + throw JSONSerializerError.deserializeError(type: AddSecondaryEmailsError.self, json: json) } } } /// The AddSecondaryEmailsResult struct - open class AddSecondaryEmailsResult: CustomStringConvertible { + public class AddSecondaryEmailsResult: CustomStringConvertible, JSONRepresentable { /// List of users and secondary email results. - public let results: Array - public init(results: Array) { + public let results: [Team.UserAddResult] + public init(results: [Team.UserAddResult]) { self.results = results } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AddSecondaryEmailsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try AddSecondaryEmailsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AddSecondaryEmailsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AddSecondaryEmailsResult: \(error)" + } } } - open class AddSecondaryEmailsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AddSecondaryEmailsResult) -> JSON { - let output = [ - "results": ArraySerializer(Team.UserAddResultSerializer()).serialize(value.results), + + public class AddSecondaryEmailsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AddSecondaryEmailsResult) throws -> JSON { + let output = [ + "results": try ArraySerializer(Team.UserAddResultSerializer()).serialize(value.results), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AddSecondaryEmailsResult { + + public func deserialize(_ json: JSON) throws -> AddSecondaryEmailsResult { switch json { - case .dictionary(let dict): - let results = ArraySerializer(Team.UserAddResultSerializer()).deserialize(dict["results"] ?? .null) - return AddSecondaryEmailsResult(results: results) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let results = try ArraySerializer(Team.UserAddResultSerializer()).deserialize(dict["results"] ?? .null) + return AddSecondaryEmailsResult(results: results) + default: + throw JSONSerializerError.deserializeError(type: AddSecondaryEmailsResult.self, json: json) } } } /// Describes which team-related admin permissions a user has. - public enum AdminTier: CustomStringConvertible { + public enum AdminTier: CustomStringConvertible, JSONRepresentable { /// User is an administrator of the team - has all permissions. case teamAdmin /// User can do most user provisioning, de-provisioning and management. @@ -361,56 +441,66 @@ open class Team { /// User is not an admin of the team. case memberOnly + func json() throws -> JSON { + try AdminTierSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminTierSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminTierSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminTier: \(error)" + } } } - open class AdminTierSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminTier) -> JSON { + + public class AdminTierSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminTier) throws -> JSON { switch value { - case .teamAdmin: - var d = [String: JSON]() - d[".tag"] = .str("team_admin") - return .dictionary(d) - case .userManagementAdmin: - var d = [String: JSON]() - d[".tag"] = .str("user_management_admin") - return .dictionary(d) - case .supportAdmin: - var d = [String: JSON]() - d[".tag"] = .str("support_admin") - return .dictionary(d) - case .memberOnly: - var d = [String: JSON]() - d[".tag"] = .str("member_only") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminTier { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team_admin": - return AdminTier.teamAdmin - case "user_management_admin": - return AdminTier.userManagementAdmin - case "support_admin": - return AdminTier.supportAdmin - case "member_only": - return AdminTier.memberOnly - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .teamAdmin: + var d = [String: JSON]() + d[".tag"] = .str("team_admin") + return .dictionary(d) + case .userManagementAdmin: + var d = [String: JSON]() + d[".tag"] = .str("user_management_admin") + return .dictionary(d) + case .supportAdmin: + var d = [String: JSON]() + d[".tag"] = .str("support_admin") + return .dictionary(d) + case .memberOnly: + var d = [String: JSON]() + d[".tag"] = .str("member_only") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminTier { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team_admin": + return AdminTier.teamAdmin + case "user_management_admin": + return AdminTier.userManagementAdmin + case "support_admin": + return AdminTier.supportAdmin + case "member_only": + return AdminTier.memberOnly + default: + throw JSONSerializerError.unknownTag(type: AdminTier.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: AdminTier.self, json: json) } } } /// Information on linked third party applications. - open class ApiApp: CustomStringConvertible { + public class ApiApp: CustomStringConvertible, JSONRepresentable { /// The application unique id. public let appId: String /// The application name. @@ -435,72 +525,94 @@ open class Team { self.linked = linked self.isAppFolder = isAppFolder } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ApiAppSerializer().serialize(self)))" + + func json() throws -> JSON { + try ApiAppSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ApiAppSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ApiApp: \(error)" + } } } - open class ApiAppSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ApiApp) -> JSON { - let output = [ - "app_id": Serialization._StringSerializer.serialize(value.appId), - "app_name": Serialization._StringSerializer.serialize(value.appName), - "is_app_folder": Serialization._BoolSerializer.serialize(value.isAppFolder), - "publisher": NullableSerializer(Serialization._StringSerializer).serialize(value.publisher), - "publisher_url": NullableSerializer(Serialization._StringSerializer).serialize(value.publisherUrl), - "linked": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.linked), + + public class ApiAppSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ApiApp) throws -> JSON { + let output = [ + "app_id": try Serialization._StringSerializer.serialize(value.appId), + "app_name": try Serialization._StringSerializer.serialize(value.appName), + "is_app_folder": try Serialization._BoolSerializer.serialize(value.isAppFolder), + "publisher": try NullableSerializer(Serialization._StringSerializer).serialize(value.publisher), + "publisher_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.publisherUrl), + "linked": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.linked), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ApiApp { + + public func deserialize(_ json: JSON) throws -> ApiApp { switch json { - case .dictionary(let dict): - let appId = Serialization._StringSerializer.deserialize(dict["app_id"] ?? .null) - let appName = Serialization._StringSerializer.deserialize(dict["app_name"] ?? .null) - let isAppFolder = Serialization._BoolSerializer.deserialize(dict["is_app_folder"] ?? .null) - let publisher = NullableSerializer(Serialization._StringSerializer).deserialize(dict["publisher"] ?? .null) - let publisherUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["publisher_url"] ?? .null) - let linked = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["linked"] ?? .null) - return ApiApp(appId: appId, appName: appName, isAppFolder: isAppFolder, publisher: publisher, publisherUrl: publisherUrl, linked: linked) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appId = try Serialization._StringSerializer.deserialize(dict["app_id"] ?? .null) + let appName = try Serialization._StringSerializer.deserialize(dict["app_name"] ?? .null) + let isAppFolder = try Serialization._BoolSerializer.deserialize(dict["is_app_folder"] ?? .null) + let publisher = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["publisher"] ?? .null) + let publisherUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["publisher_url"] ?? .null) + let linked = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["linked"] ?? .null) + return ApiApp(appId: appId, appName: appName, isAppFolder: isAppFolder, publisher: publisher, publisherUrl: publisherUrl, linked: linked) + default: + throw JSONSerializerError.deserializeError(type: ApiApp.self, json: json) } } } /// Base report structure. - open class BaseDfbReport: CustomStringConvertible { + public class BaseDfbReport: CustomStringConvertible, JSONRepresentable { /// First date present in the results as 'YYYY-MM-DD' or None. public let startDate: String public init(startDate: String) { stringValidator()(startDate) self.startDate = startDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BaseDfbReportSerializer().serialize(self)))" + + func json() throws -> JSON { + try BaseDfbReportSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BaseDfbReportSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BaseDfbReport: \(error)" + } } } - open class BaseDfbReportSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BaseDfbReport) -> JSON { - let output = [ - "start_date": Serialization._StringSerializer.serialize(value.startDate), + + public class BaseDfbReportSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BaseDfbReport) throws -> JSON { + let output = [ + "start_date": try Serialization._StringSerializer.serialize(value.startDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BaseDfbReport { + + public func deserialize(_ json: JSON) throws -> BaseDfbReport { switch json { - case .dictionary(let dict): - let startDate = Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) - return BaseDfbReport(startDate: startDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) + return BaseDfbReport(startDate: startDate) + default: + throw JSONSerializerError.deserializeError(type: BaseDfbReport.self, json: json) } } } /// Base error that all errors for existing team folders should extend. - public enum BaseTeamFolderError: CustomStringConvertible { + public enum BaseTeamFolderError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Team.TeamFolderAccessError) /// An unspecified error. @@ -510,102 +622,122 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try BaseTeamFolderErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BaseTeamFolderErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BaseTeamFolderErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BaseTeamFolderError: \(error)" + } } } - open class BaseTeamFolderErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BaseTeamFolderError) -> JSON { + + public class BaseTeamFolderErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BaseTeamFolderError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .statusError(let arg): - var d = ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] - d[".tag"] = .str("status_error") - return .dictionary(d) - case .teamSharedDropboxError(let arg): - var d = ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] - d[".tag"] = .str("team_shared_dropbox_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> BaseTeamFolderError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return BaseTeamFolderError.accessError(v) - case "status_error": - let v = Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) - return BaseTeamFolderError.statusError(v) - case "team_shared_dropbox_error": - let v = Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) - return BaseTeamFolderError.teamSharedDropboxError(v) - case "other": - return BaseTeamFolderError.other - default: - return BaseTeamFolderError.other - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .statusError(let arg): + var d = try ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] + d[".tag"] = .str("status_error") + return .dictionary(d) + case .teamSharedDropboxError(let arg): + var d = try ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] + d[".tag"] = .str("team_shared_dropbox_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> BaseTeamFolderError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return BaseTeamFolderError.accessError(v) + case "status_error": + let v = try Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) + return BaseTeamFolderError.statusError(v) + case "team_shared_dropbox_error": + let v = try Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) + return BaseTeamFolderError.teamSharedDropboxError(v) + case "other": + return BaseTeamFolderError.other + default: + return BaseTeamFolderError.other + } + default: + throw JSONSerializerError.deserializeError(type: BaseTeamFolderError.self, json: json) } } } /// Error returned when getting member custom quota. - public enum CustomQuotaError: CustomStringConvertible { + public enum CustomQuotaError: CustomStringConvertible, JSONRepresentable { /// A maximum of 1000 users can be set for a single call. case tooManyUsers /// An unspecified error. case other + func json() throws -> JSON { + try CustomQuotaErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CustomQuotaErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CustomQuotaErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CustomQuotaError: \(error)" + } } } - open class CustomQuotaErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CustomQuotaError) -> JSON { + + public class CustomQuotaErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CustomQuotaError) throws -> JSON { switch value { - case .tooManyUsers: - var d = [String: JSON]() - d[".tag"] = .str("too_many_users") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CustomQuotaError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "too_many_users": - return CustomQuotaError.tooManyUsers - case "other": - return CustomQuotaError.other - default: - return CustomQuotaError.other - } + case .tooManyUsers: + var d = [String: JSON]() + d[".tag"] = .str("too_many_users") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CustomQuotaError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "too_many_users": + return CustomQuotaError.tooManyUsers + case "other": + return CustomQuotaError.other default: - fatalError("Failed to deserialize") + return CustomQuotaError.other + } + default: + throw JSONSerializerError.deserializeError(type: CustomQuotaError.self, json: json) } } } /// User custom quota. - public enum CustomQuotaResult: CustomStringConvertible { + public enum CustomQuotaResult: CustomStringConvertible, JSONRepresentable { /// User's custom quota. case success(Team.UserCustomQuotaResult) /// Invalid user (not in team). @@ -613,82 +745,103 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try CustomQuotaResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CustomQuotaResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CustomQuotaResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CustomQuotaResult: \(error)" + } } } - open class CustomQuotaResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CustomQuotaResult) -> JSON { + + public class CustomQuotaResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CustomQuotaResult) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Team.UserCustomQuotaResultSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .invalidUser(let arg): - var d = ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("invalid_user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CustomQuotaResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Team.UserCustomQuotaResultSerializer().deserialize(json) - return CustomQuotaResult.success(v) - case "invalid_user": - let v = Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) - return CustomQuotaResult.invalidUser(v) - case "other": - return CustomQuotaResult.other - default: - return CustomQuotaResult.other - } + case .success(let arg): + var d = try Serialization.getFields(Team.UserCustomQuotaResultSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .invalidUser(let arg): + var d = try ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("invalid_user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CustomQuotaResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Team.UserCustomQuotaResultSerializer().deserialize(json) + return CustomQuotaResult.success(v) + case "invalid_user": + let v = try Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) + return CustomQuotaResult.invalidUser(v) + case "other": + return CustomQuotaResult.other default: - fatalError("Failed to deserialize") + return CustomQuotaResult.other + } + default: + throw JSONSerializerError.deserializeError(type: CustomQuotaResult.self, json: json) } } } /// The CustomQuotaUsersArg struct - open class CustomQuotaUsersArg: CustomStringConvertible { + public class CustomQuotaUsersArg: CustomStringConvertible, JSONRepresentable { /// List of users. - public let users: Array - public init(users: Array) { + public let users: [Team.UserSelectorArg] + public init(users: [Team.UserSelectorArg]) { self.users = users } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CustomQuotaUsersArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try CustomQuotaUsersArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CustomQuotaUsersArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CustomQuotaUsersArg: \(error)" + } } } - open class CustomQuotaUsersArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CustomQuotaUsersArg) -> JSON { - let output = [ - "users": ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.users), + + public class CustomQuotaUsersArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CustomQuotaUsersArg) throws -> JSON { + let output = [ + "users": try ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.users), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CustomQuotaUsersArg { + + public func deserialize(_ json: JSON) throws -> CustomQuotaUsersArg { switch json { - case .dictionary(let dict): - let users = ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["users"] ?? .null) - return CustomQuotaUsersArg(users: users) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let users = try ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["users"] ?? .null) + return CustomQuotaUsersArg(users: users) + default: + throw JSONSerializerError.deserializeError(type: CustomQuotaUsersArg.self, json: json) } } } /// Input arguments that can be provided for most reports. - open class DateRange: CustomStringConvertible { + public class DateRange: CustomStringConvertible, JSONRepresentable { /// Optional starting date (inclusive). If start_date is None or too long ago, this field will be set to 6 /// months ago. public let startDate: Date? @@ -698,70 +851,91 @@ open class Team { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DateRangeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DateRangeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DateRangeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DateRange: \(error)" + } } } - open class DateRangeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DateRange) -> JSON { - let output = [ - "start_date": NullableSerializer(NSDateSerializer("%Y-%m-%d")).serialize(value.startDate), - "end_date": NullableSerializer(NSDateSerializer("%Y-%m-%d")).serialize(value.endDate), + + public class DateRangeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DateRange) throws -> JSON { + let output = [ + "start_date": try NullableSerializer(NSDateSerializer("%Y-%m-%d")).serialize(value.startDate), + "end_date": try NullableSerializer(NSDateSerializer("%Y-%m-%d")).serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DateRange { + + public func deserialize(_ json: JSON) throws -> DateRange { switch json { - case .dictionary(let dict): - let startDate = NullableSerializer(NSDateSerializer("%Y-%m-%d")).deserialize(dict["start_date"] ?? .null) - let endDate = NullableSerializer(NSDateSerializer("%Y-%m-%d")).deserialize(dict["end_date"] ?? .null) - return DateRange(startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try NullableSerializer(NSDateSerializer("%Y-%m-%d")).deserialize(dict["start_date"] ?? .null) + let endDate = try NullableSerializer(NSDateSerializer("%Y-%m-%d")).deserialize(dict["end_date"] ?? .null) + return DateRange(startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: DateRange.self, json: json) } } } /// Errors that can originate from problems in input arguments to reports. - public enum DateRangeError: CustomStringConvertible { + public enum DateRangeError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case other + func json() throws -> JSON { + try DateRangeErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DateRangeErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DateRangeErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DateRangeError: \(error)" + } } } - open class DateRangeErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DateRangeError) -> JSON { + + public class DateRangeErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DateRangeError) throws -> JSON { switch value { - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DateRangeError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "other": - return DateRangeError.other - default: - return DateRangeError.other - } + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DateRangeError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "other": + return DateRangeError.other default: - fatalError("Failed to deserialize") + return DateRangeError.other + } + default: + throw JSONSerializerError.deserializeError(type: DateRangeError.self, json: json) } } } /// Result of trying to delete a secondary email address. 'success' is the only value indicating that a secondary - /// email was successfully deleted. The other values explain the type of error that occurred, and include the email - /// for which the error occurred. - public enum DeleteSecondaryEmailResult: CustomStringConvertible { + /// email was successfully deleted. The other values explain the type of error that occurred, and include the + /// email for which the error occurred. + public enum DeleteSecondaryEmailResult: CustomStringConvertible, JSONRepresentable { /// The secondary email was successfully deleted. case success(String) /// The email address was not found for the user. @@ -771,119 +945,151 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try DeleteSecondaryEmailResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteSecondaryEmailResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteSecondaryEmailResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteSecondaryEmailResult: \(error)" + } } } - open class DeleteSecondaryEmailResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteSecondaryEmailResult) -> JSON { + + public class DeleteSecondaryEmailResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteSecondaryEmailResult) throws -> JSON { switch value { - case .success(let arg): - var d = ["success": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("success") - return .dictionary(d) - case .notFound(let arg): - var d = ["not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("not_found") - return .dictionary(d) - case .cannotRemovePrimary(let arg): - var d = ["cannot_remove_primary": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("cannot_remove_primary") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeleteSecondaryEmailResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Serialization._StringSerializer.deserialize(d["success"] ?? .null) - return DeleteSecondaryEmailResult.success(v) - case "not_found": - let v = Serialization._StringSerializer.deserialize(d["not_found"] ?? .null) - return DeleteSecondaryEmailResult.notFound(v) - case "cannot_remove_primary": - let v = Serialization._StringSerializer.deserialize(d["cannot_remove_primary"] ?? .null) - return DeleteSecondaryEmailResult.cannotRemovePrimary(v) - case "other": - return DeleteSecondaryEmailResult.other - default: - return DeleteSecondaryEmailResult.other - } - default: - fatalError("Failed to deserialize") + case .success(let arg): + var d = try ["success": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("success") + return .dictionary(d) + case .notFound(let arg): + var d = try ["not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("not_found") + return .dictionary(d) + case .cannotRemovePrimary(let arg): + var d = try ["cannot_remove_primary": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("cannot_remove_primary") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeleteSecondaryEmailResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Serialization._StringSerializer.deserialize(d["success"] ?? .null) + return DeleteSecondaryEmailResult.success(v) + case "not_found": + let v = try Serialization._StringSerializer.deserialize(d["not_found"] ?? .null) + return DeleteSecondaryEmailResult.notFound(v) + case "cannot_remove_primary": + let v = try Serialization._StringSerializer.deserialize(d["cannot_remove_primary"] ?? .null) + return DeleteSecondaryEmailResult.cannotRemovePrimary(v) + case "other": + return DeleteSecondaryEmailResult.other + default: + return DeleteSecondaryEmailResult.other + } + default: + throw JSONSerializerError.deserializeError(type: DeleteSecondaryEmailResult.self, json: json) } } } /// The DeleteSecondaryEmailsArg struct - open class DeleteSecondaryEmailsArg: CustomStringConvertible { + public class DeleteSecondaryEmailsArg: CustomStringConvertible, JSONRepresentable { /// List of users and their secondary emails to delete. - public let emailsToDelete: Array - public init(emailsToDelete: Array) { + public let emailsToDelete: [Team.UserSecondaryEmailsArg] + public init(emailsToDelete: [Team.UserSecondaryEmailsArg]) { self.emailsToDelete = emailsToDelete } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteSecondaryEmailsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteSecondaryEmailsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteSecondaryEmailsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteSecondaryEmailsArg: \(error)" + } } } - open class DeleteSecondaryEmailsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteSecondaryEmailsArg) -> JSON { - let output = [ - "emails_to_delete": ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).serialize(value.emailsToDelete), + + public class DeleteSecondaryEmailsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteSecondaryEmailsArg) throws -> JSON { + let output = [ + "emails_to_delete": try ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).serialize(value.emailsToDelete), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteSecondaryEmailsArg { + + public func deserialize(_ json: JSON) throws -> DeleteSecondaryEmailsArg { switch json { - case .dictionary(let dict): - let emailsToDelete = ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).deserialize(dict["emails_to_delete"] ?? .null) - return DeleteSecondaryEmailsArg(emailsToDelete: emailsToDelete) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let emailsToDelete = try ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).deserialize(dict["emails_to_delete"] ?? .null) + return DeleteSecondaryEmailsArg(emailsToDelete: emailsToDelete) + default: + throw JSONSerializerError.deserializeError(type: DeleteSecondaryEmailsArg.self, json: json) } } } /// The DeleteSecondaryEmailsResult struct - open class DeleteSecondaryEmailsResult: CustomStringConvertible { + public class DeleteSecondaryEmailsResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let results: Array - public init(results: Array) { + public let results: [Team.UserDeleteResult] + public init(results: [Team.UserDeleteResult]) { self.results = results } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteSecondaryEmailsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteSecondaryEmailsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteSecondaryEmailsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteSecondaryEmailsResult: \(error)" + } } } - open class DeleteSecondaryEmailsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteSecondaryEmailsResult) -> JSON { - let output = [ - "results": ArraySerializer(Team.UserDeleteResultSerializer()).serialize(value.results), + + public class DeleteSecondaryEmailsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteSecondaryEmailsResult) throws -> JSON { + let output = [ + "results": try ArraySerializer(Team.UserDeleteResultSerializer()).serialize(value.results), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteSecondaryEmailsResult { + + public func deserialize(_ json: JSON) throws -> DeleteSecondaryEmailsResult { switch json { - case .dictionary(let dict): - let results = ArraySerializer(Team.UserDeleteResultSerializer()).deserialize(dict["results"] ?? .null) - return DeleteSecondaryEmailsResult(results: results) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let results = try ArraySerializer(Team.UserDeleteResultSerializer()).deserialize(dict["results"] ?? .null) + return DeleteSecondaryEmailsResult(results: results) + default: + throw JSONSerializerError.deserializeError(type: DeleteSecondaryEmailsResult.self, json: json) } } } /// Information about linked Dropbox desktop client sessions. - open class DesktopClientSession: Team.DeviceSession { + public class DesktopClientSession: Team.DeviceSession { /// Name of the hosting desktop. public let hostName: String /// The Dropbox desktop client type. @@ -894,7 +1100,18 @@ open class Team { public let platform: String /// Whether it's possible to delete all of the account files upon unlinking. public let isDeleteOnUnlinkSupported: Bool - public init(sessionId: String, hostName: String, clientType: Team.DesktopPlatform, clientVersion: String, platform: String, isDeleteOnUnlinkSupported: Bool, ipAddress: String? = nil, country: String? = nil, created: Date? = nil, updated: Date? = nil) { + public init( + sessionId: String, + hostName: String, + clientType: Team.DesktopPlatform, + clientVersion: String, + platform: String, + isDeleteOnUnlinkSupported: Bool, + ipAddress: String? = nil, + country: String? = nil, + created: Date? = nil, + updated: Date? = nil + ) { stringValidator()(hostName) self.hostName = hostName self.clientType = clientType @@ -905,49 +1122,67 @@ open class Team { self.isDeleteOnUnlinkSupported = isDeleteOnUnlinkSupported super.init(sessionId: sessionId, ipAddress: ipAddress, country: country, created: created, updated: updated) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DesktopClientSessionSerializer().serialize(self)))" - } - } - open class DesktopClientSessionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DesktopClientSession) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), - "host_name": Serialization._StringSerializer.serialize(value.hostName), - "client_type": Team.DesktopPlatformSerializer().serialize(value.clientType), - "client_version": Serialization._StringSerializer.serialize(value.clientVersion), - "platform": Serialization._StringSerializer.serialize(value.platform), - "is_delete_on_unlink_supported": Serialization._BoolSerializer.serialize(value.isDeleteOnUnlinkSupported), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "country": NullableSerializer(Serialization._StringSerializer).serialize(value.country), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> DesktopClientSession { - switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - let hostName = Serialization._StringSerializer.deserialize(dict["host_name"] ?? .null) - let clientType = Team.DesktopPlatformSerializer().deserialize(dict["client_type"] ?? .null) - let clientVersion = Serialization._StringSerializer.deserialize(dict["client_version"] ?? .null) - let platform = Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) - let isDeleteOnUnlinkSupported = Serialization._BoolSerializer.deserialize(dict["is_delete_on_unlink_supported"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let country = NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - return DesktopClientSession(sessionId: sessionId, hostName: hostName, clientType: clientType, clientVersion: clientVersion, platform: platform, isDeleteOnUnlinkSupported: isDeleteOnUnlinkSupported, ipAddress: ipAddress, country: country, created: created, updated: updated) - default: - fatalError("Type error deserializing") + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DesktopClientSessionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DesktopClientSession: \(error)" + } + } + } + + public class DesktopClientSessionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DesktopClientSession) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), + "host_name": try Serialization._StringSerializer.serialize(value.hostName), + "client_type": try Team.DesktopPlatformSerializer().serialize(value.clientType), + "client_version": try Serialization._StringSerializer.serialize(value.clientVersion), + "platform": try Serialization._StringSerializer.serialize(value.platform), + "is_delete_on_unlink_supported": try Serialization._BoolSerializer.serialize(value.isDeleteOnUnlinkSupported), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "country": try NullableSerializer(Serialization._StringSerializer).serialize(value.country), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> DesktopClientSession { + switch json { + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + let hostName = try Serialization._StringSerializer.deserialize(dict["host_name"] ?? .null) + let clientType = try Team.DesktopPlatformSerializer().deserialize(dict["client_type"] ?? .null) + let clientVersion = try Serialization._StringSerializer.deserialize(dict["client_version"] ?? .null) + let platform = try Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) + let isDeleteOnUnlinkSupported = try Serialization._BoolSerializer.deserialize(dict["is_delete_on_unlink_supported"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let country = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + return DesktopClientSession( + sessionId: sessionId, + hostName: hostName, + clientType: clientType, + clientVersion: clientVersion, + platform: platform, + isDeleteOnUnlinkSupported: isDeleteOnUnlinkSupported, + ipAddress: ipAddress, + country: country, + created: created, + updated: updated + ) + default: + throw JSONSerializerError.deserializeError(type: DesktopClientSession.self, json: json) } } } /// The DesktopPlatform union - public enum DesktopPlatform: CustomStringConvertible { + public enum DesktopPlatform: CustomStringConvertible, JSONRepresentable { /// Official Windows Dropbox desktop client. case windows /// Official Mac Dropbox desktop client. @@ -957,56 +1192,66 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try DesktopPlatformSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DesktopPlatformSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DesktopPlatformSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DesktopPlatform: \(error)" + } } } - open class DesktopPlatformSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DesktopPlatform) -> JSON { + + public class DesktopPlatformSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DesktopPlatform) throws -> JSON { switch value { - case .windows: - var d = [String: JSON]() - d[".tag"] = .str("windows") - return .dictionary(d) - case .mac: - var d = [String: JSON]() - d[".tag"] = .str("mac") - return .dictionary(d) - case .linux: - var d = [String: JSON]() - d[".tag"] = .str("linux") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DesktopPlatform { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "windows": - return DesktopPlatform.windows - case "mac": - return DesktopPlatform.mac - case "linux": - return DesktopPlatform.linux - case "other": - return DesktopPlatform.other - default: - return DesktopPlatform.other - } - default: - fatalError("Failed to deserialize") + case .windows: + var d = [String: JSON]() + d[".tag"] = .str("windows") + return .dictionary(d) + case .mac: + var d = [String: JSON]() + d[".tag"] = .str("mac") + return .dictionary(d) + case .linux: + var d = [String: JSON]() + d[".tag"] = .str("linux") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DesktopPlatform { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "windows": + return DesktopPlatform.windows + case "mac": + return DesktopPlatform.mac + case "linux": + return DesktopPlatform.linux + case "other": + return DesktopPlatform.other + default: + return DesktopPlatform.other + } + default: + throw JSONSerializerError.deserializeError(type: DesktopPlatform.self, json: json) } } } /// The DeviceSessionArg struct - open class DeviceSessionArg: CustomStringConvertible { + public class DeviceSessionArg: CustomStringConvertible, JSONRepresentable { /// The session id. public let sessionId: String /// The unique id of the member owning the device. @@ -1017,49 +1262,60 @@ open class Team { stringValidator()(teamMemberId) self.teamMemberId = teamMemberId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceSessionArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceSessionArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceSessionArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceSessionArg: \(error)" + } } } - open class DeviceSessionArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceSessionArg) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), + + public class DeviceSessionArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceSessionArg) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceSessionArg { + + public func deserialize(_ json: JSON) throws -> DeviceSessionArg { switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - return DeviceSessionArg(sessionId: sessionId, teamMemberId: teamMemberId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + return DeviceSessionArg(sessionId: sessionId, teamMemberId: teamMemberId) + default: + throw JSONSerializerError.deserializeError(type: DeviceSessionArg.self, json: json) } } } /// Each of the items is an array of values, one value per day. The value is the number of devices active within a /// time window, ending with that day. If there is no data for a day, then the value will be None. - open class DevicesActive: CustomStringConvertible { + public class DevicesActive: CustomStringConvertible, JSONRepresentable { /// Array of number of linked windows (desktop) clients with activity. - public let windows: Array + public let windows: [UInt64?] /// Array of number of linked mac (desktop) clients with activity. - public let macos: Array + public let macos: [UInt64?] /// Array of number of linked linus (desktop) clients with activity. - public let linux: Array + public let linux: [UInt64?] /// Array of number of linked ios devices with activity. - public let ios: Array + public let ios: [UInt64?] /// Array of number of linked android devices with activity. - public let android: Array + public let android: [UInt64?] /// Array of number of other linked devices (blackberry, windows phone, etc) with activity. - public let other: Array + public let other: [UInt64?] /// Array of total number of linked clients with activity. - public let total: Array - public init(windows: Array, macos: Array, linux: Array, ios: Array, android: Array, other: Array, total: Array) { + public let total: [UInt64?] + public init(windows: [UInt64?], macos: [UInt64?], linux: [UInt64?], ios: [UInt64?], android: [UInt64?], other: [UInt64?], total: [UInt64?]) { arrayValidator(itemValidator: nullableValidator(comparableValidator()))(windows) self.windows = windows arrayValidator(itemValidator: nullableValidator(comparableValidator()))(macos) @@ -1075,264 +1331,339 @@ open class Team { arrayValidator(itemValidator: nullableValidator(comparableValidator()))(total) self.total = total } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DevicesActiveSerializer().serialize(self)))" + + func json() throws -> JSON { + try DevicesActiveSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DevicesActiveSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DevicesActive: \(error)" + } } } - open class DevicesActiveSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DevicesActive) -> JSON { - let output = [ - "windows": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.windows), - "macos": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.macos), - "linux": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.linux), - "ios": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.ios), - "android": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.android), - "other": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.other), - "total": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.total), + + public class DevicesActiveSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DevicesActive) throws -> JSON { + let output = [ + "windows": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.windows), + "macos": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.macos), + "linux": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.linux), + "ios": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.ios), + "android": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.android), + "other": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.other), + "total": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.total), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DevicesActive { + + public func deserialize(_ json: JSON) throws -> DevicesActive { switch json { - case .dictionary(let dict): - let windows = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["windows"] ?? .null) - let macos = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["macos"] ?? .null) - let linux = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["linux"] ?? .null) - let ios = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["ios"] ?? .null) - let android = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["android"] ?? .null) - let other = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["other"] ?? .null) - let total = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["total"] ?? .null) - return DevicesActive(windows: windows, macos: macos, linux: linux, ios: ios, android: android, other: other, total: total) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let windows = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["windows"] ?? .null) + let macos = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["macos"] ?? .null) + let linux = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["linux"] ?? .null) + let ios = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["ios"] ?? .null) + let android = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["android"] ?? .null) + let other = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["other"] ?? .null) + let total = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["total"] ?? .null) + return DevicesActive(windows: windows, macos: macos, linux: linux, ios: ios, android: android, other: other, total: total) + default: + throw JSONSerializerError.deserializeError(type: DevicesActive.self, json: json) } } } /// Excluded users list argument. - open class ExcludedUsersListArg: CustomStringConvertible { + public class ExcludedUsersListArg: CustomStringConvertible, JSONRepresentable { /// Number of results to return per call. public let limit: UInt32 - public init(limit: UInt32 = 1000) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(limit: UInt32 = 1_000) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExcludedUsersListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersListArg: \(error)" + } } } - open class ExcludedUsersListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersListArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class ExcludedUsersListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersListArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExcludedUsersListArg { + + public func deserialize(_ json: JSON) throws -> ExcludedUsersListArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return ExcludedUsersListArg(limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return ExcludedUsersListArg(limit: limit) + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersListArg.self, json: json) } } } /// Excluded users list continue argument. - open class ExcludedUsersListContinueArg: CustomStringConvertible { + public class ExcludedUsersListContinueArg: CustomStringConvertible, JSONRepresentable { /// Indicates from what point to get the next set of users. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersListContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExcludedUsersListContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersListContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersListContinueArg: \(error)" + } } } - open class ExcludedUsersListContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersListContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class ExcludedUsersListContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersListContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExcludedUsersListContinueArg { + + public func deserialize(_ json: JSON) throws -> ExcludedUsersListContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return ExcludedUsersListContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return ExcludedUsersListContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersListContinueArg.self, json: json) } } } /// Excluded users list continue error. - public enum ExcludedUsersListContinueError: CustomStringConvertible { + public enum ExcludedUsersListContinueError: CustomStringConvertible, JSONRepresentable { /// The cursor is invalid. case invalidCursor /// An unspecified error. case other + func json() throws -> JSON { + try ExcludedUsersListContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersListContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersListContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersListContinueError: \(error)" + } } } - open class ExcludedUsersListContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersListContinueError) -> JSON { + + public class ExcludedUsersListContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersListContinueError) throws -> JSON { switch value { - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExcludedUsersListContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_cursor": - return ExcludedUsersListContinueError.invalidCursor - case "other": - return ExcludedUsersListContinueError.other - default: - return ExcludedUsersListContinueError.other - } + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExcludedUsersListContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_cursor": + return ExcludedUsersListContinueError.invalidCursor + case "other": + return ExcludedUsersListContinueError.other default: - fatalError("Failed to deserialize") + return ExcludedUsersListContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersListContinueError.self, json: json) } } } /// Excluded users list error. - public enum ExcludedUsersListError: CustomStringConvertible { + public enum ExcludedUsersListError: CustomStringConvertible, JSONRepresentable { /// An error occurred. case listError /// An unspecified error. case other + func json() throws -> JSON { + try ExcludedUsersListErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersListErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersListErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersListError: \(error)" + } } } - open class ExcludedUsersListErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersListError) -> JSON { + + public class ExcludedUsersListErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersListError) throws -> JSON { switch value { - case .listError: - var d = [String: JSON]() - d[".tag"] = .str("list_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExcludedUsersListError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "list_error": - return ExcludedUsersListError.listError - case "other": - return ExcludedUsersListError.other - default: - return ExcludedUsersListError.other - } + case .listError: + var d = [String: JSON]() + d[".tag"] = .str("list_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExcludedUsersListError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "list_error": + return ExcludedUsersListError.listError + case "other": + return ExcludedUsersListError.other default: - fatalError("Failed to deserialize") + return ExcludedUsersListError.other + } + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersListError.self, json: json) } } } /// Excluded users list result. - open class ExcludedUsersListResult: CustomStringConvertible { + public class ExcludedUsersListResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let users: Array + public let users: [Team.MemberProfile] /// Pass the cursor into memberSpaceLimitsExcludedUsersListContinue to obtain additional excluded users. public let cursor: String? /// Is true if there are additional excluded users that have not been returned yet. An additional call to /// memberSpaceLimitsExcludedUsersListContinue can retrieve them. public let hasMore: Bool - public init(users: Array, hasMore: Bool, cursor: String? = nil) { + public init(users: [Team.MemberProfile], hasMore: Bool, cursor: String? = nil) { self.users = users nullableValidator(stringValidator())(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersListResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExcludedUsersListResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersListResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersListResult: \(error)" + } } } - open class ExcludedUsersListResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersListResult) -> JSON { - let output = [ - "users": ArraySerializer(Team.MemberProfileSerializer()).serialize(value.users), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ExcludedUsersListResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersListResult) throws -> JSON { + let output = [ + "users": try ArraySerializer(Team.MemberProfileSerializer()).serialize(value.users), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExcludedUsersListResult { + + public func deserialize(_ json: JSON) throws -> ExcludedUsersListResult { switch json { - case .dictionary(let dict): - let users = ArraySerializer(Team.MemberProfileSerializer()).deserialize(dict["users"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ExcludedUsersListResult(users: users, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let users = try ArraySerializer(Team.MemberProfileSerializer()).deserialize(dict["users"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ExcludedUsersListResult(users: users, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersListResult.self, json: json) } } } /// Argument of excluded users update operation. Should include a list of users to add/remove (according to /// endpoint), Maximum size of the list is 1000 users. - open class ExcludedUsersUpdateArg: CustomStringConvertible { + public class ExcludedUsersUpdateArg: CustomStringConvertible, JSONRepresentable { /// List of users to be added/removed. - public let users: Array? - public init(users: Array? = nil) { + public let users: [Team.UserSelectorArg]? + public init(users: [Team.UserSelectorArg]? = nil) { self.users = users } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersUpdateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExcludedUsersUpdateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersUpdateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersUpdateArg: \(error)" + } } } - open class ExcludedUsersUpdateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersUpdateArg) -> JSON { - let output = [ - "users": NullableSerializer(ArraySerializer(Team.UserSelectorArgSerializer())).serialize(value.users), + + public class ExcludedUsersUpdateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersUpdateArg) throws -> JSON { + let output = [ + "users": try NullableSerializer(ArraySerializer(Team.UserSelectorArgSerializer())).serialize(value.users), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExcludedUsersUpdateArg { + + public func deserialize(_ json: JSON) throws -> ExcludedUsersUpdateArg { switch json { - case .dictionary(let dict): - let users = NullableSerializer(ArraySerializer(Team.UserSelectorArgSerializer())).deserialize(dict["users"] ?? .null) - return ExcludedUsersUpdateArg(users: users) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let users = try NullableSerializer(ArraySerializer(Team.UserSelectorArgSerializer())).deserialize(dict["users"] ?? .null) + return ExcludedUsersUpdateArg(users: users) + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersUpdateArg.self, json: json) } } } /// Excluded users update error. - public enum ExcludedUsersUpdateError: CustomStringConvertible { + public enum ExcludedUsersUpdateError: CustomStringConvertible, JSONRepresentable { /// At least one of the users is not part of your team. case usersNotInTeam /// A maximum of 1000 users for each of addition/removal can be supplied. @@ -1340,123 +1671,154 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try ExcludedUsersUpdateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersUpdateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersUpdateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersUpdateError: \(error)" + } } } - open class ExcludedUsersUpdateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersUpdateError) -> JSON { + + public class ExcludedUsersUpdateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersUpdateError) throws -> JSON { switch value { - case .usersNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("users_not_in_team") - return .dictionary(d) - case .tooManyUsers: - var d = [String: JSON]() - d[".tag"] = .str("too_many_users") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExcludedUsersUpdateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "users_not_in_team": - return ExcludedUsersUpdateError.usersNotInTeam - case "too_many_users": - return ExcludedUsersUpdateError.tooManyUsers - case "other": - return ExcludedUsersUpdateError.other - default: - return ExcludedUsersUpdateError.other - } + case .usersNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("users_not_in_team") + return .dictionary(d) + case .tooManyUsers: + var d = [String: JSON]() + d[".tag"] = .str("too_many_users") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExcludedUsersUpdateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "users_not_in_team": + return ExcludedUsersUpdateError.usersNotInTeam + case "too_many_users": + return ExcludedUsersUpdateError.tooManyUsers + case "other": + return ExcludedUsersUpdateError.other default: - fatalError("Failed to deserialize") + return ExcludedUsersUpdateError.other + } + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersUpdateError.self, json: json) } } } /// Excluded users update result. - open class ExcludedUsersUpdateResult: CustomStringConvertible { + public class ExcludedUsersUpdateResult: CustomStringConvertible, JSONRepresentable { /// Update status. public let status: Team.ExcludedUsersUpdateStatus public init(status: Team.ExcludedUsersUpdateStatus) { self.status = status } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersUpdateResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExcludedUsersUpdateResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersUpdateResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersUpdateResult: \(error)" + } } } - open class ExcludedUsersUpdateResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersUpdateResult) -> JSON { - let output = [ - "status": Team.ExcludedUsersUpdateStatusSerializer().serialize(value.status), + + public class ExcludedUsersUpdateResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersUpdateResult) throws -> JSON { + let output = [ + "status": try Team.ExcludedUsersUpdateStatusSerializer().serialize(value.status), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExcludedUsersUpdateResult { + + public func deserialize(_ json: JSON) throws -> ExcludedUsersUpdateResult { switch json { - case .dictionary(let dict): - let status = Team.ExcludedUsersUpdateStatusSerializer().deserialize(dict["status"] ?? .null) - return ExcludedUsersUpdateResult(status: status) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let status = try Team.ExcludedUsersUpdateStatusSerializer().deserialize(dict["status"] ?? .null) + return ExcludedUsersUpdateResult(status: status) + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersUpdateResult.self, json: json) } } } /// Excluded users update operation status. - public enum ExcludedUsersUpdateStatus: CustomStringConvertible { + public enum ExcludedUsersUpdateStatus: CustomStringConvertible, JSONRepresentable { /// Update successful. case success /// An unspecified error. case other + func json() throws -> JSON { + try ExcludedUsersUpdateStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExcludedUsersUpdateStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExcludedUsersUpdateStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExcludedUsersUpdateStatus: \(error)" + } } } - open class ExcludedUsersUpdateStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExcludedUsersUpdateStatus) -> JSON { + + public class ExcludedUsersUpdateStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExcludedUsersUpdateStatus) throws -> JSON { switch value { - case .success: - var d = [String: JSON]() - d[".tag"] = .str("success") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExcludedUsersUpdateStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - return ExcludedUsersUpdateStatus.success - case "other": - return ExcludedUsersUpdateStatus.other - default: - return ExcludedUsersUpdateStatus.other - } + case .success: + var d = [String: JSON]() + d[".tag"] = .str("success") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExcludedUsersUpdateStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + return ExcludedUsersUpdateStatus.success + case "other": + return ExcludedUsersUpdateStatus.other default: - fatalError("Failed to deserialize") + return ExcludedUsersUpdateStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: ExcludedUsersUpdateStatus.self, json: json) } } } /// A set of features that a Dropbox Business account may support. - public enum Feature: CustomStringConvertible { + public enum Feature: CustomStringConvertible, JSONRepresentable { /// The number of upload API calls allowed per month. case uploadApiRateLimit /// Does this team have a shared team root. @@ -1468,63 +1830,73 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try FeatureSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FeatureSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FeatureSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Feature: \(error)" + } } } - open class FeatureSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Feature) -> JSON { + + public class FeatureSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Feature) throws -> JSON { switch value { - case .uploadApiRateLimit: - var d = [String: JSON]() - d[".tag"] = .str("upload_api_rate_limit") - return .dictionary(d) - case .hasTeamSharedDropbox: - var d = [String: JSON]() - d[".tag"] = .str("has_team_shared_dropbox") - return .dictionary(d) - case .hasTeamFileEvents: - var d = [String: JSON]() - d[".tag"] = .str("has_team_file_events") - return .dictionary(d) - case .hasTeamSelectiveSync: - var d = [String: JSON]() - d[".tag"] = .str("has_team_selective_sync") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> Feature { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "upload_api_rate_limit": - return Feature.uploadApiRateLimit - case "has_team_shared_dropbox": - return Feature.hasTeamSharedDropbox - case "has_team_file_events": - return Feature.hasTeamFileEvents - case "has_team_selective_sync": - return Feature.hasTeamSelectiveSync - case "other": - return Feature.other - default: - return Feature.other - } - default: - fatalError("Failed to deserialize") + case .uploadApiRateLimit: + var d = [String: JSON]() + d[".tag"] = .str("upload_api_rate_limit") + return .dictionary(d) + case .hasTeamSharedDropbox: + var d = [String: JSON]() + d[".tag"] = .str("has_team_shared_dropbox") + return .dictionary(d) + case .hasTeamFileEvents: + var d = [String: JSON]() + d[".tag"] = .str("has_team_file_events") + return .dictionary(d) + case .hasTeamSelectiveSync: + var d = [String: JSON]() + d[".tag"] = .str("has_team_selective_sync") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> Feature { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "upload_api_rate_limit": + return Feature.uploadApiRateLimit + case "has_team_shared_dropbox": + return Feature.hasTeamSharedDropbox + case "has_team_file_events": + return Feature.hasTeamFileEvents + case "has_team_selective_sync": + return Feature.hasTeamSelectiveSync + case "other": + return Feature.other + default: + return Feature.other + } + default: + throw JSONSerializerError.deserializeError(type: Feature.self, json: json) } } } /// The values correspond to entries in Feature. You may get different value according to your Dropbox Business /// plan. - public enum FeatureValue: CustomStringConvertible { + public enum FeatureValue: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case uploadApiRateLimit(Team.UploadApiRateLimitValue) /// An unspecified error. @@ -1536,200 +1908,258 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try FeatureValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FeatureValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FeatureValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FeatureValue: \(error)" + } } } - open class FeatureValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FeatureValue) -> JSON { + + public class FeatureValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FeatureValue) throws -> JSON { switch value { - case .uploadApiRateLimit(let arg): - var d = ["upload_api_rate_limit": Team.UploadApiRateLimitValueSerializer().serialize(arg)] - d[".tag"] = .str("upload_api_rate_limit") - return .dictionary(d) - case .hasTeamSharedDropbox(let arg): - var d = ["has_team_shared_dropbox": Team.HasTeamSharedDropboxValueSerializer().serialize(arg)] - d[".tag"] = .str("has_team_shared_dropbox") - return .dictionary(d) - case .hasTeamFileEvents(let arg): - var d = ["has_team_file_events": Team.HasTeamFileEventsValueSerializer().serialize(arg)] - d[".tag"] = .str("has_team_file_events") - return .dictionary(d) - case .hasTeamSelectiveSync(let arg): - var d = ["has_team_selective_sync": Team.HasTeamSelectiveSyncValueSerializer().serialize(arg)] - d[".tag"] = .str("has_team_selective_sync") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FeatureValue { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "upload_api_rate_limit": - let v = Team.UploadApiRateLimitValueSerializer().deserialize(d["upload_api_rate_limit"] ?? .null) - return FeatureValue.uploadApiRateLimit(v) - case "has_team_shared_dropbox": - let v = Team.HasTeamSharedDropboxValueSerializer().deserialize(d["has_team_shared_dropbox"] ?? .null) - return FeatureValue.hasTeamSharedDropbox(v) - case "has_team_file_events": - let v = Team.HasTeamFileEventsValueSerializer().deserialize(d["has_team_file_events"] ?? .null) - return FeatureValue.hasTeamFileEvents(v) - case "has_team_selective_sync": - let v = Team.HasTeamSelectiveSyncValueSerializer().deserialize(d["has_team_selective_sync"] ?? .null) - return FeatureValue.hasTeamSelectiveSync(v) - case "other": - return FeatureValue.other - default: - return FeatureValue.other - } - default: - fatalError("Failed to deserialize") + case .uploadApiRateLimit(let arg): + var d = try ["upload_api_rate_limit": Team.UploadApiRateLimitValueSerializer().serialize(arg)] + d[".tag"] = .str("upload_api_rate_limit") + return .dictionary(d) + case .hasTeamSharedDropbox(let arg): + var d = try ["has_team_shared_dropbox": Team.HasTeamSharedDropboxValueSerializer().serialize(arg)] + d[".tag"] = .str("has_team_shared_dropbox") + return .dictionary(d) + case .hasTeamFileEvents(let arg): + var d = try ["has_team_file_events": Team.HasTeamFileEventsValueSerializer().serialize(arg)] + d[".tag"] = .str("has_team_file_events") + return .dictionary(d) + case .hasTeamSelectiveSync(let arg): + var d = try ["has_team_selective_sync": Team.HasTeamSelectiveSyncValueSerializer().serialize(arg)] + d[".tag"] = .str("has_team_selective_sync") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FeatureValue { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "upload_api_rate_limit": + let v = try Team.UploadApiRateLimitValueSerializer().deserialize(d["upload_api_rate_limit"] ?? .null) + return FeatureValue.uploadApiRateLimit(v) + case "has_team_shared_dropbox": + let v = try Team.HasTeamSharedDropboxValueSerializer().deserialize(d["has_team_shared_dropbox"] ?? .null) + return FeatureValue.hasTeamSharedDropbox(v) + case "has_team_file_events": + let v = try Team.HasTeamFileEventsValueSerializer().deserialize(d["has_team_file_events"] ?? .null) + return FeatureValue.hasTeamFileEvents(v) + case "has_team_selective_sync": + let v = try Team.HasTeamSelectiveSyncValueSerializer().deserialize(d["has_team_selective_sync"] ?? .null) + return FeatureValue.hasTeamSelectiveSync(v) + case "other": + return FeatureValue.other + default: + return FeatureValue.other + } + default: + throw JSONSerializerError.deserializeError(type: FeatureValue.self, json: json) } } } /// The FeaturesGetValuesBatchArg struct - open class FeaturesGetValuesBatchArg: CustomStringConvertible { + public class FeaturesGetValuesBatchArg: CustomStringConvertible, JSONRepresentable { /// A list of features in Feature. If the list is empty, this route will return FeaturesGetValuesBatchError. - public let features: Array - public init(features: Array) { + public let features: [Team.Feature] + public init(features: [Team.Feature]) { self.features = features } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FeaturesGetValuesBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try FeaturesGetValuesBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FeaturesGetValuesBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FeaturesGetValuesBatchArg: \(error)" + } } } - open class FeaturesGetValuesBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FeaturesGetValuesBatchArg) -> JSON { - let output = [ - "features": ArraySerializer(Team.FeatureSerializer()).serialize(value.features), + + public class FeaturesGetValuesBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FeaturesGetValuesBatchArg) throws -> JSON { + let output = [ + "features": try ArraySerializer(Team.FeatureSerializer()).serialize(value.features), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FeaturesGetValuesBatchArg { + + public func deserialize(_ json: JSON) throws -> FeaturesGetValuesBatchArg { switch json { - case .dictionary(let dict): - let features = ArraySerializer(Team.FeatureSerializer()).deserialize(dict["features"] ?? .null) - return FeaturesGetValuesBatchArg(features: features) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let features = try ArraySerializer(Team.FeatureSerializer()).deserialize(dict["features"] ?? .null) + return FeaturesGetValuesBatchArg(features: features) + default: + throw JSONSerializerError.deserializeError(type: FeaturesGetValuesBatchArg.self, json: json) } } } /// The FeaturesGetValuesBatchError union - public enum FeaturesGetValuesBatchError: CustomStringConvertible { + public enum FeaturesGetValuesBatchError: CustomStringConvertible, JSONRepresentable { /// At least one Feature must be included in the FeaturesGetValuesBatchArg.features list. case emptyFeaturesList /// An unspecified error. case other + func json() throws -> JSON { + try FeaturesGetValuesBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FeaturesGetValuesBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FeaturesGetValuesBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FeaturesGetValuesBatchError: \(error)" + } } } - open class FeaturesGetValuesBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FeaturesGetValuesBatchError) -> JSON { + + public class FeaturesGetValuesBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FeaturesGetValuesBatchError) throws -> JSON { switch value { - case .emptyFeaturesList: - var d = [String: JSON]() - d[".tag"] = .str("empty_features_list") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FeaturesGetValuesBatchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "empty_features_list": - return FeaturesGetValuesBatchError.emptyFeaturesList - case "other": - return FeaturesGetValuesBatchError.other - default: - return FeaturesGetValuesBatchError.other - } + case .emptyFeaturesList: + var d = [String: JSON]() + d[".tag"] = .str("empty_features_list") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FeaturesGetValuesBatchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "empty_features_list": + return FeaturesGetValuesBatchError.emptyFeaturesList + case "other": + return FeaturesGetValuesBatchError.other default: - fatalError("Failed to deserialize") + return FeaturesGetValuesBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: FeaturesGetValuesBatchError.self, json: json) } } } /// The FeaturesGetValuesBatchResult struct - open class FeaturesGetValuesBatchResult: CustomStringConvertible { + public class FeaturesGetValuesBatchResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let values: Array - public init(values: Array) { + public let values: [Team.FeatureValue] + public init(values: [Team.FeatureValue]) { self.values = values } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FeaturesGetValuesBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try FeaturesGetValuesBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FeaturesGetValuesBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FeaturesGetValuesBatchResult: \(error)" + } } } - open class FeaturesGetValuesBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FeaturesGetValuesBatchResult) -> JSON { - let output = [ - "values": ArraySerializer(Team.FeatureValueSerializer()).serialize(value.values), + + public class FeaturesGetValuesBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FeaturesGetValuesBatchResult) throws -> JSON { + let output = [ + "values": try ArraySerializer(Team.FeatureValueSerializer()).serialize(value.values), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FeaturesGetValuesBatchResult { + + public func deserialize(_ json: JSON) throws -> FeaturesGetValuesBatchResult { switch json { - case .dictionary(let dict): - let values = ArraySerializer(Team.FeatureValueSerializer()).deserialize(dict["values"] ?? .null) - return FeaturesGetValuesBatchResult(values: values) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let values = try ArraySerializer(Team.FeatureValueSerializer()).deserialize(dict["values"] ?? .null) + return FeaturesGetValuesBatchResult(values: values) + default: + throw JSONSerializerError.deserializeError(type: FeaturesGetValuesBatchResult.self, json: json) } } } /// Activity Report Result. Each of the items in the storage report is an array of values, one value per day. If /// there is no data for a day, then the value will be None. - open class GetActivityReport: Team.BaseDfbReport { + public class GetActivityReport: Team.BaseDfbReport { /// Array of total number of adds by team members. - public let adds: Array + public let adds: [UInt64?] /// Array of number of edits by team members. If the same user edits the same file multiple times this is /// counted as a single edit. - public let edits: Array + public let edits: [UInt64?] /// Array of total number of deletes by team members. - public let deletes: Array + public let deletes: [UInt64?] /// Array of the number of users who have been active in the last 28 days. - public let activeUsers28Day: Array + public let activeUsers28Day: [UInt64?] /// Array of the number of users who have been active in the last week. - public let activeUsers7Day: Array + public let activeUsers7Day: [UInt64?] /// Array of the number of users who have been active in the last day. - public let activeUsers1Day: Array + public let activeUsers1Day: [UInt64?] /// Array of the number of shared folders with some activity in the last 28 days. - public let activeSharedFolders28Day: Array + public let activeSharedFolders28Day: [UInt64?] /// Array of the number of shared folders with some activity in the last week. - public let activeSharedFolders7Day: Array + public let activeSharedFolders7Day: [UInt64?] /// Array of the number of shared folders with some activity in the last day. - public let activeSharedFolders1Day: Array + public let activeSharedFolders1Day: [UInt64?] /// Array of the number of shared links created. - public let sharedLinksCreated: Array + public let sharedLinksCreated: [UInt64?] /// Array of the number of views by team users to shared links created by the team. - public let sharedLinksViewedByTeam: Array + public let sharedLinksViewedByTeam: [UInt64?] /// Array of the number of views by users outside of the team to shared links created by the team. - public let sharedLinksViewedByOutsideUser: Array + public let sharedLinksViewedByOutsideUser: [UInt64?] /// Array of the number of views by non-logged-in users to shared links created by the team. - public let sharedLinksViewedByNotLoggedIn: Array + public let sharedLinksViewedByNotLoggedIn: [UInt64?] /// Array of the total number of views to shared links created by the team. - public let sharedLinksViewedTotal: Array - public init(startDate: String, adds: Array, edits: Array, deletes: Array, activeUsers28Day: Array, activeUsers7Day: Array, activeUsers1Day: Array, activeSharedFolders28Day: Array, activeSharedFolders7Day: Array, activeSharedFolders1Day: Array, sharedLinksCreated: Array, sharedLinksViewedByTeam: Array, sharedLinksViewedByOutsideUser: Array, sharedLinksViewedByNotLoggedIn: Array, sharedLinksViewedTotal: Array) { + public let sharedLinksViewedTotal: [UInt64?] + public init( + startDate: String, + adds: [UInt64?], + edits: [UInt64?], + deletes: [UInt64?], + activeUsers28Day: [UInt64?], + activeUsers7Day: [UInt64?], + activeUsers1Day: [UInt64?], + activeSharedFolders28Day: [UInt64?], + activeSharedFolders7Day: [UInt64?], + activeSharedFolders1Day: [UInt64?], + sharedLinksCreated: [UInt64?], + sharedLinksViewedByTeam: [UInt64?], + sharedLinksViewedByOutsideUser: [UInt64?], + sharedLinksViewedByNotLoggedIn: [UInt64?], + sharedLinksViewedTotal: [UInt64?] + ) { arrayValidator(itemValidator: nullableValidator(comparableValidator()))(adds) self.adds = adds arrayValidator(itemValidator: nullableValidator(comparableValidator()))(edits) @@ -1760,61 +2190,101 @@ open class Team { self.sharedLinksViewedTotal = sharedLinksViewedTotal super.init(startDate: startDate) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetActivityReportSerializer().serialize(self)))" - } - } - open class GetActivityReportSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetActivityReport) -> JSON { - let output = [ - "start_date": Serialization._StringSerializer.serialize(value.startDate), - "adds": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.adds), - "edits": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.edits), - "deletes": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.deletes), - "active_users_28_day": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeUsers28Day), - "active_users_7_day": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeUsers7Day), - "active_users_1_day": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeUsers1Day), - "active_shared_folders_28_day": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeSharedFolders28Day), - "active_shared_folders_7_day": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeSharedFolders7Day), - "active_shared_folders_1_day": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeSharedFolders1Day), - "shared_links_created": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedLinksCreated), - "shared_links_viewed_by_team": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedLinksViewedByTeam), - "shared_links_viewed_by_outside_user": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedLinksViewedByOutsideUser), - "shared_links_viewed_by_not_logged_in": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedLinksViewedByNotLoggedIn), - "shared_links_viewed_total": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedLinksViewedTotal), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> GetActivityReport { - switch json { - case .dictionary(let dict): - let startDate = Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) - let adds = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["adds"] ?? .null) - let edits = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["edits"] ?? .null) - let deletes = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["deletes"] ?? .null) - let activeUsers28Day = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["active_users_28_day"] ?? .null) - let activeUsers7Day = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["active_users_7_day"] ?? .null) - let activeUsers1Day = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["active_users_1_day"] ?? .null) - let activeSharedFolders28Day = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["active_shared_folders_28_day"] ?? .null) - let activeSharedFolders7Day = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["active_shared_folders_7_day"] ?? .null) - let activeSharedFolders1Day = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["active_shared_folders_1_day"] ?? .null) - let sharedLinksCreated = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_links_created"] ?? .null) - let sharedLinksViewedByTeam = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_links_viewed_by_team"] ?? .null) - let sharedLinksViewedByOutsideUser = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_links_viewed_by_outside_user"] ?? .null) - let sharedLinksViewedByNotLoggedIn = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_links_viewed_by_not_logged_in"] ?? .null) - let sharedLinksViewedTotal = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_links_viewed_total"] ?? .null) - return GetActivityReport(startDate: startDate, adds: adds, edits: edits, deletes: deletes, activeUsers28Day: activeUsers28Day, activeUsers7Day: activeUsers7Day, activeUsers1Day: activeUsers1Day, activeSharedFolders28Day: activeSharedFolders28Day, activeSharedFolders7Day: activeSharedFolders7Day, activeSharedFolders1Day: activeSharedFolders1Day, sharedLinksCreated: sharedLinksCreated, sharedLinksViewedByTeam: sharedLinksViewedByTeam, sharedLinksViewedByOutsideUser: sharedLinksViewedByOutsideUser, sharedLinksViewedByNotLoggedIn: sharedLinksViewedByNotLoggedIn, sharedLinksViewedTotal: sharedLinksViewedTotal) - default: - fatalError("Type error deserializing") + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetActivityReportSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetActivityReport: \(error)" + } + } + } + + public class GetActivityReportSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetActivityReport) throws -> JSON { + let output = [ + "start_date": try Serialization._StringSerializer.serialize(value.startDate), + "adds": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.adds), + "edits": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.edits), + "deletes": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.deletes), + "active_users_28_day": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeUsers28Day), + "active_users_7_day": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeUsers7Day), + "active_users_1_day": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.activeUsers1Day), + "active_shared_folders_28_day": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .serialize(value.activeSharedFolders28Day), + "active_shared_folders_7_day": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .serialize(value.activeSharedFolders7Day), + "active_shared_folders_1_day": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .serialize(value.activeSharedFolders1Day), + "shared_links_created": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedLinksCreated), + "shared_links_viewed_by_team": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .serialize(value.sharedLinksViewedByTeam), + "shared_links_viewed_by_outside_user": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .serialize(value.sharedLinksViewedByOutsideUser), + "shared_links_viewed_by_not_logged_in": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .serialize(value.sharedLinksViewedByNotLoggedIn), + "shared_links_viewed_total": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedLinksViewedTotal), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetActivityReport { + switch json { + case .dictionary(let dict): + let startDate = try Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) + let adds = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["adds"] ?? .null) + let edits = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["edits"] ?? .null) + let deletes = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["deletes"] ?? .null) + let activeUsers28Day = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["active_users_28_day"] ?? .null) + let activeUsers7Day = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["active_users_7_day"] ?? .null) + let activeUsers1Day = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["active_users_1_day"] ?? .null) + let activeSharedFolders28Day = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["active_shared_folders_28_day"] ?? .null) + let activeSharedFolders7Day = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["active_shared_folders_7_day"] ?? .null) + let activeSharedFolders1Day = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["active_shared_folders_1_day"] ?? .null) + let sharedLinksCreated = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["shared_links_created"] ?? .null) + let sharedLinksViewedByTeam = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["shared_links_viewed_by_team"] ?? .null) + let sharedLinksViewedByOutsideUser = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["shared_links_viewed_by_outside_user"] ?? .null) + let sharedLinksViewedByNotLoggedIn = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["shared_links_viewed_by_not_logged_in"] ?? .null) + let sharedLinksViewedTotal = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["shared_links_viewed_total"] ?? .null) + return GetActivityReport( + startDate: startDate, + adds: adds, + edits: edits, + deletes: deletes, + activeUsers28Day: activeUsers28Day, + activeUsers7Day: activeUsers7Day, + activeUsers1Day: activeUsers1Day, + activeSharedFolders28Day: activeSharedFolders28Day, + activeSharedFolders7Day: activeSharedFolders7Day, + activeSharedFolders1Day: activeSharedFolders1Day, + sharedLinksCreated: sharedLinksCreated, + sharedLinksViewedByTeam: sharedLinksViewedByTeam, + sharedLinksViewedByOutsideUser: sharedLinksViewedByOutsideUser, + sharedLinksViewedByNotLoggedIn: sharedLinksViewedByNotLoggedIn, + sharedLinksViewedTotal: sharedLinksViewedTotal + ) + default: + throw JSONSerializerError.deserializeError(type: GetActivityReport.self, json: json) } } } /// Devices Report Result. Contains subsections for different time ranges of activity. Each of the items in each - /// subsection of the storage report is an array of values, one value per day. If there is no data for a day, then - /// the value will be None. - open class GetDevicesReport: Team.BaseDfbReport { + /// subsection of the storage report is an array of values, one value per day. If there is no data for a day, + /// then the value will be None. + public class GetDevicesReport: Team.BaseDfbReport { /// Report of the number of devices active in the last day. public let active1Day: Team.DevicesActive /// Report of the number of devices active in the last 7 days. @@ -1827,49 +2297,63 @@ open class Team { self.active28Day = active28Day super.init(startDate: startDate) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetDevicesReportSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetDevicesReportSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetDevicesReport: \(error)" + } } } - open class GetDevicesReportSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetDevicesReport) -> JSON { - let output = [ - "start_date": Serialization._StringSerializer.serialize(value.startDate), - "active_1_day": Team.DevicesActiveSerializer().serialize(value.active1Day), - "active_7_day": Team.DevicesActiveSerializer().serialize(value.active7Day), - "active_28_day": Team.DevicesActiveSerializer().serialize(value.active28Day), + + public class GetDevicesReportSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetDevicesReport) throws -> JSON { + let output = [ + "start_date": try Serialization._StringSerializer.serialize(value.startDate), + "active_1_day": try Team.DevicesActiveSerializer().serialize(value.active1Day), + "active_7_day": try Team.DevicesActiveSerializer().serialize(value.active7Day), + "active_28_day": try Team.DevicesActiveSerializer().serialize(value.active28Day), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetDevicesReport { + + public func deserialize(_ json: JSON) throws -> GetDevicesReport { switch json { - case .dictionary(let dict): - let startDate = Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) - let active1Day = Team.DevicesActiveSerializer().deserialize(dict["active_1_day"] ?? .null) - let active7Day = Team.DevicesActiveSerializer().deserialize(dict["active_7_day"] ?? .null) - let active28Day = Team.DevicesActiveSerializer().deserialize(dict["active_28_day"] ?? .null) - return GetDevicesReport(startDate: startDate, active1Day: active1Day, active7Day: active7Day, active28Day: active28Day) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) + let active1Day = try Team.DevicesActiveSerializer().deserialize(dict["active_1_day"] ?? .null) + let active7Day = try Team.DevicesActiveSerializer().deserialize(dict["active_7_day"] ?? .null) + let active28Day = try Team.DevicesActiveSerializer().deserialize(dict["active_28_day"] ?? .null) + return GetDevicesReport(startDate: startDate, active1Day: active1Day, active7Day: active7Day, active28Day: active28Day) + default: + throw JSONSerializerError.deserializeError(type: GetDevicesReport.self, json: json) } } } /// Membership Report Result. Each of the items in the storage report is an array of values, one value per day. If /// there is no data for a day, then the value will be None. - open class GetMembershipReport: Team.BaseDfbReport { + public class GetMembershipReport: Team.BaseDfbReport { /// Team size, for each day. - public let teamSize: Array + public let teamSize: [UInt64?] /// The number of pending invites to the team, for each day. - public let pendingInvites: Array + public let pendingInvites: [UInt64?] /// The number of members that joined the team, for each day. - public let membersJoined: Array + public let membersJoined: [UInt64?] /// The number of suspended team members, for each day. - public let suspendedMembers: Array + public let suspendedMembers: [UInt64?] /// The total number of licenses the team has, for each day. - public let licenses: Array - public init(startDate: String, teamSize: Array, pendingInvites: Array, membersJoined: Array, suspendedMembers: Array, licenses: Array) { + public let licenses: [UInt64?] + public init( + startDate: String, + teamSize: [UInt64?], + pendingInvites: [UInt64?], + membersJoined: [UInt64?], + suspendedMembers: [UInt64?], + licenses: [UInt64?] + ) { arrayValidator(itemValidator: nullableValidator(comparableValidator()))(teamSize) self.teamSize = teamSize arrayValidator(itemValidator: nullableValidator(comparableValidator()))(pendingInvites) @@ -1882,56 +2366,78 @@ open class Team { self.licenses = licenses super.init(startDate: startDate) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetMembershipReportSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetMembershipReportSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetMembershipReport: \(error)" + } } } - open class GetMembershipReportSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetMembershipReport) -> JSON { - let output = [ - "start_date": Serialization._StringSerializer.serialize(value.startDate), - "team_size": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.teamSize), - "pending_invites": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.pendingInvites), - "members_joined": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.membersJoined), - "suspended_members": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.suspendedMembers), - "licenses": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.licenses), + + public class GetMembershipReportSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetMembershipReport) throws -> JSON { + let output = [ + "start_date": try Serialization._StringSerializer.serialize(value.startDate), + "team_size": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.teamSize), + "pending_invites": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.pendingInvites), + "members_joined": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.membersJoined), + "suspended_members": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.suspendedMembers), + "licenses": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.licenses), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetMembershipReport { + + public func deserialize(_ json: JSON) throws -> GetMembershipReport { switch json { - case .dictionary(let dict): - let startDate = Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) - let teamSize = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["team_size"] ?? .null) - let pendingInvites = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["pending_invites"] ?? .null) - let membersJoined = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["members_joined"] ?? .null) - let suspendedMembers = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["suspended_members"] ?? .null) - let licenses = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["licenses"] ?? .null) - return GetMembershipReport(startDate: startDate, teamSize: teamSize, pendingInvites: pendingInvites, membersJoined: membersJoined, suspendedMembers: suspendedMembers, licenses: licenses) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) + let teamSize = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["team_size"] ?? .null) + let pendingInvites = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["pending_invites"] ?? .null) + let membersJoined = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["members_joined"] ?? .null) + let suspendedMembers = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)) + .deserialize(dict["suspended_members"] ?? .null) + let licenses = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["licenses"] ?? .null) + return GetMembershipReport( + startDate: startDate, + teamSize: teamSize, + pendingInvites: pendingInvites, + membersJoined: membersJoined, + suspendedMembers: suspendedMembers, + licenses: licenses + ) + default: + throw JSONSerializerError.deserializeError(type: GetMembershipReport.self, json: json) } } } /// Storage Report Result. Each of the items in the storage report is an array of values, one value per day. If /// there is no data for a day, then the value will be None. - open class GetStorageReport: Team.BaseDfbReport { + public class GetStorageReport: Team.BaseDfbReport { /// Sum of the shared, unshared, and datastore usages, for each day. - public let totalUsage: Array + public let totalUsage: [UInt64?] /// Array of the combined size (bytes) of team members' shared folders, for each day. - public let sharedUsage: Array + public let sharedUsage: [UInt64?] /// Array of the combined size (bytes) of team members' root namespaces, for each day. - public let unsharedUsage: Array + public let unsharedUsage: [UInt64?] /// Array of the number of shared folders owned by team members, for each day. - public let sharedFolders: Array + public let sharedFolders: [UInt64?] /// Array of storage summaries of team members' account sizes. Each storage summary is an array of key, value - /// pairs, where each pair describes a storage bucket. The key indicates the upper bound of the bucket and the - /// value is the number of users in that bucket. There is one such summary per day. If there is no data for a - /// day, the storage summary will be empty. - public let memberStorageMap: Array> - public init(startDate: String, totalUsage: Array, sharedUsage: Array, unsharedUsage: Array, sharedFolders: Array, memberStorageMap: Array>) { + /// pairs, where each pair describes a storage bucket. The key indicates the upper bound of the bucket + /// and the value is the number of users in that bucket. There is one such summary per day. If there is + /// no data for a day, the storage summary will be empty. + public let memberStorageMap: [[Team.StorageBucket]] + public init( + startDate: String, + totalUsage: [UInt64?], + sharedUsage: [UInt64?], + unsharedUsage: [UInt64?], + sharedFolders: [UInt64?], + memberStorageMap: [[Team.StorageBucket]] + ) { arrayValidator(itemValidator: nullableValidator(comparableValidator()))(totalUsage) self.totalUsage = totalUsage arrayValidator(itemValidator: nullableValidator(comparableValidator()))(sharedUsage) @@ -1943,84 +2449,108 @@ open class Team { self.memberStorageMap = memberStorageMap super.init(startDate: startDate) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetStorageReportSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetStorageReportSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetStorageReport: \(error)" + } } } - open class GetStorageReportSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetStorageReport) -> JSON { - let output = [ - "start_date": Serialization._StringSerializer.serialize(value.startDate), - "total_usage": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.totalUsage), - "shared_usage": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedUsage), - "unshared_usage": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.unsharedUsage), - "shared_folders": ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedFolders), - "member_storage_map": ArraySerializer(ArraySerializer(Team.StorageBucketSerializer())).serialize(value.memberStorageMap), + + public class GetStorageReportSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetStorageReport) throws -> JSON { + let output = [ + "start_date": try Serialization._StringSerializer.serialize(value.startDate), + "total_usage": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.totalUsage), + "shared_usage": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedUsage), + "unshared_usage": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.unsharedUsage), + "shared_folders": try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).serialize(value.sharedFolders), + "member_storage_map": try ArraySerializer(ArraySerializer(Team.StorageBucketSerializer())).serialize(value.memberStorageMap), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetStorageReport { + + public func deserialize(_ json: JSON) throws -> GetStorageReport { switch json { - case .dictionary(let dict): - let startDate = Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) - let totalUsage = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["total_usage"] ?? .null) - let sharedUsage = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_usage"] ?? .null) - let unsharedUsage = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["unshared_usage"] ?? .null) - let sharedFolders = ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_folders"] ?? .null) - let memberStorageMap = ArraySerializer(ArraySerializer(Team.StorageBucketSerializer())).deserialize(dict["member_storage_map"] ?? .null) - return GetStorageReport(startDate: startDate, totalUsage: totalUsage, sharedUsage: sharedUsage, unsharedUsage: unsharedUsage, sharedFolders: sharedFolders, memberStorageMap: memberStorageMap) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try Serialization._StringSerializer.deserialize(dict["start_date"] ?? .null) + let totalUsage = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["total_usage"] ?? .null) + let sharedUsage = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_usage"] ?? .null) + let unsharedUsage = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["unshared_usage"] ?? .null) + let sharedFolders = try ArraySerializer(NullableSerializer(Serialization._UInt64Serializer)).deserialize(dict["shared_folders"] ?? .null) + let memberStorageMap = try ArraySerializer(ArraySerializer(Team.StorageBucketSerializer())).deserialize(dict["member_storage_map"] ?? .null) + return GetStorageReport( + startDate: startDate, + totalUsage: totalUsage, + sharedUsage: sharedUsage, + unsharedUsage: unsharedUsage, + sharedFolders: sharedFolders, + memberStorageMap: memberStorageMap + ) + default: + throw JSONSerializerError.deserializeError(type: GetStorageReport.self, json: json) } } } /// Role of a user in group. - public enum GroupAccessType: CustomStringConvertible { + public enum GroupAccessType: CustomStringConvertible, JSONRepresentable { /// User is a member of the group, but has no special permissions. case member /// User can rename the group, and add/remove members. case owner + func json() throws -> JSON { + try GroupAccessTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupAccessTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupAccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupAccessType: \(error)" + } } } - open class GroupAccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupAccessType) -> JSON { + + public class GroupAccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupAccessType) throws -> JSON { switch value { - case .member: - var d = [String: JSON]() - d[".tag"] = .str("member") - return .dictionary(d) - case .owner: - var d = [String: JSON]() - d[".tag"] = .str("owner") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupAccessType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "member": - return GroupAccessType.member - case "owner": - return GroupAccessType.owner - default: - fatalError("Unknown tag \(tag)") - } + case .member: + var d = [String: JSON]() + d[".tag"] = .str("member") + return .dictionary(d) + case .owner: + var d = [String: JSON]() + d[".tag"] = .str("owner") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupAccessType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "member": + return GroupAccessType.member + case "owner": + return GroupAccessType.owner default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GroupAccessType.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupAccessType.self, json: json) } } } /// The GroupCreateArg struct - open class GroupCreateArg: CustomStringConvertible { + public class GroupCreateArg: CustomStringConvertible, JSONRepresentable { /// Group name. public let groupName: String /// Automatically add the creator of the group. @@ -2029,7 +2559,12 @@ open class Team { public let groupExternalId: String? /// Whether the team can be managed by selected users, or only by team admins. public let groupManagementType: TeamCommon.GroupManagementType? - public init(groupName: String, addCreatorAsOwner: Bool = false, groupExternalId: String? = nil, groupManagementType: TeamCommon.GroupManagementType? = nil) { + public init( + groupName: String, + addCreatorAsOwner: Bool = false, + groupExternalId: String? = nil, + groupManagementType: TeamCommon.GroupManagementType? = nil + ) { stringValidator()(groupName) self.groupName = groupName self.addCreatorAsOwner = addCreatorAsOwner @@ -2037,37 +2572,54 @@ open class Team { self.groupExternalId = groupExternalId self.groupManagementType = groupManagementType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupCreateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupCreateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupCreateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupCreateArg: \(error)" + } } } - open class GroupCreateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupCreateArg) -> JSON { - let output = [ - "group_name": Serialization._StringSerializer.serialize(value.groupName), - "add_creator_as_owner": Serialization._BoolSerializer.serialize(value.addCreatorAsOwner), - "group_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), - "group_management_type": NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).serialize(value.groupManagementType), + + public class GroupCreateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupCreateArg) throws -> JSON { + let output = [ + "group_name": try Serialization._StringSerializer.serialize(value.groupName), + "add_creator_as_owner": try Serialization._BoolSerializer.serialize(value.addCreatorAsOwner), + "group_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), + "group_management_type": try NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).serialize(value.groupManagementType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupCreateArg { + + public func deserialize(_ json: JSON) throws -> GroupCreateArg { switch json { - case .dictionary(let dict): - let groupName = Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) - let addCreatorAsOwner = Serialization._BoolSerializer.deserialize(dict["add_creator_as_owner"] ?? .number(0)) - let groupExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) - let groupManagementType = NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).deserialize(dict["group_management_type"] ?? .null) - return GroupCreateArg(groupName: groupName, addCreatorAsOwner: addCreatorAsOwner, groupExternalId: groupExternalId, groupManagementType: groupManagementType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let groupName = try Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) + let addCreatorAsOwner = try Serialization._BoolSerializer.deserialize(dict["add_creator_as_owner"] ?? .number(0)) + let groupExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) + let groupManagementType = try NullableSerializer(TeamCommon.GroupManagementTypeSerializer()) + .deserialize(dict["group_management_type"] ?? .null) + return GroupCreateArg( + groupName: groupName, + addCreatorAsOwner: addCreatorAsOwner, + groupExternalId: groupExternalId, + groupManagementType: groupManagementType + ) + default: + throw JSONSerializerError.deserializeError(type: GroupCreateArg.self, json: json) } } } /// The GroupCreateError union - public enum GroupCreateError: CustomStringConvertible { + public enum GroupCreateError: CustomStringConvertible, JSONRepresentable { /// The requested group name is already being used by another group. case groupNameAlreadyUsed /// Group name is empty or has invalid characters. @@ -2079,105 +2631,125 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try GroupCreateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupCreateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupCreateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupCreateError: \(error)" + } } } - open class GroupCreateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupCreateError) -> JSON { + + public class GroupCreateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupCreateError) throws -> JSON { switch value { - case .groupNameAlreadyUsed: - var d = [String: JSON]() - d[".tag"] = .str("group_name_already_used") - return .dictionary(d) - case .groupNameInvalid: - var d = [String: JSON]() - d[".tag"] = .str("group_name_invalid") - return .dictionary(d) - case .externalIdAlreadyInUse: - var d = [String: JSON]() - d[".tag"] = .str("external_id_already_in_use") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupCreateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_name_already_used": - return GroupCreateError.groupNameAlreadyUsed - case "group_name_invalid": - return GroupCreateError.groupNameInvalid - case "external_id_already_in_use": - return GroupCreateError.externalIdAlreadyInUse - case "system_managed_group_disallowed": - return GroupCreateError.systemManagedGroupDisallowed - case "other": - return GroupCreateError.other - default: - return GroupCreateError.other - } - default: - fatalError("Failed to deserialize") + case .groupNameAlreadyUsed: + var d = [String: JSON]() + d[".tag"] = .str("group_name_already_used") + return .dictionary(d) + case .groupNameInvalid: + var d = [String: JSON]() + d[".tag"] = .str("group_name_invalid") + return .dictionary(d) + case .externalIdAlreadyInUse: + var d = [String: JSON]() + d[".tag"] = .str("external_id_already_in_use") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupCreateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_name_already_used": + return GroupCreateError.groupNameAlreadyUsed + case "group_name_invalid": + return GroupCreateError.groupNameInvalid + case "external_id_already_in_use": + return GroupCreateError.externalIdAlreadyInUse + case "system_managed_group_disallowed": + return GroupCreateError.systemManagedGroupDisallowed + case "other": + return GroupCreateError.other + default: + return GroupCreateError.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupCreateError.self, json: json) } } } /// Error that can be raised when GroupSelector is used. - public enum GroupSelectorError: CustomStringConvertible { + public enum GroupSelectorError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. case other + func json() throws -> JSON { + try GroupSelectorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupSelectorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupSelectorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupSelectorError: \(error)" + } } } - open class GroupSelectorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupSelectorError) -> JSON { + + public class GroupSelectorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupSelectorError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupSelectorError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupSelectorError.groupNotFound - case "other": - return GroupSelectorError.other - default: - return GroupSelectorError.other - } + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupSelectorError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupSelectorError.groupNotFound + case "other": + return GroupSelectorError.other default: - fatalError("Failed to deserialize") + return GroupSelectorError.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupSelectorError.self, json: json) } } } /// Error that can be raised when GroupSelector is used and team groups are disallowed from being used. - public enum GroupSelectorWithTeamGroupError: CustomStringConvertible { + public enum GroupSelectorWithTeamGroupError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -2185,50 +2757,60 @@ open class Team { /// This operation is not supported on system-managed groups. case systemManagedGroupDisallowed + func json() throws -> JSON { + try GroupSelectorWithTeamGroupErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupSelectorWithTeamGroupErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupSelectorWithTeamGroupErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupSelectorWithTeamGroupError: \(error)" + } } } - open class GroupSelectorWithTeamGroupErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupSelectorWithTeamGroupError) -> JSON { + + public class GroupSelectorWithTeamGroupErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupSelectorWithTeamGroupError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupSelectorWithTeamGroupError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupSelectorWithTeamGroupError.groupNotFound - case "other": - return GroupSelectorWithTeamGroupError.other - case "system_managed_group_disallowed": - return GroupSelectorWithTeamGroupError.systemManagedGroupDisallowed - default: - fatalError("Unknown tag \(tag)") - } + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupSelectorWithTeamGroupError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupSelectorWithTeamGroupError.groupNotFound + case "other": + return GroupSelectorWithTeamGroupError.other + case "system_managed_group_disallowed": + return GroupSelectorWithTeamGroupError.systemManagedGroupDisallowed default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GroupSelectorWithTeamGroupError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupSelectorWithTeamGroupError.self, json: json) } } } /// The GroupDeleteError union - public enum GroupDeleteError: CustomStringConvertible { + public enum GroupDeleteError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -2238,103 +2820,142 @@ open class Team { /// This group has already been deleted. case groupAlreadyDeleted + func json() throws -> JSON { + try GroupDeleteErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupDeleteErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupDeleteErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupDeleteError: \(error)" + } } } - open class GroupDeleteErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupDeleteError) -> JSON { + + public class GroupDeleteErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupDeleteError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .groupAlreadyDeleted: - var d = [String: JSON]() - d[".tag"] = .str("group_already_deleted") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupDeleteError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupDeleteError.groupNotFound - case "other": - return GroupDeleteError.other - case "system_managed_group_disallowed": - return GroupDeleteError.systemManagedGroupDisallowed - case "group_already_deleted": - return GroupDeleteError.groupAlreadyDeleted - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .groupAlreadyDeleted: + var d = [String: JSON]() + d[".tag"] = .str("group_already_deleted") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupDeleteError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupDeleteError.groupNotFound + case "other": + return GroupDeleteError.other + case "system_managed_group_disallowed": + return GroupDeleteError.systemManagedGroupDisallowed + case "group_already_deleted": + return GroupDeleteError.groupAlreadyDeleted + default: + throw JSONSerializerError.unknownTag(type: GroupDeleteError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupDeleteError.self, json: json) } } } /// Full description of a group. - open class GroupFullInfo: TeamCommon.GroupSummary { + public class GroupFullInfo: TeamCommon.GroupSummary { /// List of group members. - public let members: Array? + public let members: [Team.GroupMemberInfo]? /// The group creation time as a UTC timestamp in milliseconds since the Unix epoch. public let created: UInt64 - public init(groupName: String, groupId: String, groupManagementType: TeamCommon.GroupManagementType, created: UInt64, groupExternalId: String? = nil, memberCount: UInt32? = nil, members: Array? = nil) { + public init( + groupName: String, + groupId: String, + groupManagementType: TeamCommon.GroupManagementType, + created: UInt64, + groupExternalId: String? = nil, + memberCount: UInt32? = nil, + members: [Team.GroupMemberInfo]? = nil + ) { self.members = members comparableValidator()(created) self.created = created - super.init(groupName: groupName, groupId: groupId, groupManagementType: groupManagementType, groupExternalId: groupExternalId, memberCount: memberCount) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupFullInfoSerializer().serialize(self)))" - } - } - open class GroupFullInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupFullInfo) -> JSON { - let output = [ - "group_name": Serialization._StringSerializer.serialize(value.groupName), - "group_id": Serialization._StringSerializer.serialize(value.groupId), - "group_management_type": TeamCommon.GroupManagementTypeSerializer().serialize(value.groupManagementType), - "created": Serialization._UInt64Serializer.serialize(value.created), - "group_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), - "member_count": NullableSerializer(Serialization._UInt32Serializer).serialize(value.memberCount), - "members": NullableSerializer(ArraySerializer(Team.GroupMemberInfoSerializer())).serialize(value.members), + super.init( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType, + groupExternalId: groupExternalId, + memberCount: memberCount + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupFullInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupFullInfo: \(error)" + } + } + } + + public class GroupFullInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupFullInfo) throws -> JSON { + let output = [ + "group_name": try Serialization._StringSerializer.serialize(value.groupName), + "group_id": try Serialization._StringSerializer.serialize(value.groupId), + "group_management_type": try TeamCommon.GroupManagementTypeSerializer().serialize(value.groupManagementType), + "created": try Serialization._UInt64Serializer.serialize(value.created), + "group_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), + "member_count": try NullableSerializer(Serialization._UInt32Serializer).serialize(value.memberCount), + "members": try NullableSerializer(ArraySerializer(Team.GroupMemberInfoSerializer())).serialize(value.members), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupFullInfo { + + public func deserialize(_ json: JSON) throws -> GroupFullInfo { switch json { - case .dictionary(let dict): - let groupName = Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) - let groupId = Serialization._StringSerializer.deserialize(dict["group_id"] ?? .null) - let groupManagementType = TeamCommon.GroupManagementTypeSerializer().deserialize(dict["group_management_type"] ?? .null) - let created = Serialization._UInt64Serializer.deserialize(dict["created"] ?? .null) - let groupExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) - let memberCount = NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["member_count"] ?? .null) - let members = NullableSerializer(ArraySerializer(Team.GroupMemberInfoSerializer())).deserialize(dict["members"] ?? .null) - return GroupFullInfo(groupName: groupName, groupId: groupId, groupManagementType: groupManagementType, created: created, groupExternalId: groupExternalId, memberCount: memberCount, members: members) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let groupName = try Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) + let groupId = try Serialization._StringSerializer.deserialize(dict["group_id"] ?? .null) + let groupManagementType = try TeamCommon.GroupManagementTypeSerializer().deserialize(dict["group_management_type"] ?? .null) + let created = try Serialization._UInt64Serializer.deserialize(dict["created"] ?? .null) + let groupExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) + let memberCount = try NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["member_count"] ?? .null) + let members = try NullableSerializer(ArraySerializer(Team.GroupMemberInfoSerializer())).deserialize(dict["members"] ?? .null) + return GroupFullInfo( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType, + created: created, + groupExternalId: groupExternalId, + memberCount: memberCount, + members: members + ) + default: + throw JSONSerializerError.deserializeError(type: GroupFullInfo.self, json: json) } } } /// Profile of group member, and role in group. - open class GroupMemberInfo: CustomStringConvertible { + public class GroupMemberInfo: CustomStringConvertible, JSONRepresentable { /// Profile of group member. public let profile: Team.MemberProfile /// The role that the user has in the group. @@ -2343,33 +2964,44 @@ open class Team { self.profile = profile self.accessType = accessType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMemberInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupMemberInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMemberInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMemberInfo: \(error)" + } } } - open class GroupMemberInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMemberInfo) -> JSON { - let output = [ - "profile": Team.MemberProfileSerializer().serialize(value.profile), - "access_type": Team.GroupAccessTypeSerializer().serialize(value.accessType), + + public class GroupMemberInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMemberInfo) throws -> JSON { + let output = [ + "profile": try Team.MemberProfileSerializer().serialize(value.profile), + "access_type": try Team.GroupAccessTypeSerializer().serialize(value.accessType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMemberInfo { + + public func deserialize(_ json: JSON) throws -> GroupMemberInfo { switch json { - case .dictionary(let dict): - let profile = Team.MemberProfileSerializer().deserialize(dict["profile"] ?? .null) - let accessType = Team.GroupAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) - return GroupMemberInfo(profile: profile, accessType: accessType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let profile = try Team.MemberProfileSerializer().deserialize(dict["profile"] ?? .null) + let accessType = try Team.GroupAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) + return GroupMemberInfo(profile: profile, accessType: accessType) + default: + throw JSONSerializerError.deserializeError(type: GroupMemberInfo.self, json: json) } } } /// Argument for selecting a group and a single user. - open class GroupMemberSelector: CustomStringConvertible { + public class GroupMemberSelector: CustomStringConvertible, JSONRepresentable { /// Specify a group. public let group: Team.GroupSelector /// Identity of a user that is a member of group. @@ -2378,34 +3010,45 @@ open class Team { self.group = group self.user = user } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMemberSelectorSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupMemberSelectorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMemberSelectorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMemberSelector: \(error)" + } } } - open class GroupMemberSelectorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMemberSelector) -> JSON { - let output = [ - "group": Team.GroupSelectorSerializer().serialize(value.group), - "user": Team.UserSelectorArgSerializer().serialize(value.user), + + public class GroupMemberSelectorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMemberSelector) throws -> JSON { + let output = [ + "group": try Team.GroupSelectorSerializer().serialize(value.group), + "user": try Team.UserSelectorArgSerializer().serialize(value.user), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMemberSelector { + + public func deserialize(_ json: JSON) throws -> GroupMemberSelector { switch json { - case .dictionary(let dict): - let group = Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - return GroupMemberSelector(group: group, user: user) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let group = try Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + return GroupMemberSelector(group: group, user: user) + default: + throw JSONSerializerError.deserializeError(type: GroupMemberSelector.self, json: json) } } } /// Error that can be raised when GroupMemberSelector is used, and the user is required to be a member of the /// specified group. - public enum GroupMemberSelectorError: CustomStringConvertible { + public enum GroupMemberSelectorError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -2415,56 +3058,66 @@ open class Team { /// The specified user is not a member of this group. case memberNotInGroup + func json() throws -> JSON { + try GroupMemberSelectorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMemberSelectorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMemberSelectorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMemberSelectorError: \(error)" + } } } - open class GroupMemberSelectorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMemberSelectorError) -> JSON { + + public class GroupMemberSelectorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMemberSelectorError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .memberNotInGroup: - var d = [String: JSON]() - d[".tag"] = .str("member_not_in_group") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupMemberSelectorError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupMemberSelectorError.groupNotFound - case "other": - return GroupMemberSelectorError.other - case "system_managed_group_disallowed": - return GroupMemberSelectorError.systemManagedGroupDisallowed - case "member_not_in_group": - return GroupMemberSelectorError.memberNotInGroup - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .memberNotInGroup: + var d = [String: JSON]() + d[".tag"] = .str("member_not_in_group") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupMemberSelectorError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupMemberSelectorError.groupNotFound + case "other": + return GroupMemberSelectorError.other + case "system_managed_group_disallowed": + return GroupMemberSelectorError.systemManagedGroupDisallowed + case "member_not_in_group": + return GroupMemberSelectorError.memberNotInGroup + default: + throw JSONSerializerError.unknownTag(type: GroupMemberSelectorError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupMemberSelectorError.self, json: json) } } } /// The GroupMemberSetAccessTypeError union - public enum GroupMemberSetAccessTypeError: CustomStringConvertible { + public enum GroupMemberSetAccessTypeError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -2476,131 +3129,159 @@ open class Team { /// A company managed group cannot be managed by a user. case userCannotBeManagerOfCompanyManagedGroup + func json() throws -> JSON { + try GroupMemberSetAccessTypeErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMemberSetAccessTypeErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMemberSetAccessTypeErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMemberSetAccessTypeError: \(error)" + } } } - open class GroupMemberSetAccessTypeErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMemberSetAccessTypeError) -> JSON { + + public class GroupMemberSetAccessTypeErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMemberSetAccessTypeError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .memberNotInGroup: - var d = [String: JSON]() - d[".tag"] = .str("member_not_in_group") - return .dictionary(d) - case .userCannotBeManagerOfCompanyManagedGroup: - var d = [String: JSON]() - d[".tag"] = .str("user_cannot_be_manager_of_company_managed_group") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupMemberSetAccessTypeError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupMemberSetAccessTypeError.groupNotFound - case "other": - return GroupMemberSetAccessTypeError.other - case "system_managed_group_disallowed": - return GroupMemberSetAccessTypeError.systemManagedGroupDisallowed - case "member_not_in_group": - return GroupMemberSetAccessTypeError.memberNotInGroup - case "user_cannot_be_manager_of_company_managed_group": - return GroupMemberSetAccessTypeError.userCannotBeManagerOfCompanyManagedGroup - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .memberNotInGroup: + var d = [String: JSON]() + d[".tag"] = .str("member_not_in_group") + return .dictionary(d) + case .userCannotBeManagerOfCompanyManagedGroup: + var d = [String: JSON]() + d[".tag"] = .str("user_cannot_be_manager_of_company_managed_group") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupMemberSetAccessTypeError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupMemberSetAccessTypeError.groupNotFound + case "other": + return GroupMemberSetAccessTypeError.other + case "system_managed_group_disallowed": + return GroupMemberSetAccessTypeError.systemManagedGroupDisallowed + case "member_not_in_group": + return GroupMemberSetAccessTypeError.memberNotInGroup + case "user_cannot_be_manager_of_company_managed_group": + return GroupMemberSetAccessTypeError.userCannotBeManagerOfCompanyManagedGroup + default: + throw JSONSerializerError.unknownTag(type: GroupMemberSetAccessTypeError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupMemberSetAccessTypeError.self, json: json) } } } /// The IncludeMembersArg struct - open class IncludeMembersArg: CustomStringConvertible { + public class IncludeMembersArg: CustomStringConvertible, JSONRepresentable { /// Whether to return the list of members in the group. Note that the default value will cause all the group /// members to be returned in the response. This may take a long time for large groups. public let returnMembers: Bool public init(returnMembers: Bool = true) { self.returnMembers = returnMembers } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IncludeMembersArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try IncludeMembersArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IncludeMembersArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IncludeMembersArg: \(error)" + } } } - open class IncludeMembersArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IncludeMembersArg) -> JSON { - let output = [ - "return_members": Serialization._BoolSerializer.serialize(value.returnMembers), + + public class IncludeMembersArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IncludeMembersArg) throws -> JSON { + let output = [ + "return_members": try Serialization._BoolSerializer.serialize(value.returnMembers), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IncludeMembersArg { + + public func deserialize(_ json: JSON) throws -> IncludeMembersArg { switch json { - case .dictionary(let dict): - let returnMembers = Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) - return IncludeMembersArg(returnMembers: returnMembers) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let returnMembers = try Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) + return IncludeMembersArg(returnMembers: returnMembers) + default: + throw JSONSerializerError.deserializeError(type: IncludeMembersArg.self, json: json) } } } /// The GroupMembersAddArg struct - open class GroupMembersAddArg: Team.IncludeMembersArg { + public class GroupMembersAddArg: Team.IncludeMembersArg { /// Group to which users will be added. public let group: Team.GroupSelector /// List of users to be added to the group. - public let members: Array - public init(group: Team.GroupSelector, members: Array, returnMembers: Bool = true) { + public let members: [Team.MemberAccess] + public init(group: Team.GroupSelector, members: [Team.MemberAccess], returnMembers: Bool = true) { self.group = group self.members = members super.init(returnMembers: returnMembers) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersAddArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersAddArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersAddArg: \(error)" + } } } - open class GroupMembersAddArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersAddArg) -> JSON { - let output = [ - "group": Team.GroupSelectorSerializer().serialize(value.group), - "members": ArraySerializer(Team.MemberAccessSerializer()).serialize(value.members), - "return_members": Serialization._BoolSerializer.serialize(value.returnMembers), + + public class GroupMembersAddArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersAddArg) throws -> JSON { + let output = [ + "group": try Team.GroupSelectorSerializer().serialize(value.group), + "members": try ArraySerializer(Team.MemberAccessSerializer()).serialize(value.members), + "return_members": try Serialization._BoolSerializer.serialize(value.returnMembers), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMembersAddArg { + + public func deserialize(_ json: JSON) throws -> GroupMembersAddArg { switch json { - case .dictionary(let dict): - let group = Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) - let members = ArraySerializer(Team.MemberAccessSerializer()).deserialize(dict["members"] ?? .null) - let returnMembers = Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) - return GroupMembersAddArg(group: group, members: members, returnMembers: returnMembers) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let group = try Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) + let members = try ArraySerializer(Team.MemberAccessSerializer()).deserialize(dict["members"] ?? .null) + let returnMembers = try Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) + return GroupMembersAddArg(group: group, members: members, returnMembers: returnMembers) + default: + throw JSONSerializerError.deserializeError(type: GroupMembersAddArg.self, json: json) } } } /// The GroupMembersAddError union - public enum GroupMembersAddError: CustomStringConvertible { + public enum GroupMembersAddError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -2613,176 +3294,205 @@ open class Team { /// Group is not in this team. You cannot add members to a group that is outside of your team. case groupNotInTeam /// These members are not part of your team. Currently, you cannot add members to a group if they are not part - /// of your team, though this may change in a subsequent version. To add new members to your Dropbox Business - /// team, use the membersAdd endpoint. - case membersNotInTeam(Array) + /// of your team, though this may change in a subsequent version. To add new members to your Dropbox + /// Business team, use the membersAdd endpoint. + case membersNotInTeam([String]) /// These users were not found in Dropbox. - case usersNotFound(Array) + case usersNotFound([String]) /// A suspended user cannot be added to a group as owner in GroupAccessType. case userMustBeActiveToBeOwner /// A company-managed group cannot be managed by a user. - case userCannotBeManagerOfCompanyManagedGroup(Array) + case userCannotBeManagerOfCompanyManagedGroup([String]) + + func json() throws -> JSON { + try GroupMembersAddErrorSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersAddErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersAddErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersAddError: \(error)" + } } } - open class GroupMembersAddErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersAddError) -> JSON { + + public class GroupMembersAddErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersAddError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .duplicateUser: - var d = [String: JSON]() - d[".tag"] = .str("duplicate_user") - return .dictionary(d) - case .groupNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("group_not_in_team") - return .dictionary(d) - case .membersNotInTeam(let arg): - var d = ["members_not_in_team": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("members_not_in_team") - return .dictionary(d) - case .usersNotFound(let arg): - var d = ["users_not_found": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("users_not_found") - return .dictionary(d) - case .userMustBeActiveToBeOwner: - var d = [String: JSON]() - d[".tag"] = .str("user_must_be_active_to_be_owner") - return .dictionary(d) - case .userCannotBeManagerOfCompanyManagedGroup(let arg): - var d = ["user_cannot_be_manager_of_company_managed_group": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("user_cannot_be_manager_of_company_managed_group") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupMembersAddError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupMembersAddError.groupNotFound - case "other": - return GroupMembersAddError.other - case "system_managed_group_disallowed": - return GroupMembersAddError.systemManagedGroupDisallowed - case "duplicate_user": - return GroupMembersAddError.duplicateUser - case "group_not_in_team": - return GroupMembersAddError.groupNotInTeam - case "members_not_in_team": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["members_not_in_team"] ?? .null) - return GroupMembersAddError.membersNotInTeam(v) - case "users_not_found": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["users_not_found"] ?? .null) - return GroupMembersAddError.usersNotFound(v) - case "user_must_be_active_to_be_owner": - return GroupMembersAddError.userMustBeActiveToBeOwner - case "user_cannot_be_manager_of_company_managed_group": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["user_cannot_be_manager_of_company_managed_group"] ?? .null) - return GroupMembersAddError.userCannotBeManagerOfCompanyManagedGroup(v) - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .duplicateUser: + var d = [String: JSON]() + d[".tag"] = .str("duplicate_user") + return .dictionary(d) + case .groupNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("group_not_in_team") + return .dictionary(d) + case .membersNotInTeam(let arg): + var d = try ["members_not_in_team": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("members_not_in_team") + return .dictionary(d) + case .usersNotFound(let arg): + var d = try ["users_not_found": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("users_not_found") + return .dictionary(d) + case .userMustBeActiveToBeOwner: + var d = [String: JSON]() + d[".tag"] = .str("user_must_be_active_to_be_owner") + return .dictionary(d) + case .userCannotBeManagerOfCompanyManagedGroup(let arg): + var d = try ["user_cannot_be_manager_of_company_managed_group": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("user_cannot_be_manager_of_company_managed_group") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupMembersAddError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupMembersAddError.groupNotFound + case "other": + return GroupMembersAddError.other + case "system_managed_group_disallowed": + return GroupMembersAddError.systemManagedGroupDisallowed + case "duplicate_user": + return GroupMembersAddError.duplicateUser + case "group_not_in_team": + return GroupMembersAddError.groupNotInTeam + case "members_not_in_team": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["members_not_in_team"] ?? .null) + return GroupMembersAddError.membersNotInTeam(v) + case "users_not_found": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["users_not_found"] ?? .null) + return GroupMembersAddError.usersNotFound(v) + case "user_must_be_active_to_be_owner": + return GroupMembersAddError.userMustBeActiveToBeOwner + case "user_cannot_be_manager_of_company_managed_group": + let v = try ArraySerializer(Serialization._StringSerializer) + .deserialize(d["user_cannot_be_manager_of_company_managed_group"] ?? .null) + return GroupMembersAddError.userCannotBeManagerOfCompanyManagedGroup(v) + default: + throw JSONSerializerError.unknownTag(type: GroupMembersAddError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupMembersAddError.self, json: json) } } } /// Result returned by groupsMembersAdd and groupsMembersRemove. - open class GroupMembersChangeResult: CustomStringConvertible { + public class GroupMembersChangeResult: CustomStringConvertible, JSONRepresentable { /// The group info after member change operation has been performed. public let groupInfo: Team.GroupFullInfo /// For legacy purposes async_job_id will always return one space ' '. Formerly, it was an ID that was used to - /// obtain the status of granting/revoking group-owned resources. It's no longer necessary because the async - /// processing now happens automatically. + /// obtain the status of granting/revoking group-owned resources. It's no longer necessary because the + /// async processing now happens automatically. public let asyncJobId: String public init(groupInfo: Team.GroupFullInfo, asyncJobId: String) { self.groupInfo = groupInfo stringValidator(minLength: 1)(asyncJobId) self.asyncJobId = asyncJobId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersChangeResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupMembersChangeResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersChangeResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersChangeResult: \(error)" + } } } - open class GroupMembersChangeResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersChangeResult) -> JSON { - let output = [ - "group_info": Team.GroupFullInfoSerializer().serialize(value.groupInfo), - "async_job_id": Serialization._StringSerializer.serialize(value.asyncJobId), + + public class GroupMembersChangeResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersChangeResult) throws -> JSON { + let output = [ + "group_info": try Team.GroupFullInfoSerializer().serialize(value.groupInfo), + "async_job_id": try Serialization._StringSerializer.serialize(value.asyncJobId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMembersChangeResult { + + public func deserialize(_ json: JSON) throws -> GroupMembersChangeResult { switch json { - case .dictionary(let dict): - let groupInfo = Team.GroupFullInfoSerializer().deserialize(dict["group_info"] ?? .null) - let asyncJobId = Serialization._StringSerializer.deserialize(dict["async_job_id"] ?? .null) - return GroupMembersChangeResult(groupInfo: groupInfo, asyncJobId: asyncJobId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let groupInfo = try Team.GroupFullInfoSerializer().deserialize(dict["group_info"] ?? .null) + let asyncJobId = try Serialization._StringSerializer.deserialize(dict["async_job_id"] ?? .null) + return GroupMembersChangeResult(groupInfo: groupInfo, asyncJobId: asyncJobId) + default: + throw JSONSerializerError.deserializeError(type: GroupMembersChangeResult.self, json: json) } } } /// The GroupMembersRemoveArg struct - open class GroupMembersRemoveArg: Team.IncludeMembersArg { + public class GroupMembersRemoveArg: Team.IncludeMembersArg { /// Group from which users will be removed. public let group: Team.GroupSelector /// List of users to be removed from the group. - public let users: Array - public init(group: Team.GroupSelector, users: Array, returnMembers: Bool = true) { + public let users: [Team.UserSelectorArg] + public init(group: Team.GroupSelector, users: [Team.UserSelectorArg], returnMembers: Bool = true) { self.group = group self.users = users super.init(returnMembers: returnMembers) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersRemoveArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersRemoveArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersRemoveArg: \(error)" + } } } - open class GroupMembersRemoveArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersRemoveArg) -> JSON { - let output = [ - "group": Team.GroupSelectorSerializer().serialize(value.group), - "users": ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.users), - "return_members": Serialization._BoolSerializer.serialize(value.returnMembers), + + public class GroupMembersRemoveArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersRemoveArg) throws -> JSON { + let output = [ + "group": try Team.GroupSelectorSerializer().serialize(value.group), + "users": try ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.users), + "return_members": try Serialization._BoolSerializer.serialize(value.returnMembers), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMembersRemoveArg { + + public func deserialize(_ json: JSON) throws -> GroupMembersRemoveArg { switch json { - case .dictionary(let dict): - let group = Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) - let users = ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["users"] ?? .null) - let returnMembers = Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) - return GroupMembersRemoveArg(group: group, users: users, returnMembers: returnMembers) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let group = try Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) + let users = try ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["users"] ?? .null) + let returnMembers = try Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) + return GroupMembersRemoveArg(group: group, users: users, returnMembers: returnMembers) + default: + throw JSONSerializerError.deserializeError(type: GroupMembersRemoveArg.self, json: json) } } } /// Error that can be raised when GroupMembersSelector is used, and the users are required to be members of the /// specified group. - public enum GroupMembersSelectorError: CustomStringConvertible { + public enum GroupMembersSelectorError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -2792,56 +3502,66 @@ open class Team { /// At least one of the specified users is not a member of the group. case memberNotInGroup + func json() throws -> JSON { + try GroupMembersSelectorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersSelectorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersSelectorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersSelectorError: \(error)" + } } } - open class GroupMembersSelectorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersSelectorError) -> JSON { + + public class GroupMembersSelectorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersSelectorError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .memberNotInGroup: - var d = [String: JSON]() - d[".tag"] = .str("member_not_in_group") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupMembersSelectorError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupMembersSelectorError.groupNotFound - case "other": - return GroupMembersSelectorError.other - case "system_managed_group_disallowed": - return GroupMembersSelectorError.systemManagedGroupDisallowed - case "member_not_in_group": - return GroupMembersSelectorError.memberNotInGroup - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .memberNotInGroup: + var d = [String: JSON]() + d[".tag"] = .str("member_not_in_group") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupMembersSelectorError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupMembersSelectorError.groupNotFound + case "other": + return GroupMembersSelectorError.other + case "system_managed_group_disallowed": + return GroupMembersSelectorError.systemManagedGroupDisallowed + case "member_not_in_group": + return GroupMembersSelectorError.memberNotInGroup + default: + throw JSONSerializerError.unknownTag(type: GroupMembersSelectorError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupMembersSelectorError.self, json: json) } } } /// The GroupMembersRemoveError union - public enum GroupMembersRemoveError: CustomStringConvertible { + public enum GroupMembersRemoveError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -2853,80 +3573,90 @@ open class Team { /// Group is not in this team. You cannot remove members from a group that is outside of your team. case groupNotInTeam /// These members are not part of your team. - case membersNotInTeam(Array) + case membersNotInTeam([String]) /// These users were not found in Dropbox. - case usersNotFound(Array) + case usersNotFound([String]) + + func json() throws -> JSON { + try GroupMembersRemoveErrorSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersRemoveErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersRemoveErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersRemoveError: \(error)" + } } } - open class GroupMembersRemoveErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersRemoveError) -> JSON { + + public class GroupMembersRemoveErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersRemoveError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .memberNotInGroup: - var d = [String: JSON]() - d[".tag"] = .str("member_not_in_group") - return .dictionary(d) - case .groupNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("group_not_in_team") - return .dictionary(d) - case .membersNotInTeam(let arg): - var d = ["members_not_in_team": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("members_not_in_team") - return .dictionary(d) - case .usersNotFound(let arg): - var d = ["users_not_found": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("users_not_found") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupMembersRemoveError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupMembersRemoveError.groupNotFound - case "other": - return GroupMembersRemoveError.other - case "system_managed_group_disallowed": - return GroupMembersRemoveError.systemManagedGroupDisallowed - case "member_not_in_group": - return GroupMembersRemoveError.memberNotInGroup - case "group_not_in_team": - return GroupMembersRemoveError.groupNotInTeam - case "members_not_in_team": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["members_not_in_team"] ?? .null) - return GroupMembersRemoveError.membersNotInTeam(v) - case "users_not_found": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["users_not_found"] ?? .null) - return GroupMembersRemoveError.usersNotFound(v) - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .memberNotInGroup: + var d = [String: JSON]() + d[".tag"] = .str("member_not_in_group") + return .dictionary(d) + case .groupNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("group_not_in_team") + return .dictionary(d) + case .membersNotInTeam(let arg): + var d = try ["members_not_in_team": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("members_not_in_team") + return .dictionary(d) + case .usersNotFound(let arg): + var d = try ["users_not_found": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("users_not_found") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupMembersRemoveError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupMembersRemoveError.groupNotFound + case "other": + return GroupMembersRemoveError.other + case "system_managed_group_disallowed": + return GroupMembersRemoveError.systemManagedGroupDisallowed + case "member_not_in_group": + return GroupMembersRemoveError.memberNotInGroup + case "group_not_in_team": + return GroupMembersRemoveError.groupNotInTeam + case "members_not_in_team": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["members_not_in_team"] ?? .null) + return GroupMembersRemoveError.membersNotInTeam(v) + case "users_not_found": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["users_not_found"] ?? .null) + return GroupMembersRemoveError.usersNotFound(v) + default: + throw JSONSerializerError.unknownTag(type: GroupMembersRemoveError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupMembersRemoveError.self, json: json) } } } /// Argument for selecting a group and a list of users. - open class GroupMembersSelector: CustomStringConvertible { + public class GroupMembersSelector: CustomStringConvertible, JSONRepresentable { /// Specify a group. public let group: Team.GroupSelector /// A list of users that are members of group. @@ -2935,33 +3665,44 @@ open class Team { self.group = group self.users = users } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersSelectorSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupMembersSelectorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersSelectorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersSelector: \(error)" + } } } - open class GroupMembersSelectorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersSelector) -> JSON { - let output = [ - "group": Team.GroupSelectorSerializer().serialize(value.group), - "users": Team.UsersSelectorArgSerializer().serialize(value.users), + + public class GroupMembersSelectorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersSelector) throws -> JSON { + let output = [ + "group": try Team.GroupSelectorSerializer().serialize(value.group), + "users": try Team.UsersSelectorArgSerializer().serialize(value.users), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMembersSelector { + + public func deserialize(_ json: JSON) throws -> GroupMembersSelector { switch json { - case .dictionary(let dict): - let group = Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) - let users = Team.UsersSelectorArgSerializer().deserialize(dict["users"] ?? .null) - return GroupMembersSelector(group: group, users: users) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let group = try Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) + let users = try Team.UsersSelectorArgSerializer().deserialize(dict["users"] ?? .null) + return GroupMembersSelector(group: group, users: users) + default: + throw JSONSerializerError.deserializeError(type: GroupMembersSelector.self, json: json) } } } /// The GroupMembersSetAccessTypeArg struct - open class GroupMembersSetAccessTypeArg: Team.GroupMemberSelector { + public class GroupMembersSetAccessTypeArg: Team.GroupMemberSelector { /// New group access type the user will have. public let accessType: Team.GroupAccessType /// Whether to return the list of members in the group. Note that the default value will cause all the group @@ -2972,82 +3713,99 @@ open class Team { self.returnMembers = returnMembers super.init(group: group, user: user) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMembersSetAccessTypeArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMembersSetAccessTypeArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMembersSetAccessTypeArg: \(error)" + } } } - open class GroupMembersSetAccessTypeArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMembersSetAccessTypeArg) -> JSON { - let output = [ - "group": Team.GroupSelectorSerializer().serialize(value.group), - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "access_type": Team.GroupAccessTypeSerializer().serialize(value.accessType), - "return_members": Serialization._BoolSerializer.serialize(value.returnMembers), + + public class GroupMembersSetAccessTypeArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMembersSetAccessTypeArg) throws -> JSON { + let output = [ + "group": try Team.GroupSelectorSerializer().serialize(value.group), + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "access_type": try Team.GroupAccessTypeSerializer().serialize(value.accessType), + "return_members": try Serialization._BoolSerializer.serialize(value.returnMembers), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMembersSetAccessTypeArg { + + public func deserialize(_ json: JSON) throws -> GroupMembersSetAccessTypeArg { switch json { - case .dictionary(let dict): - let group = Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let accessType = Team.GroupAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) - let returnMembers = Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) - return GroupMembersSetAccessTypeArg(group: group, user: user, accessType: accessType, returnMembers: returnMembers) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let group = try Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let accessType = try Team.GroupAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) + let returnMembers = try Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) + return GroupMembersSetAccessTypeArg(group: group, user: user, accessType: accessType, returnMembers: returnMembers) + default: + throw JSONSerializerError.deserializeError(type: GroupMembersSetAccessTypeArg.self, json: json) } } } /// Argument for selecting a single group, either by group_id or by external group ID. - public enum GroupSelector: CustomStringConvertible { + public enum GroupSelector: CustomStringConvertible, JSONRepresentable { /// Group ID. case groupId(String) /// External ID of the group. case groupExternalId(String) + func json() throws -> JSON { + try GroupSelectorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupSelectorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupSelectorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupSelector: \(error)" + } } } - open class GroupSelectorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupSelector) -> JSON { + + public class GroupSelectorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupSelector) throws -> JSON { switch value { - case .groupId(let arg): - var d = ["group_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("group_id") - return .dictionary(d) - case .groupExternalId(let arg): - var d = ["group_external_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("group_external_id") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupSelector { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_id": - let v = Serialization._StringSerializer.deserialize(d["group_id"] ?? .null) - return GroupSelector.groupId(v) - case "group_external_id": - let v = Serialization._StringSerializer.deserialize(d["group_external_id"] ?? .null) - return GroupSelector.groupExternalId(v) - default: - fatalError("Unknown tag \(tag)") - } + case .groupId(let arg): + var d = try ["group_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("group_id") + return .dictionary(d) + case .groupExternalId(let arg): + var d = try ["group_external_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("group_external_id") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupSelector { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_id": + let v = try Serialization._StringSerializer.deserialize(d["group_id"] ?? .null) + return GroupSelector.groupId(v) + case "group_external_id": + let v = try Serialization._StringSerializer.deserialize(d["group_external_id"] ?? .null) + return GroupSelector.groupExternalId(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GroupSelector.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupSelector.self, json: json) } } } /// The GroupUpdateArgs struct - open class GroupUpdateArgs: Team.IncludeMembersArg { + public class GroupUpdateArgs: Team.IncludeMembersArg { /// Specify a group. public let group: Team.GroupSelector /// Optional argument. Set group name to this if provided. @@ -3057,7 +3815,13 @@ open class Team { public let newGroupExternalId: String? /// Set new group management type, if provided. public let newGroupManagementType: TeamCommon.GroupManagementType? - public init(group: Team.GroupSelector, returnMembers: Bool = true, newGroupName: String? = nil, newGroupExternalId: String? = nil, newGroupManagementType: TeamCommon.GroupManagementType? = nil) { + public init( + group: Team.GroupSelector, + returnMembers: Bool = true, + newGroupName: String? = nil, + newGroupExternalId: String? = nil, + newGroupManagementType: TeamCommon.GroupManagementType? = nil + ) { self.group = group nullableValidator(stringValidator())(newGroupName) self.newGroupName = newGroupName @@ -3066,39 +3830,53 @@ open class Team { self.newGroupManagementType = newGroupManagementType super.init(returnMembers: returnMembers) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupUpdateArgsSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupUpdateArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupUpdateArgs: \(error)" + } } } - open class GroupUpdateArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupUpdateArgs) -> JSON { - let output = [ - "group": Team.GroupSelectorSerializer().serialize(value.group), - "return_members": Serialization._BoolSerializer.serialize(value.returnMembers), - "new_group_name": NullableSerializer(Serialization._StringSerializer).serialize(value.newGroupName), - "new_group_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.newGroupExternalId), - "new_group_management_type": NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).serialize(value.newGroupManagementType), + + public class GroupUpdateArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupUpdateArgs) throws -> JSON { + let output = [ + "group": try Team.GroupSelectorSerializer().serialize(value.group), + "return_members": try Serialization._BoolSerializer.serialize(value.returnMembers), + "new_group_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.newGroupName), + "new_group_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.newGroupExternalId), + "new_group_management_type": try NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).serialize(value.newGroupManagementType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupUpdateArgs { + + public func deserialize(_ json: JSON) throws -> GroupUpdateArgs { switch json { - case .dictionary(let dict): - let group = Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) - let returnMembers = Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) - let newGroupName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_group_name"] ?? .null) - let newGroupExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_group_external_id"] ?? .null) - let newGroupManagementType = NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).deserialize(dict["new_group_management_type"] ?? .null) - return GroupUpdateArgs(group: group, returnMembers: returnMembers, newGroupName: newGroupName, newGroupExternalId: newGroupExternalId, newGroupManagementType: newGroupManagementType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let group = try Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) + let returnMembers = try Serialization._BoolSerializer.deserialize(dict["return_members"] ?? .number(1)) + let newGroupName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_group_name"] ?? .null) + let newGroupExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_group_external_id"] ?? .null) + let newGroupManagementType = try NullableSerializer(TeamCommon.GroupManagementTypeSerializer()) + .deserialize(dict["new_group_management_type"] ?? .null) + return GroupUpdateArgs( + group: group, + returnMembers: returnMembers, + newGroupName: newGroupName, + newGroupExternalId: newGroupExternalId, + newGroupManagementType: newGroupManagementType + ) + default: + throw JSONSerializerError.deserializeError(type: GroupUpdateArgs.self, json: json) } } } /// The GroupUpdateError union - public enum GroupUpdateError: CustomStringConvertible { + public enum GroupUpdateError: CustomStringConvertible, JSONRepresentable { /// No matching group found. No groups match the specified group ID. case groupNotFound /// An unspecified error. @@ -3112,456 +3890,572 @@ open class Team { /// The requested external ID is already being used by another group. case externalIdAlreadyInUse + func json() throws -> JSON { + try GroupUpdateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupUpdateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupUpdateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupUpdateError: \(error)" + } } } - open class GroupUpdateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupUpdateError) -> JSON { + + public class GroupUpdateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupUpdateError) throws -> JSON { switch value { - case .groupNotFound: - var d = [String: JSON]() - d[".tag"] = .str("group_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .systemManagedGroupDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("system_managed_group_disallowed") - return .dictionary(d) - case .groupNameAlreadyUsed: - var d = [String: JSON]() - d[".tag"] = .str("group_name_already_used") - return .dictionary(d) - case .groupNameInvalid: - var d = [String: JSON]() - d[".tag"] = .str("group_name_invalid") - return .dictionary(d) - case .externalIdAlreadyInUse: - var d = [String: JSON]() - d[".tag"] = .str("external_id_already_in_use") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupUpdateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_found": - return GroupUpdateError.groupNotFound - case "other": - return GroupUpdateError.other - case "system_managed_group_disallowed": - return GroupUpdateError.systemManagedGroupDisallowed - case "group_name_already_used": - return GroupUpdateError.groupNameAlreadyUsed - case "group_name_invalid": - return GroupUpdateError.groupNameInvalid - case "external_id_already_in_use": - return GroupUpdateError.externalIdAlreadyInUse - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .groupNotFound: + var d = [String: JSON]() + d[".tag"] = .str("group_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .systemManagedGroupDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("system_managed_group_disallowed") + return .dictionary(d) + case .groupNameAlreadyUsed: + var d = [String: JSON]() + d[".tag"] = .str("group_name_already_used") + return .dictionary(d) + case .groupNameInvalid: + var d = [String: JSON]() + d[".tag"] = .str("group_name_invalid") + return .dictionary(d) + case .externalIdAlreadyInUse: + var d = [String: JSON]() + d[".tag"] = .str("external_id_already_in_use") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupUpdateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_found": + return GroupUpdateError.groupNotFound + case "other": + return GroupUpdateError.other + case "system_managed_group_disallowed": + return GroupUpdateError.systemManagedGroupDisallowed + case "group_name_already_used": + return GroupUpdateError.groupNameAlreadyUsed + case "group_name_invalid": + return GroupUpdateError.groupNameInvalid + case "external_id_already_in_use": + return GroupUpdateError.externalIdAlreadyInUse + default: + throw JSONSerializerError.unknownTag(type: GroupUpdateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupUpdateError.self, json: json) } } } /// The GroupsGetInfoError union - public enum GroupsGetInfoError: CustomStringConvertible { + public enum GroupsGetInfoError: CustomStringConvertible, JSONRepresentable { /// The group is not on your team. case groupNotOnTeam /// An unspecified error. case other + func json() throws -> JSON { + try GroupsGetInfoErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsGetInfoErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsGetInfoErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsGetInfoError: \(error)" + } } } - open class GroupsGetInfoErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsGetInfoError) -> JSON { + + public class GroupsGetInfoErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsGetInfoError) throws -> JSON { switch value { - case .groupNotOnTeam: - var d = [String: JSON]() - d[".tag"] = .str("group_not_on_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupsGetInfoError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_not_on_team": - return GroupsGetInfoError.groupNotOnTeam - case "other": - return GroupsGetInfoError.other - default: - return GroupsGetInfoError.other - } + case .groupNotOnTeam: + var d = [String: JSON]() + d[".tag"] = .str("group_not_on_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupsGetInfoError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_not_on_team": + return GroupsGetInfoError.groupNotOnTeam + case "other": + return GroupsGetInfoError.other default: - fatalError("Failed to deserialize") + return GroupsGetInfoError.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupsGetInfoError.self, json: json) } } } /// The GroupsGetInfoItem union - public enum GroupsGetInfoItem: CustomStringConvertible { + public enum GroupsGetInfoItem: CustomStringConvertible, JSONRepresentable { /// An ID that was provided as a parameter to groupsGetInfo, and did not match a corresponding group. The ID can /// be a group ID, or an external ID, depending on how the method was called. case idNotFound(String) /// Info about a group. case groupInfo(Team.GroupFullInfo) + func json() throws -> JSON { + try GroupsGetInfoItemSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsGetInfoItemSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsGetInfoItemSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsGetInfoItem: \(error)" + } } } - open class GroupsGetInfoItemSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsGetInfoItem) -> JSON { + + public class GroupsGetInfoItemSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsGetInfoItem) throws -> JSON { switch value { - case .idNotFound(let arg): - var d = ["id_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("id_not_found") - return .dictionary(d) - case .groupInfo(let arg): - var d = Serialization.getFields(Team.GroupFullInfoSerializer().serialize(arg)) - d[".tag"] = .str("group_info") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupsGetInfoItem { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "id_not_found": - let v = Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) - return GroupsGetInfoItem.idNotFound(v) - case "group_info": - let v = Team.GroupFullInfoSerializer().deserialize(json) - return GroupsGetInfoItem.groupInfo(v) - default: - fatalError("Unknown tag \(tag)") - } + case .idNotFound(let arg): + var d = try ["id_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("id_not_found") + return .dictionary(d) + case .groupInfo(let arg): + var d = try Serialization.getFields(Team.GroupFullInfoSerializer().serialize(arg)) + d[".tag"] = .str("group_info") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupsGetInfoItem { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "id_not_found": + let v = try Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) + return GroupsGetInfoItem.idNotFound(v) + case "group_info": + let v = try Team.GroupFullInfoSerializer().deserialize(json) + return GroupsGetInfoItem.groupInfo(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GroupsGetInfoItem.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupsGetInfoItem.self, json: json) } } } /// The GroupsListArg struct - open class GroupsListArg: CustomStringConvertible { + public class GroupsListArg: CustomStringConvertible, JSONRepresentable { /// Number of results to return per call. public let limit: UInt32 - public init(limit: UInt32 = 1000) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(limit: UInt32 = 1_000) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupsListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsListArg: \(error)" + } } } - open class GroupsListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsListArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class GroupsListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsListArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupsListArg { + + public func deserialize(_ json: JSON) throws -> GroupsListArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return GroupsListArg(limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return GroupsListArg(limit: limit) + default: + throw JSONSerializerError.deserializeError(type: GroupsListArg.self, json: json) } } } /// The GroupsListContinueArg struct - open class GroupsListContinueArg: CustomStringConvertible { + public class GroupsListContinueArg: CustomStringConvertible, JSONRepresentable { /// Indicates from what point to get the next set of groups. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsListContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupsListContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsListContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsListContinueArg: \(error)" + } } } - open class GroupsListContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsListContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class GroupsListContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsListContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupsListContinueArg { + + public func deserialize(_ json: JSON) throws -> GroupsListContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return GroupsListContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return GroupsListContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: GroupsListContinueArg.self, json: json) } } } /// The GroupsListContinueError union - public enum GroupsListContinueError: CustomStringConvertible { + public enum GroupsListContinueError: CustomStringConvertible, JSONRepresentable { /// The cursor is invalid. case invalidCursor /// An unspecified error. case other + func json() throws -> JSON { + try GroupsListContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsListContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsListContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsListContinueError: \(error)" + } } } - open class GroupsListContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsListContinueError) -> JSON { + + public class GroupsListContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsListContinueError) throws -> JSON { switch value { - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupsListContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_cursor": - return GroupsListContinueError.invalidCursor - case "other": - return GroupsListContinueError.other - default: - return GroupsListContinueError.other - } + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupsListContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_cursor": + return GroupsListContinueError.invalidCursor + case "other": + return GroupsListContinueError.other default: - fatalError("Failed to deserialize") + return GroupsListContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupsListContinueError.self, json: json) } } } /// The GroupsListResult struct - open class GroupsListResult: CustomStringConvertible { + public class GroupsListResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let groups: Array + public let groups: [TeamCommon.GroupSummary] /// Pass the cursor into groupsListContinue to obtain the additional groups. public let cursor: String /// Is true if there are additional groups that have not been returned yet. An additional call to /// groupsListContinue can retrieve them. public let hasMore: Bool - public init(groups: Array, cursor: String, hasMore: Bool) { + public init(groups: [TeamCommon.GroupSummary], cursor: String, hasMore: Bool) { self.groups = groups stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsListResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupsListResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsListResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsListResult: \(error)" + } } } - open class GroupsListResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsListResult) -> JSON { - let output = [ - "groups": ArraySerializer(TeamCommon.GroupSummarySerializer()).serialize(value.groups), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class GroupsListResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsListResult) throws -> JSON { + let output = [ + "groups": try ArraySerializer(TeamCommon.GroupSummarySerializer()).serialize(value.groups), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupsListResult { + + public func deserialize(_ json: JSON) throws -> GroupsListResult { switch json { - case .dictionary(let dict): - let groups = ArraySerializer(TeamCommon.GroupSummarySerializer()).deserialize(dict["groups"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return GroupsListResult(groups: groups, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let groups = try ArraySerializer(TeamCommon.GroupSummarySerializer()).deserialize(dict["groups"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return GroupsListResult(groups: groups, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: GroupsListResult.self, json: json) } } } /// The GroupsMembersListArg struct - open class GroupsMembersListArg: CustomStringConvertible { + public class GroupsMembersListArg: CustomStringConvertible, JSONRepresentable { /// The group whose members are to be listed. public let group: Team.GroupSelector /// Number of results to return per call. public let limit: UInt32 - public init(group: Team.GroupSelector, limit: UInt32 = 1000) { + public init(group: Team.GroupSelector, limit: UInt32 = 1_000) { self.group = group - comparableValidator(minValue: 1, maxValue: 1000)(limit) + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsMembersListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupsMembersListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsMembersListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsMembersListArg: \(error)" + } } } - open class GroupsMembersListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsMembersListArg) -> JSON { - let output = [ - "group": Team.GroupSelectorSerializer().serialize(value.group), - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class GroupsMembersListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsMembersListArg) throws -> JSON { + let output = [ + "group": try Team.GroupSelectorSerializer().serialize(value.group), + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupsMembersListArg { + + public func deserialize(_ json: JSON) throws -> GroupsMembersListArg { switch json { - case .dictionary(let dict): - let group = Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return GroupsMembersListArg(group: group, limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let group = try Team.GroupSelectorSerializer().deserialize(dict["group"] ?? .null) + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return GroupsMembersListArg(group: group, limit: limit) + default: + throw JSONSerializerError.deserializeError(type: GroupsMembersListArg.self, json: json) } } } /// The GroupsMembersListContinueArg struct - open class GroupsMembersListContinueArg: CustomStringConvertible { + public class GroupsMembersListContinueArg: CustomStringConvertible, JSONRepresentable { /// Indicates from what point to get the next set of groups. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsMembersListContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupsMembersListContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsMembersListContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsMembersListContinueArg: \(error)" + } } } - open class GroupsMembersListContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsMembersListContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class GroupsMembersListContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsMembersListContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupsMembersListContinueArg { + + public func deserialize(_ json: JSON) throws -> GroupsMembersListContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return GroupsMembersListContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return GroupsMembersListContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: GroupsMembersListContinueArg.self, json: json) } } } /// The GroupsMembersListContinueError union - public enum GroupsMembersListContinueError: CustomStringConvertible { + public enum GroupsMembersListContinueError: CustomStringConvertible, JSONRepresentable { /// The cursor is invalid. case invalidCursor /// An unspecified error. case other + func json() throws -> JSON { + try GroupsMembersListContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsMembersListContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsMembersListContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsMembersListContinueError: \(error)" + } } } - open class GroupsMembersListContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsMembersListContinueError) -> JSON { + + public class GroupsMembersListContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsMembersListContinueError) throws -> JSON { switch value { - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupsMembersListContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_cursor": - return GroupsMembersListContinueError.invalidCursor - case "other": - return GroupsMembersListContinueError.other - default: - return GroupsMembersListContinueError.other - } + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupsMembersListContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_cursor": + return GroupsMembersListContinueError.invalidCursor + case "other": + return GroupsMembersListContinueError.other default: - fatalError("Failed to deserialize") + return GroupsMembersListContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupsMembersListContinueError.self, json: json) } } } /// The GroupsMembersListResult struct - open class GroupsMembersListResult: CustomStringConvertible { + public class GroupsMembersListResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let members: Array + public let members: [Team.GroupMemberInfo] /// Pass the cursor into groupsMembersListContinue to obtain additional group members. public let cursor: String /// Is true if there are additional group members that have not been returned yet. An additional call to /// groupsMembersListContinue can retrieve them. public let hasMore: Bool - public init(members: Array, cursor: String, hasMore: Bool) { + public init(members: [Team.GroupMemberInfo], cursor: String, hasMore: Bool) { self.members = members stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsMembersListResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupsMembersListResultSerializer().serialize(self) } - } - open class GroupsMembersListResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsMembersListResult) -> JSON { - let output = [ - "members": ArraySerializer(Team.GroupMemberInfoSerializer()).serialize(value.members), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsMembersListResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsMembersListResult: \(error)" + } + } + } + + public class GroupsMembersListResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsMembersListResult) throws -> JSON { + let output = [ + "members": try ArraySerializer(Team.GroupMemberInfoSerializer()).serialize(value.members), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupsMembersListResult { + + public func deserialize(_ json: JSON) throws -> GroupsMembersListResult { switch json { - case .dictionary(let dict): - let members = ArraySerializer(Team.GroupMemberInfoSerializer()).deserialize(dict["members"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return GroupsMembersListResult(members: members, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let members = try ArraySerializer(Team.GroupMemberInfoSerializer()).deserialize(dict["members"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return GroupsMembersListResult(members: members, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: GroupsMembersListResult.self, json: json) } } } /// The GroupsPollError union - public enum GroupsPollError: CustomStringConvertible { + public enum GroupsPollError: CustomStringConvertible, JSONRepresentable { /// The job ID is invalid. case invalidAsyncJobId /// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking @@ -3572,233 +4466,283 @@ open class Team { /// You are not allowed to poll this job. case accessDenied + func json() throws -> JSON { + try GroupsPollErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsPollErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsPollErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsPollError: \(error)" + } } } - open class GroupsPollErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsPollError) -> JSON { + + public class GroupsPollErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsPollError) throws -> JSON { switch value { - case .invalidAsyncJobId: - var d = [String: JSON]() - d[".tag"] = .str("invalid_async_job_id") - return .dictionary(d) - case .internalError: - var d = [String: JSON]() - d[".tag"] = .str("internal_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .accessDenied: - var d = [String: JSON]() - d[".tag"] = .str("access_denied") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupsPollError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_async_job_id": - return GroupsPollError.invalidAsyncJobId - case "internal_error": - return GroupsPollError.internalError - case "other": - return GroupsPollError.other - case "access_denied": - return GroupsPollError.accessDenied - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .invalidAsyncJobId: + var d = [String: JSON]() + d[".tag"] = .str("invalid_async_job_id") + return .dictionary(d) + case .internalError: + var d = [String: JSON]() + d[".tag"] = .str("internal_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .accessDenied: + var d = [String: JSON]() + d[".tag"] = .str("access_denied") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupsPollError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_async_job_id": + return GroupsPollError.invalidAsyncJobId + case "internal_error": + return GroupsPollError.internalError + case "other": + return GroupsPollError.other + case "access_denied": + return GroupsPollError.accessDenied + default: + throw JSONSerializerError.unknownTag(type: GroupsPollError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupsPollError.self, json: json) } } } /// Argument for selecting a list of groups, either by group_ids, or external group IDs. - public enum GroupsSelector: CustomStringConvertible { + public enum GroupsSelector: CustomStringConvertible, JSONRepresentable { /// List of group IDs. - case groupIds(Array) + case groupIds([String]) /// List of external IDs of groups. - case groupExternalIds(Array) + case groupExternalIds([String]) + + func json() throws -> JSON { + try GroupsSelectorSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupsSelectorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupsSelectorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupsSelector: \(error)" + } } } - open class GroupsSelectorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupsSelector) -> JSON { + + public class GroupsSelectorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupsSelector) throws -> JSON { switch value { - case .groupIds(let arg): - var d = ["group_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("group_ids") - return .dictionary(d) - case .groupExternalIds(let arg): - var d = ["group_external_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("group_external_ids") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupsSelector { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group_ids": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["group_ids"] ?? .null) - return GroupsSelector.groupIds(v) - case "group_external_ids": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["group_external_ids"] ?? .null) - return GroupsSelector.groupExternalIds(v) - default: - fatalError("Unknown tag \(tag)") - } + case .groupIds(let arg): + var d = try ["group_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("group_ids") + return .dictionary(d) + case .groupExternalIds(let arg): + var d = try ["group_external_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("group_external_ids") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupsSelector { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group_ids": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["group_ids"] ?? .null) + return GroupsSelector.groupIds(v) + case "group_external_ids": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["group_external_ids"] ?? .null) + return GroupsSelector.groupExternalIds(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GroupsSelector.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupsSelector.self, json: json) } } } /// The value for hasTeamFileEvents in Feature. - public enum HasTeamFileEventsValue: CustomStringConvertible { + public enum HasTeamFileEventsValue: CustomStringConvertible, JSONRepresentable { /// Does this team have file events. case enabled(Bool) /// An unspecified error. case other + func json() throws -> JSON { + try HasTeamFileEventsValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(HasTeamFileEventsValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try HasTeamFileEventsValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for HasTeamFileEventsValue: \(error)" + } } } - open class HasTeamFileEventsValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: HasTeamFileEventsValue) -> JSON { + + public class HasTeamFileEventsValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: HasTeamFileEventsValue) throws -> JSON { switch value { - case .enabled(let arg): - var d = ["enabled": Serialization._BoolSerializer.serialize(arg)] - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> HasTeamFileEventsValue { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "enabled": - let v = Serialization._BoolSerializer.deserialize(d["enabled"] ?? .null) - return HasTeamFileEventsValue.enabled(v) - case "other": - return HasTeamFileEventsValue.other - default: - return HasTeamFileEventsValue.other - } + case .enabled(let arg): + var d = try ["enabled": Serialization._BoolSerializer.serialize(arg)] + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> HasTeamFileEventsValue { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "enabled": + let v = try Serialization._BoolSerializer.deserialize(d["enabled"] ?? .null) + return HasTeamFileEventsValue.enabled(v) + case "other": + return HasTeamFileEventsValue.other default: - fatalError("Failed to deserialize") + return HasTeamFileEventsValue.other + } + default: + throw JSONSerializerError.deserializeError(type: HasTeamFileEventsValue.self, json: json) } } } /// The value for hasTeamSelectiveSync in Feature. - public enum HasTeamSelectiveSyncValue: CustomStringConvertible { + public enum HasTeamSelectiveSyncValue: CustomStringConvertible, JSONRepresentable { /// Does this team have team selective sync enabled. case hasTeamSelectiveSync(Bool) /// An unspecified error. case other + func json() throws -> JSON { + try HasTeamSelectiveSyncValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(HasTeamSelectiveSyncValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try HasTeamSelectiveSyncValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for HasTeamSelectiveSyncValue: \(error)" + } } } - open class HasTeamSelectiveSyncValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: HasTeamSelectiveSyncValue) -> JSON { + + public class HasTeamSelectiveSyncValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: HasTeamSelectiveSyncValue) throws -> JSON { switch value { - case .hasTeamSelectiveSync(let arg): - var d = ["has_team_selective_sync": Serialization._BoolSerializer.serialize(arg)] - d[".tag"] = .str("has_team_selective_sync") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> HasTeamSelectiveSyncValue { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "has_team_selective_sync": - let v = Serialization._BoolSerializer.deserialize(d["has_team_selective_sync"] ?? .null) - return HasTeamSelectiveSyncValue.hasTeamSelectiveSync(v) - case "other": - return HasTeamSelectiveSyncValue.other - default: - return HasTeamSelectiveSyncValue.other - } + case .hasTeamSelectiveSync(let arg): + var d = try ["has_team_selective_sync": Serialization._BoolSerializer.serialize(arg)] + d[".tag"] = .str("has_team_selective_sync") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> HasTeamSelectiveSyncValue { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "has_team_selective_sync": + let v = try Serialization._BoolSerializer.deserialize(d["has_team_selective_sync"] ?? .null) + return HasTeamSelectiveSyncValue.hasTeamSelectiveSync(v) + case "other": + return HasTeamSelectiveSyncValue.other default: - fatalError("Failed to deserialize") + return HasTeamSelectiveSyncValue.other + } + default: + throw JSONSerializerError.deserializeError(type: HasTeamSelectiveSyncValue.self, json: json) } } } /// The value for hasTeamSharedDropbox in Feature. - public enum HasTeamSharedDropboxValue: CustomStringConvertible { + public enum HasTeamSharedDropboxValue: CustomStringConvertible, JSONRepresentable { /// Does this team have a shared team root. case hasTeamSharedDropbox(Bool) /// An unspecified error. case other + func json() throws -> JSON { + try HasTeamSharedDropboxValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(HasTeamSharedDropboxValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try HasTeamSharedDropboxValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for HasTeamSharedDropboxValue: \(error)" + } } } - open class HasTeamSharedDropboxValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: HasTeamSharedDropboxValue) -> JSON { + + public class HasTeamSharedDropboxValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: HasTeamSharedDropboxValue) throws -> JSON { switch value { - case .hasTeamSharedDropbox(let arg): - var d = ["has_team_shared_dropbox": Serialization._BoolSerializer.serialize(arg)] - d[".tag"] = .str("has_team_shared_dropbox") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> HasTeamSharedDropboxValue { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "has_team_shared_dropbox": - let v = Serialization._BoolSerializer.deserialize(d["has_team_shared_dropbox"] ?? .null) - return HasTeamSharedDropboxValue.hasTeamSharedDropbox(v) - case "other": - return HasTeamSharedDropboxValue.other - default: - return HasTeamSharedDropboxValue.other - } + case .hasTeamSharedDropbox(let arg): + var d = try ["has_team_shared_dropbox": Serialization._BoolSerializer.serialize(arg)] + d[".tag"] = .str("has_team_shared_dropbox") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> HasTeamSharedDropboxValue { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "has_team_shared_dropbox": + let v = try Serialization._BoolSerializer.deserialize(d["has_team_shared_dropbox"] ?? .null) + return HasTeamSharedDropboxValue.hasTeamSharedDropbox(v) + case "other": + return HasTeamSharedDropboxValue.other default: - fatalError("Failed to deserialize") + return HasTeamSharedDropboxValue.other + } + default: + throw JSONSerializerError.deserializeError(type: HasTeamSharedDropboxValue.self, json: json) } } } /// The LegalHoldHeldRevisionMetadata struct - open class LegalHoldHeldRevisionMetadata: CustomStringConvertible { + public class LegalHoldHeldRevisionMetadata: CustomStringConvertible, JSONRepresentable { /// The held revision filename. public let newFilename: String /// The id of the held revision. @@ -3820,7 +4764,18 @@ open class Team { /// A hash of the file content. This field can be used to verify data integrity. For more information see our /// Content hash https://www.dropbox.com/developers/reference/content-hash page. public let contentHash: String - public init(newFilename: String, originalRevisionId: String, originalFilePath: String, serverModified: Date, authorMemberId: String, authorMemberStatus: Team.TeamMemberStatus, authorEmail: String, fileType: String, size: UInt64, contentHash: String) { + public init( + newFilename: String, + originalRevisionId: String, + originalFilePath: String, + serverModified: Date, + authorMemberId: String, + authorMemberStatus: Team.TeamMemberStatus, + authorEmail: String, + fileType: String, + size: UInt64, + contentHash: String + ) { stringValidator()(newFilename) self.newFilename = newFilename stringValidator(minLength: 9, pattern: "[0-9a-f]+")(originalRevisionId) @@ -3840,49 +4795,71 @@ open class Team { stringValidator(minLength: 64, maxLength: 64)(contentHash) self.contentHash = contentHash } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldHeldRevisionMetadataSerializer().serialize(self)))" - } - } - open class LegalHoldHeldRevisionMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldHeldRevisionMetadata) -> JSON { - let output = [ - "new_filename": Serialization._StringSerializer.serialize(value.newFilename), - "original_revision_id": Serialization._StringSerializer.serialize(value.originalRevisionId), - "original_file_path": Serialization._StringSerializer.serialize(value.originalFilePath), - "server_modified": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.serverModified), - "author_member_id": Serialization._StringSerializer.serialize(value.authorMemberId), - "author_member_status": Team.TeamMemberStatusSerializer().serialize(value.authorMemberStatus), - "author_email": Serialization._StringSerializer.serialize(value.authorEmail), - "file_type": Serialization._StringSerializer.serialize(value.fileType), - "size": Serialization._UInt64Serializer.serialize(value.size), - "content_hash": Serialization._StringSerializer.serialize(value.contentHash), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> LegalHoldHeldRevisionMetadata { - switch json { - case .dictionary(let dict): - let newFilename = Serialization._StringSerializer.deserialize(dict["new_filename"] ?? .null) - let originalRevisionId = Serialization._StringSerializer.deserialize(dict["original_revision_id"] ?? .null) - let originalFilePath = Serialization._StringSerializer.deserialize(dict["original_file_path"] ?? .null) - let serverModified = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["server_modified"] ?? .null) - let authorMemberId = Serialization._StringSerializer.deserialize(dict["author_member_id"] ?? .null) - let authorMemberStatus = Team.TeamMemberStatusSerializer().deserialize(dict["author_member_status"] ?? .null) - let authorEmail = Serialization._StringSerializer.deserialize(dict["author_email"] ?? .null) - let fileType = Serialization._StringSerializer.deserialize(dict["file_type"] ?? .null) - let size = Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) - let contentHash = Serialization._StringSerializer.deserialize(dict["content_hash"] ?? .null) - return LegalHoldHeldRevisionMetadata(newFilename: newFilename, originalRevisionId: originalRevisionId, originalFilePath: originalFilePath, serverModified: serverModified, authorMemberId: authorMemberId, authorMemberStatus: authorMemberStatus, authorEmail: authorEmail, fileType: fileType, size: size, contentHash: contentHash) - default: - fatalError("Type error deserializing") + + func json() throws -> JSON { + try LegalHoldHeldRevisionMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldHeldRevisionMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldHeldRevisionMetadata: \(error)" + } + } + } + + public class LegalHoldHeldRevisionMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldHeldRevisionMetadata) throws -> JSON { + let output = [ + "new_filename": try Serialization._StringSerializer.serialize(value.newFilename), + "original_revision_id": try Serialization._StringSerializer.serialize(value.originalRevisionId), + "original_file_path": try Serialization._StringSerializer.serialize(value.originalFilePath), + "server_modified": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.serverModified), + "author_member_id": try Serialization._StringSerializer.serialize(value.authorMemberId), + "author_member_status": try Team.TeamMemberStatusSerializer().serialize(value.authorMemberStatus), + "author_email": try Serialization._StringSerializer.serialize(value.authorEmail), + "file_type": try Serialization._StringSerializer.serialize(value.fileType), + "size": try Serialization._UInt64Serializer.serialize(value.size), + "content_hash": try Serialization._StringSerializer.serialize(value.contentHash), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> LegalHoldHeldRevisionMetadata { + switch json { + case .dictionary(let dict): + let newFilename = try Serialization._StringSerializer.deserialize(dict["new_filename"] ?? .null) + let originalRevisionId = try Serialization._StringSerializer.deserialize(dict["original_revision_id"] ?? .null) + let originalFilePath = try Serialization._StringSerializer.deserialize(dict["original_file_path"] ?? .null) + let serverModified = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["server_modified"] ?? .null) + let authorMemberId = try Serialization._StringSerializer.deserialize(dict["author_member_id"] ?? .null) + let authorMemberStatus = try Team.TeamMemberStatusSerializer().deserialize(dict["author_member_status"] ?? .null) + let authorEmail = try Serialization._StringSerializer.deserialize(dict["author_email"] ?? .null) + let fileType = try Serialization._StringSerializer.deserialize(dict["file_type"] ?? .null) + let size = try Serialization._UInt64Serializer.deserialize(dict["size"] ?? .null) + let contentHash = try Serialization._StringSerializer.deserialize(dict["content_hash"] ?? .null) + return LegalHoldHeldRevisionMetadata( + newFilename: newFilename, + originalRevisionId: originalRevisionId, + originalFilePath: originalFilePath, + serverModified: serverModified, + authorMemberId: authorMemberId, + authorMemberStatus: authorMemberStatus, + authorEmail: authorEmail, + fileType: fileType, + size: size, + contentHash: contentHash + ) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldHeldRevisionMetadata.self, json: json) } } } /// The LegalHoldPolicy struct - open class LegalHoldPolicy: CustomStringConvertible { + public class LegalHoldPolicy: CustomStringConvertible, JSONRepresentable { /// The legal hold id. public let id: String /// Policy name. @@ -3899,7 +4876,16 @@ open class Team { public let startDate: Date /// End date of the legal hold policy. public let endDate: Date? - public init(id: String, name: String, members: Team.MembersInfo, status: Team.LegalHoldStatus, startDate: Date, description_: String? = nil, activationTime: Date? = nil, endDate: Date? = nil) { + public init( + id: String, + name: String, + members: Team.MembersInfo, + status: Team.LegalHoldStatus, + startDate: Date, + description_: String? = nil, + activationTime: Date? = nil, + endDate: Date? = nil + ) { stringValidator(pattern: "^pid_dbhid:.+")(id) self.id = id stringValidator(maxLength: 140)(name) @@ -3912,45 +4898,65 @@ open class Team { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldPolicySerializer().serialize(self)))" - } - } - open class LegalHoldPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldPolicy) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "name": Serialization._StringSerializer.serialize(value.name), - "members": Team.MembersInfoSerializer().serialize(value.members), - "status": Team.LegalHoldStatusSerializer().serialize(value.status), - "start_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), - "description": NullableSerializer(Serialization._StringSerializer).serialize(value.description_), - "activation_time": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.activationTime), - "end_date": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endDate), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> LegalHoldPolicy { - switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let members = Team.MembersInfoSerializer().deserialize(dict["members"] ?? .null) - let status = Team.LegalHoldStatusSerializer().deserialize(dict["status"] ?? .null) - let startDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) - let description_ = NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) - let activationTime = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["activation_time"] ?? .null) - let endDate = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_date"] ?? .null) - return LegalHoldPolicy(id: id, name: name, members: members, status: status, startDate: startDate, description_: description_, activationTime: activationTime, endDate: endDate) - default: - fatalError("Type error deserializing") + + func json() throws -> JSON { + try LegalHoldPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldPolicy: \(error)" + } + } + } + + public class LegalHoldPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldPolicy) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "name": try Serialization._StringSerializer.serialize(value.name), + "members": try Team.MembersInfoSerializer().serialize(value.members), + "status": try Team.LegalHoldStatusSerializer().serialize(value.status), + "start_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), + "description": try NullableSerializer(Serialization._StringSerializer).serialize(value.description_), + "activation_time": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.activationTime), + "end_date": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endDate), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> LegalHoldPolicy { + switch json { + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let members = try Team.MembersInfoSerializer().deserialize(dict["members"] ?? .null) + let status = try Team.LegalHoldStatusSerializer().deserialize(dict["status"] ?? .null) + let startDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) + let description_ = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) + let activationTime = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["activation_time"] ?? .null) + let endDate = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_date"] ?? .null) + return LegalHoldPolicy( + id: id, + name: name, + members: members, + status: status, + startDate: startDate, + description_: description_, + activationTime: activationTime, + endDate: endDate + ) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldPolicy.self, json: json) } } } /// The LegalHoldStatus union - public enum LegalHoldStatus: CustomStringConvertible { + public enum LegalHoldStatus: CustomStringConvertible, JSONRepresentable { /// The legal hold policy is active. case active /// The legal hold policy was released. @@ -3966,74 +4972,84 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try LegalHoldStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldStatus: \(error)" + } } } - open class LegalHoldStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldStatus) -> JSON { + + public class LegalHoldStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldStatus) throws -> JSON { switch value { - case .active: - var d = [String: JSON]() - d[".tag"] = .str("active") - return .dictionary(d) - case .released: - var d = [String: JSON]() - d[".tag"] = .str("released") - return .dictionary(d) - case .activating: - var d = [String: JSON]() - d[".tag"] = .str("activating") - return .dictionary(d) - case .updating: - var d = [String: JSON]() - d[".tag"] = .str("updating") - return .dictionary(d) - case .exporting: - var d = [String: JSON]() - d[".tag"] = .str("exporting") - return .dictionary(d) - case .releasing: - var d = [String: JSON]() - d[".tag"] = .str("releasing") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "active": - return LegalHoldStatus.active - case "released": - return LegalHoldStatus.released - case "activating": - return LegalHoldStatus.activating - case "updating": - return LegalHoldStatus.updating - case "exporting": - return LegalHoldStatus.exporting - case "releasing": - return LegalHoldStatus.releasing - case "other": - return LegalHoldStatus.other - default: - return LegalHoldStatus.other - } - default: - fatalError("Failed to deserialize") + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .released: + var d = [String: JSON]() + d[".tag"] = .str("released") + return .dictionary(d) + case .activating: + var d = [String: JSON]() + d[".tag"] = .str("activating") + return .dictionary(d) + case .updating: + var d = [String: JSON]() + d[".tag"] = .str("updating") + return .dictionary(d) + case .exporting: + var d = [String: JSON]() + d[".tag"] = .str("exporting") + return .dictionary(d) + case .releasing: + var d = [String: JSON]() + d[".tag"] = .str("releasing") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return LegalHoldStatus.active + case "released": + return LegalHoldStatus.released + case "activating": + return LegalHoldStatus.activating + case "updating": + return LegalHoldStatus.updating + case "exporting": + return LegalHoldStatus.exporting + case "releasing": + return LegalHoldStatus.releasing + case "other": + return LegalHoldStatus.other + default: + return LegalHoldStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldStatus.self, json: json) } } } /// The LegalHoldsError union - public enum LegalHoldsError: CustomStringConvertible { + public enum LegalHoldsError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// You don't have permissions to perform this action. @@ -4041,81 +5057,102 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try LegalHoldsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsError: \(error)" + } } } - open class LegalHoldsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsError) -> JSON { + + public class LegalHoldsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsError.unknownLegalHoldError - case "insufficient_permissions": - return LegalHoldsError.insufficientPermissions - case "other": - return LegalHoldsError.other - default: - return LegalHoldsError.other - } + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsError.unknownLegalHoldError + case "insufficient_permissions": + return LegalHoldsError.insufficientPermissions + case "other": + return LegalHoldsError.other default: - fatalError("Failed to deserialize") + return LegalHoldsError.other + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsError.self, json: json) } } } /// The LegalHoldsGetPolicyArg struct - open class LegalHoldsGetPolicyArg: CustomStringConvertible { + public class LegalHoldsGetPolicyArg: CustomStringConvertible, JSONRepresentable { /// The legal hold Id. public let id: String public init(id: String) { stringValidator(pattern: "^pid_dbhid:.+")(id) self.id = id } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsGetPolicyArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsGetPolicyArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsGetPolicyArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsGetPolicyArg: \(error)" + } } } - open class LegalHoldsGetPolicyArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsGetPolicyArg) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), + + public class LegalHoldsGetPolicyArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsGetPolicyArg) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsGetPolicyArg { + + public func deserialize(_ json: JSON) throws -> LegalHoldsGetPolicyArg { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - return LegalHoldsGetPolicyArg(id: id) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + return LegalHoldsGetPolicyArg(id: id) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsGetPolicyArg.self, json: json) } } } /// The LegalHoldsGetPolicyError union - public enum LegalHoldsGetPolicyError: CustomStringConvertible { + public enum LegalHoldsGetPolicyError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// You don't have permissions to perform this action. @@ -4125,58 +5162,68 @@ open class Team { /// Legal hold policy does not exist for id in LegalHoldsGetPolicyArg. case legalHoldPolicyNotFound + func json() throws -> JSON { + try LegalHoldsGetPolicyErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsGetPolicyErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsGetPolicyErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsGetPolicyError: \(error)" + } } } - open class LegalHoldsGetPolicyErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsGetPolicyError) -> JSON { + + public class LegalHoldsGetPolicyErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsGetPolicyError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .legalHoldPolicyNotFound: - var d = [String: JSON]() - d[".tag"] = .str("legal_hold_policy_not_found") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsGetPolicyError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsGetPolicyError.unknownLegalHoldError - case "insufficient_permissions": - return LegalHoldsGetPolicyError.insufficientPermissions - case "other": - return LegalHoldsGetPolicyError.other - case "legal_hold_policy_not_found": - return LegalHoldsGetPolicyError.legalHoldPolicyNotFound - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .legalHoldPolicyNotFound: + var d = [String: JSON]() + d[".tag"] = .str("legal_hold_policy_not_found") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsGetPolicyError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsGetPolicyError.unknownLegalHoldError + case "insufficient_permissions": + return LegalHoldsGetPolicyError.insufficientPermissions + case "other": + return LegalHoldsGetPolicyError.other + case "legal_hold_policy_not_found": + return LegalHoldsGetPolicyError.legalHoldPolicyNotFound + default: + throw JSONSerializerError.unknownTag(type: LegalHoldsGetPolicyError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsGetPolicyError.self, json: json) } } } /// The LegalHoldsListHeldRevisionResult struct - open class LegalHoldsListHeldRevisionResult: CustomStringConvertible { + public class LegalHoldsListHeldRevisionResult: CustomStringConvertible, JSONRepresentable { /// List of file entries that under the hold. - public let entries: Array + public let entries: [Team.LegalHoldHeldRevisionMetadata] /// The cursor idicates where to continue reading file metadata entries for the next API call. When there are no /// more entries, the cursor will return none. Pass the cursor into /// /2/team/legal_holds/list_held_revisions/continue. @@ -4184,72 +5231,94 @@ open class Team { /// True if there are more file entries that haven't been returned. You can retrieve them with a call to /// /legal_holds/list_held_revisions_continue. public let hasMore: Bool - public init(entries: Array, hasMore: Bool, cursor: String? = nil) { + public init(entries: [Team.LegalHoldHeldRevisionMetadata], hasMore: Bool, cursor: String? = nil) { self.entries = entries nullableValidator(stringValidator(minLength: 1))(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListHeldRevisionResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsListHeldRevisionResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListHeldRevisionResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListHeldRevisionResult: \(error)" + } } } - open class LegalHoldsListHeldRevisionResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListHeldRevisionResult) -> JSON { - let output = [ - "entries": ArraySerializer(Team.LegalHoldHeldRevisionMetadataSerializer()).serialize(value.entries), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class LegalHoldsListHeldRevisionResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListHeldRevisionResult) throws -> JSON { + let output = [ + "entries": try ArraySerializer(Team.LegalHoldHeldRevisionMetadataSerializer()).serialize(value.entries), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsListHeldRevisionResult { + + public func deserialize(_ json: JSON) throws -> LegalHoldsListHeldRevisionResult { switch json { - case .dictionary(let dict): - let entries = ArraySerializer(Team.LegalHoldHeldRevisionMetadataSerializer()).deserialize(dict["entries"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return LegalHoldsListHeldRevisionResult(entries: entries, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let entries = try ArraySerializer(Team.LegalHoldHeldRevisionMetadataSerializer()).deserialize(dict["entries"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return LegalHoldsListHeldRevisionResult(entries: entries, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListHeldRevisionResult.self, json: json) } } } /// The LegalHoldsListHeldRevisionsArg struct - open class LegalHoldsListHeldRevisionsArg: CustomStringConvertible { + public class LegalHoldsListHeldRevisionsArg: CustomStringConvertible, JSONRepresentable { /// The legal hold Id. public let id: String public init(id: String) { stringValidator(pattern: "^pid_dbhid:.+")(id) self.id = id } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListHeldRevisionsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsListHeldRevisionsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListHeldRevisionsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListHeldRevisionsArg: \(error)" + } } } - open class LegalHoldsListHeldRevisionsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListHeldRevisionsArg) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), + + public class LegalHoldsListHeldRevisionsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListHeldRevisionsArg) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsListHeldRevisionsArg { + + public func deserialize(_ json: JSON) throws -> LegalHoldsListHeldRevisionsArg { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - return LegalHoldsListHeldRevisionsArg(id: id) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + return LegalHoldsListHeldRevisionsArg(id: id) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListHeldRevisionsArg.self, json: json) } } } /// The LegalHoldsListHeldRevisionsContinueArg struct - open class LegalHoldsListHeldRevisionsContinueArg: CustomStringConvertible { + public class LegalHoldsListHeldRevisionsContinueArg: CustomStringConvertible, JSONRepresentable { /// The legal hold Id. public let id: String /// The cursor idicates where to continue reading file metadata entries for the next API call. When there are no @@ -4261,33 +5330,44 @@ open class Team { nullableValidator(stringValidator(minLength: 1))(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListHeldRevisionsContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsListHeldRevisionsContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListHeldRevisionsContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListHeldRevisionsContinueArg: \(error)" + } } } - open class LegalHoldsListHeldRevisionsContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListHeldRevisionsContinueArg) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class LegalHoldsListHeldRevisionsContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListHeldRevisionsContinueArg) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsListHeldRevisionsContinueArg { + + public func deserialize(_ json: JSON) throws -> LegalHoldsListHeldRevisionsContinueArg { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return LegalHoldsListHeldRevisionsContinueArg(id: id, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return LegalHoldsListHeldRevisionsContinueArg(id: id, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListHeldRevisionsContinueArg.self, json: json) } } } /// The LegalHoldsListHeldRevisionsContinueError union - public enum LegalHoldsListHeldRevisionsContinueError: CustomStringConvertible { + public enum LegalHoldsListHeldRevisionsContinueError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// Temporary infrastructure failure, please retry. @@ -4298,56 +5378,66 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try LegalHoldsListHeldRevisionsContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListHeldRevisionsContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListHeldRevisionsContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListHeldRevisionsContinueError: \(error)" + } } } - open class LegalHoldsListHeldRevisionsContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListHeldRevisionsContinueError) -> JSON { + + public class LegalHoldsListHeldRevisionsContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListHeldRevisionsContinueError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .transientError: - var d = [String: JSON]() - d[".tag"] = .str("transient_error") - return .dictionary(d) - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsListHeldRevisionsContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsListHeldRevisionsContinueError.unknownLegalHoldError - case "transient_error": - return LegalHoldsListHeldRevisionsContinueError.transientError - case "reset": - return LegalHoldsListHeldRevisionsContinueError.reset - case "other": - return LegalHoldsListHeldRevisionsContinueError.other - default: - return LegalHoldsListHeldRevisionsContinueError.other - } - default: - fatalError("Failed to deserialize") + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .transientError: + var d = [String: JSON]() + d[".tag"] = .str("transient_error") + return .dictionary(d) + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsListHeldRevisionsContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsListHeldRevisionsContinueError.unknownLegalHoldError + case "transient_error": + return LegalHoldsListHeldRevisionsContinueError.transientError + case "reset": + return LegalHoldsListHeldRevisionsContinueError.reset + case "other": + return LegalHoldsListHeldRevisionsContinueError.other + default: + return LegalHoldsListHeldRevisionsContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListHeldRevisionsContinueError.self, json: json) } } } /// The LegalHoldsListHeldRevisionsError union - public enum LegalHoldsListHeldRevisionsError: CustomStringConvertible { + public enum LegalHoldsListHeldRevisionsError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// You don't have permissions to perform this action. @@ -4361,98 +5451,119 @@ open class Team { /// Trying to list revisions for an inactive legal hold. case inactiveLegalHold + func json() throws -> JSON { + try LegalHoldsListHeldRevisionsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListHeldRevisionsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListHeldRevisionsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListHeldRevisionsError: \(error)" + } } } - open class LegalHoldsListHeldRevisionsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListHeldRevisionsError) -> JSON { + + public class LegalHoldsListHeldRevisionsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListHeldRevisionsError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .transientError: - var d = [String: JSON]() - d[".tag"] = .str("transient_error") - return .dictionary(d) - case .legalHoldStillEmpty: - var d = [String: JSON]() - d[".tag"] = .str("legal_hold_still_empty") - return .dictionary(d) - case .inactiveLegalHold: - var d = [String: JSON]() - d[".tag"] = .str("inactive_legal_hold") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsListHeldRevisionsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsListHeldRevisionsError.unknownLegalHoldError - case "insufficient_permissions": - return LegalHoldsListHeldRevisionsError.insufficientPermissions - case "other": - return LegalHoldsListHeldRevisionsError.other - case "transient_error": - return LegalHoldsListHeldRevisionsError.transientError - case "legal_hold_still_empty": - return LegalHoldsListHeldRevisionsError.legalHoldStillEmpty - case "inactive_legal_hold": - return LegalHoldsListHeldRevisionsError.inactiveLegalHold - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .transientError: + var d = [String: JSON]() + d[".tag"] = .str("transient_error") + return .dictionary(d) + case .legalHoldStillEmpty: + var d = [String: JSON]() + d[".tag"] = .str("legal_hold_still_empty") + return .dictionary(d) + case .inactiveLegalHold: + var d = [String: JSON]() + d[".tag"] = .str("inactive_legal_hold") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsListHeldRevisionsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsListHeldRevisionsError.unknownLegalHoldError + case "insufficient_permissions": + return LegalHoldsListHeldRevisionsError.insufficientPermissions + case "other": + return LegalHoldsListHeldRevisionsError.other + case "transient_error": + return LegalHoldsListHeldRevisionsError.transientError + case "legal_hold_still_empty": + return LegalHoldsListHeldRevisionsError.legalHoldStillEmpty + case "inactive_legal_hold": + return LegalHoldsListHeldRevisionsError.inactiveLegalHold + default: + throw JSONSerializerError.unknownTag(type: LegalHoldsListHeldRevisionsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListHeldRevisionsError.self, json: json) } } } /// The LegalHoldsListPoliciesArg struct - open class LegalHoldsListPoliciesArg: CustomStringConvertible { + public class LegalHoldsListPoliciesArg: CustomStringConvertible, JSONRepresentable { /// Whether to return holds that were released. public let includeReleased: Bool public init(includeReleased: Bool = false) { self.includeReleased = includeReleased } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListPoliciesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsListPoliciesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListPoliciesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListPoliciesArg: \(error)" + } } } - open class LegalHoldsListPoliciesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListPoliciesArg) -> JSON { - let output = [ - "include_released": Serialization._BoolSerializer.serialize(value.includeReleased), + + public class LegalHoldsListPoliciesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListPoliciesArg) throws -> JSON { + let output = [ + "include_released": try Serialization._BoolSerializer.serialize(value.includeReleased), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsListPoliciesArg { + + public func deserialize(_ json: JSON) throws -> LegalHoldsListPoliciesArg { switch json { - case .dictionary(let dict): - let includeReleased = Serialization._BoolSerializer.deserialize(dict["include_released"] ?? .number(0)) - return LegalHoldsListPoliciesArg(includeReleased: includeReleased) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let includeReleased = try Serialization._BoolSerializer.deserialize(dict["include_released"] ?? .number(0)) + return LegalHoldsListPoliciesArg(includeReleased: includeReleased) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListPoliciesArg.self, json: json) } } } /// The LegalHoldsListPoliciesError union - public enum LegalHoldsListPoliciesError: CustomStringConvertible { + public enum LegalHoldsListPoliciesError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// You don't have permissions to perform this action. @@ -4462,97 +5573,118 @@ open class Team { /// Temporary infrastructure failure, please retry. case transientError + func json() throws -> JSON { + try LegalHoldsListPoliciesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListPoliciesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListPoliciesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListPoliciesError: \(error)" + } } } - open class LegalHoldsListPoliciesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListPoliciesError) -> JSON { + + public class LegalHoldsListPoliciesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListPoliciesError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .transientError: - var d = [String: JSON]() - d[".tag"] = .str("transient_error") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsListPoliciesError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsListPoliciesError.unknownLegalHoldError - case "insufficient_permissions": - return LegalHoldsListPoliciesError.insufficientPermissions - case "other": - return LegalHoldsListPoliciesError.other - case "transient_error": - return LegalHoldsListPoliciesError.transientError - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .transientError: + var d = [String: JSON]() + d[".tag"] = .str("transient_error") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsListPoliciesError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsListPoliciesError.unknownLegalHoldError + case "insufficient_permissions": + return LegalHoldsListPoliciesError.insufficientPermissions + case "other": + return LegalHoldsListPoliciesError.other + case "transient_error": + return LegalHoldsListPoliciesError.transientError + default: + throw JSONSerializerError.unknownTag(type: LegalHoldsListPoliciesError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListPoliciesError.self, json: json) } } } /// The LegalHoldsListPoliciesResult struct - open class LegalHoldsListPoliciesResult: CustomStringConvertible { + public class LegalHoldsListPoliciesResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let policies: Array - public init(policies: Array) { + public let policies: [Team.LegalHoldPolicy] + public init(policies: [Team.LegalHoldPolicy]) { self.policies = policies } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsListPoliciesResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsListPoliciesResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsListPoliciesResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsListPoliciesResult: \(error)" + } } } - open class LegalHoldsListPoliciesResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsListPoliciesResult) -> JSON { - let output = [ - "policies": ArraySerializer(Team.LegalHoldPolicySerializer()).serialize(value.policies), + + public class LegalHoldsListPoliciesResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsListPoliciesResult) throws -> JSON { + let output = [ + "policies": try ArraySerializer(Team.LegalHoldPolicySerializer()).serialize(value.policies), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsListPoliciesResult { + + public func deserialize(_ json: JSON) throws -> LegalHoldsListPoliciesResult { switch json { - case .dictionary(let dict): - let policies = ArraySerializer(Team.LegalHoldPolicySerializer()).deserialize(dict["policies"] ?? .null) - return LegalHoldsListPoliciesResult(policies: policies) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let policies = try ArraySerializer(Team.LegalHoldPolicySerializer()).deserialize(dict["policies"] ?? .null) + return LegalHoldsListPoliciesResult(policies: policies) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsListPoliciesResult.self, json: json) } } } /// The LegalHoldsPolicyCreateArg struct - open class LegalHoldsPolicyCreateArg: CustomStringConvertible { + public class LegalHoldsPolicyCreateArg: CustomStringConvertible, JSONRepresentable { /// Policy name. public let name: String /// A description of the legal hold policy. public let description_: String? /// List of team member IDs added to the hold. - public let members: Array + public let members: [String] /// start date of the legal hold policy. public let startDate: Date? /// end date of the legal hold policy. public let endDate: Date? - public init(name: String, members: Array, description_: String? = nil, startDate: Date? = nil, endDate: Date? = nil) { + public init(name: String, members: [String], description_: String? = nil, startDate: Date? = nil, endDate: Date? = nil) { stringValidator(maxLength: 140)(name) self.name = name nullableValidator(stringValidator(maxLength: 501))(description_) @@ -4562,39 +5694,50 @@ open class Team { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsPolicyCreateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsPolicyCreateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsPolicyCreateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsPolicyCreateArg: \(error)" + } } } - open class LegalHoldsPolicyCreateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsPolicyCreateArg) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "members": ArraySerializer(Serialization._StringSerializer).serialize(value.members), - "description": NullableSerializer(Serialization._StringSerializer).serialize(value.description_), - "start_date": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.startDate), - "end_date": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endDate), + + public class LegalHoldsPolicyCreateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsPolicyCreateArg) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "members": try ArraySerializer(Serialization._StringSerializer).serialize(value.members), + "description": try NullableSerializer(Serialization._StringSerializer).serialize(value.description_), + "start_date": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.startDate), + "end_date": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsPolicyCreateArg { + + public func deserialize(_ json: JSON) throws -> LegalHoldsPolicyCreateArg { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let members = ArraySerializer(Serialization._StringSerializer).deserialize(dict["members"] ?? .null) - let description_ = NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) - let startDate = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["start_date"] ?? .null) - let endDate = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_date"] ?? .null) - return LegalHoldsPolicyCreateArg(name: name, members: members, description_: description_, startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let members = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["members"] ?? .null) + let description_ = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) + let startDate = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["start_date"] ?? .null) + let endDate = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_date"] ?? .null) + return LegalHoldsPolicyCreateArg(name: name, members: members, description_: description_, startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsPolicyCreateArg.self, json: json) } } } /// The LegalHoldsPolicyCreateError union - public enum LegalHoldsPolicyCreateError: CustomStringConvertible { + public enum LegalHoldsPolicyCreateError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// You don't have permissions to perform this action. @@ -4618,129 +5761,150 @@ open class Team { /// The provided date is invalid. case invalidDate + func json() throws -> JSON { + try LegalHoldsPolicyCreateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsPolicyCreateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsPolicyCreateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsPolicyCreateError: \(error)" + } } } - open class LegalHoldsPolicyCreateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsPolicyCreateError) -> JSON { + + public class LegalHoldsPolicyCreateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsPolicyCreateError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .startDateIsLaterThanEndDate: - var d = [String: JSON]() - d[".tag"] = .str("start_date_is_later_than_end_date") - return .dictionary(d) - case .emptyMembersList: - var d = [String: JSON]() - d[".tag"] = .str("empty_members_list") - return .dictionary(d) - case .invalidMembers: - var d = [String: JSON]() - d[".tag"] = .str("invalid_members") - return .dictionary(d) - case .numberOfUsersOnHoldIsGreaterThanHoldLimitation: - var d = [String: JSON]() - d[".tag"] = .str("number_of_users_on_hold_is_greater_than_hold_limitation") - return .dictionary(d) - case .transientError: - var d = [String: JSON]() - d[".tag"] = .str("transient_error") - return .dictionary(d) - case .nameMustBeUnique: - var d = [String: JSON]() - d[".tag"] = .str("name_must_be_unique") - return .dictionary(d) - case .teamExceededLegalHoldQuota: - var d = [String: JSON]() - d[".tag"] = .str("team_exceeded_legal_hold_quota") - return .dictionary(d) - case .invalidDate: - var d = [String: JSON]() - d[".tag"] = .str("invalid_date") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsPolicyCreateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsPolicyCreateError.unknownLegalHoldError - case "insufficient_permissions": - return LegalHoldsPolicyCreateError.insufficientPermissions - case "other": - return LegalHoldsPolicyCreateError.other - case "start_date_is_later_than_end_date": - return LegalHoldsPolicyCreateError.startDateIsLaterThanEndDate - case "empty_members_list": - return LegalHoldsPolicyCreateError.emptyMembersList - case "invalid_members": - return LegalHoldsPolicyCreateError.invalidMembers - case "number_of_users_on_hold_is_greater_than_hold_limitation": - return LegalHoldsPolicyCreateError.numberOfUsersOnHoldIsGreaterThanHoldLimitation - case "transient_error": - return LegalHoldsPolicyCreateError.transientError - case "name_must_be_unique": - return LegalHoldsPolicyCreateError.nameMustBeUnique - case "team_exceeded_legal_hold_quota": - return LegalHoldsPolicyCreateError.teamExceededLegalHoldQuota - case "invalid_date": - return LegalHoldsPolicyCreateError.invalidDate - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .startDateIsLaterThanEndDate: + var d = [String: JSON]() + d[".tag"] = .str("start_date_is_later_than_end_date") + return .dictionary(d) + case .emptyMembersList: + var d = [String: JSON]() + d[".tag"] = .str("empty_members_list") + return .dictionary(d) + case .invalidMembers: + var d = [String: JSON]() + d[".tag"] = .str("invalid_members") + return .dictionary(d) + case .numberOfUsersOnHoldIsGreaterThanHoldLimitation: + var d = [String: JSON]() + d[".tag"] = .str("number_of_users_on_hold_is_greater_than_hold_limitation") + return .dictionary(d) + case .transientError: + var d = [String: JSON]() + d[".tag"] = .str("transient_error") + return .dictionary(d) + case .nameMustBeUnique: + var d = [String: JSON]() + d[".tag"] = .str("name_must_be_unique") + return .dictionary(d) + case .teamExceededLegalHoldQuota: + var d = [String: JSON]() + d[".tag"] = .str("team_exceeded_legal_hold_quota") + return .dictionary(d) + case .invalidDate: + var d = [String: JSON]() + d[".tag"] = .str("invalid_date") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsPolicyCreateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsPolicyCreateError.unknownLegalHoldError + case "insufficient_permissions": + return LegalHoldsPolicyCreateError.insufficientPermissions + case "other": + return LegalHoldsPolicyCreateError.other + case "start_date_is_later_than_end_date": + return LegalHoldsPolicyCreateError.startDateIsLaterThanEndDate + case "empty_members_list": + return LegalHoldsPolicyCreateError.emptyMembersList + case "invalid_members": + return LegalHoldsPolicyCreateError.invalidMembers + case "number_of_users_on_hold_is_greater_than_hold_limitation": + return LegalHoldsPolicyCreateError.numberOfUsersOnHoldIsGreaterThanHoldLimitation + case "transient_error": + return LegalHoldsPolicyCreateError.transientError + case "name_must_be_unique": + return LegalHoldsPolicyCreateError.nameMustBeUnique + case "team_exceeded_legal_hold_quota": + return LegalHoldsPolicyCreateError.teamExceededLegalHoldQuota + case "invalid_date": + return LegalHoldsPolicyCreateError.invalidDate + default: + throw JSONSerializerError.unknownTag(type: LegalHoldsPolicyCreateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsPolicyCreateError.self, json: json) } } } /// The LegalHoldsPolicyReleaseArg struct - open class LegalHoldsPolicyReleaseArg: CustomStringConvertible { + public class LegalHoldsPolicyReleaseArg: CustomStringConvertible, JSONRepresentable { /// The legal hold Id. public let id: String public init(id: String) { stringValidator(pattern: "^pid_dbhid:.+")(id) self.id = id } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsPolicyReleaseArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsPolicyReleaseArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsPolicyReleaseArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsPolicyReleaseArg: \(error)" + } } } - open class LegalHoldsPolicyReleaseArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsPolicyReleaseArg) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), + + public class LegalHoldsPolicyReleaseArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsPolicyReleaseArg) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsPolicyReleaseArg { + + public func deserialize(_ json: JSON) throws -> LegalHoldsPolicyReleaseArg { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - return LegalHoldsPolicyReleaseArg(id: id) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + return LegalHoldsPolicyReleaseArg(id: id) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsPolicyReleaseArg.self, json: json) } } } /// The LegalHoldsPolicyReleaseError union - public enum LegalHoldsPolicyReleaseError: CustomStringConvertible { + public enum LegalHoldsPolicyReleaseError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// You don't have permissions to perform this action. @@ -4754,68 +5918,78 @@ open class Team { /// Legal hold policy does not exist for id in LegalHoldsPolicyReleaseArg. case legalHoldPolicyNotFound + func json() throws -> JSON { + try LegalHoldsPolicyReleaseErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsPolicyReleaseErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsPolicyReleaseErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsPolicyReleaseError: \(error)" + } } } - open class LegalHoldsPolicyReleaseErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsPolicyReleaseError) -> JSON { + + public class LegalHoldsPolicyReleaseErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsPolicyReleaseError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .legalHoldPerformingAnotherOperation: - var d = [String: JSON]() - d[".tag"] = .str("legal_hold_performing_another_operation") - return .dictionary(d) - case .legalHoldAlreadyReleasing: - var d = [String: JSON]() - d[".tag"] = .str("legal_hold_already_releasing") - return .dictionary(d) - case .legalHoldPolicyNotFound: - var d = [String: JSON]() - d[".tag"] = .str("legal_hold_policy_not_found") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsPolicyReleaseError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsPolicyReleaseError.unknownLegalHoldError - case "insufficient_permissions": - return LegalHoldsPolicyReleaseError.insufficientPermissions - case "other": - return LegalHoldsPolicyReleaseError.other - case "legal_hold_performing_another_operation": - return LegalHoldsPolicyReleaseError.legalHoldPerformingAnotherOperation - case "legal_hold_already_releasing": - return LegalHoldsPolicyReleaseError.legalHoldAlreadyReleasing - case "legal_hold_policy_not_found": - return LegalHoldsPolicyReleaseError.legalHoldPolicyNotFound - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .legalHoldPerformingAnotherOperation: + var d = [String: JSON]() + d[".tag"] = .str("legal_hold_performing_another_operation") + return .dictionary(d) + case .legalHoldAlreadyReleasing: + var d = [String: JSON]() + d[".tag"] = .str("legal_hold_already_releasing") + return .dictionary(d) + case .legalHoldPolicyNotFound: + var d = [String: JSON]() + d[".tag"] = .str("legal_hold_policy_not_found") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsPolicyReleaseError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsPolicyReleaseError.unknownLegalHoldError + case "insufficient_permissions": + return LegalHoldsPolicyReleaseError.insufficientPermissions + case "other": + return LegalHoldsPolicyReleaseError.other + case "legal_hold_performing_another_operation": + return LegalHoldsPolicyReleaseError.legalHoldPerformingAnotherOperation + case "legal_hold_already_releasing": + return LegalHoldsPolicyReleaseError.legalHoldAlreadyReleasing + case "legal_hold_policy_not_found": + return LegalHoldsPolicyReleaseError.legalHoldPolicyNotFound + default: + throw JSONSerializerError.unknownTag(type: LegalHoldsPolicyReleaseError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsPolicyReleaseError.self, json: json) } } } /// The LegalHoldsPolicyUpdateArg struct - open class LegalHoldsPolicyUpdateArg: CustomStringConvertible { + public class LegalHoldsPolicyUpdateArg: CustomStringConvertible, JSONRepresentable { /// The legal hold Id. public let id: String /// Policy new name. @@ -4823,8 +5997,8 @@ open class Team { /// Policy new description. public let description_: String? /// List of team member IDs to apply the policy on. - public let members: Array? - public init(id: String, name: String? = nil, description_: String? = nil, members: Array? = nil) { + public let members: [String]? + public init(id: String, name: String? = nil, description_: String? = nil, members: [String]? = nil) { stringValidator(pattern: "^pid_dbhid:.+")(id) self.id = id nullableValidator(stringValidator(maxLength: 140))(name) @@ -4834,37 +6008,48 @@ open class Team { nullableValidator(arrayValidator(itemValidator: stringValidator()))(members) self.members = members } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsPolicyUpdateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsPolicyUpdateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsPolicyUpdateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsPolicyUpdateArg: \(error)" + } } } - open class LegalHoldsPolicyUpdateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsPolicyUpdateArg) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "name": NullableSerializer(Serialization._StringSerializer).serialize(value.name), - "description": NullableSerializer(Serialization._StringSerializer).serialize(value.description_), - "members": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.members), + + public class LegalHoldsPolicyUpdateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsPolicyUpdateArg) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "name": try NullableSerializer(Serialization._StringSerializer).serialize(value.name), + "description": try NullableSerializer(Serialization._StringSerializer).serialize(value.description_), + "members": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.members), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsPolicyUpdateArg { + + public func deserialize(_ json: JSON) throws -> LegalHoldsPolicyUpdateArg { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let name = NullableSerializer(Serialization._StringSerializer).deserialize(dict["name"] ?? .null) - let description_ = NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) - let members = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["members"] ?? .null) - return LegalHoldsPolicyUpdateArg(id: id, name: name, description_: description_, members: members) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let name = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["name"] ?? .null) + let description_ = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["description"] ?? .null) + let members = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["members"] ?? .null) + return LegalHoldsPolicyUpdateArg(id: id, name: name, description_: description_, members: members) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsPolicyUpdateArg.self, json: json) } } } /// The LegalHoldsPolicyUpdateError union - public enum LegalHoldsPolicyUpdateError: CustomStringConvertible { + public enum LegalHoldsPolicyUpdateError: CustomStringConvertible, JSONRepresentable { /// There has been an unknown legal hold error. case unknownLegalHoldError /// You don't have permissions to perform this action. @@ -4888,202 +6073,244 @@ open class Team { /// Legal hold policy does not exist for id in LegalHoldsPolicyUpdateArg. case legalHoldPolicyNotFound + func json() throws -> JSON { + try LegalHoldsPolicyUpdateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsPolicyUpdateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsPolicyUpdateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsPolicyUpdateError: \(error)" + } } } - open class LegalHoldsPolicyUpdateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsPolicyUpdateError) -> JSON { + + public class LegalHoldsPolicyUpdateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsPolicyUpdateError) throws -> JSON { switch value { - case .unknownLegalHoldError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_legal_hold_error") - return .dictionary(d) - case .insufficientPermissions: - var d = [String: JSON]() - d[".tag"] = .str("insufficient_permissions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .transientError: - var d = [String: JSON]() - d[".tag"] = .str("transient_error") - return .dictionary(d) - case .inactiveLegalHold: - var d = [String: JSON]() - d[".tag"] = .str("inactive_legal_hold") - return .dictionary(d) - case .legalHoldPerformingAnotherOperation: - var d = [String: JSON]() - d[".tag"] = .str("legal_hold_performing_another_operation") - return .dictionary(d) - case .invalidMembers: - var d = [String: JSON]() - d[".tag"] = .str("invalid_members") - return .dictionary(d) - case .numberOfUsersOnHoldIsGreaterThanHoldLimitation: - var d = [String: JSON]() - d[".tag"] = .str("number_of_users_on_hold_is_greater_than_hold_limitation") - return .dictionary(d) - case .emptyMembersList: - var d = [String: JSON]() - d[".tag"] = .str("empty_members_list") - return .dictionary(d) - case .nameMustBeUnique: - var d = [String: JSON]() - d[".tag"] = .str("name_must_be_unique") - return .dictionary(d) - case .legalHoldPolicyNotFound: - var d = [String: JSON]() - d[".tag"] = .str("legal_hold_policy_not_found") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LegalHoldsPolicyUpdateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unknown_legal_hold_error": - return LegalHoldsPolicyUpdateError.unknownLegalHoldError - case "insufficient_permissions": - return LegalHoldsPolicyUpdateError.insufficientPermissions - case "other": - return LegalHoldsPolicyUpdateError.other - case "transient_error": - return LegalHoldsPolicyUpdateError.transientError - case "inactive_legal_hold": - return LegalHoldsPolicyUpdateError.inactiveLegalHold - case "legal_hold_performing_another_operation": - return LegalHoldsPolicyUpdateError.legalHoldPerformingAnotherOperation - case "invalid_members": - return LegalHoldsPolicyUpdateError.invalidMembers - case "number_of_users_on_hold_is_greater_than_hold_limitation": - return LegalHoldsPolicyUpdateError.numberOfUsersOnHoldIsGreaterThanHoldLimitation - case "empty_members_list": - return LegalHoldsPolicyUpdateError.emptyMembersList - case "name_must_be_unique": - return LegalHoldsPolicyUpdateError.nameMustBeUnique - case "legal_hold_policy_not_found": - return LegalHoldsPolicyUpdateError.legalHoldPolicyNotFound - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .unknownLegalHoldError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_legal_hold_error") + return .dictionary(d) + case .insufficientPermissions: + var d = [String: JSON]() + d[".tag"] = .str("insufficient_permissions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .transientError: + var d = [String: JSON]() + d[".tag"] = .str("transient_error") + return .dictionary(d) + case .inactiveLegalHold: + var d = [String: JSON]() + d[".tag"] = .str("inactive_legal_hold") + return .dictionary(d) + case .legalHoldPerformingAnotherOperation: + var d = [String: JSON]() + d[".tag"] = .str("legal_hold_performing_another_operation") + return .dictionary(d) + case .invalidMembers: + var d = [String: JSON]() + d[".tag"] = .str("invalid_members") + return .dictionary(d) + case .numberOfUsersOnHoldIsGreaterThanHoldLimitation: + var d = [String: JSON]() + d[".tag"] = .str("number_of_users_on_hold_is_greater_than_hold_limitation") + return .dictionary(d) + case .emptyMembersList: + var d = [String: JSON]() + d[".tag"] = .str("empty_members_list") + return .dictionary(d) + case .nameMustBeUnique: + var d = [String: JSON]() + d[".tag"] = .str("name_must_be_unique") + return .dictionary(d) + case .legalHoldPolicyNotFound: + var d = [String: JSON]() + d[".tag"] = .str("legal_hold_policy_not_found") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LegalHoldsPolicyUpdateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unknown_legal_hold_error": + return LegalHoldsPolicyUpdateError.unknownLegalHoldError + case "insufficient_permissions": + return LegalHoldsPolicyUpdateError.insufficientPermissions + case "other": + return LegalHoldsPolicyUpdateError.other + case "transient_error": + return LegalHoldsPolicyUpdateError.transientError + case "inactive_legal_hold": + return LegalHoldsPolicyUpdateError.inactiveLegalHold + case "legal_hold_performing_another_operation": + return LegalHoldsPolicyUpdateError.legalHoldPerformingAnotherOperation + case "invalid_members": + return LegalHoldsPolicyUpdateError.invalidMembers + case "number_of_users_on_hold_is_greater_than_hold_limitation": + return LegalHoldsPolicyUpdateError.numberOfUsersOnHoldIsGreaterThanHoldLimitation + case "empty_members_list": + return LegalHoldsPolicyUpdateError.emptyMembersList + case "name_must_be_unique": + return LegalHoldsPolicyUpdateError.nameMustBeUnique + case "legal_hold_policy_not_found": + return LegalHoldsPolicyUpdateError.legalHoldPolicyNotFound + default: + throw JSONSerializerError.unknownTag(type: LegalHoldsPolicyUpdateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsPolicyUpdateError.self, json: json) } } } /// The ListMemberAppsArg struct - open class ListMemberAppsArg: CustomStringConvertible { + public class ListMemberAppsArg: CustomStringConvertible, JSONRepresentable { /// The team member id. public let teamMemberId: String public init(teamMemberId: String) { stringValidator()(teamMemberId) self.teamMemberId = teamMemberId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMemberAppsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMemberAppsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMemberAppsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMemberAppsArg: \(error)" + } } } - open class ListMemberAppsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMemberAppsArg) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), + + public class ListMemberAppsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMemberAppsArg) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMemberAppsArg { + + public func deserialize(_ json: JSON) throws -> ListMemberAppsArg { switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - return ListMemberAppsArg(teamMemberId: teamMemberId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + return ListMemberAppsArg(teamMemberId: teamMemberId) + default: + throw JSONSerializerError.deserializeError(type: ListMemberAppsArg.self, json: json) } } } /// Error returned by linkedAppsListMemberLinkedApps. - public enum ListMemberAppsError: CustomStringConvertible { + public enum ListMemberAppsError: CustomStringConvertible, JSONRepresentable { /// Member not found. case memberNotFound /// An unspecified error. case other + func json() throws -> JSON { + try ListMemberAppsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMemberAppsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMemberAppsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMemberAppsError: \(error)" + } } } - open class ListMemberAppsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMemberAppsError) -> JSON { + + public class ListMemberAppsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMemberAppsError) throws -> JSON { switch value { - case .memberNotFound: - var d = [String: JSON]() - d[".tag"] = .str("member_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListMemberAppsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "member_not_found": - return ListMemberAppsError.memberNotFound - case "other": - return ListMemberAppsError.other - default: - return ListMemberAppsError.other - } + case .memberNotFound: + var d = [String: JSON]() + d[".tag"] = .str("member_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListMemberAppsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "member_not_found": + return ListMemberAppsError.memberNotFound + case "other": + return ListMemberAppsError.other default: - fatalError("Failed to deserialize") + return ListMemberAppsError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListMemberAppsError.self, json: json) } } } /// The ListMemberAppsResult struct - open class ListMemberAppsResult: CustomStringConvertible { + public class ListMemberAppsResult: CustomStringConvertible, JSONRepresentable { /// List of third party applications linked by this team member. - public let linkedApiApps: Array - public init(linkedApiApps: Array) { + public let linkedApiApps: [Team.ApiApp] + public init(linkedApiApps: [Team.ApiApp]) { self.linkedApiApps = linkedApiApps } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMemberAppsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMemberAppsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMemberAppsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMemberAppsResult: \(error)" + } } } - open class ListMemberAppsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMemberAppsResult) -> JSON { - let output = [ - "linked_api_apps": ArraySerializer(Team.ApiAppSerializer()).serialize(value.linkedApiApps), + + public class ListMemberAppsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMemberAppsResult) throws -> JSON { + let output = [ + "linked_api_apps": try ArraySerializer(Team.ApiAppSerializer()).serialize(value.linkedApiApps), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMemberAppsResult { + + public func deserialize(_ json: JSON) throws -> ListMemberAppsResult { switch json { - case .dictionary(let dict): - let linkedApiApps = ArraySerializer(Team.ApiAppSerializer()).deserialize(dict["linked_api_apps"] ?? .null) - return ListMemberAppsResult(linkedApiApps: linkedApiApps) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let linkedApiApps = try ArraySerializer(Team.ApiAppSerializer()).deserialize(dict["linked_api_apps"] ?? .null) + return ListMemberAppsResult(linkedApiApps: linkedApiApps) + default: + throw JSONSerializerError.deserializeError(type: ListMemberAppsResult.self, json: json) } } } /// The ListMemberDevicesArg struct - open class ListMemberDevicesArg: CustomStringConvertible { + public class ListMemberDevicesArg: CustomStringConvertible, JSONRepresentable { /// The team's member id. public let teamMemberId: String /// Whether to list web sessions of the team's member. @@ -5099,242 +6326,323 @@ open class Team { self.includeDesktopClients = includeDesktopClients self.includeMobileClients = includeMobileClients } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMemberDevicesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMemberDevicesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMemberDevicesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMemberDevicesArg: \(error)" + } } } - open class ListMemberDevicesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMemberDevicesArg) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "include_web_sessions": Serialization._BoolSerializer.serialize(value.includeWebSessions), - "include_desktop_clients": Serialization._BoolSerializer.serialize(value.includeDesktopClients), - "include_mobile_clients": Serialization._BoolSerializer.serialize(value.includeMobileClients), + + public class ListMemberDevicesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMemberDevicesArg) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "include_web_sessions": try Serialization._BoolSerializer.serialize(value.includeWebSessions), + "include_desktop_clients": try Serialization._BoolSerializer.serialize(value.includeDesktopClients), + "include_mobile_clients": try Serialization._BoolSerializer.serialize(value.includeMobileClients), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMemberDevicesArg { + + public func deserialize(_ json: JSON) throws -> ListMemberDevicesArg { switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let includeWebSessions = Serialization._BoolSerializer.deserialize(dict["include_web_sessions"] ?? .number(1)) - let includeDesktopClients = Serialization._BoolSerializer.deserialize(dict["include_desktop_clients"] ?? .number(1)) - let includeMobileClients = Serialization._BoolSerializer.deserialize(dict["include_mobile_clients"] ?? .number(1)) - return ListMemberDevicesArg(teamMemberId: teamMemberId, includeWebSessions: includeWebSessions, includeDesktopClients: includeDesktopClients, includeMobileClients: includeMobileClients) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let includeWebSessions = try Serialization._BoolSerializer.deserialize(dict["include_web_sessions"] ?? .number(1)) + let includeDesktopClients = try Serialization._BoolSerializer.deserialize(dict["include_desktop_clients"] ?? .number(1)) + let includeMobileClients = try Serialization._BoolSerializer.deserialize(dict["include_mobile_clients"] ?? .number(1)) + return ListMemberDevicesArg( + teamMemberId: teamMemberId, + includeWebSessions: includeWebSessions, + includeDesktopClients: includeDesktopClients, + includeMobileClients: includeMobileClients + ) + default: + throw JSONSerializerError.deserializeError(type: ListMemberDevicesArg.self, json: json) } } } /// The ListMemberDevicesError union - public enum ListMemberDevicesError: CustomStringConvertible { + public enum ListMemberDevicesError: CustomStringConvertible, JSONRepresentable { /// Member not found. case memberNotFound /// An unspecified error. case other + func json() throws -> JSON { + try ListMemberDevicesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMemberDevicesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMemberDevicesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMemberDevicesError: \(error)" + } } } - open class ListMemberDevicesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMemberDevicesError) -> JSON { + + public class ListMemberDevicesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMemberDevicesError) throws -> JSON { switch value { - case .memberNotFound: - var d = [String: JSON]() - d[".tag"] = .str("member_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListMemberDevicesError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "member_not_found": - return ListMemberDevicesError.memberNotFound - case "other": - return ListMemberDevicesError.other - default: - return ListMemberDevicesError.other - } + case .memberNotFound: + var d = [String: JSON]() + d[".tag"] = .str("member_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListMemberDevicesError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "member_not_found": + return ListMemberDevicesError.memberNotFound + case "other": + return ListMemberDevicesError.other default: - fatalError("Failed to deserialize") + return ListMemberDevicesError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListMemberDevicesError.self, json: json) } } } /// The ListMemberDevicesResult struct - open class ListMemberDevicesResult: CustomStringConvertible { + public class ListMemberDevicesResult: CustomStringConvertible, JSONRepresentable { /// List of web sessions made by this team member. - public let activeWebSessions: Array? + public let activeWebSessions: [Team.ActiveWebSession]? /// List of desktop clients used by this team member. - public let desktopClientSessions: Array? + public let desktopClientSessions: [Team.DesktopClientSession]? /// List of mobile client used by this team member. - public let mobileClientSessions: Array? - public init(activeWebSessions: Array? = nil, desktopClientSessions: Array? = nil, mobileClientSessions: Array? = nil) { + public let mobileClientSessions: [Team.MobileClientSession]? + public init( + activeWebSessions: [Team.ActiveWebSession]? = nil, + desktopClientSessions: [Team.DesktopClientSession]? = nil, + mobileClientSessions: [Team.MobileClientSession]? = nil + ) { self.activeWebSessions = activeWebSessions self.desktopClientSessions = desktopClientSessions self.mobileClientSessions = mobileClientSessions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMemberDevicesResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMemberDevicesResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMemberDevicesResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMemberDevicesResult: \(error)" + } } } - open class ListMemberDevicesResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMemberDevicesResult) -> JSON { - let output = [ - "active_web_sessions": NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())).serialize(value.activeWebSessions), - "desktop_client_sessions": NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())).serialize(value.desktopClientSessions), - "mobile_client_sessions": NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())).serialize(value.mobileClientSessions), + + public class ListMemberDevicesResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMemberDevicesResult) throws -> JSON { + let output = [ + "active_web_sessions": try NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())).serialize(value.activeWebSessions), + "desktop_client_sessions": try NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())) + .serialize(value.desktopClientSessions), + "mobile_client_sessions": try NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())).serialize(value.mobileClientSessions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMemberDevicesResult { + + public func deserialize(_ json: JSON) throws -> ListMemberDevicesResult { switch json { - case .dictionary(let dict): - let activeWebSessions = NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())).deserialize(dict["active_web_sessions"] ?? .null) - let desktopClientSessions = NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())).deserialize(dict["desktop_client_sessions"] ?? .null) - let mobileClientSessions = NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())).deserialize(dict["mobile_client_sessions"] ?? .null) - return ListMemberDevicesResult(activeWebSessions: activeWebSessions, desktopClientSessions: desktopClientSessions, mobileClientSessions: mobileClientSessions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let activeWebSessions = try NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())) + .deserialize(dict["active_web_sessions"] ?? .null) + let desktopClientSessions = try NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())) + .deserialize(dict["desktop_client_sessions"] ?? .null) + let mobileClientSessions = try NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())) + .deserialize(dict["mobile_client_sessions"] ?? .null) + return ListMemberDevicesResult( + activeWebSessions: activeWebSessions, + desktopClientSessions: desktopClientSessions, + mobileClientSessions: mobileClientSessions + ) + default: + throw JSONSerializerError.deserializeError(type: ListMemberDevicesResult.self, json: json) } } } /// Arguments for linkedAppsListMembersLinkedApps. - open class ListMembersAppsArg: CustomStringConvertible { + public class ListMembersAppsArg: CustomStringConvertible, JSONRepresentable { /// At the first call to the linkedAppsListMembersLinkedApps the cursor shouldn't be passed. Then, if the result - /// of the call includes a cursor, the following requests should include the received cursors in order to - /// receive the next sub list of the team applications. + /// of the call includes a cursor, the following requests should include the received cursors in order + /// to receive the next sub list of the team applications. public let cursor: String? public init(cursor: String? = nil) { nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMembersAppsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMembersAppsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMembersAppsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMembersAppsArg: \(error)" + } } } - open class ListMembersAppsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMembersAppsArg) -> JSON { - let output = [ - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListMembersAppsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMembersAppsArg) throws -> JSON { + let output = [ + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMembersAppsArg { + + public func deserialize(_ json: JSON) throws -> ListMembersAppsArg { switch json { - case .dictionary(let dict): - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListMembersAppsArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListMembersAppsArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListMembersAppsArg.self, json: json) } } } /// Error returned by linkedAppsListMembersLinkedApps. - public enum ListMembersAppsError: CustomStringConvertible { + public enum ListMembersAppsError: CustomStringConvertible, JSONRepresentable { /// Indicates that the cursor has been invalidated. Call linkedAppsListMembersLinkedApps again with an empty /// cursor to obtain a new cursor. case reset /// An unspecified error. case other + func json() throws -> JSON { + try ListMembersAppsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMembersAppsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMembersAppsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMembersAppsError: \(error)" + } } } - open class ListMembersAppsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMembersAppsError) -> JSON { + + public class ListMembersAppsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMembersAppsError) throws -> JSON { switch value { - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListMembersAppsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "reset": - return ListMembersAppsError.reset - case "other": - return ListMembersAppsError.other - default: - return ListMembersAppsError.other - } + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListMembersAppsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "reset": + return ListMembersAppsError.reset + case "other": + return ListMembersAppsError.other default: - fatalError("Failed to deserialize") + return ListMembersAppsError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListMembersAppsError.self, json: json) } } } /// Information returned by linkedAppsListMembersLinkedApps. - open class ListMembersAppsResult: CustomStringConvertible { + public class ListMembersAppsResult: CustomStringConvertible, JSONRepresentable { /// The linked applications of each member of the team. - public let apps: Array + public let apps: [Team.MemberLinkedApps] /// If true, then there are more apps available. Pass the cursor to linkedAppsListMembersLinkedApps to retrieve /// the rest. public let hasMore: Bool /// Pass the cursor into linkedAppsListMembersLinkedApps to receive the next sub list of team's applications. public let cursor: String? - public init(apps: Array, hasMore: Bool, cursor: String? = nil) { + public init(apps: [Team.MemberLinkedApps], hasMore: Bool, cursor: String? = nil) { self.apps = apps self.hasMore = hasMore nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMembersAppsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMembersAppsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMembersAppsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMembersAppsResult: \(error)" + } } } - open class ListMembersAppsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMembersAppsResult) -> JSON { - let output = [ - "apps": ArraySerializer(Team.MemberLinkedAppsSerializer()).serialize(value.apps), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListMembersAppsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMembersAppsResult) throws -> JSON { + let output = [ + "apps": try ArraySerializer(Team.MemberLinkedAppsSerializer()).serialize(value.apps), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMembersAppsResult { + + public func deserialize(_ json: JSON) throws -> ListMembersAppsResult { switch json { - case .dictionary(let dict): - let apps = ArraySerializer(Team.MemberLinkedAppsSerializer()).deserialize(dict["apps"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListMembersAppsResult(apps: apps, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let apps = try ArraySerializer(Team.MemberLinkedAppsSerializer()).deserialize(dict["apps"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListMembersAppsResult(apps: apps, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListMembersAppsResult.self, json: json) } } } /// The ListMembersDevicesArg struct - open class ListMembersDevicesArg: CustomStringConvertible { + public class ListMembersDevicesArg: CustomStringConvertible, JSONRepresentable { /// At the first call to the devicesListMembersDevices the cursor shouldn't be passed. Then, if the result of - /// the call includes a cursor, the following requests should include the received cursors in order to receive - /// the next sub list of team devices. + /// the call includes a cursor, the following requests should include the received cursors in order to + /// receive the next sub list of team devices. public let cursor: String? /// Whether to list web sessions of the team members. public let includeWebSessions: Bool @@ -5349,245 +6657,314 @@ open class Team { self.includeDesktopClients = includeDesktopClients self.includeMobileClients = includeMobileClients } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMembersDevicesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMembersDevicesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMembersDevicesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMembersDevicesArg: \(error)" + } } } - open class ListMembersDevicesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMembersDevicesArg) -> JSON { - let output = [ - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), - "include_web_sessions": Serialization._BoolSerializer.serialize(value.includeWebSessions), - "include_desktop_clients": Serialization._BoolSerializer.serialize(value.includeDesktopClients), - "include_mobile_clients": Serialization._BoolSerializer.serialize(value.includeMobileClients), + + public class ListMembersDevicesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMembersDevicesArg) throws -> JSON { + let output = [ + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + "include_web_sessions": try Serialization._BoolSerializer.serialize(value.includeWebSessions), + "include_desktop_clients": try Serialization._BoolSerializer.serialize(value.includeDesktopClients), + "include_mobile_clients": try Serialization._BoolSerializer.serialize(value.includeMobileClients), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMembersDevicesArg { + + public func deserialize(_ json: JSON) throws -> ListMembersDevicesArg { switch json { - case .dictionary(let dict): - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - let includeWebSessions = Serialization._BoolSerializer.deserialize(dict["include_web_sessions"] ?? .number(1)) - let includeDesktopClients = Serialization._BoolSerializer.deserialize(dict["include_desktop_clients"] ?? .number(1)) - let includeMobileClients = Serialization._BoolSerializer.deserialize(dict["include_mobile_clients"] ?? .number(1)) - return ListMembersDevicesArg(cursor: cursor, includeWebSessions: includeWebSessions, includeDesktopClients: includeDesktopClients, includeMobileClients: includeMobileClients) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + let includeWebSessions = try Serialization._BoolSerializer.deserialize(dict["include_web_sessions"] ?? .number(1)) + let includeDesktopClients = try Serialization._BoolSerializer.deserialize(dict["include_desktop_clients"] ?? .number(1)) + let includeMobileClients = try Serialization._BoolSerializer.deserialize(dict["include_mobile_clients"] ?? .number(1)) + return ListMembersDevicesArg( + cursor: cursor, + includeWebSessions: includeWebSessions, + includeDesktopClients: includeDesktopClients, + includeMobileClients: includeMobileClients + ) + default: + throw JSONSerializerError.deserializeError(type: ListMembersDevicesArg.self, json: json) } } } /// The ListMembersDevicesError union - public enum ListMembersDevicesError: CustomStringConvertible { + public enum ListMembersDevicesError: CustomStringConvertible, JSONRepresentable { /// Indicates that the cursor has been invalidated. Call devicesListMembersDevices again with an empty cursor to /// obtain a new cursor. case reset /// An unspecified error. case other + func json() throws -> JSON { + try ListMembersDevicesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMembersDevicesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMembersDevicesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMembersDevicesError: \(error)" + } } } - open class ListMembersDevicesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMembersDevicesError) -> JSON { + + public class ListMembersDevicesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMembersDevicesError) throws -> JSON { switch value { - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListMembersDevicesError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "reset": - return ListMembersDevicesError.reset - case "other": - return ListMembersDevicesError.other - default: - return ListMembersDevicesError.other - } + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListMembersDevicesError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "reset": + return ListMembersDevicesError.reset + case "other": + return ListMembersDevicesError.other default: - fatalError("Failed to deserialize") + return ListMembersDevicesError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListMembersDevicesError.self, json: json) } } } /// The ListMembersDevicesResult struct - open class ListMembersDevicesResult: CustomStringConvertible { + public class ListMembersDevicesResult: CustomStringConvertible, JSONRepresentable { /// The devices of each member of the team. - public let devices: Array + public let devices: [Team.MemberDevices] /// If true, then there are more devices available. Pass the cursor to devicesListMembersDevices to retrieve the /// rest. public let hasMore: Bool /// Pass the cursor into devicesListMembersDevices to receive the next sub list of team's devices. public let cursor: String? - public init(devices: Array, hasMore: Bool, cursor: String? = nil) { + public init(devices: [Team.MemberDevices], hasMore: Bool, cursor: String? = nil) { self.devices = devices self.hasMore = hasMore nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListMembersDevicesResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListMembersDevicesResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListMembersDevicesResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListMembersDevicesResult: \(error)" + } } } - open class ListMembersDevicesResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListMembersDevicesResult) -> JSON { - let output = [ - "devices": ArraySerializer(Team.MemberDevicesSerializer()).serialize(value.devices), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListMembersDevicesResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListMembersDevicesResult) throws -> JSON { + let output = [ + "devices": try ArraySerializer(Team.MemberDevicesSerializer()).serialize(value.devices), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListMembersDevicesResult { + + public func deserialize(_ json: JSON) throws -> ListMembersDevicesResult { switch json { - case .dictionary(let dict): - let devices = ArraySerializer(Team.MemberDevicesSerializer()).deserialize(dict["devices"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListMembersDevicesResult(devices: devices, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let devices = try ArraySerializer(Team.MemberDevicesSerializer()).deserialize(dict["devices"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListMembersDevicesResult(devices: devices, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListMembersDevicesResult.self, json: json) } } } /// Arguments for linkedAppsListTeamLinkedApps. - open class ListTeamAppsArg: CustomStringConvertible { + public class ListTeamAppsArg: CustomStringConvertible, JSONRepresentable { /// At the first call to the linkedAppsListTeamLinkedApps the cursor shouldn't be passed. Then, if the result of - /// the call includes a cursor, the following requests should include the received cursors in order to receive - /// the next sub list of the team applications. + /// the call includes a cursor, the following requests should include the received cursors in order to + /// receive the next sub list of the team applications. public let cursor: String? public init(cursor: String? = nil) { nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListTeamAppsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListTeamAppsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListTeamAppsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListTeamAppsArg: \(error)" + } } } - open class ListTeamAppsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListTeamAppsArg) -> JSON { - let output = [ - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListTeamAppsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListTeamAppsArg) throws -> JSON { + let output = [ + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListTeamAppsArg { + + public func deserialize(_ json: JSON) throws -> ListTeamAppsArg { switch json { - case .dictionary(let dict): - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListTeamAppsArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListTeamAppsArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListTeamAppsArg.self, json: json) } } } /// Error returned by linkedAppsListTeamLinkedApps. - public enum ListTeamAppsError: CustomStringConvertible { + public enum ListTeamAppsError: CustomStringConvertible, JSONRepresentable { /// Indicates that the cursor has been invalidated. Call linkedAppsListTeamLinkedApps again with an empty cursor /// to obtain a new cursor. case reset /// An unspecified error. case other + func json() throws -> JSON { + try ListTeamAppsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListTeamAppsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListTeamAppsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListTeamAppsError: \(error)" + } } } - open class ListTeamAppsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListTeamAppsError) -> JSON { + + public class ListTeamAppsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListTeamAppsError) throws -> JSON { switch value { - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListTeamAppsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "reset": - return ListTeamAppsError.reset - case "other": - return ListTeamAppsError.other - default: - return ListTeamAppsError.other - } + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListTeamAppsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "reset": + return ListTeamAppsError.reset + case "other": + return ListTeamAppsError.other default: - fatalError("Failed to deserialize") + return ListTeamAppsError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListTeamAppsError.self, json: json) } } } /// Information returned by linkedAppsListTeamLinkedApps. - open class ListTeamAppsResult: CustomStringConvertible { + public class ListTeamAppsResult: CustomStringConvertible, JSONRepresentable { /// The linked applications of each member of the team. - public let apps: Array + public let apps: [Team.MemberLinkedApps] /// If true, then there are more apps available. Pass the cursor to linkedAppsListTeamLinkedApps to retrieve the /// rest. public let hasMore: Bool /// Pass the cursor into linkedAppsListTeamLinkedApps to receive the next sub list of team's applications. public let cursor: String? - public init(apps: Array, hasMore: Bool, cursor: String? = nil) { + public init(apps: [Team.MemberLinkedApps], hasMore: Bool, cursor: String? = nil) { self.apps = apps self.hasMore = hasMore nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListTeamAppsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListTeamAppsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListTeamAppsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListTeamAppsResult: \(error)" + } } } - open class ListTeamAppsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListTeamAppsResult) -> JSON { - let output = [ - "apps": ArraySerializer(Team.MemberLinkedAppsSerializer()).serialize(value.apps), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListTeamAppsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListTeamAppsResult) throws -> JSON { + let output = [ + "apps": try ArraySerializer(Team.MemberLinkedAppsSerializer()).serialize(value.apps), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListTeamAppsResult { + + public func deserialize(_ json: JSON) throws -> ListTeamAppsResult { switch json { - case .dictionary(let dict): - let apps = ArraySerializer(Team.MemberLinkedAppsSerializer()).deserialize(dict["apps"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListTeamAppsResult(apps: apps, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let apps = try ArraySerializer(Team.MemberLinkedAppsSerializer()).deserialize(dict["apps"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListTeamAppsResult(apps: apps, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListTeamAppsResult.self, json: json) } } } /// The ListTeamDevicesArg struct - open class ListTeamDevicesArg: CustomStringConvertible { + public class ListTeamDevicesArg: CustomStringConvertible, JSONRepresentable { /// At the first call to the devicesListTeamDevices the cursor shouldn't be passed. Then, if the result of the - /// call includes a cursor, the following requests should include the received cursors in order to receive the - /// next sub list of team devices. + /// call includes a cursor, the following requests should include the received cursors in order to + /// receive the next sub list of team devices. public let cursor: String? /// Whether to list web sessions of the team members. public let includeWebSessions: Bool @@ -5602,123 +6979,160 @@ open class Team { self.includeDesktopClients = includeDesktopClients self.includeMobileClients = includeMobileClients } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListTeamDevicesArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListTeamDevicesArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListTeamDevicesArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListTeamDevicesArg: \(error)" + } } } - open class ListTeamDevicesArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListTeamDevicesArg) -> JSON { - let output = [ - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), - "include_web_sessions": Serialization._BoolSerializer.serialize(value.includeWebSessions), - "include_desktop_clients": Serialization._BoolSerializer.serialize(value.includeDesktopClients), - "include_mobile_clients": Serialization._BoolSerializer.serialize(value.includeMobileClients), + + public class ListTeamDevicesArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListTeamDevicesArg) throws -> JSON { + let output = [ + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + "include_web_sessions": try Serialization._BoolSerializer.serialize(value.includeWebSessions), + "include_desktop_clients": try Serialization._BoolSerializer.serialize(value.includeDesktopClients), + "include_mobile_clients": try Serialization._BoolSerializer.serialize(value.includeMobileClients), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListTeamDevicesArg { + + public func deserialize(_ json: JSON) throws -> ListTeamDevicesArg { switch json { - case .dictionary(let dict): - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - let includeWebSessions = Serialization._BoolSerializer.deserialize(dict["include_web_sessions"] ?? .number(1)) - let includeDesktopClients = Serialization._BoolSerializer.deserialize(dict["include_desktop_clients"] ?? .number(1)) - let includeMobileClients = Serialization._BoolSerializer.deserialize(dict["include_mobile_clients"] ?? .number(1)) - return ListTeamDevicesArg(cursor: cursor, includeWebSessions: includeWebSessions, includeDesktopClients: includeDesktopClients, includeMobileClients: includeMobileClients) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + let includeWebSessions = try Serialization._BoolSerializer.deserialize(dict["include_web_sessions"] ?? .number(1)) + let includeDesktopClients = try Serialization._BoolSerializer.deserialize(dict["include_desktop_clients"] ?? .number(1)) + let includeMobileClients = try Serialization._BoolSerializer.deserialize(dict["include_mobile_clients"] ?? .number(1)) + return ListTeamDevicesArg( + cursor: cursor, + includeWebSessions: includeWebSessions, + includeDesktopClients: includeDesktopClients, + includeMobileClients: includeMobileClients + ) + default: + throw JSONSerializerError.deserializeError(type: ListTeamDevicesArg.self, json: json) } } } /// The ListTeamDevicesError union - public enum ListTeamDevicesError: CustomStringConvertible { + public enum ListTeamDevicesError: CustomStringConvertible, JSONRepresentable { /// Indicates that the cursor has been invalidated. Call devicesListTeamDevices again with an empty cursor to /// obtain a new cursor. case reset /// An unspecified error. case other + func json() throws -> JSON { + try ListTeamDevicesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListTeamDevicesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListTeamDevicesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListTeamDevicesError: \(error)" + } } } - open class ListTeamDevicesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListTeamDevicesError) -> JSON { + + public class ListTeamDevicesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListTeamDevicesError) throws -> JSON { switch value { - case .reset: - var d = [String: JSON]() - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ListTeamDevicesError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "reset": - return ListTeamDevicesError.reset - case "other": - return ListTeamDevicesError.other - default: - return ListTeamDevicesError.other - } + case .reset: + var d = [String: JSON]() + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ListTeamDevicesError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "reset": + return ListTeamDevicesError.reset + case "other": + return ListTeamDevicesError.other default: - fatalError("Failed to deserialize") + return ListTeamDevicesError.other + } + default: + throw JSONSerializerError.deserializeError(type: ListTeamDevicesError.self, json: json) } } } /// The ListTeamDevicesResult struct - open class ListTeamDevicesResult: CustomStringConvertible { + public class ListTeamDevicesResult: CustomStringConvertible, JSONRepresentable { /// The devices of each member of the team. - public let devices: Array + public let devices: [Team.MemberDevices] /// If true, then there are more devices available. Pass the cursor to devicesListTeamDevices to retrieve the /// rest. public let hasMore: Bool /// Pass the cursor into devicesListTeamDevices to receive the next sub list of team's devices. public let cursor: String? - public init(devices: Array, hasMore: Bool, cursor: String? = nil) { + public init(devices: [Team.MemberDevices], hasMore: Bool, cursor: String? = nil) { self.devices = devices self.hasMore = hasMore nullableValidator(stringValidator())(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ListTeamDevicesResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ListTeamDevicesResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ListTeamDevicesResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ListTeamDevicesResult: \(error)" + } } } - open class ListTeamDevicesResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ListTeamDevicesResult) -> JSON { - let output = [ - "devices": ArraySerializer(Team.MemberDevicesSerializer()).serialize(value.devices), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), - "cursor": NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), + + public class ListTeamDevicesResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ListTeamDevicesResult) throws -> JSON { + let output = [ + "devices": try ArraySerializer(Team.MemberDevicesSerializer()).serialize(value.devices), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), + "cursor": try NullableSerializer(Serialization._StringSerializer).serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ListTeamDevicesResult { + + public func deserialize(_ json: JSON) throws -> ListTeamDevicesResult { switch json { - case .dictionary(let dict): - let devices = ArraySerializer(Team.MemberDevicesSerializer()).deserialize(dict["devices"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - let cursor = NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) - return ListTeamDevicesResult(devices: devices, hasMore: hasMore, cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let devices = try ArraySerializer(Team.MemberDevicesSerializer()).deserialize(dict["devices"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + let cursor = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["cursor"] ?? .null) + return ListTeamDevicesResult(devices: devices, hasMore: hasMore, cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: ListTeamDevicesResult.self, json: json) } } } /// Specify access type a member should have when joined to a group. - open class MemberAccess: CustomStringConvertible { + public class MemberAccess: CustomStringConvertible, JSONRepresentable { /// Identity of a user. public let user: Team.UserSelectorArg /// Access type. @@ -5727,33 +7141,44 @@ open class Team { self.user = user self.accessType = accessType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAccessSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberAccessSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAccessSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAccess: \(error)" + } } } - open class MemberAccessSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAccess) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "access_type": Team.GroupAccessTypeSerializer().serialize(value.accessType), + + public class MemberAccessSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAccess) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "access_type": try Team.GroupAccessTypeSerializer().serialize(value.accessType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberAccess { + + public func deserialize(_ json: JSON) throws -> MemberAccess { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let accessType = Team.GroupAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) - return MemberAccess(user: user, accessType: accessType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let accessType = try Team.GroupAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) + return MemberAccess(user: user, accessType: accessType) + default: + throw JSONSerializerError.deserializeError(type: MemberAccess.self, json: json) } } } /// The MemberAddArgBase struct - open class MemberAddArgBase: CustomStringConvertible { + public class MemberAddArgBase: CustomStringConvertible, JSONRepresentable { /// (no description) public let memberEmail: String /// Member's first name. @@ -5765,12 +7190,20 @@ open class Team { /// Persistent ID for member. This field is only available to teams using persistent ID SAML configuration. public let memberPersistentId: String? /// Whether to send a welcome email to the member. If send_welcome_email is false, no email invitation will be - /// sent to the user. This may be useful for apps using single sign-on (SSO) flows for onboarding that want to - /// handle announcements themselves. + /// sent to the user. This may be useful for apps using single sign-on (SSO) flows for onboarding that + /// want to handle announcements themselves. public let sendWelcomeEmail: Bool /// Whether a user is directory restricted. public let isDirectoryRestricted: Bool? - public init(memberEmail: String, memberGivenName: String? = nil, memberSurname: String? = nil, memberExternalId: String? = nil, memberPersistentId: String? = nil, sendWelcomeEmail: Bool = true, isDirectoryRestricted: Bool? = nil) { + public init( + memberEmail: String, + memberGivenName: String? = nil, + memberSurname: String? = nil, + memberExternalId: String? = nil, + memberPersistentId: String? = nil, + sendWelcomeEmail: Bool = true, + isDirectoryRestricted: Bool? = nil + ) { stringValidator(maxLength: 255, pattern: "^['#&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$")(memberEmail) self.memberEmail = memberEmail nullableValidator(stringValidator(maxLength: 100, pattern: "[^/:?*<>\"|]*"))(memberGivenName) @@ -5784,88 +7217,140 @@ open class Team { self.sendWelcomeEmail = sendWelcomeEmail self.isDirectoryRestricted = isDirectoryRestricted } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddArgBaseSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberAddArgBaseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddArgBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddArgBase: \(error)" + } } } - open class MemberAddArgBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddArgBase) -> JSON { - let output = [ - "member_email": Serialization._StringSerializer.serialize(value.memberEmail), - "member_given_name": NullableSerializer(Serialization._StringSerializer).serialize(value.memberGivenName), - "member_surname": NullableSerializer(Serialization._StringSerializer).serialize(value.memberSurname), - "member_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), - "member_persistent_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberPersistentId), - "send_welcome_email": Serialization._BoolSerializer.serialize(value.sendWelcomeEmail), - "is_directory_restricted": NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), + + public class MemberAddArgBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddArgBase) throws -> JSON { + let output = [ + "member_email": try Serialization._StringSerializer.serialize(value.memberEmail), + "member_given_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberGivenName), + "member_surname": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberSurname), + "member_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), + "member_persistent_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberPersistentId), + "send_welcome_email": try Serialization._BoolSerializer.serialize(value.sendWelcomeEmail), + "is_directory_restricted": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberAddArgBase { + + public func deserialize(_ json: JSON) throws -> MemberAddArgBase { switch json { - case .dictionary(let dict): - let memberEmail = Serialization._StringSerializer.deserialize(dict["member_email"] ?? .null) - let memberGivenName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_given_name"] ?? .null) - let memberSurname = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_surname"] ?? .null) - let memberExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) - let memberPersistentId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_persistent_id"] ?? .null) - let sendWelcomeEmail = Serialization._BoolSerializer.deserialize(dict["send_welcome_email"] ?? .number(1)) - let isDirectoryRestricted = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) - return MemberAddArgBase(memberEmail: memberEmail, memberGivenName: memberGivenName, memberSurname: memberSurname, memberExternalId: memberExternalId, memberPersistentId: memberPersistentId, sendWelcomeEmail: sendWelcomeEmail, isDirectoryRestricted: isDirectoryRestricted) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let memberEmail = try Serialization._StringSerializer.deserialize(dict["member_email"] ?? .null) + let memberGivenName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_given_name"] ?? .null) + let memberSurname = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_surname"] ?? .null) + let memberExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) + let memberPersistentId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_persistent_id"] ?? .null) + let sendWelcomeEmail = try Serialization._BoolSerializer.deserialize(dict["send_welcome_email"] ?? .number(1)) + let isDirectoryRestricted = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) + return MemberAddArgBase( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail, + isDirectoryRestricted: isDirectoryRestricted + ) + default: + throw JSONSerializerError.deserializeError(type: MemberAddArgBase.self, json: json) } } } /// The MemberAddArg struct - open class MemberAddArg: Team.MemberAddArgBase { + public class MemberAddArg: Team.MemberAddArgBase { /// (no description) public let role: Team.AdminTier - public init(memberEmail: String, memberGivenName: String? = nil, memberSurname: String? = nil, memberExternalId: String? = nil, memberPersistentId: String? = nil, sendWelcomeEmail: Bool = true, isDirectoryRestricted: Bool? = nil, role: Team.AdminTier = .memberOnly) { + public init( + memberEmail: String, + memberGivenName: String? = nil, + memberSurname: String? = nil, + memberExternalId: String? = nil, + memberPersistentId: String? = nil, + sendWelcomeEmail: Bool = true, + isDirectoryRestricted: Bool? = nil, + role: Team.AdminTier = .memberOnly + ) { self.role = role - super.init(memberEmail: memberEmail, memberGivenName: memberGivenName, memberSurname: memberSurname, memberExternalId: memberExternalId, memberPersistentId: memberPersistentId, sendWelcomeEmail: sendWelcomeEmail, isDirectoryRestricted: isDirectoryRestricted) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddArgSerializer().serialize(self)))" - } - } - open class MemberAddArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddArg) -> JSON { - let output = [ - "member_email": Serialization._StringSerializer.serialize(value.memberEmail), - "member_given_name": NullableSerializer(Serialization._StringSerializer).serialize(value.memberGivenName), - "member_surname": NullableSerializer(Serialization._StringSerializer).serialize(value.memberSurname), - "member_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), - "member_persistent_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberPersistentId), - "send_welcome_email": Serialization._BoolSerializer.serialize(value.sendWelcomeEmail), - "is_directory_restricted": NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), - "role": Team.AdminTierSerializer().serialize(value.role), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> MemberAddArg { - switch json { - case .dictionary(let dict): - let memberEmail = Serialization._StringSerializer.deserialize(dict["member_email"] ?? .null) - let memberGivenName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_given_name"] ?? .null) - let memberSurname = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_surname"] ?? .null) - let memberExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) - let memberPersistentId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_persistent_id"] ?? .null) - let sendWelcomeEmail = Serialization._BoolSerializer.deserialize(dict["send_welcome_email"] ?? .number(1)) - let isDirectoryRestricted = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) - let role = Team.AdminTierSerializer().deserialize(dict["role"] ?? Team.AdminTierSerializer().serialize(.memberOnly)) - return MemberAddArg(memberEmail: memberEmail, memberGivenName: memberGivenName, memberSurname: memberSurname, memberExternalId: memberExternalId, memberPersistentId: memberPersistentId, sendWelcomeEmail: sendWelcomeEmail, isDirectoryRestricted: isDirectoryRestricted, role: role) - default: - fatalError("Type error deserializing") + super.init( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail, + isDirectoryRestricted: isDirectoryRestricted + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddArg: \(error)" + } + } + } + + public class MemberAddArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddArg) throws -> JSON { + let output = [ + "member_email": try Serialization._StringSerializer.serialize(value.memberEmail), + "member_given_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberGivenName), + "member_surname": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberSurname), + "member_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), + "member_persistent_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberPersistentId), + "send_welcome_email": try Serialization._BoolSerializer.serialize(value.sendWelcomeEmail), + "is_directory_restricted": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), + "role": try Team.AdminTierSerializer().serialize(value.role), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> MemberAddArg { + switch json { + case .dictionary(let dict): + let memberEmail = try Serialization._StringSerializer.deserialize(dict["member_email"] ?? .null) + let memberGivenName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_given_name"] ?? .null) + let memberSurname = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_surname"] ?? .null) + let memberExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) + let memberPersistentId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_persistent_id"] ?? .null) + let sendWelcomeEmail = try Serialization._BoolSerializer.deserialize(dict["send_welcome_email"] ?? .number(1)) + let isDirectoryRestricted = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) + let role = try Team.AdminTierSerializer().deserialize(dict["role"] ?? Team.AdminTierSerializer().serialize(.memberOnly)) + return MemberAddArg( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail, + isDirectoryRestricted: isDirectoryRestricted, + role: role + ) + default: + throw JSONSerializerError.deserializeError(type: MemberAddArg.self, json: json) } } } /// The MemberAddResultBase union - public enum MemberAddResultBase: CustomStringConvertible { + public enum MemberAddResultBase: CustomStringConvertible, JSONRepresentable { /// Team is already full. The organization has no available licenses. case teamLicenseLimit(String) /// Team is already full. The free team member limit has been reached. @@ -5890,104 +7375,114 @@ open class Team { /// User creation has failed. case userCreationFailed(String) + func json() throws -> JSON { + try MemberAddResultBaseSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddResultBaseSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddResultBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddResultBase: \(error)" + } } } - open class MemberAddResultBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddResultBase) -> JSON { + + public class MemberAddResultBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddResultBase) throws -> JSON { switch value { - case .teamLicenseLimit(let arg): - var d = ["team_license_limit": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("team_license_limit") - return .dictionary(d) - case .freeTeamMemberLimitReached(let arg): - var d = ["free_team_member_limit_reached": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("free_team_member_limit_reached") - return .dictionary(d) - case .userAlreadyOnTeam(let arg): - var d = ["user_already_on_team": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_already_on_team") - return .dictionary(d) - case .userOnAnotherTeam(let arg): - var d = ["user_on_another_team": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_on_another_team") - return .dictionary(d) - case .userAlreadyPaired(let arg): - var d = ["user_already_paired": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_already_paired") - return .dictionary(d) - case .userMigrationFailed(let arg): - var d = ["user_migration_failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_migration_failed") - return .dictionary(d) - case .duplicateExternalMemberId(let arg): - var d = ["duplicate_external_member_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("duplicate_external_member_id") - return .dictionary(d) - case .duplicateMemberPersistentId(let arg): - var d = ["duplicate_member_persistent_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("duplicate_member_persistent_id") - return .dictionary(d) - case .persistentIdDisabled(let arg): - var d = ["persistent_id_disabled": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("persistent_id_disabled") - return .dictionary(d) - case .userCreationFailed(let arg): - var d = ["user_creation_failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_creation_failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberAddResultBase { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team_license_limit": - let v = Serialization._StringSerializer.deserialize(d["team_license_limit"] ?? .null) - return MemberAddResultBase.teamLicenseLimit(v) - case "free_team_member_limit_reached": - let v = Serialization._StringSerializer.deserialize(d["free_team_member_limit_reached"] ?? .null) - return MemberAddResultBase.freeTeamMemberLimitReached(v) - case "user_already_on_team": - let v = Serialization._StringSerializer.deserialize(d["user_already_on_team"] ?? .null) - return MemberAddResultBase.userAlreadyOnTeam(v) - case "user_on_another_team": - let v = Serialization._StringSerializer.deserialize(d["user_on_another_team"] ?? .null) - return MemberAddResultBase.userOnAnotherTeam(v) - case "user_already_paired": - let v = Serialization._StringSerializer.deserialize(d["user_already_paired"] ?? .null) - return MemberAddResultBase.userAlreadyPaired(v) - case "user_migration_failed": - let v = Serialization._StringSerializer.deserialize(d["user_migration_failed"] ?? .null) - return MemberAddResultBase.userMigrationFailed(v) - case "duplicate_external_member_id": - let v = Serialization._StringSerializer.deserialize(d["duplicate_external_member_id"] ?? .null) - return MemberAddResultBase.duplicateExternalMemberId(v) - case "duplicate_member_persistent_id": - let v = Serialization._StringSerializer.deserialize(d["duplicate_member_persistent_id"] ?? .null) - return MemberAddResultBase.duplicateMemberPersistentId(v) - case "persistent_id_disabled": - let v = Serialization._StringSerializer.deserialize(d["persistent_id_disabled"] ?? .null) - return MemberAddResultBase.persistentIdDisabled(v) - case "user_creation_failed": - let v = Serialization._StringSerializer.deserialize(d["user_creation_failed"] ?? .null) - return MemberAddResultBase.userCreationFailed(v) - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .teamLicenseLimit(let arg): + var d = try ["team_license_limit": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("team_license_limit") + return .dictionary(d) + case .freeTeamMemberLimitReached(let arg): + var d = try ["free_team_member_limit_reached": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("free_team_member_limit_reached") + return .dictionary(d) + case .userAlreadyOnTeam(let arg): + var d = try ["user_already_on_team": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_already_on_team") + return .dictionary(d) + case .userOnAnotherTeam(let arg): + var d = try ["user_on_another_team": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_on_another_team") + return .dictionary(d) + case .userAlreadyPaired(let arg): + var d = try ["user_already_paired": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_already_paired") + return .dictionary(d) + case .userMigrationFailed(let arg): + var d = try ["user_migration_failed": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_migration_failed") + return .dictionary(d) + case .duplicateExternalMemberId(let arg): + var d = try ["duplicate_external_member_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("duplicate_external_member_id") + return .dictionary(d) + case .duplicateMemberPersistentId(let arg): + var d = try ["duplicate_member_persistent_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("duplicate_member_persistent_id") + return .dictionary(d) + case .persistentIdDisabled(let arg): + var d = try ["persistent_id_disabled": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("persistent_id_disabled") + return .dictionary(d) + case .userCreationFailed(let arg): + var d = try ["user_creation_failed": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_creation_failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberAddResultBase { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team_license_limit": + let v = try Serialization._StringSerializer.deserialize(d["team_license_limit"] ?? .null) + return MemberAddResultBase.teamLicenseLimit(v) + case "free_team_member_limit_reached": + let v = try Serialization._StringSerializer.deserialize(d["free_team_member_limit_reached"] ?? .null) + return MemberAddResultBase.freeTeamMemberLimitReached(v) + case "user_already_on_team": + let v = try Serialization._StringSerializer.deserialize(d["user_already_on_team"] ?? .null) + return MemberAddResultBase.userAlreadyOnTeam(v) + case "user_on_another_team": + let v = try Serialization._StringSerializer.deserialize(d["user_on_another_team"] ?? .null) + return MemberAddResultBase.userOnAnotherTeam(v) + case "user_already_paired": + let v = try Serialization._StringSerializer.deserialize(d["user_already_paired"] ?? .null) + return MemberAddResultBase.userAlreadyPaired(v) + case "user_migration_failed": + let v = try Serialization._StringSerializer.deserialize(d["user_migration_failed"] ?? .null) + return MemberAddResultBase.userMigrationFailed(v) + case "duplicate_external_member_id": + let v = try Serialization._StringSerializer.deserialize(d["duplicate_external_member_id"] ?? .null) + return MemberAddResultBase.duplicateExternalMemberId(v) + case "duplicate_member_persistent_id": + let v = try Serialization._StringSerializer.deserialize(d["duplicate_member_persistent_id"] ?? .null) + return MemberAddResultBase.duplicateMemberPersistentId(v) + case "persistent_id_disabled": + let v = try Serialization._StringSerializer.deserialize(d["persistent_id_disabled"] ?? .null) + return MemberAddResultBase.persistentIdDisabled(v) + case "user_creation_failed": + let v = try Serialization._StringSerializer.deserialize(d["user_creation_failed"] ?? .null) + return MemberAddResultBase.userCreationFailed(v) + default: + throw JSONSerializerError.unknownTag(type: MemberAddResultBase.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MemberAddResultBase.self, json: json) } } } /// Describes the result of attempting to add a single user to the team. 'success' is the only value indicating that - /// a user was indeed added to the team - the other values explain the type of failure that occurred, and include - /// the email of the user for which the operation has failed. - public enum MemberAddResult: CustomStringConvertible { + /// a user was indeed added to the team - the other values explain the type of failure that occurred, and + /// include the email of the user for which the operation has failed. + public enum MemberAddResult: CustomStringConvertible, JSONRepresentable { /// Team is already full. The organization has no available licenses. case teamLicenseLimit(String) /// Team is already full. The free team member limit has been reached. @@ -6014,157 +7509,200 @@ open class Team { /// Describes a user that was successfully added to the team. case success(Team.TeamMemberInfo) + func json() throws -> JSON { + try MemberAddResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddResult: \(error)" + } } } - open class MemberAddResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddResult) -> JSON { + + public class MemberAddResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddResult) throws -> JSON { switch value { - case .teamLicenseLimit(let arg): - var d = ["team_license_limit": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("team_license_limit") - return .dictionary(d) - case .freeTeamMemberLimitReached(let arg): - var d = ["free_team_member_limit_reached": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("free_team_member_limit_reached") - return .dictionary(d) - case .userAlreadyOnTeam(let arg): - var d = ["user_already_on_team": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_already_on_team") - return .dictionary(d) - case .userOnAnotherTeam(let arg): - var d = ["user_on_another_team": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_on_another_team") - return .dictionary(d) - case .userAlreadyPaired(let arg): - var d = ["user_already_paired": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_already_paired") - return .dictionary(d) - case .userMigrationFailed(let arg): - var d = ["user_migration_failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_migration_failed") - return .dictionary(d) - case .duplicateExternalMemberId(let arg): - var d = ["duplicate_external_member_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("duplicate_external_member_id") - return .dictionary(d) - case .duplicateMemberPersistentId(let arg): - var d = ["duplicate_member_persistent_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("duplicate_member_persistent_id") - return .dictionary(d) - case .persistentIdDisabled(let arg): - var d = ["persistent_id_disabled": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("persistent_id_disabled") - return .dictionary(d) - case .userCreationFailed(let arg): - var d = ["user_creation_failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_creation_failed") - return .dictionary(d) - case .success(let arg): - var d = Serialization.getFields(Team.TeamMemberInfoSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberAddResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team_license_limit": - let v = Serialization._StringSerializer.deserialize(d["team_license_limit"] ?? .null) - return MemberAddResult.teamLicenseLimit(v) - case "free_team_member_limit_reached": - let v = Serialization._StringSerializer.deserialize(d["free_team_member_limit_reached"] ?? .null) - return MemberAddResult.freeTeamMemberLimitReached(v) - case "user_already_on_team": - let v = Serialization._StringSerializer.deserialize(d["user_already_on_team"] ?? .null) - return MemberAddResult.userAlreadyOnTeam(v) - case "user_on_another_team": - let v = Serialization._StringSerializer.deserialize(d["user_on_another_team"] ?? .null) - return MemberAddResult.userOnAnotherTeam(v) - case "user_already_paired": - let v = Serialization._StringSerializer.deserialize(d["user_already_paired"] ?? .null) - return MemberAddResult.userAlreadyPaired(v) - case "user_migration_failed": - let v = Serialization._StringSerializer.deserialize(d["user_migration_failed"] ?? .null) - return MemberAddResult.userMigrationFailed(v) - case "duplicate_external_member_id": - let v = Serialization._StringSerializer.deserialize(d["duplicate_external_member_id"] ?? .null) - return MemberAddResult.duplicateExternalMemberId(v) - case "duplicate_member_persistent_id": - let v = Serialization._StringSerializer.deserialize(d["duplicate_member_persistent_id"] ?? .null) - return MemberAddResult.duplicateMemberPersistentId(v) - case "persistent_id_disabled": - let v = Serialization._StringSerializer.deserialize(d["persistent_id_disabled"] ?? .null) - return MemberAddResult.persistentIdDisabled(v) - case "user_creation_failed": - let v = Serialization._StringSerializer.deserialize(d["user_creation_failed"] ?? .null) - return MemberAddResult.userCreationFailed(v) - case "success": - let v = Team.TeamMemberInfoSerializer().deserialize(json) - return MemberAddResult.success(v) - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .teamLicenseLimit(let arg): + var d = try ["team_license_limit": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("team_license_limit") + return .dictionary(d) + case .freeTeamMemberLimitReached(let arg): + var d = try ["free_team_member_limit_reached": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("free_team_member_limit_reached") + return .dictionary(d) + case .userAlreadyOnTeam(let arg): + var d = try ["user_already_on_team": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_already_on_team") + return .dictionary(d) + case .userOnAnotherTeam(let arg): + var d = try ["user_on_another_team": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_on_another_team") + return .dictionary(d) + case .userAlreadyPaired(let arg): + var d = try ["user_already_paired": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_already_paired") + return .dictionary(d) + case .userMigrationFailed(let arg): + var d = try ["user_migration_failed": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_migration_failed") + return .dictionary(d) + case .duplicateExternalMemberId(let arg): + var d = try ["duplicate_external_member_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("duplicate_external_member_id") + return .dictionary(d) + case .duplicateMemberPersistentId(let arg): + var d = try ["duplicate_member_persistent_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("duplicate_member_persistent_id") + return .dictionary(d) + case .persistentIdDisabled(let arg): + var d = try ["persistent_id_disabled": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("persistent_id_disabled") + return .dictionary(d) + case .userCreationFailed(let arg): + var d = try ["user_creation_failed": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_creation_failed") + return .dictionary(d) + case .success(let arg): + var d = try Serialization.getFields(Team.TeamMemberInfoSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberAddResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team_license_limit": + let v = try Serialization._StringSerializer.deserialize(d["team_license_limit"] ?? .null) + return MemberAddResult.teamLicenseLimit(v) + case "free_team_member_limit_reached": + let v = try Serialization._StringSerializer.deserialize(d["free_team_member_limit_reached"] ?? .null) + return MemberAddResult.freeTeamMemberLimitReached(v) + case "user_already_on_team": + let v = try Serialization._StringSerializer.deserialize(d["user_already_on_team"] ?? .null) + return MemberAddResult.userAlreadyOnTeam(v) + case "user_on_another_team": + let v = try Serialization._StringSerializer.deserialize(d["user_on_another_team"] ?? .null) + return MemberAddResult.userOnAnotherTeam(v) + case "user_already_paired": + let v = try Serialization._StringSerializer.deserialize(d["user_already_paired"] ?? .null) + return MemberAddResult.userAlreadyPaired(v) + case "user_migration_failed": + let v = try Serialization._StringSerializer.deserialize(d["user_migration_failed"] ?? .null) + return MemberAddResult.userMigrationFailed(v) + case "duplicate_external_member_id": + let v = try Serialization._StringSerializer.deserialize(d["duplicate_external_member_id"] ?? .null) + return MemberAddResult.duplicateExternalMemberId(v) + case "duplicate_member_persistent_id": + let v = try Serialization._StringSerializer.deserialize(d["duplicate_member_persistent_id"] ?? .null) + return MemberAddResult.duplicateMemberPersistentId(v) + case "persistent_id_disabled": + let v = try Serialization._StringSerializer.deserialize(d["persistent_id_disabled"] ?? .null) + return MemberAddResult.persistentIdDisabled(v) + case "user_creation_failed": + let v = try Serialization._StringSerializer.deserialize(d["user_creation_failed"] ?? .null) + return MemberAddResult.userCreationFailed(v) + case "success": + let v = try Team.TeamMemberInfoSerializer().deserialize(json) + return MemberAddResult.success(v) + default: + throw JSONSerializerError.unknownTag(type: MemberAddResult.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MemberAddResult.self, json: json) } } } /// The MemberAddV2Arg struct - open class MemberAddV2Arg: Team.MemberAddArgBase { + public class MemberAddV2Arg: Team.MemberAddArgBase { /// (no description) - public let roleIds: Array? - public init(memberEmail: String, memberGivenName: String? = nil, memberSurname: String? = nil, memberExternalId: String? = nil, memberPersistentId: String? = nil, sendWelcomeEmail: Bool = true, isDirectoryRestricted: Bool? = nil, roleIds: Array? = nil) { + public let roleIds: [String]? + public init( + memberEmail: String, + memberGivenName: String? = nil, + memberSurname: String? = nil, + memberExternalId: String? = nil, + memberPersistentId: String? = nil, + sendWelcomeEmail: Bool = true, + isDirectoryRestricted: Bool? = nil, + roleIds: [String]? = nil + ) { nullableValidator(arrayValidator(maxItems: 1, itemValidator: stringValidator(maxLength: 128, pattern: "pid_dbtmr:.*")))(roleIds) self.roleIds = roleIds - super.init(memberEmail: memberEmail, memberGivenName: memberGivenName, memberSurname: memberSurname, memberExternalId: memberExternalId, memberPersistentId: memberPersistentId, sendWelcomeEmail: sendWelcomeEmail, isDirectoryRestricted: isDirectoryRestricted) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddV2ArgSerializer().serialize(self)))" - } - } - open class MemberAddV2ArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddV2Arg) -> JSON { - let output = [ - "member_email": Serialization._StringSerializer.serialize(value.memberEmail), - "member_given_name": NullableSerializer(Serialization._StringSerializer).serialize(value.memberGivenName), - "member_surname": NullableSerializer(Serialization._StringSerializer).serialize(value.memberSurname), - "member_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), - "member_persistent_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberPersistentId), - "send_welcome_email": Serialization._BoolSerializer.serialize(value.sendWelcomeEmail), - "is_directory_restricted": NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), - "role_ids": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.roleIds), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> MemberAddV2Arg { - switch json { - case .dictionary(let dict): - let memberEmail = Serialization._StringSerializer.deserialize(dict["member_email"] ?? .null) - let memberGivenName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_given_name"] ?? .null) - let memberSurname = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_surname"] ?? .null) - let memberExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) - let memberPersistentId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_persistent_id"] ?? .null) - let sendWelcomeEmail = Serialization._BoolSerializer.deserialize(dict["send_welcome_email"] ?? .number(1)) - let isDirectoryRestricted = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) - let roleIds = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["role_ids"] ?? .null) - return MemberAddV2Arg(memberEmail: memberEmail, memberGivenName: memberGivenName, memberSurname: memberSurname, memberExternalId: memberExternalId, memberPersistentId: memberPersistentId, sendWelcomeEmail: sendWelcomeEmail, isDirectoryRestricted: isDirectoryRestricted, roleIds: roleIds) - default: - fatalError("Type error deserializing") + super.init( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail, + isDirectoryRestricted: isDirectoryRestricted + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddV2ArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddV2Arg: \(error)" + } + } + } + + public class MemberAddV2ArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddV2Arg) throws -> JSON { + let output = [ + "member_email": try Serialization._StringSerializer.serialize(value.memberEmail), + "member_given_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberGivenName), + "member_surname": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberSurname), + "member_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), + "member_persistent_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberPersistentId), + "send_welcome_email": try Serialization._BoolSerializer.serialize(value.sendWelcomeEmail), + "is_directory_restricted": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), + "role_ids": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.roleIds), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> MemberAddV2Arg { + switch json { + case .dictionary(let dict): + let memberEmail = try Serialization._StringSerializer.deserialize(dict["member_email"] ?? .null) + let memberGivenName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_given_name"] ?? .null) + let memberSurname = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_surname"] ?? .null) + let memberExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) + let memberPersistentId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_persistent_id"] ?? .null) + let sendWelcomeEmail = try Serialization._BoolSerializer.deserialize(dict["send_welcome_email"] ?? .number(1)) + let isDirectoryRestricted = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) + let roleIds = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["role_ids"] ?? .null) + return MemberAddV2Arg( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail, + isDirectoryRestricted: isDirectoryRestricted, + roleIds: roleIds + ) + default: + throw JSONSerializerError.deserializeError(type: MemberAddV2Arg.self, json: json) } } } /// Describes the result of attempting to add a single user to the team. 'success' is the only value indicating that - /// a user was indeed added to the team - the other values explain the type of failure that occurred, and include - /// the email of the user for which the operation has failed. - public enum MemberAddV2Result: CustomStringConvertible { + /// a user was indeed added to the team - the other values explain the type of failure that occurred, and + /// include the email of the user for which the operation has failed. + public enum MemberAddV2Result: CustomStringConvertible, JSONRepresentable { /// Team is already full. The organization has no available licenses. case teamLicenseLimit(String) /// Team is already full. The free team member limit has been reached. @@ -6193,197 +7731,236 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MemberAddV2ResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddV2ResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddV2Result: \(error)" + } } } - open class MemberAddV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddV2Result) -> JSON { + + public class MemberAddV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddV2Result) throws -> JSON { switch value { - case .teamLicenseLimit(let arg): - var d = ["team_license_limit": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("team_license_limit") - return .dictionary(d) - case .freeTeamMemberLimitReached(let arg): - var d = ["free_team_member_limit_reached": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("free_team_member_limit_reached") - return .dictionary(d) - case .userAlreadyOnTeam(let arg): - var d = ["user_already_on_team": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_already_on_team") - return .dictionary(d) - case .userOnAnotherTeam(let arg): - var d = ["user_on_another_team": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_on_another_team") - return .dictionary(d) - case .userAlreadyPaired(let arg): - var d = ["user_already_paired": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_already_paired") - return .dictionary(d) - case .userMigrationFailed(let arg): - var d = ["user_migration_failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_migration_failed") - return .dictionary(d) - case .duplicateExternalMemberId(let arg): - var d = ["duplicate_external_member_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("duplicate_external_member_id") - return .dictionary(d) - case .duplicateMemberPersistentId(let arg): - var d = ["duplicate_member_persistent_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("duplicate_member_persistent_id") - return .dictionary(d) - case .persistentIdDisabled(let arg): - var d = ["persistent_id_disabled": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("persistent_id_disabled") - return .dictionary(d) - case .userCreationFailed(let arg): - var d = ["user_creation_failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("user_creation_failed") - return .dictionary(d) - case .success(let arg): - var d = Serialization.getFields(Team.TeamMemberInfoV2Serializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberAddV2Result { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team_license_limit": - let v = Serialization._StringSerializer.deserialize(d["team_license_limit"] ?? .null) - return MemberAddV2Result.teamLicenseLimit(v) - case "free_team_member_limit_reached": - let v = Serialization._StringSerializer.deserialize(d["free_team_member_limit_reached"] ?? .null) - return MemberAddV2Result.freeTeamMemberLimitReached(v) - case "user_already_on_team": - let v = Serialization._StringSerializer.deserialize(d["user_already_on_team"] ?? .null) - return MemberAddV2Result.userAlreadyOnTeam(v) - case "user_on_another_team": - let v = Serialization._StringSerializer.deserialize(d["user_on_another_team"] ?? .null) - return MemberAddV2Result.userOnAnotherTeam(v) - case "user_already_paired": - let v = Serialization._StringSerializer.deserialize(d["user_already_paired"] ?? .null) - return MemberAddV2Result.userAlreadyPaired(v) - case "user_migration_failed": - let v = Serialization._StringSerializer.deserialize(d["user_migration_failed"] ?? .null) - return MemberAddV2Result.userMigrationFailed(v) - case "duplicate_external_member_id": - let v = Serialization._StringSerializer.deserialize(d["duplicate_external_member_id"] ?? .null) - return MemberAddV2Result.duplicateExternalMemberId(v) - case "duplicate_member_persistent_id": - let v = Serialization._StringSerializer.deserialize(d["duplicate_member_persistent_id"] ?? .null) - return MemberAddV2Result.duplicateMemberPersistentId(v) - case "persistent_id_disabled": - let v = Serialization._StringSerializer.deserialize(d["persistent_id_disabled"] ?? .null) - return MemberAddV2Result.persistentIdDisabled(v) - case "user_creation_failed": - let v = Serialization._StringSerializer.deserialize(d["user_creation_failed"] ?? .null) - return MemberAddV2Result.userCreationFailed(v) - case "success": - let v = Team.TeamMemberInfoV2Serializer().deserialize(json) - return MemberAddV2Result.success(v) - case "other": - return MemberAddV2Result.other - default: - return MemberAddV2Result.other - } - default: - fatalError("Failed to deserialize") + case .teamLicenseLimit(let arg): + var d = try ["team_license_limit": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("team_license_limit") + return .dictionary(d) + case .freeTeamMemberLimitReached(let arg): + var d = try ["free_team_member_limit_reached": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("free_team_member_limit_reached") + return .dictionary(d) + case .userAlreadyOnTeam(let arg): + var d = try ["user_already_on_team": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_already_on_team") + return .dictionary(d) + case .userOnAnotherTeam(let arg): + var d = try ["user_on_another_team": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_on_another_team") + return .dictionary(d) + case .userAlreadyPaired(let arg): + var d = try ["user_already_paired": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_already_paired") + return .dictionary(d) + case .userMigrationFailed(let arg): + var d = try ["user_migration_failed": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_migration_failed") + return .dictionary(d) + case .duplicateExternalMemberId(let arg): + var d = try ["duplicate_external_member_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("duplicate_external_member_id") + return .dictionary(d) + case .duplicateMemberPersistentId(let arg): + var d = try ["duplicate_member_persistent_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("duplicate_member_persistent_id") + return .dictionary(d) + case .persistentIdDisabled(let arg): + var d = try ["persistent_id_disabled": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("persistent_id_disabled") + return .dictionary(d) + case .userCreationFailed(let arg): + var d = try ["user_creation_failed": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_creation_failed") + return .dictionary(d) + case .success(let arg): + var d = try Serialization.getFields(Team.TeamMemberInfoV2Serializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberAddV2Result { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team_license_limit": + let v = try Serialization._StringSerializer.deserialize(d["team_license_limit"] ?? .null) + return MemberAddV2Result.teamLicenseLimit(v) + case "free_team_member_limit_reached": + let v = try Serialization._StringSerializer.deserialize(d["free_team_member_limit_reached"] ?? .null) + return MemberAddV2Result.freeTeamMemberLimitReached(v) + case "user_already_on_team": + let v = try Serialization._StringSerializer.deserialize(d["user_already_on_team"] ?? .null) + return MemberAddV2Result.userAlreadyOnTeam(v) + case "user_on_another_team": + let v = try Serialization._StringSerializer.deserialize(d["user_on_another_team"] ?? .null) + return MemberAddV2Result.userOnAnotherTeam(v) + case "user_already_paired": + let v = try Serialization._StringSerializer.deserialize(d["user_already_paired"] ?? .null) + return MemberAddV2Result.userAlreadyPaired(v) + case "user_migration_failed": + let v = try Serialization._StringSerializer.deserialize(d["user_migration_failed"] ?? .null) + return MemberAddV2Result.userMigrationFailed(v) + case "duplicate_external_member_id": + let v = try Serialization._StringSerializer.deserialize(d["duplicate_external_member_id"] ?? .null) + return MemberAddV2Result.duplicateExternalMemberId(v) + case "duplicate_member_persistent_id": + let v = try Serialization._StringSerializer.deserialize(d["duplicate_member_persistent_id"] ?? .null) + return MemberAddV2Result.duplicateMemberPersistentId(v) + case "persistent_id_disabled": + let v = try Serialization._StringSerializer.deserialize(d["persistent_id_disabled"] ?? .null) + return MemberAddV2Result.persistentIdDisabled(v) + case "user_creation_failed": + let v = try Serialization._StringSerializer.deserialize(d["user_creation_failed"] ?? .null) + return MemberAddV2Result.userCreationFailed(v) + case "success": + let v = try Team.TeamMemberInfoV2Serializer().deserialize(json) + return MemberAddV2Result.success(v) + case "other": + return MemberAddV2Result.other + default: + return MemberAddV2Result.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberAddV2Result.self, json: json) } } } /// Information on devices of a team's member. - open class MemberDevices: CustomStringConvertible { + public class MemberDevices: CustomStringConvertible, JSONRepresentable { /// The member unique Id. public let teamMemberId: String /// List of web sessions made by this team member. - public let webSessions: Array? + public let webSessions: [Team.ActiveWebSession]? /// List of desktop clients by this team member. - public let desktopClients: Array? + public let desktopClients: [Team.DesktopClientSession]? /// List of mobile clients by this team member. - public let mobileClients: Array? - public init(teamMemberId: String, webSessions: Array? = nil, desktopClients: Array? = nil, mobileClients: Array? = nil) { + public let mobileClients: [Team.MobileClientSession]? + public init( + teamMemberId: String, + webSessions: [Team.ActiveWebSession]? = nil, + desktopClients: [Team.DesktopClientSession]? = nil, + mobileClients: [Team.MobileClientSession]? = nil + ) { stringValidator()(teamMemberId) self.teamMemberId = teamMemberId self.webSessions = webSessions self.desktopClients = desktopClients self.mobileClients = mobileClients } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberDevicesSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberDevicesSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberDevicesSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberDevices: \(error)" + } } } - open class MemberDevicesSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberDevices) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "web_sessions": NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())).serialize(value.webSessions), - "desktop_clients": NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())).serialize(value.desktopClients), - "mobile_clients": NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())).serialize(value.mobileClients), + + public class MemberDevicesSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberDevices) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "web_sessions": try NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())).serialize(value.webSessions), + "desktop_clients": try NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())).serialize(value.desktopClients), + "mobile_clients": try NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())).serialize(value.mobileClients), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberDevices { + + public func deserialize(_ json: JSON) throws -> MemberDevices { switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let webSessions = NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())).deserialize(dict["web_sessions"] ?? .null) - let desktopClients = NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())).deserialize(dict["desktop_clients"] ?? .null) - let mobileClients = NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())).deserialize(dict["mobile_clients"] ?? .null) - return MemberDevices(teamMemberId: teamMemberId, webSessions: webSessions, desktopClients: desktopClients, mobileClients: mobileClients) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let webSessions = try NullableSerializer(ArraySerializer(Team.ActiveWebSessionSerializer())).deserialize(dict["web_sessions"] ?? .null) + let desktopClients = try NullableSerializer(ArraySerializer(Team.DesktopClientSessionSerializer())) + .deserialize(dict["desktop_clients"] ?? .null) + let mobileClients = try NullableSerializer(ArraySerializer(Team.MobileClientSessionSerializer())) + .deserialize(dict["mobile_clients"] ?? .null) + return MemberDevices(teamMemberId: teamMemberId, webSessions: webSessions, desktopClients: desktopClients, mobileClients: mobileClients) + default: + throw JSONSerializerError.deserializeError(type: MemberDevices.self, json: json) } } } /// Information on linked applications of a team member. - open class MemberLinkedApps: CustomStringConvertible { + public class MemberLinkedApps: CustomStringConvertible, JSONRepresentable { /// The member unique Id. public let teamMemberId: String /// List of third party applications linked by this team member. - public let linkedApiApps: Array - public init(teamMemberId: String, linkedApiApps: Array) { + public let linkedApiApps: [Team.ApiApp] + public init(teamMemberId: String, linkedApiApps: [Team.ApiApp]) { stringValidator()(teamMemberId) self.teamMemberId = teamMemberId self.linkedApiApps = linkedApiApps } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberLinkedAppsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberLinkedAppsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberLinkedAppsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberLinkedApps: \(error)" + } } } - open class MemberLinkedAppsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberLinkedApps) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "linked_api_apps": ArraySerializer(Team.ApiAppSerializer()).serialize(value.linkedApiApps), + + public class MemberLinkedAppsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberLinkedApps) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "linked_api_apps": try ArraySerializer(Team.ApiAppSerializer()).serialize(value.linkedApiApps), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberLinkedApps { + + public func deserialize(_ json: JSON) throws -> MemberLinkedApps { switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let linkedApiApps = ArraySerializer(Team.ApiAppSerializer()).deserialize(dict["linked_api_apps"] ?? .null) - return MemberLinkedApps(teamMemberId: teamMemberId, linkedApiApps: linkedApiApps) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let linkedApiApps = try ArraySerializer(Team.ApiAppSerializer()).deserialize(dict["linked_api_apps"] ?? .null) + return MemberLinkedApps(teamMemberId: teamMemberId, linkedApiApps: linkedApiApps) + default: + throw JSONSerializerError.deserializeError(type: MemberLinkedApps.self, json: json) } } } /// Basic member profile. - open class MemberProfile: CustomStringConvertible { + public class MemberProfile: CustomStringConvertible, JSONRepresentable { /// ID of user as a member of a team. public let teamMemberId: String /// External ID that a team can attach to the user. An application using the API may find it easier to use their @@ -6396,7 +7973,7 @@ open class Team { /// Is true if the user's email is verified to be owned by the user. public let emailVerified: Bool /// Secondary emails of a user. - public let secondaryEmails: Array? + public let secondaryEmails: [SecondaryEmails.SecondaryEmail]? /// The user's status as a member of a specific team. public let status: Team.TeamMemberStatus /// Representations for a person's name. @@ -6419,7 +7996,23 @@ open class Team { public let isDirectoryRestricted: Bool? /// URL for the photo representing the user, if one is set. public let profilePhotoUrl: String? - public init(teamMemberId: String, email: String, emailVerified: Bool, status: Team.TeamMemberStatus, name: Users.Name, membershipType: Team.TeamMembershipType, externalId: String? = nil, accountId: String? = nil, secondaryEmails: Array? = nil, invitedOn: Date? = nil, joinedOn: Date? = nil, suspendedOn: Date? = nil, persistentId: String? = nil, isDirectoryRestricted: Bool? = nil, profilePhotoUrl: String? = nil) { + public init( + teamMemberId: String, + email: String, + emailVerified: Bool, + status: Team.TeamMemberStatus, + name: Users.Name, + membershipType: Team.TeamMembershipType, + externalId: String? = nil, + accountId: String? = nil, + secondaryEmails: [SecondaryEmails.SecondaryEmail]? = nil, + invitedOn: Date? = nil, + joinedOn: Date? = nil, + suspendedOn: Date? = nil, + persistentId: String? = nil, + isDirectoryRestricted: Bool? = nil, + profilePhotoUrl: String? = nil + ) { stringValidator()(teamMemberId) self.teamMemberId = teamMemberId nullableValidator(stringValidator())(externalId) @@ -6442,479 +8035,603 @@ open class Team { nullableValidator(stringValidator())(profilePhotoUrl) self.profilePhotoUrl = profilePhotoUrl } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberProfileSerializer().serialize(self)))" - } - } - open class MemberProfileSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberProfile) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "email": Serialization._StringSerializer.serialize(value.email), - "email_verified": Serialization._BoolSerializer.serialize(value.emailVerified), - "status": Team.TeamMemberStatusSerializer().serialize(value.status), - "name": Users.NameSerializer().serialize(value.name), - "membership_type": Team.TeamMembershipTypeSerializer().serialize(value.membershipType), - "external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.externalId), - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), - "secondary_emails": NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())).serialize(value.secondaryEmails), - "invited_on": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.invitedOn), - "joined_on": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.joinedOn), - "suspended_on": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.suspendedOn), - "persistent_id": NullableSerializer(Serialization._StringSerializer).serialize(value.persistentId), - "is_directory_restricted": NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), - "profile_photo_url": NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> MemberProfile { - switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let email = Serialization._StringSerializer.deserialize(dict["email"] ?? .null) - let emailVerified = Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) - let status = Team.TeamMemberStatusSerializer().deserialize(dict["status"] ?? .null) - let name = Users.NameSerializer().deserialize(dict["name"] ?? .null) - let membershipType = Team.TeamMembershipTypeSerializer().deserialize(dict["membership_type"] ?? .null) - let externalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["external_id"] ?? .null) - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - let secondaryEmails = NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())).deserialize(dict["secondary_emails"] ?? .null) - let invitedOn = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["invited_on"] ?? .null) - let joinedOn = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["joined_on"] ?? .null) - let suspendedOn = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["suspended_on"] ?? .null) - let persistentId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["persistent_id"] ?? .null) - let isDirectoryRestricted = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) - let profilePhotoUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) - return MemberProfile(teamMemberId: teamMemberId, email: email, emailVerified: emailVerified, status: status, name: name, membershipType: membershipType, externalId: externalId, accountId: accountId, secondaryEmails: secondaryEmails, invitedOn: invitedOn, joinedOn: joinedOn, suspendedOn: suspendedOn, persistentId: persistentId, isDirectoryRestricted: isDirectoryRestricted, profilePhotoUrl: profilePhotoUrl) - default: - fatalError("Type error deserializing") + + func json() throws -> JSON { + try MemberProfileSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberProfileSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberProfile: \(error)" + } + } + } + + public class MemberProfileSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberProfile) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "email": try Serialization._StringSerializer.serialize(value.email), + "email_verified": try Serialization._BoolSerializer.serialize(value.emailVerified), + "status": try Team.TeamMemberStatusSerializer().serialize(value.status), + "name": try Users.NameSerializer().serialize(value.name), + "membership_type": try Team.TeamMembershipTypeSerializer().serialize(value.membershipType), + "external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.externalId), + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + "secondary_emails": try NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())).serialize(value.secondaryEmails), + "invited_on": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.invitedOn), + "joined_on": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.joinedOn), + "suspended_on": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.suspendedOn), + "persistent_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.persistentId), + "is_directory_restricted": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), + "profile_photo_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> MemberProfile { + switch json { + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let email = try Serialization._StringSerializer.deserialize(dict["email"] ?? .null) + let emailVerified = try Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) + let status = try Team.TeamMemberStatusSerializer().deserialize(dict["status"] ?? .null) + let name = try Users.NameSerializer().deserialize(dict["name"] ?? .null) + let membershipType = try Team.TeamMembershipTypeSerializer().deserialize(dict["membership_type"] ?? .null) + let externalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["external_id"] ?? .null) + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + let secondaryEmails = try NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())) + .deserialize(dict["secondary_emails"] ?? .null) + let invitedOn = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["invited_on"] ?? .null) + let joinedOn = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["joined_on"] ?? .null) + let suspendedOn = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["suspended_on"] ?? .null) + let persistentId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["persistent_id"] ?? .null) + let isDirectoryRestricted = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) + let profilePhotoUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) + return MemberProfile( + teamMemberId: teamMemberId, + email: email, + emailVerified: emailVerified, + status: status, + name: name, + membershipType: membershipType, + externalId: externalId, + accountId: accountId, + secondaryEmails: secondaryEmails, + invitedOn: invitedOn, + joinedOn: joinedOn, + suspendedOn: suspendedOn, + persistentId: persistentId, + isDirectoryRestricted: isDirectoryRestricted, + profilePhotoUrl: profilePhotoUrl + ) + default: + throw JSONSerializerError.deserializeError(type: MemberProfile.self, json: json) } } } /// Error that can be returned whenever a struct derived from UserSelectorArg is used. - public enum UserSelectorError: CustomStringConvertible { + public enum UserSelectorError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound + func json() throws -> JSON { + try UserSelectorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserSelectorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserSelectorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserSelectorError: \(error)" + } } } - open class UserSelectorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserSelectorError) -> JSON { + + public class UserSelectorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserSelectorError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UserSelectorError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return UserSelectorError.userNotFound - default: - fatalError("Unknown tag \(tag)") - } + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UserSelectorError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return UserSelectorError.userNotFound default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: UserSelectorError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UserSelectorError.self, json: json) } } } /// The MemberSelectorError union - public enum MemberSelectorError: CustomStringConvertible { + public enum MemberSelectorError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. case userNotInTeam + func json() throws -> JSON { + try MemberSelectorErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSelectorErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSelectorErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSelectorError: \(error)" + } } } - open class MemberSelectorErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSelectorError) -> JSON { + + public class MemberSelectorErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSelectorError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberSelectorError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MemberSelectorError.userNotFound - case "user_not_in_team": - return MemberSelectorError.userNotInTeam - default: - fatalError("Unknown tag \(tag)") - } + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberSelectorError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MemberSelectorError.userNotFound + case "user_not_in_team": + return MemberSelectorError.userNotInTeam default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: MemberSelectorError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MemberSelectorError.self, json: json) } } } /// The MembersAddArgBase struct - open class MembersAddArgBase: CustomStringConvertible { + public class MembersAddArgBase: CustomStringConvertible, JSONRepresentable { /// Whether to force the add to happen asynchronously. public let forceAsync: Bool public init(forceAsync: Bool = false) { self.forceAsync = forceAsync } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersAddArgBaseSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersAddArgBaseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersAddArgBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersAddArgBase: \(error)" + } } } - open class MembersAddArgBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersAddArgBase) -> JSON { - let output = [ - "force_async": Serialization._BoolSerializer.serialize(value.forceAsync), + + public class MembersAddArgBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersAddArgBase) throws -> JSON { + let output = [ + "force_async": try Serialization._BoolSerializer.serialize(value.forceAsync), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersAddArgBase { + + public func deserialize(_ json: JSON) throws -> MembersAddArgBase { switch json { - case .dictionary(let dict): - let forceAsync = Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) - return MembersAddArgBase(forceAsync: forceAsync) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let forceAsync = try Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) + return MembersAddArgBase(forceAsync: forceAsync) + default: + throw JSONSerializerError.deserializeError(type: MembersAddArgBase.self, json: json) } } } /// The MembersAddArg struct - open class MembersAddArg: Team.MembersAddArgBase { + public class MembersAddArg: Team.MembersAddArgBase { /// Details of new members to be added to the team. - public let newMembers: Array - public init(newMembers: Array, forceAsync: Bool = false) { + public let newMembers: [Team.MemberAddArg] + public init(newMembers: [Team.MemberAddArg], forceAsync: Bool = false) { self.newMembers = newMembers super.init(forceAsync: forceAsync) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersAddArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersAddArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersAddArg: \(error)" + } } } - open class MembersAddArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersAddArg) -> JSON { - let output = [ - "new_members": ArraySerializer(Team.MemberAddArgSerializer()).serialize(value.newMembers), - "force_async": Serialization._BoolSerializer.serialize(value.forceAsync), + + public class MembersAddArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersAddArg) throws -> JSON { + let output = [ + "new_members": try ArraySerializer(Team.MemberAddArgSerializer()).serialize(value.newMembers), + "force_async": try Serialization._BoolSerializer.serialize(value.forceAsync), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersAddArg { + + public func deserialize(_ json: JSON) throws -> MembersAddArg { switch json { - case .dictionary(let dict): - let newMembers = ArraySerializer(Team.MemberAddArgSerializer()).deserialize(dict["new_members"] ?? .null) - let forceAsync = Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) - return MembersAddArg(newMembers: newMembers, forceAsync: forceAsync) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newMembers = try ArraySerializer(Team.MemberAddArgSerializer()).deserialize(dict["new_members"] ?? .null) + let forceAsync = try Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) + return MembersAddArg(newMembers: newMembers, forceAsync: forceAsync) + default: + throw JSONSerializerError.deserializeError(type: MembersAddArg.self, json: json) } } } /// The MembersAddJobStatus union - public enum MembersAddJobStatus: CustomStringConvertible { + public enum MembersAddJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The asynchronous job has finished. For each member that was specified in the parameter MembersAddArg that /// was provided to membersAdd, a corresponding item is returned in this list. - case complete(Array) + case complete([Team.MemberAddResult]) /// The asynchronous job returned an error. The string contains an error message. case failed(String) + func json() throws -> JSON { + try MembersAddJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersAddJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersAddJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersAddJobStatus: \(error)" + } } } - open class MembersAddJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersAddJobStatus) -> JSON { + + public class MembersAddJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersAddJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = ["complete": ArraySerializer(Team.MemberAddResultSerializer()).serialize(arg)] - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersAddJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return MembersAddJobStatus.inProgress - case "complete": - let v = ArraySerializer(Team.MemberAddResultSerializer()).deserialize(d["complete"] ?? .null) - return MembersAddJobStatus.complete(v) - case "failed": - let v = Serialization._StringSerializer.deserialize(d["failed"] ?? .null) - return MembersAddJobStatus.failed(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try ["complete": ArraySerializer(Team.MemberAddResultSerializer()).serialize(arg)] + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersAddJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return MembersAddJobStatus.inProgress + case "complete": + let v = try ArraySerializer(Team.MemberAddResultSerializer()).deserialize(d["complete"] ?? .null) + return MembersAddJobStatus.complete(v) + case "failed": + let v = try Serialization._StringSerializer.deserialize(d["failed"] ?? .null) + return MembersAddJobStatus.failed(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: MembersAddJobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersAddJobStatus.self, json: json) } } } /// The MembersAddJobStatusV2Result union - public enum MembersAddJobStatusV2Result: CustomStringConvertible { + public enum MembersAddJobStatusV2Result: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The asynchronous job has finished. For each member that was specified in the parameter MembersAddArg that /// was provided to membersAddV2, a corresponding item is returned in this list. - case complete(Array) + case complete([Team.MemberAddV2Result]) /// The asynchronous job returned an error. The string contains an error message. case failed(String) /// An unspecified error. case other + func json() throws -> JSON { + try MembersAddJobStatusV2ResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersAddJobStatusV2ResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersAddJobStatusV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersAddJobStatusV2Result: \(error)" + } } } - open class MembersAddJobStatusV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersAddJobStatusV2Result) -> JSON { + + public class MembersAddJobStatusV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersAddJobStatusV2Result) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = ["complete": ArraySerializer(Team.MemberAddV2ResultSerializer()).serialize(arg)] - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersAddJobStatusV2Result { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return MembersAddJobStatusV2Result.inProgress - case "complete": - let v = ArraySerializer(Team.MemberAddV2ResultSerializer()).deserialize(d["complete"] ?? .null) - return MembersAddJobStatusV2Result.complete(v) - case "failed": - let v = Serialization._StringSerializer.deserialize(d["failed"] ?? .null) - return MembersAddJobStatusV2Result.failed(v) - case "other": - return MembersAddJobStatusV2Result.other - default: - return MembersAddJobStatusV2Result.other - } - default: - fatalError("Failed to deserialize") + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try ["complete": ArraySerializer(Team.MemberAddV2ResultSerializer()).serialize(arg)] + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Serialization._StringSerializer.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 -> MembersAddJobStatusV2Result { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return MembersAddJobStatusV2Result.inProgress + case "complete": + let v = try ArraySerializer(Team.MemberAddV2ResultSerializer()).deserialize(d["complete"] ?? .null) + return MembersAddJobStatusV2Result.complete(v) + case "failed": + let v = try Serialization._StringSerializer.deserialize(d["failed"] ?? .null) + return MembersAddJobStatusV2Result.failed(v) + case "other": + return MembersAddJobStatusV2Result.other + default: + return MembersAddJobStatusV2Result.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersAddJobStatusV2Result.self, json: json) } } } /// The MembersAddLaunch union - public enum MembersAddLaunch: CustomStringConvertible { + public enum MembersAddLaunch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) /// An unspecified error. - case complete(Array) + case complete([Team.MemberAddResult]) + + func json() throws -> JSON { + try MembersAddLaunchSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersAddLaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersAddLaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersAddLaunch: \(error)" + } } } - open class MembersAddLaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersAddLaunch) -> JSON { + + public class MembersAddLaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersAddLaunch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = ["complete": ArraySerializer(Team.MemberAddResultSerializer()).serialize(arg)] - d[".tag"] = .str("complete") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersAddLaunch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return MembersAddLaunch.asyncJobId(v) - case "complete": - let v = ArraySerializer(Team.MemberAddResultSerializer()).deserialize(d["complete"] ?? .null) - return MembersAddLaunch.complete(v) - default: - fatalError("Unknown tag \(tag)") - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try ["complete": ArraySerializer(Team.MemberAddResultSerializer()).serialize(arg)] + d[".tag"] = .str("complete") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersAddLaunch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return MembersAddLaunch.asyncJobId(v) + case "complete": + let v = try ArraySerializer(Team.MemberAddResultSerializer()).deserialize(d["complete"] ?? .null) + return MembersAddLaunch.complete(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: MembersAddLaunch.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersAddLaunch.self, json: json) } } } /// The MembersAddLaunchV2Result union - public enum MembersAddLaunchV2Result: CustomStringConvertible { + public enum MembersAddLaunchV2Result: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) /// An unspecified error. - case complete(Array) + case complete([Team.MemberAddV2Result]) /// An unspecified error. case other + func json() throws -> JSON { + try MembersAddLaunchV2ResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersAddLaunchV2ResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersAddLaunchV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersAddLaunchV2Result: \(error)" + } } } - open class MembersAddLaunchV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersAddLaunchV2Result) -> JSON { + + public class MembersAddLaunchV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersAddLaunchV2Result) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = ["complete": ArraySerializer(Team.MemberAddV2ResultSerializer()).serialize(arg)] - d[".tag"] = .str("complete") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersAddLaunchV2Result { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return MembersAddLaunchV2Result.asyncJobId(v) - case "complete": - let v = ArraySerializer(Team.MemberAddV2ResultSerializer()).deserialize(d["complete"] ?? .null) - return MembersAddLaunchV2Result.complete(v) - case "other": - return MembersAddLaunchV2Result.other - default: - return MembersAddLaunchV2Result.other - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try ["complete": ArraySerializer(Team.MemberAddV2ResultSerializer()).serialize(arg)] + d[".tag"] = .str("complete") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersAddLaunchV2Result { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return MembersAddLaunchV2Result.asyncJobId(v) + case "complete": + let v = try ArraySerializer(Team.MemberAddV2ResultSerializer()).deserialize(d["complete"] ?? .null) + return MembersAddLaunchV2Result.complete(v) + case "other": + return MembersAddLaunchV2Result.other default: - fatalError("Failed to deserialize") + return MembersAddLaunchV2Result.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersAddLaunchV2Result.self, json: json) } } } /// The MembersAddV2Arg struct - open class MembersAddV2Arg: Team.MembersAddArgBase { + public class MembersAddV2Arg: Team.MembersAddArgBase { /// Details of new members to be added to the team. - public let newMembers: Array - public init(newMembers: Array, forceAsync: Bool = false) { + public let newMembers: [Team.MemberAddV2Arg] + public init(newMembers: [Team.MemberAddV2Arg], forceAsync: Bool = false) { self.newMembers = newMembers super.init(forceAsync: forceAsync) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersAddV2ArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersAddV2ArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersAddV2Arg: \(error)" + } } } - open class MembersAddV2ArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersAddV2Arg) -> JSON { - let output = [ - "new_members": ArraySerializer(Team.MemberAddV2ArgSerializer()).serialize(value.newMembers), - "force_async": Serialization._BoolSerializer.serialize(value.forceAsync), + + public class MembersAddV2ArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersAddV2Arg) throws -> JSON { + let output = [ + "new_members": try ArraySerializer(Team.MemberAddV2ArgSerializer()).serialize(value.newMembers), + "force_async": try Serialization._BoolSerializer.serialize(value.forceAsync), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersAddV2Arg { + + public func deserialize(_ json: JSON) throws -> MembersAddV2Arg { switch json { - case .dictionary(let dict): - let newMembers = ArraySerializer(Team.MemberAddV2ArgSerializer()).deserialize(dict["new_members"] ?? .null) - let forceAsync = Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) - return MembersAddV2Arg(newMembers: newMembers, forceAsync: forceAsync) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newMembers = try ArraySerializer(Team.MemberAddV2ArgSerializer()).deserialize(dict["new_members"] ?? .null) + let forceAsync = try Serialization._BoolSerializer.deserialize(dict["force_async"] ?? .number(0)) + return MembersAddV2Arg(newMembers: newMembers, forceAsync: forceAsync) + default: + throw JSONSerializerError.deserializeError(type: MembersAddV2Arg.self, json: json) } } } /// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. - open class MembersDeactivateBaseArg: CustomStringConvertible { + public class MembersDeactivateBaseArg: CustomStringConvertible, JSONRepresentable { /// Identity of user to remove/suspend/have their files moved. public let user: Team.UserSelectorArg public init(user: Team.UserSelectorArg) { self.user = user } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersDeactivateBaseArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersDeactivateBaseArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersDeactivateBaseArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersDeactivateBaseArg: \(error)" + } } } - open class MembersDeactivateBaseArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersDeactivateBaseArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), + + public class MembersDeactivateBaseArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersDeactivateBaseArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersDeactivateBaseArg { + + public func deserialize(_ json: JSON) throws -> MembersDeactivateBaseArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - return MembersDeactivateBaseArg(user: user) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + return MembersDeactivateBaseArg(user: user) + default: + throw JSONSerializerError.deserializeError(type: MembersDeactivateBaseArg.self, json: json) } } } /// The MembersDataTransferArg struct - open class MembersDataTransferArg: Team.MembersDeactivateBaseArg { + public class MembersDataTransferArg: Team.MembersDeactivateBaseArg { /// Files from the deleted member account will be transferred to this user. public let transferDestId: Team.UserSelectorArg /// Errors during the transfer process will be sent via email to this user. @@ -6924,68 +8641,82 @@ open class Team { self.transferAdminId = transferAdminId super.init(user: user) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersDataTransferArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersDataTransferArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersDataTransferArg: \(error)" + } } } - open class MembersDataTransferArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersDataTransferArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "transfer_dest_id": Team.UserSelectorArgSerializer().serialize(value.transferDestId), - "transfer_admin_id": Team.UserSelectorArgSerializer().serialize(value.transferAdminId), + + public class MembersDataTransferArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersDataTransferArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "transfer_dest_id": try Team.UserSelectorArgSerializer().serialize(value.transferDestId), + "transfer_admin_id": try Team.UserSelectorArgSerializer().serialize(value.transferAdminId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersDataTransferArg { + + public func deserialize(_ json: JSON) throws -> MembersDataTransferArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let transferDestId = Team.UserSelectorArgSerializer().deserialize(dict["transfer_dest_id"] ?? .null) - let transferAdminId = Team.UserSelectorArgSerializer().deserialize(dict["transfer_admin_id"] ?? .null) - return MembersDataTransferArg(user: user, transferDestId: transferDestId, transferAdminId: transferAdminId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let transferDestId = try Team.UserSelectorArgSerializer().deserialize(dict["transfer_dest_id"] ?? .null) + let transferAdminId = try Team.UserSelectorArgSerializer().deserialize(dict["transfer_admin_id"] ?? .null) + return MembersDataTransferArg(user: user, transferDestId: transferDestId, transferAdminId: transferAdminId) + default: + throw JSONSerializerError.deserializeError(type: MembersDataTransferArg.self, json: json) } } } /// The MembersDeactivateArg struct - open class MembersDeactivateArg: Team.MembersDeactivateBaseArg { + public class MembersDeactivateArg: Team.MembersDeactivateBaseArg { /// If provided, controls if the user's data will be deleted on their linked devices. public let wipeData: Bool public init(user: Team.UserSelectorArg, wipeData: Bool = true) { self.wipeData = wipeData super.init(user: user) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersDeactivateArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersDeactivateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersDeactivateArg: \(error)" + } } } - open class MembersDeactivateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersDeactivateArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "wipe_data": Serialization._BoolSerializer.serialize(value.wipeData), + + public class MembersDeactivateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersDeactivateArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "wipe_data": try Serialization._BoolSerializer.serialize(value.wipeData), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersDeactivateArg { + + public func deserialize(_ json: JSON) throws -> MembersDeactivateArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let wipeData = Serialization._BoolSerializer.deserialize(dict["wipe_data"] ?? .number(1)) - return MembersDeactivateArg(user: user, wipeData: wipeData) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let wipeData = try Serialization._BoolSerializer.deserialize(dict["wipe_data"] ?? .number(1)) + return MembersDeactivateArg(user: user, wipeData: wipeData) + default: + throw JSONSerializerError.deserializeError(type: MembersDeactivateArg.self, json: json) } } } /// The MembersDeactivateError union - public enum MembersDeactivateError: CustomStringConvertible { + public enum MembersDeactivateError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -6993,80 +8724,101 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersDeactivateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersDeactivateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersDeactivateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersDeactivateError: \(error)" + } } } - open class MembersDeactivateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersDeactivateError) -> JSON { + + public class MembersDeactivateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersDeactivateError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersDeactivateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersDeactivateError.userNotFound - case "user_not_in_team": - return MembersDeactivateError.userNotInTeam - case "other": - return MembersDeactivateError.other - default: - return MembersDeactivateError.other - } + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersDeactivateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersDeactivateError.userNotFound + case "user_not_in_team": + return MembersDeactivateError.userNotInTeam + case "other": + return MembersDeactivateError.other default: - fatalError("Failed to deserialize") + return MembersDeactivateError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersDeactivateError.self, json: json) } } } /// The MembersDeleteProfilePhotoArg struct - open class MembersDeleteProfilePhotoArg: CustomStringConvertible { + public class MembersDeleteProfilePhotoArg: CustomStringConvertible, JSONRepresentable { /// Identity of the user whose profile photo will be deleted. public let user: Team.UserSelectorArg public init(user: Team.UserSelectorArg) { self.user = user } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersDeleteProfilePhotoArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersDeleteProfilePhotoArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersDeleteProfilePhotoArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersDeleteProfilePhotoArg: \(error)" + } } } - open class MembersDeleteProfilePhotoArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersDeleteProfilePhotoArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), + + public class MembersDeleteProfilePhotoArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersDeleteProfilePhotoArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersDeleteProfilePhotoArg { + + public func deserialize(_ json: JSON) throws -> MembersDeleteProfilePhotoArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - return MembersDeleteProfilePhotoArg(user: user) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + return MembersDeleteProfilePhotoArg(user: user) + default: + throw JSONSerializerError.deserializeError(type: MembersDeleteProfilePhotoArg.self, json: json) } } } /// The MembersDeleteProfilePhotoError union - public enum MembersDeleteProfilePhotoError: CustomStringConvertible { + public enum MembersDeleteProfilePhotoError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -7076,647 +8828,827 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersDeleteProfilePhotoErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersDeleteProfilePhotoErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersDeleteProfilePhotoErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersDeleteProfilePhotoError: \(error)" + } } } - open class MembersDeleteProfilePhotoErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersDeleteProfilePhotoError) -> JSON { + + public class MembersDeleteProfilePhotoErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersDeleteProfilePhotoError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .setProfileDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("set_profile_disallowed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersDeleteProfilePhotoError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersDeleteProfilePhotoError.userNotFound - case "user_not_in_team": - return MembersDeleteProfilePhotoError.userNotInTeam - case "set_profile_disallowed": - return MembersDeleteProfilePhotoError.setProfileDisallowed - case "other": - return MembersDeleteProfilePhotoError.other - default: - return MembersDeleteProfilePhotoError.other - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .setProfileDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("set_profile_disallowed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersDeleteProfilePhotoError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersDeleteProfilePhotoError.userNotFound + case "user_not_in_team": + return MembersDeleteProfilePhotoError.userNotInTeam + case "set_profile_disallowed": + return MembersDeleteProfilePhotoError.setProfileDisallowed + case "other": + return MembersDeleteProfilePhotoError.other + default: + return MembersDeleteProfilePhotoError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersDeleteProfilePhotoError.self, json: json) } } } /// Available TeamMemberRole for the connected team. To be used with membersSetAdminPermissionsV2. - open class MembersGetAvailableTeamMemberRolesResult: CustomStringConvertible { + public class MembersGetAvailableTeamMemberRolesResult: CustomStringConvertible, JSONRepresentable { /// Available roles. - public let roles: Array - public init(roles: Array) { + public let roles: [Team.TeamMemberRole] + public init(roles: [Team.TeamMemberRole]) { self.roles = roles } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetAvailableTeamMemberRolesResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersGetAvailableTeamMemberRolesResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetAvailableTeamMemberRolesResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetAvailableTeamMemberRolesResult: \(error)" + } } } - open class MembersGetAvailableTeamMemberRolesResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetAvailableTeamMemberRolesResult) -> JSON { - let output = [ - "roles": ArraySerializer(Team.TeamMemberRoleSerializer()).serialize(value.roles), + + public class MembersGetAvailableTeamMemberRolesResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetAvailableTeamMemberRolesResult) throws -> JSON { + let output = [ + "roles": try ArraySerializer(Team.TeamMemberRoleSerializer()).serialize(value.roles), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersGetAvailableTeamMemberRolesResult { + + public func deserialize(_ json: JSON) throws -> MembersGetAvailableTeamMemberRolesResult { switch json { - case .dictionary(let dict): - let roles = ArraySerializer(Team.TeamMemberRoleSerializer()).deserialize(dict["roles"] ?? .null) - return MembersGetAvailableTeamMemberRolesResult(roles: roles) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let roles = try ArraySerializer(Team.TeamMemberRoleSerializer()).deserialize(dict["roles"] ?? .null) + return MembersGetAvailableTeamMemberRolesResult(roles: roles) + default: + throw JSONSerializerError.deserializeError(type: MembersGetAvailableTeamMemberRolesResult.self, json: json) } } } /// The MembersGetInfoArgs struct - open class MembersGetInfoArgs: CustomStringConvertible { + public class MembersGetInfoArgs: CustomStringConvertible, JSONRepresentable { /// List of team members. - public let members: Array - public init(members: Array) { + public let members: [Team.UserSelectorArg] + public init(members: [Team.UserSelectorArg]) { self.members = members } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetInfoArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersGetInfoArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetInfoArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetInfoArgs: \(error)" + } } } - open class MembersGetInfoArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetInfoArgs) -> JSON { - let output = [ - "members": ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.members), + + public class MembersGetInfoArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetInfoArgs) throws -> JSON { + let output = [ + "members": try ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.members), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersGetInfoArgs { + + public func deserialize(_ json: JSON) throws -> MembersGetInfoArgs { switch json { - case .dictionary(let dict): - let members = ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["members"] ?? .null) - return MembersGetInfoArgs(members: members) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let members = try ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["members"] ?? .null) + return MembersGetInfoArgs(members: members) + default: + throw JSONSerializerError.deserializeError(type: MembersGetInfoArgs.self, json: json) } } } /// The MembersGetInfoError union - public enum MembersGetInfoError: CustomStringConvertible { + public enum MembersGetInfoError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case other + func json() throws -> JSON { + try MembersGetInfoErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetInfoErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetInfoErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetInfoError: \(error)" + } } } - open class MembersGetInfoErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetInfoError) -> JSON { + + public class MembersGetInfoErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetInfoError) throws -> JSON { switch value { - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersGetInfoError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "other": - return MembersGetInfoError.other - default: - return MembersGetInfoError.other - } + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersGetInfoError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "other": + return MembersGetInfoError.other default: - fatalError("Failed to deserialize") + return MembersGetInfoError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersGetInfoError.self, json: json) } } } /// The MembersGetInfoItemBase union - public enum MembersGetInfoItemBase: CustomStringConvertible { + public enum MembersGetInfoItemBase: CustomStringConvertible, JSONRepresentable { /// An ID that was provided as a parameter to membersGetInfo or membersGetInfoV2, and did not match a - /// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how the method - /// was called. + /// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how + /// the method was called. case idNotFound(String) + func json() throws -> JSON { + try MembersGetInfoItemBaseSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetInfoItemBaseSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetInfoItemBaseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetInfoItemBase: \(error)" + } } } - open class MembersGetInfoItemBaseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetInfoItemBase) -> JSON { + + public class MembersGetInfoItemBaseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetInfoItemBase) throws -> JSON { switch value { - case .idNotFound(let arg): - var d = ["id_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("id_not_found") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersGetInfoItemBase { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "id_not_found": - let v = Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) - return MembersGetInfoItemBase.idNotFound(v) - default: - fatalError("Unknown tag \(tag)") - } + case .idNotFound(let arg): + var d = try ["id_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("id_not_found") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersGetInfoItemBase { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "id_not_found": + let v = try Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) + return MembersGetInfoItemBase.idNotFound(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: MembersGetInfoItemBase.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersGetInfoItemBase.self, json: json) } } } /// Describes a result obtained for a single user whose id was specified in the parameter of membersGetInfo. - public enum MembersGetInfoItem: CustomStringConvertible { + public enum MembersGetInfoItem: CustomStringConvertible, JSONRepresentable { /// An ID that was provided as a parameter to membersGetInfo or membersGetInfoV2, and did not match a - /// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how the method - /// was called. + /// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how + /// the method was called. case idNotFound(String) /// Info about a team member. case memberInfo(Team.TeamMemberInfo) + func json() throws -> JSON { + try MembersGetInfoItemSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetInfoItemSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetInfoItemSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetInfoItem: \(error)" + } } } - open class MembersGetInfoItemSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetInfoItem) -> JSON { + + public class MembersGetInfoItemSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetInfoItem) throws -> JSON { switch value { - case .idNotFound(let arg): - var d = ["id_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("id_not_found") - return .dictionary(d) - case .memberInfo(let arg): - var d = Serialization.getFields(Team.TeamMemberInfoSerializer().serialize(arg)) - d[".tag"] = .str("member_info") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersGetInfoItem { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "id_not_found": - let v = Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) - return MembersGetInfoItem.idNotFound(v) - case "member_info": - let v = Team.TeamMemberInfoSerializer().deserialize(json) - return MembersGetInfoItem.memberInfo(v) - default: - fatalError("Unknown tag \(tag)") - } + case .idNotFound(let arg): + var d = try ["id_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("id_not_found") + return .dictionary(d) + case .memberInfo(let arg): + var d = try Serialization.getFields(Team.TeamMemberInfoSerializer().serialize(arg)) + d[".tag"] = .str("member_info") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersGetInfoItem { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "id_not_found": + let v = try Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) + return MembersGetInfoItem.idNotFound(v) + case "member_info": + let v = try Team.TeamMemberInfoSerializer().deserialize(json) + return MembersGetInfoItem.memberInfo(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: MembersGetInfoItem.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersGetInfoItem.self, json: json) } } } /// Describes a result obtained for a single user whose id was specified in the parameter of membersGetInfoV2. - public enum MembersGetInfoItemV2: CustomStringConvertible { + public enum MembersGetInfoItemV2: CustomStringConvertible, JSONRepresentable { /// An ID that was provided as a parameter to membersGetInfo or membersGetInfoV2, and did not match a - /// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how the method - /// was called. + /// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how + /// the method was called. case idNotFound(String) /// Info about a team member. case memberInfo(Team.TeamMemberInfoV2) /// An unspecified error. case other + func json() throws -> JSON { + try MembersGetInfoItemV2Serializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetInfoItemV2Serializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetInfoItemV2Serializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetInfoItemV2: \(error)" + } } } - open class MembersGetInfoItemV2Serializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetInfoItemV2) -> JSON { + + public class MembersGetInfoItemV2Serializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetInfoItemV2) throws -> JSON { switch value { - case .idNotFound(let arg): - var d = ["id_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("id_not_found") - return .dictionary(d) - case .memberInfo(let arg): - var d = Serialization.getFields(Team.TeamMemberInfoV2Serializer().serialize(arg)) - d[".tag"] = .str("member_info") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersGetInfoItemV2 { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "id_not_found": - let v = Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) - return MembersGetInfoItemV2.idNotFound(v) - case "member_info": - let v = Team.TeamMemberInfoV2Serializer().deserialize(json) - return MembersGetInfoItemV2.memberInfo(v) - case "other": - return MembersGetInfoItemV2.other - default: - return MembersGetInfoItemV2.other - } + case .idNotFound(let arg): + var d = try ["id_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("id_not_found") + return .dictionary(d) + case .memberInfo(let arg): + var d = try Serialization.getFields(Team.TeamMemberInfoV2Serializer().serialize(arg)) + d[".tag"] = .str("member_info") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersGetInfoItemV2 { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "id_not_found": + let v = try Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) + return MembersGetInfoItemV2.idNotFound(v) + case "member_info": + let v = try Team.TeamMemberInfoV2Serializer().deserialize(json) + return MembersGetInfoItemV2.memberInfo(v) + case "other": + return MembersGetInfoItemV2.other default: - fatalError("Failed to deserialize") + return MembersGetInfoItemV2.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersGetInfoItemV2.self, json: json) } } } /// The MembersGetInfoV2Arg struct - open class MembersGetInfoV2Arg: CustomStringConvertible { + public class MembersGetInfoV2Arg: CustomStringConvertible, JSONRepresentable { /// List of team members. - public let members: Array - public init(members: Array) { + public let members: [Team.UserSelectorArg] + public init(members: [Team.UserSelectorArg]) { self.members = members } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetInfoV2ArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersGetInfoV2ArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetInfoV2ArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetInfoV2Arg: \(error)" + } } } - open class MembersGetInfoV2ArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetInfoV2Arg) -> JSON { - let output = [ - "members": ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.members), + + public class MembersGetInfoV2ArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetInfoV2Arg) throws -> JSON { + let output = [ + "members": try ArraySerializer(Team.UserSelectorArgSerializer()).serialize(value.members), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersGetInfoV2Arg { + + public func deserialize(_ json: JSON) throws -> MembersGetInfoV2Arg { switch json { - case .dictionary(let dict): - let members = ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["members"] ?? .null) - return MembersGetInfoV2Arg(members: members) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let members = try ArraySerializer(Team.UserSelectorArgSerializer()).deserialize(dict["members"] ?? .null) + return MembersGetInfoV2Arg(members: members) + default: + throw JSONSerializerError.deserializeError(type: MembersGetInfoV2Arg.self, json: json) } } } /// The MembersGetInfoV2Result struct - open class MembersGetInfoV2Result: CustomStringConvertible { + public class MembersGetInfoV2Result: CustomStringConvertible, JSONRepresentable { /// List of team members info. - public let membersInfo: Array - public init(membersInfo: Array) { + public let membersInfo: [Team.MembersGetInfoItemV2] + public init(membersInfo: [Team.MembersGetInfoItemV2]) { self.membersInfo = membersInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersGetInfoV2ResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersGetInfoV2ResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersGetInfoV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersGetInfoV2Result: \(error)" + } } } - open class MembersGetInfoV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersGetInfoV2Result) -> JSON { - let output = [ - "members_info": ArraySerializer(Team.MembersGetInfoItemV2Serializer()).serialize(value.membersInfo), + + public class MembersGetInfoV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersGetInfoV2Result) throws -> JSON { + let output = [ + "members_info": try ArraySerializer(Team.MembersGetInfoItemV2Serializer()).serialize(value.membersInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersGetInfoV2Result { + + public func deserialize(_ json: JSON) throws -> MembersGetInfoV2Result { switch json { - case .dictionary(let dict): - let membersInfo = ArraySerializer(Team.MembersGetInfoItemV2Serializer()).deserialize(dict["members_info"] ?? .null) - return MembersGetInfoV2Result(membersInfo: membersInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let membersInfo = try ArraySerializer(Team.MembersGetInfoItemV2Serializer()).deserialize(dict["members_info"] ?? .null) + return MembersGetInfoV2Result(membersInfo: membersInfo) + default: + throw JSONSerializerError.deserializeError(type: MembersGetInfoV2Result.self, json: json) } } } /// The MembersInfo struct - open class MembersInfo: CustomStringConvertible { + public class MembersInfo: CustomStringConvertible, JSONRepresentable { /// Team member IDs of the users under this hold. - public let teamMemberIds: Array + public let teamMemberIds: [String] /// The number of permanently deleted users that were under this hold. public let permanentlyDeletedUsers: UInt64 - public init(teamMemberIds: Array, permanentlyDeletedUsers: UInt64) { + public init(teamMemberIds: [String], permanentlyDeletedUsers: UInt64) { arrayValidator(itemValidator: stringValidator())(teamMemberIds) self.teamMemberIds = teamMemberIds comparableValidator()(permanentlyDeletedUsers) self.permanentlyDeletedUsers = permanentlyDeletedUsers } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersInfo: \(error)" + } } } - open class MembersInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersInfo) -> JSON { - let output = [ - "team_member_ids": ArraySerializer(Serialization._StringSerializer).serialize(value.teamMemberIds), - "permanently_deleted_users": Serialization._UInt64Serializer.serialize(value.permanentlyDeletedUsers), + + public class MembersInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersInfo) throws -> JSON { + let output = [ + "team_member_ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.teamMemberIds), + "permanently_deleted_users": try Serialization._UInt64Serializer.serialize(value.permanentlyDeletedUsers), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersInfo { + + public func deserialize(_ json: JSON) throws -> MembersInfo { switch json { - case .dictionary(let dict): - let teamMemberIds = ArraySerializer(Serialization._StringSerializer).deserialize(dict["team_member_ids"] ?? .null) - let permanentlyDeletedUsers = Serialization._UInt64Serializer.deserialize(dict["permanently_deleted_users"] ?? .null) - return MembersInfo(teamMemberIds: teamMemberIds, permanentlyDeletedUsers: permanentlyDeletedUsers) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamMemberIds = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["team_member_ids"] ?? .null) + let permanentlyDeletedUsers = try Serialization._UInt64Serializer.deserialize(dict["permanently_deleted_users"] ?? .null) + return MembersInfo(teamMemberIds: teamMemberIds, permanentlyDeletedUsers: permanentlyDeletedUsers) + default: + throw JSONSerializerError.deserializeError(type: MembersInfo.self, json: json) } } } /// The MembersListArg struct - open class MembersListArg: CustomStringConvertible { + public class MembersListArg: CustomStringConvertible, JSONRepresentable { /// Number of results to return per call. public let limit: UInt32 /// Whether to return removed members. public let includeRemoved: Bool - public init(limit: UInt32 = 1000, includeRemoved: Bool = false) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(limit: UInt32 = 1_000, includeRemoved: Bool = false) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit self.includeRemoved = includeRemoved } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersListArg: \(error)" + } } } - open class MembersListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersListArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), - "include_removed": Serialization._BoolSerializer.serialize(value.includeRemoved), + + public class MembersListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersListArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), + "include_removed": try Serialization._BoolSerializer.serialize(value.includeRemoved), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersListArg { + + public func deserialize(_ json: JSON) throws -> MembersListArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - let includeRemoved = Serialization._BoolSerializer.deserialize(dict["include_removed"] ?? .number(0)) - return MembersListArg(limit: limit, includeRemoved: includeRemoved) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + let includeRemoved = try Serialization._BoolSerializer.deserialize(dict["include_removed"] ?? .number(0)) + return MembersListArg(limit: limit, includeRemoved: includeRemoved) + default: + throw JSONSerializerError.deserializeError(type: MembersListArg.self, json: json) } } } /// The MembersListContinueArg struct - open class MembersListContinueArg: CustomStringConvertible { + public class MembersListContinueArg: CustomStringConvertible, JSONRepresentable { /// Indicates from what point to get the next set of members. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersListContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersListContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersListContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersListContinueArg: \(error)" + } } } - open class MembersListContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersListContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class MembersListContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersListContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersListContinueArg { + + public func deserialize(_ json: JSON) throws -> MembersListContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return MembersListContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return MembersListContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: MembersListContinueArg.self, json: json) } } } /// The MembersListContinueError union - public enum MembersListContinueError: CustomStringConvertible { + public enum MembersListContinueError: CustomStringConvertible, JSONRepresentable { /// The cursor is invalid. case invalidCursor /// An unspecified error. case other + func json() throws -> JSON { + try MembersListContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersListContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersListContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersListContinueError: \(error)" + } } } - open class MembersListContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersListContinueError) -> JSON { + + public class MembersListContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersListContinueError) throws -> JSON { switch value { - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersListContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_cursor": - return MembersListContinueError.invalidCursor - case "other": - return MembersListContinueError.other - default: - return MembersListContinueError.other - } + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersListContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_cursor": + return MembersListContinueError.invalidCursor + case "other": + return MembersListContinueError.other default: - fatalError("Failed to deserialize") + return MembersListContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersListContinueError.self, json: json) } } } /// The MembersListError union - public enum MembersListError: CustomStringConvertible { + public enum MembersListError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case other + func json() throws -> JSON { + try MembersListErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersListErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersListErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersListError: \(error)" + } } } - open class MembersListErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersListError) -> JSON { + + public class MembersListErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersListError) throws -> JSON { switch value { - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersListError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "other": - return MembersListError.other - default: - return MembersListError.other - } + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersListError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "other": + return MembersListError.other default: - fatalError("Failed to deserialize") + return MembersListError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersListError.self, json: json) } } } /// The MembersListResult struct - open class MembersListResult: CustomStringConvertible { + public class MembersListResult: CustomStringConvertible, JSONRepresentable { /// List of team members. - public let members: Array + public let members: [Team.TeamMemberInfo] /// Pass the cursor into membersListContinue to obtain the additional members. public let cursor: String /// Is true if there are additional team members that have not been returned yet. An additional call to /// membersListContinue can retrieve them. public let hasMore: Bool - public init(members: Array, cursor: String, hasMore: Bool) { + public init(members: [Team.TeamMemberInfo], cursor: String, hasMore: Bool) { self.members = members stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersListResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersListResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersListResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersListResult: \(error)" + } } } - open class MembersListResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersListResult) -> JSON { - let output = [ - "members": ArraySerializer(Team.TeamMemberInfoSerializer()).serialize(value.members), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class MembersListResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersListResult) throws -> JSON { + let output = [ + "members": try ArraySerializer(Team.TeamMemberInfoSerializer()).serialize(value.members), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersListResult { + + public func deserialize(_ json: JSON) throws -> MembersListResult { switch json { - case .dictionary(let dict): - let members = ArraySerializer(Team.TeamMemberInfoSerializer()).deserialize(dict["members"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return MembersListResult(members: members, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let members = try ArraySerializer(Team.TeamMemberInfoSerializer()).deserialize(dict["members"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return MembersListResult(members: members, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: MembersListResult.self, json: json) } } } /// The MembersListV2Result struct - open class MembersListV2Result: CustomStringConvertible { + public class MembersListV2Result: CustomStringConvertible, JSONRepresentable { /// List of team members. - public let members: Array + public let members: [Team.TeamMemberInfoV2] /// Pass the cursor into membersListContinueV2 to obtain the additional members. public let cursor: String /// Is true if there are additional team members that have not been returned yet. An additional call to /// membersListContinueV2 can retrieve them. public let hasMore: Bool - public init(members: Array, cursor: String, hasMore: Bool) { + public init(members: [Team.TeamMemberInfoV2], cursor: String, hasMore: Bool) { self.members = members stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersListV2ResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersListV2ResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersListV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersListV2Result: \(error)" + } } } - open class MembersListV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersListV2Result) -> JSON { - let output = [ - "members": ArraySerializer(Team.TeamMemberInfoV2Serializer()).serialize(value.members), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class MembersListV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersListV2Result) throws -> JSON { + let output = [ + "members": try ArraySerializer(Team.TeamMemberInfoV2Serializer()).serialize(value.members), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersListV2Result { + + public func deserialize(_ json: JSON) throws -> MembersListV2Result { switch json { - case .dictionary(let dict): - let members = ArraySerializer(Team.TeamMemberInfoV2Serializer()).deserialize(dict["members"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return MembersListV2Result(members: members, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let members = try ArraySerializer(Team.TeamMemberInfoV2Serializer()).deserialize(dict["members"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return MembersListV2Result(members: members, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: MembersListV2Result.self, json: json) } } } /// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. - open class MembersRecoverArg: CustomStringConvertible { + public class MembersRecoverArg: CustomStringConvertible, JSONRepresentable { /// Identity of user to recover. public let user: Team.UserSelectorArg public init(user: Team.UserSelectorArg) { self.user = user } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersRecoverArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersRecoverArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersRecoverArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersRecoverArg: \(error)" + } } } - open class MembersRecoverArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersRecoverArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), + + public class MembersRecoverArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersRecoverArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersRecoverArg { + + public func deserialize(_ json: JSON) throws -> MembersRecoverArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - return MembersRecoverArg(user: user) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + return MembersRecoverArg(user: user) + default: + throw JSONSerializerError.deserializeError(type: MembersRecoverArg.self, json: json) } } } /// The MembersRecoverError union - public enum MembersRecoverError: CustomStringConvertible { + public enum MembersRecoverError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not recoverable. @@ -7728,118 +9660,149 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersRecoverErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersRecoverErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersRecoverErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersRecoverError: \(error)" + } } } - open class MembersRecoverErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersRecoverError) -> JSON { + + public class MembersRecoverErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersRecoverError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userUnrecoverable: - var d = [String: JSON]() - d[".tag"] = .str("user_unrecoverable") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .teamLicenseLimit: - var d = [String: JSON]() - d[".tag"] = .str("team_license_limit") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersRecoverError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersRecoverError.userNotFound - case "user_unrecoverable": - return MembersRecoverError.userUnrecoverable - case "user_not_in_team": - return MembersRecoverError.userNotInTeam - case "team_license_limit": - return MembersRecoverError.teamLicenseLimit - case "other": - return MembersRecoverError.other - default: - return MembersRecoverError.other - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userUnrecoverable: + var d = [String: JSON]() + d[".tag"] = .str("user_unrecoverable") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .teamLicenseLimit: + var d = [String: JSON]() + d[".tag"] = .str("team_license_limit") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersRecoverError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersRecoverError.userNotFound + case "user_unrecoverable": + return MembersRecoverError.userUnrecoverable + case "user_not_in_team": + return MembersRecoverError.userNotInTeam + case "team_license_limit": + return MembersRecoverError.teamLicenseLimit + case "other": + return MembersRecoverError.other + default: + return MembersRecoverError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersRecoverError.self, json: json) } } } /// The MembersRemoveArg struct - open class MembersRemoveArg: Team.MembersDeactivateArg { + public class MembersRemoveArg: Team.MembersDeactivateArg { /// If provided, files from the deleted member account will be transferred to this user. public let transferDestId: Team.UserSelectorArg? /// If provided, errors during the transfer process will be sent via email to this user. If the transfer_dest_id /// argument was provided, then this argument must be provided as well. public let transferAdminId: Team.UserSelectorArg? /// Downgrade the member to a Basic account. The user will retain the email address associated with their - /// Dropbox account and data in their account that is not restricted to team members. In order to keep the - /// account the argument wipeData should be set to false. + /// Dropbox account and data in their account that is not restricted to team members. In order to keep + /// the account the argument wipeData should be set to false. public let keepAccount: Bool /// If provided, allows removed users to keep access to Dropbox folders (not Dropbox Paper folders) already - /// explicitly shared with them (not via a group) when they are downgraded to a Basic account. Users will not - /// retain access to folders that do not allow external sharing. In order to keep the sharing relationships, the - /// arguments wipeData should be set to false and keepAccount should be set to true. + /// explicitly shared with them (not via a group) when they are downgraded to a Basic account. Users + /// will not retain access to folders that do not allow external sharing. In order to keep the sharing + /// relationships, the arguments wipeData should be set to false and keepAccount should be set to true. public let retainTeamShares: Bool - public init(user: Team.UserSelectorArg, wipeData: Bool = true, transferDestId: Team.UserSelectorArg? = nil, transferAdminId: Team.UserSelectorArg? = nil, keepAccount: Bool = false, retainTeamShares: Bool = false) { + public init( + user: Team.UserSelectorArg, + wipeData: Bool = true, + transferDestId: Team.UserSelectorArg? = nil, + transferAdminId: Team.UserSelectorArg? = nil, + keepAccount: Bool = false, + retainTeamShares: Bool = false + ) { self.transferDestId = transferDestId self.transferAdminId = transferAdminId self.keepAccount = keepAccount self.retainTeamShares = retainTeamShares super.init(user: user, wipeData: wipeData) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersRemoveArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersRemoveArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersRemoveArg: \(error)" + } } } - open class MembersRemoveArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersRemoveArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "wipe_data": Serialization._BoolSerializer.serialize(value.wipeData), - "transfer_dest_id": NullableSerializer(Team.UserSelectorArgSerializer()).serialize(value.transferDestId), - "transfer_admin_id": NullableSerializer(Team.UserSelectorArgSerializer()).serialize(value.transferAdminId), - "keep_account": Serialization._BoolSerializer.serialize(value.keepAccount), - "retain_team_shares": Serialization._BoolSerializer.serialize(value.retainTeamShares), + + public class MembersRemoveArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersRemoveArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "wipe_data": try Serialization._BoolSerializer.serialize(value.wipeData), + "transfer_dest_id": try NullableSerializer(Team.UserSelectorArgSerializer()).serialize(value.transferDestId), + "transfer_admin_id": try NullableSerializer(Team.UserSelectorArgSerializer()).serialize(value.transferAdminId), + "keep_account": try Serialization._BoolSerializer.serialize(value.keepAccount), + "retain_team_shares": try Serialization._BoolSerializer.serialize(value.retainTeamShares), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersRemoveArg { + + public func deserialize(_ json: JSON) throws -> MembersRemoveArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let wipeData = Serialization._BoolSerializer.deserialize(dict["wipe_data"] ?? .number(1)) - let transferDestId = NullableSerializer(Team.UserSelectorArgSerializer()).deserialize(dict["transfer_dest_id"] ?? .null) - let transferAdminId = NullableSerializer(Team.UserSelectorArgSerializer()).deserialize(dict["transfer_admin_id"] ?? .null) - let keepAccount = Serialization._BoolSerializer.deserialize(dict["keep_account"] ?? .number(0)) - let retainTeamShares = Serialization._BoolSerializer.deserialize(dict["retain_team_shares"] ?? .number(0)) - return MembersRemoveArg(user: user, wipeData: wipeData, transferDestId: transferDestId, transferAdminId: transferAdminId, keepAccount: keepAccount, retainTeamShares: retainTeamShares) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let wipeData = try Serialization._BoolSerializer.deserialize(dict["wipe_data"] ?? .number(1)) + let transferDestId = try NullableSerializer(Team.UserSelectorArgSerializer()).deserialize(dict["transfer_dest_id"] ?? .null) + let transferAdminId = try NullableSerializer(Team.UserSelectorArgSerializer()).deserialize(dict["transfer_admin_id"] ?? .null) + let keepAccount = try Serialization._BoolSerializer.deserialize(dict["keep_account"] ?? .number(0)) + let retainTeamShares = try Serialization._BoolSerializer.deserialize(dict["retain_team_shares"] ?? .number(0)) + return MembersRemoveArg( + user: user, + wipeData: wipeData, + transferDestId: transferDestId, + transferAdminId: transferAdminId, + keepAccount: keepAccount, + retainTeamShares: retainTeamShares + ) + default: + throw JSONSerializerError.deserializeError(type: MembersRemoveArg.self, json: json) } } } /// The MembersTransferFilesError union - public enum MembersTransferFilesError: CustomStringConvertible { + public enum MembersTransferFilesError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -7865,104 +9828,114 @@ open class Team { /// The recipient user's email is not verified. case recipientNotVerified + func json() throws -> JSON { + try MembersTransferFilesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersTransferFilesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersTransferFilesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersTransferFilesError: \(error)" + } } } - open class MembersTransferFilesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersTransferFilesError) -> JSON { + + public class MembersTransferFilesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersTransferFilesError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .removedAndTransferDestShouldDiffer: - var d = [String: JSON]() - d[".tag"] = .str("removed_and_transfer_dest_should_differ") - return .dictionary(d) - case .removedAndTransferAdminShouldDiffer: - var d = [String: JSON]() - d[".tag"] = .str("removed_and_transfer_admin_should_differ") - return .dictionary(d) - case .transferDestUserNotFound: - var d = [String: JSON]() - d[".tag"] = .str("transfer_dest_user_not_found") - return .dictionary(d) - case .transferDestUserNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("transfer_dest_user_not_in_team") - return .dictionary(d) - case .transferAdminUserNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_user_not_in_team") - return .dictionary(d) - case .transferAdminUserNotFound: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_user_not_found") - return .dictionary(d) - case .unspecifiedTransferAdminId: - var d = [String: JSON]() - d[".tag"] = .str("unspecified_transfer_admin_id") - return .dictionary(d) - case .transferAdminIsNotAdmin: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_is_not_admin") - return .dictionary(d) - case .recipientNotVerified: - var d = [String: JSON]() - d[".tag"] = .str("recipient_not_verified") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersTransferFilesError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersTransferFilesError.userNotFound - case "user_not_in_team": - return MembersTransferFilesError.userNotInTeam - case "other": - return MembersTransferFilesError.other - case "removed_and_transfer_dest_should_differ": - return MembersTransferFilesError.removedAndTransferDestShouldDiffer - case "removed_and_transfer_admin_should_differ": - return MembersTransferFilesError.removedAndTransferAdminShouldDiffer - case "transfer_dest_user_not_found": - return MembersTransferFilesError.transferDestUserNotFound - case "transfer_dest_user_not_in_team": - return MembersTransferFilesError.transferDestUserNotInTeam - case "transfer_admin_user_not_in_team": - return MembersTransferFilesError.transferAdminUserNotInTeam - case "transfer_admin_user_not_found": - return MembersTransferFilesError.transferAdminUserNotFound - case "unspecified_transfer_admin_id": - return MembersTransferFilesError.unspecifiedTransferAdminId - case "transfer_admin_is_not_admin": - return MembersTransferFilesError.transferAdminIsNotAdmin - case "recipient_not_verified": - return MembersTransferFilesError.recipientNotVerified - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .removedAndTransferDestShouldDiffer: + var d = [String: JSON]() + d[".tag"] = .str("removed_and_transfer_dest_should_differ") + return .dictionary(d) + case .removedAndTransferAdminShouldDiffer: + var d = [String: JSON]() + d[".tag"] = .str("removed_and_transfer_admin_should_differ") + return .dictionary(d) + case .transferDestUserNotFound: + var d = [String: JSON]() + d[".tag"] = .str("transfer_dest_user_not_found") + return .dictionary(d) + case .transferDestUserNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("transfer_dest_user_not_in_team") + return .dictionary(d) + case .transferAdminUserNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_user_not_in_team") + return .dictionary(d) + case .transferAdminUserNotFound: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_user_not_found") + return .dictionary(d) + case .unspecifiedTransferAdminId: + var d = [String: JSON]() + d[".tag"] = .str("unspecified_transfer_admin_id") + return .dictionary(d) + case .transferAdminIsNotAdmin: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_is_not_admin") + return .dictionary(d) + case .recipientNotVerified: + var d = [String: JSON]() + d[".tag"] = .str("recipient_not_verified") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersTransferFilesError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersTransferFilesError.userNotFound + case "user_not_in_team": + return MembersTransferFilesError.userNotInTeam + case "other": + return MembersTransferFilesError.other + case "removed_and_transfer_dest_should_differ": + return MembersTransferFilesError.removedAndTransferDestShouldDiffer + case "removed_and_transfer_admin_should_differ": + return MembersTransferFilesError.removedAndTransferAdminShouldDiffer + case "transfer_dest_user_not_found": + return MembersTransferFilesError.transferDestUserNotFound + case "transfer_dest_user_not_in_team": + return MembersTransferFilesError.transferDestUserNotInTeam + case "transfer_admin_user_not_in_team": + return MembersTransferFilesError.transferAdminUserNotInTeam + case "transfer_admin_user_not_found": + return MembersTransferFilesError.transferAdminUserNotFound + case "unspecified_transfer_admin_id": + return MembersTransferFilesError.unspecifiedTransferAdminId + case "transfer_admin_is_not_admin": + return MembersTransferFilesError.transferAdminIsNotAdmin + case "recipient_not_verified": + return MembersTransferFilesError.recipientNotVerified + default: + throw JSONSerializerError.unknownTag(type: MembersTransferFilesError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersTransferFilesError.self, json: json) } } } /// The MembersRemoveError union - public enum MembersRemoveError: CustomStringConvertible { + public enum MembersRemoveError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -8016,170 +9989,180 @@ open class Team { /// of service. case cannotKeepAccountRequiredToSignTos + func json() throws -> JSON { + try MembersRemoveErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersRemoveErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersRemoveErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersRemoveError: \(error)" + } } } - open class MembersRemoveErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersRemoveError) -> JSON { + + public class MembersRemoveErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersRemoveError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .removedAndTransferDestShouldDiffer: - var d = [String: JSON]() - d[".tag"] = .str("removed_and_transfer_dest_should_differ") - return .dictionary(d) - case .removedAndTransferAdminShouldDiffer: - var d = [String: JSON]() - d[".tag"] = .str("removed_and_transfer_admin_should_differ") - return .dictionary(d) - case .transferDestUserNotFound: - var d = [String: JSON]() - d[".tag"] = .str("transfer_dest_user_not_found") - return .dictionary(d) - case .transferDestUserNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("transfer_dest_user_not_in_team") - return .dictionary(d) - case .transferAdminUserNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_user_not_in_team") - return .dictionary(d) - case .transferAdminUserNotFound: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_user_not_found") - return .dictionary(d) - case .unspecifiedTransferAdminId: - var d = [String: JSON]() - d[".tag"] = .str("unspecified_transfer_admin_id") - return .dictionary(d) - case .transferAdminIsNotAdmin: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_is_not_admin") - return .dictionary(d) - case .recipientNotVerified: - var d = [String: JSON]() - d[".tag"] = .str("recipient_not_verified") - return .dictionary(d) - case .removeLastAdmin: - var d = [String: JSON]() - d[".tag"] = .str("remove_last_admin") - return .dictionary(d) - case .cannotKeepAccountAndTransfer: - var d = [String: JSON]() - d[".tag"] = .str("cannot_keep_account_and_transfer") - return .dictionary(d) - case .cannotKeepAccountAndDeleteData: - var d = [String: JSON]() - d[".tag"] = .str("cannot_keep_account_and_delete_data") - return .dictionary(d) - case .emailAddressTooLongToBeDisabled: - var d = [String: JSON]() - d[".tag"] = .str("email_address_too_long_to_be_disabled") - return .dictionary(d) - case .cannotKeepInvitedUserAccount: - var d = [String: JSON]() - d[".tag"] = .str("cannot_keep_invited_user_account") - return .dictionary(d) - case .cannotRetainSharesWhenDataWiped: - var d = [String: JSON]() - d[".tag"] = .str("cannot_retain_shares_when_data_wiped") - return .dictionary(d) - case .cannotRetainSharesWhenNoAccountKept: - var d = [String: JSON]() - d[".tag"] = .str("cannot_retain_shares_when_no_account_kept") - return .dictionary(d) - case .cannotRetainSharesWhenTeamExternalSharingOff: - var d = [String: JSON]() - d[".tag"] = .str("cannot_retain_shares_when_team_external_sharing_off") - return .dictionary(d) - case .cannotKeepAccount: - var d = [String: JSON]() - d[".tag"] = .str("cannot_keep_account") - return .dictionary(d) - case .cannotKeepAccountUnderLegalHold: - var d = [String: JSON]() - d[".tag"] = .str("cannot_keep_account_under_legal_hold") - return .dictionary(d) - case .cannotKeepAccountRequiredToSignTos: - var d = [String: JSON]() - d[".tag"] = .str("cannot_keep_account_required_to_sign_tos") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersRemoveError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersRemoveError.userNotFound - case "user_not_in_team": - return MembersRemoveError.userNotInTeam - case "other": - return MembersRemoveError.other - case "removed_and_transfer_dest_should_differ": - return MembersRemoveError.removedAndTransferDestShouldDiffer - case "removed_and_transfer_admin_should_differ": - return MembersRemoveError.removedAndTransferAdminShouldDiffer - case "transfer_dest_user_not_found": - return MembersRemoveError.transferDestUserNotFound - case "transfer_dest_user_not_in_team": - return MembersRemoveError.transferDestUserNotInTeam - case "transfer_admin_user_not_in_team": - return MembersRemoveError.transferAdminUserNotInTeam - case "transfer_admin_user_not_found": - return MembersRemoveError.transferAdminUserNotFound - case "unspecified_transfer_admin_id": - return MembersRemoveError.unspecifiedTransferAdminId - case "transfer_admin_is_not_admin": - return MembersRemoveError.transferAdminIsNotAdmin - case "recipient_not_verified": - return MembersRemoveError.recipientNotVerified - case "remove_last_admin": - return MembersRemoveError.removeLastAdmin - case "cannot_keep_account_and_transfer": - return MembersRemoveError.cannotKeepAccountAndTransfer - case "cannot_keep_account_and_delete_data": - return MembersRemoveError.cannotKeepAccountAndDeleteData - case "email_address_too_long_to_be_disabled": - return MembersRemoveError.emailAddressTooLongToBeDisabled - case "cannot_keep_invited_user_account": - return MembersRemoveError.cannotKeepInvitedUserAccount - case "cannot_retain_shares_when_data_wiped": - return MembersRemoveError.cannotRetainSharesWhenDataWiped - case "cannot_retain_shares_when_no_account_kept": - return MembersRemoveError.cannotRetainSharesWhenNoAccountKept - case "cannot_retain_shares_when_team_external_sharing_off": - return MembersRemoveError.cannotRetainSharesWhenTeamExternalSharingOff - case "cannot_keep_account": - return MembersRemoveError.cannotKeepAccount - case "cannot_keep_account_under_legal_hold": - return MembersRemoveError.cannotKeepAccountUnderLegalHold - case "cannot_keep_account_required_to_sign_tos": - return MembersRemoveError.cannotKeepAccountRequiredToSignTos - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .removedAndTransferDestShouldDiffer: + var d = [String: JSON]() + d[".tag"] = .str("removed_and_transfer_dest_should_differ") + return .dictionary(d) + case .removedAndTransferAdminShouldDiffer: + var d = [String: JSON]() + d[".tag"] = .str("removed_and_transfer_admin_should_differ") + return .dictionary(d) + case .transferDestUserNotFound: + var d = [String: JSON]() + d[".tag"] = .str("transfer_dest_user_not_found") + return .dictionary(d) + case .transferDestUserNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("transfer_dest_user_not_in_team") + return .dictionary(d) + case .transferAdminUserNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_user_not_in_team") + return .dictionary(d) + case .transferAdminUserNotFound: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_user_not_found") + return .dictionary(d) + case .unspecifiedTransferAdminId: + var d = [String: JSON]() + d[".tag"] = .str("unspecified_transfer_admin_id") + return .dictionary(d) + case .transferAdminIsNotAdmin: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_is_not_admin") + return .dictionary(d) + case .recipientNotVerified: + var d = [String: JSON]() + d[".tag"] = .str("recipient_not_verified") + return .dictionary(d) + case .removeLastAdmin: + var d = [String: JSON]() + d[".tag"] = .str("remove_last_admin") + return .dictionary(d) + case .cannotKeepAccountAndTransfer: + var d = [String: JSON]() + d[".tag"] = .str("cannot_keep_account_and_transfer") + return .dictionary(d) + case .cannotKeepAccountAndDeleteData: + var d = [String: JSON]() + d[".tag"] = .str("cannot_keep_account_and_delete_data") + return .dictionary(d) + case .emailAddressTooLongToBeDisabled: + var d = [String: JSON]() + d[".tag"] = .str("email_address_too_long_to_be_disabled") + return .dictionary(d) + case .cannotKeepInvitedUserAccount: + var d = [String: JSON]() + d[".tag"] = .str("cannot_keep_invited_user_account") + return .dictionary(d) + case .cannotRetainSharesWhenDataWiped: + var d = [String: JSON]() + d[".tag"] = .str("cannot_retain_shares_when_data_wiped") + return .dictionary(d) + case .cannotRetainSharesWhenNoAccountKept: + var d = [String: JSON]() + d[".tag"] = .str("cannot_retain_shares_when_no_account_kept") + return .dictionary(d) + case .cannotRetainSharesWhenTeamExternalSharingOff: + var d = [String: JSON]() + d[".tag"] = .str("cannot_retain_shares_when_team_external_sharing_off") + return .dictionary(d) + case .cannotKeepAccount: + var d = [String: JSON]() + d[".tag"] = .str("cannot_keep_account") + return .dictionary(d) + case .cannotKeepAccountUnderLegalHold: + var d = [String: JSON]() + d[".tag"] = .str("cannot_keep_account_under_legal_hold") + return .dictionary(d) + case .cannotKeepAccountRequiredToSignTos: + var d = [String: JSON]() + d[".tag"] = .str("cannot_keep_account_required_to_sign_tos") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersRemoveError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersRemoveError.userNotFound + case "user_not_in_team": + return MembersRemoveError.userNotInTeam + case "other": + return MembersRemoveError.other + case "removed_and_transfer_dest_should_differ": + return MembersRemoveError.removedAndTransferDestShouldDiffer + case "removed_and_transfer_admin_should_differ": + return MembersRemoveError.removedAndTransferAdminShouldDiffer + case "transfer_dest_user_not_found": + return MembersRemoveError.transferDestUserNotFound + case "transfer_dest_user_not_in_team": + return MembersRemoveError.transferDestUserNotInTeam + case "transfer_admin_user_not_in_team": + return MembersRemoveError.transferAdminUserNotInTeam + case "transfer_admin_user_not_found": + return MembersRemoveError.transferAdminUserNotFound + case "unspecified_transfer_admin_id": + return MembersRemoveError.unspecifiedTransferAdminId + case "transfer_admin_is_not_admin": + return MembersRemoveError.transferAdminIsNotAdmin + case "recipient_not_verified": + return MembersRemoveError.recipientNotVerified + case "remove_last_admin": + return MembersRemoveError.removeLastAdmin + case "cannot_keep_account_and_transfer": + return MembersRemoveError.cannotKeepAccountAndTransfer + case "cannot_keep_account_and_delete_data": + return MembersRemoveError.cannotKeepAccountAndDeleteData + case "email_address_too_long_to_be_disabled": + return MembersRemoveError.emailAddressTooLongToBeDisabled + case "cannot_keep_invited_user_account": + return MembersRemoveError.cannotKeepInvitedUserAccount + case "cannot_retain_shares_when_data_wiped": + return MembersRemoveError.cannotRetainSharesWhenDataWiped + case "cannot_retain_shares_when_no_account_kept": + return MembersRemoveError.cannotRetainSharesWhenNoAccountKept + case "cannot_retain_shares_when_team_external_sharing_off": + return MembersRemoveError.cannotRetainSharesWhenTeamExternalSharingOff + case "cannot_keep_account": + return MembersRemoveError.cannotKeepAccount + case "cannot_keep_account_under_legal_hold": + return MembersRemoveError.cannotKeepAccountUnderLegalHold + case "cannot_keep_account_required_to_sign_tos": + return MembersRemoveError.cannotKeepAccountRequiredToSignTos + default: + throw JSONSerializerError.unknownTag(type: MembersRemoveError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersRemoveError.self, json: json) } } } /// The MembersSendWelcomeError union - public enum MembersSendWelcomeError: CustomStringConvertible { + public enum MembersSendWelcomeError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -8187,87 +10170,108 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersSendWelcomeErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSendWelcomeErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSendWelcomeErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSendWelcomeError: \(error)" + } } } - open class MembersSendWelcomeErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSendWelcomeError) -> JSON { + + public class MembersSendWelcomeErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSendWelcomeError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersSendWelcomeError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersSendWelcomeError.userNotFound - case "user_not_in_team": - return MembersSendWelcomeError.userNotInTeam - case "other": - return MembersSendWelcomeError.other - default: - return MembersSendWelcomeError.other - } + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersSendWelcomeError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersSendWelcomeError.userNotFound + case "user_not_in_team": + return MembersSendWelcomeError.userNotInTeam + case "other": + return MembersSendWelcomeError.other default: - fatalError("Failed to deserialize") + return MembersSendWelcomeError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersSendWelcomeError.self, json: json) } } } /// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. - open class MembersSetPermissions2Arg: CustomStringConvertible { + public class MembersSetPermissions2Arg: CustomStringConvertible, JSONRepresentable { /// Identity of user whose role will be set. public let user: Team.UserSelectorArg /// The new roles for the member. Send empty list to make user member only. For now, only up to one role is /// allowed. - public let newRoles: Array? - public init(user: Team.UserSelectorArg, newRoles: Array? = nil) { + public let newRoles: [String]? + public init(user: Team.UserSelectorArg, newRoles: [String]? = nil) { self.user = user nullableValidator(arrayValidator(maxItems: 1, itemValidator: stringValidator(maxLength: 128, pattern: "pid_dbtmr:.*")))(newRoles) self.newRoles = newRoles } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetPermissions2ArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersSetPermissions2ArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetPermissions2ArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetPermissions2Arg: \(error)" + } } } - open class MembersSetPermissions2ArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetPermissions2Arg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "new_roles": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.newRoles), + + public class MembersSetPermissions2ArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetPermissions2Arg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "new_roles": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.newRoles), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersSetPermissions2Arg { + + public func deserialize(_ json: JSON) throws -> MembersSetPermissions2Arg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let newRoles = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["new_roles"] ?? .null) - return MembersSetPermissions2Arg(user: user, newRoles: newRoles) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let newRoles = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["new_roles"] ?? .null) + return MembersSetPermissions2Arg(user: user, newRoles: newRoles) + default: + throw JSONSerializerError.deserializeError(type: MembersSetPermissions2Arg.self, json: json) } } } /// The MembersSetPermissions2Error union - public enum MembersSetPermissions2Error: CustomStringConvertible { + public enum MembersSetPermissions2Error: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// Cannot remove the admin setting of the last admin. @@ -8281,104 +10285,125 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersSetPermissions2ErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetPermissions2ErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetPermissions2ErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetPermissions2Error: \(error)" + } } } - open class MembersSetPermissions2ErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetPermissions2Error) -> JSON { + + public class MembersSetPermissions2ErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetPermissions2Error) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .lastAdmin: - var d = [String: JSON]() - d[".tag"] = .str("last_admin") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .cannotSetPermissions: - var d = [String: JSON]() - d[".tag"] = .str("cannot_set_permissions") - return .dictionary(d) - case .roleNotFound: - var d = [String: JSON]() - d[".tag"] = .str("role_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersSetPermissions2Error { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersSetPermissions2Error.userNotFound - case "last_admin": - return MembersSetPermissions2Error.lastAdmin - case "user_not_in_team": - return MembersSetPermissions2Error.userNotInTeam - case "cannot_set_permissions": - return MembersSetPermissions2Error.cannotSetPermissions - case "role_not_found": - return MembersSetPermissions2Error.roleNotFound - case "other": - return MembersSetPermissions2Error.other - default: - return MembersSetPermissions2Error.other - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .lastAdmin: + var d = [String: JSON]() + d[".tag"] = .str("last_admin") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .cannotSetPermissions: + var d = [String: JSON]() + d[".tag"] = .str("cannot_set_permissions") + return .dictionary(d) + case .roleNotFound: + var d = [String: JSON]() + d[".tag"] = .str("role_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersSetPermissions2Error { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersSetPermissions2Error.userNotFound + case "last_admin": + return MembersSetPermissions2Error.lastAdmin + case "user_not_in_team": + return MembersSetPermissions2Error.userNotInTeam + case "cannot_set_permissions": + return MembersSetPermissions2Error.cannotSetPermissions + case "role_not_found": + return MembersSetPermissions2Error.roleNotFound + case "other": + return MembersSetPermissions2Error.other + default: + return MembersSetPermissions2Error.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersSetPermissions2Error.self, json: json) } } } /// The MembersSetPermissions2Result struct - open class MembersSetPermissions2Result: CustomStringConvertible { + public class MembersSetPermissions2Result: CustomStringConvertible, JSONRepresentable { /// The member ID of the user to which the change was applied. public let teamMemberId: String /// The roles after the change. Empty in case the user become a non-admin. - public let roles: Array? - public init(teamMemberId: String, roles: Array? = nil) { + public let roles: [Team.TeamMemberRole]? + public init(teamMemberId: String, roles: [Team.TeamMemberRole]? = nil) { stringValidator()(teamMemberId) self.teamMemberId = teamMemberId self.roles = roles } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetPermissions2ResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersSetPermissions2ResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetPermissions2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetPermissions2Result: \(error)" + } } } - open class MembersSetPermissions2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetPermissions2Result) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "roles": NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).serialize(value.roles), + + public class MembersSetPermissions2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetPermissions2Result) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "roles": try NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).serialize(value.roles), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersSetPermissions2Result { + + public func deserialize(_ json: JSON) throws -> MembersSetPermissions2Result { switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let roles = NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).deserialize(dict["roles"] ?? .null) - return MembersSetPermissions2Result(teamMemberId: teamMemberId, roles: roles) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let roles = try NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).deserialize(dict["roles"] ?? .null) + return MembersSetPermissions2Result(teamMemberId: teamMemberId, roles: roles) + default: + throw JSONSerializerError.deserializeError(type: MembersSetPermissions2Result.self, json: json) } } } /// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. - open class MembersSetPermissionsArg: CustomStringConvertible { + public class MembersSetPermissionsArg: CustomStringConvertible, JSONRepresentable { /// Identity of user whose role will be set. public let user: Team.UserSelectorArg /// The new role of the member. @@ -8387,33 +10412,44 @@ open class Team { self.user = user self.newRole = newRole } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetPermissionsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersSetPermissionsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetPermissionsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetPermissionsArg: \(error)" + } } } - open class MembersSetPermissionsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetPermissionsArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "new_role": Team.AdminTierSerializer().serialize(value.newRole), + + public class MembersSetPermissionsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetPermissionsArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "new_role": try Team.AdminTierSerializer().serialize(value.newRole), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersSetPermissionsArg { + + public func deserialize(_ json: JSON) throws -> MembersSetPermissionsArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let newRole = Team.AdminTierSerializer().deserialize(dict["new_role"] ?? .null) - return MembersSetPermissionsArg(user: user, newRole: newRole) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let newRole = try Team.AdminTierSerializer().deserialize(dict["new_role"] ?? .null) + return MembersSetPermissionsArg(user: user, newRole: newRole) + default: + throw JSONSerializerError.deserializeError(type: MembersSetPermissionsArg.self, json: json) } } } /// The MembersSetPermissionsError union - public enum MembersSetPermissionsError: CustomStringConvertible { + public enum MembersSetPermissionsError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// Cannot remove the admin setting of the last admin. @@ -8427,68 +10463,78 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersSetPermissionsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetPermissionsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetPermissionsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetPermissionsError: \(error)" + } } } - open class MembersSetPermissionsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetPermissionsError) -> JSON { + + public class MembersSetPermissionsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetPermissionsError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .lastAdmin: - var d = [String: JSON]() - d[".tag"] = .str("last_admin") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .cannotSetPermissions: - var d = [String: JSON]() - d[".tag"] = .str("cannot_set_permissions") - return .dictionary(d) - case .teamLicenseLimit: - var d = [String: JSON]() - d[".tag"] = .str("team_license_limit") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersSetPermissionsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersSetPermissionsError.userNotFound - case "last_admin": - return MembersSetPermissionsError.lastAdmin - case "user_not_in_team": - return MembersSetPermissionsError.userNotInTeam - case "cannot_set_permissions": - return MembersSetPermissionsError.cannotSetPermissions - case "team_license_limit": - return MembersSetPermissionsError.teamLicenseLimit - case "other": - return MembersSetPermissionsError.other - default: - return MembersSetPermissionsError.other - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .lastAdmin: + var d = [String: JSON]() + d[".tag"] = .str("last_admin") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .cannotSetPermissions: + var d = [String: JSON]() + d[".tag"] = .str("cannot_set_permissions") + return .dictionary(d) + case .teamLicenseLimit: + var d = [String: JSON]() + d[".tag"] = .str("team_license_limit") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersSetPermissionsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersSetPermissionsError.userNotFound + case "last_admin": + return MembersSetPermissionsError.lastAdmin + case "user_not_in_team": + return MembersSetPermissionsError.userNotInTeam + case "cannot_set_permissions": + return MembersSetPermissionsError.cannotSetPermissions + case "team_license_limit": + return MembersSetPermissionsError.teamLicenseLimit + case "other": + return MembersSetPermissionsError.other + default: + return MembersSetPermissionsError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersSetPermissionsError.self, json: json) } } } /// The MembersSetPermissionsResult struct - open class MembersSetPermissionsResult: CustomStringConvertible { + public class MembersSetPermissionsResult: CustomStringConvertible, JSONRepresentable { /// The member ID of the user to which the change was applied. public let teamMemberId: String /// The role after the change. @@ -8498,34 +10544,45 @@ open class Team { self.teamMemberId = teamMemberId self.role = role } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetPermissionsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersSetPermissionsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetPermissionsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetPermissionsResult: \(error)" + } } } - open class MembersSetPermissionsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetPermissionsResult) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "role": Team.AdminTierSerializer().serialize(value.role), + + public class MembersSetPermissionsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetPermissionsResult) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "role": try Team.AdminTierSerializer().serialize(value.role), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersSetPermissionsResult { + + public func deserialize(_ json: JSON) throws -> MembersSetPermissionsResult { switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let role = Team.AdminTierSerializer().deserialize(dict["role"] ?? .null) - return MembersSetPermissionsResult(teamMemberId: teamMemberId, role: role) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let role = try Team.AdminTierSerializer().deserialize(dict["role"] ?? .null) + return MembersSetPermissionsResult(teamMemberId: teamMemberId, role: role) + default: + throw JSONSerializerError.deserializeError(type: MembersSetPermissionsResult.self, json: json) } } } /// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. At least one /// of new_email, new_external_id, new_given_name, and/or new_surname must be provided. - open class MembersSetProfileArg: CustomStringConvertible { + public class MembersSetProfileArg: CustomStringConvertible, JSONRepresentable { /// Identity of user whose profile will be set. public let user: Team.UserSelectorArg /// New email for member. @@ -8540,7 +10597,15 @@ open class Team { public let newPersistentId: String? /// New value for whether the user is a directory restricted user. public let newIsDirectoryRestricted: Bool? - public init(user: Team.UserSelectorArg, newEmail: String? = nil, newExternalId: String? = nil, newGivenName: String? = nil, newSurname: String? = nil, newPersistentId: String? = nil, newIsDirectoryRestricted: Bool? = nil) { + public init( + user: Team.UserSelectorArg, + newEmail: String? = nil, + newExternalId: String? = nil, + newGivenName: String? = nil, + newSurname: String? = nil, + newPersistentId: String? = nil, + newIsDirectoryRestricted: Bool? = nil + ) { self.user = user nullableValidator(stringValidator(maxLength: 255, pattern: "^['#&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$"))(newEmail) self.newEmail = newEmail @@ -8554,43 +10619,63 @@ open class Team { self.newPersistentId = newPersistentId self.newIsDirectoryRestricted = newIsDirectoryRestricted } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetProfileArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersSetProfileArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetProfileArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetProfileArg: \(error)" + } } } - open class MembersSetProfileArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetProfileArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "new_email": NullableSerializer(Serialization._StringSerializer).serialize(value.newEmail), - "new_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.newExternalId), - "new_given_name": NullableSerializer(Serialization._StringSerializer).serialize(value.newGivenName), - "new_surname": NullableSerializer(Serialization._StringSerializer).serialize(value.newSurname), - "new_persistent_id": NullableSerializer(Serialization._StringSerializer).serialize(value.newPersistentId), - "new_is_directory_restricted": NullableSerializer(Serialization._BoolSerializer).serialize(value.newIsDirectoryRestricted), + + public class MembersSetProfileArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetProfileArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "new_email": try NullableSerializer(Serialization._StringSerializer).serialize(value.newEmail), + "new_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.newExternalId), + "new_given_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.newGivenName), + "new_surname": try NullableSerializer(Serialization._StringSerializer).serialize(value.newSurname), + "new_persistent_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.newPersistentId), + "new_is_directory_restricted": try NullableSerializer(Serialization._BoolSerializer).serialize(value.newIsDirectoryRestricted), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersSetProfileArg { + + public func deserialize(_ json: JSON) throws -> MembersSetProfileArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let newEmail = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_email"] ?? .null) - let newExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_external_id"] ?? .null) - let newGivenName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_given_name"] ?? .null) - let newSurname = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_surname"] ?? .null) - let newPersistentId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_persistent_id"] ?? .null) - let newIsDirectoryRestricted = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["new_is_directory_restricted"] ?? .null) - return MembersSetProfileArg(user: user, newEmail: newEmail, newExternalId: newExternalId, newGivenName: newGivenName, newSurname: newSurname, newPersistentId: newPersistentId, newIsDirectoryRestricted: newIsDirectoryRestricted) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let newEmail = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_email"] ?? .null) + let newExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_external_id"] ?? .null) + let newGivenName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_given_name"] ?? .null) + let newSurname = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_surname"] ?? .null) + let newPersistentId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_persistent_id"] ?? .null) + let newIsDirectoryRestricted = try NullableSerializer(Serialization._BoolSerializer) + .deserialize(dict["new_is_directory_restricted"] ?? .null) + return MembersSetProfileArg( + user: user, + newEmail: newEmail, + newExternalId: newExternalId, + newGivenName: newGivenName, + newSurname: newSurname, + newPersistentId: newPersistentId, + newIsDirectoryRestricted: newIsDirectoryRestricted + ) + default: + throw JSONSerializerError.deserializeError(type: MembersSetProfileArg.self, json: json) } } } /// The MembersSetProfileError union - public enum MembersSetProfileError: CustomStringConvertible { + public enum MembersSetProfileError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -8617,104 +10702,114 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersSetProfileErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetProfileErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetProfileErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetProfileError: \(error)" + } } } - open class MembersSetProfileErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetProfileError) -> JSON { + + public class MembersSetProfileErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetProfileError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .externalIdAndNewExternalIdUnsafe: - var d = [String: JSON]() - d[".tag"] = .str("external_id_and_new_external_id_unsafe") - return .dictionary(d) - case .noNewDataSpecified: - var d = [String: JSON]() - d[".tag"] = .str("no_new_data_specified") - return .dictionary(d) - case .emailReservedForOtherUser: - var d = [String: JSON]() - d[".tag"] = .str("email_reserved_for_other_user") - return .dictionary(d) - case .externalIdUsedByOtherUser: - var d = [String: JSON]() - d[".tag"] = .str("external_id_used_by_other_user") - return .dictionary(d) - case .setProfileDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("set_profile_disallowed") - return .dictionary(d) - case .paramCannotBeEmpty: - var d = [String: JSON]() - d[".tag"] = .str("param_cannot_be_empty") - return .dictionary(d) - case .persistentIdDisabled: - var d = [String: JSON]() - d[".tag"] = .str("persistent_id_disabled") - return .dictionary(d) - case .persistentIdUsedByOtherUser: - var d = [String: JSON]() - d[".tag"] = .str("persistent_id_used_by_other_user") - return .dictionary(d) - case .directoryRestrictedOff: - var d = [String: JSON]() - d[".tag"] = .str("directory_restricted_off") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersSetProfileError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersSetProfileError.userNotFound - case "user_not_in_team": - return MembersSetProfileError.userNotInTeam - case "external_id_and_new_external_id_unsafe": - return MembersSetProfileError.externalIdAndNewExternalIdUnsafe - case "no_new_data_specified": - return MembersSetProfileError.noNewDataSpecified - case "email_reserved_for_other_user": - return MembersSetProfileError.emailReservedForOtherUser - case "external_id_used_by_other_user": - return MembersSetProfileError.externalIdUsedByOtherUser - case "set_profile_disallowed": - return MembersSetProfileError.setProfileDisallowed - case "param_cannot_be_empty": - return MembersSetProfileError.paramCannotBeEmpty - case "persistent_id_disabled": - return MembersSetProfileError.persistentIdDisabled - case "persistent_id_used_by_other_user": - return MembersSetProfileError.persistentIdUsedByOtherUser - case "directory_restricted_off": - return MembersSetProfileError.directoryRestrictedOff - case "other": - return MembersSetProfileError.other - default: - return MembersSetProfileError.other - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .externalIdAndNewExternalIdUnsafe: + var d = [String: JSON]() + d[".tag"] = .str("external_id_and_new_external_id_unsafe") + return .dictionary(d) + case .noNewDataSpecified: + var d = [String: JSON]() + d[".tag"] = .str("no_new_data_specified") + return .dictionary(d) + case .emailReservedForOtherUser: + var d = [String: JSON]() + d[".tag"] = .str("email_reserved_for_other_user") + return .dictionary(d) + case .externalIdUsedByOtherUser: + var d = [String: JSON]() + d[".tag"] = .str("external_id_used_by_other_user") + return .dictionary(d) + case .setProfileDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("set_profile_disallowed") + return .dictionary(d) + case .paramCannotBeEmpty: + var d = [String: JSON]() + d[".tag"] = .str("param_cannot_be_empty") + return .dictionary(d) + case .persistentIdDisabled: + var d = [String: JSON]() + d[".tag"] = .str("persistent_id_disabled") + return .dictionary(d) + case .persistentIdUsedByOtherUser: + var d = [String: JSON]() + d[".tag"] = .str("persistent_id_used_by_other_user") + return .dictionary(d) + case .directoryRestrictedOff: + var d = [String: JSON]() + d[".tag"] = .str("directory_restricted_off") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersSetProfileError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersSetProfileError.userNotFound + case "user_not_in_team": + return MembersSetProfileError.userNotInTeam + case "external_id_and_new_external_id_unsafe": + return MembersSetProfileError.externalIdAndNewExternalIdUnsafe + case "no_new_data_specified": + return MembersSetProfileError.noNewDataSpecified + case "email_reserved_for_other_user": + return MembersSetProfileError.emailReservedForOtherUser + case "external_id_used_by_other_user": + return MembersSetProfileError.externalIdUsedByOtherUser + case "set_profile_disallowed": + return MembersSetProfileError.setProfileDisallowed + case "param_cannot_be_empty": + return MembersSetProfileError.paramCannotBeEmpty + case "persistent_id_disabled": + return MembersSetProfileError.persistentIdDisabled + case "persistent_id_used_by_other_user": + return MembersSetProfileError.persistentIdUsedByOtherUser + case "directory_restricted_off": + return MembersSetProfileError.directoryRestrictedOff + case "other": + return MembersSetProfileError.other + default: + return MembersSetProfileError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersSetProfileError.self, json: json) } } } /// The MembersSetProfilePhotoArg struct - open class MembersSetProfilePhotoArg: CustomStringConvertible { + public class MembersSetProfilePhotoArg: CustomStringConvertible, JSONRepresentable { /// Identity of the user whose profile photo will be set. public let user: Team.UserSelectorArg /// Image to set as the member's new profile photo. @@ -8723,33 +10818,44 @@ open class Team { self.user = user self.photo = photo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetProfilePhotoArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersSetProfilePhotoArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetProfilePhotoArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetProfilePhotoArg: \(error)" + } } } - open class MembersSetProfilePhotoArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetProfilePhotoArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "photo": Account.PhotoSourceArgSerializer().serialize(value.photo), + + public class MembersSetProfilePhotoArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetProfilePhotoArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "photo": try Account.PhotoSourceArgSerializer().serialize(value.photo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersSetProfilePhotoArg { + + public func deserialize(_ json: JSON) throws -> MembersSetProfilePhotoArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let photo = Account.PhotoSourceArgSerializer().deserialize(dict["photo"] ?? .null) - return MembersSetProfilePhotoArg(user: user, photo: photo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let photo = try Account.PhotoSourceArgSerializer().deserialize(dict["photo"] ?? .null) + return MembersSetProfilePhotoArg(user: user, photo: photo) + default: + throw JSONSerializerError.deserializeError(type: MembersSetProfilePhotoArg.self, json: json) } } } /// The MembersSetProfilePhotoError union - public enum MembersSetProfilePhotoError: CustomStringConvertible { + public enum MembersSetProfilePhotoError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -8761,63 +10867,73 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MembersSetProfilePhotoErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSetProfilePhotoErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSetProfilePhotoErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSetProfilePhotoError: \(error)" + } } } - open class MembersSetProfilePhotoErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSetProfilePhotoError) -> JSON { + + public class MembersSetProfilePhotoErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSetProfilePhotoError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .setProfileDisallowed: - var d = [String: JSON]() - d[".tag"] = .str("set_profile_disallowed") - return .dictionary(d) - case .photoError(let arg): - var d = ["photo_error": Account.SetProfilePhotoErrorSerializer().serialize(arg)] - d[".tag"] = .str("photo_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersSetProfilePhotoError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersSetProfilePhotoError.userNotFound - case "user_not_in_team": - return MembersSetProfilePhotoError.userNotInTeam - case "set_profile_disallowed": - return MembersSetProfilePhotoError.setProfileDisallowed - case "photo_error": - let v = Account.SetProfilePhotoErrorSerializer().deserialize(d["photo_error"] ?? .null) - return MembersSetProfilePhotoError.photoError(v) - case "other": - return MembersSetProfilePhotoError.other - default: - return MembersSetProfilePhotoError.other - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .setProfileDisallowed: + var d = [String: JSON]() + d[".tag"] = .str("set_profile_disallowed") + return .dictionary(d) + case .photoError(let arg): + var d = try ["photo_error": Account.SetProfilePhotoErrorSerializer().serialize(arg)] + d[".tag"] = .str("photo_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersSetProfilePhotoError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersSetProfilePhotoError.userNotFound + case "user_not_in_team": + return MembersSetProfilePhotoError.userNotInTeam + case "set_profile_disallowed": + return MembersSetProfilePhotoError.setProfileDisallowed + case "photo_error": + let v = try Account.SetProfilePhotoErrorSerializer().deserialize(d["photo_error"] ?? .null) + return MembersSetProfilePhotoError.photoError(v) + case "other": + return MembersSetProfilePhotoError.other + default: + return MembersSetProfilePhotoError.other + } + default: + throw JSONSerializerError.deserializeError(type: MembersSetProfilePhotoError.self, json: json) } } } /// The MembersSuspendError union - public enum MembersSuspendError: CustomStringConvertible { + public enum MembersSuspendError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -8831,68 +10947,78 @@ open class Team { /// Team is full. The organization has no available licenses. case teamLicenseLimit + func json() throws -> JSON { + try MembersSuspendErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersSuspendErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersSuspendErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersSuspendError: \(error)" + } } } - open class MembersSuspendErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersSuspendError) -> JSON { + + public class MembersSuspendErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersSuspendError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .suspendInactiveUser: - var d = [String: JSON]() - d[".tag"] = .str("suspend_inactive_user") - return .dictionary(d) - case .suspendLastAdmin: - var d = [String: JSON]() - d[".tag"] = .str("suspend_last_admin") - return .dictionary(d) - case .teamLicenseLimit: - var d = [String: JSON]() - d[".tag"] = .str("team_license_limit") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersSuspendError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersSuspendError.userNotFound - case "user_not_in_team": - return MembersSuspendError.userNotInTeam - case "other": - return MembersSuspendError.other - case "suspend_inactive_user": - return MembersSuspendError.suspendInactiveUser - case "suspend_last_admin": - return MembersSuspendError.suspendLastAdmin - case "team_license_limit": - return MembersSuspendError.teamLicenseLimit - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .suspendInactiveUser: + var d = [String: JSON]() + d[".tag"] = .str("suspend_inactive_user") + return .dictionary(d) + case .suspendLastAdmin: + var d = [String: JSON]() + d[".tag"] = .str("suspend_last_admin") + return .dictionary(d) + case .teamLicenseLimit: + var d = [String: JSON]() + d[".tag"] = .str("team_license_limit") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersSuspendError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersSuspendError.userNotFound + case "user_not_in_team": + return MembersSuspendError.userNotInTeam + case "other": + return MembersSuspendError.other + case "suspend_inactive_user": + return MembersSuspendError.suspendInactiveUser + case "suspend_last_admin": + return MembersSuspendError.suspendLastAdmin + case "team_license_limit": + return MembersSuspendError.teamLicenseLimit + default: + throw JSONSerializerError.unknownTag(type: MembersSuspendError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersSuspendError.self, json: json) } } } /// The MembersTransferFormerMembersFilesError union - public enum MembersTransferFormerMembersFilesError: CustomStringConvertible { + public enum MembersTransferFormerMembersFilesError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -8926,158 +11052,179 @@ open class Team { /// User's data has already been transferred to another user. case userDataAlreadyTransferred + func json() throws -> JSON { + try MembersTransferFormerMembersFilesErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersTransferFormerMembersFilesErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersTransferFormerMembersFilesErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersTransferFormerMembersFilesError: \(error)" + } } } - open class MembersTransferFormerMembersFilesErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersTransferFormerMembersFilesError) -> JSON { + + public class MembersTransferFormerMembersFilesErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersTransferFormerMembersFilesError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .removedAndTransferDestShouldDiffer: - var d = [String: JSON]() - d[".tag"] = .str("removed_and_transfer_dest_should_differ") - return .dictionary(d) - case .removedAndTransferAdminShouldDiffer: - var d = [String: JSON]() - d[".tag"] = .str("removed_and_transfer_admin_should_differ") - return .dictionary(d) - case .transferDestUserNotFound: - var d = [String: JSON]() - d[".tag"] = .str("transfer_dest_user_not_found") - return .dictionary(d) - case .transferDestUserNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("transfer_dest_user_not_in_team") - return .dictionary(d) - case .transferAdminUserNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_user_not_in_team") - return .dictionary(d) - case .transferAdminUserNotFound: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_user_not_found") - return .dictionary(d) - case .unspecifiedTransferAdminId: - var d = [String: JSON]() - d[".tag"] = .str("unspecified_transfer_admin_id") - return .dictionary(d) - case .transferAdminIsNotAdmin: - var d = [String: JSON]() - d[".tag"] = .str("transfer_admin_is_not_admin") - return .dictionary(d) - case .recipientNotVerified: - var d = [String: JSON]() - d[".tag"] = .str("recipient_not_verified") - return .dictionary(d) - case .userDataIsBeingTransferred: - var d = [String: JSON]() - d[".tag"] = .str("user_data_is_being_transferred") - return .dictionary(d) - case .userNotRemoved: - var d = [String: JSON]() - d[".tag"] = .str("user_not_removed") - return .dictionary(d) - case .userDataCannotBeTransferred: - var d = [String: JSON]() - d[".tag"] = .str("user_data_cannot_be_transferred") - return .dictionary(d) - case .userDataAlreadyTransferred: - var d = [String: JSON]() - d[".tag"] = .str("user_data_already_transferred") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersTransferFormerMembersFilesError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersTransferFormerMembersFilesError.userNotFound - case "user_not_in_team": - return MembersTransferFormerMembersFilesError.userNotInTeam - case "other": - return MembersTransferFormerMembersFilesError.other - case "removed_and_transfer_dest_should_differ": - return MembersTransferFormerMembersFilesError.removedAndTransferDestShouldDiffer - case "removed_and_transfer_admin_should_differ": - return MembersTransferFormerMembersFilesError.removedAndTransferAdminShouldDiffer - case "transfer_dest_user_not_found": - return MembersTransferFormerMembersFilesError.transferDestUserNotFound - case "transfer_dest_user_not_in_team": - return MembersTransferFormerMembersFilesError.transferDestUserNotInTeam - case "transfer_admin_user_not_in_team": - return MembersTransferFormerMembersFilesError.transferAdminUserNotInTeam - case "transfer_admin_user_not_found": - return MembersTransferFormerMembersFilesError.transferAdminUserNotFound - case "unspecified_transfer_admin_id": - return MembersTransferFormerMembersFilesError.unspecifiedTransferAdminId - case "transfer_admin_is_not_admin": - return MembersTransferFormerMembersFilesError.transferAdminIsNotAdmin - case "recipient_not_verified": - return MembersTransferFormerMembersFilesError.recipientNotVerified - case "user_data_is_being_transferred": - return MembersTransferFormerMembersFilesError.userDataIsBeingTransferred - case "user_not_removed": - return MembersTransferFormerMembersFilesError.userNotRemoved - case "user_data_cannot_be_transferred": - return MembersTransferFormerMembersFilesError.userDataCannotBeTransferred - case "user_data_already_transferred": - return MembersTransferFormerMembersFilesError.userDataAlreadyTransferred - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .removedAndTransferDestShouldDiffer: + var d = [String: JSON]() + d[".tag"] = .str("removed_and_transfer_dest_should_differ") + return .dictionary(d) + case .removedAndTransferAdminShouldDiffer: + var d = [String: JSON]() + d[".tag"] = .str("removed_and_transfer_admin_should_differ") + return .dictionary(d) + case .transferDestUserNotFound: + var d = [String: JSON]() + d[".tag"] = .str("transfer_dest_user_not_found") + return .dictionary(d) + case .transferDestUserNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("transfer_dest_user_not_in_team") + return .dictionary(d) + case .transferAdminUserNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_user_not_in_team") + return .dictionary(d) + case .transferAdminUserNotFound: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_user_not_found") + return .dictionary(d) + case .unspecifiedTransferAdminId: + var d = [String: JSON]() + d[".tag"] = .str("unspecified_transfer_admin_id") + return .dictionary(d) + case .transferAdminIsNotAdmin: + var d = [String: JSON]() + d[".tag"] = .str("transfer_admin_is_not_admin") + return .dictionary(d) + case .recipientNotVerified: + var d = [String: JSON]() + d[".tag"] = .str("recipient_not_verified") + return .dictionary(d) + case .userDataIsBeingTransferred: + var d = [String: JSON]() + d[".tag"] = .str("user_data_is_being_transferred") + return .dictionary(d) + case .userNotRemoved: + var d = [String: JSON]() + d[".tag"] = .str("user_not_removed") + return .dictionary(d) + case .userDataCannotBeTransferred: + var d = [String: JSON]() + d[".tag"] = .str("user_data_cannot_be_transferred") + return .dictionary(d) + case .userDataAlreadyTransferred: + var d = [String: JSON]() + d[".tag"] = .str("user_data_already_transferred") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersTransferFormerMembersFilesError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersTransferFormerMembersFilesError.userNotFound + case "user_not_in_team": + return MembersTransferFormerMembersFilesError.userNotInTeam + case "other": + return MembersTransferFormerMembersFilesError.other + case "removed_and_transfer_dest_should_differ": + return MembersTransferFormerMembersFilesError.removedAndTransferDestShouldDiffer + case "removed_and_transfer_admin_should_differ": + return MembersTransferFormerMembersFilesError.removedAndTransferAdminShouldDiffer + case "transfer_dest_user_not_found": + return MembersTransferFormerMembersFilesError.transferDestUserNotFound + case "transfer_dest_user_not_in_team": + return MembersTransferFormerMembersFilesError.transferDestUserNotInTeam + case "transfer_admin_user_not_in_team": + return MembersTransferFormerMembersFilesError.transferAdminUserNotInTeam + case "transfer_admin_user_not_found": + return MembersTransferFormerMembersFilesError.transferAdminUserNotFound + case "unspecified_transfer_admin_id": + return MembersTransferFormerMembersFilesError.unspecifiedTransferAdminId + case "transfer_admin_is_not_admin": + return MembersTransferFormerMembersFilesError.transferAdminIsNotAdmin + case "recipient_not_verified": + return MembersTransferFormerMembersFilesError.recipientNotVerified + case "user_data_is_being_transferred": + return MembersTransferFormerMembersFilesError.userDataIsBeingTransferred + case "user_not_removed": + return MembersTransferFormerMembersFilesError.userNotRemoved + case "user_data_cannot_be_transferred": + return MembersTransferFormerMembersFilesError.userDataCannotBeTransferred + case "user_data_already_transferred": + return MembersTransferFormerMembersFilesError.userDataAlreadyTransferred + default: + throw JSONSerializerError.unknownTag(type: MembersTransferFormerMembersFilesError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersTransferFormerMembersFilesError.self, json: json) } } } /// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. - open class MembersUnsuspendArg: CustomStringConvertible { + public class MembersUnsuspendArg: CustomStringConvertible, JSONRepresentable { /// Identity of user to unsuspend. public let user: Team.UserSelectorArg public init(user: Team.UserSelectorArg) { self.user = user } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersUnsuspendArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try MembersUnsuspendArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersUnsuspendArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersUnsuspendArg: \(error)" + } } } - open class MembersUnsuspendArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersUnsuspendArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), + + public class MembersUnsuspendArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersUnsuspendArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MembersUnsuspendArg { + + public func deserialize(_ json: JSON) throws -> MembersUnsuspendArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - return MembersUnsuspendArg(user: user) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + return MembersUnsuspendArg(user: user) + default: + throw JSONSerializerError.deserializeError(type: MembersUnsuspendArg.self, json: json) } } } /// The MembersUnsuspendError union - public enum MembersUnsuspendError: CustomStringConvertible { + public enum MembersUnsuspendError: CustomStringConvertible, JSONRepresentable { /// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. case userNotFound /// The user is not a member of the team. @@ -9089,62 +11236,72 @@ open class Team { /// Team is full. The organization has no available licenses. case teamLicenseLimit + func json() throws -> JSON { + try MembersUnsuspendErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MembersUnsuspendErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MembersUnsuspendErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MembersUnsuspendError: \(error)" + } } } - open class MembersUnsuspendErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MembersUnsuspendError) -> JSON { + + public class MembersUnsuspendErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MembersUnsuspendError) throws -> JSON { switch value { - case .userNotFound: - var d = [String: JSON]() - d[".tag"] = .str("user_not_found") - return .dictionary(d) - case .userNotInTeam: - var d = [String: JSON]() - d[".tag"] = .str("user_not_in_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .unsuspendNonSuspendedMember: - var d = [String: JSON]() - d[".tag"] = .str("unsuspend_non_suspended_member") - return .dictionary(d) - case .teamLicenseLimit: - var d = [String: JSON]() - d[".tag"] = .str("team_license_limit") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MembersUnsuspendError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_not_found": - return MembersUnsuspendError.userNotFound - case "user_not_in_team": - return MembersUnsuspendError.userNotInTeam - case "other": - return MembersUnsuspendError.other - case "unsuspend_non_suspended_member": - return MembersUnsuspendError.unsuspendNonSuspendedMember - case "team_license_limit": - return MembersUnsuspendError.teamLicenseLimit - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .userNotFound: + var d = [String: JSON]() + d[".tag"] = .str("user_not_found") + return .dictionary(d) + case .userNotInTeam: + var d = [String: JSON]() + d[".tag"] = .str("user_not_in_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .unsuspendNonSuspendedMember: + var d = [String: JSON]() + d[".tag"] = .str("unsuspend_non_suspended_member") + return .dictionary(d) + case .teamLicenseLimit: + var d = [String: JSON]() + d[".tag"] = .str("team_license_limit") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MembersUnsuspendError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_not_found": + return MembersUnsuspendError.userNotFound + case "user_not_in_team": + return MembersUnsuspendError.userNotInTeam + case "other": + return MembersUnsuspendError.other + case "unsuspend_non_suspended_member": + return MembersUnsuspendError.unsuspendNonSuspendedMember + case "team_license_limit": + return MembersUnsuspendError.teamLicenseLimit + default: + throw JSONSerializerError.unknownTag(type: MembersUnsuspendError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: MembersUnsuspendError.self, json: json) } } } /// The MobileClientPlatform union - public enum MobileClientPlatform: CustomStringConvertible { + public enum MobileClientPlatform: CustomStringConvertible, JSONRepresentable { /// Official Dropbox iPhone client. case iphone /// Official Dropbox iPad client. @@ -9158,68 +11315,78 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try MobileClientPlatformSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MobileClientPlatformSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MobileClientPlatformSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MobileClientPlatform: \(error)" + } } } - open class MobileClientPlatformSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MobileClientPlatform) -> JSON { + + public class MobileClientPlatformSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MobileClientPlatform) throws -> JSON { switch value { - case .iphone: - var d = [String: JSON]() - d[".tag"] = .str("iphone") - return .dictionary(d) - case .ipad: - var d = [String: JSON]() - d[".tag"] = .str("ipad") - return .dictionary(d) - case .android: - var d = [String: JSON]() - d[".tag"] = .str("android") - return .dictionary(d) - case .windowsPhone: - var d = [String: JSON]() - d[".tag"] = .str("windows_phone") - return .dictionary(d) - case .blackberry: - var d = [String: JSON]() - d[".tag"] = .str("blackberry") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MobileClientPlatform { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "iphone": - return MobileClientPlatform.iphone - case "ipad": - return MobileClientPlatform.ipad - case "android": - return MobileClientPlatform.android - case "windows_phone": - return MobileClientPlatform.windowsPhone - case "blackberry": - return MobileClientPlatform.blackberry - case "other": - return MobileClientPlatform.other - default: - return MobileClientPlatform.other - } - default: - fatalError("Failed to deserialize") + case .iphone: + var d = [String: JSON]() + d[".tag"] = .str("iphone") + return .dictionary(d) + case .ipad: + var d = [String: JSON]() + d[".tag"] = .str("ipad") + return .dictionary(d) + case .android: + var d = [String: JSON]() + d[".tag"] = .str("android") + return .dictionary(d) + case .windowsPhone: + var d = [String: JSON]() + d[".tag"] = .str("windows_phone") + return .dictionary(d) + case .blackberry: + var d = [String: JSON]() + d[".tag"] = .str("blackberry") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MobileClientPlatform { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "iphone": + return MobileClientPlatform.iphone + case "ipad": + return MobileClientPlatform.ipad + case "android": + return MobileClientPlatform.android + case "windows_phone": + return MobileClientPlatform.windowsPhone + case "blackberry": + return MobileClientPlatform.blackberry + case "other": + return MobileClientPlatform.other + default: + return MobileClientPlatform.other + } + default: + throw JSONSerializerError.deserializeError(type: MobileClientPlatform.self, json: json) } } } /// Information about linked Dropbox mobile client sessions. - open class MobileClientSession: Team.DeviceSession { + public class MobileClientSession: Team.DeviceSession { /// The device name. public let deviceName: String /// The mobile application type. @@ -9230,7 +11397,18 @@ open class Team { public let osVersion: String? /// last carrier used by the device. public let lastCarrier: String? - public init(sessionId: String, deviceName: String, clientType: Team.MobileClientPlatform, ipAddress: String? = nil, country: String? = nil, created: Date? = nil, updated: Date? = nil, clientVersion: String? = nil, osVersion: String? = nil, lastCarrier: String? = nil) { + public init( + sessionId: String, + deviceName: String, + clientType: Team.MobileClientPlatform, + ipAddress: String? = nil, + country: String? = nil, + created: Date? = nil, + updated: Date? = nil, + clientVersion: String? = nil, + osVersion: String? = nil, + lastCarrier: String? = nil + ) { stringValidator()(deviceName) self.deviceName = deviceName self.clientType = clientType @@ -9242,49 +11420,67 @@ open class Team { self.lastCarrier = lastCarrier super.init(sessionId: sessionId, ipAddress: ipAddress, country: country, created: created, updated: updated) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MobileClientSessionSerializer().serialize(self)))" - } - } - open class MobileClientSessionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MobileClientSession) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), - "device_name": Serialization._StringSerializer.serialize(value.deviceName), - "client_type": Team.MobileClientPlatformSerializer().serialize(value.clientType), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "country": NullableSerializer(Serialization._StringSerializer).serialize(value.country), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), - "client_version": NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), - "os_version": NullableSerializer(Serialization._StringSerializer).serialize(value.osVersion), - "last_carrier": NullableSerializer(Serialization._StringSerializer).serialize(value.lastCarrier), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> MobileClientSession { - switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - let deviceName = Serialization._StringSerializer.deserialize(dict["device_name"] ?? .null) - let clientType = Team.MobileClientPlatformSerializer().deserialize(dict["client_type"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let country = NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - let clientVersion = NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) - let osVersion = NullableSerializer(Serialization._StringSerializer).deserialize(dict["os_version"] ?? .null) - let lastCarrier = NullableSerializer(Serialization._StringSerializer).deserialize(dict["last_carrier"] ?? .null) - return MobileClientSession(sessionId: sessionId, deviceName: deviceName, clientType: clientType, ipAddress: ipAddress, country: country, created: created, updated: updated, clientVersion: clientVersion, osVersion: osVersion, lastCarrier: lastCarrier) - default: - fatalError("Type error deserializing") + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MobileClientSessionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MobileClientSession: \(error)" + } + } + } + + public class MobileClientSessionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MobileClientSession) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), + "device_name": try Serialization._StringSerializer.serialize(value.deviceName), + "client_type": try Team.MobileClientPlatformSerializer().serialize(value.clientType), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "country": try NullableSerializer(Serialization._StringSerializer).serialize(value.country), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + "client_version": try NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), + "os_version": try NullableSerializer(Serialization._StringSerializer).serialize(value.osVersion), + "last_carrier": try NullableSerializer(Serialization._StringSerializer).serialize(value.lastCarrier), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> MobileClientSession { + switch json { + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + let deviceName = try Serialization._StringSerializer.deserialize(dict["device_name"] ?? .null) + let clientType = try Team.MobileClientPlatformSerializer().deserialize(dict["client_type"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let country = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + let clientVersion = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) + let osVersion = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["os_version"] ?? .null) + let lastCarrier = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["last_carrier"] ?? .null) + return MobileClientSession( + sessionId: sessionId, + deviceName: deviceName, + clientType: clientType, + ipAddress: ipAddress, + country: country, + created: created, + updated: updated, + clientVersion: clientVersion, + osVersion: osVersion, + lastCarrier: lastCarrier + ) + default: + throw JSONSerializerError.deserializeError(type: MobileClientSession.self, json: json) } } } /// Properties of a namespace. - open class NamespaceMetadata: CustomStringConvertible { + public class NamespaceMetadata: CustomStringConvertible, JSONRepresentable { /// The name of this namespace. public let name: String /// The ID of this namespace. @@ -9303,37 +11499,48 @@ open class Team { nullableValidator(stringValidator())(teamMemberId) self.teamMemberId = teamMemberId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NamespaceMetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try NamespaceMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NamespaceMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NamespaceMetadata: \(error)" + } } } - open class NamespaceMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NamespaceMetadata) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "namespace_id": Serialization._StringSerializer.serialize(value.namespaceId), - "namespace_type": Team.NamespaceTypeSerializer().serialize(value.namespaceType), - "team_member_id": NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), + + public class NamespaceMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NamespaceMetadata) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "namespace_id": try Serialization._StringSerializer.serialize(value.namespaceId), + "namespace_type": try Team.NamespaceTypeSerializer().serialize(value.namespaceType), + "team_member_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NamespaceMetadata { + + public func deserialize(_ json: JSON) throws -> NamespaceMetadata { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let namespaceId = Serialization._StringSerializer.deserialize(dict["namespace_id"] ?? .null) - let namespaceType = Team.NamespaceTypeSerializer().deserialize(dict["namespace_type"] ?? .null) - let teamMemberId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) - return NamespaceMetadata(name: name, namespaceId: namespaceId, namespaceType: namespaceType, teamMemberId: teamMemberId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let namespaceId = try Serialization._StringSerializer.deserialize(dict["namespace_id"] ?? .null) + let namespaceType = try Team.NamespaceTypeSerializer().deserialize(dict["namespace_type"] ?? .null) + let teamMemberId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) + return NamespaceMetadata(name: name, namespaceId: namespaceId, namespaceType: namespaceType, teamMemberId: teamMemberId) + default: + throw JSONSerializerError.deserializeError(type: NamespaceMetadata.self, json: json) } } } /// The NamespaceType union - public enum NamespaceType: CustomStringConvertible { + public enum NamespaceType: CustomStringConvertible, JSONRepresentable { /// App sandbox folder. case appFolder /// Shared folder. @@ -9345,62 +11552,72 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try NamespaceTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NamespaceTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NamespaceTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NamespaceType: \(error)" + } } } - open class NamespaceTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NamespaceType) -> JSON { + + public class NamespaceTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NamespaceType) throws -> JSON { switch value { - case .appFolder: - var d = [String: JSON]() - d[".tag"] = .str("app_folder") - return .dictionary(d) - case .sharedFolder: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder") - return .dictionary(d) - case .teamFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_folder") - return .dictionary(d) - case .teamMemberFolder: - var d = [String: JSON]() - d[".tag"] = .str("team_member_folder") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> NamespaceType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "app_folder": - return NamespaceType.appFolder - case "shared_folder": - return NamespaceType.sharedFolder - case "team_folder": - return NamespaceType.teamFolder - case "team_member_folder": - return NamespaceType.teamMemberFolder - case "other": - return NamespaceType.other - default: - return NamespaceType.other - } - default: - fatalError("Failed to deserialize") + case .appFolder: + var d = [String: JSON]() + d[".tag"] = .str("app_folder") + return .dictionary(d) + case .sharedFolder: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder") + return .dictionary(d) + case .teamFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_folder") + return .dictionary(d) + case .teamMemberFolder: + var d = [String: JSON]() + d[".tag"] = .str("team_member_folder") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> NamespaceType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "app_folder": + return NamespaceType.appFolder + case "shared_folder": + return NamespaceType.sharedFolder + case "team_folder": + return NamespaceType.teamFolder + case "team_member_folder": + return NamespaceType.teamMemberFolder + case "other": + return NamespaceType.other + default: + return NamespaceType.other + } + default: + throw JSONSerializerError.deserializeError(type: NamespaceType.self, json: json) } } } /// User result for setting member custom quota. - public enum RemoveCustomQuotaResult: CustomStringConvertible { + public enum RemoveCustomQuotaResult: CustomStringConvertible, JSONRepresentable { /// Successfully removed user. case success(Team.UserSelectorArg) /// Invalid user (not in team). @@ -9408,52 +11625,62 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try RemoveCustomQuotaResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemoveCustomQuotaResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemoveCustomQuotaResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemoveCustomQuotaResult: \(error)" + } } } - open class RemoveCustomQuotaResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemoveCustomQuotaResult) -> JSON { + + public class RemoveCustomQuotaResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemoveCustomQuotaResult) throws -> JSON { switch value { - case .success(let arg): - var d = ["success": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("success") - return .dictionary(d) - case .invalidUser(let arg): - var d = ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("invalid_user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RemoveCustomQuotaResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Team.UserSelectorArgSerializer().deserialize(d["success"] ?? .null) - return RemoveCustomQuotaResult.success(v) - case "invalid_user": - let v = Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) - return RemoveCustomQuotaResult.invalidUser(v) - case "other": - return RemoveCustomQuotaResult.other - default: - return RemoveCustomQuotaResult.other - } + case .success(let arg): + var d = try ["success": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("success") + return .dictionary(d) + case .invalidUser(let arg): + var d = try ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("invalid_user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RemoveCustomQuotaResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Team.UserSelectorArgSerializer().deserialize(d["success"] ?? .null) + return RemoveCustomQuotaResult.success(v) + case "invalid_user": + let v = try Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) + return RemoveCustomQuotaResult.invalidUser(v) + case "other": + return RemoveCustomQuotaResult.other default: - fatalError("Failed to deserialize") + return RemoveCustomQuotaResult.other + } + default: + throw JSONSerializerError.deserializeError(type: RemoveCustomQuotaResult.self, json: json) } } } /// The RemovedStatus struct - open class RemovedStatus: CustomStringConvertible { + public class RemovedStatus: CustomStringConvertible, JSONRepresentable { /// True if the removed team member is recoverable. public let isRecoverable: Bool /// True if the team member's account was converted to individual account. @@ -9462,27 +11689,38 @@ open class Team { self.isRecoverable = isRecoverable self.isDisconnected = isDisconnected } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RemovedStatusSerializer().serialize(self)))" + + func json() throws -> JSON { + try RemovedStatusSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RemovedStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RemovedStatus: \(error)" + } } } - open class RemovedStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RemovedStatus) -> JSON { - let output = [ - "is_recoverable": Serialization._BoolSerializer.serialize(value.isRecoverable), - "is_disconnected": Serialization._BoolSerializer.serialize(value.isDisconnected), + + public class RemovedStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RemovedStatus) throws -> JSON { + let output = [ + "is_recoverable": try Serialization._BoolSerializer.serialize(value.isRecoverable), + "is_disconnected": try Serialization._BoolSerializer.serialize(value.isDisconnected), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RemovedStatus { + + public func deserialize(_ json: JSON) throws -> RemovedStatus { switch json { - case .dictionary(let dict): - let isRecoverable = Serialization._BoolSerializer.deserialize(dict["is_recoverable"] ?? .null) - let isDisconnected = Serialization._BoolSerializer.deserialize(dict["is_disconnected"] ?? .null) - return RemovedStatus(isRecoverable: isRecoverable, isDisconnected: isDisconnected) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isRecoverable = try Serialization._BoolSerializer.deserialize(dict["is_recoverable"] ?? .null) + let isDisconnected = try Serialization._BoolSerializer.deserialize(dict["is_disconnected"] ?? .null) + return RemovedStatus(isRecoverable: isRecoverable, isDisconnected: isDisconnected) + default: + throw JSONSerializerError.deserializeError(type: RemovedStatus.self, json: json) } } } @@ -9490,7 +11728,7 @@ open class Team { /// Result of trying to resend verification email to a secondary email address. 'success' is the only value /// indicating that a verification email was successfully sent. The other values explain the type of error that /// occurred, and include the email for which the error occurred. - public enum ResendSecondaryEmailResult: CustomStringConvertible { + public enum ResendSecondaryEmailResult: CustomStringConvertible, JSONRepresentable { /// A verification email was successfully sent to the secondary email address. case success(String) /// This secondary email address is not pending for the user. @@ -9500,119 +11738,151 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try ResendSecondaryEmailResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResendSecondaryEmailResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResendSecondaryEmailResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResendSecondaryEmailResult: \(error)" + } } } - open class ResendSecondaryEmailResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResendSecondaryEmailResult) -> JSON { + + public class ResendSecondaryEmailResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResendSecondaryEmailResult) throws -> JSON { switch value { - case .success(let arg): - var d = ["success": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("success") - return .dictionary(d) - case .notPending(let arg): - var d = ["not_pending": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("not_pending") - return .dictionary(d) - case .rateLimited(let arg): - var d = ["rate_limited": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("rate_limited") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ResendSecondaryEmailResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Serialization._StringSerializer.deserialize(d["success"] ?? .null) - return ResendSecondaryEmailResult.success(v) - case "not_pending": - let v = Serialization._StringSerializer.deserialize(d["not_pending"] ?? .null) - return ResendSecondaryEmailResult.notPending(v) - case "rate_limited": - let v = Serialization._StringSerializer.deserialize(d["rate_limited"] ?? .null) - return ResendSecondaryEmailResult.rateLimited(v) - case "other": - return ResendSecondaryEmailResult.other - default: - return ResendSecondaryEmailResult.other - } - default: - fatalError("Failed to deserialize") + case .success(let arg): + var d = try ["success": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("success") + return .dictionary(d) + case .notPending(let arg): + var d = try ["not_pending": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("not_pending") + return .dictionary(d) + case .rateLimited(let arg): + var d = try ["rate_limited": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("rate_limited") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ResendSecondaryEmailResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Serialization._StringSerializer.deserialize(d["success"] ?? .null) + return ResendSecondaryEmailResult.success(v) + case "not_pending": + let v = try Serialization._StringSerializer.deserialize(d["not_pending"] ?? .null) + return ResendSecondaryEmailResult.notPending(v) + case "rate_limited": + let v = try Serialization._StringSerializer.deserialize(d["rate_limited"] ?? .null) + return ResendSecondaryEmailResult.rateLimited(v) + case "other": + return ResendSecondaryEmailResult.other + default: + return ResendSecondaryEmailResult.other + } + default: + throw JSONSerializerError.deserializeError(type: ResendSecondaryEmailResult.self, json: json) } } } /// The ResendVerificationEmailArg struct - open class ResendVerificationEmailArg: CustomStringConvertible { + public class ResendVerificationEmailArg: CustomStringConvertible, JSONRepresentable { /// List of users and secondary emails to resend verification emails to. - public let emailsToResend: Array - public init(emailsToResend: Array) { + public let emailsToResend: [Team.UserSecondaryEmailsArg] + public init(emailsToResend: [Team.UserSecondaryEmailsArg]) { self.emailsToResend = emailsToResend } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResendVerificationEmailArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try ResendVerificationEmailArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResendVerificationEmailArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResendVerificationEmailArg: \(error)" + } } } - open class ResendVerificationEmailArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResendVerificationEmailArg) -> JSON { - let output = [ - "emails_to_resend": ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).serialize(value.emailsToResend), + + public class ResendVerificationEmailArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResendVerificationEmailArg) throws -> JSON { + let output = [ + "emails_to_resend": try ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).serialize(value.emailsToResend), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResendVerificationEmailArg { + + public func deserialize(_ json: JSON) throws -> ResendVerificationEmailArg { switch json { - case .dictionary(let dict): - let emailsToResend = ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).deserialize(dict["emails_to_resend"] ?? .null) - return ResendVerificationEmailArg(emailsToResend: emailsToResend) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let emailsToResend = try ArraySerializer(Team.UserSecondaryEmailsArgSerializer()).deserialize(dict["emails_to_resend"] ?? .null) + return ResendVerificationEmailArg(emailsToResend: emailsToResend) + default: + throw JSONSerializerError.deserializeError(type: ResendVerificationEmailArg.self, json: json) } } } /// List of users and resend results. - open class ResendVerificationEmailResult: CustomStringConvertible { + public class ResendVerificationEmailResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let results: Array - public init(results: Array) { + public let results: [Team.UserResendResult] + public init(results: [Team.UserResendResult]) { self.results = results } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResendVerificationEmailResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try ResendVerificationEmailResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResendVerificationEmailResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResendVerificationEmailResult: \(error)" + } } } - open class ResendVerificationEmailResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResendVerificationEmailResult) -> JSON { - let output = [ - "results": ArraySerializer(Team.UserResendResultSerializer()).serialize(value.results), + + public class ResendVerificationEmailResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResendVerificationEmailResult) throws -> JSON { + let output = [ + "results": try ArraySerializer(Team.UserResendResultSerializer()).serialize(value.results), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResendVerificationEmailResult { + + public func deserialize(_ json: JSON) throws -> ResendVerificationEmailResult { switch json { - case .dictionary(let dict): - let results = ArraySerializer(Team.UserResendResultSerializer()).deserialize(dict["results"] ?? .null) - return ResendVerificationEmailResult(results: results) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let results = try ArraySerializer(Team.UserResendResultSerializer()).deserialize(dict["results"] ?? .null) + return ResendVerificationEmailResult(results: results) + default: + throw JSONSerializerError.deserializeError(type: ResendVerificationEmailResult.self, json: json) } } } /// The RevokeDesktopClientArg struct - open class RevokeDesktopClientArg: Team.DeviceSessionArg { + public class RevokeDesktopClientArg: Team.DeviceSessionArg { /// Whether to delete all files of the account (this is possible only if supported by the desktop client and /// will be made the next time the client access the account). public let deleteOnUnlink: Bool @@ -9620,35 +11890,42 @@ open class Team { self.deleteOnUnlink = deleteOnUnlink super.init(sessionId: sessionId, teamMemberId: teamMemberId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeDesktopClientArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeDesktopClientArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeDesktopClientArg: \(error)" + } } } - open class RevokeDesktopClientArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeDesktopClientArg) -> JSON { - let output = [ - "session_id": Serialization._StringSerializer.serialize(value.sessionId), - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "delete_on_unlink": Serialization._BoolSerializer.serialize(value.deleteOnUnlink), + + public class RevokeDesktopClientArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeDesktopClientArg) throws -> JSON { + let output = [ + "session_id": try Serialization._StringSerializer.serialize(value.sessionId), + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "delete_on_unlink": try Serialization._BoolSerializer.serialize(value.deleteOnUnlink), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeDesktopClientArg { + + public func deserialize(_ json: JSON) throws -> RevokeDesktopClientArg { switch json { - case .dictionary(let dict): - let sessionId = Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let deleteOnUnlink = Serialization._BoolSerializer.deserialize(dict["delete_on_unlink"] ?? .number(0)) - return RevokeDesktopClientArg(sessionId: sessionId, teamMemberId: teamMemberId, deleteOnUnlink: deleteOnUnlink) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try Serialization._StringSerializer.deserialize(dict["session_id"] ?? .null) + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let deleteOnUnlink = try Serialization._BoolSerializer.deserialize(dict["delete_on_unlink"] ?? .number(0)) + return RevokeDesktopClientArg(sessionId: sessionId, teamMemberId: teamMemberId, deleteOnUnlink: deleteOnUnlink) + default: + throw JSONSerializerError.deserializeError(type: RevokeDesktopClientArg.self, json: json) } } } /// The RevokeDeviceSessionArg union - public enum RevokeDeviceSessionArg: CustomStringConvertible { + public enum RevokeDeviceSessionArg: CustomStringConvertible, JSONRepresentable { /// End an active session. case webSession(Team.DeviceSessionArg) /// Unlink a linked desktop device. @@ -9656,148 +11933,191 @@ open class Team { /// Unlink a linked mobile device. case mobileClient(Team.DeviceSessionArg) + func json() throws -> JSON { + try RevokeDeviceSessionArgSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeDeviceSessionArgSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeDeviceSessionArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeDeviceSessionArg: \(error)" + } } } - open class RevokeDeviceSessionArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeDeviceSessionArg) -> JSON { + + public class RevokeDeviceSessionArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeDeviceSessionArg) throws -> JSON { switch value { - case .webSession(let arg): - var d = Serialization.getFields(Team.DeviceSessionArgSerializer().serialize(arg)) - d[".tag"] = .str("web_session") - return .dictionary(d) - case .desktopClient(let arg): - var d = Serialization.getFields(Team.RevokeDesktopClientArgSerializer().serialize(arg)) - d[".tag"] = .str("desktop_client") - return .dictionary(d) - case .mobileClient(let arg): - var d = Serialization.getFields(Team.DeviceSessionArgSerializer().serialize(arg)) - d[".tag"] = .str("mobile_client") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RevokeDeviceSessionArg { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "web_session": - let v = Team.DeviceSessionArgSerializer().deserialize(json) - return RevokeDeviceSessionArg.webSession(v) - case "desktop_client": - let v = Team.RevokeDesktopClientArgSerializer().deserialize(json) - return RevokeDeviceSessionArg.desktopClient(v) - case "mobile_client": - let v = Team.DeviceSessionArgSerializer().deserialize(json) - return RevokeDeviceSessionArg.mobileClient(v) - default: - fatalError("Unknown tag \(tag)") - } + case .webSession(let arg): + var d = try Serialization.getFields(Team.DeviceSessionArgSerializer().serialize(arg)) + d[".tag"] = .str("web_session") + return .dictionary(d) + case .desktopClient(let arg): + var d = try Serialization.getFields(Team.RevokeDesktopClientArgSerializer().serialize(arg)) + d[".tag"] = .str("desktop_client") + return .dictionary(d) + case .mobileClient(let arg): + var d = try Serialization.getFields(Team.DeviceSessionArgSerializer().serialize(arg)) + d[".tag"] = .str("mobile_client") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RevokeDeviceSessionArg { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "web_session": + let v = try Team.DeviceSessionArgSerializer().deserialize(json) + return RevokeDeviceSessionArg.webSession(v) + case "desktop_client": + let v = try Team.RevokeDesktopClientArgSerializer().deserialize(json) + return RevokeDeviceSessionArg.desktopClient(v) + case "mobile_client": + let v = try Team.DeviceSessionArgSerializer().deserialize(json) + return RevokeDeviceSessionArg.mobileClient(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RevokeDeviceSessionArg.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RevokeDeviceSessionArg.self, json: json) } } } /// The RevokeDeviceSessionBatchArg struct - open class RevokeDeviceSessionBatchArg: CustomStringConvertible { + public class RevokeDeviceSessionBatchArg: CustomStringConvertible, JSONRepresentable { /// (no description) - public let revokeDevices: Array - public init(revokeDevices: Array) { + public let revokeDevices: [Team.RevokeDeviceSessionArg] + public init(revokeDevices: [Team.RevokeDeviceSessionArg]) { self.revokeDevices = revokeDevices } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeDeviceSessionBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeDeviceSessionBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeDeviceSessionBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeDeviceSessionBatchArg: \(error)" + } } } - open class RevokeDeviceSessionBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeDeviceSessionBatchArg) -> JSON { - let output = [ - "revoke_devices": ArraySerializer(Team.RevokeDeviceSessionArgSerializer()).serialize(value.revokeDevices), + + public class RevokeDeviceSessionBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeDeviceSessionBatchArg) throws -> JSON { + let output = [ + "revoke_devices": try ArraySerializer(Team.RevokeDeviceSessionArgSerializer()).serialize(value.revokeDevices), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeDeviceSessionBatchArg { + + public func deserialize(_ json: JSON) throws -> RevokeDeviceSessionBatchArg { switch json { - case .dictionary(let dict): - let revokeDevices = ArraySerializer(Team.RevokeDeviceSessionArgSerializer()).deserialize(dict["revoke_devices"] ?? .null) - return RevokeDeviceSessionBatchArg(revokeDevices: revokeDevices) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let revokeDevices = try ArraySerializer(Team.RevokeDeviceSessionArgSerializer()).deserialize(dict["revoke_devices"] ?? .null) + return RevokeDeviceSessionBatchArg(revokeDevices: revokeDevices) + default: + throw JSONSerializerError.deserializeError(type: RevokeDeviceSessionBatchArg.self, json: json) } } } /// The RevokeDeviceSessionBatchError union - public enum RevokeDeviceSessionBatchError: CustomStringConvertible { + public enum RevokeDeviceSessionBatchError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case other + func json() throws -> JSON { + try RevokeDeviceSessionBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeDeviceSessionBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeDeviceSessionBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeDeviceSessionBatchError: \(error)" + } } } - open class RevokeDeviceSessionBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeDeviceSessionBatchError) -> JSON { + + public class RevokeDeviceSessionBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeDeviceSessionBatchError) throws -> JSON { switch value { - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RevokeDeviceSessionBatchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "other": - return RevokeDeviceSessionBatchError.other - default: - return RevokeDeviceSessionBatchError.other - } + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RevokeDeviceSessionBatchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "other": + return RevokeDeviceSessionBatchError.other default: - fatalError("Failed to deserialize") + return RevokeDeviceSessionBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: RevokeDeviceSessionBatchError.self, json: json) } } } /// The RevokeDeviceSessionBatchResult struct - open class RevokeDeviceSessionBatchResult: CustomStringConvertible { + public class RevokeDeviceSessionBatchResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let revokeDevicesStatus: Array - public init(revokeDevicesStatus: Array) { + public let revokeDevicesStatus: [Team.RevokeDeviceSessionStatus] + public init(revokeDevicesStatus: [Team.RevokeDeviceSessionStatus]) { self.revokeDevicesStatus = revokeDevicesStatus } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeDeviceSessionBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeDeviceSessionBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeDeviceSessionBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeDeviceSessionBatchResult: \(error)" + } } } - open class RevokeDeviceSessionBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeDeviceSessionBatchResult) -> JSON { - let output = [ - "revoke_devices_status": ArraySerializer(Team.RevokeDeviceSessionStatusSerializer()).serialize(value.revokeDevicesStatus), + + public class RevokeDeviceSessionBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeDeviceSessionBatchResult) throws -> JSON { + let output = [ + "revoke_devices_status": try ArraySerializer(Team.RevokeDeviceSessionStatusSerializer()).serialize(value.revokeDevicesStatus), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeDeviceSessionBatchResult { + + public func deserialize(_ json: JSON) throws -> RevokeDeviceSessionBatchResult { switch json { - case .dictionary(let dict): - let revokeDevicesStatus = ArraySerializer(Team.RevokeDeviceSessionStatusSerializer()).deserialize(dict["revoke_devices_status"] ?? .null) - return RevokeDeviceSessionBatchResult(revokeDevicesStatus: revokeDevicesStatus) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let revokeDevicesStatus = try ArraySerializer(Team.RevokeDeviceSessionStatusSerializer()) + .deserialize(dict["revoke_devices_status"] ?? .null) + return RevokeDeviceSessionBatchResult(revokeDevicesStatus: revokeDevicesStatus) + default: + throw JSONSerializerError.deserializeError(type: RevokeDeviceSessionBatchResult.self, json: json) } } } /// The RevokeDeviceSessionError union - public enum RevokeDeviceSessionError: CustomStringConvertible { + public enum RevokeDeviceSessionError: CustomStringConvertible, JSONRepresentable { /// Device session not found. case deviceSessionNotFound /// Member not found. @@ -9805,50 +12125,60 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try RevokeDeviceSessionErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeDeviceSessionErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeDeviceSessionErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeDeviceSessionError: \(error)" + } } } - open class RevokeDeviceSessionErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeDeviceSessionError) -> JSON { + + public class RevokeDeviceSessionErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeDeviceSessionError) throws -> JSON { switch value { - case .deviceSessionNotFound: - var d = [String: JSON]() - d[".tag"] = .str("device_session_not_found") - return .dictionary(d) - case .memberNotFound: - var d = [String: JSON]() - d[".tag"] = .str("member_not_found") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RevokeDeviceSessionError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "device_session_not_found": - return RevokeDeviceSessionError.deviceSessionNotFound - case "member_not_found": - return RevokeDeviceSessionError.memberNotFound - case "other": - return RevokeDeviceSessionError.other - default: - return RevokeDeviceSessionError.other - } + case .deviceSessionNotFound: + var d = [String: JSON]() + d[".tag"] = .str("device_session_not_found") + return .dictionary(d) + case .memberNotFound: + var d = [String: JSON]() + d[".tag"] = .str("member_not_found") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RevokeDeviceSessionError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "device_session_not_found": + return RevokeDeviceSessionError.deviceSessionNotFound + case "member_not_found": + return RevokeDeviceSessionError.memberNotFound + case "other": + return RevokeDeviceSessionError.other default: - fatalError("Failed to deserialize") + return RevokeDeviceSessionError.other + } + default: + throw JSONSerializerError.deserializeError(type: RevokeDeviceSessionError.self, json: json) } } } /// The RevokeDeviceSessionStatus struct - open class RevokeDeviceSessionStatus: CustomStringConvertible { + public class RevokeDeviceSessionStatus: CustomStringConvertible, JSONRepresentable { /// Result of the revoking request. public let success: Bool /// The error cause in case of a failure. @@ -9857,33 +12187,44 @@ open class Team { self.success = success self.errorType = errorType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeDeviceSessionStatusSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeDeviceSessionStatusSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeDeviceSessionStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeDeviceSessionStatus: \(error)" + } } } - open class RevokeDeviceSessionStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeDeviceSessionStatus) -> JSON { - let output = [ - "success": Serialization._BoolSerializer.serialize(value.success), - "error_type": NullableSerializer(Team.RevokeDeviceSessionErrorSerializer()).serialize(value.errorType), + + public class RevokeDeviceSessionStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeDeviceSessionStatus) throws -> JSON { + let output = [ + "success": try Serialization._BoolSerializer.serialize(value.success), + "error_type": try NullableSerializer(Team.RevokeDeviceSessionErrorSerializer()).serialize(value.errorType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeDeviceSessionStatus { + + public func deserialize(_ json: JSON) throws -> RevokeDeviceSessionStatus { switch json { - case .dictionary(let dict): - let success = Serialization._BoolSerializer.deserialize(dict["success"] ?? .null) - let errorType = NullableSerializer(Team.RevokeDeviceSessionErrorSerializer()).deserialize(dict["error_type"] ?? .null) - return RevokeDeviceSessionStatus(success: success, errorType: errorType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let success = try Serialization._BoolSerializer.deserialize(dict["success"] ?? .null) + let errorType = try NullableSerializer(Team.RevokeDeviceSessionErrorSerializer()).deserialize(dict["error_type"] ?? .null) + return RevokeDeviceSessionStatus(success: success, errorType: errorType) + default: + throw JSONSerializerError.deserializeError(type: RevokeDeviceSessionStatus.self, json: json) } } } /// The RevokeLinkedApiAppArg struct - open class RevokeLinkedApiAppArg: CustomStringConvertible { + public class RevokeLinkedApiAppArg: CustomStringConvertible, JSONRepresentable { /// The application's unique id. public let appId: String /// The unique id of the member owning the device. @@ -9898,130 +12239,174 @@ open class Team { self.teamMemberId = teamMemberId self.keepAppFolder = keepAppFolder } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeLinkedApiAppArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeLinkedApiAppArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeLinkedApiAppArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeLinkedApiAppArg: \(error)" + } } } - open class RevokeLinkedApiAppArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeLinkedApiAppArg) -> JSON { - let output = [ - "app_id": Serialization._StringSerializer.serialize(value.appId), - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "keep_app_folder": Serialization._BoolSerializer.serialize(value.keepAppFolder), + + public class RevokeLinkedApiAppArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeLinkedApiAppArg) throws -> JSON { + let output = [ + "app_id": try Serialization._StringSerializer.serialize(value.appId), + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "keep_app_folder": try Serialization._BoolSerializer.serialize(value.keepAppFolder), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeLinkedApiAppArg { + + public func deserialize(_ json: JSON) throws -> RevokeLinkedApiAppArg { switch json { - case .dictionary(let dict): - let appId = Serialization._StringSerializer.deserialize(dict["app_id"] ?? .null) - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let keepAppFolder = Serialization._BoolSerializer.deserialize(dict["keep_app_folder"] ?? .number(1)) - return RevokeLinkedApiAppArg(appId: appId, teamMemberId: teamMemberId, keepAppFolder: keepAppFolder) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appId = try Serialization._StringSerializer.deserialize(dict["app_id"] ?? .null) + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let keepAppFolder = try Serialization._BoolSerializer.deserialize(dict["keep_app_folder"] ?? .number(1)) + return RevokeLinkedApiAppArg(appId: appId, teamMemberId: teamMemberId, keepAppFolder: keepAppFolder) + default: + throw JSONSerializerError.deserializeError(type: RevokeLinkedApiAppArg.self, json: json) } } } /// The RevokeLinkedApiAppBatchArg struct - open class RevokeLinkedApiAppBatchArg: CustomStringConvertible { + public class RevokeLinkedApiAppBatchArg: CustomStringConvertible, JSONRepresentable { /// (no description) - public let revokeLinkedApp: Array - public init(revokeLinkedApp: Array) { + public let revokeLinkedApp: [Team.RevokeLinkedApiAppArg] + public init(revokeLinkedApp: [Team.RevokeLinkedApiAppArg]) { self.revokeLinkedApp = revokeLinkedApp } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeLinkedApiAppBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeLinkedApiAppBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeLinkedApiAppBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeLinkedApiAppBatchArg: \(error)" + } } } - open class RevokeLinkedApiAppBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeLinkedApiAppBatchArg) -> JSON { - let output = [ - "revoke_linked_app": ArraySerializer(Team.RevokeLinkedApiAppArgSerializer()).serialize(value.revokeLinkedApp), + + public class RevokeLinkedApiAppBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeLinkedApiAppBatchArg) throws -> JSON { + let output = [ + "revoke_linked_app": try ArraySerializer(Team.RevokeLinkedApiAppArgSerializer()).serialize(value.revokeLinkedApp), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeLinkedApiAppBatchArg { + + public func deserialize(_ json: JSON) throws -> RevokeLinkedApiAppBatchArg { switch json { - case .dictionary(let dict): - let revokeLinkedApp = ArraySerializer(Team.RevokeLinkedApiAppArgSerializer()).deserialize(dict["revoke_linked_app"] ?? .null) - return RevokeLinkedApiAppBatchArg(revokeLinkedApp: revokeLinkedApp) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let revokeLinkedApp = try ArraySerializer(Team.RevokeLinkedApiAppArgSerializer()).deserialize(dict["revoke_linked_app"] ?? .null) + return RevokeLinkedApiAppBatchArg(revokeLinkedApp: revokeLinkedApp) + default: + throw JSONSerializerError.deserializeError(type: RevokeLinkedApiAppBatchArg.self, json: json) } } } /// Error returned by linkedAppsRevokeLinkedAppBatch. - public enum RevokeLinkedAppBatchError: CustomStringConvertible { + public enum RevokeLinkedAppBatchError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case other + func json() throws -> JSON { + try RevokeLinkedAppBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeLinkedAppBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeLinkedAppBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeLinkedAppBatchError: \(error)" + } } } - open class RevokeLinkedAppBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeLinkedAppBatchError) -> JSON { + + public class RevokeLinkedAppBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeLinkedAppBatchError) throws -> JSON { switch value { - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RevokeLinkedAppBatchError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "other": - return RevokeLinkedAppBatchError.other - default: - return RevokeLinkedAppBatchError.other - } + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RevokeLinkedAppBatchError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "other": + return RevokeLinkedAppBatchError.other default: - fatalError("Failed to deserialize") + return RevokeLinkedAppBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: RevokeLinkedAppBatchError.self, json: json) } } } /// The RevokeLinkedAppBatchResult struct - open class RevokeLinkedAppBatchResult: CustomStringConvertible { + public class RevokeLinkedAppBatchResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let revokeLinkedAppStatus: Array - public init(revokeLinkedAppStatus: Array) { + public let revokeLinkedAppStatus: [Team.RevokeLinkedAppStatus] + public init(revokeLinkedAppStatus: [Team.RevokeLinkedAppStatus]) { self.revokeLinkedAppStatus = revokeLinkedAppStatus } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeLinkedAppBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeLinkedAppBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeLinkedAppBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeLinkedAppBatchResult: \(error)" + } } } - open class RevokeLinkedAppBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeLinkedAppBatchResult) -> JSON { - let output = [ - "revoke_linked_app_status": ArraySerializer(Team.RevokeLinkedAppStatusSerializer()).serialize(value.revokeLinkedAppStatus), + + public class RevokeLinkedAppBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeLinkedAppBatchResult) throws -> JSON { + let output = [ + "revoke_linked_app_status": try ArraySerializer(Team.RevokeLinkedAppStatusSerializer()).serialize(value.revokeLinkedAppStatus), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeLinkedAppBatchResult { + + public func deserialize(_ json: JSON) throws -> RevokeLinkedAppBatchResult { switch json { - case .dictionary(let dict): - let revokeLinkedAppStatus = ArraySerializer(Team.RevokeLinkedAppStatusSerializer()).deserialize(dict["revoke_linked_app_status"] ?? .null) - return RevokeLinkedAppBatchResult(revokeLinkedAppStatus: revokeLinkedAppStatus) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let revokeLinkedAppStatus = try ArraySerializer(Team.RevokeLinkedAppStatusSerializer()) + .deserialize(dict["revoke_linked_app_status"] ?? .null) + return RevokeLinkedAppBatchResult(revokeLinkedAppStatus: revokeLinkedAppStatus) + default: + throw JSONSerializerError.deserializeError(type: RevokeLinkedAppBatchResult.self, json: json) } } } /// Error returned by linkedAppsRevokeLinkedApp. - public enum RevokeLinkedAppError: CustomStringConvertible { + public enum RevokeLinkedAppError: CustomStringConvertible, JSONRepresentable { /// Application not found. case appNotFound /// Member not found. @@ -10031,56 +12416,66 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try RevokeLinkedAppErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeLinkedAppErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeLinkedAppErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeLinkedAppError: \(error)" + } } } - open class RevokeLinkedAppErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeLinkedAppError) -> JSON { + + public class RevokeLinkedAppErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeLinkedAppError) throws -> JSON { switch value { - case .appNotFound: - var d = [String: JSON]() - d[".tag"] = .str("app_not_found") - return .dictionary(d) - case .memberNotFound: - var d = [String: JSON]() - d[".tag"] = .str("member_not_found") - return .dictionary(d) - case .appFolderRemovalNotSupported: - var d = [String: JSON]() - d[".tag"] = .str("app_folder_removal_not_supported") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RevokeLinkedAppError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "app_not_found": - return RevokeLinkedAppError.appNotFound - case "member_not_found": - return RevokeLinkedAppError.memberNotFound - case "app_folder_removal_not_supported": - return RevokeLinkedAppError.appFolderRemovalNotSupported - case "other": - return RevokeLinkedAppError.other - default: - return RevokeLinkedAppError.other - } - default: - fatalError("Failed to deserialize") + case .appNotFound: + var d = [String: JSON]() + d[".tag"] = .str("app_not_found") + return .dictionary(d) + case .memberNotFound: + var d = [String: JSON]() + d[".tag"] = .str("member_not_found") + return .dictionary(d) + case .appFolderRemovalNotSupported: + var d = [String: JSON]() + d[".tag"] = .str("app_folder_removal_not_supported") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RevokeLinkedAppError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "app_not_found": + return RevokeLinkedAppError.appNotFound + case "member_not_found": + return RevokeLinkedAppError.memberNotFound + case "app_folder_removal_not_supported": + return RevokeLinkedAppError.appFolderRemovalNotSupported + case "other": + return RevokeLinkedAppError.other + default: + return RevokeLinkedAppError.other + } + default: + throw JSONSerializerError.deserializeError(type: RevokeLinkedAppError.self, json: json) } } } /// The RevokeLinkedAppStatus struct - open class RevokeLinkedAppStatus: CustomStringConvertible { + public class RevokeLinkedAppStatus: CustomStringConvertible, JSONRepresentable { /// Result of the revoking request. public let success: Bool /// The error cause in case of a failure. @@ -10089,63 +12484,85 @@ open class Team { self.success = success self.errorType = errorType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RevokeLinkedAppStatusSerializer().serialize(self)))" + + func json() throws -> JSON { + try RevokeLinkedAppStatusSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RevokeLinkedAppStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RevokeLinkedAppStatus: \(error)" + } } } - open class RevokeLinkedAppStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RevokeLinkedAppStatus) -> JSON { - let output = [ - "success": Serialization._BoolSerializer.serialize(value.success), - "error_type": NullableSerializer(Team.RevokeLinkedAppErrorSerializer()).serialize(value.errorType), + + public class RevokeLinkedAppStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RevokeLinkedAppStatus) throws -> JSON { + let output = [ + "success": try Serialization._BoolSerializer.serialize(value.success), + "error_type": try NullableSerializer(Team.RevokeLinkedAppErrorSerializer()).serialize(value.errorType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RevokeLinkedAppStatus { + + public func deserialize(_ json: JSON) throws -> RevokeLinkedAppStatus { switch json { - case .dictionary(let dict): - let success = Serialization._BoolSerializer.deserialize(dict["success"] ?? .null) - let errorType = NullableSerializer(Team.RevokeLinkedAppErrorSerializer()).deserialize(dict["error_type"] ?? .null) - return RevokeLinkedAppStatus(success: success, errorType: errorType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let success = try Serialization._BoolSerializer.deserialize(dict["success"] ?? .null) + let errorType = try NullableSerializer(Team.RevokeLinkedAppErrorSerializer()).deserialize(dict["error_type"] ?? .null) + return RevokeLinkedAppStatus(success: success, errorType: errorType) + default: + throw JSONSerializerError.deserializeError(type: RevokeLinkedAppStatus.self, json: json) } } } /// The SetCustomQuotaArg struct - open class SetCustomQuotaArg: CustomStringConvertible { + public class SetCustomQuotaArg: CustomStringConvertible, JSONRepresentable { /// List of users and their custom quotas. - public let usersAndQuotas: Array - public init(usersAndQuotas: Array) { + public let usersAndQuotas: [Team.UserCustomQuotaArg] + public init(usersAndQuotas: [Team.UserCustomQuotaArg]) { self.usersAndQuotas = usersAndQuotas } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SetCustomQuotaArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SetCustomQuotaArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SetCustomQuotaArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SetCustomQuotaArg: \(error)" + } } } - open class SetCustomQuotaArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SetCustomQuotaArg) -> JSON { - let output = [ - "users_and_quotas": ArraySerializer(Team.UserCustomQuotaArgSerializer()).serialize(value.usersAndQuotas), + + public class SetCustomQuotaArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SetCustomQuotaArg) throws -> JSON { + let output = [ + "users_and_quotas": try ArraySerializer(Team.UserCustomQuotaArgSerializer()).serialize(value.usersAndQuotas), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SetCustomQuotaArg { + + public func deserialize(_ json: JSON) throws -> SetCustomQuotaArg { switch json { - case .dictionary(let dict): - let usersAndQuotas = ArraySerializer(Team.UserCustomQuotaArgSerializer()).deserialize(dict["users_and_quotas"] ?? .null) - return SetCustomQuotaArg(usersAndQuotas: usersAndQuotas) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let usersAndQuotas = try ArraySerializer(Team.UserCustomQuotaArgSerializer()).deserialize(dict["users_and_quotas"] ?? .null) + return SetCustomQuotaArg(usersAndQuotas: usersAndQuotas) + default: + throw JSONSerializerError.deserializeError(type: SetCustomQuotaArg.self, json: json) } } } /// Error returned when setting member custom quota. - public enum SetCustomQuotaError: CustomStringConvertible { + public enum SetCustomQuotaError: CustomStringConvertible, JSONRepresentable { /// A maximum of 1000 users can be set for a single call. case tooManyUsers /// An unspecified error. @@ -10153,88 +12570,109 @@ open class Team { /// Some of the users are on the excluded users list and can't have custom quota set. case someUsersAreExcluded + func json() throws -> JSON { + try SetCustomQuotaErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SetCustomQuotaErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SetCustomQuotaErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SetCustomQuotaError: \(error)" + } } } - open class SetCustomQuotaErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SetCustomQuotaError) -> JSON { + + public class SetCustomQuotaErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SetCustomQuotaError) throws -> JSON { switch value { - case .tooManyUsers: - var d = [String: JSON]() - d[".tag"] = .str("too_many_users") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .someUsersAreExcluded: - var d = [String: JSON]() - d[".tag"] = .str("some_users_are_excluded") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SetCustomQuotaError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "too_many_users": - return SetCustomQuotaError.tooManyUsers - case "other": - return SetCustomQuotaError.other - case "some_users_are_excluded": - return SetCustomQuotaError.someUsersAreExcluded - default: - fatalError("Unknown tag \(tag)") - } + case .tooManyUsers: + var d = [String: JSON]() + d[".tag"] = .str("too_many_users") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .someUsersAreExcluded: + var d = [String: JSON]() + d[".tag"] = .str("some_users_are_excluded") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SetCustomQuotaError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "too_many_users": + return SetCustomQuotaError.tooManyUsers + case "other": + return SetCustomQuotaError.other + case "some_users_are_excluded": + return SetCustomQuotaError.someUsersAreExcluded default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: SetCustomQuotaError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: SetCustomQuotaError.self, json: json) } } } /// Structure representing Approve List entries. Domain and emails are supported. At least one entry of any /// supported type is required. - open class SharingAllowlistAddArgs: CustomStringConvertible { + public class SharingAllowlistAddArgs: CustomStringConvertible, JSONRepresentable { /// List of domains represented by valid string representation (RFC-1034/5). - public let domains: Array? + public let domains: [String]? /// List of emails represented by valid string representation (RFC-5322/822). - public let emails: Array? - public init(domains: Array? = nil, emails: Array? = nil) { + public let emails: [String]? + public init(domains: [String]? = nil, emails: [String]? = nil) { nullableValidator(arrayValidator(itemValidator: stringValidator()))(domains) self.domains = domains nullableValidator(arrayValidator(itemValidator: stringValidator()))(emails) self.emails = emails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistAddArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingAllowlistAddArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistAddArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistAddArgs: \(error)" + } } } - open class SharingAllowlistAddArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistAddArgs) -> JSON { - let output = [ - "domains": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.domains), - "emails": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.emails), + + public class SharingAllowlistAddArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistAddArgs) throws -> JSON { + let output = [ + "domains": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.domains), + "emails": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.emails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistAddArgs { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistAddArgs { switch json { - case .dictionary(let dict): - let domains = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["domains"] ?? .null) - let emails = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["emails"] ?? .null) - return SharingAllowlistAddArgs(domains: domains, emails: emails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domains = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["domains"] ?? .null) + let emails = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["emails"] ?? .null) + return SharingAllowlistAddArgs(domains: domains, emails: emails) + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistAddArgs.self, json: json) } } } /// The SharingAllowlistAddError union - public enum SharingAllowlistAddError: CustomStringConvertible { + public enum SharingAllowlistAddError: CustomStringConvertible, JSONRepresentable { /// One of provided values is not valid. case malformedEntry(String) /// Neither single domain nor email provided. @@ -10250,238 +12688,296 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try SharingAllowlistAddErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistAddErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistAddErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistAddError: \(error)" + } } } - open class SharingAllowlistAddErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistAddError) -> JSON { + + public class SharingAllowlistAddErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistAddError) throws -> JSON { switch value { - case .malformedEntry(let arg): - var d = ["malformed_entry": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("malformed_entry") - return .dictionary(d) - case .noEntriesProvided: - var d = [String: JSON]() - d[".tag"] = .str("no_entries_provided") - return .dictionary(d) - case .tooManyEntriesProvided: - var d = [String: JSON]() - d[".tag"] = .str("too_many_entries_provided") - return .dictionary(d) - case .teamLimitReached: - var d = [String: JSON]() - d[".tag"] = .str("team_limit_reached") - return .dictionary(d) - case .unknownError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_error") - return .dictionary(d) - case .entriesAlreadyExist(let arg): - var d = ["entries_already_exist": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("entries_already_exist") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingAllowlistAddError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "malformed_entry": - let v = Serialization._StringSerializer.deserialize(d["malformed_entry"] ?? .null) - return SharingAllowlistAddError.malformedEntry(v) - case "no_entries_provided": - return SharingAllowlistAddError.noEntriesProvided - case "too_many_entries_provided": - return SharingAllowlistAddError.tooManyEntriesProvided - case "team_limit_reached": - return SharingAllowlistAddError.teamLimitReached - case "unknown_error": - return SharingAllowlistAddError.unknownError - case "entries_already_exist": - let v = Serialization._StringSerializer.deserialize(d["entries_already_exist"] ?? .null) - return SharingAllowlistAddError.entriesAlreadyExist(v) - case "other": - return SharingAllowlistAddError.other - default: - return SharingAllowlistAddError.other - } - default: - fatalError("Failed to deserialize") + case .malformedEntry(let arg): + var d = try ["malformed_entry": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("malformed_entry") + return .dictionary(d) + case .noEntriesProvided: + var d = [String: JSON]() + d[".tag"] = .str("no_entries_provided") + return .dictionary(d) + case .tooManyEntriesProvided: + var d = [String: JSON]() + d[".tag"] = .str("too_many_entries_provided") + return .dictionary(d) + case .teamLimitReached: + var d = [String: JSON]() + d[".tag"] = .str("team_limit_reached") + return .dictionary(d) + case .unknownError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_error") + return .dictionary(d) + case .entriesAlreadyExist(let arg): + var d = try ["entries_already_exist": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("entries_already_exist") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingAllowlistAddError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "malformed_entry": + let v = try Serialization._StringSerializer.deserialize(d["malformed_entry"] ?? .null) + return SharingAllowlistAddError.malformedEntry(v) + case "no_entries_provided": + return SharingAllowlistAddError.noEntriesProvided + case "too_many_entries_provided": + return SharingAllowlistAddError.tooManyEntriesProvided + case "team_limit_reached": + return SharingAllowlistAddError.teamLimitReached + case "unknown_error": + return SharingAllowlistAddError.unknownError + case "entries_already_exist": + let v = try Serialization._StringSerializer.deserialize(d["entries_already_exist"] ?? .null) + return SharingAllowlistAddError.entriesAlreadyExist(v) + case "other": + return SharingAllowlistAddError.other + default: + return SharingAllowlistAddError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistAddError.self, json: json) } } } /// This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone. - open class SharingAllowlistAddResponse: CustomStringConvertible { - public init() { + public class SharingAllowlistAddResponse: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharingAllowlistAddResponseSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistAddResponseSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistAddResponseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistAddResponse: \(error)" + } } } - open class SharingAllowlistAddResponseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistAddResponse) -> JSON { + + public class SharingAllowlistAddResponseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistAddResponse) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistAddResponse { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistAddResponse { switch json { - case .dictionary(_): - return SharingAllowlistAddResponse() - default: - fatalError("Type error deserializing") + case .dictionary: + return SharingAllowlistAddResponse() + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistAddResponse.self, json: json) } } } /// The SharingAllowlistListArg struct - open class SharingAllowlistListArg: CustomStringConvertible { + public class SharingAllowlistListArg: CustomStringConvertible, JSONRepresentable { /// The number of entries to fetch at one time. public let limit: UInt32 - public init(limit: UInt32 = 1000) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(limit: UInt32 = 1_000) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingAllowlistListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistListArg: \(error)" + } } } - open class SharingAllowlistListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistListArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class SharingAllowlistListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistListArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistListArg { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistListArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return SharingAllowlistListArg(limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return SharingAllowlistListArg(limit: limit) + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistListArg.self, json: json) } } } /// The SharingAllowlistListContinueArg struct - open class SharingAllowlistListContinueArg: CustomStringConvertible { + public class SharingAllowlistListContinueArg: CustomStringConvertible, JSONRepresentable { /// The cursor returned from a previous call to sharingAllowlistList or sharingAllowlistListContinue. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistListContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingAllowlistListContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistListContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistListContinueArg: \(error)" + } } } - open class SharingAllowlistListContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistListContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class SharingAllowlistListContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistListContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistListContinueArg { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistListContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return SharingAllowlistListContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return SharingAllowlistListContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistListContinueArg.self, json: json) } } } /// The SharingAllowlistListContinueError union - public enum SharingAllowlistListContinueError: CustomStringConvertible { + public enum SharingAllowlistListContinueError: CustomStringConvertible, JSONRepresentable { /// Provided cursor is not valid. case invalidCursor /// An unspecified error. case other + func json() throws -> JSON { + try SharingAllowlistListContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistListContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistListContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistListContinueError: \(error)" + } } } - open class SharingAllowlistListContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistListContinueError) -> JSON { + + public class SharingAllowlistListContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistListContinueError) throws -> JSON { switch value { - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingAllowlistListContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_cursor": - return SharingAllowlistListContinueError.invalidCursor - case "other": - return SharingAllowlistListContinueError.other - default: - return SharingAllowlistListContinueError.other - } + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingAllowlistListContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_cursor": + return SharingAllowlistListContinueError.invalidCursor + case "other": + return SharingAllowlistListContinueError.other default: - fatalError("Failed to deserialize") + return SharingAllowlistListContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistListContinueError.self, json: json) } } } /// This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone. - open class SharingAllowlistListError: CustomStringConvertible { - public init() { + public class SharingAllowlistListError: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharingAllowlistListErrorSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistListErrorSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistListErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistListError: \(error)" + } } } - open class SharingAllowlistListErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistListError) -> JSON { + + public class SharingAllowlistListErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistListError) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistListError { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistListError { switch json { - case .dictionary(_): - return SharingAllowlistListError() - default: - fatalError("Type error deserializing") + case .dictionary: + return SharingAllowlistListError() + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistListError.self, json: json) } } } /// The SharingAllowlistListResponse struct - open class SharingAllowlistListResponse: CustomStringConvertible { + public class SharingAllowlistListResponse: CustomStringConvertible, JSONRepresentable { /// List of domains represented by valid string representation (RFC-1034/5). - public let domains: Array + public let domains: [String] /// List of emails represented by valid string representation (RFC-5322/822). - public let emails: Array + public let emails: [String] /// If this is nonempty, there are more entries that can be fetched with sharingAllowlistListContinue. public let cursor: String /// if true indicates that more entries can be fetched with sharingAllowlistListContinue. public let hasMore: Bool - public init(domains: Array, emails: Array, cursor: String = "", hasMore: Bool = false) { + public init(domains: [String], emails: [String], cursor: String = "", hasMore: Bool = false) { arrayValidator(itemValidator: stringValidator())(domains) self.domains = domains arrayValidator(itemValidator: stringValidator())(emails) @@ -10490,74 +12986,96 @@ open class Team { self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistListResponseSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingAllowlistListResponseSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistListResponseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistListResponse: \(error)" + } } } - open class SharingAllowlistListResponseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistListResponse) -> JSON { - let output = [ - "domains": ArraySerializer(Serialization._StringSerializer).serialize(value.domains), - "emails": ArraySerializer(Serialization._StringSerializer).serialize(value.emails), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class SharingAllowlistListResponseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistListResponse) throws -> JSON { + let output = [ + "domains": try ArraySerializer(Serialization._StringSerializer).serialize(value.domains), + "emails": try ArraySerializer(Serialization._StringSerializer).serialize(value.emails), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistListResponse { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistListResponse { switch json { - case .dictionary(let dict): - let domains = ArraySerializer(Serialization._StringSerializer).deserialize(dict["domains"] ?? .null) - let emails = ArraySerializer(Serialization._StringSerializer).deserialize(dict["emails"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .str("")) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .number(0)) - return SharingAllowlistListResponse(domains: domains, emails: emails, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domains = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["domains"] ?? .null) + let emails = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["emails"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .str("")) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .number(0)) + return SharingAllowlistListResponse(domains: domains, emails: emails, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistListResponse.self, json: json) } } } /// The SharingAllowlistRemoveArgs struct - open class SharingAllowlistRemoveArgs: CustomStringConvertible { + public class SharingAllowlistRemoveArgs: CustomStringConvertible, JSONRepresentable { /// List of domains represented by valid string representation (RFC-1034/5). - public let domains: Array? + public let domains: [String]? /// List of emails represented by valid string representation (RFC-5322/822). - public let emails: Array? - public init(domains: Array? = nil, emails: Array? = nil) { + public let emails: [String]? + public init(domains: [String]? = nil, emails: [String]? = nil) { nullableValidator(arrayValidator(itemValidator: stringValidator()))(domains) self.domains = domains nullableValidator(arrayValidator(itemValidator: stringValidator()))(emails) self.emails = emails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistRemoveArgsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingAllowlistRemoveArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistRemoveArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistRemoveArgs: \(error)" + } } } - open class SharingAllowlistRemoveArgsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistRemoveArgs) -> JSON { - let output = [ - "domains": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.domains), - "emails": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.emails), + + public class SharingAllowlistRemoveArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistRemoveArgs) throws -> JSON { + let output = [ + "domains": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.domains), + "emails": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.emails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistRemoveArgs { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistRemoveArgs { switch json { - case .dictionary(let dict): - let domains = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["domains"] ?? .null) - let emails = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["emails"] ?? .null) - return SharingAllowlistRemoveArgs(domains: domains, emails: emails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domains = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["domains"] ?? .null) + let emails = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["emails"] ?? .null) + return SharingAllowlistRemoveArgs(domains: domains, emails: emails) + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistRemoveArgs.self, json: json) } } } /// The SharingAllowlistRemoveError union - public enum SharingAllowlistRemoveError: CustomStringConvertible { + public enum SharingAllowlistRemoveError: CustomStringConvertible, JSONRepresentable { /// One of provided values is not valid. case malformedEntry(String) /// One or more provided values do not exist. @@ -10571,94 +13089,112 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try SharingAllowlistRemoveErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistRemoveErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistRemoveErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistRemoveError: \(error)" + } } } - open class SharingAllowlistRemoveErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistRemoveError) -> JSON { + + public class SharingAllowlistRemoveErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistRemoveError) throws -> JSON { switch value { - case .malformedEntry(let arg): - var d = ["malformed_entry": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("malformed_entry") - return .dictionary(d) - case .entriesDoNotExist(let arg): - var d = ["entries_do_not_exist": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("entries_do_not_exist") - return .dictionary(d) - case .noEntriesProvided: - var d = [String: JSON]() - d[".tag"] = .str("no_entries_provided") - return .dictionary(d) - case .tooManyEntriesProvided: - var d = [String: JSON]() - d[".tag"] = .str("too_many_entries_provided") - return .dictionary(d) - case .unknownError: - var d = [String: JSON]() - d[".tag"] = .str("unknown_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingAllowlistRemoveError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "malformed_entry": - let v = Serialization._StringSerializer.deserialize(d["malformed_entry"] ?? .null) - return SharingAllowlistRemoveError.malformedEntry(v) - case "entries_do_not_exist": - let v = Serialization._StringSerializer.deserialize(d["entries_do_not_exist"] ?? .null) - return SharingAllowlistRemoveError.entriesDoNotExist(v) - case "no_entries_provided": - return SharingAllowlistRemoveError.noEntriesProvided - case "too_many_entries_provided": - return SharingAllowlistRemoveError.tooManyEntriesProvided - case "unknown_error": - return SharingAllowlistRemoveError.unknownError - case "other": - return SharingAllowlistRemoveError.other - default: - return SharingAllowlistRemoveError.other - } - default: - fatalError("Failed to deserialize") + case .malformedEntry(let arg): + var d = try ["malformed_entry": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("malformed_entry") + return .dictionary(d) + case .entriesDoNotExist(let arg): + var d = try ["entries_do_not_exist": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("entries_do_not_exist") + return .dictionary(d) + case .noEntriesProvided: + var d = [String: JSON]() + d[".tag"] = .str("no_entries_provided") + return .dictionary(d) + case .tooManyEntriesProvided: + var d = [String: JSON]() + d[".tag"] = .str("too_many_entries_provided") + return .dictionary(d) + case .unknownError: + var d = [String: JSON]() + d[".tag"] = .str("unknown_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingAllowlistRemoveError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "malformed_entry": + let v = try Serialization._StringSerializer.deserialize(d["malformed_entry"] ?? .null) + return SharingAllowlistRemoveError.malformedEntry(v) + case "entries_do_not_exist": + let v = try Serialization._StringSerializer.deserialize(d["entries_do_not_exist"] ?? .null) + return SharingAllowlistRemoveError.entriesDoNotExist(v) + case "no_entries_provided": + return SharingAllowlistRemoveError.noEntriesProvided + case "too_many_entries_provided": + return SharingAllowlistRemoveError.tooManyEntriesProvided + case "unknown_error": + return SharingAllowlistRemoveError.unknownError + case "other": + return SharingAllowlistRemoveError.other + default: + return SharingAllowlistRemoveError.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistRemoveError.self, json: json) } } } /// This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone. - open class SharingAllowlistRemoveResponse: CustomStringConvertible { - public init() { + public class SharingAllowlistRemoveResponse: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharingAllowlistRemoveResponseSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingAllowlistRemoveResponseSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingAllowlistRemoveResponseSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingAllowlistRemoveResponse: \(error)" + } } } - open class SharingAllowlistRemoveResponseSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingAllowlistRemoveResponse) -> JSON { + + public class SharingAllowlistRemoveResponseSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingAllowlistRemoveResponse) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingAllowlistRemoveResponse { + + public func deserialize(_ json: JSON) throws -> SharingAllowlistRemoveResponse { switch json { - case .dictionary(_): - return SharingAllowlistRemoveResponse() - default: - fatalError("Type error deserializing") + case .dictionary: + return SharingAllowlistRemoveResponse() + default: + throw JSONSerializerError.deserializeError(type: SharingAllowlistRemoveResponse.self, json: json) } } } /// Describes the number of users in a specific storage bucket. - open class StorageBucket: CustomStringConvertible { + public class StorageBucket: CustomStringConvertible, JSONRepresentable { /// The name of the storage bucket. For example, '1G' is a bucket of users with storage size up to 1 Giga. public let bucket: String /// The number of people whose storage is in the range of this storage bucket. @@ -10669,33 +13205,44 @@ open class Team { comparableValidator()(users) self.users = users } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(StorageBucketSerializer().serialize(self)))" + + func json() throws -> JSON { + try StorageBucketSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try StorageBucketSerializer().serialize(self)))" + } catch { + return "Failed to generate description for StorageBucket: \(error)" + } } } - open class StorageBucketSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: StorageBucket) -> JSON { - let output = [ - "bucket": Serialization._StringSerializer.serialize(value.bucket), - "users": Serialization._UInt64Serializer.serialize(value.users), + + public class StorageBucketSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: StorageBucket) throws -> JSON { + let output = [ + "bucket": try Serialization._StringSerializer.serialize(value.bucket), + "users": try Serialization._UInt64Serializer.serialize(value.users), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> StorageBucket { + + public func deserialize(_ json: JSON) throws -> StorageBucket { switch json { - case .dictionary(let dict): - let bucket = Serialization._StringSerializer.deserialize(dict["bucket"] ?? .null) - let users = Serialization._UInt64Serializer.deserialize(dict["users"] ?? .null) - return StorageBucket(bucket: bucket, users: users) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let bucket = try Serialization._StringSerializer.deserialize(dict["bucket"] ?? .null) + let users = try Serialization._UInt64Serializer.deserialize(dict["users"] ?? .null) + return StorageBucket(bucket: bucket, users: users) + default: + throw JSONSerializerError.deserializeError(type: StorageBucket.self, json: json) } } } /// The TeamFolderAccessError union - public enum TeamFolderAccessError: CustomStringConvertible { + public enum TeamFolderAccessError: CustomStringConvertible, JSONRepresentable { /// The team folder ID is invalid. case invalidTeamFolderId /// The authenticated app does not have permission to manage that team folder. @@ -10703,50 +13250,60 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderAccessErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderAccessErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderAccessErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderAccessError: \(error)" + } } } - open class TeamFolderAccessErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderAccessError) -> JSON { + + public class TeamFolderAccessErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderAccessError) throws -> JSON { switch value { - case .invalidTeamFolderId: - var d = [String: JSON]() - d[".tag"] = .str("invalid_team_folder_id") - return .dictionary(d) - case .noAccess: - var d = [String: JSON]() - d[".tag"] = .str("no_access") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderAccessError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_team_folder_id": - return TeamFolderAccessError.invalidTeamFolderId - case "no_access": - return TeamFolderAccessError.noAccess - case "other": - return TeamFolderAccessError.other - default: - return TeamFolderAccessError.other - } + case .invalidTeamFolderId: + var d = [String: JSON]() + d[".tag"] = .str("invalid_team_folder_id") + return .dictionary(d) + case .noAccess: + var d = [String: JSON]() + d[".tag"] = .str("no_access") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderAccessError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_team_folder_id": + return TeamFolderAccessError.invalidTeamFolderId + case "no_access": + return TeamFolderAccessError.noAccess + case "other": + return TeamFolderAccessError.other default: - fatalError("Failed to deserialize") + return TeamFolderAccessError.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderAccessError.self, json: json) } } } /// The TeamFolderActivateError union - public enum TeamFolderActivateError: CustomStringConvertible { + public enum TeamFolderActivateError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Team.TeamFolderAccessError) /// An unspecified error. @@ -10756,123 +13313,151 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderActivateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderActivateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderActivateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderActivateError: \(error)" + } } } - open class TeamFolderActivateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderActivateError) -> JSON { + + public class TeamFolderActivateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderActivateError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .statusError(let arg): - var d = ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] - d[".tag"] = .str("status_error") - return .dictionary(d) - case .teamSharedDropboxError(let arg): - var d = ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] - d[".tag"] = .str("team_shared_dropbox_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderActivateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return TeamFolderActivateError.accessError(v) - case "status_error": - let v = Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) - return TeamFolderActivateError.statusError(v) - case "team_shared_dropbox_error": - let v = Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) - return TeamFolderActivateError.teamSharedDropboxError(v) - case "other": - return TeamFolderActivateError.other - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .statusError(let arg): + var d = try ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] + d[".tag"] = .str("status_error") + return .dictionary(d) + case .teamSharedDropboxError(let arg): + var d = try ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] + d[".tag"] = .str("team_shared_dropbox_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderActivateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return TeamFolderActivateError.accessError(v) + case "status_error": + let v = try Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) + return TeamFolderActivateError.statusError(v) + case "team_shared_dropbox_error": + let v = try Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) + return TeamFolderActivateError.teamSharedDropboxError(v) + case "other": + return TeamFolderActivateError.other + default: + throw JSONSerializerError.unknownTag(type: TeamFolderActivateError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderActivateError.self, json: json) } } } /// The TeamFolderIdArg struct - open class TeamFolderIdArg: CustomStringConvertible { + public class TeamFolderIdArg: CustomStringConvertible, JSONRepresentable { /// The ID of the team folder. public let teamFolderId: String public init(teamFolderId: String) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(teamFolderId) self.teamFolderId = teamFolderId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderIdArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderIdArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderIdArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderIdArg: \(error)" + } } } - open class TeamFolderIdArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderIdArg) -> JSON { - let output = [ - "team_folder_id": Serialization._StringSerializer.serialize(value.teamFolderId), + + public class TeamFolderIdArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderIdArg) throws -> JSON { + let output = [ + "team_folder_id": try Serialization._StringSerializer.serialize(value.teamFolderId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderIdArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderIdArg { switch json { - case .dictionary(let dict): - let teamFolderId = Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) - return TeamFolderIdArg(teamFolderId: teamFolderId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamFolderId = try Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) + return TeamFolderIdArg(teamFolderId: teamFolderId) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderIdArg.self, json: json) } } } /// The TeamFolderArchiveArg struct - open class TeamFolderArchiveArg: Team.TeamFolderIdArg { + public class TeamFolderArchiveArg: Team.TeamFolderIdArg { /// Whether to force the archive to happen synchronously. public let forceAsyncOff: Bool public init(teamFolderId: String, forceAsyncOff: Bool = false) { self.forceAsyncOff = forceAsyncOff super.init(teamFolderId: teamFolderId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderArchiveArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderArchiveArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderArchiveArg: \(error)" + } } } - open class TeamFolderArchiveArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderArchiveArg) -> JSON { - let output = [ - "team_folder_id": Serialization._StringSerializer.serialize(value.teamFolderId), - "force_async_off": Serialization._BoolSerializer.serialize(value.forceAsyncOff), + + public class TeamFolderArchiveArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderArchiveArg) throws -> JSON { + let output = [ + "team_folder_id": try Serialization._StringSerializer.serialize(value.teamFolderId), + "force_async_off": try Serialization._BoolSerializer.serialize(value.forceAsyncOff), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderArchiveArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderArchiveArg { switch json { - case .dictionary(let dict): - let teamFolderId = Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) - let forceAsyncOff = Serialization._BoolSerializer.deserialize(dict["force_async_off"] ?? .number(0)) - return TeamFolderArchiveArg(teamFolderId: teamFolderId, forceAsyncOff: forceAsyncOff) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamFolderId = try Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) + let forceAsyncOff = try Serialization._BoolSerializer.deserialize(dict["force_async_off"] ?? .number(0)) + return TeamFolderArchiveArg(teamFolderId: teamFolderId, forceAsyncOff: forceAsyncOff) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderArchiveArg.self, json: json) } } } /// The TeamFolderArchiveError union - public enum TeamFolderArchiveError: CustomStringConvertible { + public enum TeamFolderArchiveError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Team.TeamFolderAccessError) /// An unspecified error. @@ -10882,59 +13467,69 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderArchiveErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderArchiveErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderArchiveErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderArchiveError: \(error)" + } } } - open class TeamFolderArchiveErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderArchiveError) -> JSON { + + public class TeamFolderArchiveErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderArchiveError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .statusError(let arg): - var d = ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] - d[".tag"] = .str("status_error") - return .dictionary(d) - case .teamSharedDropboxError(let arg): - var d = ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] - d[".tag"] = .str("team_shared_dropbox_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderArchiveError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return TeamFolderArchiveError.accessError(v) - case "status_error": - let v = Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) - return TeamFolderArchiveError.statusError(v) - case "team_shared_dropbox_error": - let v = Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) - return TeamFolderArchiveError.teamSharedDropboxError(v) - case "other": - return TeamFolderArchiveError.other - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .statusError(let arg): + var d = try ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] + d[".tag"] = .str("status_error") + return .dictionary(d) + case .teamSharedDropboxError(let arg): + var d = try ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] + d[".tag"] = .str("team_shared_dropbox_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderArchiveError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return TeamFolderArchiveError.accessError(v) + case "status_error": + let v = try Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) + return TeamFolderArchiveError.statusError(v) + case "team_shared_dropbox_error": + let v = try Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) + return TeamFolderArchiveError.teamSharedDropboxError(v) + case "other": + return TeamFolderArchiveError.other + default: + throw JSONSerializerError.unknownTag(type: TeamFolderArchiveError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderArchiveError.self, json: json) } } } /// The TeamFolderArchiveJobStatus union - public enum TeamFolderArchiveJobStatus: CustomStringConvertible { + public enum TeamFolderArchiveJobStatus: CustomStringConvertible, JSONRepresentable { /// The asynchronous job is still in progress. case inProgress /// The archive job has finished. The value is the metadata for the resulting team folder. @@ -10942,98 +13537,118 @@ open class Team { /// Error occurred while performing an asynchronous job from teamFolderArchive. case failed(Team.TeamFolderArchiveError) + func json() throws -> JSON { + try TeamFolderArchiveJobStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderArchiveJobStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderArchiveJobStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderArchiveJobStatus: \(error)" + } } } - open class TeamFolderArchiveJobStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderArchiveJobStatus) -> JSON { + + public class TeamFolderArchiveJobStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderArchiveJobStatus) throws -> JSON { switch value { - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Team.TeamFolderMetadataSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - case .failed(let arg): - var d = ["failed": Team.TeamFolderArchiveErrorSerializer().serialize(arg)] - d[".tag"] = .str("failed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderArchiveJobStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "in_progress": - return TeamFolderArchiveJobStatus.inProgress - case "complete": - let v = Team.TeamFolderMetadataSerializer().deserialize(json) - return TeamFolderArchiveJobStatus.complete(v) - case "failed": - let v = Team.TeamFolderArchiveErrorSerializer().deserialize(d["failed"] ?? .null) - return TeamFolderArchiveJobStatus.failed(v) - default: - fatalError("Unknown tag \(tag)") - } + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Team.TeamFolderMetadataSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Team.TeamFolderArchiveErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderArchiveJobStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return TeamFolderArchiveJobStatus.inProgress + case "complete": + let v = try Team.TeamFolderMetadataSerializer().deserialize(json) + return TeamFolderArchiveJobStatus.complete(v) + case "failed": + let v = try Team.TeamFolderArchiveErrorSerializer().deserialize(d["failed"] ?? .null) + return TeamFolderArchiveJobStatus.failed(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: TeamFolderArchiveJobStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderArchiveJobStatus.self, json: json) } } } /// The TeamFolderArchiveLaunch union - public enum TeamFolderArchiveLaunch: CustomStringConvertible { + public enum TeamFolderArchiveLaunch: CustomStringConvertible, JSONRepresentable { /// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain /// the status of the asynchronous job. case asyncJobId(String) /// An unspecified error. case complete(Team.TeamFolderMetadata) + func json() throws -> JSON { + try TeamFolderArchiveLaunchSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderArchiveLaunchSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderArchiveLaunchSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderArchiveLaunch: \(error)" + } } } - open class TeamFolderArchiveLaunchSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderArchiveLaunch) -> JSON { + + public class TeamFolderArchiveLaunchSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderArchiveLaunch) throws -> JSON { switch value { - case .asyncJobId(let arg): - var d = ["async_job_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("async_job_id") - return .dictionary(d) - case .complete(let arg): - var d = Serialization.getFields(Team.TeamFolderMetadataSerializer().serialize(arg)) - d[".tag"] = .str("complete") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderArchiveLaunch { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "async_job_id": - let v = Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) - return TeamFolderArchiveLaunch.asyncJobId(v) - case "complete": - let v = Team.TeamFolderMetadataSerializer().deserialize(json) - return TeamFolderArchiveLaunch.complete(v) - default: - fatalError("Unknown tag \(tag)") - } + case .asyncJobId(let arg): + var d = try ["async_job_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("async_job_id") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Team.TeamFolderMetadataSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderArchiveLaunch { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "async_job_id": + let v = try Serialization._StringSerializer.deserialize(d["async_job_id"] ?? .null) + return TeamFolderArchiveLaunch.asyncJobId(v) + case "complete": + let v = try Team.TeamFolderMetadataSerializer().deserialize(json) + return TeamFolderArchiveLaunch.complete(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: TeamFolderArchiveLaunch.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderArchiveLaunch.self, json: json) } } } /// The TeamFolderCreateArg struct - open class TeamFolderCreateArg: CustomStringConvertible { + public class TeamFolderCreateArg: CustomStringConvertible, JSONRepresentable { /// Name for the new team folder. public let name: String /// The sync setting to apply to this team folder. Only permitted if the team has team selective sync enabled. @@ -11043,33 +13658,44 @@ open class Team { self.name = name self.syncSetting = syncSetting } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderCreateArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderCreateArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderCreateArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderCreateArg: \(error)" + } } } - open class TeamFolderCreateArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderCreateArg) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "sync_setting": NullableSerializer(Files.SyncSettingArgSerializer()).serialize(value.syncSetting), + + public class TeamFolderCreateArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderCreateArg) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "sync_setting": try NullableSerializer(Files.SyncSettingArgSerializer()).serialize(value.syncSetting), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderCreateArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderCreateArg { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let syncSetting = NullableSerializer(Files.SyncSettingArgSerializer()).deserialize(dict["sync_setting"] ?? .null) - return TeamFolderCreateArg(name: name, syncSetting: syncSetting) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let syncSetting = try NullableSerializer(Files.SyncSettingArgSerializer()).deserialize(dict["sync_setting"] ?? .null) + return TeamFolderCreateArg(name: name, syncSetting: syncSetting) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderCreateArg.self, json: json) } } } /// The TeamFolderCreateError union - public enum TeamFolderCreateError: CustomStringConvertible { + public enum TeamFolderCreateError: CustomStringConvertible, JSONRepresentable { /// The provided name cannot be used. case invalidFolderName /// There is already a team folder with the provided name. @@ -11081,139 +13707,170 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderCreateErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderCreateErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderCreateErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderCreateError: \(error)" + } } } - open class TeamFolderCreateErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderCreateError) -> JSON { + + public class TeamFolderCreateErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderCreateError) throws -> JSON { switch value { - case .invalidFolderName: - var d = [String: JSON]() - d[".tag"] = .str("invalid_folder_name") - return .dictionary(d) - case .folderNameAlreadyUsed: - var d = [String: JSON]() - d[".tag"] = .str("folder_name_already_used") - return .dictionary(d) - case .folderNameReserved: - var d = [String: JSON]() - d[".tag"] = .str("folder_name_reserved") - return .dictionary(d) - case .syncSettingsError(let arg): - var d = ["sync_settings_error": Files.SyncSettingsErrorSerializer().serialize(arg)] - d[".tag"] = .str("sync_settings_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderCreateError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_folder_name": - return TeamFolderCreateError.invalidFolderName - case "folder_name_already_used": - return TeamFolderCreateError.folderNameAlreadyUsed - case "folder_name_reserved": - return TeamFolderCreateError.folderNameReserved - case "sync_settings_error": - let v = Files.SyncSettingsErrorSerializer().deserialize(d["sync_settings_error"] ?? .null) - return TeamFolderCreateError.syncSettingsError(v) - case "other": - return TeamFolderCreateError.other - default: - return TeamFolderCreateError.other - } - default: - fatalError("Failed to deserialize") + case .invalidFolderName: + var d = [String: JSON]() + d[".tag"] = .str("invalid_folder_name") + return .dictionary(d) + case .folderNameAlreadyUsed: + var d = [String: JSON]() + d[".tag"] = .str("folder_name_already_used") + return .dictionary(d) + case .folderNameReserved: + var d = [String: JSON]() + d[".tag"] = .str("folder_name_reserved") + return .dictionary(d) + case .syncSettingsError(let arg): + var d = try ["sync_settings_error": Files.SyncSettingsErrorSerializer().serialize(arg)] + d[".tag"] = .str("sync_settings_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderCreateError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_folder_name": + return TeamFolderCreateError.invalidFolderName + case "folder_name_already_used": + return TeamFolderCreateError.folderNameAlreadyUsed + case "folder_name_reserved": + return TeamFolderCreateError.folderNameReserved + case "sync_settings_error": + let v = try Files.SyncSettingsErrorSerializer().deserialize(d["sync_settings_error"] ?? .null) + return TeamFolderCreateError.syncSettingsError(v) + case "other": + return TeamFolderCreateError.other + default: + return TeamFolderCreateError.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderCreateError.self, json: json) } } } /// The TeamFolderGetInfoItem union - public enum TeamFolderGetInfoItem: CustomStringConvertible { + public enum TeamFolderGetInfoItem: CustomStringConvertible, JSONRepresentable { /// An ID that was provided as a parameter to teamFolderGetInfo did not match any of the team's team folders. case idNotFound(String) /// Properties of a team folder. case teamFolderMetadata(Team.TeamFolderMetadata) + func json() throws -> JSON { + try TeamFolderGetInfoItemSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderGetInfoItemSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderGetInfoItemSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderGetInfoItem: \(error)" + } } } - open class TeamFolderGetInfoItemSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderGetInfoItem) -> JSON { + + public class TeamFolderGetInfoItemSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderGetInfoItem) throws -> JSON { switch value { - case .idNotFound(let arg): - var d = ["id_not_found": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("id_not_found") - return .dictionary(d) - case .teamFolderMetadata(let arg): - var d = Serialization.getFields(Team.TeamFolderMetadataSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_metadata") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderGetInfoItem { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "id_not_found": - let v = Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) - return TeamFolderGetInfoItem.idNotFound(v) - case "team_folder_metadata": - let v = Team.TeamFolderMetadataSerializer().deserialize(json) - return TeamFolderGetInfoItem.teamFolderMetadata(v) - default: - fatalError("Unknown tag \(tag)") - } + case .idNotFound(let arg): + var d = try ["id_not_found": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("id_not_found") + return .dictionary(d) + case .teamFolderMetadata(let arg): + var d = try Serialization.getFields(Team.TeamFolderMetadataSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_metadata") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderGetInfoItem { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "id_not_found": + let v = try Serialization._StringSerializer.deserialize(d["id_not_found"] ?? .null) + return TeamFolderGetInfoItem.idNotFound(v) + case "team_folder_metadata": + let v = try Team.TeamFolderMetadataSerializer().deserialize(json) + return TeamFolderGetInfoItem.teamFolderMetadata(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: TeamFolderGetInfoItem.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderGetInfoItem.self, json: json) } } } /// The TeamFolderIdListArg struct - open class TeamFolderIdListArg: CustomStringConvertible { + public class TeamFolderIdListArg: CustomStringConvertible, JSONRepresentable { /// The list of team folder IDs. - public let teamFolderIds: Array - public init(teamFolderIds: Array) { + public let teamFolderIds: [String] + public init(teamFolderIds: [String]) { arrayValidator(minItems: 1, itemValidator: stringValidator(pattern: "[-_0-9a-zA-Z:]+"))(teamFolderIds) self.teamFolderIds = teamFolderIds } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderIdListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderIdListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderIdListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderIdListArg: \(error)" + } } } - open class TeamFolderIdListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderIdListArg) -> JSON { - let output = [ - "team_folder_ids": ArraySerializer(Serialization._StringSerializer).serialize(value.teamFolderIds), + + public class TeamFolderIdListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderIdListArg) throws -> JSON { + let output = [ + "team_folder_ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.teamFolderIds), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderIdListArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderIdListArg { switch json { - case .dictionary(let dict): - let teamFolderIds = ArraySerializer(Serialization._StringSerializer).deserialize(dict["team_folder_ids"] ?? .null) - return TeamFolderIdListArg(teamFolderIds: teamFolderIds) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamFolderIds = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["team_folder_ids"] ?? .null) + return TeamFolderIdListArg(teamFolderIds: teamFolderIds) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderIdListArg.self, json: json) } } } /// The TeamFolderInvalidStatusError union - public enum TeamFolderInvalidStatusError: CustomStringConvertible { + public enum TeamFolderInvalidStatusError: CustomStringConvertible, JSONRepresentable { /// The folder is active and the operation did not succeed. case active /// The folder is archived and the operation did not succeed. @@ -11223,233 +13880,297 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderInvalidStatusErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderInvalidStatusErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderInvalidStatusErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderInvalidStatusError: \(error)" + } } } - open class TeamFolderInvalidStatusErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderInvalidStatusError) -> JSON { + + public class TeamFolderInvalidStatusErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderInvalidStatusError) throws -> JSON { switch value { - case .active: - var d = [String: JSON]() - d[".tag"] = .str("active") - return .dictionary(d) - case .archived: - var d = [String: JSON]() - d[".tag"] = .str("archived") - return .dictionary(d) - case .archiveInProgress: - var d = [String: JSON]() - d[".tag"] = .str("archive_in_progress") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderInvalidStatusError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "active": - return TeamFolderInvalidStatusError.active - case "archived": - return TeamFolderInvalidStatusError.archived - case "archive_in_progress": - return TeamFolderInvalidStatusError.archiveInProgress - case "other": - return TeamFolderInvalidStatusError.other - default: - return TeamFolderInvalidStatusError.other - } - default: - fatalError("Failed to deserialize") + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .archived: + var d = [String: JSON]() + d[".tag"] = .str("archived") + return .dictionary(d) + case .archiveInProgress: + var d = [String: JSON]() + d[".tag"] = .str("archive_in_progress") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderInvalidStatusError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return TeamFolderInvalidStatusError.active + case "archived": + return TeamFolderInvalidStatusError.archived + case "archive_in_progress": + return TeamFolderInvalidStatusError.archiveInProgress + case "other": + return TeamFolderInvalidStatusError.other + default: + return TeamFolderInvalidStatusError.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderInvalidStatusError.self, json: json) } } } /// The TeamFolderListArg struct - open class TeamFolderListArg: CustomStringConvertible { + public class TeamFolderListArg: CustomStringConvertible, JSONRepresentable { /// The maximum number of results to return per request. public let limit: UInt32 - public init(limit: UInt32 = 1000) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(limit: UInt32 = 1_000) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderListArg: \(error)" + } } } - open class TeamFolderListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderListArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class TeamFolderListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderListArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderListArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderListArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return TeamFolderListArg(limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return TeamFolderListArg(limit: limit) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderListArg.self, json: json) } } } /// The TeamFolderListContinueArg struct - open class TeamFolderListContinueArg: CustomStringConvertible { + public class TeamFolderListContinueArg: CustomStringConvertible, JSONRepresentable { /// Indicates from what point to get the next set of team folders. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderListContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderListContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderListContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderListContinueArg: \(error)" + } } } - open class TeamFolderListContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderListContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class TeamFolderListContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderListContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderListContinueArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderListContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return TeamFolderListContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return TeamFolderListContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderListContinueArg.self, json: json) } } } /// The TeamFolderListContinueError union - public enum TeamFolderListContinueError: CustomStringConvertible { + public enum TeamFolderListContinueError: CustomStringConvertible, JSONRepresentable { /// The cursor is invalid. case invalidCursor /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderListContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderListContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderListContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderListContinueError: \(error)" + } } } - open class TeamFolderListContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderListContinueError) -> JSON { + + public class TeamFolderListContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderListContinueError) throws -> JSON { switch value { - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderListContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_cursor": - return TeamFolderListContinueError.invalidCursor - case "other": - return TeamFolderListContinueError.other - default: - return TeamFolderListContinueError.other - } + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderListContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_cursor": + return TeamFolderListContinueError.invalidCursor + case "other": + return TeamFolderListContinueError.other default: - fatalError("Failed to deserialize") + return TeamFolderListContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderListContinueError.self, json: json) } } } /// The TeamFolderListError struct - open class TeamFolderListError: CustomStringConvertible { + public class TeamFolderListError: CustomStringConvertible, JSONRepresentable { /// (no description) public let accessError: Team.TeamFolderAccessError public init(accessError: Team.TeamFolderAccessError) { self.accessError = accessError } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderListErrorSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderListErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderListErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderListError: \(error)" + } } } - open class TeamFolderListErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderListError) -> JSON { - let output = [ - "access_error": Team.TeamFolderAccessErrorSerializer().serialize(value.accessError), + + public class TeamFolderListErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderListError) throws -> JSON { + let output = [ + "access_error": try Team.TeamFolderAccessErrorSerializer().serialize(value.accessError), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderListError { + + public func deserialize(_ json: JSON) throws -> TeamFolderListError { switch json { - case .dictionary(let dict): - let accessError = Team.TeamFolderAccessErrorSerializer().deserialize(dict["access_error"] ?? .null) - return TeamFolderListError(accessError: accessError) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessError = try Team.TeamFolderAccessErrorSerializer().deserialize(dict["access_error"] ?? .null) + return TeamFolderListError(accessError: accessError) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderListError.self, json: json) } } } /// Result for teamFolderList and teamFolderListContinue. - open class TeamFolderListResult: CustomStringConvertible { + public class TeamFolderListResult: CustomStringConvertible, JSONRepresentable { /// List of all team folders in the authenticated team. - public let teamFolders: Array + public let teamFolders: [Team.TeamFolderMetadata] /// Pass the cursor into teamFolderListContinue to obtain additional team folders. public let cursor: String /// Is true if there are additional team folders that have not been returned yet. An additional call to /// teamFolderListContinue can retrieve them. public let hasMore: Bool - public init(teamFolders: Array, cursor: String, hasMore: Bool) { + public init(teamFolders: [Team.TeamFolderMetadata], cursor: String, hasMore: Bool) { self.teamFolders = teamFolders stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderListResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderListResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderListResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderListResult: \(error)" + } } } - open class TeamFolderListResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderListResult) -> JSON { - let output = [ - "team_folders": ArraySerializer(Team.TeamFolderMetadataSerializer()).serialize(value.teamFolders), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class TeamFolderListResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderListResult) throws -> JSON { + let output = [ + "team_folders": try ArraySerializer(Team.TeamFolderMetadataSerializer()).serialize(value.teamFolders), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderListResult { + + public func deserialize(_ json: JSON) throws -> TeamFolderListResult { switch json { - case .dictionary(let dict): - let teamFolders = ArraySerializer(Team.TeamFolderMetadataSerializer()).deserialize(dict["team_folders"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return TeamFolderListResult(teamFolders: teamFolders, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamFolders = try ArraySerializer(Team.TeamFolderMetadataSerializer()).deserialize(dict["team_folders"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return TeamFolderListResult(teamFolders: teamFolders, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderListResult.self, json: json) } } } /// Properties of a team folder. - open class TeamFolderMetadata: CustomStringConvertible { + public class TeamFolderMetadata: CustomStringConvertible, JSONRepresentable { /// The ID of the team folder. public let teamFolderId: String /// The name of the team folder. @@ -11461,8 +14182,15 @@ open class Team { /// The sync setting applied to this team folder. public let syncSetting: Files.SyncSetting /// Sync settings applied to contents of this team folder. - public let contentSyncSettings: Array - public init(teamFolderId: String, name: String, status: Team.TeamFolderStatus, isTeamSharedDropbox: Bool, syncSetting: Files.SyncSetting, contentSyncSettings: Array) { + public let contentSyncSettings: [Files.ContentSyncSetting] + public init( + teamFolderId: String, + name: String, + status: Team.TeamFolderStatus, + isTeamSharedDropbox: Bool, + syncSetting: Files.SyncSetting, + contentSyncSettings: [Files.ContentSyncSetting] + ) { stringValidator(pattern: "[-_0-9a-zA-Z:]+")(teamFolderId) self.teamFolderId = teamFolderId stringValidator()(name) @@ -11472,41 +14200,59 @@ open class Team { self.syncSetting = syncSetting self.contentSyncSettings = contentSyncSettings } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderMetadataSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderMetadataSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderMetadataSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderMetadata: \(error)" + } } } - open class TeamFolderMetadataSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderMetadata) -> JSON { - let output = [ - "team_folder_id": Serialization._StringSerializer.serialize(value.teamFolderId), - "name": Serialization._StringSerializer.serialize(value.name), - "status": Team.TeamFolderStatusSerializer().serialize(value.status), - "is_team_shared_dropbox": Serialization._BoolSerializer.serialize(value.isTeamSharedDropbox), - "sync_setting": Files.SyncSettingSerializer().serialize(value.syncSetting), - "content_sync_settings": ArraySerializer(Files.ContentSyncSettingSerializer()).serialize(value.contentSyncSettings), + + public class TeamFolderMetadataSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderMetadata) throws -> JSON { + let output = [ + "team_folder_id": try Serialization._StringSerializer.serialize(value.teamFolderId), + "name": try Serialization._StringSerializer.serialize(value.name), + "status": try Team.TeamFolderStatusSerializer().serialize(value.status), + "is_team_shared_dropbox": try Serialization._BoolSerializer.serialize(value.isTeamSharedDropbox), + "sync_setting": try Files.SyncSettingSerializer().serialize(value.syncSetting), + "content_sync_settings": try ArraySerializer(Files.ContentSyncSettingSerializer()).serialize(value.contentSyncSettings), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderMetadata { + + public func deserialize(_ json: JSON) throws -> TeamFolderMetadata { switch json { - case .dictionary(let dict): - let teamFolderId = Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let status = Team.TeamFolderStatusSerializer().deserialize(dict["status"] ?? .null) - let isTeamSharedDropbox = Serialization._BoolSerializer.deserialize(dict["is_team_shared_dropbox"] ?? .null) - let syncSetting = Files.SyncSettingSerializer().deserialize(dict["sync_setting"] ?? .null) - let contentSyncSettings = ArraySerializer(Files.ContentSyncSettingSerializer()).deserialize(dict["content_sync_settings"] ?? .null) - return TeamFolderMetadata(teamFolderId: teamFolderId, name: name, status: status, isTeamSharedDropbox: isTeamSharedDropbox, syncSetting: syncSetting, contentSyncSettings: contentSyncSettings) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamFolderId = try Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let status = try Team.TeamFolderStatusSerializer().deserialize(dict["status"] ?? .null) + let isTeamSharedDropbox = try Serialization._BoolSerializer.deserialize(dict["is_team_shared_dropbox"] ?? .null) + let syncSetting = try Files.SyncSettingSerializer().deserialize(dict["sync_setting"] ?? .null) + let contentSyncSettings = try ArraySerializer(Files.ContentSyncSettingSerializer()).deserialize(dict["content_sync_settings"] ?? .null) + return TeamFolderMetadata( + teamFolderId: teamFolderId, + name: name, + status: status, + isTeamSharedDropbox: isTeamSharedDropbox, + syncSetting: syncSetting, + contentSyncSettings: contentSyncSettings + ) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderMetadata.self, json: json) } } } /// The TeamFolderPermanentlyDeleteError union - public enum TeamFolderPermanentlyDeleteError: CustomStringConvertible { + public enum TeamFolderPermanentlyDeleteError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Team.TeamFolderAccessError) /// An unspecified error. @@ -11516,59 +14262,69 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderPermanentlyDeleteErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderPermanentlyDeleteErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderPermanentlyDeleteErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderPermanentlyDeleteError: \(error)" + } } } - open class TeamFolderPermanentlyDeleteErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderPermanentlyDeleteError) -> JSON { + + public class TeamFolderPermanentlyDeleteErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderPermanentlyDeleteError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .statusError(let arg): - var d = ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] - d[".tag"] = .str("status_error") - return .dictionary(d) - case .teamSharedDropboxError(let arg): - var d = ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] - d[".tag"] = .str("team_shared_dropbox_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderPermanentlyDeleteError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return TeamFolderPermanentlyDeleteError.accessError(v) - case "status_error": - let v = Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) - return TeamFolderPermanentlyDeleteError.statusError(v) - case "team_shared_dropbox_error": - let v = Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) - return TeamFolderPermanentlyDeleteError.teamSharedDropboxError(v) - case "other": - return TeamFolderPermanentlyDeleteError.other - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .statusError(let arg): + var d = try ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] + d[".tag"] = .str("status_error") + return .dictionary(d) + case .teamSharedDropboxError(let arg): + var d = try ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] + d[".tag"] = .str("team_shared_dropbox_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderPermanentlyDeleteError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return TeamFolderPermanentlyDeleteError.accessError(v) + case "status_error": + let v = try Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) + return TeamFolderPermanentlyDeleteError.statusError(v) + case "team_shared_dropbox_error": + let v = try Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) + return TeamFolderPermanentlyDeleteError.teamSharedDropboxError(v) + case "other": + return TeamFolderPermanentlyDeleteError.other + default: + throw JSONSerializerError.unknownTag(type: TeamFolderPermanentlyDeleteError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderPermanentlyDeleteError.self, json: json) } } } /// The TeamFolderRenameArg struct - open class TeamFolderRenameArg: Team.TeamFolderIdArg { + public class TeamFolderRenameArg: Team.TeamFolderIdArg { /// New team folder name. public let name: String public init(teamFolderId: String, name: String) { @@ -11576,33 +14332,40 @@ open class Team { self.name = name super.init(teamFolderId: teamFolderId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderRenameArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderRenameArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderRenameArg: \(error)" + } } } - open class TeamFolderRenameArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderRenameArg) -> JSON { - let output = [ - "team_folder_id": Serialization._StringSerializer.serialize(value.teamFolderId), - "name": Serialization._StringSerializer.serialize(value.name), + + public class TeamFolderRenameArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderRenameArg) throws -> JSON { + let output = [ + "team_folder_id": try Serialization._StringSerializer.serialize(value.teamFolderId), + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderRenameArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderRenameArg { switch json { - case .dictionary(let dict): - let teamFolderId = Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return TeamFolderRenameArg(teamFolderId: teamFolderId, name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamFolderId = try Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return TeamFolderRenameArg(teamFolderId: teamFolderId, name: name) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderRenameArg.self, json: json) } } } /// The TeamFolderRenameError union - public enum TeamFolderRenameError: CustomStringConvertible { + public enum TeamFolderRenameError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Team.TeamFolderAccessError) /// An unspecified error. @@ -11618,77 +14381,87 @@ open class Team { /// The provided name cannot be used because it is reserved. case folderNameReserved + func json() throws -> JSON { + try TeamFolderRenameErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderRenameErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderRenameErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderRenameError: \(error)" + } } } - open class TeamFolderRenameErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderRenameError) -> JSON { + + public class TeamFolderRenameErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderRenameError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .statusError(let arg): - var d = ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] - d[".tag"] = .str("status_error") - return .dictionary(d) - case .teamSharedDropboxError(let arg): - var d = ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] - d[".tag"] = .str("team_shared_dropbox_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .invalidFolderName: - var d = [String: JSON]() - d[".tag"] = .str("invalid_folder_name") - return .dictionary(d) - case .folderNameAlreadyUsed: - var d = [String: JSON]() - d[".tag"] = .str("folder_name_already_used") - return .dictionary(d) - case .folderNameReserved: - var d = [String: JSON]() - d[".tag"] = .str("folder_name_reserved") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderRenameError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return TeamFolderRenameError.accessError(v) - case "status_error": - let v = Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) - return TeamFolderRenameError.statusError(v) - case "team_shared_dropbox_error": - let v = Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) - return TeamFolderRenameError.teamSharedDropboxError(v) - case "other": - return TeamFolderRenameError.other - case "invalid_folder_name": - return TeamFolderRenameError.invalidFolderName - case "folder_name_already_used": - return TeamFolderRenameError.folderNameAlreadyUsed - case "folder_name_reserved": - return TeamFolderRenameError.folderNameReserved - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .statusError(let arg): + var d = try ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] + d[".tag"] = .str("status_error") + return .dictionary(d) + case .teamSharedDropboxError(let arg): + var d = try ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] + d[".tag"] = .str("team_shared_dropbox_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .invalidFolderName: + var d = [String: JSON]() + d[".tag"] = .str("invalid_folder_name") + return .dictionary(d) + case .folderNameAlreadyUsed: + var d = [String: JSON]() + d[".tag"] = .str("folder_name_already_used") + return .dictionary(d) + case .folderNameReserved: + var d = [String: JSON]() + d[".tag"] = .str("folder_name_reserved") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderRenameError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return TeamFolderRenameError.accessError(v) + case "status_error": + let v = try Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) + return TeamFolderRenameError.statusError(v) + case "team_shared_dropbox_error": + let v = try Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) + return TeamFolderRenameError.teamSharedDropboxError(v) + case "other": + return TeamFolderRenameError.other + case "invalid_folder_name": + return TeamFolderRenameError.invalidFolderName + case "folder_name_already_used": + return TeamFolderRenameError.folderNameAlreadyUsed + case "folder_name_reserved": + return TeamFolderRenameError.folderNameReserved + default: + throw JSONSerializerError.unknownTag(type: TeamFolderRenameError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderRenameError.self, json: json) } } } /// The TeamFolderStatus union - public enum TeamFolderStatus: CustomStringConvertible { + public enum TeamFolderStatus: CustomStringConvertible, JSONRepresentable { /// The team folder and sub-folders are available to all members. case active /// The team folder is not accessible outside of the team folder manager. @@ -11698,138 +14471,166 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderStatus: \(error)" + } } } - open class TeamFolderStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderStatus) -> JSON { + + public class TeamFolderStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderStatus) throws -> JSON { switch value { - case .active: - var d = [String: JSON]() - d[".tag"] = .str("active") - return .dictionary(d) - case .archived: - var d = [String: JSON]() - d[".tag"] = .str("archived") - return .dictionary(d) - case .archiveInProgress: - var d = [String: JSON]() - d[".tag"] = .str("archive_in_progress") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "active": - return TeamFolderStatus.active - case "archived": - return TeamFolderStatus.archived - case "archive_in_progress": - return TeamFolderStatus.archiveInProgress - case "other": - return TeamFolderStatus.other - default: - return TeamFolderStatus.other - } - default: - fatalError("Failed to deserialize") + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .archived: + var d = [String: JSON]() + d[".tag"] = .str("archived") + return .dictionary(d) + case .archiveInProgress: + var d = [String: JSON]() + d[".tag"] = .str("archive_in_progress") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return TeamFolderStatus.active + case "archived": + return TeamFolderStatus.archived + case "archive_in_progress": + return TeamFolderStatus.archiveInProgress + case "other": + return TeamFolderStatus.other + default: + return TeamFolderStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderStatus.self, json: json) } } } /// The TeamFolderTeamSharedDropboxError union - public enum TeamFolderTeamSharedDropboxError: CustomStringConvertible { + public enum TeamFolderTeamSharedDropboxError: CustomStringConvertible, JSONRepresentable { /// This action is not allowed for a shared team root. case disallowed /// An unspecified error. case other + func json() throws -> JSON { + try TeamFolderTeamSharedDropboxErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderTeamSharedDropboxErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderTeamSharedDropboxErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderTeamSharedDropboxError: \(error)" + } } } - open class TeamFolderTeamSharedDropboxErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderTeamSharedDropboxError) -> JSON { + + public class TeamFolderTeamSharedDropboxErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderTeamSharedDropboxError) throws -> JSON { switch value { - case .disallowed: - var d = [String: JSON]() - d[".tag"] = .str("disallowed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderTeamSharedDropboxError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disallowed": - return TeamFolderTeamSharedDropboxError.disallowed - case "other": - return TeamFolderTeamSharedDropboxError.other - default: - return TeamFolderTeamSharedDropboxError.other - } + case .disallowed: + var d = [String: JSON]() + d[".tag"] = .str("disallowed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderTeamSharedDropboxError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disallowed": + return TeamFolderTeamSharedDropboxError.disallowed + case "other": + return TeamFolderTeamSharedDropboxError.other default: - fatalError("Failed to deserialize") + return TeamFolderTeamSharedDropboxError.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderTeamSharedDropboxError.self, json: json) } } } /// The TeamFolderUpdateSyncSettingsArg struct - open class TeamFolderUpdateSyncSettingsArg: Team.TeamFolderIdArg { + public class TeamFolderUpdateSyncSettingsArg: Team.TeamFolderIdArg { /// Sync setting to apply to the team folder itself. Only meaningful if the team folder is not a shared team /// root. public let syncSetting: Files.SyncSettingArg? /// Sync settings to apply to contents of this team folder. - public let contentSyncSettings: Array? - public init(teamFolderId: String, syncSetting: Files.SyncSettingArg? = nil, contentSyncSettings: Array? = nil) { + public let contentSyncSettings: [Files.ContentSyncSettingArg]? + public init(teamFolderId: String, syncSetting: Files.SyncSettingArg? = nil, contentSyncSettings: [Files.ContentSyncSettingArg]? = nil) { self.syncSetting = syncSetting self.contentSyncSettings = contentSyncSettings super.init(teamFolderId: teamFolderId) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderUpdateSyncSettingsArgSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderUpdateSyncSettingsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderUpdateSyncSettingsArg: \(error)" + } } } - open class TeamFolderUpdateSyncSettingsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderUpdateSyncSettingsArg) -> JSON { - let output = [ - "team_folder_id": Serialization._StringSerializer.serialize(value.teamFolderId), - "sync_setting": NullableSerializer(Files.SyncSettingArgSerializer()).serialize(value.syncSetting), - "content_sync_settings": NullableSerializer(ArraySerializer(Files.ContentSyncSettingArgSerializer())).serialize(value.contentSyncSettings), + + public class TeamFolderUpdateSyncSettingsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderUpdateSyncSettingsArg) throws -> JSON { + let output = [ + "team_folder_id": try Serialization._StringSerializer.serialize(value.teamFolderId), + "sync_setting": try NullableSerializer(Files.SyncSettingArgSerializer()).serialize(value.syncSetting), + "content_sync_settings": try NullableSerializer(ArraySerializer(Files.ContentSyncSettingArgSerializer())).serialize(value.contentSyncSettings), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderUpdateSyncSettingsArg { + + public func deserialize(_ json: JSON) throws -> TeamFolderUpdateSyncSettingsArg { switch json { - case .dictionary(let dict): - let teamFolderId = Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) - let syncSetting = NullableSerializer(Files.SyncSettingArgSerializer()).deserialize(dict["sync_setting"] ?? .null) - let contentSyncSettings = NullableSerializer(ArraySerializer(Files.ContentSyncSettingArgSerializer())).deserialize(dict["content_sync_settings"] ?? .null) - return TeamFolderUpdateSyncSettingsArg(teamFolderId: teamFolderId, syncSetting: syncSetting, contentSyncSettings: contentSyncSettings) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamFolderId = try Serialization._StringSerializer.deserialize(dict["team_folder_id"] ?? .null) + let syncSetting = try NullableSerializer(Files.SyncSettingArgSerializer()).deserialize(dict["sync_setting"] ?? .null) + let contentSyncSettings = try NullableSerializer(ArraySerializer(Files.ContentSyncSettingArgSerializer())) + .deserialize(dict["content_sync_settings"] ?? .null) + return TeamFolderUpdateSyncSettingsArg(teamFolderId: teamFolderId, syncSetting: syncSetting, contentSyncSettings: contentSyncSettings) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderUpdateSyncSettingsArg.self, json: json) } } } /// The TeamFolderUpdateSyncSettingsError union - public enum TeamFolderUpdateSyncSettingsError: CustomStringConvertible { + public enum TeamFolderUpdateSyncSettingsError: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accessError(Team.TeamFolderAccessError) /// An unspecified error. @@ -11841,66 +14642,76 @@ open class Team { /// An error occurred setting the sync settings. case syncSettingsError(Files.SyncSettingsError) + func json() throws -> JSON { + try TeamFolderUpdateSyncSettingsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderUpdateSyncSettingsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderUpdateSyncSettingsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderUpdateSyncSettingsError: \(error)" + } } } - open class TeamFolderUpdateSyncSettingsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderUpdateSyncSettingsError) -> JSON { + + public class TeamFolderUpdateSyncSettingsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderUpdateSyncSettingsError) throws -> JSON { switch value { - case .accessError(let arg): - var d = ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] - d[".tag"] = .str("access_error") - return .dictionary(d) - case .statusError(let arg): - var d = ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] - d[".tag"] = .str("status_error") - return .dictionary(d) - case .teamSharedDropboxError(let arg): - var d = ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] - d[".tag"] = .str("team_shared_dropbox_error") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .syncSettingsError(let arg): - var d = ["sync_settings_error": Files.SyncSettingsErrorSerializer().serialize(arg)] - d[".tag"] = .str("sync_settings_error") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamFolderUpdateSyncSettingsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "access_error": - let v = Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) - return TeamFolderUpdateSyncSettingsError.accessError(v) - case "status_error": - let v = Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) - return TeamFolderUpdateSyncSettingsError.statusError(v) - case "team_shared_dropbox_error": - let v = Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) - return TeamFolderUpdateSyncSettingsError.teamSharedDropboxError(v) - case "other": - return TeamFolderUpdateSyncSettingsError.other - case "sync_settings_error": - let v = Files.SyncSettingsErrorSerializer().deserialize(d["sync_settings_error"] ?? .null) - return TeamFolderUpdateSyncSettingsError.syncSettingsError(v) - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .accessError(let arg): + var d = try ["access_error": Team.TeamFolderAccessErrorSerializer().serialize(arg)] + d[".tag"] = .str("access_error") + return .dictionary(d) + case .statusError(let arg): + var d = try ["status_error": Team.TeamFolderInvalidStatusErrorSerializer().serialize(arg)] + d[".tag"] = .str("status_error") + return .dictionary(d) + case .teamSharedDropboxError(let arg): + var d = try ["team_shared_dropbox_error": Team.TeamFolderTeamSharedDropboxErrorSerializer().serialize(arg)] + d[".tag"] = .str("team_shared_dropbox_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .syncSettingsError(let arg): + var d = try ["sync_settings_error": Files.SyncSettingsErrorSerializer().serialize(arg)] + d[".tag"] = .str("sync_settings_error") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamFolderUpdateSyncSettingsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "access_error": + let v = try Team.TeamFolderAccessErrorSerializer().deserialize(d["access_error"] ?? .null) + return TeamFolderUpdateSyncSettingsError.accessError(v) + case "status_error": + let v = try Team.TeamFolderInvalidStatusErrorSerializer().deserialize(d["status_error"] ?? .null) + return TeamFolderUpdateSyncSettingsError.statusError(v) + case "team_shared_dropbox_error": + let v = try Team.TeamFolderTeamSharedDropboxErrorSerializer().deserialize(d["team_shared_dropbox_error"] ?? .null) + return TeamFolderUpdateSyncSettingsError.teamSharedDropboxError(v) + case "other": + return TeamFolderUpdateSyncSettingsError.other + case "sync_settings_error": + let v = try Files.SyncSettingsErrorSerializer().deserialize(d["sync_settings_error"] ?? .null) + return TeamFolderUpdateSyncSettingsError.syncSettingsError(v) + default: + throw JSONSerializerError.unknownTag(type: TeamFolderUpdateSyncSettingsError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamFolderUpdateSyncSettingsError.self, json: json) } } } /// The TeamGetInfoResult struct - open class TeamGetInfoResult: CustomStringConvertible { + public class TeamGetInfoResult: CustomStringConvertible, JSONRepresentable { /// The name of the team. public let name: String /// The ID of the team. @@ -11913,7 +14724,14 @@ open class Team { public let numUsedLicenses: UInt32 /// (no description) public let policies: TeamPolicies.TeamMemberPolicies - public init(name: String, teamId: String, numLicensedUsers: UInt32, numProvisionedUsers: UInt32, numUsedLicenses: UInt32, policies: TeamPolicies.TeamMemberPolicies) { + public init( + name: String, + teamId: String, + numLicensedUsers: UInt32, + numProvisionedUsers: UInt32, + policies: TeamPolicies.TeamMemberPolicies, + numUsedLicenses: UInt32 = 0 + ) { stringValidator()(name) self.name = name stringValidator()(teamId) @@ -11926,41 +14744,59 @@ open class Team { self.numUsedLicenses = numUsedLicenses self.policies = policies } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamGetInfoResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamGetInfoResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamGetInfoResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamGetInfoResult: \(error)" + } } } - open class TeamGetInfoResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamGetInfoResult) -> JSON { - let output = [ - "name": Serialization._StringSerializer.serialize(value.name), - "team_id": Serialization._StringSerializer.serialize(value.teamId), - "num_licensed_users": Serialization._UInt32Serializer.serialize(value.numLicensedUsers), - "num_provisioned_users": Serialization._UInt32Serializer.serialize(value.numProvisionedUsers), - "num_used_licenses": Serialization._UInt32Serializer.serialize(value.numUsedLicenses), - "policies": TeamPolicies.TeamMemberPoliciesSerializer().serialize(value.policies), + + public class TeamGetInfoResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamGetInfoResult) throws -> JSON { + let output = [ + "name": try Serialization._StringSerializer.serialize(value.name), + "team_id": try Serialization._StringSerializer.serialize(value.teamId), + "num_licensed_users": try Serialization._UInt32Serializer.serialize(value.numLicensedUsers), + "num_provisioned_users": try Serialization._UInt32Serializer.serialize(value.numProvisionedUsers), + "policies": try TeamPolicies.TeamMemberPoliciesSerializer().serialize(value.policies), + "num_used_licenses": try Serialization._UInt32Serializer.serialize(value.numUsedLicenses), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamGetInfoResult { + + public func deserialize(_ json: JSON) throws -> TeamGetInfoResult { switch json { - case .dictionary(let dict): - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let teamId = Serialization._StringSerializer.deserialize(dict["team_id"] ?? .null) - let numLicensedUsers = Serialization._UInt32Serializer.deserialize(dict["num_licensed_users"] ?? .null) - let numProvisionedUsers = Serialization._UInt32Serializer.deserialize(dict["num_provisioned_users"] ?? .null) - let numUsedLicenses = Serialization._UInt32Serializer.deserialize(dict["num_used_licenses"] ?? .null) - let policies = TeamPolicies.TeamMemberPoliciesSerializer().deserialize(dict["policies"] ?? .null) - return TeamGetInfoResult(name: name, teamId: teamId, numLicensedUsers: numLicensedUsers, numProvisionedUsers: numProvisionedUsers, numUsedLicenses: numUsedLicenses, policies: policies) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let teamId = try Serialization._StringSerializer.deserialize(dict["team_id"] ?? .null) + let numLicensedUsers = try Serialization._UInt32Serializer.deserialize(dict["num_licensed_users"] ?? .null) + let numProvisionedUsers = try Serialization._UInt32Serializer.deserialize(dict["num_provisioned_users"] ?? .null) + let policies = try TeamPolicies.TeamMemberPoliciesSerializer().deserialize(dict["policies"] ?? .null) + let numUsedLicenses = try Serialization._UInt32Serializer.deserialize(dict["num_used_licenses"] ?? .number(0)) + return TeamGetInfoResult( + name: name, + teamId: teamId, + numLicensedUsers: numLicensedUsers, + numProvisionedUsers: numProvisionedUsers, + policies: policies, + numUsedLicenses: numUsedLicenses + ) + default: + throw JSONSerializerError.deserializeError(type: TeamGetInfoResult.self, json: json) } } } /// Information about a team member. - open class TeamMemberInfo: CustomStringConvertible { + public class TeamMemberInfo: CustomStringConvertible, JSONRepresentable { /// Profile of a user as a member of a team. public let profile: Team.TeamMemberProfile /// The user's role in the team. @@ -11969,167 +14805,260 @@ open class Team { self.profile = profile self.role = role } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMemberInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberInfo: \(error)" + } } } - open class TeamMemberInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberInfo) -> JSON { - let output = [ - "profile": Team.TeamMemberProfileSerializer().serialize(value.profile), - "role": Team.AdminTierSerializer().serialize(value.role), + + public class TeamMemberInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberInfo) throws -> JSON { + let output = [ + "profile": try Team.TeamMemberProfileSerializer().serialize(value.profile), + "role": try Team.AdminTierSerializer().serialize(value.role), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMemberInfo { + + public func deserialize(_ json: JSON) throws -> TeamMemberInfo { switch json { - case .dictionary(let dict): - let profile = Team.TeamMemberProfileSerializer().deserialize(dict["profile"] ?? .null) - let role = Team.AdminTierSerializer().deserialize(dict["role"] ?? .null) - return TeamMemberInfo(profile: profile, role: role) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let profile = try Team.TeamMemberProfileSerializer().deserialize(dict["profile"] ?? .null) + let role = try Team.AdminTierSerializer().deserialize(dict["role"] ?? .null) + return TeamMemberInfo(profile: profile, role: role) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberInfo.self, json: json) } } } /// Information about a team member. - open class TeamMemberInfoV2: CustomStringConvertible { + public class TeamMemberInfoV2: CustomStringConvertible, JSONRepresentable { /// Profile of a user as a member of a team. public let profile: Team.TeamMemberProfile /// The user's roles in the team. - public let roles: Array? - public init(profile: Team.TeamMemberProfile, roles: Array? = nil) { + public let roles: [Team.TeamMemberRole]? + public init(profile: Team.TeamMemberProfile, roles: [Team.TeamMemberRole]? = nil) { self.profile = profile self.roles = roles } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberInfoV2Serializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMemberInfoV2Serializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberInfoV2Serializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberInfoV2: \(error)" + } } } - open class TeamMemberInfoV2Serializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberInfoV2) -> JSON { - let output = [ - "profile": Team.TeamMemberProfileSerializer().serialize(value.profile), - "roles": NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).serialize(value.roles), + + public class TeamMemberInfoV2Serializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberInfoV2) throws -> JSON { + let output = [ + "profile": try Team.TeamMemberProfileSerializer().serialize(value.profile), + "roles": try NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).serialize(value.roles), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMemberInfoV2 { + + public func deserialize(_ json: JSON) throws -> TeamMemberInfoV2 { switch json { - case .dictionary(let dict): - let profile = Team.TeamMemberProfileSerializer().deserialize(dict["profile"] ?? .null) - let roles = NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).deserialize(dict["roles"] ?? .null) - return TeamMemberInfoV2(profile: profile, roles: roles) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let profile = try Team.TeamMemberProfileSerializer().deserialize(dict["profile"] ?? .null) + let roles = try NullableSerializer(ArraySerializer(Team.TeamMemberRoleSerializer())).deserialize(dict["roles"] ?? .null) + return TeamMemberInfoV2(profile: profile, roles: roles) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberInfoV2.self, json: json) } } } /// Information about a team member, after the change, like at membersSetProfileV2. - open class TeamMemberInfoV2Result: CustomStringConvertible { + public class TeamMemberInfoV2Result: CustomStringConvertible, JSONRepresentable { /// Member info, after the change. public let memberInfo: Team.TeamMemberInfoV2 public init(memberInfo: Team.TeamMemberInfoV2) { self.memberInfo = memberInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberInfoV2ResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMemberInfoV2ResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberInfoV2ResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberInfoV2Result: \(error)" + } } } - open class TeamMemberInfoV2ResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberInfoV2Result) -> JSON { - let output = [ - "member_info": Team.TeamMemberInfoV2Serializer().serialize(value.memberInfo), + + public class TeamMemberInfoV2ResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberInfoV2Result) throws -> JSON { + let output = [ + "member_info": try Team.TeamMemberInfoV2Serializer().serialize(value.memberInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMemberInfoV2Result { + + public func deserialize(_ json: JSON) throws -> TeamMemberInfoV2Result { switch json { - case .dictionary(let dict): - let memberInfo = Team.TeamMemberInfoV2Serializer().deserialize(dict["member_info"] ?? .null) - return TeamMemberInfoV2Result(memberInfo: memberInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let memberInfo = try Team.TeamMemberInfoV2Serializer().deserialize(dict["member_info"] ?? .null) + return TeamMemberInfoV2Result(memberInfo: memberInfo) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberInfoV2Result.self, json: json) } } } /// Profile of a user as a member of a team. - open class TeamMemberProfile: Team.MemberProfile { + public class TeamMemberProfile: Team.MemberProfile { /// List of group IDs of groups that the user belongs to. - public let groups: Array + public let groups: [String] /// The namespace id of the user's root folder. public let memberFolderId: String - public init(teamMemberId: String, email: String, emailVerified: Bool, status: Team.TeamMemberStatus, name: Users.Name, membershipType: Team.TeamMembershipType, groups: Array, memberFolderId: String, externalId: String? = nil, accountId: String? = nil, secondaryEmails: Array? = nil, invitedOn: Date? = nil, joinedOn: Date? = nil, suspendedOn: Date? = nil, persistentId: String? = nil, isDirectoryRestricted: Bool? = nil, profilePhotoUrl: String? = nil) { + public init( + teamMemberId: String, + email: String, + emailVerified: Bool, + status: Team.TeamMemberStatus, + name: Users.Name, + membershipType: Team.TeamMembershipType, + groups: [String], + memberFolderId: String, + externalId: String? = nil, + accountId: String? = nil, + secondaryEmails: [SecondaryEmails.SecondaryEmail]? = nil, + invitedOn: Date? = nil, + joinedOn: Date? = nil, + suspendedOn: Date? = nil, + persistentId: String? = nil, + isDirectoryRestricted: Bool? = nil, + profilePhotoUrl: String? = nil + ) { arrayValidator(itemValidator: stringValidator())(groups) self.groups = groups stringValidator(pattern: "[-_0-9a-zA-Z:]+")(memberFolderId) self.memberFolderId = memberFolderId - super.init(teamMemberId: teamMemberId, email: email, emailVerified: emailVerified, status: status, name: name, membershipType: membershipType, externalId: externalId, accountId: accountId, secondaryEmails: secondaryEmails, invitedOn: invitedOn, joinedOn: joinedOn, suspendedOn: suspendedOn, persistentId: persistentId, isDirectoryRestricted: isDirectoryRestricted, profilePhotoUrl: profilePhotoUrl) - } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberProfileSerializer().serialize(self)))" - } - } - open class TeamMemberProfileSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberProfile) -> JSON { - let output = [ - "team_member_id": Serialization._StringSerializer.serialize(value.teamMemberId), - "email": Serialization._StringSerializer.serialize(value.email), - "email_verified": Serialization._BoolSerializer.serialize(value.emailVerified), - "status": Team.TeamMemberStatusSerializer().serialize(value.status), - "name": Users.NameSerializer().serialize(value.name), - "membership_type": Team.TeamMembershipTypeSerializer().serialize(value.membershipType), - "groups": ArraySerializer(Serialization._StringSerializer).serialize(value.groups), - "member_folder_id": Serialization._StringSerializer.serialize(value.memberFolderId), - "external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.externalId), - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), - "secondary_emails": NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())).serialize(value.secondaryEmails), - "invited_on": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.invitedOn), - "joined_on": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.joinedOn), - "suspended_on": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.suspendedOn), - "persistent_id": NullableSerializer(Serialization._StringSerializer).serialize(value.persistentId), - "is_directory_restricted": NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), - "profile_photo_url": NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> TeamMemberProfile { - switch json { - case .dictionary(let dict): - let teamMemberId = Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) - let email = Serialization._StringSerializer.deserialize(dict["email"] ?? .null) - let emailVerified = Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) - let status = Team.TeamMemberStatusSerializer().deserialize(dict["status"] ?? .null) - let name = Users.NameSerializer().deserialize(dict["name"] ?? .null) - let membershipType = Team.TeamMembershipTypeSerializer().deserialize(dict["membership_type"] ?? .null) - let groups = ArraySerializer(Serialization._StringSerializer).deserialize(dict["groups"] ?? .null) - let memberFolderId = Serialization._StringSerializer.deserialize(dict["member_folder_id"] ?? .null) - let externalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["external_id"] ?? .null) - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - let secondaryEmails = NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())).deserialize(dict["secondary_emails"] ?? .null) - let invitedOn = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["invited_on"] ?? .null) - let joinedOn = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["joined_on"] ?? .null) - let suspendedOn = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["suspended_on"] ?? .null) - let persistentId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["persistent_id"] ?? .null) - let isDirectoryRestricted = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) - let profilePhotoUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) - return TeamMemberProfile(teamMemberId: teamMemberId, email: email, emailVerified: emailVerified, status: status, name: name, membershipType: membershipType, groups: groups, memberFolderId: memberFolderId, externalId: externalId, accountId: accountId, secondaryEmails: secondaryEmails, invitedOn: invitedOn, joinedOn: joinedOn, suspendedOn: suspendedOn, persistentId: persistentId, isDirectoryRestricted: isDirectoryRestricted, profilePhotoUrl: profilePhotoUrl) - default: - fatalError("Type error deserializing") + super.init( + teamMemberId: teamMemberId, + email: email, + emailVerified: emailVerified, + status: status, + name: name, + membershipType: membershipType, + externalId: externalId, + accountId: accountId, + secondaryEmails: secondaryEmails, + invitedOn: invitedOn, + joinedOn: joinedOn, + suspendedOn: suspendedOn, + persistentId: persistentId, + isDirectoryRestricted: isDirectoryRestricted, + profilePhotoUrl: profilePhotoUrl + ) + } + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberProfileSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberProfile: \(error)" + } + } + } + + public class TeamMemberProfileSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberProfile) throws -> JSON { + let output = [ + "team_member_id": try Serialization._StringSerializer.serialize(value.teamMemberId), + "email": try Serialization._StringSerializer.serialize(value.email), + "email_verified": try Serialization._BoolSerializer.serialize(value.emailVerified), + "status": try Team.TeamMemberStatusSerializer().serialize(value.status), + "name": try Users.NameSerializer().serialize(value.name), + "membership_type": try Team.TeamMembershipTypeSerializer().serialize(value.membershipType), + "groups": try ArraySerializer(Serialization._StringSerializer).serialize(value.groups), + "member_folder_id": try Serialization._StringSerializer.serialize(value.memberFolderId), + "external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.externalId), + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + "secondary_emails": try NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())).serialize(value.secondaryEmails), + "invited_on": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.invitedOn), + "joined_on": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.joinedOn), + "suspended_on": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.suspendedOn), + "persistent_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.persistentId), + "is_directory_restricted": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isDirectoryRestricted), + "profile_photo_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> TeamMemberProfile { + switch json { + case .dictionary(let dict): + let teamMemberId = try Serialization._StringSerializer.deserialize(dict["team_member_id"] ?? .null) + let email = try Serialization._StringSerializer.deserialize(dict["email"] ?? .null) + let emailVerified = try Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) + let status = try Team.TeamMemberStatusSerializer().deserialize(dict["status"] ?? .null) + let name = try Users.NameSerializer().deserialize(dict["name"] ?? .null) + let membershipType = try Team.TeamMembershipTypeSerializer().deserialize(dict["membership_type"] ?? .null) + let groups = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["groups"] ?? .null) + let memberFolderId = try Serialization._StringSerializer.deserialize(dict["member_folder_id"] ?? .null) + let externalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["external_id"] ?? .null) + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + let secondaryEmails = try NullableSerializer(ArraySerializer(SecondaryEmails.SecondaryEmailSerializer())) + .deserialize(dict["secondary_emails"] ?? .null) + let invitedOn = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["invited_on"] ?? .null) + let joinedOn = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["joined_on"] ?? .null) + let suspendedOn = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["suspended_on"] ?? .null) + let persistentId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["persistent_id"] ?? .null) + let isDirectoryRestricted = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_directory_restricted"] ?? .null) + let profilePhotoUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) + return TeamMemberProfile( + teamMemberId: teamMemberId, + email: email, + emailVerified: emailVerified, + status: status, + name: name, + membershipType: membershipType, + groups: groups, + memberFolderId: memberFolderId, + externalId: externalId, + accountId: accountId, + secondaryEmails: secondaryEmails, + invitedOn: invitedOn, + joinedOn: joinedOn, + suspendedOn: suspendedOn, + persistentId: persistentId, + isDirectoryRestricted: isDirectoryRestricted, + profilePhotoUrl: profilePhotoUrl + ) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberProfile.self, json: json) } } } /// A role which can be attached to a team member. This replaces AdminTier; each AdminTier corresponds to a new /// TeamMemberRole with a matching name. - open class TeamMemberRole: CustomStringConvertible { + public class TeamMemberRole: CustomStringConvertible, JSONRepresentable { /// A string containing encoded role ID. For roles defined by Dropbox, this is the same across all teams. public let roleId: String /// The role display name. @@ -12144,35 +15073,46 @@ open class Team { stringValidator(maxLength: 256)(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberRoleSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMemberRoleSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberRoleSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberRole: \(error)" + } } } - open class TeamMemberRoleSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberRole) -> JSON { - let output = [ - "role_id": Serialization._StringSerializer.serialize(value.roleId), - "name": Serialization._StringSerializer.serialize(value.name), - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMemberRoleSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberRole) throws -> JSON { + let output = [ + "role_id": try Serialization._StringSerializer.serialize(value.roleId), + "name": try Serialization._StringSerializer.serialize(value.name), + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMemberRole { + + public func deserialize(_ json: JSON) throws -> TeamMemberRole { switch json { - case .dictionary(let dict): - let roleId = Serialization._StringSerializer.deserialize(dict["role_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMemberRole(roleId: roleId, name: name, description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let roleId = try Serialization._StringSerializer.deserialize(dict["role_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMemberRole(roleId: roleId, name: name, description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberRole.self, json: json) } } } /// The user's status as a member of a specific team. - public enum TeamMemberStatus: CustomStringConvertible { + public enum TeamMemberStatus: CustomStringConvertible, JSONRepresentable { /// User has successfully joined the team. case active /// User has been invited to a team, but has not joined the team yet. @@ -12184,205 +15124,257 @@ open class Team { /// members/list. case removed(Team.RemovedStatus) + func json() throws -> JSON { + try TeamMemberStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberStatus: \(error)" + } } } - open class TeamMemberStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberStatus) -> JSON { + + public class TeamMemberStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberStatus) throws -> JSON { switch value { - case .active: - var d = [String: JSON]() - d[".tag"] = .str("active") - return .dictionary(d) - case .invited: - var d = [String: JSON]() - d[".tag"] = .str("invited") - return .dictionary(d) - case .suspended: - var d = [String: JSON]() - d[".tag"] = .str("suspended") - return .dictionary(d) - case .removed(let arg): - var d = Serialization.getFields(Team.RemovedStatusSerializer().serialize(arg)) - d[".tag"] = .str("removed") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamMemberStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "active": - return TeamMemberStatus.active - case "invited": - return TeamMemberStatus.invited - case "suspended": - return TeamMemberStatus.suspended - case "removed": - let v = Team.RemovedStatusSerializer().deserialize(json) - return TeamMemberStatus.removed(v) - default: - fatalError("Unknown tag \(tag)") - } - default: - fatalError("Failed to deserialize") + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .invited: + var d = [String: JSON]() + d[".tag"] = .str("invited") + return .dictionary(d) + case .suspended: + var d = [String: JSON]() + d[".tag"] = .str("suspended") + return .dictionary(d) + case .removed(let arg): + var d = try Serialization.getFields(Team.RemovedStatusSerializer().serialize(arg)) + d[".tag"] = .str("removed") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamMemberStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return TeamMemberStatus.active + case "invited": + return TeamMemberStatus.invited + case "suspended": + return TeamMemberStatus.suspended + case "removed": + let v = try Team.RemovedStatusSerializer().deserialize(json) + return TeamMemberStatus.removed(v) + default: + throw JSONSerializerError.unknownTag(type: TeamMemberStatus.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamMemberStatus.self, json: json) } } } /// The TeamMembershipType union - public enum TeamMembershipType: CustomStringConvertible { + public enum TeamMembershipType: CustomStringConvertible, JSONRepresentable { /// User uses a license and has full access to team resources like the shared quota. case full /// User does not have access to the shared quota and team admins have restricted administrative control. case limited + func json() throws -> JSON { + try TeamMembershipTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMembershipTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMembershipTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMembershipType: \(error)" + } } } - open class TeamMembershipTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMembershipType) -> JSON { + + public class TeamMembershipTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMembershipType) throws -> JSON { switch value { - case .full: - var d = [String: JSON]() - d[".tag"] = .str("full") - return .dictionary(d) - case .limited: - var d = [String: JSON]() - d[".tag"] = .str("limited") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamMembershipType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "full": - return TeamMembershipType.full - case "limited": - return TeamMembershipType.limited - default: - fatalError("Unknown tag \(tag)") - } + case .full: + var d = [String: JSON]() + d[".tag"] = .str("full") + return .dictionary(d) + case .limited: + var d = [String: JSON]() + d[".tag"] = .str("limited") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamMembershipType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "full": + return TeamMembershipType.full + case "limited": + return TeamMembershipType.limited default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: TeamMembershipType.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamMembershipType.self, json: json) } } } /// The TeamNamespacesListArg struct - open class TeamNamespacesListArg: CustomStringConvertible { + public class TeamNamespacesListArg: CustomStringConvertible, JSONRepresentable { /// Specifying a value here has no effect. public let limit: UInt32 - public init(limit: UInt32 = 1000) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init(limit: UInt32 = 1_000) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamNamespacesListArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamNamespacesListArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamNamespacesListArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamNamespacesListArg: \(error)" + } } } - open class TeamNamespacesListArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamNamespacesListArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), + + public class TeamNamespacesListArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamNamespacesListArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamNamespacesListArg { + + public func deserialize(_ json: JSON) throws -> TeamNamespacesListArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - return TeamNamespacesListArg(limit: limit) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + return TeamNamespacesListArg(limit: limit) + default: + throw JSONSerializerError.deserializeError(type: TeamNamespacesListArg.self, json: json) } } } /// The TeamNamespacesListContinueArg struct - open class TeamNamespacesListContinueArg: CustomStringConvertible { + public class TeamNamespacesListContinueArg: CustomStringConvertible, JSONRepresentable { /// Indicates from what point to get the next set of team-accessible namespaces. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamNamespacesListContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamNamespacesListContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamNamespacesListContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamNamespacesListContinueArg: \(error)" + } } } - open class TeamNamespacesListContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamNamespacesListContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class TeamNamespacesListContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamNamespacesListContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamNamespacesListContinueArg { + + public func deserialize(_ json: JSON) throws -> TeamNamespacesListContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return TeamNamespacesListContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return TeamNamespacesListContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: TeamNamespacesListContinueArg.self, json: json) } } } /// The TeamNamespacesListError union - public enum TeamNamespacesListError: CustomStringConvertible { + public enum TeamNamespacesListError: CustomStringConvertible, JSONRepresentable { /// Argument passed in is invalid. case invalidArg /// An unspecified error. case other + func json() throws -> JSON { + try TeamNamespacesListErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamNamespacesListErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamNamespacesListErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamNamespacesListError: \(error)" + } } } - open class TeamNamespacesListErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamNamespacesListError) -> JSON { + + public class TeamNamespacesListErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamNamespacesListError) throws -> JSON { switch value { - case .invalidArg: - var d = [String: JSON]() - d[".tag"] = .str("invalid_arg") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamNamespacesListError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_arg": - return TeamNamespacesListError.invalidArg - case "other": - return TeamNamespacesListError.other - default: - return TeamNamespacesListError.other - } + case .invalidArg: + var d = [String: JSON]() + d[".tag"] = .str("invalid_arg") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamNamespacesListError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_arg": + return TeamNamespacesListError.invalidArg + case "other": + return TeamNamespacesListError.other default: - fatalError("Failed to deserialize") + return TeamNamespacesListError.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamNamespacesListError.self, json: json) } } } /// The TeamNamespacesListContinueError union - public enum TeamNamespacesListContinueError: CustomStringConvertible { + public enum TeamNamespacesListContinueError: CustomStringConvertible, JSONRepresentable { /// Argument passed in is invalid. case invalidArg /// An unspecified error. @@ -12390,92 +15382,113 @@ open class Team { /// The cursor is invalid. case invalidCursor + func json() throws -> JSON { + try TeamNamespacesListContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamNamespacesListContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamNamespacesListContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamNamespacesListContinueError: \(error)" + } } } - open class TeamNamespacesListContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamNamespacesListContinueError) -> JSON { + + public class TeamNamespacesListContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamNamespacesListContinueError) throws -> JSON { switch value { - case .invalidArg: - var d = [String: JSON]() - d[".tag"] = .str("invalid_arg") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - case .invalidCursor: - var d = [String: JSON]() - d[".tag"] = .str("invalid_cursor") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamNamespacesListContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invalid_arg": - return TeamNamespacesListContinueError.invalidArg - case "other": - return TeamNamespacesListContinueError.other - case "invalid_cursor": - return TeamNamespacesListContinueError.invalidCursor - default: - fatalError("Unknown tag \(tag)") - } + case .invalidArg: + var d = [String: JSON]() + d[".tag"] = .str("invalid_arg") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + case .invalidCursor: + var d = [String: JSON]() + d[".tag"] = .str("invalid_cursor") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamNamespacesListContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invalid_arg": + return TeamNamespacesListContinueError.invalidArg + case "other": + return TeamNamespacesListContinueError.other + case "invalid_cursor": + return TeamNamespacesListContinueError.invalidCursor default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: TeamNamespacesListContinueError.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: TeamNamespacesListContinueError.self, json: json) } } } /// Result for namespacesList. - open class TeamNamespacesListResult: CustomStringConvertible { + public class TeamNamespacesListResult: CustomStringConvertible, JSONRepresentable { /// List of all namespaces the team can access. - public let namespaces: Array + public let namespaces: [Team.NamespaceMetadata] /// Pass the cursor into namespacesListContinue to obtain additional namespaces. Note that duplicate namespaces /// may be returned. public let cursor: String /// Is true if there are additional namespaces that have not been returned yet. public let hasMore: Bool - public init(namespaces: Array, cursor: String, hasMore: Bool) { + public init(namespaces: [Team.NamespaceMetadata], cursor: String, hasMore: Bool) { self.namespaces = namespaces stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamNamespacesListResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamNamespacesListResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamNamespacesListResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamNamespacesListResult: \(error)" + } } } - open class TeamNamespacesListResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamNamespacesListResult) -> JSON { - let output = [ - "namespaces": ArraySerializer(Team.NamespaceMetadataSerializer()).serialize(value.namespaces), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class TeamNamespacesListResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamNamespacesListResult) throws -> JSON { + let output = [ + "namespaces": try ArraySerializer(Team.NamespaceMetadataSerializer()).serialize(value.namespaces), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamNamespacesListResult { + + public func deserialize(_ json: JSON) throws -> TeamNamespacesListResult { switch json { - case .dictionary(let dict): - let namespaces = ArraySerializer(Team.NamespaceMetadataSerializer()).deserialize(dict["namespaces"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return TeamNamespacesListResult(namespaces: namespaces, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let namespaces = try ArraySerializer(Team.NamespaceMetadataSerializer()).deserialize(dict["namespaces"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return TeamNamespacesListResult(namespaces: namespaces, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: TeamNamespacesListResult.self, json: json) } } } /// The TeamReportFailureReason union - public enum TeamReportFailureReason: CustomStringConvertible { + public enum TeamReportFailureReason: CustomStringConvertible, JSONRepresentable { /// We couldn't create the report, but we think this was a fluke. Everything should work if you try it again. case temporaryError /// Too many other reports are being created right now. Try creating this report again once the others finish. @@ -12485,56 +15498,66 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TeamReportFailureReasonSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamReportFailureReasonSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamReportFailureReasonSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamReportFailureReason: \(error)" + } } } - open class TeamReportFailureReasonSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamReportFailureReason) -> JSON { + + public class TeamReportFailureReasonSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamReportFailureReason) throws -> JSON { switch value { - case .temporaryError: - var d = [String: JSON]() - d[".tag"] = .str("temporary_error") - return .dictionary(d) - case .manyReportsAtOnce: - var d = [String: JSON]() - d[".tag"] = .str("many_reports_at_once") - return .dictionary(d) - case .tooMuchData: - var d = [String: JSON]() - d[".tag"] = .str("too_much_data") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamReportFailureReason { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "temporary_error": - return TeamReportFailureReason.temporaryError - case "many_reports_at_once": - return TeamReportFailureReason.manyReportsAtOnce - case "too_much_data": - return TeamReportFailureReason.tooMuchData - case "other": - return TeamReportFailureReason.other - default: - return TeamReportFailureReason.other - } - default: - fatalError("Failed to deserialize") + case .temporaryError: + var d = [String: JSON]() + d[".tag"] = .str("temporary_error") + return .dictionary(d) + case .manyReportsAtOnce: + var d = [String: JSON]() + d[".tag"] = .str("many_reports_at_once") + return .dictionary(d) + case .tooMuchData: + var d = [String: JSON]() + d[".tag"] = .str("too_much_data") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamReportFailureReason { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "temporary_error": + return TeamReportFailureReason.temporaryError + case "many_reports_at_once": + return TeamReportFailureReason.manyReportsAtOnce + case "too_much_data": + return TeamReportFailureReason.tooMuchData + case "other": + return TeamReportFailureReason.other + default: + return TeamReportFailureReason.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamReportFailureReason.self, json: json) } } } /// Error returned by tokenGetAuthenticatedAdmin. - public enum TokenGetAuthenticatedAdminError: CustomStringConvertible { + public enum TokenGetAuthenticatedAdminError: CustomStringConvertible, JSONRepresentable { /// The current token is not associated with a team admin, because mappings were not recorded when the token was /// created. Consider re-authorizing a new access token to record its authenticating admin. case mappingNotFound @@ -12544,80 +15567,101 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try TokenGetAuthenticatedAdminErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TokenGetAuthenticatedAdminErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TokenGetAuthenticatedAdminErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TokenGetAuthenticatedAdminError: \(error)" + } } } - open class TokenGetAuthenticatedAdminErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TokenGetAuthenticatedAdminError) -> JSON { + + public class TokenGetAuthenticatedAdminErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TokenGetAuthenticatedAdminError) throws -> JSON { switch value { - case .mappingNotFound: - var d = [String: JSON]() - d[".tag"] = .str("mapping_not_found") - return .dictionary(d) - case .adminNotActive: - var d = [String: JSON]() - d[".tag"] = .str("admin_not_active") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TokenGetAuthenticatedAdminError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "mapping_not_found": - return TokenGetAuthenticatedAdminError.mappingNotFound - case "admin_not_active": - return TokenGetAuthenticatedAdminError.adminNotActive - case "other": - return TokenGetAuthenticatedAdminError.other - default: - return TokenGetAuthenticatedAdminError.other - } + case .mappingNotFound: + var d = [String: JSON]() + d[".tag"] = .str("mapping_not_found") + return .dictionary(d) + case .adminNotActive: + var d = [String: JSON]() + d[".tag"] = .str("admin_not_active") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TokenGetAuthenticatedAdminError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "mapping_not_found": + return TokenGetAuthenticatedAdminError.mappingNotFound + case "admin_not_active": + return TokenGetAuthenticatedAdminError.adminNotActive + case "other": + return TokenGetAuthenticatedAdminError.other default: - fatalError("Failed to deserialize") + return TokenGetAuthenticatedAdminError.other + } + default: + throw JSONSerializerError.deserializeError(type: TokenGetAuthenticatedAdminError.self, json: json) } } } /// Results for tokenGetAuthenticatedAdmin. - open class TokenGetAuthenticatedAdminResult: CustomStringConvertible { + public class TokenGetAuthenticatedAdminResult: CustomStringConvertible, JSONRepresentable { /// The admin who authorized the token. public let adminProfile: Team.TeamMemberProfile public init(adminProfile: Team.TeamMemberProfile) { self.adminProfile = adminProfile } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TokenGetAuthenticatedAdminResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try TokenGetAuthenticatedAdminResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TokenGetAuthenticatedAdminResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TokenGetAuthenticatedAdminResult: \(error)" + } } } - open class TokenGetAuthenticatedAdminResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TokenGetAuthenticatedAdminResult) -> JSON { - let output = [ - "admin_profile": Team.TeamMemberProfileSerializer().serialize(value.adminProfile), + + public class TokenGetAuthenticatedAdminResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TokenGetAuthenticatedAdminResult) throws -> JSON { + let output = [ + "admin_profile": try Team.TeamMemberProfileSerializer().serialize(value.adminProfile), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TokenGetAuthenticatedAdminResult { + + public func deserialize(_ json: JSON) throws -> TokenGetAuthenticatedAdminResult { switch json { - case .dictionary(let dict): - let adminProfile = Team.TeamMemberProfileSerializer().deserialize(dict["admin_profile"] ?? .null) - return TokenGetAuthenticatedAdminResult(adminProfile: adminProfile) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let adminProfile = try Team.TeamMemberProfileSerializer().deserialize(dict["admin_profile"] ?? .null) + return TokenGetAuthenticatedAdminResult(adminProfile: adminProfile) + default: + throw JSONSerializerError.deserializeError(type: TokenGetAuthenticatedAdminResult.self, json: json) } } } /// The value for uploadApiRateLimit in Feature. - public enum UploadApiRateLimitValue: CustomStringConvertible { + public enum UploadApiRateLimitValue: CustomStringConvertible, JSONRepresentable { /// This team has unlimited upload API quota. So far both server version account and legacy account type have /// unlimited monthly upload api quota. case unlimited @@ -12626,53 +15670,63 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try UploadApiRateLimitValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UploadApiRateLimitValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UploadApiRateLimitValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UploadApiRateLimitValue: \(error)" + } } } - open class UploadApiRateLimitValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UploadApiRateLimitValue) -> JSON { + + public class UploadApiRateLimitValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UploadApiRateLimitValue) throws -> JSON { switch value { - case .unlimited: - var d = [String: JSON]() - d[".tag"] = .str("unlimited") - return .dictionary(d) - case .limit(let arg): - var d = ["limit": Serialization._UInt32Serializer.serialize(arg)] - d[".tag"] = .str("limit") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UploadApiRateLimitValue { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unlimited": - return UploadApiRateLimitValue.unlimited - case "limit": - let v = Serialization._UInt32Serializer.deserialize(d["limit"] ?? .null) - return UploadApiRateLimitValue.limit(v) - case "other": - return UploadApiRateLimitValue.other - default: - return UploadApiRateLimitValue.other - } + case .unlimited: + var d = [String: JSON]() + d[".tag"] = .str("unlimited") + return .dictionary(d) + case .limit(let arg): + var d = try ["limit": Serialization._UInt32Serializer.serialize(arg)] + d[".tag"] = .str("limit") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UploadApiRateLimitValue { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unlimited": + return UploadApiRateLimitValue.unlimited + case "limit": + let v = try Serialization._UInt32Serializer.deserialize(d["limit"] ?? .null) + return UploadApiRateLimitValue.limit(v) + case "other": + return UploadApiRateLimitValue.other default: - fatalError("Failed to deserialize") + return UploadApiRateLimitValue.other + } + default: + throw JSONSerializerError.deserializeError(type: UploadApiRateLimitValue.self, json: json) } } } /// Result of trying to add secondary emails to a user. 'success' is the only value indicating that a user was - /// successfully retrieved for adding secondary emails. The other values explain the type of error that occurred, - /// and include the user for which the error occurred. - public enum UserAddResult: CustomStringConvertible { + /// successfully retrieved for adding secondary emails. The other values explain the type of error that + /// occurred, and include the user for which the error occurred. + public enum UserAddResult: CustomStringConvertible, JSONRepresentable { /// Describes a user and the results for each attempt to add a secondary email. case success(Team.UserSecondaryEmailsResult) /// Specified user is not a valid target for adding secondary emails. @@ -12684,66 +15738,76 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try UserAddResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserAddResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserAddResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserAddResult: \(error)" + } } } - open class UserAddResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserAddResult) -> JSON { + + public class UserAddResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserAddResult) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Team.UserSecondaryEmailsResultSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .invalidUser(let arg): - var d = ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("invalid_user") - return .dictionary(d) - case .unverified(let arg): - var d = ["unverified": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("unverified") - return .dictionary(d) - case .placeholderUser(let arg): - var d = ["placeholder_user": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("placeholder_user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UserAddResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Team.UserSecondaryEmailsResultSerializer().deserialize(json) - return UserAddResult.success(v) - case "invalid_user": - let v = Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) - return UserAddResult.invalidUser(v) - case "unverified": - let v = Team.UserSelectorArgSerializer().deserialize(d["unverified"] ?? .null) - return UserAddResult.unverified(v) - case "placeholder_user": - let v = Team.UserSelectorArgSerializer().deserialize(d["placeholder_user"] ?? .null) - return UserAddResult.placeholderUser(v) - case "other": - return UserAddResult.other - default: - return UserAddResult.other - } - default: - fatalError("Failed to deserialize") + case .success(let arg): + var d = try Serialization.getFields(Team.UserSecondaryEmailsResultSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .invalidUser(let arg): + var d = try ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("invalid_user") + return .dictionary(d) + case .unverified(let arg): + var d = try ["unverified": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("unverified") + return .dictionary(d) + case .placeholderUser(let arg): + var d = try ["placeholder_user": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("placeholder_user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UserAddResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Team.UserSecondaryEmailsResultSerializer().deserialize(json) + return UserAddResult.success(v) + case "invalid_user": + let v = try Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) + return UserAddResult.invalidUser(v) + case "unverified": + let v = try Team.UserSelectorArgSerializer().deserialize(d["unverified"] ?? .null) + return UserAddResult.unverified(v) + case "placeholder_user": + let v = try Team.UserSelectorArgSerializer().deserialize(d["placeholder_user"] ?? .null) + return UserAddResult.placeholderUser(v) + case "other": + return UserAddResult.other + default: + return UserAddResult.other + } + default: + throw JSONSerializerError.deserializeError(type: UserAddResult.self, json: json) } } } /// User and their required custom quota in GB (1 TB = 1024 GB). - open class UserCustomQuotaArg: CustomStringConvertible { + public class UserCustomQuotaArg: CustomStringConvertible, JSONRepresentable { /// (no description) public let user: Team.UserSelectorArg /// (no description) @@ -12753,33 +15817,44 @@ open class Team { comparableValidator(minValue: 15)(quotaGb) self.quotaGb = quotaGb } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserCustomQuotaArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserCustomQuotaArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserCustomQuotaArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserCustomQuotaArg: \(error)" + } } } - open class UserCustomQuotaArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserCustomQuotaArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "quota_gb": Serialization._UInt32Serializer.serialize(value.quotaGb), + + public class UserCustomQuotaArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserCustomQuotaArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "quota_gb": try Serialization._UInt32Serializer.serialize(value.quotaGb), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserCustomQuotaArg { + + public func deserialize(_ json: JSON) throws -> UserCustomQuotaArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let quotaGb = Serialization._UInt32Serializer.deserialize(dict["quota_gb"] ?? .null) - return UserCustomQuotaArg(user: user, quotaGb: quotaGb) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let quotaGb = try Serialization._UInt32Serializer.deserialize(dict["quota_gb"] ?? .null) + return UserCustomQuotaArg(user: user, quotaGb: quotaGb) + default: + throw JSONSerializerError.deserializeError(type: UserCustomQuotaArg.self, json: json) } } } /// User and their custom quota in GB (1 TB = 1024 GB). No quota returns if the user has no custom quota set. - open class UserCustomQuotaResult: CustomStringConvertible { + public class UserCustomQuotaResult: CustomStringConvertible, JSONRepresentable { /// (no description) public let user: Team.UserSelectorArg /// (no description) @@ -12789,70 +15864,92 @@ open class Team { nullableValidator(comparableValidator(minValue: 15))(quotaGb) self.quotaGb = quotaGb } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserCustomQuotaResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserCustomQuotaResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserCustomQuotaResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserCustomQuotaResult: \(error)" + } } } - open class UserCustomQuotaResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserCustomQuotaResult) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "quota_gb": NullableSerializer(Serialization._UInt32Serializer).serialize(value.quotaGb), + + public class UserCustomQuotaResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserCustomQuotaResult) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "quota_gb": try NullableSerializer(Serialization._UInt32Serializer).serialize(value.quotaGb), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserCustomQuotaResult { + + public func deserialize(_ json: JSON) throws -> UserCustomQuotaResult { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let quotaGb = NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["quota_gb"] ?? .null) - return UserCustomQuotaResult(user: user, quotaGb: quotaGb) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let quotaGb = try NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["quota_gb"] ?? .null) + return UserCustomQuotaResult(user: user, quotaGb: quotaGb) + default: + throw JSONSerializerError.deserializeError(type: UserCustomQuotaResult.self, json: json) } } } /// The UserDeleteEmailsResult struct - open class UserDeleteEmailsResult: CustomStringConvertible { + public class UserDeleteEmailsResult: CustomStringConvertible, JSONRepresentable { /// (no description) public let user: Team.UserSelectorArg /// (no description) - public let results: Array - public init(user: Team.UserSelectorArg, results: Array) { + public let results: [Team.DeleteSecondaryEmailResult] + public init(user: Team.UserSelectorArg, results: [Team.DeleteSecondaryEmailResult]) { self.user = user self.results = results } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserDeleteEmailsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserDeleteEmailsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserDeleteEmailsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserDeleteEmailsResult: \(error)" + } } } - open class UserDeleteEmailsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserDeleteEmailsResult) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "results": ArraySerializer(Team.DeleteSecondaryEmailResultSerializer()).serialize(value.results), + + public class UserDeleteEmailsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserDeleteEmailsResult) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "results": try ArraySerializer(Team.DeleteSecondaryEmailResultSerializer()).serialize(value.results), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserDeleteEmailsResult { + + public func deserialize(_ json: JSON) throws -> UserDeleteEmailsResult { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let results = ArraySerializer(Team.DeleteSecondaryEmailResultSerializer()).deserialize(dict["results"] ?? .null) - return UserDeleteEmailsResult(user: user, results: results) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let results = try ArraySerializer(Team.DeleteSecondaryEmailResultSerializer()).deserialize(dict["results"] ?? .null) + return UserDeleteEmailsResult(user: user, results: results) + default: + throw JSONSerializerError.deserializeError(type: UserDeleteEmailsResult.self, json: json) } } } /// Result of trying to delete a user's secondary emails. 'success' is the only value indicating that a user was - /// successfully retrieved for deleting secondary emails. The other values explain the type of error that occurred, - /// and include the user for which the error occurred. - public enum UserDeleteResult: CustomStringConvertible { + /// successfully retrieved for deleting secondary emails. The other values explain the type of error that + /// occurred, and include the user for which the error occurred. + public enum UserDeleteResult: CustomStringConvertible, JSONRepresentable { /// Describes a user and the results for each attempt to delete a secondary email. case success(Team.UserDeleteEmailsResult) /// Specified user is not a valid target for deleting secondary emails. @@ -12860,81 +15957,102 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try UserDeleteResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserDeleteResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserDeleteResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserDeleteResult: \(error)" + } } } - open class UserDeleteResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserDeleteResult) -> JSON { + + public class UserDeleteResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserDeleteResult) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Team.UserDeleteEmailsResultSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .invalidUser(let arg): - var d = ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("invalid_user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UserDeleteResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Team.UserDeleteEmailsResultSerializer().deserialize(json) - return UserDeleteResult.success(v) - case "invalid_user": - let v = Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) - return UserDeleteResult.invalidUser(v) - case "other": - return UserDeleteResult.other - default: - return UserDeleteResult.other - } + case .success(let arg): + var d = try Serialization.getFields(Team.UserDeleteEmailsResultSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .invalidUser(let arg): + var d = try ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("invalid_user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UserDeleteResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Team.UserDeleteEmailsResultSerializer().deserialize(json) + return UserDeleteResult.success(v) + case "invalid_user": + let v = try Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) + return UserDeleteResult.invalidUser(v) + case "other": + return UserDeleteResult.other default: - fatalError("Failed to deserialize") + return UserDeleteResult.other + } + default: + throw JSONSerializerError.deserializeError(type: UserDeleteResult.self, json: json) } } } /// The UserResendEmailsResult struct - open class UserResendEmailsResult: CustomStringConvertible { + public class UserResendEmailsResult: CustomStringConvertible, JSONRepresentable { /// (no description) public let user: Team.UserSelectorArg /// (no description) - public let results: Array - public init(user: Team.UserSelectorArg, results: Array) { + public let results: [Team.ResendSecondaryEmailResult] + public init(user: Team.UserSelectorArg, results: [Team.ResendSecondaryEmailResult]) { self.user = user self.results = results } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserResendEmailsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserResendEmailsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserResendEmailsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserResendEmailsResult: \(error)" + } } } - open class UserResendEmailsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserResendEmailsResult) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "results": ArraySerializer(Team.ResendSecondaryEmailResultSerializer()).serialize(value.results), + + public class UserResendEmailsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserResendEmailsResult) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "results": try ArraySerializer(Team.ResendSecondaryEmailResultSerializer()).serialize(value.results), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserResendEmailsResult { + + public func deserialize(_ json: JSON) throws -> UserResendEmailsResult { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let results = ArraySerializer(Team.ResendSecondaryEmailResultSerializer()).deserialize(dict["results"] ?? .null) - return UserResendEmailsResult(user: user, results: results) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let results = try ArraySerializer(Team.ResendSecondaryEmailResultSerializer()).deserialize(dict["results"] ?? .null) + return UserResendEmailsResult(user: user, results: results) + default: + throw JSONSerializerError.deserializeError(type: UserResendEmailsResult.self, json: json) } } } @@ -12942,7 +16060,7 @@ open class Team { /// Result of trying to resend verification emails to a user. 'success' is the only value indicating that a user was /// successfully retrieved for sending verification emails. The other values explain the type of error that /// occurred, and include the user for which the error occurred. - public enum UserResendResult: CustomStringConvertible { + public enum UserResendResult: CustomStringConvertible, JSONRepresentable { /// Describes a user and the results for each attempt to resend verification emails. case success(Team.UserResendEmailsResult) /// Specified user is not a valid target for resending verification emails. @@ -12950,123 +16068,158 @@ open class Team { /// An unspecified error. case other + func json() throws -> JSON { + try UserResendResultSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserResendResultSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserResendResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserResendResult: \(error)" + } } } - open class UserResendResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserResendResult) -> JSON { + + public class UserResendResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserResendResult) throws -> JSON { switch value { - case .success(let arg): - var d = Serialization.getFields(Team.UserResendEmailsResultSerializer().serialize(arg)) - d[".tag"] = .str("success") - return .dictionary(d) - case .invalidUser(let arg): - var d = ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] - d[".tag"] = .str("invalid_user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UserResendResult { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "success": - let v = Team.UserResendEmailsResultSerializer().deserialize(json) - return UserResendResult.success(v) - case "invalid_user": - let v = Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) - return UserResendResult.invalidUser(v) - case "other": - return UserResendResult.other - default: - return UserResendResult.other - } + case .success(let arg): + var d = try Serialization.getFields(Team.UserResendEmailsResultSerializer().serialize(arg)) + d[".tag"] = .str("success") + return .dictionary(d) + case .invalidUser(let arg): + var d = try ["invalid_user": Team.UserSelectorArgSerializer().serialize(arg)] + d[".tag"] = .str("invalid_user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UserResendResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "success": + let v = try Team.UserResendEmailsResultSerializer().deserialize(json) + return UserResendResult.success(v) + case "invalid_user": + let v = try Team.UserSelectorArgSerializer().deserialize(d["invalid_user"] ?? .null) + return UserResendResult.invalidUser(v) + case "other": + return UserResendResult.other default: - fatalError("Failed to deserialize") + return UserResendResult.other + } + default: + throw JSONSerializerError.deserializeError(type: UserResendResult.self, json: json) } } } /// User and a list of secondary emails. - open class UserSecondaryEmailsArg: CustomStringConvertible { + public class UserSecondaryEmailsArg: CustomStringConvertible, JSONRepresentable { /// (no description) public let user: Team.UserSelectorArg /// (no description) - public let secondaryEmails: Array - public init(user: Team.UserSelectorArg, secondaryEmails: Array) { + public let secondaryEmails: [String] + public init(user: Team.UserSelectorArg, secondaryEmails: [String]) { self.user = user - arrayValidator(itemValidator: stringValidator(maxLength: 255, pattern: "^['#&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$"))(secondaryEmails) + arrayValidator(itemValidator: stringValidator( + maxLength: 255, + pattern: "^['#&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$" + ))(secondaryEmails) self.secondaryEmails = secondaryEmails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserSecondaryEmailsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserSecondaryEmailsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserSecondaryEmailsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserSecondaryEmailsArg: \(error)" + } } } - open class UserSecondaryEmailsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserSecondaryEmailsArg) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "secondary_emails": ArraySerializer(Serialization._StringSerializer).serialize(value.secondaryEmails), + + public class UserSecondaryEmailsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserSecondaryEmailsArg) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "secondary_emails": try ArraySerializer(Serialization._StringSerializer).serialize(value.secondaryEmails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserSecondaryEmailsArg { + + public func deserialize(_ json: JSON) throws -> UserSecondaryEmailsArg { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let secondaryEmails = ArraySerializer(Serialization._StringSerializer).deserialize(dict["secondary_emails"] ?? .null) - return UserSecondaryEmailsArg(user: user, secondaryEmails: secondaryEmails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let secondaryEmails = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["secondary_emails"] ?? .null) + return UserSecondaryEmailsArg(user: user, secondaryEmails: secondaryEmails) + default: + throw JSONSerializerError.deserializeError(type: UserSecondaryEmailsArg.self, json: json) } } } /// The UserSecondaryEmailsResult struct - open class UserSecondaryEmailsResult: CustomStringConvertible { + public class UserSecondaryEmailsResult: CustomStringConvertible, JSONRepresentable { /// (no description) public let user: Team.UserSelectorArg /// (no description) - public let results: Array - public init(user: Team.UserSelectorArg, results: Array) { + public let results: [Team.AddSecondaryEmailResult] + public init(user: Team.UserSelectorArg, results: [Team.AddSecondaryEmailResult]) { self.user = user self.results = results } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserSecondaryEmailsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserSecondaryEmailsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserSecondaryEmailsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserSecondaryEmailsResult: \(error)" + } } } - open class UserSecondaryEmailsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserSecondaryEmailsResult) -> JSON { - let output = [ - "user": Team.UserSelectorArgSerializer().serialize(value.user), - "results": ArraySerializer(Team.AddSecondaryEmailResultSerializer()).serialize(value.results), + + public class UserSecondaryEmailsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserSecondaryEmailsResult) throws -> JSON { + let output = [ + "user": try Team.UserSelectorArgSerializer().serialize(value.user), + "results": try ArraySerializer(Team.AddSecondaryEmailResultSerializer()).serialize(value.results), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserSecondaryEmailsResult { + + public func deserialize(_ json: JSON) throws -> UserSecondaryEmailsResult { switch json { - case .dictionary(let dict): - let user = Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) - let results = ArraySerializer(Team.AddSecondaryEmailResultSerializer()).deserialize(dict["results"] ?? .null) - return UserSecondaryEmailsResult(user: user, results: results) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let user = try Team.UserSelectorArgSerializer().deserialize(dict["user"] ?? .null) + let results = try ArraySerializer(Team.AddSecondaryEmailResultSerializer()).deserialize(dict["results"] ?? .null) + return UserSecondaryEmailsResult(user: user, results: results) + default: + throw JSONSerializerError.deserializeError(type: UserSecondaryEmailsResult.self, json: json) } } } /// Argument for selecting a single user, either by team_member_id, external_id or email. - public enum UserSelectorArg: CustomStringConvertible { + public enum UserSelectorArg: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case teamMemberId(String) /// An unspecified error. @@ -13074,106 +16227,125 @@ open class Team { /// An unspecified error. case email(String) + func json() throws -> JSON { + try UserSelectorArgSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserSelectorArgSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserSelectorArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserSelectorArg: \(error)" + } } } - open class UserSelectorArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserSelectorArg) -> JSON { + + public class UserSelectorArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserSelectorArg) throws -> JSON { switch value { - case .teamMemberId(let arg): - var d = ["team_member_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("team_member_id") - return .dictionary(d) - case .externalId(let arg): - var d = ["external_id": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("external_id") - return .dictionary(d) - case .email(let arg): - var d = ["email": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("email") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UserSelectorArg { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team_member_id": - let v = Serialization._StringSerializer.deserialize(d["team_member_id"] ?? .null) - return UserSelectorArg.teamMemberId(v) - case "external_id": - let v = Serialization._StringSerializer.deserialize(d["external_id"] ?? .null) - return UserSelectorArg.externalId(v) - case "email": - let v = Serialization._StringSerializer.deserialize(d["email"] ?? .null) - return UserSelectorArg.email(v) - default: - fatalError("Unknown tag \(tag)") - } + case .teamMemberId(let arg): + var d = try ["team_member_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("team_member_id") + return .dictionary(d) + case .externalId(let arg): + var d = try ["external_id": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("external_id") + return .dictionary(d) + case .email(let arg): + var d = try ["email": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("email") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UserSelectorArg { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team_member_id": + let v = try Serialization._StringSerializer.deserialize(d["team_member_id"] ?? .null) + return UserSelectorArg.teamMemberId(v) + case "external_id": + let v = try Serialization._StringSerializer.deserialize(d["external_id"] ?? .null) + return UserSelectorArg.externalId(v) + case "email": + let v = try Serialization._StringSerializer.deserialize(d["email"] ?? .null) + return UserSelectorArg.email(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: UserSelectorArg.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UserSelectorArg.self, json: json) } } } /// Argument for selecting a list of users, either by team_member_ids, external_ids or emails. - public enum UsersSelectorArg: CustomStringConvertible { + public enum UsersSelectorArg: CustomStringConvertible, JSONRepresentable { /// List of member IDs. - case teamMemberIds(Array) + case teamMemberIds([String]) /// List of external user IDs. - case externalIds(Array) + case externalIds([String]) /// List of email addresses. - case emails(Array) + case emails([String]) + + func json() throws -> JSON { + try UsersSelectorArgSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UsersSelectorArgSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UsersSelectorArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UsersSelectorArg: \(error)" + } } } - open class UsersSelectorArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UsersSelectorArg) -> JSON { + + public class UsersSelectorArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UsersSelectorArg) throws -> JSON { switch value { - case .teamMemberIds(let arg): - var d = ["team_member_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("team_member_ids") - return .dictionary(d) - case .externalIds(let arg): - var d = ["external_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("external_ids") - return .dictionary(d) - case .emails(let arg): - var d = ["emails": ArraySerializer(Serialization._StringSerializer).serialize(arg)] - d[".tag"] = .str("emails") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> UsersSelectorArg { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team_member_ids": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["team_member_ids"] ?? .null) - return UsersSelectorArg.teamMemberIds(v) - case "external_ids": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["external_ids"] ?? .null) - return UsersSelectorArg.externalIds(v) - case "emails": - let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["emails"] ?? .null) - return UsersSelectorArg.emails(v) - default: - fatalError("Unknown tag \(tag)") - } + case .teamMemberIds(let arg): + var d = try ["team_member_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("team_member_ids") + return .dictionary(d) + case .externalIds(let arg): + var d = try ["external_ids": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("external_ids") + return .dictionary(d) + case .emails(let arg): + var d = try ["emails": ArraySerializer(Serialization._StringSerializer).serialize(arg)] + d[".tag"] = .str("emails") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> UsersSelectorArg { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team_member_ids": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["team_member_ids"] ?? .null) + return UsersSelectorArg.teamMemberIds(v) + case "external_ids": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["external_ids"] ?? .null) + return UsersSelectorArg.externalIds(v) + case "emails": + let v = try ArraySerializer(Serialization._StringSerializer).deserialize(d["emails"] ?? .null) + return UsersSelectorArg.emails(v) default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: UsersSelectorArg.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: UsersSelectorArg.self, json: json) } } } - /// Stone Route Objects static let devicesListMemberDevices = Route( @@ -13184,9 +16356,11 @@ open class Team { argSerializer: Team.ListMemberDevicesArgSerializer(), responseSerializer: Team.ListMemberDevicesResultSerializer(), errorSerializer: Team.ListMemberDevicesErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let devicesListMembersDevices = Route( name: "devices/list_members_devices", @@ -13196,9 +16370,11 @@ open class Team { argSerializer: Team.ListMembersDevicesArgSerializer(), responseSerializer: Team.ListMembersDevicesResultSerializer(), errorSerializer: Team.ListMembersDevicesErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let devicesListTeamDevices = Route( name: "devices/list_team_devices", @@ -13208,9 +16384,11 @@ open class Team { argSerializer: Team.ListTeamDevicesArgSerializer(), responseSerializer: Team.ListTeamDevicesResultSerializer(), errorSerializer: Team.ListTeamDevicesErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let devicesRevokeDeviceSession = Route( name: "devices/revoke_device_session", @@ -13220,9 +16398,11 @@ open class Team { argSerializer: Team.RevokeDeviceSessionArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.RevokeDeviceSessionErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let devicesRevokeDeviceSessionBatch = Route( name: "devices/revoke_device_session_batch", @@ -13232,9 +16412,11 @@ open class Team { argSerializer: Team.RevokeDeviceSessionBatchArgSerializer(), responseSerializer: Team.RevokeDeviceSessionBatchResultSerializer(), errorSerializer: Team.RevokeDeviceSessionBatchErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let featuresGetValues = Route( name: "features/get_values", @@ -13244,9 +16426,11 @@ open class Team { argSerializer: Team.FeaturesGetValuesBatchArgSerializer(), responseSerializer: Team.FeaturesGetValuesBatchResultSerializer(), errorSerializer: Team.FeaturesGetValuesBatchErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let getInfo = Route( name: "get_info", @@ -13256,9 +16440,11 @@ open class Team { argSerializer: Serialization._VoidSerializer, responseSerializer: Team.TeamGetInfoResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsCreate = Route( name: "groups/create", @@ -13268,9 +16454,11 @@ open class Team { argSerializer: Team.GroupCreateArgSerializer(), responseSerializer: Team.GroupFullInfoSerializer(), errorSerializer: Team.GroupCreateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsDelete = Route( name: "groups/delete", @@ -13280,9 +16468,11 @@ open class Team { argSerializer: Team.GroupSelectorSerializer(), responseSerializer: Async.LaunchEmptyResultSerializer(), errorSerializer: Team.GroupDeleteErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsGetInfo = Route( name: "groups/get_info", @@ -13292,9 +16482,11 @@ open class Team { argSerializer: Team.GroupsSelectorSerializer(), responseSerializer: ArraySerializer(Team.GroupsGetInfoItemSerializer()), errorSerializer: Team.GroupsGetInfoErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsJobStatusGet = Route( name: "groups/job_status/get", @@ -13304,9 +16496,11 @@ open class Team { argSerializer: Async.PollArgSerializer(), responseSerializer: Async.PollEmptyResultSerializer(), errorSerializer: Team.GroupsPollErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsList = Route( name: "groups/list", @@ -13316,9 +16510,11 @@ open class Team { argSerializer: Team.GroupsListArgSerializer(), responseSerializer: Team.GroupsListResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsListContinue = Route( name: "groups/list/continue", @@ -13328,9 +16524,11 @@ open class Team { argSerializer: Team.GroupsListContinueArgSerializer(), responseSerializer: Team.GroupsListResultSerializer(), errorSerializer: Team.GroupsListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsMembersAdd = Route( name: "groups/members/add", @@ -13340,9 +16538,11 @@ open class Team { argSerializer: Team.GroupMembersAddArgSerializer(), responseSerializer: Team.GroupMembersChangeResultSerializer(), errorSerializer: Team.GroupMembersAddErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsMembersList = Route( name: "groups/members/list", @@ -13352,9 +16552,11 @@ open class Team { argSerializer: Team.GroupsMembersListArgSerializer(), responseSerializer: Team.GroupsMembersListResultSerializer(), errorSerializer: Team.GroupSelectorErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsMembersListContinue = Route( name: "groups/members/list/continue", @@ -13364,9 +16566,11 @@ open class Team { argSerializer: Team.GroupsMembersListContinueArgSerializer(), responseSerializer: Team.GroupsMembersListResultSerializer(), errorSerializer: Team.GroupsMembersListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsMembersRemove = Route( name: "groups/members/remove", @@ -13376,9 +16580,11 @@ open class Team { argSerializer: Team.GroupMembersRemoveArgSerializer(), responseSerializer: Team.GroupMembersChangeResultSerializer(), errorSerializer: Team.GroupMembersRemoveErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsMembersSetAccessType = Route( name: "groups/members/set_access_type", @@ -13388,9 +16594,11 @@ open class Team { argSerializer: Team.GroupMembersSetAccessTypeArgSerializer(), responseSerializer: ArraySerializer(Team.GroupsGetInfoItemSerializer()), errorSerializer: Team.GroupMemberSetAccessTypeErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let groupsUpdate = Route( name: "groups/update", @@ -13400,9 +16608,11 @@ open class Team { argSerializer: Team.GroupUpdateArgsSerializer(), responseSerializer: Team.GroupFullInfoSerializer(), errorSerializer: Team.GroupUpdateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let legalHoldsCreatePolicy = Route( name: "legal_holds/create_policy", @@ -13412,9 +16622,11 @@ open class Team { argSerializer: Team.LegalHoldsPolicyCreateArgSerializer(), responseSerializer: Team.LegalHoldPolicySerializer(), errorSerializer: Team.LegalHoldsPolicyCreateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let legalHoldsGetPolicy = Route( name: "legal_holds/get_policy", @@ -13424,9 +16636,11 @@ open class Team { argSerializer: Team.LegalHoldsGetPolicyArgSerializer(), responseSerializer: Team.LegalHoldPolicySerializer(), errorSerializer: Team.LegalHoldsGetPolicyErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let legalHoldsListHeldRevisions = Route( name: "legal_holds/list_held_revisions", @@ -13436,9 +16650,11 @@ open class Team { argSerializer: Team.LegalHoldsListHeldRevisionsArgSerializer(), responseSerializer: Team.LegalHoldsListHeldRevisionResultSerializer(), errorSerializer: Team.LegalHoldsListHeldRevisionsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let legalHoldsListHeldRevisionsContinue = Route( name: "legal_holds/list_held_revisions_continue", @@ -13448,9 +16664,11 @@ open class Team { argSerializer: Team.LegalHoldsListHeldRevisionsContinueArgSerializer(), responseSerializer: Team.LegalHoldsListHeldRevisionResultSerializer(), errorSerializer: Team.LegalHoldsListHeldRevisionsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let legalHoldsListPolicies = Route( name: "legal_holds/list_policies", @@ -13460,9 +16678,11 @@ open class Team { argSerializer: Team.LegalHoldsListPoliciesArgSerializer(), responseSerializer: Team.LegalHoldsListPoliciesResultSerializer(), errorSerializer: Team.LegalHoldsListPoliciesErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let legalHoldsReleasePolicy = Route( name: "legal_holds/release_policy", @@ -13472,9 +16692,11 @@ open class Team { argSerializer: Team.LegalHoldsPolicyReleaseArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.LegalHoldsPolicyReleaseErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let legalHoldsUpdatePolicy = Route( name: "legal_holds/update_policy", @@ -13484,9 +16706,11 @@ open class Team { argSerializer: Team.LegalHoldsPolicyUpdateArgSerializer(), responseSerializer: Team.LegalHoldPolicySerializer(), errorSerializer: Team.LegalHoldsPolicyUpdateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let linkedAppsListMemberLinkedApps = Route( name: "linked_apps/list_member_linked_apps", @@ -13496,9 +16720,11 @@ open class Team { argSerializer: Team.ListMemberAppsArgSerializer(), responseSerializer: Team.ListMemberAppsResultSerializer(), errorSerializer: Team.ListMemberAppsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let linkedAppsListMembersLinkedApps = Route( name: "linked_apps/list_members_linked_apps", @@ -13508,9 +16734,11 @@ open class Team { argSerializer: Team.ListMembersAppsArgSerializer(), responseSerializer: Team.ListMembersAppsResultSerializer(), errorSerializer: Team.ListMembersAppsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let linkedAppsListTeamLinkedApps = Route( name: "linked_apps/list_team_linked_apps", @@ -13520,9 +16748,11 @@ open class Team { argSerializer: Team.ListTeamAppsArgSerializer(), responseSerializer: Team.ListTeamAppsResultSerializer(), errorSerializer: Team.ListTeamAppsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let linkedAppsRevokeLinkedApp = Route( name: "linked_apps/revoke_linked_app", @@ -13532,9 +16762,11 @@ open class Team { argSerializer: Team.RevokeLinkedApiAppArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.RevokeLinkedAppErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let linkedAppsRevokeLinkedAppBatch = Route( name: "linked_apps/revoke_linked_app_batch", @@ -13544,9 +16776,11 @@ open class Team { argSerializer: Team.RevokeLinkedApiAppBatchArgSerializer(), responseSerializer: Team.RevokeLinkedAppBatchResultSerializer(), errorSerializer: Team.RevokeLinkedAppBatchErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let memberSpaceLimitsExcludedUsersAdd = Route( name: "member_space_limits/excluded_users/add", @@ -13556,9 +16790,11 @@ open class Team { argSerializer: Team.ExcludedUsersUpdateArgSerializer(), responseSerializer: Team.ExcludedUsersUpdateResultSerializer(), errorSerializer: Team.ExcludedUsersUpdateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let memberSpaceLimitsExcludedUsersList = Route( name: "member_space_limits/excluded_users/list", @@ -13568,9 +16804,11 @@ open class Team { argSerializer: Team.ExcludedUsersListArgSerializer(), responseSerializer: Team.ExcludedUsersListResultSerializer(), errorSerializer: Team.ExcludedUsersListErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let memberSpaceLimitsExcludedUsersListContinue = Route( name: "member_space_limits/excluded_users/list/continue", @@ -13580,9 +16818,11 @@ open class Team { argSerializer: Team.ExcludedUsersListContinueArgSerializer(), responseSerializer: Team.ExcludedUsersListResultSerializer(), errorSerializer: Team.ExcludedUsersListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let memberSpaceLimitsExcludedUsersRemove = Route( name: "member_space_limits/excluded_users/remove", @@ -13592,9 +16832,11 @@ open class Team { argSerializer: Team.ExcludedUsersUpdateArgSerializer(), responseSerializer: Team.ExcludedUsersUpdateResultSerializer(), errorSerializer: Team.ExcludedUsersUpdateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let memberSpaceLimitsGetCustomQuota = Route( name: "member_space_limits/get_custom_quota", @@ -13604,9 +16846,11 @@ open class Team { argSerializer: Team.CustomQuotaUsersArgSerializer(), responseSerializer: ArraySerializer(Team.CustomQuotaResultSerializer()), errorSerializer: Team.CustomQuotaErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let memberSpaceLimitsRemoveCustomQuota = Route( name: "member_space_limits/remove_custom_quota", @@ -13616,9 +16860,11 @@ open class Team { argSerializer: Team.CustomQuotaUsersArgSerializer(), responseSerializer: ArraySerializer(Team.RemoveCustomQuotaResultSerializer()), errorSerializer: Team.CustomQuotaErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let memberSpaceLimitsSetCustomQuota = Route( name: "member_space_limits/set_custom_quota", @@ -13628,21 +16874,25 @@ open class Team { argSerializer: Team.SetCustomQuotaArgSerializer(), responseSerializer: ArraySerializer(Team.CustomQuotaResultSerializer()), errorSerializer: Team.SetCustomQuotaErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersAddV2 = Route( - name: "members/add", + name: "members/add_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersAddV2ArgSerializer(), responseSerializer: Team.MembersAddLaunchV2ResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersAdd = Route( name: "members/add", @@ -13652,21 +16902,25 @@ open class Team { argSerializer: Team.MembersAddArgSerializer(), responseSerializer: Team.MembersAddLaunchSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersAddJobStatusGetV2 = Route( - name: "members/add/job_status/get", + name: "members/add/job_status/get_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Async.PollArgSerializer(), responseSerializer: Team.MembersAddJobStatusV2ResultSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersAddJobStatusGet = Route( name: "members/add/job_status/get", @@ -13676,21 +16930,25 @@ open class Team { argSerializer: Async.PollArgSerializer(), responseSerializer: Team.MembersAddJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersDeleteProfilePhotoV2 = Route( - name: "members/delete_profile_photo", + name: "members/delete_profile_photo_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersDeleteProfilePhotoArgSerializer(), responseSerializer: Team.TeamMemberInfoV2ResultSerializer(), errorSerializer: Team.MembersDeleteProfilePhotoErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersDeleteProfilePhoto = Route( name: "members/delete_profile_photo", @@ -13700,9 +16958,11 @@ open class Team { argSerializer: Team.MembersDeleteProfilePhotoArgSerializer(), responseSerializer: Team.TeamMemberInfoSerializer(), errorSerializer: Team.MembersDeleteProfilePhotoErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersGetAvailableTeamMemberRoles = Route( name: "members/get_available_team_member_roles", @@ -13712,21 +16972,25 @@ open class Team { argSerializer: Serialization._VoidSerializer, responseSerializer: Team.MembersGetAvailableTeamMemberRolesResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersGetInfoV2 = Route( - name: "members/get_info", + name: "members/get_info_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersGetInfoV2ArgSerializer(), responseSerializer: Team.MembersGetInfoV2ResultSerializer(), errorSerializer: Team.MembersGetInfoErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersGetInfo = Route( name: "members/get_info", @@ -13736,21 +17000,25 @@ open class Team { argSerializer: Team.MembersGetInfoArgsSerializer(), responseSerializer: ArraySerializer(Team.MembersGetInfoItemSerializer()), errorSerializer: Team.MembersGetInfoErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersListV2 = Route( - name: "members/list", + name: "members/list_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersListArgSerializer(), responseSerializer: Team.MembersListV2ResultSerializer(), errorSerializer: Team.MembersListErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersList = Route( name: "members/list", @@ -13760,21 +17028,25 @@ open class Team { argSerializer: Team.MembersListArgSerializer(), responseSerializer: Team.MembersListResultSerializer(), errorSerializer: Team.MembersListErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersListContinueV2 = Route( - name: "members/list/continue", + name: "members/list/continue_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersListContinueArgSerializer(), responseSerializer: Team.MembersListV2ResultSerializer(), errorSerializer: Team.MembersListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersListContinue = Route( name: "members/list/continue", @@ -13784,9 +17056,11 @@ open class Team { argSerializer: Team.MembersListContinueArgSerializer(), responseSerializer: Team.MembersListResultSerializer(), errorSerializer: Team.MembersListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersMoveFormerMemberFiles = Route( name: "members/move_former_member_files", @@ -13796,9 +17070,11 @@ open class Team { argSerializer: Team.MembersDataTransferArgSerializer(), responseSerializer: Async.LaunchEmptyResultSerializer(), errorSerializer: Team.MembersTransferFormerMembersFilesErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersMoveFormerMemberFilesJobStatusCheck = Route( name: "members/move_former_member_files/job_status/check", @@ -13808,9 +17084,11 @@ open class Team { argSerializer: Async.PollArgSerializer(), responseSerializer: Async.PollEmptyResultSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersRecover = Route( name: "members/recover", @@ -13820,9 +17098,11 @@ open class Team { argSerializer: Team.MembersRecoverArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.MembersRecoverErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersRemove = Route( name: "members/remove", @@ -13832,9 +17112,11 @@ open class Team { argSerializer: Team.MembersRemoveArgSerializer(), responseSerializer: Async.LaunchEmptyResultSerializer(), errorSerializer: Team.MembersRemoveErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersRemoveJobStatusGet = Route( name: "members/remove/job_status/get", @@ -13844,9 +17126,11 @@ open class Team { argSerializer: Async.PollArgSerializer(), responseSerializer: Async.PollEmptyResultSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSecondaryEmailsAdd = Route( name: "members/secondary_emails/add", @@ -13856,9 +17140,11 @@ open class Team { argSerializer: Team.AddSecondaryEmailsArgSerializer(), responseSerializer: Team.AddSecondaryEmailsResultSerializer(), errorSerializer: Team.AddSecondaryEmailsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSecondaryEmailsDelete = Route( name: "members/secondary_emails/delete", @@ -13868,9 +17154,11 @@ open class Team { argSerializer: Team.DeleteSecondaryEmailsArgSerializer(), responseSerializer: Team.DeleteSecondaryEmailsResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSecondaryEmailsResendVerificationEmails = Route( name: "members/secondary_emails/resend_verification_emails", @@ -13880,9 +17168,11 @@ open class Team { argSerializer: Team.ResendVerificationEmailArgSerializer(), responseSerializer: Team.ResendVerificationEmailResultSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSendWelcomeEmail = Route( name: "members/send_welcome_email", @@ -13892,21 +17182,25 @@ open class Team { argSerializer: Team.UserSelectorArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.MembersSendWelcomeErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSetAdminPermissionsV2 = Route( - name: "members/set_admin_permissions", + name: "members/set_admin_permissions_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersSetPermissions2ArgSerializer(), responseSerializer: Team.MembersSetPermissions2ResultSerializer(), errorSerializer: Team.MembersSetPermissions2ErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSetAdminPermissions = Route( name: "members/set_admin_permissions", @@ -13916,21 +17210,25 @@ open class Team { argSerializer: Team.MembersSetPermissionsArgSerializer(), responseSerializer: Team.MembersSetPermissionsResultSerializer(), errorSerializer: Team.MembersSetPermissionsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSetProfileV2 = Route( - name: "members/set_profile", + name: "members/set_profile_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersSetProfileArgSerializer(), responseSerializer: Team.TeamMemberInfoV2ResultSerializer(), errorSerializer: Team.MembersSetProfileErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSetProfile = Route( name: "members/set_profile", @@ -13940,21 +17238,25 @@ open class Team { argSerializer: Team.MembersSetProfileArgSerializer(), responseSerializer: Team.TeamMemberInfoSerializer(), errorSerializer: Team.MembersSetProfileErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSetProfilePhotoV2 = Route( - name: "members/set_profile_photo", + name: "members/set_profile_photo_v2", version: 2, namespace: "team", deprecated: false, argSerializer: Team.MembersSetProfilePhotoArgSerializer(), responseSerializer: Team.TeamMemberInfoV2ResultSerializer(), errorSerializer: Team.MembersSetProfilePhotoErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSetProfilePhoto = Route( name: "members/set_profile_photo", @@ -13964,9 +17266,11 @@ open class Team { argSerializer: Team.MembersSetProfilePhotoArgSerializer(), responseSerializer: Team.TeamMemberInfoSerializer(), errorSerializer: Team.MembersSetProfilePhotoErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersSuspend = Route( name: "members/suspend", @@ -13976,9 +17280,11 @@ open class Team { argSerializer: Team.MembersDeactivateArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.MembersSuspendErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let membersUnsuspend = Route( name: "members/unsuspend", @@ -13988,9 +17294,11 @@ open class Team { argSerializer: Team.MembersUnsuspendArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.MembersUnsuspendErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let namespacesList = Route( name: "namespaces/list", @@ -14000,9 +17308,11 @@ open class Team { argSerializer: Team.TeamNamespacesListArgSerializer(), responseSerializer: Team.TeamNamespacesListResultSerializer(), errorSerializer: Team.TeamNamespacesListErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let namespacesListContinue = Route( name: "namespaces/list/continue", @@ -14012,9 +17322,11 @@ open class Team { argSerializer: Team.TeamNamespacesListContinueArgSerializer(), responseSerializer: Team.TeamNamespacesListResultSerializer(), errorSerializer: Team.TeamNamespacesListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let propertiesTemplateAdd = Route( name: "properties/template/add", @@ -14024,9 +17336,11 @@ open class Team { argSerializer: FileProperties.AddTemplateArgSerializer(), responseSerializer: FileProperties.AddTemplateResultSerializer(), errorSerializer: FileProperties.ModifyTemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let propertiesTemplateGet = Route( name: "properties/template/get", @@ -14036,9 +17350,11 @@ open class Team { argSerializer: FileProperties.GetTemplateArgSerializer(), responseSerializer: FileProperties.GetTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let propertiesTemplateList = Route( name: "properties/template/list", @@ -14048,9 +17364,11 @@ open class Team { argSerializer: Serialization._VoidSerializer, responseSerializer: FileProperties.ListTemplateResultSerializer(), errorSerializer: FileProperties.TemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let propertiesTemplateUpdate = Route( name: "properties/template/update", @@ -14060,9 +17378,11 @@ open class Team { argSerializer: FileProperties.UpdateTemplateArgSerializer(), responseSerializer: FileProperties.UpdateTemplateResultSerializer(), errorSerializer: FileProperties.ModifyTemplateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let reportsGetActivity = Route( name: "reports/get_activity", @@ -14072,9 +17392,11 @@ open class Team { argSerializer: Team.DateRangeSerializer(), responseSerializer: Team.GetActivityReportSerializer(), errorSerializer: Team.DateRangeErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let reportsGetDevices = Route( name: "reports/get_devices", @@ -14084,9 +17406,11 @@ open class Team { argSerializer: Team.DateRangeSerializer(), responseSerializer: Team.GetDevicesReportSerializer(), errorSerializer: Team.DateRangeErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let reportsGetMembership = Route( name: "reports/get_membership", @@ -14096,9 +17420,11 @@ open class Team { argSerializer: Team.DateRangeSerializer(), responseSerializer: Team.GetMembershipReportSerializer(), errorSerializer: Team.DateRangeErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let reportsGetStorage = Route( name: "reports/get_storage", @@ -14108,9 +17434,11 @@ open class Team { argSerializer: Team.DateRangeSerializer(), responseSerializer: Team.GetStorageReportSerializer(), errorSerializer: Team.DateRangeErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let sharingAllowlistAdd = Route( name: "sharing_allowlist/add", @@ -14120,9 +17448,11 @@ open class Team { argSerializer: Team.SharingAllowlistAddArgsSerializer(), responseSerializer: Team.SharingAllowlistAddResponseSerializer(), errorSerializer: Team.SharingAllowlistAddErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let sharingAllowlistList = Route( name: "sharing_allowlist/list", @@ -14132,9 +17462,11 @@ open class Team { argSerializer: Team.SharingAllowlistListArgSerializer(), responseSerializer: Team.SharingAllowlistListResponseSerializer(), errorSerializer: Team.SharingAllowlistListErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let sharingAllowlistListContinue = Route( name: "sharing_allowlist/list/continue", @@ -14144,9 +17476,11 @@ open class Team { argSerializer: Team.SharingAllowlistListContinueArgSerializer(), responseSerializer: Team.SharingAllowlistListResponseSerializer(), errorSerializer: Team.SharingAllowlistListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let sharingAllowlistRemove = Route( name: "sharing_allowlist/remove", @@ -14156,9 +17490,11 @@ open class Team { argSerializer: Team.SharingAllowlistRemoveArgsSerializer(), responseSerializer: Team.SharingAllowlistRemoveResponseSerializer(), errorSerializer: Team.SharingAllowlistRemoveErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderActivate = Route( name: "team_folder/activate", @@ -14168,9 +17504,11 @@ open class Team { argSerializer: Team.TeamFolderIdArgSerializer(), responseSerializer: Team.TeamFolderMetadataSerializer(), errorSerializer: Team.TeamFolderActivateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderArchive = Route( name: "team_folder/archive", @@ -14180,9 +17518,11 @@ open class Team { argSerializer: Team.TeamFolderArchiveArgSerializer(), responseSerializer: Team.TeamFolderArchiveLaunchSerializer(), errorSerializer: Team.TeamFolderArchiveErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderArchiveCheck = Route( name: "team_folder/archive/check", @@ -14192,9 +17532,11 @@ open class Team { argSerializer: Async.PollArgSerializer(), responseSerializer: Team.TeamFolderArchiveJobStatusSerializer(), errorSerializer: Async.PollErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderCreate = Route( name: "team_folder/create", @@ -14204,9 +17546,11 @@ open class Team { argSerializer: Team.TeamFolderCreateArgSerializer(), responseSerializer: Team.TeamFolderMetadataSerializer(), errorSerializer: Team.TeamFolderCreateErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderGetInfo = Route( name: "team_folder/get_info", @@ -14216,9 +17560,11 @@ open class Team { argSerializer: Team.TeamFolderIdListArgSerializer(), responseSerializer: ArraySerializer(Team.TeamFolderGetInfoItemSerializer()), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderList = Route( name: "team_folder/list", @@ -14228,9 +17574,11 @@ open class Team { argSerializer: Team.TeamFolderListArgSerializer(), responseSerializer: Team.TeamFolderListResultSerializer(), errorSerializer: Team.TeamFolderListErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderListContinue = Route( name: "team_folder/list/continue", @@ -14240,9 +17588,11 @@ open class Team { argSerializer: Team.TeamFolderListContinueArgSerializer(), responseSerializer: Team.TeamFolderListResultSerializer(), errorSerializer: Team.TeamFolderListContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderPermanentlyDelete = Route( name: "team_folder/permanently_delete", @@ -14252,9 +17602,11 @@ open class Team { argSerializer: Team.TeamFolderIdArgSerializer(), responseSerializer: Serialization._VoidSerializer, errorSerializer: Team.TeamFolderPermanentlyDeleteErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderRename = Route( name: "team_folder/rename", @@ -14264,9 +17616,11 @@ open class Team { argSerializer: Team.TeamFolderRenameArgSerializer(), responseSerializer: Team.TeamFolderMetadataSerializer(), errorSerializer: Team.TeamFolderRenameErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let teamFolderUpdateSyncSettings = Route( name: "team_folder/update_sync_settings", @@ -14276,9 +17630,11 @@ open class Team { argSerializer: Team.TeamFolderUpdateSyncSettingsArgSerializer(), responseSerializer: Team.TeamFolderMetadataSerializer(), errorSerializer: Team.TeamFolderUpdateSyncSettingsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let tokenGetAuthenticatedAdmin = Route( name: "token/get_authenticated_admin", @@ -14288,8 +17644,10 @@ open class Team { argSerializer: Serialization._VoidSerializer, responseSerializer: Team.TokenGetAuthenticatedAdminResultSerializer(), errorSerializer: Team.TokenGetAuthenticatedAdminErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/TeamCommon.swift b/Source/SwiftyDropbox/Shared/Generated/TeamCommon.swift index 82dea5806..bbb3fd680 100644 --- a/Source/SwiftyDropbox/Shared/Generated/TeamCommon.swift +++ b/Source/SwiftyDropbox/Shared/Generated/TeamCommon.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the team_common namespace -open class TeamCommon { +public class TeamCommon { /// The group type determines how a group is managed. - public enum GroupManagementType: CustomStringConvertible { + public enum GroupManagementType: CustomStringConvertible, JSONRepresentable { /// A group which is managed by selected users. case userManaged /// A group which is managed by team admins only. @@ -19,56 +19,66 @@ open class TeamCommon { /// An unspecified error. case other + func json() throws -> JSON { + try GroupManagementTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupManagementTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupManagementTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupManagementType: \(error)" + } } } - open class GroupManagementTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupManagementType) -> JSON { + + public class GroupManagementTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupManagementType) throws -> JSON { switch value { - case .userManaged: - var d = [String: JSON]() - d[".tag"] = .str("user_managed") - return .dictionary(d) - case .companyManaged: - var d = [String: JSON]() - d[".tag"] = .str("company_managed") - return .dictionary(d) - case .systemManaged: - var d = [String: JSON]() - d[".tag"] = .str("system_managed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .userManaged: + var d = [String: JSON]() + d[".tag"] = .str("user_managed") + return .dictionary(d) + case .companyManaged: + var d = [String: JSON]() + d[".tag"] = .str("company_managed") + return .dictionary(d) + case .systemManaged: + var d = [String: JSON]() + d[".tag"] = .str("system_managed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GroupManagementType { + + public func deserialize(_ json: JSON) throws -> GroupManagementType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "user_managed": - return GroupManagementType.userManaged - case "company_managed": - return GroupManagementType.companyManaged - case "system_managed": - return GroupManagementType.systemManaged - case "other": - return GroupManagementType.other - default: - return GroupManagementType.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "user_managed": + return GroupManagementType.userManaged + case "company_managed": + return GroupManagementType.companyManaged + case "system_managed": + return GroupManagementType.systemManaged + case "other": + return GroupManagementType.other default: - fatalError("Failed to deserialize") + return GroupManagementType.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupManagementType.self, json: json) } } } /// Information about a group. - open class GroupSummary: CustomStringConvertible { + public class GroupSummary: CustomStringConvertible, JSONRepresentable { /// (no description) public let groupName: String /// (no description) @@ -79,7 +89,13 @@ open class TeamCommon { public let memberCount: UInt32? /// Who is allowed to manage the group. public let groupManagementType: TeamCommon.GroupManagementType - public init(groupName: String, groupId: String, groupManagementType: TeamCommon.GroupManagementType, groupExternalId: String? = nil, memberCount: UInt32? = nil) { + public init( + groupName: String, + groupId: String, + groupManagementType: TeamCommon.GroupManagementType, + groupExternalId: String? = nil, + memberCount: UInt32? = nil + ) { stringValidator()(groupName) self.groupName = groupName stringValidator()(groupId) @@ -90,39 +106,56 @@ open class TeamCommon { self.memberCount = memberCount self.groupManagementType = groupManagementType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupSummarySerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupSummarySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupSummarySerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupSummary: \(error)" + } } } - open class GroupSummarySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupSummary) -> JSON { - let output = [ - "group_name": Serialization._StringSerializer.serialize(value.groupName), - "group_id": Serialization._StringSerializer.serialize(value.groupId), - "group_management_type": TeamCommon.GroupManagementTypeSerializer().serialize(value.groupManagementType), - "group_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), - "member_count": NullableSerializer(Serialization._UInt32Serializer).serialize(value.memberCount), + + public class GroupSummarySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupSummary) throws -> JSON { + let output = [ + "group_name": try Serialization._StringSerializer.serialize(value.groupName), + "group_id": try Serialization._StringSerializer.serialize(value.groupId), + "group_management_type": try TeamCommon.GroupManagementTypeSerializer().serialize(value.groupManagementType), + "group_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.groupExternalId), + "member_count": try NullableSerializer(Serialization._UInt32Serializer).serialize(value.memberCount), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupSummary { + + public func deserialize(_ json: JSON) throws -> GroupSummary { switch json { - case .dictionary(let dict): - let groupName = Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) - let groupId = Serialization._StringSerializer.deserialize(dict["group_id"] ?? .null) - let groupManagementType = TeamCommon.GroupManagementTypeSerializer().deserialize(dict["group_management_type"] ?? .null) - let groupExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) - let memberCount = NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["member_count"] ?? .null) - return GroupSummary(groupName: groupName, groupId: groupId, groupManagementType: groupManagementType, groupExternalId: groupExternalId, memberCount: memberCount) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let groupName = try Serialization._StringSerializer.deserialize(dict["group_name"] ?? .null) + let groupId = try Serialization._StringSerializer.deserialize(dict["group_id"] ?? .null) + let groupManagementType = try TeamCommon.GroupManagementTypeSerializer().deserialize(dict["group_management_type"] ?? .null) + let groupExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_external_id"] ?? .null) + let memberCount = try NullableSerializer(Serialization._UInt32Serializer).deserialize(dict["member_count"] ?? .null) + return GroupSummary( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType, + groupExternalId: groupExternalId, + memberCount: memberCount + ) + default: + throw JSONSerializerError.deserializeError(type: GroupSummary.self, json: json) } } } /// The group type determines how a group is created and managed. - public enum GroupType: CustomStringConvertible { + public enum GroupType: CustomStringConvertible, JSONRepresentable { /// A group to which team members are automatically added. Applicable to team folders /// https://www.dropbox.com/help/986 only. case team @@ -131,50 +164,60 @@ open class TeamCommon { /// An unspecified error. case other + func json() throws -> JSON { + try GroupTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupType: \(error)" + } } } - open class GroupTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupType) -> JSON { + + public class GroupTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupType) throws -> JSON { switch value { - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .userManaged: - var d = [String: JSON]() - d[".tag"] = .str("user_managed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .userManaged: + var d = [String: JSON]() + d[".tag"] = .str("user_managed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GroupType { + + public func deserialize(_ json: JSON) throws -> GroupType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team": - return GroupType.team - case "user_managed": - return GroupType.userManaged - case "other": - return GroupType.other - default: - return GroupType.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team": + return GroupType.team + case "user_managed": + return GroupType.userManaged + case "other": + return GroupType.other default: - fatalError("Failed to deserialize") + return GroupType.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupType.self, json: json) } } } /// The type of the space limit imposed on a team member. - public enum MemberSpaceLimitType: CustomStringConvertible { + public enum MemberSpaceLimitType: CustomStringConvertible, JSONRepresentable { /// The team member does not have imposed space limit. case off /// The team member has soft imposed space limit - the limit is used for display and for notifications. @@ -184,56 +227,66 @@ open class TeamCommon { /// An unspecified error. case other + func json() throws -> JSON { + try MemberSpaceLimitTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitType: \(error)" + } } } - open class MemberSpaceLimitTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitType) -> JSON { + + public class MemberSpaceLimitTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitType) throws -> JSON { switch value { - case .off: - var d = [String: JSON]() - d[".tag"] = .str("off") - return .dictionary(d) - case .alertOnly: - var d = [String: JSON]() - d[".tag"] = .str("alert_only") - return .dictionary(d) - case .stopSync: - var d = [String: JSON]() - d[".tag"] = .str("stop_sync") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .off: + var d = [String: JSON]() + d[".tag"] = .str("off") + return .dictionary(d) + case .alertOnly: + var d = [String: JSON]() + d[".tag"] = .str("alert_only") + return .dictionary(d) + case .stopSync: + var d = [String: JSON]() + d[".tag"] = .str("stop_sync") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> MemberSpaceLimitType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "off": - return MemberSpaceLimitType.off - case "alert_only": - return MemberSpaceLimitType.alertOnly - case "stop_sync": - return MemberSpaceLimitType.stopSync - case "other": - return MemberSpaceLimitType.other - default: - return MemberSpaceLimitType.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "off": + return MemberSpaceLimitType.off + case "alert_only": + return MemberSpaceLimitType.alertOnly + case "stop_sync": + return MemberSpaceLimitType.stopSync + case "other": + return MemberSpaceLimitType.other default: - fatalError("Failed to deserialize") + return MemberSpaceLimitType.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitType.self, json: json) } } } /// Time range. - open class TimeRange: CustomStringConvertible { + public class TimeRange: CustomStringConvertible, JSONRepresentable { /// Optional starting time (inclusive). public let startTime: Date? /// Optional ending time (exclusive). @@ -242,29 +295,39 @@ open class TeamCommon { self.startTime = startTime self.endTime = endTime } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TimeRangeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TimeRangeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TimeRangeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TimeRange: \(error)" + } } } - open class TimeRangeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TimeRange) -> JSON { - let output = [ - "start_time": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.startTime), - "end_time": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endTime), + + public class TimeRangeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TimeRange) throws -> JSON { + let output = [ + "start_time": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.startTime), + "end_time": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endTime), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TimeRange { + + public func deserialize(_ json: JSON) throws -> TimeRange { switch json { - case .dictionary(let dict): - let startTime = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["start_time"] ?? .null) - let endTime = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_time"] ?? .null) - return TimeRange(startTime: startTime, endTime: endTime) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startTime = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["start_time"] ?? .null) + let endTime = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_time"] ?? .null) + return TimeRange(startTime: startTime, endTime: endTime) + default: + throw JSONSerializerError.deserializeError(type: TimeRange.self, json: json) } } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift b/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift index 215edc2f2..afa2dd05c 100644 --- a/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift +++ b/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the team_log namespace -open class TeamLog { +public class TeamLog { /// Indicates the method in which the action was performed. - public enum AccessMethodLogInfo: CustomStringConvertible { + public enum AccessMethodLogInfo: CustomStringConvertible, JSONRepresentable { /// Admin console session details. case adminConsole(TeamLog.WebSessionLogInfo) /// Api session details. @@ -25,80 +25,90 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AccessMethodLogInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccessMethodLogInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccessMethodLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccessMethodLogInfo: \(error)" + } } } - open class AccessMethodLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccessMethodLogInfo) -> JSON { + + public class AccessMethodLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccessMethodLogInfo) throws -> JSON { switch value { - case .adminConsole(let arg): - var d = Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("admin_console") - return .dictionary(d) - case .api(let arg): - var d = Serialization.getFields(TeamLog.ApiSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("api") - return .dictionary(d) - case .contentManager(let arg): - var d = Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("content_manager") - return .dictionary(d) - case .endUser(let arg): - var d = ["end_user": TeamLog.SessionLogInfoSerializer().serialize(arg)] - d[".tag"] = .str("end_user") - return .dictionary(d) - case .enterpriseConsole(let arg): - var d = Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("enterprise_console") - return .dictionary(d) - case .signInAs(let arg): - var d = Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("sign_in_as") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AccessMethodLogInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admin_console": - let v = TeamLog.WebSessionLogInfoSerializer().deserialize(json) - return AccessMethodLogInfo.adminConsole(v) - case "api": - let v = TeamLog.ApiSessionLogInfoSerializer().deserialize(json) - return AccessMethodLogInfo.api(v) - case "content_manager": - let v = TeamLog.WebSessionLogInfoSerializer().deserialize(json) - return AccessMethodLogInfo.contentManager(v) - case "end_user": - let v = TeamLog.SessionLogInfoSerializer().deserialize(d["end_user"] ?? .null) - return AccessMethodLogInfo.endUser(v) - case "enterprise_console": - let v = TeamLog.WebSessionLogInfoSerializer().deserialize(json) - return AccessMethodLogInfo.enterpriseConsole(v) - case "sign_in_as": - let v = TeamLog.WebSessionLogInfoSerializer().deserialize(json) - return AccessMethodLogInfo.signInAs(v) - case "other": - return AccessMethodLogInfo.other - default: - return AccessMethodLogInfo.other - } - default: - fatalError("Failed to deserialize") + case .adminConsole(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("admin_console") + return .dictionary(d) + case .api(let arg): + var d = try Serialization.getFields(TeamLog.ApiSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("api") + return .dictionary(d) + case .contentManager(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("content_manager") + return .dictionary(d) + case .endUser(let arg): + var d = try ["end_user": TeamLog.SessionLogInfoSerializer().serialize(arg)] + d[".tag"] = .str("end_user") + return .dictionary(d) + case .enterpriseConsole(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("enterprise_console") + return .dictionary(d) + case .signInAs(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("sign_in_as") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AccessMethodLogInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admin_console": + let v = try TeamLog.WebSessionLogInfoSerializer().deserialize(json) + return AccessMethodLogInfo.adminConsole(v) + case "api": + let v = try TeamLog.ApiSessionLogInfoSerializer().deserialize(json) + return AccessMethodLogInfo.api(v) + case "content_manager": + let v = try TeamLog.WebSessionLogInfoSerializer().deserialize(json) + return AccessMethodLogInfo.contentManager(v) + case "end_user": + let v = try TeamLog.SessionLogInfoSerializer().deserialize(d["end_user"] ?? .null) + return AccessMethodLogInfo.endUser(v) + case "enterprise_console": + let v = try TeamLog.WebSessionLogInfoSerializer().deserialize(json) + return AccessMethodLogInfo.enterpriseConsole(v) + case "sign_in_as": + let v = try TeamLog.WebSessionLogInfoSerializer().deserialize(json) + return AccessMethodLogInfo.signInAs(v) + case "other": + return AccessMethodLogInfo.other + default: + return AccessMethodLogInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: AccessMethodLogInfo.self, json: json) } } } /// The AccountCaptureAvailability union - public enum AccountCaptureAvailability: CustomStringConvertible { + public enum AccountCaptureAvailability: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case available /// An unspecified error. @@ -106,50 +116,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AccountCaptureAvailabilitySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureAvailabilitySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureAvailabilitySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureAvailability: \(error)" + } } } - open class AccountCaptureAvailabilitySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureAvailability) -> JSON { + + public class AccountCaptureAvailabilitySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureAvailability) throws -> JSON { switch value { - case .available: - var d = [String: JSON]() - d[".tag"] = .str("available") - return .dictionary(d) - case .unavailable: - var d = [String: JSON]() - d[".tag"] = .str("unavailable") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AccountCaptureAvailability { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "available": - return AccountCaptureAvailability.available - case "unavailable": - return AccountCaptureAvailability.unavailable - case "other": - return AccountCaptureAvailability.other - default: - return AccountCaptureAvailability.other - } + case .available: + var d = [String: JSON]() + d[".tag"] = .str("available") + return .dictionary(d) + case .unavailable: + var d = [String: JSON]() + d[".tag"] = .str("unavailable") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AccountCaptureAvailability { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "available": + return AccountCaptureAvailability.available + case "unavailable": + return AccountCaptureAvailability.unavailable + case "other": + return AccountCaptureAvailability.other default: - fatalError("Failed to deserialize") + return AccountCaptureAvailability.other + } + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureAvailability.self, json: json) } } } /// Granted/revoked option to enable account capture on team domains. - open class AccountCaptureChangeAvailabilityDetails: CustomStringConvertible { + public class AccountCaptureChangeAvailabilityDetails: CustomStringConvertible, JSONRepresentable { /// New account capture availabilty value. public let newValue: TeamLog.AccountCaptureAvailability /// Previous account capture availabilty value. Might be missing due to historical data gap. @@ -158,64 +178,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureChangeAvailabilityDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureChangeAvailabilityDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureChangeAvailabilityDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureChangeAvailabilityDetails: \(error)" + } } } - open class AccountCaptureChangeAvailabilityDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureChangeAvailabilityDetails) -> JSON { - let output = [ - "new_value": TeamLog.AccountCaptureAvailabilitySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.AccountCaptureAvailabilitySerializer()).serialize(value.previousValue), + + public class AccountCaptureChangeAvailabilityDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureChangeAvailabilityDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.AccountCaptureAvailabilitySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.AccountCaptureAvailabilitySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureChangeAvailabilityDetails { + + public func deserialize(_ json: JSON) throws -> AccountCaptureChangeAvailabilityDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.AccountCaptureAvailabilitySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.AccountCaptureAvailabilitySerializer()).deserialize(dict["previous_value"] ?? .null) - return AccountCaptureChangeAvailabilityDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.AccountCaptureAvailabilitySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.AccountCaptureAvailabilitySerializer()).deserialize(dict["previous_value"] ?? .null) + return AccountCaptureChangeAvailabilityDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureChangeAvailabilityDetails.self, json: json) } } } /// The AccountCaptureChangeAvailabilityType struct - open class AccountCaptureChangeAvailabilityType: CustomStringConvertible { + public class AccountCaptureChangeAvailabilityType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureChangeAvailabilityTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureChangeAvailabilityTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureChangeAvailabilityTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureChangeAvailabilityType: \(error)" + } } } - open class AccountCaptureChangeAvailabilityTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureChangeAvailabilityType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AccountCaptureChangeAvailabilityTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureChangeAvailabilityType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureChangeAvailabilityType { + + public func deserialize(_ json: JSON) throws -> AccountCaptureChangeAvailabilityType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AccountCaptureChangeAvailabilityType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AccountCaptureChangeAvailabilityType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureChangeAvailabilityType.self, json: json) } } } /// Changed account capture setting on team domain. - open class AccountCaptureChangePolicyDetails: CustomStringConvertible { + public class AccountCaptureChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New account capture policy. public let newValue: TeamLog.AccountCapturePolicy /// Previous account capture policy. Might be missing due to historical data gap. @@ -224,126 +266,170 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureChangePolicyDetails: \(error)" + } } } - open class AccountCaptureChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.AccountCapturePolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.AccountCapturePolicySerializer()).serialize(value.previousValue), + + public class AccountCaptureChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.AccountCapturePolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.AccountCapturePolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> AccountCaptureChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.AccountCapturePolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.AccountCapturePolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return AccountCaptureChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.AccountCapturePolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.AccountCapturePolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return AccountCaptureChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureChangePolicyDetails.self, json: json) } } } /// The AccountCaptureChangePolicyType struct - open class AccountCaptureChangePolicyType: CustomStringConvertible { + public class AccountCaptureChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureChangePolicyType: \(error)" + } } } - open class AccountCaptureChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AccountCaptureChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureChangePolicyType { + + public func deserialize(_ json: JSON) throws -> AccountCaptureChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AccountCaptureChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AccountCaptureChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureChangePolicyType.self, json: json) } } } /// Account-captured user migrated account to team. - open class AccountCaptureMigrateAccountDetails: CustomStringConvertible { + public class AccountCaptureMigrateAccountDetails: CustomStringConvertible, JSONRepresentable { /// Domain name. public let domainName: String public init(domainName: String) { stringValidator()(domainName) self.domainName = domainName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureMigrateAccountDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureMigrateAccountDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureMigrateAccountDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureMigrateAccountDetails: \(error)" + } } } - open class AccountCaptureMigrateAccountDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureMigrateAccountDetails) -> JSON { - let output = [ - "domain_name": Serialization._StringSerializer.serialize(value.domainName), + + public class AccountCaptureMigrateAccountDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureMigrateAccountDetails) throws -> JSON { + let output = [ + "domain_name": try Serialization._StringSerializer.serialize(value.domainName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureMigrateAccountDetails { + + public func deserialize(_ json: JSON) throws -> AccountCaptureMigrateAccountDetails { switch json { - case .dictionary(let dict): - let domainName = Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) - return AccountCaptureMigrateAccountDetails(domainName: domainName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domainName = try Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) + return AccountCaptureMigrateAccountDetails(domainName: domainName) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureMigrateAccountDetails.self, json: json) } } } /// The AccountCaptureMigrateAccountType struct - open class AccountCaptureMigrateAccountType: CustomStringConvertible { + public class AccountCaptureMigrateAccountType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureMigrateAccountTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureMigrateAccountTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureMigrateAccountTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureMigrateAccountType: \(error)" + } } } - open class AccountCaptureMigrateAccountTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureMigrateAccountType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AccountCaptureMigrateAccountTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureMigrateAccountType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureMigrateAccountType { + + public func deserialize(_ json: JSON) throws -> AccountCaptureMigrateAccountType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AccountCaptureMigrateAccountType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AccountCaptureMigrateAccountType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureMigrateAccountType.self, json: json) } } } /// Sent account capture email to all unmanaged members. - open class AccountCaptureNotificationEmailsSentDetails: CustomStringConvertible { + public class AccountCaptureNotificationEmailsSentDetails: CustomStringConvertible, JSONRepresentable { /// Domain name. public let domainName: String /// Account-capture email notification type. @@ -353,64 +439,87 @@ open class TeamLog { self.domainName = domainName self.notificationType = notificationType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureNotificationEmailsSentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureNotificationEmailsSentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureNotificationEmailsSentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureNotificationEmailsSentDetails: \(error)" + } } } - open class AccountCaptureNotificationEmailsSentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureNotificationEmailsSentDetails) -> JSON { - let output = [ - "domain_name": Serialization._StringSerializer.serialize(value.domainName), - "notification_type": NullableSerializer(TeamLog.AccountCaptureNotificationTypeSerializer()).serialize(value.notificationType), + + public class AccountCaptureNotificationEmailsSentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureNotificationEmailsSentDetails) throws -> JSON { + let output = [ + "domain_name": try Serialization._StringSerializer.serialize(value.domainName), + "notification_type": try NullableSerializer(TeamLog.AccountCaptureNotificationTypeSerializer()).serialize(value.notificationType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureNotificationEmailsSentDetails { + + public func deserialize(_ json: JSON) throws -> AccountCaptureNotificationEmailsSentDetails { switch json { - case .dictionary(let dict): - let domainName = Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) - let notificationType = NullableSerializer(TeamLog.AccountCaptureNotificationTypeSerializer()).deserialize(dict["notification_type"] ?? .null) - return AccountCaptureNotificationEmailsSentDetails(domainName: domainName, notificationType: notificationType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domainName = try Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) + let notificationType = try NullableSerializer(TeamLog.AccountCaptureNotificationTypeSerializer()) + .deserialize(dict["notification_type"] ?? .null) + return AccountCaptureNotificationEmailsSentDetails(domainName: domainName, notificationType: notificationType) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureNotificationEmailsSentDetails.self, json: json) } } } /// The AccountCaptureNotificationEmailsSentType struct - open class AccountCaptureNotificationEmailsSentType: CustomStringConvertible { + public class AccountCaptureNotificationEmailsSentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureNotificationEmailsSentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureNotificationEmailsSentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureNotificationEmailsSentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureNotificationEmailsSentType: \(error)" + } } } - open class AccountCaptureNotificationEmailsSentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureNotificationEmailsSentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AccountCaptureNotificationEmailsSentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureNotificationEmailsSentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureNotificationEmailsSentType { + + public func deserialize(_ json: JSON) throws -> AccountCaptureNotificationEmailsSentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AccountCaptureNotificationEmailsSentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AccountCaptureNotificationEmailsSentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureNotificationEmailsSentType.self, json: json) } } } /// The AccountCaptureNotificationType union - public enum AccountCaptureNotificationType: CustomStringConvertible { + public enum AccountCaptureNotificationType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case actionableNotification /// An unspecified error. @@ -418,50 +527,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AccountCaptureNotificationTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureNotificationTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureNotificationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureNotificationType: \(error)" + } } } - open class AccountCaptureNotificationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureNotificationType) -> JSON { + + public class AccountCaptureNotificationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureNotificationType) throws -> JSON { switch value { - case .actionableNotification: - var d = [String: JSON]() - d[".tag"] = .str("actionable_notification") - return .dictionary(d) - case .proactiveWarningNotification: - var d = [String: JSON]() - d[".tag"] = .str("proactive_warning_notification") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AccountCaptureNotificationType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "actionable_notification": - return AccountCaptureNotificationType.actionableNotification - case "proactive_warning_notification": - return AccountCaptureNotificationType.proactiveWarningNotification - case "other": - return AccountCaptureNotificationType.other - default: - return AccountCaptureNotificationType.other - } + case .actionableNotification: + var d = [String: JSON]() + d[".tag"] = .str("actionable_notification") + return .dictionary(d) + case .proactiveWarningNotification: + var d = [String: JSON]() + d[".tag"] = .str("proactive_warning_notification") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AccountCaptureNotificationType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "actionable_notification": + return AccountCaptureNotificationType.actionableNotification + case "proactive_warning_notification": + return AccountCaptureNotificationType.proactiveWarningNotification + case "other": + return AccountCaptureNotificationType.other default: - fatalError("Failed to deserialize") + return AccountCaptureNotificationType.other + } + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureNotificationType.self, json: json) } } } /// The AccountCapturePolicy union - public enum AccountCapturePolicy: CustomStringConvertible { + public enum AccountCapturePolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case allUsers /// An unspecified error. @@ -469,120 +588,160 @@ open class TeamLog { /// An unspecified error. case invitedUsers /// An unspecified error. + case preventPersonalCreation + /// An unspecified error. case other + func json() throws -> JSON { + try AccountCapturePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCapturePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCapturePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCapturePolicy: \(error)" + } } } - open class AccountCapturePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCapturePolicy) -> JSON { + + public class AccountCapturePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCapturePolicy) throws -> JSON { switch value { - case .allUsers: - var d = [String: JSON]() - d[".tag"] = .str("all_users") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .invitedUsers: - var d = [String: JSON]() - d[".tag"] = .str("invited_users") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AccountCapturePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "all_users": - return AccountCapturePolicy.allUsers - case "disabled": - return AccountCapturePolicy.disabled - case "invited_users": - return AccountCapturePolicy.invitedUsers - case "other": - return AccountCapturePolicy.other - default: - return AccountCapturePolicy.other - } - default: - fatalError("Failed to deserialize") + case .allUsers: + var d = [String: JSON]() + d[".tag"] = .str("all_users") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .invitedUsers: + var d = [String: JSON]() + d[".tag"] = .str("invited_users") + return .dictionary(d) + case .preventPersonalCreation: + var d = [String: JSON]() + d[".tag"] = .str("prevent_personal_creation") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AccountCapturePolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "all_users": + return AccountCapturePolicy.allUsers + case "disabled": + return AccountCapturePolicy.disabled + case "invited_users": + return AccountCapturePolicy.invitedUsers + case "prevent_personal_creation": + return AccountCapturePolicy.preventPersonalCreation + case "other": + return AccountCapturePolicy.other + default: + return AccountCapturePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: AccountCapturePolicy.self, json: json) } } } /// Account-captured user changed account email to personal email. - open class AccountCaptureRelinquishAccountDetails: CustomStringConvertible { + public class AccountCaptureRelinquishAccountDetails: CustomStringConvertible, JSONRepresentable { /// Domain name. public let domainName: String public init(domainName: String) { stringValidator()(domainName) self.domainName = domainName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureRelinquishAccountDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureRelinquishAccountDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureRelinquishAccountDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureRelinquishAccountDetails: \(error)" + } } } - open class AccountCaptureRelinquishAccountDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureRelinquishAccountDetails) -> JSON { - let output = [ - "domain_name": Serialization._StringSerializer.serialize(value.domainName), + + public class AccountCaptureRelinquishAccountDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureRelinquishAccountDetails) throws -> JSON { + let output = [ + "domain_name": try Serialization._StringSerializer.serialize(value.domainName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureRelinquishAccountDetails { + + public func deserialize(_ json: JSON) throws -> AccountCaptureRelinquishAccountDetails { switch json { - case .dictionary(let dict): - let domainName = Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) - return AccountCaptureRelinquishAccountDetails(domainName: domainName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domainName = try Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) + return AccountCaptureRelinquishAccountDetails(domainName: domainName) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureRelinquishAccountDetails.self, json: json) } } } /// The AccountCaptureRelinquishAccountType struct - open class AccountCaptureRelinquishAccountType: CustomStringConvertible { + public class AccountCaptureRelinquishAccountType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountCaptureRelinquishAccountTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountCaptureRelinquishAccountTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountCaptureRelinquishAccountTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountCaptureRelinquishAccountType: \(error)" + } } } - open class AccountCaptureRelinquishAccountTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountCaptureRelinquishAccountType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AccountCaptureRelinquishAccountTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountCaptureRelinquishAccountType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountCaptureRelinquishAccountType { + + public func deserialize(_ json: JSON) throws -> AccountCaptureRelinquishAccountType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AccountCaptureRelinquishAccountType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AccountCaptureRelinquishAccountType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AccountCaptureRelinquishAccountType.self, json: json) } } } /// Unlocked/locked account after failed sign in attempts. - open class AccountLockOrUnlockedDetails: CustomStringConvertible { + public class AccountLockOrUnlockedDetails: CustomStringConvertible, JSONRepresentable { /// The previous account status. public let previousValue: TeamLog.AccountState /// The new account status. @@ -591,64 +750,86 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountLockOrUnlockedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountLockOrUnlockedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountLockOrUnlockedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountLockOrUnlockedDetails: \(error)" + } } } - open class AccountLockOrUnlockedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountLockOrUnlockedDetails) -> JSON { - let output = [ - "previous_value": TeamLog.AccountStateSerializer().serialize(value.previousValue), - "new_value": TeamLog.AccountStateSerializer().serialize(value.newValue), + + public class AccountLockOrUnlockedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountLockOrUnlockedDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.AccountStateSerializer().serialize(value.previousValue), + "new_value": try TeamLog.AccountStateSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountLockOrUnlockedDetails { + + public func deserialize(_ json: JSON) throws -> AccountLockOrUnlockedDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.AccountStateSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.AccountStateSerializer().deserialize(dict["new_value"] ?? .null) - return AccountLockOrUnlockedDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.AccountStateSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.AccountStateSerializer().deserialize(dict["new_value"] ?? .null) + return AccountLockOrUnlockedDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: AccountLockOrUnlockedDetails.self, json: json) } } } /// The AccountLockOrUnlockedType struct - open class AccountLockOrUnlockedType: CustomStringConvertible { + public class AccountLockOrUnlockedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountLockOrUnlockedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountLockOrUnlockedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountLockOrUnlockedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountLockOrUnlockedType: \(error)" + } } } - open class AccountLockOrUnlockedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountLockOrUnlockedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AccountLockOrUnlockedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountLockOrUnlockedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AccountLockOrUnlockedType { + + public func deserialize(_ json: JSON) throws -> AccountLockOrUnlockedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AccountLockOrUnlockedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AccountLockOrUnlockedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AccountLockOrUnlockedType.self, json: json) } } } /// The AccountState union - public enum AccountState: CustomStringConvertible { + public enum AccountState: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case locked /// An unspecified error. @@ -656,50 +837,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AccountStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountState: \(error)" + } } } - open class AccountStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountState) -> JSON { + + public class AccountStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountState) throws -> JSON { switch value { - case .locked: - var d = [String: JSON]() - d[".tag"] = .str("locked") - return .dictionary(d) - case .unlocked: - var d = [String: JSON]() - d[".tag"] = .str("unlocked") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AccountState { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "locked": - return AccountState.locked - case "unlocked": - return AccountState.unlocked - case "other": - return AccountState.other - default: - return AccountState.other - } + case .locked: + var d = [String: JSON]() + d[".tag"] = .str("locked") + return .dictionary(d) + case .unlocked: + var d = [String: JSON]() + d[".tag"] = .str("unlocked") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AccountState { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "locked": + return AccountState.locked + case "unlocked": + return AccountState.unlocked + case "other": + return AccountState.other default: - fatalError("Failed to deserialize") + return AccountState.other + } + default: + throw JSONSerializerError.deserializeError(type: AccountState.self, json: json) } } } /// Additional information indicating the action taken that caused status change. - public enum ActionDetails: CustomStringConvertible { + public enum ActionDetails: CustomStringConvertible, JSONRepresentable { /// Define how the user was removed from the team. case removeAction(TeamLog.MemberRemoveActionType) /// Additional information relevant when someone is invited to the team. @@ -709,59 +900,69 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ActionDetailsSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ActionDetailsSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ActionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ActionDetails: \(error)" + } } } - open class ActionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ActionDetails) -> JSON { + + public class ActionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ActionDetails) throws -> JSON { switch value { - case .removeAction(let arg): - var d = ["remove_action": TeamLog.MemberRemoveActionTypeSerializer().serialize(arg)] - d[".tag"] = .str("remove_action") - return .dictionary(d) - case .teamInviteDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamInviteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_invite_details") - return .dictionary(d) - case .teamJoinDetails(let arg): - var d = Serialization.getFields(TeamLog.JoinTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_join_details") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ActionDetails { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "remove_action": - let v = TeamLog.MemberRemoveActionTypeSerializer().deserialize(d["remove_action"] ?? .null) - return ActionDetails.removeAction(v) - case "team_invite_details": - let v = TeamLog.TeamInviteDetailsSerializer().deserialize(json) - return ActionDetails.teamInviteDetails(v) - case "team_join_details": - let v = TeamLog.JoinTeamDetailsSerializer().deserialize(json) - return ActionDetails.teamJoinDetails(v) - case "other": - return ActionDetails.other - default: - return ActionDetails.other - } - default: - fatalError("Failed to deserialize") + case .removeAction(let arg): + var d = try ["remove_action": TeamLog.MemberRemoveActionTypeSerializer().serialize(arg)] + d[".tag"] = .str("remove_action") + return .dictionary(d) + case .teamInviteDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamInviteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_invite_details") + return .dictionary(d) + case .teamJoinDetails(let arg): + var d = try Serialization.getFields(TeamLog.JoinTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_join_details") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ActionDetails { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "remove_action": + let v = try TeamLog.MemberRemoveActionTypeSerializer().deserialize(d["remove_action"] ?? .null) + return ActionDetails.removeAction(v) + case "team_invite_details": + let v = try TeamLog.TeamInviteDetailsSerializer().deserialize(json) + return ActionDetails.teamInviteDetails(v) + case "team_join_details": + let v = try TeamLog.JoinTeamDetailsSerializer().deserialize(json) + return ActionDetails.teamJoinDetails(v) + case "other": + return ActionDetails.other + default: + return ActionDetails.other + } + default: + throw JSONSerializerError.deserializeError(type: ActionDetails.self, json: json) } } } /// The entity who performed the action. - public enum ActorLogInfo: CustomStringConvertible { + public enum ActorLogInfo: CustomStringConvertible, JSONRepresentable { /// The admin who did the action. case admin(TeamLog.UserLogInfo) /// Anonymous actor. @@ -777,78 +978,88 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ActorLogInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ActorLogInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ActorLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ActorLogInfo: \(error)" + } } } - open class ActorLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ActorLogInfo) -> JSON { + + public class ActorLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ActorLogInfo) throws -> JSON { switch value { - case .admin(let arg): - var d = ["admin": TeamLog.UserLogInfoSerializer().serialize(arg)] - d[".tag"] = .str("admin") - return .dictionary(d) - case .anonymous: - var d = [String: JSON]() - d[".tag"] = .str("anonymous") - return .dictionary(d) - case .app(let arg): - var d = ["app": TeamLog.AppLogInfoSerializer().serialize(arg)] - d[".tag"] = .str("app") - return .dictionary(d) - case .dropbox: - var d = [String: JSON]() - d[".tag"] = .str("dropbox") - return .dictionary(d) - case .reseller(let arg): - var d = Serialization.getFields(TeamLog.ResellerLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("reseller") - return .dictionary(d) - case .user(let arg): - var d = ["user": TeamLog.UserLogInfoSerializer().serialize(arg)] - d[".tag"] = .str("user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ActorLogInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admin": - let v = TeamLog.UserLogInfoSerializer().deserialize(d["admin"] ?? .null) - return ActorLogInfo.admin(v) - case "anonymous": - return ActorLogInfo.anonymous - case "app": - let v = TeamLog.AppLogInfoSerializer().deserialize(d["app"] ?? .null) - return ActorLogInfo.app(v) - case "dropbox": - return ActorLogInfo.dropbox - case "reseller": - let v = TeamLog.ResellerLogInfoSerializer().deserialize(json) - return ActorLogInfo.reseller(v) - case "user": - let v = TeamLog.UserLogInfoSerializer().deserialize(d["user"] ?? .null) - return ActorLogInfo.user(v) - case "other": - return ActorLogInfo.other - default: - return ActorLogInfo.other - } - default: - fatalError("Failed to deserialize") + case .admin(let arg): + var d = try ["admin": TeamLog.UserLogInfoSerializer().serialize(arg)] + d[".tag"] = .str("admin") + return .dictionary(d) + case .anonymous: + var d = [String: JSON]() + d[".tag"] = .str("anonymous") + return .dictionary(d) + case .app(let arg): + var d = try ["app": TeamLog.AppLogInfoSerializer().serialize(arg)] + d[".tag"] = .str("app") + return .dictionary(d) + case .dropbox: + var d = [String: JSON]() + d[".tag"] = .str("dropbox") + return .dictionary(d) + case .reseller(let arg): + var d = try Serialization.getFields(TeamLog.ResellerLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("reseller") + return .dictionary(d) + case .user(let arg): + var d = try ["user": TeamLog.UserLogInfoSerializer().serialize(arg)] + d[".tag"] = .str("user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ActorLogInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admin": + let v = try TeamLog.UserLogInfoSerializer().deserialize(d["admin"] ?? .null) + return ActorLogInfo.admin(v) + case "anonymous": + return ActorLogInfo.anonymous + case "app": + let v = try TeamLog.AppLogInfoSerializer().deserialize(d["app"] ?? .null) + return ActorLogInfo.app(v) + case "dropbox": + return ActorLogInfo.dropbox + case "reseller": + let v = try TeamLog.ResellerLogInfoSerializer().deserialize(json) + return ActorLogInfo.reseller(v) + case "user": + let v = try TeamLog.UserLogInfoSerializer().deserialize(d["user"] ?? .null) + return ActorLogInfo.user(v) + case "other": + return ActorLogInfo.other + default: + return ActorLogInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: ActorLogInfo.self, json: json) } } } /// Alert category - public enum AdminAlertCategoryEnum: CustomStringConvertible { + public enum AdminAlertCategoryEnum: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accountTakeover /// An unspecified error. @@ -866,80 +1077,90 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminAlertCategoryEnumSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertCategoryEnumSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertCategoryEnumSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertCategoryEnum: \(error)" + } } } - open class AdminAlertCategoryEnumSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertCategoryEnum) -> JSON { + + public class AdminAlertCategoryEnumSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertCategoryEnum) throws -> JSON { switch value { - case .accountTakeover: - var d = [String: JSON]() - d[".tag"] = .str("account_takeover") - return .dictionary(d) - case .dataLossProtection: - var d = [String: JSON]() - d[".tag"] = .str("data_loss_protection") - return .dictionary(d) - case .informationGovernance: - var d = [String: JSON]() - d[".tag"] = .str("information_governance") - return .dictionary(d) - case .malwareSharing: - var d = [String: JSON]() - d[".tag"] = .str("malware_sharing") - return .dictionary(d) - case .massiveFileOperation: - var d = [String: JSON]() - d[".tag"] = .str("massive_file_operation") - return .dictionary(d) - case .na: - var d = [String: JSON]() - d[".tag"] = .str("na") - return .dictionary(d) - case .threatManagement: - var d = [String: JSON]() - d[".tag"] = .str("threat_management") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminAlertCategoryEnum { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "account_takeover": - return AdminAlertCategoryEnum.accountTakeover - case "data_loss_protection": - return AdminAlertCategoryEnum.dataLossProtection - case "information_governance": - return AdminAlertCategoryEnum.informationGovernance - case "malware_sharing": - return AdminAlertCategoryEnum.malwareSharing - case "massive_file_operation": - return AdminAlertCategoryEnum.massiveFileOperation - case "na": - return AdminAlertCategoryEnum.na - case "threat_management": - return AdminAlertCategoryEnum.threatManagement - case "other": - return AdminAlertCategoryEnum.other - default: - return AdminAlertCategoryEnum.other - } - default: - fatalError("Failed to deserialize") + case .accountTakeover: + var d = [String: JSON]() + d[".tag"] = .str("account_takeover") + return .dictionary(d) + case .dataLossProtection: + var d = [String: JSON]() + d[".tag"] = .str("data_loss_protection") + return .dictionary(d) + case .informationGovernance: + var d = [String: JSON]() + d[".tag"] = .str("information_governance") + return .dictionary(d) + case .malwareSharing: + var d = [String: JSON]() + d[".tag"] = .str("malware_sharing") + return .dictionary(d) + case .massiveFileOperation: + var d = [String: JSON]() + d[".tag"] = .str("massive_file_operation") + return .dictionary(d) + case .na: + var d = [String: JSON]() + d[".tag"] = .str("na") + return .dictionary(d) + case .threatManagement: + var d = [String: JSON]() + d[".tag"] = .str("threat_management") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminAlertCategoryEnum { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "account_takeover": + return AdminAlertCategoryEnum.accountTakeover + case "data_loss_protection": + return AdminAlertCategoryEnum.dataLossProtection + case "information_governance": + return AdminAlertCategoryEnum.informationGovernance + case "malware_sharing": + return AdminAlertCategoryEnum.malwareSharing + case "massive_file_operation": + return AdminAlertCategoryEnum.massiveFileOperation + case "na": + return AdminAlertCategoryEnum.na + case "threat_management": + return AdminAlertCategoryEnum.threatManagement + case "other": + return AdminAlertCategoryEnum.other + default: + return AdminAlertCategoryEnum.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminAlertCategoryEnum.self, json: json) } } } /// Alert state - public enum AdminAlertGeneralStateEnum: CustomStringConvertible { + public enum AdminAlertGeneralStateEnum: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case active /// An unspecified error. @@ -953,68 +1174,78 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminAlertGeneralStateEnumSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertGeneralStateEnumSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertGeneralStateEnumSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertGeneralStateEnum: \(error)" + } } } - open class AdminAlertGeneralStateEnumSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertGeneralStateEnum) -> JSON { + + public class AdminAlertGeneralStateEnumSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertGeneralStateEnum) throws -> JSON { switch value { - case .active: - var d = [String: JSON]() - d[".tag"] = .str("active") - return .dictionary(d) - case .dismissed: - var d = [String: JSON]() - d[".tag"] = .str("dismissed") - return .dictionary(d) - case .inProgress: - var d = [String: JSON]() - d[".tag"] = .str("in_progress") - return .dictionary(d) - case .na: - var d = [String: JSON]() - d[".tag"] = .str("na") - return .dictionary(d) - case .resolved: - var d = [String: JSON]() - d[".tag"] = .str("resolved") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminAlertGeneralStateEnum { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "active": - return AdminAlertGeneralStateEnum.active - case "dismissed": - return AdminAlertGeneralStateEnum.dismissed - case "in_progress": - return AdminAlertGeneralStateEnum.inProgress - case "na": - return AdminAlertGeneralStateEnum.na - case "resolved": - return AdminAlertGeneralStateEnum.resolved - case "other": - return AdminAlertGeneralStateEnum.other - default: - return AdminAlertGeneralStateEnum.other - } - default: - fatalError("Failed to deserialize") + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .dismissed: + var d = [String: JSON]() + d[".tag"] = .str("dismissed") + return .dictionary(d) + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .na: + var d = [String: JSON]() + d[".tag"] = .str("na") + return .dictionary(d) + case .resolved: + var d = [String: JSON]() + d[".tag"] = .str("resolved") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminAlertGeneralStateEnum { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return AdminAlertGeneralStateEnum.active + case "dismissed": + return AdminAlertGeneralStateEnum.dismissed + case "in_progress": + return AdminAlertGeneralStateEnum.inProgress + case "na": + return AdminAlertGeneralStateEnum.na + case "resolved": + return AdminAlertGeneralStateEnum.resolved + case "other": + return AdminAlertGeneralStateEnum.other + default: + return AdminAlertGeneralStateEnum.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminAlertGeneralStateEnum.self, json: json) } } } /// Alert severity - public enum AdminAlertSeverityEnum: CustomStringConvertible { + public enum AdminAlertSeverityEnum: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case high /// An unspecified error. @@ -1028,68 +1259,78 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminAlertSeverityEnumSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertSeverityEnumSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertSeverityEnumSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertSeverityEnum: \(error)" + } } } - open class AdminAlertSeverityEnumSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertSeverityEnum) -> JSON { + + public class AdminAlertSeverityEnumSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertSeverityEnum) throws -> JSON { switch value { - case .high: - var d = [String: JSON]() - d[".tag"] = .str("high") - return .dictionary(d) - case .info: - var d = [String: JSON]() - d[".tag"] = .str("info") - return .dictionary(d) - case .low: - var d = [String: JSON]() - d[".tag"] = .str("low") - return .dictionary(d) - case .medium: - var d = [String: JSON]() - d[".tag"] = .str("medium") - return .dictionary(d) - case .na: - var d = [String: JSON]() - d[".tag"] = .str("na") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminAlertSeverityEnum { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "high": - return AdminAlertSeverityEnum.high - case "info": - return AdminAlertSeverityEnum.info - case "low": - return AdminAlertSeverityEnum.low - case "medium": - return AdminAlertSeverityEnum.medium - case "na": - return AdminAlertSeverityEnum.na - case "other": - return AdminAlertSeverityEnum.other - default: - return AdminAlertSeverityEnum.other - } - default: - fatalError("Failed to deserialize") + case .high: + var d = [String: JSON]() + d[".tag"] = .str("high") + return .dictionary(d) + case .info: + var d = [String: JSON]() + d[".tag"] = .str("info") + return .dictionary(d) + case .low: + var d = [String: JSON]() + d[".tag"] = .str("low") + return .dictionary(d) + case .medium: + var d = [String: JSON]() + d[".tag"] = .str("medium") + return .dictionary(d) + case .na: + var d = [String: JSON]() + d[".tag"] = .str("na") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminAlertSeverityEnum { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "high": + return AdminAlertSeverityEnum.high + case "info": + return AdminAlertSeverityEnum.info + case "low": + return AdminAlertSeverityEnum.low + case "medium": + return AdminAlertSeverityEnum.medium + case "na": + return AdminAlertSeverityEnum.na + case "other": + return AdminAlertSeverityEnum.other + default: + return AdminAlertSeverityEnum.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminAlertSeverityEnum.self, json: json) } } } /// Alert configurations - open class AdminAlertingAlertConfiguration: CustomStringConvertible { + public class AdminAlertingAlertConfiguration: CustomStringConvertible, JSONRepresentable { /// Alert state. public let alertState: TeamLog.AdminAlertingAlertStatePolicy? /// Sensitivity level. @@ -1100,7 +1341,13 @@ open class TeamLog { public let text: String? /// Excluded file extensions. public let excludedFileExtensions: String? - public init(alertState: TeamLog.AdminAlertingAlertStatePolicy? = nil, sensitivityLevel: TeamLog.AdminAlertingAlertSensitivity? = nil, recipientsSettings: TeamLog.RecipientsConfiguration? = nil, text: String? = nil, excludedFileExtensions: String? = nil) { + public init( + alertState: TeamLog.AdminAlertingAlertStatePolicy? = nil, + sensitivityLevel: TeamLog.AdminAlertingAlertSensitivity? = nil, + recipientsSettings: TeamLog.RecipientsConfiguration? = nil, + text: String? = nil, + excludedFileExtensions: String? = nil + ) { self.alertState = alertState self.sensitivityLevel = sensitivityLevel self.recipientsSettings = recipientsSettings @@ -1109,39 +1356,58 @@ open class TeamLog { nullableValidator(stringValidator())(excludedFileExtensions) self.excludedFileExtensions = excludedFileExtensions } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingAlertConfigurationSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminAlertingAlertConfigurationSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingAlertConfigurationSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingAlertConfiguration: \(error)" + } } } - open class AdminAlertingAlertConfigurationSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingAlertConfiguration) -> JSON { - let output = [ - "alert_state": NullableSerializer(TeamLog.AdminAlertingAlertStatePolicySerializer()).serialize(value.alertState), - "sensitivity_level": NullableSerializer(TeamLog.AdminAlertingAlertSensitivitySerializer()).serialize(value.sensitivityLevel), - "recipients_settings": NullableSerializer(TeamLog.RecipientsConfigurationSerializer()).serialize(value.recipientsSettings), - "text": NullableSerializer(Serialization._StringSerializer).serialize(value.text), - "excluded_file_extensions": NullableSerializer(Serialization._StringSerializer).serialize(value.excludedFileExtensions), + + public class AdminAlertingAlertConfigurationSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingAlertConfiguration) throws -> JSON { + let output = [ + "alert_state": try NullableSerializer(TeamLog.AdminAlertingAlertStatePolicySerializer()).serialize(value.alertState), + "sensitivity_level": try NullableSerializer(TeamLog.AdminAlertingAlertSensitivitySerializer()).serialize(value.sensitivityLevel), + "recipients_settings": try NullableSerializer(TeamLog.RecipientsConfigurationSerializer()).serialize(value.recipientsSettings), + "text": try NullableSerializer(Serialization._StringSerializer).serialize(value.text), + "excluded_file_extensions": try NullableSerializer(Serialization._StringSerializer).serialize(value.excludedFileExtensions), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminAlertingAlertConfiguration { + + public func deserialize(_ json: JSON) throws -> AdminAlertingAlertConfiguration { switch json { - case .dictionary(let dict): - let alertState = NullableSerializer(TeamLog.AdminAlertingAlertStatePolicySerializer()).deserialize(dict["alert_state"] ?? .null) - let sensitivityLevel = NullableSerializer(TeamLog.AdminAlertingAlertSensitivitySerializer()).deserialize(dict["sensitivity_level"] ?? .null) - let recipientsSettings = NullableSerializer(TeamLog.RecipientsConfigurationSerializer()).deserialize(dict["recipients_settings"] ?? .null) - let text = NullableSerializer(Serialization._StringSerializer).deserialize(dict["text"] ?? .null) - let excludedFileExtensions = NullableSerializer(Serialization._StringSerializer).deserialize(dict["excluded_file_extensions"] ?? .null) - return AdminAlertingAlertConfiguration(alertState: alertState, sensitivityLevel: sensitivityLevel, recipientsSettings: recipientsSettings, text: text, excludedFileExtensions: excludedFileExtensions) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let alertState = try NullableSerializer(TeamLog.AdminAlertingAlertStatePolicySerializer()).deserialize(dict["alert_state"] ?? .null) + let sensitivityLevel = try NullableSerializer(TeamLog.AdminAlertingAlertSensitivitySerializer()) + .deserialize(dict["sensitivity_level"] ?? .null) + let recipientsSettings = try NullableSerializer(TeamLog.RecipientsConfigurationSerializer()) + .deserialize(dict["recipients_settings"] ?? .null) + let text = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["text"] ?? .null) + let excludedFileExtensions = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["excluded_file_extensions"] ?? .null) + return AdminAlertingAlertConfiguration( + alertState: alertState, + sensitivityLevel: sensitivityLevel, + recipientsSettings: recipientsSettings, + text: text, + excludedFileExtensions: excludedFileExtensions + ) + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingAlertConfiguration.self, json: json) } } } /// Alert sensitivity - public enum AdminAlertingAlertSensitivity: CustomStringConvertible { + public enum AdminAlertingAlertSensitivity: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case high /// An unspecified error. @@ -1157,74 +1423,84 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminAlertingAlertSensitivitySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingAlertSensitivitySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingAlertSensitivitySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingAlertSensitivity: \(error)" + } } } - open class AdminAlertingAlertSensitivitySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingAlertSensitivity) -> JSON { + + public class AdminAlertingAlertSensitivitySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingAlertSensitivity) throws -> JSON { switch value { - case .high: - var d = [String: JSON]() - d[".tag"] = .str("high") - return .dictionary(d) - case .highest: - var d = [String: JSON]() - d[".tag"] = .str("highest") - return .dictionary(d) - case .invalid: - var d = [String: JSON]() - d[".tag"] = .str("invalid") - return .dictionary(d) - case .low: - var d = [String: JSON]() - d[".tag"] = .str("low") - return .dictionary(d) - case .lowest: - var d = [String: JSON]() - d[".tag"] = .str("lowest") - return .dictionary(d) - case .medium: - var d = [String: JSON]() - d[".tag"] = .str("medium") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminAlertingAlertSensitivity { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "high": - return AdminAlertingAlertSensitivity.high - case "highest": - return AdminAlertingAlertSensitivity.highest - case "invalid": - return AdminAlertingAlertSensitivity.invalid - case "low": - return AdminAlertingAlertSensitivity.low - case "lowest": - return AdminAlertingAlertSensitivity.lowest - case "medium": - return AdminAlertingAlertSensitivity.medium - case "other": - return AdminAlertingAlertSensitivity.other - default: - return AdminAlertingAlertSensitivity.other - } - default: - fatalError("Failed to deserialize") + case .high: + var d = [String: JSON]() + d[".tag"] = .str("high") + return .dictionary(d) + case .highest: + var d = [String: JSON]() + d[".tag"] = .str("highest") + return .dictionary(d) + case .invalid: + var d = [String: JSON]() + d[".tag"] = .str("invalid") + return .dictionary(d) + case .low: + var d = [String: JSON]() + d[".tag"] = .str("low") + return .dictionary(d) + case .lowest: + var d = [String: JSON]() + d[".tag"] = .str("lowest") + return .dictionary(d) + case .medium: + var d = [String: JSON]() + d[".tag"] = .str("medium") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminAlertingAlertSensitivity { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "high": + return AdminAlertingAlertSensitivity.high + case "highest": + return AdminAlertingAlertSensitivity.highest + case "invalid": + return AdminAlertingAlertSensitivity.invalid + case "low": + return AdminAlertingAlertSensitivity.low + case "lowest": + return AdminAlertingAlertSensitivity.lowest + case "medium": + return AdminAlertingAlertSensitivity.medium + case "other": + return AdminAlertingAlertSensitivity.other + default: + return AdminAlertingAlertSensitivity.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingAlertSensitivity.self, json: json) } } } /// Changed an alert state. - open class AdminAlertingAlertStateChangedDetails: CustomStringConvertible { + public class AdminAlertingAlertStateChangedDetails: CustomStringConvertible, JSONRepresentable { /// Alert name. public let alertName: String /// Alert severity. @@ -1237,7 +1513,14 @@ open class TeamLog { public let previousValue: TeamLog.AdminAlertGeneralStateEnum /// Alert state after the change. public let newValue: TeamLog.AdminAlertGeneralStateEnum - public init(alertName: String, alertSeverity: TeamLog.AdminAlertSeverityEnum, alertCategory: TeamLog.AdminAlertCategoryEnum, alertInstanceId: String, previousValue: TeamLog.AdminAlertGeneralStateEnum, newValue: TeamLog.AdminAlertGeneralStateEnum) { + public init( + alertName: String, + alertSeverity: TeamLog.AdminAlertSeverityEnum, + alertCategory: TeamLog.AdminAlertCategoryEnum, + alertInstanceId: String, + previousValue: TeamLog.AdminAlertGeneralStateEnum, + newValue: TeamLog.AdminAlertGeneralStateEnum + ) { stringValidator()(alertName) self.alertName = alertName self.alertSeverity = alertSeverity @@ -1247,72 +1530,101 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingAlertStateChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminAlertingAlertStateChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingAlertStateChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingAlertStateChangedDetails: \(error)" + } } } - open class AdminAlertingAlertStateChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingAlertStateChangedDetails) -> JSON { - let output = [ - "alert_name": Serialization._StringSerializer.serialize(value.alertName), - "alert_severity": TeamLog.AdminAlertSeverityEnumSerializer().serialize(value.alertSeverity), - "alert_category": TeamLog.AdminAlertCategoryEnumSerializer().serialize(value.alertCategory), - "alert_instance_id": Serialization._StringSerializer.serialize(value.alertInstanceId), - "previous_value": TeamLog.AdminAlertGeneralStateEnumSerializer().serialize(value.previousValue), - "new_value": TeamLog.AdminAlertGeneralStateEnumSerializer().serialize(value.newValue), + + public class AdminAlertingAlertStateChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingAlertStateChangedDetails) throws -> JSON { + let output = [ + "alert_name": try Serialization._StringSerializer.serialize(value.alertName), + "alert_severity": try TeamLog.AdminAlertSeverityEnumSerializer().serialize(value.alertSeverity), + "alert_category": try TeamLog.AdminAlertCategoryEnumSerializer().serialize(value.alertCategory), + "alert_instance_id": try Serialization._StringSerializer.serialize(value.alertInstanceId), + "previous_value": try TeamLog.AdminAlertGeneralStateEnumSerializer().serialize(value.previousValue), + "new_value": try TeamLog.AdminAlertGeneralStateEnumSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminAlertingAlertStateChangedDetails { + + public func deserialize(_ json: JSON) throws -> AdminAlertingAlertStateChangedDetails { switch json { - case .dictionary(let dict): - let alertName = Serialization._StringSerializer.deserialize(dict["alert_name"] ?? .null) - let alertSeverity = TeamLog.AdminAlertSeverityEnumSerializer().deserialize(dict["alert_severity"] ?? .null) - let alertCategory = TeamLog.AdminAlertCategoryEnumSerializer().deserialize(dict["alert_category"] ?? .null) - let alertInstanceId = Serialization._StringSerializer.deserialize(dict["alert_instance_id"] ?? .null) - let previousValue = TeamLog.AdminAlertGeneralStateEnumSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.AdminAlertGeneralStateEnumSerializer().deserialize(dict["new_value"] ?? .null) - return AdminAlertingAlertStateChangedDetails(alertName: alertName, alertSeverity: alertSeverity, alertCategory: alertCategory, alertInstanceId: alertInstanceId, previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let alertName = try Serialization._StringSerializer.deserialize(dict["alert_name"] ?? .null) + let alertSeverity = try TeamLog.AdminAlertSeverityEnumSerializer().deserialize(dict["alert_severity"] ?? .null) + let alertCategory = try TeamLog.AdminAlertCategoryEnumSerializer().deserialize(dict["alert_category"] ?? .null) + let alertInstanceId = try Serialization._StringSerializer.deserialize(dict["alert_instance_id"] ?? .null) + let previousValue = try TeamLog.AdminAlertGeneralStateEnumSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.AdminAlertGeneralStateEnumSerializer().deserialize(dict["new_value"] ?? .null) + return AdminAlertingAlertStateChangedDetails( + alertName: alertName, + alertSeverity: alertSeverity, + alertCategory: alertCategory, + alertInstanceId: alertInstanceId, + previousValue: previousValue, + newValue: newValue + ) + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingAlertStateChangedDetails.self, json: json) } } } /// The AdminAlertingAlertStateChangedType struct - open class AdminAlertingAlertStateChangedType: CustomStringConvertible { + public class AdminAlertingAlertStateChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingAlertStateChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminAlertingAlertStateChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingAlertStateChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingAlertStateChangedType: \(error)" + } } } - open class AdminAlertingAlertStateChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingAlertStateChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AdminAlertingAlertStateChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingAlertStateChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminAlertingAlertStateChangedType { + + public func deserialize(_ json: JSON) throws -> AdminAlertingAlertStateChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AdminAlertingAlertStateChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AdminAlertingAlertStateChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingAlertStateChangedType.self, json: json) } } } /// Policy for controlling whether an alert can be triggered or not - public enum AdminAlertingAlertStatePolicy: CustomStringConvertible { + public enum AdminAlertingAlertStatePolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case off /// An unspecified error. @@ -1320,50 +1632,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminAlertingAlertStatePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingAlertStatePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingAlertStatePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingAlertStatePolicy: \(error)" + } } } - open class AdminAlertingAlertStatePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingAlertStatePolicy) -> JSON { + + public class AdminAlertingAlertStatePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingAlertStatePolicy) throws -> JSON { switch value { - case .off: - var d = [String: JSON]() - d[".tag"] = .str("off") - return .dictionary(d) - case .on: - var d = [String: JSON]() - d[".tag"] = .str("on") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminAlertingAlertStatePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "off": - return AdminAlertingAlertStatePolicy.off - case "on": - return AdminAlertingAlertStatePolicy.on - case "other": - return AdminAlertingAlertStatePolicy.other - default: - return AdminAlertingAlertStatePolicy.other - } + case .off: + var d = [String: JSON]() + d[".tag"] = .str("off") + return .dictionary(d) + case .on: + var d = [String: JSON]() + d[".tag"] = .str("on") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminAlertingAlertStatePolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "off": + return AdminAlertingAlertStatePolicy.off + case "on": + return AdminAlertingAlertStatePolicy.on + case "other": + return AdminAlertingAlertStatePolicy.other default: - fatalError("Failed to deserialize") + return AdminAlertingAlertStatePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingAlertStatePolicy.self, json: json) } } } /// Changed an alert setting. - open class AdminAlertingChangedAlertConfigDetails: CustomStringConvertible { + public class AdminAlertingChangedAlertConfigDetails: CustomStringConvertible, JSONRepresentable { /// Alert Name. public let alertName: String /// Previous alert configuration. @@ -1376,66 +1698,92 @@ open class TeamLog { self.previousAlertConfig = previousAlertConfig self.newAlertConfig = newAlertConfig } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingChangedAlertConfigDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminAlertingChangedAlertConfigDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingChangedAlertConfigDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingChangedAlertConfigDetails: \(error)" + } } } - open class AdminAlertingChangedAlertConfigDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingChangedAlertConfigDetails) -> JSON { - let output = [ - "alert_name": Serialization._StringSerializer.serialize(value.alertName), - "previous_alert_config": TeamLog.AdminAlertingAlertConfigurationSerializer().serialize(value.previousAlertConfig), - "new_alert_config": TeamLog.AdminAlertingAlertConfigurationSerializer().serialize(value.newAlertConfig), + + public class AdminAlertingChangedAlertConfigDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingChangedAlertConfigDetails) throws -> JSON { + let output = [ + "alert_name": try Serialization._StringSerializer.serialize(value.alertName), + "previous_alert_config": try TeamLog.AdminAlertingAlertConfigurationSerializer().serialize(value.previousAlertConfig), + "new_alert_config": try TeamLog.AdminAlertingAlertConfigurationSerializer().serialize(value.newAlertConfig), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminAlertingChangedAlertConfigDetails { + + public func deserialize(_ json: JSON) throws -> AdminAlertingChangedAlertConfigDetails { switch json { - case .dictionary(let dict): - let alertName = Serialization._StringSerializer.deserialize(dict["alert_name"] ?? .null) - let previousAlertConfig = TeamLog.AdminAlertingAlertConfigurationSerializer().deserialize(dict["previous_alert_config"] ?? .null) - let newAlertConfig = TeamLog.AdminAlertingAlertConfigurationSerializer().deserialize(dict["new_alert_config"] ?? .null) - return AdminAlertingChangedAlertConfigDetails(alertName: alertName, previousAlertConfig: previousAlertConfig, newAlertConfig: newAlertConfig) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let alertName = try Serialization._StringSerializer.deserialize(dict["alert_name"] ?? .null) + let previousAlertConfig = try TeamLog.AdminAlertingAlertConfigurationSerializer().deserialize(dict["previous_alert_config"] ?? .null) + let newAlertConfig = try TeamLog.AdminAlertingAlertConfigurationSerializer().deserialize(dict["new_alert_config"] ?? .null) + return AdminAlertingChangedAlertConfigDetails( + alertName: alertName, + previousAlertConfig: previousAlertConfig, + newAlertConfig: newAlertConfig + ) + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingChangedAlertConfigDetails.self, json: json) } } } /// The AdminAlertingChangedAlertConfigType struct - open class AdminAlertingChangedAlertConfigType: CustomStringConvertible { + public class AdminAlertingChangedAlertConfigType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingChangedAlertConfigTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminAlertingChangedAlertConfigTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingChangedAlertConfigTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingChangedAlertConfigType: \(error)" + } } } - open class AdminAlertingChangedAlertConfigTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingChangedAlertConfigType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AdminAlertingChangedAlertConfigTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingChangedAlertConfigType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminAlertingChangedAlertConfigType { + + public func deserialize(_ json: JSON) throws -> AdminAlertingChangedAlertConfigType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AdminAlertingChangedAlertConfigType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AdminAlertingChangedAlertConfigType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingChangedAlertConfigType.self, json: json) } } } /// Triggered security alert. - open class AdminAlertingTriggeredAlertDetails: CustomStringConvertible { + public class AdminAlertingTriggeredAlertDetails: CustomStringConvertible, JSONRepresentable { /// Alert name. public let alertName: String /// Alert severity. @@ -1452,68 +1800,95 @@ open class TeamLog { stringValidator()(alertInstanceId) self.alertInstanceId = alertInstanceId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingTriggeredAlertDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminAlertingTriggeredAlertDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingTriggeredAlertDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingTriggeredAlertDetails: \(error)" + } } } - open class AdminAlertingTriggeredAlertDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingTriggeredAlertDetails) -> JSON { - let output = [ - "alert_name": Serialization._StringSerializer.serialize(value.alertName), - "alert_severity": TeamLog.AdminAlertSeverityEnumSerializer().serialize(value.alertSeverity), - "alert_category": TeamLog.AdminAlertCategoryEnumSerializer().serialize(value.alertCategory), - "alert_instance_id": Serialization._StringSerializer.serialize(value.alertInstanceId), + + public class AdminAlertingTriggeredAlertDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingTriggeredAlertDetails) throws -> JSON { + let output = [ + "alert_name": try Serialization._StringSerializer.serialize(value.alertName), + "alert_severity": try TeamLog.AdminAlertSeverityEnumSerializer().serialize(value.alertSeverity), + "alert_category": try TeamLog.AdminAlertCategoryEnumSerializer().serialize(value.alertCategory), + "alert_instance_id": try Serialization._StringSerializer.serialize(value.alertInstanceId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminAlertingTriggeredAlertDetails { + + public func deserialize(_ json: JSON) throws -> AdminAlertingTriggeredAlertDetails { switch json { - case .dictionary(let dict): - let alertName = Serialization._StringSerializer.deserialize(dict["alert_name"] ?? .null) - let alertSeverity = TeamLog.AdminAlertSeverityEnumSerializer().deserialize(dict["alert_severity"] ?? .null) - let alertCategory = TeamLog.AdminAlertCategoryEnumSerializer().deserialize(dict["alert_category"] ?? .null) - let alertInstanceId = Serialization._StringSerializer.deserialize(dict["alert_instance_id"] ?? .null) - return AdminAlertingTriggeredAlertDetails(alertName: alertName, alertSeverity: alertSeverity, alertCategory: alertCategory, alertInstanceId: alertInstanceId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let alertName = try Serialization._StringSerializer.deserialize(dict["alert_name"] ?? .null) + let alertSeverity = try TeamLog.AdminAlertSeverityEnumSerializer().deserialize(dict["alert_severity"] ?? .null) + let alertCategory = try TeamLog.AdminAlertCategoryEnumSerializer().deserialize(dict["alert_category"] ?? .null) + let alertInstanceId = try Serialization._StringSerializer.deserialize(dict["alert_instance_id"] ?? .null) + return AdminAlertingTriggeredAlertDetails( + alertName: alertName, + alertSeverity: alertSeverity, + alertCategory: alertCategory, + alertInstanceId: alertInstanceId + ) + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingTriggeredAlertDetails.self, json: json) } } } /// The AdminAlertingTriggeredAlertType struct - open class AdminAlertingTriggeredAlertType: CustomStringConvertible { + public class AdminAlertingTriggeredAlertType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminAlertingTriggeredAlertTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminAlertingTriggeredAlertTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminAlertingTriggeredAlertTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminAlertingTriggeredAlertType: \(error)" + } } } - open class AdminAlertingTriggeredAlertTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminAlertingTriggeredAlertType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AdminAlertingTriggeredAlertTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminAlertingTriggeredAlertType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminAlertingTriggeredAlertType { + + public func deserialize(_ json: JSON) throws -> AdminAlertingTriggeredAlertType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AdminAlertingTriggeredAlertType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AdminAlertingTriggeredAlertType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AdminAlertingTriggeredAlertType.self, json: json) } } } /// The AdminConsoleAppPermission union - public enum AdminConsoleAppPermission: CustomStringConvertible { + public enum AdminConsoleAppPermission: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case defaultForListedApps /// An unspecified error. @@ -1521,50 +1896,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminConsoleAppPermissionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminConsoleAppPermissionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminConsoleAppPermissionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminConsoleAppPermission: \(error)" + } } } - open class AdminConsoleAppPermissionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminConsoleAppPermission) -> JSON { + + public class AdminConsoleAppPermissionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminConsoleAppPermission) throws -> JSON { switch value { - case .defaultForListedApps: - var d = [String: JSON]() - d[".tag"] = .str("default_for_listed_apps") - return .dictionary(d) - case .defaultForUnlistedApps: - var d = [String: JSON]() - d[".tag"] = .str("default_for_unlisted_apps") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminConsoleAppPermission { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default_for_listed_apps": - return AdminConsoleAppPermission.defaultForListedApps - case "default_for_unlisted_apps": - return AdminConsoleAppPermission.defaultForUnlistedApps - case "other": - return AdminConsoleAppPermission.other - default: - return AdminConsoleAppPermission.other - } + case .defaultForListedApps: + var d = [String: JSON]() + d[".tag"] = .str("default_for_listed_apps") + return .dictionary(d) + case .defaultForUnlistedApps: + var d = [String: JSON]() + d[".tag"] = .str("default_for_unlisted_apps") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminConsoleAppPermission { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default_for_listed_apps": + return AdminConsoleAppPermission.defaultForListedApps + case "default_for_unlisted_apps": + return AdminConsoleAppPermission.defaultForUnlistedApps + case "other": + return AdminConsoleAppPermission.other default: - fatalError("Failed to deserialize") + return AdminConsoleAppPermission.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminConsoleAppPermission.self, json: json) } } } /// The AdminConsoleAppPolicy union - public enum AdminConsoleAppPolicy: CustomStringConvertible { + public enum AdminConsoleAppPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case allow /// An unspecified error. @@ -1574,56 +1959,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminConsoleAppPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminConsoleAppPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminConsoleAppPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminConsoleAppPolicy: \(error)" + } } } - open class AdminConsoleAppPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminConsoleAppPolicy) -> JSON { + + public class AdminConsoleAppPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminConsoleAppPolicy) throws -> JSON { switch value { - case .allow: - var d = [String: JSON]() - d[".tag"] = .str("allow") - return .dictionary(d) - case .block: - var d = [String: JSON]() - d[".tag"] = .str("block") - return .dictionary(d) - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminConsoleAppPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "allow": - return AdminConsoleAppPolicy.allow - case "block": - return AdminConsoleAppPolicy.block - case "default": - return AdminConsoleAppPolicy.default_ - case "other": - return AdminConsoleAppPolicy.other - default: - return AdminConsoleAppPolicy.other - } - default: - fatalError("Failed to deserialize") + case .allow: + var d = [String: JSON]() + d[".tag"] = .str("allow") + return .dictionary(d) + case .block: + var d = [String: JSON]() + d[".tag"] = .str("block") + return .dictionary(d) + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminConsoleAppPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "allow": + return AdminConsoleAppPolicy.allow + case "block": + return AdminConsoleAppPolicy.block + case "default": + return AdminConsoleAppPolicy.default_ + case "other": + return AdminConsoleAppPolicy.other + default: + return AdminConsoleAppPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminConsoleAppPolicy.self, json: json) } } } /// Changed admin reminder settings for requests to join the team. - open class AdminEmailRemindersChangedDetails: CustomStringConvertible { + public class AdminEmailRemindersChangedDetails: CustomStringConvertible, JSONRepresentable { /// To. public let newValue: TeamLog.AdminEmailRemindersPolicy /// From. @@ -1632,64 +2027,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminEmailRemindersChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminEmailRemindersChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminEmailRemindersChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminEmailRemindersChangedDetails: \(error)" + } } } - open class AdminEmailRemindersChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminEmailRemindersChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.AdminEmailRemindersPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.AdminEmailRemindersPolicySerializer().serialize(value.previousValue), + + public class AdminEmailRemindersChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminEmailRemindersChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.AdminEmailRemindersPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.AdminEmailRemindersPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminEmailRemindersChangedDetails { + + public func deserialize(_ json: JSON) throws -> AdminEmailRemindersChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.AdminEmailRemindersPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.AdminEmailRemindersPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return AdminEmailRemindersChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.AdminEmailRemindersPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.AdminEmailRemindersPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return AdminEmailRemindersChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: AdminEmailRemindersChangedDetails.self, json: json) } } } /// The AdminEmailRemindersChangedType struct - open class AdminEmailRemindersChangedType: CustomStringConvertible { + public class AdminEmailRemindersChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminEmailRemindersChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AdminEmailRemindersChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminEmailRemindersChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminEmailRemindersChangedType: \(error)" + } } } - open class AdminEmailRemindersChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminEmailRemindersChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AdminEmailRemindersChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminEmailRemindersChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AdminEmailRemindersChangedType { + + public func deserialize(_ json: JSON) throws -> AdminEmailRemindersChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AdminEmailRemindersChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AdminEmailRemindersChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AdminEmailRemindersChangedType.self, json: json) } } } /// Policy for deciding whether team admins receive reminder emails for requests to join the team - public enum AdminEmailRemindersPolicy: CustomStringConvertible { + public enum AdminEmailRemindersPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case default_ /// An unspecified error. @@ -1699,56 +2116,66 @@ open class TeamLog { /// An unspecified error. case other - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminEmailRemindersPolicySerializer().serialize(self)))" + func json() throws -> JSON { + try AdminEmailRemindersPolicySerializer().serialize(self) } - } - open class AdminEmailRemindersPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminEmailRemindersPolicy) -> JSON { + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminEmailRemindersPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminEmailRemindersPolicy: \(error)" + } + } + } + + public class AdminEmailRemindersPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminEmailRemindersPolicy) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminEmailRemindersPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return AdminEmailRemindersPolicy.default_ - case "disabled": - return AdminEmailRemindersPolicy.disabled - case "enabled": - return AdminEmailRemindersPolicy.enabled - case "other": - return AdminEmailRemindersPolicy.other - default: - return AdminEmailRemindersPolicy.other - } - default: - fatalError("Failed to deserialize") + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminEmailRemindersPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return AdminEmailRemindersPolicy.default_ + case "disabled": + return AdminEmailRemindersPolicy.disabled + case "enabled": + return AdminEmailRemindersPolicy.enabled + case "other": + return AdminEmailRemindersPolicy.other + default: + return AdminEmailRemindersPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminEmailRemindersPolicy.self, json: json) } } } /// The AdminRole union - public enum AdminRole: CustomStringConvertible { + public enum AdminRole: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case billingAdmin /// An unspecified error. @@ -1772,98 +2199,108 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AdminRoleSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AdminRoleSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AdminRoleSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AdminRole: \(error)" + } } } - open class AdminRoleSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AdminRole) -> JSON { + + public class AdminRoleSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AdminRole) throws -> JSON { switch value { - case .billingAdmin: - var d = [String: JSON]() - d[".tag"] = .str("billing_admin") - return .dictionary(d) - case .complianceAdmin: - var d = [String: JSON]() - d[".tag"] = .str("compliance_admin") - return .dictionary(d) - case .contentAdmin: - var d = [String: JSON]() - d[".tag"] = .str("content_admin") - return .dictionary(d) - case .limitedAdmin: - var d = [String: JSON]() - d[".tag"] = .str("limited_admin") - return .dictionary(d) - case .memberOnly: - var d = [String: JSON]() - d[".tag"] = .str("member_only") - return .dictionary(d) - case .reportingAdmin: - var d = [String: JSON]() - d[".tag"] = .str("reporting_admin") - return .dictionary(d) - case .securityAdmin: - var d = [String: JSON]() - d[".tag"] = .str("security_admin") - return .dictionary(d) - case .supportAdmin: - var d = [String: JSON]() - d[".tag"] = .str("support_admin") - return .dictionary(d) - case .teamAdmin: - var d = [String: JSON]() - d[".tag"] = .str("team_admin") - return .dictionary(d) - case .userManagementAdmin: - var d = [String: JSON]() - d[".tag"] = .str("user_management_admin") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AdminRole { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "billing_admin": - return AdminRole.billingAdmin - case "compliance_admin": - return AdminRole.complianceAdmin - case "content_admin": - return AdminRole.contentAdmin - case "limited_admin": - return AdminRole.limitedAdmin - case "member_only": - return AdminRole.memberOnly - case "reporting_admin": - return AdminRole.reportingAdmin - case "security_admin": - return AdminRole.securityAdmin - case "support_admin": - return AdminRole.supportAdmin - case "team_admin": - return AdminRole.teamAdmin - case "user_management_admin": - return AdminRole.userManagementAdmin - case "other": - return AdminRole.other - default: - return AdminRole.other - } - default: - fatalError("Failed to deserialize") + case .billingAdmin: + var d = [String: JSON]() + d[".tag"] = .str("billing_admin") + return .dictionary(d) + case .complianceAdmin: + var d = [String: JSON]() + d[".tag"] = .str("compliance_admin") + return .dictionary(d) + case .contentAdmin: + var d = [String: JSON]() + d[".tag"] = .str("content_admin") + return .dictionary(d) + case .limitedAdmin: + var d = [String: JSON]() + d[".tag"] = .str("limited_admin") + return .dictionary(d) + case .memberOnly: + var d = [String: JSON]() + d[".tag"] = .str("member_only") + return .dictionary(d) + case .reportingAdmin: + var d = [String: JSON]() + d[".tag"] = .str("reporting_admin") + return .dictionary(d) + case .securityAdmin: + var d = [String: JSON]() + d[".tag"] = .str("security_admin") + return .dictionary(d) + case .supportAdmin: + var d = [String: JSON]() + d[".tag"] = .str("support_admin") + return .dictionary(d) + case .teamAdmin: + var d = [String: JSON]() + d[".tag"] = .str("team_admin") + return .dictionary(d) + case .userManagementAdmin: + var d = [String: JSON]() + d[".tag"] = .str("user_management_admin") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AdminRole { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "billing_admin": + return AdminRole.billingAdmin + case "compliance_admin": + return AdminRole.complianceAdmin + case "content_admin": + return AdminRole.contentAdmin + case "limited_admin": + return AdminRole.limitedAdmin + case "member_only": + return AdminRole.memberOnly + case "reporting_admin": + return AdminRole.reportingAdmin + case "security_admin": + return AdminRole.securityAdmin + case "support_admin": + return AdminRole.supportAdmin + case "team_admin": + return AdminRole.teamAdmin + case "user_management_admin": + return AdminRole.userManagementAdmin + case "other": + return AdminRole.other + default: + return AdminRole.other + } + default: + throw JSONSerializerError.deserializeError(type: AdminRole.self, json: json) } } } /// Alert recipients setting type - public enum AlertRecipientsSettingType: CustomStringConvertible { + public enum AlertRecipientsSettingType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case customList /// An unspecified error. @@ -1875,386 +2312,511 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try AlertRecipientsSettingTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AlertRecipientsSettingTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AlertRecipientsSettingTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AlertRecipientsSettingType: \(error)" + } } } - open class AlertRecipientsSettingTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AlertRecipientsSettingType) -> JSON { + + public class AlertRecipientsSettingTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AlertRecipientsSettingType) throws -> JSON { switch value { - case .customList: - var d = [String: JSON]() - d[".tag"] = .str("custom_list") - return .dictionary(d) - case .invalid: - var d = [String: JSON]() - d[".tag"] = .str("invalid") - return .dictionary(d) - case .none: - var d = [String: JSON]() - d[".tag"] = .str("none") - return .dictionary(d) - case .teamAdmins: - var d = [String: JSON]() - d[".tag"] = .str("team_admins") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AlertRecipientsSettingType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "custom_list": - return AlertRecipientsSettingType.customList - case "invalid": - return AlertRecipientsSettingType.invalid - case "none": - return AlertRecipientsSettingType.none - case "team_admins": - return AlertRecipientsSettingType.teamAdmins - case "other": - return AlertRecipientsSettingType.other - default: - return AlertRecipientsSettingType.other - } - default: - fatalError("Failed to deserialize") + case .customList: + var d = [String: JSON]() + d[".tag"] = .str("custom_list") + return .dictionary(d) + case .invalid: + var d = [String: JSON]() + d[".tag"] = .str("invalid") + return .dictionary(d) + case .none: + var d = [String: JSON]() + d[".tag"] = .str("none") + return .dictionary(d) + case .teamAdmins: + var d = [String: JSON]() + d[".tag"] = .str("team_admins") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AlertRecipientsSettingType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "custom_list": + return AlertRecipientsSettingType.customList + case "invalid": + return AlertRecipientsSettingType.invalid + case "none": + return AlertRecipientsSettingType.none + case "team_admins": + return AlertRecipientsSettingType.teamAdmins + case "other": + return AlertRecipientsSettingType.other + default: + return AlertRecipientsSettingType.other + } + default: + throw JSONSerializerError.deserializeError(type: AlertRecipientsSettingType.self, json: json) } } } /// Disabled downloads. - open class AllowDownloadDisabledDetails: CustomStringConvertible { - public init() { + public class AllowDownloadDisabledDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try AllowDownloadDisabledDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AllowDownloadDisabledDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AllowDownloadDisabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AllowDownloadDisabledDetails: \(error)" + } } } - open class AllowDownloadDisabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AllowDownloadDisabledDetails) -> JSON { + + public class AllowDownloadDisabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AllowDownloadDisabledDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> AllowDownloadDisabledDetails { + + public func deserialize(_ json: JSON) throws -> AllowDownloadDisabledDetails { switch json { - case .dictionary(_): - return AllowDownloadDisabledDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return AllowDownloadDisabledDetails() + default: + throw JSONSerializerError.deserializeError(type: AllowDownloadDisabledDetails.self, json: json) } } } /// The AllowDownloadDisabledType struct - open class AllowDownloadDisabledType: CustomStringConvertible { + public class AllowDownloadDisabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AllowDownloadDisabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AllowDownloadDisabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AllowDownloadDisabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AllowDownloadDisabledType: \(error)" + } } } - open class AllowDownloadDisabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AllowDownloadDisabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AllowDownloadDisabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AllowDownloadDisabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AllowDownloadDisabledType { + + public func deserialize(_ json: JSON) throws -> AllowDownloadDisabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AllowDownloadDisabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AllowDownloadDisabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AllowDownloadDisabledType.self, json: json) } } } /// Enabled downloads. - open class AllowDownloadEnabledDetails: CustomStringConvertible { - public init() { + public class AllowDownloadEnabledDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try AllowDownloadEnabledDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AllowDownloadEnabledDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AllowDownloadEnabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AllowDownloadEnabledDetails: \(error)" + } } } - open class AllowDownloadEnabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AllowDownloadEnabledDetails) -> JSON { + + public class AllowDownloadEnabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AllowDownloadEnabledDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> AllowDownloadEnabledDetails { + + public func deserialize(_ json: JSON) throws -> AllowDownloadEnabledDetails { switch json { - case .dictionary(_): - return AllowDownloadEnabledDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return AllowDownloadEnabledDetails() + default: + throw JSONSerializerError.deserializeError(type: AllowDownloadEnabledDetails.self, json: json) } } } /// The AllowDownloadEnabledType struct - open class AllowDownloadEnabledType: CustomStringConvertible { + public class AllowDownloadEnabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AllowDownloadEnabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AllowDownloadEnabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AllowDownloadEnabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AllowDownloadEnabledType: \(error)" + } } } - open class AllowDownloadEnabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AllowDownloadEnabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AllowDownloadEnabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AllowDownloadEnabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AllowDownloadEnabledType { + + public func deserialize(_ json: JSON) throws -> AllowDownloadEnabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AllowDownloadEnabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AllowDownloadEnabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AllowDownloadEnabledType.self, json: json) } } } /// Api session. - open class ApiSessionLogInfo: CustomStringConvertible { + public class ApiSessionLogInfo: CustomStringConvertible, JSONRepresentable { /// Api request ID. public let requestId: String public init(requestId: String) { stringValidator()(requestId) self.requestId = requestId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ApiSessionLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try ApiSessionLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ApiSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ApiSessionLogInfo: \(error)" + } } } - open class ApiSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ApiSessionLogInfo) -> JSON { - let output = [ - "request_id": Serialization._StringSerializer.serialize(value.requestId), + + public class ApiSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ApiSessionLogInfo) throws -> JSON { + let output = [ + "request_id": try Serialization._StringSerializer.serialize(value.requestId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ApiSessionLogInfo { + + public func deserialize(_ json: JSON) throws -> ApiSessionLogInfo { switch json { - case .dictionary(let dict): - let requestId = Serialization._StringSerializer.deserialize(dict["request_id"] ?? .null) - return ApiSessionLogInfo(requestId: requestId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let requestId = try Serialization._StringSerializer.deserialize(dict["request_id"] ?? .null) + return ApiSessionLogInfo(requestId: requestId) + default: + throw JSONSerializerError.deserializeError(type: ApiSessionLogInfo.self, json: json) } } } /// Failed to connect app for member. - open class AppBlockedByPermissionsDetails: CustomStringConvertible { + public class AppBlockedByPermissionsDetails: CustomStringConvertible, JSONRepresentable { /// Relevant application details. public let appInfo: TeamLog.AppLogInfo public init(appInfo: TeamLog.AppLogInfo) { self.appInfo = appInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppBlockedByPermissionsDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppBlockedByPermissionsDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppBlockedByPermissionsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppBlockedByPermissionsDetails: \(error)" + } } } - open class AppBlockedByPermissionsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppBlockedByPermissionsDetails) -> JSON { - let output = [ - "app_info": TeamLog.AppLogInfoSerializer().serialize(value.appInfo), + + public class AppBlockedByPermissionsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppBlockedByPermissionsDetails) throws -> JSON { + let output = [ + "app_info": try TeamLog.AppLogInfoSerializer().serialize(value.appInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppBlockedByPermissionsDetails { + + public func deserialize(_ json: JSON) throws -> AppBlockedByPermissionsDetails { switch json { - case .dictionary(let dict): - let appInfo = TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) - return AppBlockedByPermissionsDetails(appInfo: appInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appInfo = try TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) + return AppBlockedByPermissionsDetails(appInfo: appInfo) + default: + throw JSONSerializerError.deserializeError(type: AppBlockedByPermissionsDetails.self, json: json) } } } /// The AppBlockedByPermissionsType struct - open class AppBlockedByPermissionsType: CustomStringConvertible { + public class AppBlockedByPermissionsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppBlockedByPermissionsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppBlockedByPermissionsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppBlockedByPermissionsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppBlockedByPermissionsType: \(error)" + } } } - open class AppBlockedByPermissionsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppBlockedByPermissionsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AppBlockedByPermissionsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppBlockedByPermissionsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppBlockedByPermissionsType { + + public func deserialize(_ json: JSON) throws -> AppBlockedByPermissionsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AppBlockedByPermissionsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AppBlockedByPermissionsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AppBlockedByPermissionsType.self, json: json) } } } /// Linked app for team. - open class AppLinkTeamDetails: CustomStringConvertible { + public class AppLinkTeamDetails: CustomStringConvertible, JSONRepresentable { /// Relevant application details. public let appInfo: TeamLog.AppLogInfo public init(appInfo: TeamLog.AppLogInfo) { self.appInfo = appInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppLinkTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppLinkTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppLinkTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppLinkTeamDetails: \(error)" + } } } - open class AppLinkTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppLinkTeamDetails) -> JSON { - let output = [ - "app_info": TeamLog.AppLogInfoSerializer().serialize(value.appInfo), + + public class AppLinkTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppLinkTeamDetails) throws -> JSON { + let output = [ + "app_info": try TeamLog.AppLogInfoSerializer().serialize(value.appInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppLinkTeamDetails { + + public func deserialize(_ json: JSON) throws -> AppLinkTeamDetails { switch json { - case .dictionary(let dict): - let appInfo = TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) - return AppLinkTeamDetails(appInfo: appInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appInfo = try TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) + return AppLinkTeamDetails(appInfo: appInfo) + default: + throw JSONSerializerError.deserializeError(type: AppLinkTeamDetails.self, json: json) } } } /// The AppLinkTeamType struct - open class AppLinkTeamType: CustomStringConvertible { + public class AppLinkTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppLinkTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppLinkTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppLinkTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppLinkTeamType: \(error)" + } } } - open class AppLinkTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppLinkTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AppLinkTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppLinkTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppLinkTeamType { + + public func deserialize(_ json: JSON) throws -> AppLinkTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AppLinkTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AppLinkTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AppLinkTeamType.self, json: json) } } } /// Linked app for member. - open class AppLinkUserDetails: CustomStringConvertible { + public class AppLinkUserDetails: CustomStringConvertible, JSONRepresentable { /// Relevant application details. public let appInfo: TeamLog.AppLogInfo public init(appInfo: TeamLog.AppLogInfo) { self.appInfo = appInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppLinkUserDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppLinkUserDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppLinkUserDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppLinkUserDetails: \(error)" + } } } - open class AppLinkUserDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppLinkUserDetails) -> JSON { - let output = [ - "app_info": TeamLog.AppLogInfoSerializer().serialize(value.appInfo), + + public class AppLinkUserDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppLinkUserDetails) throws -> JSON { + let output = [ + "app_info": try TeamLog.AppLogInfoSerializer().serialize(value.appInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppLinkUserDetails { + + public func deserialize(_ json: JSON) throws -> AppLinkUserDetails { switch json { - case .dictionary(let dict): - let appInfo = TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) - return AppLinkUserDetails(appInfo: appInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appInfo = try TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) + return AppLinkUserDetails(appInfo: appInfo) + default: + throw JSONSerializerError.deserializeError(type: AppLinkUserDetails.self, json: json) } } } /// The AppLinkUserType struct - open class AppLinkUserType: CustomStringConvertible { + public class AppLinkUserType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppLinkUserTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppLinkUserTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppLinkUserTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppLinkUserType: \(error)" + } } } - open class AppLinkUserTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppLinkUserType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AppLinkUserTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppLinkUserType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppLinkUserType { + + public func deserialize(_ json: JSON) throws -> AppLinkUserType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AppLinkUserType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AppLinkUserType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AppLinkUserType.self, json: json) } } } /// App's logged information. - open class AppLogInfo: CustomStringConvertible { + public class AppLogInfo: CustomStringConvertible, JSONRepresentable { /// App unique ID. public let appId: String? /// App display name. @@ -2265,61 +2827,73 @@ open class TeamLog { nullableValidator(stringValidator())(displayName) self.displayName = displayName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppLogInfo: \(error)" + } } } - open class AppLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppLogInfo) -> JSON { - var output = [ - "app_id": NullableSerializer(Serialization._StringSerializer).serialize(value.appId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + + public class AppLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppLogInfo) throws -> JSON { + var output = [ + "app_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.appId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), ] switch value { - case let userOrTeamLinkedApp as TeamLog.UserOrTeamLinkedAppLogInfo: - for (k, v) in Serialization.getFields(TeamLog.UserOrTeamLinkedAppLogInfoSerializer().serialize(userOrTeamLinkedApp)) { - output[k] = v - } - output[".tag"] = .str("user_or_team_linked_app") - case let userLinkedApp as TeamLog.UserLinkedAppLogInfo: - for (k, v) in Serialization.getFields(TeamLog.UserLinkedAppLogInfoSerializer().serialize(userLinkedApp)) { - output[k] = v - } - output[".tag"] = .str("user_linked_app") - case let teamLinkedApp as TeamLog.TeamLinkedAppLogInfo: - for (k, v) in Serialization.getFields(TeamLog.TeamLinkedAppLogInfoSerializer().serialize(teamLinkedApp)) { - output[k] = v - } - output[".tag"] = .str("team_linked_app") - default: fatalError("Tried to serialize unexpected subtype") - } - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> AppLogInfo { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "user_or_team_linked_app": - return TeamLog.UserOrTeamLinkedAppLogInfoSerializer().deserialize(json) - case "user_linked_app": - return TeamLog.UserLinkedAppLogInfoSerializer().deserialize(json) - case "team_linked_app": - return TeamLog.TeamLinkedAppLogInfoSerializer().deserialize(json) - default: - let appId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - return AppLogInfo(appId: appId, displayName: displayName) - } + case let userOrTeamLinkedApp as TeamLog.UserOrTeamLinkedAppLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.UserOrTeamLinkedAppLogInfoSerializer().serialize(userOrTeamLinkedApp)) { + output[k] = v + } + output[".tag"] = .str("user_or_team_linked_app") + case let userLinkedApp as TeamLog.UserLinkedAppLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.UserLinkedAppLogInfoSerializer().serialize(userLinkedApp)) { + output[k] = v + } + output[".tag"] = .str("user_linked_app") + case let teamLinkedApp as TeamLog.TeamLinkedAppLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.TeamLinkedAppLogInfoSerializer().serialize(teamLinkedApp)) { + output[k] = v + } + output[".tag"] = .str("team_linked_app") + default: + throw JSONSerializerError.unexpectedSubtype(type: AppLogInfo.self, subtype: value) + } + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> AppLogInfo { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "user_or_team_linked_app": + return try TeamLog.UserOrTeamLinkedAppLogInfoSerializer().deserialize(json) + case "user_linked_app": + return try TeamLog.UserLinkedAppLogInfoSerializer().deserialize(json) + case "team_linked_app": + return try TeamLog.TeamLinkedAppLogInfoSerializer().deserialize(json) default: - fatalError("Type error deserializing") + let appId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + return AppLogInfo(appId: appId, displayName: displayName) + } + default: + throw JSONSerializerError.deserializeError(type: AppLogInfo.self, json: json) } } } /// Changed app permissions. - open class AppPermissionsChangedDetails: CustomStringConvertible { + public class AppPermissionsChangedDetails: CustomStringConvertible, JSONRepresentable { /// Name of the app. public let appName: String? /// Permission that was changed. @@ -2328,252 +2902,342 @@ open class TeamLog { public let previousValue: TeamLog.AdminConsoleAppPolicy /// New policy. public let newValue: TeamLog.AdminConsoleAppPolicy - public init(previousValue: TeamLog.AdminConsoleAppPolicy, newValue: TeamLog.AdminConsoleAppPolicy, appName: String? = nil, permission: TeamLog.AdminConsoleAppPermission? = nil) { + public init( + previousValue: TeamLog.AdminConsoleAppPolicy, + newValue: TeamLog.AdminConsoleAppPolicy, + appName: String? = nil, + permission: TeamLog.AdminConsoleAppPermission? = nil + ) { nullableValidator(stringValidator())(appName) self.appName = appName self.permission = permission self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppPermissionsChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppPermissionsChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppPermissionsChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppPermissionsChangedDetails: \(error)" + } } } - open class AppPermissionsChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppPermissionsChangedDetails) -> JSON { - let output = [ - "previous_value": TeamLog.AdminConsoleAppPolicySerializer().serialize(value.previousValue), - "new_value": TeamLog.AdminConsoleAppPolicySerializer().serialize(value.newValue), - "app_name": NullableSerializer(Serialization._StringSerializer).serialize(value.appName), - "permission": NullableSerializer(TeamLog.AdminConsoleAppPermissionSerializer()).serialize(value.permission), + + public class AppPermissionsChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppPermissionsChangedDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.AdminConsoleAppPolicySerializer().serialize(value.previousValue), + "new_value": try TeamLog.AdminConsoleAppPolicySerializer().serialize(value.newValue), + "app_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.appName), + "permission": try NullableSerializer(TeamLog.AdminConsoleAppPermissionSerializer()).serialize(value.permission), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppPermissionsChangedDetails { + + public func deserialize(_ json: JSON) throws -> AppPermissionsChangedDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.AdminConsoleAppPolicySerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.AdminConsoleAppPolicySerializer().deserialize(dict["new_value"] ?? .null) - let appName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_name"] ?? .null) - let permission = NullableSerializer(TeamLog.AdminConsoleAppPermissionSerializer()).deserialize(dict["permission"] ?? .null) - return AppPermissionsChangedDetails(previousValue: previousValue, newValue: newValue, appName: appName, permission: permission) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.AdminConsoleAppPolicySerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.AdminConsoleAppPolicySerializer().deserialize(dict["new_value"] ?? .null) + let appName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_name"] ?? .null) + let permission = try NullableSerializer(TeamLog.AdminConsoleAppPermissionSerializer()).deserialize(dict["permission"] ?? .null) + return AppPermissionsChangedDetails(previousValue: previousValue, newValue: newValue, appName: appName, permission: permission) + default: + throw JSONSerializerError.deserializeError(type: AppPermissionsChangedDetails.self, json: json) } } } /// The AppPermissionsChangedType struct - open class AppPermissionsChangedType: CustomStringConvertible { + public class AppPermissionsChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppPermissionsChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppPermissionsChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppPermissionsChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppPermissionsChangedType: \(error)" + } } } - open class AppPermissionsChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppPermissionsChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AppPermissionsChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppPermissionsChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppPermissionsChangedType { + + public func deserialize(_ json: JSON) throws -> AppPermissionsChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AppPermissionsChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AppPermissionsChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AppPermissionsChangedType.self, json: json) } } } /// Unlinked app for team. - open class AppUnlinkTeamDetails: CustomStringConvertible { + public class AppUnlinkTeamDetails: CustomStringConvertible, JSONRepresentable { /// Relevant application details. public let appInfo: TeamLog.AppLogInfo public init(appInfo: TeamLog.AppLogInfo) { self.appInfo = appInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppUnlinkTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppUnlinkTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppUnlinkTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppUnlinkTeamDetails: \(error)" + } } } - open class AppUnlinkTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppUnlinkTeamDetails) -> JSON { - let output = [ - "app_info": TeamLog.AppLogInfoSerializer().serialize(value.appInfo), + + public class AppUnlinkTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppUnlinkTeamDetails) throws -> JSON { + let output = [ + "app_info": try TeamLog.AppLogInfoSerializer().serialize(value.appInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppUnlinkTeamDetails { + + public func deserialize(_ json: JSON) throws -> AppUnlinkTeamDetails { switch json { - case .dictionary(let dict): - let appInfo = TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) - return AppUnlinkTeamDetails(appInfo: appInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appInfo = try TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) + return AppUnlinkTeamDetails(appInfo: appInfo) + default: + throw JSONSerializerError.deserializeError(type: AppUnlinkTeamDetails.self, json: json) } } } /// The AppUnlinkTeamType struct - open class AppUnlinkTeamType: CustomStringConvertible { + public class AppUnlinkTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppUnlinkTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppUnlinkTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppUnlinkTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppUnlinkTeamType: \(error)" + } } } - open class AppUnlinkTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppUnlinkTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AppUnlinkTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppUnlinkTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppUnlinkTeamType { + + public func deserialize(_ json: JSON) throws -> AppUnlinkTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AppUnlinkTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AppUnlinkTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AppUnlinkTeamType.self, json: json) } } } /// Unlinked app for member. - open class AppUnlinkUserDetails: CustomStringConvertible { + public class AppUnlinkUserDetails: CustomStringConvertible, JSONRepresentable { /// Relevant application details. public let appInfo: TeamLog.AppLogInfo public init(appInfo: TeamLog.AppLogInfo) { self.appInfo = appInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppUnlinkUserDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppUnlinkUserDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppUnlinkUserDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppUnlinkUserDetails: \(error)" + } } } - open class AppUnlinkUserDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppUnlinkUserDetails) -> JSON { - let output = [ - "app_info": TeamLog.AppLogInfoSerializer().serialize(value.appInfo), + + public class AppUnlinkUserDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppUnlinkUserDetails) throws -> JSON { + let output = [ + "app_info": try TeamLog.AppLogInfoSerializer().serialize(value.appInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppUnlinkUserDetails { + + public func deserialize(_ json: JSON) throws -> AppUnlinkUserDetails { switch json { - case .dictionary(let dict): - let appInfo = TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) - return AppUnlinkUserDetails(appInfo: appInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appInfo = try TeamLog.AppLogInfoSerializer().deserialize(dict["app_info"] ?? .null) + return AppUnlinkUserDetails(appInfo: appInfo) + default: + throw JSONSerializerError.deserializeError(type: AppUnlinkUserDetails.self, json: json) } } } /// The AppUnlinkUserType struct - open class AppUnlinkUserType: CustomStringConvertible { + public class AppUnlinkUserType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AppUnlinkUserTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try AppUnlinkUserTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AppUnlinkUserTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AppUnlinkUserType: \(error)" + } } } - open class AppUnlinkUserTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AppUnlinkUserType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class AppUnlinkUserTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AppUnlinkUserType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> AppUnlinkUserType { + + public func deserialize(_ json: JSON) throws -> AppUnlinkUserType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return AppUnlinkUserType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return AppUnlinkUserType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: AppUnlinkUserType.self, json: json) } } } /// Applied naming convention. - open class ApplyNamingConventionDetails: CustomStringConvertible { - public init() { + public class ApplyNamingConventionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ApplyNamingConventionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ApplyNamingConventionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ApplyNamingConventionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ApplyNamingConventionDetails: \(error)" + } } } - open class ApplyNamingConventionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ApplyNamingConventionDetails) -> JSON { + + public class ApplyNamingConventionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ApplyNamingConventionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> ApplyNamingConventionDetails { + + public func deserialize(_ json: JSON) throws -> ApplyNamingConventionDetails { switch json { - case .dictionary(_): - return ApplyNamingConventionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return ApplyNamingConventionDetails() + default: + throw JSONSerializerError.deserializeError(type: ApplyNamingConventionDetails.self, json: json) } } } /// The ApplyNamingConventionType struct - open class ApplyNamingConventionType: CustomStringConvertible { + public class ApplyNamingConventionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ApplyNamingConventionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ApplyNamingConventionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ApplyNamingConventionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ApplyNamingConventionType: \(error)" + } } } - open class ApplyNamingConventionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ApplyNamingConventionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ApplyNamingConventionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ApplyNamingConventionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ApplyNamingConventionType { + + public func deserialize(_ json: JSON) throws -> ApplyNamingConventionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ApplyNamingConventionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ApplyNamingConventionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ApplyNamingConventionType.self, json: json) } } } /// Asset details. - public enum AssetLogInfo: CustomStringConvertible { + public enum AssetLogInfo: CustomStringConvertible, JSONRepresentable { /// File's details. case file(TeamLog.FileLogInfo) /// Folder's details. @@ -2587,273 +3251,293 @@ open class TeamLog { /// An unspecified error. case other - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AssetLogInfoSerializer().serialize(self)))" + func json() throws -> JSON { + try AssetLogInfoSerializer().serialize(self) } - } - open class AssetLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AssetLogInfo) -> JSON { - switch value { - case .file(let arg): - var d = Serialization.getFields(TeamLog.FileLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("file") - return .dictionary(d) - case .folder(let arg): - var d = Serialization.getFields(TeamLog.FolderLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("folder") - return .dictionary(d) - case .paperDocument(let arg): - var d = Serialization.getFields(TeamLog.PaperDocumentLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("paper_document") - return .dictionary(d) - case .paperFolder(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder") - return .dictionary(d) - case .showcaseDocument(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseDocumentLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("showcase_document") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> AssetLogInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "file": - let v = TeamLog.FileLogInfoSerializer().deserialize(json) - return AssetLogInfo.file(v) - case "folder": - let v = TeamLog.FolderLogInfoSerializer().deserialize(json) - return AssetLogInfo.folder(v) - case "paper_document": - let v = TeamLog.PaperDocumentLogInfoSerializer().deserialize(json) - return AssetLogInfo.paperDocument(v) - case "paper_folder": - let v = TeamLog.PaperFolderLogInfoSerializer().deserialize(json) - return AssetLogInfo.paperFolder(v) - case "showcase_document": - let v = TeamLog.ShowcaseDocumentLogInfoSerializer().deserialize(json) - return AssetLogInfo.showcaseDocument(v) - case "other": - return AssetLogInfo.other - default: - return AssetLogInfo.other - } - default: - fatalError("Failed to deserialize") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AssetLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AssetLogInfo: \(error)" } } } - /// Backup status - public enum BackupStatus: CustomStringConvertible { - /// An unspecified error. - case disabled - /// An unspecified error. - case enabled - /// An unspecified error. - case other + public class AssetLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AssetLogInfo) throws -> JSON { + switch value { + case .file(let arg): + var d = try Serialization.getFields(TeamLog.FileLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("file") + return .dictionary(d) + case .folder(let arg): + var d = try Serialization.getFields(TeamLog.FolderLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("folder") + return .dictionary(d) + case .paperDocument(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocumentLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("paper_document") + return .dictionary(d) + case .paperFolder(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder") + return .dictionary(d) + case .showcaseDocument(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseDocumentLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("showcase_document") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> AssetLogInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "file": + let v = try TeamLog.FileLogInfoSerializer().deserialize(json) + return AssetLogInfo.file(v) + case "folder": + let v = try TeamLog.FolderLogInfoSerializer().deserialize(json) + return AssetLogInfo.folder(v) + case "paper_document": + let v = try TeamLog.PaperDocumentLogInfoSerializer().deserialize(json) + return AssetLogInfo.paperDocument(v) + case "paper_folder": + let v = try TeamLog.PaperFolderLogInfoSerializer().deserialize(json) + return AssetLogInfo.paperFolder(v) + case "showcase_document": + let v = try TeamLog.ShowcaseDocumentLogInfoSerializer().deserialize(json) + return AssetLogInfo.showcaseDocument(v) + case "other": + return AssetLogInfo.other + default: + return AssetLogInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: AssetLogInfo.self, json: json) + } + } + } + + /// Invited members to activate Backup. + public class BackupAdminInvitationSentDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try BackupAdminInvitationSentDetailsSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BackupStatusSerializer().serialize(self)))" - } - } - open class BackupStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BackupStatus) -> JSON { - switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> BackupStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return BackupStatus.disabled - case "enabled": - return BackupStatus.enabled - case "other": - return BackupStatus.other - default: - return BackupStatus.other - } - default: - fatalError("Failed to deserialize") + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BackupAdminInvitationSentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BackupAdminInvitationSentDetails: \(error)" } } } - /// Added Binder page. - open class BinderAddPageDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - /// Title of the Binder doc. - public let docTitle: String - /// Name of the Binder page/section. - public let binderItemName: String - public init(eventUuid: String, docTitle: String, binderItemName: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid - stringValidator()(docTitle) - self.docTitle = docTitle - stringValidator()(binderItemName) - self.binderItemName = binderItemName - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderAddPageDetailsSerializer().serialize(self)))" - } - } - open class BinderAddPageDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderAddPageDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), - ] + public class BackupAdminInvitationSentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BackupAdminInvitationSentDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderAddPageDetails { + + public func deserialize(_ json: JSON) throws -> BackupAdminInvitationSentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - return BinderAddPageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) - default: - fatalError("Type error deserializing") + case .dictionary: + return BackupAdminInvitationSentDetails() + default: + throw JSONSerializerError.deserializeError(type: BackupAdminInvitationSentDetails.self, json: json) } } } - /// The BinderAddPageType struct - open class BinderAddPageType: CustomStringConvertible { + /// The BackupAdminInvitationSentType struct + public class BackupAdminInvitationSentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderAddPageTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BackupAdminInvitationSentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BackupAdminInvitationSentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BackupAdminInvitationSentType: \(error)" + } } } - open class BinderAddPageTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderAddPageType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BackupAdminInvitationSentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BackupAdminInvitationSentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderAddPageType { + + public func deserialize(_ json: JSON) throws -> BackupAdminInvitationSentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderAddPageType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BackupAdminInvitationSentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BackupAdminInvitationSentType.self, json: json) } } } - /// Added Binder section. - open class BinderAddSectionDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - /// Title of the Binder doc. - public let docTitle: String - /// Name of the Binder page/section. - public let binderItemName: String - public init(eventUuid: String, docTitle: String, binderItemName: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid - stringValidator()(docTitle) - self.docTitle = docTitle - stringValidator()(binderItemName) - self.binderItemName = binderItemName + /// Opened Backup invite. + public class BackupInvitationOpenedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try BackupInvitationOpenedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderAddSectionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BackupInvitationOpenedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BackupInvitationOpenedDetails: \(error)" + } } } - open class BinderAddSectionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderAddSectionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), - ] + + public class BackupInvitationOpenedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BackupInvitationOpenedDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderAddSectionDetails { + + public func deserialize(_ json: JSON) throws -> BackupInvitationOpenedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - return BinderAddSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) - default: - fatalError("Type error deserializing") + case .dictionary: + return BackupInvitationOpenedDetails() + default: + throw JSONSerializerError.deserializeError(type: BackupInvitationOpenedDetails.self, json: json) } } } - /// The BinderAddSectionType struct - open class BinderAddSectionType: CustomStringConvertible { + /// The BackupInvitationOpenedType struct + public class BackupInvitationOpenedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderAddSectionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BackupInvitationOpenedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BackupInvitationOpenedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BackupInvitationOpenedType: \(error)" + } } } - open class BinderAddSectionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderAddSectionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BackupInvitationOpenedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BackupInvitationOpenedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderAddSectionType { + + public func deserialize(_ json: JSON) throws -> BackupInvitationOpenedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderAddSectionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BackupInvitationOpenedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BackupInvitationOpenedType.self, json: json) } } } - /// Removed Binder page. - open class BinderRemovePageDetails: CustomStringConvertible { - /// Event unique identifier. + /// Backup status + public enum BackupStatus: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case disabled + /// An unspecified error. + case enabled + /// An unspecified error. + case other + + func json() throws -> JSON { + try BackupStatusSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BackupStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BackupStatus: \(error)" + } + } + } + + public class BackupStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BackupStatus) throws -> JSON { + switch value { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> BackupStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return BackupStatus.disabled + case "enabled": + return BackupStatus.enabled + case "other": + return BackupStatus.other + default: + return BackupStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: BackupStatus.self, json: json) + } + } + } + + /// Added Binder page. + public class BinderAddPageDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. public let eventUuid: String /// Title of the Binder doc. public let docTitle: String @@ -2867,66 +3551,280 @@ open class TeamLog { stringValidator()(binderItemName) self.binderItemName = binderItemName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRemovePageDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderAddPageDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderAddPageDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderAddPageDetails: \(error)" + } + } + } + + public class BinderAddPageDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderAddPageDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> BinderAddPageDetails { + switch json { + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + return BinderAddPageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + default: + throw JSONSerializerError.deserializeError(type: BinderAddPageDetails.self, json: json) + } + } + } + + /// The BinderAddPageType struct + public class BinderAddPageType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try BinderAddPageTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderAddPageTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderAddPageType: \(error)" + } } } - open class BinderRemovePageDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRemovePageDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), + + public class BinderAddPageTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderAddPageType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRemovePageDetails { + + public func deserialize(_ json: JSON) throws -> BinderAddPageType { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - return BinderRemovePageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderAddPageType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderAddPageType.self, json: json) + } + } + } + + /// Added Binder section. + public class BinderAddSectionDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + /// Title of the Binder doc. + public let docTitle: String + /// Name of the Binder page/section. + public let binderItemName: String + public init(eventUuid: String, docTitle: String, binderItemName: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + stringValidator()(docTitle) + self.docTitle = docTitle + stringValidator()(binderItemName) + self.binderItemName = binderItemName + } + + func json() throws -> JSON { + try BinderAddSectionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderAddSectionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderAddSectionDetails: \(error)" + } + } + } + + public class BinderAddSectionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderAddSectionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> BinderAddSectionDetails { + switch json { + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + return BinderAddSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + default: + throw JSONSerializerError.deserializeError(type: BinderAddSectionDetails.self, json: json) + } + } + } + + /// The BinderAddSectionType struct + public class BinderAddSectionType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try BinderAddSectionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderAddSectionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderAddSectionType: \(error)" + } + } + } + + public class BinderAddSectionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderAddSectionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> BinderAddSectionType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderAddSectionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderAddSectionType.self, json: json) + } + } + } + + /// Removed Binder page. + public class BinderRemovePageDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + /// Title of the Binder doc. + public let docTitle: String + /// Name of the Binder page/section. + public let binderItemName: String + public init(eventUuid: String, docTitle: String, binderItemName: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + stringValidator()(docTitle) + self.docTitle = docTitle + stringValidator()(binderItemName) + self.binderItemName = binderItemName + } + + func json() throws -> JSON { + try BinderRemovePageDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRemovePageDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRemovePageDetails: \(error)" + } + } + } + + public class BinderRemovePageDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRemovePageDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> BinderRemovePageDetails { + switch json { + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + return BinderRemovePageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + default: + throw JSONSerializerError.deserializeError(type: BinderRemovePageDetails.self, json: json) } } } /// The BinderRemovePageType struct - open class BinderRemovePageType: CustomStringConvertible { + public class BinderRemovePageType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRemovePageTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderRemovePageTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRemovePageTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRemovePageType: \(error)" + } } } - open class BinderRemovePageTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRemovePageType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BinderRemovePageTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRemovePageType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRemovePageType { + + public func deserialize(_ json: JSON) throws -> BinderRemovePageType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderRemovePageType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderRemovePageType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderRemovePageType.self, json: json) } } } /// Removed Binder section. - open class BinderRemoveSectionDetails: CustomStringConvertible { + public class BinderRemoveSectionDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Title of the Binder doc. @@ -2941,66 +3839,88 @@ open class TeamLog { stringValidator()(binderItemName) self.binderItemName = binderItemName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRemoveSectionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderRemoveSectionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRemoveSectionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRemoveSectionDetails: \(error)" + } } } - open class BinderRemoveSectionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRemoveSectionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), + + public class BinderRemoveSectionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRemoveSectionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRemoveSectionDetails { + + public func deserialize(_ json: JSON) throws -> BinderRemoveSectionDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - return BinderRemoveSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + return BinderRemoveSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + default: + throw JSONSerializerError.deserializeError(type: BinderRemoveSectionDetails.self, json: json) } } } /// The BinderRemoveSectionType struct - open class BinderRemoveSectionType: CustomStringConvertible { + public class BinderRemoveSectionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRemoveSectionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderRemoveSectionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRemoveSectionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRemoveSectionType: \(error)" + } } } - open class BinderRemoveSectionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRemoveSectionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BinderRemoveSectionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRemoveSectionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRemoveSectionType { + + public func deserialize(_ json: JSON) throws -> BinderRemoveSectionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderRemoveSectionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderRemoveSectionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderRemoveSectionType.self, json: json) } } } /// Renamed Binder page. - open class BinderRenamePageDetails: CustomStringConvertible { + public class BinderRenamePageDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Title of the Binder doc. @@ -3019,68 +3939,95 @@ open class TeamLog { nullableValidator(stringValidator())(previousBinderItemName) self.previousBinderItemName = previousBinderItemName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRenamePageDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderRenamePageDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRenamePageDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRenamePageDetails: \(error)" + } } } - open class BinderRenamePageDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRenamePageDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), - "previous_binder_item_name": NullableSerializer(Serialization._StringSerializer).serialize(value.previousBinderItemName), + + public class BinderRenamePageDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRenamePageDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), + "previous_binder_item_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousBinderItemName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRenamePageDetails { + + public func deserialize(_ json: JSON) throws -> BinderRenamePageDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - let previousBinderItemName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_binder_item_name"] ?? .null) - return BinderRenamePageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName, previousBinderItemName: previousBinderItemName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + let previousBinderItemName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_binder_item_name"] ?? .null) + return BinderRenamePageDetails( + eventUuid: eventUuid, + docTitle: docTitle, + binderItemName: binderItemName, + previousBinderItemName: previousBinderItemName + ) + default: + throw JSONSerializerError.deserializeError(type: BinderRenamePageDetails.self, json: json) } } } /// The BinderRenamePageType struct - open class BinderRenamePageType: CustomStringConvertible { + public class BinderRenamePageType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRenamePageTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderRenamePageTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRenamePageTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRenamePageType: \(error)" + } } } - open class BinderRenamePageTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRenamePageType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BinderRenamePageTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRenamePageType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRenamePageType { + + public func deserialize(_ json: JSON) throws -> BinderRenamePageType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderRenamePageType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderRenamePageType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderRenamePageType.self, json: json) } } } /// Renamed Binder section. - open class BinderRenameSectionDetails: CustomStringConvertible { + public class BinderRenameSectionDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Title of the Binder doc. @@ -3099,68 +4046,95 @@ open class TeamLog { nullableValidator(stringValidator())(previousBinderItemName) self.previousBinderItemName = previousBinderItemName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRenameSectionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderRenameSectionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRenameSectionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRenameSectionDetails: \(error)" + } } } - open class BinderRenameSectionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRenameSectionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), - "previous_binder_item_name": NullableSerializer(Serialization._StringSerializer).serialize(value.previousBinderItemName), + + public class BinderRenameSectionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRenameSectionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), + "previous_binder_item_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousBinderItemName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRenameSectionDetails { + + public func deserialize(_ json: JSON) throws -> BinderRenameSectionDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - let previousBinderItemName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_binder_item_name"] ?? .null) - return BinderRenameSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName, previousBinderItemName: previousBinderItemName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + let previousBinderItemName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_binder_item_name"] ?? .null) + return BinderRenameSectionDetails( + eventUuid: eventUuid, + docTitle: docTitle, + binderItemName: binderItemName, + previousBinderItemName: previousBinderItemName + ) + default: + throw JSONSerializerError.deserializeError(type: BinderRenameSectionDetails.self, json: json) } } } /// The BinderRenameSectionType struct - open class BinderRenameSectionType: CustomStringConvertible { + public class BinderRenameSectionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderRenameSectionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderRenameSectionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderRenameSectionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderRenameSectionType: \(error)" + } } } - open class BinderRenameSectionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderRenameSectionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BinderRenameSectionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderRenameSectionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderRenameSectionType { + + public func deserialize(_ json: JSON) throws -> BinderRenameSectionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderRenameSectionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderRenameSectionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderRenameSectionType.self, json: json) } } } /// Reordered Binder page. - open class BinderReorderPageDetails: CustomStringConvertible { + public class BinderReorderPageDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Title of the Binder doc. @@ -3175,66 +4149,88 @@ open class TeamLog { stringValidator()(binderItemName) self.binderItemName = binderItemName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderReorderPageDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderReorderPageDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderReorderPageDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderReorderPageDetails: \(error)" + } } } - open class BinderReorderPageDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderReorderPageDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), + + public class BinderReorderPageDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderReorderPageDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderReorderPageDetails { + + public func deserialize(_ json: JSON) throws -> BinderReorderPageDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - return BinderReorderPageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + return BinderReorderPageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + default: + throw JSONSerializerError.deserializeError(type: BinderReorderPageDetails.self, json: json) } } } /// The BinderReorderPageType struct - open class BinderReorderPageType: CustomStringConvertible { + public class BinderReorderPageType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderReorderPageTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderReorderPageTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderReorderPageTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderReorderPageType: \(error)" + } } } - open class BinderReorderPageTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderReorderPageType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BinderReorderPageTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderReorderPageType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderReorderPageType { + + public func deserialize(_ json: JSON) throws -> BinderReorderPageType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderReorderPageType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderReorderPageType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderReorderPageType.self, json: json) } } } /// Reordered Binder section. - open class BinderReorderSectionDetails: CustomStringConvertible { + public class BinderReorderSectionDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Title of the Binder doc. @@ -3249,66 +4245,88 @@ open class TeamLog { stringValidator()(binderItemName) self.binderItemName = binderItemName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderReorderSectionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderReorderSectionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderReorderSectionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderReorderSectionDetails: \(error)" + } } } - open class BinderReorderSectionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderReorderSectionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), - "binder_item_name": Serialization._StringSerializer.serialize(value.binderItemName), + + public class BinderReorderSectionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderReorderSectionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), + "binder_item_name": try Serialization._StringSerializer.serialize(value.binderItemName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderReorderSectionDetails { + + public func deserialize(_ json: JSON) throws -> BinderReorderSectionDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - let binderItemName = Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) - return BinderReorderSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + let binderItemName = try Serialization._StringSerializer.deserialize(dict["binder_item_name"] ?? .null) + return BinderReorderSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + default: + throw JSONSerializerError.deserializeError(type: BinderReorderSectionDetails.self, json: json) } } } /// The BinderReorderSectionType struct - open class BinderReorderSectionType: CustomStringConvertible { + public class BinderReorderSectionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BinderReorderSectionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try BinderReorderSectionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BinderReorderSectionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BinderReorderSectionType: \(error)" + } } } - open class BinderReorderSectionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BinderReorderSectionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class BinderReorderSectionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BinderReorderSectionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BinderReorderSectionType { + + public func deserialize(_ json: JSON) throws -> BinderReorderSectionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return BinderReorderSectionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return BinderReorderSectionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: BinderReorderSectionType.self, json: json) } } } /// Policy for controlling if team members can activate camera uploads - public enum CameraUploadsPolicy: CustomStringConvertible { + public enum CameraUploadsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -3316,50 +4334,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try CameraUploadsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CameraUploadsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CameraUploadsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for CameraUploadsPolicy: \(error)" + } } } - open class CameraUploadsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CameraUploadsPolicy) -> JSON { + + public class CameraUploadsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CameraUploadsPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CameraUploadsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return CameraUploadsPolicy.disabled - case "enabled": - return CameraUploadsPolicy.enabled - case "other": - return CameraUploadsPolicy.other - default: - return CameraUploadsPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CameraUploadsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return CameraUploadsPolicy.disabled + case "enabled": + return CameraUploadsPolicy.enabled + case "other": + return CameraUploadsPolicy.other default: - fatalError("Failed to deserialize") + return CameraUploadsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: CameraUploadsPolicy.self, json: json) } } } /// Changed camera uploads setting for team. - open class CameraUploadsPolicyChangedDetails: CustomStringConvertible { + public class CameraUploadsPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New camera uploads setting. public let newValue: TeamLog.CameraUploadsPolicy /// Previous camera uploads setting. @@ -3368,64 +4396,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CameraUploadsPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try CameraUploadsPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CameraUploadsPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CameraUploadsPolicyChangedDetails: \(error)" + } } } - open class CameraUploadsPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CameraUploadsPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.CameraUploadsPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.CameraUploadsPolicySerializer().serialize(value.previousValue), + + public class CameraUploadsPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CameraUploadsPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.CameraUploadsPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.CameraUploadsPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CameraUploadsPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> CameraUploadsPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.CameraUploadsPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.CameraUploadsPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return CameraUploadsPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.CameraUploadsPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.CameraUploadsPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return CameraUploadsPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: CameraUploadsPolicyChangedDetails.self, json: json) } } } /// The CameraUploadsPolicyChangedType struct - open class CameraUploadsPolicyChangedType: CustomStringConvertible { + public class CameraUploadsPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CameraUploadsPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try CameraUploadsPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CameraUploadsPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CameraUploadsPolicyChangedType: \(error)" + } } } - open class CameraUploadsPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CameraUploadsPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class CameraUploadsPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CameraUploadsPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CameraUploadsPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> CameraUploadsPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return CameraUploadsPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return CameraUploadsPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: CameraUploadsPolicyChangedType.self, json: json) } } } /// Policy for deciding whether team users can transcription in Capture - public enum CaptureTranscriptPolicy: CustomStringConvertible { + public enum CaptureTranscriptPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case default_ /// An unspecified error. @@ -3435,56 +4485,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try CaptureTranscriptPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CaptureTranscriptPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CaptureTranscriptPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for CaptureTranscriptPolicy: \(error)" + } } } - open class CaptureTranscriptPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CaptureTranscriptPolicy) -> JSON { + + public class CaptureTranscriptPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CaptureTranscriptPolicy) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CaptureTranscriptPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return CaptureTranscriptPolicy.default_ - case "disabled": - return CaptureTranscriptPolicy.disabled - case "enabled": - return CaptureTranscriptPolicy.enabled - case "other": - return CaptureTranscriptPolicy.other - default: - return CaptureTranscriptPolicy.other - } - default: - fatalError("Failed to deserialize") + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CaptureTranscriptPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return CaptureTranscriptPolicy.default_ + case "disabled": + return CaptureTranscriptPolicy.disabled + case "enabled": + return CaptureTranscriptPolicy.enabled + case "other": + return CaptureTranscriptPolicy.other + default: + return CaptureTranscriptPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: CaptureTranscriptPolicy.self, json: json) } } } /// Changed Capture transcription policy for team. - open class CaptureTranscriptPolicyChangedDetails: CustomStringConvertible { + public class CaptureTranscriptPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// To. public let newValue: TeamLog.CaptureTranscriptPolicy /// From. @@ -3493,64 +4553,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CaptureTranscriptPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try CaptureTranscriptPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CaptureTranscriptPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CaptureTranscriptPolicyChangedDetails: \(error)" + } } } - open class CaptureTranscriptPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CaptureTranscriptPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.CaptureTranscriptPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.CaptureTranscriptPolicySerializer().serialize(value.previousValue), + + public class CaptureTranscriptPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CaptureTranscriptPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.CaptureTranscriptPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.CaptureTranscriptPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CaptureTranscriptPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> CaptureTranscriptPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.CaptureTranscriptPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.CaptureTranscriptPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return CaptureTranscriptPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.CaptureTranscriptPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.CaptureTranscriptPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return CaptureTranscriptPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: CaptureTranscriptPolicyChangedDetails.self, json: json) } } } /// The CaptureTranscriptPolicyChangedType struct - open class CaptureTranscriptPolicyChangedType: CustomStringConvertible { + public class CaptureTranscriptPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CaptureTranscriptPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try CaptureTranscriptPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CaptureTranscriptPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CaptureTranscriptPolicyChangedType: \(error)" + } } } - open class CaptureTranscriptPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CaptureTranscriptPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class CaptureTranscriptPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CaptureTranscriptPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CaptureTranscriptPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> CaptureTranscriptPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return CaptureTranscriptPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return CaptureTranscriptPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: CaptureTranscriptPolicyChangedType.self, json: json) } } } /// Certificate details. - open class Certificate: CustomStringConvertible { + public class Certificate: CustomStringConvertible, JSONRepresentable { /// Certificate subject. public let subject: String /// Certificate issuer. @@ -3565,7 +4647,15 @@ open class TeamLog { public let sha1Fingerprint: String /// Certificate common name. public let commonName: String? - public init(subject: String, issuer: String, issueDate: String, expirationDate: String, serialNumber: String, sha1Fingerprint: String, commonName: String? = nil) { + public init( + subject: String, + issuer: String, + issueDate: String, + expirationDate: String, + serialNumber: String, + sha1Fingerprint: String, + commonName: String? = nil + ) { stringValidator()(subject) self.subject = subject stringValidator()(issuer) @@ -3581,44 +4671,63 @@ open class TeamLog { nullableValidator(stringValidator())(commonName) self.commonName = commonName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CertificateSerializer().serialize(self)))" + + func json() throws -> JSON { + try CertificateSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CertificateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Certificate: \(error)" + } } } - open class CertificateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Certificate) -> JSON { - let output = [ - "subject": Serialization._StringSerializer.serialize(value.subject), - "issuer": Serialization._StringSerializer.serialize(value.issuer), - "issue_date": Serialization._StringSerializer.serialize(value.issueDate), - "expiration_date": Serialization._StringSerializer.serialize(value.expirationDate), - "serial_number": Serialization._StringSerializer.serialize(value.serialNumber), - "sha1_fingerprint": Serialization._StringSerializer.serialize(value.sha1Fingerprint), - "common_name": NullableSerializer(Serialization._StringSerializer).serialize(value.commonName), + + public class CertificateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Certificate) throws -> JSON { + let output = [ + "subject": try Serialization._StringSerializer.serialize(value.subject), + "issuer": try Serialization._StringSerializer.serialize(value.issuer), + "issue_date": try Serialization._StringSerializer.serialize(value.issueDate), + "expiration_date": try Serialization._StringSerializer.serialize(value.expirationDate), + "serial_number": try Serialization._StringSerializer.serialize(value.serialNumber), + "sha1_fingerprint": try Serialization._StringSerializer.serialize(value.sha1Fingerprint), + "common_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.commonName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> Certificate { + + public func deserialize(_ json: JSON) throws -> Certificate { switch json { - case .dictionary(let dict): - let subject = Serialization._StringSerializer.deserialize(dict["subject"] ?? .null) - let issuer = Serialization._StringSerializer.deserialize(dict["issuer"] ?? .null) - let issueDate = Serialization._StringSerializer.deserialize(dict["issue_date"] ?? .null) - let expirationDate = Serialization._StringSerializer.deserialize(dict["expiration_date"] ?? .null) - let serialNumber = Serialization._StringSerializer.deserialize(dict["serial_number"] ?? .null) - let sha1Fingerprint = Serialization._StringSerializer.deserialize(dict["sha1_fingerprint"] ?? .null) - let commonName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["common_name"] ?? .null) - return Certificate(subject: subject, issuer: issuer, issueDate: issueDate, expirationDate: expirationDate, serialNumber: serialNumber, sha1Fingerprint: sha1Fingerprint, commonName: commonName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let subject = try Serialization._StringSerializer.deserialize(dict["subject"] ?? .null) + let issuer = try Serialization._StringSerializer.deserialize(dict["issuer"] ?? .null) + let issueDate = try Serialization._StringSerializer.deserialize(dict["issue_date"] ?? .null) + let expirationDate = try Serialization._StringSerializer.deserialize(dict["expiration_date"] ?? .null) + let serialNumber = try Serialization._StringSerializer.deserialize(dict["serial_number"] ?? .null) + let sha1Fingerprint = try Serialization._StringSerializer.deserialize(dict["sha1_fingerprint"] ?? .null) + let commonName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["common_name"] ?? .null) + return Certificate( + subject: subject, + issuer: issuer, + issueDate: issueDate, + expirationDate: expirationDate, + serialNumber: serialNumber, + sha1Fingerprint: sha1Fingerprint, + commonName: commonName + ) + default: + throw JSONSerializerError.deserializeError(type: Certificate.self, json: json) } } } /// Policy for deciding whether the team's default expiration days policy must be enforced when an externally shared /// link is updated - public enum ChangeLinkExpirationPolicy: CustomStringConvertible { + public enum ChangeLinkExpirationPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case allowed /// An unspecified error. @@ -3626,50 +4735,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ChangeLinkExpirationPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ChangeLinkExpirationPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ChangeLinkExpirationPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ChangeLinkExpirationPolicy: \(error)" + } } } - open class ChangeLinkExpirationPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ChangeLinkExpirationPolicy) -> JSON { + + public class ChangeLinkExpirationPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ChangeLinkExpirationPolicy) throws -> JSON { switch value { - case .allowed: - var d = [String: JSON]() - d[".tag"] = .str("allowed") - return .dictionary(d) - case .notAllowed: - var d = [String: JSON]() - d[".tag"] = .str("not_allowed") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ChangeLinkExpirationPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "allowed": - return ChangeLinkExpirationPolicy.allowed - case "not_allowed": - return ChangeLinkExpirationPolicy.notAllowed - case "other": - return ChangeLinkExpirationPolicy.other - default: - return ChangeLinkExpirationPolicy.other - } + case .allowed: + var d = [String: JSON]() + d[".tag"] = .str("allowed") + return .dictionary(d) + case .notAllowed: + var d = [String: JSON]() + d[".tag"] = .str("not_allowed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ChangeLinkExpirationPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "allowed": + return ChangeLinkExpirationPolicy.allowed + case "not_allowed": + return ChangeLinkExpirationPolicy.notAllowed + case "other": + return ChangeLinkExpirationPolicy.other default: - fatalError("Failed to deserialize") + return ChangeLinkExpirationPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ChangeLinkExpirationPolicy.self, json: json) } } } /// Changed enterprise admin role. - open class ChangedEnterpriseAdminRoleDetails: CustomStringConvertible { + public class ChangedEnterpriseAdminRoleDetails: CustomStringConvertible, JSONRepresentable { /// The member’s previous enterprise admin role. public let previousValue: TeamLog.FedAdminRole /// The member’s new enterprise admin role. @@ -3682,66 +4801,88 @@ open class TeamLog { stringValidator()(teamName) self.teamName = teamName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ChangedEnterpriseAdminRoleDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ChangedEnterpriseAdminRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ChangedEnterpriseAdminRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ChangedEnterpriseAdminRoleDetails: \(error)" + } } } - open class ChangedEnterpriseAdminRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ChangedEnterpriseAdminRoleDetails) -> JSON { - let output = [ - "previous_value": TeamLog.FedAdminRoleSerializer().serialize(value.previousValue), - "new_value": TeamLog.FedAdminRoleSerializer().serialize(value.newValue), - "team_name": Serialization._StringSerializer.serialize(value.teamName), + + public class ChangedEnterpriseAdminRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ChangedEnterpriseAdminRoleDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.FedAdminRoleSerializer().serialize(value.previousValue), + "new_value": try TeamLog.FedAdminRoleSerializer().serialize(value.newValue), + "team_name": try Serialization._StringSerializer.serialize(value.teamName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ChangedEnterpriseAdminRoleDetails { + + public func deserialize(_ json: JSON) throws -> ChangedEnterpriseAdminRoleDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.FedAdminRoleSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.FedAdminRoleSerializer().deserialize(dict["new_value"] ?? .null) - let teamName = Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) - return ChangedEnterpriseAdminRoleDetails(previousValue: previousValue, newValue: newValue, teamName: teamName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.FedAdminRoleSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.FedAdminRoleSerializer().deserialize(dict["new_value"] ?? .null) + let teamName = try Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) + return ChangedEnterpriseAdminRoleDetails(previousValue: previousValue, newValue: newValue, teamName: teamName) + default: + throw JSONSerializerError.deserializeError(type: ChangedEnterpriseAdminRoleDetails.self, json: json) } } } /// The ChangedEnterpriseAdminRoleType struct - open class ChangedEnterpriseAdminRoleType: CustomStringConvertible { + public class ChangedEnterpriseAdminRoleType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ChangedEnterpriseAdminRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ChangedEnterpriseAdminRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ChangedEnterpriseAdminRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ChangedEnterpriseAdminRoleType: \(error)" + } } } - open class ChangedEnterpriseAdminRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ChangedEnterpriseAdminRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ChangedEnterpriseAdminRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ChangedEnterpriseAdminRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ChangedEnterpriseAdminRoleType { + + public func deserialize(_ json: JSON) throws -> ChangedEnterpriseAdminRoleType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ChangedEnterpriseAdminRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ChangedEnterpriseAdminRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ChangedEnterpriseAdminRoleType.self, json: json) } } } /// Changed enterprise-connected team status. - open class ChangedEnterpriseConnectedTeamStatusDetails: CustomStringConvertible { + public class ChangedEnterpriseConnectedTeamStatusDetails: CustomStringConvertible, JSONRepresentable { /// The preformed change in the team’s connection status. public let action: TeamLog.FedHandshakeAction /// Additional information about the organization or team. @@ -3750,261 +4891,360 @@ open class TeamLog { public let previousValue: TeamLog.TrustedTeamsRequestState /// New request state. public let newValue: TeamLog.TrustedTeamsRequestState - public init(action: TeamLog.FedHandshakeAction, additionalInfo: TeamLog.FederationStatusChangeAdditionalInfo, previousValue: TeamLog.TrustedTeamsRequestState, newValue: TeamLog.TrustedTeamsRequestState) { + public init( + action: TeamLog.FedHandshakeAction, + additionalInfo: TeamLog.FederationStatusChangeAdditionalInfo, + previousValue: TeamLog.TrustedTeamsRequestState, + newValue: TeamLog.TrustedTeamsRequestState + ) { self.action = action self.additionalInfo = additionalInfo self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ChangedEnterpriseConnectedTeamStatusDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ChangedEnterpriseConnectedTeamStatusDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ChangedEnterpriseConnectedTeamStatusDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ChangedEnterpriseConnectedTeamStatusDetails: \(error)" + } } } - open class ChangedEnterpriseConnectedTeamStatusDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ChangedEnterpriseConnectedTeamStatusDetails) -> JSON { - let output = [ - "action": TeamLog.FedHandshakeActionSerializer().serialize(value.action), - "additional_info": TeamLog.FederationStatusChangeAdditionalInfoSerializer().serialize(value.additionalInfo), - "previous_value": TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.previousValue), - "new_value": TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.newValue), + + public class ChangedEnterpriseConnectedTeamStatusDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ChangedEnterpriseConnectedTeamStatusDetails) throws -> JSON { + let output = [ + "action": try TeamLog.FedHandshakeActionSerializer().serialize(value.action), + "additional_info": try TeamLog.FederationStatusChangeAdditionalInfoSerializer().serialize(value.additionalInfo), + "previous_value": try TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.previousValue), + "new_value": try TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ChangedEnterpriseConnectedTeamStatusDetails { + + public func deserialize(_ json: JSON) throws -> ChangedEnterpriseConnectedTeamStatusDetails { switch json { - case .dictionary(let dict): - let action = TeamLog.FedHandshakeActionSerializer().deserialize(dict["action"] ?? .null) - let additionalInfo = TeamLog.FederationStatusChangeAdditionalInfoSerializer().deserialize(dict["additional_info"] ?? .null) - let previousValue = TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["new_value"] ?? .null) - return ChangedEnterpriseConnectedTeamStatusDetails(action: action, additionalInfo: additionalInfo, previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let action = try TeamLog.FedHandshakeActionSerializer().deserialize(dict["action"] ?? .null) + let additionalInfo = try TeamLog.FederationStatusChangeAdditionalInfoSerializer().deserialize(dict["additional_info"] ?? .null) + let previousValue = try TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["new_value"] ?? .null) + return ChangedEnterpriseConnectedTeamStatusDetails( + action: action, + additionalInfo: additionalInfo, + previousValue: previousValue, + newValue: newValue + ) + default: + throw JSONSerializerError.deserializeError(type: ChangedEnterpriseConnectedTeamStatusDetails.self, json: json) } } } /// The ChangedEnterpriseConnectedTeamStatusType struct - open class ChangedEnterpriseConnectedTeamStatusType: CustomStringConvertible { + public class ChangedEnterpriseConnectedTeamStatusType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ChangedEnterpriseConnectedTeamStatusTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ChangedEnterpriseConnectedTeamStatusTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ChangedEnterpriseConnectedTeamStatusTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ChangedEnterpriseConnectedTeamStatusType: \(error)" + } } } - open class ChangedEnterpriseConnectedTeamStatusTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ChangedEnterpriseConnectedTeamStatusType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ChangedEnterpriseConnectedTeamStatusTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ChangedEnterpriseConnectedTeamStatusType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ChangedEnterpriseConnectedTeamStatusType { + + public func deserialize(_ json: JSON) throws -> ChangedEnterpriseConnectedTeamStatusType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ChangedEnterpriseConnectedTeamStatusType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ChangedEnterpriseConnectedTeamStatusType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ChangedEnterpriseConnectedTeamStatusType.self, json: json) } } } /// Changed classification policy for team. - open class ClassificationChangePolicyDetails: CustomStringConvertible { + public class ClassificationChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// Previous classification policy. public let previousValue: TeamLog.ClassificationPolicyEnumWrapper /// New classification policy. public let newValue: TeamLog.ClassificationPolicyEnumWrapper /// Policy type. public let classificationType: TeamLog.ClassificationType - public init(previousValue: TeamLog.ClassificationPolicyEnumWrapper, newValue: TeamLog.ClassificationPolicyEnumWrapper, classificationType: TeamLog.ClassificationType) { + public init( + previousValue: TeamLog.ClassificationPolicyEnumWrapper, + newValue: TeamLog.ClassificationPolicyEnumWrapper, + classificationType: TeamLog.ClassificationType + ) { self.previousValue = previousValue self.newValue = newValue self.classificationType = classificationType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ClassificationChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationChangePolicyDetails: \(error)" + } } } - open class ClassificationChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationChangePolicyDetails) -> JSON { - let output = [ - "previous_value": TeamLog.ClassificationPolicyEnumWrapperSerializer().serialize(value.previousValue), - "new_value": TeamLog.ClassificationPolicyEnumWrapperSerializer().serialize(value.newValue), - "classification_type": TeamLog.ClassificationTypeSerializer().serialize(value.classificationType), + + public class ClassificationChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationChangePolicyDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.ClassificationPolicyEnumWrapperSerializer().serialize(value.previousValue), + "new_value": try TeamLog.ClassificationPolicyEnumWrapperSerializer().serialize(value.newValue), + "classification_type": try TeamLog.ClassificationTypeSerializer().serialize(value.classificationType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ClassificationChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> ClassificationChangePolicyDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.ClassificationPolicyEnumWrapperSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.ClassificationPolicyEnumWrapperSerializer().deserialize(dict["new_value"] ?? .null) - let classificationType = TeamLog.ClassificationTypeSerializer().deserialize(dict["classification_type"] ?? .null) - return ClassificationChangePolicyDetails(previousValue: previousValue, newValue: newValue, classificationType: classificationType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.ClassificationPolicyEnumWrapperSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.ClassificationPolicyEnumWrapperSerializer().deserialize(dict["new_value"] ?? .null) + let classificationType = try TeamLog.ClassificationTypeSerializer().deserialize(dict["classification_type"] ?? .null) + return ClassificationChangePolicyDetails(previousValue: previousValue, newValue: newValue, classificationType: classificationType) + default: + throw JSONSerializerError.deserializeError(type: ClassificationChangePolicyDetails.self, json: json) } } } /// The ClassificationChangePolicyType struct - open class ClassificationChangePolicyType: CustomStringConvertible { + public class ClassificationChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ClassificationChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationChangePolicyType: \(error)" + } } } - open class ClassificationChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ClassificationChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ClassificationChangePolicyType { + + public func deserialize(_ json: JSON) throws -> ClassificationChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ClassificationChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ClassificationChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ClassificationChangePolicyType.self, json: json) } } } /// Created Classification report. - open class ClassificationCreateReportDetails: CustomStringConvertible { - public init() { + public class ClassificationCreateReportDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ClassificationCreateReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationCreateReportDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationCreateReportDetails: \(error)" + } } } - open class ClassificationCreateReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationCreateReportDetails) -> JSON { + + public class ClassificationCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationCreateReportDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> ClassificationCreateReportDetails { + + public func deserialize(_ json: JSON) throws -> ClassificationCreateReportDetails { switch json { - case .dictionary(_): - return ClassificationCreateReportDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return ClassificationCreateReportDetails() + default: + throw JSONSerializerError.deserializeError(type: ClassificationCreateReportDetails.self, json: json) } } } /// Couldn't create Classification report. - open class ClassificationCreateReportFailDetails: CustomStringConvertible { + public class ClassificationCreateReportFailDetails: CustomStringConvertible, JSONRepresentable { /// Failure reason. public let failureReason: Team.TeamReportFailureReason public init(failureReason: Team.TeamReportFailureReason) { self.failureReason = failureReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationCreateReportFailDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ClassificationCreateReportFailDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationCreateReportFailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationCreateReportFailDetails: \(error)" + } } } - open class ClassificationCreateReportFailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationCreateReportFailDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), + + public class ClassificationCreateReportFailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationCreateReportFailDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ClassificationCreateReportFailDetails { + + public func deserialize(_ json: JSON) throws -> ClassificationCreateReportFailDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return ClassificationCreateReportFailDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return ClassificationCreateReportFailDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: ClassificationCreateReportFailDetails.self, json: json) } } } /// The ClassificationCreateReportFailType struct - open class ClassificationCreateReportFailType: CustomStringConvertible { + public class ClassificationCreateReportFailType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationCreateReportFailTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ClassificationCreateReportFailTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationCreateReportFailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationCreateReportFailType: \(error)" + } } } - open class ClassificationCreateReportFailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationCreateReportFailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ClassificationCreateReportFailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationCreateReportFailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ClassificationCreateReportFailType { + + public func deserialize(_ json: JSON) throws -> ClassificationCreateReportFailType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ClassificationCreateReportFailType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ClassificationCreateReportFailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ClassificationCreateReportFailType.self, json: json) } } } /// The ClassificationCreateReportType struct - open class ClassificationCreateReportType: CustomStringConvertible { + public class ClassificationCreateReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationCreateReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ClassificationCreateReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationCreateReportType: \(error)" + } } } - open class ClassificationCreateReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationCreateReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ClassificationCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ClassificationCreateReportType { + + public func deserialize(_ json: JSON) throws -> ClassificationCreateReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ClassificationCreateReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ClassificationCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ClassificationCreateReportType.self, json: json) } } } /// Policy for controlling team access to the classification feature - public enum ClassificationPolicyEnumWrapper: CustomStringConvertible { + public enum ClassificationPolicyEnumWrapper: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -4016,62 +5256,72 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ClassificationPolicyEnumWrapperSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationPolicyEnumWrapperSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationPolicyEnumWrapperSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationPolicyEnumWrapper: \(error)" + } } } - open class ClassificationPolicyEnumWrapperSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationPolicyEnumWrapper) -> JSON { + + public class ClassificationPolicyEnumWrapperSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationPolicyEnumWrapper) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .memberAndTeamFolders: - var d = [String: JSON]() - d[".tag"] = .str("member_and_team_folders") - return .dictionary(d) - case .teamFolders: - var d = [String: JSON]() - d[".tag"] = .str("team_folders") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ClassificationPolicyEnumWrapper { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ClassificationPolicyEnumWrapper.disabled - case "enabled": - return ClassificationPolicyEnumWrapper.enabled - case "member_and_team_folders": - return ClassificationPolicyEnumWrapper.memberAndTeamFolders - case "team_folders": - return ClassificationPolicyEnumWrapper.teamFolders - case "other": - return ClassificationPolicyEnumWrapper.other - default: - return ClassificationPolicyEnumWrapper.other - } - default: - fatalError("Failed to deserialize") + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .memberAndTeamFolders: + var d = [String: JSON]() + d[".tag"] = .str("member_and_team_folders") + return .dictionary(d) + case .teamFolders: + var d = [String: JSON]() + d[".tag"] = .str("team_folders") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ClassificationPolicyEnumWrapper { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ClassificationPolicyEnumWrapper.disabled + case "enabled": + return ClassificationPolicyEnumWrapper.enabled + case "member_and_team_folders": + return ClassificationPolicyEnumWrapper.memberAndTeamFolders + case "team_folders": + return ClassificationPolicyEnumWrapper.teamFolders + case "other": + return ClassificationPolicyEnumWrapper.other + default: + return ClassificationPolicyEnumWrapper.other + } + default: + throw JSONSerializerError.deserializeError(type: ClassificationPolicyEnumWrapper.self, json: json) } } } /// The type of classification (currently only personal information) - public enum ClassificationType: CustomStringConvertible { + public enum ClassificationType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case personalInformation /// An unspecified error. @@ -4079,112 +5329,144 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ClassificationTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ClassificationTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ClassificationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ClassificationType: \(error)" + } } } - open class ClassificationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ClassificationType) -> JSON { + + public class ClassificationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ClassificationType) throws -> JSON { switch value { - case .personalInformation: - var d = [String: JSON]() - d[".tag"] = .str("personal_information") - return .dictionary(d) - case .pii: - var d = [String: JSON]() - d[".tag"] = .str("pii") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ClassificationType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "personal_information": - return ClassificationType.personalInformation - case "pii": - return ClassificationType.pii - case "other": - return ClassificationType.other - default: - return ClassificationType.other - } + case .personalInformation: + var d = [String: JSON]() + d[".tag"] = .str("personal_information") + return .dictionary(d) + case .pii: + var d = [String: JSON]() + d[".tag"] = .str("pii") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ClassificationType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "personal_information": + return ClassificationType.personalInformation + case "pii": + return ClassificationType.pii + case "other": + return ClassificationType.other default: - fatalError("Failed to deserialize") + return ClassificationType.other + } + default: + throw JSONSerializerError.deserializeError(type: ClassificationType.self, json: json) } } } /// Shared album. - open class CollectionShareDetails: CustomStringConvertible { + public class CollectionShareDetails: CustomStringConvertible, JSONRepresentable { /// Album name. public let albumName: String public init(albumName: String) { stringValidator()(albumName) self.albumName = albumName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CollectionShareDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try CollectionShareDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CollectionShareDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CollectionShareDetails: \(error)" + } } } - open class CollectionShareDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CollectionShareDetails) -> JSON { - let output = [ - "album_name": Serialization._StringSerializer.serialize(value.albumName), + + public class CollectionShareDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CollectionShareDetails) throws -> JSON { + let output = [ + "album_name": try Serialization._StringSerializer.serialize(value.albumName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CollectionShareDetails { + + public func deserialize(_ json: JSON) throws -> CollectionShareDetails { switch json { - case .dictionary(let dict): - let albumName = Serialization._StringSerializer.deserialize(dict["album_name"] ?? .null) - return CollectionShareDetails(albumName: albumName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let albumName = try Serialization._StringSerializer.deserialize(dict["album_name"] ?? .null) + return CollectionShareDetails(albumName: albumName) + default: + throw JSONSerializerError.deserializeError(type: CollectionShareDetails.self, json: json) } } } /// The CollectionShareType struct - open class CollectionShareType: CustomStringConvertible { + public class CollectionShareType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CollectionShareTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try CollectionShareTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CollectionShareTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CollectionShareType: \(error)" + } } } - open class CollectionShareTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CollectionShareType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class CollectionShareTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CollectionShareType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CollectionShareType { + + public func deserialize(_ json: JSON) throws -> CollectionShareType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return CollectionShareType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return CollectionShareType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: CollectionShareType.self, json: json) } } } /// Policy for controlling team access to computer backup feature - public enum ComputerBackupPolicy: CustomStringConvertible { + public enum ComputerBackupPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case default_ /// An unspecified error. @@ -4194,56 +5476,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ComputerBackupPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ComputerBackupPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ComputerBackupPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ComputerBackupPolicy: \(error)" + } } } - open class ComputerBackupPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ComputerBackupPolicy) -> JSON { + + public class ComputerBackupPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ComputerBackupPolicy) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ComputerBackupPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return ComputerBackupPolicy.default_ - case "disabled": - return ComputerBackupPolicy.disabled - case "enabled": - return ComputerBackupPolicy.enabled - case "other": - return ComputerBackupPolicy.other - default: - return ComputerBackupPolicy.other - } - default: - fatalError("Failed to deserialize") + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ComputerBackupPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return ComputerBackupPolicy.default_ + case "disabled": + return ComputerBackupPolicy.disabled + case "enabled": + return ComputerBackupPolicy.enabled + case "other": + return ComputerBackupPolicy.other + default: + return ComputerBackupPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ComputerBackupPolicy.self, json: json) } } } /// Changed computer backup policy for team. - open class ComputerBackupPolicyChangedDetails: CustomStringConvertible { + public class ComputerBackupPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New computer backup policy. public let newValue: TeamLog.ComputerBackupPolicy /// Previous computer backup policy. @@ -4252,95 +5544,128 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ComputerBackupPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ComputerBackupPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ComputerBackupPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ComputerBackupPolicyChangedDetails: \(error)" + } } } - open class ComputerBackupPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ComputerBackupPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.ComputerBackupPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.ComputerBackupPolicySerializer().serialize(value.previousValue), + + public class ComputerBackupPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ComputerBackupPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ComputerBackupPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.ComputerBackupPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ComputerBackupPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> ComputerBackupPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ComputerBackupPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.ComputerBackupPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return ComputerBackupPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ComputerBackupPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.ComputerBackupPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return ComputerBackupPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ComputerBackupPolicyChangedDetails.self, json: json) } } } /// The ComputerBackupPolicyChangedType struct - open class ComputerBackupPolicyChangedType: CustomStringConvertible { + public class ComputerBackupPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ComputerBackupPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ComputerBackupPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ComputerBackupPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ComputerBackupPolicyChangedType: \(error)" + } } } - open class ComputerBackupPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ComputerBackupPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ComputerBackupPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ComputerBackupPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ComputerBackupPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> ComputerBackupPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ComputerBackupPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ComputerBackupPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ComputerBackupPolicyChangedType.self, json: json) } } } /// The name of the team - open class ConnectedTeamName: CustomStringConvertible { + public class ConnectedTeamName: CustomStringConvertible, JSONRepresentable { /// The name of the team. public let team: String public init(team: String) { stringValidator()(team) self.team = team } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ConnectedTeamNameSerializer().serialize(self)))" + + func json() throws -> JSON { + try ConnectedTeamNameSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ConnectedTeamNameSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ConnectedTeamName: \(error)" + } } } - open class ConnectedTeamNameSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ConnectedTeamName) -> JSON { - let output = [ - "team": Serialization._StringSerializer.serialize(value.team), + + public class ConnectedTeamNameSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ConnectedTeamName) throws -> JSON { + let output = [ + "team": try Serialization._StringSerializer.serialize(value.team), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ConnectedTeamName { + + public func deserialize(_ json: JSON) throws -> ConnectedTeamName { switch json { - case .dictionary(let dict): - let team = Serialization._StringSerializer.deserialize(dict["team"] ?? .null) - return ConnectedTeamName(team: team) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let team = try Serialization._StringSerializer.deserialize(dict["team"] ?? .null) + return ConnectedTeamName(team: team) + default: + throw JSONSerializerError.deserializeError(type: ConnectedTeamName.self, json: json) } } } /// Changed content management setting. - open class ContentAdministrationPolicyChangedDetails: CustomStringConvertible { + public class ContentAdministrationPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New content administration policy. public let newValue: String /// Previous content administration policy. @@ -4351,64 +5676,86 @@ open class TeamLog { stringValidator()(previousValue) self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ContentAdministrationPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ContentAdministrationPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ContentAdministrationPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ContentAdministrationPolicyChangedDetails: \(error)" + } } } - open class ContentAdministrationPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ContentAdministrationPolicyChangedDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), + + public class ContentAdministrationPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ContentAdministrationPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ContentAdministrationPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> ContentAdministrationPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return ContentAdministrationPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return ContentAdministrationPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ContentAdministrationPolicyChangedDetails.self, json: json) } } } /// The ContentAdministrationPolicyChangedType struct - open class ContentAdministrationPolicyChangedType: CustomStringConvertible { + public class ContentAdministrationPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ContentAdministrationPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ContentAdministrationPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ContentAdministrationPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ContentAdministrationPolicyChangedType: \(error)" + } } } - open class ContentAdministrationPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ContentAdministrationPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ContentAdministrationPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ContentAdministrationPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ContentAdministrationPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> ContentAdministrationPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ContentAdministrationPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ContentAdministrationPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ContentAdministrationPolicyChangedType.self, json: json) } } } /// Policy for pemanent content deletion - public enum ContentPermanentDeletePolicy: CustomStringConvertible { + public enum ContentPermanentDeletePolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -4416,50 +5763,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ContentPermanentDeletePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ContentPermanentDeletePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ContentPermanentDeletePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ContentPermanentDeletePolicy: \(error)" + } } } - open class ContentPermanentDeletePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ContentPermanentDeletePolicy) -> JSON { + + public class ContentPermanentDeletePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ContentPermanentDeletePolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ContentPermanentDeletePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ContentPermanentDeletePolicy.disabled - case "enabled": - return ContentPermanentDeletePolicy.enabled - case "other": - return ContentPermanentDeletePolicy.other - default: - return ContentPermanentDeletePolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ContentPermanentDeletePolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ContentPermanentDeletePolicy.disabled + case "enabled": + return ContentPermanentDeletePolicy.enabled + case "other": + return ContentPermanentDeletePolicy.other default: - fatalError("Failed to deserialize") + return ContentPermanentDeletePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ContentPermanentDeletePolicy.self, json: json) } } } /// The primary entity on which the action was done. - public enum ContextLogInfo: CustomStringConvertible { + public enum ContextLogInfo: CustomStringConvertible, JSONRepresentable { /// Anonymous context. case anonymous /// Action was done on behalf of a non team member. @@ -4475,133 +5832,162 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ContextLogInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ContextLogInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ContextLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ContextLogInfo: \(error)" + } } } - open class ContextLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ContextLogInfo) -> JSON { + + public class ContextLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ContextLogInfo) throws -> JSON { switch value { - case .anonymous: - var d = [String: JSON]() - d[".tag"] = .str("anonymous") - return .dictionary(d) - case .nonTeamMember(let arg): - var d = Serialization.getFields(TeamLog.NonTeamMemberLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("non_team_member") - return .dictionary(d) - case .organizationTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("organization_team") - return .dictionary(d) - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .teamMember(let arg): - var d = Serialization.getFields(TeamLog.TeamMemberLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("team_member") - return .dictionary(d) - case .trustedNonTeamMember(let arg): - var d = Serialization.getFields(TeamLog.TrustedNonTeamMemberLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("trusted_non_team_member") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ContextLogInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "anonymous": - return ContextLogInfo.anonymous - case "non_team_member": - let v = TeamLog.NonTeamMemberLogInfoSerializer().deserialize(json) - return ContextLogInfo.nonTeamMember(v) - case "organization_team": - let v = TeamLog.TeamLogInfoSerializer().deserialize(json) - return ContextLogInfo.organizationTeam(v) - case "team": - return ContextLogInfo.team - case "team_member": - let v = TeamLog.TeamMemberLogInfoSerializer().deserialize(json) - return ContextLogInfo.teamMember(v) - case "trusted_non_team_member": - let v = TeamLog.TrustedNonTeamMemberLogInfoSerializer().deserialize(json) - return ContextLogInfo.trustedNonTeamMember(v) - case "other": - return ContextLogInfo.other - default: - return ContextLogInfo.other - } - default: - fatalError("Failed to deserialize") + case .anonymous: + var d = [String: JSON]() + d[".tag"] = .str("anonymous") + return .dictionary(d) + case .nonTeamMember(let arg): + var d = try Serialization.getFields(TeamLog.NonTeamMemberLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("non_team_member") + return .dictionary(d) + case .organizationTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("organization_team") + return .dictionary(d) + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .teamMember(let arg): + var d = try Serialization.getFields(TeamLog.TeamMemberLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("team_member") + return .dictionary(d) + case .trustedNonTeamMember(let arg): + var d = try Serialization.getFields(TeamLog.TrustedNonTeamMemberLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("trusted_non_team_member") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ContextLogInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "anonymous": + return ContextLogInfo.anonymous + case "non_team_member": + let v = try TeamLog.NonTeamMemberLogInfoSerializer().deserialize(json) + return ContextLogInfo.nonTeamMember(v) + case "organization_team": + let v = try TeamLog.TeamLogInfoSerializer().deserialize(json) + return ContextLogInfo.organizationTeam(v) + case "team": + return ContextLogInfo.team + case "team_member": + let v = try TeamLog.TeamMemberLogInfoSerializer().deserialize(json) + return ContextLogInfo.teamMember(v) + case "trusted_non_team_member": + let v = try TeamLog.TrustedNonTeamMemberLogInfoSerializer().deserialize(json) + return ContextLogInfo.trustedNonTeamMember(v) + case "other": + return ContextLogInfo.other + default: + return ContextLogInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: ContextLogInfo.self, json: json) } } } /// Created folders. - open class CreateFolderDetails: CustomStringConvertible { - public init() { + public class CreateFolderDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try CreateFolderDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderDetails: \(error)" + } } } - open class CreateFolderDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderDetails) -> JSON { + + public class CreateFolderDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFolderDetails { + + public func deserialize(_ json: JSON) throws -> CreateFolderDetails { switch json { - case .dictionary(_): - return CreateFolderDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return CreateFolderDetails() + default: + throw JSONSerializerError.deserializeError(type: CreateFolderDetails.self, json: json) } } } /// The CreateFolderType struct - open class CreateFolderType: CustomStringConvertible { + public class CreateFolderType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateFolderTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateFolderTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateFolderTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateFolderType: \(error)" + } } } - open class CreateFolderTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateFolderType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class CreateFolderTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateFolderType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateFolderType { + + public func deserialize(_ json: JSON) throws -> CreateFolderType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return CreateFolderType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return CreateFolderType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: CreateFolderType.self, json: json) } } } /// Created team invite link. - open class CreateTeamInviteLinkDetails: CustomStringConvertible { + public class CreateTeamInviteLinkDetails: CustomStringConvertible, JSONRepresentable { /// The invite link url that was created. public let linkUrl: String /// The expiration date of the invite link. @@ -4612,64 +5998,86 @@ open class TeamLog { stringValidator()(expiryDate) self.expiryDate = expiryDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateTeamInviteLinkDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateTeamInviteLinkDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateTeamInviteLinkDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateTeamInviteLinkDetails: \(error)" + } } } - open class CreateTeamInviteLinkDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateTeamInviteLinkDetails) -> JSON { - let output = [ - "link_url": Serialization._StringSerializer.serialize(value.linkUrl), - "expiry_date": Serialization._StringSerializer.serialize(value.expiryDate), + + public class CreateTeamInviteLinkDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateTeamInviteLinkDetails) throws -> JSON { + let output = [ + "link_url": try Serialization._StringSerializer.serialize(value.linkUrl), + "expiry_date": try Serialization._StringSerializer.serialize(value.expiryDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateTeamInviteLinkDetails { + + public func deserialize(_ json: JSON) throws -> CreateTeamInviteLinkDetails { switch json { - case .dictionary(let dict): - let linkUrl = Serialization._StringSerializer.deserialize(dict["link_url"] ?? .null) - let expiryDate = Serialization._StringSerializer.deserialize(dict["expiry_date"] ?? .null) - return CreateTeamInviteLinkDetails(linkUrl: linkUrl, expiryDate: expiryDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let linkUrl = try Serialization._StringSerializer.deserialize(dict["link_url"] ?? .null) + let expiryDate = try Serialization._StringSerializer.deserialize(dict["expiry_date"] ?? .null) + return CreateTeamInviteLinkDetails(linkUrl: linkUrl, expiryDate: expiryDate) + default: + throw JSONSerializerError.deserializeError(type: CreateTeamInviteLinkDetails.self, json: json) } } } /// The CreateTeamInviteLinkType struct - open class CreateTeamInviteLinkType: CustomStringConvertible { + public class CreateTeamInviteLinkType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CreateTeamInviteLinkTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try CreateTeamInviteLinkTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CreateTeamInviteLinkTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CreateTeamInviteLinkType: \(error)" + } } } - open class CreateTeamInviteLinkTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CreateTeamInviteLinkType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class CreateTeamInviteLinkTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CreateTeamInviteLinkType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> CreateTeamInviteLinkType { + + public func deserialize(_ json: JSON) throws -> CreateTeamInviteLinkType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return CreateTeamInviteLinkType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return CreateTeamInviteLinkType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: CreateTeamInviteLinkType.self, json: json) } } } /// Set restrictions on data center locations where team data resides. - open class DataPlacementRestrictionChangePolicyDetails: CustomStringConvertible { + public class DataPlacementRestrictionChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// Previous placement restriction. public let previousValue: TeamLog.PlacementRestriction /// New placement restriction. @@ -4678,235 +6086,317 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataPlacementRestrictionChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DataPlacementRestrictionChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataPlacementRestrictionChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataPlacementRestrictionChangePolicyDetails: \(error)" + } } } - open class DataPlacementRestrictionChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataPlacementRestrictionChangePolicyDetails) -> JSON { - let output = [ - "previous_value": TeamLog.PlacementRestrictionSerializer().serialize(value.previousValue), - "new_value": TeamLog.PlacementRestrictionSerializer().serialize(value.newValue), + + public class DataPlacementRestrictionChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataPlacementRestrictionChangePolicyDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.PlacementRestrictionSerializer().serialize(value.previousValue), + "new_value": try TeamLog.PlacementRestrictionSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataPlacementRestrictionChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> DataPlacementRestrictionChangePolicyDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.PlacementRestrictionSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.PlacementRestrictionSerializer().deserialize(dict["new_value"] ?? .null) - return DataPlacementRestrictionChangePolicyDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.PlacementRestrictionSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.PlacementRestrictionSerializer().deserialize(dict["new_value"] ?? .null) + return DataPlacementRestrictionChangePolicyDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: DataPlacementRestrictionChangePolicyDetails.self, json: json) } } } /// The DataPlacementRestrictionChangePolicyType struct - open class DataPlacementRestrictionChangePolicyType: CustomStringConvertible { + public class DataPlacementRestrictionChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataPlacementRestrictionChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DataPlacementRestrictionChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataPlacementRestrictionChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataPlacementRestrictionChangePolicyType: \(error)" + } } } - open class DataPlacementRestrictionChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataPlacementRestrictionChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DataPlacementRestrictionChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataPlacementRestrictionChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataPlacementRestrictionChangePolicyType { + + public func deserialize(_ json: JSON) throws -> DataPlacementRestrictionChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DataPlacementRestrictionChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DataPlacementRestrictionChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DataPlacementRestrictionChangePolicyType.self, json: json) } } } /// Completed restrictions on data center locations where team data resides. - open class DataPlacementRestrictionSatisfyPolicyDetails: CustomStringConvertible { + public class DataPlacementRestrictionSatisfyPolicyDetails: CustomStringConvertible, JSONRepresentable { /// Placement restriction. public let placementRestriction: TeamLog.PlacementRestriction public init(placementRestriction: TeamLog.PlacementRestriction) { self.placementRestriction = placementRestriction } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataPlacementRestrictionSatisfyPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DataPlacementRestrictionSatisfyPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataPlacementRestrictionSatisfyPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataPlacementRestrictionSatisfyPolicyDetails: \(error)" + } } } - open class DataPlacementRestrictionSatisfyPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataPlacementRestrictionSatisfyPolicyDetails) -> JSON { - let output = [ - "placement_restriction": TeamLog.PlacementRestrictionSerializer().serialize(value.placementRestriction), + + public class DataPlacementRestrictionSatisfyPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataPlacementRestrictionSatisfyPolicyDetails) throws -> JSON { + let output = [ + "placement_restriction": try TeamLog.PlacementRestrictionSerializer().serialize(value.placementRestriction), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataPlacementRestrictionSatisfyPolicyDetails { + + public func deserialize(_ json: JSON) throws -> DataPlacementRestrictionSatisfyPolicyDetails { switch json { - case .dictionary(let dict): - let placementRestriction = TeamLog.PlacementRestrictionSerializer().deserialize(dict["placement_restriction"] ?? .null) - return DataPlacementRestrictionSatisfyPolicyDetails(placementRestriction: placementRestriction) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let placementRestriction = try TeamLog.PlacementRestrictionSerializer().deserialize(dict["placement_restriction"] ?? .null) + return DataPlacementRestrictionSatisfyPolicyDetails(placementRestriction: placementRestriction) + default: + throw JSONSerializerError.deserializeError(type: DataPlacementRestrictionSatisfyPolicyDetails.self, json: json) } } } /// The DataPlacementRestrictionSatisfyPolicyType struct - open class DataPlacementRestrictionSatisfyPolicyType: CustomStringConvertible { + public class DataPlacementRestrictionSatisfyPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataPlacementRestrictionSatisfyPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DataPlacementRestrictionSatisfyPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataPlacementRestrictionSatisfyPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataPlacementRestrictionSatisfyPolicyType: \(error)" + } } } - open class DataPlacementRestrictionSatisfyPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataPlacementRestrictionSatisfyPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DataPlacementRestrictionSatisfyPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataPlacementRestrictionSatisfyPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataPlacementRestrictionSatisfyPolicyType { + + public func deserialize(_ json: JSON) throws -> DataPlacementRestrictionSatisfyPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DataPlacementRestrictionSatisfyPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DataPlacementRestrictionSatisfyPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DataPlacementRestrictionSatisfyPolicyType.self, json: json) } } } /// Requested data residency migration for team data. - open class DataResidencyMigrationRequestSuccessfulDetails: CustomStringConvertible { - public init() { + public class DataResidencyMigrationRequestSuccessfulDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DataResidencyMigrationRequestSuccessfulDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataResidencyMigrationRequestSuccessfulDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataResidencyMigrationRequestSuccessfulDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataResidencyMigrationRequestSuccessfulDetails: \(error)" + } } } - open class DataResidencyMigrationRequestSuccessfulDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataResidencyMigrationRequestSuccessfulDetails) -> JSON { + + public class DataResidencyMigrationRequestSuccessfulDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataResidencyMigrationRequestSuccessfulDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataResidencyMigrationRequestSuccessfulDetails { + + public func deserialize(_ json: JSON) throws -> DataResidencyMigrationRequestSuccessfulDetails { switch json { - case .dictionary(_): - return DataResidencyMigrationRequestSuccessfulDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DataResidencyMigrationRequestSuccessfulDetails() + default: + throw JSONSerializerError.deserializeError(type: DataResidencyMigrationRequestSuccessfulDetails.self, json: json) } } } /// The DataResidencyMigrationRequestSuccessfulType struct - open class DataResidencyMigrationRequestSuccessfulType: CustomStringConvertible { + public class DataResidencyMigrationRequestSuccessfulType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataResidencyMigrationRequestSuccessfulTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DataResidencyMigrationRequestSuccessfulTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataResidencyMigrationRequestSuccessfulTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataResidencyMigrationRequestSuccessfulType: \(error)" + } } } - open class DataResidencyMigrationRequestSuccessfulTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataResidencyMigrationRequestSuccessfulType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DataResidencyMigrationRequestSuccessfulTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataResidencyMigrationRequestSuccessfulType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataResidencyMigrationRequestSuccessfulType { + + public func deserialize(_ json: JSON) throws -> DataResidencyMigrationRequestSuccessfulType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DataResidencyMigrationRequestSuccessfulType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DataResidencyMigrationRequestSuccessfulType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DataResidencyMigrationRequestSuccessfulType.self, json: json) } } } /// Request for data residency migration for team data has failed. - open class DataResidencyMigrationRequestUnsuccessfulDetails: CustomStringConvertible { - public init() { + public class DataResidencyMigrationRequestUnsuccessfulDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DataResidencyMigrationRequestUnsuccessfulDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataResidencyMigrationRequestUnsuccessfulDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataResidencyMigrationRequestUnsuccessfulDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataResidencyMigrationRequestUnsuccessfulDetails: \(error)" + } } } - open class DataResidencyMigrationRequestUnsuccessfulDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataResidencyMigrationRequestUnsuccessfulDetails) -> JSON { + + public class DataResidencyMigrationRequestUnsuccessfulDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataResidencyMigrationRequestUnsuccessfulDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataResidencyMigrationRequestUnsuccessfulDetails { + + public func deserialize(_ json: JSON) throws -> DataResidencyMigrationRequestUnsuccessfulDetails { switch json { - case .dictionary(_): - return DataResidencyMigrationRequestUnsuccessfulDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DataResidencyMigrationRequestUnsuccessfulDetails() + default: + throw JSONSerializerError.deserializeError(type: DataResidencyMigrationRequestUnsuccessfulDetails.self, json: json) } } } /// The DataResidencyMigrationRequestUnsuccessfulType struct - open class DataResidencyMigrationRequestUnsuccessfulType: CustomStringConvertible { + public class DataResidencyMigrationRequestUnsuccessfulType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DataResidencyMigrationRequestUnsuccessfulTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DataResidencyMigrationRequestUnsuccessfulTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DataResidencyMigrationRequestUnsuccessfulTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DataResidencyMigrationRequestUnsuccessfulType: \(error)" + } } } - open class DataResidencyMigrationRequestUnsuccessfulTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DataResidencyMigrationRequestUnsuccessfulType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DataResidencyMigrationRequestUnsuccessfulTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DataResidencyMigrationRequestUnsuccessfulType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DataResidencyMigrationRequestUnsuccessfulType { + + public func deserialize(_ json: JSON) throws -> DataResidencyMigrationRequestUnsuccessfulType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DataResidencyMigrationRequestUnsuccessfulType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DataResidencyMigrationRequestUnsuccessfulType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DataResidencyMigrationRequestUnsuccessfulType.self, json: json) } } } /// Policy for the default number of days until an externally shared link expires - public enum DefaultLinkExpirationDaysPolicy: CustomStringConvertible { + public enum DefaultLinkExpirationDaysPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case day1 /// An unspecified error. @@ -4926,148 +6416,180 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try DefaultLinkExpirationDaysPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DefaultLinkExpirationDaysPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DefaultLinkExpirationDaysPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for DefaultLinkExpirationDaysPolicy: \(error)" + } } } - open class DefaultLinkExpirationDaysPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DefaultLinkExpirationDaysPolicy) -> JSON { + + public class DefaultLinkExpirationDaysPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DefaultLinkExpirationDaysPolicy) throws -> JSON { switch value { - case .day1: - var d = [String: JSON]() - d[".tag"] = .str("day_1") - return .dictionary(d) - case .day180: - var d = [String: JSON]() - d[".tag"] = .str("day_180") - return .dictionary(d) - case .day3: - var d = [String: JSON]() - d[".tag"] = .str("day_3") - return .dictionary(d) - case .day30: - var d = [String: JSON]() - d[".tag"] = .str("day_30") - return .dictionary(d) - case .day7: - var d = [String: JSON]() - d[".tag"] = .str("day_7") - return .dictionary(d) - case .day90: - var d = [String: JSON]() - d[".tag"] = .str("day_90") - return .dictionary(d) - case .none: - var d = [String: JSON]() - d[".tag"] = .str("none") - return .dictionary(d) - case .year1: - var d = [String: JSON]() - d[".tag"] = .str("year_1") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DefaultLinkExpirationDaysPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "day_1": - return DefaultLinkExpirationDaysPolicy.day1 - case "day_180": - return DefaultLinkExpirationDaysPolicy.day180 - case "day_3": - return DefaultLinkExpirationDaysPolicy.day3 - case "day_30": - return DefaultLinkExpirationDaysPolicy.day30 - case "day_7": - return DefaultLinkExpirationDaysPolicy.day7 - case "day_90": - return DefaultLinkExpirationDaysPolicy.day90 - case "none": - return DefaultLinkExpirationDaysPolicy.none - case "year_1": - return DefaultLinkExpirationDaysPolicy.year1 - case "other": - return DefaultLinkExpirationDaysPolicy.other - default: - return DefaultLinkExpirationDaysPolicy.other - } - default: - fatalError("Failed to deserialize") + case .day1: + var d = [String: JSON]() + d[".tag"] = .str("day_1") + return .dictionary(d) + case .day180: + var d = [String: JSON]() + d[".tag"] = .str("day_180") + return .dictionary(d) + case .day3: + var d = [String: JSON]() + d[".tag"] = .str("day_3") + return .dictionary(d) + case .day30: + var d = [String: JSON]() + d[".tag"] = .str("day_30") + return .dictionary(d) + case .day7: + var d = [String: JSON]() + d[".tag"] = .str("day_7") + return .dictionary(d) + case .day90: + var d = [String: JSON]() + d[".tag"] = .str("day_90") + return .dictionary(d) + case .none: + var d = [String: JSON]() + d[".tag"] = .str("none") + return .dictionary(d) + case .year1: + var d = [String: JSON]() + d[".tag"] = .str("year_1") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DefaultLinkExpirationDaysPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "day_1": + return DefaultLinkExpirationDaysPolicy.day1 + case "day_180": + return DefaultLinkExpirationDaysPolicy.day180 + case "day_3": + return DefaultLinkExpirationDaysPolicy.day3 + case "day_30": + return DefaultLinkExpirationDaysPolicy.day30 + case "day_7": + return DefaultLinkExpirationDaysPolicy.day7 + case "day_90": + return DefaultLinkExpirationDaysPolicy.day90 + case "none": + return DefaultLinkExpirationDaysPolicy.none + case "year_1": + return DefaultLinkExpirationDaysPolicy.year1 + case "other": + return DefaultLinkExpirationDaysPolicy.other + default: + return DefaultLinkExpirationDaysPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: DefaultLinkExpirationDaysPolicy.self, json: json) } } } /// Deleted team invite link. - open class DeleteTeamInviteLinkDetails: CustomStringConvertible { + public class DeleteTeamInviteLinkDetails: CustomStringConvertible, JSONRepresentable { /// The invite link url that was deleted. public let linkUrl: String public init(linkUrl: String) { stringValidator()(linkUrl) self.linkUrl = linkUrl } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteTeamInviteLinkDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteTeamInviteLinkDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteTeamInviteLinkDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteTeamInviteLinkDetails: \(error)" + } } } - open class DeleteTeamInviteLinkDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteTeamInviteLinkDetails) -> JSON { - let output = [ - "link_url": Serialization._StringSerializer.serialize(value.linkUrl), + + public class DeleteTeamInviteLinkDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteTeamInviteLinkDetails) throws -> JSON { + let output = [ + "link_url": try Serialization._StringSerializer.serialize(value.linkUrl), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteTeamInviteLinkDetails { + + public func deserialize(_ json: JSON) throws -> DeleteTeamInviteLinkDetails { switch json { - case .dictionary(let dict): - let linkUrl = Serialization._StringSerializer.deserialize(dict["link_url"] ?? .null) - return DeleteTeamInviteLinkDetails(linkUrl: linkUrl) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let linkUrl = try Serialization._StringSerializer.deserialize(dict["link_url"] ?? .null) + return DeleteTeamInviteLinkDetails(linkUrl: linkUrl) + default: + throw JSONSerializerError.deserializeError(type: DeleteTeamInviteLinkDetails.self, json: json) } } } /// The DeleteTeamInviteLinkType struct - open class DeleteTeamInviteLinkType: CustomStringConvertible { + public class DeleteTeamInviteLinkType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeleteTeamInviteLinkTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeleteTeamInviteLinkTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeleteTeamInviteLinkTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeleteTeamInviteLinkType: \(error)" + } } } - open class DeleteTeamInviteLinkTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeleteTeamInviteLinkType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeleteTeamInviteLinkTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeleteTeamInviteLinkType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeleteTeamInviteLinkType { + + public func deserialize(_ json: JSON) throws -> DeleteTeamInviteLinkType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeleteTeamInviteLinkType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeleteTeamInviteLinkType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeleteTeamInviteLinkType.self, json: json) } } } /// Device's session logged information. - open class DeviceSessionLogInfo: CustomStringConvertible { + public class DeviceSessionLogInfo: CustomStringConvertible, JSONRepresentable { /// The IP address of the last activity from this session. public let ipAddress: String? /// The time this session was created. @@ -5080,70 +6602,82 @@ open class TeamLog { self.created = created self.updated = updated } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceSessionLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceSessionLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceSessionLogInfo: \(error)" + } } } - open class DeviceSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceSessionLogInfo) -> JSON { - var output = [ - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + + public class DeviceSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceSessionLogInfo) throws -> JSON { + var output = [ + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), ] switch value { - case let desktopDeviceSession as TeamLog.DesktopDeviceSessionLogInfo: - for (k, v) in Serialization.getFields(TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(desktopDeviceSession)) { - output[k] = v - } - output[".tag"] = .str("desktop_device_session") - case let mobileDeviceSession as TeamLog.MobileDeviceSessionLogInfo: - for (k, v) in Serialization.getFields(TeamLog.MobileDeviceSessionLogInfoSerializer().serialize(mobileDeviceSession)) { - output[k] = v - } - output[".tag"] = .str("mobile_device_session") - case let webDeviceSession as TeamLog.WebDeviceSessionLogInfo: - for (k, v) in Serialization.getFields(TeamLog.WebDeviceSessionLogInfoSerializer().serialize(webDeviceSession)) { - output[k] = v - } - output[".tag"] = .str("web_device_session") - case let legacyDeviceSession as TeamLog.LegacyDeviceSessionLogInfo: - for (k, v) in Serialization.getFields(TeamLog.LegacyDeviceSessionLogInfoSerializer().serialize(legacyDeviceSession)) { - output[k] = v - } - output[".tag"] = .str("legacy_device_session") - default: fatalError("Tried to serialize unexpected subtype") - } - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> DeviceSessionLogInfo { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "desktop_device_session": - return TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(json) - case "mobile_device_session": - return TeamLog.MobileDeviceSessionLogInfoSerializer().deserialize(json) - case "web_device_session": - return TeamLog.WebDeviceSessionLogInfoSerializer().deserialize(json) - case "legacy_device_session": - return TeamLog.LegacyDeviceSessionLogInfoSerializer().deserialize(json) - default: - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - return DeviceSessionLogInfo(ipAddress: ipAddress, created: created, updated: updated) - } - default: - fatalError("Type error deserializing") + case let desktopDeviceSession as TeamLog.DesktopDeviceSessionLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(desktopDeviceSession)) { + output[k] = v + } + output[".tag"] = .str("desktop_device_session") + case let mobileDeviceSession as TeamLog.MobileDeviceSessionLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.MobileDeviceSessionLogInfoSerializer().serialize(mobileDeviceSession)) { + output[k] = v + } + output[".tag"] = .str("mobile_device_session") + case let webDeviceSession as TeamLog.WebDeviceSessionLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.WebDeviceSessionLogInfoSerializer().serialize(webDeviceSession)) { + output[k] = v + } + output[".tag"] = .str("web_device_session") + case let legacyDeviceSession as TeamLog.LegacyDeviceSessionLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.LegacyDeviceSessionLogInfoSerializer().serialize(legacyDeviceSession)) { + output[k] = v + } + output[".tag"] = .str("legacy_device_session") + default: + throw JSONSerializerError.unexpectedSubtype(type: DeviceSessionLogInfo.self, subtype: value) + } + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> DeviceSessionLogInfo { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "desktop_device_session": + return try TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(json) + case "mobile_device_session": + return try TeamLog.MobileDeviceSessionLogInfoSerializer().deserialize(json) + case "web_device_session": + return try TeamLog.WebDeviceSessionLogInfoSerializer().deserialize(json) + case "legacy_device_session": + return try TeamLog.LegacyDeviceSessionLogInfoSerializer().deserialize(json) + default: + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + return DeviceSessionLogInfo(ipAddress: ipAddress, created: created, updated: updated) + } + default: + throw JSONSerializerError.deserializeError(type: DeviceSessionLogInfo.self, json: json) } } } /// Information about linked Dropbox desktop client sessions - open class DesktopDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { + public class DesktopDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { /// Desktop session unique id. public let sessionInfo: TeamLog.DesktopSessionLogInfo? /// Name of the hosting desktop. @@ -5156,7 +6690,17 @@ open class TeamLog { public let platform: String /// Whether itu2019s possible to delete all of the account files upon unlinking. public let isDeleteOnUnlinkSupported: Bool - public init(hostName: String, clientType: Team.DesktopPlatform, platform: String, isDeleteOnUnlinkSupported: Bool, ipAddress: String? = nil, created: Date? = nil, updated: Date? = nil, sessionInfo: TeamLog.DesktopSessionLogInfo? = nil, clientVersion: String? = nil) { + public init( + hostName: String, + clientType: Team.DesktopPlatform, + platform: String, + isDeleteOnUnlinkSupported: Bool, + ipAddress: String? = nil, + created: Date? = nil, + updated: Date? = nil, + sessionInfo: TeamLog.DesktopSessionLogInfo? = nil, + clientVersion: String? = nil + ) { self.sessionInfo = sessionInfo stringValidator()(hostName) self.hostName = hostName @@ -5168,186 +6712,240 @@ open class TeamLog { self.isDeleteOnUnlinkSupported = isDeleteOnUnlinkSupported super.init(ipAddress: ipAddress, created: created, updated: updated) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DesktopDeviceSessionLogInfoSerializer().serialize(self)))" - } - } - open class DesktopDeviceSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DesktopDeviceSessionLogInfo) -> JSON { - let output = [ - "host_name": Serialization._StringSerializer.serialize(value.hostName), - "client_type": Team.DesktopPlatformSerializer().serialize(value.clientType), - "platform": Serialization._StringSerializer.serialize(value.platform), - "is_delete_on_unlink_supported": Serialization._BoolSerializer.serialize(value.isDeleteOnUnlinkSupported), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), - "session_info": NullableSerializer(TeamLog.DesktopSessionLogInfoSerializer()).serialize(value.sessionInfo), - "client_version": NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> DesktopDeviceSessionLogInfo { - switch json { - case .dictionary(let dict): - let hostName = Serialization._StringSerializer.deserialize(dict["host_name"] ?? .null) - let clientType = Team.DesktopPlatformSerializer().deserialize(dict["client_type"] ?? .null) - let platform = Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) - let isDeleteOnUnlinkSupported = Serialization._BoolSerializer.deserialize(dict["is_delete_on_unlink_supported"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - let sessionInfo = NullableSerializer(TeamLog.DesktopSessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) - let clientVersion = NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) - return DesktopDeviceSessionLogInfo(hostName: hostName, clientType: clientType, platform: platform, isDeleteOnUnlinkSupported: isDeleteOnUnlinkSupported, ipAddress: ipAddress, created: created, updated: updated, sessionInfo: sessionInfo, clientVersion: clientVersion) - default: - fatalError("Type error deserializing") + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DesktopDeviceSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DesktopDeviceSessionLogInfo: \(error)" + } + } + } + + public class DesktopDeviceSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DesktopDeviceSessionLogInfo) throws -> JSON { + let output = [ + "host_name": try Serialization._StringSerializer.serialize(value.hostName), + "client_type": try Team.DesktopPlatformSerializer().serialize(value.clientType), + "platform": try Serialization._StringSerializer.serialize(value.platform), + "is_delete_on_unlink_supported": try Serialization._BoolSerializer.serialize(value.isDeleteOnUnlinkSupported), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + "session_info": try NullableSerializer(TeamLog.DesktopSessionLogInfoSerializer()).serialize(value.sessionInfo), + "client_version": try NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> DesktopDeviceSessionLogInfo { + switch json { + case .dictionary(let dict): + let hostName = try Serialization._StringSerializer.deserialize(dict["host_name"] ?? .null) + let clientType = try Team.DesktopPlatformSerializer().deserialize(dict["client_type"] ?? .null) + let platform = try Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) + let isDeleteOnUnlinkSupported = try Serialization._BoolSerializer.deserialize(dict["is_delete_on_unlink_supported"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + let sessionInfo = try NullableSerializer(TeamLog.DesktopSessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) + let clientVersion = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) + return DesktopDeviceSessionLogInfo( + hostName: hostName, + clientType: clientType, + platform: platform, + isDeleteOnUnlinkSupported: isDeleteOnUnlinkSupported, + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo, + clientVersion: clientVersion + ) + default: + throw JSONSerializerError.deserializeError(type: DesktopDeviceSessionLogInfo.self, json: json) } } } /// Session's logged information. - open class SessionLogInfo: CustomStringConvertible { + public class SessionLogInfo: CustomStringConvertible, JSONRepresentable { /// Session ID. public let sessionId: String? public init(sessionId: String? = nil) { nullableValidator(stringValidator())(sessionId) self.sessionId = sessionId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SessionLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try SessionLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SessionLogInfo: \(error)" + } } } - open class SessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SessionLogInfo) -> JSON { - var output = [ - "session_id": NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), + + public class SessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SessionLogInfo) throws -> JSON { + var output = [ + "session_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), ] switch value { - case let web as TeamLog.WebSessionLogInfo: - for (k, v) in Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(web)) { - output[k] = v - } - output[".tag"] = .str("web") - case let desktop as TeamLog.DesktopSessionLogInfo: - for (k, v) in Serialization.getFields(TeamLog.DesktopSessionLogInfoSerializer().serialize(desktop)) { - output[k] = v - } - output[".tag"] = .str("desktop") - case let mobile as TeamLog.MobileSessionLogInfo: - for (k, v) in Serialization.getFields(TeamLog.MobileSessionLogInfoSerializer().serialize(mobile)) { - output[k] = v - } - output[".tag"] = .str("mobile") - default: fatalError("Tried to serialize unexpected subtype") - } - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> SessionLogInfo { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "web": - return TeamLog.WebSessionLogInfoSerializer().deserialize(json) - case "desktop": - return TeamLog.DesktopSessionLogInfoSerializer().deserialize(json) - case "mobile": - return TeamLog.MobileSessionLogInfoSerializer().deserialize(json) - default: - let sessionId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) - return SessionLogInfo(sessionId: sessionId) - } + case let web as TeamLog.WebSessionLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.WebSessionLogInfoSerializer().serialize(web)) { + output[k] = v + } + output[".tag"] = .str("web") + case let desktop as TeamLog.DesktopSessionLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.DesktopSessionLogInfoSerializer().serialize(desktop)) { + output[k] = v + } + output[".tag"] = .str("desktop") + case let mobile as TeamLog.MobileSessionLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.MobileSessionLogInfoSerializer().serialize(mobile)) { + output[k] = v + } + output[".tag"] = .str("mobile") + default: + throw JSONSerializerError.unexpectedSubtype(type: SessionLogInfo.self, subtype: value) + } + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SessionLogInfo { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "web": + return try TeamLog.WebSessionLogInfoSerializer().deserialize(json) + case "desktop": + return try TeamLog.DesktopSessionLogInfoSerializer().deserialize(json) + case "mobile": + return try TeamLog.MobileSessionLogInfoSerializer().deserialize(json) default: - fatalError("Type error deserializing") + let sessionId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) + return SessionLogInfo(sessionId: sessionId) + } + default: + throw JSONSerializerError.deserializeError(type: SessionLogInfo.self, json: json) } } } /// Desktop session. - open class DesktopSessionLogInfo: TeamLog.SessionLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DesktopSessionLogInfoSerializer().serialize(self)))" + public class DesktopSessionLogInfo: TeamLog.SessionLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DesktopSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DesktopSessionLogInfo: \(error)" + } } } - open class DesktopSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DesktopSessionLogInfo) -> JSON { - let output = [ - "session_id": NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), + + public class DesktopSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DesktopSessionLogInfo) throws -> JSON { + let output = [ + "session_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DesktopSessionLogInfo { + + public func deserialize(_ json: JSON) throws -> DesktopSessionLogInfo { switch json { - case .dictionary(let dict): - let sessionId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) - return DesktopSessionLogInfo(sessionId: sessionId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) + return DesktopSessionLogInfo(sessionId: sessionId) + default: + throw JSONSerializerError.deserializeError(type: DesktopSessionLogInfo.self, json: json) } } } /// Added members to device approvals exception list. - open class DeviceApprovalsAddExceptionDetails: CustomStringConvertible { - public init() { + public class DeviceApprovalsAddExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DeviceApprovalsAddExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsAddExceptionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsAddExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsAddExceptionDetails: \(error)" + } } } - open class DeviceApprovalsAddExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsAddExceptionDetails) -> JSON { + + public class DeviceApprovalsAddExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsAddExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsAddExceptionDetails { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsAddExceptionDetails { switch json { - case .dictionary(_): - return DeviceApprovalsAddExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DeviceApprovalsAddExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsAddExceptionDetails.self, json: json) } } } /// The DeviceApprovalsAddExceptionType struct - open class DeviceApprovalsAddExceptionType: CustomStringConvertible { + public class DeviceApprovalsAddExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsAddExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsAddExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsAddExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsAddExceptionType: \(error)" + } } } - open class DeviceApprovalsAddExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsAddExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceApprovalsAddExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsAddExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsAddExceptionType { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsAddExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceApprovalsAddExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceApprovalsAddExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsAddExceptionType.self, json: json) } } } /// Set/removed limit on number of computers member can link to team Dropbox account. - open class DeviceApprovalsChangeDesktopPolicyDetails: CustomStringConvertible { + public class DeviceApprovalsChangeDesktopPolicyDetails: CustomStringConvertible, JSONRepresentable { /// New desktop device approvals policy. Might be missing due to historical data gap. public let newValue: TeamLog.DeviceApprovalsPolicy? /// Previous desktop device approvals policy. Might be missing due to historical data gap. @@ -5356,64 +6954,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeDesktopPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeDesktopPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeDesktopPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeDesktopPolicyDetails: \(error)" + } } } - open class DeviceApprovalsChangeDesktopPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeDesktopPolicyDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.previousValue), + + public class DeviceApprovalsChangeDesktopPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeDesktopPolicyDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeDesktopPolicyDetails { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeDesktopPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return DeviceApprovalsChangeDesktopPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return DeviceApprovalsChangeDesktopPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeDesktopPolicyDetails.self, json: json) } } } /// The DeviceApprovalsChangeDesktopPolicyType struct - open class DeviceApprovalsChangeDesktopPolicyType: CustomStringConvertible { + public class DeviceApprovalsChangeDesktopPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeDesktopPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeDesktopPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeDesktopPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeDesktopPolicyType: \(error)" + } } } - open class DeviceApprovalsChangeDesktopPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeDesktopPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceApprovalsChangeDesktopPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeDesktopPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeDesktopPolicyType { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeDesktopPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceApprovalsChangeDesktopPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceApprovalsChangeDesktopPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeDesktopPolicyType.self, json: json) } } } /// Set/removed limit on number of mobile devices member can link to team Dropbox account. - open class DeviceApprovalsChangeMobilePolicyDetails: CustomStringConvertible { + public class DeviceApprovalsChangeMobilePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New mobile device approvals policy. Might be missing due to historical data gap. public let newValue: TeamLog.DeviceApprovalsPolicy? /// Previous mobile device approvals policy. Might be missing due to historical data gap. @@ -5422,64 +7042,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeMobilePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeMobilePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeMobilePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeMobilePolicyDetails: \(error)" + } } } - open class DeviceApprovalsChangeMobilePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeMobilePolicyDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.previousValue), + + public class DeviceApprovalsChangeMobilePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeMobilePolicyDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeMobilePolicyDetails { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeMobilePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return DeviceApprovalsChangeMobilePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.DeviceApprovalsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return DeviceApprovalsChangeMobilePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeMobilePolicyDetails.self, json: json) } } } /// The DeviceApprovalsChangeMobilePolicyType struct - open class DeviceApprovalsChangeMobilePolicyType: CustomStringConvertible { + public class DeviceApprovalsChangeMobilePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeMobilePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeMobilePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeMobilePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeMobilePolicyType: \(error)" + } } } - open class DeviceApprovalsChangeMobilePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeMobilePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceApprovalsChangeMobilePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeMobilePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeMobilePolicyType { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeMobilePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceApprovalsChangeMobilePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceApprovalsChangeMobilePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeMobilePolicyType.self, json: json) } } } /// Changed device approvals setting when member is over limit. - open class DeviceApprovalsChangeOverageActionDetails: CustomStringConvertible { + public class DeviceApprovalsChangeOverageActionDetails: CustomStringConvertible, JSONRepresentable { /// New over the limits policy. Might be missing due to historical data gap. public let newValue: TeamPolicies.RolloutMethod? /// Previous over the limit policy. Might be missing due to historical data gap. @@ -5488,64 +7130,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeOverageActionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeOverageActionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeOverageActionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeOverageActionDetails: \(error)" + } } } - open class DeviceApprovalsChangeOverageActionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeOverageActionDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamPolicies.RolloutMethodSerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.RolloutMethodSerializer()).serialize(value.previousValue), + + public class DeviceApprovalsChangeOverageActionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeOverageActionDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamPolicies.RolloutMethodSerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.RolloutMethodSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeOverageActionDetails { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeOverageActionDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamPolicies.RolloutMethodSerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.RolloutMethodSerializer()).deserialize(dict["previous_value"] ?? .null) - return DeviceApprovalsChangeOverageActionDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamPolicies.RolloutMethodSerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.RolloutMethodSerializer()).deserialize(dict["previous_value"] ?? .null) + return DeviceApprovalsChangeOverageActionDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeOverageActionDetails.self, json: json) } } } /// The DeviceApprovalsChangeOverageActionType struct - open class DeviceApprovalsChangeOverageActionType: CustomStringConvertible { + public class DeviceApprovalsChangeOverageActionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeOverageActionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeOverageActionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeOverageActionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeOverageActionType: \(error)" + } } } - open class DeviceApprovalsChangeOverageActionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeOverageActionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceApprovalsChangeOverageActionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeOverageActionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeOverageActionType { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeOverageActionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceApprovalsChangeOverageActionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceApprovalsChangeOverageActionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeOverageActionType.self, json: json) } } } /// Changed device approvals setting when member unlinks approved device. - open class DeviceApprovalsChangeUnlinkActionDetails: CustomStringConvertible { + public class DeviceApprovalsChangeUnlinkActionDetails: CustomStringConvertible, JSONRepresentable { /// New device unlink policy. Might be missing due to historical data gap. public let newValue: TeamLog.DeviceUnlinkPolicy? /// Previous device unlink policy. Might be missing due to historical data gap. @@ -5554,64 +7218,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeUnlinkActionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeUnlinkActionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeUnlinkActionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeUnlinkActionDetails: \(error)" + } } } - open class DeviceApprovalsChangeUnlinkActionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeUnlinkActionDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).serialize(value.previousValue), + + public class DeviceApprovalsChangeUnlinkActionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeUnlinkActionDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeUnlinkActionDetails { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeUnlinkActionDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return DeviceApprovalsChangeUnlinkActionDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.DeviceUnlinkPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return DeviceApprovalsChangeUnlinkActionDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeUnlinkActionDetails.self, json: json) } } } /// The DeviceApprovalsChangeUnlinkActionType struct - open class DeviceApprovalsChangeUnlinkActionType: CustomStringConvertible { + public class DeviceApprovalsChangeUnlinkActionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsChangeUnlinkActionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsChangeUnlinkActionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsChangeUnlinkActionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsChangeUnlinkActionType: \(error)" + } } } - open class DeviceApprovalsChangeUnlinkActionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsChangeUnlinkActionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceApprovalsChangeUnlinkActionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsChangeUnlinkActionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsChangeUnlinkActionType { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsChangeUnlinkActionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceApprovalsChangeUnlinkActionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceApprovalsChangeUnlinkActionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsChangeUnlinkActionType.self, json: json) } } } /// The DeviceApprovalsPolicy union - public enum DeviceApprovalsPolicy: CustomStringConvertible { + public enum DeviceApprovalsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case limited /// An unspecified error. @@ -5619,289 +7305,384 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try DeviceApprovalsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsPolicy: \(error)" + } } } - open class DeviceApprovalsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsPolicy) -> JSON { + + public class DeviceApprovalsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsPolicy) throws -> JSON { switch value { - case .limited: - var d = [String: JSON]() - d[".tag"] = .str("limited") - return .dictionary(d) - case .unlimited: - var d = [String: JSON]() - d[".tag"] = .str("unlimited") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeviceApprovalsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "limited": - return DeviceApprovalsPolicy.limited - case "unlimited": - return DeviceApprovalsPolicy.unlimited - case "other": - return DeviceApprovalsPolicy.other - default: - return DeviceApprovalsPolicy.other - } + case .limited: + var d = [String: JSON]() + d[".tag"] = .str("limited") + return .dictionary(d) + case .unlimited: + var d = [String: JSON]() + d[".tag"] = .str("unlimited") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "limited": + return DeviceApprovalsPolicy.limited + case "unlimited": + return DeviceApprovalsPolicy.unlimited + case "other": + return DeviceApprovalsPolicy.other default: - fatalError("Failed to deserialize") + return DeviceApprovalsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsPolicy.self, json: json) } } } /// Removed members from device approvals exception list. - open class DeviceApprovalsRemoveExceptionDetails: CustomStringConvertible { - public init() { + public class DeviceApprovalsRemoveExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DeviceApprovalsRemoveExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsRemoveExceptionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsRemoveExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsRemoveExceptionDetails: \(error)" + } } } - open class DeviceApprovalsRemoveExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsRemoveExceptionDetails) -> JSON { + + public class DeviceApprovalsRemoveExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsRemoveExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsRemoveExceptionDetails { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsRemoveExceptionDetails { switch json { - case .dictionary(_): - return DeviceApprovalsRemoveExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DeviceApprovalsRemoveExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsRemoveExceptionDetails.self, json: json) } } } /// The DeviceApprovalsRemoveExceptionType struct - open class DeviceApprovalsRemoveExceptionType: CustomStringConvertible { + public class DeviceApprovalsRemoveExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceApprovalsRemoveExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceApprovalsRemoveExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceApprovalsRemoveExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceApprovalsRemoveExceptionType: \(error)" + } } } - open class DeviceApprovalsRemoveExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceApprovalsRemoveExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceApprovalsRemoveExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceApprovalsRemoveExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceApprovalsRemoveExceptionType { + + public func deserialize(_ json: JSON) throws -> DeviceApprovalsRemoveExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceApprovalsRemoveExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceApprovalsRemoveExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceApprovalsRemoveExceptionType.self, json: json) } } } /// Changed IP address associated with active desktop session. - open class DeviceChangeIpDesktopDetails: CustomStringConvertible { + public class DeviceChangeIpDesktopDetails: CustomStringConvertible, JSONRepresentable { /// Device's session logged information. public let deviceSessionInfo: TeamLog.DeviceSessionLogInfo public init(deviceSessionInfo: TeamLog.DeviceSessionLogInfo) { self.deviceSessionInfo = deviceSessionInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceChangeIpDesktopDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceChangeIpDesktopDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceChangeIpDesktopDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceChangeIpDesktopDetails: \(error)" + } } } - open class DeviceChangeIpDesktopDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceChangeIpDesktopDetails) -> JSON { - let output = [ - "device_session_info": TeamLog.DeviceSessionLogInfoSerializer().serialize(value.deviceSessionInfo), + + public class DeviceChangeIpDesktopDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceChangeIpDesktopDetails) throws -> JSON { + let output = [ + "device_session_info": try TeamLog.DeviceSessionLogInfoSerializer().serialize(value.deviceSessionInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceChangeIpDesktopDetails { + + public func deserialize(_ json: JSON) throws -> DeviceChangeIpDesktopDetails { switch json { - case .dictionary(let dict): - let deviceSessionInfo = TeamLog.DeviceSessionLogInfoSerializer().deserialize(dict["device_session_info"] ?? .null) - return DeviceChangeIpDesktopDetails(deviceSessionInfo: deviceSessionInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let deviceSessionInfo = try TeamLog.DeviceSessionLogInfoSerializer().deserialize(dict["device_session_info"] ?? .null) + return DeviceChangeIpDesktopDetails(deviceSessionInfo: deviceSessionInfo) + default: + throw JSONSerializerError.deserializeError(type: DeviceChangeIpDesktopDetails.self, json: json) } } } /// The DeviceChangeIpDesktopType struct - open class DeviceChangeIpDesktopType: CustomStringConvertible { + public class DeviceChangeIpDesktopType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceChangeIpDesktopTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceChangeIpDesktopTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceChangeIpDesktopTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceChangeIpDesktopType: \(error)" + } } } - open class DeviceChangeIpDesktopTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceChangeIpDesktopType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceChangeIpDesktopTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceChangeIpDesktopType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceChangeIpDesktopType { + + public func deserialize(_ json: JSON) throws -> DeviceChangeIpDesktopType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceChangeIpDesktopType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceChangeIpDesktopType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceChangeIpDesktopType.self, json: json) } } } /// Changed IP address associated with active mobile session. - open class DeviceChangeIpMobileDetails: CustomStringConvertible { + public class DeviceChangeIpMobileDetails: CustomStringConvertible, JSONRepresentable { /// Device's session logged information. public let deviceSessionInfo: TeamLog.DeviceSessionLogInfo? public init(deviceSessionInfo: TeamLog.DeviceSessionLogInfo? = nil) { self.deviceSessionInfo = deviceSessionInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceChangeIpMobileDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceChangeIpMobileDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceChangeIpMobileDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceChangeIpMobileDetails: \(error)" + } } } - open class DeviceChangeIpMobileDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceChangeIpMobileDetails) -> JSON { - let output = [ - "device_session_info": NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).serialize(value.deviceSessionInfo), + + public class DeviceChangeIpMobileDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceChangeIpMobileDetails) throws -> JSON { + let output = [ + "device_session_info": try NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).serialize(value.deviceSessionInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceChangeIpMobileDetails { + + public func deserialize(_ json: JSON) throws -> DeviceChangeIpMobileDetails { switch json { - case .dictionary(let dict): - let deviceSessionInfo = NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).deserialize(dict["device_session_info"] ?? .null) - return DeviceChangeIpMobileDetails(deviceSessionInfo: deviceSessionInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let deviceSessionInfo = try NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).deserialize(dict["device_session_info"] ?? .null) + return DeviceChangeIpMobileDetails(deviceSessionInfo: deviceSessionInfo) + default: + throw JSONSerializerError.deserializeError(type: DeviceChangeIpMobileDetails.self, json: json) } } } /// The DeviceChangeIpMobileType struct - open class DeviceChangeIpMobileType: CustomStringConvertible { + public class DeviceChangeIpMobileType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceChangeIpMobileTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceChangeIpMobileTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceChangeIpMobileTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceChangeIpMobileType: \(error)" + } } } - open class DeviceChangeIpMobileTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceChangeIpMobileType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceChangeIpMobileTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceChangeIpMobileType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceChangeIpMobileType { + + public func deserialize(_ json: JSON) throws -> DeviceChangeIpMobileType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceChangeIpMobileType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceChangeIpMobileType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceChangeIpMobileType.self, json: json) } } } /// Changed IP address associated with active web session. - open class DeviceChangeIpWebDetails: CustomStringConvertible { + public class DeviceChangeIpWebDetails: CustomStringConvertible, JSONRepresentable { /// Web browser name. public let userAgent: String public init(userAgent: String) { stringValidator()(userAgent) self.userAgent = userAgent } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceChangeIpWebDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceChangeIpWebDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceChangeIpWebDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceChangeIpWebDetails: \(error)" + } } } - open class DeviceChangeIpWebDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceChangeIpWebDetails) -> JSON { - let output = [ - "user_agent": Serialization._StringSerializer.serialize(value.userAgent), + + public class DeviceChangeIpWebDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceChangeIpWebDetails) throws -> JSON { + let output = [ + "user_agent": try Serialization._StringSerializer.serialize(value.userAgent), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceChangeIpWebDetails { + + public func deserialize(_ json: JSON) throws -> DeviceChangeIpWebDetails { switch json { - case .dictionary(let dict): - let userAgent = Serialization._StringSerializer.deserialize(dict["user_agent"] ?? .null) - return DeviceChangeIpWebDetails(userAgent: userAgent) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let userAgent = try Serialization._StringSerializer.deserialize(dict["user_agent"] ?? .null) + return DeviceChangeIpWebDetails(userAgent: userAgent) + default: + throw JSONSerializerError.deserializeError(type: DeviceChangeIpWebDetails.self, json: json) } } } /// The DeviceChangeIpWebType struct - open class DeviceChangeIpWebType: CustomStringConvertible { + public class DeviceChangeIpWebType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceChangeIpWebTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceChangeIpWebTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceChangeIpWebTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceChangeIpWebType: \(error)" + } } } - open class DeviceChangeIpWebTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceChangeIpWebType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceChangeIpWebTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceChangeIpWebType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceChangeIpWebType { + + public func deserialize(_ json: JSON) throws -> DeviceChangeIpWebType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceChangeIpWebType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceChangeIpWebType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceChangeIpWebType.self, json: json) } } } /// Failed to delete all files from unlinked device. - open class DeviceDeleteOnUnlinkFailDetails: CustomStringConvertible { + public class DeviceDeleteOnUnlinkFailDetails: CustomStringConvertible, JSONRepresentable { /// Session unique id. public let sessionInfo: TeamLog.SessionLogInfo? /// The device name. Might be missing due to historical data gap. @@ -5915,66 +7696,88 @@ open class TeamLog { comparableValidator()(numFailures) self.numFailures = numFailures } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceDeleteOnUnlinkFailDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceDeleteOnUnlinkFailDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceDeleteOnUnlinkFailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceDeleteOnUnlinkFailDetails: \(error)" + } } } - open class DeviceDeleteOnUnlinkFailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceDeleteOnUnlinkFailDetails) -> JSON { - let output = [ - "num_failures": Serialization._Int64Serializer.serialize(value.numFailures), - "session_info": NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + + public class DeviceDeleteOnUnlinkFailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceDeleteOnUnlinkFailDetails) throws -> JSON { + let output = [ + "num_failures": try Serialization._Int64Serializer.serialize(value.numFailures), + "session_info": try NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceDeleteOnUnlinkFailDetails { + + public func deserialize(_ json: JSON) throws -> DeviceDeleteOnUnlinkFailDetails { switch json { - case .dictionary(let dict): - let numFailures = Serialization._Int64Serializer.deserialize(dict["num_failures"] ?? .null) - let sessionInfo = NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - return DeviceDeleteOnUnlinkFailDetails(numFailures: numFailures, sessionInfo: sessionInfo, displayName: displayName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let numFailures = try Serialization._Int64Serializer.deserialize(dict["num_failures"] ?? .null) + let sessionInfo = try NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + return DeviceDeleteOnUnlinkFailDetails(numFailures: numFailures, sessionInfo: sessionInfo, displayName: displayName) + default: + throw JSONSerializerError.deserializeError(type: DeviceDeleteOnUnlinkFailDetails.self, json: json) } } } /// The DeviceDeleteOnUnlinkFailType struct - open class DeviceDeleteOnUnlinkFailType: CustomStringConvertible { + public class DeviceDeleteOnUnlinkFailType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceDeleteOnUnlinkFailTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceDeleteOnUnlinkFailTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceDeleteOnUnlinkFailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceDeleteOnUnlinkFailType: \(error)" + } } } - open class DeviceDeleteOnUnlinkFailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceDeleteOnUnlinkFailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceDeleteOnUnlinkFailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceDeleteOnUnlinkFailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceDeleteOnUnlinkFailType { + + public func deserialize(_ json: JSON) throws -> DeviceDeleteOnUnlinkFailType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceDeleteOnUnlinkFailType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceDeleteOnUnlinkFailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceDeleteOnUnlinkFailType.self, json: json) } } } /// Deleted all files from unlinked device. - open class DeviceDeleteOnUnlinkSuccessDetails: CustomStringConvertible { + public class DeviceDeleteOnUnlinkSuccessDetails: CustomStringConvertible, JSONRepresentable { /// Session unique id. public let sessionInfo: TeamLog.SessionLogInfo? /// The device name. Might be missing due to historical data gap. @@ -5984,64 +7787,86 @@ open class TeamLog { nullableValidator(stringValidator())(displayName) self.displayName = displayName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceDeleteOnUnlinkSuccessDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceDeleteOnUnlinkSuccessDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceDeleteOnUnlinkSuccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceDeleteOnUnlinkSuccessDetails: \(error)" + } } } - open class DeviceDeleteOnUnlinkSuccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceDeleteOnUnlinkSuccessDetails) -> JSON { - let output = [ - "session_info": NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + + public class DeviceDeleteOnUnlinkSuccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceDeleteOnUnlinkSuccessDetails) throws -> JSON { + let output = [ + "session_info": try NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceDeleteOnUnlinkSuccessDetails { + + public func deserialize(_ json: JSON) throws -> DeviceDeleteOnUnlinkSuccessDetails { switch json { - case .dictionary(let dict): - let sessionInfo = NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - return DeviceDeleteOnUnlinkSuccessDetails(sessionInfo: sessionInfo, displayName: displayName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionInfo = try NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + return DeviceDeleteOnUnlinkSuccessDetails(sessionInfo: sessionInfo, displayName: displayName) + default: + throw JSONSerializerError.deserializeError(type: DeviceDeleteOnUnlinkSuccessDetails.self, json: json) } } } /// The DeviceDeleteOnUnlinkSuccessType struct - open class DeviceDeleteOnUnlinkSuccessType: CustomStringConvertible { + public class DeviceDeleteOnUnlinkSuccessType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceDeleteOnUnlinkSuccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceDeleteOnUnlinkSuccessTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceDeleteOnUnlinkSuccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceDeleteOnUnlinkSuccessType: \(error)" + } } } - open class DeviceDeleteOnUnlinkSuccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceDeleteOnUnlinkSuccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceDeleteOnUnlinkSuccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceDeleteOnUnlinkSuccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceDeleteOnUnlinkSuccessType { + + public func deserialize(_ json: JSON) throws -> DeviceDeleteOnUnlinkSuccessType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceDeleteOnUnlinkSuccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceDeleteOnUnlinkSuccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceDeleteOnUnlinkSuccessType.self, json: json) } } } /// Failed to link device. - open class DeviceLinkFailDetails: CustomStringConvertible { + public class DeviceLinkFailDetails: CustomStringConvertible, JSONRepresentable { /// IP address. Might be missing due to historical data gap. public let ipAddress: String? /// A description of the device used while user approval blocked. @@ -6051,235 +7876,317 @@ open class TeamLog { self.ipAddress = ipAddress self.deviceType = deviceType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceLinkFailDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceLinkFailDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceLinkFailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceLinkFailDetails: \(error)" + } } } - open class DeviceLinkFailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceLinkFailDetails) -> JSON { - let output = [ - "device_type": TeamLog.DeviceTypeSerializer().serialize(value.deviceType), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + + public class DeviceLinkFailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceLinkFailDetails) throws -> JSON { + let output = [ + "device_type": try TeamLog.DeviceTypeSerializer().serialize(value.deviceType), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceLinkFailDetails { + + public func deserialize(_ json: JSON) throws -> DeviceLinkFailDetails { switch json { - case .dictionary(let dict): - let deviceType = TeamLog.DeviceTypeSerializer().deserialize(dict["device_type"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - return DeviceLinkFailDetails(deviceType: deviceType, ipAddress: ipAddress) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let deviceType = try TeamLog.DeviceTypeSerializer().deserialize(dict["device_type"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + return DeviceLinkFailDetails(deviceType: deviceType, ipAddress: ipAddress) + default: + throw JSONSerializerError.deserializeError(type: DeviceLinkFailDetails.self, json: json) } } } /// The DeviceLinkFailType struct - open class DeviceLinkFailType: CustomStringConvertible { + public class DeviceLinkFailType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceLinkFailTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceLinkFailTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceLinkFailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceLinkFailType: \(error)" + } } } - open class DeviceLinkFailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceLinkFailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceLinkFailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceLinkFailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceLinkFailType { + + public func deserialize(_ json: JSON) throws -> DeviceLinkFailType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceLinkFailType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceLinkFailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceLinkFailType.self, json: json) } } } /// Linked device. - open class DeviceLinkSuccessDetails: CustomStringConvertible { + public class DeviceLinkSuccessDetails: CustomStringConvertible, JSONRepresentable { /// Device's session logged information. public let deviceSessionInfo: TeamLog.DeviceSessionLogInfo? public init(deviceSessionInfo: TeamLog.DeviceSessionLogInfo? = nil) { self.deviceSessionInfo = deviceSessionInfo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceLinkSuccessDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceLinkSuccessDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceLinkSuccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceLinkSuccessDetails: \(error)" + } } } - open class DeviceLinkSuccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceLinkSuccessDetails) -> JSON { - let output = [ - "device_session_info": NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).serialize(value.deviceSessionInfo), + + public class DeviceLinkSuccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceLinkSuccessDetails) throws -> JSON { + let output = [ + "device_session_info": try NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).serialize(value.deviceSessionInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceLinkSuccessDetails { + + public func deserialize(_ json: JSON) throws -> DeviceLinkSuccessDetails { switch json { - case .dictionary(let dict): - let deviceSessionInfo = NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).deserialize(dict["device_session_info"] ?? .null) - return DeviceLinkSuccessDetails(deviceSessionInfo: deviceSessionInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let deviceSessionInfo = try NullableSerializer(TeamLog.DeviceSessionLogInfoSerializer()).deserialize(dict["device_session_info"] ?? .null) + return DeviceLinkSuccessDetails(deviceSessionInfo: deviceSessionInfo) + default: + throw JSONSerializerError.deserializeError(type: DeviceLinkSuccessDetails.self, json: json) } } } /// The DeviceLinkSuccessType struct - open class DeviceLinkSuccessType: CustomStringConvertible { + public class DeviceLinkSuccessType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceLinkSuccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceLinkSuccessTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceLinkSuccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceLinkSuccessType: \(error)" + } } } - open class DeviceLinkSuccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceLinkSuccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceLinkSuccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceLinkSuccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceLinkSuccessType { + + public func deserialize(_ json: JSON) throws -> DeviceLinkSuccessType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceLinkSuccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceLinkSuccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceLinkSuccessType.self, json: json) } } } /// Disabled device management. - open class DeviceManagementDisabledDetails: CustomStringConvertible { - public init() { + public class DeviceManagementDisabledDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DeviceManagementDisabledDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceManagementDisabledDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceManagementDisabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceManagementDisabledDetails: \(error)" + } } } - open class DeviceManagementDisabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceManagementDisabledDetails) -> JSON { + + public class DeviceManagementDisabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceManagementDisabledDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceManagementDisabledDetails { + + public func deserialize(_ json: JSON) throws -> DeviceManagementDisabledDetails { switch json { - case .dictionary(_): - return DeviceManagementDisabledDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DeviceManagementDisabledDetails() + default: + throw JSONSerializerError.deserializeError(type: DeviceManagementDisabledDetails.self, json: json) } } } /// The DeviceManagementDisabledType struct - open class DeviceManagementDisabledType: CustomStringConvertible { + public class DeviceManagementDisabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceManagementDisabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceManagementDisabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceManagementDisabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceManagementDisabledType: \(error)" + } } } - open class DeviceManagementDisabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceManagementDisabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceManagementDisabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceManagementDisabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceManagementDisabledType { + + public func deserialize(_ json: JSON) throws -> DeviceManagementDisabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceManagementDisabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceManagementDisabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceManagementDisabledType.self, json: json) } } } /// Enabled device management. - open class DeviceManagementEnabledDetails: CustomStringConvertible { - public init() { + public class DeviceManagementEnabledDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DeviceManagementEnabledDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceManagementEnabledDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceManagementEnabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceManagementEnabledDetails: \(error)" + } } } - open class DeviceManagementEnabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceManagementEnabledDetails) -> JSON { + + public class DeviceManagementEnabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceManagementEnabledDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceManagementEnabledDetails { + + public func deserialize(_ json: JSON) throws -> DeviceManagementEnabledDetails { switch json { - case .dictionary(_): - return DeviceManagementEnabledDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DeviceManagementEnabledDetails() + default: + throw JSONSerializerError.deserializeError(type: DeviceManagementEnabledDetails.self, json: json) } } } /// The DeviceManagementEnabledType struct - open class DeviceManagementEnabledType: CustomStringConvertible { + public class DeviceManagementEnabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceManagementEnabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceManagementEnabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceManagementEnabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceManagementEnabledType: \(error)" + } } } - open class DeviceManagementEnabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceManagementEnabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceManagementEnabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceManagementEnabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceManagementEnabledType { + + public func deserialize(_ json: JSON) throws -> DeviceManagementEnabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceManagementEnabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceManagementEnabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceManagementEnabledType.self, json: json) } } } /// Enabled/disabled backup for computer. - open class DeviceSyncBackupStatusChangedDetails: CustomStringConvertible { + public class DeviceSyncBackupStatusChangedDetails: CustomStringConvertible, JSONRepresentable { /// Device's session logged information. public let desktopDeviceSessionInfo: TeamLog.DesktopDeviceSessionLogInfo /// Previous status of computer backup on the device. @@ -6291,66 +8198,92 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceSyncBackupStatusChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceSyncBackupStatusChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceSyncBackupStatusChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceSyncBackupStatusChangedDetails: \(error)" + } } } - open class DeviceSyncBackupStatusChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceSyncBackupStatusChangedDetails) -> JSON { - let output = [ - "desktop_device_session_info": TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(value.desktopDeviceSessionInfo), - "previous_value": TeamLog.BackupStatusSerializer().serialize(value.previousValue), - "new_value": TeamLog.BackupStatusSerializer().serialize(value.newValue), + + public class DeviceSyncBackupStatusChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceSyncBackupStatusChangedDetails) throws -> JSON { + let output = [ + "desktop_device_session_info": try TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(value.desktopDeviceSessionInfo), + "previous_value": try TeamLog.BackupStatusSerializer().serialize(value.previousValue), + "new_value": try TeamLog.BackupStatusSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceSyncBackupStatusChangedDetails { + + public func deserialize(_ json: JSON) throws -> DeviceSyncBackupStatusChangedDetails { switch json { - case .dictionary(let dict): - let desktopDeviceSessionInfo = TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(dict["desktop_device_session_info"] ?? .null) - let previousValue = TeamLog.BackupStatusSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.BackupStatusSerializer().deserialize(dict["new_value"] ?? .null) - return DeviceSyncBackupStatusChangedDetails(desktopDeviceSessionInfo: desktopDeviceSessionInfo, previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let desktopDeviceSessionInfo = try TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(dict["desktop_device_session_info"] ?? .null) + let previousValue = try TeamLog.BackupStatusSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.BackupStatusSerializer().deserialize(dict["new_value"] ?? .null) + return DeviceSyncBackupStatusChangedDetails( + desktopDeviceSessionInfo: desktopDeviceSessionInfo, + previousValue: previousValue, + newValue: newValue + ) + default: + throw JSONSerializerError.deserializeError(type: DeviceSyncBackupStatusChangedDetails.self, json: json) } } } /// The DeviceSyncBackupStatusChangedType struct - open class DeviceSyncBackupStatusChangedType: CustomStringConvertible { + public class DeviceSyncBackupStatusChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceSyncBackupStatusChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceSyncBackupStatusChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceSyncBackupStatusChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceSyncBackupStatusChangedType: \(error)" + } } } - open class DeviceSyncBackupStatusChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceSyncBackupStatusChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceSyncBackupStatusChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceSyncBackupStatusChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceSyncBackupStatusChangedType { + + public func deserialize(_ json: JSON) throws -> DeviceSyncBackupStatusChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceSyncBackupStatusChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceSyncBackupStatusChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceSyncBackupStatusChangedType.self, json: json) } } } /// The DeviceType union - public enum DeviceType: CustomStringConvertible { + public enum DeviceType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case desktop /// An unspecified error. @@ -6358,50 +8291,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try DeviceTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceType: \(error)" + } } } - open class DeviceTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceType) -> JSON { + + public class DeviceTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceType) throws -> JSON { switch value { - case .desktop: - var d = [String: JSON]() - d[".tag"] = .str("desktop") - return .dictionary(d) - case .mobile: - var d = [String: JSON]() - d[".tag"] = .str("mobile") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeviceType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "desktop": - return DeviceType.desktop - case "mobile": - return DeviceType.mobile - case "other": - return DeviceType.other - default: - return DeviceType.other - } + case .desktop: + var d = [String: JSON]() + d[".tag"] = .str("desktop") + return .dictionary(d) + case .mobile: + var d = [String: JSON]() + d[".tag"] = .str("mobile") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeviceType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "desktop": + return DeviceType.desktop + case "mobile": + return DeviceType.mobile + case "other": + return DeviceType.other default: - fatalError("Failed to deserialize") + return DeviceType.other + } + default: + throw JSONSerializerError.deserializeError(type: DeviceType.self, json: json) } } } /// Disconnected device. - open class DeviceUnlinkDetails: CustomStringConvertible { + public class DeviceUnlinkDetails: CustomStringConvertible, JSONRepresentable { /// Session unique id. public let sessionInfo: TeamLog.SessionLogInfo? /// The device name. Might be missing due to historical data gap. @@ -6414,35 +8357,46 @@ open class TeamLog { self.displayName = displayName self.deleteData = deleteData } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceUnlinkDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceUnlinkDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceUnlinkDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceUnlinkDetails: \(error)" + } } } - open class DeviceUnlinkDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceUnlinkDetails) -> JSON { - let output = [ - "delete_data": Serialization._BoolSerializer.serialize(value.deleteData), - "session_info": NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + + public class DeviceUnlinkDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceUnlinkDetails) throws -> JSON { + let output = [ + "delete_data": try Serialization._BoolSerializer.serialize(value.deleteData), + "session_info": try NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceUnlinkDetails { + + public func deserialize(_ json: JSON) throws -> DeviceUnlinkDetails { switch json { - case .dictionary(let dict): - let deleteData = Serialization._BoolSerializer.deserialize(dict["delete_data"] ?? .null) - let sessionInfo = NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - return DeviceUnlinkDetails(deleteData: deleteData, sessionInfo: sessionInfo, displayName: displayName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let deleteData = try Serialization._BoolSerializer.deserialize(dict["delete_data"] ?? .null) + let sessionInfo = try NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + return DeviceUnlinkDetails(deleteData: deleteData, sessionInfo: sessionInfo, displayName: displayName) + default: + throw JSONSerializerError.deserializeError(type: DeviceUnlinkDetails.self, json: json) } } } /// The DeviceUnlinkPolicy union - public enum DeviceUnlinkPolicy: CustomStringConvertible { + public enum DeviceUnlinkPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case keep /// An unspecified error. @@ -6450,246 +8404,324 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try DeviceUnlinkPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceUnlinkPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceUnlinkPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceUnlinkPolicy: \(error)" + } } } - open class DeviceUnlinkPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceUnlinkPolicy) -> JSON { + + public class DeviceUnlinkPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceUnlinkPolicy) throws -> JSON { switch value { - case .keep: - var d = [String: JSON]() - d[".tag"] = .str("keep") - return .dictionary(d) - case .remove: - var d = [String: JSON]() - d[".tag"] = .str("remove") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DeviceUnlinkPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "keep": - return DeviceUnlinkPolicy.keep - case "remove": - return DeviceUnlinkPolicy.remove - case "other": - return DeviceUnlinkPolicy.other - default: - return DeviceUnlinkPolicy.other - } + case .keep: + var d = [String: JSON]() + d[".tag"] = .str("keep") + return .dictionary(d) + case .remove: + var d = [String: JSON]() + d[".tag"] = .str("remove") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DeviceUnlinkPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "keep": + return DeviceUnlinkPolicy.keep + case "remove": + return DeviceUnlinkPolicy.remove + case "other": + return DeviceUnlinkPolicy.other default: - fatalError("Failed to deserialize") + return DeviceUnlinkPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: DeviceUnlinkPolicy.self, json: json) } } } /// The DeviceUnlinkType struct - open class DeviceUnlinkType: CustomStringConvertible { + public class DeviceUnlinkType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DeviceUnlinkTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DeviceUnlinkTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DeviceUnlinkTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DeviceUnlinkType: \(error)" + } } } - open class DeviceUnlinkTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DeviceUnlinkType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DeviceUnlinkTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DeviceUnlinkType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DeviceUnlinkType { + + public func deserialize(_ json: JSON) throws -> DeviceUnlinkType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DeviceUnlinkType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DeviceUnlinkType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DeviceUnlinkType.self, json: json) } } } /// Added members to directory restrictions list. - open class DirectoryRestrictionsAddMembersDetails: CustomStringConvertible { - public init() { + public class DirectoryRestrictionsAddMembersDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DirectoryRestrictionsAddMembersDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DirectoryRestrictionsAddMembersDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DirectoryRestrictionsAddMembersDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DirectoryRestrictionsAddMembersDetails: \(error)" + } } } - open class DirectoryRestrictionsAddMembersDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DirectoryRestrictionsAddMembersDetails) -> JSON { + + public class DirectoryRestrictionsAddMembersDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DirectoryRestrictionsAddMembersDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DirectoryRestrictionsAddMembersDetails { + + public func deserialize(_ json: JSON) throws -> DirectoryRestrictionsAddMembersDetails { switch json { - case .dictionary(_): - return DirectoryRestrictionsAddMembersDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DirectoryRestrictionsAddMembersDetails() + default: + throw JSONSerializerError.deserializeError(type: DirectoryRestrictionsAddMembersDetails.self, json: json) } } } /// The DirectoryRestrictionsAddMembersType struct - open class DirectoryRestrictionsAddMembersType: CustomStringConvertible { + public class DirectoryRestrictionsAddMembersType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DirectoryRestrictionsAddMembersTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DirectoryRestrictionsAddMembersTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DirectoryRestrictionsAddMembersTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DirectoryRestrictionsAddMembersType: \(error)" + } } } - open class DirectoryRestrictionsAddMembersTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DirectoryRestrictionsAddMembersType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DirectoryRestrictionsAddMembersTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DirectoryRestrictionsAddMembersType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DirectoryRestrictionsAddMembersType { + + public func deserialize(_ json: JSON) throws -> DirectoryRestrictionsAddMembersType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DirectoryRestrictionsAddMembersType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DirectoryRestrictionsAddMembersType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DirectoryRestrictionsAddMembersType.self, json: json) } } } /// Removed members from directory restrictions list. - open class DirectoryRestrictionsRemoveMembersDetails: CustomStringConvertible { - public init() { + public class DirectoryRestrictionsRemoveMembersDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DirectoryRestrictionsRemoveMembersDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DirectoryRestrictionsRemoveMembersDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DirectoryRestrictionsRemoveMembersDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DirectoryRestrictionsRemoveMembersDetails: \(error)" + } } } - open class DirectoryRestrictionsRemoveMembersDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DirectoryRestrictionsRemoveMembersDetails) -> JSON { + + public class DirectoryRestrictionsRemoveMembersDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DirectoryRestrictionsRemoveMembersDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DirectoryRestrictionsRemoveMembersDetails { + + public func deserialize(_ json: JSON) throws -> DirectoryRestrictionsRemoveMembersDetails { switch json { - case .dictionary(_): - return DirectoryRestrictionsRemoveMembersDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DirectoryRestrictionsRemoveMembersDetails() + default: + throw JSONSerializerError.deserializeError(type: DirectoryRestrictionsRemoveMembersDetails.self, json: json) } } } /// The DirectoryRestrictionsRemoveMembersType struct - open class DirectoryRestrictionsRemoveMembersType: CustomStringConvertible { + public class DirectoryRestrictionsRemoveMembersType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DirectoryRestrictionsRemoveMembersTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DirectoryRestrictionsRemoveMembersTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DirectoryRestrictionsRemoveMembersTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DirectoryRestrictionsRemoveMembersType: \(error)" + } } } - open class DirectoryRestrictionsRemoveMembersTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DirectoryRestrictionsRemoveMembersType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DirectoryRestrictionsRemoveMembersTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DirectoryRestrictionsRemoveMembersType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DirectoryRestrictionsRemoveMembersType { + + public func deserialize(_ json: JSON) throws -> DirectoryRestrictionsRemoveMembersType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DirectoryRestrictionsRemoveMembersType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DirectoryRestrictionsRemoveMembersType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DirectoryRestrictionsRemoveMembersType.self, json: json) } } } /// Disabled domain invites. - open class DisabledDomainInvitesDetails: CustomStringConvertible { - public init() { + public class DisabledDomainInvitesDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DisabledDomainInvitesDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DisabledDomainInvitesDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DisabledDomainInvitesDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DisabledDomainInvitesDetails: \(error)" + } } } - open class DisabledDomainInvitesDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DisabledDomainInvitesDetails) -> JSON { + + public class DisabledDomainInvitesDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DisabledDomainInvitesDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DisabledDomainInvitesDetails { + + public func deserialize(_ json: JSON) throws -> DisabledDomainInvitesDetails { switch json { - case .dictionary(_): - return DisabledDomainInvitesDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DisabledDomainInvitesDetails() + default: + throw JSONSerializerError.deserializeError(type: DisabledDomainInvitesDetails.self, json: json) } } } /// The DisabledDomainInvitesType struct - open class DisabledDomainInvitesType: CustomStringConvertible { + public class DisabledDomainInvitesType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DisabledDomainInvitesTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DisabledDomainInvitesTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DisabledDomainInvitesTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DisabledDomainInvitesType: \(error)" + } } } - open class DisabledDomainInvitesTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DisabledDomainInvitesType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DisabledDomainInvitesTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DisabledDomainInvitesType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DisabledDomainInvitesType { + + public func deserialize(_ json: JSON) throws -> DisabledDomainInvitesType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DisabledDomainInvitesType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DisabledDomainInvitesType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DisabledDomainInvitesType.self, json: json) } } } /// The DispositionActionType union - public enum DispositionActionType: CustomStringConvertible { + public enum DispositionActionType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case automaticDelete /// An unspecified error. @@ -6697,160 +8729,208 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try DispositionActionTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DispositionActionTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DispositionActionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DispositionActionType: \(error)" + } } } - open class DispositionActionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DispositionActionType) -> JSON { + + public class DispositionActionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DispositionActionType) throws -> JSON { switch value { - case .automaticDelete: - var d = [String: JSON]() - d[".tag"] = .str("automatic_delete") - return .dictionary(d) - case .automaticPermanentlyDelete: - var d = [String: JSON]() - d[".tag"] = .str("automatic_permanently_delete") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DispositionActionType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "automatic_delete": - return DispositionActionType.automaticDelete - case "automatic_permanently_delete": - return DispositionActionType.automaticPermanentlyDelete - case "other": - return DispositionActionType.other - default: - return DispositionActionType.other - } + case .automaticDelete: + var d = [String: JSON]() + d[".tag"] = .str("automatic_delete") + return .dictionary(d) + case .automaticPermanentlyDelete: + var d = [String: JSON]() + d[".tag"] = .str("automatic_permanently_delete") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DispositionActionType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "automatic_delete": + return DispositionActionType.automaticDelete + case "automatic_permanently_delete": + return DispositionActionType.automaticPermanentlyDelete + case "other": + return DispositionActionType.other default: - fatalError("Failed to deserialize") + return DispositionActionType.other + } + default: + throw JSONSerializerError.deserializeError(type: DispositionActionType.self, json: json) } } } /// Approved user's request to join team. - open class DomainInvitesApproveRequestToJoinTeamDetails: CustomStringConvertible { - public init() { + public class DomainInvitesApproveRequestToJoinTeamDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DomainInvitesApproveRequestToJoinTeamDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesApproveRequestToJoinTeamDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesApproveRequestToJoinTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesApproveRequestToJoinTeamDetails: \(error)" + } } } - open class DomainInvitesApproveRequestToJoinTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesApproveRequestToJoinTeamDetails) -> JSON { + + public class DomainInvitesApproveRequestToJoinTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesApproveRequestToJoinTeamDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesApproveRequestToJoinTeamDetails { + + public func deserialize(_ json: JSON) throws -> DomainInvitesApproveRequestToJoinTeamDetails { switch json { - case .dictionary(_): - return DomainInvitesApproveRequestToJoinTeamDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DomainInvitesApproveRequestToJoinTeamDetails() + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesApproveRequestToJoinTeamDetails.self, json: json) } } } /// The DomainInvitesApproveRequestToJoinTeamType struct - open class DomainInvitesApproveRequestToJoinTeamType: CustomStringConvertible { + public class DomainInvitesApproveRequestToJoinTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesApproveRequestToJoinTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainInvitesApproveRequestToJoinTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesApproveRequestToJoinTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesApproveRequestToJoinTeamType: \(error)" + } } } - open class DomainInvitesApproveRequestToJoinTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesApproveRequestToJoinTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainInvitesApproveRequestToJoinTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesApproveRequestToJoinTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesApproveRequestToJoinTeamType { + + public func deserialize(_ json: JSON) throws -> DomainInvitesApproveRequestToJoinTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainInvitesApproveRequestToJoinTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainInvitesApproveRequestToJoinTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesApproveRequestToJoinTeamType.self, json: json) } } } /// Declined user's request to join team. - open class DomainInvitesDeclineRequestToJoinTeamDetails: CustomStringConvertible { - public init() { + public class DomainInvitesDeclineRequestToJoinTeamDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DomainInvitesDeclineRequestToJoinTeamDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesDeclineRequestToJoinTeamDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesDeclineRequestToJoinTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesDeclineRequestToJoinTeamDetails: \(error)" + } } } - open class DomainInvitesDeclineRequestToJoinTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesDeclineRequestToJoinTeamDetails) -> JSON { + + public class DomainInvitesDeclineRequestToJoinTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesDeclineRequestToJoinTeamDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesDeclineRequestToJoinTeamDetails { + + public func deserialize(_ json: JSON) throws -> DomainInvitesDeclineRequestToJoinTeamDetails { switch json { - case .dictionary(_): - return DomainInvitesDeclineRequestToJoinTeamDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DomainInvitesDeclineRequestToJoinTeamDetails() + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesDeclineRequestToJoinTeamDetails.self, json: json) } } } /// The DomainInvitesDeclineRequestToJoinTeamType struct - open class DomainInvitesDeclineRequestToJoinTeamType: CustomStringConvertible { + public class DomainInvitesDeclineRequestToJoinTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesDeclineRequestToJoinTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainInvitesDeclineRequestToJoinTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesDeclineRequestToJoinTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesDeclineRequestToJoinTeamType: \(error)" + } } } - open class DomainInvitesDeclineRequestToJoinTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesDeclineRequestToJoinTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainInvitesDeclineRequestToJoinTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesDeclineRequestToJoinTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesDeclineRequestToJoinTeamType { + + public func deserialize(_ json: JSON) throws -> DomainInvitesDeclineRequestToJoinTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainInvitesDeclineRequestToJoinTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainInvitesDeclineRequestToJoinTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesDeclineRequestToJoinTeamType.self, json: json) } } } /// Sent domain invites to existing domain accounts. - open class DomainInvitesEmailExistingUsersDetails: CustomStringConvertible { + public class DomainInvitesEmailExistingUsersDetails: CustomStringConvertible, JSONRepresentable { /// Domain names. public let domainName: String /// Number of recipients. @@ -6861,229 +8941,308 @@ open class TeamLog { comparableValidator()(numRecipients) self.numRecipients = numRecipients } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesEmailExistingUsersDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainInvitesEmailExistingUsersDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesEmailExistingUsersDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesEmailExistingUsersDetails: \(error)" + } } } - open class DomainInvitesEmailExistingUsersDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesEmailExistingUsersDetails) -> JSON { - let output = [ - "domain_name": Serialization._StringSerializer.serialize(value.domainName), - "num_recipients": Serialization._UInt64Serializer.serialize(value.numRecipients), + + public class DomainInvitesEmailExistingUsersDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesEmailExistingUsersDetails) throws -> JSON { + let output = [ + "domain_name": try Serialization._StringSerializer.serialize(value.domainName), + "num_recipients": try Serialization._UInt64Serializer.serialize(value.numRecipients), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesEmailExistingUsersDetails { + + public func deserialize(_ json: JSON) throws -> DomainInvitesEmailExistingUsersDetails { switch json { - case .dictionary(let dict): - let domainName = Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) - let numRecipients = Serialization._UInt64Serializer.deserialize(dict["num_recipients"] ?? .null) - return DomainInvitesEmailExistingUsersDetails(domainName: domainName, numRecipients: numRecipients) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domainName = try Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) + let numRecipients = try Serialization._UInt64Serializer.deserialize(dict["num_recipients"] ?? .null) + return DomainInvitesEmailExistingUsersDetails(domainName: domainName, numRecipients: numRecipients) + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesEmailExistingUsersDetails.self, json: json) } } } /// The DomainInvitesEmailExistingUsersType struct - open class DomainInvitesEmailExistingUsersType: CustomStringConvertible { + public class DomainInvitesEmailExistingUsersType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesEmailExistingUsersTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainInvitesEmailExistingUsersTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesEmailExistingUsersTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesEmailExistingUsersType: \(error)" + } } } - open class DomainInvitesEmailExistingUsersTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesEmailExistingUsersType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainInvitesEmailExistingUsersTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesEmailExistingUsersType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesEmailExistingUsersType { + + public func deserialize(_ json: JSON) throws -> DomainInvitesEmailExistingUsersType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainInvitesEmailExistingUsersType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainInvitesEmailExistingUsersType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesEmailExistingUsersType.self, json: json) } } } /// Requested to join team. - open class DomainInvitesRequestToJoinTeamDetails: CustomStringConvertible { - public init() { + public class DomainInvitesRequestToJoinTeamDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DomainInvitesRequestToJoinTeamDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesRequestToJoinTeamDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesRequestToJoinTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesRequestToJoinTeamDetails: \(error)" + } } } - open class DomainInvitesRequestToJoinTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesRequestToJoinTeamDetails) -> JSON { + + public class DomainInvitesRequestToJoinTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesRequestToJoinTeamDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesRequestToJoinTeamDetails { + + public func deserialize(_ json: JSON) throws -> DomainInvitesRequestToJoinTeamDetails { switch json { - case .dictionary(_): - return DomainInvitesRequestToJoinTeamDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DomainInvitesRequestToJoinTeamDetails() + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesRequestToJoinTeamDetails.self, json: json) } } } /// The DomainInvitesRequestToJoinTeamType struct - open class DomainInvitesRequestToJoinTeamType: CustomStringConvertible { + public class DomainInvitesRequestToJoinTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesRequestToJoinTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainInvitesRequestToJoinTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesRequestToJoinTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesRequestToJoinTeamType: \(error)" + } } } - open class DomainInvitesRequestToJoinTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesRequestToJoinTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainInvitesRequestToJoinTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesRequestToJoinTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesRequestToJoinTeamType { + + public func deserialize(_ json: JSON) throws -> DomainInvitesRequestToJoinTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainInvitesRequestToJoinTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainInvitesRequestToJoinTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesRequestToJoinTeamType.self, json: json) } } } /// Disabled "Automatically invite new users". - open class DomainInvitesSetInviteNewUserPrefToNoDetails: CustomStringConvertible { - public init() { + public class DomainInvitesSetInviteNewUserPrefToNoDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesSetInviteNewUserPrefToNoDetails: \(error)" + } } } - open class DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesSetInviteNewUserPrefToNoDetails) -> JSON { + + public class DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesSetInviteNewUserPrefToNoDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesSetInviteNewUserPrefToNoDetails { + + public func deserialize(_ json: JSON) throws -> DomainInvitesSetInviteNewUserPrefToNoDetails { switch json { - case .dictionary(_): - return DomainInvitesSetInviteNewUserPrefToNoDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DomainInvitesSetInviteNewUserPrefToNoDetails() + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesSetInviteNewUserPrefToNoDetails.self, json: json) } } } /// The DomainInvitesSetInviteNewUserPrefToNoType struct - open class DomainInvitesSetInviteNewUserPrefToNoType: CustomStringConvertible { + public class DomainInvitesSetInviteNewUserPrefToNoType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesSetInviteNewUserPrefToNoTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainInvitesSetInviteNewUserPrefToNoTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesSetInviteNewUserPrefToNoTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesSetInviteNewUserPrefToNoType: \(error)" + } } } - open class DomainInvitesSetInviteNewUserPrefToNoTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesSetInviteNewUserPrefToNoType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainInvitesSetInviteNewUserPrefToNoTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesSetInviteNewUserPrefToNoType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesSetInviteNewUserPrefToNoType { + + public func deserialize(_ json: JSON) throws -> DomainInvitesSetInviteNewUserPrefToNoType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainInvitesSetInviteNewUserPrefToNoType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainInvitesSetInviteNewUserPrefToNoType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesSetInviteNewUserPrefToNoType.self, json: json) } } } /// Enabled "Automatically invite new users". - open class DomainInvitesSetInviteNewUserPrefToYesDetails: CustomStringConvertible { - public init() { + public class DomainInvitesSetInviteNewUserPrefToYesDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesSetInviteNewUserPrefToYesDetails: \(error)" + } } } - open class DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesSetInviteNewUserPrefToYesDetails) -> JSON { + + public class DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesSetInviteNewUserPrefToYesDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesSetInviteNewUserPrefToYesDetails { + + public func deserialize(_ json: JSON) throws -> DomainInvitesSetInviteNewUserPrefToYesDetails { switch json { - case .dictionary(_): - return DomainInvitesSetInviteNewUserPrefToYesDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return DomainInvitesSetInviteNewUserPrefToYesDetails() + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesSetInviteNewUserPrefToYesDetails.self, json: json) } } } /// The DomainInvitesSetInviteNewUserPrefToYesType struct - open class DomainInvitesSetInviteNewUserPrefToYesType: CustomStringConvertible { + public class DomainInvitesSetInviteNewUserPrefToYesType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainInvitesSetInviteNewUserPrefToYesTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainInvitesSetInviteNewUserPrefToYesTypeSerializer().serialize(self) } - } - open class DomainInvitesSetInviteNewUserPrefToYesTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainInvitesSetInviteNewUserPrefToYesType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainInvitesSetInviteNewUserPrefToYesTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainInvitesSetInviteNewUserPrefToYesType: \(error)" + } + } + } + + public class DomainInvitesSetInviteNewUserPrefToYesTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainInvitesSetInviteNewUserPrefToYesType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainInvitesSetInviteNewUserPrefToYesType { + + public func deserialize(_ json: JSON) throws -> DomainInvitesSetInviteNewUserPrefToYesType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainInvitesSetInviteNewUserPrefToYesType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainInvitesSetInviteNewUserPrefToYesType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainInvitesSetInviteNewUserPrefToYesType.self, json: json) } } } /// Failed to verify team domain. - open class DomainVerificationAddDomainFailDetails: CustomStringConvertible { + public class DomainVerificationAddDomainFailDetails: CustomStringConvertible, JSONRepresentable { /// Domain name. public let domainName: String /// Domain name verification method. Might be missing due to historical data gap. @@ -7094,194 +9253,260 @@ open class TeamLog { nullableValidator(stringValidator())(verificationMethod) self.verificationMethod = verificationMethod } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainVerificationAddDomainFailDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainVerificationAddDomainFailDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainVerificationAddDomainFailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainVerificationAddDomainFailDetails: \(error)" + } } } - open class DomainVerificationAddDomainFailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainVerificationAddDomainFailDetails) -> JSON { - let output = [ - "domain_name": Serialization._StringSerializer.serialize(value.domainName), - "verification_method": NullableSerializer(Serialization._StringSerializer).serialize(value.verificationMethod), + + public class DomainVerificationAddDomainFailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainVerificationAddDomainFailDetails) throws -> JSON { + let output = [ + "domain_name": try Serialization._StringSerializer.serialize(value.domainName), + "verification_method": try NullableSerializer(Serialization._StringSerializer).serialize(value.verificationMethod), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainVerificationAddDomainFailDetails { + + public func deserialize(_ json: JSON) throws -> DomainVerificationAddDomainFailDetails { switch json { - case .dictionary(let dict): - let domainName = Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) - let verificationMethod = NullableSerializer(Serialization._StringSerializer).deserialize(dict["verification_method"] ?? .null) - return DomainVerificationAddDomainFailDetails(domainName: domainName, verificationMethod: verificationMethod) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domainName = try Serialization._StringSerializer.deserialize(dict["domain_name"] ?? .null) + let verificationMethod = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["verification_method"] ?? .null) + return DomainVerificationAddDomainFailDetails(domainName: domainName, verificationMethod: verificationMethod) + default: + throw JSONSerializerError.deserializeError(type: DomainVerificationAddDomainFailDetails.self, json: json) } } } /// The DomainVerificationAddDomainFailType struct - open class DomainVerificationAddDomainFailType: CustomStringConvertible { + public class DomainVerificationAddDomainFailType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainVerificationAddDomainFailTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainVerificationAddDomainFailTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainVerificationAddDomainFailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainVerificationAddDomainFailType: \(error)" + } } } - open class DomainVerificationAddDomainFailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainVerificationAddDomainFailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainVerificationAddDomainFailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainVerificationAddDomainFailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainVerificationAddDomainFailType { + + public func deserialize(_ json: JSON) throws -> DomainVerificationAddDomainFailType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainVerificationAddDomainFailType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainVerificationAddDomainFailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainVerificationAddDomainFailType.self, json: json) } } } /// Verified team domain. - open class DomainVerificationAddDomainSuccessDetails: CustomStringConvertible { + public class DomainVerificationAddDomainSuccessDetails: CustomStringConvertible, JSONRepresentable { /// Domain names. - public let domainNames: Array + public let domainNames: [String] /// Domain name verification method. Might be missing due to historical data gap. public let verificationMethod: String? - public init(domainNames: Array, verificationMethod: String? = nil) { + public init(domainNames: [String], verificationMethod: String? = nil) { arrayValidator(itemValidator: stringValidator())(domainNames) self.domainNames = domainNames nullableValidator(stringValidator())(verificationMethod) self.verificationMethod = verificationMethod } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainVerificationAddDomainSuccessDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainVerificationAddDomainSuccessDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainVerificationAddDomainSuccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainVerificationAddDomainSuccessDetails: \(error)" + } } } - open class DomainVerificationAddDomainSuccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainVerificationAddDomainSuccessDetails) -> JSON { - let output = [ - "domain_names": ArraySerializer(Serialization._StringSerializer).serialize(value.domainNames), - "verification_method": NullableSerializer(Serialization._StringSerializer).serialize(value.verificationMethod), + + public class DomainVerificationAddDomainSuccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainVerificationAddDomainSuccessDetails) throws -> JSON { + let output = [ + "domain_names": try ArraySerializer(Serialization._StringSerializer).serialize(value.domainNames), + "verification_method": try NullableSerializer(Serialization._StringSerializer).serialize(value.verificationMethod), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainVerificationAddDomainSuccessDetails { + + public func deserialize(_ json: JSON) throws -> DomainVerificationAddDomainSuccessDetails { switch json { - case .dictionary(let dict): - let domainNames = ArraySerializer(Serialization._StringSerializer).deserialize(dict["domain_names"] ?? .null) - let verificationMethod = NullableSerializer(Serialization._StringSerializer).deserialize(dict["verification_method"] ?? .null) - return DomainVerificationAddDomainSuccessDetails(domainNames: domainNames, verificationMethod: verificationMethod) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domainNames = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["domain_names"] ?? .null) + let verificationMethod = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["verification_method"] ?? .null) + return DomainVerificationAddDomainSuccessDetails(domainNames: domainNames, verificationMethod: verificationMethod) + default: + throw JSONSerializerError.deserializeError(type: DomainVerificationAddDomainSuccessDetails.self, json: json) } } } /// The DomainVerificationAddDomainSuccessType struct - open class DomainVerificationAddDomainSuccessType: CustomStringConvertible { + public class DomainVerificationAddDomainSuccessType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainVerificationAddDomainSuccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainVerificationAddDomainSuccessTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainVerificationAddDomainSuccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainVerificationAddDomainSuccessType: \(error)" + } } } - open class DomainVerificationAddDomainSuccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainVerificationAddDomainSuccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainVerificationAddDomainSuccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainVerificationAddDomainSuccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainVerificationAddDomainSuccessType { + + public func deserialize(_ json: JSON) throws -> DomainVerificationAddDomainSuccessType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainVerificationAddDomainSuccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainVerificationAddDomainSuccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainVerificationAddDomainSuccessType.self, json: json) } } } /// Removed domain from list of verified team domains. - open class DomainVerificationRemoveDomainDetails: CustomStringConvertible { + public class DomainVerificationRemoveDomainDetails: CustomStringConvertible, JSONRepresentable { /// Domain names. - public let domainNames: Array - public init(domainNames: Array) { + public let domainNames: [String] + public init(domainNames: [String]) { arrayValidator(itemValidator: stringValidator())(domainNames) self.domainNames = domainNames } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainVerificationRemoveDomainDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainVerificationRemoveDomainDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainVerificationRemoveDomainDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainVerificationRemoveDomainDetails: \(error)" + } } } - open class DomainVerificationRemoveDomainDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainVerificationRemoveDomainDetails) -> JSON { - let output = [ - "domain_names": ArraySerializer(Serialization._StringSerializer).serialize(value.domainNames), + + public class DomainVerificationRemoveDomainDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainVerificationRemoveDomainDetails) throws -> JSON { + let output = [ + "domain_names": try ArraySerializer(Serialization._StringSerializer).serialize(value.domainNames), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainVerificationRemoveDomainDetails { + + public func deserialize(_ json: JSON) throws -> DomainVerificationRemoveDomainDetails { switch json { - case .dictionary(let dict): - let domainNames = ArraySerializer(Serialization._StringSerializer).deserialize(dict["domain_names"] ?? .null) - return DomainVerificationRemoveDomainDetails(domainNames: domainNames) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let domainNames = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["domain_names"] ?? .null) + return DomainVerificationRemoveDomainDetails(domainNames: domainNames) + default: + throw JSONSerializerError.deserializeError(type: DomainVerificationRemoveDomainDetails.self, json: json) } } } /// The DomainVerificationRemoveDomainType struct - open class DomainVerificationRemoveDomainType: CustomStringConvertible { + public class DomainVerificationRemoveDomainType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DomainVerificationRemoveDomainTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DomainVerificationRemoveDomainTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DomainVerificationRemoveDomainTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DomainVerificationRemoveDomainType: \(error)" + } } } - open class DomainVerificationRemoveDomainTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DomainVerificationRemoveDomainType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DomainVerificationRemoveDomainTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DomainVerificationRemoveDomainType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DomainVerificationRemoveDomainType { + + public func deserialize(_ json: JSON) throws -> DomainVerificationRemoveDomainType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DomainVerificationRemoveDomainType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DomainVerificationRemoveDomainType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DomainVerificationRemoveDomainType.self, json: json) } } } /// Shared content downloads policy - public enum DownloadPolicyType: CustomStringConvertible { + public enum DownloadPolicyType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case allow /// An unspecified error. @@ -7289,112 +9514,144 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try DownloadPolicyTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DownloadPolicyTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DownloadPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DownloadPolicyType: \(error)" + } } } - open class DownloadPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DownloadPolicyType) -> JSON { + + public class DownloadPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DownloadPolicyType) throws -> JSON { switch value { - case .allow: - var d = [String: JSON]() - d[".tag"] = .str("allow") - return .dictionary(d) - case .disallow: - var d = [String: JSON]() - d[".tag"] = .str("disallow") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DownloadPolicyType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "allow": - return DownloadPolicyType.allow - case "disallow": - return DownloadPolicyType.disallow - case "other": - return DownloadPolicyType.other - default: - return DownloadPolicyType.other - } + case .allow: + var d = [String: JSON]() + d[".tag"] = .str("allow") + return .dictionary(d) + case .disallow: + var d = [String: JSON]() + d[".tag"] = .str("disallow") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DownloadPolicyType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "allow": + return DownloadPolicyType.allow + case "disallow": + return DownloadPolicyType.disallow + case "other": + return DownloadPolicyType.other default: - fatalError("Failed to deserialize") + return DownloadPolicyType.other + } + default: + throw JSONSerializerError.deserializeError(type: DownloadPolicyType.self, json: json) } } } /// Exported passwords. - open class DropboxPasswordsExportedDetails: CustomStringConvertible { + public class DropboxPasswordsExportedDetails: CustomStringConvertible, JSONRepresentable { /// The platform the device runs export. public let platform: String public init(platform: String) { stringValidator()(platform) self.platform = platform } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DropboxPasswordsExportedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DropboxPasswordsExportedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DropboxPasswordsExportedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DropboxPasswordsExportedDetails: \(error)" + } } } - open class DropboxPasswordsExportedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DropboxPasswordsExportedDetails) -> JSON { - let output = [ - "platform": Serialization._StringSerializer.serialize(value.platform), + + public class DropboxPasswordsExportedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DropboxPasswordsExportedDetails) throws -> JSON { + let output = [ + "platform": try Serialization._StringSerializer.serialize(value.platform), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DropboxPasswordsExportedDetails { + + public func deserialize(_ json: JSON) throws -> DropboxPasswordsExportedDetails { switch json { - case .dictionary(let dict): - let platform = Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) - return DropboxPasswordsExportedDetails(platform: platform) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let platform = try Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) + return DropboxPasswordsExportedDetails(platform: platform) + default: + throw JSONSerializerError.deserializeError(type: DropboxPasswordsExportedDetails.self, json: json) } } } /// The DropboxPasswordsExportedType struct - open class DropboxPasswordsExportedType: CustomStringConvertible { + public class DropboxPasswordsExportedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DropboxPasswordsExportedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DropboxPasswordsExportedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DropboxPasswordsExportedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DropboxPasswordsExportedType: \(error)" + } } } - open class DropboxPasswordsExportedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DropboxPasswordsExportedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DropboxPasswordsExportedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DropboxPasswordsExportedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DropboxPasswordsExportedType { + + public func deserialize(_ json: JSON) throws -> DropboxPasswordsExportedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DropboxPasswordsExportedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DropboxPasswordsExportedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DropboxPasswordsExportedType.self, json: json) } } } /// Enrolled new Dropbox Passwords device. - open class DropboxPasswordsNewDeviceEnrolledDetails: CustomStringConvertible { + public class DropboxPasswordsNewDeviceEnrolledDetails: CustomStringConvertible, JSONRepresentable { /// Whether it's a first device enrolled. public let isFirstDevice: Bool /// The platform the device is enrolled. @@ -7404,64 +9661,86 @@ open class TeamLog { stringValidator()(platform) self.platform = platform } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DropboxPasswordsNewDeviceEnrolledDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DropboxPasswordsNewDeviceEnrolledDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DropboxPasswordsNewDeviceEnrolledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DropboxPasswordsNewDeviceEnrolledDetails: \(error)" + } } } - open class DropboxPasswordsNewDeviceEnrolledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DropboxPasswordsNewDeviceEnrolledDetails) -> JSON { - let output = [ - "is_first_device": Serialization._BoolSerializer.serialize(value.isFirstDevice), - "platform": Serialization._StringSerializer.serialize(value.platform), + + public class DropboxPasswordsNewDeviceEnrolledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DropboxPasswordsNewDeviceEnrolledDetails) throws -> JSON { + let output = [ + "is_first_device": try Serialization._BoolSerializer.serialize(value.isFirstDevice), + "platform": try Serialization._StringSerializer.serialize(value.platform), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DropboxPasswordsNewDeviceEnrolledDetails { + + public func deserialize(_ json: JSON) throws -> DropboxPasswordsNewDeviceEnrolledDetails { switch json { - case .dictionary(let dict): - let isFirstDevice = Serialization._BoolSerializer.deserialize(dict["is_first_device"] ?? .null) - let platform = Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) - return DropboxPasswordsNewDeviceEnrolledDetails(isFirstDevice: isFirstDevice, platform: platform) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isFirstDevice = try Serialization._BoolSerializer.deserialize(dict["is_first_device"] ?? .null) + let platform = try Serialization._StringSerializer.deserialize(dict["platform"] ?? .null) + return DropboxPasswordsNewDeviceEnrolledDetails(isFirstDevice: isFirstDevice, platform: platform) + default: + throw JSONSerializerError.deserializeError(type: DropboxPasswordsNewDeviceEnrolledDetails.self, json: json) } } } /// The DropboxPasswordsNewDeviceEnrolledType struct - open class DropboxPasswordsNewDeviceEnrolledType: CustomStringConvertible { + public class DropboxPasswordsNewDeviceEnrolledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DropboxPasswordsNewDeviceEnrolledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DropboxPasswordsNewDeviceEnrolledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DropboxPasswordsNewDeviceEnrolledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DropboxPasswordsNewDeviceEnrolledType: \(error)" + } } } - open class DropboxPasswordsNewDeviceEnrolledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DropboxPasswordsNewDeviceEnrolledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DropboxPasswordsNewDeviceEnrolledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DropboxPasswordsNewDeviceEnrolledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DropboxPasswordsNewDeviceEnrolledType { + + public func deserialize(_ json: JSON) throws -> DropboxPasswordsNewDeviceEnrolledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DropboxPasswordsNewDeviceEnrolledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DropboxPasswordsNewDeviceEnrolledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DropboxPasswordsNewDeviceEnrolledType.self, json: json) } } } /// Policy for deciding whether team users can use Dropbox Passwords - public enum DropboxPasswordsPolicy: CustomStringConvertible { + public enum DropboxPasswordsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case default_ /// An unspecified error. @@ -7471,56 +9750,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try DropboxPasswordsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DropboxPasswordsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DropboxPasswordsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for DropboxPasswordsPolicy: \(error)" + } } } - open class DropboxPasswordsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DropboxPasswordsPolicy) -> JSON { + + public class DropboxPasswordsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DropboxPasswordsPolicy) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> DropboxPasswordsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return DropboxPasswordsPolicy.default_ - case "disabled": - return DropboxPasswordsPolicy.disabled - case "enabled": - return DropboxPasswordsPolicy.enabled - case "other": - return DropboxPasswordsPolicy.other - default: - return DropboxPasswordsPolicy.other - } - default: - fatalError("Failed to deserialize") + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> DropboxPasswordsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return DropboxPasswordsPolicy.default_ + case "disabled": + return DropboxPasswordsPolicy.disabled + case "enabled": + return DropboxPasswordsPolicy.enabled + case "other": + return DropboxPasswordsPolicy.other + default: + return DropboxPasswordsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: DropboxPasswordsPolicy.self, json: json) } } } /// Changed Dropbox Passwords policy for team. - open class DropboxPasswordsPolicyChangedDetails: CustomStringConvertible { + public class DropboxPasswordsPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// To. public let newValue: TeamLog.DropboxPasswordsPolicy /// From. @@ -7529,64 +9818,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DropboxPasswordsPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try DropboxPasswordsPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DropboxPasswordsPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DropboxPasswordsPolicyChangedDetails: \(error)" + } } } - open class DropboxPasswordsPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DropboxPasswordsPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.DropboxPasswordsPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.DropboxPasswordsPolicySerializer().serialize(value.previousValue), + + public class DropboxPasswordsPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DropboxPasswordsPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.DropboxPasswordsPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.DropboxPasswordsPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DropboxPasswordsPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> DropboxPasswordsPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.DropboxPasswordsPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.DropboxPasswordsPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return DropboxPasswordsPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.DropboxPasswordsPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.DropboxPasswordsPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return DropboxPasswordsPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: DropboxPasswordsPolicyChangedDetails.self, json: json) } } } /// The DropboxPasswordsPolicyChangedType struct - open class DropboxPasswordsPolicyChangedType: CustomStringConvertible { + public class DropboxPasswordsPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DropboxPasswordsPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try DropboxPasswordsPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DropboxPasswordsPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DropboxPasswordsPolicyChangedType: \(error)" + } } } - open class DropboxPasswordsPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DropboxPasswordsPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class DropboxPasswordsPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DropboxPasswordsPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DropboxPasswordsPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> DropboxPasswordsPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return DropboxPasswordsPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return DropboxPasswordsPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: DropboxPasswordsPolicyChangedType.self, json: json) } } } /// Represents a time duration: unit and amount - open class DurationLogInfo: CustomStringConvertible { + public class DurationLogInfo: CustomStringConvertible, JSONRepresentable { /// Time unit. public let unit: TeamLog.TimeUnit /// Amount of time. @@ -7596,33 +9907,44 @@ open class TeamLog { comparableValidator()(amount) self.amount = amount } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(DurationLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try DurationLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try DurationLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for DurationLogInfo: \(error)" + } } } - open class DurationLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: DurationLogInfo) -> JSON { - let output = [ - "unit": TeamLog.TimeUnitSerializer().serialize(value.unit), - "amount": Serialization._UInt64Serializer.serialize(value.amount), + + public class DurationLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: DurationLogInfo) throws -> JSON { + let output = [ + "unit": try TeamLog.TimeUnitSerializer().serialize(value.unit), + "amount": try Serialization._UInt64Serializer.serialize(value.amount), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> DurationLogInfo { + + public func deserialize(_ json: JSON) throws -> DurationLogInfo { switch json { - case .dictionary(let dict): - let unit = TeamLog.TimeUnitSerializer().deserialize(dict["unit"] ?? .null) - let amount = Serialization._UInt64Serializer.deserialize(dict["amount"] ?? .null) - return DurationLogInfo(unit: unit, amount: amount) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let unit = try TeamLog.TimeUnitSerializer().deserialize(dict["unit"] ?? .null) + let amount = try Serialization._UInt64Serializer.deserialize(dict["amount"] ?? .null) + return DurationLogInfo(unit: unit, amount: amount) + default: + throw JSONSerializerError.deserializeError(type: DurationLogInfo.self, json: json) } } } /// Policy for deciding whether a team can use Email to Dropbox feature - public enum EmailIngestPolicy: CustomStringConvertible { + public enum EmailIngestPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -7630,50 +9952,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try EmailIngestPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmailIngestPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmailIngestPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmailIngestPolicy: \(error)" + } } } - open class EmailIngestPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmailIngestPolicy) -> JSON { + + public class EmailIngestPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmailIngestPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> EmailIngestPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return EmailIngestPolicy.disabled - case "enabled": - return EmailIngestPolicy.enabled - case "other": - return EmailIngestPolicy.other - default: - return EmailIngestPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> EmailIngestPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return EmailIngestPolicy.disabled + case "enabled": + return EmailIngestPolicy.enabled + case "other": + return EmailIngestPolicy.other default: - fatalError("Failed to deserialize") + return EmailIngestPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: EmailIngestPolicy.self, json: json) } } } /// Changed email to Dropbox policy for team. - open class EmailIngestPolicyChangedDetails: CustomStringConvertible { + public class EmailIngestPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// To. public let newValue: TeamLog.EmailIngestPolicy /// From. @@ -7682,75 +10014,97 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmailIngestPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmailIngestPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmailIngestPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmailIngestPolicyChangedDetails: \(error)" + } } } - open class EmailIngestPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmailIngestPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.EmailIngestPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.EmailIngestPolicySerializer().serialize(value.previousValue), + + public class EmailIngestPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmailIngestPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.EmailIngestPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.EmailIngestPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmailIngestPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> EmailIngestPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.EmailIngestPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.EmailIngestPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return EmailIngestPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.EmailIngestPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.EmailIngestPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return EmailIngestPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: EmailIngestPolicyChangedDetails.self, json: json) } } } /// The EmailIngestPolicyChangedType struct - open class EmailIngestPolicyChangedType: CustomStringConvertible { + public class EmailIngestPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmailIngestPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmailIngestPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmailIngestPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmailIngestPolicyChangedType: \(error)" + } } } - open class EmailIngestPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmailIngestPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmailIngestPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmailIngestPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmailIngestPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> EmailIngestPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmailIngestPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmailIngestPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmailIngestPolicyChangedType.self, json: json) } } } /// Received files via Email to Dropbox. - open class EmailIngestReceiveFileDetails: CustomStringConvertible { + public class EmailIngestReceiveFileDetails: CustomStringConvertible, JSONRepresentable { /// Inbox name. public let inboxName: String /// Submitted file names. - public let attachmentNames: Array + public let attachmentNames: [String] /// Subject of the email. public let subject: String? /// The name as provided by the submitter. public let fromName: String? /// The email as provided by the submitter. public let fromEmail: String? - public init(inboxName: String, attachmentNames: Array, subject: String? = nil, fromName: String? = nil, fromEmail: String? = nil) { + public init(inboxName: String, attachmentNames: [String], subject: String? = nil, fromName: String? = nil, fromEmail: String? = nil) { stringValidator()(inboxName) self.inboxName = inboxName arrayValidator(itemValidator: stringValidator())(attachmentNames) @@ -7762,125 +10116,172 @@ open class TeamLog { nullableValidator(stringValidator(maxLength: 255))(fromEmail) self.fromEmail = fromEmail } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmailIngestReceiveFileDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmailIngestReceiveFileDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmailIngestReceiveFileDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmailIngestReceiveFileDetails: \(error)" + } } } - open class EmailIngestReceiveFileDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmailIngestReceiveFileDetails) -> JSON { - let output = [ - "inbox_name": Serialization._StringSerializer.serialize(value.inboxName), - "attachment_names": ArraySerializer(Serialization._StringSerializer).serialize(value.attachmentNames), - "subject": NullableSerializer(Serialization._StringSerializer).serialize(value.subject), - "from_name": NullableSerializer(Serialization._StringSerializer).serialize(value.fromName), - "from_email": NullableSerializer(Serialization._StringSerializer).serialize(value.fromEmail), + + public class EmailIngestReceiveFileDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmailIngestReceiveFileDetails) throws -> JSON { + let output = [ + "inbox_name": try Serialization._StringSerializer.serialize(value.inboxName), + "attachment_names": try ArraySerializer(Serialization._StringSerializer).serialize(value.attachmentNames), + "subject": try NullableSerializer(Serialization._StringSerializer).serialize(value.subject), + "from_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.fromName), + "from_email": try NullableSerializer(Serialization._StringSerializer).serialize(value.fromEmail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmailIngestReceiveFileDetails { + + public func deserialize(_ json: JSON) throws -> EmailIngestReceiveFileDetails { switch json { - case .dictionary(let dict): - let inboxName = Serialization._StringSerializer.deserialize(dict["inbox_name"] ?? .null) - let attachmentNames = ArraySerializer(Serialization._StringSerializer).deserialize(dict["attachment_names"] ?? .null) - let subject = NullableSerializer(Serialization._StringSerializer).deserialize(dict["subject"] ?? .null) - let fromName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["from_name"] ?? .null) - let fromEmail = NullableSerializer(Serialization._StringSerializer).deserialize(dict["from_email"] ?? .null) - return EmailIngestReceiveFileDetails(inboxName: inboxName, attachmentNames: attachmentNames, subject: subject, fromName: fromName, fromEmail: fromEmail) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let inboxName = try Serialization._StringSerializer.deserialize(dict["inbox_name"] ?? .null) + let attachmentNames = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["attachment_names"] ?? .null) + let subject = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["subject"] ?? .null) + let fromName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["from_name"] ?? .null) + let fromEmail = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["from_email"] ?? .null) + return EmailIngestReceiveFileDetails( + inboxName: inboxName, + attachmentNames: attachmentNames, + subject: subject, + fromName: fromName, + fromEmail: fromEmail + ) + default: + throw JSONSerializerError.deserializeError(type: EmailIngestReceiveFileDetails.self, json: json) } } } /// The EmailIngestReceiveFileType struct - open class EmailIngestReceiveFileType: CustomStringConvertible { + public class EmailIngestReceiveFileType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmailIngestReceiveFileTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmailIngestReceiveFileTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmailIngestReceiveFileTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmailIngestReceiveFileType: \(error)" + } } } - open class EmailIngestReceiveFileTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmailIngestReceiveFileType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmailIngestReceiveFileTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmailIngestReceiveFileType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmailIngestReceiveFileType { + + public func deserialize(_ json: JSON) throws -> EmailIngestReceiveFileType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmailIngestReceiveFileType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmailIngestReceiveFileType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmailIngestReceiveFileType.self, json: json) } } } /// Added members to EMM exception list. - open class EmmAddExceptionDetails: CustomStringConvertible { - public init() { + public class EmmAddExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try EmmAddExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmAddExceptionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmAddExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmAddExceptionDetails: \(error)" + } } } - open class EmmAddExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmAddExceptionDetails) -> JSON { + + public class EmmAddExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmAddExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmAddExceptionDetails { + + public func deserialize(_ json: JSON) throws -> EmmAddExceptionDetails { switch json { - case .dictionary(_): - return EmmAddExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return EmmAddExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: EmmAddExceptionDetails.self, json: json) } } } /// The EmmAddExceptionType struct - open class EmmAddExceptionType: CustomStringConvertible { + public class EmmAddExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmAddExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmAddExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmAddExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmAddExceptionType: \(error)" + } } } - open class EmmAddExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmAddExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmmAddExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmAddExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmAddExceptionType { + + public func deserialize(_ json: JSON) throws -> EmmAddExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmmAddExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmmAddExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmmAddExceptionType.self, json: json) } } } /// Enabled/disabled enterprise mobility management for members. - open class EmmChangePolicyDetails: CustomStringConvertible { + public class EmmChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New enterprise mobility management policy. public let newValue: TeamPolicies.EmmState /// Previous enterprise mobility management policy. Might be missing due to historical data gap. @@ -7889,516 +10290,696 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmChangePolicyDetails: \(error)" + } } } - open class EmmChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.EmmStateSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.EmmStateSerializer()).serialize(value.previousValue), + + public class EmmChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.EmmStateSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.EmmStateSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> EmmChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.EmmStateSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.EmmStateSerializer()).deserialize(dict["previous_value"] ?? .null) - return EmmChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamPolicies.EmmStateSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.EmmStateSerializer()).deserialize(dict["previous_value"] ?? .null) + return EmmChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: EmmChangePolicyDetails.self, json: json) } } } /// The EmmChangePolicyType struct - open class EmmChangePolicyType: CustomStringConvertible { + public class EmmChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmChangePolicyType: \(error)" + } } } - open class EmmChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmmChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmChangePolicyType { + + public func deserialize(_ json: JSON) throws -> EmmChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmmChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmmChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmmChangePolicyType.self, json: json) } } } /// Created EMM-excluded users report. - open class EmmCreateExceptionsReportDetails: CustomStringConvertible { - public init() { + public class EmmCreateExceptionsReportDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try EmmCreateExceptionsReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmCreateExceptionsReportDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmCreateExceptionsReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmCreateExceptionsReportDetails: \(error)" + } } } - open class EmmCreateExceptionsReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmCreateExceptionsReportDetails) -> JSON { + + public class EmmCreateExceptionsReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmCreateExceptionsReportDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmCreateExceptionsReportDetails { + + public func deserialize(_ json: JSON) throws -> EmmCreateExceptionsReportDetails { switch json { - case .dictionary(_): - return EmmCreateExceptionsReportDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return EmmCreateExceptionsReportDetails() + default: + throw JSONSerializerError.deserializeError(type: EmmCreateExceptionsReportDetails.self, json: json) } } } /// The EmmCreateExceptionsReportType struct - open class EmmCreateExceptionsReportType: CustomStringConvertible { + public class EmmCreateExceptionsReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmCreateExceptionsReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmCreateExceptionsReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmCreateExceptionsReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmCreateExceptionsReportType: \(error)" + } } } - open class EmmCreateExceptionsReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmCreateExceptionsReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmmCreateExceptionsReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmCreateExceptionsReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmCreateExceptionsReportType { + + public func deserialize(_ json: JSON) throws -> EmmCreateExceptionsReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmmCreateExceptionsReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmmCreateExceptionsReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmmCreateExceptionsReportType.self, json: json) } } } /// Created EMM mobile app usage report. - open class EmmCreateUsageReportDetails: CustomStringConvertible { - public init() { + public class EmmCreateUsageReportDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try EmmCreateUsageReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmCreateUsageReportDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmCreateUsageReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmCreateUsageReportDetails: \(error)" + } } } - open class EmmCreateUsageReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmCreateUsageReportDetails) -> JSON { + + public class EmmCreateUsageReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmCreateUsageReportDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmCreateUsageReportDetails { + + public func deserialize(_ json: JSON) throws -> EmmCreateUsageReportDetails { switch json { - case .dictionary(_): - return EmmCreateUsageReportDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return EmmCreateUsageReportDetails() + default: + throw JSONSerializerError.deserializeError(type: EmmCreateUsageReportDetails.self, json: json) } } } /// The EmmCreateUsageReportType struct - open class EmmCreateUsageReportType: CustomStringConvertible { + public class EmmCreateUsageReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmCreateUsageReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmCreateUsageReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmCreateUsageReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmCreateUsageReportType: \(error)" + } } } - open class EmmCreateUsageReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmCreateUsageReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmmCreateUsageReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmCreateUsageReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmCreateUsageReportType { + + public func deserialize(_ json: JSON) throws -> EmmCreateUsageReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmmCreateUsageReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmmCreateUsageReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmmCreateUsageReportType.self, json: json) } } } /// Failed to sign in via EMM. - open class EmmErrorDetails: CustomStringConvertible { + public class EmmErrorDetails: CustomStringConvertible, JSONRepresentable { /// Error details. public let errorDetails: TeamLog.FailureDetailsLogInfo public init(errorDetails: TeamLog.FailureDetailsLogInfo) { self.errorDetails = errorDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmErrorDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmErrorDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmErrorDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmErrorDetails: \(error)" + } } } - open class EmmErrorDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmErrorDetails) -> JSON { - let output = [ - "error_details": TeamLog.FailureDetailsLogInfoSerializer().serialize(value.errorDetails), + + public class EmmErrorDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmErrorDetails) throws -> JSON { + let output = [ + "error_details": try TeamLog.FailureDetailsLogInfoSerializer().serialize(value.errorDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmErrorDetails { + + public func deserialize(_ json: JSON) throws -> EmmErrorDetails { switch json { - case .dictionary(let dict): - let errorDetails = TeamLog.FailureDetailsLogInfoSerializer().deserialize(dict["error_details"] ?? .null) - return EmmErrorDetails(errorDetails: errorDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let errorDetails = try TeamLog.FailureDetailsLogInfoSerializer().deserialize(dict["error_details"] ?? .null) + return EmmErrorDetails(errorDetails: errorDetails) + default: + throw JSONSerializerError.deserializeError(type: EmmErrorDetails.self, json: json) } } } /// The EmmErrorType struct - open class EmmErrorType: CustomStringConvertible { + public class EmmErrorType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmErrorTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmErrorTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmErrorTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmErrorType: \(error)" + } } } - open class EmmErrorTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmErrorType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmmErrorTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmErrorType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmErrorType { + + public func deserialize(_ json: JSON) throws -> EmmErrorType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmmErrorType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmmErrorType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmmErrorType.self, json: json) } } } /// Refreshed auth token used for setting up EMM. - open class EmmRefreshAuthTokenDetails: CustomStringConvertible { - public init() { + public class EmmRefreshAuthTokenDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try EmmRefreshAuthTokenDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmRefreshAuthTokenDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmRefreshAuthTokenDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmRefreshAuthTokenDetails: \(error)" + } } } - open class EmmRefreshAuthTokenDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmRefreshAuthTokenDetails) -> JSON { + + public class EmmRefreshAuthTokenDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmRefreshAuthTokenDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmRefreshAuthTokenDetails { + + public func deserialize(_ json: JSON) throws -> EmmRefreshAuthTokenDetails { switch json { - case .dictionary(_): - return EmmRefreshAuthTokenDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return EmmRefreshAuthTokenDetails() + default: + throw JSONSerializerError.deserializeError(type: EmmRefreshAuthTokenDetails.self, json: json) } } } /// The EmmRefreshAuthTokenType struct - open class EmmRefreshAuthTokenType: CustomStringConvertible { + public class EmmRefreshAuthTokenType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmRefreshAuthTokenTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmRefreshAuthTokenTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmRefreshAuthTokenTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmRefreshAuthTokenType: \(error)" + } } } - open class EmmRefreshAuthTokenTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmRefreshAuthTokenType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmmRefreshAuthTokenTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmRefreshAuthTokenType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmRefreshAuthTokenType { + + public func deserialize(_ json: JSON) throws -> EmmRefreshAuthTokenType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmmRefreshAuthTokenType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmmRefreshAuthTokenType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmmRefreshAuthTokenType.self, json: json) } } } /// Removed members from EMM exception list. - open class EmmRemoveExceptionDetails: CustomStringConvertible { - public init() { + public class EmmRemoveExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try EmmRemoveExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmRemoveExceptionDetailsSerializer().serialize(self)))" - } - } - open class EmmRemoveExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmRemoveExceptionDetails) -> JSON { + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmRemoveExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmRemoveExceptionDetails: \(error)" + } + } + } + + public class EmmRemoveExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmRemoveExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmRemoveExceptionDetails { + + public func deserialize(_ json: JSON) throws -> EmmRemoveExceptionDetails { switch json { - case .dictionary(_): - return EmmRemoveExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return EmmRemoveExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: EmmRemoveExceptionDetails.self, json: json) } } } /// The EmmRemoveExceptionType struct - open class EmmRemoveExceptionType: CustomStringConvertible { + public class EmmRemoveExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmRemoveExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EmmRemoveExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmRemoveExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmRemoveExceptionType: \(error)" + } } } - open class EmmRemoveExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmRemoveExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EmmRemoveExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmRemoveExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EmmRemoveExceptionType { + + public func deserialize(_ json: JSON) throws -> EmmRemoveExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EmmRemoveExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EmmRemoveExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EmmRemoveExceptionType.self, json: json) } } } /// Enabled domain invites. - open class EnabledDomainInvitesDetails: CustomStringConvertible { - public init() { + public class EnabledDomainInvitesDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try EnabledDomainInvitesDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EnabledDomainInvitesDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EnabledDomainInvitesDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EnabledDomainInvitesDetails: \(error)" + } } } - open class EnabledDomainInvitesDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EnabledDomainInvitesDetails) -> JSON { + + public class EnabledDomainInvitesDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EnabledDomainInvitesDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> EnabledDomainInvitesDetails { + + public func deserialize(_ json: JSON) throws -> EnabledDomainInvitesDetails { switch json { - case .dictionary(_): - return EnabledDomainInvitesDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return EnabledDomainInvitesDetails() + default: + throw JSONSerializerError.deserializeError(type: EnabledDomainInvitesDetails.self, json: json) } } } /// The EnabledDomainInvitesType struct - open class EnabledDomainInvitesType: CustomStringConvertible { + public class EnabledDomainInvitesType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EnabledDomainInvitesTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EnabledDomainInvitesTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EnabledDomainInvitesTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EnabledDomainInvitesType: \(error)" + } } } - open class EnabledDomainInvitesTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EnabledDomainInvitesType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EnabledDomainInvitesTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EnabledDomainInvitesType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EnabledDomainInvitesType { + + public func deserialize(_ json: JSON) throws -> EnabledDomainInvitesType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EnabledDomainInvitesType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EnabledDomainInvitesType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EnabledDomainInvitesType.self, json: json) } } } /// Ended enterprise admin session. - open class EndedEnterpriseAdminSessionDeprecatedDetails: CustomStringConvertible { + public class EndedEnterpriseAdminSessionDeprecatedDetails: CustomStringConvertible, JSONRepresentable { /// More information about the organization or team. public let federationExtraDetails: TeamLog.FedExtraDetails public init(federationExtraDetails: TeamLog.FedExtraDetails) { self.federationExtraDetails = federationExtraDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EndedEnterpriseAdminSessionDeprecatedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try EndedEnterpriseAdminSessionDeprecatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EndedEnterpriseAdminSessionDeprecatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EndedEnterpriseAdminSessionDeprecatedDetails: \(error)" + } } } - open class EndedEnterpriseAdminSessionDeprecatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EndedEnterpriseAdminSessionDeprecatedDetails) -> JSON { - let output = [ - "federation_extra_details": TeamLog.FedExtraDetailsSerializer().serialize(value.federationExtraDetails), + + public class EndedEnterpriseAdminSessionDeprecatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EndedEnterpriseAdminSessionDeprecatedDetails) throws -> JSON { + let output = [ + "federation_extra_details": try TeamLog.FedExtraDetailsSerializer().serialize(value.federationExtraDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EndedEnterpriseAdminSessionDeprecatedDetails { + + public func deserialize(_ json: JSON) throws -> EndedEnterpriseAdminSessionDeprecatedDetails { switch json { - case .dictionary(let dict): - let federationExtraDetails = TeamLog.FedExtraDetailsSerializer().deserialize(dict["federation_extra_details"] ?? .null) - return EndedEnterpriseAdminSessionDeprecatedDetails(federationExtraDetails: federationExtraDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let federationExtraDetails = try TeamLog.FedExtraDetailsSerializer().deserialize(dict["federation_extra_details"] ?? .null) + return EndedEnterpriseAdminSessionDeprecatedDetails(federationExtraDetails: federationExtraDetails) + default: + throw JSONSerializerError.deserializeError(type: EndedEnterpriseAdminSessionDeprecatedDetails.self, json: json) } } } /// The EndedEnterpriseAdminSessionDeprecatedType struct - open class EndedEnterpriseAdminSessionDeprecatedType: CustomStringConvertible { + public class EndedEnterpriseAdminSessionDeprecatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EndedEnterpriseAdminSessionDeprecatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EndedEnterpriseAdminSessionDeprecatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EndedEnterpriseAdminSessionDeprecatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EndedEnterpriseAdminSessionDeprecatedType: \(error)" + } } } - open class EndedEnterpriseAdminSessionDeprecatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EndedEnterpriseAdminSessionDeprecatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EndedEnterpriseAdminSessionDeprecatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EndedEnterpriseAdminSessionDeprecatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EndedEnterpriseAdminSessionDeprecatedType { + + public func deserialize(_ json: JSON) throws -> EndedEnterpriseAdminSessionDeprecatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EndedEnterpriseAdminSessionDeprecatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EndedEnterpriseAdminSessionDeprecatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EndedEnterpriseAdminSessionDeprecatedType.self, json: json) } } } /// Ended enterprise admin session. - open class EndedEnterpriseAdminSessionDetails: CustomStringConvertible { - public init() { + public class EndedEnterpriseAdminSessionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try EndedEnterpriseAdminSessionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EndedEnterpriseAdminSessionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EndedEnterpriseAdminSessionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EndedEnterpriseAdminSessionDetails: \(error)" + } } } - open class EndedEnterpriseAdminSessionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EndedEnterpriseAdminSessionDetails) -> JSON { + + public class EndedEnterpriseAdminSessionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EndedEnterpriseAdminSessionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> EndedEnterpriseAdminSessionDetails { + + public func deserialize(_ json: JSON) throws -> EndedEnterpriseAdminSessionDetails { switch json { - case .dictionary(_): - return EndedEnterpriseAdminSessionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return EndedEnterpriseAdminSessionDetails() + default: + throw JSONSerializerError.deserializeError(type: EndedEnterpriseAdminSessionDetails.self, json: json) } } } /// The EndedEnterpriseAdminSessionType struct - open class EndedEnterpriseAdminSessionType: CustomStringConvertible { + public class EndedEnterpriseAdminSessionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EndedEnterpriseAdminSessionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EndedEnterpriseAdminSessionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EndedEnterpriseAdminSessionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EndedEnterpriseAdminSessionType: \(error)" + } } } - open class EndedEnterpriseAdminSessionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EndedEnterpriseAdminSessionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EndedEnterpriseAdminSessionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EndedEnterpriseAdminSessionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EndedEnterpriseAdminSessionType { + + public func deserialize(_ json: JSON) throws -> EndedEnterpriseAdminSessionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EndedEnterpriseAdminSessionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EndedEnterpriseAdminSessionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EndedEnterpriseAdminSessionType.self, json: json) } } } /// Policy for deciding whether password must be enforced when an externally shared link is updated - public enum EnforceLinkPasswordPolicy: CustomStringConvertible { + public enum EnforceLinkPasswordPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case optional /// An unspecified error. @@ -8406,50 +10987,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try EnforceLinkPasswordPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EnforceLinkPasswordPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EnforceLinkPasswordPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for EnforceLinkPasswordPolicy: \(error)" + } } } - open class EnforceLinkPasswordPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EnforceLinkPasswordPolicy) -> JSON { + + public class EnforceLinkPasswordPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EnforceLinkPasswordPolicy) throws -> JSON { switch value { - case .optional: - var d = [String: JSON]() - d[".tag"] = .str("optional") - return .dictionary(d) - case .required: - var d = [String: JSON]() - d[".tag"] = .str("required") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> EnforceLinkPasswordPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "optional": - return EnforceLinkPasswordPolicy.optional - case "required": - return EnforceLinkPasswordPolicy.required - case "other": - return EnforceLinkPasswordPolicy.other - default: - return EnforceLinkPasswordPolicy.other - } + case .optional: + var d = [String: JSON]() + d[".tag"] = .str("optional") + return .dictionary(d) + case .required: + var d = [String: JSON]() + d[".tag"] = .str("required") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> EnforceLinkPasswordPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "optional": + return EnforceLinkPasswordPolicy.optional + case "required": + return EnforceLinkPasswordPolicy.required + case "other": + return EnforceLinkPasswordPolicy.other default: - fatalError("Failed to deserialize") + return EnforceLinkPasswordPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: EnforceLinkPasswordPolicy.self, json: json) } } } /// Changed who can update a setting. - open class EnterpriseSettingsLockingDetails: CustomStringConvertible { + public class EnterpriseSettingsLockingDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let teamName: String /// Settings page name. @@ -8468,68 +11059,96 @@ open class TeamLog { stringValidator()(newSettingsPageLockingState) self.newSettingsPageLockingState = newSettingsPageLockingState } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EnterpriseSettingsLockingDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try EnterpriseSettingsLockingDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EnterpriseSettingsLockingDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EnterpriseSettingsLockingDetails: \(error)" + } } } - open class EnterpriseSettingsLockingDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EnterpriseSettingsLockingDetails) -> JSON { - let output = [ - "team_name": Serialization._StringSerializer.serialize(value.teamName), - "settings_page_name": Serialization._StringSerializer.serialize(value.settingsPageName), - "previous_settings_page_locking_state": Serialization._StringSerializer.serialize(value.previousSettingsPageLockingState), - "new_settings_page_locking_state": Serialization._StringSerializer.serialize(value.newSettingsPageLockingState), + + public class EnterpriseSettingsLockingDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EnterpriseSettingsLockingDetails) throws -> JSON { + let output = [ + "team_name": try Serialization._StringSerializer.serialize(value.teamName), + "settings_page_name": try Serialization._StringSerializer.serialize(value.settingsPageName), + "previous_settings_page_locking_state": try Serialization._StringSerializer.serialize(value.previousSettingsPageLockingState), + "new_settings_page_locking_state": try Serialization._StringSerializer.serialize(value.newSettingsPageLockingState), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EnterpriseSettingsLockingDetails { + + public func deserialize(_ json: JSON) throws -> EnterpriseSettingsLockingDetails { switch json { - case .dictionary(let dict): - let teamName = Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) - let settingsPageName = Serialization._StringSerializer.deserialize(dict["settings_page_name"] ?? .null) - let previousSettingsPageLockingState = Serialization._StringSerializer.deserialize(dict["previous_settings_page_locking_state"] ?? .null) - let newSettingsPageLockingState = Serialization._StringSerializer.deserialize(dict["new_settings_page_locking_state"] ?? .null) - return EnterpriseSettingsLockingDetails(teamName: teamName, settingsPageName: settingsPageName, previousSettingsPageLockingState: previousSettingsPageLockingState, newSettingsPageLockingState: newSettingsPageLockingState) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamName = try Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) + let settingsPageName = try Serialization._StringSerializer.deserialize(dict["settings_page_name"] ?? .null) + let previousSettingsPageLockingState = try Serialization._StringSerializer + .deserialize(dict["previous_settings_page_locking_state"] ?? .null) + let newSettingsPageLockingState = try Serialization._StringSerializer.deserialize(dict["new_settings_page_locking_state"] ?? .null) + return EnterpriseSettingsLockingDetails( + teamName: teamName, + settingsPageName: settingsPageName, + previousSettingsPageLockingState: previousSettingsPageLockingState, + newSettingsPageLockingState: newSettingsPageLockingState + ) + default: + throw JSONSerializerError.deserializeError(type: EnterpriseSettingsLockingDetails.self, json: json) } } } /// The EnterpriseSettingsLockingType struct - open class EnterpriseSettingsLockingType: CustomStringConvertible { + public class EnterpriseSettingsLockingType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EnterpriseSettingsLockingTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try EnterpriseSettingsLockingTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EnterpriseSettingsLockingTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EnterpriseSettingsLockingType: \(error)" + } } } - open class EnterpriseSettingsLockingTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EnterpriseSettingsLockingType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class EnterpriseSettingsLockingTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EnterpriseSettingsLockingType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> EnterpriseSettingsLockingType { + + public func deserialize(_ json: JSON) throws -> EnterpriseSettingsLockingType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return EnterpriseSettingsLockingType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return EnterpriseSettingsLockingType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: EnterpriseSettingsLockingType.self, json: json) } } } /// Category of events in event audit log. - public enum EventCategory: CustomStringConvertible { + public enum EventCategory: CustomStringConvertible, JSONRepresentable { /// Events that involve team related alerts. case adminAlerting /// Events that apply to management of linked apps. @@ -8542,6 +11161,8 @@ open class TeamLog { case devices /// Events that involve domain management feature: domain verification, invite enforcement and account capture. case domains + /// Events that involve encryption. + case encryption /// Events that have to do with filesystem operations on files and folders: copy, move, delete, etc. case fileOperations /// Events that apply to the file requests feature. @@ -8579,170 +11200,186 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try EventCategorySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EventCategorySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EventCategorySerializer().serialize(self)))" + } catch { + return "Failed to generate description for EventCategory: \(error)" + } } } - open class EventCategorySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EventCategory) -> JSON { + + public class EventCategorySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EventCategory) throws -> JSON { switch value { - case .adminAlerting: - var d = [String: JSON]() - d[".tag"] = .str("admin_alerting") - return .dictionary(d) - case .apps: - var d = [String: JSON]() - d[".tag"] = .str("apps") - return .dictionary(d) - case .comments: - var d = [String: JSON]() - d[".tag"] = .str("comments") - return .dictionary(d) - case .dataGovernance: - var d = [String: JSON]() - d[".tag"] = .str("data_governance") - return .dictionary(d) - case .devices: - var d = [String: JSON]() - d[".tag"] = .str("devices") - return .dictionary(d) - case .domains: - var d = [String: JSON]() - d[".tag"] = .str("domains") - return .dictionary(d) - case .fileOperations: - var d = [String: JSON]() - d[".tag"] = .str("file_operations") - return .dictionary(d) - case .fileRequests: - var d = [String: JSON]() - d[".tag"] = .str("file_requests") - return .dictionary(d) - case .groups: - var d = [String: JSON]() - d[".tag"] = .str("groups") - return .dictionary(d) - case .logins: - var d = [String: JSON]() - d[".tag"] = .str("logins") - return .dictionary(d) - case .members: - var d = [String: JSON]() - d[".tag"] = .str("members") - return .dictionary(d) - case .paper: - var d = [String: JSON]() - d[".tag"] = .str("paper") - return .dictionary(d) - case .passwords: - var d = [String: JSON]() - d[".tag"] = .str("passwords") - return .dictionary(d) - case .reports: - var d = [String: JSON]() - d[".tag"] = .str("reports") - return .dictionary(d) - case .sharing: - var d = [String: JSON]() - d[".tag"] = .str("sharing") - return .dictionary(d) - case .showcase: - var d = [String: JSON]() - d[".tag"] = .str("showcase") - return .dictionary(d) - case .sso: - var d = [String: JSON]() - d[".tag"] = .str("sso") - return .dictionary(d) - case .teamFolders: - var d = [String: JSON]() - d[".tag"] = .str("team_folders") - return .dictionary(d) - case .teamPolicies: - var d = [String: JSON]() - d[".tag"] = .str("team_policies") - return .dictionary(d) - case .teamProfile: - var d = [String: JSON]() - d[".tag"] = .str("team_profile") - return .dictionary(d) - case .tfa: - var d = [String: JSON]() - d[".tag"] = .str("tfa") - return .dictionary(d) - case .trustedTeams: - var d = [String: JSON]() - d[".tag"] = .str("trusted_teams") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> EventCategory { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admin_alerting": - return EventCategory.adminAlerting - case "apps": - return EventCategory.apps - case "comments": - return EventCategory.comments - case "data_governance": - return EventCategory.dataGovernance - case "devices": - return EventCategory.devices - case "domains": - return EventCategory.domains - case "file_operations": - return EventCategory.fileOperations - case "file_requests": - return EventCategory.fileRequests - case "groups": - return EventCategory.groups - case "logins": - return EventCategory.logins - case "members": - return EventCategory.members - case "paper": - return EventCategory.paper - case "passwords": - return EventCategory.passwords - case "reports": - return EventCategory.reports - case "sharing": - return EventCategory.sharing - case "showcase": - return EventCategory.showcase - case "sso": - return EventCategory.sso - case "team_folders": - return EventCategory.teamFolders - case "team_policies": - return EventCategory.teamPolicies - case "team_profile": - return EventCategory.teamProfile - case "tfa": - return EventCategory.tfa - case "trusted_teams": - return EventCategory.trustedTeams - case "other": - return EventCategory.other - default: - return EventCategory.other - } - default: - fatalError("Failed to deserialize") + case .adminAlerting: + var d = [String: JSON]() + d[".tag"] = .str("admin_alerting") + return .dictionary(d) + case .apps: + var d = [String: JSON]() + d[".tag"] = .str("apps") + return .dictionary(d) + case .comments: + var d = [String: JSON]() + d[".tag"] = .str("comments") + return .dictionary(d) + case .dataGovernance: + var d = [String: JSON]() + d[".tag"] = .str("data_governance") + return .dictionary(d) + case .devices: + var d = [String: JSON]() + d[".tag"] = .str("devices") + return .dictionary(d) + case .domains: + var d = [String: JSON]() + d[".tag"] = .str("domains") + return .dictionary(d) + case .encryption: + var d = [String: JSON]() + d[".tag"] = .str("encryption") + return .dictionary(d) + case .fileOperations: + var d = [String: JSON]() + d[".tag"] = .str("file_operations") + return .dictionary(d) + case .fileRequests: + var d = [String: JSON]() + d[".tag"] = .str("file_requests") + return .dictionary(d) + case .groups: + var d = [String: JSON]() + d[".tag"] = .str("groups") + return .dictionary(d) + case .logins: + var d = [String: JSON]() + d[".tag"] = .str("logins") + return .dictionary(d) + case .members: + var d = [String: JSON]() + d[".tag"] = .str("members") + return .dictionary(d) + case .paper: + var d = [String: JSON]() + d[".tag"] = .str("paper") + return .dictionary(d) + case .passwords: + var d = [String: JSON]() + d[".tag"] = .str("passwords") + return .dictionary(d) + case .reports: + var d = [String: JSON]() + d[".tag"] = .str("reports") + return .dictionary(d) + case .sharing: + var d = [String: JSON]() + d[".tag"] = .str("sharing") + return .dictionary(d) + case .showcase: + var d = [String: JSON]() + d[".tag"] = .str("showcase") + return .dictionary(d) + case .sso: + var d = [String: JSON]() + d[".tag"] = .str("sso") + return .dictionary(d) + case .teamFolders: + var d = [String: JSON]() + d[".tag"] = .str("team_folders") + return .dictionary(d) + case .teamPolicies: + var d = [String: JSON]() + d[".tag"] = .str("team_policies") + return .dictionary(d) + case .teamProfile: + var d = [String: JSON]() + d[".tag"] = .str("team_profile") + return .dictionary(d) + case .tfa: + var d = [String: JSON]() + d[".tag"] = .str("tfa") + return .dictionary(d) + case .trustedTeams: + var d = [String: JSON]() + d[".tag"] = .str("trusted_teams") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> EventCategory { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admin_alerting": + return EventCategory.adminAlerting + case "apps": + return EventCategory.apps + case "comments": + return EventCategory.comments + case "data_governance": + return EventCategory.dataGovernance + case "devices": + return EventCategory.devices + case "domains": + return EventCategory.domains + case "encryption": + return EventCategory.encryption + case "file_operations": + return EventCategory.fileOperations + case "file_requests": + return EventCategory.fileRequests + case "groups": + return EventCategory.groups + case "logins": + return EventCategory.logins + case "members": + return EventCategory.members + case "paper": + return EventCategory.paper + case "passwords": + return EventCategory.passwords + case "reports": + return EventCategory.reports + case "sharing": + return EventCategory.sharing + case "showcase": + return EventCategory.showcase + case "sso": + return EventCategory.sso + case "team_folders": + return EventCategory.teamFolders + case "team_policies": + return EventCategory.teamPolicies + case "team_profile": + return EventCategory.teamProfile + case "tfa": + return EventCategory.tfa + case "trusted_teams": + return EventCategory.trustedTeams + case "other": + return EventCategory.other + default: + return EventCategory.other + } + default: + throw JSONSerializerError.deserializeError(type: EventCategory.self, json: json) } } } /// Additional fields depending on the event type. - public enum EventDetails: CustomStringConvertible { + public enum EventDetails: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case adminAlertingAlertStateChangedDetails(TeamLog.AdminAlertingAlertStateChangedDetails) /// An unspecified error. @@ -8750,6 +11387,10 @@ open class TeamLog { /// An unspecified error. case adminAlertingTriggeredAlertDetails(TeamLog.AdminAlertingTriggeredAlertDetails) /// An unspecified error. + case ransomwareRestoreProcessCompletedDetails(TeamLog.RansomwareRestoreProcessCompletedDetails) + /// An unspecified error. + case ransomwareRestoreProcessStartedDetails(TeamLog.RansomwareRestoreProcessStartedDetails) + /// An unspecified error. case appBlockedByPermissionsDetails(TeamLog.AppBlockedByPermissionsDetails) /// An unspecified error. case appLinkTeamDetails(TeamLog.AppLinkTeamDetails) @@ -8888,12 +11529,28 @@ open class TeamLog { /// An unspecified error. case enabledDomainInvitesDetails(TeamLog.EnabledDomainInvitesDetails) /// An unspecified error. + case teamEncryptionKeyCancelKeyDeletionDetails(TeamLog.TeamEncryptionKeyCancelKeyDeletionDetails) + /// An unspecified error. + case teamEncryptionKeyCreateKeyDetails(TeamLog.TeamEncryptionKeyCreateKeyDetails) + /// An unspecified error. + case teamEncryptionKeyDeleteKeyDetails(TeamLog.TeamEncryptionKeyDeleteKeyDetails) + /// An unspecified error. + case teamEncryptionKeyDisableKeyDetails(TeamLog.TeamEncryptionKeyDisableKeyDetails) + /// An unspecified error. + case teamEncryptionKeyEnableKeyDetails(TeamLog.TeamEncryptionKeyEnableKeyDetails) + /// An unspecified error. + case teamEncryptionKeyRotateKeyDetails(TeamLog.TeamEncryptionKeyRotateKeyDetails) + /// An unspecified error. + case teamEncryptionKeyScheduleKeyDeletionDetails(TeamLog.TeamEncryptionKeyScheduleKeyDeletionDetails) + /// An unspecified error. case applyNamingConventionDetails(TeamLog.ApplyNamingConventionDetails) /// An unspecified error. case createFolderDetails(TeamLog.CreateFolderDetails) /// An unspecified error. case fileAddDetails(TeamLog.FileAddDetails) /// An unspecified error. + case fileAddFromAutomationDetails(TeamLog.FileAddFromAutomationDetails) + /// An unspecified error. case fileCopyDetails(TeamLog.FileCopyDetails) /// An unspecified error. case fileDeleteDetails(TeamLog.FileDeleteDetails) @@ -8936,6 +11593,8 @@ open class TeamLog { /// An unspecified error. case organizeFolderWithTidyDetails(TeamLog.OrganizeFolderWithTidyDetails) /// An unspecified error. + case replayFileDeleteDetails(TeamLog.ReplayFileDeleteDetails) + /// An unspecified error. case rewindFolderDetails(TeamLog.RewindFolderDetails) /// An unspecified error. case undoNamingConventionDetails(TeamLog.UndoNamingConventionDetails) @@ -9008,6 +11667,10 @@ open class TeamLog { /// An unspecified error. case ssoErrorDetails(TeamLog.SsoErrorDetails) /// An unspecified error. + case backupAdminInvitationSentDetails(TeamLog.BackupAdminInvitationSentDetails) + /// An unspecified error. + case backupInvitationOpenedDetails(TeamLog.BackupInvitationOpenedDetails) + /// An unspecified error. case createTeamInviteLinkDetails(TeamLog.CreateTeamInviteLinkDetails) /// An unspecified error. case deleteTeamInviteLinkDetails(TeamLog.DeleteTeamInviteLinkDetails) @@ -9198,6 +11861,10 @@ open class TeamLog { /// An unspecified error. case paperAdminExportStartDetails(TeamLog.PaperAdminExportStartDetails) /// An unspecified error. + case ransomwareAlertCreateReportDetails(TeamLog.RansomwareAlertCreateReportDetails) + /// An unspecified error. + case ransomwareAlertCreateReportFailedDetails(TeamLog.RansomwareAlertCreateReportFailedDetails) + /// An unspecified error. case smartSyncCreateAdminPrivilegeReportDetails(TeamLog.SmartSyncCreateAdminPrivilegeReportDetails) /// An unspecified error. case teamActivityCreateReportDetails(TeamLog.TeamActivityCreateReportDetails) @@ -9228,6 +11895,14 @@ open class TeamLog { /// An unspecified error. case openNoteSharedDetails(TeamLog.OpenNoteSharedDetails) /// An unspecified error. + case replayFileSharedLinkCreatedDetails(TeamLog.ReplayFileSharedLinkCreatedDetails) + /// An unspecified error. + case replayFileSharedLinkModifiedDetails(TeamLog.ReplayFileSharedLinkModifiedDetails) + /// An unspecified error. + case replayProjectTeamAddDetails(TeamLog.ReplayProjectTeamAddDetails) + /// An unspecified error. + case replayProjectTeamDeleteDetails(TeamLog.ReplayProjectTeamDeleteDetails) + /// An unspecified error. case sfAddGroupDetails(TeamLog.SfAddGroupDetails) /// An unspecified error. case sfAllowNonMembersToViewSharedLinksDetails(TeamLog.SfAllowNonMembersToViewSharedLinksDetails) @@ -9716,3439 +12391,3586 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try EventDetailsSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EventDetailsSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EventDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EventDetails: \(error)" + } } } - open class EventDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EventDetails) -> JSON { + + public class EventDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EventDetails) throws -> JSON { switch value { - case .adminAlertingAlertStateChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.AdminAlertingAlertStateChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("admin_alerting_alert_state_changed_details") - return .dictionary(d) - case .adminAlertingChangedAlertConfigDetails(let arg): - var d = Serialization.getFields(TeamLog.AdminAlertingChangedAlertConfigDetailsSerializer().serialize(arg)) - d[".tag"] = .str("admin_alerting_changed_alert_config_details") - return .dictionary(d) - case .adminAlertingTriggeredAlertDetails(let arg): - var d = Serialization.getFields(TeamLog.AdminAlertingTriggeredAlertDetailsSerializer().serialize(arg)) - d[".tag"] = .str("admin_alerting_triggered_alert_details") - return .dictionary(d) - case .appBlockedByPermissionsDetails(let arg): - var d = Serialization.getFields(TeamLog.AppBlockedByPermissionsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("app_blocked_by_permissions_details") - return .dictionary(d) - case .appLinkTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.AppLinkTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("app_link_team_details") - return .dictionary(d) - case .appLinkUserDetails(let arg): - var d = Serialization.getFields(TeamLog.AppLinkUserDetailsSerializer().serialize(arg)) - d[".tag"] = .str("app_link_user_details") - return .dictionary(d) - case .appUnlinkTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.AppUnlinkTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("app_unlink_team_details") - return .dictionary(d) - case .appUnlinkUserDetails(let arg): - var d = Serialization.getFields(TeamLog.AppUnlinkUserDetailsSerializer().serialize(arg)) - d[".tag"] = .str("app_unlink_user_details") - return .dictionary(d) - case .integrationConnectedDetails(let arg): - var d = Serialization.getFields(TeamLog.IntegrationConnectedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("integration_connected_details") - return .dictionary(d) - case .integrationDisconnectedDetails(let arg): - var d = Serialization.getFields(TeamLog.IntegrationDisconnectedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("integration_disconnected_details") - return .dictionary(d) - case .fileAddCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.FileAddCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_add_comment_details") - return .dictionary(d) - case .fileChangeCommentSubscriptionDetails(let arg): - var d = Serialization.getFields(TeamLog.FileChangeCommentSubscriptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_change_comment_subscription_details") - return .dictionary(d) - case .fileDeleteCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.FileDeleteCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_delete_comment_details") - return .dictionary(d) - case .fileEditCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.FileEditCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_edit_comment_details") - return .dictionary(d) - case .fileLikeCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.FileLikeCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_like_comment_details") - return .dictionary(d) - case .fileResolveCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.FileResolveCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_resolve_comment_details") - return .dictionary(d) - case .fileUnlikeCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.FileUnlikeCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_unlike_comment_details") - return .dictionary(d) - case .fileUnresolveCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.FileUnresolveCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_unresolve_comment_details") - return .dictionary(d) - case .governancePolicyAddFoldersDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyAddFoldersDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_add_folders_details") - return .dictionary(d) - case .governancePolicyAddFolderFailedDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyAddFolderFailedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_add_folder_failed_details") - return .dictionary(d) - case .governancePolicyContentDisposedDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyContentDisposedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_content_disposed_details") - return .dictionary(d) - case .governancePolicyCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_create_details") - return .dictionary(d) - case .governancePolicyDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_delete_details") - return .dictionary(d) - case .governancePolicyEditDetailsDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyEditDetailsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_edit_details_details") - return .dictionary(d) - case .governancePolicyEditDurationDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyEditDurationDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_edit_duration_details") - return .dictionary(d) - case .governancePolicyExportCreatedDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyExportCreatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_export_created_details") - return .dictionary(d) - case .governancePolicyExportRemovedDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyExportRemovedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_export_removed_details") - return .dictionary(d) - case .governancePolicyRemoveFoldersDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyRemoveFoldersDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_remove_folders_details") - return .dictionary(d) - case .governancePolicyReportCreatedDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyReportCreatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_report_created_details") - return .dictionary(d) - case .governancePolicyZipPartDownloadedDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyZipPartDownloadedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_zip_part_downloaded_details") - return .dictionary(d) - case .legalHoldsActivateAHoldDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsActivateAHoldDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_activate_a_hold_details") - return .dictionary(d) - case .legalHoldsAddMembersDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsAddMembersDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_add_members_details") - return .dictionary(d) - case .legalHoldsChangeHoldDetailsDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsChangeHoldDetailsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_change_hold_details_details") - return .dictionary(d) - case .legalHoldsChangeHoldNameDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsChangeHoldNameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_change_hold_name_details") - return .dictionary(d) - case .legalHoldsExportAHoldDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportAHoldDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_a_hold_details") - return .dictionary(d) - case .legalHoldsExportCancelledDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportCancelledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_cancelled_details") - return .dictionary(d) - case .legalHoldsExportDownloadedDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportDownloadedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_downloaded_details") - return .dictionary(d) - case .legalHoldsExportRemovedDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportRemovedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_removed_details") - return .dictionary(d) - case .legalHoldsReleaseAHoldDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsReleaseAHoldDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_release_a_hold_details") - return .dictionary(d) - case .legalHoldsRemoveMembersDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsRemoveMembersDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_remove_members_details") - return .dictionary(d) - case .legalHoldsReportAHoldDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsReportAHoldDetailsSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_report_a_hold_details") - return .dictionary(d) - case .deviceChangeIpDesktopDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceChangeIpDesktopDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_change_ip_desktop_details") - return .dictionary(d) - case .deviceChangeIpMobileDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceChangeIpMobileDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_change_ip_mobile_details") - return .dictionary(d) - case .deviceChangeIpWebDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceChangeIpWebDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_change_ip_web_details") - return .dictionary(d) - case .deviceDeleteOnUnlinkFailDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkFailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_delete_on_unlink_fail_details") - return .dictionary(d) - case .deviceDeleteOnUnlinkSuccessDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkSuccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_delete_on_unlink_success_details") - return .dictionary(d) - case .deviceLinkFailDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceLinkFailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_link_fail_details") - return .dictionary(d) - case .deviceLinkSuccessDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceLinkSuccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_link_success_details") - return .dictionary(d) - case .deviceManagementDisabledDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceManagementDisabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_management_disabled_details") - return .dictionary(d) - case .deviceManagementEnabledDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceManagementEnabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_management_enabled_details") - return .dictionary(d) - case .deviceSyncBackupStatusChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceSyncBackupStatusChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_sync_backup_status_changed_details") - return .dictionary(d) - case .deviceUnlinkDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceUnlinkDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_unlink_details") - return .dictionary(d) - case .dropboxPasswordsExportedDetails(let arg): - var d = Serialization.getFields(TeamLog.DropboxPasswordsExportedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("dropbox_passwords_exported_details") - return .dictionary(d) - case .dropboxPasswordsNewDeviceEnrolledDetails(let arg): - var d = Serialization.getFields(TeamLog.DropboxPasswordsNewDeviceEnrolledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("dropbox_passwords_new_device_enrolled_details") - return .dictionary(d) - case .emmRefreshAuthTokenDetails(let arg): - var d = Serialization.getFields(TeamLog.EmmRefreshAuthTokenDetailsSerializer().serialize(arg)) - d[".tag"] = .str("emm_refresh_auth_token_details") - return .dictionary(d) - case .externalDriveBackupEligibilityStatusCheckedDetails(let arg): - var d = Serialization.getFields(TeamLog.ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("external_drive_backup_eligibility_status_checked_details") - return .dictionary(d) - case .externalDriveBackupStatusChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.ExternalDriveBackupStatusChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("external_drive_backup_status_changed_details") - return .dictionary(d) - case .accountCaptureChangeAvailabilityDetails(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureChangeAvailabilityDetailsSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_change_availability_details") - return .dictionary(d) - case .accountCaptureMigrateAccountDetails(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureMigrateAccountDetailsSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_migrate_account_details") - return .dictionary(d) - case .accountCaptureNotificationEmailsSentDetails(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureNotificationEmailsSentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_notification_emails_sent_details") - return .dictionary(d) - case .accountCaptureRelinquishAccountDetails(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureRelinquishAccountDetailsSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_relinquish_account_details") - return .dictionary(d) - case .disabledDomainInvitesDetails(let arg): - var d = Serialization.getFields(TeamLog.DisabledDomainInvitesDetailsSerializer().serialize(arg)) - d[".tag"] = .str("disabled_domain_invites_details") - return .dictionary(d) - case .domainInvitesApproveRequestToJoinTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesApproveRequestToJoinTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_approve_request_to_join_team_details") - return .dictionary(d) - case .domainInvitesDeclineRequestToJoinTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesDeclineRequestToJoinTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_decline_request_to_join_team_details") - return .dictionary(d) - case .domainInvitesEmailExistingUsersDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesEmailExistingUsersDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_email_existing_users_details") - return .dictionary(d) - case .domainInvitesRequestToJoinTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesRequestToJoinTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_request_to_join_team_details") - return .dictionary(d) - case .domainInvitesSetInviteNewUserPrefToNoDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_no_details") - return .dictionary(d) - case .domainInvitesSetInviteNewUserPrefToYesDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_yes_details") - return .dictionary(d) - case .domainVerificationAddDomainFailDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainVerificationAddDomainFailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_verification_add_domain_fail_details") - return .dictionary(d) - case .domainVerificationAddDomainSuccessDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainVerificationAddDomainSuccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_verification_add_domain_success_details") - return .dictionary(d) - case .domainVerificationRemoveDomainDetails(let arg): - var d = Serialization.getFields(TeamLog.DomainVerificationRemoveDomainDetailsSerializer().serialize(arg)) - d[".tag"] = .str("domain_verification_remove_domain_details") - return .dictionary(d) - case .enabledDomainInvitesDetails(let arg): - var d = Serialization.getFields(TeamLog.EnabledDomainInvitesDetailsSerializer().serialize(arg)) - d[".tag"] = .str("enabled_domain_invites_details") - return .dictionary(d) - case .applyNamingConventionDetails(let arg): - var d = Serialization.getFields(TeamLog.ApplyNamingConventionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("apply_naming_convention_details") - return .dictionary(d) - case .createFolderDetails(let arg): - var d = Serialization.getFields(TeamLog.CreateFolderDetailsSerializer().serialize(arg)) - d[".tag"] = .str("create_folder_details") - return .dictionary(d) - case .fileAddDetails(let arg): - var d = Serialization.getFields(TeamLog.FileAddDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_add_details") - return .dictionary(d) - case .fileCopyDetails(let arg): - var d = Serialization.getFields(TeamLog.FileCopyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_copy_details") - return .dictionary(d) - case .fileDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.FileDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_delete_details") - return .dictionary(d) - case .fileDownloadDetails(let arg): - var d = Serialization.getFields(TeamLog.FileDownloadDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_download_details") - return .dictionary(d) - case .fileEditDetails(let arg): - var d = Serialization.getFields(TeamLog.FileEditDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_edit_details") - return .dictionary(d) - case .fileGetCopyReferenceDetails(let arg): - var d = Serialization.getFields(TeamLog.FileGetCopyReferenceDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_get_copy_reference_details") - return .dictionary(d) - case .fileLockingLockStatusChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.FileLockingLockStatusChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_locking_lock_status_changed_details") - return .dictionary(d) - case .fileMoveDetails(let arg): - var d = Serialization.getFields(TeamLog.FileMoveDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_move_details") - return .dictionary(d) - case .filePermanentlyDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.FilePermanentlyDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_permanently_delete_details") - return .dictionary(d) - case .filePreviewDetails(let arg): - var d = Serialization.getFields(TeamLog.FilePreviewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_preview_details") - return .dictionary(d) - case .fileRenameDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRenameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_rename_details") - return .dictionary(d) - case .fileRestoreDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRestoreDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_restore_details") - return .dictionary(d) - case .fileRevertDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRevertDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_revert_details") - return .dictionary(d) - case .fileRollbackChangesDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRollbackChangesDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_rollback_changes_details") - return .dictionary(d) - case .fileSaveCopyReferenceDetails(let arg): - var d = Serialization.getFields(TeamLog.FileSaveCopyReferenceDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_save_copy_reference_details") - return .dictionary(d) - case .folderOverviewDescriptionChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.FolderOverviewDescriptionChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("folder_overview_description_changed_details") - return .dictionary(d) - case .folderOverviewItemPinnedDetails(let arg): - var d = Serialization.getFields(TeamLog.FolderOverviewItemPinnedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("folder_overview_item_pinned_details") - return .dictionary(d) - case .folderOverviewItemUnpinnedDetails(let arg): - var d = Serialization.getFields(TeamLog.FolderOverviewItemUnpinnedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("folder_overview_item_unpinned_details") - return .dictionary(d) - case .objectLabelAddedDetails(let arg): - var d = Serialization.getFields(TeamLog.ObjectLabelAddedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("object_label_added_details") - return .dictionary(d) - case .objectLabelRemovedDetails(let arg): - var d = Serialization.getFields(TeamLog.ObjectLabelRemovedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("object_label_removed_details") - return .dictionary(d) - case .objectLabelUpdatedValueDetails(let arg): - var d = Serialization.getFields(TeamLog.ObjectLabelUpdatedValueDetailsSerializer().serialize(arg)) - d[".tag"] = .str("object_label_updated_value_details") - return .dictionary(d) - case .organizeFolderWithTidyDetails(let arg): - var d = Serialization.getFields(TeamLog.OrganizeFolderWithTidyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("organize_folder_with_tidy_details") - return .dictionary(d) - case .rewindFolderDetails(let arg): - var d = Serialization.getFields(TeamLog.RewindFolderDetailsSerializer().serialize(arg)) - d[".tag"] = .str("rewind_folder_details") - return .dictionary(d) - case .undoNamingConventionDetails(let arg): - var d = Serialization.getFields(TeamLog.UndoNamingConventionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("undo_naming_convention_details") - return .dictionary(d) - case .undoOrganizeFolderWithTidyDetails(let arg): - var d = Serialization.getFields(TeamLog.UndoOrganizeFolderWithTidyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("undo_organize_folder_with_tidy_details") - return .dictionary(d) - case .userTagsAddedDetails(let arg): - var d = Serialization.getFields(TeamLog.UserTagsAddedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("user_tags_added_details") - return .dictionary(d) - case .userTagsRemovedDetails(let arg): - var d = Serialization.getFields(TeamLog.UserTagsRemovedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("user_tags_removed_details") - return .dictionary(d) - case .emailIngestReceiveFileDetails(let arg): - var d = Serialization.getFields(TeamLog.EmailIngestReceiveFileDetailsSerializer().serialize(arg)) - d[".tag"] = .str("email_ingest_receive_file_details") - return .dictionary(d) - case .fileRequestChangeDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestChangeDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_request_change_details") - return .dictionary(d) - case .fileRequestCloseDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestCloseDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_request_close_details") - return .dictionary(d) - case .fileRequestCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_request_create_details") - return .dictionary(d) - case .fileRequestDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_request_delete_details") - return .dictionary(d) - case .fileRequestReceiveFileDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestReceiveFileDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_request_receive_file_details") - return .dictionary(d) - case .groupAddExternalIdDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupAddExternalIdDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_add_external_id_details") - return .dictionary(d) - case .groupAddMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupAddMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_add_member_details") - return .dictionary(d) - case .groupChangeExternalIdDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupChangeExternalIdDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_change_external_id_details") - return .dictionary(d) - case .groupChangeManagementTypeDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupChangeManagementTypeDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_change_management_type_details") - return .dictionary(d) - case .groupChangeMemberRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupChangeMemberRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_change_member_role_details") - return .dictionary(d) - case .groupCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_create_details") - return .dictionary(d) - case .groupDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_delete_details") - return .dictionary(d) - case .groupDescriptionUpdatedDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupDescriptionUpdatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_description_updated_details") - return .dictionary(d) - case .groupJoinPolicyUpdatedDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupJoinPolicyUpdatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_join_policy_updated_details") - return .dictionary(d) - case .groupMovedDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupMovedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_moved_details") - return .dictionary(d) - case .groupRemoveExternalIdDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupRemoveExternalIdDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_remove_external_id_details") - return .dictionary(d) - case .groupRemoveMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupRemoveMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_remove_member_details") - return .dictionary(d) - case .groupRenameDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupRenameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_rename_details") - return .dictionary(d) - case .accountLockOrUnlockedDetails(let arg): - var d = Serialization.getFields(TeamLog.AccountLockOrUnlockedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("account_lock_or_unlocked_details") - return .dictionary(d) - case .emmErrorDetails(let arg): - var d = Serialization.getFields(TeamLog.EmmErrorDetailsSerializer().serialize(arg)) - d[".tag"] = .str("emm_error_details") - return .dictionary(d) - case .guestAdminSignedInViaTrustedTeamsDetails(let arg): - var d = Serialization.getFields(TeamLog.GuestAdminSignedInViaTrustedTeamsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("guest_admin_signed_in_via_trusted_teams_details") - return .dictionary(d) - case .guestAdminSignedOutViaTrustedTeamsDetails(let arg): - var d = Serialization.getFields(TeamLog.GuestAdminSignedOutViaTrustedTeamsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("guest_admin_signed_out_via_trusted_teams_details") - return .dictionary(d) - case .loginFailDetails(let arg): - var d = Serialization.getFields(TeamLog.LoginFailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("login_fail_details") - return .dictionary(d) - case .loginSuccessDetails(let arg): - var d = Serialization.getFields(TeamLog.LoginSuccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("login_success_details") - return .dictionary(d) - case .logoutDetails(let arg): - var d = Serialization.getFields(TeamLog.LogoutDetailsSerializer().serialize(arg)) - d[".tag"] = .str("logout_details") - return .dictionary(d) - case .resellerSupportSessionEndDetails(let arg): - var d = Serialization.getFields(TeamLog.ResellerSupportSessionEndDetailsSerializer().serialize(arg)) - d[".tag"] = .str("reseller_support_session_end_details") - return .dictionary(d) - case .resellerSupportSessionStartDetails(let arg): - var d = Serialization.getFields(TeamLog.ResellerSupportSessionStartDetailsSerializer().serialize(arg)) - d[".tag"] = .str("reseller_support_session_start_details") - return .dictionary(d) - case .signInAsSessionEndDetails(let arg): - var d = Serialization.getFields(TeamLog.SignInAsSessionEndDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sign_in_as_session_end_details") - return .dictionary(d) - case .signInAsSessionStartDetails(let arg): - var d = Serialization.getFields(TeamLog.SignInAsSessionStartDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sign_in_as_session_start_details") - return .dictionary(d) - case .ssoErrorDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoErrorDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_error_details") - return .dictionary(d) - case .createTeamInviteLinkDetails(let arg): - var d = Serialization.getFields(TeamLog.CreateTeamInviteLinkDetailsSerializer().serialize(arg)) - d[".tag"] = .str("create_team_invite_link_details") - return .dictionary(d) - case .deleteTeamInviteLinkDetails(let arg): - var d = Serialization.getFields(TeamLog.DeleteTeamInviteLinkDetailsSerializer().serialize(arg)) - d[".tag"] = .str("delete_team_invite_link_details") - return .dictionary(d) - case .memberAddExternalIdDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberAddExternalIdDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_add_external_id_details") - return .dictionary(d) - case .memberAddNameDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberAddNameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_add_name_details") - return .dictionary(d) - case .memberChangeAdminRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeAdminRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_change_admin_role_details") - return .dictionary(d) - case .memberChangeEmailDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeEmailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_change_email_details") - return .dictionary(d) - case .memberChangeExternalIdDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeExternalIdDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_change_external_id_details") - return .dictionary(d) - case .memberChangeMembershipTypeDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeMembershipTypeDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_change_membership_type_details") - return .dictionary(d) - case .memberChangeNameDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeNameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_change_name_details") - return .dictionary(d) - case .memberChangeResellerRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeResellerRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_change_reseller_role_details") - return .dictionary(d) - case .memberChangeStatusDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeStatusDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_change_status_details") - return .dictionary(d) - case .memberDeleteManualContactsDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberDeleteManualContactsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_delete_manual_contacts_details") - return .dictionary(d) - case .memberDeleteProfilePhotoDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberDeleteProfilePhotoDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_delete_profile_photo_details") - return .dictionary(d) - case .memberPermanentlyDeleteAccountContentsDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberPermanentlyDeleteAccountContentsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_permanently_delete_account_contents_details") - return .dictionary(d) - case .memberRemoveExternalIdDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberRemoveExternalIdDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_remove_external_id_details") - return .dictionary(d) - case .memberSetProfilePhotoDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSetProfilePhotoDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_set_profile_photo_details") - return .dictionary(d) - case .memberSpaceLimitsAddCustomQuotaDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsAddCustomQuotaDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_add_custom_quota_details") - return .dictionary(d) - case .memberSpaceLimitsChangeCustomQuotaDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCustomQuotaDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_custom_quota_details") - return .dictionary(d) - case .memberSpaceLimitsChangeStatusDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangeStatusDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_status_details") - return .dictionary(d) - case .memberSpaceLimitsRemoveCustomQuotaDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_remove_custom_quota_details") - return .dictionary(d) - case .memberSuggestDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSuggestDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_suggest_details") - return .dictionary(d) - case .memberTransferAccountContentsDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberTransferAccountContentsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_transfer_account_contents_details") - return .dictionary(d) - case .pendingSecondaryEmailAddedDetails(let arg): - var d = Serialization.getFields(TeamLog.PendingSecondaryEmailAddedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("pending_secondary_email_added_details") - return .dictionary(d) - case .secondaryEmailDeletedDetails(let arg): - var d = Serialization.getFields(TeamLog.SecondaryEmailDeletedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("secondary_email_deleted_details") - return .dictionary(d) - case .secondaryEmailVerifiedDetails(let arg): - var d = Serialization.getFields(TeamLog.SecondaryEmailVerifiedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("secondary_email_verified_details") - return .dictionary(d) - case .secondaryMailsPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.SecondaryMailsPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("secondary_mails_policy_changed_details") - return .dictionary(d) - case .binderAddPageDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderAddPageDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_add_page_details") - return .dictionary(d) - case .binderAddSectionDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderAddSectionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_add_section_details") - return .dictionary(d) - case .binderRemovePageDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderRemovePageDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_remove_page_details") - return .dictionary(d) - case .binderRemoveSectionDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderRemoveSectionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_remove_section_details") - return .dictionary(d) - case .binderRenamePageDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderRenamePageDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_rename_page_details") - return .dictionary(d) - case .binderRenameSectionDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderRenameSectionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_rename_section_details") - return .dictionary(d) - case .binderReorderPageDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderReorderPageDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_reorder_page_details") - return .dictionary(d) - case .binderReorderSectionDetails(let arg): - var d = Serialization.getFields(TeamLog.BinderReorderSectionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("binder_reorder_section_details") - return .dictionary(d) - case .paperContentAddMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentAddMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_add_member_details") - return .dictionary(d) - case .paperContentAddToFolderDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentAddToFolderDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_add_to_folder_details") - return .dictionary(d) - case .paperContentArchiveDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentArchiveDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_archive_details") - return .dictionary(d) - case .paperContentCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_create_details") - return .dictionary(d) - case .paperContentPermanentlyDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentPermanentlyDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_permanently_delete_details") - return .dictionary(d) - case .paperContentRemoveFromFolderDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRemoveFromFolderDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_remove_from_folder_details") - return .dictionary(d) - case .paperContentRemoveMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRemoveMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_remove_member_details") - return .dictionary(d) - case .paperContentRenameDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRenameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_rename_details") - return .dictionary(d) - case .paperContentRestoreDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRestoreDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_restore_details") - return .dictionary(d) - case .paperDocAddCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocAddCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_add_comment_details") - return .dictionary(d) - case .paperDocChangeMemberRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocChangeMemberRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_change_member_role_details") - return .dictionary(d) - case .paperDocChangeSharingPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocChangeSharingPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_change_sharing_policy_details") - return .dictionary(d) - case .paperDocChangeSubscriptionDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocChangeSubscriptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_change_subscription_details") - return .dictionary(d) - case .paperDocDeletedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocDeletedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_deleted_details") - return .dictionary(d) - case .paperDocDeleteCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocDeleteCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_delete_comment_details") - return .dictionary(d) - case .paperDocDownloadDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocDownloadDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_download_details") - return .dictionary(d) - case .paperDocEditDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocEditDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_edit_details") - return .dictionary(d) - case .paperDocEditCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocEditCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_edit_comment_details") - return .dictionary(d) - case .paperDocFollowedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocFollowedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_followed_details") - return .dictionary(d) - case .paperDocMentionDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocMentionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_mention_details") - return .dictionary(d) - case .paperDocOwnershipChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocOwnershipChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_ownership_changed_details") - return .dictionary(d) - case .paperDocRequestAccessDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocRequestAccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_request_access_details") - return .dictionary(d) - case .paperDocResolveCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocResolveCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_resolve_comment_details") - return .dictionary(d) - case .paperDocRevertDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocRevertDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_revert_details") - return .dictionary(d) - case .paperDocSlackShareDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocSlackShareDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_slack_share_details") - return .dictionary(d) - case .paperDocTeamInviteDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocTeamInviteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_team_invite_details") - return .dictionary(d) - case .paperDocTrashedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocTrashedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_trashed_details") - return .dictionary(d) - case .paperDocUnresolveCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocUnresolveCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_unresolve_comment_details") - return .dictionary(d) - case .paperDocUntrashedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocUntrashedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_untrashed_details") - return .dictionary(d) - case .paperDocViewDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDocViewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_view_details") - return .dictionary(d) - case .paperExternalViewAllowDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperExternalViewAllowDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_external_view_allow_details") - return .dictionary(d) - case .paperExternalViewDefaultTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperExternalViewDefaultTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_external_view_default_team_details") - return .dictionary(d) - case .paperExternalViewForbidDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperExternalViewForbidDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_external_view_forbid_details") - return .dictionary(d) - case .paperFolderChangeSubscriptionDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderChangeSubscriptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_change_subscription_details") - return .dictionary(d) - case .paperFolderDeletedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderDeletedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_deleted_details") - return .dictionary(d) - case .paperFolderFollowedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderFollowedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_followed_details") - return .dictionary(d) - case .paperFolderTeamInviteDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderTeamInviteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_team_invite_details") - return .dictionary(d) - case .paperPublishedLinkChangePermissionDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkChangePermissionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_change_permission_details") - return .dictionary(d) - case .paperPublishedLinkCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_create_details") - return .dictionary(d) - case .paperPublishedLinkDisabledDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkDisabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_disabled_details") - return .dictionary(d) - case .paperPublishedLinkViewDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkViewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_view_details") - return .dictionary(d) - case .passwordChangeDetails(let arg): - var d = Serialization.getFields(TeamLog.PasswordChangeDetailsSerializer().serialize(arg)) - d[".tag"] = .str("password_change_details") - return .dictionary(d) - case .passwordResetDetails(let arg): - var d = Serialization.getFields(TeamLog.PasswordResetDetailsSerializer().serialize(arg)) - d[".tag"] = .str("password_reset_details") - return .dictionary(d) - case .passwordResetAllDetails(let arg): - var d = Serialization.getFields(TeamLog.PasswordResetAllDetailsSerializer().serialize(arg)) - d[".tag"] = .str("password_reset_all_details") - return .dictionary(d) - case .classificationCreateReportDetails(let arg): - var d = Serialization.getFields(TeamLog.ClassificationCreateReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("classification_create_report_details") - return .dictionary(d) - case .classificationCreateReportFailDetails(let arg): - var d = Serialization.getFields(TeamLog.ClassificationCreateReportFailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("classification_create_report_fail_details") - return .dictionary(d) - case .emmCreateExceptionsReportDetails(let arg): - var d = Serialization.getFields(TeamLog.EmmCreateExceptionsReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("emm_create_exceptions_report_details") - return .dictionary(d) - case .emmCreateUsageReportDetails(let arg): - var d = Serialization.getFields(TeamLog.EmmCreateUsageReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("emm_create_usage_report_details") - return .dictionary(d) - case .exportMembersReportDetails(let arg): - var d = Serialization.getFields(TeamLog.ExportMembersReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("export_members_report_details") - return .dictionary(d) - case .exportMembersReportFailDetails(let arg): - var d = Serialization.getFields(TeamLog.ExportMembersReportFailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("export_members_report_fail_details") - return .dictionary(d) - case .externalSharingCreateReportDetails(let arg): - var d = Serialization.getFields(TeamLog.ExternalSharingCreateReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("external_sharing_create_report_details") - return .dictionary(d) - case .externalSharingReportFailedDetails(let arg): - var d = Serialization.getFields(TeamLog.ExternalSharingReportFailedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("external_sharing_report_failed_details") - return .dictionary(d) - case .noExpirationLinkGenCreateReportDetails(let arg): - var d = Serialization.getFields(TeamLog.NoExpirationLinkGenCreateReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("no_expiration_link_gen_create_report_details") - return .dictionary(d) - case .noExpirationLinkGenReportFailedDetails(let arg): - var d = Serialization.getFields(TeamLog.NoExpirationLinkGenReportFailedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("no_expiration_link_gen_report_failed_details") - return .dictionary(d) - case .noPasswordLinkGenCreateReportDetails(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkGenCreateReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_gen_create_report_details") - return .dictionary(d) - case .noPasswordLinkGenReportFailedDetails(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkGenReportFailedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_gen_report_failed_details") - return .dictionary(d) - case .noPasswordLinkViewCreateReportDetails(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkViewCreateReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_view_create_report_details") - return .dictionary(d) - case .noPasswordLinkViewReportFailedDetails(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkViewReportFailedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_view_report_failed_details") - return .dictionary(d) - case .outdatedLinkViewCreateReportDetails(let arg): - var d = Serialization.getFields(TeamLog.OutdatedLinkViewCreateReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("outdated_link_view_create_report_details") - return .dictionary(d) - case .outdatedLinkViewReportFailedDetails(let arg): - var d = Serialization.getFields(TeamLog.OutdatedLinkViewReportFailedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("outdated_link_view_report_failed_details") - return .dictionary(d) - case .paperAdminExportStartDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperAdminExportStartDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_admin_export_start_details") - return .dictionary(d) - case .smartSyncCreateAdminPrivilegeReportDetails(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncCreateAdminPrivilegeReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_create_admin_privilege_report_details") - return .dictionary(d) - case .teamActivityCreateReportDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamActivityCreateReportDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_activity_create_report_details") - return .dictionary(d) - case .teamActivityCreateReportFailDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamActivityCreateReportFailDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_activity_create_report_fail_details") - return .dictionary(d) - case .collectionShareDetails(let arg): - var d = Serialization.getFields(TeamLog.CollectionShareDetailsSerializer().serialize(arg)) - d[".tag"] = .str("collection_share_details") - return .dictionary(d) - case .fileTransfersFileAddDetails(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersFileAddDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_file_add_details") - return .dictionary(d) - case .fileTransfersTransferDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_delete_details") - return .dictionary(d) - case .fileTransfersTransferDownloadDetails(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferDownloadDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_download_details") - return .dictionary(d) - case .fileTransfersTransferSendDetails(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferSendDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_send_details") - return .dictionary(d) - case .fileTransfersTransferViewDetails(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferViewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_view_details") - return .dictionary(d) - case .noteAclInviteOnlyDetails(let arg): - var d = Serialization.getFields(TeamLog.NoteAclInviteOnlyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("note_acl_invite_only_details") - return .dictionary(d) - case .noteAclLinkDetails(let arg): - var d = Serialization.getFields(TeamLog.NoteAclLinkDetailsSerializer().serialize(arg)) - d[".tag"] = .str("note_acl_link_details") - return .dictionary(d) - case .noteAclTeamLinkDetails(let arg): - var d = Serialization.getFields(TeamLog.NoteAclTeamLinkDetailsSerializer().serialize(arg)) - d[".tag"] = .str("note_acl_team_link_details") - return .dictionary(d) - case .noteSharedDetails(let arg): - var d = Serialization.getFields(TeamLog.NoteSharedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("note_shared_details") - return .dictionary(d) - case .noteShareReceiveDetails(let arg): - var d = Serialization.getFields(TeamLog.NoteShareReceiveDetailsSerializer().serialize(arg)) - d[".tag"] = .str("note_share_receive_details") - return .dictionary(d) - case .openNoteSharedDetails(let arg): - var d = Serialization.getFields(TeamLog.OpenNoteSharedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("open_note_shared_details") - return .dictionary(d) - case .sfAddGroupDetails(let arg): - var d = Serialization.getFields(TeamLog.SfAddGroupDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_add_group_details") - return .dictionary(d) - case .sfAllowNonMembersToViewSharedLinksDetails(let arg): - var d = Serialization.getFields(TeamLog.SfAllowNonMembersToViewSharedLinksDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_allow_non_members_to_view_shared_links_details") - return .dictionary(d) - case .sfExternalInviteWarnDetails(let arg): - var d = Serialization.getFields(TeamLog.SfExternalInviteWarnDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_external_invite_warn_details") - return .dictionary(d) - case .sfFbInviteDetails(let arg): - var d = Serialization.getFields(TeamLog.SfFbInviteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_fb_invite_details") - return .dictionary(d) - case .sfFbInviteChangeRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.SfFbInviteChangeRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_fb_invite_change_role_details") - return .dictionary(d) - case .sfFbUninviteDetails(let arg): - var d = Serialization.getFields(TeamLog.SfFbUninviteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_fb_uninvite_details") - return .dictionary(d) - case .sfInviteGroupDetails(let arg): - var d = Serialization.getFields(TeamLog.SfInviteGroupDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_invite_group_details") - return .dictionary(d) - case .sfTeamGrantAccessDetails(let arg): - var d = Serialization.getFields(TeamLog.SfTeamGrantAccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_grant_access_details") - return .dictionary(d) - case .sfTeamInviteDetails(let arg): - var d = Serialization.getFields(TeamLog.SfTeamInviteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_invite_details") - return .dictionary(d) - case .sfTeamInviteChangeRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.SfTeamInviteChangeRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_invite_change_role_details") - return .dictionary(d) - case .sfTeamJoinDetails(let arg): - var d = Serialization.getFields(TeamLog.SfTeamJoinDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_join_details") - return .dictionary(d) - case .sfTeamJoinFromOobLinkDetails(let arg): - var d = Serialization.getFields(TeamLog.SfTeamJoinFromOobLinkDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_join_from_oob_link_details") - return .dictionary(d) - case .sfTeamUninviteDetails(let arg): - var d = Serialization.getFields(TeamLog.SfTeamUninviteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_uninvite_details") - return .dictionary(d) - case .sharedContentAddInviteesDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddInviteesDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_invitees_details") - return .dictionary(d) - case .sharedContentAddLinkExpiryDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddLinkExpiryDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_link_expiry_details") - return .dictionary(d) - case .sharedContentAddLinkPasswordDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddLinkPasswordDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_link_password_details") - return .dictionary(d) - case .sharedContentAddMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_member_details") - return .dictionary(d) - case .sharedContentChangeDownloadsPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeDownloadsPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_downloads_policy_details") - return .dictionary(d) - case .sharedContentChangeInviteeRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeInviteeRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_invitee_role_details") - return .dictionary(d) - case .sharedContentChangeLinkAudienceDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeLinkAudienceDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_link_audience_details") - return .dictionary(d) - case .sharedContentChangeLinkExpiryDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeLinkExpiryDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_link_expiry_details") - return .dictionary(d) - case .sharedContentChangeLinkPasswordDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeLinkPasswordDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_link_password_details") - return .dictionary(d) - case .sharedContentChangeMemberRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeMemberRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_member_role_details") - return .dictionary(d) - case .sharedContentChangeViewerInfoPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeViewerInfoPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_viewer_info_policy_details") - return .dictionary(d) - case .sharedContentClaimInvitationDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentClaimInvitationDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_claim_invitation_details") - return .dictionary(d) - case .sharedContentCopyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentCopyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_copy_details") - return .dictionary(d) - case .sharedContentDownloadDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentDownloadDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_download_details") - return .dictionary(d) - case .sharedContentRelinquishMembershipDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRelinquishMembershipDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_relinquish_membership_details") - return .dictionary(d) - case .sharedContentRemoveInviteesDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveInviteesDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_invitees_details") - return .dictionary(d) - case .sharedContentRemoveLinkExpiryDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveLinkExpiryDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_link_expiry_details") - return .dictionary(d) - case .sharedContentRemoveLinkPasswordDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveLinkPasswordDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_link_password_details") - return .dictionary(d) - case .sharedContentRemoveMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_member_details") - return .dictionary(d) - case .sharedContentRequestAccessDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRequestAccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_request_access_details") - return .dictionary(d) - case .sharedContentRestoreInviteesDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRestoreInviteesDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_restore_invitees_details") - return .dictionary(d) - case .sharedContentRestoreMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRestoreMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_restore_member_details") - return .dictionary(d) - case .sharedContentUnshareDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentUnshareDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_unshare_details") - return .dictionary(d) - case .sharedContentViewDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedContentViewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_view_details") - return .dictionary(d) - case .sharedFolderChangeLinkPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeLinkPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_link_policy_details") - return .dictionary(d) - case .sharedFolderChangeMembersInheritancePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeMembersInheritancePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_members_inheritance_policy_details") - return .dictionary(d) - case .sharedFolderChangeMembersManagementPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeMembersManagementPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_members_management_policy_details") - return .dictionary(d) - case .sharedFolderChangeMembersPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeMembersPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_members_policy_details") - return .dictionary(d) - case .sharedFolderCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_create_details") - return .dictionary(d) - case .sharedFolderDeclineInvitationDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderDeclineInvitationDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_decline_invitation_details") - return .dictionary(d) - case .sharedFolderMountDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderMountDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_mount_details") - return .dictionary(d) - case .sharedFolderNestDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderNestDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_nest_details") - return .dictionary(d) - case .sharedFolderTransferOwnershipDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderTransferOwnershipDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_transfer_ownership_details") - return .dictionary(d) - case .sharedFolderUnmountDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderUnmountDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_unmount_details") - return .dictionary(d) - case .sharedLinkAddExpiryDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkAddExpiryDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_add_expiry_details") - return .dictionary(d) - case .sharedLinkChangeExpiryDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkChangeExpiryDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_change_expiry_details") - return .dictionary(d) - case .sharedLinkChangeVisibilityDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkChangeVisibilityDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_change_visibility_details") - return .dictionary(d) - case .sharedLinkCopyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkCopyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_copy_details") - return .dictionary(d) - case .sharedLinkCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_create_details") - return .dictionary(d) - case .sharedLinkDisableDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkDisableDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_disable_details") - return .dictionary(d) - case .sharedLinkDownloadDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkDownloadDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_download_details") - return .dictionary(d) - case .sharedLinkRemoveExpiryDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkRemoveExpiryDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_remove_expiry_details") - return .dictionary(d) - case .sharedLinkSettingsAddExpirationDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAddExpirationDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_add_expiration_details") - return .dictionary(d) - case .sharedLinkSettingsAddPasswordDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAddPasswordDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_add_password_details") - return .dictionary(d) - case .sharedLinkSettingsAllowDownloadDisabledDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadDisabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_allow_download_disabled_details") - return .dictionary(d) - case .sharedLinkSettingsAllowDownloadEnabledDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadEnabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_allow_download_enabled_details") - return .dictionary(d) - case .sharedLinkSettingsChangeAudienceDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsChangeAudienceDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_change_audience_details") - return .dictionary(d) - case .sharedLinkSettingsChangeExpirationDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsChangeExpirationDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_change_expiration_details") - return .dictionary(d) - case .sharedLinkSettingsChangePasswordDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsChangePasswordDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_change_password_details") - return .dictionary(d) - case .sharedLinkSettingsRemoveExpirationDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsRemoveExpirationDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_remove_expiration_details") - return .dictionary(d) - case .sharedLinkSettingsRemovePasswordDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsRemovePasswordDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_remove_password_details") - return .dictionary(d) - case .sharedLinkShareDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkShareDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_share_details") - return .dictionary(d) - case .sharedLinkViewDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkViewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_view_details") - return .dictionary(d) - case .sharedNoteOpenedDetails(let arg): - var d = Serialization.getFields(TeamLog.SharedNoteOpenedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shared_note_opened_details") - return .dictionary(d) - case .shmodelDisableDownloadsDetails(let arg): - var d = Serialization.getFields(TeamLog.ShmodelDisableDownloadsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shmodel_disable_downloads_details") - return .dictionary(d) - case .shmodelEnableDownloadsDetails(let arg): - var d = Serialization.getFields(TeamLog.ShmodelEnableDownloadsDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shmodel_enable_downloads_details") - return .dictionary(d) - case .shmodelGroupShareDetails(let arg): - var d = Serialization.getFields(TeamLog.ShmodelGroupShareDetailsSerializer().serialize(arg)) - d[".tag"] = .str("shmodel_group_share_details") - return .dictionary(d) - case .showcaseAccessGrantedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseAccessGrantedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_access_granted_details") - return .dictionary(d) - case .showcaseAddMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseAddMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_add_member_details") - return .dictionary(d) - case .showcaseArchivedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseArchivedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_archived_details") - return .dictionary(d) - case .showcaseCreatedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseCreatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_created_details") - return .dictionary(d) - case .showcaseDeleteCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseDeleteCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_delete_comment_details") - return .dictionary(d) - case .showcaseEditedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseEditedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_edited_details") - return .dictionary(d) - case .showcaseEditCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseEditCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_edit_comment_details") - return .dictionary(d) - case .showcaseFileAddedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileAddedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_added_details") - return .dictionary(d) - case .showcaseFileDownloadDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileDownloadDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_download_details") - return .dictionary(d) - case .showcaseFileRemovedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileRemovedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_removed_details") - return .dictionary(d) - case .showcaseFileViewDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileViewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_view_details") - return .dictionary(d) - case .showcasePermanentlyDeletedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcasePermanentlyDeletedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_permanently_deleted_details") - return .dictionary(d) - case .showcasePostCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcasePostCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_post_comment_details") - return .dictionary(d) - case .showcaseRemoveMemberDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRemoveMemberDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_remove_member_details") - return .dictionary(d) - case .showcaseRenamedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRenamedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_renamed_details") - return .dictionary(d) - case .showcaseRequestAccessDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRequestAccessDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_request_access_details") - return .dictionary(d) - case .showcaseResolveCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseResolveCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_resolve_comment_details") - return .dictionary(d) - case .showcaseRestoredDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRestoredDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_restored_details") - return .dictionary(d) - case .showcaseTrashedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseTrashedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_trashed_details") - return .dictionary(d) - case .showcaseTrashedDeprecatedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseTrashedDeprecatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_trashed_deprecated_details") - return .dictionary(d) - case .showcaseUnresolveCommentDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseUnresolveCommentDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_unresolve_comment_details") - return .dictionary(d) - case .showcaseUntrashedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseUntrashedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_untrashed_details") - return .dictionary(d) - case .showcaseUntrashedDeprecatedDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseUntrashedDeprecatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_untrashed_deprecated_details") - return .dictionary(d) - case .showcaseViewDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseViewDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_view_details") - return .dictionary(d) - case .ssoAddCertDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoAddCertDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_add_cert_details") - return .dictionary(d) - case .ssoAddLoginUrlDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoAddLoginUrlDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_add_login_url_details") - return .dictionary(d) - case .ssoAddLogoutUrlDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoAddLogoutUrlDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_add_logout_url_details") - return .dictionary(d) - case .ssoChangeCertDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeCertDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_cert_details") - return .dictionary(d) - case .ssoChangeLoginUrlDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeLoginUrlDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_login_url_details") - return .dictionary(d) - case .ssoChangeLogoutUrlDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeLogoutUrlDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_logout_url_details") - return .dictionary(d) - case .ssoChangeSamlIdentityModeDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeSamlIdentityModeDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_saml_identity_mode_details") - return .dictionary(d) - case .ssoRemoveCertDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoRemoveCertDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_remove_cert_details") - return .dictionary(d) - case .ssoRemoveLoginUrlDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoRemoveLoginUrlDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_remove_login_url_details") - return .dictionary(d) - case .ssoRemoveLogoutUrlDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoRemoveLogoutUrlDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_remove_logout_url_details") - return .dictionary(d) - case .teamFolderChangeStatusDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderChangeStatusDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_change_status_details") - return .dictionary(d) - case .teamFolderCreateDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderCreateDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_create_details") - return .dictionary(d) - case .teamFolderDowngradeDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderDowngradeDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_downgrade_details") - return .dictionary(d) - case .teamFolderPermanentlyDeleteDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderPermanentlyDeleteDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_permanently_delete_details") - return .dictionary(d) - case .teamFolderRenameDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderRenameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_rename_details") - return .dictionary(d) - case .teamSelectiveSyncSettingsChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamSelectiveSyncSettingsChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_selective_sync_settings_changed_details") - return .dictionary(d) - case .accountCaptureChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_change_policy_details") - return .dictionary(d) - case .adminEmailRemindersChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.AdminEmailRemindersChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("admin_email_reminders_changed_details") - return .dictionary(d) - case .allowDownloadDisabledDetails(let arg): - var d = Serialization.getFields(TeamLog.AllowDownloadDisabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("allow_download_disabled_details") - return .dictionary(d) - case .allowDownloadEnabledDetails(let arg): - var d = Serialization.getFields(TeamLog.AllowDownloadEnabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("allow_download_enabled_details") - return .dictionary(d) - case .appPermissionsChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.AppPermissionsChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("app_permissions_changed_details") - return .dictionary(d) - case .cameraUploadsPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.CameraUploadsPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("camera_uploads_policy_changed_details") - return .dictionary(d) - case .captureTranscriptPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.CaptureTranscriptPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("capture_transcript_policy_changed_details") - return .dictionary(d) - case .classificationChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.ClassificationChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("classification_change_policy_details") - return .dictionary(d) - case .computerBackupPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.ComputerBackupPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("computer_backup_policy_changed_details") - return .dictionary(d) - case .contentAdministrationPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.ContentAdministrationPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("content_administration_policy_changed_details") - return .dictionary(d) - case .dataPlacementRestrictionChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.DataPlacementRestrictionChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("data_placement_restriction_change_policy_details") - return .dictionary(d) - case .dataPlacementRestrictionSatisfyPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.DataPlacementRestrictionSatisfyPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("data_placement_restriction_satisfy_policy_details") - return .dictionary(d) - case .deviceApprovalsAddExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsAddExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_add_exception_details") - return .dictionary(d) - case .deviceApprovalsChangeDesktopPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeDesktopPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_desktop_policy_details") - return .dictionary(d) - case .deviceApprovalsChangeMobilePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeMobilePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_mobile_policy_details") - return .dictionary(d) - case .deviceApprovalsChangeOverageActionDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeOverageActionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_overage_action_details") - return .dictionary(d) - case .deviceApprovalsChangeUnlinkActionDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeUnlinkActionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_unlink_action_details") - return .dictionary(d) - case .deviceApprovalsRemoveExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsRemoveExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_remove_exception_details") - return .dictionary(d) - case .directoryRestrictionsAddMembersDetails(let arg): - var d = Serialization.getFields(TeamLog.DirectoryRestrictionsAddMembersDetailsSerializer().serialize(arg)) - d[".tag"] = .str("directory_restrictions_add_members_details") - return .dictionary(d) - case .directoryRestrictionsRemoveMembersDetails(let arg): - var d = Serialization.getFields(TeamLog.DirectoryRestrictionsRemoveMembersDetailsSerializer().serialize(arg)) - d[".tag"] = .str("directory_restrictions_remove_members_details") - return .dictionary(d) - case .dropboxPasswordsPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.DropboxPasswordsPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("dropbox_passwords_policy_changed_details") - return .dictionary(d) - case .emailIngestPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.EmailIngestPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("email_ingest_policy_changed_details") - return .dictionary(d) - case .emmAddExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.EmmAddExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("emm_add_exception_details") - return .dictionary(d) - case .emmChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.EmmChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("emm_change_policy_details") - return .dictionary(d) - case .emmRemoveExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.EmmRemoveExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("emm_remove_exception_details") - return .dictionary(d) - case .extendedVersionHistoryChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.ExtendedVersionHistoryChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("extended_version_history_change_policy_details") - return .dictionary(d) - case .externalDriveBackupPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.ExternalDriveBackupPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("external_drive_backup_policy_changed_details") - return .dictionary(d) - case .fileCommentsChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.FileCommentsChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_comments_change_policy_details") - return .dictionary(d) - case .fileLockingPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.FileLockingPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_locking_policy_changed_details") - return .dictionary(d) - case .fileProviderMigrationPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.FileProviderMigrationPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_provider_migration_policy_changed_details") - return .dictionary(d) - case .fileRequestsChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestsChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_requests_change_policy_details") - return .dictionary(d) - case .fileRequestsEmailsEnabledDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestsEmailsEnabledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_requests_emails_enabled_details") - return .dictionary(d) - case .fileRequestsEmailsRestrictedToTeamOnlyDetails(let arg): - var d = Serialization.getFields(TeamLog.FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_requests_emails_restricted_to_team_only_details") - return .dictionary(d) - case .fileTransfersPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_policy_changed_details") - return .dictionary(d) - case .folderLinkRestrictionPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.FolderLinkRestrictionPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("folder_link_restriction_policy_changed_details") - return .dictionary(d) - case .googleSsoChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.GoogleSsoChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("google_sso_change_policy_details") - return .dictionary(d) - case .groupUserManagementChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.GroupUserManagementChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("group_user_management_change_policy_details") - return .dictionary(d) - case .integrationPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.IntegrationPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("integration_policy_changed_details") - return .dictionary(d) - case .inviteAcceptanceEmailPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.InviteAcceptanceEmailPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("invite_acceptance_email_policy_changed_details") - return .dictionary(d) - case .memberRequestsChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberRequestsChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_requests_change_policy_details") - return .dictionary(d) - case .memberSendInvitePolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSendInvitePolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_send_invite_policy_changed_details") - return .dictionary(d) - case .memberSpaceLimitsAddExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsAddExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_add_exception_details") - return .dictionary(d) - case .memberSpaceLimitsChangeCapsTypePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_caps_type_policy_details") - return .dictionary(d) - case .memberSpaceLimitsChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_policy_details") - return .dictionary(d) - case .memberSpaceLimitsRemoveExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_remove_exception_details") - return .dictionary(d) - case .memberSuggestionsChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.MemberSuggestionsChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("member_suggestions_change_policy_details") - return .dictionary(d) - case .microsoftOfficeAddinChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.MicrosoftOfficeAddinChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("microsoft_office_addin_change_policy_details") - return .dictionary(d) - case .networkControlChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.NetworkControlChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("network_control_change_policy_details") - return .dictionary(d) - case .paperChangeDeploymentPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperChangeDeploymentPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_deployment_policy_details") - return .dictionary(d) - case .paperChangeMemberLinkPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperChangeMemberLinkPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_member_link_policy_details") - return .dictionary(d) - case .paperChangeMemberPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperChangeMemberPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_member_policy_details") - return .dictionary(d) - case .paperChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_policy_details") - return .dictionary(d) - case .paperDefaultFolderPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDefaultFolderPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_default_folder_policy_changed_details") - return .dictionary(d) - case .paperDesktopPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperDesktopPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_desktop_policy_changed_details") - return .dictionary(d) - case .paperEnabledUsersGroupAdditionDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperEnabledUsersGroupAdditionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_enabled_users_group_addition_details") - return .dictionary(d) - case .paperEnabledUsersGroupRemovalDetails(let arg): - var d = Serialization.getFields(TeamLog.PaperEnabledUsersGroupRemovalDetailsSerializer().serialize(arg)) - d[".tag"] = .str("paper_enabled_users_group_removal_details") - return .dictionary(d) - case .passwordStrengthRequirementsChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.PasswordStrengthRequirementsChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("password_strength_requirements_change_policy_details") - return .dictionary(d) - case .permanentDeleteChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.PermanentDeleteChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("permanent_delete_change_policy_details") - return .dictionary(d) - case .resellerSupportChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.ResellerSupportChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("reseller_support_change_policy_details") - return .dictionary(d) - case .rewindPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.RewindPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("rewind_policy_changed_details") - return .dictionary(d) - case .sendForSignaturePolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.SendForSignaturePolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("send_for_signature_policy_changed_details") - return .dictionary(d) - case .sharingChangeFolderJoinPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeFolderJoinPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_folder_join_policy_details") - return .dictionary(d) - case .sharingChangeLinkAllowChangeExpirationPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_allow_change_expiration_policy_details") - return .dictionary(d) - case .sharingChangeLinkDefaultExpirationPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkDefaultExpirationPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_default_expiration_policy_details") - return .dictionary(d) - case .sharingChangeLinkEnforcePasswordPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkEnforcePasswordPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_enforce_password_policy_details") - return .dictionary(d) - case .sharingChangeLinkPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_policy_details") - return .dictionary(d) - case .sharingChangeMemberPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeMemberPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_member_policy_details") - return .dictionary(d) - case .showcaseChangeDownloadPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseChangeDownloadPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_change_download_policy_details") - return .dictionary(d) - case .showcaseChangeEnabledPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseChangeEnabledPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_change_enabled_policy_details") - return .dictionary(d) - case .showcaseChangeExternalSharingPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseChangeExternalSharingPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("showcase_change_external_sharing_policy_details") - return .dictionary(d) - case .smarterSmartSyncPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.SmarterSmartSyncPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("smarter_smart_sync_policy_changed_details") - return .dictionary(d) - case .smartSyncChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_change_policy_details") - return .dictionary(d) - case .smartSyncNotOptOutDetails(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncNotOptOutDetailsSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_not_opt_out_details") - return .dictionary(d) - case .smartSyncOptOutDetails(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncOptOutDetailsSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_opt_out_details") - return .dictionary(d) - case .ssoChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.SsoChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_policy_details") - return .dictionary(d) - case .teamBrandingPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamBrandingPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_branding_policy_changed_details") - return .dictionary(d) - case .teamExtensionsPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamExtensionsPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_extensions_policy_changed_details") - return .dictionary(d) - case .teamSelectiveSyncPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamSelectiveSyncPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_selective_sync_policy_changed_details") - return .dictionary(d) - case .teamSharingWhitelistSubjectsChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamSharingWhitelistSubjectsChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_sharing_whitelist_subjects_changed_details") - return .dictionary(d) - case .tfaAddExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaAddExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_add_exception_details") - return .dictionary(d) - case .tfaChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_change_policy_details") - return .dictionary(d) - case .tfaRemoveExceptionDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaRemoveExceptionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_remove_exception_details") - return .dictionary(d) - case .twoAccountChangePolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.TwoAccountChangePolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("two_account_change_policy_details") - return .dictionary(d) - case .viewerInfoPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.ViewerInfoPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("viewer_info_policy_changed_details") - return .dictionary(d) - case .watermarkingPolicyChangedDetails(let arg): - var d = Serialization.getFields(TeamLog.WatermarkingPolicyChangedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("watermarking_policy_changed_details") - return .dictionary(d) - case .webSessionsChangeActiveSessionLimitDetails(let arg): - var d = Serialization.getFields(TeamLog.WebSessionsChangeActiveSessionLimitDetailsSerializer().serialize(arg)) - d[".tag"] = .str("web_sessions_change_active_session_limit_details") - return .dictionary(d) - case .webSessionsChangeFixedLengthPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.WebSessionsChangeFixedLengthPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("web_sessions_change_fixed_length_policy_details") - return .dictionary(d) - case .webSessionsChangeIdleLengthPolicyDetails(let arg): - var d = Serialization.getFields(TeamLog.WebSessionsChangeIdleLengthPolicyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("web_sessions_change_idle_length_policy_details") - return .dictionary(d) - case .dataResidencyMigrationRequestSuccessfulDetails(let arg): - var d = Serialization.getFields(TeamLog.DataResidencyMigrationRequestSuccessfulDetailsSerializer().serialize(arg)) - d[".tag"] = .str("data_residency_migration_request_successful_details") - return .dictionary(d) - case .dataResidencyMigrationRequestUnsuccessfulDetails(let arg): - var d = Serialization.getFields(TeamLog.DataResidencyMigrationRequestUnsuccessfulDetailsSerializer().serialize(arg)) - d[".tag"] = .str("data_residency_migration_request_unsuccessful_details") - return .dictionary(d) - case .teamMergeFromDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeFromDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_from_details") - return .dictionary(d) - case .teamMergeToDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeToDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_to_details") - return .dictionary(d) - case .teamProfileAddBackgroundDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileAddBackgroundDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_add_background_details") - return .dictionary(d) - case .teamProfileAddLogoDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileAddLogoDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_add_logo_details") - return .dictionary(d) - case .teamProfileChangeBackgroundDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeBackgroundDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_background_details") - return .dictionary(d) - case .teamProfileChangeDefaultLanguageDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeDefaultLanguageDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_default_language_details") - return .dictionary(d) - case .teamProfileChangeLogoDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeLogoDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_logo_details") - return .dictionary(d) - case .teamProfileChangeNameDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeNameDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_name_details") - return .dictionary(d) - case .teamProfileRemoveBackgroundDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileRemoveBackgroundDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_remove_background_details") - return .dictionary(d) - case .teamProfileRemoveLogoDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileRemoveLogoDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_remove_logo_details") - return .dictionary(d) - case .tfaAddBackupPhoneDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaAddBackupPhoneDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_add_backup_phone_details") - return .dictionary(d) - case .tfaAddSecurityKeyDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaAddSecurityKeyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_add_security_key_details") - return .dictionary(d) - case .tfaChangeBackupPhoneDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaChangeBackupPhoneDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_change_backup_phone_details") - return .dictionary(d) - case .tfaChangeStatusDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaChangeStatusDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_change_status_details") - return .dictionary(d) - case .tfaRemoveBackupPhoneDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaRemoveBackupPhoneDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_remove_backup_phone_details") - return .dictionary(d) - case .tfaRemoveSecurityKeyDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaRemoveSecurityKeyDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_remove_security_key_details") - return .dictionary(d) - case .tfaResetDetails(let arg): - var d = Serialization.getFields(TeamLog.TfaResetDetailsSerializer().serialize(arg)) - d[".tag"] = .str("tfa_reset_details") - return .dictionary(d) - case .changedEnterpriseAdminRoleDetails(let arg): - var d = Serialization.getFields(TeamLog.ChangedEnterpriseAdminRoleDetailsSerializer().serialize(arg)) - d[".tag"] = .str("changed_enterprise_admin_role_details") - return .dictionary(d) - case .changedEnterpriseConnectedTeamStatusDetails(let arg): - var d = Serialization.getFields(TeamLog.ChangedEnterpriseConnectedTeamStatusDetailsSerializer().serialize(arg)) - d[".tag"] = .str("changed_enterprise_connected_team_status_details") - return .dictionary(d) - case .endedEnterpriseAdminSessionDetails(let arg): - var d = Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("ended_enterprise_admin_session_details") - return .dictionary(d) - case .endedEnterpriseAdminSessionDeprecatedDetails(let arg): - var d = Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionDeprecatedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("ended_enterprise_admin_session_deprecated_details") - return .dictionary(d) - case .enterpriseSettingsLockingDetails(let arg): - var d = Serialization.getFields(TeamLog.EnterpriseSettingsLockingDetailsSerializer().serialize(arg)) - d[".tag"] = .str("enterprise_settings_locking_details") - return .dictionary(d) - case .guestAdminChangeStatusDetails(let arg): - var d = Serialization.getFields(TeamLog.GuestAdminChangeStatusDetailsSerializer().serialize(arg)) - d[".tag"] = .str("guest_admin_change_status_details") - return .dictionary(d) - case .startedEnterpriseAdminSessionDetails(let arg): - var d = Serialization.getFields(TeamLog.StartedEnterpriseAdminSessionDetailsSerializer().serialize(arg)) - d[".tag"] = .str("started_enterprise_admin_session_details") - return .dictionary(d) - case .teamMergeRequestAcceptedDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAcceptedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_accepted_details") - return .dictionary(d) - case .teamMergeRequestAcceptedShownToPrimaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_accepted_shown_to_primary_team_details") - return .dictionary(d) - case .teamMergeRequestAcceptedShownToSecondaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_accepted_shown_to_secondary_team_details") - return .dictionary(d) - case .teamMergeRequestAutoCanceledDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAutoCanceledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_auto_canceled_details") - return .dictionary(d) - case .teamMergeRequestCanceledDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestCanceledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_canceled_details") - return .dictionary(d) - case .teamMergeRequestCanceledShownToPrimaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_canceled_shown_to_primary_team_details") - return .dictionary(d) - case .teamMergeRequestCanceledShownToSecondaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_canceled_shown_to_secondary_team_details") - return .dictionary(d) - case .teamMergeRequestExpiredDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestExpiredDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_expired_details") - return .dictionary(d) - case .teamMergeRequestExpiredShownToPrimaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_expired_shown_to_primary_team_details") - return .dictionary(d) - case .teamMergeRequestExpiredShownToSecondaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_expired_shown_to_secondary_team_details") - return .dictionary(d) - case .teamMergeRequestRejectedShownToPrimaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_rejected_shown_to_primary_team_details") - return .dictionary(d) - case .teamMergeRequestRejectedShownToSecondaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_rejected_shown_to_secondary_team_details") - return .dictionary(d) - case .teamMergeRequestReminderDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestReminderDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_reminder_details") - return .dictionary(d) - case .teamMergeRequestReminderShownToPrimaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_reminder_shown_to_primary_team_details") - return .dictionary(d) - case .teamMergeRequestReminderShownToSecondaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_reminder_shown_to_secondary_team_details") - return .dictionary(d) - case .teamMergeRequestRevokedDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestRevokedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_revoked_details") - return .dictionary(d) - case .teamMergeRequestSentShownToPrimaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_sent_shown_to_primary_team_details") - return .dictionary(d) - case .teamMergeRequestSentShownToSecondaryTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_sent_shown_to_secondary_team_details") - return .dictionary(d) - case .missingDetails(let arg): - var d = Serialization.getFields(TeamLog.MissingDetailsSerializer().serialize(arg)) - d[".tag"] = .str("missing_details") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> EventDetails { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admin_alerting_alert_state_changed_details": - let v = TeamLog.AdminAlertingAlertStateChangedDetailsSerializer().deserialize(json) - return EventDetails.adminAlertingAlertStateChangedDetails(v) - case "admin_alerting_changed_alert_config_details": - let v = TeamLog.AdminAlertingChangedAlertConfigDetailsSerializer().deserialize(json) - return EventDetails.adminAlertingChangedAlertConfigDetails(v) - case "admin_alerting_triggered_alert_details": - let v = TeamLog.AdminAlertingTriggeredAlertDetailsSerializer().deserialize(json) - return EventDetails.adminAlertingTriggeredAlertDetails(v) - case "app_blocked_by_permissions_details": - let v = TeamLog.AppBlockedByPermissionsDetailsSerializer().deserialize(json) - return EventDetails.appBlockedByPermissionsDetails(v) - case "app_link_team_details": - let v = TeamLog.AppLinkTeamDetailsSerializer().deserialize(json) - return EventDetails.appLinkTeamDetails(v) - case "app_link_user_details": - let v = TeamLog.AppLinkUserDetailsSerializer().deserialize(json) - return EventDetails.appLinkUserDetails(v) - case "app_unlink_team_details": - let v = TeamLog.AppUnlinkTeamDetailsSerializer().deserialize(json) - return EventDetails.appUnlinkTeamDetails(v) - case "app_unlink_user_details": - let v = TeamLog.AppUnlinkUserDetailsSerializer().deserialize(json) - return EventDetails.appUnlinkUserDetails(v) - case "integration_connected_details": - let v = TeamLog.IntegrationConnectedDetailsSerializer().deserialize(json) - return EventDetails.integrationConnectedDetails(v) - case "integration_disconnected_details": - let v = TeamLog.IntegrationDisconnectedDetailsSerializer().deserialize(json) - return EventDetails.integrationDisconnectedDetails(v) - case "file_add_comment_details": - let v = TeamLog.FileAddCommentDetailsSerializer().deserialize(json) - return EventDetails.fileAddCommentDetails(v) - case "file_change_comment_subscription_details": - let v = TeamLog.FileChangeCommentSubscriptionDetailsSerializer().deserialize(json) - return EventDetails.fileChangeCommentSubscriptionDetails(v) - case "file_delete_comment_details": - let v = TeamLog.FileDeleteCommentDetailsSerializer().deserialize(json) - return EventDetails.fileDeleteCommentDetails(v) - case "file_edit_comment_details": - let v = TeamLog.FileEditCommentDetailsSerializer().deserialize(json) - return EventDetails.fileEditCommentDetails(v) - case "file_like_comment_details": - let v = TeamLog.FileLikeCommentDetailsSerializer().deserialize(json) - return EventDetails.fileLikeCommentDetails(v) - case "file_resolve_comment_details": - let v = TeamLog.FileResolveCommentDetailsSerializer().deserialize(json) - return EventDetails.fileResolveCommentDetails(v) - case "file_unlike_comment_details": - let v = TeamLog.FileUnlikeCommentDetailsSerializer().deserialize(json) - return EventDetails.fileUnlikeCommentDetails(v) - case "file_unresolve_comment_details": - let v = TeamLog.FileUnresolveCommentDetailsSerializer().deserialize(json) - return EventDetails.fileUnresolveCommentDetails(v) - case "governance_policy_add_folders_details": - let v = TeamLog.GovernancePolicyAddFoldersDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyAddFoldersDetails(v) - case "governance_policy_add_folder_failed_details": - let v = TeamLog.GovernancePolicyAddFolderFailedDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyAddFolderFailedDetails(v) - case "governance_policy_content_disposed_details": - let v = TeamLog.GovernancePolicyContentDisposedDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyContentDisposedDetails(v) - case "governance_policy_create_details": - let v = TeamLog.GovernancePolicyCreateDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyCreateDetails(v) - case "governance_policy_delete_details": - let v = TeamLog.GovernancePolicyDeleteDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyDeleteDetails(v) - case "governance_policy_edit_details_details": - let v = TeamLog.GovernancePolicyEditDetailsDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyEditDetailsDetails(v) - case "governance_policy_edit_duration_details": - let v = TeamLog.GovernancePolicyEditDurationDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyEditDurationDetails(v) - case "governance_policy_export_created_details": - let v = TeamLog.GovernancePolicyExportCreatedDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyExportCreatedDetails(v) - case "governance_policy_export_removed_details": - let v = TeamLog.GovernancePolicyExportRemovedDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyExportRemovedDetails(v) - case "governance_policy_remove_folders_details": - let v = TeamLog.GovernancePolicyRemoveFoldersDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyRemoveFoldersDetails(v) - case "governance_policy_report_created_details": - let v = TeamLog.GovernancePolicyReportCreatedDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyReportCreatedDetails(v) - case "governance_policy_zip_part_downloaded_details": - let v = TeamLog.GovernancePolicyZipPartDownloadedDetailsSerializer().deserialize(json) - return EventDetails.governancePolicyZipPartDownloadedDetails(v) - case "legal_holds_activate_a_hold_details": - let v = TeamLog.LegalHoldsActivateAHoldDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsActivateAHoldDetails(v) - case "legal_holds_add_members_details": - let v = TeamLog.LegalHoldsAddMembersDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsAddMembersDetails(v) - case "legal_holds_change_hold_details_details": - let v = TeamLog.LegalHoldsChangeHoldDetailsDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsChangeHoldDetailsDetails(v) - case "legal_holds_change_hold_name_details": - let v = TeamLog.LegalHoldsChangeHoldNameDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsChangeHoldNameDetails(v) - case "legal_holds_export_a_hold_details": - let v = TeamLog.LegalHoldsExportAHoldDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsExportAHoldDetails(v) - case "legal_holds_export_cancelled_details": - let v = TeamLog.LegalHoldsExportCancelledDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsExportCancelledDetails(v) - case "legal_holds_export_downloaded_details": - let v = TeamLog.LegalHoldsExportDownloadedDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsExportDownloadedDetails(v) - case "legal_holds_export_removed_details": - let v = TeamLog.LegalHoldsExportRemovedDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsExportRemovedDetails(v) - case "legal_holds_release_a_hold_details": - let v = TeamLog.LegalHoldsReleaseAHoldDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsReleaseAHoldDetails(v) - case "legal_holds_remove_members_details": - let v = TeamLog.LegalHoldsRemoveMembersDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsRemoveMembersDetails(v) - case "legal_holds_report_a_hold_details": - let v = TeamLog.LegalHoldsReportAHoldDetailsSerializer().deserialize(json) - return EventDetails.legalHoldsReportAHoldDetails(v) - case "device_change_ip_desktop_details": - let v = TeamLog.DeviceChangeIpDesktopDetailsSerializer().deserialize(json) - return EventDetails.deviceChangeIpDesktopDetails(v) - case "device_change_ip_mobile_details": - let v = TeamLog.DeviceChangeIpMobileDetailsSerializer().deserialize(json) - return EventDetails.deviceChangeIpMobileDetails(v) - case "device_change_ip_web_details": - let v = TeamLog.DeviceChangeIpWebDetailsSerializer().deserialize(json) - return EventDetails.deviceChangeIpWebDetails(v) - case "device_delete_on_unlink_fail_details": - let v = TeamLog.DeviceDeleteOnUnlinkFailDetailsSerializer().deserialize(json) - return EventDetails.deviceDeleteOnUnlinkFailDetails(v) - case "device_delete_on_unlink_success_details": - let v = TeamLog.DeviceDeleteOnUnlinkSuccessDetailsSerializer().deserialize(json) - return EventDetails.deviceDeleteOnUnlinkSuccessDetails(v) - case "device_link_fail_details": - let v = TeamLog.DeviceLinkFailDetailsSerializer().deserialize(json) - return EventDetails.deviceLinkFailDetails(v) - case "device_link_success_details": - let v = TeamLog.DeviceLinkSuccessDetailsSerializer().deserialize(json) - return EventDetails.deviceLinkSuccessDetails(v) - case "device_management_disabled_details": - let v = TeamLog.DeviceManagementDisabledDetailsSerializer().deserialize(json) - return EventDetails.deviceManagementDisabledDetails(v) - case "device_management_enabled_details": - let v = TeamLog.DeviceManagementEnabledDetailsSerializer().deserialize(json) - return EventDetails.deviceManagementEnabledDetails(v) - case "device_sync_backup_status_changed_details": - let v = TeamLog.DeviceSyncBackupStatusChangedDetailsSerializer().deserialize(json) - return EventDetails.deviceSyncBackupStatusChangedDetails(v) - case "device_unlink_details": - let v = TeamLog.DeviceUnlinkDetailsSerializer().deserialize(json) - return EventDetails.deviceUnlinkDetails(v) - case "dropbox_passwords_exported_details": - let v = TeamLog.DropboxPasswordsExportedDetailsSerializer().deserialize(json) - return EventDetails.dropboxPasswordsExportedDetails(v) - case "dropbox_passwords_new_device_enrolled_details": - let v = TeamLog.DropboxPasswordsNewDeviceEnrolledDetailsSerializer().deserialize(json) - return EventDetails.dropboxPasswordsNewDeviceEnrolledDetails(v) - case "emm_refresh_auth_token_details": - let v = TeamLog.EmmRefreshAuthTokenDetailsSerializer().deserialize(json) - return EventDetails.emmRefreshAuthTokenDetails(v) - case "external_drive_backup_eligibility_status_checked_details": - let v = TeamLog.ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer().deserialize(json) - return EventDetails.externalDriveBackupEligibilityStatusCheckedDetails(v) - case "external_drive_backup_status_changed_details": - let v = TeamLog.ExternalDriveBackupStatusChangedDetailsSerializer().deserialize(json) - return EventDetails.externalDriveBackupStatusChangedDetails(v) - case "account_capture_change_availability_details": - let v = TeamLog.AccountCaptureChangeAvailabilityDetailsSerializer().deserialize(json) - return EventDetails.accountCaptureChangeAvailabilityDetails(v) - case "account_capture_migrate_account_details": - let v = TeamLog.AccountCaptureMigrateAccountDetailsSerializer().deserialize(json) - return EventDetails.accountCaptureMigrateAccountDetails(v) - case "account_capture_notification_emails_sent_details": - let v = TeamLog.AccountCaptureNotificationEmailsSentDetailsSerializer().deserialize(json) - return EventDetails.accountCaptureNotificationEmailsSentDetails(v) - case "account_capture_relinquish_account_details": - let v = TeamLog.AccountCaptureRelinquishAccountDetailsSerializer().deserialize(json) - return EventDetails.accountCaptureRelinquishAccountDetails(v) - case "disabled_domain_invites_details": - let v = TeamLog.DisabledDomainInvitesDetailsSerializer().deserialize(json) - return EventDetails.disabledDomainInvitesDetails(v) - case "domain_invites_approve_request_to_join_team_details": - let v = TeamLog.DomainInvitesApproveRequestToJoinTeamDetailsSerializer().deserialize(json) - return EventDetails.domainInvitesApproveRequestToJoinTeamDetails(v) - case "domain_invites_decline_request_to_join_team_details": - let v = TeamLog.DomainInvitesDeclineRequestToJoinTeamDetailsSerializer().deserialize(json) - return EventDetails.domainInvitesDeclineRequestToJoinTeamDetails(v) - case "domain_invites_email_existing_users_details": - let v = TeamLog.DomainInvitesEmailExistingUsersDetailsSerializer().deserialize(json) - return EventDetails.domainInvitesEmailExistingUsersDetails(v) - case "domain_invites_request_to_join_team_details": - let v = TeamLog.DomainInvitesRequestToJoinTeamDetailsSerializer().deserialize(json) - return EventDetails.domainInvitesRequestToJoinTeamDetails(v) - case "domain_invites_set_invite_new_user_pref_to_no_details": - let v = TeamLog.DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer().deserialize(json) - return EventDetails.domainInvitesSetInviteNewUserPrefToNoDetails(v) - case "domain_invites_set_invite_new_user_pref_to_yes_details": - let v = TeamLog.DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer().deserialize(json) - return EventDetails.domainInvitesSetInviteNewUserPrefToYesDetails(v) - case "domain_verification_add_domain_fail_details": - let v = TeamLog.DomainVerificationAddDomainFailDetailsSerializer().deserialize(json) - return EventDetails.domainVerificationAddDomainFailDetails(v) - case "domain_verification_add_domain_success_details": - let v = TeamLog.DomainVerificationAddDomainSuccessDetailsSerializer().deserialize(json) - return EventDetails.domainVerificationAddDomainSuccessDetails(v) - case "domain_verification_remove_domain_details": - let v = TeamLog.DomainVerificationRemoveDomainDetailsSerializer().deserialize(json) - return EventDetails.domainVerificationRemoveDomainDetails(v) - case "enabled_domain_invites_details": - let v = TeamLog.EnabledDomainInvitesDetailsSerializer().deserialize(json) - return EventDetails.enabledDomainInvitesDetails(v) - case "apply_naming_convention_details": - let v = TeamLog.ApplyNamingConventionDetailsSerializer().deserialize(json) - return EventDetails.applyNamingConventionDetails(v) - case "create_folder_details": - let v = TeamLog.CreateFolderDetailsSerializer().deserialize(json) - return EventDetails.createFolderDetails(v) - case "file_add_details": - let v = TeamLog.FileAddDetailsSerializer().deserialize(json) - return EventDetails.fileAddDetails(v) - case "file_copy_details": - let v = TeamLog.FileCopyDetailsSerializer().deserialize(json) - return EventDetails.fileCopyDetails(v) - case "file_delete_details": - let v = TeamLog.FileDeleteDetailsSerializer().deserialize(json) - return EventDetails.fileDeleteDetails(v) - case "file_download_details": - let v = TeamLog.FileDownloadDetailsSerializer().deserialize(json) - return EventDetails.fileDownloadDetails(v) - case "file_edit_details": - let v = TeamLog.FileEditDetailsSerializer().deserialize(json) - return EventDetails.fileEditDetails(v) - case "file_get_copy_reference_details": - let v = TeamLog.FileGetCopyReferenceDetailsSerializer().deserialize(json) - return EventDetails.fileGetCopyReferenceDetails(v) - case "file_locking_lock_status_changed_details": - let v = TeamLog.FileLockingLockStatusChangedDetailsSerializer().deserialize(json) - return EventDetails.fileLockingLockStatusChangedDetails(v) - case "file_move_details": - let v = TeamLog.FileMoveDetailsSerializer().deserialize(json) - return EventDetails.fileMoveDetails(v) - case "file_permanently_delete_details": - let v = TeamLog.FilePermanentlyDeleteDetailsSerializer().deserialize(json) - return EventDetails.filePermanentlyDeleteDetails(v) - case "file_preview_details": - let v = TeamLog.FilePreviewDetailsSerializer().deserialize(json) - return EventDetails.filePreviewDetails(v) - case "file_rename_details": - let v = TeamLog.FileRenameDetailsSerializer().deserialize(json) - return EventDetails.fileRenameDetails(v) - case "file_restore_details": - let v = TeamLog.FileRestoreDetailsSerializer().deserialize(json) - return EventDetails.fileRestoreDetails(v) - case "file_revert_details": - let v = TeamLog.FileRevertDetailsSerializer().deserialize(json) - return EventDetails.fileRevertDetails(v) - case "file_rollback_changes_details": - let v = TeamLog.FileRollbackChangesDetailsSerializer().deserialize(json) - return EventDetails.fileRollbackChangesDetails(v) - case "file_save_copy_reference_details": - let v = TeamLog.FileSaveCopyReferenceDetailsSerializer().deserialize(json) - return EventDetails.fileSaveCopyReferenceDetails(v) - case "folder_overview_description_changed_details": - let v = TeamLog.FolderOverviewDescriptionChangedDetailsSerializer().deserialize(json) - return EventDetails.folderOverviewDescriptionChangedDetails(v) - case "folder_overview_item_pinned_details": - let v = TeamLog.FolderOverviewItemPinnedDetailsSerializer().deserialize(json) - return EventDetails.folderOverviewItemPinnedDetails(v) - case "folder_overview_item_unpinned_details": - let v = TeamLog.FolderOverviewItemUnpinnedDetailsSerializer().deserialize(json) - return EventDetails.folderOverviewItemUnpinnedDetails(v) - case "object_label_added_details": - let v = TeamLog.ObjectLabelAddedDetailsSerializer().deserialize(json) - return EventDetails.objectLabelAddedDetails(v) - case "object_label_removed_details": - let v = TeamLog.ObjectLabelRemovedDetailsSerializer().deserialize(json) - return EventDetails.objectLabelRemovedDetails(v) - case "object_label_updated_value_details": - let v = TeamLog.ObjectLabelUpdatedValueDetailsSerializer().deserialize(json) - return EventDetails.objectLabelUpdatedValueDetails(v) - case "organize_folder_with_tidy_details": - let v = TeamLog.OrganizeFolderWithTidyDetailsSerializer().deserialize(json) - return EventDetails.organizeFolderWithTidyDetails(v) - case "rewind_folder_details": - let v = TeamLog.RewindFolderDetailsSerializer().deserialize(json) - return EventDetails.rewindFolderDetails(v) - case "undo_naming_convention_details": - let v = TeamLog.UndoNamingConventionDetailsSerializer().deserialize(json) - return EventDetails.undoNamingConventionDetails(v) - case "undo_organize_folder_with_tidy_details": - let v = TeamLog.UndoOrganizeFolderWithTidyDetailsSerializer().deserialize(json) - return EventDetails.undoOrganizeFolderWithTidyDetails(v) - case "user_tags_added_details": - let v = TeamLog.UserTagsAddedDetailsSerializer().deserialize(json) - return EventDetails.userTagsAddedDetails(v) - case "user_tags_removed_details": - let v = TeamLog.UserTagsRemovedDetailsSerializer().deserialize(json) - return EventDetails.userTagsRemovedDetails(v) - case "email_ingest_receive_file_details": - let v = TeamLog.EmailIngestReceiveFileDetailsSerializer().deserialize(json) - return EventDetails.emailIngestReceiveFileDetails(v) - case "file_request_change_details": - let v = TeamLog.FileRequestChangeDetailsSerializer().deserialize(json) - return EventDetails.fileRequestChangeDetails(v) - case "file_request_close_details": - let v = TeamLog.FileRequestCloseDetailsSerializer().deserialize(json) - return EventDetails.fileRequestCloseDetails(v) - case "file_request_create_details": - let v = TeamLog.FileRequestCreateDetailsSerializer().deserialize(json) - return EventDetails.fileRequestCreateDetails(v) - case "file_request_delete_details": - let v = TeamLog.FileRequestDeleteDetailsSerializer().deserialize(json) - return EventDetails.fileRequestDeleteDetails(v) - case "file_request_receive_file_details": - let v = TeamLog.FileRequestReceiveFileDetailsSerializer().deserialize(json) - return EventDetails.fileRequestReceiveFileDetails(v) - case "group_add_external_id_details": - let v = TeamLog.GroupAddExternalIdDetailsSerializer().deserialize(json) - return EventDetails.groupAddExternalIdDetails(v) - case "group_add_member_details": - let v = TeamLog.GroupAddMemberDetailsSerializer().deserialize(json) - return EventDetails.groupAddMemberDetails(v) - case "group_change_external_id_details": - let v = TeamLog.GroupChangeExternalIdDetailsSerializer().deserialize(json) - return EventDetails.groupChangeExternalIdDetails(v) - case "group_change_management_type_details": - let v = TeamLog.GroupChangeManagementTypeDetailsSerializer().deserialize(json) - return EventDetails.groupChangeManagementTypeDetails(v) - case "group_change_member_role_details": - let v = TeamLog.GroupChangeMemberRoleDetailsSerializer().deserialize(json) - return EventDetails.groupChangeMemberRoleDetails(v) - case "group_create_details": - let v = TeamLog.GroupCreateDetailsSerializer().deserialize(json) - return EventDetails.groupCreateDetails(v) - case "group_delete_details": - let v = TeamLog.GroupDeleteDetailsSerializer().deserialize(json) - return EventDetails.groupDeleteDetails(v) - case "group_description_updated_details": - let v = TeamLog.GroupDescriptionUpdatedDetailsSerializer().deserialize(json) - return EventDetails.groupDescriptionUpdatedDetails(v) - case "group_join_policy_updated_details": - let v = TeamLog.GroupJoinPolicyUpdatedDetailsSerializer().deserialize(json) - return EventDetails.groupJoinPolicyUpdatedDetails(v) - case "group_moved_details": - let v = TeamLog.GroupMovedDetailsSerializer().deserialize(json) - return EventDetails.groupMovedDetails(v) - case "group_remove_external_id_details": - let v = TeamLog.GroupRemoveExternalIdDetailsSerializer().deserialize(json) - return EventDetails.groupRemoveExternalIdDetails(v) - case "group_remove_member_details": - let v = TeamLog.GroupRemoveMemberDetailsSerializer().deserialize(json) - return EventDetails.groupRemoveMemberDetails(v) - case "group_rename_details": - let v = TeamLog.GroupRenameDetailsSerializer().deserialize(json) - return EventDetails.groupRenameDetails(v) - case "account_lock_or_unlocked_details": - let v = TeamLog.AccountLockOrUnlockedDetailsSerializer().deserialize(json) - return EventDetails.accountLockOrUnlockedDetails(v) - case "emm_error_details": - let v = TeamLog.EmmErrorDetailsSerializer().deserialize(json) - return EventDetails.emmErrorDetails(v) - case "guest_admin_signed_in_via_trusted_teams_details": - let v = TeamLog.GuestAdminSignedInViaTrustedTeamsDetailsSerializer().deserialize(json) - return EventDetails.guestAdminSignedInViaTrustedTeamsDetails(v) - case "guest_admin_signed_out_via_trusted_teams_details": - let v = TeamLog.GuestAdminSignedOutViaTrustedTeamsDetailsSerializer().deserialize(json) - return EventDetails.guestAdminSignedOutViaTrustedTeamsDetails(v) - case "login_fail_details": - let v = TeamLog.LoginFailDetailsSerializer().deserialize(json) - return EventDetails.loginFailDetails(v) - case "login_success_details": - let v = TeamLog.LoginSuccessDetailsSerializer().deserialize(json) - return EventDetails.loginSuccessDetails(v) - case "logout_details": - let v = TeamLog.LogoutDetailsSerializer().deserialize(json) - return EventDetails.logoutDetails(v) - case "reseller_support_session_end_details": - let v = TeamLog.ResellerSupportSessionEndDetailsSerializer().deserialize(json) - return EventDetails.resellerSupportSessionEndDetails(v) - case "reseller_support_session_start_details": - let v = TeamLog.ResellerSupportSessionStartDetailsSerializer().deserialize(json) - return EventDetails.resellerSupportSessionStartDetails(v) - case "sign_in_as_session_end_details": - let v = TeamLog.SignInAsSessionEndDetailsSerializer().deserialize(json) - return EventDetails.signInAsSessionEndDetails(v) - case "sign_in_as_session_start_details": - let v = TeamLog.SignInAsSessionStartDetailsSerializer().deserialize(json) - return EventDetails.signInAsSessionStartDetails(v) - case "sso_error_details": - let v = TeamLog.SsoErrorDetailsSerializer().deserialize(json) - return EventDetails.ssoErrorDetails(v) - case "create_team_invite_link_details": - let v = TeamLog.CreateTeamInviteLinkDetailsSerializer().deserialize(json) - return EventDetails.createTeamInviteLinkDetails(v) - case "delete_team_invite_link_details": - let v = TeamLog.DeleteTeamInviteLinkDetailsSerializer().deserialize(json) - return EventDetails.deleteTeamInviteLinkDetails(v) - case "member_add_external_id_details": - let v = TeamLog.MemberAddExternalIdDetailsSerializer().deserialize(json) - return EventDetails.memberAddExternalIdDetails(v) - case "member_add_name_details": - let v = TeamLog.MemberAddNameDetailsSerializer().deserialize(json) - return EventDetails.memberAddNameDetails(v) - case "member_change_admin_role_details": - let v = TeamLog.MemberChangeAdminRoleDetailsSerializer().deserialize(json) - return EventDetails.memberChangeAdminRoleDetails(v) - case "member_change_email_details": - let v = TeamLog.MemberChangeEmailDetailsSerializer().deserialize(json) - return EventDetails.memberChangeEmailDetails(v) - case "member_change_external_id_details": - let v = TeamLog.MemberChangeExternalIdDetailsSerializer().deserialize(json) - return EventDetails.memberChangeExternalIdDetails(v) - case "member_change_membership_type_details": - let v = TeamLog.MemberChangeMembershipTypeDetailsSerializer().deserialize(json) - return EventDetails.memberChangeMembershipTypeDetails(v) - case "member_change_name_details": - let v = TeamLog.MemberChangeNameDetailsSerializer().deserialize(json) - return EventDetails.memberChangeNameDetails(v) - case "member_change_reseller_role_details": - let v = TeamLog.MemberChangeResellerRoleDetailsSerializer().deserialize(json) - return EventDetails.memberChangeResellerRoleDetails(v) - case "member_change_status_details": - let v = TeamLog.MemberChangeStatusDetailsSerializer().deserialize(json) - return EventDetails.memberChangeStatusDetails(v) - case "member_delete_manual_contacts_details": - let v = TeamLog.MemberDeleteManualContactsDetailsSerializer().deserialize(json) - return EventDetails.memberDeleteManualContactsDetails(v) - case "member_delete_profile_photo_details": - let v = TeamLog.MemberDeleteProfilePhotoDetailsSerializer().deserialize(json) - return EventDetails.memberDeleteProfilePhotoDetails(v) - case "member_permanently_delete_account_contents_details": - let v = TeamLog.MemberPermanentlyDeleteAccountContentsDetailsSerializer().deserialize(json) - return EventDetails.memberPermanentlyDeleteAccountContentsDetails(v) - case "member_remove_external_id_details": - let v = TeamLog.MemberRemoveExternalIdDetailsSerializer().deserialize(json) - return EventDetails.memberRemoveExternalIdDetails(v) - case "member_set_profile_photo_details": - let v = TeamLog.MemberSetProfilePhotoDetailsSerializer().deserialize(json) - return EventDetails.memberSetProfilePhotoDetails(v) - case "member_space_limits_add_custom_quota_details": - let v = TeamLog.MemberSpaceLimitsAddCustomQuotaDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsAddCustomQuotaDetails(v) - case "member_space_limits_change_custom_quota_details": - let v = TeamLog.MemberSpaceLimitsChangeCustomQuotaDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsChangeCustomQuotaDetails(v) - case "member_space_limits_change_status_details": - let v = TeamLog.MemberSpaceLimitsChangeStatusDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsChangeStatusDetails(v) - case "member_space_limits_remove_custom_quota_details": - let v = TeamLog.MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsRemoveCustomQuotaDetails(v) - case "member_suggest_details": - let v = TeamLog.MemberSuggestDetailsSerializer().deserialize(json) - return EventDetails.memberSuggestDetails(v) - case "member_transfer_account_contents_details": - let v = TeamLog.MemberTransferAccountContentsDetailsSerializer().deserialize(json) - return EventDetails.memberTransferAccountContentsDetails(v) - case "pending_secondary_email_added_details": - let v = TeamLog.PendingSecondaryEmailAddedDetailsSerializer().deserialize(json) - return EventDetails.pendingSecondaryEmailAddedDetails(v) - case "secondary_email_deleted_details": - let v = TeamLog.SecondaryEmailDeletedDetailsSerializer().deserialize(json) - return EventDetails.secondaryEmailDeletedDetails(v) - case "secondary_email_verified_details": - let v = TeamLog.SecondaryEmailVerifiedDetailsSerializer().deserialize(json) - return EventDetails.secondaryEmailVerifiedDetails(v) - case "secondary_mails_policy_changed_details": - let v = TeamLog.SecondaryMailsPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.secondaryMailsPolicyChangedDetails(v) - case "binder_add_page_details": - let v = TeamLog.BinderAddPageDetailsSerializer().deserialize(json) - return EventDetails.binderAddPageDetails(v) - case "binder_add_section_details": - let v = TeamLog.BinderAddSectionDetailsSerializer().deserialize(json) - return EventDetails.binderAddSectionDetails(v) - case "binder_remove_page_details": - let v = TeamLog.BinderRemovePageDetailsSerializer().deserialize(json) - return EventDetails.binderRemovePageDetails(v) - case "binder_remove_section_details": - let v = TeamLog.BinderRemoveSectionDetailsSerializer().deserialize(json) - return EventDetails.binderRemoveSectionDetails(v) - case "binder_rename_page_details": - let v = TeamLog.BinderRenamePageDetailsSerializer().deserialize(json) - return EventDetails.binderRenamePageDetails(v) - case "binder_rename_section_details": - let v = TeamLog.BinderRenameSectionDetailsSerializer().deserialize(json) - return EventDetails.binderRenameSectionDetails(v) - case "binder_reorder_page_details": - let v = TeamLog.BinderReorderPageDetailsSerializer().deserialize(json) - return EventDetails.binderReorderPageDetails(v) - case "binder_reorder_section_details": - let v = TeamLog.BinderReorderSectionDetailsSerializer().deserialize(json) - return EventDetails.binderReorderSectionDetails(v) - case "paper_content_add_member_details": - let v = TeamLog.PaperContentAddMemberDetailsSerializer().deserialize(json) - return EventDetails.paperContentAddMemberDetails(v) - case "paper_content_add_to_folder_details": - let v = TeamLog.PaperContentAddToFolderDetailsSerializer().deserialize(json) - return EventDetails.paperContentAddToFolderDetails(v) - case "paper_content_archive_details": - let v = TeamLog.PaperContentArchiveDetailsSerializer().deserialize(json) - return EventDetails.paperContentArchiveDetails(v) - case "paper_content_create_details": - let v = TeamLog.PaperContentCreateDetailsSerializer().deserialize(json) - return EventDetails.paperContentCreateDetails(v) - case "paper_content_permanently_delete_details": - let v = TeamLog.PaperContentPermanentlyDeleteDetailsSerializer().deserialize(json) - return EventDetails.paperContentPermanentlyDeleteDetails(v) - case "paper_content_remove_from_folder_details": - let v = TeamLog.PaperContentRemoveFromFolderDetailsSerializer().deserialize(json) - return EventDetails.paperContentRemoveFromFolderDetails(v) - case "paper_content_remove_member_details": - let v = TeamLog.PaperContentRemoveMemberDetailsSerializer().deserialize(json) - return EventDetails.paperContentRemoveMemberDetails(v) - case "paper_content_rename_details": - let v = TeamLog.PaperContentRenameDetailsSerializer().deserialize(json) - return EventDetails.paperContentRenameDetails(v) - case "paper_content_restore_details": - let v = TeamLog.PaperContentRestoreDetailsSerializer().deserialize(json) - return EventDetails.paperContentRestoreDetails(v) - case "paper_doc_add_comment_details": - let v = TeamLog.PaperDocAddCommentDetailsSerializer().deserialize(json) - return EventDetails.paperDocAddCommentDetails(v) - case "paper_doc_change_member_role_details": - let v = TeamLog.PaperDocChangeMemberRoleDetailsSerializer().deserialize(json) - return EventDetails.paperDocChangeMemberRoleDetails(v) - case "paper_doc_change_sharing_policy_details": - let v = TeamLog.PaperDocChangeSharingPolicyDetailsSerializer().deserialize(json) - return EventDetails.paperDocChangeSharingPolicyDetails(v) - case "paper_doc_change_subscription_details": - let v = TeamLog.PaperDocChangeSubscriptionDetailsSerializer().deserialize(json) - return EventDetails.paperDocChangeSubscriptionDetails(v) - case "paper_doc_deleted_details": - let v = TeamLog.PaperDocDeletedDetailsSerializer().deserialize(json) - return EventDetails.paperDocDeletedDetails(v) - case "paper_doc_delete_comment_details": - let v = TeamLog.PaperDocDeleteCommentDetailsSerializer().deserialize(json) - return EventDetails.paperDocDeleteCommentDetails(v) - case "paper_doc_download_details": - let v = TeamLog.PaperDocDownloadDetailsSerializer().deserialize(json) - return EventDetails.paperDocDownloadDetails(v) - case "paper_doc_edit_details": - let v = TeamLog.PaperDocEditDetailsSerializer().deserialize(json) - return EventDetails.paperDocEditDetails(v) - case "paper_doc_edit_comment_details": - let v = TeamLog.PaperDocEditCommentDetailsSerializer().deserialize(json) - return EventDetails.paperDocEditCommentDetails(v) - case "paper_doc_followed_details": - let v = TeamLog.PaperDocFollowedDetailsSerializer().deserialize(json) - return EventDetails.paperDocFollowedDetails(v) - case "paper_doc_mention_details": - let v = TeamLog.PaperDocMentionDetailsSerializer().deserialize(json) - return EventDetails.paperDocMentionDetails(v) - case "paper_doc_ownership_changed_details": - let v = TeamLog.PaperDocOwnershipChangedDetailsSerializer().deserialize(json) - return EventDetails.paperDocOwnershipChangedDetails(v) - case "paper_doc_request_access_details": - let v = TeamLog.PaperDocRequestAccessDetailsSerializer().deserialize(json) - return EventDetails.paperDocRequestAccessDetails(v) - case "paper_doc_resolve_comment_details": - let v = TeamLog.PaperDocResolveCommentDetailsSerializer().deserialize(json) - return EventDetails.paperDocResolveCommentDetails(v) - case "paper_doc_revert_details": - let v = TeamLog.PaperDocRevertDetailsSerializer().deserialize(json) - return EventDetails.paperDocRevertDetails(v) - case "paper_doc_slack_share_details": - let v = TeamLog.PaperDocSlackShareDetailsSerializer().deserialize(json) - return EventDetails.paperDocSlackShareDetails(v) - case "paper_doc_team_invite_details": - let v = TeamLog.PaperDocTeamInviteDetailsSerializer().deserialize(json) - return EventDetails.paperDocTeamInviteDetails(v) - case "paper_doc_trashed_details": - let v = TeamLog.PaperDocTrashedDetailsSerializer().deserialize(json) - return EventDetails.paperDocTrashedDetails(v) - case "paper_doc_unresolve_comment_details": - let v = TeamLog.PaperDocUnresolveCommentDetailsSerializer().deserialize(json) - return EventDetails.paperDocUnresolveCommentDetails(v) - case "paper_doc_untrashed_details": - let v = TeamLog.PaperDocUntrashedDetailsSerializer().deserialize(json) - return EventDetails.paperDocUntrashedDetails(v) - case "paper_doc_view_details": - let v = TeamLog.PaperDocViewDetailsSerializer().deserialize(json) - return EventDetails.paperDocViewDetails(v) - case "paper_external_view_allow_details": - let v = TeamLog.PaperExternalViewAllowDetailsSerializer().deserialize(json) - return EventDetails.paperExternalViewAllowDetails(v) - case "paper_external_view_default_team_details": - let v = TeamLog.PaperExternalViewDefaultTeamDetailsSerializer().deserialize(json) - return EventDetails.paperExternalViewDefaultTeamDetails(v) - case "paper_external_view_forbid_details": - let v = TeamLog.PaperExternalViewForbidDetailsSerializer().deserialize(json) - return EventDetails.paperExternalViewForbidDetails(v) - case "paper_folder_change_subscription_details": - let v = TeamLog.PaperFolderChangeSubscriptionDetailsSerializer().deserialize(json) - return EventDetails.paperFolderChangeSubscriptionDetails(v) - case "paper_folder_deleted_details": - let v = TeamLog.PaperFolderDeletedDetailsSerializer().deserialize(json) - return EventDetails.paperFolderDeletedDetails(v) - case "paper_folder_followed_details": - let v = TeamLog.PaperFolderFollowedDetailsSerializer().deserialize(json) - return EventDetails.paperFolderFollowedDetails(v) - case "paper_folder_team_invite_details": - let v = TeamLog.PaperFolderTeamInviteDetailsSerializer().deserialize(json) - return EventDetails.paperFolderTeamInviteDetails(v) - case "paper_published_link_change_permission_details": - let v = TeamLog.PaperPublishedLinkChangePermissionDetailsSerializer().deserialize(json) - return EventDetails.paperPublishedLinkChangePermissionDetails(v) - case "paper_published_link_create_details": - let v = TeamLog.PaperPublishedLinkCreateDetailsSerializer().deserialize(json) - return EventDetails.paperPublishedLinkCreateDetails(v) - case "paper_published_link_disabled_details": - let v = TeamLog.PaperPublishedLinkDisabledDetailsSerializer().deserialize(json) - return EventDetails.paperPublishedLinkDisabledDetails(v) - case "paper_published_link_view_details": - let v = TeamLog.PaperPublishedLinkViewDetailsSerializer().deserialize(json) - return EventDetails.paperPublishedLinkViewDetails(v) - case "password_change_details": - let v = TeamLog.PasswordChangeDetailsSerializer().deserialize(json) - return EventDetails.passwordChangeDetails(v) - case "password_reset_details": - let v = TeamLog.PasswordResetDetailsSerializer().deserialize(json) - return EventDetails.passwordResetDetails(v) - case "password_reset_all_details": - let v = TeamLog.PasswordResetAllDetailsSerializer().deserialize(json) - return EventDetails.passwordResetAllDetails(v) - case "classification_create_report_details": - let v = TeamLog.ClassificationCreateReportDetailsSerializer().deserialize(json) - return EventDetails.classificationCreateReportDetails(v) - case "classification_create_report_fail_details": - let v = TeamLog.ClassificationCreateReportFailDetailsSerializer().deserialize(json) - return EventDetails.classificationCreateReportFailDetails(v) - case "emm_create_exceptions_report_details": - let v = TeamLog.EmmCreateExceptionsReportDetailsSerializer().deserialize(json) - return EventDetails.emmCreateExceptionsReportDetails(v) - case "emm_create_usage_report_details": - let v = TeamLog.EmmCreateUsageReportDetailsSerializer().deserialize(json) - return EventDetails.emmCreateUsageReportDetails(v) - case "export_members_report_details": - let v = TeamLog.ExportMembersReportDetailsSerializer().deserialize(json) - return EventDetails.exportMembersReportDetails(v) - case "export_members_report_fail_details": - let v = TeamLog.ExportMembersReportFailDetailsSerializer().deserialize(json) - return EventDetails.exportMembersReportFailDetails(v) - case "external_sharing_create_report_details": - let v = TeamLog.ExternalSharingCreateReportDetailsSerializer().deserialize(json) - return EventDetails.externalSharingCreateReportDetails(v) - case "external_sharing_report_failed_details": - let v = TeamLog.ExternalSharingReportFailedDetailsSerializer().deserialize(json) - return EventDetails.externalSharingReportFailedDetails(v) - case "no_expiration_link_gen_create_report_details": - let v = TeamLog.NoExpirationLinkGenCreateReportDetailsSerializer().deserialize(json) - return EventDetails.noExpirationLinkGenCreateReportDetails(v) - case "no_expiration_link_gen_report_failed_details": - let v = TeamLog.NoExpirationLinkGenReportFailedDetailsSerializer().deserialize(json) - return EventDetails.noExpirationLinkGenReportFailedDetails(v) - case "no_password_link_gen_create_report_details": - let v = TeamLog.NoPasswordLinkGenCreateReportDetailsSerializer().deserialize(json) - return EventDetails.noPasswordLinkGenCreateReportDetails(v) - case "no_password_link_gen_report_failed_details": - let v = TeamLog.NoPasswordLinkGenReportFailedDetailsSerializer().deserialize(json) - return EventDetails.noPasswordLinkGenReportFailedDetails(v) - case "no_password_link_view_create_report_details": - let v = TeamLog.NoPasswordLinkViewCreateReportDetailsSerializer().deserialize(json) - return EventDetails.noPasswordLinkViewCreateReportDetails(v) - case "no_password_link_view_report_failed_details": - let v = TeamLog.NoPasswordLinkViewReportFailedDetailsSerializer().deserialize(json) - return EventDetails.noPasswordLinkViewReportFailedDetails(v) - case "outdated_link_view_create_report_details": - let v = TeamLog.OutdatedLinkViewCreateReportDetailsSerializer().deserialize(json) - return EventDetails.outdatedLinkViewCreateReportDetails(v) - case "outdated_link_view_report_failed_details": - let v = TeamLog.OutdatedLinkViewReportFailedDetailsSerializer().deserialize(json) - return EventDetails.outdatedLinkViewReportFailedDetails(v) - case "paper_admin_export_start_details": - let v = TeamLog.PaperAdminExportStartDetailsSerializer().deserialize(json) - return EventDetails.paperAdminExportStartDetails(v) - case "smart_sync_create_admin_privilege_report_details": - let v = TeamLog.SmartSyncCreateAdminPrivilegeReportDetailsSerializer().deserialize(json) - return EventDetails.smartSyncCreateAdminPrivilegeReportDetails(v) - case "team_activity_create_report_details": - let v = TeamLog.TeamActivityCreateReportDetailsSerializer().deserialize(json) - return EventDetails.teamActivityCreateReportDetails(v) - case "team_activity_create_report_fail_details": - let v = TeamLog.TeamActivityCreateReportFailDetailsSerializer().deserialize(json) - return EventDetails.teamActivityCreateReportFailDetails(v) - case "collection_share_details": - let v = TeamLog.CollectionShareDetailsSerializer().deserialize(json) - return EventDetails.collectionShareDetails(v) - case "file_transfers_file_add_details": - let v = TeamLog.FileTransfersFileAddDetailsSerializer().deserialize(json) - return EventDetails.fileTransfersFileAddDetails(v) - case "file_transfers_transfer_delete_details": - let v = TeamLog.FileTransfersTransferDeleteDetailsSerializer().deserialize(json) - return EventDetails.fileTransfersTransferDeleteDetails(v) - case "file_transfers_transfer_download_details": - let v = TeamLog.FileTransfersTransferDownloadDetailsSerializer().deserialize(json) - return EventDetails.fileTransfersTransferDownloadDetails(v) - case "file_transfers_transfer_send_details": - let v = TeamLog.FileTransfersTransferSendDetailsSerializer().deserialize(json) - return EventDetails.fileTransfersTransferSendDetails(v) - case "file_transfers_transfer_view_details": - let v = TeamLog.FileTransfersTransferViewDetailsSerializer().deserialize(json) - return EventDetails.fileTransfersTransferViewDetails(v) - case "note_acl_invite_only_details": - let v = TeamLog.NoteAclInviteOnlyDetailsSerializer().deserialize(json) - return EventDetails.noteAclInviteOnlyDetails(v) - case "note_acl_link_details": - let v = TeamLog.NoteAclLinkDetailsSerializer().deserialize(json) - return EventDetails.noteAclLinkDetails(v) - case "note_acl_team_link_details": - let v = TeamLog.NoteAclTeamLinkDetailsSerializer().deserialize(json) - return EventDetails.noteAclTeamLinkDetails(v) - case "note_shared_details": - let v = TeamLog.NoteSharedDetailsSerializer().deserialize(json) - return EventDetails.noteSharedDetails(v) - case "note_share_receive_details": - let v = TeamLog.NoteShareReceiveDetailsSerializer().deserialize(json) - return EventDetails.noteShareReceiveDetails(v) - case "open_note_shared_details": - let v = TeamLog.OpenNoteSharedDetailsSerializer().deserialize(json) - return EventDetails.openNoteSharedDetails(v) - case "sf_add_group_details": - let v = TeamLog.SfAddGroupDetailsSerializer().deserialize(json) - return EventDetails.sfAddGroupDetails(v) - case "sf_allow_non_members_to_view_shared_links_details": - let v = TeamLog.SfAllowNonMembersToViewSharedLinksDetailsSerializer().deserialize(json) - return EventDetails.sfAllowNonMembersToViewSharedLinksDetails(v) - case "sf_external_invite_warn_details": - let v = TeamLog.SfExternalInviteWarnDetailsSerializer().deserialize(json) - return EventDetails.sfExternalInviteWarnDetails(v) - case "sf_fb_invite_details": - let v = TeamLog.SfFbInviteDetailsSerializer().deserialize(json) - return EventDetails.sfFbInviteDetails(v) - case "sf_fb_invite_change_role_details": - let v = TeamLog.SfFbInviteChangeRoleDetailsSerializer().deserialize(json) - return EventDetails.sfFbInviteChangeRoleDetails(v) - case "sf_fb_uninvite_details": - let v = TeamLog.SfFbUninviteDetailsSerializer().deserialize(json) - return EventDetails.sfFbUninviteDetails(v) - case "sf_invite_group_details": - let v = TeamLog.SfInviteGroupDetailsSerializer().deserialize(json) - return EventDetails.sfInviteGroupDetails(v) - case "sf_team_grant_access_details": - let v = TeamLog.SfTeamGrantAccessDetailsSerializer().deserialize(json) - return EventDetails.sfTeamGrantAccessDetails(v) - case "sf_team_invite_details": - let v = TeamLog.SfTeamInviteDetailsSerializer().deserialize(json) - return EventDetails.sfTeamInviteDetails(v) - case "sf_team_invite_change_role_details": - let v = TeamLog.SfTeamInviteChangeRoleDetailsSerializer().deserialize(json) - return EventDetails.sfTeamInviteChangeRoleDetails(v) - case "sf_team_join_details": - let v = TeamLog.SfTeamJoinDetailsSerializer().deserialize(json) - return EventDetails.sfTeamJoinDetails(v) - case "sf_team_join_from_oob_link_details": - let v = TeamLog.SfTeamJoinFromOobLinkDetailsSerializer().deserialize(json) - return EventDetails.sfTeamJoinFromOobLinkDetails(v) - case "sf_team_uninvite_details": - let v = TeamLog.SfTeamUninviteDetailsSerializer().deserialize(json) - return EventDetails.sfTeamUninviteDetails(v) - case "shared_content_add_invitees_details": - let v = TeamLog.SharedContentAddInviteesDetailsSerializer().deserialize(json) - return EventDetails.sharedContentAddInviteesDetails(v) - case "shared_content_add_link_expiry_details": - let v = TeamLog.SharedContentAddLinkExpiryDetailsSerializer().deserialize(json) - return EventDetails.sharedContentAddLinkExpiryDetails(v) - case "shared_content_add_link_password_details": - let v = TeamLog.SharedContentAddLinkPasswordDetailsSerializer().deserialize(json) - return EventDetails.sharedContentAddLinkPasswordDetails(v) - case "shared_content_add_member_details": - let v = TeamLog.SharedContentAddMemberDetailsSerializer().deserialize(json) - return EventDetails.sharedContentAddMemberDetails(v) - case "shared_content_change_downloads_policy_details": - let v = TeamLog.SharedContentChangeDownloadsPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharedContentChangeDownloadsPolicyDetails(v) - case "shared_content_change_invitee_role_details": - let v = TeamLog.SharedContentChangeInviteeRoleDetailsSerializer().deserialize(json) - return EventDetails.sharedContentChangeInviteeRoleDetails(v) - case "shared_content_change_link_audience_details": - let v = TeamLog.SharedContentChangeLinkAudienceDetailsSerializer().deserialize(json) - return EventDetails.sharedContentChangeLinkAudienceDetails(v) - case "shared_content_change_link_expiry_details": - let v = TeamLog.SharedContentChangeLinkExpiryDetailsSerializer().deserialize(json) - return EventDetails.sharedContentChangeLinkExpiryDetails(v) - case "shared_content_change_link_password_details": - let v = TeamLog.SharedContentChangeLinkPasswordDetailsSerializer().deserialize(json) - return EventDetails.sharedContentChangeLinkPasswordDetails(v) - case "shared_content_change_member_role_details": - let v = TeamLog.SharedContentChangeMemberRoleDetailsSerializer().deserialize(json) - return EventDetails.sharedContentChangeMemberRoleDetails(v) - case "shared_content_change_viewer_info_policy_details": - let v = TeamLog.SharedContentChangeViewerInfoPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharedContentChangeViewerInfoPolicyDetails(v) - case "shared_content_claim_invitation_details": - let v = TeamLog.SharedContentClaimInvitationDetailsSerializer().deserialize(json) - return EventDetails.sharedContentClaimInvitationDetails(v) - case "shared_content_copy_details": - let v = TeamLog.SharedContentCopyDetailsSerializer().deserialize(json) - return EventDetails.sharedContentCopyDetails(v) - case "shared_content_download_details": - let v = TeamLog.SharedContentDownloadDetailsSerializer().deserialize(json) - return EventDetails.sharedContentDownloadDetails(v) - case "shared_content_relinquish_membership_details": - let v = TeamLog.SharedContentRelinquishMembershipDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRelinquishMembershipDetails(v) - case "shared_content_remove_invitees_details": - let v = TeamLog.SharedContentRemoveInviteesDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRemoveInviteesDetails(v) - case "shared_content_remove_link_expiry_details": - let v = TeamLog.SharedContentRemoveLinkExpiryDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRemoveLinkExpiryDetails(v) - case "shared_content_remove_link_password_details": - let v = TeamLog.SharedContentRemoveLinkPasswordDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRemoveLinkPasswordDetails(v) - case "shared_content_remove_member_details": - let v = TeamLog.SharedContentRemoveMemberDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRemoveMemberDetails(v) - case "shared_content_request_access_details": - let v = TeamLog.SharedContentRequestAccessDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRequestAccessDetails(v) - case "shared_content_restore_invitees_details": - let v = TeamLog.SharedContentRestoreInviteesDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRestoreInviteesDetails(v) - case "shared_content_restore_member_details": - let v = TeamLog.SharedContentRestoreMemberDetailsSerializer().deserialize(json) - return EventDetails.sharedContentRestoreMemberDetails(v) - case "shared_content_unshare_details": - let v = TeamLog.SharedContentUnshareDetailsSerializer().deserialize(json) - return EventDetails.sharedContentUnshareDetails(v) - case "shared_content_view_details": - let v = TeamLog.SharedContentViewDetailsSerializer().deserialize(json) - return EventDetails.sharedContentViewDetails(v) - case "shared_folder_change_link_policy_details": - let v = TeamLog.SharedFolderChangeLinkPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderChangeLinkPolicyDetails(v) - case "shared_folder_change_members_inheritance_policy_details": - let v = TeamLog.SharedFolderChangeMembersInheritancePolicyDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderChangeMembersInheritancePolicyDetails(v) - case "shared_folder_change_members_management_policy_details": - let v = TeamLog.SharedFolderChangeMembersManagementPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderChangeMembersManagementPolicyDetails(v) - case "shared_folder_change_members_policy_details": - let v = TeamLog.SharedFolderChangeMembersPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderChangeMembersPolicyDetails(v) - case "shared_folder_create_details": - let v = TeamLog.SharedFolderCreateDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderCreateDetails(v) - case "shared_folder_decline_invitation_details": - let v = TeamLog.SharedFolderDeclineInvitationDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderDeclineInvitationDetails(v) - case "shared_folder_mount_details": - let v = TeamLog.SharedFolderMountDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderMountDetails(v) - case "shared_folder_nest_details": - let v = TeamLog.SharedFolderNestDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderNestDetails(v) - case "shared_folder_transfer_ownership_details": - let v = TeamLog.SharedFolderTransferOwnershipDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderTransferOwnershipDetails(v) - case "shared_folder_unmount_details": - let v = TeamLog.SharedFolderUnmountDetailsSerializer().deserialize(json) - return EventDetails.sharedFolderUnmountDetails(v) - case "shared_link_add_expiry_details": - let v = TeamLog.SharedLinkAddExpiryDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkAddExpiryDetails(v) - case "shared_link_change_expiry_details": - let v = TeamLog.SharedLinkChangeExpiryDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkChangeExpiryDetails(v) - case "shared_link_change_visibility_details": - let v = TeamLog.SharedLinkChangeVisibilityDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkChangeVisibilityDetails(v) - case "shared_link_copy_details": - let v = TeamLog.SharedLinkCopyDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkCopyDetails(v) - case "shared_link_create_details": - let v = TeamLog.SharedLinkCreateDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkCreateDetails(v) - case "shared_link_disable_details": - let v = TeamLog.SharedLinkDisableDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkDisableDetails(v) - case "shared_link_download_details": - let v = TeamLog.SharedLinkDownloadDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkDownloadDetails(v) - case "shared_link_remove_expiry_details": - let v = TeamLog.SharedLinkRemoveExpiryDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkRemoveExpiryDetails(v) - case "shared_link_settings_add_expiration_details": - let v = TeamLog.SharedLinkSettingsAddExpirationDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsAddExpirationDetails(v) - case "shared_link_settings_add_password_details": - let v = TeamLog.SharedLinkSettingsAddPasswordDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsAddPasswordDetails(v) - case "shared_link_settings_allow_download_disabled_details": - let v = TeamLog.SharedLinkSettingsAllowDownloadDisabledDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsAllowDownloadDisabledDetails(v) - case "shared_link_settings_allow_download_enabled_details": - let v = TeamLog.SharedLinkSettingsAllowDownloadEnabledDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsAllowDownloadEnabledDetails(v) - case "shared_link_settings_change_audience_details": - let v = TeamLog.SharedLinkSettingsChangeAudienceDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsChangeAudienceDetails(v) - case "shared_link_settings_change_expiration_details": - let v = TeamLog.SharedLinkSettingsChangeExpirationDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsChangeExpirationDetails(v) - case "shared_link_settings_change_password_details": - let v = TeamLog.SharedLinkSettingsChangePasswordDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsChangePasswordDetails(v) - case "shared_link_settings_remove_expiration_details": - let v = TeamLog.SharedLinkSettingsRemoveExpirationDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsRemoveExpirationDetails(v) - case "shared_link_settings_remove_password_details": - let v = TeamLog.SharedLinkSettingsRemovePasswordDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkSettingsRemovePasswordDetails(v) - case "shared_link_share_details": - let v = TeamLog.SharedLinkShareDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkShareDetails(v) - case "shared_link_view_details": - let v = TeamLog.SharedLinkViewDetailsSerializer().deserialize(json) - return EventDetails.sharedLinkViewDetails(v) - case "shared_note_opened_details": - let v = TeamLog.SharedNoteOpenedDetailsSerializer().deserialize(json) - return EventDetails.sharedNoteOpenedDetails(v) - case "shmodel_disable_downloads_details": - let v = TeamLog.ShmodelDisableDownloadsDetailsSerializer().deserialize(json) - return EventDetails.shmodelDisableDownloadsDetails(v) - case "shmodel_enable_downloads_details": - let v = TeamLog.ShmodelEnableDownloadsDetailsSerializer().deserialize(json) - return EventDetails.shmodelEnableDownloadsDetails(v) - case "shmodel_group_share_details": - let v = TeamLog.ShmodelGroupShareDetailsSerializer().deserialize(json) - return EventDetails.shmodelGroupShareDetails(v) - case "showcase_access_granted_details": - let v = TeamLog.ShowcaseAccessGrantedDetailsSerializer().deserialize(json) - return EventDetails.showcaseAccessGrantedDetails(v) - case "showcase_add_member_details": - let v = TeamLog.ShowcaseAddMemberDetailsSerializer().deserialize(json) - return EventDetails.showcaseAddMemberDetails(v) - case "showcase_archived_details": - let v = TeamLog.ShowcaseArchivedDetailsSerializer().deserialize(json) - return EventDetails.showcaseArchivedDetails(v) - case "showcase_created_details": - let v = TeamLog.ShowcaseCreatedDetailsSerializer().deserialize(json) - return EventDetails.showcaseCreatedDetails(v) - case "showcase_delete_comment_details": - let v = TeamLog.ShowcaseDeleteCommentDetailsSerializer().deserialize(json) - return EventDetails.showcaseDeleteCommentDetails(v) - case "showcase_edited_details": - let v = TeamLog.ShowcaseEditedDetailsSerializer().deserialize(json) - return EventDetails.showcaseEditedDetails(v) - case "showcase_edit_comment_details": - let v = TeamLog.ShowcaseEditCommentDetailsSerializer().deserialize(json) - return EventDetails.showcaseEditCommentDetails(v) - case "showcase_file_added_details": - let v = TeamLog.ShowcaseFileAddedDetailsSerializer().deserialize(json) - return EventDetails.showcaseFileAddedDetails(v) - case "showcase_file_download_details": - let v = TeamLog.ShowcaseFileDownloadDetailsSerializer().deserialize(json) - return EventDetails.showcaseFileDownloadDetails(v) - case "showcase_file_removed_details": - let v = TeamLog.ShowcaseFileRemovedDetailsSerializer().deserialize(json) - return EventDetails.showcaseFileRemovedDetails(v) - case "showcase_file_view_details": - let v = TeamLog.ShowcaseFileViewDetailsSerializer().deserialize(json) - return EventDetails.showcaseFileViewDetails(v) - case "showcase_permanently_deleted_details": - let v = TeamLog.ShowcasePermanentlyDeletedDetailsSerializer().deserialize(json) - return EventDetails.showcasePermanentlyDeletedDetails(v) - case "showcase_post_comment_details": - let v = TeamLog.ShowcasePostCommentDetailsSerializer().deserialize(json) - return EventDetails.showcasePostCommentDetails(v) - case "showcase_remove_member_details": - let v = TeamLog.ShowcaseRemoveMemberDetailsSerializer().deserialize(json) - return EventDetails.showcaseRemoveMemberDetails(v) - case "showcase_renamed_details": - let v = TeamLog.ShowcaseRenamedDetailsSerializer().deserialize(json) - return EventDetails.showcaseRenamedDetails(v) - case "showcase_request_access_details": - let v = TeamLog.ShowcaseRequestAccessDetailsSerializer().deserialize(json) - return EventDetails.showcaseRequestAccessDetails(v) - case "showcase_resolve_comment_details": - let v = TeamLog.ShowcaseResolveCommentDetailsSerializer().deserialize(json) - return EventDetails.showcaseResolveCommentDetails(v) - case "showcase_restored_details": - let v = TeamLog.ShowcaseRestoredDetailsSerializer().deserialize(json) - return EventDetails.showcaseRestoredDetails(v) - case "showcase_trashed_details": - let v = TeamLog.ShowcaseTrashedDetailsSerializer().deserialize(json) - return EventDetails.showcaseTrashedDetails(v) - case "showcase_trashed_deprecated_details": - let v = TeamLog.ShowcaseTrashedDeprecatedDetailsSerializer().deserialize(json) - return EventDetails.showcaseTrashedDeprecatedDetails(v) - case "showcase_unresolve_comment_details": - let v = TeamLog.ShowcaseUnresolveCommentDetailsSerializer().deserialize(json) - return EventDetails.showcaseUnresolveCommentDetails(v) - case "showcase_untrashed_details": - let v = TeamLog.ShowcaseUntrashedDetailsSerializer().deserialize(json) - return EventDetails.showcaseUntrashedDetails(v) - case "showcase_untrashed_deprecated_details": - let v = TeamLog.ShowcaseUntrashedDeprecatedDetailsSerializer().deserialize(json) - return EventDetails.showcaseUntrashedDeprecatedDetails(v) - case "showcase_view_details": - let v = TeamLog.ShowcaseViewDetailsSerializer().deserialize(json) - return EventDetails.showcaseViewDetails(v) - case "sso_add_cert_details": - let v = TeamLog.SsoAddCertDetailsSerializer().deserialize(json) - return EventDetails.ssoAddCertDetails(v) - case "sso_add_login_url_details": - let v = TeamLog.SsoAddLoginUrlDetailsSerializer().deserialize(json) - return EventDetails.ssoAddLoginUrlDetails(v) - case "sso_add_logout_url_details": - let v = TeamLog.SsoAddLogoutUrlDetailsSerializer().deserialize(json) - return EventDetails.ssoAddLogoutUrlDetails(v) - case "sso_change_cert_details": - let v = TeamLog.SsoChangeCertDetailsSerializer().deserialize(json) - return EventDetails.ssoChangeCertDetails(v) - case "sso_change_login_url_details": - let v = TeamLog.SsoChangeLoginUrlDetailsSerializer().deserialize(json) - return EventDetails.ssoChangeLoginUrlDetails(v) - case "sso_change_logout_url_details": - let v = TeamLog.SsoChangeLogoutUrlDetailsSerializer().deserialize(json) - return EventDetails.ssoChangeLogoutUrlDetails(v) - case "sso_change_saml_identity_mode_details": - let v = TeamLog.SsoChangeSamlIdentityModeDetailsSerializer().deserialize(json) - return EventDetails.ssoChangeSamlIdentityModeDetails(v) - case "sso_remove_cert_details": - let v = TeamLog.SsoRemoveCertDetailsSerializer().deserialize(json) - return EventDetails.ssoRemoveCertDetails(v) - case "sso_remove_login_url_details": - let v = TeamLog.SsoRemoveLoginUrlDetailsSerializer().deserialize(json) - return EventDetails.ssoRemoveLoginUrlDetails(v) - case "sso_remove_logout_url_details": - let v = TeamLog.SsoRemoveLogoutUrlDetailsSerializer().deserialize(json) - return EventDetails.ssoRemoveLogoutUrlDetails(v) - case "team_folder_change_status_details": - let v = TeamLog.TeamFolderChangeStatusDetailsSerializer().deserialize(json) - return EventDetails.teamFolderChangeStatusDetails(v) - case "team_folder_create_details": - let v = TeamLog.TeamFolderCreateDetailsSerializer().deserialize(json) - return EventDetails.teamFolderCreateDetails(v) - case "team_folder_downgrade_details": - let v = TeamLog.TeamFolderDowngradeDetailsSerializer().deserialize(json) - return EventDetails.teamFolderDowngradeDetails(v) - case "team_folder_permanently_delete_details": - let v = TeamLog.TeamFolderPermanentlyDeleteDetailsSerializer().deserialize(json) - return EventDetails.teamFolderPermanentlyDeleteDetails(v) - case "team_folder_rename_details": - let v = TeamLog.TeamFolderRenameDetailsSerializer().deserialize(json) - return EventDetails.teamFolderRenameDetails(v) - case "team_selective_sync_settings_changed_details": - let v = TeamLog.TeamSelectiveSyncSettingsChangedDetailsSerializer().deserialize(json) - return EventDetails.teamSelectiveSyncSettingsChangedDetails(v) - case "account_capture_change_policy_details": - let v = TeamLog.AccountCaptureChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.accountCaptureChangePolicyDetails(v) - case "admin_email_reminders_changed_details": - let v = TeamLog.AdminEmailRemindersChangedDetailsSerializer().deserialize(json) - return EventDetails.adminEmailRemindersChangedDetails(v) - case "allow_download_disabled_details": - let v = TeamLog.AllowDownloadDisabledDetailsSerializer().deserialize(json) - return EventDetails.allowDownloadDisabledDetails(v) - case "allow_download_enabled_details": - let v = TeamLog.AllowDownloadEnabledDetailsSerializer().deserialize(json) - return EventDetails.allowDownloadEnabledDetails(v) - case "app_permissions_changed_details": - let v = TeamLog.AppPermissionsChangedDetailsSerializer().deserialize(json) - return EventDetails.appPermissionsChangedDetails(v) - case "camera_uploads_policy_changed_details": - let v = TeamLog.CameraUploadsPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.cameraUploadsPolicyChangedDetails(v) - case "capture_transcript_policy_changed_details": - let v = TeamLog.CaptureTranscriptPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.captureTranscriptPolicyChangedDetails(v) - case "classification_change_policy_details": - let v = TeamLog.ClassificationChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.classificationChangePolicyDetails(v) - case "computer_backup_policy_changed_details": - let v = TeamLog.ComputerBackupPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.computerBackupPolicyChangedDetails(v) - case "content_administration_policy_changed_details": - let v = TeamLog.ContentAdministrationPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.contentAdministrationPolicyChangedDetails(v) - case "data_placement_restriction_change_policy_details": - let v = TeamLog.DataPlacementRestrictionChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.dataPlacementRestrictionChangePolicyDetails(v) - case "data_placement_restriction_satisfy_policy_details": - let v = TeamLog.DataPlacementRestrictionSatisfyPolicyDetailsSerializer().deserialize(json) - return EventDetails.dataPlacementRestrictionSatisfyPolicyDetails(v) - case "device_approvals_add_exception_details": - let v = TeamLog.DeviceApprovalsAddExceptionDetailsSerializer().deserialize(json) - return EventDetails.deviceApprovalsAddExceptionDetails(v) - case "device_approvals_change_desktop_policy_details": - let v = TeamLog.DeviceApprovalsChangeDesktopPolicyDetailsSerializer().deserialize(json) - return EventDetails.deviceApprovalsChangeDesktopPolicyDetails(v) - case "device_approvals_change_mobile_policy_details": - let v = TeamLog.DeviceApprovalsChangeMobilePolicyDetailsSerializer().deserialize(json) - return EventDetails.deviceApprovalsChangeMobilePolicyDetails(v) - case "device_approvals_change_overage_action_details": - let v = TeamLog.DeviceApprovalsChangeOverageActionDetailsSerializer().deserialize(json) - return EventDetails.deviceApprovalsChangeOverageActionDetails(v) - case "device_approvals_change_unlink_action_details": - let v = TeamLog.DeviceApprovalsChangeUnlinkActionDetailsSerializer().deserialize(json) - return EventDetails.deviceApprovalsChangeUnlinkActionDetails(v) - case "device_approvals_remove_exception_details": - let v = TeamLog.DeviceApprovalsRemoveExceptionDetailsSerializer().deserialize(json) - return EventDetails.deviceApprovalsRemoveExceptionDetails(v) - case "directory_restrictions_add_members_details": - let v = TeamLog.DirectoryRestrictionsAddMembersDetailsSerializer().deserialize(json) - return EventDetails.directoryRestrictionsAddMembersDetails(v) - case "directory_restrictions_remove_members_details": - let v = TeamLog.DirectoryRestrictionsRemoveMembersDetailsSerializer().deserialize(json) - return EventDetails.directoryRestrictionsRemoveMembersDetails(v) - case "dropbox_passwords_policy_changed_details": - let v = TeamLog.DropboxPasswordsPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.dropboxPasswordsPolicyChangedDetails(v) - case "email_ingest_policy_changed_details": - let v = TeamLog.EmailIngestPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.emailIngestPolicyChangedDetails(v) - case "emm_add_exception_details": - let v = TeamLog.EmmAddExceptionDetailsSerializer().deserialize(json) - return EventDetails.emmAddExceptionDetails(v) - case "emm_change_policy_details": - let v = TeamLog.EmmChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.emmChangePolicyDetails(v) - case "emm_remove_exception_details": - let v = TeamLog.EmmRemoveExceptionDetailsSerializer().deserialize(json) - return EventDetails.emmRemoveExceptionDetails(v) - case "extended_version_history_change_policy_details": - let v = TeamLog.ExtendedVersionHistoryChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.extendedVersionHistoryChangePolicyDetails(v) - case "external_drive_backup_policy_changed_details": - let v = TeamLog.ExternalDriveBackupPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.externalDriveBackupPolicyChangedDetails(v) - case "file_comments_change_policy_details": - let v = TeamLog.FileCommentsChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.fileCommentsChangePolicyDetails(v) - case "file_locking_policy_changed_details": - let v = TeamLog.FileLockingPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.fileLockingPolicyChangedDetails(v) - case "file_provider_migration_policy_changed_details": - let v = TeamLog.FileProviderMigrationPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.fileProviderMigrationPolicyChangedDetails(v) - case "file_requests_change_policy_details": - let v = TeamLog.FileRequestsChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.fileRequestsChangePolicyDetails(v) - case "file_requests_emails_enabled_details": - let v = TeamLog.FileRequestsEmailsEnabledDetailsSerializer().deserialize(json) - return EventDetails.fileRequestsEmailsEnabledDetails(v) - case "file_requests_emails_restricted_to_team_only_details": - let v = TeamLog.FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer().deserialize(json) - return EventDetails.fileRequestsEmailsRestrictedToTeamOnlyDetails(v) - case "file_transfers_policy_changed_details": - let v = TeamLog.FileTransfersPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.fileTransfersPolicyChangedDetails(v) - case "folder_link_restriction_policy_changed_details": - let v = TeamLog.FolderLinkRestrictionPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.folderLinkRestrictionPolicyChangedDetails(v) - case "google_sso_change_policy_details": - let v = TeamLog.GoogleSsoChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.googleSsoChangePolicyDetails(v) - case "group_user_management_change_policy_details": - let v = TeamLog.GroupUserManagementChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.groupUserManagementChangePolicyDetails(v) - case "integration_policy_changed_details": - let v = TeamLog.IntegrationPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.integrationPolicyChangedDetails(v) - case "invite_acceptance_email_policy_changed_details": - let v = TeamLog.InviteAcceptanceEmailPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.inviteAcceptanceEmailPolicyChangedDetails(v) - case "member_requests_change_policy_details": - let v = TeamLog.MemberRequestsChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.memberRequestsChangePolicyDetails(v) - case "member_send_invite_policy_changed_details": - let v = TeamLog.MemberSendInvitePolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.memberSendInvitePolicyChangedDetails(v) - case "member_space_limits_add_exception_details": - let v = TeamLog.MemberSpaceLimitsAddExceptionDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsAddExceptionDetails(v) - case "member_space_limits_change_caps_type_policy_details": - let v = TeamLog.MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsChangeCapsTypePolicyDetails(v) - case "member_space_limits_change_policy_details": - let v = TeamLog.MemberSpaceLimitsChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsChangePolicyDetails(v) - case "member_space_limits_remove_exception_details": - let v = TeamLog.MemberSpaceLimitsRemoveExceptionDetailsSerializer().deserialize(json) - return EventDetails.memberSpaceLimitsRemoveExceptionDetails(v) - case "member_suggestions_change_policy_details": - let v = TeamLog.MemberSuggestionsChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.memberSuggestionsChangePolicyDetails(v) - case "microsoft_office_addin_change_policy_details": - let v = TeamLog.MicrosoftOfficeAddinChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.microsoftOfficeAddinChangePolicyDetails(v) - case "network_control_change_policy_details": - let v = TeamLog.NetworkControlChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.networkControlChangePolicyDetails(v) - case "paper_change_deployment_policy_details": - let v = TeamLog.PaperChangeDeploymentPolicyDetailsSerializer().deserialize(json) - return EventDetails.paperChangeDeploymentPolicyDetails(v) - case "paper_change_member_link_policy_details": - let v = TeamLog.PaperChangeMemberLinkPolicyDetailsSerializer().deserialize(json) - return EventDetails.paperChangeMemberLinkPolicyDetails(v) - case "paper_change_member_policy_details": - let v = TeamLog.PaperChangeMemberPolicyDetailsSerializer().deserialize(json) - return EventDetails.paperChangeMemberPolicyDetails(v) - case "paper_change_policy_details": - let v = TeamLog.PaperChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.paperChangePolicyDetails(v) - case "paper_default_folder_policy_changed_details": - let v = TeamLog.PaperDefaultFolderPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.paperDefaultFolderPolicyChangedDetails(v) - case "paper_desktop_policy_changed_details": - let v = TeamLog.PaperDesktopPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.paperDesktopPolicyChangedDetails(v) - case "paper_enabled_users_group_addition_details": - let v = TeamLog.PaperEnabledUsersGroupAdditionDetailsSerializer().deserialize(json) - return EventDetails.paperEnabledUsersGroupAdditionDetails(v) - case "paper_enabled_users_group_removal_details": - let v = TeamLog.PaperEnabledUsersGroupRemovalDetailsSerializer().deserialize(json) - return EventDetails.paperEnabledUsersGroupRemovalDetails(v) - case "password_strength_requirements_change_policy_details": - let v = TeamLog.PasswordStrengthRequirementsChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.passwordStrengthRequirementsChangePolicyDetails(v) - case "permanent_delete_change_policy_details": - let v = TeamLog.PermanentDeleteChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.permanentDeleteChangePolicyDetails(v) - case "reseller_support_change_policy_details": - let v = TeamLog.ResellerSupportChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.resellerSupportChangePolicyDetails(v) - case "rewind_policy_changed_details": - let v = TeamLog.RewindPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.rewindPolicyChangedDetails(v) - case "send_for_signature_policy_changed_details": - let v = TeamLog.SendForSignaturePolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.sendForSignaturePolicyChangedDetails(v) - case "sharing_change_folder_join_policy_details": - let v = TeamLog.SharingChangeFolderJoinPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharingChangeFolderJoinPolicyDetails(v) - case "sharing_change_link_allow_change_expiration_policy_details": - let v = TeamLog.SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharingChangeLinkAllowChangeExpirationPolicyDetails(v) - case "sharing_change_link_default_expiration_policy_details": - let v = TeamLog.SharingChangeLinkDefaultExpirationPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharingChangeLinkDefaultExpirationPolicyDetails(v) - case "sharing_change_link_enforce_password_policy_details": - let v = TeamLog.SharingChangeLinkEnforcePasswordPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharingChangeLinkEnforcePasswordPolicyDetails(v) - case "sharing_change_link_policy_details": - let v = TeamLog.SharingChangeLinkPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharingChangeLinkPolicyDetails(v) - case "sharing_change_member_policy_details": - let v = TeamLog.SharingChangeMemberPolicyDetailsSerializer().deserialize(json) - return EventDetails.sharingChangeMemberPolicyDetails(v) - case "showcase_change_download_policy_details": - let v = TeamLog.ShowcaseChangeDownloadPolicyDetailsSerializer().deserialize(json) - return EventDetails.showcaseChangeDownloadPolicyDetails(v) - case "showcase_change_enabled_policy_details": - let v = TeamLog.ShowcaseChangeEnabledPolicyDetailsSerializer().deserialize(json) - return EventDetails.showcaseChangeEnabledPolicyDetails(v) - case "showcase_change_external_sharing_policy_details": - let v = TeamLog.ShowcaseChangeExternalSharingPolicyDetailsSerializer().deserialize(json) - return EventDetails.showcaseChangeExternalSharingPolicyDetails(v) - case "smarter_smart_sync_policy_changed_details": - let v = TeamLog.SmarterSmartSyncPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.smarterSmartSyncPolicyChangedDetails(v) - case "smart_sync_change_policy_details": - let v = TeamLog.SmartSyncChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.smartSyncChangePolicyDetails(v) - case "smart_sync_not_opt_out_details": - let v = TeamLog.SmartSyncNotOptOutDetailsSerializer().deserialize(json) - return EventDetails.smartSyncNotOptOutDetails(v) - case "smart_sync_opt_out_details": - let v = TeamLog.SmartSyncOptOutDetailsSerializer().deserialize(json) - return EventDetails.smartSyncOptOutDetails(v) - case "sso_change_policy_details": - let v = TeamLog.SsoChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.ssoChangePolicyDetails(v) - case "team_branding_policy_changed_details": - let v = TeamLog.TeamBrandingPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.teamBrandingPolicyChangedDetails(v) - case "team_extensions_policy_changed_details": - let v = TeamLog.TeamExtensionsPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.teamExtensionsPolicyChangedDetails(v) - case "team_selective_sync_policy_changed_details": - let v = TeamLog.TeamSelectiveSyncPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.teamSelectiveSyncPolicyChangedDetails(v) - case "team_sharing_whitelist_subjects_changed_details": - let v = TeamLog.TeamSharingWhitelistSubjectsChangedDetailsSerializer().deserialize(json) - return EventDetails.teamSharingWhitelistSubjectsChangedDetails(v) - case "tfa_add_exception_details": - let v = TeamLog.TfaAddExceptionDetailsSerializer().deserialize(json) - return EventDetails.tfaAddExceptionDetails(v) - case "tfa_change_policy_details": - let v = TeamLog.TfaChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.tfaChangePolicyDetails(v) - case "tfa_remove_exception_details": - let v = TeamLog.TfaRemoveExceptionDetailsSerializer().deserialize(json) - return EventDetails.tfaRemoveExceptionDetails(v) - case "two_account_change_policy_details": - let v = TeamLog.TwoAccountChangePolicyDetailsSerializer().deserialize(json) - return EventDetails.twoAccountChangePolicyDetails(v) - case "viewer_info_policy_changed_details": - let v = TeamLog.ViewerInfoPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.viewerInfoPolicyChangedDetails(v) - case "watermarking_policy_changed_details": - let v = TeamLog.WatermarkingPolicyChangedDetailsSerializer().deserialize(json) - return EventDetails.watermarkingPolicyChangedDetails(v) - case "web_sessions_change_active_session_limit_details": - let v = TeamLog.WebSessionsChangeActiveSessionLimitDetailsSerializer().deserialize(json) - return EventDetails.webSessionsChangeActiveSessionLimitDetails(v) - case "web_sessions_change_fixed_length_policy_details": - let v = TeamLog.WebSessionsChangeFixedLengthPolicyDetailsSerializer().deserialize(json) - return EventDetails.webSessionsChangeFixedLengthPolicyDetails(v) - case "web_sessions_change_idle_length_policy_details": - let v = TeamLog.WebSessionsChangeIdleLengthPolicyDetailsSerializer().deserialize(json) - return EventDetails.webSessionsChangeIdleLengthPolicyDetails(v) - case "data_residency_migration_request_successful_details": - let v = TeamLog.DataResidencyMigrationRequestSuccessfulDetailsSerializer().deserialize(json) - return EventDetails.dataResidencyMigrationRequestSuccessfulDetails(v) - case "data_residency_migration_request_unsuccessful_details": - let v = TeamLog.DataResidencyMigrationRequestUnsuccessfulDetailsSerializer().deserialize(json) - return EventDetails.dataResidencyMigrationRequestUnsuccessfulDetails(v) - case "team_merge_from_details": - let v = TeamLog.TeamMergeFromDetailsSerializer().deserialize(json) - return EventDetails.teamMergeFromDetails(v) - case "team_merge_to_details": - let v = TeamLog.TeamMergeToDetailsSerializer().deserialize(json) - return EventDetails.teamMergeToDetails(v) - case "team_profile_add_background_details": - let v = TeamLog.TeamProfileAddBackgroundDetailsSerializer().deserialize(json) - return EventDetails.teamProfileAddBackgroundDetails(v) - case "team_profile_add_logo_details": - let v = TeamLog.TeamProfileAddLogoDetailsSerializer().deserialize(json) - return EventDetails.teamProfileAddLogoDetails(v) - case "team_profile_change_background_details": - let v = TeamLog.TeamProfileChangeBackgroundDetailsSerializer().deserialize(json) - return EventDetails.teamProfileChangeBackgroundDetails(v) - case "team_profile_change_default_language_details": - let v = TeamLog.TeamProfileChangeDefaultLanguageDetailsSerializer().deserialize(json) - return EventDetails.teamProfileChangeDefaultLanguageDetails(v) - case "team_profile_change_logo_details": - let v = TeamLog.TeamProfileChangeLogoDetailsSerializer().deserialize(json) - return EventDetails.teamProfileChangeLogoDetails(v) - case "team_profile_change_name_details": - let v = TeamLog.TeamProfileChangeNameDetailsSerializer().deserialize(json) - return EventDetails.teamProfileChangeNameDetails(v) - case "team_profile_remove_background_details": - let v = TeamLog.TeamProfileRemoveBackgroundDetailsSerializer().deserialize(json) - return EventDetails.teamProfileRemoveBackgroundDetails(v) - case "team_profile_remove_logo_details": - let v = TeamLog.TeamProfileRemoveLogoDetailsSerializer().deserialize(json) - return EventDetails.teamProfileRemoveLogoDetails(v) - case "tfa_add_backup_phone_details": - let v = TeamLog.TfaAddBackupPhoneDetailsSerializer().deserialize(json) - return EventDetails.tfaAddBackupPhoneDetails(v) - case "tfa_add_security_key_details": - let v = TeamLog.TfaAddSecurityKeyDetailsSerializer().deserialize(json) - return EventDetails.tfaAddSecurityKeyDetails(v) - case "tfa_change_backup_phone_details": - let v = TeamLog.TfaChangeBackupPhoneDetailsSerializer().deserialize(json) - return EventDetails.tfaChangeBackupPhoneDetails(v) - case "tfa_change_status_details": - let v = TeamLog.TfaChangeStatusDetailsSerializer().deserialize(json) - return EventDetails.tfaChangeStatusDetails(v) - case "tfa_remove_backup_phone_details": - let v = TeamLog.TfaRemoveBackupPhoneDetailsSerializer().deserialize(json) - return EventDetails.tfaRemoveBackupPhoneDetails(v) - case "tfa_remove_security_key_details": - let v = TeamLog.TfaRemoveSecurityKeyDetailsSerializer().deserialize(json) - return EventDetails.tfaRemoveSecurityKeyDetails(v) - case "tfa_reset_details": - let v = TeamLog.TfaResetDetailsSerializer().deserialize(json) - return EventDetails.tfaResetDetails(v) - case "changed_enterprise_admin_role_details": - let v = TeamLog.ChangedEnterpriseAdminRoleDetailsSerializer().deserialize(json) - return EventDetails.changedEnterpriseAdminRoleDetails(v) - case "changed_enterprise_connected_team_status_details": - let v = TeamLog.ChangedEnterpriseConnectedTeamStatusDetailsSerializer().deserialize(json) - return EventDetails.changedEnterpriseConnectedTeamStatusDetails(v) - case "ended_enterprise_admin_session_details": - let v = TeamLog.EndedEnterpriseAdminSessionDetailsSerializer().deserialize(json) - return EventDetails.endedEnterpriseAdminSessionDetails(v) - case "ended_enterprise_admin_session_deprecated_details": - let v = TeamLog.EndedEnterpriseAdminSessionDeprecatedDetailsSerializer().deserialize(json) - return EventDetails.endedEnterpriseAdminSessionDeprecatedDetails(v) - case "enterprise_settings_locking_details": - let v = TeamLog.EnterpriseSettingsLockingDetailsSerializer().deserialize(json) - return EventDetails.enterpriseSettingsLockingDetails(v) - case "guest_admin_change_status_details": - let v = TeamLog.GuestAdminChangeStatusDetailsSerializer().deserialize(json) - return EventDetails.guestAdminChangeStatusDetails(v) - case "started_enterprise_admin_session_details": - let v = TeamLog.StartedEnterpriseAdminSessionDetailsSerializer().deserialize(json) - return EventDetails.startedEnterpriseAdminSessionDetails(v) - case "team_merge_request_accepted_details": - let v = TeamLog.TeamMergeRequestAcceptedDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestAcceptedDetails(v) - case "team_merge_request_accepted_shown_to_primary_team_details": - let v = TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestAcceptedShownToPrimaryTeamDetails(v) - case "team_merge_request_accepted_shown_to_secondary_team_details": - let v = TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestAcceptedShownToSecondaryTeamDetails(v) - case "team_merge_request_auto_canceled_details": - let v = TeamLog.TeamMergeRequestAutoCanceledDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestAutoCanceledDetails(v) - case "team_merge_request_canceled_details": - let v = TeamLog.TeamMergeRequestCanceledDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestCanceledDetails(v) - case "team_merge_request_canceled_shown_to_primary_team_details": - let v = TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestCanceledShownToPrimaryTeamDetails(v) - case "team_merge_request_canceled_shown_to_secondary_team_details": - let v = TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestCanceledShownToSecondaryTeamDetails(v) - case "team_merge_request_expired_details": - let v = TeamLog.TeamMergeRequestExpiredDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestExpiredDetails(v) - case "team_merge_request_expired_shown_to_primary_team_details": - let v = TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestExpiredShownToPrimaryTeamDetails(v) - case "team_merge_request_expired_shown_to_secondary_team_details": - let v = TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestExpiredShownToSecondaryTeamDetails(v) - case "team_merge_request_rejected_shown_to_primary_team_details": - let v = TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestRejectedShownToPrimaryTeamDetails(v) - case "team_merge_request_rejected_shown_to_secondary_team_details": - let v = TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestRejectedShownToSecondaryTeamDetails(v) - case "team_merge_request_reminder_details": - let v = TeamLog.TeamMergeRequestReminderDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestReminderDetails(v) - case "team_merge_request_reminder_shown_to_primary_team_details": - let v = TeamLog.TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestReminderShownToPrimaryTeamDetails(v) - case "team_merge_request_reminder_shown_to_secondary_team_details": - let v = TeamLog.TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestReminderShownToSecondaryTeamDetails(v) - case "team_merge_request_revoked_details": - let v = TeamLog.TeamMergeRequestRevokedDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestRevokedDetails(v) - case "team_merge_request_sent_shown_to_primary_team_details": - let v = TeamLog.TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestSentShownToPrimaryTeamDetails(v) - case "team_merge_request_sent_shown_to_secondary_team_details": - let v = TeamLog.TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer().deserialize(json) - return EventDetails.teamMergeRequestSentShownToSecondaryTeamDetails(v) - case "missing_details": - let v = TeamLog.MissingDetailsSerializer().deserialize(json) - return EventDetails.missingDetails(v) - case "other": - return EventDetails.other - default: - return EventDetails.other - } - default: - fatalError("Failed to deserialize") + case .adminAlertingAlertStateChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.AdminAlertingAlertStateChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("admin_alerting_alert_state_changed_details") + return .dictionary(d) + case .adminAlertingChangedAlertConfigDetails(let arg): + var d = try Serialization.getFields(TeamLog.AdminAlertingChangedAlertConfigDetailsSerializer().serialize(arg)) + d[".tag"] = .str("admin_alerting_changed_alert_config_details") + return .dictionary(d) + case .adminAlertingTriggeredAlertDetails(let arg): + var d = try Serialization.getFields(TeamLog.AdminAlertingTriggeredAlertDetailsSerializer().serialize(arg)) + d[".tag"] = .str("admin_alerting_triggered_alert_details") + return .dictionary(d) + case .ransomwareRestoreProcessCompletedDetails(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareRestoreProcessCompletedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_restore_process_completed_details") + return .dictionary(d) + case .ransomwareRestoreProcessStartedDetails(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareRestoreProcessStartedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_restore_process_started_details") + return .dictionary(d) + case .appBlockedByPermissionsDetails(let arg): + var d = try Serialization.getFields(TeamLog.AppBlockedByPermissionsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("app_blocked_by_permissions_details") + return .dictionary(d) + case .appLinkTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.AppLinkTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("app_link_team_details") + return .dictionary(d) + case .appLinkUserDetails(let arg): + var d = try Serialization.getFields(TeamLog.AppLinkUserDetailsSerializer().serialize(arg)) + d[".tag"] = .str("app_link_user_details") + return .dictionary(d) + case .appUnlinkTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.AppUnlinkTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("app_unlink_team_details") + return .dictionary(d) + case .appUnlinkUserDetails(let arg): + var d = try Serialization.getFields(TeamLog.AppUnlinkUserDetailsSerializer().serialize(arg)) + d[".tag"] = .str("app_unlink_user_details") + return .dictionary(d) + case .integrationConnectedDetails(let arg): + var d = try Serialization.getFields(TeamLog.IntegrationConnectedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("integration_connected_details") + return .dictionary(d) + case .integrationDisconnectedDetails(let arg): + var d = try Serialization.getFields(TeamLog.IntegrationDisconnectedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("integration_disconnected_details") + return .dictionary(d) + case .fileAddCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileAddCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_add_comment_details") + return .dictionary(d) + case .fileChangeCommentSubscriptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileChangeCommentSubscriptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_change_comment_subscription_details") + return .dictionary(d) + case .fileDeleteCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileDeleteCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_delete_comment_details") + return .dictionary(d) + case .fileEditCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileEditCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_edit_comment_details") + return .dictionary(d) + case .fileLikeCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileLikeCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_like_comment_details") + return .dictionary(d) + case .fileResolveCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileResolveCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_resolve_comment_details") + return .dictionary(d) + case .fileUnlikeCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileUnlikeCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_unlike_comment_details") + return .dictionary(d) + case .fileUnresolveCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileUnresolveCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_unresolve_comment_details") + return .dictionary(d) + case .governancePolicyAddFoldersDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyAddFoldersDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_add_folders_details") + return .dictionary(d) + case .governancePolicyAddFolderFailedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyAddFolderFailedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_add_folder_failed_details") + return .dictionary(d) + case .governancePolicyContentDisposedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyContentDisposedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_content_disposed_details") + return .dictionary(d) + case .governancePolicyCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_create_details") + return .dictionary(d) + case .governancePolicyDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_delete_details") + return .dictionary(d) + case .governancePolicyEditDetailsDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyEditDetailsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_edit_details_details") + return .dictionary(d) + case .governancePolicyEditDurationDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyEditDurationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_edit_duration_details") + return .dictionary(d) + case .governancePolicyExportCreatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyExportCreatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_export_created_details") + return .dictionary(d) + case .governancePolicyExportRemovedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyExportRemovedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_export_removed_details") + return .dictionary(d) + case .governancePolicyRemoveFoldersDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyRemoveFoldersDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_remove_folders_details") + return .dictionary(d) + case .governancePolicyReportCreatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyReportCreatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_report_created_details") + return .dictionary(d) + case .governancePolicyZipPartDownloadedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyZipPartDownloadedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_zip_part_downloaded_details") + return .dictionary(d) + case .legalHoldsActivateAHoldDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsActivateAHoldDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_activate_a_hold_details") + return .dictionary(d) + case .legalHoldsAddMembersDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsAddMembersDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_add_members_details") + return .dictionary(d) + case .legalHoldsChangeHoldDetailsDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsChangeHoldDetailsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_change_hold_details_details") + return .dictionary(d) + case .legalHoldsChangeHoldNameDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsChangeHoldNameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_change_hold_name_details") + return .dictionary(d) + case .legalHoldsExportAHoldDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportAHoldDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_a_hold_details") + return .dictionary(d) + case .legalHoldsExportCancelledDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportCancelledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_cancelled_details") + return .dictionary(d) + case .legalHoldsExportDownloadedDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportDownloadedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_downloaded_details") + return .dictionary(d) + case .legalHoldsExportRemovedDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportRemovedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_removed_details") + return .dictionary(d) + case .legalHoldsReleaseAHoldDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsReleaseAHoldDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_release_a_hold_details") + return .dictionary(d) + case .legalHoldsRemoveMembersDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsRemoveMembersDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_remove_members_details") + return .dictionary(d) + case .legalHoldsReportAHoldDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsReportAHoldDetailsSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_report_a_hold_details") + return .dictionary(d) + case .deviceChangeIpDesktopDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceChangeIpDesktopDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_change_ip_desktop_details") + return .dictionary(d) + case .deviceChangeIpMobileDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceChangeIpMobileDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_change_ip_mobile_details") + return .dictionary(d) + case .deviceChangeIpWebDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceChangeIpWebDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_change_ip_web_details") + return .dictionary(d) + case .deviceDeleteOnUnlinkFailDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkFailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_delete_on_unlink_fail_details") + return .dictionary(d) + case .deviceDeleteOnUnlinkSuccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkSuccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_delete_on_unlink_success_details") + return .dictionary(d) + case .deviceLinkFailDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceLinkFailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_link_fail_details") + return .dictionary(d) + case .deviceLinkSuccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceLinkSuccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_link_success_details") + return .dictionary(d) + case .deviceManagementDisabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceManagementDisabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_management_disabled_details") + return .dictionary(d) + case .deviceManagementEnabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceManagementEnabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_management_enabled_details") + return .dictionary(d) + case .deviceSyncBackupStatusChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceSyncBackupStatusChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_sync_backup_status_changed_details") + return .dictionary(d) + case .deviceUnlinkDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceUnlinkDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_unlink_details") + return .dictionary(d) + case .dropboxPasswordsExportedDetails(let arg): + var d = try Serialization.getFields(TeamLog.DropboxPasswordsExportedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("dropbox_passwords_exported_details") + return .dictionary(d) + case .dropboxPasswordsNewDeviceEnrolledDetails(let arg): + var d = try Serialization.getFields(TeamLog.DropboxPasswordsNewDeviceEnrolledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("dropbox_passwords_new_device_enrolled_details") + return .dictionary(d) + case .emmRefreshAuthTokenDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmmRefreshAuthTokenDetailsSerializer().serialize(arg)) + d[".tag"] = .str("emm_refresh_auth_token_details") + return .dictionary(d) + case .externalDriveBackupEligibilityStatusCheckedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("external_drive_backup_eligibility_status_checked_details") + return .dictionary(d) + case .externalDriveBackupStatusChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExternalDriveBackupStatusChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("external_drive_backup_status_changed_details") + return .dictionary(d) + case .accountCaptureChangeAvailabilityDetails(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureChangeAvailabilityDetailsSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_change_availability_details") + return .dictionary(d) + case .accountCaptureMigrateAccountDetails(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureMigrateAccountDetailsSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_migrate_account_details") + return .dictionary(d) + case .accountCaptureNotificationEmailsSentDetails(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureNotificationEmailsSentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_notification_emails_sent_details") + return .dictionary(d) + case .accountCaptureRelinquishAccountDetails(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureRelinquishAccountDetailsSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_relinquish_account_details") + return .dictionary(d) + case .disabledDomainInvitesDetails(let arg): + var d = try Serialization.getFields(TeamLog.DisabledDomainInvitesDetailsSerializer().serialize(arg)) + d[".tag"] = .str("disabled_domain_invites_details") + return .dictionary(d) + case .domainInvitesApproveRequestToJoinTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesApproveRequestToJoinTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_approve_request_to_join_team_details") + return .dictionary(d) + case .domainInvitesDeclineRequestToJoinTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesDeclineRequestToJoinTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_decline_request_to_join_team_details") + return .dictionary(d) + case .domainInvitesEmailExistingUsersDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesEmailExistingUsersDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_email_existing_users_details") + return .dictionary(d) + case .domainInvitesRequestToJoinTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesRequestToJoinTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_request_to_join_team_details") + return .dictionary(d) + case .domainInvitesSetInviteNewUserPrefToNoDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_no_details") + return .dictionary(d) + case .domainInvitesSetInviteNewUserPrefToYesDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_yes_details") + return .dictionary(d) + case .domainVerificationAddDomainFailDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainVerificationAddDomainFailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_verification_add_domain_fail_details") + return .dictionary(d) + case .domainVerificationAddDomainSuccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainVerificationAddDomainSuccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_verification_add_domain_success_details") + return .dictionary(d) + case .domainVerificationRemoveDomainDetails(let arg): + var d = try Serialization.getFields(TeamLog.DomainVerificationRemoveDomainDetailsSerializer().serialize(arg)) + d[".tag"] = .str("domain_verification_remove_domain_details") + return .dictionary(d) + case .enabledDomainInvitesDetails(let arg): + var d = try Serialization.getFields(TeamLog.EnabledDomainInvitesDetailsSerializer().serialize(arg)) + d[".tag"] = .str("enabled_domain_invites_details") + return .dictionary(d) + case .teamEncryptionKeyCancelKeyDeletionDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyCancelKeyDeletionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_cancel_key_deletion_details") + return .dictionary(d) + case .teamEncryptionKeyCreateKeyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyCreateKeyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_create_key_details") + return .dictionary(d) + case .teamEncryptionKeyDeleteKeyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyDeleteKeyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_delete_key_details") + return .dictionary(d) + case .teamEncryptionKeyDisableKeyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyDisableKeyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_disable_key_details") + return .dictionary(d) + case .teamEncryptionKeyEnableKeyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyEnableKeyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_enable_key_details") + return .dictionary(d) + case .teamEncryptionKeyRotateKeyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyRotateKeyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_rotate_key_details") + return .dictionary(d) + case .teamEncryptionKeyScheduleKeyDeletionDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyScheduleKeyDeletionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_schedule_key_deletion_details") + return .dictionary(d) + case .applyNamingConventionDetails(let arg): + var d = try Serialization.getFields(TeamLog.ApplyNamingConventionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("apply_naming_convention_details") + return .dictionary(d) + case .createFolderDetails(let arg): + var d = try Serialization.getFields(TeamLog.CreateFolderDetailsSerializer().serialize(arg)) + d[".tag"] = .str("create_folder_details") + return .dictionary(d) + case .fileAddDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileAddDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_add_details") + return .dictionary(d) + case .fileAddFromAutomationDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileAddFromAutomationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_add_from_automation_details") + return .dictionary(d) + case .fileCopyDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileCopyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_copy_details") + return .dictionary(d) + case .fileDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_delete_details") + return .dictionary(d) + case .fileDownloadDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileDownloadDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_download_details") + return .dictionary(d) + case .fileEditDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileEditDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_edit_details") + return .dictionary(d) + case .fileGetCopyReferenceDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileGetCopyReferenceDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_get_copy_reference_details") + return .dictionary(d) + case .fileLockingLockStatusChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileLockingLockStatusChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_locking_lock_status_changed_details") + return .dictionary(d) + case .fileMoveDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileMoveDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_move_details") + return .dictionary(d) + case .filePermanentlyDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.FilePermanentlyDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_permanently_delete_details") + return .dictionary(d) + case .filePreviewDetails(let arg): + var d = try Serialization.getFields(TeamLog.FilePreviewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_preview_details") + return .dictionary(d) + case .fileRenameDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRenameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_rename_details") + return .dictionary(d) + case .fileRestoreDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRestoreDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_restore_details") + return .dictionary(d) + case .fileRevertDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRevertDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_revert_details") + return .dictionary(d) + case .fileRollbackChangesDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRollbackChangesDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_rollback_changes_details") + return .dictionary(d) + case .fileSaveCopyReferenceDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileSaveCopyReferenceDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_save_copy_reference_details") + return .dictionary(d) + case .folderOverviewDescriptionChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FolderOverviewDescriptionChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("folder_overview_description_changed_details") + return .dictionary(d) + case .folderOverviewItemPinnedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FolderOverviewItemPinnedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("folder_overview_item_pinned_details") + return .dictionary(d) + case .folderOverviewItemUnpinnedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FolderOverviewItemUnpinnedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("folder_overview_item_unpinned_details") + return .dictionary(d) + case .objectLabelAddedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ObjectLabelAddedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("object_label_added_details") + return .dictionary(d) + case .objectLabelRemovedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ObjectLabelRemovedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("object_label_removed_details") + return .dictionary(d) + case .objectLabelUpdatedValueDetails(let arg): + var d = try Serialization.getFields(TeamLog.ObjectLabelUpdatedValueDetailsSerializer().serialize(arg)) + d[".tag"] = .str("object_label_updated_value_details") + return .dictionary(d) + case .organizeFolderWithTidyDetails(let arg): + var d = try Serialization.getFields(TeamLog.OrganizeFolderWithTidyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("organize_folder_with_tidy_details") + return .dictionary(d) + case .replayFileDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.ReplayFileDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("replay_file_delete_details") + return .dictionary(d) + case .rewindFolderDetails(let arg): + var d = try Serialization.getFields(TeamLog.RewindFolderDetailsSerializer().serialize(arg)) + d[".tag"] = .str("rewind_folder_details") + return .dictionary(d) + case .undoNamingConventionDetails(let arg): + var d = try Serialization.getFields(TeamLog.UndoNamingConventionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("undo_naming_convention_details") + return .dictionary(d) + case .undoOrganizeFolderWithTidyDetails(let arg): + var d = try Serialization.getFields(TeamLog.UndoOrganizeFolderWithTidyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("undo_organize_folder_with_tidy_details") + return .dictionary(d) + case .userTagsAddedDetails(let arg): + var d = try Serialization.getFields(TeamLog.UserTagsAddedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("user_tags_added_details") + return .dictionary(d) + case .userTagsRemovedDetails(let arg): + var d = try Serialization.getFields(TeamLog.UserTagsRemovedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("user_tags_removed_details") + return .dictionary(d) + case .emailIngestReceiveFileDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmailIngestReceiveFileDetailsSerializer().serialize(arg)) + d[".tag"] = .str("email_ingest_receive_file_details") + return .dictionary(d) + case .fileRequestChangeDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestChangeDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_request_change_details") + return .dictionary(d) + case .fileRequestCloseDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestCloseDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_request_close_details") + return .dictionary(d) + case .fileRequestCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_request_create_details") + return .dictionary(d) + case .fileRequestDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_request_delete_details") + return .dictionary(d) + case .fileRequestReceiveFileDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestReceiveFileDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_request_receive_file_details") + return .dictionary(d) + case .groupAddExternalIdDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupAddExternalIdDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_add_external_id_details") + return .dictionary(d) + case .groupAddMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupAddMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_add_member_details") + return .dictionary(d) + case .groupChangeExternalIdDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupChangeExternalIdDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_change_external_id_details") + return .dictionary(d) + case .groupChangeManagementTypeDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupChangeManagementTypeDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_change_management_type_details") + return .dictionary(d) + case .groupChangeMemberRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupChangeMemberRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_change_member_role_details") + return .dictionary(d) + case .groupCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_create_details") + return .dictionary(d) + case .groupDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_delete_details") + return .dictionary(d) + case .groupDescriptionUpdatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupDescriptionUpdatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_description_updated_details") + return .dictionary(d) + case .groupJoinPolicyUpdatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupJoinPolicyUpdatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_join_policy_updated_details") + return .dictionary(d) + case .groupMovedDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupMovedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_moved_details") + return .dictionary(d) + case .groupRemoveExternalIdDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupRemoveExternalIdDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_remove_external_id_details") + return .dictionary(d) + case .groupRemoveMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupRemoveMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_remove_member_details") + return .dictionary(d) + case .groupRenameDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupRenameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_rename_details") + return .dictionary(d) + case .accountLockOrUnlockedDetails(let arg): + var d = try Serialization.getFields(TeamLog.AccountLockOrUnlockedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("account_lock_or_unlocked_details") + return .dictionary(d) + case .emmErrorDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmmErrorDetailsSerializer().serialize(arg)) + d[".tag"] = .str("emm_error_details") + return .dictionary(d) + case .guestAdminSignedInViaTrustedTeamsDetails(let arg): + var d = try Serialization.getFields(TeamLog.GuestAdminSignedInViaTrustedTeamsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("guest_admin_signed_in_via_trusted_teams_details") + return .dictionary(d) + case .guestAdminSignedOutViaTrustedTeamsDetails(let arg): + var d = try Serialization.getFields(TeamLog.GuestAdminSignedOutViaTrustedTeamsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("guest_admin_signed_out_via_trusted_teams_details") + return .dictionary(d) + case .loginFailDetails(let arg): + var d = try Serialization.getFields(TeamLog.LoginFailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("login_fail_details") + return .dictionary(d) + case .loginSuccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.LoginSuccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("login_success_details") + return .dictionary(d) + case .logoutDetails(let arg): + var d = try Serialization.getFields(TeamLog.LogoutDetailsSerializer().serialize(arg)) + d[".tag"] = .str("logout_details") + return .dictionary(d) + case .resellerSupportSessionEndDetails(let arg): + var d = try Serialization.getFields(TeamLog.ResellerSupportSessionEndDetailsSerializer().serialize(arg)) + d[".tag"] = .str("reseller_support_session_end_details") + return .dictionary(d) + case .resellerSupportSessionStartDetails(let arg): + var d = try Serialization.getFields(TeamLog.ResellerSupportSessionStartDetailsSerializer().serialize(arg)) + d[".tag"] = .str("reseller_support_session_start_details") + return .dictionary(d) + case .signInAsSessionEndDetails(let arg): + var d = try Serialization.getFields(TeamLog.SignInAsSessionEndDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sign_in_as_session_end_details") + return .dictionary(d) + case .signInAsSessionStartDetails(let arg): + var d = try Serialization.getFields(TeamLog.SignInAsSessionStartDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sign_in_as_session_start_details") + return .dictionary(d) + case .ssoErrorDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoErrorDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_error_details") + return .dictionary(d) + case .backupAdminInvitationSentDetails(let arg): + var d = try Serialization.getFields(TeamLog.BackupAdminInvitationSentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("backup_admin_invitation_sent_details") + return .dictionary(d) + case .backupInvitationOpenedDetails(let arg): + var d = try Serialization.getFields(TeamLog.BackupInvitationOpenedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("backup_invitation_opened_details") + return .dictionary(d) + case .createTeamInviteLinkDetails(let arg): + var d = try Serialization.getFields(TeamLog.CreateTeamInviteLinkDetailsSerializer().serialize(arg)) + d[".tag"] = .str("create_team_invite_link_details") + return .dictionary(d) + case .deleteTeamInviteLinkDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeleteTeamInviteLinkDetailsSerializer().serialize(arg)) + d[".tag"] = .str("delete_team_invite_link_details") + return .dictionary(d) + case .memberAddExternalIdDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberAddExternalIdDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_add_external_id_details") + return .dictionary(d) + case .memberAddNameDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberAddNameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_add_name_details") + return .dictionary(d) + case .memberChangeAdminRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeAdminRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_change_admin_role_details") + return .dictionary(d) + case .memberChangeEmailDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeEmailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_change_email_details") + return .dictionary(d) + case .memberChangeExternalIdDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeExternalIdDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_change_external_id_details") + return .dictionary(d) + case .memberChangeMembershipTypeDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeMembershipTypeDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_change_membership_type_details") + return .dictionary(d) + case .memberChangeNameDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeNameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_change_name_details") + return .dictionary(d) + case .memberChangeResellerRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeResellerRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_change_reseller_role_details") + return .dictionary(d) + case .memberChangeStatusDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeStatusDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_change_status_details") + return .dictionary(d) + case .memberDeleteManualContactsDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberDeleteManualContactsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_delete_manual_contacts_details") + return .dictionary(d) + case .memberDeleteProfilePhotoDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberDeleteProfilePhotoDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_delete_profile_photo_details") + return .dictionary(d) + case .memberPermanentlyDeleteAccountContentsDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberPermanentlyDeleteAccountContentsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_permanently_delete_account_contents_details") + return .dictionary(d) + case .memberRemoveExternalIdDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberRemoveExternalIdDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_remove_external_id_details") + return .dictionary(d) + case .memberSetProfilePhotoDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSetProfilePhotoDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_set_profile_photo_details") + return .dictionary(d) + case .memberSpaceLimitsAddCustomQuotaDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsAddCustomQuotaDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_add_custom_quota_details") + return .dictionary(d) + case .memberSpaceLimitsChangeCustomQuotaDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCustomQuotaDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_custom_quota_details") + return .dictionary(d) + case .memberSpaceLimitsChangeStatusDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangeStatusDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_status_details") + return .dictionary(d) + case .memberSpaceLimitsRemoveCustomQuotaDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_remove_custom_quota_details") + return .dictionary(d) + case .memberSuggestDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSuggestDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_suggest_details") + return .dictionary(d) + case .memberTransferAccountContentsDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberTransferAccountContentsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_transfer_account_contents_details") + return .dictionary(d) + case .pendingSecondaryEmailAddedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PendingSecondaryEmailAddedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("pending_secondary_email_added_details") + return .dictionary(d) + case .secondaryEmailDeletedDetails(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryEmailDeletedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("secondary_email_deleted_details") + return .dictionary(d) + case .secondaryEmailVerifiedDetails(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryEmailVerifiedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("secondary_email_verified_details") + return .dictionary(d) + case .secondaryMailsPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryMailsPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("secondary_mails_policy_changed_details") + return .dictionary(d) + case .binderAddPageDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderAddPageDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_add_page_details") + return .dictionary(d) + case .binderAddSectionDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderAddSectionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_add_section_details") + return .dictionary(d) + case .binderRemovePageDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderRemovePageDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_remove_page_details") + return .dictionary(d) + case .binderRemoveSectionDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderRemoveSectionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_remove_section_details") + return .dictionary(d) + case .binderRenamePageDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderRenamePageDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_rename_page_details") + return .dictionary(d) + case .binderRenameSectionDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderRenameSectionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_rename_section_details") + return .dictionary(d) + case .binderReorderPageDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderReorderPageDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_reorder_page_details") + return .dictionary(d) + case .binderReorderSectionDetails(let arg): + var d = try Serialization.getFields(TeamLog.BinderReorderSectionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("binder_reorder_section_details") + return .dictionary(d) + case .paperContentAddMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentAddMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_add_member_details") + return .dictionary(d) + case .paperContentAddToFolderDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentAddToFolderDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_add_to_folder_details") + return .dictionary(d) + case .paperContentArchiveDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentArchiveDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_archive_details") + return .dictionary(d) + case .paperContentCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_create_details") + return .dictionary(d) + case .paperContentPermanentlyDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentPermanentlyDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_permanently_delete_details") + return .dictionary(d) + case .paperContentRemoveFromFolderDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRemoveFromFolderDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_remove_from_folder_details") + return .dictionary(d) + case .paperContentRemoveMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRemoveMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_remove_member_details") + return .dictionary(d) + case .paperContentRenameDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRenameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_rename_details") + return .dictionary(d) + case .paperContentRestoreDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRestoreDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_restore_details") + return .dictionary(d) + case .paperDocAddCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocAddCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_add_comment_details") + return .dictionary(d) + case .paperDocChangeMemberRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocChangeMemberRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_change_member_role_details") + return .dictionary(d) + case .paperDocChangeSharingPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocChangeSharingPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_change_sharing_policy_details") + return .dictionary(d) + case .paperDocChangeSubscriptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocChangeSubscriptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_change_subscription_details") + return .dictionary(d) + case .paperDocDeletedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocDeletedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_deleted_details") + return .dictionary(d) + case .paperDocDeleteCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocDeleteCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_delete_comment_details") + return .dictionary(d) + case .paperDocDownloadDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocDownloadDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_download_details") + return .dictionary(d) + case .paperDocEditDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocEditDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_edit_details") + return .dictionary(d) + case .paperDocEditCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocEditCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_edit_comment_details") + return .dictionary(d) + case .paperDocFollowedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocFollowedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_followed_details") + return .dictionary(d) + case .paperDocMentionDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocMentionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_mention_details") + return .dictionary(d) + case .paperDocOwnershipChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocOwnershipChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_ownership_changed_details") + return .dictionary(d) + case .paperDocRequestAccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocRequestAccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_request_access_details") + return .dictionary(d) + case .paperDocResolveCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocResolveCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_resolve_comment_details") + return .dictionary(d) + case .paperDocRevertDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocRevertDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_revert_details") + return .dictionary(d) + case .paperDocSlackShareDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocSlackShareDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_slack_share_details") + return .dictionary(d) + case .paperDocTeamInviteDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocTeamInviteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_team_invite_details") + return .dictionary(d) + case .paperDocTrashedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocTrashedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_trashed_details") + return .dictionary(d) + case .paperDocUnresolveCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocUnresolveCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_unresolve_comment_details") + return .dictionary(d) + case .paperDocUntrashedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocUntrashedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_untrashed_details") + return .dictionary(d) + case .paperDocViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_view_details") + return .dictionary(d) + case .paperExternalViewAllowDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperExternalViewAllowDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_external_view_allow_details") + return .dictionary(d) + case .paperExternalViewDefaultTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperExternalViewDefaultTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_external_view_default_team_details") + return .dictionary(d) + case .paperExternalViewForbidDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperExternalViewForbidDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_external_view_forbid_details") + return .dictionary(d) + case .paperFolderChangeSubscriptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderChangeSubscriptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_change_subscription_details") + return .dictionary(d) + case .paperFolderDeletedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderDeletedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_deleted_details") + return .dictionary(d) + case .paperFolderFollowedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderFollowedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_followed_details") + return .dictionary(d) + case .paperFolderTeamInviteDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderTeamInviteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_team_invite_details") + return .dictionary(d) + case .paperPublishedLinkChangePermissionDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkChangePermissionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_change_permission_details") + return .dictionary(d) + case .paperPublishedLinkCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_create_details") + return .dictionary(d) + case .paperPublishedLinkDisabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkDisabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_disabled_details") + return .dictionary(d) + case .paperPublishedLinkViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_view_details") + return .dictionary(d) + case .passwordChangeDetails(let arg): + var d = try Serialization.getFields(TeamLog.PasswordChangeDetailsSerializer().serialize(arg)) + d[".tag"] = .str("password_change_details") + return .dictionary(d) + case .passwordResetDetails(let arg): + var d = try Serialization.getFields(TeamLog.PasswordResetDetailsSerializer().serialize(arg)) + d[".tag"] = .str("password_reset_details") + return .dictionary(d) + case .passwordResetAllDetails(let arg): + var d = try Serialization.getFields(TeamLog.PasswordResetAllDetailsSerializer().serialize(arg)) + d[".tag"] = .str("password_reset_all_details") + return .dictionary(d) + case .classificationCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.ClassificationCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("classification_create_report_details") + return .dictionary(d) + case .classificationCreateReportFailDetails(let arg): + var d = try Serialization.getFields(TeamLog.ClassificationCreateReportFailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("classification_create_report_fail_details") + return .dictionary(d) + case .emmCreateExceptionsReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmmCreateExceptionsReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("emm_create_exceptions_report_details") + return .dictionary(d) + case .emmCreateUsageReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmmCreateUsageReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("emm_create_usage_report_details") + return .dictionary(d) + case .exportMembersReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExportMembersReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("export_members_report_details") + return .dictionary(d) + case .exportMembersReportFailDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExportMembersReportFailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("export_members_report_fail_details") + return .dictionary(d) + case .externalSharingCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExternalSharingCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("external_sharing_create_report_details") + return .dictionary(d) + case .externalSharingReportFailedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExternalSharingReportFailedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("external_sharing_report_failed_details") + return .dictionary(d) + case .noExpirationLinkGenCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoExpirationLinkGenCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("no_expiration_link_gen_create_report_details") + return .dictionary(d) + case .noExpirationLinkGenReportFailedDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoExpirationLinkGenReportFailedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("no_expiration_link_gen_report_failed_details") + return .dictionary(d) + case .noPasswordLinkGenCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkGenCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_gen_create_report_details") + return .dictionary(d) + case .noPasswordLinkGenReportFailedDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkGenReportFailedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_gen_report_failed_details") + return .dictionary(d) + case .noPasswordLinkViewCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkViewCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_view_create_report_details") + return .dictionary(d) + case .noPasswordLinkViewReportFailedDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkViewReportFailedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_view_report_failed_details") + return .dictionary(d) + case .outdatedLinkViewCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.OutdatedLinkViewCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("outdated_link_view_create_report_details") + return .dictionary(d) + case .outdatedLinkViewReportFailedDetails(let arg): + var d = try Serialization.getFields(TeamLog.OutdatedLinkViewReportFailedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("outdated_link_view_report_failed_details") + return .dictionary(d) + case .paperAdminExportStartDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperAdminExportStartDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_admin_export_start_details") + return .dictionary(d) + case .ransomwareAlertCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareAlertCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_alert_create_report_details") + return .dictionary(d) + case .ransomwareAlertCreateReportFailedDetails(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareAlertCreateReportFailedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_alert_create_report_failed_details") + return .dictionary(d) + case .smartSyncCreateAdminPrivilegeReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncCreateAdminPrivilegeReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_create_admin_privilege_report_details") + return .dictionary(d) + case .teamActivityCreateReportDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamActivityCreateReportDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_activity_create_report_details") + return .dictionary(d) + case .teamActivityCreateReportFailDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamActivityCreateReportFailDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_activity_create_report_fail_details") + return .dictionary(d) + case .collectionShareDetails(let arg): + var d = try Serialization.getFields(TeamLog.CollectionShareDetailsSerializer().serialize(arg)) + d[".tag"] = .str("collection_share_details") + return .dictionary(d) + case .fileTransfersFileAddDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersFileAddDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_file_add_details") + return .dictionary(d) + case .fileTransfersTransferDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_delete_details") + return .dictionary(d) + case .fileTransfersTransferDownloadDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferDownloadDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_download_details") + return .dictionary(d) + case .fileTransfersTransferSendDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferSendDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_send_details") + return .dictionary(d) + case .fileTransfersTransferViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_view_details") + return .dictionary(d) + case .noteAclInviteOnlyDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoteAclInviteOnlyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("note_acl_invite_only_details") + return .dictionary(d) + case .noteAclLinkDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoteAclLinkDetailsSerializer().serialize(arg)) + d[".tag"] = .str("note_acl_link_details") + return .dictionary(d) + case .noteAclTeamLinkDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoteAclTeamLinkDetailsSerializer().serialize(arg)) + d[".tag"] = .str("note_acl_team_link_details") + return .dictionary(d) + case .noteSharedDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoteSharedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("note_shared_details") + return .dictionary(d) + case .noteShareReceiveDetails(let arg): + var d = try Serialization.getFields(TeamLog.NoteShareReceiveDetailsSerializer().serialize(arg)) + d[".tag"] = .str("note_share_receive_details") + return .dictionary(d) + case .openNoteSharedDetails(let arg): + var d = try Serialization.getFields(TeamLog.OpenNoteSharedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("open_note_shared_details") + return .dictionary(d) + case .replayFileSharedLinkCreatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ReplayFileSharedLinkCreatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("replay_file_shared_link_created_details") + return .dictionary(d) + case .replayFileSharedLinkModifiedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ReplayFileSharedLinkModifiedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("replay_file_shared_link_modified_details") + return .dictionary(d) + case .replayProjectTeamAddDetails(let arg): + var d = try Serialization.getFields(TeamLog.ReplayProjectTeamAddDetailsSerializer().serialize(arg)) + d[".tag"] = .str("replay_project_team_add_details") + return .dictionary(d) + case .replayProjectTeamDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.ReplayProjectTeamDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("replay_project_team_delete_details") + return .dictionary(d) + case .sfAddGroupDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfAddGroupDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_add_group_details") + return .dictionary(d) + case .sfAllowNonMembersToViewSharedLinksDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfAllowNonMembersToViewSharedLinksDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_allow_non_members_to_view_shared_links_details") + return .dictionary(d) + case .sfExternalInviteWarnDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfExternalInviteWarnDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_external_invite_warn_details") + return .dictionary(d) + case .sfFbInviteDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfFbInviteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_fb_invite_details") + return .dictionary(d) + case .sfFbInviteChangeRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfFbInviteChangeRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_fb_invite_change_role_details") + return .dictionary(d) + case .sfFbUninviteDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfFbUninviteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_fb_uninvite_details") + return .dictionary(d) + case .sfInviteGroupDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfInviteGroupDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_invite_group_details") + return .dictionary(d) + case .sfTeamGrantAccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamGrantAccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_grant_access_details") + return .dictionary(d) + case .sfTeamInviteDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamInviteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_invite_details") + return .dictionary(d) + case .sfTeamInviteChangeRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamInviteChangeRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_invite_change_role_details") + return .dictionary(d) + case .sfTeamJoinDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamJoinDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_join_details") + return .dictionary(d) + case .sfTeamJoinFromOobLinkDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamJoinFromOobLinkDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_join_from_oob_link_details") + return .dictionary(d) + case .sfTeamUninviteDetails(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamUninviteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_uninvite_details") + return .dictionary(d) + case .sharedContentAddInviteesDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddInviteesDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_invitees_details") + return .dictionary(d) + case .sharedContentAddLinkExpiryDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddLinkExpiryDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_link_expiry_details") + return .dictionary(d) + case .sharedContentAddLinkPasswordDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddLinkPasswordDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_link_password_details") + return .dictionary(d) + case .sharedContentAddMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_member_details") + return .dictionary(d) + case .sharedContentChangeDownloadsPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeDownloadsPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_downloads_policy_details") + return .dictionary(d) + case .sharedContentChangeInviteeRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeInviteeRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_invitee_role_details") + return .dictionary(d) + case .sharedContentChangeLinkAudienceDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeLinkAudienceDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_link_audience_details") + return .dictionary(d) + case .sharedContentChangeLinkExpiryDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeLinkExpiryDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_link_expiry_details") + return .dictionary(d) + case .sharedContentChangeLinkPasswordDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeLinkPasswordDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_link_password_details") + return .dictionary(d) + case .sharedContentChangeMemberRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeMemberRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_member_role_details") + return .dictionary(d) + case .sharedContentChangeViewerInfoPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeViewerInfoPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_viewer_info_policy_details") + return .dictionary(d) + case .sharedContentClaimInvitationDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentClaimInvitationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_claim_invitation_details") + return .dictionary(d) + case .sharedContentCopyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentCopyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_copy_details") + return .dictionary(d) + case .sharedContentDownloadDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentDownloadDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_download_details") + return .dictionary(d) + case .sharedContentRelinquishMembershipDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRelinquishMembershipDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_relinquish_membership_details") + return .dictionary(d) + case .sharedContentRemoveInviteesDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveInviteesDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_invitees_details") + return .dictionary(d) + case .sharedContentRemoveLinkExpiryDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveLinkExpiryDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_link_expiry_details") + return .dictionary(d) + case .sharedContentRemoveLinkPasswordDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveLinkPasswordDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_link_password_details") + return .dictionary(d) + case .sharedContentRemoveMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_member_details") + return .dictionary(d) + case .sharedContentRequestAccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRequestAccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_request_access_details") + return .dictionary(d) + case .sharedContentRestoreInviteesDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRestoreInviteesDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_restore_invitees_details") + return .dictionary(d) + case .sharedContentRestoreMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRestoreMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_restore_member_details") + return .dictionary(d) + case .sharedContentUnshareDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentUnshareDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_unshare_details") + return .dictionary(d) + case .sharedContentViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_view_details") + return .dictionary(d) + case .sharedFolderChangeLinkPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeLinkPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_link_policy_details") + return .dictionary(d) + case .sharedFolderChangeMembersInheritancePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeMembersInheritancePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_members_inheritance_policy_details") + return .dictionary(d) + case .sharedFolderChangeMembersManagementPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeMembersManagementPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_members_management_policy_details") + return .dictionary(d) + case .sharedFolderChangeMembersPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeMembersPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_members_policy_details") + return .dictionary(d) + case .sharedFolderCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_create_details") + return .dictionary(d) + case .sharedFolderDeclineInvitationDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderDeclineInvitationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_decline_invitation_details") + return .dictionary(d) + case .sharedFolderMountDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderMountDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_mount_details") + return .dictionary(d) + case .sharedFolderNestDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderNestDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_nest_details") + return .dictionary(d) + case .sharedFolderTransferOwnershipDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderTransferOwnershipDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_transfer_ownership_details") + return .dictionary(d) + case .sharedFolderUnmountDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderUnmountDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_unmount_details") + return .dictionary(d) + case .sharedLinkAddExpiryDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkAddExpiryDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_add_expiry_details") + return .dictionary(d) + case .sharedLinkChangeExpiryDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkChangeExpiryDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_change_expiry_details") + return .dictionary(d) + case .sharedLinkChangeVisibilityDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkChangeVisibilityDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_change_visibility_details") + return .dictionary(d) + case .sharedLinkCopyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkCopyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_copy_details") + return .dictionary(d) + case .sharedLinkCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_create_details") + return .dictionary(d) + case .sharedLinkDisableDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkDisableDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_disable_details") + return .dictionary(d) + case .sharedLinkDownloadDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkDownloadDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_download_details") + return .dictionary(d) + case .sharedLinkRemoveExpiryDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkRemoveExpiryDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_remove_expiry_details") + return .dictionary(d) + case .sharedLinkSettingsAddExpirationDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAddExpirationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_add_expiration_details") + return .dictionary(d) + case .sharedLinkSettingsAddPasswordDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAddPasswordDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_add_password_details") + return .dictionary(d) + case .sharedLinkSettingsAllowDownloadDisabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadDisabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_allow_download_disabled_details") + return .dictionary(d) + case .sharedLinkSettingsAllowDownloadEnabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadEnabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_allow_download_enabled_details") + return .dictionary(d) + case .sharedLinkSettingsChangeAudienceDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsChangeAudienceDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_change_audience_details") + return .dictionary(d) + case .sharedLinkSettingsChangeExpirationDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsChangeExpirationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_change_expiration_details") + return .dictionary(d) + case .sharedLinkSettingsChangePasswordDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsChangePasswordDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_change_password_details") + return .dictionary(d) + case .sharedLinkSettingsRemoveExpirationDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsRemoveExpirationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_remove_expiration_details") + return .dictionary(d) + case .sharedLinkSettingsRemovePasswordDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsRemovePasswordDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_remove_password_details") + return .dictionary(d) + case .sharedLinkShareDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkShareDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_share_details") + return .dictionary(d) + case .sharedLinkViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_view_details") + return .dictionary(d) + case .sharedNoteOpenedDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharedNoteOpenedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shared_note_opened_details") + return .dictionary(d) + case .shmodelDisableDownloadsDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShmodelDisableDownloadsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shmodel_disable_downloads_details") + return .dictionary(d) + case .shmodelEnableDownloadsDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShmodelEnableDownloadsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shmodel_enable_downloads_details") + return .dictionary(d) + case .shmodelGroupShareDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShmodelGroupShareDetailsSerializer().serialize(arg)) + d[".tag"] = .str("shmodel_group_share_details") + return .dictionary(d) + case .showcaseAccessGrantedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseAccessGrantedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_access_granted_details") + return .dictionary(d) + case .showcaseAddMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseAddMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_add_member_details") + return .dictionary(d) + case .showcaseArchivedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseArchivedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_archived_details") + return .dictionary(d) + case .showcaseCreatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseCreatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_created_details") + return .dictionary(d) + case .showcaseDeleteCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseDeleteCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_delete_comment_details") + return .dictionary(d) + case .showcaseEditedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseEditedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_edited_details") + return .dictionary(d) + case .showcaseEditCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseEditCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_edit_comment_details") + return .dictionary(d) + case .showcaseFileAddedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileAddedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_added_details") + return .dictionary(d) + case .showcaseFileDownloadDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileDownloadDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_download_details") + return .dictionary(d) + case .showcaseFileRemovedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileRemovedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_removed_details") + return .dictionary(d) + case .showcaseFileViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_view_details") + return .dictionary(d) + case .showcasePermanentlyDeletedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcasePermanentlyDeletedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_permanently_deleted_details") + return .dictionary(d) + case .showcasePostCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcasePostCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_post_comment_details") + return .dictionary(d) + case .showcaseRemoveMemberDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRemoveMemberDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_remove_member_details") + return .dictionary(d) + case .showcaseRenamedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRenamedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_renamed_details") + return .dictionary(d) + case .showcaseRequestAccessDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRequestAccessDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_request_access_details") + return .dictionary(d) + case .showcaseResolveCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseResolveCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_resolve_comment_details") + return .dictionary(d) + case .showcaseRestoredDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRestoredDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_restored_details") + return .dictionary(d) + case .showcaseTrashedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseTrashedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_trashed_details") + return .dictionary(d) + case .showcaseTrashedDeprecatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseTrashedDeprecatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_trashed_deprecated_details") + return .dictionary(d) + case .showcaseUnresolveCommentDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseUnresolveCommentDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_unresolve_comment_details") + return .dictionary(d) + case .showcaseUntrashedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseUntrashedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_untrashed_details") + return .dictionary(d) + case .showcaseUntrashedDeprecatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseUntrashedDeprecatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_untrashed_deprecated_details") + return .dictionary(d) + case .showcaseViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_view_details") + return .dictionary(d) + case .ssoAddCertDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoAddCertDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_add_cert_details") + return .dictionary(d) + case .ssoAddLoginUrlDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoAddLoginUrlDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_add_login_url_details") + return .dictionary(d) + case .ssoAddLogoutUrlDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoAddLogoutUrlDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_add_logout_url_details") + return .dictionary(d) + case .ssoChangeCertDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeCertDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_cert_details") + return .dictionary(d) + case .ssoChangeLoginUrlDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeLoginUrlDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_login_url_details") + return .dictionary(d) + case .ssoChangeLogoutUrlDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeLogoutUrlDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_logout_url_details") + return .dictionary(d) + case .ssoChangeSamlIdentityModeDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeSamlIdentityModeDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_saml_identity_mode_details") + return .dictionary(d) + case .ssoRemoveCertDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoRemoveCertDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_remove_cert_details") + return .dictionary(d) + case .ssoRemoveLoginUrlDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoRemoveLoginUrlDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_remove_login_url_details") + return .dictionary(d) + case .ssoRemoveLogoutUrlDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoRemoveLogoutUrlDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_remove_logout_url_details") + return .dictionary(d) + case .teamFolderChangeStatusDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderChangeStatusDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_change_status_details") + return .dictionary(d) + case .teamFolderCreateDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderCreateDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_create_details") + return .dictionary(d) + case .teamFolderDowngradeDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderDowngradeDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_downgrade_details") + return .dictionary(d) + case .teamFolderPermanentlyDeleteDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderPermanentlyDeleteDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_permanently_delete_details") + return .dictionary(d) + case .teamFolderRenameDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderRenameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_rename_details") + return .dictionary(d) + case .teamSelectiveSyncSettingsChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamSelectiveSyncSettingsChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_selective_sync_settings_changed_details") + return .dictionary(d) + case .accountCaptureChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_change_policy_details") + return .dictionary(d) + case .adminEmailRemindersChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.AdminEmailRemindersChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("admin_email_reminders_changed_details") + return .dictionary(d) + case .allowDownloadDisabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.AllowDownloadDisabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("allow_download_disabled_details") + return .dictionary(d) + case .allowDownloadEnabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.AllowDownloadEnabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("allow_download_enabled_details") + return .dictionary(d) + case .appPermissionsChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.AppPermissionsChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("app_permissions_changed_details") + return .dictionary(d) + case .cameraUploadsPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.CameraUploadsPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("camera_uploads_policy_changed_details") + return .dictionary(d) + case .captureTranscriptPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.CaptureTranscriptPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("capture_transcript_policy_changed_details") + return .dictionary(d) + case .classificationChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.ClassificationChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("classification_change_policy_details") + return .dictionary(d) + case .computerBackupPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ComputerBackupPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("computer_backup_policy_changed_details") + return .dictionary(d) + case .contentAdministrationPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ContentAdministrationPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("content_administration_policy_changed_details") + return .dictionary(d) + case .dataPlacementRestrictionChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.DataPlacementRestrictionChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("data_placement_restriction_change_policy_details") + return .dictionary(d) + case .dataPlacementRestrictionSatisfyPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.DataPlacementRestrictionSatisfyPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("data_placement_restriction_satisfy_policy_details") + return .dictionary(d) + case .deviceApprovalsAddExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsAddExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_add_exception_details") + return .dictionary(d) + case .deviceApprovalsChangeDesktopPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeDesktopPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_desktop_policy_details") + return .dictionary(d) + case .deviceApprovalsChangeMobilePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeMobilePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_mobile_policy_details") + return .dictionary(d) + case .deviceApprovalsChangeOverageActionDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeOverageActionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_overage_action_details") + return .dictionary(d) + case .deviceApprovalsChangeUnlinkActionDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeUnlinkActionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_unlink_action_details") + return .dictionary(d) + case .deviceApprovalsRemoveExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsRemoveExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_remove_exception_details") + return .dictionary(d) + case .directoryRestrictionsAddMembersDetails(let arg): + var d = try Serialization.getFields(TeamLog.DirectoryRestrictionsAddMembersDetailsSerializer().serialize(arg)) + d[".tag"] = .str("directory_restrictions_add_members_details") + return .dictionary(d) + case .directoryRestrictionsRemoveMembersDetails(let arg): + var d = try Serialization.getFields(TeamLog.DirectoryRestrictionsRemoveMembersDetailsSerializer().serialize(arg)) + d[".tag"] = .str("directory_restrictions_remove_members_details") + return .dictionary(d) + case .dropboxPasswordsPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.DropboxPasswordsPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("dropbox_passwords_policy_changed_details") + return .dictionary(d) + case .emailIngestPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmailIngestPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("email_ingest_policy_changed_details") + return .dictionary(d) + case .emmAddExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmmAddExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("emm_add_exception_details") + return .dictionary(d) + case .emmChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmmChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("emm_change_policy_details") + return .dictionary(d) + case .emmRemoveExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.EmmRemoveExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("emm_remove_exception_details") + return .dictionary(d) + case .extendedVersionHistoryChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExtendedVersionHistoryChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("extended_version_history_change_policy_details") + return .dictionary(d) + case .externalDriveBackupPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ExternalDriveBackupPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("external_drive_backup_policy_changed_details") + return .dictionary(d) + case .fileCommentsChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileCommentsChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_comments_change_policy_details") + return .dictionary(d) + case .fileLockingPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileLockingPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_locking_policy_changed_details") + return .dictionary(d) + case .fileProviderMigrationPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileProviderMigrationPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_provider_migration_policy_changed_details") + return .dictionary(d) + case .fileRequestsChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestsChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_requests_change_policy_details") + return .dictionary(d) + case .fileRequestsEmailsEnabledDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestsEmailsEnabledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_requests_emails_enabled_details") + return .dictionary(d) + case .fileRequestsEmailsRestrictedToTeamOnlyDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_requests_emails_restricted_to_team_only_details") + return .dictionary(d) + case .fileTransfersPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_policy_changed_details") + return .dictionary(d) + case .folderLinkRestrictionPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.FolderLinkRestrictionPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("folder_link_restriction_policy_changed_details") + return .dictionary(d) + case .googleSsoChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.GoogleSsoChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("google_sso_change_policy_details") + return .dictionary(d) + case .groupUserManagementChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.GroupUserManagementChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("group_user_management_change_policy_details") + return .dictionary(d) + case .integrationPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.IntegrationPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("integration_policy_changed_details") + return .dictionary(d) + case .inviteAcceptanceEmailPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.InviteAcceptanceEmailPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("invite_acceptance_email_policy_changed_details") + return .dictionary(d) + case .memberRequestsChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberRequestsChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_requests_change_policy_details") + return .dictionary(d) + case .memberSendInvitePolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSendInvitePolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_send_invite_policy_changed_details") + return .dictionary(d) + case .memberSpaceLimitsAddExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsAddExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_add_exception_details") + return .dictionary(d) + case .memberSpaceLimitsChangeCapsTypePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_caps_type_policy_details") + return .dictionary(d) + case .memberSpaceLimitsChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_policy_details") + return .dictionary(d) + case .memberSpaceLimitsRemoveExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_remove_exception_details") + return .dictionary(d) + case .memberSuggestionsChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.MemberSuggestionsChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("member_suggestions_change_policy_details") + return .dictionary(d) + case .microsoftOfficeAddinChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.MicrosoftOfficeAddinChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("microsoft_office_addin_change_policy_details") + return .dictionary(d) + case .networkControlChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.NetworkControlChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("network_control_change_policy_details") + return .dictionary(d) + case .paperChangeDeploymentPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangeDeploymentPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_deployment_policy_details") + return .dictionary(d) + case .paperChangeMemberLinkPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangeMemberLinkPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_member_link_policy_details") + return .dictionary(d) + case .paperChangeMemberPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangeMemberPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_member_policy_details") + return .dictionary(d) + case .paperChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_policy_details") + return .dictionary(d) + case .paperDefaultFolderPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDefaultFolderPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_default_folder_policy_changed_details") + return .dictionary(d) + case .paperDesktopPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperDesktopPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_desktop_policy_changed_details") + return .dictionary(d) + case .paperEnabledUsersGroupAdditionDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperEnabledUsersGroupAdditionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_enabled_users_group_addition_details") + return .dictionary(d) + case .paperEnabledUsersGroupRemovalDetails(let arg): + var d = try Serialization.getFields(TeamLog.PaperEnabledUsersGroupRemovalDetailsSerializer().serialize(arg)) + d[".tag"] = .str("paper_enabled_users_group_removal_details") + return .dictionary(d) + case .passwordStrengthRequirementsChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.PasswordStrengthRequirementsChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("password_strength_requirements_change_policy_details") + return .dictionary(d) + case .permanentDeleteChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.PermanentDeleteChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("permanent_delete_change_policy_details") + return .dictionary(d) + case .resellerSupportChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.ResellerSupportChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("reseller_support_change_policy_details") + return .dictionary(d) + case .rewindPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.RewindPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("rewind_policy_changed_details") + return .dictionary(d) + case .sendForSignaturePolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.SendForSignaturePolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("send_for_signature_policy_changed_details") + return .dictionary(d) + case .sharingChangeFolderJoinPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeFolderJoinPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_folder_join_policy_details") + return .dictionary(d) + case .sharingChangeLinkAllowChangeExpirationPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_allow_change_expiration_policy_details") + return .dictionary(d) + case .sharingChangeLinkDefaultExpirationPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkDefaultExpirationPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_default_expiration_policy_details") + return .dictionary(d) + case .sharingChangeLinkEnforcePasswordPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkEnforcePasswordPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_enforce_password_policy_details") + return .dictionary(d) + case .sharingChangeLinkPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_policy_details") + return .dictionary(d) + case .sharingChangeMemberPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeMemberPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_member_policy_details") + return .dictionary(d) + case .showcaseChangeDownloadPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseChangeDownloadPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_change_download_policy_details") + return .dictionary(d) + case .showcaseChangeEnabledPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseChangeEnabledPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_change_enabled_policy_details") + return .dictionary(d) + case .showcaseChangeExternalSharingPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseChangeExternalSharingPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("showcase_change_external_sharing_policy_details") + return .dictionary(d) + case .smarterSmartSyncPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.SmarterSmartSyncPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("smarter_smart_sync_policy_changed_details") + return .dictionary(d) + case .smartSyncChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_change_policy_details") + return .dictionary(d) + case .smartSyncNotOptOutDetails(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncNotOptOutDetailsSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_not_opt_out_details") + return .dictionary(d) + case .smartSyncOptOutDetails(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncOptOutDetailsSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_opt_out_details") + return .dictionary(d) + case .ssoChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_policy_details") + return .dictionary(d) + case .teamBrandingPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamBrandingPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_branding_policy_changed_details") + return .dictionary(d) + case .teamExtensionsPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamExtensionsPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_extensions_policy_changed_details") + return .dictionary(d) + case .teamSelectiveSyncPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamSelectiveSyncPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_selective_sync_policy_changed_details") + return .dictionary(d) + case .teamSharingWhitelistSubjectsChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamSharingWhitelistSubjectsChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_sharing_whitelist_subjects_changed_details") + return .dictionary(d) + case .tfaAddExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaAddExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_add_exception_details") + return .dictionary(d) + case .tfaChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_change_policy_details") + return .dictionary(d) + case .tfaRemoveExceptionDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaRemoveExceptionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_remove_exception_details") + return .dictionary(d) + case .twoAccountChangePolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TwoAccountChangePolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("two_account_change_policy_details") + return .dictionary(d) + case .viewerInfoPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ViewerInfoPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("viewer_info_policy_changed_details") + return .dictionary(d) + case .watermarkingPolicyChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.WatermarkingPolicyChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("watermarking_policy_changed_details") + return .dictionary(d) + case .webSessionsChangeActiveSessionLimitDetails(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionsChangeActiveSessionLimitDetailsSerializer().serialize(arg)) + d[".tag"] = .str("web_sessions_change_active_session_limit_details") + return .dictionary(d) + case .webSessionsChangeFixedLengthPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionsChangeFixedLengthPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("web_sessions_change_fixed_length_policy_details") + return .dictionary(d) + case .webSessionsChangeIdleLengthPolicyDetails(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionsChangeIdleLengthPolicyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("web_sessions_change_idle_length_policy_details") + return .dictionary(d) + case .dataResidencyMigrationRequestSuccessfulDetails(let arg): + var d = try Serialization.getFields(TeamLog.DataResidencyMigrationRequestSuccessfulDetailsSerializer().serialize(arg)) + d[".tag"] = .str("data_residency_migration_request_successful_details") + return .dictionary(d) + case .dataResidencyMigrationRequestUnsuccessfulDetails(let arg): + var d = try Serialization.getFields(TeamLog.DataResidencyMigrationRequestUnsuccessfulDetailsSerializer().serialize(arg)) + d[".tag"] = .str("data_residency_migration_request_unsuccessful_details") + return .dictionary(d) + case .teamMergeFromDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeFromDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_from_details") + return .dictionary(d) + case .teamMergeToDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeToDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_to_details") + return .dictionary(d) + case .teamProfileAddBackgroundDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileAddBackgroundDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_add_background_details") + return .dictionary(d) + case .teamProfileAddLogoDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileAddLogoDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_add_logo_details") + return .dictionary(d) + case .teamProfileChangeBackgroundDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeBackgroundDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_background_details") + return .dictionary(d) + case .teamProfileChangeDefaultLanguageDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeDefaultLanguageDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_default_language_details") + return .dictionary(d) + case .teamProfileChangeLogoDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeLogoDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_logo_details") + return .dictionary(d) + case .teamProfileChangeNameDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeNameDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_name_details") + return .dictionary(d) + case .teamProfileRemoveBackgroundDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileRemoveBackgroundDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_remove_background_details") + return .dictionary(d) + case .teamProfileRemoveLogoDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileRemoveLogoDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_remove_logo_details") + return .dictionary(d) + case .tfaAddBackupPhoneDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaAddBackupPhoneDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_add_backup_phone_details") + return .dictionary(d) + case .tfaAddSecurityKeyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaAddSecurityKeyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_add_security_key_details") + return .dictionary(d) + case .tfaChangeBackupPhoneDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaChangeBackupPhoneDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_change_backup_phone_details") + return .dictionary(d) + case .tfaChangeStatusDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaChangeStatusDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_change_status_details") + return .dictionary(d) + case .tfaRemoveBackupPhoneDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaRemoveBackupPhoneDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_remove_backup_phone_details") + return .dictionary(d) + case .tfaRemoveSecurityKeyDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaRemoveSecurityKeyDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_remove_security_key_details") + return .dictionary(d) + case .tfaResetDetails(let arg): + var d = try Serialization.getFields(TeamLog.TfaResetDetailsSerializer().serialize(arg)) + d[".tag"] = .str("tfa_reset_details") + return .dictionary(d) + case .changedEnterpriseAdminRoleDetails(let arg): + var d = try Serialization.getFields(TeamLog.ChangedEnterpriseAdminRoleDetailsSerializer().serialize(arg)) + d[".tag"] = .str("changed_enterprise_admin_role_details") + return .dictionary(d) + case .changedEnterpriseConnectedTeamStatusDetails(let arg): + var d = try Serialization.getFields(TeamLog.ChangedEnterpriseConnectedTeamStatusDetailsSerializer().serialize(arg)) + d[".tag"] = .str("changed_enterprise_connected_team_status_details") + return .dictionary(d) + case .endedEnterpriseAdminSessionDetails(let arg): + var d = try Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("ended_enterprise_admin_session_details") + return .dictionary(d) + case .endedEnterpriseAdminSessionDeprecatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionDeprecatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("ended_enterprise_admin_session_deprecated_details") + return .dictionary(d) + case .enterpriseSettingsLockingDetails(let arg): + var d = try Serialization.getFields(TeamLog.EnterpriseSettingsLockingDetailsSerializer().serialize(arg)) + d[".tag"] = .str("enterprise_settings_locking_details") + return .dictionary(d) + case .guestAdminChangeStatusDetails(let arg): + var d = try Serialization.getFields(TeamLog.GuestAdminChangeStatusDetailsSerializer().serialize(arg)) + d[".tag"] = .str("guest_admin_change_status_details") + return .dictionary(d) + case .startedEnterpriseAdminSessionDetails(let arg): + var d = try Serialization.getFields(TeamLog.StartedEnterpriseAdminSessionDetailsSerializer().serialize(arg)) + d[".tag"] = .str("started_enterprise_admin_session_details") + return .dictionary(d) + case .teamMergeRequestAcceptedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAcceptedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_accepted_details") + return .dictionary(d) + case .teamMergeRequestAcceptedShownToPrimaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_accepted_shown_to_primary_team_details") + return .dictionary(d) + case .teamMergeRequestAcceptedShownToSecondaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_accepted_shown_to_secondary_team_details") + return .dictionary(d) + case .teamMergeRequestAutoCanceledDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAutoCanceledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_auto_canceled_details") + return .dictionary(d) + case .teamMergeRequestCanceledDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestCanceledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_canceled_details") + return .dictionary(d) + case .teamMergeRequestCanceledShownToPrimaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_canceled_shown_to_primary_team_details") + return .dictionary(d) + case .teamMergeRequestCanceledShownToSecondaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_canceled_shown_to_secondary_team_details") + return .dictionary(d) + case .teamMergeRequestExpiredDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestExpiredDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_expired_details") + return .dictionary(d) + case .teamMergeRequestExpiredShownToPrimaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_expired_shown_to_primary_team_details") + return .dictionary(d) + case .teamMergeRequestExpiredShownToSecondaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_expired_shown_to_secondary_team_details") + return .dictionary(d) + case .teamMergeRequestRejectedShownToPrimaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_rejected_shown_to_primary_team_details") + return .dictionary(d) + case .teamMergeRequestRejectedShownToSecondaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_rejected_shown_to_secondary_team_details") + return .dictionary(d) + case .teamMergeRequestReminderDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestReminderDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_reminder_details") + return .dictionary(d) + case .teamMergeRequestReminderShownToPrimaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_reminder_shown_to_primary_team_details") + return .dictionary(d) + case .teamMergeRequestReminderShownToSecondaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_reminder_shown_to_secondary_team_details") + return .dictionary(d) + case .teamMergeRequestRevokedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestRevokedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_revoked_details") + return .dictionary(d) + case .teamMergeRequestSentShownToPrimaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_sent_shown_to_primary_team_details") + return .dictionary(d) + case .teamMergeRequestSentShownToSecondaryTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_sent_shown_to_secondary_team_details") + return .dictionary(d) + case .missingDetails(let arg): + var d = try Serialization.getFields(TeamLog.MissingDetailsSerializer().serialize(arg)) + d[".tag"] = .str("missing_details") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> EventDetails { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admin_alerting_alert_state_changed_details": + let v = try TeamLog.AdminAlertingAlertStateChangedDetailsSerializer().deserialize(json) + return EventDetails.adminAlertingAlertStateChangedDetails(v) + case "admin_alerting_changed_alert_config_details": + let v = try TeamLog.AdminAlertingChangedAlertConfigDetailsSerializer().deserialize(json) + return EventDetails.adminAlertingChangedAlertConfigDetails(v) + case "admin_alerting_triggered_alert_details": + let v = try TeamLog.AdminAlertingTriggeredAlertDetailsSerializer().deserialize(json) + return EventDetails.adminAlertingTriggeredAlertDetails(v) + case "ransomware_restore_process_completed_details": + let v = try TeamLog.RansomwareRestoreProcessCompletedDetailsSerializer().deserialize(json) + return EventDetails.ransomwareRestoreProcessCompletedDetails(v) + case "ransomware_restore_process_started_details": + let v = try TeamLog.RansomwareRestoreProcessStartedDetailsSerializer().deserialize(json) + return EventDetails.ransomwareRestoreProcessStartedDetails(v) + case "app_blocked_by_permissions_details": + let v = try TeamLog.AppBlockedByPermissionsDetailsSerializer().deserialize(json) + return EventDetails.appBlockedByPermissionsDetails(v) + case "app_link_team_details": + let v = try TeamLog.AppLinkTeamDetailsSerializer().deserialize(json) + return EventDetails.appLinkTeamDetails(v) + case "app_link_user_details": + let v = try TeamLog.AppLinkUserDetailsSerializer().deserialize(json) + return EventDetails.appLinkUserDetails(v) + case "app_unlink_team_details": + let v = try TeamLog.AppUnlinkTeamDetailsSerializer().deserialize(json) + return EventDetails.appUnlinkTeamDetails(v) + case "app_unlink_user_details": + let v = try TeamLog.AppUnlinkUserDetailsSerializer().deserialize(json) + return EventDetails.appUnlinkUserDetails(v) + case "integration_connected_details": + let v = try TeamLog.IntegrationConnectedDetailsSerializer().deserialize(json) + return EventDetails.integrationConnectedDetails(v) + case "integration_disconnected_details": + let v = try TeamLog.IntegrationDisconnectedDetailsSerializer().deserialize(json) + return EventDetails.integrationDisconnectedDetails(v) + case "file_add_comment_details": + let v = try TeamLog.FileAddCommentDetailsSerializer().deserialize(json) + return EventDetails.fileAddCommentDetails(v) + case "file_change_comment_subscription_details": + let v = try TeamLog.FileChangeCommentSubscriptionDetailsSerializer().deserialize(json) + return EventDetails.fileChangeCommentSubscriptionDetails(v) + case "file_delete_comment_details": + let v = try TeamLog.FileDeleteCommentDetailsSerializer().deserialize(json) + return EventDetails.fileDeleteCommentDetails(v) + case "file_edit_comment_details": + let v = try TeamLog.FileEditCommentDetailsSerializer().deserialize(json) + return EventDetails.fileEditCommentDetails(v) + case "file_like_comment_details": + let v = try TeamLog.FileLikeCommentDetailsSerializer().deserialize(json) + return EventDetails.fileLikeCommentDetails(v) + case "file_resolve_comment_details": + let v = try TeamLog.FileResolveCommentDetailsSerializer().deserialize(json) + return EventDetails.fileResolveCommentDetails(v) + case "file_unlike_comment_details": + let v = try TeamLog.FileUnlikeCommentDetailsSerializer().deserialize(json) + return EventDetails.fileUnlikeCommentDetails(v) + case "file_unresolve_comment_details": + let v = try TeamLog.FileUnresolveCommentDetailsSerializer().deserialize(json) + return EventDetails.fileUnresolveCommentDetails(v) + case "governance_policy_add_folders_details": + let v = try TeamLog.GovernancePolicyAddFoldersDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyAddFoldersDetails(v) + case "governance_policy_add_folder_failed_details": + let v = try TeamLog.GovernancePolicyAddFolderFailedDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyAddFolderFailedDetails(v) + case "governance_policy_content_disposed_details": + let v = try TeamLog.GovernancePolicyContentDisposedDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyContentDisposedDetails(v) + case "governance_policy_create_details": + let v = try TeamLog.GovernancePolicyCreateDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyCreateDetails(v) + case "governance_policy_delete_details": + let v = try TeamLog.GovernancePolicyDeleteDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyDeleteDetails(v) + case "governance_policy_edit_details_details": + let v = try TeamLog.GovernancePolicyEditDetailsDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyEditDetailsDetails(v) + case "governance_policy_edit_duration_details": + let v = try TeamLog.GovernancePolicyEditDurationDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyEditDurationDetails(v) + case "governance_policy_export_created_details": + let v = try TeamLog.GovernancePolicyExportCreatedDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyExportCreatedDetails(v) + case "governance_policy_export_removed_details": + let v = try TeamLog.GovernancePolicyExportRemovedDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyExportRemovedDetails(v) + case "governance_policy_remove_folders_details": + let v = try TeamLog.GovernancePolicyRemoveFoldersDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyRemoveFoldersDetails(v) + case "governance_policy_report_created_details": + let v = try TeamLog.GovernancePolicyReportCreatedDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyReportCreatedDetails(v) + case "governance_policy_zip_part_downloaded_details": + let v = try TeamLog.GovernancePolicyZipPartDownloadedDetailsSerializer().deserialize(json) + return EventDetails.governancePolicyZipPartDownloadedDetails(v) + case "legal_holds_activate_a_hold_details": + let v = try TeamLog.LegalHoldsActivateAHoldDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsActivateAHoldDetails(v) + case "legal_holds_add_members_details": + let v = try TeamLog.LegalHoldsAddMembersDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsAddMembersDetails(v) + case "legal_holds_change_hold_details_details": + let v = try TeamLog.LegalHoldsChangeHoldDetailsDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsChangeHoldDetailsDetails(v) + case "legal_holds_change_hold_name_details": + let v = try TeamLog.LegalHoldsChangeHoldNameDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsChangeHoldNameDetails(v) + case "legal_holds_export_a_hold_details": + let v = try TeamLog.LegalHoldsExportAHoldDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsExportAHoldDetails(v) + case "legal_holds_export_cancelled_details": + let v = try TeamLog.LegalHoldsExportCancelledDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsExportCancelledDetails(v) + case "legal_holds_export_downloaded_details": + let v = try TeamLog.LegalHoldsExportDownloadedDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsExportDownloadedDetails(v) + case "legal_holds_export_removed_details": + let v = try TeamLog.LegalHoldsExportRemovedDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsExportRemovedDetails(v) + case "legal_holds_release_a_hold_details": + let v = try TeamLog.LegalHoldsReleaseAHoldDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsReleaseAHoldDetails(v) + case "legal_holds_remove_members_details": + let v = try TeamLog.LegalHoldsRemoveMembersDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsRemoveMembersDetails(v) + case "legal_holds_report_a_hold_details": + let v = try TeamLog.LegalHoldsReportAHoldDetailsSerializer().deserialize(json) + return EventDetails.legalHoldsReportAHoldDetails(v) + case "device_change_ip_desktop_details": + let v = try TeamLog.DeviceChangeIpDesktopDetailsSerializer().deserialize(json) + return EventDetails.deviceChangeIpDesktopDetails(v) + case "device_change_ip_mobile_details": + let v = try TeamLog.DeviceChangeIpMobileDetailsSerializer().deserialize(json) + return EventDetails.deviceChangeIpMobileDetails(v) + case "device_change_ip_web_details": + let v = try TeamLog.DeviceChangeIpWebDetailsSerializer().deserialize(json) + return EventDetails.deviceChangeIpWebDetails(v) + case "device_delete_on_unlink_fail_details": + let v = try TeamLog.DeviceDeleteOnUnlinkFailDetailsSerializer().deserialize(json) + return EventDetails.deviceDeleteOnUnlinkFailDetails(v) + case "device_delete_on_unlink_success_details": + let v = try TeamLog.DeviceDeleteOnUnlinkSuccessDetailsSerializer().deserialize(json) + return EventDetails.deviceDeleteOnUnlinkSuccessDetails(v) + case "device_link_fail_details": + let v = try TeamLog.DeviceLinkFailDetailsSerializer().deserialize(json) + return EventDetails.deviceLinkFailDetails(v) + case "device_link_success_details": + let v = try TeamLog.DeviceLinkSuccessDetailsSerializer().deserialize(json) + return EventDetails.deviceLinkSuccessDetails(v) + case "device_management_disabled_details": + let v = try TeamLog.DeviceManagementDisabledDetailsSerializer().deserialize(json) + return EventDetails.deviceManagementDisabledDetails(v) + case "device_management_enabled_details": + let v = try TeamLog.DeviceManagementEnabledDetailsSerializer().deserialize(json) + return EventDetails.deviceManagementEnabledDetails(v) + case "device_sync_backup_status_changed_details": + let v = try TeamLog.DeviceSyncBackupStatusChangedDetailsSerializer().deserialize(json) + return EventDetails.deviceSyncBackupStatusChangedDetails(v) + case "device_unlink_details": + let v = try TeamLog.DeviceUnlinkDetailsSerializer().deserialize(json) + return EventDetails.deviceUnlinkDetails(v) + case "dropbox_passwords_exported_details": + let v = try TeamLog.DropboxPasswordsExportedDetailsSerializer().deserialize(json) + return EventDetails.dropboxPasswordsExportedDetails(v) + case "dropbox_passwords_new_device_enrolled_details": + let v = try TeamLog.DropboxPasswordsNewDeviceEnrolledDetailsSerializer().deserialize(json) + return EventDetails.dropboxPasswordsNewDeviceEnrolledDetails(v) + case "emm_refresh_auth_token_details": + let v = try TeamLog.EmmRefreshAuthTokenDetailsSerializer().deserialize(json) + return EventDetails.emmRefreshAuthTokenDetails(v) + case "external_drive_backup_eligibility_status_checked_details": + let v = try TeamLog.ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer().deserialize(json) + return EventDetails.externalDriveBackupEligibilityStatusCheckedDetails(v) + case "external_drive_backup_status_changed_details": + let v = try TeamLog.ExternalDriveBackupStatusChangedDetailsSerializer().deserialize(json) + return EventDetails.externalDriveBackupStatusChangedDetails(v) + case "account_capture_change_availability_details": + let v = try TeamLog.AccountCaptureChangeAvailabilityDetailsSerializer().deserialize(json) + return EventDetails.accountCaptureChangeAvailabilityDetails(v) + case "account_capture_migrate_account_details": + let v = try TeamLog.AccountCaptureMigrateAccountDetailsSerializer().deserialize(json) + return EventDetails.accountCaptureMigrateAccountDetails(v) + case "account_capture_notification_emails_sent_details": + let v = try TeamLog.AccountCaptureNotificationEmailsSentDetailsSerializer().deserialize(json) + return EventDetails.accountCaptureNotificationEmailsSentDetails(v) + case "account_capture_relinquish_account_details": + let v = try TeamLog.AccountCaptureRelinquishAccountDetailsSerializer().deserialize(json) + return EventDetails.accountCaptureRelinquishAccountDetails(v) + case "disabled_domain_invites_details": + let v = try TeamLog.DisabledDomainInvitesDetailsSerializer().deserialize(json) + return EventDetails.disabledDomainInvitesDetails(v) + case "domain_invites_approve_request_to_join_team_details": + let v = try TeamLog.DomainInvitesApproveRequestToJoinTeamDetailsSerializer().deserialize(json) + return EventDetails.domainInvitesApproveRequestToJoinTeamDetails(v) + case "domain_invites_decline_request_to_join_team_details": + let v = try TeamLog.DomainInvitesDeclineRequestToJoinTeamDetailsSerializer().deserialize(json) + return EventDetails.domainInvitesDeclineRequestToJoinTeamDetails(v) + case "domain_invites_email_existing_users_details": + let v = try TeamLog.DomainInvitesEmailExistingUsersDetailsSerializer().deserialize(json) + return EventDetails.domainInvitesEmailExistingUsersDetails(v) + case "domain_invites_request_to_join_team_details": + let v = try TeamLog.DomainInvitesRequestToJoinTeamDetailsSerializer().deserialize(json) + return EventDetails.domainInvitesRequestToJoinTeamDetails(v) + case "domain_invites_set_invite_new_user_pref_to_no_details": + let v = try TeamLog.DomainInvitesSetInviteNewUserPrefToNoDetailsSerializer().deserialize(json) + return EventDetails.domainInvitesSetInviteNewUserPrefToNoDetails(v) + case "domain_invites_set_invite_new_user_pref_to_yes_details": + let v = try TeamLog.DomainInvitesSetInviteNewUserPrefToYesDetailsSerializer().deserialize(json) + return EventDetails.domainInvitesSetInviteNewUserPrefToYesDetails(v) + case "domain_verification_add_domain_fail_details": + let v = try TeamLog.DomainVerificationAddDomainFailDetailsSerializer().deserialize(json) + return EventDetails.domainVerificationAddDomainFailDetails(v) + case "domain_verification_add_domain_success_details": + let v = try TeamLog.DomainVerificationAddDomainSuccessDetailsSerializer().deserialize(json) + return EventDetails.domainVerificationAddDomainSuccessDetails(v) + case "domain_verification_remove_domain_details": + let v = try TeamLog.DomainVerificationRemoveDomainDetailsSerializer().deserialize(json) + return EventDetails.domainVerificationRemoveDomainDetails(v) + case "enabled_domain_invites_details": + let v = try TeamLog.EnabledDomainInvitesDetailsSerializer().deserialize(json) + return EventDetails.enabledDomainInvitesDetails(v) + case "team_encryption_key_cancel_key_deletion_details": + let v = try TeamLog.TeamEncryptionKeyCancelKeyDeletionDetailsSerializer().deserialize(json) + return EventDetails.teamEncryptionKeyCancelKeyDeletionDetails(v) + case "team_encryption_key_create_key_details": + let v = try TeamLog.TeamEncryptionKeyCreateKeyDetailsSerializer().deserialize(json) + return EventDetails.teamEncryptionKeyCreateKeyDetails(v) + case "team_encryption_key_delete_key_details": + let v = try TeamLog.TeamEncryptionKeyDeleteKeyDetailsSerializer().deserialize(json) + return EventDetails.teamEncryptionKeyDeleteKeyDetails(v) + case "team_encryption_key_disable_key_details": + let v = try TeamLog.TeamEncryptionKeyDisableKeyDetailsSerializer().deserialize(json) + return EventDetails.teamEncryptionKeyDisableKeyDetails(v) + case "team_encryption_key_enable_key_details": + let v = try TeamLog.TeamEncryptionKeyEnableKeyDetailsSerializer().deserialize(json) + return EventDetails.teamEncryptionKeyEnableKeyDetails(v) + case "team_encryption_key_rotate_key_details": + let v = try TeamLog.TeamEncryptionKeyRotateKeyDetailsSerializer().deserialize(json) + return EventDetails.teamEncryptionKeyRotateKeyDetails(v) + case "team_encryption_key_schedule_key_deletion_details": + let v = try TeamLog.TeamEncryptionKeyScheduleKeyDeletionDetailsSerializer().deserialize(json) + return EventDetails.teamEncryptionKeyScheduleKeyDeletionDetails(v) + case "apply_naming_convention_details": + let v = try TeamLog.ApplyNamingConventionDetailsSerializer().deserialize(json) + return EventDetails.applyNamingConventionDetails(v) + case "create_folder_details": + let v = try TeamLog.CreateFolderDetailsSerializer().deserialize(json) + return EventDetails.createFolderDetails(v) + case "file_add_details": + let v = try TeamLog.FileAddDetailsSerializer().deserialize(json) + return EventDetails.fileAddDetails(v) + case "file_add_from_automation_details": + let v = try TeamLog.FileAddFromAutomationDetailsSerializer().deserialize(json) + return EventDetails.fileAddFromAutomationDetails(v) + case "file_copy_details": + let v = try TeamLog.FileCopyDetailsSerializer().deserialize(json) + return EventDetails.fileCopyDetails(v) + case "file_delete_details": + let v = try TeamLog.FileDeleteDetailsSerializer().deserialize(json) + return EventDetails.fileDeleteDetails(v) + case "file_download_details": + let v = try TeamLog.FileDownloadDetailsSerializer().deserialize(json) + return EventDetails.fileDownloadDetails(v) + case "file_edit_details": + let v = try TeamLog.FileEditDetailsSerializer().deserialize(json) + return EventDetails.fileEditDetails(v) + case "file_get_copy_reference_details": + let v = try TeamLog.FileGetCopyReferenceDetailsSerializer().deserialize(json) + return EventDetails.fileGetCopyReferenceDetails(v) + case "file_locking_lock_status_changed_details": + let v = try TeamLog.FileLockingLockStatusChangedDetailsSerializer().deserialize(json) + return EventDetails.fileLockingLockStatusChangedDetails(v) + case "file_move_details": + let v = try TeamLog.FileMoveDetailsSerializer().deserialize(json) + return EventDetails.fileMoveDetails(v) + case "file_permanently_delete_details": + let v = try TeamLog.FilePermanentlyDeleteDetailsSerializer().deserialize(json) + return EventDetails.filePermanentlyDeleteDetails(v) + case "file_preview_details": + let v = try TeamLog.FilePreviewDetailsSerializer().deserialize(json) + return EventDetails.filePreviewDetails(v) + case "file_rename_details": + let v = try TeamLog.FileRenameDetailsSerializer().deserialize(json) + return EventDetails.fileRenameDetails(v) + case "file_restore_details": + let v = try TeamLog.FileRestoreDetailsSerializer().deserialize(json) + return EventDetails.fileRestoreDetails(v) + case "file_revert_details": + let v = try TeamLog.FileRevertDetailsSerializer().deserialize(json) + return EventDetails.fileRevertDetails(v) + case "file_rollback_changes_details": + let v = try TeamLog.FileRollbackChangesDetailsSerializer().deserialize(json) + return EventDetails.fileRollbackChangesDetails(v) + case "file_save_copy_reference_details": + let v = try TeamLog.FileSaveCopyReferenceDetailsSerializer().deserialize(json) + return EventDetails.fileSaveCopyReferenceDetails(v) + case "folder_overview_description_changed_details": + let v = try TeamLog.FolderOverviewDescriptionChangedDetailsSerializer().deserialize(json) + return EventDetails.folderOverviewDescriptionChangedDetails(v) + case "folder_overview_item_pinned_details": + let v = try TeamLog.FolderOverviewItemPinnedDetailsSerializer().deserialize(json) + return EventDetails.folderOverviewItemPinnedDetails(v) + case "folder_overview_item_unpinned_details": + let v = try TeamLog.FolderOverviewItemUnpinnedDetailsSerializer().deserialize(json) + return EventDetails.folderOverviewItemUnpinnedDetails(v) + case "object_label_added_details": + let v = try TeamLog.ObjectLabelAddedDetailsSerializer().deserialize(json) + return EventDetails.objectLabelAddedDetails(v) + case "object_label_removed_details": + let v = try TeamLog.ObjectLabelRemovedDetailsSerializer().deserialize(json) + return EventDetails.objectLabelRemovedDetails(v) + case "object_label_updated_value_details": + let v = try TeamLog.ObjectLabelUpdatedValueDetailsSerializer().deserialize(json) + return EventDetails.objectLabelUpdatedValueDetails(v) + case "organize_folder_with_tidy_details": + let v = try TeamLog.OrganizeFolderWithTidyDetailsSerializer().deserialize(json) + return EventDetails.organizeFolderWithTidyDetails(v) + case "replay_file_delete_details": + let v = try TeamLog.ReplayFileDeleteDetailsSerializer().deserialize(json) + return EventDetails.replayFileDeleteDetails(v) + case "rewind_folder_details": + let v = try TeamLog.RewindFolderDetailsSerializer().deserialize(json) + return EventDetails.rewindFolderDetails(v) + case "undo_naming_convention_details": + let v = try TeamLog.UndoNamingConventionDetailsSerializer().deserialize(json) + return EventDetails.undoNamingConventionDetails(v) + case "undo_organize_folder_with_tidy_details": + let v = try TeamLog.UndoOrganizeFolderWithTidyDetailsSerializer().deserialize(json) + return EventDetails.undoOrganizeFolderWithTidyDetails(v) + case "user_tags_added_details": + let v = try TeamLog.UserTagsAddedDetailsSerializer().deserialize(json) + return EventDetails.userTagsAddedDetails(v) + case "user_tags_removed_details": + let v = try TeamLog.UserTagsRemovedDetailsSerializer().deserialize(json) + return EventDetails.userTagsRemovedDetails(v) + case "email_ingest_receive_file_details": + let v = try TeamLog.EmailIngestReceiveFileDetailsSerializer().deserialize(json) + return EventDetails.emailIngestReceiveFileDetails(v) + case "file_request_change_details": + let v = try TeamLog.FileRequestChangeDetailsSerializer().deserialize(json) + return EventDetails.fileRequestChangeDetails(v) + case "file_request_close_details": + let v = try TeamLog.FileRequestCloseDetailsSerializer().deserialize(json) + return EventDetails.fileRequestCloseDetails(v) + case "file_request_create_details": + let v = try TeamLog.FileRequestCreateDetailsSerializer().deserialize(json) + return EventDetails.fileRequestCreateDetails(v) + case "file_request_delete_details": + let v = try TeamLog.FileRequestDeleteDetailsSerializer().deserialize(json) + return EventDetails.fileRequestDeleteDetails(v) + case "file_request_receive_file_details": + let v = try TeamLog.FileRequestReceiveFileDetailsSerializer().deserialize(json) + return EventDetails.fileRequestReceiveFileDetails(v) + case "group_add_external_id_details": + let v = try TeamLog.GroupAddExternalIdDetailsSerializer().deserialize(json) + return EventDetails.groupAddExternalIdDetails(v) + case "group_add_member_details": + let v = try TeamLog.GroupAddMemberDetailsSerializer().deserialize(json) + return EventDetails.groupAddMemberDetails(v) + case "group_change_external_id_details": + let v = try TeamLog.GroupChangeExternalIdDetailsSerializer().deserialize(json) + return EventDetails.groupChangeExternalIdDetails(v) + case "group_change_management_type_details": + let v = try TeamLog.GroupChangeManagementTypeDetailsSerializer().deserialize(json) + return EventDetails.groupChangeManagementTypeDetails(v) + case "group_change_member_role_details": + let v = try TeamLog.GroupChangeMemberRoleDetailsSerializer().deserialize(json) + return EventDetails.groupChangeMemberRoleDetails(v) + case "group_create_details": + let v = try TeamLog.GroupCreateDetailsSerializer().deserialize(json) + return EventDetails.groupCreateDetails(v) + case "group_delete_details": + let v = try TeamLog.GroupDeleteDetailsSerializer().deserialize(json) + return EventDetails.groupDeleteDetails(v) + case "group_description_updated_details": + let v = try TeamLog.GroupDescriptionUpdatedDetailsSerializer().deserialize(json) + return EventDetails.groupDescriptionUpdatedDetails(v) + case "group_join_policy_updated_details": + let v = try TeamLog.GroupJoinPolicyUpdatedDetailsSerializer().deserialize(json) + return EventDetails.groupJoinPolicyUpdatedDetails(v) + case "group_moved_details": + let v = try TeamLog.GroupMovedDetailsSerializer().deserialize(json) + return EventDetails.groupMovedDetails(v) + case "group_remove_external_id_details": + let v = try TeamLog.GroupRemoveExternalIdDetailsSerializer().deserialize(json) + return EventDetails.groupRemoveExternalIdDetails(v) + case "group_remove_member_details": + let v = try TeamLog.GroupRemoveMemberDetailsSerializer().deserialize(json) + return EventDetails.groupRemoveMemberDetails(v) + case "group_rename_details": + let v = try TeamLog.GroupRenameDetailsSerializer().deserialize(json) + return EventDetails.groupRenameDetails(v) + case "account_lock_or_unlocked_details": + let v = try TeamLog.AccountLockOrUnlockedDetailsSerializer().deserialize(json) + return EventDetails.accountLockOrUnlockedDetails(v) + case "emm_error_details": + let v = try TeamLog.EmmErrorDetailsSerializer().deserialize(json) + return EventDetails.emmErrorDetails(v) + case "guest_admin_signed_in_via_trusted_teams_details": + let v = try TeamLog.GuestAdminSignedInViaTrustedTeamsDetailsSerializer().deserialize(json) + return EventDetails.guestAdminSignedInViaTrustedTeamsDetails(v) + case "guest_admin_signed_out_via_trusted_teams_details": + let v = try TeamLog.GuestAdminSignedOutViaTrustedTeamsDetailsSerializer().deserialize(json) + return EventDetails.guestAdminSignedOutViaTrustedTeamsDetails(v) + case "login_fail_details": + let v = try TeamLog.LoginFailDetailsSerializer().deserialize(json) + return EventDetails.loginFailDetails(v) + case "login_success_details": + let v = try TeamLog.LoginSuccessDetailsSerializer().deserialize(json) + return EventDetails.loginSuccessDetails(v) + case "logout_details": + let v = try TeamLog.LogoutDetailsSerializer().deserialize(json) + return EventDetails.logoutDetails(v) + case "reseller_support_session_end_details": + let v = try TeamLog.ResellerSupportSessionEndDetailsSerializer().deserialize(json) + return EventDetails.resellerSupportSessionEndDetails(v) + case "reseller_support_session_start_details": + let v = try TeamLog.ResellerSupportSessionStartDetailsSerializer().deserialize(json) + return EventDetails.resellerSupportSessionStartDetails(v) + case "sign_in_as_session_end_details": + let v = try TeamLog.SignInAsSessionEndDetailsSerializer().deserialize(json) + return EventDetails.signInAsSessionEndDetails(v) + case "sign_in_as_session_start_details": + let v = try TeamLog.SignInAsSessionStartDetailsSerializer().deserialize(json) + return EventDetails.signInAsSessionStartDetails(v) + case "sso_error_details": + let v = try TeamLog.SsoErrorDetailsSerializer().deserialize(json) + return EventDetails.ssoErrorDetails(v) + case "backup_admin_invitation_sent_details": + let v = try TeamLog.BackupAdminInvitationSentDetailsSerializer().deserialize(json) + return EventDetails.backupAdminInvitationSentDetails(v) + case "backup_invitation_opened_details": + let v = try TeamLog.BackupInvitationOpenedDetailsSerializer().deserialize(json) + return EventDetails.backupInvitationOpenedDetails(v) + case "create_team_invite_link_details": + let v = try TeamLog.CreateTeamInviteLinkDetailsSerializer().deserialize(json) + return EventDetails.createTeamInviteLinkDetails(v) + case "delete_team_invite_link_details": + let v = try TeamLog.DeleteTeamInviteLinkDetailsSerializer().deserialize(json) + return EventDetails.deleteTeamInviteLinkDetails(v) + case "member_add_external_id_details": + let v = try TeamLog.MemberAddExternalIdDetailsSerializer().deserialize(json) + return EventDetails.memberAddExternalIdDetails(v) + case "member_add_name_details": + let v = try TeamLog.MemberAddNameDetailsSerializer().deserialize(json) + return EventDetails.memberAddNameDetails(v) + case "member_change_admin_role_details": + let v = try TeamLog.MemberChangeAdminRoleDetailsSerializer().deserialize(json) + return EventDetails.memberChangeAdminRoleDetails(v) + case "member_change_email_details": + let v = try TeamLog.MemberChangeEmailDetailsSerializer().deserialize(json) + return EventDetails.memberChangeEmailDetails(v) + case "member_change_external_id_details": + let v = try TeamLog.MemberChangeExternalIdDetailsSerializer().deserialize(json) + return EventDetails.memberChangeExternalIdDetails(v) + case "member_change_membership_type_details": + let v = try TeamLog.MemberChangeMembershipTypeDetailsSerializer().deserialize(json) + return EventDetails.memberChangeMembershipTypeDetails(v) + case "member_change_name_details": + let v = try TeamLog.MemberChangeNameDetailsSerializer().deserialize(json) + return EventDetails.memberChangeNameDetails(v) + case "member_change_reseller_role_details": + let v = try TeamLog.MemberChangeResellerRoleDetailsSerializer().deserialize(json) + return EventDetails.memberChangeResellerRoleDetails(v) + case "member_change_status_details": + let v = try TeamLog.MemberChangeStatusDetailsSerializer().deserialize(json) + return EventDetails.memberChangeStatusDetails(v) + case "member_delete_manual_contacts_details": + let v = try TeamLog.MemberDeleteManualContactsDetailsSerializer().deserialize(json) + return EventDetails.memberDeleteManualContactsDetails(v) + case "member_delete_profile_photo_details": + let v = try TeamLog.MemberDeleteProfilePhotoDetailsSerializer().deserialize(json) + return EventDetails.memberDeleteProfilePhotoDetails(v) + case "member_permanently_delete_account_contents_details": + let v = try TeamLog.MemberPermanentlyDeleteAccountContentsDetailsSerializer().deserialize(json) + return EventDetails.memberPermanentlyDeleteAccountContentsDetails(v) + case "member_remove_external_id_details": + let v = try TeamLog.MemberRemoveExternalIdDetailsSerializer().deserialize(json) + return EventDetails.memberRemoveExternalIdDetails(v) + case "member_set_profile_photo_details": + let v = try TeamLog.MemberSetProfilePhotoDetailsSerializer().deserialize(json) + return EventDetails.memberSetProfilePhotoDetails(v) + case "member_space_limits_add_custom_quota_details": + let v = try TeamLog.MemberSpaceLimitsAddCustomQuotaDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsAddCustomQuotaDetails(v) + case "member_space_limits_change_custom_quota_details": + let v = try TeamLog.MemberSpaceLimitsChangeCustomQuotaDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsChangeCustomQuotaDetails(v) + case "member_space_limits_change_status_details": + let v = try TeamLog.MemberSpaceLimitsChangeStatusDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsChangeStatusDetails(v) + case "member_space_limits_remove_custom_quota_details": + let v = try TeamLog.MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsRemoveCustomQuotaDetails(v) + case "member_suggest_details": + let v = try TeamLog.MemberSuggestDetailsSerializer().deserialize(json) + return EventDetails.memberSuggestDetails(v) + case "member_transfer_account_contents_details": + let v = try TeamLog.MemberTransferAccountContentsDetailsSerializer().deserialize(json) + return EventDetails.memberTransferAccountContentsDetails(v) + case "pending_secondary_email_added_details": + let v = try TeamLog.PendingSecondaryEmailAddedDetailsSerializer().deserialize(json) + return EventDetails.pendingSecondaryEmailAddedDetails(v) + case "secondary_email_deleted_details": + let v = try TeamLog.SecondaryEmailDeletedDetailsSerializer().deserialize(json) + return EventDetails.secondaryEmailDeletedDetails(v) + case "secondary_email_verified_details": + let v = try TeamLog.SecondaryEmailVerifiedDetailsSerializer().deserialize(json) + return EventDetails.secondaryEmailVerifiedDetails(v) + case "secondary_mails_policy_changed_details": + let v = try TeamLog.SecondaryMailsPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.secondaryMailsPolicyChangedDetails(v) + case "binder_add_page_details": + let v = try TeamLog.BinderAddPageDetailsSerializer().deserialize(json) + return EventDetails.binderAddPageDetails(v) + case "binder_add_section_details": + let v = try TeamLog.BinderAddSectionDetailsSerializer().deserialize(json) + return EventDetails.binderAddSectionDetails(v) + case "binder_remove_page_details": + let v = try TeamLog.BinderRemovePageDetailsSerializer().deserialize(json) + return EventDetails.binderRemovePageDetails(v) + case "binder_remove_section_details": + let v = try TeamLog.BinderRemoveSectionDetailsSerializer().deserialize(json) + return EventDetails.binderRemoveSectionDetails(v) + case "binder_rename_page_details": + let v = try TeamLog.BinderRenamePageDetailsSerializer().deserialize(json) + return EventDetails.binderRenamePageDetails(v) + case "binder_rename_section_details": + let v = try TeamLog.BinderRenameSectionDetailsSerializer().deserialize(json) + return EventDetails.binderRenameSectionDetails(v) + case "binder_reorder_page_details": + let v = try TeamLog.BinderReorderPageDetailsSerializer().deserialize(json) + return EventDetails.binderReorderPageDetails(v) + case "binder_reorder_section_details": + let v = try TeamLog.BinderReorderSectionDetailsSerializer().deserialize(json) + return EventDetails.binderReorderSectionDetails(v) + case "paper_content_add_member_details": + let v = try TeamLog.PaperContentAddMemberDetailsSerializer().deserialize(json) + return EventDetails.paperContentAddMemberDetails(v) + case "paper_content_add_to_folder_details": + let v = try TeamLog.PaperContentAddToFolderDetailsSerializer().deserialize(json) + return EventDetails.paperContentAddToFolderDetails(v) + case "paper_content_archive_details": + let v = try TeamLog.PaperContentArchiveDetailsSerializer().deserialize(json) + return EventDetails.paperContentArchiveDetails(v) + case "paper_content_create_details": + let v = try TeamLog.PaperContentCreateDetailsSerializer().deserialize(json) + return EventDetails.paperContentCreateDetails(v) + case "paper_content_permanently_delete_details": + let v = try TeamLog.PaperContentPermanentlyDeleteDetailsSerializer().deserialize(json) + return EventDetails.paperContentPermanentlyDeleteDetails(v) + case "paper_content_remove_from_folder_details": + let v = try TeamLog.PaperContentRemoveFromFolderDetailsSerializer().deserialize(json) + return EventDetails.paperContentRemoveFromFolderDetails(v) + case "paper_content_remove_member_details": + let v = try TeamLog.PaperContentRemoveMemberDetailsSerializer().deserialize(json) + return EventDetails.paperContentRemoveMemberDetails(v) + case "paper_content_rename_details": + let v = try TeamLog.PaperContentRenameDetailsSerializer().deserialize(json) + return EventDetails.paperContentRenameDetails(v) + case "paper_content_restore_details": + let v = try TeamLog.PaperContentRestoreDetailsSerializer().deserialize(json) + return EventDetails.paperContentRestoreDetails(v) + case "paper_doc_add_comment_details": + let v = try TeamLog.PaperDocAddCommentDetailsSerializer().deserialize(json) + return EventDetails.paperDocAddCommentDetails(v) + case "paper_doc_change_member_role_details": + let v = try TeamLog.PaperDocChangeMemberRoleDetailsSerializer().deserialize(json) + return EventDetails.paperDocChangeMemberRoleDetails(v) + case "paper_doc_change_sharing_policy_details": + let v = try TeamLog.PaperDocChangeSharingPolicyDetailsSerializer().deserialize(json) + return EventDetails.paperDocChangeSharingPolicyDetails(v) + case "paper_doc_change_subscription_details": + let v = try TeamLog.PaperDocChangeSubscriptionDetailsSerializer().deserialize(json) + return EventDetails.paperDocChangeSubscriptionDetails(v) + case "paper_doc_deleted_details": + let v = try TeamLog.PaperDocDeletedDetailsSerializer().deserialize(json) + return EventDetails.paperDocDeletedDetails(v) + case "paper_doc_delete_comment_details": + let v = try TeamLog.PaperDocDeleteCommentDetailsSerializer().deserialize(json) + return EventDetails.paperDocDeleteCommentDetails(v) + case "paper_doc_download_details": + let v = try TeamLog.PaperDocDownloadDetailsSerializer().deserialize(json) + return EventDetails.paperDocDownloadDetails(v) + case "paper_doc_edit_details": + let v = try TeamLog.PaperDocEditDetailsSerializer().deserialize(json) + return EventDetails.paperDocEditDetails(v) + case "paper_doc_edit_comment_details": + let v = try TeamLog.PaperDocEditCommentDetailsSerializer().deserialize(json) + return EventDetails.paperDocEditCommentDetails(v) + case "paper_doc_followed_details": + let v = try TeamLog.PaperDocFollowedDetailsSerializer().deserialize(json) + return EventDetails.paperDocFollowedDetails(v) + case "paper_doc_mention_details": + let v = try TeamLog.PaperDocMentionDetailsSerializer().deserialize(json) + return EventDetails.paperDocMentionDetails(v) + case "paper_doc_ownership_changed_details": + let v = try TeamLog.PaperDocOwnershipChangedDetailsSerializer().deserialize(json) + return EventDetails.paperDocOwnershipChangedDetails(v) + case "paper_doc_request_access_details": + let v = try TeamLog.PaperDocRequestAccessDetailsSerializer().deserialize(json) + return EventDetails.paperDocRequestAccessDetails(v) + case "paper_doc_resolve_comment_details": + let v = try TeamLog.PaperDocResolveCommentDetailsSerializer().deserialize(json) + return EventDetails.paperDocResolveCommentDetails(v) + case "paper_doc_revert_details": + let v = try TeamLog.PaperDocRevertDetailsSerializer().deserialize(json) + return EventDetails.paperDocRevertDetails(v) + case "paper_doc_slack_share_details": + let v = try TeamLog.PaperDocSlackShareDetailsSerializer().deserialize(json) + return EventDetails.paperDocSlackShareDetails(v) + case "paper_doc_team_invite_details": + let v = try TeamLog.PaperDocTeamInviteDetailsSerializer().deserialize(json) + return EventDetails.paperDocTeamInviteDetails(v) + case "paper_doc_trashed_details": + let v = try TeamLog.PaperDocTrashedDetailsSerializer().deserialize(json) + return EventDetails.paperDocTrashedDetails(v) + case "paper_doc_unresolve_comment_details": + let v = try TeamLog.PaperDocUnresolveCommentDetailsSerializer().deserialize(json) + return EventDetails.paperDocUnresolveCommentDetails(v) + case "paper_doc_untrashed_details": + let v = try TeamLog.PaperDocUntrashedDetailsSerializer().deserialize(json) + return EventDetails.paperDocUntrashedDetails(v) + case "paper_doc_view_details": + let v = try TeamLog.PaperDocViewDetailsSerializer().deserialize(json) + return EventDetails.paperDocViewDetails(v) + case "paper_external_view_allow_details": + let v = try TeamLog.PaperExternalViewAllowDetailsSerializer().deserialize(json) + return EventDetails.paperExternalViewAllowDetails(v) + case "paper_external_view_default_team_details": + let v = try TeamLog.PaperExternalViewDefaultTeamDetailsSerializer().deserialize(json) + return EventDetails.paperExternalViewDefaultTeamDetails(v) + case "paper_external_view_forbid_details": + let v = try TeamLog.PaperExternalViewForbidDetailsSerializer().deserialize(json) + return EventDetails.paperExternalViewForbidDetails(v) + case "paper_folder_change_subscription_details": + let v = try TeamLog.PaperFolderChangeSubscriptionDetailsSerializer().deserialize(json) + return EventDetails.paperFolderChangeSubscriptionDetails(v) + case "paper_folder_deleted_details": + let v = try TeamLog.PaperFolderDeletedDetailsSerializer().deserialize(json) + return EventDetails.paperFolderDeletedDetails(v) + case "paper_folder_followed_details": + let v = try TeamLog.PaperFolderFollowedDetailsSerializer().deserialize(json) + return EventDetails.paperFolderFollowedDetails(v) + case "paper_folder_team_invite_details": + let v = try TeamLog.PaperFolderTeamInviteDetailsSerializer().deserialize(json) + return EventDetails.paperFolderTeamInviteDetails(v) + case "paper_published_link_change_permission_details": + let v = try TeamLog.PaperPublishedLinkChangePermissionDetailsSerializer().deserialize(json) + return EventDetails.paperPublishedLinkChangePermissionDetails(v) + case "paper_published_link_create_details": + let v = try TeamLog.PaperPublishedLinkCreateDetailsSerializer().deserialize(json) + return EventDetails.paperPublishedLinkCreateDetails(v) + case "paper_published_link_disabled_details": + let v = try TeamLog.PaperPublishedLinkDisabledDetailsSerializer().deserialize(json) + return EventDetails.paperPublishedLinkDisabledDetails(v) + case "paper_published_link_view_details": + let v = try TeamLog.PaperPublishedLinkViewDetailsSerializer().deserialize(json) + return EventDetails.paperPublishedLinkViewDetails(v) + case "password_change_details": + let v = try TeamLog.PasswordChangeDetailsSerializer().deserialize(json) + return EventDetails.passwordChangeDetails(v) + case "password_reset_details": + let v = try TeamLog.PasswordResetDetailsSerializer().deserialize(json) + return EventDetails.passwordResetDetails(v) + case "password_reset_all_details": + let v = try TeamLog.PasswordResetAllDetailsSerializer().deserialize(json) + return EventDetails.passwordResetAllDetails(v) + case "classification_create_report_details": + let v = try TeamLog.ClassificationCreateReportDetailsSerializer().deserialize(json) + return EventDetails.classificationCreateReportDetails(v) + case "classification_create_report_fail_details": + let v = try TeamLog.ClassificationCreateReportFailDetailsSerializer().deserialize(json) + return EventDetails.classificationCreateReportFailDetails(v) + case "emm_create_exceptions_report_details": + let v = try TeamLog.EmmCreateExceptionsReportDetailsSerializer().deserialize(json) + return EventDetails.emmCreateExceptionsReportDetails(v) + case "emm_create_usage_report_details": + let v = try TeamLog.EmmCreateUsageReportDetailsSerializer().deserialize(json) + return EventDetails.emmCreateUsageReportDetails(v) + case "export_members_report_details": + let v = try TeamLog.ExportMembersReportDetailsSerializer().deserialize(json) + return EventDetails.exportMembersReportDetails(v) + case "export_members_report_fail_details": + let v = try TeamLog.ExportMembersReportFailDetailsSerializer().deserialize(json) + return EventDetails.exportMembersReportFailDetails(v) + case "external_sharing_create_report_details": + let v = try TeamLog.ExternalSharingCreateReportDetailsSerializer().deserialize(json) + return EventDetails.externalSharingCreateReportDetails(v) + case "external_sharing_report_failed_details": + let v = try TeamLog.ExternalSharingReportFailedDetailsSerializer().deserialize(json) + return EventDetails.externalSharingReportFailedDetails(v) + case "no_expiration_link_gen_create_report_details": + let v = try TeamLog.NoExpirationLinkGenCreateReportDetailsSerializer().deserialize(json) + return EventDetails.noExpirationLinkGenCreateReportDetails(v) + case "no_expiration_link_gen_report_failed_details": + let v = try TeamLog.NoExpirationLinkGenReportFailedDetailsSerializer().deserialize(json) + return EventDetails.noExpirationLinkGenReportFailedDetails(v) + case "no_password_link_gen_create_report_details": + let v = try TeamLog.NoPasswordLinkGenCreateReportDetailsSerializer().deserialize(json) + return EventDetails.noPasswordLinkGenCreateReportDetails(v) + case "no_password_link_gen_report_failed_details": + let v = try TeamLog.NoPasswordLinkGenReportFailedDetailsSerializer().deserialize(json) + return EventDetails.noPasswordLinkGenReportFailedDetails(v) + case "no_password_link_view_create_report_details": + let v = try TeamLog.NoPasswordLinkViewCreateReportDetailsSerializer().deserialize(json) + return EventDetails.noPasswordLinkViewCreateReportDetails(v) + case "no_password_link_view_report_failed_details": + let v = try TeamLog.NoPasswordLinkViewReportFailedDetailsSerializer().deserialize(json) + return EventDetails.noPasswordLinkViewReportFailedDetails(v) + case "outdated_link_view_create_report_details": + let v = try TeamLog.OutdatedLinkViewCreateReportDetailsSerializer().deserialize(json) + return EventDetails.outdatedLinkViewCreateReportDetails(v) + case "outdated_link_view_report_failed_details": + let v = try TeamLog.OutdatedLinkViewReportFailedDetailsSerializer().deserialize(json) + return EventDetails.outdatedLinkViewReportFailedDetails(v) + case "paper_admin_export_start_details": + let v = try TeamLog.PaperAdminExportStartDetailsSerializer().deserialize(json) + return EventDetails.paperAdminExportStartDetails(v) + case "ransomware_alert_create_report_details": + let v = try TeamLog.RansomwareAlertCreateReportDetailsSerializer().deserialize(json) + return EventDetails.ransomwareAlertCreateReportDetails(v) + case "ransomware_alert_create_report_failed_details": + let v = try TeamLog.RansomwareAlertCreateReportFailedDetailsSerializer().deserialize(json) + return EventDetails.ransomwareAlertCreateReportFailedDetails(v) + case "smart_sync_create_admin_privilege_report_details": + let v = try TeamLog.SmartSyncCreateAdminPrivilegeReportDetailsSerializer().deserialize(json) + return EventDetails.smartSyncCreateAdminPrivilegeReportDetails(v) + case "team_activity_create_report_details": + let v = try TeamLog.TeamActivityCreateReportDetailsSerializer().deserialize(json) + return EventDetails.teamActivityCreateReportDetails(v) + case "team_activity_create_report_fail_details": + let v = try TeamLog.TeamActivityCreateReportFailDetailsSerializer().deserialize(json) + return EventDetails.teamActivityCreateReportFailDetails(v) + case "collection_share_details": + let v = try TeamLog.CollectionShareDetailsSerializer().deserialize(json) + return EventDetails.collectionShareDetails(v) + case "file_transfers_file_add_details": + let v = try TeamLog.FileTransfersFileAddDetailsSerializer().deserialize(json) + return EventDetails.fileTransfersFileAddDetails(v) + case "file_transfers_transfer_delete_details": + let v = try TeamLog.FileTransfersTransferDeleteDetailsSerializer().deserialize(json) + return EventDetails.fileTransfersTransferDeleteDetails(v) + case "file_transfers_transfer_download_details": + let v = try TeamLog.FileTransfersTransferDownloadDetailsSerializer().deserialize(json) + return EventDetails.fileTransfersTransferDownloadDetails(v) + case "file_transfers_transfer_send_details": + let v = try TeamLog.FileTransfersTransferSendDetailsSerializer().deserialize(json) + return EventDetails.fileTransfersTransferSendDetails(v) + case "file_transfers_transfer_view_details": + let v = try TeamLog.FileTransfersTransferViewDetailsSerializer().deserialize(json) + return EventDetails.fileTransfersTransferViewDetails(v) + case "note_acl_invite_only_details": + let v = try TeamLog.NoteAclInviteOnlyDetailsSerializer().deserialize(json) + return EventDetails.noteAclInviteOnlyDetails(v) + case "note_acl_link_details": + let v = try TeamLog.NoteAclLinkDetailsSerializer().deserialize(json) + return EventDetails.noteAclLinkDetails(v) + case "note_acl_team_link_details": + let v = try TeamLog.NoteAclTeamLinkDetailsSerializer().deserialize(json) + return EventDetails.noteAclTeamLinkDetails(v) + case "note_shared_details": + let v = try TeamLog.NoteSharedDetailsSerializer().deserialize(json) + return EventDetails.noteSharedDetails(v) + case "note_share_receive_details": + let v = try TeamLog.NoteShareReceiveDetailsSerializer().deserialize(json) + return EventDetails.noteShareReceiveDetails(v) + case "open_note_shared_details": + let v = try TeamLog.OpenNoteSharedDetailsSerializer().deserialize(json) + return EventDetails.openNoteSharedDetails(v) + case "replay_file_shared_link_created_details": + let v = try TeamLog.ReplayFileSharedLinkCreatedDetailsSerializer().deserialize(json) + return EventDetails.replayFileSharedLinkCreatedDetails(v) + case "replay_file_shared_link_modified_details": + let v = try TeamLog.ReplayFileSharedLinkModifiedDetailsSerializer().deserialize(json) + return EventDetails.replayFileSharedLinkModifiedDetails(v) + case "replay_project_team_add_details": + let v = try TeamLog.ReplayProjectTeamAddDetailsSerializer().deserialize(json) + return EventDetails.replayProjectTeamAddDetails(v) + case "replay_project_team_delete_details": + let v = try TeamLog.ReplayProjectTeamDeleteDetailsSerializer().deserialize(json) + return EventDetails.replayProjectTeamDeleteDetails(v) + case "sf_add_group_details": + let v = try TeamLog.SfAddGroupDetailsSerializer().deserialize(json) + return EventDetails.sfAddGroupDetails(v) + case "sf_allow_non_members_to_view_shared_links_details": + let v = try TeamLog.SfAllowNonMembersToViewSharedLinksDetailsSerializer().deserialize(json) + return EventDetails.sfAllowNonMembersToViewSharedLinksDetails(v) + case "sf_external_invite_warn_details": + let v = try TeamLog.SfExternalInviteWarnDetailsSerializer().deserialize(json) + return EventDetails.sfExternalInviteWarnDetails(v) + case "sf_fb_invite_details": + let v = try TeamLog.SfFbInviteDetailsSerializer().deserialize(json) + return EventDetails.sfFbInviteDetails(v) + case "sf_fb_invite_change_role_details": + let v = try TeamLog.SfFbInviteChangeRoleDetailsSerializer().deserialize(json) + return EventDetails.sfFbInviteChangeRoleDetails(v) + case "sf_fb_uninvite_details": + let v = try TeamLog.SfFbUninviteDetailsSerializer().deserialize(json) + return EventDetails.sfFbUninviteDetails(v) + case "sf_invite_group_details": + let v = try TeamLog.SfInviteGroupDetailsSerializer().deserialize(json) + return EventDetails.sfInviteGroupDetails(v) + case "sf_team_grant_access_details": + let v = try TeamLog.SfTeamGrantAccessDetailsSerializer().deserialize(json) + return EventDetails.sfTeamGrantAccessDetails(v) + case "sf_team_invite_details": + let v = try TeamLog.SfTeamInviteDetailsSerializer().deserialize(json) + return EventDetails.sfTeamInviteDetails(v) + case "sf_team_invite_change_role_details": + let v = try TeamLog.SfTeamInviteChangeRoleDetailsSerializer().deserialize(json) + return EventDetails.sfTeamInviteChangeRoleDetails(v) + case "sf_team_join_details": + let v = try TeamLog.SfTeamJoinDetailsSerializer().deserialize(json) + return EventDetails.sfTeamJoinDetails(v) + case "sf_team_join_from_oob_link_details": + let v = try TeamLog.SfTeamJoinFromOobLinkDetailsSerializer().deserialize(json) + return EventDetails.sfTeamJoinFromOobLinkDetails(v) + case "sf_team_uninvite_details": + let v = try TeamLog.SfTeamUninviteDetailsSerializer().deserialize(json) + return EventDetails.sfTeamUninviteDetails(v) + case "shared_content_add_invitees_details": + let v = try TeamLog.SharedContentAddInviteesDetailsSerializer().deserialize(json) + return EventDetails.sharedContentAddInviteesDetails(v) + case "shared_content_add_link_expiry_details": + let v = try TeamLog.SharedContentAddLinkExpiryDetailsSerializer().deserialize(json) + return EventDetails.sharedContentAddLinkExpiryDetails(v) + case "shared_content_add_link_password_details": + let v = try TeamLog.SharedContentAddLinkPasswordDetailsSerializer().deserialize(json) + return EventDetails.sharedContentAddLinkPasswordDetails(v) + case "shared_content_add_member_details": + let v = try TeamLog.SharedContentAddMemberDetailsSerializer().deserialize(json) + return EventDetails.sharedContentAddMemberDetails(v) + case "shared_content_change_downloads_policy_details": + let v = try TeamLog.SharedContentChangeDownloadsPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharedContentChangeDownloadsPolicyDetails(v) + case "shared_content_change_invitee_role_details": + let v = try TeamLog.SharedContentChangeInviteeRoleDetailsSerializer().deserialize(json) + return EventDetails.sharedContentChangeInviteeRoleDetails(v) + case "shared_content_change_link_audience_details": + let v = try TeamLog.SharedContentChangeLinkAudienceDetailsSerializer().deserialize(json) + return EventDetails.sharedContentChangeLinkAudienceDetails(v) + case "shared_content_change_link_expiry_details": + let v = try TeamLog.SharedContentChangeLinkExpiryDetailsSerializer().deserialize(json) + return EventDetails.sharedContentChangeLinkExpiryDetails(v) + case "shared_content_change_link_password_details": + let v = try TeamLog.SharedContentChangeLinkPasswordDetailsSerializer().deserialize(json) + return EventDetails.sharedContentChangeLinkPasswordDetails(v) + case "shared_content_change_member_role_details": + let v = try TeamLog.SharedContentChangeMemberRoleDetailsSerializer().deserialize(json) + return EventDetails.sharedContentChangeMemberRoleDetails(v) + case "shared_content_change_viewer_info_policy_details": + let v = try TeamLog.SharedContentChangeViewerInfoPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharedContentChangeViewerInfoPolicyDetails(v) + case "shared_content_claim_invitation_details": + let v = try TeamLog.SharedContentClaimInvitationDetailsSerializer().deserialize(json) + return EventDetails.sharedContentClaimInvitationDetails(v) + case "shared_content_copy_details": + let v = try TeamLog.SharedContentCopyDetailsSerializer().deserialize(json) + return EventDetails.sharedContentCopyDetails(v) + case "shared_content_download_details": + let v = try TeamLog.SharedContentDownloadDetailsSerializer().deserialize(json) + return EventDetails.sharedContentDownloadDetails(v) + case "shared_content_relinquish_membership_details": + let v = try TeamLog.SharedContentRelinquishMembershipDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRelinquishMembershipDetails(v) + case "shared_content_remove_invitees_details": + let v = try TeamLog.SharedContentRemoveInviteesDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRemoveInviteesDetails(v) + case "shared_content_remove_link_expiry_details": + let v = try TeamLog.SharedContentRemoveLinkExpiryDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRemoveLinkExpiryDetails(v) + case "shared_content_remove_link_password_details": + let v = try TeamLog.SharedContentRemoveLinkPasswordDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRemoveLinkPasswordDetails(v) + case "shared_content_remove_member_details": + let v = try TeamLog.SharedContentRemoveMemberDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRemoveMemberDetails(v) + case "shared_content_request_access_details": + let v = try TeamLog.SharedContentRequestAccessDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRequestAccessDetails(v) + case "shared_content_restore_invitees_details": + let v = try TeamLog.SharedContentRestoreInviteesDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRestoreInviteesDetails(v) + case "shared_content_restore_member_details": + let v = try TeamLog.SharedContentRestoreMemberDetailsSerializer().deserialize(json) + return EventDetails.sharedContentRestoreMemberDetails(v) + case "shared_content_unshare_details": + let v = try TeamLog.SharedContentUnshareDetailsSerializer().deserialize(json) + return EventDetails.sharedContentUnshareDetails(v) + case "shared_content_view_details": + let v = try TeamLog.SharedContentViewDetailsSerializer().deserialize(json) + return EventDetails.sharedContentViewDetails(v) + case "shared_folder_change_link_policy_details": + let v = try TeamLog.SharedFolderChangeLinkPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderChangeLinkPolicyDetails(v) + case "shared_folder_change_members_inheritance_policy_details": + let v = try TeamLog.SharedFolderChangeMembersInheritancePolicyDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderChangeMembersInheritancePolicyDetails(v) + case "shared_folder_change_members_management_policy_details": + let v = try TeamLog.SharedFolderChangeMembersManagementPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderChangeMembersManagementPolicyDetails(v) + case "shared_folder_change_members_policy_details": + let v = try TeamLog.SharedFolderChangeMembersPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderChangeMembersPolicyDetails(v) + case "shared_folder_create_details": + let v = try TeamLog.SharedFolderCreateDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderCreateDetails(v) + case "shared_folder_decline_invitation_details": + let v = try TeamLog.SharedFolderDeclineInvitationDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderDeclineInvitationDetails(v) + case "shared_folder_mount_details": + let v = try TeamLog.SharedFolderMountDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderMountDetails(v) + case "shared_folder_nest_details": + let v = try TeamLog.SharedFolderNestDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderNestDetails(v) + case "shared_folder_transfer_ownership_details": + let v = try TeamLog.SharedFolderTransferOwnershipDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderTransferOwnershipDetails(v) + case "shared_folder_unmount_details": + let v = try TeamLog.SharedFolderUnmountDetailsSerializer().deserialize(json) + return EventDetails.sharedFolderUnmountDetails(v) + case "shared_link_add_expiry_details": + let v = try TeamLog.SharedLinkAddExpiryDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkAddExpiryDetails(v) + case "shared_link_change_expiry_details": + let v = try TeamLog.SharedLinkChangeExpiryDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkChangeExpiryDetails(v) + case "shared_link_change_visibility_details": + let v = try TeamLog.SharedLinkChangeVisibilityDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkChangeVisibilityDetails(v) + case "shared_link_copy_details": + let v = try TeamLog.SharedLinkCopyDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkCopyDetails(v) + case "shared_link_create_details": + let v = try TeamLog.SharedLinkCreateDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkCreateDetails(v) + case "shared_link_disable_details": + let v = try TeamLog.SharedLinkDisableDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkDisableDetails(v) + case "shared_link_download_details": + let v = try TeamLog.SharedLinkDownloadDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkDownloadDetails(v) + case "shared_link_remove_expiry_details": + let v = try TeamLog.SharedLinkRemoveExpiryDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkRemoveExpiryDetails(v) + case "shared_link_settings_add_expiration_details": + let v = try TeamLog.SharedLinkSettingsAddExpirationDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsAddExpirationDetails(v) + case "shared_link_settings_add_password_details": + let v = try TeamLog.SharedLinkSettingsAddPasswordDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsAddPasswordDetails(v) + case "shared_link_settings_allow_download_disabled_details": + let v = try TeamLog.SharedLinkSettingsAllowDownloadDisabledDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsAllowDownloadDisabledDetails(v) + case "shared_link_settings_allow_download_enabled_details": + let v = try TeamLog.SharedLinkSettingsAllowDownloadEnabledDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsAllowDownloadEnabledDetails(v) + case "shared_link_settings_change_audience_details": + let v = try TeamLog.SharedLinkSettingsChangeAudienceDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsChangeAudienceDetails(v) + case "shared_link_settings_change_expiration_details": + let v = try TeamLog.SharedLinkSettingsChangeExpirationDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsChangeExpirationDetails(v) + case "shared_link_settings_change_password_details": + let v = try TeamLog.SharedLinkSettingsChangePasswordDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsChangePasswordDetails(v) + case "shared_link_settings_remove_expiration_details": + let v = try TeamLog.SharedLinkSettingsRemoveExpirationDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsRemoveExpirationDetails(v) + case "shared_link_settings_remove_password_details": + let v = try TeamLog.SharedLinkSettingsRemovePasswordDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkSettingsRemovePasswordDetails(v) + case "shared_link_share_details": + let v = try TeamLog.SharedLinkShareDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkShareDetails(v) + case "shared_link_view_details": + let v = try TeamLog.SharedLinkViewDetailsSerializer().deserialize(json) + return EventDetails.sharedLinkViewDetails(v) + case "shared_note_opened_details": + let v = try TeamLog.SharedNoteOpenedDetailsSerializer().deserialize(json) + return EventDetails.sharedNoteOpenedDetails(v) + case "shmodel_disable_downloads_details": + let v = try TeamLog.ShmodelDisableDownloadsDetailsSerializer().deserialize(json) + return EventDetails.shmodelDisableDownloadsDetails(v) + case "shmodel_enable_downloads_details": + let v = try TeamLog.ShmodelEnableDownloadsDetailsSerializer().deserialize(json) + return EventDetails.shmodelEnableDownloadsDetails(v) + case "shmodel_group_share_details": + let v = try TeamLog.ShmodelGroupShareDetailsSerializer().deserialize(json) + return EventDetails.shmodelGroupShareDetails(v) + case "showcase_access_granted_details": + let v = try TeamLog.ShowcaseAccessGrantedDetailsSerializer().deserialize(json) + return EventDetails.showcaseAccessGrantedDetails(v) + case "showcase_add_member_details": + let v = try TeamLog.ShowcaseAddMemberDetailsSerializer().deserialize(json) + return EventDetails.showcaseAddMemberDetails(v) + case "showcase_archived_details": + let v = try TeamLog.ShowcaseArchivedDetailsSerializer().deserialize(json) + return EventDetails.showcaseArchivedDetails(v) + case "showcase_created_details": + let v = try TeamLog.ShowcaseCreatedDetailsSerializer().deserialize(json) + return EventDetails.showcaseCreatedDetails(v) + case "showcase_delete_comment_details": + let v = try TeamLog.ShowcaseDeleteCommentDetailsSerializer().deserialize(json) + return EventDetails.showcaseDeleteCommentDetails(v) + case "showcase_edited_details": + let v = try TeamLog.ShowcaseEditedDetailsSerializer().deserialize(json) + return EventDetails.showcaseEditedDetails(v) + case "showcase_edit_comment_details": + let v = try TeamLog.ShowcaseEditCommentDetailsSerializer().deserialize(json) + return EventDetails.showcaseEditCommentDetails(v) + case "showcase_file_added_details": + let v = try TeamLog.ShowcaseFileAddedDetailsSerializer().deserialize(json) + return EventDetails.showcaseFileAddedDetails(v) + case "showcase_file_download_details": + let v = try TeamLog.ShowcaseFileDownloadDetailsSerializer().deserialize(json) + return EventDetails.showcaseFileDownloadDetails(v) + case "showcase_file_removed_details": + let v = try TeamLog.ShowcaseFileRemovedDetailsSerializer().deserialize(json) + return EventDetails.showcaseFileRemovedDetails(v) + case "showcase_file_view_details": + let v = try TeamLog.ShowcaseFileViewDetailsSerializer().deserialize(json) + return EventDetails.showcaseFileViewDetails(v) + case "showcase_permanently_deleted_details": + let v = try TeamLog.ShowcasePermanentlyDeletedDetailsSerializer().deserialize(json) + return EventDetails.showcasePermanentlyDeletedDetails(v) + case "showcase_post_comment_details": + let v = try TeamLog.ShowcasePostCommentDetailsSerializer().deserialize(json) + return EventDetails.showcasePostCommentDetails(v) + case "showcase_remove_member_details": + let v = try TeamLog.ShowcaseRemoveMemberDetailsSerializer().deserialize(json) + return EventDetails.showcaseRemoveMemberDetails(v) + case "showcase_renamed_details": + let v = try TeamLog.ShowcaseRenamedDetailsSerializer().deserialize(json) + return EventDetails.showcaseRenamedDetails(v) + case "showcase_request_access_details": + let v = try TeamLog.ShowcaseRequestAccessDetailsSerializer().deserialize(json) + return EventDetails.showcaseRequestAccessDetails(v) + case "showcase_resolve_comment_details": + let v = try TeamLog.ShowcaseResolveCommentDetailsSerializer().deserialize(json) + return EventDetails.showcaseResolveCommentDetails(v) + case "showcase_restored_details": + let v = try TeamLog.ShowcaseRestoredDetailsSerializer().deserialize(json) + return EventDetails.showcaseRestoredDetails(v) + case "showcase_trashed_details": + let v = try TeamLog.ShowcaseTrashedDetailsSerializer().deserialize(json) + return EventDetails.showcaseTrashedDetails(v) + case "showcase_trashed_deprecated_details": + let v = try TeamLog.ShowcaseTrashedDeprecatedDetailsSerializer().deserialize(json) + return EventDetails.showcaseTrashedDeprecatedDetails(v) + case "showcase_unresolve_comment_details": + let v = try TeamLog.ShowcaseUnresolveCommentDetailsSerializer().deserialize(json) + return EventDetails.showcaseUnresolveCommentDetails(v) + case "showcase_untrashed_details": + let v = try TeamLog.ShowcaseUntrashedDetailsSerializer().deserialize(json) + return EventDetails.showcaseUntrashedDetails(v) + case "showcase_untrashed_deprecated_details": + let v = try TeamLog.ShowcaseUntrashedDeprecatedDetailsSerializer().deserialize(json) + return EventDetails.showcaseUntrashedDeprecatedDetails(v) + case "showcase_view_details": + let v = try TeamLog.ShowcaseViewDetailsSerializer().deserialize(json) + return EventDetails.showcaseViewDetails(v) + case "sso_add_cert_details": + let v = try TeamLog.SsoAddCertDetailsSerializer().deserialize(json) + return EventDetails.ssoAddCertDetails(v) + case "sso_add_login_url_details": + let v = try TeamLog.SsoAddLoginUrlDetailsSerializer().deserialize(json) + return EventDetails.ssoAddLoginUrlDetails(v) + case "sso_add_logout_url_details": + let v = try TeamLog.SsoAddLogoutUrlDetailsSerializer().deserialize(json) + return EventDetails.ssoAddLogoutUrlDetails(v) + case "sso_change_cert_details": + let v = try TeamLog.SsoChangeCertDetailsSerializer().deserialize(json) + return EventDetails.ssoChangeCertDetails(v) + case "sso_change_login_url_details": + let v = try TeamLog.SsoChangeLoginUrlDetailsSerializer().deserialize(json) + return EventDetails.ssoChangeLoginUrlDetails(v) + case "sso_change_logout_url_details": + let v = try TeamLog.SsoChangeLogoutUrlDetailsSerializer().deserialize(json) + return EventDetails.ssoChangeLogoutUrlDetails(v) + case "sso_change_saml_identity_mode_details": + let v = try TeamLog.SsoChangeSamlIdentityModeDetailsSerializer().deserialize(json) + return EventDetails.ssoChangeSamlIdentityModeDetails(v) + case "sso_remove_cert_details": + let v = try TeamLog.SsoRemoveCertDetailsSerializer().deserialize(json) + return EventDetails.ssoRemoveCertDetails(v) + case "sso_remove_login_url_details": + let v = try TeamLog.SsoRemoveLoginUrlDetailsSerializer().deserialize(json) + return EventDetails.ssoRemoveLoginUrlDetails(v) + case "sso_remove_logout_url_details": + let v = try TeamLog.SsoRemoveLogoutUrlDetailsSerializer().deserialize(json) + return EventDetails.ssoRemoveLogoutUrlDetails(v) + case "team_folder_change_status_details": + let v = try TeamLog.TeamFolderChangeStatusDetailsSerializer().deserialize(json) + return EventDetails.teamFolderChangeStatusDetails(v) + case "team_folder_create_details": + let v = try TeamLog.TeamFolderCreateDetailsSerializer().deserialize(json) + return EventDetails.teamFolderCreateDetails(v) + case "team_folder_downgrade_details": + let v = try TeamLog.TeamFolderDowngradeDetailsSerializer().deserialize(json) + return EventDetails.teamFolderDowngradeDetails(v) + case "team_folder_permanently_delete_details": + let v = try TeamLog.TeamFolderPermanentlyDeleteDetailsSerializer().deserialize(json) + return EventDetails.teamFolderPermanentlyDeleteDetails(v) + case "team_folder_rename_details": + let v = try TeamLog.TeamFolderRenameDetailsSerializer().deserialize(json) + return EventDetails.teamFolderRenameDetails(v) + case "team_selective_sync_settings_changed_details": + let v = try TeamLog.TeamSelectiveSyncSettingsChangedDetailsSerializer().deserialize(json) + return EventDetails.teamSelectiveSyncSettingsChangedDetails(v) + case "account_capture_change_policy_details": + let v = try TeamLog.AccountCaptureChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.accountCaptureChangePolicyDetails(v) + case "admin_email_reminders_changed_details": + let v = try TeamLog.AdminEmailRemindersChangedDetailsSerializer().deserialize(json) + return EventDetails.adminEmailRemindersChangedDetails(v) + case "allow_download_disabled_details": + let v = try TeamLog.AllowDownloadDisabledDetailsSerializer().deserialize(json) + return EventDetails.allowDownloadDisabledDetails(v) + case "allow_download_enabled_details": + let v = try TeamLog.AllowDownloadEnabledDetailsSerializer().deserialize(json) + return EventDetails.allowDownloadEnabledDetails(v) + case "app_permissions_changed_details": + let v = try TeamLog.AppPermissionsChangedDetailsSerializer().deserialize(json) + return EventDetails.appPermissionsChangedDetails(v) + case "camera_uploads_policy_changed_details": + let v = try TeamLog.CameraUploadsPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.cameraUploadsPolicyChangedDetails(v) + case "capture_transcript_policy_changed_details": + let v = try TeamLog.CaptureTranscriptPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.captureTranscriptPolicyChangedDetails(v) + case "classification_change_policy_details": + let v = try TeamLog.ClassificationChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.classificationChangePolicyDetails(v) + case "computer_backup_policy_changed_details": + let v = try TeamLog.ComputerBackupPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.computerBackupPolicyChangedDetails(v) + case "content_administration_policy_changed_details": + let v = try TeamLog.ContentAdministrationPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.contentAdministrationPolicyChangedDetails(v) + case "data_placement_restriction_change_policy_details": + let v = try TeamLog.DataPlacementRestrictionChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.dataPlacementRestrictionChangePolicyDetails(v) + case "data_placement_restriction_satisfy_policy_details": + let v = try TeamLog.DataPlacementRestrictionSatisfyPolicyDetailsSerializer().deserialize(json) + return EventDetails.dataPlacementRestrictionSatisfyPolicyDetails(v) + case "device_approvals_add_exception_details": + let v = try TeamLog.DeviceApprovalsAddExceptionDetailsSerializer().deserialize(json) + return EventDetails.deviceApprovalsAddExceptionDetails(v) + case "device_approvals_change_desktop_policy_details": + let v = try TeamLog.DeviceApprovalsChangeDesktopPolicyDetailsSerializer().deserialize(json) + return EventDetails.deviceApprovalsChangeDesktopPolicyDetails(v) + case "device_approvals_change_mobile_policy_details": + let v = try TeamLog.DeviceApprovalsChangeMobilePolicyDetailsSerializer().deserialize(json) + return EventDetails.deviceApprovalsChangeMobilePolicyDetails(v) + case "device_approvals_change_overage_action_details": + let v = try TeamLog.DeviceApprovalsChangeOverageActionDetailsSerializer().deserialize(json) + return EventDetails.deviceApprovalsChangeOverageActionDetails(v) + case "device_approvals_change_unlink_action_details": + let v = try TeamLog.DeviceApprovalsChangeUnlinkActionDetailsSerializer().deserialize(json) + return EventDetails.deviceApprovalsChangeUnlinkActionDetails(v) + case "device_approvals_remove_exception_details": + let v = try TeamLog.DeviceApprovalsRemoveExceptionDetailsSerializer().deserialize(json) + return EventDetails.deviceApprovalsRemoveExceptionDetails(v) + case "directory_restrictions_add_members_details": + let v = try TeamLog.DirectoryRestrictionsAddMembersDetailsSerializer().deserialize(json) + return EventDetails.directoryRestrictionsAddMembersDetails(v) + case "directory_restrictions_remove_members_details": + let v = try TeamLog.DirectoryRestrictionsRemoveMembersDetailsSerializer().deserialize(json) + return EventDetails.directoryRestrictionsRemoveMembersDetails(v) + case "dropbox_passwords_policy_changed_details": + let v = try TeamLog.DropboxPasswordsPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.dropboxPasswordsPolicyChangedDetails(v) + case "email_ingest_policy_changed_details": + let v = try TeamLog.EmailIngestPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.emailIngestPolicyChangedDetails(v) + case "emm_add_exception_details": + let v = try TeamLog.EmmAddExceptionDetailsSerializer().deserialize(json) + return EventDetails.emmAddExceptionDetails(v) + case "emm_change_policy_details": + let v = try TeamLog.EmmChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.emmChangePolicyDetails(v) + case "emm_remove_exception_details": + let v = try TeamLog.EmmRemoveExceptionDetailsSerializer().deserialize(json) + return EventDetails.emmRemoveExceptionDetails(v) + case "extended_version_history_change_policy_details": + let v = try TeamLog.ExtendedVersionHistoryChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.extendedVersionHistoryChangePolicyDetails(v) + case "external_drive_backup_policy_changed_details": + let v = try TeamLog.ExternalDriveBackupPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.externalDriveBackupPolicyChangedDetails(v) + case "file_comments_change_policy_details": + let v = try TeamLog.FileCommentsChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.fileCommentsChangePolicyDetails(v) + case "file_locking_policy_changed_details": + let v = try TeamLog.FileLockingPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.fileLockingPolicyChangedDetails(v) + case "file_provider_migration_policy_changed_details": + let v = try TeamLog.FileProviderMigrationPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.fileProviderMigrationPolicyChangedDetails(v) + case "file_requests_change_policy_details": + let v = try TeamLog.FileRequestsChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.fileRequestsChangePolicyDetails(v) + case "file_requests_emails_enabled_details": + let v = try TeamLog.FileRequestsEmailsEnabledDetailsSerializer().deserialize(json) + return EventDetails.fileRequestsEmailsEnabledDetails(v) + case "file_requests_emails_restricted_to_team_only_details": + let v = try TeamLog.FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer().deserialize(json) + return EventDetails.fileRequestsEmailsRestrictedToTeamOnlyDetails(v) + case "file_transfers_policy_changed_details": + let v = try TeamLog.FileTransfersPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.fileTransfersPolicyChangedDetails(v) + case "folder_link_restriction_policy_changed_details": + let v = try TeamLog.FolderLinkRestrictionPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.folderLinkRestrictionPolicyChangedDetails(v) + case "google_sso_change_policy_details": + let v = try TeamLog.GoogleSsoChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.googleSsoChangePolicyDetails(v) + case "group_user_management_change_policy_details": + let v = try TeamLog.GroupUserManagementChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.groupUserManagementChangePolicyDetails(v) + case "integration_policy_changed_details": + let v = try TeamLog.IntegrationPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.integrationPolicyChangedDetails(v) + case "invite_acceptance_email_policy_changed_details": + let v = try TeamLog.InviteAcceptanceEmailPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.inviteAcceptanceEmailPolicyChangedDetails(v) + case "member_requests_change_policy_details": + let v = try TeamLog.MemberRequestsChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.memberRequestsChangePolicyDetails(v) + case "member_send_invite_policy_changed_details": + let v = try TeamLog.MemberSendInvitePolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.memberSendInvitePolicyChangedDetails(v) + case "member_space_limits_add_exception_details": + let v = try TeamLog.MemberSpaceLimitsAddExceptionDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsAddExceptionDetails(v) + case "member_space_limits_change_caps_type_policy_details": + let v = try TeamLog.MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsChangeCapsTypePolicyDetails(v) + case "member_space_limits_change_policy_details": + let v = try TeamLog.MemberSpaceLimitsChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsChangePolicyDetails(v) + case "member_space_limits_remove_exception_details": + let v = try TeamLog.MemberSpaceLimitsRemoveExceptionDetailsSerializer().deserialize(json) + return EventDetails.memberSpaceLimitsRemoveExceptionDetails(v) + case "member_suggestions_change_policy_details": + let v = try TeamLog.MemberSuggestionsChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.memberSuggestionsChangePolicyDetails(v) + case "microsoft_office_addin_change_policy_details": + let v = try TeamLog.MicrosoftOfficeAddinChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.microsoftOfficeAddinChangePolicyDetails(v) + case "network_control_change_policy_details": + let v = try TeamLog.NetworkControlChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.networkControlChangePolicyDetails(v) + case "paper_change_deployment_policy_details": + let v = try TeamLog.PaperChangeDeploymentPolicyDetailsSerializer().deserialize(json) + return EventDetails.paperChangeDeploymentPolicyDetails(v) + case "paper_change_member_link_policy_details": + let v = try TeamLog.PaperChangeMemberLinkPolicyDetailsSerializer().deserialize(json) + return EventDetails.paperChangeMemberLinkPolicyDetails(v) + case "paper_change_member_policy_details": + let v = try TeamLog.PaperChangeMemberPolicyDetailsSerializer().deserialize(json) + return EventDetails.paperChangeMemberPolicyDetails(v) + case "paper_change_policy_details": + let v = try TeamLog.PaperChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.paperChangePolicyDetails(v) + case "paper_default_folder_policy_changed_details": + let v = try TeamLog.PaperDefaultFolderPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.paperDefaultFolderPolicyChangedDetails(v) + case "paper_desktop_policy_changed_details": + let v = try TeamLog.PaperDesktopPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.paperDesktopPolicyChangedDetails(v) + case "paper_enabled_users_group_addition_details": + let v = try TeamLog.PaperEnabledUsersGroupAdditionDetailsSerializer().deserialize(json) + return EventDetails.paperEnabledUsersGroupAdditionDetails(v) + case "paper_enabled_users_group_removal_details": + let v = try TeamLog.PaperEnabledUsersGroupRemovalDetailsSerializer().deserialize(json) + return EventDetails.paperEnabledUsersGroupRemovalDetails(v) + case "password_strength_requirements_change_policy_details": + let v = try TeamLog.PasswordStrengthRequirementsChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.passwordStrengthRequirementsChangePolicyDetails(v) + case "permanent_delete_change_policy_details": + let v = try TeamLog.PermanentDeleteChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.permanentDeleteChangePolicyDetails(v) + case "reseller_support_change_policy_details": + let v = try TeamLog.ResellerSupportChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.resellerSupportChangePolicyDetails(v) + case "rewind_policy_changed_details": + let v = try TeamLog.RewindPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.rewindPolicyChangedDetails(v) + case "send_for_signature_policy_changed_details": + let v = try TeamLog.SendForSignaturePolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.sendForSignaturePolicyChangedDetails(v) + case "sharing_change_folder_join_policy_details": + let v = try TeamLog.SharingChangeFolderJoinPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharingChangeFolderJoinPolicyDetails(v) + case "sharing_change_link_allow_change_expiration_policy_details": + let v = try TeamLog.SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharingChangeLinkAllowChangeExpirationPolicyDetails(v) + case "sharing_change_link_default_expiration_policy_details": + let v = try TeamLog.SharingChangeLinkDefaultExpirationPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharingChangeLinkDefaultExpirationPolicyDetails(v) + case "sharing_change_link_enforce_password_policy_details": + let v = try TeamLog.SharingChangeLinkEnforcePasswordPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharingChangeLinkEnforcePasswordPolicyDetails(v) + case "sharing_change_link_policy_details": + let v = try TeamLog.SharingChangeLinkPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharingChangeLinkPolicyDetails(v) + case "sharing_change_member_policy_details": + let v = try TeamLog.SharingChangeMemberPolicyDetailsSerializer().deserialize(json) + return EventDetails.sharingChangeMemberPolicyDetails(v) + case "showcase_change_download_policy_details": + let v = try TeamLog.ShowcaseChangeDownloadPolicyDetailsSerializer().deserialize(json) + return EventDetails.showcaseChangeDownloadPolicyDetails(v) + case "showcase_change_enabled_policy_details": + let v = try TeamLog.ShowcaseChangeEnabledPolicyDetailsSerializer().deserialize(json) + return EventDetails.showcaseChangeEnabledPolicyDetails(v) + case "showcase_change_external_sharing_policy_details": + let v = try TeamLog.ShowcaseChangeExternalSharingPolicyDetailsSerializer().deserialize(json) + return EventDetails.showcaseChangeExternalSharingPolicyDetails(v) + case "smarter_smart_sync_policy_changed_details": + let v = try TeamLog.SmarterSmartSyncPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.smarterSmartSyncPolicyChangedDetails(v) + case "smart_sync_change_policy_details": + let v = try TeamLog.SmartSyncChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.smartSyncChangePolicyDetails(v) + case "smart_sync_not_opt_out_details": + let v = try TeamLog.SmartSyncNotOptOutDetailsSerializer().deserialize(json) + return EventDetails.smartSyncNotOptOutDetails(v) + case "smart_sync_opt_out_details": + let v = try TeamLog.SmartSyncOptOutDetailsSerializer().deserialize(json) + return EventDetails.smartSyncOptOutDetails(v) + case "sso_change_policy_details": + let v = try TeamLog.SsoChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.ssoChangePolicyDetails(v) + case "team_branding_policy_changed_details": + let v = try TeamLog.TeamBrandingPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.teamBrandingPolicyChangedDetails(v) + case "team_extensions_policy_changed_details": + let v = try TeamLog.TeamExtensionsPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.teamExtensionsPolicyChangedDetails(v) + case "team_selective_sync_policy_changed_details": + let v = try TeamLog.TeamSelectiveSyncPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.teamSelectiveSyncPolicyChangedDetails(v) + case "team_sharing_whitelist_subjects_changed_details": + let v = try TeamLog.TeamSharingWhitelistSubjectsChangedDetailsSerializer().deserialize(json) + return EventDetails.teamSharingWhitelistSubjectsChangedDetails(v) + case "tfa_add_exception_details": + let v = try TeamLog.TfaAddExceptionDetailsSerializer().deserialize(json) + return EventDetails.tfaAddExceptionDetails(v) + case "tfa_change_policy_details": + let v = try TeamLog.TfaChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.tfaChangePolicyDetails(v) + case "tfa_remove_exception_details": + let v = try TeamLog.TfaRemoveExceptionDetailsSerializer().deserialize(json) + return EventDetails.tfaRemoveExceptionDetails(v) + case "two_account_change_policy_details": + let v = try TeamLog.TwoAccountChangePolicyDetailsSerializer().deserialize(json) + return EventDetails.twoAccountChangePolicyDetails(v) + case "viewer_info_policy_changed_details": + let v = try TeamLog.ViewerInfoPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.viewerInfoPolicyChangedDetails(v) + case "watermarking_policy_changed_details": + let v = try TeamLog.WatermarkingPolicyChangedDetailsSerializer().deserialize(json) + return EventDetails.watermarkingPolicyChangedDetails(v) + case "web_sessions_change_active_session_limit_details": + let v = try TeamLog.WebSessionsChangeActiveSessionLimitDetailsSerializer().deserialize(json) + return EventDetails.webSessionsChangeActiveSessionLimitDetails(v) + case "web_sessions_change_fixed_length_policy_details": + let v = try TeamLog.WebSessionsChangeFixedLengthPolicyDetailsSerializer().deserialize(json) + return EventDetails.webSessionsChangeFixedLengthPolicyDetails(v) + case "web_sessions_change_idle_length_policy_details": + let v = try TeamLog.WebSessionsChangeIdleLengthPolicyDetailsSerializer().deserialize(json) + return EventDetails.webSessionsChangeIdleLengthPolicyDetails(v) + case "data_residency_migration_request_successful_details": + let v = try TeamLog.DataResidencyMigrationRequestSuccessfulDetailsSerializer().deserialize(json) + return EventDetails.dataResidencyMigrationRequestSuccessfulDetails(v) + case "data_residency_migration_request_unsuccessful_details": + let v = try TeamLog.DataResidencyMigrationRequestUnsuccessfulDetailsSerializer().deserialize(json) + return EventDetails.dataResidencyMigrationRequestUnsuccessfulDetails(v) + case "team_merge_from_details": + let v = try TeamLog.TeamMergeFromDetailsSerializer().deserialize(json) + return EventDetails.teamMergeFromDetails(v) + case "team_merge_to_details": + let v = try TeamLog.TeamMergeToDetailsSerializer().deserialize(json) + return EventDetails.teamMergeToDetails(v) + case "team_profile_add_background_details": + let v = try TeamLog.TeamProfileAddBackgroundDetailsSerializer().deserialize(json) + return EventDetails.teamProfileAddBackgroundDetails(v) + case "team_profile_add_logo_details": + let v = try TeamLog.TeamProfileAddLogoDetailsSerializer().deserialize(json) + return EventDetails.teamProfileAddLogoDetails(v) + case "team_profile_change_background_details": + let v = try TeamLog.TeamProfileChangeBackgroundDetailsSerializer().deserialize(json) + return EventDetails.teamProfileChangeBackgroundDetails(v) + case "team_profile_change_default_language_details": + let v = try TeamLog.TeamProfileChangeDefaultLanguageDetailsSerializer().deserialize(json) + return EventDetails.teamProfileChangeDefaultLanguageDetails(v) + case "team_profile_change_logo_details": + let v = try TeamLog.TeamProfileChangeLogoDetailsSerializer().deserialize(json) + return EventDetails.teamProfileChangeLogoDetails(v) + case "team_profile_change_name_details": + let v = try TeamLog.TeamProfileChangeNameDetailsSerializer().deserialize(json) + return EventDetails.teamProfileChangeNameDetails(v) + case "team_profile_remove_background_details": + let v = try TeamLog.TeamProfileRemoveBackgroundDetailsSerializer().deserialize(json) + return EventDetails.teamProfileRemoveBackgroundDetails(v) + case "team_profile_remove_logo_details": + let v = try TeamLog.TeamProfileRemoveLogoDetailsSerializer().deserialize(json) + return EventDetails.teamProfileRemoveLogoDetails(v) + case "tfa_add_backup_phone_details": + let v = try TeamLog.TfaAddBackupPhoneDetailsSerializer().deserialize(json) + return EventDetails.tfaAddBackupPhoneDetails(v) + case "tfa_add_security_key_details": + let v = try TeamLog.TfaAddSecurityKeyDetailsSerializer().deserialize(json) + return EventDetails.tfaAddSecurityKeyDetails(v) + case "tfa_change_backup_phone_details": + let v = try TeamLog.TfaChangeBackupPhoneDetailsSerializer().deserialize(json) + return EventDetails.tfaChangeBackupPhoneDetails(v) + case "tfa_change_status_details": + let v = try TeamLog.TfaChangeStatusDetailsSerializer().deserialize(json) + return EventDetails.tfaChangeStatusDetails(v) + case "tfa_remove_backup_phone_details": + let v = try TeamLog.TfaRemoveBackupPhoneDetailsSerializer().deserialize(json) + return EventDetails.tfaRemoveBackupPhoneDetails(v) + case "tfa_remove_security_key_details": + let v = try TeamLog.TfaRemoveSecurityKeyDetailsSerializer().deserialize(json) + return EventDetails.tfaRemoveSecurityKeyDetails(v) + case "tfa_reset_details": + let v = try TeamLog.TfaResetDetailsSerializer().deserialize(json) + return EventDetails.tfaResetDetails(v) + case "changed_enterprise_admin_role_details": + let v = try TeamLog.ChangedEnterpriseAdminRoleDetailsSerializer().deserialize(json) + return EventDetails.changedEnterpriseAdminRoleDetails(v) + case "changed_enterprise_connected_team_status_details": + let v = try TeamLog.ChangedEnterpriseConnectedTeamStatusDetailsSerializer().deserialize(json) + return EventDetails.changedEnterpriseConnectedTeamStatusDetails(v) + case "ended_enterprise_admin_session_details": + let v = try TeamLog.EndedEnterpriseAdminSessionDetailsSerializer().deserialize(json) + return EventDetails.endedEnterpriseAdminSessionDetails(v) + case "ended_enterprise_admin_session_deprecated_details": + let v = try TeamLog.EndedEnterpriseAdminSessionDeprecatedDetailsSerializer().deserialize(json) + return EventDetails.endedEnterpriseAdminSessionDeprecatedDetails(v) + case "enterprise_settings_locking_details": + let v = try TeamLog.EnterpriseSettingsLockingDetailsSerializer().deserialize(json) + return EventDetails.enterpriseSettingsLockingDetails(v) + case "guest_admin_change_status_details": + let v = try TeamLog.GuestAdminChangeStatusDetailsSerializer().deserialize(json) + return EventDetails.guestAdminChangeStatusDetails(v) + case "started_enterprise_admin_session_details": + let v = try TeamLog.StartedEnterpriseAdminSessionDetailsSerializer().deserialize(json) + return EventDetails.startedEnterpriseAdminSessionDetails(v) + case "team_merge_request_accepted_details": + let v = try TeamLog.TeamMergeRequestAcceptedDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestAcceptedDetails(v) + case "team_merge_request_accepted_shown_to_primary_team_details": + let v = try TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestAcceptedShownToPrimaryTeamDetails(v) + case "team_merge_request_accepted_shown_to_secondary_team_details": + let v = try TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestAcceptedShownToSecondaryTeamDetails(v) + case "team_merge_request_auto_canceled_details": + let v = try TeamLog.TeamMergeRequestAutoCanceledDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestAutoCanceledDetails(v) + case "team_merge_request_canceled_details": + let v = try TeamLog.TeamMergeRequestCanceledDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestCanceledDetails(v) + case "team_merge_request_canceled_shown_to_primary_team_details": + let v = try TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestCanceledShownToPrimaryTeamDetails(v) + case "team_merge_request_canceled_shown_to_secondary_team_details": + let v = try TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestCanceledShownToSecondaryTeamDetails(v) + case "team_merge_request_expired_details": + let v = try TeamLog.TeamMergeRequestExpiredDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestExpiredDetails(v) + case "team_merge_request_expired_shown_to_primary_team_details": + let v = try TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestExpiredShownToPrimaryTeamDetails(v) + case "team_merge_request_expired_shown_to_secondary_team_details": + let v = try TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestExpiredShownToSecondaryTeamDetails(v) + case "team_merge_request_rejected_shown_to_primary_team_details": + let v = try TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestRejectedShownToPrimaryTeamDetails(v) + case "team_merge_request_rejected_shown_to_secondary_team_details": + let v = try TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestRejectedShownToSecondaryTeamDetails(v) + case "team_merge_request_reminder_details": + let v = try TeamLog.TeamMergeRequestReminderDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestReminderDetails(v) + case "team_merge_request_reminder_shown_to_primary_team_details": + let v = try TeamLog.TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestReminderShownToPrimaryTeamDetails(v) + case "team_merge_request_reminder_shown_to_secondary_team_details": + let v = try TeamLog.TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestReminderShownToSecondaryTeamDetails(v) + case "team_merge_request_revoked_details": + let v = try TeamLog.TeamMergeRequestRevokedDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestRevokedDetails(v) + case "team_merge_request_sent_shown_to_primary_team_details": + let v = try TeamLog.TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestSentShownToPrimaryTeamDetails(v) + case "team_merge_request_sent_shown_to_secondary_team_details": + let v = try TeamLog.TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer().deserialize(json) + return EventDetails.teamMergeRequestSentShownToSecondaryTeamDetails(v) + case "missing_details": + let v = try TeamLog.MissingDetailsSerializer().deserialize(json) + return EventDetails.missingDetails(v) + case "other": + return EventDetails.other + default: + return EventDetails.other + } + default: + throw JSONSerializerError.deserializeError(type: EventDetails.self, json: json) } } } /// The type of the event with description. - public enum EventType: CustomStringConvertible { + public enum EventType: CustomStringConvertible, JSONRepresentable { /// (admin_alerting) Changed an alert state case adminAlertingAlertStateChanged(TeamLog.AdminAlertingAlertStateChangedType) /// (admin_alerting) Changed an alert setting case adminAlertingChangedAlertConfig(TeamLog.AdminAlertingChangedAlertConfigType) /// (admin_alerting) Triggered security alert case adminAlertingTriggeredAlert(TeamLog.AdminAlertingTriggeredAlertType) + /// (admin_alerting) Completed ransomware restore process + case ransomwareRestoreProcessCompleted(TeamLog.RansomwareRestoreProcessCompletedType) + /// (admin_alerting) Started ransomware restore process + case ransomwareRestoreProcessStarted(TeamLog.RansomwareRestoreProcessStartedType) /// (apps) Failed to connect app for member case appBlockedByPermissions(TeamLog.AppBlockedByPermissionsType) /// (apps) Linked app for team @@ -13287,12 +16109,28 @@ open class TeamLog { case domainVerificationRemoveDomain(TeamLog.DomainVerificationRemoveDomainType) /// (domains) Enabled domain invites (deprecated, no longer logged) case enabledDomainInvites(TeamLog.EnabledDomainInvitesType) + /// (encryption) Canceled team encryption key deletion + case teamEncryptionKeyCancelKeyDeletion(TeamLog.TeamEncryptionKeyCancelKeyDeletionType) + /// (encryption) Created team encryption key + case teamEncryptionKeyCreateKey(TeamLog.TeamEncryptionKeyCreateKeyType) + /// (encryption) Deleted team encryption key + case teamEncryptionKeyDeleteKey(TeamLog.TeamEncryptionKeyDeleteKeyType) + /// (encryption) Disabled team encryption key + case teamEncryptionKeyDisableKey(TeamLog.TeamEncryptionKeyDisableKeyType) + /// (encryption) Enabled team encryption key + case teamEncryptionKeyEnableKey(TeamLog.TeamEncryptionKeyEnableKeyType) + /// (encryption) Rotated team encryption key (deprecated, no longer logged) + case teamEncryptionKeyRotateKey(TeamLog.TeamEncryptionKeyRotateKeyType) + /// (encryption) Scheduled encryption key deletion + case teamEncryptionKeyScheduleKeyDeletion(TeamLog.TeamEncryptionKeyScheduleKeyDeletionType) /// (file_operations) Applied naming convention case applyNamingConvention(TeamLog.ApplyNamingConventionType) /// (file_operations) Created folders (deprecated, no longer logged) case createFolder(TeamLog.CreateFolderType) /// (file_operations) Added files and/or folders case fileAdd(TeamLog.FileAddType) + /// (file_operations) Added files and/or folders from automation + case fileAddFromAutomation(TeamLog.FileAddFromAutomationType) /// (file_operations) Copied files and/or folders case fileCopy(TeamLog.FileCopyType) /// (file_operations) Deleted files and/or folders @@ -13335,6 +16173,8 @@ open class TeamLog { case objectLabelUpdatedValue(TeamLog.ObjectLabelUpdatedValueType) /// (file_operations) Organized a folder with multi-file organize case organizeFolderWithTidy(TeamLog.OrganizeFolderWithTidyType) + /// (file_operations) Deleted files in Replay + case replayFileDelete(TeamLog.ReplayFileDeleteType) /// (file_operations) Rewound a folder case rewindFolder(TeamLog.RewindFolderType) /// (file_operations) Reverted naming convention @@ -13407,6 +16247,10 @@ open class TeamLog { case signInAsSessionStart(TeamLog.SignInAsSessionStartType) /// (logins) Failed to sign in via SSO (deprecated, replaced by 'Failed to sign in') case ssoError(TeamLog.SsoErrorType) + /// (members) Invited members to activate Backup + case backupAdminInvitationSent(TeamLog.BackupAdminInvitationSentType) + /// (members) Opened Backup invite + case backupInvitationOpened(TeamLog.BackupInvitationOpenedType) /// (members) Created team invite link case createTeamInviteLink(TeamLog.CreateTeamInviteLinkType) /// (members) Deleted team invite link @@ -13597,6 +16441,10 @@ open class TeamLog { case outdatedLinkViewReportFailed(TeamLog.OutdatedLinkViewReportFailedType) /// (reports) Exported all team Paper docs case paperAdminExportStart(TeamLog.PaperAdminExportStartType) + /// (reports) Created ransomware report + case ransomwareAlertCreateReport(TeamLog.RansomwareAlertCreateReportType) + /// (reports) Couldn't generate ransomware report + case ransomwareAlertCreateReportFailed(TeamLog.RansomwareAlertCreateReportFailedType) /// (reports) Created Smart Sync non-admin devices report case smartSyncCreateAdminPrivilegeReport(TeamLog.SmartSyncCreateAdminPrivilegeReportType) /// (reports) Created team activity report @@ -13627,6 +16475,14 @@ open class TeamLog { case noteShareReceive(TeamLog.NoteShareReceiveType) /// (sharing) Opened shared Paper doc (deprecated, no longer logged) case openNoteShared(TeamLog.OpenNoteSharedType) + /// (sharing) Created shared link in Replay + case replayFileSharedLinkCreated(TeamLog.ReplayFileSharedLinkCreatedType) + /// (sharing) Modified shared link in Replay + case replayFileSharedLinkModified(TeamLog.ReplayFileSharedLinkModifiedType) + /// (sharing) Added member to Replay Project + case replayProjectTeamAdd(TeamLog.ReplayProjectTeamAddType) + /// (sharing) Removed member from Replay Project + case replayProjectTeamDelete(TeamLog.ReplayProjectTeamDeleteType) /// (sharing) Added team to shared folder (deprecated, no longer logged) case sfAddGroup(TeamLog.SfAddGroupType) /// (sharing) Allowed non-collaborators to view links to files in shared folder (deprecated, no longer logged) @@ -14123,3432 +16979,3579 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try EventTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EventTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EventTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EventType: \(error)" + } } } - open class EventTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EventType) -> JSON { + + public class EventTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EventType) throws -> JSON { switch value { - case .adminAlertingAlertStateChanged(let arg): - var d = Serialization.getFields(TeamLog.AdminAlertingAlertStateChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("admin_alerting_alert_state_changed") - return .dictionary(d) - case .adminAlertingChangedAlertConfig(let arg): - var d = Serialization.getFields(TeamLog.AdminAlertingChangedAlertConfigTypeSerializer().serialize(arg)) - d[".tag"] = .str("admin_alerting_changed_alert_config") - return .dictionary(d) - case .adminAlertingTriggeredAlert(let arg): - var d = Serialization.getFields(TeamLog.AdminAlertingTriggeredAlertTypeSerializer().serialize(arg)) - d[".tag"] = .str("admin_alerting_triggered_alert") - return .dictionary(d) - case .appBlockedByPermissions(let arg): - var d = Serialization.getFields(TeamLog.AppBlockedByPermissionsTypeSerializer().serialize(arg)) - d[".tag"] = .str("app_blocked_by_permissions") - return .dictionary(d) - case .appLinkTeam(let arg): - var d = Serialization.getFields(TeamLog.AppLinkTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("app_link_team") - return .dictionary(d) - case .appLinkUser(let arg): - var d = Serialization.getFields(TeamLog.AppLinkUserTypeSerializer().serialize(arg)) - d[".tag"] = .str("app_link_user") - return .dictionary(d) - case .appUnlinkTeam(let arg): - var d = Serialization.getFields(TeamLog.AppUnlinkTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("app_unlink_team") - return .dictionary(d) - case .appUnlinkUser(let arg): - var d = Serialization.getFields(TeamLog.AppUnlinkUserTypeSerializer().serialize(arg)) - d[".tag"] = .str("app_unlink_user") - return .dictionary(d) - case .integrationConnected(let arg): - var d = Serialization.getFields(TeamLog.IntegrationConnectedTypeSerializer().serialize(arg)) - d[".tag"] = .str("integration_connected") - return .dictionary(d) - case .integrationDisconnected(let arg): - var d = Serialization.getFields(TeamLog.IntegrationDisconnectedTypeSerializer().serialize(arg)) - d[".tag"] = .str("integration_disconnected") - return .dictionary(d) - case .fileAddComment(let arg): - var d = Serialization.getFields(TeamLog.FileAddCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_add_comment") - return .dictionary(d) - case .fileChangeCommentSubscription(let arg): - var d = Serialization.getFields(TeamLog.FileChangeCommentSubscriptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_change_comment_subscription") - return .dictionary(d) - case .fileDeleteComment(let arg): - var d = Serialization.getFields(TeamLog.FileDeleteCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_delete_comment") - return .dictionary(d) - case .fileEditComment(let arg): - var d = Serialization.getFields(TeamLog.FileEditCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_edit_comment") - return .dictionary(d) - case .fileLikeComment(let arg): - var d = Serialization.getFields(TeamLog.FileLikeCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_like_comment") - return .dictionary(d) - case .fileResolveComment(let arg): - var d = Serialization.getFields(TeamLog.FileResolveCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_resolve_comment") - return .dictionary(d) - case .fileUnlikeComment(let arg): - var d = Serialization.getFields(TeamLog.FileUnlikeCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_unlike_comment") - return .dictionary(d) - case .fileUnresolveComment(let arg): - var d = Serialization.getFields(TeamLog.FileUnresolveCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_unresolve_comment") - return .dictionary(d) - case .governancePolicyAddFolders(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyAddFoldersTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_add_folders") - return .dictionary(d) - case .governancePolicyAddFolderFailed(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyAddFolderFailedTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_add_folder_failed") - return .dictionary(d) - case .governancePolicyContentDisposed(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyContentDisposedTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_content_disposed") - return .dictionary(d) - case .governancePolicyCreate(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_create") - return .dictionary(d) - case .governancePolicyDelete(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_delete") - return .dictionary(d) - case .governancePolicyEditDetails(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyEditDetailsTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_edit_details") - return .dictionary(d) - case .governancePolicyEditDuration(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyEditDurationTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_edit_duration") - return .dictionary(d) - case .governancePolicyExportCreated(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyExportCreatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_export_created") - return .dictionary(d) - case .governancePolicyExportRemoved(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyExportRemovedTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_export_removed") - return .dictionary(d) - case .governancePolicyRemoveFolders(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyRemoveFoldersTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_remove_folders") - return .dictionary(d) - case .governancePolicyReportCreated(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyReportCreatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_report_created") - return .dictionary(d) - case .governancePolicyZipPartDownloaded(let arg): - var d = Serialization.getFields(TeamLog.GovernancePolicyZipPartDownloadedTypeSerializer().serialize(arg)) - d[".tag"] = .str("governance_policy_zip_part_downloaded") - return .dictionary(d) - case .legalHoldsActivateAHold(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsActivateAHoldTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_activate_a_hold") - return .dictionary(d) - case .legalHoldsAddMembers(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsAddMembersTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_add_members") - return .dictionary(d) - case .legalHoldsChangeHoldDetails(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsChangeHoldDetailsTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_change_hold_details") - return .dictionary(d) - case .legalHoldsChangeHoldName(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsChangeHoldNameTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_change_hold_name") - return .dictionary(d) - case .legalHoldsExportAHold(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportAHoldTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_a_hold") - return .dictionary(d) - case .legalHoldsExportCancelled(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportCancelledTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_cancelled") - return .dictionary(d) - case .legalHoldsExportDownloaded(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportDownloadedTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_downloaded") - return .dictionary(d) - case .legalHoldsExportRemoved(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsExportRemovedTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_export_removed") - return .dictionary(d) - case .legalHoldsReleaseAHold(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsReleaseAHoldTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_release_a_hold") - return .dictionary(d) - case .legalHoldsRemoveMembers(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsRemoveMembersTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_remove_members") - return .dictionary(d) - case .legalHoldsReportAHold(let arg): - var d = Serialization.getFields(TeamLog.LegalHoldsReportAHoldTypeSerializer().serialize(arg)) - d[".tag"] = .str("legal_holds_report_a_hold") - return .dictionary(d) - case .deviceChangeIpDesktop(let arg): - var d = Serialization.getFields(TeamLog.DeviceChangeIpDesktopTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_change_ip_desktop") - return .dictionary(d) - case .deviceChangeIpMobile(let arg): - var d = Serialization.getFields(TeamLog.DeviceChangeIpMobileTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_change_ip_mobile") - return .dictionary(d) - case .deviceChangeIpWeb(let arg): - var d = Serialization.getFields(TeamLog.DeviceChangeIpWebTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_change_ip_web") - return .dictionary(d) - case .deviceDeleteOnUnlinkFail(let arg): - var d = Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkFailTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_delete_on_unlink_fail") - return .dictionary(d) - case .deviceDeleteOnUnlinkSuccess(let arg): - var d = Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkSuccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_delete_on_unlink_success") - return .dictionary(d) - case .deviceLinkFail(let arg): - var d = Serialization.getFields(TeamLog.DeviceLinkFailTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_link_fail") - return .dictionary(d) - case .deviceLinkSuccess(let arg): - var d = Serialization.getFields(TeamLog.DeviceLinkSuccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_link_success") - return .dictionary(d) - case .deviceManagementDisabled(let arg): - var d = Serialization.getFields(TeamLog.DeviceManagementDisabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_management_disabled") - return .dictionary(d) - case .deviceManagementEnabled(let arg): - var d = Serialization.getFields(TeamLog.DeviceManagementEnabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_management_enabled") - return .dictionary(d) - case .deviceSyncBackupStatusChanged(let arg): - var d = Serialization.getFields(TeamLog.DeviceSyncBackupStatusChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_sync_backup_status_changed") - return .dictionary(d) - case .deviceUnlink(let arg): - var d = Serialization.getFields(TeamLog.DeviceUnlinkTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_unlink") - return .dictionary(d) - case .dropboxPasswordsExported(let arg): - var d = Serialization.getFields(TeamLog.DropboxPasswordsExportedTypeSerializer().serialize(arg)) - d[".tag"] = .str("dropbox_passwords_exported") - return .dictionary(d) - case .dropboxPasswordsNewDeviceEnrolled(let arg): - var d = Serialization.getFields(TeamLog.DropboxPasswordsNewDeviceEnrolledTypeSerializer().serialize(arg)) - d[".tag"] = .str("dropbox_passwords_new_device_enrolled") - return .dictionary(d) - case .emmRefreshAuthToken(let arg): - var d = Serialization.getFields(TeamLog.EmmRefreshAuthTokenTypeSerializer().serialize(arg)) - d[".tag"] = .str("emm_refresh_auth_token") - return .dictionary(d) - case .externalDriveBackupEligibilityStatusChecked(let arg): - var d = Serialization.getFields(TeamLog.ExternalDriveBackupEligibilityStatusCheckedTypeSerializer().serialize(arg)) - d[".tag"] = .str("external_drive_backup_eligibility_status_checked") - return .dictionary(d) - case .externalDriveBackupStatusChanged(let arg): - var d = Serialization.getFields(TeamLog.ExternalDriveBackupStatusChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("external_drive_backup_status_changed") - return .dictionary(d) - case .accountCaptureChangeAvailability(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureChangeAvailabilityTypeSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_change_availability") - return .dictionary(d) - case .accountCaptureMigrateAccount(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureMigrateAccountTypeSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_migrate_account") - return .dictionary(d) - case .accountCaptureNotificationEmailsSent(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureNotificationEmailsSentTypeSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_notification_emails_sent") - return .dictionary(d) - case .accountCaptureRelinquishAccount(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureRelinquishAccountTypeSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_relinquish_account") - return .dictionary(d) - case .disabledDomainInvites(let arg): - var d = Serialization.getFields(TeamLog.DisabledDomainInvitesTypeSerializer().serialize(arg)) - d[".tag"] = .str("disabled_domain_invites") - return .dictionary(d) - case .domainInvitesApproveRequestToJoinTeam(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesApproveRequestToJoinTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_approve_request_to_join_team") - return .dictionary(d) - case .domainInvitesDeclineRequestToJoinTeam(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesDeclineRequestToJoinTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_decline_request_to_join_team") - return .dictionary(d) - case .domainInvitesEmailExistingUsers(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesEmailExistingUsersTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_email_existing_users") - return .dictionary(d) - case .domainInvitesRequestToJoinTeam(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesRequestToJoinTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_request_to_join_team") - return .dictionary(d) - case .domainInvitesSetInviteNewUserPrefToNo(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToNoTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_no") - return .dictionary(d) - case .domainInvitesSetInviteNewUserPrefToYes(let arg): - var d = Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToYesTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_yes") - return .dictionary(d) - case .domainVerificationAddDomainFail(let arg): - var d = Serialization.getFields(TeamLog.DomainVerificationAddDomainFailTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_verification_add_domain_fail") - return .dictionary(d) - case .domainVerificationAddDomainSuccess(let arg): - var d = Serialization.getFields(TeamLog.DomainVerificationAddDomainSuccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_verification_add_domain_success") - return .dictionary(d) - case .domainVerificationRemoveDomain(let arg): - var d = Serialization.getFields(TeamLog.DomainVerificationRemoveDomainTypeSerializer().serialize(arg)) - d[".tag"] = .str("domain_verification_remove_domain") - return .dictionary(d) - case .enabledDomainInvites(let arg): - var d = Serialization.getFields(TeamLog.EnabledDomainInvitesTypeSerializer().serialize(arg)) - d[".tag"] = .str("enabled_domain_invites") - return .dictionary(d) - case .applyNamingConvention(let arg): - var d = Serialization.getFields(TeamLog.ApplyNamingConventionTypeSerializer().serialize(arg)) - d[".tag"] = .str("apply_naming_convention") - return .dictionary(d) - case .createFolder(let arg): - var d = Serialization.getFields(TeamLog.CreateFolderTypeSerializer().serialize(arg)) - d[".tag"] = .str("create_folder") - return .dictionary(d) - case .fileAdd(let arg): - var d = Serialization.getFields(TeamLog.FileAddTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_add") - return .dictionary(d) - case .fileCopy(let arg): - var d = Serialization.getFields(TeamLog.FileCopyTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_copy") - return .dictionary(d) - case .fileDelete(let arg): - var d = Serialization.getFields(TeamLog.FileDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_delete") - return .dictionary(d) - case .fileDownload(let arg): - var d = Serialization.getFields(TeamLog.FileDownloadTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_download") - return .dictionary(d) - case .fileEdit(let arg): - var d = Serialization.getFields(TeamLog.FileEditTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_edit") - return .dictionary(d) - case .fileGetCopyReference(let arg): - var d = Serialization.getFields(TeamLog.FileGetCopyReferenceTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_get_copy_reference") - return .dictionary(d) - case .fileLockingLockStatusChanged(let arg): - var d = Serialization.getFields(TeamLog.FileLockingLockStatusChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_locking_lock_status_changed") - return .dictionary(d) - case .fileMove(let arg): - var d = Serialization.getFields(TeamLog.FileMoveTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_move") - return .dictionary(d) - case .filePermanentlyDelete(let arg): - var d = Serialization.getFields(TeamLog.FilePermanentlyDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_permanently_delete") - return .dictionary(d) - case .filePreview(let arg): - var d = Serialization.getFields(TeamLog.FilePreviewTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_preview") - return .dictionary(d) - case .fileRename(let arg): - var d = Serialization.getFields(TeamLog.FileRenameTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_rename") - return .dictionary(d) - case .fileRestore(let arg): - var d = Serialization.getFields(TeamLog.FileRestoreTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_restore") - return .dictionary(d) - case .fileRevert(let arg): - var d = Serialization.getFields(TeamLog.FileRevertTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_revert") - return .dictionary(d) - case .fileRollbackChanges(let arg): - var d = Serialization.getFields(TeamLog.FileRollbackChangesTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_rollback_changes") - return .dictionary(d) - case .fileSaveCopyReference(let arg): - var d = Serialization.getFields(TeamLog.FileSaveCopyReferenceTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_save_copy_reference") - return .dictionary(d) - case .folderOverviewDescriptionChanged(let arg): - var d = Serialization.getFields(TeamLog.FolderOverviewDescriptionChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("folder_overview_description_changed") - return .dictionary(d) - case .folderOverviewItemPinned(let arg): - var d = Serialization.getFields(TeamLog.FolderOverviewItemPinnedTypeSerializer().serialize(arg)) - d[".tag"] = .str("folder_overview_item_pinned") - return .dictionary(d) - case .folderOverviewItemUnpinned(let arg): - var d = Serialization.getFields(TeamLog.FolderOverviewItemUnpinnedTypeSerializer().serialize(arg)) - d[".tag"] = .str("folder_overview_item_unpinned") - return .dictionary(d) - case .objectLabelAdded(let arg): - var d = Serialization.getFields(TeamLog.ObjectLabelAddedTypeSerializer().serialize(arg)) - d[".tag"] = .str("object_label_added") - return .dictionary(d) - case .objectLabelRemoved(let arg): - var d = Serialization.getFields(TeamLog.ObjectLabelRemovedTypeSerializer().serialize(arg)) - d[".tag"] = .str("object_label_removed") - return .dictionary(d) - case .objectLabelUpdatedValue(let arg): - var d = Serialization.getFields(TeamLog.ObjectLabelUpdatedValueTypeSerializer().serialize(arg)) - d[".tag"] = .str("object_label_updated_value") - return .dictionary(d) - case .organizeFolderWithTidy(let arg): - var d = Serialization.getFields(TeamLog.OrganizeFolderWithTidyTypeSerializer().serialize(arg)) - d[".tag"] = .str("organize_folder_with_tidy") - return .dictionary(d) - case .rewindFolder(let arg): - var d = Serialization.getFields(TeamLog.RewindFolderTypeSerializer().serialize(arg)) - d[".tag"] = .str("rewind_folder") - return .dictionary(d) - case .undoNamingConvention(let arg): - var d = Serialization.getFields(TeamLog.UndoNamingConventionTypeSerializer().serialize(arg)) - d[".tag"] = .str("undo_naming_convention") - return .dictionary(d) - case .undoOrganizeFolderWithTidy(let arg): - var d = Serialization.getFields(TeamLog.UndoOrganizeFolderWithTidyTypeSerializer().serialize(arg)) - d[".tag"] = .str("undo_organize_folder_with_tidy") - return .dictionary(d) - case .userTagsAdded(let arg): - var d = Serialization.getFields(TeamLog.UserTagsAddedTypeSerializer().serialize(arg)) - d[".tag"] = .str("user_tags_added") - return .dictionary(d) - case .userTagsRemoved(let arg): - var d = Serialization.getFields(TeamLog.UserTagsRemovedTypeSerializer().serialize(arg)) - d[".tag"] = .str("user_tags_removed") - return .dictionary(d) - case .emailIngestReceiveFile(let arg): - var d = Serialization.getFields(TeamLog.EmailIngestReceiveFileTypeSerializer().serialize(arg)) - d[".tag"] = .str("email_ingest_receive_file") - return .dictionary(d) - case .fileRequestChange(let arg): - var d = Serialization.getFields(TeamLog.FileRequestChangeTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_request_change") - return .dictionary(d) - case .fileRequestClose(let arg): - var d = Serialization.getFields(TeamLog.FileRequestCloseTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_request_close") - return .dictionary(d) - case .fileRequestCreate(let arg): - var d = Serialization.getFields(TeamLog.FileRequestCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_request_create") - return .dictionary(d) - case .fileRequestDelete(let arg): - var d = Serialization.getFields(TeamLog.FileRequestDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_request_delete") - return .dictionary(d) - case .fileRequestReceiveFile(let arg): - var d = Serialization.getFields(TeamLog.FileRequestReceiveFileTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_request_receive_file") - return .dictionary(d) - case .groupAddExternalId(let arg): - var d = Serialization.getFields(TeamLog.GroupAddExternalIdTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_add_external_id") - return .dictionary(d) - case .groupAddMember(let arg): - var d = Serialization.getFields(TeamLog.GroupAddMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_add_member") - return .dictionary(d) - case .groupChangeExternalId(let arg): - var d = Serialization.getFields(TeamLog.GroupChangeExternalIdTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_change_external_id") - return .dictionary(d) - case .groupChangeManagementType(let arg): - var d = Serialization.getFields(TeamLog.GroupChangeManagementTypeTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_change_management_type") - return .dictionary(d) - case .groupChangeMemberRole(let arg): - var d = Serialization.getFields(TeamLog.GroupChangeMemberRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_change_member_role") - return .dictionary(d) - case .groupCreate(let arg): - var d = Serialization.getFields(TeamLog.GroupCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_create") - return .dictionary(d) - case .groupDelete(let arg): - var d = Serialization.getFields(TeamLog.GroupDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_delete") - return .dictionary(d) - case .groupDescriptionUpdated(let arg): - var d = Serialization.getFields(TeamLog.GroupDescriptionUpdatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_description_updated") - return .dictionary(d) - case .groupJoinPolicyUpdated(let arg): - var d = Serialization.getFields(TeamLog.GroupJoinPolicyUpdatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_join_policy_updated") - return .dictionary(d) - case .groupMoved(let arg): - var d = Serialization.getFields(TeamLog.GroupMovedTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_moved") - return .dictionary(d) - case .groupRemoveExternalId(let arg): - var d = Serialization.getFields(TeamLog.GroupRemoveExternalIdTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_remove_external_id") - return .dictionary(d) - case .groupRemoveMember(let arg): - var d = Serialization.getFields(TeamLog.GroupRemoveMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_remove_member") - return .dictionary(d) - case .groupRename(let arg): - var d = Serialization.getFields(TeamLog.GroupRenameTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_rename") - return .dictionary(d) - case .accountLockOrUnlocked(let arg): - var d = Serialization.getFields(TeamLog.AccountLockOrUnlockedTypeSerializer().serialize(arg)) - d[".tag"] = .str("account_lock_or_unlocked") - return .dictionary(d) - case .emmError(let arg): - var d = Serialization.getFields(TeamLog.EmmErrorTypeSerializer().serialize(arg)) - d[".tag"] = .str("emm_error") - return .dictionary(d) - case .guestAdminSignedInViaTrustedTeams(let arg): - var d = Serialization.getFields(TeamLog.GuestAdminSignedInViaTrustedTeamsTypeSerializer().serialize(arg)) - d[".tag"] = .str("guest_admin_signed_in_via_trusted_teams") - return .dictionary(d) - case .guestAdminSignedOutViaTrustedTeams(let arg): - var d = Serialization.getFields(TeamLog.GuestAdminSignedOutViaTrustedTeamsTypeSerializer().serialize(arg)) - d[".tag"] = .str("guest_admin_signed_out_via_trusted_teams") - return .dictionary(d) - case .loginFail(let arg): - var d = Serialization.getFields(TeamLog.LoginFailTypeSerializer().serialize(arg)) - d[".tag"] = .str("login_fail") - return .dictionary(d) - case .loginSuccess(let arg): - var d = Serialization.getFields(TeamLog.LoginSuccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("login_success") - return .dictionary(d) - case .logout(let arg): - var d = Serialization.getFields(TeamLog.LogoutTypeSerializer().serialize(arg)) - d[".tag"] = .str("logout") - return .dictionary(d) - case .resellerSupportSessionEnd(let arg): - var d = Serialization.getFields(TeamLog.ResellerSupportSessionEndTypeSerializer().serialize(arg)) - d[".tag"] = .str("reseller_support_session_end") - return .dictionary(d) - case .resellerSupportSessionStart(let arg): - var d = Serialization.getFields(TeamLog.ResellerSupportSessionStartTypeSerializer().serialize(arg)) - d[".tag"] = .str("reseller_support_session_start") - return .dictionary(d) - case .signInAsSessionEnd(let arg): - var d = Serialization.getFields(TeamLog.SignInAsSessionEndTypeSerializer().serialize(arg)) - d[".tag"] = .str("sign_in_as_session_end") - return .dictionary(d) - case .signInAsSessionStart(let arg): - var d = Serialization.getFields(TeamLog.SignInAsSessionStartTypeSerializer().serialize(arg)) - d[".tag"] = .str("sign_in_as_session_start") - return .dictionary(d) - case .ssoError(let arg): - var d = Serialization.getFields(TeamLog.SsoErrorTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_error") - return .dictionary(d) - case .createTeamInviteLink(let arg): - var d = Serialization.getFields(TeamLog.CreateTeamInviteLinkTypeSerializer().serialize(arg)) - d[".tag"] = .str("create_team_invite_link") - return .dictionary(d) - case .deleteTeamInviteLink(let arg): - var d = Serialization.getFields(TeamLog.DeleteTeamInviteLinkTypeSerializer().serialize(arg)) - d[".tag"] = .str("delete_team_invite_link") - return .dictionary(d) - case .memberAddExternalId(let arg): - var d = Serialization.getFields(TeamLog.MemberAddExternalIdTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_add_external_id") - return .dictionary(d) - case .memberAddName(let arg): - var d = Serialization.getFields(TeamLog.MemberAddNameTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_add_name") - return .dictionary(d) - case .memberChangeAdminRole(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeAdminRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_change_admin_role") - return .dictionary(d) - case .memberChangeEmail(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeEmailTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_change_email") - return .dictionary(d) - case .memberChangeExternalId(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeExternalIdTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_change_external_id") - return .dictionary(d) - case .memberChangeMembershipType(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeMembershipTypeTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_change_membership_type") - return .dictionary(d) - case .memberChangeName(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeNameTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_change_name") - return .dictionary(d) - case .memberChangeResellerRole(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeResellerRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_change_reseller_role") - return .dictionary(d) - case .memberChangeStatus(let arg): - var d = Serialization.getFields(TeamLog.MemberChangeStatusTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_change_status") - return .dictionary(d) - case .memberDeleteManualContacts(let arg): - var d = Serialization.getFields(TeamLog.MemberDeleteManualContactsTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_delete_manual_contacts") - return .dictionary(d) - case .memberDeleteProfilePhoto(let arg): - var d = Serialization.getFields(TeamLog.MemberDeleteProfilePhotoTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_delete_profile_photo") - return .dictionary(d) - case .memberPermanentlyDeleteAccountContents(let arg): - var d = Serialization.getFields(TeamLog.MemberPermanentlyDeleteAccountContentsTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_permanently_delete_account_contents") - return .dictionary(d) - case .memberRemoveExternalId(let arg): - var d = Serialization.getFields(TeamLog.MemberRemoveExternalIdTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_remove_external_id") - return .dictionary(d) - case .memberSetProfilePhoto(let arg): - var d = Serialization.getFields(TeamLog.MemberSetProfilePhotoTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_set_profile_photo") - return .dictionary(d) - case .memberSpaceLimitsAddCustomQuota(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsAddCustomQuotaTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_add_custom_quota") - return .dictionary(d) - case .memberSpaceLimitsChangeCustomQuota(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCustomQuotaTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_custom_quota") - return .dictionary(d) - case .memberSpaceLimitsChangeStatus(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangeStatusTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_status") - return .dictionary(d) - case .memberSpaceLimitsRemoveCustomQuota(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveCustomQuotaTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_remove_custom_quota") - return .dictionary(d) - case .memberSuggest(let arg): - var d = Serialization.getFields(TeamLog.MemberSuggestTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_suggest") - return .dictionary(d) - case .memberTransferAccountContents(let arg): - var d = Serialization.getFields(TeamLog.MemberTransferAccountContentsTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_transfer_account_contents") - return .dictionary(d) - case .pendingSecondaryEmailAdded(let arg): - var d = Serialization.getFields(TeamLog.PendingSecondaryEmailAddedTypeSerializer().serialize(arg)) - d[".tag"] = .str("pending_secondary_email_added") - return .dictionary(d) - case .secondaryEmailDeleted(let arg): - var d = Serialization.getFields(TeamLog.SecondaryEmailDeletedTypeSerializer().serialize(arg)) - d[".tag"] = .str("secondary_email_deleted") - return .dictionary(d) - case .secondaryEmailVerified(let arg): - var d = Serialization.getFields(TeamLog.SecondaryEmailVerifiedTypeSerializer().serialize(arg)) - d[".tag"] = .str("secondary_email_verified") - return .dictionary(d) - case .secondaryMailsPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.SecondaryMailsPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("secondary_mails_policy_changed") - return .dictionary(d) - case .binderAddPage(let arg): - var d = Serialization.getFields(TeamLog.BinderAddPageTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_add_page") - return .dictionary(d) - case .binderAddSection(let arg): - var d = Serialization.getFields(TeamLog.BinderAddSectionTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_add_section") - return .dictionary(d) - case .binderRemovePage(let arg): - var d = Serialization.getFields(TeamLog.BinderRemovePageTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_remove_page") - return .dictionary(d) - case .binderRemoveSection(let arg): - var d = Serialization.getFields(TeamLog.BinderRemoveSectionTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_remove_section") - return .dictionary(d) - case .binderRenamePage(let arg): - var d = Serialization.getFields(TeamLog.BinderRenamePageTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_rename_page") - return .dictionary(d) - case .binderRenameSection(let arg): - var d = Serialization.getFields(TeamLog.BinderRenameSectionTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_rename_section") - return .dictionary(d) - case .binderReorderPage(let arg): - var d = Serialization.getFields(TeamLog.BinderReorderPageTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_reorder_page") - return .dictionary(d) - case .binderReorderSection(let arg): - var d = Serialization.getFields(TeamLog.BinderReorderSectionTypeSerializer().serialize(arg)) - d[".tag"] = .str("binder_reorder_section") - return .dictionary(d) - case .paperContentAddMember(let arg): - var d = Serialization.getFields(TeamLog.PaperContentAddMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_add_member") - return .dictionary(d) - case .paperContentAddToFolder(let arg): - var d = Serialization.getFields(TeamLog.PaperContentAddToFolderTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_add_to_folder") - return .dictionary(d) - case .paperContentArchive(let arg): - var d = Serialization.getFields(TeamLog.PaperContentArchiveTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_archive") - return .dictionary(d) - case .paperContentCreate(let arg): - var d = Serialization.getFields(TeamLog.PaperContentCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_create") - return .dictionary(d) - case .paperContentPermanentlyDelete(let arg): - var d = Serialization.getFields(TeamLog.PaperContentPermanentlyDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_permanently_delete") - return .dictionary(d) - case .paperContentRemoveFromFolder(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRemoveFromFolderTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_remove_from_folder") - return .dictionary(d) - case .paperContentRemoveMember(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRemoveMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_remove_member") - return .dictionary(d) - case .paperContentRename(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRenameTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_rename") - return .dictionary(d) - case .paperContentRestore(let arg): - var d = Serialization.getFields(TeamLog.PaperContentRestoreTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_content_restore") - return .dictionary(d) - case .paperDocAddComment(let arg): - var d = Serialization.getFields(TeamLog.PaperDocAddCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_add_comment") - return .dictionary(d) - case .paperDocChangeMemberRole(let arg): - var d = Serialization.getFields(TeamLog.PaperDocChangeMemberRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_change_member_role") - return .dictionary(d) - case .paperDocChangeSharingPolicy(let arg): - var d = Serialization.getFields(TeamLog.PaperDocChangeSharingPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_change_sharing_policy") - return .dictionary(d) - case .paperDocChangeSubscription(let arg): - var d = Serialization.getFields(TeamLog.PaperDocChangeSubscriptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_change_subscription") - return .dictionary(d) - case .paperDocDeleted(let arg): - var d = Serialization.getFields(TeamLog.PaperDocDeletedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_deleted") - return .dictionary(d) - case .paperDocDeleteComment(let arg): - var d = Serialization.getFields(TeamLog.PaperDocDeleteCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_delete_comment") - return .dictionary(d) - case .paperDocDownload(let arg): - var d = Serialization.getFields(TeamLog.PaperDocDownloadTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_download") - return .dictionary(d) - case .paperDocEdit(let arg): - var d = Serialization.getFields(TeamLog.PaperDocEditTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_edit") - return .dictionary(d) - case .paperDocEditComment(let arg): - var d = Serialization.getFields(TeamLog.PaperDocEditCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_edit_comment") - return .dictionary(d) - case .paperDocFollowed(let arg): - var d = Serialization.getFields(TeamLog.PaperDocFollowedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_followed") - return .dictionary(d) - case .paperDocMention(let arg): - var d = Serialization.getFields(TeamLog.PaperDocMentionTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_mention") - return .dictionary(d) - case .paperDocOwnershipChanged(let arg): - var d = Serialization.getFields(TeamLog.PaperDocOwnershipChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_ownership_changed") - return .dictionary(d) - case .paperDocRequestAccess(let arg): - var d = Serialization.getFields(TeamLog.PaperDocRequestAccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_request_access") - return .dictionary(d) - case .paperDocResolveComment(let arg): - var d = Serialization.getFields(TeamLog.PaperDocResolveCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_resolve_comment") - return .dictionary(d) - case .paperDocRevert(let arg): - var d = Serialization.getFields(TeamLog.PaperDocRevertTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_revert") - return .dictionary(d) - case .paperDocSlackShare(let arg): - var d = Serialization.getFields(TeamLog.PaperDocSlackShareTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_slack_share") - return .dictionary(d) - case .paperDocTeamInvite(let arg): - var d = Serialization.getFields(TeamLog.PaperDocTeamInviteTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_team_invite") - return .dictionary(d) - case .paperDocTrashed(let arg): - var d = Serialization.getFields(TeamLog.PaperDocTrashedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_trashed") - return .dictionary(d) - case .paperDocUnresolveComment(let arg): - var d = Serialization.getFields(TeamLog.PaperDocUnresolveCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_unresolve_comment") - return .dictionary(d) - case .paperDocUntrashed(let arg): - var d = Serialization.getFields(TeamLog.PaperDocUntrashedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_untrashed") - return .dictionary(d) - case .paperDocView(let arg): - var d = Serialization.getFields(TeamLog.PaperDocViewTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_doc_view") - return .dictionary(d) - case .paperExternalViewAllow(let arg): - var d = Serialization.getFields(TeamLog.PaperExternalViewAllowTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_external_view_allow") - return .dictionary(d) - case .paperExternalViewDefaultTeam(let arg): - var d = Serialization.getFields(TeamLog.PaperExternalViewDefaultTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_external_view_default_team") - return .dictionary(d) - case .paperExternalViewForbid(let arg): - var d = Serialization.getFields(TeamLog.PaperExternalViewForbidTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_external_view_forbid") - return .dictionary(d) - case .paperFolderChangeSubscription(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderChangeSubscriptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_change_subscription") - return .dictionary(d) - case .paperFolderDeleted(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderDeletedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_deleted") - return .dictionary(d) - case .paperFolderFollowed(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderFollowedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_followed") - return .dictionary(d) - case .paperFolderTeamInvite(let arg): - var d = Serialization.getFields(TeamLog.PaperFolderTeamInviteTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_folder_team_invite") - return .dictionary(d) - case .paperPublishedLinkChangePermission(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkChangePermissionTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_change_permission") - return .dictionary(d) - case .paperPublishedLinkCreate(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_create") - return .dictionary(d) - case .paperPublishedLinkDisabled(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkDisabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_disabled") - return .dictionary(d) - case .paperPublishedLinkView(let arg): - var d = Serialization.getFields(TeamLog.PaperPublishedLinkViewTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_published_link_view") - return .dictionary(d) - case .passwordChange(let arg): - var d = Serialization.getFields(TeamLog.PasswordChangeTypeSerializer().serialize(arg)) - d[".tag"] = .str("password_change") - return .dictionary(d) - case .passwordReset(let arg): - var d = Serialization.getFields(TeamLog.PasswordResetTypeSerializer().serialize(arg)) - d[".tag"] = .str("password_reset") - return .dictionary(d) - case .passwordResetAll(let arg): - var d = Serialization.getFields(TeamLog.PasswordResetAllTypeSerializer().serialize(arg)) - d[".tag"] = .str("password_reset_all") - return .dictionary(d) - case .classificationCreateReport(let arg): - var d = Serialization.getFields(TeamLog.ClassificationCreateReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("classification_create_report") - return .dictionary(d) - case .classificationCreateReportFail(let arg): - var d = Serialization.getFields(TeamLog.ClassificationCreateReportFailTypeSerializer().serialize(arg)) - d[".tag"] = .str("classification_create_report_fail") - return .dictionary(d) - case .emmCreateExceptionsReport(let arg): - var d = Serialization.getFields(TeamLog.EmmCreateExceptionsReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("emm_create_exceptions_report") - return .dictionary(d) - case .emmCreateUsageReport(let arg): - var d = Serialization.getFields(TeamLog.EmmCreateUsageReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("emm_create_usage_report") - return .dictionary(d) - case .exportMembersReport(let arg): - var d = Serialization.getFields(TeamLog.ExportMembersReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("export_members_report") - return .dictionary(d) - case .exportMembersReportFail(let arg): - var d = Serialization.getFields(TeamLog.ExportMembersReportFailTypeSerializer().serialize(arg)) - d[".tag"] = .str("export_members_report_fail") - return .dictionary(d) - case .externalSharingCreateReport(let arg): - var d = Serialization.getFields(TeamLog.ExternalSharingCreateReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("external_sharing_create_report") - return .dictionary(d) - case .externalSharingReportFailed(let arg): - var d = Serialization.getFields(TeamLog.ExternalSharingReportFailedTypeSerializer().serialize(arg)) - d[".tag"] = .str("external_sharing_report_failed") - return .dictionary(d) - case .noExpirationLinkGenCreateReport(let arg): - var d = Serialization.getFields(TeamLog.NoExpirationLinkGenCreateReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("no_expiration_link_gen_create_report") - return .dictionary(d) - case .noExpirationLinkGenReportFailed(let arg): - var d = Serialization.getFields(TeamLog.NoExpirationLinkGenReportFailedTypeSerializer().serialize(arg)) - d[".tag"] = .str("no_expiration_link_gen_report_failed") - return .dictionary(d) - case .noPasswordLinkGenCreateReport(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkGenCreateReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_gen_create_report") - return .dictionary(d) - case .noPasswordLinkGenReportFailed(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkGenReportFailedTypeSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_gen_report_failed") - return .dictionary(d) - case .noPasswordLinkViewCreateReport(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkViewCreateReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_view_create_report") - return .dictionary(d) - case .noPasswordLinkViewReportFailed(let arg): - var d = Serialization.getFields(TeamLog.NoPasswordLinkViewReportFailedTypeSerializer().serialize(arg)) - d[".tag"] = .str("no_password_link_view_report_failed") - return .dictionary(d) - case .outdatedLinkViewCreateReport(let arg): - var d = Serialization.getFields(TeamLog.OutdatedLinkViewCreateReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("outdated_link_view_create_report") - return .dictionary(d) - case .outdatedLinkViewReportFailed(let arg): - var d = Serialization.getFields(TeamLog.OutdatedLinkViewReportFailedTypeSerializer().serialize(arg)) - d[".tag"] = .str("outdated_link_view_report_failed") - return .dictionary(d) - case .paperAdminExportStart(let arg): - var d = Serialization.getFields(TeamLog.PaperAdminExportStartTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_admin_export_start") - return .dictionary(d) - case .smartSyncCreateAdminPrivilegeReport(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncCreateAdminPrivilegeReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_create_admin_privilege_report") - return .dictionary(d) - case .teamActivityCreateReport(let arg): - var d = Serialization.getFields(TeamLog.TeamActivityCreateReportTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_activity_create_report") - return .dictionary(d) - case .teamActivityCreateReportFail(let arg): - var d = Serialization.getFields(TeamLog.TeamActivityCreateReportFailTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_activity_create_report_fail") - return .dictionary(d) - case .collectionShare(let arg): - var d = Serialization.getFields(TeamLog.CollectionShareTypeSerializer().serialize(arg)) - d[".tag"] = .str("collection_share") - return .dictionary(d) - case .fileTransfersFileAdd(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersFileAddTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_file_add") - return .dictionary(d) - case .fileTransfersTransferDelete(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_delete") - return .dictionary(d) - case .fileTransfersTransferDownload(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferDownloadTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_download") - return .dictionary(d) - case .fileTransfersTransferSend(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferSendTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_send") - return .dictionary(d) - case .fileTransfersTransferView(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersTransferViewTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_transfer_view") - return .dictionary(d) - case .noteAclInviteOnly(let arg): - var d = Serialization.getFields(TeamLog.NoteAclInviteOnlyTypeSerializer().serialize(arg)) - d[".tag"] = .str("note_acl_invite_only") - return .dictionary(d) - case .noteAclLink(let arg): - var d = Serialization.getFields(TeamLog.NoteAclLinkTypeSerializer().serialize(arg)) - d[".tag"] = .str("note_acl_link") - return .dictionary(d) - case .noteAclTeamLink(let arg): - var d = Serialization.getFields(TeamLog.NoteAclTeamLinkTypeSerializer().serialize(arg)) - d[".tag"] = .str("note_acl_team_link") - return .dictionary(d) - case .noteShared(let arg): - var d = Serialization.getFields(TeamLog.NoteSharedTypeSerializer().serialize(arg)) - d[".tag"] = .str("note_shared") - return .dictionary(d) - case .noteShareReceive(let arg): - var d = Serialization.getFields(TeamLog.NoteShareReceiveTypeSerializer().serialize(arg)) - d[".tag"] = .str("note_share_receive") - return .dictionary(d) - case .openNoteShared(let arg): - var d = Serialization.getFields(TeamLog.OpenNoteSharedTypeSerializer().serialize(arg)) - d[".tag"] = .str("open_note_shared") - return .dictionary(d) - case .sfAddGroup(let arg): - var d = Serialization.getFields(TeamLog.SfAddGroupTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_add_group") - return .dictionary(d) - case .sfAllowNonMembersToViewSharedLinks(let arg): - var d = Serialization.getFields(TeamLog.SfAllowNonMembersToViewSharedLinksTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_allow_non_members_to_view_shared_links") - return .dictionary(d) - case .sfExternalInviteWarn(let arg): - var d = Serialization.getFields(TeamLog.SfExternalInviteWarnTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_external_invite_warn") - return .dictionary(d) - case .sfFbInvite(let arg): - var d = Serialization.getFields(TeamLog.SfFbInviteTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_fb_invite") - return .dictionary(d) - case .sfFbInviteChangeRole(let arg): - var d = Serialization.getFields(TeamLog.SfFbInviteChangeRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_fb_invite_change_role") - return .dictionary(d) - case .sfFbUninvite(let arg): - var d = Serialization.getFields(TeamLog.SfFbUninviteTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_fb_uninvite") - return .dictionary(d) - case .sfInviteGroup(let arg): - var d = Serialization.getFields(TeamLog.SfInviteGroupTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_invite_group") - return .dictionary(d) - case .sfTeamGrantAccess(let arg): - var d = Serialization.getFields(TeamLog.SfTeamGrantAccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_grant_access") - return .dictionary(d) - case .sfTeamInvite(let arg): - var d = Serialization.getFields(TeamLog.SfTeamInviteTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_invite") - return .dictionary(d) - case .sfTeamInviteChangeRole(let arg): - var d = Serialization.getFields(TeamLog.SfTeamInviteChangeRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_invite_change_role") - return .dictionary(d) - case .sfTeamJoin(let arg): - var d = Serialization.getFields(TeamLog.SfTeamJoinTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_join") - return .dictionary(d) - case .sfTeamJoinFromOobLink(let arg): - var d = Serialization.getFields(TeamLog.SfTeamJoinFromOobLinkTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_join_from_oob_link") - return .dictionary(d) - case .sfTeamUninvite(let arg): - var d = Serialization.getFields(TeamLog.SfTeamUninviteTypeSerializer().serialize(arg)) - d[".tag"] = .str("sf_team_uninvite") - return .dictionary(d) - case .sharedContentAddInvitees(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddInviteesTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_invitees") - return .dictionary(d) - case .sharedContentAddLinkExpiry(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddLinkExpiryTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_link_expiry") - return .dictionary(d) - case .sharedContentAddLinkPassword(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddLinkPasswordTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_link_password") - return .dictionary(d) - case .sharedContentAddMember(let arg): - var d = Serialization.getFields(TeamLog.SharedContentAddMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_add_member") - return .dictionary(d) - case .sharedContentChangeDownloadsPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeDownloadsPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_downloads_policy") - return .dictionary(d) - case .sharedContentChangeInviteeRole(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeInviteeRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_invitee_role") - return .dictionary(d) - case .sharedContentChangeLinkAudience(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeLinkAudienceTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_link_audience") - return .dictionary(d) - case .sharedContentChangeLinkExpiry(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeLinkExpiryTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_link_expiry") - return .dictionary(d) - case .sharedContentChangeLinkPassword(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeLinkPasswordTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_link_password") - return .dictionary(d) - case .sharedContentChangeMemberRole(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeMemberRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_member_role") - return .dictionary(d) - case .sharedContentChangeViewerInfoPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharedContentChangeViewerInfoPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_change_viewer_info_policy") - return .dictionary(d) - case .sharedContentClaimInvitation(let arg): - var d = Serialization.getFields(TeamLog.SharedContentClaimInvitationTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_claim_invitation") - return .dictionary(d) - case .sharedContentCopy(let arg): - var d = Serialization.getFields(TeamLog.SharedContentCopyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_copy") - return .dictionary(d) - case .sharedContentDownload(let arg): - var d = Serialization.getFields(TeamLog.SharedContentDownloadTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_download") - return .dictionary(d) - case .sharedContentRelinquishMembership(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRelinquishMembershipTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_relinquish_membership") - return .dictionary(d) - case .sharedContentRemoveInvitees(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveInviteesTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_invitees") - return .dictionary(d) - case .sharedContentRemoveLinkExpiry(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveLinkExpiryTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_link_expiry") - return .dictionary(d) - case .sharedContentRemoveLinkPassword(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveLinkPasswordTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_link_password") - return .dictionary(d) - case .sharedContentRemoveMember(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRemoveMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_remove_member") - return .dictionary(d) - case .sharedContentRequestAccess(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRequestAccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_request_access") - return .dictionary(d) - case .sharedContentRestoreInvitees(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRestoreInviteesTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_restore_invitees") - return .dictionary(d) - case .sharedContentRestoreMember(let arg): - var d = Serialization.getFields(TeamLog.SharedContentRestoreMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_restore_member") - return .dictionary(d) - case .sharedContentUnshare(let arg): - var d = Serialization.getFields(TeamLog.SharedContentUnshareTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_unshare") - return .dictionary(d) - case .sharedContentView(let arg): - var d = Serialization.getFields(TeamLog.SharedContentViewTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_content_view") - return .dictionary(d) - case .sharedFolderChangeLinkPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeLinkPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_link_policy") - return .dictionary(d) - case .sharedFolderChangeMembersInheritancePolicy(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeMembersInheritancePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_members_inheritance_policy") - return .dictionary(d) - case .sharedFolderChangeMembersManagementPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeMembersManagementPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_members_management_policy") - return .dictionary(d) - case .sharedFolderChangeMembersPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderChangeMembersPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_change_members_policy") - return .dictionary(d) - case .sharedFolderCreate(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_create") - return .dictionary(d) - case .sharedFolderDeclineInvitation(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderDeclineInvitationTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_decline_invitation") - return .dictionary(d) - case .sharedFolderMount(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderMountTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_mount") - return .dictionary(d) - case .sharedFolderNest(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderNestTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_nest") - return .dictionary(d) - case .sharedFolderTransferOwnership(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderTransferOwnershipTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_transfer_ownership") - return .dictionary(d) - case .sharedFolderUnmount(let arg): - var d = Serialization.getFields(TeamLog.SharedFolderUnmountTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_folder_unmount") - return .dictionary(d) - case .sharedLinkAddExpiry(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkAddExpiryTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_add_expiry") - return .dictionary(d) - case .sharedLinkChangeExpiry(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkChangeExpiryTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_change_expiry") - return .dictionary(d) - case .sharedLinkChangeVisibility(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkChangeVisibilityTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_change_visibility") - return .dictionary(d) - case .sharedLinkCopy(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkCopyTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_copy") - return .dictionary(d) - case .sharedLinkCreate(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_create") - return .dictionary(d) - case .sharedLinkDisable(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkDisableTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_disable") - return .dictionary(d) - case .sharedLinkDownload(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkDownloadTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_download") - return .dictionary(d) - case .sharedLinkRemoveExpiry(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkRemoveExpiryTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_remove_expiry") - return .dictionary(d) - case .sharedLinkSettingsAddExpiration(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAddExpirationTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_add_expiration") - return .dictionary(d) - case .sharedLinkSettingsAddPassword(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAddPasswordTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_add_password") - return .dictionary(d) - case .sharedLinkSettingsAllowDownloadDisabled(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadDisabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_allow_download_disabled") - return .dictionary(d) - case .sharedLinkSettingsAllowDownloadEnabled(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadEnabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_allow_download_enabled") - return .dictionary(d) - case .sharedLinkSettingsChangeAudience(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsChangeAudienceTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_change_audience") - return .dictionary(d) - case .sharedLinkSettingsChangeExpiration(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsChangeExpirationTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_change_expiration") - return .dictionary(d) - case .sharedLinkSettingsChangePassword(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsChangePasswordTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_change_password") - return .dictionary(d) - case .sharedLinkSettingsRemoveExpiration(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsRemoveExpirationTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_remove_expiration") - return .dictionary(d) - case .sharedLinkSettingsRemovePassword(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkSettingsRemovePasswordTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_settings_remove_password") - return .dictionary(d) - case .sharedLinkShare(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkShareTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_share") - return .dictionary(d) - case .sharedLinkView(let arg): - var d = Serialization.getFields(TeamLog.SharedLinkViewTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_link_view") - return .dictionary(d) - case .sharedNoteOpened(let arg): - var d = Serialization.getFields(TeamLog.SharedNoteOpenedTypeSerializer().serialize(arg)) - d[".tag"] = .str("shared_note_opened") - return .dictionary(d) - case .shmodelDisableDownloads(let arg): - var d = Serialization.getFields(TeamLog.ShmodelDisableDownloadsTypeSerializer().serialize(arg)) - d[".tag"] = .str("shmodel_disable_downloads") - return .dictionary(d) - case .shmodelEnableDownloads(let arg): - var d = Serialization.getFields(TeamLog.ShmodelEnableDownloadsTypeSerializer().serialize(arg)) - d[".tag"] = .str("shmodel_enable_downloads") - return .dictionary(d) - case .shmodelGroupShare(let arg): - var d = Serialization.getFields(TeamLog.ShmodelGroupShareTypeSerializer().serialize(arg)) - d[".tag"] = .str("shmodel_group_share") - return .dictionary(d) - case .showcaseAccessGranted(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseAccessGrantedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_access_granted") - return .dictionary(d) - case .showcaseAddMember(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseAddMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_add_member") - return .dictionary(d) - case .showcaseArchived(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseArchivedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_archived") - return .dictionary(d) - case .showcaseCreated(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseCreatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_created") - return .dictionary(d) - case .showcaseDeleteComment(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseDeleteCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_delete_comment") - return .dictionary(d) - case .showcaseEdited(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseEditedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_edited") - return .dictionary(d) - case .showcaseEditComment(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseEditCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_edit_comment") - return .dictionary(d) - case .showcaseFileAdded(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileAddedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_added") - return .dictionary(d) - case .showcaseFileDownload(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileDownloadTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_download") - return .dictionary(d) - case .showcaseFileRemoved(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileRemovedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_removed") - return .dictionary(d) - case .showcaseFileView(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseFileViewTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_file_view") - return .dictionary(d) - case .showcasePermanentlyDeleted(let arg): - var d = Serialization.getFields(TeamLog.ShowcasePermanentlyDeletedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_permanently_deleted") - return .dictionary(d) - case .showcasePostComment(let arg): - var d = Serialization.getFields(TeamLog.ShowcasePostCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_post_comment") - return .dictionary(d) - case .showcaseRemoveMember(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRemoveMemberTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_remove_member") - return .dictionary(d) - case .showcaseRenamed(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRenamedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_renamed") - return .dictionary(d) - case .showcaseRequestAccess(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRequestAccessTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_request_access") - return .dictionary(d) - case .showcaseResolveComment(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseResolveCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_resolve_comment") - return .dictionary(d) - case .showcaseRestored(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseRestoredTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_restored") - return .dictionary(d) - case .showcaseTrashed(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseTrashedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_trashed") - return .dictionary(d) - case .showcaseTrashedDeprecated(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseTrashedDeprecatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_trashed_deprecated") - return .dictionary(d) - case .showcaseUnresolveComment(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseUnresolveCommentTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_unresolve_comment") - return .dictionary(d) - case .showcaseUntrashed(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseUntrashedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_untrashed") - return .dictionary(d) - case .showcaseUntrashedDeprecated(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseUntrashedDeprecatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_untrashed_deprecated") - return .dictionary(d) - case .showcaseView(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseViewTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_view") - return .dictionary(d) - case .ssoAddCert(let arg): - var d = Serialization.getFields(TeamLog.SsoAddCertTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_add_cert") - return .dictionary(d) - case .ssoAddLoginUrl(let arg): - var d = Serialization.getFields(TeamLog.SsoAddLoginUrlTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_add_login_url") - return .dictionary(d) - case .ssoAddLogoutUrl(let arg): - var d = Serialization.getFields(TeamLog.SsoAddLogoutUrlTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_add_logout_url") - return .dictionary(d) - case .ssoChangeCert(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeCertTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_cert") - return .dictionary(d) - case .ssoChangeLoginUrl(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeLoginUrlTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_login_url") - return .dictionary(d) - case .ssoChangeLogoutUrl(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeLogoutUrlTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_logout_url") - return .dictionary(d) - case .ssoChangeSamlIdentityMode(let arg): - var d = Serialization.getFields(TeamLog.SsoChangeSamlIdentityModeTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_saml_identity_mode") - return .dictionary(d) - case .ssoRemoveCert(let arg): - var d = Serialization.getFields(TeamLog.SsoRemoveCertTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_remove_cert") - return .dictionary(d) - case .ssoRemoveLoginUrl(let arg): - var d = Serialization.getFields(TeamLog.SsoRemoveLoginUrlTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_remove_login_url") - return .dictionary(d) - case .ssoRemoveLogoutUrl(let arg): - var d = Serialization.getFields(TeamLog.SsoRemoveLogoutUrlTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_remove_logout_url") - return .dictionary(d) - case .teamFolderChangeStatus(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderChangeStatusTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_change_status") - return .dictionary(d) - case .teamFolderCreate(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderCreateTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_create") - return .dictionary(d) - case .teamFolderDowngrade(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderDowngradeTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_downgrade") - return .dictionary(d) - case .teamFolderPermanentlyDelete(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderPermanentlyDeleteTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_permanently_delete") - return .dictionary(d) - case .teamFolderRename(let arg): - var d = Serialization.getFields(TeamLog.TeamFolderRenameTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_folder_rename") - return .dictionary(d) - case .teamSelectiveSyncSettingsChanged(let arg): - var d = Serialization.getFields(TeamLog.TeamSelectiveSyncSettingsChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_selective_sync_settings_changed") - return .dictionary(d) - case .accountCaptureChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.AccountCaptureChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("account_capture_change_policy") - return .dictionary(d) - case .adminEmailRemindersChanged(let arg): - var d = Serialization.getFields(TeamLog.AdminEmailRemindersChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("admin_email_reminders_changed") - return .dictionary(d) - case .allowDownloadDisabled(let arg): - var d = Serialization.getFields(TeamLog.AllowDownloadDisabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("allow_download_disabled") - return .dictionary(d) - case .allowDownloadEnabled(let arg): - var d = Serialization.getFields(TeamLog.AllowDownloadEnabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("allow_download_enabled") - return .dictionary(d) - case .appPermissionsChanged(let arg): - var d = Serialization.getFields(TeamLog.AppPermissionsChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("app_permissions_changed") - return .dictionary(d) - case .cameraUploadsPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.CameraUploadsPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("camera_uploads_policy_changed") - return .dictionary(d) - case .captureTranscriptPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.CaptureTranscriptPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("capture_transcript_policy_changed") - return .dictionary(d) - case .classificationChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.ClassificationChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("classification_change_policy") - return .dictionary(d) - case .computerBackupPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.ComputerBackupPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("computer_backup_policy_changed") - return .dictionary(d) - case .contentAdministrationPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.ContentAdministrationPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("content_administration_policy_changed") - return .dictionary(d) - case .dataPlacementRestrictionChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.DataPlacementRestrictionChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("data_placement_restriction_change_policy") - return .dictionary(d) - case .dataPlacementRestrictionSatisfyPolicy(let arg): - var d = Serialization.getFields(TeamLog.DataPlacementRestrictionSatisfyPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("data_placement_restriction_satisfy_policy") - return .dictionary(d) - case .deviceApprovalsAddException(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsAddExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_add_exception") - return .dictionary(d) - case .deviceApprovalsChangeDesktopPolicy(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeDesktopPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_desktop_policy") - return .dictionary(d) - case .deviceApprovalsChangeMobilePolicy(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeMobilePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_mobile_policy") - return .dictionary(d) - case .deviceApprovalsChangeOverageAction(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeOverageActionTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_overage_action") - return .dictionary(d) - case .deviceApprovalsChangeUnlinkAction(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsChangeUnlinkActionTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_change_unlink_action") - return .dictionary(d) - case .deviceApprovalsRemoveException(let arg): - var d = Serialization.getFields(TeamLog.DeviceApprovalsRemoveExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("device_approvals_remove_exception") - return .dictionary(d) - case .directoryRestrictionsAddMembers(let arg): - var d = Serialization.getFields(TeamLog.DirectoryRestrictionsAddMembersTypeSerializer().serialize(arg)) - d[".tag"] = .str("directory_restrictions_add_members") - return .dictionary(d) - case .directoryRestrictionsRemoveMembers(let arg): - var d = Serialization.getFields(TeamLog.DirectoryRestrictionsRemoveMembersTypeSerializer().serialize(arg)) - d[".tag"] = .str("directory_restrictions_remove_members") - return .dictionary(d) - case .dropboxPasswordsPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.DropboxPasswordsPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("dropbox_passwords_policy_changed") - return .dictionary(d) - case .emailIngestPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.EmailIngestPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("email_ingest_policy_changed") - return .dictionary(d) - case .emmAddException(let arg): - var d = Serialization.getFields(TeamLog.EmmAddExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("emm_add_exception") - return .dictionary(d) - case .emmChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.EmmChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("emm_change_policy") - return .dictionary(d) - case .emmRemoveException(let arg): - var d = Serialization.getFields(TeamLog.EmmRemoveExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("emm_remove_exception") - return .dictionary(d) - case .extendedVersionHistoryChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.ExtendedVersionHistoryChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("extended_version_history_change_policy") - return .dictionary(d) - case .externalDriveBackupPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.ExternalDriveBackupPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("external_drive_backup_policy_changed") - return .dictionary(d) - case .fileCommentsChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.FileCommentsChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_comments_change_policy") - return .dictionary(d) - case .fileLockingPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.FileLockingPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_locking_policy_changed") - return .dictionary(d) - case .fileProviderMigrationPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.FileProviderMigrationPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_provider_migration_policy_changed") - return .dictionary(d) - case .fileRequestsChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.FileRequestsChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_requests_change_policy") - return .dictionary(d) - case .fileRequestsEmailsEnabled(let arg): - var d = Serialization.getFields(TeamLog.FileRequestsEmailsEnabledTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_requests_emails_enabled") - return .dictionary(d) - case .fileRequestsEmailsRestrictedToTeamOnly(let arg): - var d = Serialization.getFields(TeamLog.FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_requests_emails_restricted_to_team_only") - return .dictionary(d) - case .fileTransfersPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.FileTransfersPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("file_transfers_policy_changed") - return .dictionary(d) - case .folderLinkRestrictionPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.FolderLinkRestrictionPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("folder_link_restriction_policy_changed") - return .dictionary(d) - case .googleSsoChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.GoogleSsoChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("google_sso_change_policy") - return .dictionary(d) - case .groupUserManagementChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.GroupUserManagementChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("group_user_management_change_policy") - return .dictionary(d) - case .integrationPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.IntegrationPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("integration_policy_changed") - return .dictionary(d) - case .inviteAcceptanceEmailPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.InviteAcceptanceEmailPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("invite_acceptance_email_policy_changed") - return .dictionary(d) - case .memberRequestsChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.MemberRequestsChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_requests_change_policy") - return .dictionary(d) - case .memberSendInvitePolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.MemberSendInvitePolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_send_invite_policy_changed") - return .dictionary(d) - case .memberSpaceLimitsAddException(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsAddExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_add_exception") - return .dictionary(d) - case .memberSpaceLimitsChangeCapsTypePolicy(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_caps_type_policy") - return .dictionary(d) - case .memberSpaceLimitsChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_change_policy") - return .dictionary(d) - case .memberSpaceLimitsRemoveException(let arg): - var d = Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_space_limits_remove_exception") - return .dictionary(d) - case .memberSuggestionsChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.MemberSuggestionsChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("member_suggestions_change_policy") - return .dictionary(d) - case .microsoftOfficeAddinChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.MicrosoftOfficeAddinChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("microsoft_office_addin_change_policy") - return .dictionary(d) - case .networkControlChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.NetworkControlChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("network_control_change_policy") - return .dictionary(d) - case .paperChangeDeploymentPolicy(let arg): - var d = Serialization.getFields(TeamLog.PaperChangeDeploymentPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_deployment_policy") - return .dictionary(d) - case .paperChangeMemberLinkPolicy(let arg): - var d = Serialization.getFields(TeamLog.PaperChangeMemberLinkPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_member_link_policy") - return .dictionary(d) - case .paperChangeMemberPolicy(let arg): - var d = Serialization.getFields(TeamLog.PaperChangeMemberPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_member_policy") - return .dictionary(d) - case .paperChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.PaperChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_change_policy") - return .dictionary(d) - case .paperDefaultFolderPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.PaperDefaultFolderPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_default_folder_policy_changed") - return .dictionary(d) - case .paperDesktopPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.PaperDesktopPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_desktop_policy_changed") - return .dictionary(d) - case .paperEnabledUsersGroupAddition(let arg): - var d = Serialization.getFields(TeamLog.PaperEnabledUsersGroupAdditionTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_enabled_users_group_addition") - return .dictionary(d) - case .paperEnabledUsersGroupRemoval(let arg): - var d = Serialization.getFields(TeamLog.PaperEnabledUsersGroupRemovalTypeSerializer().serialize(arg)) - d[".tag"] = .str("paper_enabled_users_group_removal") - return .dictionary(d) - case .passwordStrengthRequirementsChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.PasswordStrengthRequirementsChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("password_strength_requirements_change_policy") - return .dictionary(d) - case .permanentDeleteChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.PermanentDeleteChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("permanent_delete_change_policy") - return .dictionary(d) - case .resellerSupportChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.ResellerSupportChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("reseller_support_change_policy") - return .dictionary(d) - case .rewindPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.RewindPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("rewind_policy_changed") - return .dictionary(d) - case .sendForSignaturePolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.SendForSignaturePolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("send_for_signature_policy_changed") - return .dictionary(d) - case .sharingChangeFolderJoinPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeFolderJoinPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_folder_join_policy") - return .dictionary(d) - case .sharingChangeLinkAllowChangeExpirationPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_allow_change_expiration_policy") - return .dictionary(d) - case .sharingChangeLinkDefaultExpirationPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkDefaultExpirationPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_default_expiration_policy") - return .dictionary(d) - case .sharingChangeLinkEnforcePasswordPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkEnforcePasswordPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_enforce_password_policy") - return .dictionary(d) - case .sharingChangeLinkPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeLinkPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_link_policy") - return .dictionary(d) - case .sharingChangeMemberPolicy(let arg): - var d = Serialization.getFields(TeamLog.SharingChangeMemberPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("sharing_change_member_policy") - return .dictionary(d) - case .showcaseChangeDownloadPolicy(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseChangeDownloadPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_change_download_policy") - return .dictionary(d) - case .showcaseChangeEnabledPolicy(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseChangeEnabledPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_change_enabled_policy") - return .dictionary(d) - case .showcaseChangeExternalSharingPolicy(let arg): - var d = Serialization.getFields(TeamLog.ShowcaseChangeExternalSharingPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("showcase_change_external_sharing_policy") - return .dictionary(d) - case .smarterSmartSyncPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.SmarterSmartSyncPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("smarter_smart_sync_policy_changed") - return .dictionary(d) - case .smartSyncChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_change_policy") - return .dictionary(d) - case .smartSyncNotOptOut(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncNotOptOutTypeSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_not_opt_out") - return .dictionary(d) - case .smartSyncOptOut(let arg): - var d = Serialization.getFields(TeamLog.SmartSyncOptOutTypeSerializer().serialize(arg)) - d[".tag"] = .str("smart_sync_opt_out") - return .dictionary(d) - case .ssoChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.SsoChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("sso_change_policy") - return .dictionary(d) - case .teamBrandingPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.TeamBrandingPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_branding_policy_changed") - return .dictionary(d) - case .teamExtensionsPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.TeamExtensionsPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_extensions_policy_changed") - return .dictionary(d) - case .teamSelectiveSyncPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.TeamSelectiveSyncPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_selective_sync_policy_changed") - return .dictionary(d) - case .teamSharingWhitelistSubjectsChanged(let arg): - var d = Serialization.getFields(TeamLog.TeamSharingWhitelistSubjectsChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_sharing_whitelist_subjects_changed") - return .dictionary(d) - case .tfaAddException(let arg): - var d = Serialization.getFields(TeamLog.TfaAddExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_add_exception") - return .dictionary(d) - case .tfaChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.TfaChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_change_policy") - return .dictionary(d) - case .tfaRemoveException(let arg): - var d = Serialization.getFields(TeamLog.TfaRemoveExceptionTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_remove_exception") - return .dictionary(d) - case .twoAccountChangePolicy(let arg): - var d = Serialization.getFields(TeamLog.TwoAccountChangePolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("two_account_change_policy") - return .dictionary(d) - case .viewerInfoPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.ViewerInfoPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("viewer_info_policy_changed") - return .dictionary(d) - case .watermarkingPolicyChanged(let arg): - var d = Serialization.getFields(TeamLog.WatermarkingPolicyChangedTypeSerializer().serialize(arg)) - d[".tag"] = .str("watermarking_policy_changed") - return .dictionary(d) - case .webSessionsChangeActiveSessionLimit(let arg): - var d = Serialization.getFields(TeamLog.WebSessionsChangeActiveSessionLimitTypeSerializer().serialize(arg)) - d[".tag"] = .str("web_sessions_change_active_session_limit") - return .dictionary(d) - case .webSessionsChangeFixedLengthPolicy(let arg): - var d = Serialization.getFields(TeamLog.WebSessionsChangeFixedLengthPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("web_sessions_change_fixed_length_policy") - return .dictionary(d) - case .webSessionsChangeIdleLengthPolicy(let arg): - var d = Serialization.getFields(TeamLog.WebSessionsChangeIdleLengthPolicyTypeSerializer().serialize(arg)) - d[".tag"] = .str("web_sessions_change_idle_length_policy") - return .dictionary(d) - case .dataResidencyMigrationRequestSuccessful(let arg): - var d = Serialization.getFields(TeamLog.DataResidencyMigrationRequestSuccessfulTypeSerializer().serialize(arg)) - d[".tag"] = .str("data_residency_migration_request_successful") - return .dictionary(d) - case .dataResidencyMigrationRequestUnsuccessful(let arg): - var d = Serialization.getFields(TeamLog.DataResidencyMigrationRequestUnsuccessfulTypeSerializer().serialize(arg)) - d[".tag"] = .str("data_residency_migration_request_unsuccessful") - return .dictionary(d) - case .teamMergeFrom(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeFromTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_from") - return .dictionary(d) - case .teamMergeTo(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeToTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_to") - return .dictionary(d) - case .teamProfileAddBackground(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileAddBackgroundTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_add_background") - return .dictionary(d) - case .teamProfileAddLogo(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileAddLogoTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_add_logo") - return .dictionary(d) - case .teamProfileChangeBackground(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeBackgroundTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_background") - return .dictionary(d) - case .teamProfileChangeDefaultLanguage(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeDefaultLanguageTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_default_language") - return .dictionary(d) - case .teamProfileChangeLogo(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeLogoTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_logo") - return .dictionary(d) - case .teamProfileChangeName(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileChangeNameTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_change_name") - return .dictionary(d) - case .teamProfileRemoveBackground(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileRemoveBackgroundTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_remove_background") - return .dictionary(d) - case .teamProfileRemoveLogo(let arg): - var d = Serialization.getFields(TeamLog.TeamProfileRemoveLogoTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_profile_remove_logo") - return .dictionary(d) - case .tfaAddBackupPhone(let arg): - var d = Serialization.getFields(TeamLog.TfaAddBackupPhoneTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_add_backup_phone") - return .dictionary(d) - case .tfaAddSecurityKey(let arg): - var d = Serialization.getFields(TeamLog.TfaAddSecurityKeyTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_add_security_key") - return .dictionary(d) - case .tfaChangeBackupPhone(let arg): - var d = Serialization.getFields(TeamLog.TfaChangeBackupPhoneTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_change_backup_phone") - return .dictionary(d) - case .tfaChangeStatus(let arg): - var d = Serialization.getFields(TeamLog.TfaChangeStatusTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_change_status") - return .dictionary(d) - case .tfaRemoveBackupPhone(let arg): - var d = Serialization.getFields(TeamLog.TfaRemoveBackupPhoneTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_remove_backup_phone") - return .dictionary(d) - case .tfaRemoveSecurityKey(let arg): - var d = Serialization.getFields(TeamLog.TfaRemoveSecurityKeyTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_remove_security_key") - return .dictionary(d) - case .tfaReset(let arg): - var d = Serialization.getFields(TeamLog.TfaResetTypeSerializer().serialize(arg)) - d[".tag"] = .str("tfa_reset") - return .dictionary(d) - case .changedEnterpriseAdminRole(let arg): - var d = Serialization.getFields(TeamLog.ChangedEnterpriseAdminRoleTypeSerializer().serialize(arg)) - d[".tag"] = .str("changed_enterprise_admin_role") - return .dictionary(d) - case .changedEnterpriseConnectedTeamStatus(let arg): - var d = Serialization.getFields(TeamLog.ChangedEnterpriseConnectedTeamStatusTypeSerializer().serialize(arg)) - d[".tag"] = .str("changed_enterprise_connected_team_status") - return .dictionary(d) - case .endedEnterpriseAdminSession(let arg): - var d = Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionTypeSerializer().serialize(arg)) - d[".tag"] = .str("ended_enterprise_admin_session") - return .dictionary(d) - case .endedEnterpriseAdminSessionDeprecated(let arg): - var d = Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionDeprecatedTypeSerializer().serialize(arg)) - d[".tag"] = .str("ended_enterprise_admin_session_deprecated") - return .dictionary(d) - case .enterpriseSettingsLocking(let arg): - var d = Serialization.getFields(TeamLog.EnterpriseSettingsLockingTypeSerializer().serialize(arg)) - d[".tag"] = .str("enterprise_settings_locking") - return .dictionary(d) - case .guestAdminChangeStatus(let arg): - var d = Serialization.getFields(TeamLog.GuestAdminChangeStatusTypeSerializer().serialize(arg)) - d[".tag"] = .str("guest_admin_change_status") - return .dictionary(d) - case .startedEnterpriseAdminSession(let arg): - var d = Serialization.getFields(TeamLog.StartedEnterpriseAdminSessionTypeSerializer().serialize(arg)) - d[".tag"] = .str("started_enterprise_admin_session") - return .dictionary(d) - case .teamMergeRequestAccepted(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAcceptedTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_accepted") - return .dictionary(d) - case .teamMergeRequestAcceptedShownToPrimaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_accepted_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestAcceptedShownToSecondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_accepted_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestAutoCanceled(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestAutoCanceledTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_auto_canceled") - return .dictionary(d) - case .teamMergeRequestCanceled(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestCanceledTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_canceled") - return .dictionary(d) - case .teamMergeRequestCanceledShownToPrimaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_canceled_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestCanceledShownToSecondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_canceled_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestExpired(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestExpiredTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_expired") - return .dictionary(d) - case .teamMergeRequestExpiredShownToPrimaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_expired_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestExpiredShownToSecondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_expired_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestRejectedShownToPrimaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_rejected_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestRejectedShownToSecondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_rejected_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestReminder(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestReminderTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_reminder") - return .dictionary(d) - case .teamMergeRequestReminderShownToPrimaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_reminder_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestReminderShownToSecondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_reminder_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestRevoked(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestRevokedTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_revoked") - return .dictionary(d) - case .teamMergeRequestSentShownToPrimaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestSentShownToPrimaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_sent_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestSentShownToSecondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.TeamMergeRequestSentShownToSecondaryTeamTypeSerializer().serialize(arg)) - d[".tag"] = .str("team_merge_request_sent_shown_to_secondary_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> EventType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admin_alerting_alert_state_changed": - let v = TeamLog.AdminAlertingAlertStateChangedTypeSerializer().deserialize(json) - return EventType.adminAlertingAlertStateChanged(v) - case "admin_alerting_changed_alert_config": - let v = TeamLog.AdminAlertingChangedAlertConfigTypeSerializer().deserialize(json) - return EventType.adminAlertingChangedAlertConfig(v) - case "admin_alerting_triggered_alert": - let v = TeamLog.AdminAlertingTriggeredAlertTypeSerializer().deserialize(json) - return EventType.adminAlertingTriggeredAlert(v) - case "app_blocked_by_permissions": - let v = TeamLog.AppBlockedByPermissionsTypeSerializer().deserialize(json) - return EventType.appBlockedByPermissions(v) - case "app_link_team": - let v = TeamLog.AppLinkTeamTypeSerializer().deserialize(json) - return EventType.appLinkTeam(v) - case "app_link_user": - let v = TeamLog.AppLinkUserTypeSerializer().deserialize(json) - return EventType.appLinkUser(v) - case "app_unlink_team": - let v = TeamLog.AppUnlinkTeamTypeSerializer().deserialize(json) - return EventType.appUnlinkTeam(v) - case "app_unlink_user": - let v = TeamLog.AppUnlinkUserTypeSerializer().deserialize(json) - return EventType.appUnlinkUser(v) - case "integration_connected": - let v = TeamLog.IntegrationConnectedTypeSerializer().deserialize(json) - return EventType.integrationConnected(v) - case "integration_disconnected": - let v = TeamLog.IntegrationDisconnectedTypeSerializer().deserialize(json) - return EventType.integrationDisconnected(v) - case "file_add_comment": - let v = TeamLog.FileAddCommentTypeSerializer().deserialize(json) - return EventType.fileAddComment(v) - case "file_change_comment_subscription": - let v = TeamLog.FileChangeCommentSubscriptionTypeSerializer().deserialize(json) - return EventType.fileChangeCommentSubscription(v) - case "file_delete_comment": - let v = TeamLog.FileDeleteCommentTypeSerializer().deserialize(json) - return EventType.fileDeleteComment(v) - case "file_edit_comment": - let v = TeamLog.FileEditCommentTypeSerializer().deserialize(json) - return EventType.fileEditComment(v) - case "file_like_comment": - let v = TeamLog.FileLikeCommentTypeSerializer().deserialize(json) - return EventType.fileLikeComment(v) - case "file_resolve_comment": - let v = TeamLog.FileResolveCommentTypeSerializer().deserialize(json) - return EventType.fileResolveComment(v) - case "file_unlike_comment": - let v = TeamLog.FileUnlikeCommentTypeSerializer().deserialize(json) - return EventType.fileUnlikeComment(v) - case "file_unresolve_comment": - let v = TeamLog.FileUnresolveCommentTypeSerializer().deserialize(json) - return EventType.fileUnresolveComment(v) - case "governance_policy_add_folders": - let v = TeamLog.GovernancePolicyAddFoldersTypeSerializer().deserialize(json) - return EventType.governancePolicyAddFolders(v) - case "governance_policy_add_folder_failed": - let v = TeamLog.GovernancePolicyAddFolderFailedTypeSerializer().deserialize(json) - return EventType.governancePolicyAddFolderFailed(v) - case "governance_policy_content_disposed": - let v = TeamLog.GovernancePolicyContentDisposedTypeSerializer().deserialize(json) - return EventType.governancePolicyContentDisposed(v) - case "governance_policy_create": - let v = TeamLog.GovernancePolicyCreateTypeSerializer().deserialize(json) - return EventType.governancePolicyCreate(v) - case "governance_policy_delete": - let v = TeamLog.GovernancePolicyDeleteTypeSerializer().deserialize(json) - return EventType.governancePolicyDelete(v) - case "governance_policy_edit_details": - let v = TeamLog.GovernancePolicyEditDetailsTypeSerializer().deserialize(json) - return EventType.governancePolicyEditDetails(v) - case "governance_policy_edit_duration": - let v = TeamLog.GovernancePolicyEditDurationTypeSerializer().deserialize(json) - return EventType.governancePolicyEditDuration(v) - case "governance_policy_export_created": - let v = TeamLog.GovernancePolicyExportCreatedTypeSerializer().deserialize(json) - return EventType.governancePolicyExportCreated(v) - case "governance_policy_export_removed": - let v = TeamLog.GovernancePolicyExportRemovedTypeSerializer().deserialize(json) - return EventType.governancePolicyExportRemoved(v) - case "governance_policy_remove_folders": - let v = TeamLog.GovernancePolicyRemoveFoldersTypeSerializer().deserialize(json) - return EventType.governancePolicyRemoveFolders(v) - case "governance_policy_report_created": - let v = TeamLog.GovernancePolicyReportCreatedTypeSerializer().deserialize(json) - return EventType.governancePolicyReportCreated(v) - case "governance_policy_zip_part_downloaded": - let v = TeamLog.GovernancePolicyZipPartDownloadedTypeSerializer().deserialize(json) - return EventType.governancePolicyZipPartDownloaded(v) - case "legal_holds_activate_a_hold": - let v = TeamLog.LegalHoldsActivateAHoldTypeSerializer().deserialize(json) - return EventType.legalHoldsActivateAHold(v) - case "legal_holds_add_members": - let v = TeamLog.LegalHoldsAddMembersTypeSerializer().deserialize(json) - return EventType.legalHoldsAddMembers(v) - case "legal_holds_change_hold_details": - let v = TeamLog.LegalHoldsChangeHoldDetailsTypeSerializer().deserialize(json) - return EventType.legalHoldsChangeHoldDetails(v) - case "legal_holds_change_hold_name": - let v = TeamLog.LegalHoldsChangeHoldNameTypeSerializer().deserialize(json) - return EventType.legalHoldsChangeHoldName(v) - case "legal_holds_export_a_hold": - let v = TeamLog.LegalHoldsExportAHoldTypeSerializer().deserialize(json) - return EventType.legalHoldsExportAHold(v) - case "legal_holds_export_cancelled": - let v = TeamLog.LegalHoldsExportCancelledTypeSerializer().deserialize(json) - return EventType.legalHoldsExportCancelled(v) - case "legal_holds_export_downloaded": - let v = TeamLog.LegalHoldsExportDownloadedTypeSerializer().deserialize(json) - return EventType.legalHoldsExportDownloaded(v) - case "legal_holds_export_removed": - let v = TeamLog.LegalHoldsExportRemovedTypeSerializer().deserialize(json) - return EventType.legalHoldsExportRemoved(v) - case "legal_holds_release_a_hold": - let v = TeamLog.LegalHoldsReleaseAHoldTypeSerializer().deserialize(json) - return EventType.legalHoldsReleaseAHold(v) - case "legal_holds_remove_members": - let v = TeamLog.LegalHoldsRemoveMembersTypeSerializer().deserialize(json) - return EventType.legalHoldsRemoveMembers(v) - case "legal_holds_report_a_hold": - let v = TeamLog.LegalHoldsReportAHoldTypeSerializer().deserialize(json) - return EventType.legalHoldsReportAHold(v) - case "device_change_ip_desktop": - let v = TeamLog.DeviceChangeIpDesktopTypeSerializer().deserialize(json) - return EventType.deviceChangeIpDesktop(v) - case "device_change_ip_mobile": - let v = TeamLog.DeviceChangeIpMobileTypeSerializer().deserialize(json) - return EventType.deviceChangeIpMobile(v) - case "device_change_ip_web": - let v = TeamLog.DeviceChangeIpWebTypeSerializer().deserialize(json) - return EventType.deviceChangeIpWeb(v) - case "device_delete_on_unlink_fail": - let v = TeamLog.DeviceDeleteOnUnlinkFailTypeSerializer().deserialize(json) - return EventType.deviceDeleteOnUnlinkFail(v) - case "device_delete_on_unlink_success": - let v = TeamLog.DeviceDeleteOnUnlinkSuccessTypeSerializer().deserialize(json) - return EventType.deviceDeleteOnUnlinkSuccess(v) - case "device_link_fail": - let v = TeamLog.DeviceLinkFailTypeSerializer().deserialize(json) - return EventType.deviceLinkFail(v) - case "device_link_success": - let v = TeamLog.DeviceLinkSuccessTypeSerializer().deserialize(json) - return EventType.deviceLinkSuccess(v) - case "device_management_disabled": - let v = TeamLog.DeviceManagementDisabledTypeSerializer().deserialize(json) - return EventType.deviceManagementDisabled(v) - case "device_management_enabled": - let v = TeamLog.DeviceManagementEnabledTypeSerializer().deserialize(json) - return EventType.deviceManagementEnabled(v) - case "device_sync_backup_status_changed": - let v = TeamLog.DeviceSyncBackupStatusChangedTypeSerializer().deserialize(json) - return EventType.deviceSyncBackupStatusChanged(v) - case "device_unlink": - let v = TeamLog.DeviceUnlinkTypeSerializer().deserialize(json) - return EventType.deviceUnlink(v) - case "dropbox_passwords_exported": - let v = TeamLog.DropboxPasswordsExportedTypeSerializer().deserialize(json) - return EventType.dropboxPasswordsExported(v) - case "dropbox_passwords_new_device_enrolled": - let v = TeamLog.DropboxPasswordsNewDeviceEnrolledTypeSerializer().deserialize(json) - return EventType.dropboxPasswordsNewDeviceEnrolled(v) - case "emm_refresh_auth_token": - let v = TeamLog.EmmRefreshAuthTokenTypeSerializer().deserialize(json) - return EventType.emmRefreshAuthToken(v) - case "external_drive_backup_eligibility_status_checked": - let v = TeamLog.ExternalDriveBackupEligibilityStatusCheckedTypeSerializer().deserialize(json) - return EventType.externalDriveBackupEligibilityStatusChecked(v) - case "external_drive_backup_status_changed": - let v = TeamLog.ExternalDriveBackupStatusChangedTypeSerializer().deserialize(json) - return EventType.externalDriveBackupStatusChanged(v) - case "account_capture_change_availability": - let v = TeamLog.AccountCaptureChangeAvailabilityTypeSerializer().deserialize(json) - return EventType.accountCaptureChangeAvailability(v) - case "account_capture_migrate_account": - let v = TeamLog.AccountCaptureMigrateAccountTypeSerializer().deserialize(json) - return EventType.accountCaptureMigrateAccount(v) - case "account_capture_notification_emails_sent": - let v = TeamLog.AccountCaptureNotificationEmailsSentTypeSerializer().deserialize(json) - return EventType.accountCaptureNotificationEmailsSent(v) - case "account_capture_relinquish_account": - let v = TeamLog.AccountCaptureRelinquishAccountTypeSerializer().deserialize(json) - return EventType.accountCaptureRelinquishAccount(v) - case "disabled_domain_invites": - let v = TeamLog.DisabledDomainInvitesTypeSerializer().deserialize(json) - return EventType.disabledDomainInvites(v) - case "domain_invites_approve_request_to_join_team": - let v = TeamLog.DomainInvitesApproveRequestToJoinTeamTypeSerializer().deserialize(json) - return EventType.domainInvitesApproveRequestToJoinTeam(v) - case "domain_invites_decline_request_to_join_team": - let v = TeamLog.DomainInvitesDeclineRequestToJoinTeamTypeSerializer().deserialize(json) - return EventType.domainInvitesDeclineRequestToJoinTeam(v) - case "domain_invites_email_existing_users": - let v = TeamLog.DomainInvitesEmailExistingUsersTypeSerializer().deserialize(json) - return EventType.domainInvitesEmailExistingUsers(v) - case "domain_invites_request_to_join_team": - let v = TeamLog.DomainInvitesRequestToJoinTeamTypeSerializer().deserialize(json) - return EventType.domainInvitesRequestToJoinTeam(v) - case "domain_invites_set_invite_new_user_pref_to_no": - let v = TeamLog.DomainInvitesSetInviteNewUserPrefToNoTypeSerializer().deserialize(json) - return EventType.domainInvitesSetInviteNewUserPrefToNo(v) - case "domain_invites_set_invite_new_user_pref_to_yes": - let v = TeamLog.DomainInvitesSetInviteNewUserPrefToYesTypeSerializer().deserialize(json) - return EventType.domainInvitesSetInviteNewUserPrefToYes(v) - case "domain_verification_add_domain_fail": - let v = TeamLog.DomainVerificationAddDomainFailTypeSerializer().deserialize(json) - return EventType.domainVerificationAddDomainFail(v) - case "domain_verification_add_domain_success": - let v = TeamLog.DomainVerificationAddDomainSuccessTypeSerializer().deserialize(json) - return EventType.domainVerificationAddDomainSuccess(v) - case "domain_verification_remove_domain": - let v = TeamLog.DomainVerificationRemoveDomainTypeSerializer().deserialize(json) - return EventType.domainVerificationRemoveDomain(v) - case "enabled_domain_invites": - let v = TeamLog.EnabledDomainInvitesTypeSerializer().deserialize(json) - return EventType.enabledDomainInvites(v) - case "apply_naming_convention": - let v = TeamLog.ApplyNamingConventionTypeSerializer().deserialize(json) - return EventType.applyNamingConvention(v) - case "create_folder": - let v = TeamLog.CreateFolderTypeSerializer().deserialize(json) - return EventType.createFolder(v) - case "file_add": - let v = TeamLog.FileAddTypeSerializer().deserialize(json) - return EventType.fileAdd(v) - case "file_copy": - let v = TeamLog.FileCopyTypeSerializer().deserialize(json) - return EventType.fileCopy(v) - case "file_delete": - let v = TeamLog.FileDeleteTypeSerializer().deserialize(json) - return EventType.fileDelete(v) - case "file_download": - let v = TeamLog.FileDownloadTypeSerializer().deserialize(json) - return EventType.fileDownload(v) - case "file_edit": - let v = TeamLog.FileEditTypeSerializer().deserialize(json) - return EventType.fileEdit(v) - case "file_get_copy_reference": - let v = TeamLog.FileGetCopyReferenceTypeSerializer().deserialize(json) - return EventType.fileGetCopyReference(v) - case "file_locking_lock_status_changed": - let v = TeamLog.FileLockingLockStatusChangedTypeSerializer().deserialize(json) - return EventType.fileLockingLockStatusChanged(v) - case "file_move": - let v = TeamLog.FileMoveTypeSerializer().deserialize(json) - return EventType.fileMove(v) - case "file_permanently_delete": - let v = TeamLog.FilePermanentlyDeleteTypeSerializer().deserialize(json) - return EventType.filePermanentlyDelete(v) - case "file_preview": - let v = TeamLog.FilePreviewTypeSerializer().deserialize(json) - return EventType.filePreview(v) - case "file_rename": - let v = TeamLog.FileRenameTypeSerializer().deserialize(json) - return EventType.fileRename(v) - case "file_restore": - let v = TeamLog.FileRestoreTypeSerializer().deserialize(json) - return EventType.fileRestore(v) - case "file_revert": - let v = TeamLog.FileRevertTypeSerializer().deserialize(json) - return EventType.fileRevert(v) - case "file_rollback_changes": - let v = TeamLog.FileRollbackChangesTypeSerializer().deserialize(json) - return EventType.fileRollbackChanges(v) - case "file_save_copy_reference": - let v = TeamLog.FileSaveCopyReferenceTypeSerializer().deserialize(json) - return EventType.fileSaveCopyReference(v) - case "folder_overview_description_changed": - let v = TeamLog.FolderOverviewDescriptionChangedTypeSerializer().deserialize(json) - return EventType.folderOverviewDescriptionChanged(v) - case "folder_overview_item_pinned": - let v = TeamLog.FolderOverviewItemPinnedTypeSerializer().deserialize(json) - return EventType.folderOverviewItemPinned(v) - case "folder_overview_item_unpinned": - let v = TeamLog.FolderOverviewItemUnpinnedTypeSerializer().deserialize(json) - return EventType.folderOverviewItemUnpinned(v) - case "object_label_added": - let v = TeamLog.ObjectLabelAddedTypeSerializer().deserialize(json) - return EventType.objectLabelAdded(v) - case "object_label_removed": - let v = TeamLog.ObjectLabelRemovedTypeSerializer().deserialize(json) - return EventType.objectLabelRemoved(v) - case "object_label_updated_value": - let v = TeamLog.ObjectLabelUpdatedValueTypeSerializer().deserialize(json) - return EventType.objectLabelUpdatedValue(v) - case "organize_folder_with_tidy": - let v = TeamLog.OrganizeFolderWithTidyTypeSerializer().deserialize(json) - return EventType.organizeFolderWithTidy(v) - case "rewind_folder": - let v = TeamLog.RewindFolderTypeSerializer().deserialize(json) - return EventType.rewindFolder(v) - case "undo_naming_convention": - let v = TeamLog.UndoNamingConventionTypeSerializer().deserialize(json) - return EventType.undoNamingConvention(v) - case "undo_organize_folder_with_tidy": - let v = TeamLog.UndoOrganizeFolderWithTidyTypeSerializer().deserialize(json) - return EventType.undoOrganizeFolderWithTidy(v) - case "user_tags_added": - let v = TeamLog.UserTagsAddedTypeSerializer().deserialize(json) - return EventType.userTagsAdded(v) - case "user_tags_removed": - let v = TeamLog.UserTagsRemovedTypeSerializer().deserialize(json) - return EventType.userTagsRemoved(v) - case "email_ingest_receive_file": - let v = TeamLog.EmailIngestReceiveFileTypeSerializer().deserialize(json) - return EventType.emailIngestReceiveFile(v) - case "file_request_change": - let v = TeamLog.FileRequestChangeTypeSerializer().deserialize(json) - return EventType.fileRequestChange(v) - case "file_request_close": - let v = TeamLog.FileRequestCloseTypeSerializer().deserialize(json) - return EventType.fileRequestClose(v) - case "file_request_create": - let v = TeamLog.FileRequestCreateTypeSerializer().deserialize(json) - return EventType.fileRequestCreate(v) - case "file_request_delete": - let v = TeamLog.FileRequestDeleteTypeSerializer().deserialize(json) - return EventType.fileRequestDelete(v) - case "file_request_receive_file": - let v = TeamLog.FileRequestReceiveFileTypeSerializer().deserialize(json) - return EventType.fileRequestReceiveFile(v) - case "group_add_external_id": - let v = TeamLog.GroupAddExternalIdTypeSerializer().deserialize(json) - return EventType.groupAddExternalId(v) - case "group_add_member": - let v = TeamLog.GroupAddMemberTypeSerializer().deserialize(json) - return EventType.groupAddMember(v) - case "group_change_external_id": - let v = TeamLog.GroupChangeExternalIdTypeSerializer().deserialize(json) - return EventType.groupChangeExternalId(v) - case "group_change_management_type": - let v = TeamLog.GroupChangeManagementTypeTypeSerializer().deserialize(json) - return EventType.groupChangeManagementType(v) - case "group_change_member_role": - let v = TeamLog.GroupChangeMemberRoleTypeSerializer().deserialize(json) - return EventType.groupChangeMemberRole(v) - case "group_create": - let v = TeamLog.GroupCreateTypeSerializer().deserialize(json) - return EventType.groupCreate(v) - case "group_delete": - let v = TeamLog.GroupDeleteTypeSerializer().deserialize(json) - return EventType.groupDelete(v) - case "group_description_updated": - let v = TeamLog.GroupDescriptionUpdatedTypeSerializer().deserialize(json) - return EventType.groupDescriptionUpdated(v) - case "group_join_policy_updated": - let v = TeamLog.GroupJoinPolicyUpdatedTypeSerializer().deserialize(json) - return EventType.groupJoinPolicyUpdated(v) - case "group_moved": - let v = TeamLog.GroupMovedTypeSerializer().deserialize(json) - return EventType.groupMoved(v) - case "group_remove_external_id": - let v = TeamLog.GroupRemoveExternalIdTypeSerializer().deserialize(json) - return EventType.groupRemoveExternalId(v) - case "group_remove_member": - let v = TeamLog.GroupRemoveMemberTypeSerializer().deserialize(json) - return EventType.groupRemoveMember(v) - case "group_rename": - let v = TeamLog.GroupRenameTypeSerializer().deserialize(json) - return EventType.groupRename(v) - case "account_lock_or_unlocked": - let v = TeamLog.AccountLockOrUnlockedTypeSerializer().deserialize(json) - return EventType.accountLockOrUnlocked(v) - case "emm_error": - let v = TeamLog.EmmErrorTypeSerializer().deserialize(json) - return EventType.emmError(v) - case "guest_admin_signed_in_via_trusted_teams": - let v = TeamLog.GuestAdminSignedInViaTrustedTeamsTypeSerializer().deserialize(json) - return EventType.guestAdminSignedInViaTrustedTeams(v) - case "guest_admin_signed_out_via_trusted_teams": - let v = TeamLog.GuestAdminSignedOutViaTrustedTeamsTypeSerializer().deserialize(json) - return EventType.guestAdminSignedOutViaTrustedTeams(v) - case "login_fail": - let v = TeamLog.LoginFailTypeSerializer().deserialize(json) - return EventType.loginFail(v) - case "login_success": - let v = TeamLog.LoginSuccessTypeSerializer().deserialize(json) - return EventType.loginSuccess(v) - case "logout": - let v = TeamLog.LogoutTypeSerializer().deserialize(json) - return EventType.logout(v) - case "reseller_support_session_end": - let v = TeamLog.ResellerSupportSessionEndTypeSerializer().deserialize(json) - return EventType.resellerSupportSessionEnd(v) - case "reseller_support_session_start": - let v = TeamLog.ResellerSupportSessionStartTypeSerializer().deserialize(json) - return EventType.resellerSupportSessionStart(v) - case "sign_in_as_session_end": - let v = TeamLog.SignInAsSessionEndTypeSerializer().deserialize(json) - return EventType.signInAsSessionEnd(v) - case "sign_in_as_session_start": - let v = TeamLog.SignInAsSessionStartTypeSerializer().deserialize(json) - return EventType.signInAsSessionStart(v) - case "sso_error": - let v = TeamLog.SsoErrorTypeSerializer().deserialize(json) - return EventType.ssoError(v) - case "create_team_invite_link": - let v = TeamLog.CreateTeamInviteLinkTypeSerializer().deserialize(json) - return EventType.createTeamInviteLink(v) - case "delete_team_invite_link": - let v = TeamLog.DeleteTeamInviteLinkTypeSerializer().deserialize(json) - return EventType.deleteTeamInviteLink(v) - case "member_add_external_id": - let v = TeamLog.MemberAddExternalIdTypeSerializer().deserialize(json) - return EventType.memberAddExternalId(v) - case "member_add_name": - let v = TeamLog.MemberAddNameTypeSerializer().deserialize(json) - return EventType.memberAddName(v) - case "member_change_admin_role": - let v = TeamLog.MemberChangeAdminRoleTypeSerializer().deserialize(json) - return EventType.memberChangeAdminRole(v) - case "member_change_email": - let v = TeamLog.MemberChangeEmailTypeSerializer().deserialize(json) - return EventType.memberChangeEmail(v) - case "member_change_external_id": - let v = TeamLog.MemberChangeExternalIdTypeSerializer().deserialize(json) - return EventType.memberChangeExternalId(v) - case "member_change_membership_type": - let v = TeamLog.MemberChangeMembershipTypeTypeSerializer().deserialize(json) - return EventType.memberChangeMembershipType(v) - case "member_change_name": - let v = TeamLog.MemberChangeNameTypeSerializer().deserialize(json) - return EventType.memberChangeName(v) - case "member_change_reseller_role": - let v = TeamLog.MemberChangeResellerRoleTypeSerializer().deserialize(json) - return EventType.memberChangeResellerRole(v) - case "member_change_status": - let v = TeamLog.MemberChangeStatusTypeSerializer().deserialize(json) - return EventType.memberChangeStatus(v) - case "member_delete_manual_contacts": - let v = TeamLog.MemberDeleteManualContactsTypeSerializer().deserialize(json) - return EventType.memberDeleteManualContacts(v) - case "member_delete_profile_photo": - let v = TeamLog.MemberDeleteProfilePhotoTypeSerializer().deserialize(json) - return EventType.memberDeleteProfilePhoto(v) - case "member_permanently_delete_account_contents": - let v = TeamLog.MemberPermanentlyDeleteAccountContentsTypeSerializer().deserialize(json) - return EventType.memberPermanentlyDeleteAccountContents(v) - case "member_remove_external_id": - let v = TeamLog.MemberRemoveExternalIdTypeSerializer().deserialize(json) - return EventType.memberRemoveExternalId(v) - case "member_set_profile_photo": - let v = TeamLog.MemberSetProfilePhotoTypeSerializer().deserialize(json) - return EventType.memberSetProfilePhoto(v) - case "member_space_limits_add_custom_quota": - let v = TeamLog.MemberSpaceLimitsAddCustomQuotaTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsAddCustomQuota(v) - case "member_space_limits_change_custom_quota": - let v = TeamLog.MemberSpaceLimitsChangeCustomQuotaTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsChangeCustomQuota(v) - case "member_space_limits_change_status": - let v = TeamLog.MemberSpaceLimitsChangeStatusTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsChangeStatus(v) - case "member_space_limits_remove_custom_quota": - let v = TeamLog.MemberSpaceLimitsRemoveCustomQuotaTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsRemoveCustomQuota(v) - case "member_suggest": - let v = TeamLog.MemberSuggestTypeSerializer().deserialize(json) - return EventType.memberSuggest(v) - case "member_transfer_account_contents": - let v = TeamLog.MemberTransferAccountContentsTypeSerializer().deserialize(json) - return EventType.memberTransferAccountContents(v) - case "pending_secondary_email_added": - let v = TeamLog.PendingSecondaryEmailAddedTypeSerializer().deserialize(json) - return EventType.pendingSecondaryEmailAdded(v) - case "secondary_email_deleted": - let v = TeamLog.SecondaryEmailDeletedTypeSerializer().deserialize(json) - return EventType.secondaryEmailDeleted(v) - case "secondary_email_verified": - let v = TeamLog.SecondaryEmailVerifiedTypeSerializer().deserialize(json) - return EventType.secondaryEmailVerified(v) - case "secondary_mails_policy_changed": - let v = TeamLog.SecondaryMailsPolicyChangedTypeSerializer().deserialize(json) - return EventType.secondaryMailsPolicyChanged(v) - case "binder_add_page": - let v = TeamLog.BinderAddPageTypeSerializer().deserialize(json) - return EventType.binderAddPage(v) - case "binder_add_section": - let v = TeamLog.BinderAddSectionTypeSerializer().deserialize(json) - return EventType.binderAddSection(v) - case "binder_remove_page": - let v = TeamLog.BinderRemovePageTypeSerializer().deserialize(json) - return EventType.binderRemovePage(v) - case "binder_remove_section": - let v = TeamLog.BinderRemoveSectionTypeSerializer().deserialize(json) - return EventType.binderRemoveSection(v) - case "binder_rename_page": - let v = TeamLog.BinderRenamePageTypeSerializer().deserialize(json) - return EventType.binderRenamePage(v) - case "binder_rename_section": - let v = TeamLog.BinderRenameSectionTypeSerializer().deserialize(json) - return EventType.binderRenameSection(v) - case "binder_reorder_page": - let v = TeamLog.BinderReorderPageTypeSerializer().deserialize(json) - return EventType.binderReorderPage(v) - case "binder_reorder_section": - let v = TeamLog.BinderReorderSectionTypeSerializer().deserialize(json) - return EventType.binderReorderSection(v) - case "paper_content_add_member": - let v = TeamLog.PaperContentAddMemberTypeSerializer().deserialize(json) - return EventType.paperContentAddMember(v) - case "paper_content_add_to_folder": - let v = TeamLog.PaperContentAddToFolderTypeSerializer().deserialize(json) - return EventType.paperContentAddToFolder(v) - case "paper_content_archive": - let v = TeamLog.PaperContentArchiveTypeSerializer().deserialize(json) - return EventType.paperContentArchive(v) - case "paper_content_create": - let v = TeamLog.PaperContentCreateTypeSerializer().deserialize(json) - return EventType.paperContentCreate(v) - case "paper_content_permanently_delete": - let v = TeamLog.PaperContentPermanentlyDeleteTypeSerializer().deserialize(json) - return EventType.paperContentPermanentlyDelete(v) - case "paper_content_remove_from_folder": - let v = TeamLog.PaperContentRemoveFromFolderTypeSerializer().deserialize(json) - return EventType.paperContentRemoveFromFolder(v) - case "paper_content_remove_member": - let v = TeamLog.PaperContentRemoveMemberTypeSerializer().deserialize(json) - return EventType.paperContentRemoveMember(v) - case "paper_content_rename": - let v = TeamLog.PaperContentRenameTypeSerializer().deserialize(json) - return EventType.paperContentRename(v) - case "paper_content_restore": - let v = TeamLog.PaperContentRestoreTypeSerializer().deserialize(json) - return EventType.paperContentRestore(v) - case "paper_doc_add_comment": - let v = TeamLog.PaperDocAddCommentTypeSerializer().deserialize(json) - return EventType.paperDocAddComment(v) - case "paper_doc_change_member_role": - let v = TeamLog.PaperDocChangeMemberRoleTypeSerializer().deserialize(json) - return EventType.paperDocChangeMemberRole(v) - case "paper_doc_change_sharing_policy": - let v = TeamLog.PaperDocChangeSharingPolicyTypeSerializer().deserialize(json) - return EventType.paperDocChangeSharingPolicy(v) - case "paper_doc_change_subscription": - let v = TeamLog.PaperDocChangeSubscriptionTypeSerializer().deserialize(json) - return EventType.paperDocChangeSubscription(v) - case "paper_doc_deleted": - let v = TeamLog.PaperDocDeletedTypeSerializer().deserialize(json) - return EventType.paperDocDeleted(v) - case "paper_doc_delete_comment": - let v = TeamLog.PaperDocDeleteCommentTypeSerializer().deserialize(json) - return EventType.paperDocDeleteComment(v) - case "paper_doc_download": - let v = TeamLog.PaperDocDownloadTypeSerializer().deserialize(json) - return EventType.paperDocDownload(v) - case "paper_doc_edit": - let v = TeamLog.PaperDocEditTypeSerializer().deserialize(json) - return EventType.paperDocEdit(v) - case "paper_doc_edit_comment": - let v = TeamLog.PaperDocEditCommentTypeSerializer().deserialize(json) - return EventType.paperDocEditComment(v) - case "paper_doc_followed": - let v = TeamLog.PaperDocFollowedTypeSerializer().deserialize(json) - return EventType.paperDocFollowed(v) - case "paper_doc_mention": - let v = TeamLog.PaperDocMentionTypeSerializer().deserialize(json) - return EventType.paperDocMention(v) - case "paper_doc_ownership_changed": - let v = TeamLog.PaperDocOwnershipChangedTypeSerializer().deserialize(json) - return EventType.paperDocOwnershipChanged(v) - case "paper_doc_request_access": - let v = TeamLog.PaperDocRequestAccessTypeSerializer().deserialize(json) - return EventType.paperDocRequestAccess(v) - case "paper_doc_resolve_comment": - let v = TeamLog.PaperDocResolveCommentTypeSerializer().deserialize(json) - return EventType.paperDocResolveComment(v) - case "paper_doc_revert": - let v = TeamLog.PaperDocRevertTypeSerializer().deserialize(json) - return EventType.paperDocRevert(v) - case "paper_doc_slack_share": - let v = TeamLog.PaperDocSlackShareTypeSerializer().deserialize(json) - return EventType.paperDocSlackShare(v) - case "paper_doc_team_invite": - let v = TeamLog.PaperDocTeamInviteTypeSerializer().deserialize(json) - return EventType.paperDocTeamInvite(v) - case "paper_doc_trashed": - let v = TeamLog.PaperDocTrashedTypeSerializer().deserialize(json) - return EventType.paperDocTrashed(v) - case "paper_doc_unresolve_comment": - let v = TeamLog.PaperDocUnresolveCommentTypeSerializer().deserialize(json) - return EventType.paperDocUnresolveComment(v) - case "paper_doc_untrashed": - let v = TeamLog.PaperDocUntrashedTypeSerializer().deserialize(json) - return EventType.paperDocUntrashed(v) - case "paper_doc_view": - let v = TeamLog.PaperDocViewTypeSerializer().deserialize(json) - return EventType.paperDocView(v) - case "paper_external_view_allow": - let v = TeamLog.PaperExternalViewAllowTypeSerializer().deserialize(json) - return EventType.paperExternalViewAllow(v) - case "paper_external_view_default_team": - let v = TeamLog.PaperExternalViewDefaultTeamTypeSerializer().deserialize(json) - return EventType.paperExternalViewDefaultTeam(v) - case "paper_external_view_forbid": - let v = TeamLog.PaperExternalViewForbidTypeSerializer().deserialize(json) - return EventType.paperExternalViewForbid(v) - case "paper_folder_change_subscription": - let v = TeamLog.PaperFolderChangeSubscriptionTypeSerializer().deserialize(json) - return EventType.paperFolderChangeSubscription(v) - case "paper_folder_deleted": - let v = TeamLog.PaperFolderDeletedTypeSerializer().deserialize(json) - return EventType.paperFolderDeleted(v) - case "paper_folder_followed": - let v = TeamLog.PaperFolderFollowedTypeSerializer().deserialize(json) - return EventType.paperFolderFollowed(v) - case "paper_folder_team_invite": - let v = TeamLog.PaperFolderTeamInviteTypeSerializer().deserialize(json) - return EventType.paperFolderTeamInvite(v) - case "paper_published_link_change_permission": - let v = TeamLog.PaperPublishedLinkChangePermissionTypeSerializer().deserialize(json) - return EventType.paperPublishedLinkChangePermission(v) - case "paper_published_link_create": - let v = TeamLog.PaperPublishedLinkCreateTypeSerializer().deserialize(json) - return EventType.paperPublishedLinkCreate(v) - case "paper_published_link_disabled": - let v = TeamLog.PaperPublishedLinkDisabledTypeSerializer().deserialize(json) - return EventType.paperPublishedLinkDisabled(v) - case "paper_published_link_view": - let v = TeamLog.PaperPublishedLinkViewTypeSerializer().deserialize(json) - return EventType.paperPublishedLinkView(v) - case "password_change": - let v = TeamLog.PasswordChangeTypeSerializer().deserialize(json) - return EventType.passwordChange(v) - case "password_reset": - let v = TeamLog.PasswordResetTypeSerializer().deserialize(json) - return EventType.passwordReset(v) - case "password_reset_all": - let v = TeamLog.PasswordResetAllTypeSerializer().deserialize(json) - return EventType.passwordResetAll(v) - case "classification_create_report": - let v = TeamLog.ClassificationCreateReportTypeSerializer().deserialize(json) - return EventType.classificationCreateReport(v) - case "classification_create_report_fail": - let v = TeamLog.ClassificationCreateReportFailTypeSerializer().deserialize(json) - return EventType.classificationCreateReportFail(v) - case "emm_create_exceptions_report": - let v = TeamLog.EmmCreateExceptionsReportTypeSerializer().deserialize(json) - return EventType.emmCreateExceptionsReport(v) - case "emm_create_usage_report": - let v = TeamLog.EmmCreateUsageReportTypeSerializer().deserialize(json) - return EventType.emmCreateUsageReport(v) - case "export_members_report": - let v = TeamLog.ExportMembersReportTypeSerializer().deserialize(json) - return EventType.exportMembersReport(v) - case "export_members_report_fail": - let v = TeamLog.ExportMembersReportFailTypeSerializer().deserialize(json) - return EventType.exportMembersReportFail(v) - case "external_sharing_create_report": - let v = TeamLog.ExternalSharingCreateReportTypeSerializer().deserialize(json) - return EventType.externalSharingCreateReport(v) - case "external_sharing_report_failed": - let v = TeamLog.ExternalSharingReportFailedTypeSerializer().deserialize(json) - return EventType.externalSharingReportFailed(v) - case "no_expiration_link_gen_create_report": - let v = TeamLog.NoExpirationLinkGenCreateReportTypeSerializer().deserialize(json) - return EventType.noExpirationLinkGenCreateReport(v) - case "no_expiration_link_gen_report_failed": - let v = TeamLog.NoExpirationLinkGenReportFailedTypeSerializer().deserialize(json) - return EventType.noExpirationLinkGenReportFailed(v) - case "no_password_link_gen_create_report": - let v = TeamLog.NoPasswordLinkGenCreateReportTypeSerializer().deserialize(json) - return EventType.noPasswordLinkGenCreateReport(v) - case "no_password_link_gen_report_failed": - let v = TeamLog.NoPasswordLinkGenReportFailedTypeSerializer().deserialize(json) - return EventType.noPasswordLinkGenReportFailed(v) - case "no_password_link_view_create_report": - let v = TeamLog.NoPasswordLinkViewCreateReportTypeSerializer().deserialize(json) - return EventType.noPasswordLinkViewCreateReport(v) - case "no_password_link_view_report_failed": - let v = TeamLog.NoPasswordLinkViewReportFailedTypeSerializer().deserialize(json) - return EventType.noPasswordLinkViewReportFailed(v) - case "outdated_link_view_create_report": - let v = TeamLog.OutdatedLinkViewCreateReportTypeSerializer().deserialize(json) - return EventType.outdatedLinkViewCreateReport(v) - case "outdated_link_view_report_failed": - let v = TeamLog.OutdatedLinkViewReportFailedTypeSerializer().deserialize(json) - return EventType.outdatedLinkViewReportFailed(v) - case "paper_admin_export_start": - let v = TeamLog.PaperAdminExportStartTypeSerializer().deserialize(json) - return EventType.paperAdminExportStart(v) - case "smart_sync_create_admin_privilege_report": - let v = TeamLog.SmartSyncCreateAdminPrivilegeReportTypeSerializer().deserialize(json) - return EventType.smartSyncCreateAdminPrivilegeReport(v) - case "team_activity_create_report": - let v = TeamLog.TeamActivityCreateReportTypeSerializer().deserialize(json) - return EventType.teamActivityCreateReport(v) - case "team_activity_create_report_fail": - let v = TeamLog.TeamActivityCreateReportFailTypeSerializer().deserialize(json) - return EventType.teamActivityCreateReportFail(v) - case "collection_share": - let v = TeamLog.CollectionShareTypeSerializer().deserialize(json) - return EventType.collectionShare(v) - case "file_transfers_file_add": - let v = TeamLog.FileTransfersFileAddTypeSerializer().deserialize(json) - return EventType.fileTransfersFileAdd(v) - case "file_transfers_transfer_delete": - let v = TeamLog.FileTransfersTransferDeleteTypeSerializer().deserialize(json) - return EventType.fileTransfersTransferDelete(v) - case "file_transfers_transfer_download": - let v = TeamLog.FileTransfersTransferDownloadTypeSerializer().deserialize(json) - return EventType.fileTransfersTransferDownload(v) - case "file_transfers_transfer_send": - let v = TeamLog.FileTransfersTransferSendTypeSerializer().deserialize(json) - return EventType.fileTransfersTransferSend(v) - case "file_transfers_transfer_view": - let v = TeamLog.FileTransfersTransferViewTypeSerializer().deserialize(json) - return EventType.fileTransfersTransferView(v) - case "note_acl_invite_only": - let v = TeamLog.NoteAclInviteOnlyTypeSerializer().deserialize(json) - return EventType.noteAclInviteOnly(v) - case "note_acl_link": - let v = TeamLog.NoteAclLinkTypeSerializer().deserialize(json) - return EventType.noteAclLink(v) - case "note_acl_team_link": - let v = TeamLog.NoteAclTeamLinkTypeSerializer().deserialize(json) - return EventType.noteAclTeamLink(v) - case "note_shared": - let v = TeamLog.NoteSharedTypeSerializer().deserialize(json) - return EventType.noteShared(v) - case "note_share_receive": - let v = TeamLog.NoteShareReceiveTypeSerializer().deserialize(json) - return EventType.noteShareReceive(v) - case "open_note_shared": - let v = TeamLog.OpenNoteSharedTypeSerializer().deserialize(json) - return EventType.openNoteShared(v) - case "sf_add_group": - let v = TeamLog.SfAddGroupTypeSerializer().deserialize(json) - return EventType.sfAddGroup(v) - case "sf_allow_non_members_to_view_shared_links": - let v = TeamLog.SfAllowNonMembersToViewSharedLinksTypeSerializer().deserialize(json) - return EventType.sfAllowNonMembersToViewSharedLinks(v) - case "sf_external_invite_warn": - let v = TeamLog.SfExternalInviteWarnTypeSerializer().deserialize(json) - return EventType.sfExternalInviteWarn(v) - case "sf_fb_invite": - let v = TeamLog.SfFbInviteTypeSerializer().deserialize(json) - return EventType.sfFbInvite(v) - case "sf_fb_invite_change_role": - let v = TeamLog.SfFbInviteChangeRoleTypeSerializer().deserialize(json) - return EventType.sfFbInviteChangeRole(v) - case "sf_fb_uninvite": - let v = TeamLog.SfFbUninviteTypeSerializer().deserialize(json) - return EventType.sfFbUninvite(v) - case "sf_invite_group": - let v = TeamLog.SfInviteGroupTypeSerializer().deserialize(json) - return EventType.sfInviteGroup(v) - case "sf_team_grant_access": - let v = TeamLog.SfTeamGrantAccessTypeSerializer().deserialize(json) - return EventType.sfTeamGrantAccess(v) - case "sf_team_invite": - let v = TeamLog.SfTeamInviteTypeSerializer().deserialize(json) - return EventType.sfTeamInvite(v) - case "sf_team_invite_change_role": - let v = TeamLog.SfTeamInviteChangeRoleTypeSerializer().deserialize(json) - return EventType.sfTeamInviteChangeRole(v) - case "sf_team_join": - let v = TeamLog.SfTeamJoinTypeSerializer().deserialize(json) - return EventType.sfTeamJoin(v) - case "sf_team_join_from_oob_link": - let v = TeamLog.SfTeamJoinFromOobLinkTypeSerializer().deserialize(json) - return EventType.sfTeamJoinFromOobLink(v) - case "sf_team_uninvite": - let v = TeamLog.SfTeamUninviteTypeSerializer().deserialize(json) - return EventType.sfTeamUninvite(v) - case "shared_content_add_invitees": - let v = TeamLog.SharedContentAddInviteesTypeSerializer().deserialize(json) - return EventType.sharedContentAddInvitees(v) - case "shared_content_add_link_expiry": - let v = TeamLog.SharedContentAddLinkExpiryTypeSerializer().deserialize(json) - return EventType.sharedContentAddLinkExpiry(v) - case "shared_content_add_link_password": - let v = TeamLog.SharedContentAddLinkPasswordTypeSerializer().deserialize(json) - return EventType.sharedContentAddLinkPassword(v) - case "shared_content_add_member": - let v = TeamLog.SharedContentAddMemberTypeSerializer().deserialize(json) - return EventType.sharedContentAddMember(v) - case "shared_content_change_downloads_policy": - let v = TeamLog.SharedContentChangeDownloadsPolicyTypeSerializer().deserialize(json) - return EventType.sharedContentChangeDownloadsPolicy(v) - case "shared_content_change_invitee_role": - let v = TeamLog.SharedContentChangeInviteeRoleTypeSerializer().deserialize(json) - return EventType.sharedContentChangeInviteeRole(v) - case "shared_content_change_link_audience": - let v = TeamLog.SharedContentChangeLinkAudienceTypeSerializer().deserialize(json) - return EventType.sharedContentChangeLinkAudience(v) - case "shared_content_change_link_expiry": - let v = TeamLog.SharedContentChangeLinkExpiryTypeSerializer().deserialize(json) - return EventType.sharedContentChangeLinkExpiry(v) - case "shared_content_change_link_password": - let v = TeamLog.SharedContentChangeLinkPasswordTypeSerializer().deserialize(json) - return EventType.sharedContentChangeLinkPassword(v) - case "shared_content_change_member_role": - let v = TeamLog.SharedContentChangeMemberRoleTypeSerializer().deserialize(json) - return EventType.sharedContentChangeMemberRole(v) - case "shared_content_change_viewer_info_policy": - let v = TeamLog.SharedContentChangeViewerInfoPolicyTypeSerializer().deserialize(json) - return EventType.sharedContentChangeViewerInfoPolicy(v) - case "shared_content_claim_invitation": - let v = TeamLog.SharedContentClaimInvitationTypeSerializer().deserialize(json) - return EventType.sharedContentClaimInvitation(v) - case "shared_content_copy": - let v = TeamLog.SharedContentCopyTypeSerializer().deserialize(json) - return EventType.sharedContentCopy(v) - case "shared_content_download": - let v = TeamLog.SharedContentDownloadTypeSerializer().deserialize(json) - return EventType.sharedContentDownload(v) - case "shared_content_relinquish_membership": - let v = TeamLog.SharedContentRelinquishMembershipTypeSerializer().deserialize(json) - return EventType.sharedContentRelinquishMembership(v) - case "shared_content_remove_invitees": - let v = TeamLog.SharedContentRemoveInviteesTypeSerializer().deserialize(json) - return EventType.sharedContentRemoveInvitees(v) - case "shared_content_remove_link_expiry": - let v = TeamLog.SharedContentRemoveLinkExpiryTypeSerializer().deserialize(json) - return EventType.sharedContentRemoveLinkExpiry(v) - case "shared_content_remove_link_password": - let v = TeamLog.SharedContentRemoveLinkPasswordTypeSerializer().deserialize(json) - return EventType.sharedContentRemoveLinkPassword(v) - case "shared_content_remove_member": - let v = TeamLog.SharedContentRemoveMemberTypeSerializer().deserialize(json) - return EventType.sharedContentRemoveMember(v) - case "shared_content_request_access": - let v = TeamLog.SharedContentRequestAccessTypeSerializer().deserialize(json) - return EventType.sharedContentRequestAccess(v) - case "shared_content_restore_invitees": - let v = TeamLog.SharedContentRestoreInviteesTypeSerializer().deserialize(json) - return EventType.sharedContentRestoreInvitees(v) - case "shared_content_restore_member": - let v = TeamLog.SharedContentRestoreMemberTypeSerializer().deserialize(json) - return EventType.sharedContentRestoreMember(v) - case "shared_content_unshare": - let v = TeamLog.SharedContentUnshareTypeSerializer().deserialize(json) - return EventType.sharedContentUnshare(v) - case "shared_content_view": - let v = TeamLog.SharedContentViewTypeSerializer().deserialize(json) - return EventType.sharedContentView(v) - case "shared_folder_change_link_policy": - let v = TeamLog.SharedFolderChangeLinkPolicyTypeSerializer().deserialize(json) - return EventType.sharedFolderChangeLinkPolicy(v) - case "shared_folder_change_members_inheritance_policy": - let v = TeamLog.SharedFolderChangeMembersInheritancePolicyTypeSerializer().deserialize(json) - return EventType.sharedFolderChangeMembersInheritancePolicy(v) - case "shared_folder_change_members_management_policy": - let v = TeamLog.SharedFolderChangeMembersManagementPolicyTypeSerializer().deserialize(json) - return EventType.sharedFolderChangeMembersManagementPolicy(v) - case "shared_folder_change_members_policy": - let v = TeamLog.SharedFolderChangeMembersPolicyTypeSerializer().deserialize(json) - return EventType.sharedFolderChangeMembersPolicy(v) - case "shared_folder_create": - let v = TeamLog.SharedFolderCreateTypeSerializer().deserialize(json) - return EventType.sharedFolderCreate(v) - case "shared_folder_decline_invitation": - let v = TeamLog.SharedFolderDeclineInvitationTypeSerializer().deserialize(json) - return EventType.sharedFolderDeclineInvitation(v) - case "shared_folder_mount": - let v = TeamLog.SharedFolderMountTypeSerializer().deserialize(json) - return EventType.sharedFolderMount(v) - case "shared_folder_nest": - let v = TeamLog.SharedFolderNestTypeSerializer().deserialize(json) - return EventType.sharedFolderNest(v) - case "shared_folder_transfer_ownership": - let v = TeamLog.SharedFolderTransferOwnershipTypeSerializer().deserialize(json) - return EventType.sharedFolderTransferOwnership(v) - case "shared_folder_unmount": - let v = TeamLog.SharedFolderUnmountTypeSerializer().deserialize(json) - return EventType.sharedFolderUnmount(v) - case "shared_link_add_expiry": - let v = TeamLog.SharedLinkAddExpiryTypeSerializer().deserialize(json) - return EventType.sharedLinkAddExpiry(v) - case "shared_link_change_expiry": - let v = TeamLog.SharedLinkChangeExpiryTypeSerializer().deserialize(json) - return EventType.sharedLinkChangeExpiry(v) - case "shared_link_change_visibility": - let v = TeamLog.SharedLinkChangeVisibilityTypeSerializer().deserialize(json) - return EventType.sharedLinkChangeVisibility(v) - case "shared_link_copy": - let v = TeamLog.SharedLinkCopyTypeSerializer().deserialize(json) - return EventType.sharedLinkCopy(v) - case "shared_link_create": - let v = TeamLog.SharedLinkCreateTypeSerializer().deserialize(json) - return EventType.sharedLinkCreate(v) - case "shared_link_disable": - let v = TeamLog.SharedLinkDisableTypeSerializer().deserialize(json) - return EventType.sharedLinkDisable(v) - case "shared_link_download": - let v = TeamLog.SharedLinkDownloadTypeSerializer().deserialize(json) - return EventType.sharedLinkDownload(v) - case "shared_link_remove_expiry": - let v = TeamLog.SharedLinkRemoveExpiryTypeSerializer().deserialize(json) - return EventType.sharedLinkRemoveExpiry(v) - case "shared_link_settings_add_expiration": - let v = TeamLog.SharedLinkSettingsAddExpirationTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsAddExpiration(v) - case "shared_link_settings_add_password": - let v = TeamLog.SharedLinkSettingsAddPasswordTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsAddPassword(v) - case "shared_link_settings_allow_download_disabled": - let v = TeamLog.SharedLinkSettingsAllowDownloadDisabledTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsAllowDownloadDisabled(v) - case "shared_link_settings_allow_download_enabled": - let v = TeamLog.SharedLinkSettingsAllowDownloadEnabledTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsAllowDownloadEnabled(v) - case "shared_link_settings_change_audience": - let v = TeamLog.SharedLinkSettingsChangeAudienceTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsChangeAudience(v) - case "shared_link_settings_change_expiration": - let v = TeamLog.SharedLinkSettingsChangeExpirationTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsChangeExpiration(v) - case "shared_link_settings_change_password": - let v = TeamLog.SharedLinkSettingsChangePasswordTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsChangePassword(v) - case "shared_link_settings_remove_expiration": - let v = TeamLog.SharedLinkSettingsRemoveExpirationTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsRemoveExpiration(v) - case "shared_link_settings_remove_password": - let v = TeamLog.SharedLinkSettingsRemovePasswordTypeSerializer().deserialize(json) - return EventType.sharedLinkSettingsRemovePassword(v) - case "shared_link_share": - let v = TeamLog.SharedLinkShareTypeSerializer().deserialize(json) - return EventType.sharedLinkShare(v) - case "shared_link_view": - let v = TeamLog.SharedLinkViewTypeSerializer().deserialize(json) - return EventType.sharedLinkView(v) - case "shared_note_opened": - let v = TeamLog.SharedNoteOpenedTypeSerializer().deserialize(json) - return EventType.sharedNoteOpened(v) - case "shmodel_disable_downloads": - let v = TeamLog.ShmodelDisableDownloadsTypeSerializer().deserialize(json) - return EventType.shmodelDisableDownloads(v) - case "shmodel_enable_downloads": - let v = TeamLog.ShmodelEnableDownloadsTypeSerializer().deserialize(json) - return EventType.shmodelEnableDownloads(v) - case "shmodel_group_share": - let v = TeamLog.ShmodelGroupShareTypeSerializer().deserialize(json) - return EventType.shmodelGroupShare(v) - case "showcase_access_granted": - let v = TeamLog.ShowcaseAccessGrantedTypeSerializer().deserialize(json) - return EventType.showcaseAccessGranted(v) - case "showcase_add_member": - let v = TeamLog.ShowcaseAddMemberTypeSerializer().deserialize(json) - return EventType.showcaseAddMember(v) - case "showcase_archived": - let v = TeamLog.ShowcaseArchivedTypeSerializer().deserialize(json) - return EventType.showcaseArchived(v) - case "showcase_created": - let v = TeamLog.ShowcaseCreatedTypeSerializer().deserialize(json) - return EventType.showcaseCreated(v) - case "showcase_delete_comment": - let v = TeamLog.ShowcaseDeleteCommentTypeSerializer().deserialize(json) - return EventType.showcaseDeleteComment(v) - case "showcase_edited": - let v = TeamLog.ShowcaseEditedTypeSerializer().deserialize(json) - return EventType.showcaseEdited(v) - case "showcase_edit_comment": - let v = TeamLog.ShowcaseEditCommentTypeSerializer().deserialize(json) - return EventType.showcaseEditComment(v) - case "showcase_file_added": - let v = TeamLog.ShowcaseFileAddedTypeSerializer().deserialize(json) - return EventType.showcaseFileAdded(v) - case "showcase_file_download": - let v = TeamLog.ShowcaseFileDownloadTypeSerializer().deserialize(json) - return EventType.showcaseFileDownload(v) - case "showcase_file_removed": - let v = TeamLog.ShowcaseFileRemovedTypeSerializer().deserialize(json) - return EventType.showcaseFileRemoved(v) - case "showcase_file_view": - let v = TeamLog.ShowcaseFileViewTypeSerializer().deserialize(json) - return EventType.showcaseFileView(v) - case "showcase_permanently_deleted": - let v = TeamLog.ShowcasePermanentlyDeletedTypeSerializer().deserialize(json) - return EventType.showcasePermanentlyDeleted(v) - case "showcase_post_comment": - let v = TeamLog.ShowcasePostCommentTypeSerializer().deserialize(json) - return EventType.showcasePostComment(v) - case "showcase_remove_member": - let v = TeamLog.ShowcaseRemoveMemberTypeSerializer().deserialize(json) - return EventType.showcaseRemoveMember(v) - case "showcase_renamed": - let v = TeamLog.ShowcaseRenamedTypeSerializer().deserialize(json) - return EventType.showcaseRenamed(v) - case "showcase_request_access": - let v = TeamLog.ShowcaseRequestAccessTypeSerializer().deserialize(json) - return EventType.showcaseRequestAccess(v) - case "showcase_resolve_comment": - let v = TeamLog.ShowcaseResolveCommentTypeSerializer().deserialize(json) - return EventType.showcaseResolveComment(v) - case "showcase_restored": - let v = TeamLog.ShowcaseRestoredTypeSerializer().deserialize(json) - return EventType.showcaseRestored(v) - case "showcase_trashed": - let v = TeamLog.ShowcaseTrashedTypeSerializer().deserialize(json) - return EventType.showcaseTrashed(v) - case "showcase_trashed_deprecated": - let v = TeamLog.ShowcaseTrashedDeprecatedTypeSerializer().deserialize(json) - return EventType.showcaseTrashedDeprecated(v) - case "showcase_unresolve_comment": - let v = TeamLog.ShowcaseUnresolveCommentTypeSerializer().deserialize(json) - return EventType.showcaseUnresolveComment(v) - case "showcase_untrashed": - let v = TeamLog.ShowcaseUntrashedTypeSerializer().deserialize(json) - return EventType.showcaseUntrashed(v) - case "showcase_untrashed_deprecated": - let v = TeamLog.ShowcaseUntrashedDeprecatedTypeSerializer().deserialize(json) - return EventType.showcaseUntrashedDeprecated(v) - case "showcase_view": - let v = TeamLog.ShowcaseViewTypeSerializer().deserialize(json) - return EventType.showcaseView(v) - case "sso_add_cert": - let v = TeamLog.SsoAddCertTypeSerializer().deserialize(json) - return EventType.ssoAddCert(v) - case "sso_add_login_url": - let v = TeamLog.SsoAddLoginUrlTypeSerializer().deserialize(json) - return EventType.ssoAddLoginUrl(v) - case "sso_add_logout_url": - let v = TeamLog.SsoAddLogoutUrlTypeSerializer().deserialize(json) - return EventType.ssoAddLogoutUrl(v) - case "sso_change_cert": - let v = TeamLog.SsoChangeCertTypeSerializer().deserialize(json) - return EventType.ssoChangeCert(v) - case "sso_change_login_url": - let v = TeamLog.SsoChangeLoginUrlTypeSerializer().deserialize(json) - return EventType.ssoChangeLoginUrl(v) - case "sso_change_logout_url": - let v = TeamLog.SsoChangeLogoutUrlTypeSerializer().deserialize(json) - return EventType.ssoChangeLogoutUrl(v) - case "sso_change_saml_identity_mode": - let v = TeamLog.SsoChangeSamlIdentityModeTypeSerializer().deserialize(json) - return EventType.ssoChangeSamlIdentityMode(v) - case "sso_remove_cert": - let v = TeamLog.SsoRemoveCertTypeSerializer().deserialize(json) - return EventType.ssoRemoveCert(v) - case "sso_remove_login_url": - let v = TeamLog.SsoRemoveLoginUrlTypeSerializer().deserialize(json) - return EventType.ssoRemoveLoginUrl(v) - case "sso_remove_logout_url": - let v = TeamLog.SsoRemoveLogoutUrlTypeSerializer().deserialize(json) - return EventType.ssoRemoveLogoutUrl(v) - case "team_folder_change_status": - let v = TeamLog.TeamFolderChangeStatusTypeSerializer().deserialize(json) - return EventType.teamFolderChangeStatus(v) - case "team_folder_create": - let v = TeamLog.TeamFolderCreateTypeSerializer().deserialize(json) - return EventType.teamFolderCreate(v) - case "team_folder_downgrade": - let v = TeamLog.TeamFolderDowngradeTypeSerializer().deserialize(json) - return EventType.teamFolderDowngrade(v) - case "team_folder_permanently_delete": - let v = TeamLog.TeamFolderPermanentlyDeleteTypeSerializer().deserialize(json) - return EventType.teamFolderPermanentlyDelete(v) - case "team_folder_rename": - let v = TeamLog.TeamFolderRenameTypeSerializer().deserialize(json) - return EventType.teamFolderRename(v) - case "team_selective_sync_settings_changed": - let v = TeamLog.TeamSelectiveSyncSettingsChangedTypeSerializer().deserialize(json) - return EventType.teamSelectiveSyncSettingsChanged(v) - case "account_capture_change_policy": - let v = TeamLog.AccountCaptureChangePolicyTypeSerializer().deserialize(json) - return EventType.accountCaptureChangePolicy(v) - case "admin_email_reminders_changed": - let v = TeamLog.AdminEmailRemindersChangedTypeSerializer().deserialize(json) - return EventType.adminEmailRemindersChanged(v) - case "allow_download_disabled": - let v = TeamLog.AllowDownloadDisabledTypeSerializer().deserialize(json) - return EventType.allowDownloadDisabled(v) - case "allow_download_enabled": - let v = TeamLog.AllowDownloadEnabledTypeSerializer().deserialize(json) - return EventType.allowDownloadEnabled(v) - case "app_permissions_changed": - let v = TeamLog.AppPermissionsChangedTypeSerializer().deserialize(json) - return EventType.appPermissionsChanged(v) - case "camera_uploads_policy_changed": - let v = TeamLog.CameraUploadsPolicyChangedTypeSerializer().deserialize(json) - return EventType.cameraUploadsPolicyChanged(v) - case "capture_transcript_policy_changed": - let v = TeamLog.CaptureTranscriptPolicyChangedTypeSerializer().deserialize(json) - return EventType.captureTranscriptPolicyChanged(v) - case "classification_change_policy": - let v = TeamLog.ClassificationChangePolicyTypeSerializer().deserialize(json) - return EventType.classificationChangePolicy(v) - case "computer_backup_policy_changed": - let v = TeamLog.ComputerBackupPolicyChangedTypeSerializer().deserialize(json) - return EventType.computerBackupPolicyChanged(v) - case "content_administration_policy_changed": - let v = TeamLog.ContentAdministrationPolicyChangedTypeSerializer().deserialize(json) - return EventType.contentAdministrationPolicyChanged(v) - case "data_placement_restriction_change_policy": - let v = TeamLog.DataPlacementRestrictionChangePolicyTypeSerializer().deserialize(json) - return EventType.dataPlacementRestrictionChangePolicy(v) - case "data_placement_restriction_satisfy_policy": - let v = TeamLog.DataPlacementRestrictionSatisfyPolicyTypeSerializer().deserialize(json) - return EventType.dataPlacementRestrictionSatisfyPolicy(v) - case "device_approvals_add_exception": - let v = TeamLog.DeviceApprovalsAddExceptionTypeSerializer().deserialize(json) - return EventType.deviceApprovalsAddException(v) - case "device_approvals_change_desktop_policy": - let v = TeamLog.DeviceApprovalsChangeDesktopPolicyTypeSerializer().deserialize(json) - return EventType.deviceApprovalsChangeDesktopPolicy(v) - case "device_approvals_change_mobile_policy": - let v = TeamLog.DeviceApprovalsChangeMobilePolicyTypeSerializer().deserialize(json) - return EventType.deviceApprovalsChangeMobilePolicy(v) - case "device_approvals_change_overage_action": - let v = TeamLog.DeviceApprovalsChangeOverageActionTypeSerializer().deserialize(json) - return EventType.deviceApprovalsChangeOverageAction(v) - case "device_approvals_change_unlink_action": - let v = TeamLog.DeviceApprovalsChangeUnlinkActionTypeSerializer().deserialize(json) - return EventType.deviceApprovalsChangeUnlinkAction(v) - case "device_approvals_remove_exception": - let v = TeamLog.DeviceApprovalsRemoveExceptionTypeSerializer().deserialize(json) - return EventType.deviceApprovalsRemoveException(v) - case "directory_restrictions_add_members": - let v = TeamLog.DirectoryRestrictionsAddMembersTypeSerializer().deserialize(json) - return EventType.directoryRestrictionsAddMembers(v) - case "directory_restrictions_remove_members": - let v = TeamLog.DirectoryRestrictionsRemoveMembersTypeSerializer().deserialize(json) - return EventType.directoryRestrictionsRemoveMembers(v) - case "dropbox_passwords_policy_changed": - let v = TeamLog.DropboxPasswordsPolicyChangedTypeSerializer().deserialize(json) - return EventType.dropboxPasswordsPolicyChanged(v) - case "email_ingest_policy_changed": - let v = TeamLog.EmailIngestPolicyChangedTypeSerializer().deserialize(json) - return EventType.emailIngestPolicyChanged(v) - case "emm_add_exception": - let v = TeamLog.EmmAddExceptionTypeSerializer().deserialize(json) - return EventType.emmAddException(v) - case "emm_change_policy": - let v = TeamLog.EmmChangePolicyTypeSerializer().deserialize(json) - return EventType.emmChangePolicy(v) - case "emm_remove_exception": - let v = TeamLog.EmmRemoveExceptionTypeSerializer().deserialize(json) - return EventType.emmRemoveException(v) - case "extended_version_history_change_policy": - let v = TeamLog.ExtendedVersionHistoryChangePolicyTypeSerializer().deserialize(json) - return EventType.extendedVersionHistoryChangePolicy(v) - case "external_drive_backup_policy_changed": - let v = TeamLog.ExternalDriveBackupPolicyChangedTypeSerializer().deserialize(json) - return EventType.externalDriveBackupPolicyChanged(v) - case "file_comments_change_policy": - let v = TeamLog.FileCommentsChangePolicyTypeSerializer().deserialize(json) - return EventType.fileCommentsChangePolicy(v) - case "file_locking_policy_changed": - let v = TeamLog.FileLockingPolicyChangedTypeSerializer().deserialize(json) - return EventType.fileLockingPolicyChanged(v) - case "file_provider_migration_policy_changed": - let v = TeamLog.FileProviderMigrationPolicyChangedTypeSerializer().deserialize(json) - return EventType.fileProviderMigrationPolicyChanged(v) - case "file_requests_change_policy": - let v = TeamLog.FileRequestsChangePolicyTypeSerializer().deserialize(json) - return EventType.fileRequestsChangePolicy(v) - case "file_requests_emails_enabled": - let v = TeamLog.FileRequestsEmailsEnabledTypeSerializer().deserialize(json) - return EventType.fileRequestsEmailsEnabled(v) - case "file_requests_emails_restricted_to_team_only": - let v = TeamLog.FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer().deserialize(json) - return EventType.fileRequestsEmailsRestrictedToTeamOnly(v) - case "file_transfers_policy_changed": - let v = TeamLog.FileTransfersPolicyChangedTypeSerializer().deserialize(json) - return EventType.fileTransfersPolicyChanged(v) - case "folder_link_restriction_policy_changed": - let v = TeamLog.FolderLinkRestrictionPolicyChangedTypeSerializer().deserialize(json) - return EventType.folderLinkRestrictionPolicyChanged(v) - case "google_sso_change_policy": - let v = TeamLog.GoogleSsoChangePolicyTypeSerializer().deserialize(json) - return EventType.googleSsoChangePolicy(v) - case "group_user_management_change_policy": - let v = TeamLog.GroupUserManagementChangePolicyTypeSerializer().deserialize(json) - return EventType.groupUserManagementChangePolicy(v) - case "integration_policy_changed": - let v = TeamLog.IntegrationPolicyChangedTypeSerializer().deserialize(json) - return EventType.integrationPolicyChanged(v) - case "invite_acceptance_email_policy_changed": - let v = TeamLog.InviteAcceptanceEmailPolicyChangedTypeSerializer().deserialize(json) - return EventType.inviteAcceptanceEmailPolicyChanged(v) - case "member_requests_change_policy": - let v = TeamLog.MemberRequestsChangePolicyTypeSerializer().deserialize(json) - return EventType.memberRequestsChangePolicy(v) - case "member_send_invite_policy_changed": - let v = TeamLog.MemberSendInvitePolicyChangedTypeSerializer().deserialize(json) - return EventType.memberSendInvitePolicyChanged(v) - case "member_space_limits_add_exception": - let v = TeamLog.MemberSpaceLimitsAddExceptionTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsAddException(v) - case "member_space_limits_change_caps_type_policy": - let v = TeamLog.MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsChangeCapsTypePolicy(v) - case "member_space_limits_change_policy": - let v = TeamLog.MemberSpaceLimitsChangePolicyTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsChangePolicy(v) - case "member_space_limits_remove_exception": - let v = TeamLog.MemberSpaceLimitsRemoveExceptionTypeSerializer().deserialize(json) - return EventType.memberSpaceLimitsRemoveException(v) - case "member_suggestions_change_policy": - let v = TeamLog.MemberSuggestionsChangePolicyTypeSerializer().deserialize(json) - return EventType.memberSuggestionsChangePolicy(v) - case "microsoft_office_addin_change_policy": - let v = TeamLog.MicrosoftOfficeAddinChangePolicyTypeSerializer().deserialize(json) - return EventType.microsoftOfficeAddinChangePolicy(v) - case "network_control_change_policy": - let v = TeamLog.NetworkControlChangePolicyTypeSerializer().deserialize(json) - return EventType.networkControlChangePolicy(v) - case "paper_change_deployment_policy": - let v = TeamLog.PaperChangeDeploymentPolicyTypeSerializer().deserialize(json) - return EventType.paperChangeDeploymentPolicy(v) - case "paper_change_member_link_policy": - let v = TeamLog.PaperChangeMemberLinkPolicyTypeSerializer().deserialize(json) - return EventType.paperChangeMemberLinkPolicy(v) - case "paper_change_member_policy": - let v = TeamLog.PaperChangeMemberPolicyTypeSerializer().deserialize(json) - return EventType.paperChangeMemberPolicy(v) - case "paper_change_policy": - let v = TeamLog.PaperChangePolicyTypeSerializer().deserialize(json) - return EventType.paperChangePolicy(v) - case "paper_default_folder_policy_changed": - let v = TeamLog.PaperDefaultFolderPolicyChangedTypeSerializer().deserialize(json) - return EventType.paperDefaultFolderPolicyChanged(v) - case "paper_desktop_policy_changed": - let v = TeamLog.PaperDesktopPolicyChangedTypeSerializer().deserialize(json) - return EventType.paperDesktopPolicyChanged(v) - case "paper_enabled_users_group_addition": - let v = TeamLog.PaperEnabledUsersGroupAdditionTypeSerializer().deserialize(json) - return EventType.paperEnabledUsersGroupAddition(v) - case "paper_enabled_users_group_removal": - let v = TeamLog.PaperEnabledUsersGroupRemovalTypeSerializer().deserialize(json) - return EventType.paperEnabledUsersGroupRemoval(v) - case "password_strength_requirements_change_policy": - let v = TeamLog.PasswordStrengthRequirementsChangePolicyTypeSerializer().deserialize(json) - return EventType.passwordStrengthRequirementsChangePolicy(v) - case "permanent_delete_change_policy": - let v = TeamLog.PermanentDeleteChangePolicyTypeSerializer().deserialize(json) - return EventType.permanentDeleteChangePolicy(v) - case "reseller_support_change_policy": - let v = TeamLog.ResellerSupportChangePolicyTypeSerializer().deserialize(json) - return EventType.resellerSupportChangePolicy(v) - case "rewind_policy_changed": - let v = TeamLog.RewindPolicyChangedTypeSerializer().deserialize(json) - return EventType.rewindPolicyChanged(v) - case "send_for_signature_policy_changed": - let v = TeamLog.SendForSignaturePolicyChangedTypeSerializer().deserialize(json) - return EventType.sendForSignaturePolicyChanged(v) - case "sharing_change_folder_join_policy": - let v = TeamLog.SharingChangeFolderJoinPolicyTypeSerializer().deserialize(json) - return EventType.sharingChangeFolderJoinPolicy(v) - case "sharing_change_link_allow_change_expiration_policy": - let v = TeamLog.SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer().deserialize(json) - return EventType.sharingChangeLinkAllowChangeExpirationPolicy(v) - case "sharing_change_link_default_expiration_policy": - let v = TeamLog.SharingChangeLinkDefaultExpirationPolicyTypeSerializer().deserialize(json) - return EventType.sharingChangeLinkDefaultExpirationPolicy(v) - case "sharing_change_link_enforce_password_policy": - let v = TeamLog.SharingChangeLinkEnforcePasswordPolicyTypeSerializer().deserialize(json) - return EventType.sharingChangeLinkEnforcePasswordPolicy(v) - case "sharing_change_link_policy": - let v = TeamLog.SharingChangeLinkPolicyTypeSerializer().deserialize(json) - return EventType.sharingChangeLinkPolicy(v) - case "sharing_change_member_policy": - let v = TeamLog.SharingChangeMemberPolicyTypeSerializer().deserialize(json) - return EventType.sharingChangeMemberPolicy(v) - case "showcase_change_download_policy": - let v = TeamLog.ShowcaseChangeDownloadPolicyTypeSerializer().deserialize(json) - return EventType.showcaseChangeDownloadPolicy(v) - case "showcase_change_enabled_policy": - let v = TeamLog.ShowcaseChangeEnabledPolicyTypeSerializer().deserialize(json) - return EventType.showcaseChangeEnabledPolicy(v) - case "showcase_change_external_sharing_policy": - let v = TeamLog.ShowcaseChangeExternalSharingPolicyTypeSerializer().deserialize(json) - return EventType.showcaseChangeExternalSharingPolicy(v) - case "smarter_smart_sync_policy_changed": - let v = TeamLog.SmarterSmartSyncPolicyChangedTypeSerializer().deserialize(json) - return EventType.smarterSmartSyncPolicyChanged(v) - case "smart_sync_change_policy": - let v = TeamLog.SmartSyncChangePolicyTypeSerializer().deserialize(json) - return EventType.smartSyncChangePolicy(v) - case "smart_sync_not_opt_out": - let v = TeamLog.SmartSyncNotOptOutTypeSerializer().deserialize(json) - return EventType.smartSyncNotOptOut(v) - case "smart_sync_opt_out": - let v = TeamLog.SmartSyncOptOutTypeSerializer().deserialize(json) - return EventType.smartSyncOptOut(v) - case "sso_change_policy": - let v = TeamLog.SsoChangePolicyTypeSerializer().deserialize(json) - return EventType.ssoChangePolicy(v) - case "team_branding_policy_changed": - let v = TeamLog.TeamBrandingPolicyChangedTypeSerializer().deserialize(json) - return EventType.teamBrandingPolicyChanged(v) - case "team_extensions_policy_changed": - let v = TeamLog.TeamExtensionsPolicyChangedTypeSerializer().deserialize(json) - return EventType.teamExtensionsPolicyChanged(v) - case "team_selective_sync_policy_changed": - let v = TeamLog.TeamSelectiveSyncPolicyChangedTypeSerializer().deserialize(json) - return EventType.teamSelectiveSyncPolicyChanged(v) - case "team_sharing_whitelist_subjects_changed": - let v = TeamLog.TeamSharingWhitelistSubjectsChangedTypeSerializer().deserialize(json) - return EventType.teamSharingWhitelistSubjectsChanged(v) - case "tfa_add_exception": - let v = TeamLog.TfaAddExceptionTypeSerializer().deserialize(json) - return EventType.tfaAddException(v) - case "tfa_change_policy": - let v = TeamLog.TfaChangePolicyTypeSerializer().deserialize(json) - return EventType.tfaChangePolicy(v) - case "tfa_remove_exception": - let v = TeamLog.TfaRemoveExceptionTypeSerializer().deserialize(json) - return EventType.tfaRemoveException(v) - case "two_account_change_policy": - let v = TeamLog.TwoAccountChangePolicyTypeSerializer().deserialize(json) - return EventType.twoAccountChangePolicy(v) - case "viewer_info_policy_changed": - let v = TeamLog.ViewerInfoPolicyChangedTypeSerializer().deserialize(json) - return EventType.viewerInfoPolicyChanged(v) - case "watermarking_policy_changed": - let v = TeamLog.WatermarkingPolicyChangedTypeSerializer().deserialize(json) - return EventType.watermarkingPolicyChanged(v) - case "web_sessions_change_active_session_limit": - let v = TeamLog.WebSessionsChangeActiveSessionLimitTypeSerializer().deserialize(json) - return EventType.webSessionsChangeActiveSessionLimit(v) - case "web_sessions_change_fixed_length_policy": - let v = TeamLog.WebSessionsChangeFixedLengthPolicyTypeSerializer().deserialize(json) - return EventType.webSessionsChangeFixedLengthPolicy(v) - case "web_sessions_change_idle_length_policy": - let v = TeamLog.WebSessionsChangeIdleLengthPolicyTypeSerializer().deserialize(json) - return EventType.webSessionsChangeIdleLengthPolicy(v) - case "data_residency_migration_request_successful": - let v = TeamLog.DataResidencyMigrationRequestSuccessfulTypeSerializer().deserialize(json) - return EventType.dataResidencyMigrationRequestSuccessful(v) - case "data_residency_migration_request_unsuccessful": - let v = TeamLog.DataResidencyMigrationRequestUnsuccessfulTypeSerializer().deserialize(json) - return EventType.dataResidencyMigrationRequestUnsuccessful(v) - case "team_merge_from": - let v = TeamLog.TeamMergeFromTypeSerializer().deserialize(json) - return EventType.teamMergeFrom(v) - case "team_merge_to": - let v = TeamLog.TeamMergeToTypeSerializer().deserialize(json) - return EventType.teamMergeTo(v) - case "team_profile_add_background": - let v = TeamLog.TeamProfileAddBackgroundTypeSerializer().deserialize(json) - return EventType.teamProfileAddBackground(v) - case "team_profile_add_logo": - let v = TeamLog.TeamProfileAddLogoTypeSerializer().deserialize(json) - return EventType.teamProfileAddLogo(v) - case "team_profile_change_background": - let v = TeamLog.TeamProfileChangeBackgroundTypeSerializer().deserialize(json) - return EventType.teamProfileChangeBackground(v) - case "team_profile_change_default_language": - let v = TeamLog.TeamProfileChangeDefaultLanguageTypeSerializer().deserialize(json) - return EventType.teamProfileChangeDefaultLanguage(v) - case "team_profile_change_logo": - let v = TeamLog.TeamProfileChangeLogoTypeSerializer().deserialize(json) - return EventType.teamProfileChangeLogo(v) - case "team_profile_change_name": - let v = TeamLog.TeamProfileChangeNameTypeSerializer().deserialize(json) - return EventType.teamProfileChangeName(v) - case "team_profile_remove_background": - let v = TeamLog.TeamProfileRemoveBackgroundTypeSerializer().deserialize(json) - return EventType.teamProfileRemoveBackground(v) - case "team_profile_remove_logo": - let v = TeamLog.TeamProfileRemoveLogoTypeSerializer().deserialize(json) - return EventType.teamProfileRemoveLogo(v) - case "tfa_add_backup_phone": - let v = TeamLog.TfaAddBackupPhoneTypeSerializer().deserialize(json) - return EventType.tfaAddBackupPhone(v) - case "tfa_add_security_key": - let v = TeamLog.TfaAddSecurityKeyTypeSerializer().deserialize(json) - return EventType.tfaAddSecurityKey(v) - case "tfa_change_backup_phone": - let v = TeamLog.TfaChangeBackupPhoneTypeSerializer().deserialize(json) - return EventType.tfaChangeBackupPhone(v) - case "tfa_change_status": - let v = TeamLog.TfaChangeStatusTypeSerializer().deserialize(json) - return EventType.tfaChangeStatus(v) - case "tfa_remove_backup_phone": - let v = TeamLog.TfaRemoveBackupPhoneTypeSerializer().deserialize(json) - return EventType.tfaRemoveBackupPhone(v) - case "tfa_remove_security_key": - let v = TeamLog.TfaRemoveSecurityKeyTypeSerializer().deserialize(json) - return EventType.tfaRemoveSecurityKey(v) - case "tfa_reset": - let v = TeamLog.TfaResetTypeSerializer().deserialize(json) - return EventType.tfaReset(v) - case "changed_enterprise_admin_role": - let v = TeamLog.ChangedEnterpriseAdminRoleTypeSerializer().deserialize(json) - return EventType.changedEnterpriseAdminRole(v) - case "changed_enterprise_connected_team_status": - let v = TeamLog.ChangedEnterpriseConnectedTeamStatusTypeSerializer().deserialize(json) - return EventType.changedEnterpriseConnectedTeamStatus(v) - case "ended_enterprise_admin_session": - let v = TeamLog.EndedEnterpriseAdminSessionTypeSerializer().deserialize(json) - return EventType.endedEnterpriseAdminSession(v) - case "ended_enterprise_admin_session_deprecated": - let v = TeamLog.EndedEnterpriseAdminSessionDeprecatedTypeSerializer().deserialize(json) - return EventType.endedEnterpriseAdminSessionDeprecated(v) - case "enterprise_settings_locking": - let v = TeamLog.EnterpriseSettingsLockingTypeSerializer().deserialize(json) - return EventType.enterpriseSettingsLocking(v) - case "guest_admin_change_status": - let v = TeamLog.GuestAdminChangeStatusTypeSerializer().deserialize(json) - return EventType.guestAdminChangeStatus(v) - case "started_enterprise_admin_session": - let v = TeamLog.StartedEnterpriseAdminSessionTypeSerializer().deserialize(json) - return EventType.startedEnterpriseAdminSession(v) - case "team_merge_request_accepted": - let v = TeamLog.TeamMergeRequestAcceptedTypeSerializer().deserialize(json) - return EventType.teamMergeRequestAccepted(v) - case "team_merge_request_accepted_shown_to_primary_team": - let v = TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestAcceptedShownToPrimaryTeam(v) - case "team_merge_request_accepted_shown_to_secondary_team": - let v = TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestAcceptedShownToSecondaryTeam(v) - case "team_merge_request_auto_canceled": - let v = TeamLog.TeamMergeRequestAutoCanceledTypeSerializer().deserialize(json) - return EventType.teamMergeRequestAutoCanceled(v) - case "team_merge_request_canceled": - let v = TeamLog.TeamMergeRequestCanceledTypeSerializer().deserialize(json) - return EventType.teamMergeRequestCanceled(v) - case "team_merge_request_canceled_shown_to_primary_team": - let v = TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestCanceledShownToPrimaryTeam(v) - case "team_merge_request_canceled_shown_to_secondary_team": - let v = TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestCanceledShownToSecondaryTeam(v) - case "team_merge_request_expired": - let v = TeamLog.TeamMergeRequestExpiredTypeSerializer().deserialize(json) - return EventType.teamMergeRequestExpired(v) - case "team_merge_request_expired_shown_to_primary_team": - let v = TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestExpiredShownToPrimaryTeam(v) - case "team_merge_request_expired_shown_to_secondary_team": - let v = TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestExpiredShownToSecondaryTeam(v) - case "team_merge_request_rejected_shown_to_primary_team": - let v = TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestRejectedShownToPrimaryTeam(v) - case "team_merge_request_rejected_shown_to_secondary_team": - let v = TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestRejectedShownToSecondaryTeam(v) - case "team_merge_request_reminder": - let v = TeamLog.TeamMergeRequestReminderTypeSerializer().deserialize(json) - return EventType.teamMergeRequestReminder(v) - case "team_merge_request_reminder_shown_to_primary_team": - let v = TeamLog.TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestReminderShownToPrimaryTeam(v) - case "team_merge_request_reminder_shown_to_secondary_team": - let v = TeamLog.TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestReminderShownToSecondaryTeam(v) - case "team_merge_request_revoked": - let v = TeamLog.TeamMergeRequestRevokedTypeSerializer().deserialize(json) - return EventType.teamMergeRequestRevoked(v) - case "team_merge_request_sent_shown_to_primary_team": - let v = TeamLog.TeamMergeRequestSentShownToPrimaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestSentShownToPrimaryTeam(v) - case "team_merge_request_sent_shown_to_secondary_team": - let v = TeamLog.TeamMergeRequestSentShownToSecondaryTeamTypeSerializer().deserialize(json) - return EventType.teamMergeRequestSentShownToSecondaryTeam(v) - case "other": - return EventType.other - default: - return EventType.other - } - default: - fatalError("Failed to deserialize") + case .adminAlertingAlertStateChanged(let arg): + var d = try Serialization.getFields(TeamLog.AdminAlertingAlertStateChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("admin_alerting_alert_state_changed") + return .dictionary(d) + case .adminAlertingChangedAlertConfig(let arg): + var d = try Serialization.getFields(TeamLog.AdminAlertingChangedAlertConfigTypeSerializer().serialize(arg)) + d[".tag"] = .str("admin_alerting_changed_alert_config") + return .dictionary(d) + case .adminAlertingTriggeredAlert(let arg): + var d = try Serialization.getFields(TeamLog.AdminAlertingTriggeredAlertTypeSerializer().serialize(arg)) + d[".tag"] = .str("admin_alerting_triggered_alert") + return .dictionary(d) + case .ransomwareRestoreProcessCompleted(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareRestoreProcessCompletedTypeSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_restore_process_completed") + return .dictionary(d) + case .ransomwareRestoreProcessStarted(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareRestoreProcessStartedTypeSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_restore_process_started") + return .dictionary(d) + case .appBlockedByPermissions(let arg): + var d = try Serialization.getFields(TeamLog.AppBlockedByPermissionsTypeSerializer().serialize(arg)) + d[".tag"] = .str("app_blocked_by_permissions") + return .dictionary(d) + case .appLinkTeam(let arg): + var d = try Serialization.getFields(TeamLog.AppLinkTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("app_link_team") + return .dictionary(d) + case .appLinkUser(let arg): + var d = try Serialization.getFields(TeamLog.AppLinkUserTypeSerializer().serialize(arg)) + d[".tag"] = .str("app_link_user") + return .dictionary(d) + case .appUnlinkTeam(let arg): + var d = try Serialization.getFields(TeamLog.AppUnlinkTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("app_unlink_team") + return .dictionary(d) + case .appUnlinkUser(let arg): + var d = try Serialization.getFields(TeamLog.AppUnlinkUserTypeSerializer().serialize(arg)) + d[".tag"] = .str("app_unlink_user") + return .dictionary(d) + case .integrationConnected(let arg): + var d = try Serialization.getFields(TeamLog.IntegrationConnectedTypeSerializer().serialize(arg)) + d[".tag"] = .str("integration_connected") + return .dictionary(d) + case .integrationDisconnected(let arg): + var d = try Serialization.getFields(TeamLog.IntegrationDisconnectedTypeSerializer().serialize(arg)) + d[".tag"] = .str("integration_disconnected") + return .dictionary(d) + case .fileAddComment(let arg): + var d = try Serialization.getFields(TeamLog.FileAddCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_add_comment") + return .dictionary(d) + case .fileChangeCommentSubscription(let arg): + var d = try Serialization.getFields(TeamLog.FileChangeCommentSubscriptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_change_comment_subscription") + return .dictionary(d) + case .fileDeleteComment(let arg): + var d = try Serialization.getFields(TeamLog.FileDeleteCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_delete_comment") + return .dictionary(d) + case .fileEditComment(let arg): + var d = try Serialization.getFields(TeamLog.FileEditCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_edit_comment") + return .dictionary(d) + case .fileLikeComment(let arg): + var d = try Serialization.getFields(TeamLog.FileLikeCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_like_comment") + return .dictionary(d) + case .fileResolveComment(let arg): + var d = try Serialization.getFields(TeamLog.FileResolveCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_resolve_comment") + return .dictionary(d) + case .fileUnlikeComment(let arg): + var d = try Serialization.getFields(TeamLog.FileUnlikeCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_unlike_comment") + return .dictionary(d) + case .fileUnresolveComment(let arg): + var d = try Serialization.getFields(TeamLog.FileUnresolveCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_unresolve_comment") + return .dictionary(d) + case .governancePolicyAddFolders(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyAddFoldersTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_add_folders") + return .dictionary(d) + case .governancePolicyAddFolderFailed(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyAddFolderFailedTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_add_folder_failed") + return .dictionary(d) + case .governancePolicyContentDisposed(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyContentDisposedTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_content_disposed") + return .dictionary(d) + case .governancePolicyCreate(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_create") + return .dictionary(d) + case .governancePolicyDelete(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_delete") + return .dictionary(d) + case .governancePolicyEditDetails(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyEditDetailsTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_edit_details") + return .dictionary(d) + case .governancePolicyEditDuration(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyEditDurationTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_edit_duration") + return .dictionary(d) + case .governancePolicyExportCreated(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyExportCreatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_export_created") + return .dictionary(d) + case .governancePolicyExportRemoved(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyExportRemovedTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_export_removed") + return .dictionary(d) + case .governancePolicyRemoveFolders(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyRemoveFoldersTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_remove_folders") + return .dictionary(d) + case .governancePolicyReportCreated(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyReportCreatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_report_created") + return .dictionary(d) + case .governancePolicyZipPartDownloaded(let arg): + var d = try Serialization.getFields(TeamLog.GovernancePolicyZipPartDownloadedTypeSerializer().serialize(arg)) + d[".tag"] = .str("governance_policy_zip_part_downloaded") + return .dictionary(d) + case .legalHoldsActivateAHold(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsActivateAHoldTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_activate_a_hold") + return .dictionary(d) + case .legalHoldsAddMembers(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsAddMembersTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_add_members") + return .dictionary(d) + case .legalHoldsChangeHoldDetails(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsChangeHoldDetailsTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_change_hold_details") + return .dictionary(d) + case .legalHoldsChangeHoldName(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsChangeHoldNameTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_change_hold_name") + return .dictionary(d) + case .legalHoldsExportAHold(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportAHoldTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_a_hold") + return .dictionary(d) + case .legalHoldsExportCancelled(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportCancelledTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_cancelled") + return .dictionary(d) + case .legalHoldsExportDownloaded(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportDownloadedTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_downloaded") + return .dictionary(d) + case .legalHoldsExportRemoved(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsExportRemovedTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_export_removed") + return .dictionary(d) + case .legalHoldsReleaseAHold(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsReleaseAHoldTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_release_a_hold") + return .dictionary(d) + case .legalHoldsRemoveMembers(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsRemoveMembersTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_remove_members") + return .dictionary(d) + case .legalHoldsReportAHold(let arg): + var d = try Serialization.getFields(TeamLog.LegalHoldsReportAHoldTypeSerializer().serialize(arg)) + d[".tag"] = .str("legal_holds_report_a_hold") + return .dictionary(d) + case .deviceChangeIpDesktop(let arg): + var d = try Serialization.getFields(TeamLog.DeviceChangeIpDesktopTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_change_ip_desktop") + return .dictionary(d) + case .deviceChangeIpMobile(let arg): + var d = try Serialization.getFields(TeamLog.DeviceChangeIpMobileTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_change_ip_mobile") + return .dictionary(d) + case .deviceChangeIpWeb(let arg): + var d = try Serialization.getFields(TeamLog.DeviceChangeIpWebTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_change_ip_web") + return .dictionary(d) + case .deviceDeleteOnUnlinkFail(let arg): + var d = try Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkFailTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_delete_on_unlink_fail") + return .dictionary(d) + case .deviceDeleteOnUnlinkSuccess(let arg): + var d = try Serialization.getFields(TeamLog.DeviceDeleteOnUnlinkSuccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_delete_on_unlink_success") + return .dictionary(d) + case .deviceLinkFail(let arg): + var d = try Serialization.getFields(TeamLog.DeviceLinkFailTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_link_fail") + return .dictionary(d) + case .deviceLinkSuccess(let arg): + var d = try Serialization.getFields(TeamLog.DeviceLinkSuccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_link_success") + return .dictionary(d) + case .deviceManagementDisabled(let arg): + var d = try Serialization.getFields(TeamLog.DeviceManagementDisabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_management_disabled") + return .dictionary(d) + case .deviceManagementEnabled(let arg): + var d = try Serialization.getFields(TeamLog.DeviceManagementEnabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_management_enabled") + return .dictionary(d) + case .deviceSyncBackupStatusChanged(let arg): + var d = try Serialization.getFields(TeamLog.DeviceSyncBackupStatusChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_sync_backup_status_changed") + return .dictionary(d) + case .deviceUnlink(let arg): + var d = try Serialization.getFields(TeamLog.DeviceUnlinkTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_unlink") + return .dictionary(d) + case .dropboxPasswordsExported(let arg): + var d = try Serialization.getFields(TeamLog.DropboxPasswordsExportedTypeSerializer().serialize(arg)) + d[".tag"] = .str("dropbox_passwords_exported") + return .dictionary(d) + case .dropboxPasswordsNewDeviceEnrolled(let arg): + var d = try Serialization.getFields(TeamLog.DropboxPasswordsNewDeviceEnrolledTypeSerializer().serialize(arg)) + d[".tag"] = .str("dropbox_passwords_new_device_enrolled") + return .dictionary(d) + case .emmRefreshAuthToken(let arg): + var d = try Serialization.getFields(TeamLog.EmmRefreshAuthTokenTypeSerializer().serialize(arg)) + d[".tag"] = .str("emm_refresh_auth_token") + return .dictionary(d) + case .externalDriveBackupEligibilityStatusChecked(let arg): + var d = try Serialization.getFields(TeamLog.ExternalDriveBackupEligibilityStatusCheckedTypeSerializer().serialize(arg)) + d[".tag"] = .str("external_drive_backup_eligibility_status_checked") + return .dictionary(d) + case .externalDriveBackupStatusChanged(let arg): + var d = try Serialization.getFields(TeamLog.ExternalDriveBackupStatusChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("external_drive_backup_status_changed") + return .dictionary(d) + case .accountCaptureChangeAvailability(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureChangeAvailabilityTypeSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_change_availability") + return .dictionary(d) + case .accountCaptureMigrateAccount(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureMigrateAccountTypeSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_migrate_account") + return .dictionary(d) + case .accountCaptureNotificationEmailsSent(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureNotificationEmailsSentTypeSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_notification_emails_sent") + return .dictionary(d) + case .accountCaptureRelinquishAccount(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureRelinquishAccountTypeSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_relinquish_account") + return .dictionary(d) + case .disabledDomainInvites(let arg): + var d = try Serialization.getFields(TeamLog.DisabledDomainInvitesTypeSerializer().serialize(arg)) + d[".tag"] = .str("disabled_domain_invites") + return .dictionary(d) + case .domainInvitesApproveRequestToJoinTeam(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesApproveRequestToJoinTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_approve_request_to_join_team") + return .dictionary(d) + case .domainInvitesDeclineRequestToJoinTeam(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesDeclineRequestToJoinTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_decline_request_to_join_team") + return .dictionary(d) + case .domainInvitesEmailExistingUsers(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesEmailExistingUsersTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_email_existing_users") + return .dictionary(d) + case .domainInvitesRequestToJoinTeam(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesRequestToJoinTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_request_to_join_team") + return .dictionary(d) + case .domainInvitesSetInviteNewUserPrefToNo(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToNoTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_no") + return .dictionary(d) + case .domainInvitesSetInviteNewUserPrefToYes(let arg): + var d = try Serialization.getFields(TeamLog.DomainInvitesSetInviteNewUserPrefToYesTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_yes") + return .dictionary(d) + case .domainVerificationAddDomainFail(let arg): + var d = try Serialization.getFields(TeamLog.DomainVerificationAddDomainFailTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_verification_add_domain_fail") + return .dictionary(d) + case .domainVerificationAddDomainSuccess(let arg): + var d = try Serialization.getFields(TeamLog.DomainVerificationAddDomainSuccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_verification_add_domain_success") + return .dictionary(d) + case .domainVerificationRemoveDomain(let arg): + var d = try Serialization.getFields(TeamLog.DomainVerificationRemoveDomainTypeSerializer().serialize(arg)) + d[".tag"] = .str("domain_verification_remove_domain") + return .dictionary(d) + case .enabledDomainInvites(let arg): + var d = try Serialization.getFields(TeamLog.EnabledDomainInvitesTypeSerializer().serialize(arg)) + d[".tag"] = .str("enabled_domain_invites") + return .dictionary(d) + case .teamEncryptionKeyCancelKeyDeletion(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyCancelKeyDeletionTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_cancel_key_deletion") + return .dictionary(d) + case .teamEncryptionKeyCreateKey(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyCreateKeyTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_create_key") + return .dictionary(d) + case .teamEncryptionKeyDeleteKey(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyDeleteKeyTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_delete_key") + return .dictionary(d) + case .teamEncryptionKeyDisableKey(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyDisableKeyTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_disable_key") + return .dictionary(d) + case .teamEncryptionKeyEnableKey(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyEnableKeyTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_enable_key") + return .dictionary(d) + case .teamEncryptionKeyRotateKey(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyRotateKeyTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_rotate_key") + return .dictionary(d) + case .teamEncryptionKeyScheduleKeyDeletion(let arg): + var d = try Serialization.getFields(TeamLog.TeamEncryptionKeyScheduleKeyDeletionTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_encryption_key_schedule_key_deletion") + return .dictionary(d) + case .applyNamingConvention(let arg): + var d = try Serialization.getFields(TeamLog.ApplyNamingConventionTypeSerializer().serialize(arg)) + d[".tag"] = .str("apply_naming_convention") + return .dictionary(d) + case .createFolder(let arg): + var d = try Serialization.getFields(TeamLog.CreateFolderTypeSerializer().serialize(arg)) + d[".tag"] = .str("create_folder") + return .dictionary(d) + case .fileAdd(let arg): + var d = try Serialization.getFields(TeamLog.FileAddTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_add") + return .dictionary(d) + case .fileAddFromAutomation(let arg): + var d = try Serialization.getFields(TeamLog.FileAddFromAutomationTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_add_from_automation") + return .dictionary(d) + case .fileCopy(let arg): + var d = try Serialization.getFields(TeamLog.FileCopyTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_copy") + return .dictionary(d) + case .fileDelete(let arg): + var d = try Serialization.getFields(TeamLog.FileDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_delete") + return .dictionary(d) + case .fileDownload(let arg): + var d = try Serialization.getFields(TeamLog.FileDownloadTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_download") + return .dictionary(d) + case .fileEdit(let arg): + var d = try Serialization.getFields(TeamLog.FileEditTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_edit") + return .dictionary(d) + case .fileGetCopyReference(let arg): + var d = try Serialization.getFields(TeamLog.FileGetCopyReferenceTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_get_copy_reference") + return .dictionary(d) + case .fileLockingLockStatusChanged(let arg): + var d = try Serialization.getFields(TeamLog.FileLockingLockStatusChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_locking_lock_status_changed") + return .dictionary(d) + case .fileMove(let arg): + var d = try Serialization.getFields(TeamLog.FileMoveTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_move") + return .dictionary(d) + case .filePermanentlyDelete(let arg): + var d = try Serialization.getFields(TeamLog.FilePermanentlyDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_permanently_delete") + return .dictionary(d) + case .filePreview(let arg): + var d = try Serialization.getFields(TeamLog.FilePreviewTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_preview") + return .dictionary(d) + case .fileRename(let arg): + var d = try Serialization.getFields(TeamLog.FileRenameTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_rename") + return .dictionary(d) + case .fileRestore(let arg): + var d = try Serialization.getFields(TeamLog.FileRestoreTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_restore") + return .dictionary(d) + case .fileRevert(let arg): + var d = try Serialization.getFields(TeamLog.FileRevertTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_revert") + return .dictionary(d) + case .fileRollbackChanges(let arg): + var d = try Serialization.getFields(TeamLog.FileRollbackChangesTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_rollback_changes") + return .dictionary(d) + case .fileSaveCopyReference(let arg): + var d = try Serialization.getFields(TeamLog.FileSaveCopyReferenceTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_save_copy_reference") + return .dictionary(d) + case .folderOverviewDescriptionChanged(let arg): + var d = try Serialization.getFields(TeamLog.FolderOverviewDescriptionChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("folder_overview_description_changed") + return .dictionary(d) + case .folderOverviewItemPinned(let arg): + var d = try Serialization.getFields(TeamLog.FolderOverviewItemPinnedTypeSerializer().serialize(arg)) + d[".tag"] = .str("folder_overview_item_pinned") + return .dictionary(d) + case .folderOverviewItemUnpinned(let arg): + var d = try Serialization.getFields(TeamLog.FolderOverviewItemUnpinnedTypeSerializer().serialize(arg)) + d[".tag"] = .str("folder_overview_item_unpinned") + return .dictionary(d) + case .objectLabelAdded(let arg): + var d = try Serialization.getFields(TeamLog.ObjectLabelAddedTypeSerializer().serialize(arg)) + d[".tag"] = .str("object_label_added") + return .dictionary(d) + case .objectLabelRemoved(let arg): + var d = try Serialization.getFields(TeamLog.ObjectLabelRemovedTypeSerializer().serialize(arg)) + d[".tag"] = .str("object_label_removed") + return .dictionary(d) + case .objectLabelUpdatedValue(let arg): + var d = try Serialization.getFields(TeamLog.ObjectLabelUpdatedValueTypeSerializer().serialize(arg)) + d[".tag"] = .str("object_label_updated_value") + return .dictionary(d) + case .organizeFolderWithTidy(let arg): + var d = try Serialization.getFields(TeamLog.OrganizeFolderWithTidyTypeSerializer().serialize(arg)) + d[".tag"] = .str("organize_folder_with_tidy") + return .dictionary(d) + case .replayFileDelete(let arg): + var d = try Serialization.getFields(TeamLog.ReplayFileDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("replay_file_delete") + return .dictionary(d) + case .rewindFolder(let arg): + var d = try Serialization.getFields(TeamLog.RewindFolderTypeSerializer().serialize(arg)) + d[".tag"] = .str("rewind_folder") + return .dictionary(d) + case .undoNamingConvention(let arg): + var d = try Serialization.getFields(TeamLog.UndoNamingConventionTypeSerializer().serialize(arg)) + d[".tag"] = .str("undo_naming_convention") + return .dictionary(d) + case .undoOrganizeFolderWithTidy(let arg): + var d = try Serialization.getFields(TeamLog.UndoOrganizeFolderWithTidyTypeSerializer().serialize(arg)) + d[".tag"] = .str("undo_organize_folder_with_tidy") + return .dictionary(d) + case .userTagsAdded(let arg): + var d = try Serialization.getFields(TeamLog.UserTagsAddedTypeSerializer().serialize(arg)) + d[".tag"] = .str("user_tags_added") + return .dictionary(d) + case .userTagsRemoved(let arg): + var d = try Serialization.getFields(TeamLog.UserTagsRemovedTypeSerializer().serialize(arg)) + d[".tag"] = .str("user_tags_removed") + return .dictionary(d) + case .emailIngestReceiveFile(let arg): + var d = try Serialization.getFields(TeamLog.EmailIngestReceiveFileTypeSerializer().serialize(arg)) + d[".tag"] = .str("email_ingest_receive_file") + return .dictionary(d) + case .fileRequestChange(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestChangeTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_request_change") + return .dictionary(d) + case .fileRequestClose(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestCloseTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_request_close") + return .dictionary(d) + case .fileRequestCreate(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_request_create") + return .dictionary(d) + case .fileRequestDelete(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_request_delete") + return .dictionary(d) + case .fileRequestReceiveFile(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestReceiveFileTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_request_receive_file") + return .dictionary(d) + case .groupAddExternalId(let arg): + var d = try Serialization.getFields(TeamLog.GroupAddExternalIdTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_add_external_id") + return .dictionary(d) + case .groupAddMember(let arg): + var d = try Serialization.getFields(TeamLog.GroupAddMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_add_member") + return .dictionary(d) + case .groupChangeExternalId(let arg): + var d = try Serialization.getFields(TeamLog.GroupChangeExternalIdTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_change_external_id") + return .dictionary(d) + case .groupChangeManagementType(let arg): + var d = try Serialization.getFields(TeamLog.GroupChangeManagementTypeTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_change_management_type") + return .dictionary(d) + case .groupChangeMemberRole(let arg): + var d = try Serialization.getFields(TeamLog.GroupChangeMemberRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_change_member_role") + return .dictionary(d) + case .groupCreate(let arg): + var d = try Serialization.getFields(TeamLog.GroupCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_create") + return .dictionary(d) + case .groupDelete(let arg): + var d = try Serialization.getFields(TeamLog.GroupDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_delete") + return .dictionary(d) + case .groupDescriptionUpdated(let arg): + var d = try Serialization.getFields(TeamLog.GroupDescriptionUpdatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_description_updated") + return .dictionary(d) + case .groupJoinPolicyUpdated(let arg): + var d = try Serialization.getFields(TeamLog.GroupJoinPolicyUpdatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_join_policy_updated") + return .dictionary(d) + case .groupMoved(let arg): + var d = try Serialization.getFields(TeamLog.GroupMovedTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_moved") + return .dictionary(d) + case .groupRemoveExternalId(let arg): + var d = try Serialization.getFields(TeamLog.GroupRemoveExternalIdTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_remove_external_id") + return .dictionary(d) + case .groupRemoveMember(let arg): + var d = try Serialization.getFields(TeamLog.GroupRemoveMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_remove_member") + return .dictionary(d) + case .groupRename(let arg): + var d = try Serialization.getFields(TeamLog.GroupRenameTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_rename") + return .dictionary(d) + case .accountLockOrUnlocked(let arg): + var d = try Serialization.getFields(TeamLog.AccountLockOrUnlockedTypeSerializer().serialize(arg)) + d[".tag"] = .str("account_lock_or_unlocked") + return .dictionary(d) + case .emmError(let arg): + var d = try Serialization.getFields(TeamLog.EmmErrorTypeSerializer().serialize(arg)) + d[".tag"] = .str("emm_error") + return .dictionary(d) + case .guestAdminSignedInViaTrustedTeams(let arg): + var d = try Serialization.getFields(TeamLog.GuestAdminSignedInViaTrustedTeamsTypeSerializer().serialize(arg)) + d[".tag"] = .str("guest_admin_signed_in_via_trusted_teams") + return .dictionary(d) + case .guestAdminSignedOutViaTrustedTeams(let arg): + var d = try Serialization.getFields(TeamLog.GuestAdminSignedOutViaTrustedTeamsTypeSerializer().serialize(arg)) + d[".tag"] = .str("guest_admin_signed_out_via_trusted_teams") + return .dictionary(d) + case .loginFail(let arg): + var d = try Serialization.getFields(TeamLog.LoginFailTypeSerializer().serialize(arg)) + d[".tag"] = .str("login_fail") + return .dictionary(d) + case .loginSuccess(let arg): + var d = try Serialization.getFields(TeamLog.LoginSuccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("login_success") + return .dictionary(d) + case .logout(let arg): + var d = try Serialization.getFields(TeamLog.LogoutTypeSerializer().serialize(arg)) + d[".tag"] = .str("logout") + return .dictionary(d) + case .resellerSupportSessionEnd(let arg): + var d = try Serialization.getFields(TeamLog.ResellerSupportSessionEndTypeSerializer().serialize(arg)) + d[".tag"] = .str("reseller_support_session_end") + return .dictionary(d) + case .resellerSupportSessionStart(let arg): + var d = try Serialization.getFields(TeamLog.ResellerSupportSessionStartTypeSerializer().serialize(arg)) + d[".tag"] = .str("reseller_support_session_start") + return .dictionary(d) + case .signInAsSessionEnd(let arg): + var d = try Serialization.getFields(TeamLog.SignInAsSessionEndTypeSerializer().serialize(arg)) + d[".tag"] = .str("sign_in_as_session_end") + return .dictionary(d) + case .signInAsSessionStart(let arg): + var d = try Serialization.getFields(TeamLog.SignInAsSessionStartTypeSerializer().serialize(arg)) + d[".tag"] = .str("sign_in_as_session_start") + return .dictionary(d) + case .ssoError(let arg): + var d = try Serialization.getFields(TeamLog.SsoErrorTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_error") + return .dictionary(d) + case .backupAdminInvitationSent(let arg): + var d = try Serialization.getFields(TeamLog.BackupAdminInvitationSentTypeSerializer().serialize(arg)) + d[".tag"] = .str("backup_admin_invitation_sent") + return .dictionary(d) + case .backupInvitationOpened(let arg): + var d = try Serialization.getFields(TeamLog.BackupInvitationOpenedTypeSerializer().serialize(arg)) + d[".tag"] = .str("backup_invitation_opened") + return .dictionary(d) + case .createTeamInviteLink(let arg): + var d = try Serialization.getFields(TeamLog.CreateTeamInviteLinkTypeSerializer().serialize(arg)) + d[".tag"] = .str("create_team_invite_link") + return .dictionary(d) + case .deleteTeamInviteLink(let arg): + var d = try Serialization.getFields(TeamLog.DeleteTeamInviteLinkTypeSerializer().serialize(arg)) + d[".tag"] = .str("delete_team_invite_link") + return .dictionary(d) + case .memberAddExternalId(let arg): + var d = try Serialization.getFields(TeamLog.MemberAddExternalIdTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_add_external_id") + return .dictionary(d) + case .memberAddName(let arg): + var d = try Serialization.getFields(TeamLog.MemberAddNameTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_add_name") + return .dictionary(d) + case .memberChangeAdminRole(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeAdminRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_change_admin_role") + return .dictionary(d) + case .memberChangeEmail(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeEmailTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_change_email") + return .dictionary(d) + case .memberChangeExternalId(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeExternalIdTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_change_external_id") + return .dictionary(d) + case .memberChangeMembershipType(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeMembershipTypeTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_change_membership_type") + return .dictionary(d) + case .memberChangeName(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeNameTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_change_name") + return .dictionary(d) + case .memberChangeResellerRole(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeResellerRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_change_reseller_role") + return .dictionary(d) + case .memberChangeStatus(let arg): + var d = try Serialization.getFields(TeamLog.MemberChangeStatusTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_change_status") + return .dictionary(d) + case .memberDeleteManualContacts(let arg): + var d = try Serialization.getFields(TeamLog.MemberDeleteManualContactsTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_delete_manual_contacts") + return .dictionary(d) + case .memberDeleteProfilePhoto(let arg): + var d = try Serialization.getFields(TeamLog.MemberDeleteProfilePhotoTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_delete_profile_photo") + return .dictionary(d) + case .memberPermanentlyDeleteAccountContents(let arg): + var d = try Serialization.getFields(TeamLog.MemberPermanentlyDeleteAccountContentsTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_permanently_delete_account_contents") + return .dictionary(d) + case .memberRemoveExternalId(let arg): + var d = try Serialization.getFields(TeamLog.MemberRemoveExternalIdTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_remove_external_id") + return .dictionary(d) + case .memberSetProfilePhoto(let arg): + var d = try Serialization.getFields(TeamLog.MemberSetProfilePhotoTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_set_profile_photo") + return .dictionary(d) + case .memberSpaceLimitsAddCustomQuota(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsAddCustomQuotaTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_add_custom_quota") + return .dictionary(d) + case .memberSpaceLimitsChangeCustomQuota(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCustomQuotaTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_custom_quota") + return .dictionary(d) + case .memberSpaceLimitsChangeStatus(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangeStatusTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_status") + return .dictionary(d) + case .memberSpaceLimitsRemoveCustomQuota(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveCustomQuotaTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_remove_custom_quota") + return .dictionary(d) + case .memberSuggest(let arg): + var d = try Serialization.getFields(TeamLog.MemberSuggestTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_suggest") + return .dictionary(d) + case .memberTransferAccountContents(let arg): + var d = try Serialization.getFields(TeamLog.MemberTransferAccountContentsTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_transfer_account_contents") + return .dictionary(d) + case .pendingSecondaryEmailAdded(let arg): + var d = try Serialization.getFields(TeamLog.PendingSecondaryEmailAddedTypeSerializer().serialize(arg)) + d[".tag"] = .str("pending_secondary_email_added") + return .dictionary(d) + case .secondaryEmailDeleted(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryEmailDeletedTypeSerializer().serialize(arg)) + d[".tag"] = .str("secondary_email_deleted") + return .dictionary(d) + case .secondaryEmailVerified(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryEmailVerifiedTypeSerializer().serialize(arg)) + d[".tag"] = .str("secondary_email_verified") + return .dictionary(d) + case .secondaryMailsPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryMailsPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("secondary_mails_policy_changed") + return .dictionary(d) + case .binderAddPage(let arg): + var d = try Serialization.getFields(TeamLog.BinderAddPageTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_add_page") + return .dictionary(d) + case .binderAddSection(let arg): + var d = try Serialization.getFields(TeamLog.BinderAddSectionTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_add_section") + return .dictionary(d) + case .binderRemovePage(let arg): + var d = try Serialization.getFields(TeamLog.BinderRemovePageTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_remove_page") + return .dictionary(d) + case .binderRemoveSection(let arg): + var d = try Serialization.getFields(TeamLog.BinderRemoveSectionTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_remove_section") + return .dictionary(d) + case .binderRenamePage(let arg): + var d = try Serialization.getFields(TeamLog.BinderRenamePageTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_rename_page") + return .dictionary(d) + case .binderRenameSection(let arg): + var d = try Serialization.getFields(TeamLog.BinderRenameSectionTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_rename_section") + return .dictionary(d) + case .binderReorderPage(let arg): + var d = try Serialization.getFields(TeamLog.BinderReorderPageTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_reorder_page") + return .dictionary(d) + case .binderReorderSection(let arg): + var d = try Serialization.getFields(TeamLog.BinderReorderSectionTypeSerializer().serialize(arg)) + d[".tag"] = .str("binder_reorder_section") + return .dictionary(d) + case .paperContentAddMember(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentAddMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_add_member") + return .dictionary(d) + case .paperContentAddToFolder(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentAddToFolderTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_add_to_folder") + return .dictionary(d) + case .paperContentArchive(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentArchiveTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_archive") + return .dictionary(d) + case .paperContentCreate(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_create") + return .dictionary(d) + case .paperContentPermanentlyDelete(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentPermanentlyDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_permanently_delete") + return .dictionary(d) + case .paperContentRemoveFromFolder(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRemoveFromFolderTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_remove_from_folder") + return .dictionary(d) + case .paperContentRemoveMember(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRemoveMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_remove_member") + return .dictionary(d) + case .paperContentRename(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRenameTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_rename") + return .dictionary(d) + case .paperContentRestore(let arg): + var d = try Serialization.getFields(TeamLog.PaperContentRestoreTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_content_restore") + return .dictionary(d) + case .paperDocAddComment(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocAddCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_add_comment") + return .dictionary(d) + case .paperDocChangeMemberRole(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocChangeMemberRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_change_member_role") + return .dictionary(d) + case .paperDocChangeSharingPolicy(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocChangeSharingPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_change_sharing_policy") + return .dictionary(d) + case .paperDocChangeSubscription(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocChangeSubscriptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_change_subscription") + return .dictionary(d) + case .paperDocDeleted(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocDeletedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_deleted") + return .dictionary(d) + case .paperDocDeleteComment(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocDeleteCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_delete_comment") + return .dictionary(d) + case .paperDocDownload(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocDownloadTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_download") + return .dictionary(d) + case .paperDocEdit(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocEditTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_edit") + return .dictionary(d) + case .paperDocEditComment(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocEditCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_edit_comment") + return .dictionary(d) + case .paperDocFollowed(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocFollowedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_followed") + return .dictionary(d) + case .paperDocMention(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocMentionTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_mention") + return .dictionary(d) + case .paperDocOwnershipChanged(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocOwnershipChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_ownership_changed") + return .dictionary(d) + case .paperDocRequestAccess(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocRequestAccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_request_access") + return .dictionary(d) + case .paperDocResolveComment(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocResolveCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_resolve_comment") + return .dictionary(d) + case .paperDocRevert(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocRevertTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_revert") + return .dictionary(d) + case .paperDocSlackShare(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocSlackShareTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_slack_share") + return .dictionary(d) + case .paperDocTeamInvite(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocTeamInviteTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_team_invite") + return .dictionary(d) + case .paperDocTrashed(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocTrashedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_trashed") + return .dictionary(d) + case .paperDocUnresolveComment(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocUnresolveCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_unresolve_comment") + return .dictionary(d) + case .paperDocUntrashed(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocUntrashedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_untrashed") + return .dictionary(d) + case .paperDocView(let arg): + var d = try Serialization.getFields(TeamLog.PaperDocViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_doc_view") + return .dictionary(d) + case .paperExternalViewAllow(let arg): + var d = try Serialization.getFields(TeamLog.PaperExternalViewAllowTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_external_view_allow") + return .dictionary(d) + case .paperExternalViewDefaultTeam(let arg): + var d = try Serialization.getFields(TeamLog.PaperExternalViewDefaultTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_external_view_default_team") + return .dictionary(d) + case .paperExternalViewForbid(let arg): + var d = try Serialization.getFields(TeamLog.PaperExternalViewForbidTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_external_view_forbid") + return .dictionary(d) + case .paperFolderChangeSubscription(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderChangeSubscriptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_change_subscription") + return .dictionary(d) + case .paperFolderDeleted(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderDeletedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_deleted") + return .dictionary(d) + case .paperFolderFollowed(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderFollowedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_followed") + return .dictionary(d) + case .paperFolderTeamInvite(let arg): + var d = try Serialization.getFields(TeamLog.PaperFolderTeamInviteTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_folder_team_invite") + return .dictionary(d) + case .paperPublishedLinkChangePermission(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkChangePermissionTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_change_permission") + return .dictionary(d) + case .paperPublishedLinkCreate(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_create") + return .dictionary(d) + case .paperPublishedLinkDisabled(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkDisabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_disabled") + return .dictionary(d) + case .paperPublishedLinkView(let arg): + var d = try Serialization.getFields(TeamLog.PaperPublishedLinkViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_published_link_view") + return .dictionary(d) + case .passwordChange(let arg): + var d = try Serialization.getFields(TeamLog.PasswordChangeTypeSerializer().serialize(arg)) + d[".tag"] = .str("password_change") + return .dictionary(d) + case .passwordReset(let arg): + var d = try Serialization.getFields(TeamLog.PasswordResetTypeSerializer().serialize(arg)) + d[".tag"] = .str("password_reset") + return .dictionary(d) + case .passwordResetAll(let arg): + var d = try Serialization.getFields(TeamLog.PasswordResetAllTypeSerializer().serialize(arg)) + d[".tag"] = .str("password_reset_all") + return .dictionary(d) + case .classificationCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.ClassificationCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("classification_create_report") + return .dictionary(d) + case .classificationCreateReportFail(let arg): + var d = try Serialization.getFields(TeamLog.ClassificationCreateReportFailTypeSerializer().serialize(arg)) + d[".tag"] = .str("classification_create_report_fail") + return .dictionary(d) + case .emmCreateExceptionsReport(let arg): + var d = try Serialization.getFields(TeamLog.EmmCreateExceptionsReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("emm_create_exceptions_report") + return .dictionary(d) + case .emmCreateUsageReport(let arg): + var d = try Serialization.getFields(TeamLog.EmmCreateUsageReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("emm_create_usage_report") + return .dictionary(d) + case .exportMembersReport(let arg): + var d = try Serialization.getFields(TeamLog.ExportMembersReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("export_members_report") + return .dictionary(d) + case .exportMembersReportFail(let arg): + var d = try Serialization.getFields(TeamLog.ExportMembersReportFailTypeSerializer().serialize(arg)) + d[".tag"] = .str("export_members_report_fail") + return .dictionary(d) + case .externalSharingCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.ExternalSharingCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("external_sharing_create_report") + return .dictionary(d) + case .externalSharingReportFailed(let arg): + var d = try Serialization.getFields(TeamLog.ExternalSharingReportFailedTypeSerializer().serialize(arg)) + d[".tag"] = .str("external_sharing_report_failed") + return .dictionary(d) + case .noExpirationLinkGenCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.NoExpirationLinkGenCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("no_expiration_link_gen_create_report") + return .dictionary(d) + case .noExpirationLinkGenReportFailed(let arg): + var d = try Serialization.getFields(TeamLog.NoExpirationLinkGenReportFailedTypeSerializer().serialize(arg)) + d[".tag"] = .str("no_expiration_link_gen_report_failed") + return .dictionary(d) + case .noPasswordLinkGenCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkGenCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_gen_create_report") + return .dictionary(d) + case .noPasswordLinkGenReportFailed(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkGenReportFailedTypeSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_gen_report_failed") + return .dictionary(d) + case .noPasswordLinkViewCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkViewCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_view_create_report") + return .dictionary(d) + case .noPasswordLinkViewReportFailed(let arg): + var d = try Serialization.getFields(TeamLog.NoPasswordLinkViewReportFailedTypeSerializer().serialize(arg)) + d[".tag"] = .str("no_password_link_view_report_failed") + return .dictionary(d) + case .outdatedLinkViewCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.OutdatedLinkViewCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("outdated_link_view_create_report") + return .dictionary(d) + case .outdatedLinkViewReportFailed(let arg): + var d = try Serialization.getFields(TeamLog.OutdatedLinkViewReportFailedTypeSerializer().serialize(arg)) + d[".tag"] = .str("outdated_link_view_report_failed") + return .dictionary(d) + case .paperAdminExportStart(let arg): + var d = try Serialization.getFields(TeamLog.PaperAdminExportStartTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_admin_export_start") + return .dictionary(d) + case .ransomwareAlertCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareAlertCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_alert_create_report") + return .dictionary(d) + case .ransomwareAlertCreateReportFailed(let arg): + var d = try Serialization.getFields(TeamLog.RansomwareAlertCreateReportFailedTypeSerializer().serialize(arg)) + d[".tag"] = .str("ransomware_alert_create_report_failed") + return .dictionary(d) + case .smartSyncCreateAdminPrivilegeReport(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncCreateAdminPrivilegeReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_create_admin_privilege_report") + return .dictionary(d) + case .teamActivityCreateReport(let arg): + var d = try Serialization.getFields(TeamLog.TeamActivityCreateReportTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_activity_create_report") + return .dictionary(d) + case .teamActivityCreateReportFail(let arg): + var d = try Serialization.getFields(TeamLog.TeamActivityCreateReportFailTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_activity_create_report_fail") + return .dictionary(d) + case .collectionShare(let arg): + var d = try Serialization.getFields(TeamLog.CollectionShareTypeSerializer().serialize(arg)) + d[".tag"] = .str("collection_share") + return .dictionary(d) + case .fileTransfersFileAdd(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersFileAddTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_file_add") + return .dictionary(d) + case .fileTransfersTransferDelete(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_delete") + return .dictionary(d) + case .fileTransfersTransferDownload(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferDownloadTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_download") + return .dictionary(d) + case .fileTransfersTransferSend(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferSendTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_send") + return .dictionary(d) + case .fileTransfersTransferView(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersTransferViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_transfer_view") + return .dictionary(d) + case .noteAclInviteOnly(let arg): + var d = try Serialization.getFields(TeamLog.NoteAclInviteOnlyTypeSerializer().serialize(arg)) + d[".tag"] = .str("note_acl_invite_only") + return .dictionary(d) + case .noteAclLink(let arg): + var d = try Serialization.getFields(TeamLog.NoteAclLinkTypeSerializer().serialize(arg)) + d[".tag"] = .str("note_acl_link") + return .dictionary(d) + case .noteAclTeamLink(let arg): + var d = try Serialization.getFields(TeamLog.NoteAclTeamLinkTypeSerializer().serialize(arg)) + d[".tag"] = .str("note_acl_team_link") + return .dictionary(d) + case .noteShared(let arg): + var d = try Serialization.getFields(TeamLog.NoteSharedTypeSerializer().serialize(arg)) + d[".tag"] = .str("note_shared") + return .dictionary(d) + case .noteShareReceive(let arg): + var d = try Serialization.getFields(TeamLog.NoteShareReceiveTypeSerializer().serialize(arg)) + d[".tag"] = .str("note_share_receive") + return .dictionary(d) + case .openNoteShared(let arg): + var d = try Serialization.getFields(TeamLog.OpenNoteSharedTypeSerializer().serialize(arg)) + d[".tag"] = .str("open_note_shared") + return .dictionary(d) + case .replayFileSharedLinkCreated(let arg): + var d = try Serialization.getFields(TeamLog.ReplayFileSharedLinkCreatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("replay_file_shared_link_created") + return .dictionary(d) + case .replayFileSharedLinkModified(let arg): + var d = try Serialization.getFields(TeamLog.ReplayFileSharedLinkModifiedTypeSerializer().serialize(arg)) + d[".tag"] = .str("replay_file_shared_link_modified") + return .dictionary(d) + case .replayProjectTeamAdd(let arg): + var d = try Serialization.getFields(TeamLog.ReplayProjectTeamAddTypeSerializer().serialize(arg)) + d[".tag"] = .str("replay_project_team_add") + return .dictionary(d) + case .replayProjectTeamDelete(let arg): + var d = try Serialization.getFields(TeamLog.ReplayProjectTeamDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("replay_project_team_delete") + return .dictionary(d) + case .sfAddGroup(let arg): + var d = try Serialization.getFields(TeamLog.SfAddGroupTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_add_group") + return .dictionary(d) + case .sfAllowNonMembersToViewSharedLinks(let arg): + var d = try Serialization.getFields(TeamLog.SfAllowNonMembersToViewSharedLinksTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_allow_non_members_to_view_shared_links") + return .dictionary(d) + case .sfExternalInviteWarn(let arg): + var d = try Serialization.getFields(TeamLog.SfExternalInviteWarnTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_external_invite_warn") + return .dictionary(d) + case .sfFbInvite(let arg): + var d = try Serialization.getFields(TeamLog.SfFbInviteTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_fb_invite") + return .dictionary(d) + case .sfFbInviteChangeRole(let arg): + var d = try Serialization.getFields(TeamLog.SfFbInviteChangeRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_fb_invite_change_role") + return .dictionary(d) + case .sfFbUninvite(let arg): + var d = try Serialization.getFields(TeamLog.SfFbUninviteTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_fb_uninvite") + return .dictionary(d) + case .sfInviteGroup(let arg): + var d = try Serialization.getFields(TeamLog.SfInviteGroupTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_invite_group") + return .dictionary(d) + case .sfTeamGrantAccess(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamGrantAccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_grant_access") + return .dictionary(d) + case .sfTeamInvite(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamInviteTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_invite") + return .dictionary(d) + case .sfTeamInviteChangeRole(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamInviteChangeRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_invite_change_role") + return .dictionary(d) + case .sfTeamJoin(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamJoinTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_join") + return .dictionary(d) + case .sfTeamJoinFromOobLink(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamJoinFromOobLinkTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_join_from_oob_link") + return .dictionary(d) + case .sfTeamUninvite(let arg): + var d = try Serialization.getFields(TeamLog.SfTeamUninviteTypeSerializer().serialize(arg)) + d[".tag"] = .str("sf_team_uninvite") + return .dictionary(d) + case .sharedContentAddInvitees(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddInviteesTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_invitees") + return .dictionary(d) + case .sharedContentAddLinkExpiry(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddLinkExpiryTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_link_expiry") + return .dictionary(d) + case .sharedContentAddLinkPassword(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddLinkPasswordTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_link_password") + return .dictionary(d) + case .sharedContentAddMember(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentAddMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_add_member") + return .dictionary(d) + case .sharedContentChangeDownloadsPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeDownloadsPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_downloads_policy") + return .dictionary(d) + case .sharedContentChangeInviteeRole(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeInviteeRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_invitee_role") + return .dictionary(d) + case .sharedContentChangeLinkAudience(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeLinkAudienceTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_link_audience") + return .dictionary(d) + case .sharedContentChangeLinkExpiry(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeLinkExpiryTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_link_expiry") + return .dictionary(d) + case .sharedContentChangeLinkPassword(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeLinkPasswordTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_link_password") + return .dictionary(d) + case .sharedContentChangeMemberRole(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeMemberRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_member_role") + return .dictionary(d) + case .sharedContentChangeViewerInfoPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentChangeViewerInfoPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_change_viewer_info_policy") + return .dictionary(d) + case .sharedContentClaimInvitation(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentClaimInvitationTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_claim_invitation") + return .dictionary(d) + case .sharedContentCopy(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentCopyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_copy") + return .dictionary(d) + case .sharedContentDownload(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentDownloadTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_download") + return .dictionary(d) + case .sharedContentRelinquishMembership(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRelinquishMembershipTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_relinquish_membership") + return .dictionary(d) + case .sharedContentRemoveInvitees(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveInviteesTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_invitees") + return .dictionary(d) + case .sharedContentRemoveLinkExpiry(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveLinkExpiryTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_link_expiry") + return .dictionary(d) + case .sharedContentRemoveLinkPassword(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveLinkPasswordTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_link_password") + return .dictionary(d) + case .sharedContentRemoveMember(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRemoveMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_remove_member") + return .dictionary(d) + case .sharedContentRequestAccess(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRequestAccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_request_access") + return .dictionary(d) + case .sharedContentRestoreInvitees(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRestoreInviteesTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_restore_invitees") + return .dictionary(d) + case .sharedContentRestoreMember(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentRestoreMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_restore_member") + return .dictionary(d) + case .sharedContentUnshare(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentUnshareTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_unshare") + return .dictionary(d) + case .sharedContentView(let arg): + var d = try Serialization.getFields(TeamLog.SharedContentViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_content_view") + return .dictionary(d) + case .sharedFolderChangeLinkPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeLinkPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_link_policy") + return .dictionary(d) + case .sharedFolderChangeMembersInheritancePolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeMembersInheritancePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_members_inheritance_policy") + return .dictionary(d) + case .sharedFolderChangeMembersManagementPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeMembersManagementPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_members_management_policy") + return .dictionary(d) + case .sharedFolderChangeMembersPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderChangeMembersPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_change_members_policy") + return .dictionary(d) + case .sharedFolderCreate(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_create") + return .dictionary(d) + case .sharedFolderDeclineInvitation(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderDeclineInvitationTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_decline_invitation") + return .dictionary(d) + case .sharedFolderMount(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderMountTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_mount") + return .dictionary(d) + case .sharedFolderNest(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderNestTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_nest") + return .dictionary(d) + case .sharedFolderTransferOwnership(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderTransferOwnershipTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_transfer_ownership") + return .dictionary(d) + case .sharedFolderUnmount(let arg): + var d = try Serialization.getFields(TeamLog.SharedFolderUnmountTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_folder_unmount") + return .dictionary(d) + case .sharedLinkAddExpiry(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkAddExpiryTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_add_expiry") + return .dictionary(d) + case .sharedLinkChangeExpiry(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkChangeExpiryTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_change_expiry") + return .dictionary(d) + case .sharedLinkChangeVisibility(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkChangeVisibilityTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_change_visibility") + return .dictionary(d) + case .sharedLinkCopy(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkCopyTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_copy") + return .dictionary(d) + case .sharedLinkCreate(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_create") + return .dictionary(d) + case .sharedLinkDisable(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkDisableTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_disable") + return .dictionary(d) + case .sharedLinkDownload(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkDownloadTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_download") + return .dictionary(d) + case .sharedLinkRemoveExpiry(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkRemoveExpiryTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_remove_expiry") + return .dictionary(d) + case .sharedLinkSettingsAddExpiration(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAddExpirationTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_add_expiration") + return .dictionary(d) + case .sharedLinkSettingsAddPassword(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAddPasswordTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_add_password") + return .dictionary(d) + case .sharedLinkSettingsAllowDownloadDisabled(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadDisabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_allow_download_disabled") + return .dictionary(d) + case .sharedLinkSettingsAllowDownloadEnabled(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsAllowDownloadEnabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_allow_download_enabled") + return .dictionary(d) + case .sharedLinkSettingsChangeAudience(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsChangeAudienceTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_change_audience") + return .dictionary(d) + case .sharedLinkSettingsChangeExpiration(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsChangeExpirationTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_change_expiration") + return .dictionary(d) + case .sharedLinkSettingsChangePassword(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsChangePasswordTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_change_password") + return .dictionary(d) + case .sharedLinkSettingsRemoveExpiration(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsRemoveExpirationTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_remove_expiration") + return .dictionary(d) + case .sharedLinkSettingsRemovePassword(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkSettingsRemovePasswordTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_settings_remove_password") + return .dictionary(d) + case .sharedLinkShare(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkShareTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_share") + return .dictionary(d) + case .sharedLinkView(let arg): + var d = try Serialization.getFields(TeamLog.SharedLinkViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_link_view") + return .dictionary(d) + case .sharedNoteOpened(let arg): + var d = try Serialization.getFields(TeamLog.SharedNoteOpenedTypeSerializer().serialize(arg)) + d[".tag"] = .str("shared_note_opened") + return .dictionary(d) + case .shmodelDisableDownloads(let arg): + var d = try Serialization.getFields(TeamLog.ShmodelDisableDownloadsTypeSerializer().serialize(arg)) + d[".tag"] = .str("shmodel_disable_downloads") + return .dictionary(d) + case .shmodelEnableDownloads(let arg): + var d = try Serialization.getFields(TeamLog.ShmodelEnableDownloadsTypeSerializer().serialize(arg)) + d[".tag"] = .str("shmodel_enable_downloads") + return .dictionary(d) + case .shmodelGroupShare(let arg): + var d = try Serialization.getFields(TeamLog.ShmodelGroupShareTypeSerializer().serialize(arg)) + d[".tag"] = .str("shmodel_group_share") + return .dictionary(d) + case .showcaseAccessGranted(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseAccessGrantedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_access_granted") + return .dictionary(d) + case .showcaseAddMember(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseAddMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_add_member") + return .dictionary(d) + case .showcaseArchived(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseArchivedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_archived") + return .dictionary(d) + case .showcaseCreated(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseCreatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_created") + return .dictionary(d) + case .showcaseDeleteComment(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseDeleteCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_delete_comment") + return .dictionary(d) + case .showcaseEdited(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseEditedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_edited") + return .dictionary(d) + case .showcaseEditComment(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseEditCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_edit_comment") + return .dictionary(d) + case .showcaseFileAdded(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileAddedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_added") + return .dictionary(d) + case .showcaseFileDownload(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileDownloadTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_download") + return .dictionary(d) + case .showcaseFileRemoved(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileRemovedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_removed") + return .dictionary(d) + case .showcaseFileView(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseFileViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_file_view") + return .dictionary(d) + case .showcasePermanentlyDeleted(let arg): + var d = try Serialization.getFields(TeamLog.ShowcasePermanentlyDeletedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_permanently_deleted") + return .dictionary(d) + case .showcasePostComment(let arg): + var d = try Serialization.getFields(TeamLog.ShowcasePostCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_post_comment") + return .dictionary(d) + case .showcaseRemoveMember(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRemoveMemberTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_remove_member") + return .dictionary(d) + case .showcaseRenamed(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRenamedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_renamed") + return .dictionary(d) + case .showcaseRequestAccess(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRequestAccessTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_request_access") + return .dictionary(d) + case .showcaseResolveComment(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseResolveCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_resolve_comment") + return .dictionary(d) + case .showcaseRestored(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseRestoredTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_restored") + return .dictionary(d) + case .showcaseTrashed(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseTrashedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_trashed") + return .dictionary(d) + case .showcaseTrashedDeprecated(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseTrashedDeprecatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_trashed_deprecated") + return .dictionary(d) + case .showcaseUnresolveComment(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseUnresolveCommentTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_unresolve_comment") + return .dictionary(d) + case .showcaseUntrashed(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseUntrashedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_untrashed") + return .dictionary(d) + case .showcaseUntrashedDeprecated(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseUntrashedDeprecatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_untrashed_deprecated") + return .dictionary(d) + case .showcaseView(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_view") + return .dictionary(d) + case .ssoAddCert(let arg): + var d = try Serialization.getFields(TeamLog.SsoAddCertTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_add_cert") + return .dictionary(d) + case .ssoAddLoginUrl(let arg): + var d = try Serialization.getFields(TeamLog.SsoAddLoginUrlTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_add_login_url") + return .dictionary(d) + case .ssoAddLogoutUrl(let arg): + var d = try Serialization.getFields(TeamLog.SsoAddLogoutUrlTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_add_logout_url") + return .dictionary(d) + case .ssoChangeCert(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeCertTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_cert") + return .dictionary(d) + case .ssoChangeLoginUrl(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeLoginUrlTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_login_url") + return .dictionary(d) + case .ssoChangeLogoutUrl(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeLogoutUrlTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_logout_url") + return .dictionary(d) + case .ssoChangeSamlIdentityMode(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangeSamlIdentityModeTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_saml_identity_mode") + return .dictionary(d) + case .ssoRemoveCert(let arg): + var d = try Serialization.getFields(TeamLog.SsoRemoveCertTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_remove_cert") + return .dictionary(d) + case .ssoRemoveLoginUrl(let arg): + var d = try Serialization.getFields(TeamLog.SsoRemoveLoginUrlTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_remove_login_url") + return .dictionary(d) + case .ssoRemoveLogoutUrl(let arg): + var d = try Serialization.getFields(TeamLog.SsoRemoveLogoutUrlTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_remove_logout_url") + return .dictionary(d) + case .teamFolderChangeStatus(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderChangeStatusTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_change_status") + return .dictionary(d) + case .teamFolderCreate(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderCreateTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_create") + return .dictionary(d) + case .teamFolderDowngrade(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderDowngradeTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_downgrade") + return .dictionary(d) + case .teamFolderPermanentlyDelete(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderPermanentlyDeleteTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_permanently_delete") + return .dictionary(d) + case .teamFolderRename(let arg): + var d = try Serialization.getFields(TeamLog.TeamFolderRenameTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_folder_rename") + return .dictionary(d) + case .teamSelectiveSyncSettingsChanged(let arg): + var d = try Serialization.getFields(TeamLog.TeamSelectiveSyncSettingsChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_selective_sync_settings_changed") + return .dictionary(d) + case .accountCaptureChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.AccountCaptureChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("account_capture_change_policy") + return .dictionary(d) + case .adminEmailRemindersChanged(let arg): + var d = try Serialization.getFields(TeamLog.AdminEmailRemindersChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("admin_email_reminders_changed") + return .dictionary(d) + case .allowDownloadDisabled(let arg): + var d = try Serialization.getFields(TeamLog.AllowDownloadDisabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("allow_download_disabled") + return .dictionary(d) + case .allowDownloadEnabled(let arg): + var d = try Serialization.getFields(TeamLog.AllowDownloadEnabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("allow_download_enabled") + return .dictionary(d) + case .appPermissionsChanged(let arg): + var d = try Serialization.getFields(TeamLog.AppPermissionsChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("app_permissions_changed") + return .dictionary(d) + case .cameraUploadsPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.CameraUploadsPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("camera_uploads_policy_changed") + return .dictionary(d) + case .captureTranscriptPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.CaptureTranscriptPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("capture_transcript_policy_changed") + return .dictionary(d) + case .classificationChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.ClassificationChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("classification_change_policy") + return .dictionary(d) + case .computerBackupPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.ComputerBackupPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("computer_backup_policy_changed") + return .dictionary(d) + case .contentAdministrationPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.ContentAdministrationPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("content_administration_policy_changed") + return .dictionary(d) + case .dataPlacementRestrictionChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.DataPlacementRestrictionChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("data_placement_restriction_change_policy") + return .dictionary(d) + case .dataPlacementRestrictionSatisfyPolicy(let arg): + var d = try Serialization.getFields(TeamLog.DataPlacementRestrictionSatisfyPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("data_placement_restriction_satisfy_policy") + return .dictionary(d) + case .deviceApprovalsAddException(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsAddExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_add_exception") + return .dictionary(d) + case .deviceApprovalsChangeDesktopPolicy(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeDesktopPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_desktop_policy") + return .dictionary(d) + case .deviceApprovalsChangeMobilePolicy(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeMobilePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_mobile_policy") + return .dictionary(d) + case .deviceApprovalsChangeOverageAction(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeOverageActionTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_overage_action") + return .dictionary(d) + case .deviceApprovalsChangeUnlinkAction(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsChangeUnlinkActionTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_change_unlink_action") + return .dictionary(d) + case .deviceApprovalsRemoveException(let arg): + var d = try Serialization.getFields(TeamLog.DeviceApprovalsRemoveExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("device_approvals_remove_exception") + return .dictionary(d) + case .directoryRestrictionsAddMembers(let arg): + var d = try Serialization.getFields(TeamLog.DirectoryRestrictionsAddMembersTypeSerializer().serialize(arg)) + d[".tag"] = .str("directory_restrictions_add_members") + return .dictionary(d) + case .directoryRestrictionsRemoveMembers(let arg): + var d = try Serialization.getFields(TeamLog.DirectoryRestrictionsRemoveMembersTypeSerializer().serialize(arg)) + d[".tag"] = .str("directory_restrictions_remove_members") + return .dictionary(d) + case .dropboxPasswordsPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.DropboxPasswordsPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("dropbox_passwords_policy_changed") + return .dictionary(d) + case .emailIngestPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.EmailIngestPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("email_ingest_policy_changed") + return .dictionary(d) + case .emmAddException(let arg): + var d = try Serialization.getFields(TeamLog.EmmAddExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("emm_add_exception") + return .dictionary(d) + case .emmChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.EmmChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("emm_change_policy") + return .dictionary(d) + case .emmRemoveException(let arg): + var d = try Serialization.getFields(TeamLog.EmmRemoveExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("emm_remove_exception") + return .dictionary(d) + case .extendedVersionHistoryChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.ExtendedVersionHistoryChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("extended_version_history_change_policy") + return .dictionary(d) + case .externalDriveBackupPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.ExternalDriveBackupPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("external_drive_backup_policy_changed") + return .dictionary(d) + case .fileCommentsChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.FileCommentsChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_comments_change_policy") + return .dictionary(d) + case .fileLockingPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.FileLockingPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_locking_policy_changed") + return .dictionary(d) + case .fileProviderMigrationPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.FileProviderMigrationPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_provider_migration_policy_changed") + return .dictionary(d) + case .fileRequestsChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestsChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_requests_change_policy") + return .dictionary(d) + case .fileRequestsEmailsEnabled(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestsEmailsEnabledTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_requests_emails_enabled") + return .dictionary(d) + case .fileRequestsEmailsRestrictedToTeamOnly(let arg): + var d = try Serialization.getFields(TeamLog.FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_requests_emails_restricted_to_team_only") + return .dictionary(d) + case .fileTransfersPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.FileTransfersPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("file_transfers_policy_changed") + return .dictionary(d) + case .folderLinkRestrictionPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.FolderLinkRestrictionPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("folder_link_restriction_policy_changed") + return .dictionary(d) + case .googleSsoChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.GoogleSsoChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("google_sso_change_policy") + return .dictionary(d) + case .groupUserManagementChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.GroupUserManagementChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("group_user_management_change_policy") + return .dictionary(d) + case .integrationPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.IntegrationPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("integration_policy_changed") + return .dictionary(d) + case .inviteAcceptanceEmailPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.InviteAcceptanceEmailPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("invite_acceptance_email_policy_changed") + return .dictionary(d) + case .memberRequestsChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.MemberRequestsChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_requests_change_policy") + return .dictionary(d) + case .memberSendInvitePolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.MemberSendInvitePolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_send_invite_policy_changed") + return .dictionary(d) + case .memberSpaceLimitsAddException(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsAddExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_add_exception") + return .dictionary(d) + case .memberSpaceLimitsChangeCapsTypePolicy(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_caps_type_policy") + return .dictionary(d) + case .memberSpaceLimitsChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_change_policy") + return .dictionary(d) + case .memberSpaceLimitsRemoveException(let arg): + var d = try Serialization.getFields(TeamLog.MemberSpaceLimitsRemoveExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_space_limits_remove_exception") + return .dictionary(d) + case .memberSuggestionsChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.MemberSuggestionsChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("member_suggestions_change_policy") + return .dictionary(d) + case .microsoftOfficeAddinChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.MicrosoftOfficeAddinChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("microsoft_office_addin_change_policy") + return .dictionary(d) + case .networkControlChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.NetworkControlChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("network_control_change_policy") + return .dictionary(d) + case .paperChangeDeploymentPolicy(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangeDeploymentPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_deployment_policy") + return .dictionary(d) + case .paperChangeMemberLinkPolicy(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangeMemberLinkPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_member_link_policy") + return .dictionary(d) + case .paperChangeMemberPolicy(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangeMemberPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_member_policy") + return .dictionary(d) + case .paperChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.PaperChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_change_policy") + return .dictionary(d) + case .paperDefaultFolderPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.PaperDefaultFolderPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_default_folder_policy_changed") + return .dictionary(d) + case .paperDesktopPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.PaperDesktopPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_desktop_policy_changed") + return .dictionary(d) + case .paperEnabledUsersGroupAddition(let arg): + var d = try Serialization.getFields(TeamLog.PaperEnabledUsersGroupAdditionTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_enabled_users_group_addition") + return .dictionary(d) + case .paperEnabledUsersGroupRemoval(let arg): + var d = try Serialization.getFields(TeamLog.PaperEnabledUsersGroupRemovalTypeSerializer().serialize(arg)) + d[".tag"] = .str("paper_enabled_users_group_removal") + return .dictionary(d) + case .passwordStrengthRequirementsChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.PasswordStrengthRequirementsChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("password_strength_requirements_change_policy") + return .dictionary(d) + case .permanentDeleteChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.PermanentDeleteChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("permanent_delete_change_policy") + return .dictionary(d) + case .resellerSupportChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.ResellerSupportChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("reseller_support_change_policy") + return .dictionary(d) + case .rewindPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.RewindPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("rewind_policy_changed") + return .dictionary(d) + case .sendForSignaturePolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.SendForSignaturePolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("send_for_signature_policy_changed") + return .dictionary(d) + case .sharingChangeFolderJoinPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeFolderJoinPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_folder_join_policy") + return .dictionary(d) + case .sharingChangeLinkAllowChangeExpirationPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_allow_change_expiration_policy") + return .dictionary(d) + case .sharingChangeLinkDefaultExpirationPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkDefaultExpirationPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_default_expiration_policy") + return .dictionary(d) + case .sharingChangeLinkEnforcePasswordPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkEnforcePasswordPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_enforce_password_policy") + return .dictionary(d) + case .sharingChangeLinkPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeLinkPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_link_policy") + return .dictionary(d) + case .sharingChangeMemberPolicy(let arg): + var d = try Serialization.getFields(TeamLog.SharingChangeMemberPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("sharing_change_member_policy") + return .dictionary(d) + case .showcaseChangeDownloadPolicy(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseChangeDownloadPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_change_download_policy") + return .dictionary(d) + case .showcaseChangeEnabledPolicy(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseChangeEnabledPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_change_enabled_policy") + return .dictionary(d) + case .showcaseChangeExternalSharingPolicy(let arg): + var d = try Serialization.getFields(TeamLog.ShowcaseChangeExternalSharingPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("showcase_change_external_sharing_policy") + return .dictionary(d) + case .smarterSmartSyncPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.SmarterSmartSyncPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("smarter_smart_sync_policy_changed") + return .dictionary(d) + case .smartSyncChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_change_policy") + return .dictionary(d) + case .smartSyncNotOptOut(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncNotOptOutTypeSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_not_opt_out") + return .dictionary(d) + case .smartSyncOptOut(let arg): + var d = try Serialization.getFields(TeamLog.SmartSyncOptOutTypeSerializer().serialize(arg)) + d[".tag"] = .str("smart_sync_opt_out") + return .dictionary(d) + case .ssoChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.SsoChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("sso_change_policy") + return .dictionary(d) + case .teamBrandingPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.TeamBrandingPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_branding_policy_changed") + return .dictionary(d) + case .teamExtensionsPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.TeamExtensionsPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_extensions_policy_changed") + return .dictionary(d) + case .teamSelectiveSyncPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.TeamSelectiveSyncPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_selective_sync_policy_changed") + return .dictionary(d) + case .teamSharingWhitelistSubjectsChanged(let arg): + var d = try Serialization.getFields(TeamLog.TeamSharingWhitelistSubjectsChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_sharing_whitelist_subjects_changed") + return .dictionary(d) + case .tfaAddException(let arg): + var d = try Serialization.getFields(TeamLog.TfaAddExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_add_exception") + return .dictionary(d) + case .tfaChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.TfaChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_change_policy") + return .dictionary(d) + case .tfaRemoveException(let arg): + var d = try Serialization.getFields(TeamLog.TfaRemoveExceptionTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_remove_exception") + return .dictionary(d) + case .twoAccountChangePolicy(let arg): + var d = try Serialization.getFields(TeamLog.TwoAccountChangePolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("two_account_change_policy") + return .dictionary(d) + case .viewerInfoPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.ViewerInfoPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("viewer_info_policy_changed") + return .dictionary(d) + case .watermarkingPolicyChanged(let arg): + var d = try Serialization.getFields(TeamLog.WatermarkingPolicyChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("watermarking_policy_changed") + return .dictionary(d) + case .webSessionsChangeActiveSessionLimit(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionsChangeActiveSessionLimitTypeSerializer().serialize(arg)) + d[".tag"] = .str("web_sessions_change_active_session_limit") + return .dictionary(d) + case .webSessionsChangeFixedLengthPolicy(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionsChangeFixedLengthPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("web_sessions_change_fixed_length_policy") + return .dictionary(d) + case .webSessionsChangeIdleLengthPolicy(let arg): + var d = try Serialization.getFields(TeamLog.WebSessionsChangeIdleLengthPolicyTypeSerializer().serialize(arg)) + d[".tag"] = .str("web_sessions_change_idle_length_policy") + return .dictionary(d) + case .dataResidencyMigrationRequestSuccessful(let arg): + var d = try Serialization.getFields(TeamLog.DataResidencyMigrationRequestSuccessfulTypeSerializer().serialize(arg)) + d[".tag"] = .str("data_residency_migration_request_successful") + return .dictionary(d) + case .dataResidencyMigrationRequestUnsuccessful(let arg): + var d = try Serialization.getFields(TeamLog.DataResidencyMigrationRequestUnsuccessfulTypeSerializer().serialize(arg)) + d[".tag"] = .str("data_residency_migration_request_unsuccessful") + return .dictionary(d) + case .teamMergeFrom(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeFromTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_from") + return .dictionary(d) + case .teamMergeTo(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeToTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_to") + return .dictionary(d) + case .teamProfileAddBackground(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileAddBackgroundTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_add_background") + return .dictionary(d) + case .teamProfileAddLogo(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileAddLogoTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_add_logo") + return .dictionary(d) + case .teamProfileChangeBackground(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeBackgroundTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_background") + return .dictionary(d) + case .teamProfileChangeDefaultLanguage(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeDefaultLanguageTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_default_language") + return .dictionary(d) + case .teamProfileChangeLogo(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeLogoTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_logo") + return .dictionary(d) + case .teamProfileChangeName(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileChangeNameTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_change_name") + return .dictionary(d) + case .teamProfileRemoveBackground(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileRemoveBackgroundTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_remove_background") + return .dictionary(d) + case .teamProfileRemoveLogo(let arg): + var d = try Serialization.getFields(TeamLog.TeamProfileRemoveLogoTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_profile_remove_logo") + return .dictionary(d) + case .tfaAddBackupPhone(let arg): + var d = try Serialization.getFields(TeamLog.TfaAddBackupPhoneTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_add_backup_phone") + return .dictionary(d) + case .tfaAddSecurityKey(let arg): + var d = try Serialization.getFields(TeamLog.TfaAddSecurityKeyTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_add_security_key") + return .dictionary(d) + case .tfaChangeBackupPhone(let arg): + var d = try Serialization.getFields(TeamLog.TfaChangeBackupPhoneTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_change_backup_phone") + return .dictionary(d) + case .tfaChangeStatus(let arg): + var d = try Serialization.getFields(TeamLog.TfaChangeStatusTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_change_status") + return .dictionary(d) + case .tfaRemoveBackupPhone(let arg): + var d = try Serialization.getFields(TeamLog.TfaRemoveBackupPhoneTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_remove_backup_phone") + return .dictionary(d) + case .tfaRemoveSecurityKey(let arg): + var d = try Serialization.getFields(TeamLog.TfaRemoveSecurityKeyTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_remove_security_key") + return .dictionary(d) + case .tfaReset(let arg): + var d = try Serialization.getFields(TeamLog.TfaResetTypeSerializer().serialize(arg)) + d[".tag"] = .str("tfa_reset") + return .dictionary(d) + case .changedEnterpriseAdminRole(let arg): + var d = try Serialization.getFields(TeamLog.ChangedEnterpriseAdminRoleTypeSerializer().serialize(arg)) + d[".tag"] = .str("changed_enterprise_admin_role") + return .dictionary(d) + case .changedEnterpriseConnectedTeamStatus(let arg): + var d = try Serialization.getFields(TeamLog.ChangedEnterpriseConnectedTeamStatusTypeSerializer().serialize(arg)) + d[".tag"] = .str("changed_enterprise_connected_team_status") + return .dictionary(d) + case .endedEnterpriseAdminSession(let arg): + var d = try Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionTypeSerializer().serialize(arg)) + d[".tag"] = .str("ended_enterprise_admin_session") + return .dictionary(d) + case .endedEnterpriseAdminSessionDeprecated(let arg): + var d = try Serialization.getFields(TeamLog.EndedEnterpriseAdminSessionDeprecatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("ended_enterprise_admin_session_deprecated") + return .dictionary(d) + case .enterpriseSettingsLocking(let arg): + var d = try Serialization.getFields(TeamLog.EnterpriseSettingsLockingTypeSerializer().serialize(arg)) + d[".tag"] = .str("enterprise_settings_locking") + return .dictionary(d) + case .guestAdminChangeStatus(let arg): + var d = try Serialization.getFields(TeamLog.GuestAdminChangeStatusTypeSerializer().serialize(arg)) + d[".tag"] = .str("guest_admin_change_status") + return .dictionary(d) + case .startedEnterpriseAdminSession(let arg): + var d = try Serialization.getFields(TeamLog.StartedEnterpriseAdminSessionTypeSerializer().serialize(arg)) + d[".tag"] = .str("started_enterprise_admin_session") + return .dictionary(d) + case .teamMergeRequestAccepted(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAcceptedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_accepted") + return .dictionary(d) + case .teamMergeRequestAcceptedShownToPrimaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_accepted_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestAcceptedShownToSecondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_accepted_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestAutoCanceled(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestAutoCanceledTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_auto_canceled") + return .dictionary(d) + case .teamMergeRequestCanceled(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestCanceledTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_canceled") + return .dictionary(d) + case .teamMergeRequestCanceledShownToPrimaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_canceled_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestCanceledShownToSecondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_canceled_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestExpired(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestExpiredTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_expired") + return .dictionary(d) + case .teamMergeRequestExpiredShownToPrimaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_expired_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestExpiredShownToSecondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_expired_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestRejectedShownToPrimaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_rejected_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestRejectedShownToSecondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_rejected_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestReminder(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestReminderTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_reminder") + return .dictionary(d) + case .teamMergeRequestReminderShownToPrimaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_reminder_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestReminderShownToSecondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_reminder_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestRevoked(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestRevokedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_revoked") + return .dictionary(d) + case .teamMergeRequestSentShownToPrimaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestSentShownToPrimaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_sent_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestSentShownToSecondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.TeamMergeRequestSentShownToSecondaryTeamTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_merge_request_sent_shown_to_secondary_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> EventType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admin_alerting_alert_state_changed": + let v = try TeamLog.AdminAlertingAlertStateChangedTypeSerializer().deserialize(json) + return EventType.adminAlertingAlertStateChanged(v) + case "admin_alerting_changed_alert_config": + let v = try TeamLog.AdminAlertingChangedAlertConfigTypeSerializer().deserialize(json) + return EventType.adminAlertingChangedAlertConfig(v) + case "admin_alerting_triggered_alert": + let v = try TeamLog.AdminAlertingTriggeredAlertTypeSerializer().deserialize(json) + return EventType.adminAlertingTriggeredAlert(v) + case "ransomware_restore_process_completed": + let v = try TeamLog.RansomwareRestoreProcessCompletedTypeSerializer().deserialize(json) + return EventType.ransomwareRestoreProcessCompleted(v) + case "ransomware_restore_process_started": + let v = try TeamLog.RansomwareRestoreProcessStartedTypeSerializer().deserialize(json) + return EventType.ransomwareRestoreProcessStarted(v) + case "app_blocked_by_permissions": + let v = try TeamLog.AppBlockedByPermissionsTypeSerializer().deserialize(json) + return EventType.appBlockedByPermissions(v) + case "app_link_team": + let v = try TeamLog.AppLinkTeamTypeSerializer().deserialize(json) + return EventType.appLinkTeam(v) + case "app_link_user": + let v = try TeamLog.AppLinkUserTypeSerializer().deserialize(json) + return EventType.appLinkUser(v) + case "app_unlink_team": + let v = try TeamLog.AppUnlinkTeamTypeSerializer().deserialize(json) + return EventType.appUnlinkTeam(v) + case "app_unlink_user": + let v = try TeamLog.AppUnlinkUserTypeSerializer().deserialize(json) + return EventType.appUnlinkUser(v) + case "integration_connected": + let v = try TeamLog.IntegrationConnectedTypeSerializer().deserialize(json) + return EventType.integrationConnected(v) + case "integration_disconnected": + let v = try TeamLog.IntegrationDisconnectedTypeSerializer().deserialize(json) + return EventType.integrationDisconnected(v) + case "file_add_comment": + let v = try TeamLog.FileAddCommentTypeSerializer().deserialize(json) + return EventType.fileAddComment(v) + case "file_change_comment_subscription": + let v = try TeamLog.FileChangeCommentSubscriptionTypeSerializer().deserialize(json) + return EventType.fileChangeCommentSubscription(v) + case "file_delete_comment": + let v = try TeamLog.FileDeleteCommentTypeSerializer().deserialize(json) + return EventType.fileDeleteComment(v) + case "file_edit_comment": + let v = try TeamLog.FileEditCommentTypeSerializer().deserialize(json) + return EventType.fileEditComment(v) + case "file_like_comment": + let v = try TeamLog.FileLikeCommentTypeSerializer().deserialize(json) + return EventType.fileLikeComment(v) + case "file_resolve_comment": + let v = try TeamLog.FileResolveCommentTypeSerializer().deserialize(json) + return EventType.fileResolveComment(v) + case "file_unlike_comment": + let v = try TeamLog.FileUnlikeCommentTypeSerializer().deserialize(json) + return EventType.fileUnlikeComment(v) + case "file_unresolve_comment": + let v = try TeamLog.FileUnresolveCommentTypeSerializer().deserialize(json) + return EventType.fileUnresolveComment(v) + case "governance_policy_add_folders": + let v = try TeamLog.GovernancePolicyAddFoldersTypeSerializer().deserialize(json) + return EventType.governancePolicyAddFolders(v) + case "governance_policy_add_folder_failed": + let v = try TeamLog.GovernancePolicyAddFolderFailedTypeSerializer().deserialize(json) + return EventType.governancePolicyAddFolderFailed(v) + case "governance_policy_content_disposed": + let v = try TeamLog.GovernancePolicyContentDisposedTypeSerializer().deserialize(json) + return EventType.governancePolicyContentDisposed(v) + case "governance_policy_create": + let v = try TeamLog.GovernancePolicyCreateTypeSerializer().deserialize(json) + return EventType.governancePolicyCreate(v) + case "governance_policy_delete": + let v = try TeamLog.GovernancePolicyDeleteTypeSerializer().deserialize(json) + return EventType.governancePolicyDelete(v) + case "governance_policy_edit_details": + let v = try TeamLog.GovernancePolicyEditDetailsTypeSerializer().deserialize(json) + return EventType.governancePolicyEditDetails(v) + case "governance_policy_edit_duration": + let v = try TeamLog.GovernancePolicyEditDurationTypeSerializer().deserialize(json) + return EventType.governancePolicyEditDuration(v) + case "governance_policy_export_created": + let v = try TeamLog.GovernancePolicyExportCreatedTypeSerializer().deserialize(json) + return EventType.governancePolicyExportCreated(v) + case "governance_policy_export_removed": + let v = try TeamLog.GovernancePolicyExportRemovedTypeSerializer().deserialize(json) + return EventType.governancePolicyExportRemoved(v) + case "governance_policy_remove_folders": + let v = try TeamLog.GovernancePolicyRemoveFoldersTypeSerializer().deserialize(json) + return EventType.governancePolicyRemoveFolders(v) + case "governance_policy_report_created": + let v = try TeamLog.GovernancePolicyReportCreatedTypeSerializer().deserialize(json) + return EventType.governancePolicyReportCreated(v) + case "governance_policy_zip_part_downloaded": + let v = try TeamLog.GovernancePolicyZipPartDownloadedTypeSerializer().deserialize(json) + return EventType.governancePolicyZipPartDownloaded(v) + case "legal_holds_activate_a_hold": + let v = try TeamLog.LegalHoldsActivateAHoldTypeSerializer().deserialize(json) + return EventType.legalHoldsActivateAHold(v) + case "legal_holds_add_members": + let v = try TeamLog.LegalHoldsAddMembersTypeSerializer().deserialize(json) + return EventType.legalHoldsAddMembers(v) + case "legal_holds_change_hold_details": + let v = try TeamLog.LegalHoldsChangeHoldDetailsTypeSerializer().deserialize(json) + return EventType.legalHoldsChangeHoldDetails(v) + case "legal_holds_change_hold_name": + let v = try TeamLog.LegalHoldsChangeHoldNameTypeSerializer().deserialize(json) + return EventType.legalHoldsChangeHoldName(v) + case "legal_holds_export_a_hold": + let v = try TeamLog.LegalHoldsExportAHoldTypeSerializer().deserialize(json) + return EventType.legalHoldsExportAHold(v) + case "legal_holds_export_cancelled": + let v = try TeamLog.LegalHoldsExportCancelledTypeSerializer().deserialize(json) + return EventType.legalHoldsExportCancelled(v) + case "legal_holds_export_downloaded": + let v = try TeamLog.LegalHoldsExportDownloadedTypeSerializer().deserialize(json) + return EventType.legalHoldsExportDownloaded(v) + case "legal_holds_export_removed": + let v = try TeamLog.LegalHoldsExportRemovedTypeSerializer().deserialize(json) + return EventType.legalHoldsExportRemoved(v) + case "legal_holds_release_a_hold": + let v = try TeamLog.LegalHoldsReleaseAHoldTypeSerializer().deserialize(json) + return EventType.legalHoldsReleaseAHold(v) + case "legal_holds_remove_members": + let v = try TeamLog.LegalHoldsRemoveMembersTypeSerializer().deserialize(json) + return EventType.legalHoldsRemoveMembers(v) + case "legal_holds_report_a_hold": + let v = try TeamLog.LegalHoldsReportAHoldTypeSerializer().deserialize(json) + return EventType.legalHoldsReportAHold(v) + case "device_change_ip_desktop": + let v = try TeamLog.DeviceChangeIpDesktopTypeSerializer().deserialize(json) + return EventType.deviceChangeIpDesktop(v) + case "device_change_ip_mobile": + let v = try TeamLog.DeviceChangeIpMobileTypeSerializer().deserialize(json) + return EventType.deviceChangeIpMobile(v) + case "device_change_ip_web": + let v = try TeamLog.DeviceChangeIpWebTypeSerializer().deserialize(json) + return EventType.deviceChangeIpWeb(v) + case "device_delete_on_unlink_fail": + let v = try TeamLog.DeviceDeleteOnUnlinkFailTypeSerializer().deserialize(json) + return EventType.deviceDeleteOnUnlinkFail(v) + case "device_delete_on_unlink_success": + let v = try TeamLog.DeviceDeleteOnUnlinkSuccessTypeSerializer().deserialize(json) + return EventType.deviceDeleteOnUnlinkSuccess(v) + case "device_link_fail": + let v = try TeamLog.DeviceLinkFailTypeSerializer().deserialize(json) + return EventType.deviceLinkFail(v) + case "device_link_success": + let v = try TeamLog.DeviceLinkSuccessTypeSerializer().deserialize(json) + return EventType.deviceLinkSuccess(v) + case "device_management_disabled": + let v = try TeamLog.DeviceManagementDisabledTypeSerializer().deserialize(json) + return EventType.deviceManagementDisabled(v) + case "device_management_enabled": + let v = try TeamLog.DeviceManagementEnabledTypeSerializer().deserialize(json) + return EventType.deviceManagementEnabled(v) + case "device_sync_backup_status_changed": + let v = try TeamLog.DeviceSyncBackupStatusChangedTypeSerializer().deserialize(json) + return EventType.deviceSyncBackupStatusChanged(v) + case "device_unlink": + let v = try TeamLog.DeviceUnlinkTypeSerializer().deserialize(json) + return EventType.deviceUnlink(v) + case "dropbox_passwords_exported": + let v = try TeamLog.DropboxPasswordsExportedTypeSerializer().deserialize(json) + return EventType.dropboxPasswordsExported(v) + case "dropbox_passwords_new_device_enrolled": + let v = try TeamLog.DropboxPasswordsNewDeviceEnrolledTypeSerializer().deserialize(json) + return EventType.dropboxPasswordsNewDeviceEnrolled(v) + case "emm_refresh_auth_token": + let v = try TeamLog.EmmRefreshAuthTokenTypeSerializer().deserialize(json) + return EventType.emmRefreshAuthToken(v) + case "external_drive_backup_eligibility_status_checked": + let v = try TeamLog.ExternalDriveBackupEligibilityStatusCheckedTypeSerializer().deserialize(json) + return EventType.externalDriveBackupEligibilityStatusChecked(v) + case "external_drive_backup_status_changed": + let v = try TeamLog.ExternalDriveBackupStatusChangedTypeSerializer().deserialize(json) + return EventType.externalDriveBackupStatusChanged(v) + case "account_capture_change_availability": + let v = try TeamLog.AccountCaptureChangeAvailabilityTypeSerializer().deserialize(json) + return EventType.accountCaptureChangeAvailability(v) + case "account_capture_migrate_account": + let v = try TeamLog.AccountCaptureMigrateAccountTypeSerializer().deserialize(json) + return EventType.accountCaptureMigrateAccount(v) + case "account_capture_notification_emails_sent": + let v = try TeamLog.AccountCaptureNotificationEmailsSentTypeSerializer().deserialize(json) + return EventType.accountCaptureNotificationEmailsSent(v) + case "account_capture_relinquish_account": + let v = try TeamLog.AccountCaptureRelinquishAccountTypeSerializer().deserialize(json) + return EventType.accountCaptureRelinquishAccount(v) + case "disabled_domain_invites": + let v = try TeamLog.DisabledDomainInvitesTypeSerializer().deserialize(json) + return EventType.disabledDomainInvites(v) + case "domain_invites_approve_request_to_join_team": + let v = try TeamLog.DomainInvitesApproveRequestToJoinTeamTypeSerializer().deserialize(json) + return EventType.domainInvitesApproveRequestToJoinTeam(v) + case "domain_invites_decline_request_to_join_team": + let v = try TeamLog.DomainInvitesDeclineRequestToJoinTeamTypeSerializer().deserialize(json) + return EventType.domainInvitesDeclineRequestToJoinTeam(v) + case "domain_invites_email_existing_users": + let v = try TeamLog.DomainInvitesEmailExistingUsersTypeSerializer().deserialize(json) + return EventType.domainInvitesEmailExistingUsers(v) + case "domain_invites_request_to_join_team": + let v = try TeamLog.DomainInvitesRequestToJoinTeamTypeSerializer().deserialize(json) + return EventType.domainInvitesRequestToJoinTeam(v) + case "domain_invites_set_invite_new_user_pref_to_no": + let v = try TeamLog.DomainInvitesSetInviteNewUserPrefToNoTypeSerializer().deserialize(json) + return EventType.domainInvitesSetInviteNewUserPrefToNo(v) + case "domain_invites_set_invite_new_user_pref_to_yes": + let v = try TeamLog.DomainInvitesSetInviteNewUserPrefToYesTypeSerializer().deserialize(json) + return EventType.domainInvitesSetInviteNewUserPrefToYes(v) + case "domain_verification_add_domain_fail": + let v = try TeamLog.DomainVerificationAddDomainFailTypeSerializer().deserialize(json) + return EventType.domainVerificationAddDomainFail(v) + case "domain_verification_add_domain_success": + let v = try TeamLog.DomainVerificationAddDomainSuccessTypeSerializer().deserialize(json) + return EventType.domainVerificationAddDomainSuccess(v) + case "domain_verification_remove_domain": + let v = try TeamLog.DomainVerificationRemoveDomainTypeSerializer().deserialize(json) + return EventType.domainVerificationRemoveDomain(v) + case "enabled_domain_invites": + let v = try TeamLog.EnabledDomainInvitesTypeSerializer().deserialize(json) + return EventType.enabledDomainInvites(v) + case "team_encryption_key_cancel_key_deletion": + let v = try TeamLog.TeamEncryptionKeyCancelKeyDeletionTypeSerializer().deserialize(json) + return EventType.teamEncryptionKeyCancelKeyDeletion(v) + case "team_encryption_key_create_key": + let v = try TeamLog.TeamEncryptionKeyCreateKeyTypeSerializer().deserialize(json) + return EventType.teamEncryptionKeyCreateKey(v) + case "team_encryption_key_delete_key": + let v = try TeamLog.TeamEncryptionKeyDeleteKeyTypeSerializer().deserialize(json) + return EventType.teamEncryptionKeyDeleteKey(v) + case "team_encryption_key_disable_key": + let v = try TeamLog.TeamEncryptionKeyDisableKeyTypeSerializer().deserialize(json) + return EventType.teamEncryptionKeyDisableKey(v) + case "team_encryption_key_enable_key": + let v = try TeamLog.TeamEncryptionKeyEnableKeyTypeSerializer().deserialize(json) + return EventType.teamEncryptionKeyEnableKey(v) + case "team_encryption_key_rotate_key": + let v = try TeamLog.TeamEncryptionKeyRotateKeyTypeSerializer().deserialize(json) + return EventType.teamEncryptionKeyRotateKey(v) + case "team_encryption_key_schedule_key_deletion": + let v = try TeamLog.TeamEncryptionKeyScheduleKeyDeletionTypeSerializer().deserialize(json) + return EventType.teamEncryptionKeyScheduleKeyDeletion(v) + case "apply_naming_convention": + let v = try TeamLog.ApplyNamingConventionTypeSerializer().deserialize(json) + return EventType.applyNamingConvention(v) + case "create_folder": + let v = try TeamLog.CreateFolderTypeSerializer().deserialize(json) + return EventType.createFolder(v) + case "file_add": + let v = try TeamLog.FileAddTypeSerializer().deserialize(json) + return EventType.fileAdd(v) + case "file_add_from_automation": + let v = try TeamLog.FileAddFromAutomationTypeSerializer().deserialize(json) + return EventType.fileAddFromAutomation(v) + case "file_copy": + let v = try TeamLog.FileCopyTypeSerializer().deserialize(json) + return EventType.fileCopy(v) + case "file_delete": + let v = try TeamLog.FileDeleteTypeSerializer().deserialize(json) + return EventType.fileDelete(v) + case "file_download": + let v = try TeamLog.FileDownloadTypeSerializer().deserialize(json) + return EventType.fileDownload(v) + case "file_edit": + let v = try TeamLog.FileEditTypeSerializer().deserialize(json) + return EventType.fileEdit(v) + case "file_get_copy_reference": + let v = try TeamLog.FileGetCopyReferenceTypeSerializer().deserialize(json) + return EventType.fileGetCopyReference(v) + case "file_locking_lock_status_changed": + let v = try TeamLog.FileLockingLockStatusChangedTypeSerializer().deserialize(json) + return EventType.fileLockingLockStatusChanged(v) + case "file_move": + let v = try TeamLog.FileMoveTypeSerializer().deserialize(json) + return EventType.fileMove(v) + case "file_permanently_delete": + let v = try TeamLog.FilePermanentlyDeleteTypeSerializer().deserialize(json) + return EventType.filePermanentlyDelete(v) + case "file_preview": + let v = try TeamLog.FilePreviewTypeSerializer().deserialize(json) + return EventType.filePreview(v) + case "file_rename": + let v = try TeamLog.FileRenameTypeSerializer().deserialize(json) + return EventType.fileRename(v) + case "file_restore": + let v = try TeamLog.FileRestoreTypeSerializer().deserialize(json) + return EventType.fileRestore(v) + case "file_revert": + let v = try TeamLog.FileRevertTypeSerializer().deserialize(json) + return EventType.fileRevert(v) + case "file_rollback_changes": + let v = try TeamLog.FileRollbackChangesTypeSerializer().deserialize(json) + return EventType.fileRollbackChanges(v) + case "file_save_copy_reference": + let v = try TeamLog.FileSaveCopyReferenceTypeSerializer().deserialize(json) + return EventType.fileSaveCopyReference(v) + case "folder_overview_description_changed": + let v = try TeamLog.FolderOverviewDescriptionChangedTypeSerializer().deserialize(json) + return EventType.folderOverviewDescriptionChanged(v) + case "folder_overview_item_pinned": + let v = try TeamLog.FolderOverviewItemPinnedTypeSerializer().deserialize(json) + return EventType.folderOverviewItemPinned(v) + case "folder_overview_item_unpinned": + let v = try TeamLog.FolderOverviewItemUnpinnedTypeSerializer().deserialize(json) + return EventType.folderOverviewItemUnpinned(v) + case "object_label_added": + let v = try TeamLog.ObjectLabelAddedTypeSerializer().deserialize(json) + return EventType.objectLabelAdded(v) + case "object_label_removed": + let v = try TeamLog.ObjectLabelRemovedTypeSerializer().deserialize(json) + return EventType.objectLabelRemoved(v) + case "object_label_updated_value": + let v = try TeamLog.ObjectLabelUpdatedValueTypeSerializer().deserialize(json) + return EventType.objectLabelUpdatedValue(v) + case "organize_folder_with_tidy": + let v = try TeamLog.OrganizeFolderWithTidyTypeSerializer().deserialize(json) + return EventType.organizeFolderWithTidy(v) + case "replay_file_delete": + let v = try TeamLog.ReplayFileDeleteTypeSerializer().deserialize(json) + return EventType.replayFileDelete(v) + case "rewind_folder": + let v = try TeamLog.RewindFolderTypeSerializer().deserialize(json) + return EventType.rewindFolder(v) + case "undo_naming_convention": + let v = try TeamLog.UndoNamingConventionTypeSerializer().deserialize(json) + return EventType.undoNamingConvention(v) + case "undo_organize_folder_with_tidy": + let v = try TeamLog.UndoOrganizeFolderWithTidyTypeSerializer().deserialize(json) + return EventType.undoOrganizeFolderWithTidy(v) + case "user_tags_added": + let v = try TeamLog.UserTagsAddedTypeSerializer().deserialize(json) + return EventType.userTagsAdded(v) + case "user_tags_removed": + let v = try TeamLog.UserTagsRemovedTypeSerializer().deserialize(json) + return EventType.userTagsRemoved(v) + case "email_ingest_receive_file": + let v = try TeamLog.EmailIngestReceiveFileTypeSerializer().deserialize(json) + return EventType.emailIngestReceiveFile(v) + case "file_request_change": + let v = try TeamLog.FileRequestChangeTypeSerializer().deserialize(json) + return EventType.fileRequestChange(v) + case "file_request_close": + let v = try TeamLog.FileRequestCloseTypeSerializer().deserialize(json) + return EventType.fileRequestClose(v) + case "file_request_create": + let v = try TeamLog.FileRequestCreateTypeSerializer().deserialize(json) + return EventType.fileRequestCreate(v) + case "file_request_delete": + let v = try TeamLog.FileRequestDeleteTypeSerializer().deserialize(json) + return EventType.fileRequestDelete(v) + case "file_request_receive_file": + let v = try TeamLog.FileRequestReceiveFileTypeSerializer().deserialize(json) + return EventType.fileRequestReceiveFile(v) + case "group_add_external_id": + let v = try TeamLog.GroupAddExternalIdTypeSerializer().deserialize(json) + return EventType.groupAddExternalId(v) + case "group_add_member": + let v = try TeamLog.GroupAddMemberTypeSerializer().deserialize(json) + return EventType.groupAddMember(v) + case "group_change_external_id": + let v = try TeamLog.GroupChangeExternalIdTypeSerializer().deserialize(json) + return EventType.groupChangeExternalId(v) + case "group_change_management_type": + let v = try TeamLog.GroupChangeManagementTypeTypeSerializer().deserialize(json) + return EventType.groupChangeManagementType(v) + case "group_change_member_role": + let v = try TeamLog.GroupChangeMemberRoleTypeSerializer().deserialize(json) + return EventType.groupChangeMemberRole(v) + case "group_create": + let v = try TeamLog.GroupCreateTypeSerializer().deserialize(json) + return EventType.groupCreate(v) + case "group_delete": + let v = try TeamLog.GroupDeleteTypeSerializer().deserialize(json) + return EventType.groupDelete(v) + case "group_description_updated": + let v = try TeamLog.GroupDescriptionUpdatedTypeSerializer().deserialize(json) + return EventType.groupDescriptionUpdated(v) + case "group_join_policy_updated": + let v = try TeamLog.GroupJoinPolicyUpdatedTypeSerializer().deserialize(json) + return EventType.groupJoinPolicyUpdated(v) + case "group_moved": + let v = try TeamLog.GroupMovedTypeSerializer().deserialize(json) + return EventType.groupMoved(v) + case "group_remove_external_id": + let v = try TeamLog.GroupRemoveExternalIdTypeSerializer().deserialize(json) + return EventType.groupRemoveExternalId(v) + case "group_remove_member": + let v = try TeamLog.GroupRemoveMemberTypeSerializer().deserialize(json) + return EventType.groupRemoveMember(v) + case "group_rename": + let v = try TeamLog.GroupRenameTypeSerializer().deserialize(json) + return EventType.groupRename(v) + case "account_lock_or_unlocked": + let v = try TeamLog.AccountLockOrUnlockedTypeSerializer().deserialize(json) + return EventType.accountLockOrUnlocked(v) + case "emm_error": + let v = try TeamLog.EmmErrorTypeSerializer().deserialize(json) + return EventType.emmError(v) + case "guest_admin_signed_in_via_trusted_teams": + let v = try TeamLog.GuestAdminSignedInViaTrustedTeamsTypeSerializer().deserialize(json) + return EventType.guestAdminSignedInViaTrustedTeams(v) + case "guest_admin_signed_out_via_trusted_teams": + let v = try TeamLog.GuestAdminSignedOutViaTrustedTeamsTypeSerializer().deserialize(json) + return EventType.guestAdminSignedOutViaTrustedTeams(v) + case "login_fail": + let v = try TeamLog.LoginFailTypeSerializer().deserialize(json) + return EventType.loginFail(v) + case "login_success": + let v = try TeamLog.LoginSuccessTypeSerializer().deserialize(json) + return EventType.loginSuccess(v) + case "logout": + let v = try TeamLog.LogoutTypeSerializer().deserialize(json) + return EventType.logout(v) + case "reseller_support_session_end": + let v = try TeamLog.ResellerSupportSessionEndTypeSerializer().deserialize(json) + return EventType.resellerSupportSessionEnd(v) + case "reseller_support_session_start": + let v = try TeamLog.ResellerSupportSessionStartTypeSerializer().deserialize(json) + return EventType.resellerSupportSessionStart(v) + case "sign_in_as_session_end": + let v = try TeamLog.SignInAsSessionEndTypeSerializer().deserialize(json) + return EventType.signInAsSessionEnd(v) + case "sign_in_as_session_start": + let v = try TeamLog.SignInAsSessionStartTypeSerializer().deserialize(json) + return EventType.signInAsSessionStart(v) + case "sso_error": + let v = try TeamLog.SsoErrorTypeSerializer().deserialize(json) + return EventType.ssoError(v) + case "backup_admin_invitation_sent": + let v = try TeamLog.BackupAdminInvitationSentTypeSerializer().deserialize(json) + return EventType.backupAdminInvitationSent(v) + case "backup_invitation_opened": + let v = try TeamLog.BackupInvitationOpenedTypeSerializer().deserialize(json) + return EventType.backupInvitationOpened(v) + case "create_team_invite_link": + let v = try TeamLog.CreateTeamInviteLinkTypeSerializer().deserialize(json) + return EventType.createTeamInviteLink(v) + case "delete_team_invite_link": + let v = try TeamLog.DeleteTeamInviteLinkTypeSerializer().deserialize(json) + return EventType.deleteTeamInviteLink(v) + case "member_add_external_id": + let v = try TeamLog.MemberAddExternalIdTypeSerializer().deserialize(json) + return EventType.memberAddExternalId(v) + case "member_add_name": + let v = try TeamLog.MemberAddNameTypeSerializer().deserialize(json) + return EventType.memberAddName(v) + case "member_change_admin_role": + let v = try TeamLog.MemberChangeAdminRoleTypeSerializer().deserialize(json) + return EventType.memberChangeAdminRole(v) + case "member_change_email": + let v = try TeamLog.MemberChangeEmailTypeSerializer().deserialize(json) + return EventType.memberChangeEmail(v) + case "member_change_external_id": + let v = try TeamLog.MemberChangeExternalIdTypeSerializer().deserialize(json) + return EventType.memberChangeExternalId(v) + case "member_change_membership_type": + let v = try TeamLog.MemberChangeMembershipTypeTypeSerializer().deserialize(json) + return EventType.memberChangeMembershipType(v) + case "member_change_name": + let v = try TeamLog.MemberChangeNameTypeSerializer().deserialize(json) + return EventType.memberChangeName(v) + case "member_change_reseller_role": + let v = try TeamLog.MemberChangeResellerRoleTypeSerializer().deserialize(json) + return EventType.memberChangeResellerRole(v) + case "member_change_status": + let v = try TeamLog.MemberChangeStatusTypeSerializer().deserialize(json) + return EventType.memberChangeStatus(v) + case "member_delete_manual_contacts": + let v = try TeamLog.MemberDeleteManualContactsTypeSerializer().deserialize(json) + return EventType.memberDeleteManualContacts(v) + case "member_delete_profile_photo": + let v = try TeamLog.MemberDeleteProfilePhotoTypeSerializer().deserialize(json) + return EventType.memberDeleteProfilePhoto(v) + case "member_permanently_delete_account_contents": + let v = try TeamLog.MemberPermanentlyDeleteAccountContentsTypeSerializer().deserialize(json) + return EventType.memberPermanentlyDeleteAccountContents(v) + case "member_remove_external_id": + let v = try TeamLog.MemberRemoveExternalIdTypeSerializer().deserialize(json) + return EventType.memberRemoveExternalId(v) + case "member_set_profile_photo": + let v = try TeamLog.MemberSetProfilePhotoTypeSerializer().deserialize(json) + return EventType.memberSetProfilePhoto(v) + case "member_space_limits_add_custom_quota": + let v = try TeamLog.MemberSpaceLimitsAddCustomQuotaTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsAddCustomQuota(v) + case "member_space_limits_change_custom_quota": + let v = try TeamLog.MemberSpaceLimitsChangeCustomQuotaTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsChangeCustomQuota(v) + case "member_space_limits_change_status": + let v = try TeamLog.MemberSpaceLimitsChangeStatusTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsChangeStatus(v) + case "member_space_limits_remove_custom_quota": + let v = try TeamLog.MemberSpaceLimitsRemoveCustomQuotaTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsRemoveCustomQuota(v) + case "member_suggest": + let v = try TeamLog.MemberSuggestTypeSerializer().deserialize(json) + return EventType.memberSuggest(v) + case "member_transfer_account_contents": + let v = try TeamLog.MemberTransferAccountContentsTypeSerializer().deserialize(json) + return EventType.memberTransferAccountContents(v) + case "pending_secondary_email_added": + let v = try TeamLog.PendingSecondaryEmailAddedTypeSerializer().deserialize(json) + return EventType.pendingSecondaryEmailAdded(v) + case "secondary_email_deleted": + let v = try TeamLog.SecondaryEmailDeletedTypeSerializer().deserialize(json) + return EventType.secondaryEmailDeleted(v) + case "secondary_email_verified": + let v = try TeamLog.SecondaryEmailVerifiedTypeSerializer().deserialize(json) + return EventType.secondaryEmailVerified(v) + case "secondary_mails_policy_changed": + let v = try TeamLog.SecondaryMailsPolicyChangedTypeSerializer().deserialize(json) + return EventType.secondaryMailsPolicyChanged(v) + case "binder_add_page": + let v = try TeamLog.BinderAddPageTypeSerializer().deserialize(json) + return EventType.binderAddPage(v) + case "binder_add_section": + let v = try TeamLog.BinderAddSectionTypeSerializer().deserialize(json) + return EventType.binderAddSection(v) + case "binder_remove_page": + let v = try TeamLog.BinderRemovePageTypeSerializer().deserialize(json) + return EventType.binderRemovePage(v) + case "binder_remove_section": + let v = try TeamLog.BinderRemoveSectionTypeSerializer().deserialize(json) + return EventType.binderRemoveSection(v) + case "binder_rename_page": + let v = try TeamLog.BinderRenamePageTypeSerializer().deserialize(json) + return EventType.binderRenamePage(v) + case "binder_rename_section": + let v = try TeamLog.BinderRenameSectionTypeSerializer().deserialize(json) + return EventType.binderRenameSection(v) + case "binder_reorder_page": + let v = try TeamLog.BinderReorderPageTypeSerializer().deserialize(json) + return EventType.binderReorderPage(v) + case "binder_reorder_section": + let v = try TeamLog.BinderReorderSectionTypeSerializer().deserialize(json) + return EventType.binderReorderSection(v) + case "paper_content_add_member": + let v = try TeamLog.PaperContentAddMemberTypeSerializer().deserialize(json) + return EventType.paperContentAddMember(v) + case "paper_content_add_to_folder": + let v = try TeamLog.PaperContentAddToFolderTypeSerializer().deserialize(json) + return EventType.paperContentAddToFolder(v) + case "paper_content_archive": + let v = try TeamLog.PaperContentArchiveTypeSerializer().deserialize(json) + return EventType.paperContentArchive(v) + case "paper_content_create": + let v = try TeamLog.PaperContentCreateTypeSerializer().deserialize(json) + return EventType.paperContentCreate(v) + case "paper_content_permanently_delete": + let v = try TeamLog.PaperContentPermanentlyDeleteTypeSerializer().deserialize(json) + return EventType.paperContentPermanentlyDelete(v) + case "paper_content_remove_from_folder": + let v = try TeamLog.PaperContentRemoveFromFolderTypeSerializer().deserialize(json) + return EventType.paperContentRemoveFromFolder(v) + case "paper_content_remove_member": + let v = try TeamLog.PaperContentRemoveMemberTypeSerializer().deserialize(json) + return EventType.paperContentRemoveMember(v) + case "paper_content_rename": + let v = try TeamLog.PaperContentRenameTypeSerializer().deserialize(json) + return EventType.paperContentRename(v) + case "paper_content_restore": + let v = try TeamLog.PaperContentRestoreTypeSerializer().deserialize(json) + return EventType.paperContentRestore(v) + case "paper_doc_add_comment": + let v = try TeamLog.PaperDocAddCommentTypeSerializer().deserialize(json) + return EventType.paperDocAddComment(v) + case "paper_doc_change_member_role": + let v = try TeamLog.PaperDocChangeMemberRoleTypeSerializer().deserialize(json) + return EventType.paperDocChangeMemberRole(v) + case "paper_doc_change_sharing_policy": + let v = try TeamLog.PaperDocChangeSharingPolicyTypeSerializer().deserialize(json) + return EventType.paperDocChangeSharingPolicy(v) + case "paper_doc_change_subscription": + let v = try TeamLog.PaperDocChangeSubscriptionTypeSerializer().deserialize(json) + return EventType.paperDocChangeSubscription(v) + case "paper_doc_deleted": + let v = try TeamLog.PaperDocDeletedTypeSerializer().deserialize(json) + return EventType.paperDocDeleted(v) + case "paper_doc_delete_comment": + let v = try TeamLog.PaperDocDeleteCommentTypeSerializer().deserialize(json) + return EventType.paperDocDeleteComment(v) + case "paper_doc_download": + let v = try TeamLog.PaperDocDownloadTypeSerializer().deserialize(json) + return EventType.paperDocDownload(v) + case "paper_doc_edit": + let v = try TeamLog.PaperDocEditTypeSerializer().deserialize(json) + return EventType.paperDocEdit(v) + case "paper_doc_edit_comment": + let v = try TeamLog.PaperDocEditCommentTypeSerializer().deserialize(json) + return EventType.paperDocEditComment(v) + case "paper_doc_followed": + let v = try TeamLog.PaperDocFollowedTypeSerializer().deserialize(json) + return EventType.paperDocFollowed(v) + case "paper_doc_mention": + let v = try TeamLog.PaperDocMentionTypeSerializer().deserialize(json) + return EventType.paperDocMention(v) + case "paper_doc_ownership_changed": + let v = try TeamLog.PaperDocOwnershipChangedTypeSerializer().deserialize(json) + return EventType.paperDocOwnershipChanged(v) + case "paper_doc_request_access": + let v = try TeamLog.PaperDocRequestAccessTypeSerializer().deserialize(json) + return EventType.paperDocRequestAccess(v) + case "paper_doc_resolve_comment": + let v = try TeamLog.PaperDocResolveCommentTypeSerializer().deserialize(json) + return EventType.paperDocResolveComment(v) + case "paper_doc_revert": + let v = try TeamLog.PaperDocRevertTypeSerializer().deserialize(json) + return EventType.paperDocRevert(v) + case "paper_doc_slack_share": + let v = try TeamLog.PaperDocSlackShareTypeSerializer().deserialize(json) + return EventType.paperDocSlackShare(v) + case "paper_doc_team_invite": + let v = try TeamLog.PaperDocTeamInviteTypeSerializer().deserialize(json) + return EventType.paperDocTeamInvite(v) + case "paper_doc_trashed": + let v = try TeamLog.PaperDocTrashedTypeSerializer().deserialize(json) + return EventType.paperDocTrashed(v) + case "paper_doc_unresolve_comment": + let v = try TeamLog.PaperDocUnresolveCommentTypeSerializer().deserialize(json) + return EventType.paperDocUnresolveComment(v) + case "paper_doc_untrashed": + let v = try TeamLog.PaperDocUntrashedTypeSerializer().deserialize(json) + return EventType.paperDocUntrashed(v) + case "paper_doc_view": + let v = try TeamLog.PaperDocViewTypeSerializer().deserialize(json) + return EventType.paperDocView(v) + case "paper_external_view_allow": + let v = try TeamLog.PaperExternalViewAllowTypeSerializer().deserialize(json) + return EventType.paperExternalViewAllow(v) + case "paper_external_view_default_team": + let v = try TeamLog.PaperExternalViewDefaultTeamTypeSerializer().deserialize(json) + return EventType.paperExternalViewDefaultTeam(v) + case "paper_external_view_forbid": + let v = try TeamLog.PaperExternalViewForbidTypeSerializer().deserialize(json) + return EventType.paperExternalViewForbid(v) + case "paper_folder_change_subscription": + let v = try TeamLog.PaperFolderChangeSubscriptionTypeSerializer().deserialize(json) + return EventType.paperFolderChangeSubscription(v) + case "paper_folder_deleted": + let v = try TeamLog.PaperFolderDeletedTypeSerializer().deserialize(json) + return EventType.paperFolderDeleted(v) + case "paper_folder_followed": + let v = try TeamLog.PaperFolderFollowedTypeSerializer().deserialize(json) + return EventType.paperFolderFollowed(v) + case "paper_folder_team_invite": + let v = try TeamLog.PaperFolderTeamInviteTypeSerializer().deserialize(json) + return EventType.paperFolderTeamInvite(v) + case "paper_published_link_change_permission": + let v = try TeamLog.PaperPublishedLinkChangePermissionTypeSerializer().deserialize(json) + return EventType.paperPublishedLinkChangePermission(v) + case "paper_published_link_create": + let v = try TeamLog.PaperPublishedLinkCreateTypeSerializer().deserialize(json) + return EventType.paperPublishedLinkCreate(v) + case "paper_published_link_disabled": + let v = try TeamLog.PaperPublishedLinkDisabledTypeSerializer().deserialize(json) + return EventType.paperPublishedLinkDisabled(v) + case "paper_published_link_view": + let v = try TeamLog.PaperPublishedLinkViewTypeSerializer().deserialize(json) + return EventType.paperPublishedLinkView(v) + case "password_change": + let v = try TeamLog.PasswordChangeTypeSerializer().deserialize(json) + return EventType.passwordChange(v) + case "password_reset": + let v = try TeamLog.PasswordResetTypeSerializer().deserialize(json) + return EventType.passwordReset(v) + case "password_reset_all": + let v = try TeamLog.PasswordResetAllTypeSerializer().deserialize(json) + return EventType.passwordResetAll(v) + case "classification_create_report": + let v = try TeamLog.ClassificationCreateReportTypeSerializer().deserialize(json) + return EventType.classificationCreateReport(v) + case "classification_create_report_fail": + let v = try TeamLog.ClassificationCreateReportFailTypeSerializer().deserialize(json) + return EventType.classificationCreateReportFail(v) + case "emm_create_exceptions_report": + let v = try TeamLog.EmmCreateExceptionsReportTypeSerializer().deserialize(json) + return EventType.emmCreateExceptionsReport(v) + case "emm_create_usage_report": + let v = try TeamLog.EmmCreateUsageReportTypeSerializer().deserialize(json) + return EventType.emmCreateUsageReport(v) + case "export_members_report": + let v = try TeamLog.ExportMembersReportTypeSerializer().deserialize(json) + return EventType.exportMembersReport(v) + case "export_members_report_fail": + let v = try TeamLog.ExportMembersReportFailTypeSerializer().deserialize(json) + return EventType.exportMembersReportFail(v) + case "external_sharing_create_report": + let v = try TeamLog.ExternalSharingCreateReportTypeSerializer().deserialize(json) + return EventType.externalSharingCreateReport(v) + case "external_sharing_report_failed": + let v = try TeamLog.ExternalSharingReportFailedTypeSerializer().deserialize(json) + return EventType.externalSharingReportFailed(v) + case "no_expiration_link_gen_create_report": + let v = try TeamLog.NoExpirationLinkGenCreateReportTypeSerializer().deserialize(json) + return EventType.noExpirationLinkGenCreateReport(v) + case "no_expiration_link_gen_report_failed": + let v = try TeamLog.NoExpirationLinkGenReportFailedTypeSerializer().deserialize(json) + return EventType.noExpirationLinkGenReportFailed(v) + case "no_password_link_gen_create_report": + let v = try TeamLog.NoPasswordLinkGenCreateReportTypeSerializer().deserialize(json) + return EventType.noPasswordLinkGenCreateReport(v) + case "no_password_link_gen_report_failed": + let v = try TeamLog.NoPasswordLinkGenReportFailedTypeSerializer().deserialize(json) + return EventType.noPasswordLinkGenReportFailed(v) + case "no_password_link_view_create_report": + let v = try TeamLog.NoPasswordLinkViewCreateReportTypeSerializer().deserialize(json) + return EventType.noPasswordLinkViewCreateReport(v) + case "no_password_link_view_report_failed": + let v = try TeamLog.NoPasswordLinkViewReportFailedTypeSerializer().deserialize(json) + return EventType.noPasswordLinkViewReportFailed(v) + case "outdated_link_view_create_report": + let v = try TeamLog.OutdatedLinkViewCreateReportTypeSerializer().deserialize(json) + return EventType.outdatedLinkViewCreateReport(v) + case "outdated_link_view_report_failed": + let v = try TeamLog.OutdatedLinkViewReportFailedTypeSerializer().deserialize(json) + return EventType.outdatedLinkViewReportFailed(v) + case "paper_admin_export_start": + let v = try TeamLog.PaperAdminExportStartTypeSerializer().deserialize(json) + return EventType.paperAdminExportStart(v) + case "ransomware_alert_create_report": + let v = try TeamLog.RansomwareAlertCreateReportTypeSerializer().deserialize(json) + return EventType.ransomwareAlertCreateReport(v) + case "ransomware_alert_create_report_failed": + let v = try TeamLog.RansomwareAlertCreateReportFailedTypeSerializer().deserialize(json) + return EventType.ransomwareAlertCreateReportFailed(v) + case "smart_sync_create_admin_privilege_report": + let v = try TeamLog.SmartSyncCreateAdminPrivilegeReportTypeSerializer().deserialize(json) + return EventType.smartSyncCreateAdminPrivilegeReport(v) + case "team_activity_create_report": + let v = try TeamLog.TeamActivityCreateReportTypeSerializer().deserialize(json) + return EventType.teamActivityCreateReport(v) + case "team_activity_create_report_fail": + let v = try TeamLog.TeamActivityCreateReportFailTypeSerializer().deserialize(json) + return EventType.teamActivityCreateReportFail(v) + case "collection_share": + let v = try TeamLog.CollectionShareTypeSerializer().deserialize(json) + return EventType.collectionShare(v) + case "file_transfers_file_add": + let v = try TeamLog.FileTransfersFileAddTypeSerializer().deserialize(json) + return EventType.fileTransfersFileAdd(v) + case "file_transfers_transfer_delete": + let v = try TeamLog.FileTransfersTransferDeleteTypeSerializer().deserialize(json) + return EventType.fileTransfersTransferDelete(v) + case "file_transfers_transfer_download": + let v = try TeamLog.FileTransfersTransferDownloadTypeSerializer().deserialize(json) + return EventType.fileTransfersTransferDownload(v) + case "file_transfers_transfer_send": + let v = try TeamLog.FileTransfersTransferSendTypeSerializer().deserialize(json) + return EventType.fileTransfersTransferSend(v) + case "file_transfers_transfer_view": + let v = try TeamLog.FileTransfersTransferViewTypeSerializer().deserialize(json) + return EventType.fileTransfersTransferView(v) + case "note_acl_invite_only": + let v = try TeamLog.NoteAclInviteOnlyTypeSerializer().deserialize(json) + return EventType.noteAclInviteOnly(v) + case "note_acl_link": + let v = try TeamLog.NoteAclLinkTypeSerializer().deserialize(json) + return EventType.noteAclLink(v) + case "note_acl_team_link": + let v = try TeamLog.NoteAclTeamLinkTypeSerializer().deserialize(json) + return EventType.noteAclTeamLink(v) + case "note_shared": + let v = try TeamLog.NoteSharedTypeSerializer().deserialize(json) + return EventType.noteShared(v) + case "note_share_receive": + let v = try TeamLog.NoteShareReceiveTypeSerializer().deserialize(json) + return EventType.noteShareReceive(v) + case "open_note_shared": + let v = try TeamLog.OpenNoteSharedTypeSerializer().deserialize(json) + return EventType.openNoteShared(v) + case "replay_file_shared_link_created": + let v = try TeamLog.ReplayFileSharedLinkCreatedTypeSerializer().deserialize(json) + return EventType.replayFileSharedLinkCreated(v) + case "replay_file_shared_link_modified": + let v = try TeamLog.ReplayFileSharedLinkModifiedTypeSerializer().deserialize(json) + return EventType.replayFileSharedLinkModified(v) + case "replay_project_team_add": + let v = try TeamLog.ReplayProjectTeamAddTypeSerializer().deserialize(json) + return EventType.replayProjectTeamAdd(v) + case "replay_project_team_delete": + let v = try TeamLog.ReplayProjectTeamDeleteTypeSerializer().deserialize(json) + return EventType.replayProjectTeamDelete(v) + case "sf_add_group": + let v = try TeamLog.SfAddGroupTypeSerializer().deserialize(json) + return EventType.sfAddGroup(v) + case "sf_allow_non_members_to_view_shared_links": + let v = try TeamLog.SfAllowNonMembersToViewSharedLinksTypeSerializer().deserialize(json) + return EventType.sfAllowNonMembersToViewSharedLinks(v) + case "sf_external_invite_warn": + let v = try TeamLog.SfExternalInviteWarnTypeSerializer().deserialize(json) + return EventType.sfExternalInviteWarn(v) + case "sf_fb_invite": + let v = try TeamLog.SfFbInviteTypeSerializer().deserialize(json) + return EventType.sfFbInvite(v) + case "sf_fb_invite_change_role": + let v = try TeamLog.SfFbInviteChangeRoleTypeSerializer().deserialize(json) + return EventType.sfFbInviteChangeRole(v) + case "sf_fb_uninvite": + let v = try TeamLog.SfFbUninviteTypeSerializer().deserialize(json) + return EventType.sfFbUninvite(v) + case "sf_invite_group": + let v = try TeamLog.SfInviteGroupTypeSerializer().deserialize(json) + return EventType.sfInviteGroup(v) + case "sf_team_grant_access": + let v = try TeamLog.SfTeamGrantAccessTypeSerializer().deserialize(json) + return EventType.sfTeamGrantAccess(v) + case "sf_team_invite": + let v = try TeamLog.SfTeamInviteTypeSerializer().deserialize(json) + return EventType.sfTeamInvite(v) + case "sf_team_invite_change_role": + let v = try TeamLog.SfTeamInviteChangeRoleTypeSerializer().deserialize(json) + return EventType.sfTeamInviteChangeRole(v) + case "sf_team_join": + let v = try TeamLog.SfTeamJoinTypeSerializer().deserialize(json) + return EventType.sfTeamJoin(v) + case "sf_team_join_from_oob_link": + let v = try TeamLog.SfTeamJoinFromOobLinkTypeSerializer().deserialize(json) + return EventType.sfTeamJoinFromOobLink(v) + case "sf_team_uninvite": + let v = try TeamLog.SfTeamUninviteTypeSerializer().deserialize(json) + return EventType.sfTeamUninvite(v) + case "shared_content_add_invitees": + let v = try TeamLog.SharedContentAddInviteesTypeSerializer().deserialize(json) + return EventType.sharedContentAddInvitees(v) + case "shared_content_add_link_expiry": + let v = try TeamLog.SharedContentAddLinkExpiryTypeSerializer().deserialize(json) + return EventType.sharedContentAddLinkExpiry(v) + case "shared_content_add_link_password": + let v = try TeamLog.SharedContentAddLinkPasswordTypeSerializer().deserialize(json) + return EventType.sharedContentAddLinkPassword(v) + case "shared_content_add_member": + let v = try TeamLog.SharedContentAddMemberTypeSerializer().deserialize(json) + return EventType.sharedContentAddMember(v) + case "shared_content_change_downloads_policy": + let v = try TeamLog.SharedContentChangeDownloadsPolicyTypeSerializer().deserialize(json) + return EventType.sharedContentChangeDownloadsPolicy(v) + case "shared_content_change_invitee_role": + let v = try TeamLog.SharedContentChangeInviteeRoleTypeSerializer().deserialize(json) + return EventType.sharedContentChangeInviteeRole(v) + case "shared_content_change_link_audience": + let v = try TeamLog.SharedContentChangeLinkAudienceTypeSerializer().deserialize(json) + return EventType.sharedContentChangeLinkAudience(v) + case "shared_content_change_link_expiry": + let v = try TeamLog.SharedContentChangeLinkExpiryTypeSerializer().deserialize(json) + return EventType.sharedContentChangeLinkExpiry(v) + case "shared_content_change_link_password": + let v = try TeamLog.SharedContentChangeLinkPasswordTypeSerializer().deserialize(json) + return EventType.sharedContentChangeLinkPassword(v) + case "shared_content_change_member_role": + let v = try TeamLog.SharedContentChangeMemberRoleTypeSerializer().deserialize(json) + return EventType.sharedContentChangeMemberRole(v) + case "shared_content_change_viewer_info_policy": + let v = try TeamLog.SharedContentChangeViewerInfoPolicyTypeSerializer().deserialize(json) + return EventType.sharedContentChangeViewerInfoPolicy(v) + case "shared_content_claim_invitation": + let v = try TeamLog.SharedContentClaimInvitationTypeSerializer().deserialize(json) + return EventType.sharedContentClaimInvitation(v) + case "shared_content_copy": + let v = try TeamLog.SharedContentCopyTypeSerializer().deserialize(json) + return EventType.sharedContentCopy(v) + case "shared_content_download": + let v = try TeamLog.SharedContentDownloadTypeSerializer().deserialize(json) + return EventType.sharedContentDownload(v) + case "shared_content_relinquish_membership": + let v = try TeamLog.SharedContentRelinquishMembershipTypeSerializer().deserialize(json) + return EventType.sharedContentRelinquishMembership(v) + case "shared_content_remove_invitees": + let v = try TeamLog.SharedContentRemoveInviteesTypeSerializer().deserialize(json) + return EventType.sharedContentRemoveInvitees(v) + case "shared_content_remove_link_expiry": + let v = try TeamLog.SharedContentRemoveLinkExpiryTypeSerializer().deserialize(json) + return EventType.sharedContentRemoveLinkExpiry(v) + case "shared_content_remove_link_password": + let v = try TeamLog.SharedContentRemoveLinkPasswordTypeSerializer().deserialize(json) + return EventType.sharedContentRemoveLinkPassword(v) + case "shared_content_remove_member": + let v = try TeamLog.SharedContentRemoveMemberTypeSerializer().deserialize(json) + return EventType.sharedContentRemoveMember(v) + case "shared_content_request_access": + let v = try TeamLog.SharedContentRequestAccessTypeSerializer().deserialize(json) + return EventType.sharedContentRequestAccess(v) + case "shared_content_restore_invitees": + let v = try TeamLog.SharedContentRestoreInviteesTypeSerializer().deserialize(json) + return EventType.sharedContentRestoreInvitees(v) + case "shared_content_restore_member": + let v = try TeamLog.SharedContentRestoreMemberTypeSerializer().deserialize(json) + return EventType.sharedContentRestoreMember(v) + case "shared_content_unshare": + let v = try TeamLog.SharedContentUnshareTypeSerializer().deserialize(json) + return EventType.sharedContentUnshare(v) + case "shared_content_view": + let v = try TeamLog.SharedContentViewTypeSerializer().deserialize(json) + return EventType.sharedContentView(v) + case "shared_folder_change_link_policy": + let v = try TeamLog.SharedFolderChangeLinkPolicyTypeSerializer().deserialize(json) + return EventType.sharedFolderChangeLinkPolicy(v) + case "shared_folder_change_members_inheritance_policy": + let v = try TeamLog.SharedFolderChangeMembersInheritancePolicyTypeSerializer().deserialize(json) + return EventType.sharedFolderChangeMembersInheritancePolicy(v) + case "shared_folder_change_members_management_policy": + let v = try TeamLog.SharedFolderChangeMembersManagementPolicyTypeSerializer().deserialize(json) + return EventType.sharedFolderChangeMembersManagementPolicy(v) + case "shared_folder_change_members_policy": + let v = try TeamLog.SharedFolderChangeMembersPolicyTypeSerializer().deserialize(json) + return EventType.sharedFolderChangeMembersPolicy(v) + case "shared_folder_create": + let v = try TeamLog.SharedFolderCreateTypeSerializer().deserialize(json) + return EventType.sharedFolderCreate(v) + case "shared_folder_decline_invitation": + let v = try TeamLog.SharedFolderDeclineInvitationTypeSerializer().deserialize(json) + return EventType.sharedFolderDeclineInvitation(v) + case "shared_folder_mount": + let v = try TeamLog.SharedFolderMountTypeSerializer().deserialize(json) + return EventType.sharedFolderMount(v) + case "shared_folder_nest": + let v = try TeamLog.SharedFolderNestTypeSerializer().deserialize(json) + return EventType.sharedFolderNest(v) + case "shared_folder_transfer_ownership": + let v = try TeamLog.SharedFolderTransferOwnershipTypeSerializer().deserialize(json) + return EventType.sharedFolderTransferOwnership(v) + case "shared_folder_unmount": + let v = try TeamLog.SharedFolderUnmountTypeSerializer().deserialize(json) + return EventType.sharedFolderUnmount(v) + case "shared_link_add_expiry": + let v = try TeamLog.SharedLinkAddExpiryTypeSerializer().deserialize(json) + return EventType.sharedLinkAddExpiry(v) + case "shared_link_change_expiry": + let v = try TeamLog.SharedLinkChangeExpiryTypeSerializer().deserialize(json) + return EventType.sharedLinkChangeExpiry(v) + case "shared_link_change_visibility": + let v = try TeamLog.SharedLinkChangeVisibilityTypeSerializer().deserialize(json) + return EventType.sharedLinkChangeVisibility(v) + case "shared_link_copy": + let v = try TeamLog.SharedLinkCopyTypeSerializer().deserialize(json) + return EventType.sharedLinkCopy(v) + case "shared_link_create": + let v = try TeamLog.SharedLinkCreateTypeSerializer().deserialize(json) + return EventType.sharedLinkCreate(v) + case "shared_link_disable": + let v = try TeamLog.SharedLinkDisableTypeSerializer().deserialize(json) + return EventType.sharedLinkDisable(v) + case "shared_link_download": + let v = try TeamLog.SharedLinkDownloadTypeSerializer().deserialize(json) + return EventType.sharedLinkDownload(v) + case "shared_link_remove_expiry": + let v = try TeamLog.SharedLinkRemoveExpiryTypeSerializer().deserialize(json) + return EventType.sharedLinkRemoveExpiry(v) + case "shared_link_settings_add_expiration": + let v = try TeamLog.SharedLinkSettingsAddExpirationTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsAddExpiration(v) + case "shared_link_settings_add_password": + let v = try TeamLog.SharedLinkSettingsAddPasswordTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsAddPassword(v) + case "shared_link_settings_allow_download_disabled": + let v = try TeamLog.SharedLinkSettingsAllowDownloadDisabledTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsAllowDownloadDisabled(v) + case "shared_link_settings_allow_download_enabled": + let v = try TeamLog.SharedLinkSettingsAllowDownloadEnabledTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsAllowDownloadEnabled(v) + case "shared_link_settings_change_audience": + let v = try TeamLog.SharedLinkSettingsChangeAudienceTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsChangeAudience(v) + case "shared_link_settings_change_expiration": + let v = try TeamLog.SharedLinkSettingsChangeExpirationTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsChangeExpiration(v) + case "shared_link_settings_change_password": + let v = try TeamLog.SharedLinkSettingsChangePasswordTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsChangePassword(v) + case "shared_link_settings_remove_expiration": + let v = try TeamLog.SharedLinkSettingsRemoveExpirationTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsRemoveExpiration(v) + case "shared_link_settings_remove_password": + let v = try TeamLog.SharedLinkSettingsRemovePasswordTypeSerializer().deserialize(json) + return EventType.sharedLinkSettingsRemovePassword(v) + case "shared_link_share": + let v = try TeamLog.SharedLinkShareTypeSerializer().deserialize(json) + return EventType.sharedLinkShare(v) + case "shared_link_view": + let v = try TeamLog.SharedLinkViewTypeSerializer().deserialize(json) + return EventType.sharedLinkView(v) + case "shared_note_opened": + let v = try TeamLog.SharedNoteOpenedTypeSerializer().deserialize(json) + return EventType.sharedNoteOpened(v) + case "shmodel_disable_downloads": + let v = try TeamLog.ShmodelDisableDownloadsTypeSerializer().deserialize(json) + return EventType.shmodelDisableDownloads(v) + case "shmodel_enable_downloads": + let v = try TeamLog.ShmodelEnableDownloadsTypeSerializer().deserialize(json) + return EventType.shmodelEnableDownloads(v) + case "shmodel_group_share": + let v = try TeamLog.ShmodelGroupShareTypeSerializer().deserialize(json) + return EventType.shmodelGroupShare(v) + case "showcase_access_granted": + let v = try TeamLog.ShowcaseAccessGrantedTypeSerializer().deserialize(json) + return EventType.showcaseAccessGranted(v) + case "showcase_add_member": + let v = try TeamLog.ShowcaseAddMemberTypeSerializer().deserialize(json) + return EventType.showcaseAddMember(v) + case "showcase_archived": + let v = try TeamLog.ShowcaseArchivedTypeSerializer().deserialize(json) + return EventType.showcaseArchived(v) + case "showcase_created": + let v = try TeamLog.ShowcaseCreatedTypeSerializer().deserialize(json) + return EventType.showcaseCreated(v) + case "showcase_delete_comment": + let v = try TeamLog.ShowcaseDeleteCommentTypeSerializer().deserialize(json) + return EventType.showcaseDeleteComment(v) + case "showcase_edited": + let v = try TeamLog.ShowcaseEditedTypeSerializer().deserialize(json) + return EventType.showcaseEdited(v) + case "showcase_edit_comment": + let v = try TeamLog.ShowcaseEditCommentTypeSerializer().deserialize(json) + return EventType.showcaseEditComment(v) + case "showcase_file_added": + let v = try TeamLog.ShowcaseFileAddedTypeSerializer().deserialize(json) + return EventType.showcaseFileAdded(v) + case "showcase_file_download": + let v = try TeamLog.ShowcaseFileDownloadTypeSerializer().deserialize(json) + return EventType.showcaseFileDownload(v) + case "showcase_file_removed": + let v = try TeamLog.ShowcaseFileRemovedTypeSerializer().deserialize(json) + return EventType.showcaseFileRemoved(v) + case "showcase_file_view": + let v = try TeamLog.ShowcaseFileViewTypeSerializer().deserialize(json) + return EventType.showcaseFileView(v) + case "showcase_permanently_deleted": + let v = try TeamLog.ShowcasePermanentlyDeletedTypeSerializer().deserialize(json) + return EventType.showcasePermanentlyDeleted(v) + case "showcase_post_comment": + let v = try TeamLog.ShowcasePostCommentTypeSerializer().deserialize(json) + return EventType.showcasePostComment(v) + case "showcase_remove_member": + let v = try TeamLog.ShowcaseRemoveMemberTypeSerializer().deserialize(json) + return EventType.showcaseRemoveMember(v) + case "showcase_renamed": + let v = try TeamLog.ShowcaseRenamedTypeSerializer().deserialize(json) + return EventType.showcaseRenamed(v) + case "showcase_request_access": + let v = try TeamLog.ShowcaseRequestAccessTypeSerializer().deserialize(json) + return EventType.showcaseRequestAccess(v) + case "showcase_resolve_comment": + let v = try TeamLog.ShowcaseResolveCommentTypeSerializer().deserialize(json) + return EventType.showcaseResolveComment(v) + case "showcase_restored": + let v = try TeamLog.ShowcaseRestoredTypeSerializer().deserialize(json) + return EventType.showcaseRestored(v) + case "showcase_trashed": + let v = try TeamLog.ShowcaseTrashedTypeSerializer().deserialize(json) + return EventType.showcaseTrashed(v) + case "showcase_trashed_deprecated": + let v = try TeamLog.ShowcaseTrashedDeprecatedTypeSerializer().deserialize(json) + return EventType.showcaseTrashedDeprecated(v) + case "showcase_unresolve_comment": + let v = try TeamLog.ShowcaseUnresolveCommentTypeSerializer().deserialize(json) + return EventType.showcaseUnresolveComment(v) + case "showcase_untrashed": + let v = try TeamLog.ShowcaseUntrashedTypeSerializer().deserialize(json) + return EventType.showcaseUntrashed(v) + case "showcase_untrashed_deprecated": + let v = try TeamLog.ShowcaseUntrashedDeprecatedTypeSerializer().deserialize(json) + return EventType.showcaseUntrashedDeprecated(v) + case "showcase_view": + let v = try TeamLog.ShowcaseViewTypeSerializer().deserialize(json) + return EventType.showcaseView(v) + case "sso_add_cert": + let v = try TeamLog.SsoAddCertTypeSerializer().deserialize(json) + return EventType.ssoAddCert(v) + case "sso_add_login_url": + let v = try TeamLog.SsoAddLoginUrlTypeSerializer().deserialize(json) + return EventType.ssoAddLoginUrl(v) + case "sso_add_logout_url": + let v = try TeamLog.SsoAddLogoutUrlTypeSerializer().deserialize(json) + return EventType.ssoAddLogoutUrl(v) + case "sso_change_cert": + let v = try TeamLog.SsoChangeCertTypeSerializer().deserialize(json) + return EventType.ssoChangeCert(v) + case "sso_change_login_url": + let v = try TeamLog.SsoChangeLoginUrlTypeSerializer().deserialize(json) + return EventType.ssoChangeLoginUrl(v) + case "sso_change_logout_url": + let v = try TeamLog.SsoChangeLogoutUrlTypeSerializer().deserialize(json) + return EventType.ssoChangeLogoutUrl(v) + case "sso_change_saml_identity_mode": + let v = try TeamLog.SsoChangeSamlIdentityModeTypeSerializer().deserialize(json) + return EventType.ssoChangeSamlIdentityMode(v) + case "sso_remove_cert": + let v = try TeamLog.SsoRemoveCertTypeSerializer().deserialize(json) + return EventType.ssoRemoveCert(v) + case "sso_remove_login_url": + let v = try TeamLog.SsoRemoveLoginUrlTypeSerializer().deserialize(json) + return EventType.ssoRemoveLoginUrl(v) + case "sso_remove_logout_url": + let v = try TeamLog.SsoRemoveLogoutUrlTypeSerializer().deserialize(json) + return EventType.ssoRemoveLogoutUrl(v) + case "team_folder_change_status": + let v = try TeamLog.TeamFolderChangeStatusTypeSerializer().deserialize(json) + return EventType.teamFolderChangeStatus(v) + case "team_folder_create": + let v = try TeamLog.TeamFolderCreateTypeSerializer().deserialize(json) + return EventType.teamFolderCreate(v) + case "team_folder_downgrade": + let v = try TeamLog.TeamFolderDowngradeTypeSerializer().deserialize(json) + return EventType.teamFolderDowngrade(v) + case "team_folder_permanently_delete": + let v = try TeamLog.TeamFolderPermanentlyDeleteTypeSerializer().deserialize(json) + return EventType.teamFolderPermanentlyDelete(v) + case "team_folder_rename": + let v = try TeamLog.TeamFolderRenameTypeSerializer().deserialize(json) + return EventType.teamFolderRename(v) + case "team_selective_sync_settings_changed": + let v = try TeamLog.TeamSelectiveSyncSettingsChangedTypeSerializer().deserialize(json) + return EventType.teamSelectiveSyncSettingsChanged(v) + case "account_capture_change_policy": + let v = try TeamLog.AccountCaptureChangePolicyTypeSerializer().deserialize(json) + return EventType.accountCaptureChangePolicy(v) + case "admin_email_reminders_changed": + let v = try TeamLog.AdminEmailRemindersChangedTypeSerializer().deserialize(json) + return EventType.adminEmailRemindersChanged(v) + case "allow_download_disabled": + let v = try TeamLog.AllowDownloadDisabledTypeSerializer().deserialize(json) + return EventType.allowDownloadDisabled(v) + case "allow_download_enabled": + let v = try TeamLog.AllowDownloadEnabledTypeSerializer().deserialize(json) + return EventType.allowDownloadEnabled(v) + case "app_permissions_changed": + let v = try TeamLog.AppPermissionsChangedTypeSerializer().deserialize(json) + return EventType.appPermissionsChanged(v) + case "camera_uploads_policy_changed": + let v = try TeamLog.CameraUploadsPolicyChangedTypeSerializer().deserialize(json) + return EventType.cameraUploadsPolicyChanged(v) + case "capture_transcript_policy_changed": + let v = try TeamLog.CaptureTranscriptPolicyChangedTypeSerializer().deserialize(json) + return EventType.captureTranscriptPolicyChanged(v) + case "classification_change_policy": + let v = try TeamLog.ClassificationChangePolicyTypeSerializer().deserialize(json) + return EventType.classificationChangePolicy(v) + case "computer_backup_policy_changed": + let v = try TeamLog.ComputerBackupPolicyChangedTypeSerializer().deserialize(json) + return EventType.computerBackupPolicyChanged(v) + case "content_administration_policy_changed": + let v = try TeamLog.ContentAdministrationPolicyChangedTypeSerializer().deserialize(json) + return EventType.contentAdministrationPolicyChanged(v) + case "data_placement_restriction_change_policy": + let v = try TeamLog.DataPlacementRestrictionChangePolicyTypeSerializer().deserialize(json) + return EventType.dataPlacementRestrictionChangePolicy(v) + case "data_placement_restriction_satisfy_policy": + let v = try TeamLog.DataPlacementRestrictionSatisfyPolicyTypeSerializer().deserialize(json) + return EventType.dataPlacementRestrictionSatisfyPolicy(v) + case "device_approvals_add_exception": + let v = try TeamLog.DeviceApprovalsAddExceptionTypeSerializer().deserialize(json) + return EventType.deviceApprovalsAddException(v) + case "device_approvals_change_desktop_policy": + let v = try TeamLog.DeviceApprovalsChangeDesktopPolicyTypeSerializer().deserialize(json) + return EventType.deviceApprovalsChangeDesktopPolicy(v) + case "device_approvals_change_mobile_policy": + let v = try TeamLog.DeviceApprovalsChangeMobilePolicyTypeSerializer().deserialize(json) + return EventType.deviceApprovalsChangeMobilePolicy(v) + case "device_approvals_change_overage_action": + let v = try TeamLog.DeviceApprovalsChangeOverageActionTypeSerializer().deserialize(json) + return EventType.deviceApprovalsChangeOverageAction(v) + case "device_approvals_change_unlink_action": + let v = try TeamLog.DeviceApprovalsChangeUnlinkActionTypeSerializer().deserialize(json) + return EventType.deviceApprovalsChangeUnlinkAction(v) + case "device_approvals_remove_exception": + let v = try TeamLog.DeviceApprovalsRemoveExceptionTypeSerializer().deserialize(json) + return EventType.deviceApprovalsRemoveException(v) + case "directory_restrictions_add_members": + let v = try TeamLog.DirectoryRestrictionsAddMembersTypeSerializer().deserialize(json) + return EventType.directoryRestrictionsAddMembers(v) + case "directory_restrictions_remove_members": + let v = try TeamLog.DirectoryRestrictionsRemoveMembersTypeSerializer().deserialize(json) + return EventType.directoryRestrictionsRemoveMembers(v) + case "dropbox_passwords_policy_changed": + let v = try TeamLog.DropboxPasswordsPolicyChangedTypeSerializer().deserialize(json) + return EventType.dropboxPasswordsPolicyChanged(v) + case "email_ingest_policy_changed": + let v = try TeamLog.EmailIngestPolicyChangedTypeSerializer().deserialize(json) + return EventType.emailIngestPolicyChanged(v) + case "emm_add_exception": + let v = try TeamLog.EmmAddExceptionTypeSerializer().deserialize(json) + return EventType.emmAddException(v) + case "emm_change_policy": + let v = try TeamLog.EmmChangePolicyTypeSerializer().deserialize(json) + return EventType.emmChangePolicy(v) + case "emm_remove_exception": + let v = try TeamLog.EmmRemoveExceptionTypeSerializer().deserialize(json) + return EventType.emmRemoveException(v) + case "extended_version_history_change_policy": + let v = try TeamLog.ExtendedVersionHistoryChangePolicyTypeSerializer().deserialize(json) + return EventType.extendedVersionHistoryChangePolicy(v) + case "external_drive_backup_policy_changed": + let v = try TeamLog.ExternalDriveBackupPolicyChangedTypeSerializer().deserialize(json) + return EventType.externalDriveBackupPolicyChanged(v) + case "file_comments_change_policy": + let v = try TeamLog.FileCommentsChangePolicyTypeSerializer().deserialize(json) + return EventType.fileCommentsChangePolicy(v) + case "file_locking_policy_changed": + let v = try TeamLog.FileLockingPolicyChangedTypeSerializer().deserialize(json) + return EventType.fileLockingPolicyChanged(v) + case "file_provider_migration_policy_changed": + let v = try TeamLog.FileProviderMigrationPolicyChangedTypeSerializer().deserialize(json) + return EventType.fileProviderMigrationPolicyChanged(v) + case "file_requests_change_policy": + let v = try TeamLog.FileRequestsChangePolicyTypeSerializer().deserialize(json) + return EventType.fileRequestsChangePolicy(v) + case "file_requests_emails_enabled": + let v = try TeamLog.FileRequestsEmailsEnabledTypeSerializer().deserialize(json) + return EventType.fileRequestsEmailsEnabled(v) + case "file_requests_emails_restricted_to_team_only": + let v = try TeamLog.FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer().deserialize(json) + return EventType.fileRequestsEmailsRestrictedToTeamOnly(v) + case "file_transfers_policy_changed": + let v = try TeamLog.FileTransfersPolicyChangedTypeSerializer().deserialize(json) + return EventType.fileTransfersPolicyChanged(v) + case "folder_link_restriction_policy_changed": + let v = try TeamLog.FolderLinkRestrictionPolicyChangedTypeSerializer().deserialize(json) + return EventType.folderLinkRestrictionPolicyChanged(v) + case "google_sso_change_policy": + let v = try TeamLog.GoogleSsoChangePolicyTypeSerializer().deserialize(json) + return EventType.googleSsoChangePolicy(v) + case "group_user_management_change_policy": + let v = try TeamLog.GroupUserManagementChangePolicyTypeSerializer().deserialize(json) + return EventType.groupUserManagementChangePolicy(v) + case "integration_policy_changed": + let v = try TeamLog.IntegrationPolicyChangedTypeSerializer().deserialize(json) + return EventType.integrationPolicyChanged(v) + case "invite_acceptance_email_policy_changed": + let v = try TeamLog.InviteAcceptanceEmailPolicyChangedTypeSerializer().deserialize(json) + return EventType.inviteAcceptanceEmailPolicyChanged(v) + case "member_requests_change_policy": + let v = try TeamLog.MemberRequestsChangePolicyTypeSerializer().deserialize(json) + return EventType.memberRequestsChangePolicy(v) + case "member_send_invite_policy_changed": + let v = try TeamLog.MemberSendInvitePolicyChangedTypeSerializer().deserialize(json) + return EventType.memberSendInvitePolicyChanged(v) + case "member_space_limits_add_exception": + let v = try TeamLog.MemberSpaceLimitsAddExceptionTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsAddException(v) + case "member_space_limits_change_caps_type_policy": + let v = try TeamLog.MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsChangeCapsTypePolicy(v) + case "member_space_limits_change_policy": + let v = try TeamLog.MemberSpaceLimitsChangePolicyTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsChangePolicy(v) + case "member_space_limits_remove_exception": + let v = try TeamLog.MemberSpaceLimitsRemoveExceptionTypeSerializer().deserialize(json) + return EventType.memberSpaceLimitsRemoveException(v) + case "member_suggestions_change_policy": + let v = try TeamLog.MemberSuggestionsChangePolicyTypeSerializer().deserialize(json) + return EventType.memberSuggestionsChangePolicy(v) + case "microsoft_office_addin_change_policy": + let v = try TeamLog.MicrosoftOfficeAddinChangePolicyTypeSerializer().deserialize(json) + return EventType.microsoftOfficeAddinChangePolicy(v) + case "network_control_change_policy": + let v = try TeamLog.NetworkControlChangePolicyTypeSerializer().deserialize(json) + return EventType.networkControlChangePolicy(v) + case "paper_change_deployment_policy": + let v = try TeamLog.PaperChangeDeploymentPolicyTypeSerializer().deserialize(json) + return EventType.paperChangeDeploymentPolicy(v) + case "paper_change_member_link_policy": + let v = try TeamLog.PaperChangeMemberLinkPolicyTypeSerializer().deserialize(json) + return EventType.paperChangeMemberLinkPolicy(v) + case "paper_change_member_policy": + let v = try TeamLog.PaperChangeMemberPolicyTypeSerializer().deserialize(json) + return EventType.paperChangeMemberPolicy(v) + case "paper_change_policy": + let v = try TeamLog.PaperChangePolicyTypeSerializer().deserialize(json) + return EventType.paperChangePolicy(v) + case "paper_default_folder_policy_changed": + let v = try TeamLog.PaperDefaultFolderPolicyChangedTypeSerializer().deserialize(json) + return EventType.paperDefaultFolderPolicyChanged(v) + case "paper_desktop_policy_changed": + let v = try TeamLog.PaperDesktopPolicyChangedTypeSerializer().deserialize(json) + return EventType.paperDesktopPolicyChanged(v) + case "paper_enabled_users_group_addition": + let v = try TeamLog.PaperEnabledUsersGroupAdditionTypeSerializer().deserialize(json) + return EventType.paperEnabledUsersGroupAddition(v) + case "paper_enabled_users_group_removal": + let v = try TeamLog.PaperEnabledUsersGroupRemovalTypeSerializer().deserialize(json) + return EventType.paperEnabledUsersGroupRemoval(v) + case "password_strength_requirements_change_policy": + let v = try TeamLog.PasswordStrengthRequirementsChangePolicyTypeSerializer().deserialize(json) + return EventType.passwordStrengthRequirementsChangePolicy(v) + case "permanent_delete_change_policy": + let v = try TeamLog.PermanentDeleteChangePolicyTypeSerializer().deserialize(json) + return EventType.permanentDeleteChangePolicy(v) + case "reseller_support_change_policy": + let v = try TeamLog.ResellerSupportChangePolicyTypeSerializer().deserialize(json) + return EventType.resellerSupportChangePolicy(v) + case "rewind_policy_changed": + let v = try TeamLog.RewindPolicyChangedTypeSerializer().deserialize(json) + return EventType.rewindPolicyChanged(v) + case "send_for_signature_policy_changed": + let v = try TeamLog.SendForSignaturePolicyChangedTypeSerializer().deserialize(json) + return EventType.sendForSignaturePolicyChanged(v) + case "sharing_change_folder_join_policy": + let v = try TeamLog.SharingChangeFolderJoinPolicyTypeSerializer().deserialize(json) + return EventType.sharingChangeFolderJoinPolicy(v) + case "sharing_change_link_allow_change_expiration_policy": + let v = try TeamLog.SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer().deserialize(json) + return EventType.sharingChangeLinkAllowChangeExpirationPolicy(v) + case "sharing_change_link_default_expiration_policy": + let v = try TeamLog.SharingChangeLinkDefaultExpirationPolicyTypeSerializer().deserialize(json) + return EventType.sharingChangeLinkDefaultExpirationPolicy(v) + case "sharing_change_link_enforce_password_policy": + let v = try TeamLog.SharingChangeLinkEnforcePasswordPolicyTypeSerializer().deserialize(json) + return EventType.sharingChangeLinkEnforcePasswordPolicy(v) + case "sharing_change_link_policy": + let v = try TeamLog.SharingChangeLinkPolicyTypeSerializer().deserialize(json) + return EventType.sharingChangeLinkPolicy(v) + case "sharing_change_member_policy": + let v = try TeamLog.SharingChangeMemberPolicyTypeSerializer().deserialize(json) + return EventType.sharingChangeMemberPolicy(v) + case "showcase_change_download_policy": + let v = try TeamLog.ShowcaseChangeDownloadPolicyTypeSerializer().deserialize(json) + return EventType.showcaseChangeDownloadPolicy(v) + case "showcase_change_enabled_policy": + let v = try TeamLog.ShowcaseChangeEnabledPolicyTypeSerializer().deserialize(json) + return EventType.showcaseChangeEnabledPolicy(v) + case "showcase_change_external_sharing_policy": + let v = try TeamLog.ShowcaseChangeExternalSharingPolicyTypeSerializer().deserialize(json) + return EventType.showcaseChangeExternalSharingPolicy(v) + case "smarter_smart_sync_policy_changed": + let v = try TeamLog.SmarterSmartSyncPolicyChangedTypeSerializer().deserialize(json) + return EventType.smarterSmartSyncPolicyChanged(v) + case "smart_sync_change_policy": + let v = try TeamLog.SmartSyncChangePolicyTypeSerializer().deserialize(json) + return EventType.smartSyncChangePolicy(v) + case "smart_sync_not_opt_out": + let v = try TeamLog.SmartSyncNotOptOutTypeSerializer().deserialize(json) + return EventType.smartSyncNotOptOut(v) + case "smart_sync_opt_out": + let v = try TeamLog.SmartSyncOptOutTypeSerializer().deserialize(json) + return EventType.smartSyncOptOut(v) + case "sso_change_policy": + let v = try TeamLog.SsoChangePolicyTypeSerializer().deserialize(json) + return EventType.ssoChangePolicy(v) + case "team_branding_policy_changed": + let v = try TeamLog.TeamBrandingPolicyChangedTypeSerializer().deserialize(json) + return EventType.teamBrandingPolicyChanged(v) + case "team_extensions_policy_changed": + let v = try TeamLog.TeamExtensionsPolicyChangedTypeSerializer().deserialize(json) + return EventType.teamExtensionsPolicyChanged(v) + case "team_selective_sync_policy_changed": + let v = try TeamLog.TeamSelectiveSyncPolicyChangedTypeSerializer().deserialize(json) + return EventType.teamSelectiveSyncPolicyChanged(v) + case "team_sharing_whitelist_subjects_changed": + let v = try TeamLog.TeamSharingWhitelistSubjectsChangedTypeSerializer().deserialize(json) + return EventType.teamSharingWhitelistSubjectsChanged(v) + case "tfa_add_exception": + let v = try TeamLog.TfaAddExceptionTypeSerializer().deserialize(json) + return EventType.tfaAddException(v) + case "tfa_change_policy": + let v = try TeamLog.TfaChangePolicyTypeSerializer().deserialize(json) + return EventType.tfaChangePolicy(v) + case "tfa_remove_exception": + let v = try TeamLog.TfaRemoveExceptionTypeSerializer().deserialize(json) + return EventType.tfaRemoveException(v) + case "two_account_change_policy": + let v = try TeamLog.TwoAccountChangePolicyTypeSerializer().deserialize(json) + return EventType.twoAccountChangePolicy(v) + case "viewer_info_policy_changed": + let v = try TeamLog.ViewerInfoPolicyChangedTypeSerializer().deserialize(json) + return EventType.viewerInfoPolicyChanged(v) + case "watermarking_policy_changed": + let v = try TeamLog.WatermarkingPolicyChangedTypeSerializer().deserialize(json) + return EventType.watermarkingPolicyChanged(v) + case "web_sessions_change_active_session_limit": + let v = try TeamLog.WebSessionsChangeActiveSessionLimitTypeSerializer().deserialize(json) + return EventType.webSessionsChangeActiveSessionLimit(v) + case "web_sessions_change_fixed_length_policy": + let v = try TeamLog.WebSessionsChangeFixedLengthPolicyTypeSerializer().deserialize(json) + return EventType.webSessionsChangeFixedLengthPolicy(v) + case "web_sessions_change_idle_length_policy": + let v = try TeamLog.WebSessionsChangeIdleLengthPolicyTypeSerializer().deserialize(json) + return EventType.webSessionsChangeIdleLengthPolicy(v) + case "data_residency_migration_request_successful": + let v = try TeamLog.DataResidencyMigrationRequestSuccessfulTypeSerializer().deserialize(json) + return EventType.dataResidencyMigrationRequestSuccessful(v) + case "data_residency_migration_request_unsuccessful": + let v = try TeamLog.DataResidencyMigrationRequestUnsuccessfulTypeSerializer().deserialize(json) + return EventType.dataResidencyMigrationRequestUnsuccessful(v) + case "team_merge_from": + let v = try TeamLog.TeamMergeFromTypeSerializer().deserialize(json) + return EventType.teamMergeFrom(v) + case "team_merge_to": + let v = try TeamLog.TeamMergeToTypeSerializer().deserialize(json) + return EventType.teamMergeTo(v) + case "team_profile_add_background": + let v = try TeamLog.TeamProfileAddBackgroundTypeSerializer().deserialize(json) + return EventType.teamProfileAddBackground(v) + case "team_profile_add_logo": + let v = try TeamLog.TeamProfileAddLogoTypeSerializer().deserialize(json) + return EventType.teamProfileAddLogo(v) + case "team_profile_change_background": + let v = try TeamLog.TeamProfileChangeBackgroundTypeSerializer().deserialize(json) + return EventType.teamProfileChangeBackground(v) + case "team_profile_change_default_language": + let v = try TeamLog.TeamProfileChangeDefaultLanguageTypeSerializer().deserialize(json) + return EventType.teamProfileChangeDefaultLanguage(v) + case "team_profile_change_logo": + let v = try TeamLog.TeamProfileChangeLogoTypeSerializer().deserialize(json) + return EventType.teamProfileChangeLogo(v) + case "team_profile_change_name": + let v = try TeamLog.TeamProfileChangeNameTypeSerializer().deserialize(json) + return EventType.teamProfileChangeName(v) + case "team_profile_remove_background": + let v = try TeamLog.TeamProfileRemoveBackgroundTypeSerializer().deserialize(json) + return EventType.teamProfileRemoveBackground(v) + case "team_profile_remove_logo": + let v = try TeamLog.TeamProfileRemoveLogoTypeSerializer().deserialize(json) + return EventType.teamProfileRemoveLogo(v) + case "tfa_add_backup_phone": + let v = try TeamLog.TfaAddBackupPhoneTypeSerializer().deserialize(json) + return EventType.tfaAddBackupPhone(v) + case "tfa_add_security_key": + let v = try TeamLog.TfaAddSecurityKeyTypeSerializer().deserialize(json) + return EventType.tfaAddSecurityKey(v) + case "tfa_change_backup_phone": + let v = try TeamLog.TfaChangeBackupPhoneTypeSerializer().deserialize(json) + return EventType.tfaChangeBackupPhone(v) + case "tfa_change_status": + let v = try TeamLog.TfaChangeStatusTypeSerializer().deserialize(json) + return EventType.tfaChangeStatus(v) + case "tfa_remove_backup_phone": + let v = try TeamLog.TfaRemoveBackupPhoneTypeSerializer().deserialize(json) + return EventType.tfaRemoveBackupPhone(v) + case "tfa_remove_security_key": + let v = try TeamLog.TfaRemoveSecurityKeyTypeSerializer().deserialize(json) + return EventType.tfaRemoveSecurityKey(v) + case "tfa_reset": + let v = try TeamLog.TfaResetTypeSerializer().deserialize(json) + return EventType.tfaReset(v) + case "changed_enterprise_admin_role": + let v = try TeamLog.ChangedEnterpriseAdminRoleTypeSerializer().deserialize(json) + return EventType.changedEnterpriseAdminRole(v) + case "changed_enterprise_connected_team_status": + let v = try TeamLog.ChangedEnterpriseConnectedTeamStatusTypeSerializer().deserialize(json) + return EventType.changedEnterpriseConnectedTeamStatus(v) + case "ended_enterprise_admin_session": + let v = try TeamLog.EndedEnterpriseAdminSessionTypeSerializer().deserialize(json) + return EventType.endedEnterpriseAdminSession(v) + case "ended_enterprise_admin_session_deprecated": + let v = try TeamLog.EndedEnterpriseAdminSessionDeprecatedTypeSerializer().deserialize(json) + return EventType.endedEnterpriseAdminSessionDeprecated(v) + case "enterprise_settings_locking": + let v = try TeamLog.EnterpriseSettingsLockingTypeSerializer().deserialize(json) + return EventType.enterpriseSettingsLocking(v) + case "guest_admin_change_status": + let v = try TeamLog.GuestAdminChangeStatusTypeSerializer().deserialize(json) + return EventType.guestAdminChangeStatus(v) + case "started_enterprise_admin_session": + let v = try TeamLog.StartedEnterpriseAdminSessionTypeSerializer().deserialize(json) + return EventType.startedEnterpriseAdminSession(v) + case "team_merge_request_accepted": + let v = try TeamLog.TeamMergeRequestAcceptedTypeSerializer().deserialize(json) + return EventType.teamMergeRequestAccepted(v) + case "team_merge_request_accepted_shown_to_primary_team": + let v = try TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestAcceptedShownToPrimaryTeam(v) + case "team_merge_request_accepted_shown_to_secondary_team": + let v = try TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestAcceptedShownToSecondaryTeam(v) + case "team_merge_request_auto_canceled": + let v = try TeamLog.TeamMergeRequestAutoCanceledTypeSerializer().deserialize(json) + return EventType.teamMergeRequestAutoCanceled(v) + case "team_merge_request_canceled": + let v = try TeamLog.TeamMergeRequestCanceledTypeSerializer().deserialize(json) + return EventType.teamMergeRequestCanceled(v) + case "team_merge_request_canceled_shown_to_primary_team": + let v = try TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestCanceledShownToPrimaryTeam(v) + case "team_merge_request_canceled_shown_to_secondary_team": + let v = try TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestCanceledShownToSecondaryTeam(v) + case "team_merge_request_expired": + let v = try TeamLog.TeamMergeRequestExpiredTypeSerializer().deserialize(json) + return EventType.teamMergeRequestExpired(v) + case "team_merge_request_expired_shown_to_primary_team": + let v = try TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestExpiredShownToPrimaryTeam(v) + case "team_merge_request_expired_shown_to_secondary_team": + let v = try TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestExpiredShownToSecondaryTeam(v) + case "team_merge_request_rejected_shown_to_primary_team": + let v = try TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestRejectedShownToPrimaryTeam(v) + case "team_merge_request_rejected_shown_to_secondary_team": + let v = try TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestRejectedShownToSecondaryTeam(v) + case "team_merge_request_reminder": + let v = try TeamLog.TeamMergeRequestReminderTypeSerializer().deserialize(json) + return EventType.teamMergeRequestReminder(v) + case "team_merge_request_reminder_shown_to_primary_team": + let v = try TeamLog.TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestReminderShownToPrimaryTeam(v) + case "team_merge_request_reminder_shown_to_secondary_team": + let v = try TeamLog.TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestReminderShownToSecondaryTeam(v) + case "team_merge_request_revoked": + let v = try TeamLog.TeamMergeRequestRevokedTypeSerializer().deserialize(json) + return EventType.teamMergeRequestRevoked(v) + case "team_merge_request_sent_shown_to_primary_team": + let v = try TeamLog.TeamMergeRequestSentShownToPrimaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestSentShownToPrimaryTeam(v) + case "team_merge_request_sent_shown_to_secondary_team": + let v = try TeamLog.TeamMergeRequestSentShownToSecondaryTeamTypeSerializer().deserialize(json) + return EventType.teamMergeRequestSentShownToSecondaryTeam(v) + case "other": + return EventType.other + default: + return EventType.other + } + default: + throw JSONSerializerError.deserializeError(type: EventType.self, json: json) } } } /// The type of the event. - public enum EventTypeArg: CustomStringConvertible { + public enum EventTypeArg: CustomStringConvertible, JSONRepresentable { /// (admin_alerting) Changed an alert state case adminAlertingAlertStateChanged /// (admin_alerting) Changed an alert setting case adminAlertingChangedAlertConfig /// (admin_alerting) Triggered security alert case adminAlertingTriggeredAlert + /// (admin_alerting) Completed ransomware restore process + case ransomwareRestoreProcessCompleted + /// (admin_alerting) Started ransomware restore process + case ransomwareRestoreProcessStarted /// (apps) Failed to connect app for member case appBlockedByPermissions /// (apps) Linked app for team @@ -17687,12 +20690,28 @@ open class TeamLog { case domainVerificationRemoveDomain /// (domains) Enabled domain invites (deprecated, no longer logged) case enabledDomainInvites + /// (encryption) Canceled team encryption key deletion + case teamEncryptionKeyCancelKeyDeletion + /// (encryption) Created team encryption key + case teamEncryptionKeyCreateKey + /// (encryption) Deleted team encryption key + case teamEncryptionKeyDeleteKey + /// (encryption) Disabled team encryption key + case teamEncryptionKeyDisableKey + /// (encryption) Enabled team encryption key + case teamEncryptionKeyEnableKey + /// (encryption) Rotated team encryption key (deprecated, no longer logged) + case teamEncryptionKeyRotateKey + /// (encryption) Scheduled encryption key deletion + case teamEncryptionKeyScheduleKeyDeletion /// (file_operations) Applied naming convention case applyNamingConvention /// (file_operations) Created folders (deprecated, no longer logged) case createFolder /// (file_operations) Added files and/or folders case fileAdd + /// (file_operations) Added files and/or folders from automation + case fileAddFromAutomation /// (file_operations) Copied files and/or folders case fileCopy /// (file_operations) Deleted files and/or folders @@ -17735,6 +20754,8 @@ open class TeamLog { case objectLabelUpdatedValue /// (file_operations) Organized a folder with multi-file organize case organizeFolderWithTidy + /// (file_operations) Deleted files in Replay + case replayFileDelete /// (file_operations) Rewound a folder case rewindFolder /// (file_operations) Reverted naming convention @@ -17807,6 +20828,10 @@ open class TeamLog { case signInAsSessionStart /// (logins) Failed to sign in via SSO (deprecated, replaced by 'Failed to sign in') case ssoError + /// (members) Invited members to activate Backup + case backupAdminInvitationSent + /// (members) Opened Backup invite + case backupInvitationOpened /// (members) Created team invite link case createTeamInviteLink /// (members) Deleted team invite link @@ -17997,6 +21022,10 @@ open class TeamLog { case outdatedLinkViewReportFailed /// (reports) Exported all team Paper docs case paperAdminExportStart + /// (reports) Created ransomware report + case ransomwareAlertCreateReport + /// (reports) Couldn't generate ransomware report + case ransomwareAlertCreateReportFailed /// (reports) Created Smart Sync non-admin devices report case smartSyncCreateAdminPrivilegeReport /// (reports) Created team activity report @@ -18027,6 +21056,14 @@ open class TeamLog { case noteShareReceive /// (sharing) Opened shared Paper doc (deprecated, no longer logged) case openNoteShared + /// (sharing) Created shared link in Replay + case replayFileSharedLinkCreated + /// (sharing) Modified shared link in Replay + case replayFileSharedLinkModified + /// (sharing) Added member to Replay Project + case replayProjectTeamAdd + /// (sharing) Removed member from Replay Project + case replayProjectTeamDelete /// (sharing) Added team to shared folder (deprecated, no longer logged) case sfAddGroup /// (sharing) Allowed non-collaborators to view links to files in shared folder (deprecated, no longer logged) @@ -18523,3058 +21560,3223 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try EventTypeArgSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EventTypeArgSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EventTypeArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EventTypeArg: \(error)" + } } } - open class EventTypeArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EventTypeArg) -> JSON { + + public class EventTypeArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EventTypeArg) throws -> JSON { switch value { - case .adminAlertingAlertStateChanged: - var d = [String: JSON]() - d[".tag"] = .str("admin_alerting_alert_state_changed") - return .dictionary(d) - case .adminAlertingChangedAlertConfig: - var d = [String: JSON]() - d[".tag"] = .str("admin_alerting_changed_alert_config") - return .dictionary(d) - case .adminAlertingTriggeredAlert: - var d = [String: JSON]() - d[".tag"] = .str("admin_alerting_triggered_alert") - return .dictionary(d) - case .appBlockedByPermissions: - var d = [String: JSON]() - d[".tag"] = .str("app_blocked_by_permissions") - return .dictionary(d) - case .appLinkTeam: - var d = [String: JSON]() - d[".tag"] = .str("app_link_team") - return .dictionary(d) - case .appLinkUser: - var d = [String: JSON]() - d[".tag"] = .str("app_link_user") - return .dictionary(d) - case .appUnlinkTeam: - var d = [String: JSON]() - d[".tag"] = .str("app_unlink_team") - return .dictionary(d) - case .appUnlinkUser: - var d = [String: JSON]() - d[".tag"] = .str("app_unlink_user") - return .dictionary(d) - case .integrationConnected: - var d = [String: JSON]() - d[".tag"] = .str("integration_connected") - return .dictionary(d) - case .integrationDisconnected: - var d = [String: JSON]() - d[".tag"] = .str("integration_disconnected") - return .dictionary(d) - case .fileAddComment: - var d = [String: JSON]() - d[".tag"] = .str("file_add_comment") - return .dictionary(d) - case .fileChangeCommentSubscription: - var d = [String: JSON]() - d[".tag"] = .str("file_change_comment_subscription") - return .dictionary(d) - case .fileDeleteComment: - var d = [String: JSON]() - d[".tag"] = .str("file_delete_comment") - return .dictionary(d) - case .fileEditComment: - var d = [String: JSON]() - d[".tag"] = .str("file_edit_comment") - return .dictionary(d) - case .fileLikeComment: - var d = [String: JSON]() - d[".tag"] = .str("file_like_comment") - return .dictionary(d) - case .fileResolveComment: - var d = [String: JSON]() - d[".tag"] = .str("file_resolve_comment") - return .dictionary(d) - case .fileUnlikeComment: - var d = [String: JSON]() - d[".tag"] = .str("file_unlike_comment") - return .dictionary(d) - case .fileUnresolveComment: - var d = [String: JSON]() - d[".tag"] = .str("file_unresolve_comment") - return .dictionary(d) - case .governancePolicyAddFolders: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_add_folders") - return .dictionary(d) - case .governancePolicyAddFolderFailed: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_add_folder_failed") - return .dictionary(d) - case .governancePolicyContentDisposed: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_content_disposed") - return .dictionary(d) - case .governancePolicyCreate: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_create") - return .dictionary(d) - case .governancePolicyDelete: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_delete") - return .dictionary(d) - case .governancePolicyEditDetails: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_edit_details") - return .dictionary(d) - case .governancePolicyEditDuration: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_edit_duration") - return .dictionary(d) - case .governancePolicyExportCreated: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_export_created") - return .dictionary(d) - case .governancePolicyExportRemoved: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_export_removed") - return .dictionary(d) - case .governancePolicyRemoveFolders: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_remove_folders") - return .dictionary(d) - case .governancePolicyReportCreated: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_report_created") - return .dictionary(d) - case .governancePolicyZipPartDownloaded: - var d = [String: JSON]() - d[".tag"] = .str("governance_policy_zip_part_downloaded") - return .dictionary(d) - case .legalHoldsActivateAHold: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_activate_a_hold") - return .dictionary(d) - case .legalHoldsAddMembers: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_add_members") - return .dictionary(d) - case .legalHoldsChangeHoldDetails: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_change_hold_details") - return .dictionary(d) - case .legalHoldsChangeHoldName: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_change_hold_name") - return .dictionary(d) - case .legalHoldsExportAHold: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_export_a_hold") - return .dictionary(d) - case .legalHoldsExportCancelled: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_export_cancelled") - return .dictionary(d) - case .legalHoldsExportDownloaded: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_export_downloaded") - return .dictionary(d) - case .legalHoldsExportRemoved: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_export_removed") - return .dictionary(d) - case .legalHoldsReleaseAHold: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_release_a_hold") - return .dictionary(d) - case .legalHoldsRemoveMembers: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_remove_members") - return .dictionary(d) - case .legalHoldsReportAHold: - var d = [String: JSON]() - d[".tag"] = .str("legal_holds_report_a_hold") - return .dictionary(d) - case .deviceChangeIpDesktop: - var d = [String: JSON]() - d[".tag"] = .str("device_change_ip_desktop") - return .dictionary(d) - case .deviceChangeIpMobile: - var d = [String: JSON]() - d[".tag"] = .str("device_change_ip_mobile") - return .dictionary(d) - case .deviceChangeIpWeb: - var d = [String: JSON]() - d[".tag"] = .str("device_change_ip_web") - return .dictionary(d) - case .deviceDeleteOnUnlinkFail: - var d = [String: JSON]() - d[".tag"] = .str("device_delete_on_unlink_fail") - return .dictionary(d) - case .deviceDeleteOnUnlinkSuccess: - var d = [String: JSON]() - d[".tag"] = .str("device_delete_on_unlink_success") - return .dictionary(d) - case .deviceLinkFail: - var d = [String: JSON]() - d[".tag"] = .str("device_link_fail") - return .dictionary(d) - case .deviceLinkSuccess: - var d = [String: JSON]() - d[".tag"] = .str("device_link_success") - return .dictionary(d) - case .deviceManagementDisabled: - var d = [String: JSON]() - d[".tag"] = .str("device_management_disabled") - return .dictionary(d) - case .deviceManagementEnabled: - var d = [String: JSON]() - d[".tag"] = .str("device_management_enabled") - return .dictionary(d) - case .deviceSyncBackupStatusChanged: - var d = [String: JSON]() - d[".tag"] = .str("device_sync_backup_status_changed") - return .dictionary(d) - case .deviceUnlink: - var d = [String: JSON]() - d[".tag"] = .str("device_unlink") - return .dictionary(d) - case .dropboxPasswordsExported: - var d = [String: JSON]() - d[".tag"] = .str("dropbox_passwords_exported") - return .dictionary(d) - case .dropboxPasswordsNewDeviceEnrolled: - var d = [String: JSON]() - d[".tag"] = .str("dropbox_passwords_new_device_enrolled") - return .dictionary(d) - case .emmRefreshAuthToken: - var d = [String: JSON]() - d[".tag"] = .str("emm_refresh_auth_token") - return .dictionary(d) - case .externalDriveBackupEligibilityStatusChecked: - var d = [String: JSON]() - d[".tag"] = .str("external_drive_backup_eligibility_status_checked") - return .dictionary(d) - case .externalDriveBackupStatusChanged: - var d = [String: JSON]() - d[".tag"] = .str("external_drive_backup_status_changed") - return .dictionary(d) - case .accountCaptureChangeAvailability: - var d = [String: JSON]() - d[".tag"] = .str("account_capture_change_availability") - return .dictionary(d) - case .accountCaptureMigrateAccount: - var d = [String: JSON]() - d[".tag"] = .str("account_capture_migrate_account") - return .dictionary(d) - case .accountCaptureNotificationEmailsSent: - var d = [String: JSON]() - d[".tag"] = .str("account_capture_notification_emails_sent") - return .dictionary(d) - case .accountCaptureRelinquishAccount: - var d = [String: JSON]() - d[".tag"] = .str("account_capture_relinquish_account") - return .dictionary(d) - case .disabledDomainInvites: - var d = [String: JSON]() - d[".tag"] = .str("disabled_domain_invites") - return .dictionary(d) - case .domainInvitesApproveRequestToJoinTeam: - var d = [String: JSON]() - d[".tag"] = .str("domain_invites_approve_request_to_join_team") - return .dictionary(d) - case .domainInvitesDeclineRequestToJoinTeam: - var d = [String: JSON]() - d[".tag"] = .str("domain_invites_decline_request_to_join_team") - return .dictionary(d) - case .domainInvitesEmailExistingUsers: - var d = [String: JSON]() - d[".tag"] = .str("domain_invites_email_existing_users") - return .dictionary(d) - case .domainInvitesRequestToJoinTeam: - var d = [String: JSON]() - d[".tag"] = .str("domain_invites_request_to_join_team") - return .dictionary(d) - case .domainInvitesSetInviteNewUserPrefToNo: - var d = [String: JSON]() - d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_no") - return .dictionary(d) - case .domainInvitesSetInviteNewUserPrefToYes: - var d = [String: JSON]() - d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_yes") - return .dictionary(d) - case .domainVerificationAddDomainFail: - var d = [String: JSON]() - d[".tag"] = .str("domain_verification_add_domain_fail") - return .dictionary(d) - case .domainVerificationAddDomainSuccess: - var d = [String: JSON]() - d[".tag"] = .str("domain_verification_add_domain_success") - return .dictionary(d) - case .domainVerificationRemoveDomain: - var d = [String: JSON]() - d[".tag"] = .str("domain_verification_remove_domain") - return .dictionary(d) - case .enabledDomainInvites: - var d = [String: JSON]() - d[".tag"] = .str("enabled_domain_invites") - return .dictionary(d) - case .applyNamingConvention: - var d = [String: JSON]() - d[".tag"] = .str("apply_naming_convention") - return .dictionary(d) - case .createFolder: - var d = [String: JSON]() - d[".tag"] = .str("create_folder") - return .dictionary(d) - case .fileAdd: - var d = [String: JSON]() - d[".tag"] = .str("file_add") - return .dictionary(d) - case .fileCopy: - var d = [String: JSON]() - d[".tag"] = .str("file_copy") - return .dictionary(d) - case .fileDelete: - var d = [String: JSON]() - d[".tag"] = .str("file_delete") - return .dictionary(d) - case .fileDownload: - var d = [String: JSON]() - d[".tag"] = .str("file_download") - return .dictionary(d) - case .fileEdit: - var d = [String: JSON]() - d[".tag"] = .str("file_edit") - return .dictionary(d) - case .fileGetCopyReference: - var d = [String: JSON]() - d[".tag"] = .str("file_get_copy_reference") - return .dictionary(d) - case .fileLockingLockStatusChanged: - var d = [String: JSON]() - d[".tag"] = .str("file_locking_lock_status_changed") - return .dictionary(d) - case .fileMove: - var d = [String: JSON]() - d[".tag"] = .str("file_move") - return .dictionary(d) - case .filePermanentlyDelete: - var d = [String: JSON]() - d[".tag"] = .str("file_permanently_delete") - return .dictionary(d) - case .filePreview: - var d = [String: JSON]() - d[".tag"] = .str("file_preview") - return .dictionary(d) - case .fileRename: - var d = [String: JSON]() - d[".tag"] = .str("file_rename") - return .dictionary(d) - case .fileRestore: - var d = [String: JSON]() - d[".tag"] = .str("file_restore") - return .dictionary(d) - case .fileRevert: - var d = [String: JSON]() - d[".tag"] = .str("file_revert") - return .dictionary(d) - case .fileRollbackChanges: - var d = [String: JSON]() - d[".tag"] = .str("file_rollback_changes") - return .dictionary(d) - case .fileSaveCopyReference: - var d = [String: JSON]() - d[".tag"] = .str("file_save_copy_reference") - return .dictionary(d) - case .folderOverviewDescriptionChanged: - var d = [String: JSON]() - d[".tag"] = .str("folder_overview_description_changed") - return .dictionary(d) - case .folderOverviewItemPinned: - var d = [String: JSON]() - d[".tag"] = .str("folder_overview_item_pinned") - return .dictionary(d) - case .folderOverviewItemUnpinned: - var d = [String: JSON]() - d[".tag"] = .str("folder_overview_item_unpinned") - return .dictionary(d) - case .objectLabelAdded: - var d = [String: JSON]() - d[".tag"] = .str("object_label_added") - return .dictionary(d) - case .objectLabelRemoved: - var d = [String: JSON]() - d[".tag"] = .str("object_label_removed") - return .dictionary(d) - case .objectLabelUpdatedValue: - var d = [String: JSON]() - d[".tag"] = .str("object_label_updated_value") - return .dictionary(d) - case .organizeFolderWithTidy: - var d = [String: JSON]() - d[".tag"] = .str("organize_folder_with_tidy") - return .dictionary(d) - case .rewindFolder: - var d = [String: JSON]() - d[".tag"] = .str("rewind_folder") - return .dictionary(d) - case .undoNamingConvention: - var d = [String: JSON]() - d[".tag"] = .str("undo_naming_convention") - return .dictionary(d) - case .undoOrganizeFolderWithTidy: - var d = [String: JSON]() - d[".tag"] = .str("undo_organize_folder_with_tidy") - return .dictionary(d) - case .userTagsAdded: - var d = [String: JSON]() - d[".tag"] = .str("user_tags_added") - return .dictionary(d) - case .userTagsRemoved: - var d = [String: JSON]() - d[".tag"] = .str("user_tags_removed") - return .dictionary(d) - case .emailIngestReceiveFile: - var d = [String: JSON]() - d[".tag"] = .str("email_ingest_receive_file") - return .dictionary(d) - case .fileRequestChange: - var d = [String: JSON]() - d[".tag"] = .str("file_request_change") - return .dictionary(d) - case .fileRequestClose: - var d = [String: JSON]() - d[".tag"] = .str("file_request_close") - return .dictionary(d) - case .fileRequestCreate: - var d = [String: JSON]() - d[".tag"] = .str("file_request_create") - return .dictionary(d) - case .fileRequestDelete: - var d = [String: JSON]() - d[".tag"] = .str("file_request_delete") - return .dictionary(d) - case .fileRequestReceiveFile: - var d = [String: JSON]() - d[".tag"] = .str("file_request_receive_file") - return .dictionary(d) - case .groupAddExternalId: - var d = [String: JSON]() - d[".tag"] = .str("group_add_external_id") - return .dictionary(d) - case .groupAddMember: - var d = [String: JSON]() - d[".tag"] = .str("group_add_member") - return .dictionary(d) - case .groupChangeExternalId: - var d = [String: JSON]() - d[".tag"] = .str("group_change_external_id") - return .dictionary(d) - case .groupChangeManagementType: - var d = [String: JSON]() - d[".tag"] = .str("group_change_management_type") - return .dictionary(d) - case .groupChangeMemberRole: - var d = [String: JSON]() - d[".tag"] = .str("group_change_member_role") - return .dictionary(d) - case .groupCreate: - var d = [String: JSON]() - d[".tag"] = .str("group_create") - return .dictionary(d) - case .groupDelete: - var d = [String: JSON]() - d[".tag"] = .str("group_delete") - return .dictionary(d) - case .groupDescriptionUpdated: - var d = [String: JSON]() - d[".tag"] = .str("group_description_updated") - return .dictionary(d) - case .groupJoinPolicyUpdated: - var d = [String: JSON]() - d[".tag"] = .str("group_join_policy_updated") - return .dictionary(d) - case .groupMoved: - var d = [String: JSON]() - d[".tag"] = .str("group_moved") - return .dictionary(d) - case .groupRemoveExternalId: - var d = [String: JSON]() - d[".tag"] = .str("group_remove_external_id") - return .dictionary(d) - case .groupRemoveMember: - var d = [String: JSON]() - d[".tag"] = .str("group_remove_member") - return .dictionary(d) - case .groupRename: - var d = [String: JSON]() - d[".tag"] = .str("group_rename") - return .dictionary(d) - case .accountLockOrUnlocked: - var d = [String: JSON]() - d[".tag"] = .str("account_lock_or_unlocked") - return .dictionary(d) - case .emmError: - var d = [String: JSON]() - d[".tag"] = .str("emm_error") - return .dictionary(d) - case .guestAdminSignedInViaTrustedTeams: - var d = [String: JSON]() - d[".tag"] = .str("guest_admin_signed_in_via_trusted_teams") - return .dictionary(d) - case .guestAdminSignedOutViaTrustedTeams: - var d = [String: JSON]() - d[".tag"] = .str("guest_admin_signed_out_via_trusted_teams") - return .dictionary(d) - case .loginFail: - var d = [String: JSON]() - d[".tag"] = .str("login_fail") - return .dictionary(d) - case .loginSuccess: - var d = [String: JSON]() - d[".tag"] = .str("login_success") - return .dictionary(d) - case .logout: - var d = [String: JSON]() - d[".tag"] = .str("logout") - return .dictionary(d) - case .resellerSupportSessionEnd: - var d = [String: JSON]() - d[".tag"] = .str("reseller_support_session_end") - return .dictionary(d) - case .resellerSupportSessionStart: - var d = [String: JSON]() - d[".tag"] = .str("reseller_support_session_start") - return .dictionary(d) - case .signInAsSessionEnd: - var d = [String: JSON]() - d[".tag"] = .str("sign_in_as_session_end") - return .dictionary(d) - case .signInAsSessionStart: - var d = [String: JSON]() - d[".tag"] = .str("sign_in_as_session_start") - return .dictionary(d) - case .ssoError: - var d = [String: JSON]() - d[".tag"] = .str("sso_error") - return .dictionary(d) - case .createTeamInviteLink: - var d = [String: JSON]() - d[".tag"] = .str("create_team_invite_link") - return .dictionary(d) - case .deleteTeamInviteLink: - var d = [String: JSON]() - d[".tag"] = .str("delete_team_invite_link") - return .dictionary(d) - case .memberAddExternalId: - var d = [String: JSON]() - d[".tag"] = .str("member_add_external_id") - return .dictionary(d) - case .memberAddName: - var d = [String: JSON]() - d[".tag"] = .str("member_add_name") - return .dictionary(d) - case .memberChangeAdminRole: - var d = [String: JSON]() - d[".tag"] = .str("member_change_admin_role") - return .dictionary(d) - case .memberChangeEmail: - var d = [String: JSON]() - d[".tag"] = .str("member_change_email") - return .dictionary(d) - case .memberChangeExternalId: - var d = [String: JSON]() - d[".tag"] = .str("member_change_external_id") - return .dictionary(d) - case .memberChangeMembershipType: - var d = [String: JSON]() - d[".tag"] = .str("member_change_membership_type") - return .dictionary(d) - case .memberChangeName: - var d = [String: JSON]() - d[".tag"] = .str("member_change_name") - return .dictionary(d) - case .memberChangeResellerRole: - var d = [String: JSON]() - d[".tag"] = .str("member_change_reseller_role") - return .dictionary(d) - case .memberChangeStatus: - var d = [String: JSON]() - d[".tag"] = .str("member_change_status") - return .dictionary(d) - case .memberDeleteManualContacts: - var d = [String: JSON]() - d[".tag"] = .str("member_delete_manual_contacts") - return .dictionary(d) - case .memberDeleteProfilePhoto: - var d = [String: JSON]() - d[".tag"] = .str("member_delete_profile_photo") - return .dictionary(d) - case .memberPermanentlyDeleteAccountContents: - var d = [String: JSON]() - d[".tag"] = .str("member_permanently_delete_account_contents") - return .dictionary(d) - case .memberRemoveExternalId: - var d = [String: JSON]() - d[".tag"] = .str("member_remove_external_id") - return .dictionary(d) - case .memberSetProfilePhoto: - var d = [String: JSON]() - d[".tag"] = .str("member_set_profile_photo") - return .dictionary(d) - case .memberSpaceLimitsAddCustomQuota: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_add_custom_quota") - return .dictionary(d) - case .memberSpaceLimitsChangeCustomQuota: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_change_custom_quota") - return .dictionary(d) - case .memberSpaceLimitsChangeStatus: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_change_status") - return .dictionary(d) - case .memberSpaceLimitsRemoveCustomQuota: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_remove_custom_quota") - return .dictionary(d) - case .memberSuggest: - var d = [String: JSON]() - d[".tag"] = .str("member_suggest") - return .dictionary(d) - case .memberTransferAccountContents: - var d = [String: JSON]() - d[".tag"] = .str("member_transfer_account_contents") - return .dictionary(d) - case .pendingSecondaryEmailAdded: - var d = [String: JSON]() - d[".tag"] = .str("pending_secondary_email_added") - return .dictionary(d) - case .secondaryEmailDeleted: - var d = [String: JSON]() - d[".tag"] = .str("secondary_email_deleted") - return .dictionary(d) - case .secondaryEmailVerified: - var d = [String: JSON]() - d[".tag"] = .str("secondary_email_verified") - return .dictionary(d) - case .secondaryMailsPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("secondary_mails_policy_changed") - return .dictionary(d) - case .binderAddPage: - var d = [String: JSON]() - d[".tag"] = .str("binder_add_page") - return .dictionary(d) - case .binderAddSection: - var d = [String: JSON]() - d[".tag"] = .str("binder_add_section") - return .dictionary(d) - case .binderRemovePage: - var d = [String: JSON]() - d[".tag"] = .str("binder_remove_page") - return .dictionary(d) - case .binderRemoveSection: - var d = [String: JSON]() - d[".tag"] = .str("binder_remove_section") - return .dictionary(d) - case .binderRenamePage: - var d = [String: JSON]() - d[".tag"] = .str("binder_rename_page") - return .dictionary(d) - case .binderRenameSection: - var d = [String: JSON]() - d[".tag"] = .str("binder_rename_section") - return .dictionary(d) - case .binderReorderPage: - var d = [String: JSON]() - d[".tag"] = .str("binder_reorder_page") - return .dictionary(d) - case .binderReorderSection: - var d = [String: JSON]() - d[".tag"] = .str("binder_reorder_section") - return .dictionary(d) - case .paperContentAddMember: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_add_member") - return .dictionary(d) - case .paperContentAddToFolder: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_add_to_folder") - return .dictionary(d) - case .paperContentArchive: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_archive") - return .dictionary(d) - case .paperContentCreate: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_create") - return .dictionary(d) - case .paperContentPermanentlyDelete: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_permanently_delete") - return .dictionary(d) - case .paperContentRemoveFromFolder: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_remove_from_folder") - return .dictionary(d) - case .paperContentRemoveMember: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_remove_member") - return .dictionary(d) - case .paperContentRename: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_rename") - return .dictionary(d) - case .paperContentRestore: - var d = [String: JSON]() - d[".tag"] = .str("paper_content_restore") - return .dictionary(d) - case .paperDocAddComment: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_add_comment") - return .dictionary(d) - case .paperDocChangeMemberRole: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_change_member_role") - return .dictionary(d) - case .paperDocChangeSharingPolicy: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_change_sharing_policy") - return .dictionary(d) - case .paperDocChangeSubscription: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_change_subscription") - return .dictionary(d) - case .paperDocDeleted: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_deleted") - return .dictionary(d) - case .paperDocDeleteComment: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_delete_comment") - return .dictionary(d) - case .paperDocDownload: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_download") - return .dictionary(d) - case .paperDocEdit: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_edit") - return .dictionary(d) - case .paperDocEditComment: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_edit_comment") - return .dictionary(d) - case .paperDocFollowed: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_followed") - return .dictionary(d) - case .paperDocMention: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_mention") - return .dictionary(d) - case .paperDocOwnershipChanged: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_ownership_changed") - return .dictionary(d) - case .paperDocRequestAccess: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_request_access") - return .dictionary(d) - case .paperDocResolveComment: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_resolve_comment") - return .dictionary(d) - case .paperDocRevert: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_revert") - return .dictionary(d) - case .paperDocSlackShare: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_slack_share") - return .dictionary(d) - case .paperDocTeamInvite: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_team_invite") - return .dictionary(d) - case .paperDocTrashed: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_trashed") - return .dictionary(d) - case .paperDocUnresolveComment: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_unresolve_comment") - return .dictionary(d) - case .paperDocUntrashed: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_untrashed") - return .dictionary(d) - case .paperDocView: - var d = [String: JSON]() - d[".tag"] = .str("paper_doc_view") - return .dictionary(d) - case .paperExternalViewAllow: - var d = [String: JSON]() - d[".tag"] = .str("paper_external_view_allow") - return .dictionary(d) - case .paperExternalViewDefaultTeam: - var d = [String: JSON]() - d[".tag"] = .str("paper_external_view_default_team") - return .dictionary(d) - case .paperExternalViewForbid: - var d = [String: JSON]() - d[".tag"] = .str("paper_external_view_forbid") - return .dictionary(d) - case .paperFolderChangeSubscription: - var d = [String: JSON]() - d[".tag"] = .str("paper_folder_change_subscription") - return .dictionary(d) - case .paperFolderDeleted: - var d = [String: JSON]() - d[".tag"] = .str("paper_folder_deleted") - return .dictionary(d) - case .paperFolderFollowed: - var d = [String: JSON]() - d[".tag"] = .str("paper_folder_followed") - return .dictionary(d) - case .paperFolderTeamInvite: - var d = [String: JSON]() - d[".tag"] = .str("paper_folder_team_invite") - return .dictionary(d) - case .paperPublishedLinkChangePermission: - var d = [String: JSON]() - d[".tag"] = .str("paper_published_link_change_permission") - return .dictionary(d) - case .paperPublishedLinkCreate: - var d = [String: JSON]() - d[".tag"] = .str("paper_published_link_create") - return .dictionary(d) - case .paperPublishedLinkDisabled: - var d = [String: JSON]() - d[".tag"] = .str("paper_published_link_disabled") - return .dictionary(d) - case .paperPublishedLinkView: - var d = [String: JSON]() - d[".tag"] = .str("paper_published_link_view") - return .dictionary(d) - case .passwordChange: - var d = [String: JSON]() - d[".tag"] = .str("password_change") - return .dictionary(d) - case .passwordReset: - var d = [String: JSON]() - d[".tag"] = .str("password_reset") - return .dictionary(d) - case .passwordResetAll: - var d = [String: JSON]() - d[".tag"] = .str("password_reset_all") - return .dictionary(d) - case .classificationCreateReport: - var d = [String: JSON]() - d[".tag"] = .str("classification_create_report") - return .dictionary(d) - case .classificationCreateReportFail: - var d = [String: JSON]() - d[".tag"] = .str("classification_create_report_fail") - return .dictionary(d) - case .emmCreateExceptionsReport: - var d = [String: JSON]() - d[".tag"] = .str("emm_create_exceptions_report") - return .dictionary(d) - case .emmCreateUsageReport: - var d = [String: JSON]() - d[".tag"] = .str("emm_create_usage_report") - return .dictionary(d) - case .exportMembersReport: - var d = [String: JSON]() - d[".tag"] = .str("export_members_report") - return .dictionary(d) - case .exportMembersReportFail: - var d = [String: JSON]() - d[".tag"] = .str("export_members_report_fail") - return .dictionary(d) - case .externalSharingCreateReport: - var d = [String: JSON]() - d[".tag"] = .str("external_sharing_create_report") - return .dictionary(d) - case .externalSharingReportFailed: - var d = [String: JSON]() - d[".tag"] = .str("external_sharing_report_failed") - return .dictionary(d) - case .noExpirationLinkGenCreateReport: - var d = [String: JSON]() - d[".tag"] = .str("no_expiration_link_gen_create_report") - return .dictionary(d) - case .noExpirationLinkGenReportFailed: - var d = [String: JSON]() - d[".tag"] = .str("no_expiration_link_gen_report_failed") - return .dictionary(d) - case .noPasswordLinkGenCreateReport: - var d = [String: JSON]() - d[".tag"] = .str("no_password_link_gen_create_report") - return .dictionary(d) - case .noPasswordLinkGenReportFailed: - var d = [String: JSON]() - d[".tag"] = .str("no_password_link_gen_report_failed") - return .dictionary(d) - case .noPasswordLinkViewCreateReport: - var d = [String: JSON]() - d[".tag"] = .str("no_password_link_view_create_report") - return .dictionary(d) - case .noPasswordLinkViewReportFailed: - var d = [String: JSON]() - d[".tag"] = .str("no_password_link_view_report_failed") - return .dictionary(d) - case .outdatedLinkViewCreateReport: - var d = [String: JSON]() - d[".tag"] = .str("outdated_link_view_create_report") - return .dictionary(d) - case .outdatedLinkViewReportFailed: - var d = [String: JSON]() - d[".tag"] = .str("outdated_link_view_report_failed") - return .dictionary(d) - case .paperAdminExportStart: - var d = [String: JSON]() - d[".tag"] = .str("paper_admin_export_start") - return .dictionary(d) - case .smartSyncCreateAdminPrivilegeReport: - var d = [String: JSON]() - d[".tag"] = .str("smart_sync_create_admin_privilege_report") - return .dictionary(d) - case .teamActivityCreateReport: - var d = [String: JSON]() - d[".tag"] = .str("team_activity_create_report") - return .dictionary(d) - case .teamActivityCreateReportFail: - var d = [String: JSON]() - d[".tag"] = .str("team_activity_create_report_fail") - return .dictionary(d) - case .collectionShare: - var d = [String: JSON]() - d[".tag"] = .str("collection_share") - return .dictionary(d) - case .fileTransfersFileAdd: - var d = [String: JSON]() - d[".tag"] = .str("file_transfers_file_add") - return .dictionary(d) - case .fileTransfersTransferDelete: - var d = [String: JSON]() - d[".tag"] = .str("file_transfers_transfer_delete") - return .dictionary(d) - case .fileTransfersTransferDownload: - var d = [String: JSON]() - d[".tag"] = .str("file_transfers_transfer_download") - return .dictionary(d) - case .fileTransfersTransferSend: - var d = [String: JSON]() - d[".tag"] = .str("file_transfers_transfer_send") - return .dictionary(d) - case .fileTransfersTransferView: - var d = [String: JSON]() - d[".tag"] = .str("file_transfers_transfer_view") - return .dictionary(d) - case .noteAclInviteOnly: - var d = [String: JSON]() - d[".tag"] = .str("note_acl_invite_only") - return .dictionary(d) - case .noteAclLink: - var d = [String: JSON]() - d[".tag"] = .str("note_acl_link") - return .dictionary(d) - case .noteAclTeamLink: - var d = [String: JSON]() - d[".tag"] = .str("note_acl_team_link") - return .dictionary(d) - case .noteShared: - var d = [String: JSON]() - d[".tag"] = .str("note_shared") - return .dictionary(d) - case .noteShareReceive: - var d = [String: JSON]() - d[".tag"] = .str("note_share_receive") - return .dictionary(d) - case .openNoteShared: - var d = [String: JSON]() - d[".tag"] = .str("open_note_shared") - return .dictionary(d) - case .sfAddGroup: - var d = [String: JSON]() - d[".tag"] = .str("sf_add_group") - return .dictionary(d) - case .sfAllowNonMembersToViewSharedLinks: - var d = [String: JSON]() - d[".tag"] = .str("sf_allow_non_members_to_view_shared_links") - return .dictionary(d) - case .sfExternalInviteWarn: - var d = [String: JSON]() - d[".tag"] = .str("sf_external_invite_warn") - return .dictionary(d) - case .sfFbInvite: - var d = [String: JSON]() - d[".tag"] = .str("sf_fb_invite") - return .dictionary(d) - case .sfFbInviteChangeRole: - var d = [String: JSON]() - d[".tag"] = .str("sf_fb_invite_change_role") - return .dictionary(d) - case .sfFbUninvite: - var d = [String: JSON]() - d[".tag"] = .str("sf_fb_uninvite") - return .dictionary(d) - case .sfInviteGroup: - var d = [String: JSON]() - d[".tag"] = .str("sf_invite_group") - return .dictionary(d) - case .sfTeamGrantAccess: - var d = [String: JSON]() - d[".tag"] = .str("sf_team_grant_access") - return .dictionary(d) - case .sfTeamInvite: - var d = [String: JSON]() - d[".tag"] = .str("sf_team_invite") - return .dictionary(d) - case .sfTeamInviteChangeRole: - var d = [String: JSON]() - d[".tag"] = .str("sf_team_invite_change_role") - return .dictionary(d) - case .sfTeamJoin: - var d = [String: JSON]() - d[".tag"] = .str("sf_team_join") - return .dictionary(d) - case .sfTeamJoinFromOobLink: - var d = [String: JSON]() - d[".tag"] = .str("sf_team_join_from_oob_link") - return .dictionary(d) - case .sfTeamUninvite: - var d = [String: JSON]() - d[".tag"] = .str("sf_team_uninvite") - return .dictionary(d) - case .sharedContentAddInvitees: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_add_invitees") - return .dictionary(d) - case .sharedContentAddLinkExpiry: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_add_link_expiry") - return .dictionary(d) - case .sharedContentAddLinkPassword: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_add_link_password") - return .dictionary(d) - case .sharedContentAddMember: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_add_member") - return .dictionary(d) - case .sharedContentChangeDownloadsPolicy: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_change_downloads_policy") - return .dictionary(d) - case .sharedContentChangeInviteeRole: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_change_invitee_role") - return .dictionary(d) - case .sharedContentChangeLinkAudience: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_change_link_audience") - return .dictionary(d) - case .sharedContentChangeLinkExpiry: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_change_link_expiry") - return .dictionary(d) - case .sharedContentChangeLinkPassword: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_change_link_password") - return .dictionary(d) - case .sharedContentChangeMemberRole: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_change_member_role") - return .dictionary(d) - case .sharedContentChangeViewerInfoPolicy: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_change_viewer_info_policy") - return .dictionary(d) - case .sharedContentClaimInvitation: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_claim_invitation") - return .dictionary(d) - case .sharedContentCopy: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_copy") - return .dictionary(d) - case .sharedContentDownload: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_download") - return .dictionary(d) - case .sharedContentRelinquishMembership: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_relinquish_membership") - return .dictionary(d) - case .sharedContentRemoveInvitees: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_remove_invitees") - return .dictionary(d) - case .sharedContentRemoveLinkExpiry: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_remove_link_expiry") - return .dictionary(d) - case .sharedContentRemoveLinkPassword: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_remove_link_password") - return .dictionary(d) - case .sharedContentRemoveMember: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_remove_member") - return .dictionary(d) - case .sharedContentRequestAccess: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_request_access") - return .dictionary(d) - case .sharedContentRestoreInvitees: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_restore_invitees") - return .dictionary(d) - case .sharedContentRestoreMember: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_restore_member") - return .dictionary(d) - case .sharedContentUnshare: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_unshare") - return .dictionary(d) - case .sharedContentView: - var d = [String: JSON]() - d[".tag"] = .str("shared_content_view") - return .dictionary(d) - case .sharedFolderChangeLinkPolicy: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_change_link_policy") - return .dictionary(d) - case .sharedFolderChangeMembersInheritancePolicy: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_change_members_inheritance_policy") - return .dictionary(d) - case .sharedFolderChangeMembersManagementPolicy: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_change_members_management_policy") - return .dictionary(d) - case .sharedFolderChangeMembersPolicy: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_change_members_policy") - return .dictionary(d) - case .sharedFolderCreate: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_create") - return .dictionary(d) - case .sharedFolderDeclineInvitation: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_decline_invitation") - return .dictionary(d) - case .sharedFolderMount: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_mount") - return .dictionary(d) - case .sharedFolderNest: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_nest") - return .dictionary(d) - case .sharedFolderTransferOwnership: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_transfer_ownership") - return .dictionary(d) - case .sharedFolderUnmount: - var d = [String: JSON]() - d[".tag"] = .str("shared_folder_unmount") - return .dictionary(d) - case .sharedLinkAddExpiry: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_add_expiry") - return .dictionary(d) - case .sharedLinkChangeExpiry: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_change_expiry") - return .dictionary(d) - case .sharedLinkChangeVisibility: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_change_visibility") - return .dictionary(d) - case .sharedLinkCopy: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_copy") - return .dictionary(d) - case .sharedLinkCreate: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_create") - return .dictionary(d) - case .sharedLinkDisable: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_disable") - return .dictionary(d) - case .sharedLinkDownload: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_download") - return .dictionary(d) - case .sharedLinkRemoveExpiry: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_remove_expiry") - return .dictionary(d) - case .sharedLinkSettingsAddExpiration: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_add_expiration") - return .dictionary(d) - case .sharedLinkSettingsAddPassword: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_add_password") - return .dictionary(d) - case .sharedLinkSettingsAllowDownloadDisabled: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_allow_download_disabled") - return .dictionary(d) - case .sharedLinkSettingsAllowDownloadEnabled: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_allow_download_enabled") - return .dictionary(d) - case .sharedLinkSettingsChangeAudience: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_change_audience") - return .dictionary(d) - case .sharedLinkSettingsChangeExpiration: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_change_expiration") - return .dictionary(d) - case .sharedLinkSettingsChangePassword: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_change_password") - return .dictionary(d) - case .sharedLinkSettingsRemoveExpiration: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_remove_expiration") - return .dictionary(d) - case .sharedLinkSettingsRemovePassword: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_settings_remove_password") - return .dictionary(d) - case .sharedLinkShare: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_share") - return .dictionary(d) - case .sharedLinkView: - var d = [String: JSON]() - d[".tag"] = .str("shared_link_view") - return .dictionary(d) - case .sharedNoteOpened: - var d = [String: JSON]() - d[".tag"] = .str("shared_note_opened") - return .dictionary(d) - case .shmodelDisableDownloads: - var d = [String: JSON]() - d[".tag"] = .str("shmodel_disable_downloads") - return .dictionary(d) - case .shmodelEnableDownloads: - var d = [String: JSON]() - d[".tag"] = .str("shmodel_enable_downloads") - return .dictionary(d) - case .shmodelGroupShare: - var d = [String: JSON]() - d[".tag"] = .str("shmodel_group_share") - return .dictionary(d) - case .showcaseAccessGranted: - var d = [String: JSON]() - d[".tag"] = .str("showcase_access_granted") - return .dictionary(d) - case .showcaseAddMember: - var d = [String: JSON]() - d[".tag"] = .str("showcase_add_member") - return .dictionary(d) - case .showcaseArchived: - var d = [String: JSON]() - d[".tag"] = .str("showcase_archived") - return .dictionary(d) - case .showcaseCreated: - var d = [String: JSON]() - d[".tag"] = .str("showcase_created") - return .dictionary(d) - case .showcaseDeleteComment: - var d = [String: JSON]() - d[".tag"] = .str("showcase_delete_comment") - return .dictionary(d) - case .showcaseEdited: - var d = [String: JSON]() - d[".tag"] = .str("showcase_edited") - return .dictionary(d) - case .showcaseEditComment: - var d = [String: JSON]() - d[".tag"] = .str("showcase_edit_comment") - return .dictionary(d) - case .showcaseFileAdded: - var d = [String: JSON]() - d[".tag"] = .str("showcase_file_added") - return .dictionary(d) - case .showcaseFileDownload: - var d = [String: JSON]() - d[".tag"] = .str("showcase_file_download") - return .dictionary(d) - case .showcaseFileRemoved: - var d = [String: JSON]() - d[".tag"] = .str("showcase_file_removed") - return .dictionary(d) - case .showcaseFileView: - var d = [String: JSON]() - d[".tag"] = .str("showcase_file_view") - return .dictionary(d) - case .showcasePermanentlyDeleted: - var d = [String: JSON]() - d[".tag"] = .str("showcase_permanently_deleted") - return .dictionary(d) - case .showcasePostComment: - var d = [String: JSON]() - d[".tag"] = .str("showcase_post_comment") - return .dictionary(d) - case .showcaseRemoveMember: - var d = [String: JSON]() - d[".tag"] = .str("showcase_remove_member") - return .dictionary(d) - case .showcaseRenamed: - var d = [String: JSON]() - d[".tag"] = .str("showcase_renamed") - return .dictionary(d) - case .showcaseRequestAccess: - var d = [String: JSON]() - d[".tag"] = .str("showcase_request_access") - return .dictionary(d) - case .showcaseResolveComment: - var d = [String: JSON]() - d[".tag"] = .str("showcase_resolve_comment") - return .dictionary(d) - case .showcaseRestored: - var d = [String: JSON]() - d[".tag"] = .str("showcase_restored") - return .dictionary(d) - case .showcaseTrashed: - var d = [String: JSON]() - d[".tag"] = .str("showcase_trashed") - return .dictionary(d) - case .showcaseTrashedDeprecated: - var d = [String: JSON]() - d[".tag"] = .str("showcase_trashed_deprecated") - return .dictionary(d) - case .showcaseUnresolveComment: - var d = [String: JSON]() - d[".tag"] = .str("showcase_unresolve_comment") - return .dictionary(d) - case .showcaseUntrashed: - var d = [String: JSON]() - d[".tag"] = .str("showcase_untrashed") - return .dictionary(d) - case .showcaseUntrashedDeprecated: - var d = [String: JSON]() - d[".tag"] = .str("showcase_untrashed_deprecated") - return .dictionary(d) - case .showcaseView: - var d = [String: JSON]() - d[".tag"] = .str("showcase_view") - return .dictionary(d) - case .ssoAddCert: - var d = [String: JSON]() - d[".tag"] = .str("sso_add_cert") - return .dictionary(d) - case .ssoAddLoginUrl: - var d = [String: JSON]() - d[".tag"] = .str("sso_add_login_url") - return .dictionary(d) - case .ssoAddLogoutUrl: - var d = [String: JSON]() - d[".tag"] = .str("sso_add_logout_url") - return .dictionary(d) - case .ssoChangeCert: - var d = [String: JSON]() - d[".tag"] = .str("sso_change_cert") - return .dictionary(d) - case .ssoChangeLoginUrl: - var d = [String: JSON]() - d[".tag"] = .str("sso_change_login_url") - return .dictionary(d) - case .ssoChangeLogoutUrl: - var d = [String: JSON]() - d[".tag"] = .str("sso_change_logout_url") - return .dictionary(d) - case .ssoChangeSamlIdentityMode: - var d = [String: JSON]() - d[".tag"] = .str("sso_change_saml_identity_mode") - return .dictionary(d) - case .ssoRemoveCert: - var d = [String: JSON]() - d[".tag"] = .str("sso_remove_cert") - return .dictionary(d) - case .ssoRemoveLoginUrl: - var d = [String: JSON]() - d[".tag"] = .str("sso_remove_login_url") - return .dictionary(d) - case .ssoRemoveLogoutUrl: - var d = [String: JSON]() - d[".tag"] = .str("sso_remove_logout_url") - return .dictionary(d) - case .teamFolderChangeStatus: - var d = [String: JSON]() - d[".tag"] = .str("team_folder_change_status") - return .dictionary(d) - case .teamFolderCreate: - var d = [String: JSON]() - d[".tag"] = .str("team_folder_create") - return .dictionary(d) - case .teamFolderDowngrade: - var d = [String: JSON]() - d[".tag"] = .str("team_folder_downgrade") - return .dictionary(d) - case .teamFolderPermanentlyDelete: - var d = [String: JSON]() - d[".tag"] = .str("team_folder_permanently_delete") - return .dictionary(d) - case .teamFolderRename: - var d = [String: JSON]() - d[".tag"] = .str("team_folder_rename") - return .dictionary(d) - case .teamSelectiveSyncSettingsChanged: - var d = [String: JSON]() - d[".tag"] = .str("team_selective_sync_settings_changed") - return .dictionary(d) - case .accountCaptureChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("account_capture_change_policy") - return .dictionary(d) - case .adminEmailRemindersChanged: - var d = [String: JSON]() - d[".tag"] = .str("admin_email_reminders_changed") - return .dictionary(d) - case .allowDownloadDisabled: - var d = [String: JSON]() - d[".tag"] = .str("allow_download_disabled") - return .dictionary(d) - case .allowDownloadEnabled: - var d = [String: JSON]() - d[".tag"] = .str("allow_download_enabled") - return .dictionary(d) - case .appPermissionsChanged: - var d = [String: JSON]() - d[".tag"] = .str("app_permissions_changed") - return .dictionary(d) - case .cameraUploadsPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("camera_uploads_policy_changed") - return .dictionary(d) - case .captureTranscriptPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("capture_transcript_policy_changed") - return .dictionary(d) - case .classificationChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("classification_change_policy") - return .dictionary(d) - case .computerBackupPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("computer_backup_policy_changed") - return .dictionary(d) - case .contentAdministrationPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("content_administration_policy_changed") - return .dictionary(d) - case .dataPlacementRestrictionChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("data_placement_restriction_change_policy") - return .dictionary(d) - case .dataPlacementRestrictionSatisfyPolicy: - var d = [String: JSON]() - d[".tag"] = .str("data_placement_restriction_satisfy_policy") - return .dictionary(d) - case .deviceApprovalsAddException: - var d = [String: JSON]() - d[".tag"] = .str("device_approvals_add_exception") - return .dictionary(d) - case .deviceApprovalsChangeDesktopPolicy: - var d = [String: JSON]() - d[".tag"] = .str("device_approvals_change_desktop_policy") - return .dictionary(d) - case .deviceApprovalsChangeMobilePolicy: - var d = [String: JSON]() - d[".tag"] = .str("device_approvals_change_mobile_policy") - return .dictionary(d) - case .deviceApprovalsChangeOverageAction: - var d = [String: JSON]() - d[".tag"] = .str("device_approvals_change_overage_action") - return .dictionary(d) - case .deviceApprovalsChangeUnlinkAction: - var d = [String: JSON]() - d[".tag"] = .str("device_approvals_change_unlink_action") - return .dictionary(d) - case .deviceApprovalsRemoveException: - var d = [String: JSON]() - d[".tag"] = .str("device_approvals_remove_exception") - return .dictionary(d) - case .directoryRestrictionsAddMembers: - var d = [String: JSON]() - d[".tag"] = .str("directory_restrictions_add_members") - return .dictionary(d) - case .directoryRestrictionsRemoveMembers: - var d = [String: JSON]() - d[".tag"] = .str("directory_restrictions_remove_members") - return .dictionary(d) - case .dropboxPasswordsPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("dropbox_passwords_policy_changed") - return .dictionary(d) - case .emailIngestPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("email_ingest_policy_changed") - return .dictionary(d) - case .emmAddException: - var d = [String: JSON]() - d[".tag"] = .str("emm_add_exception") - return .dictionary(d) - case .emmChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("emm_change_policy") - return .dictionary(d) - case .emmRemoveException: - var d = [String: JSON]() - d[".tag"] = .str("emm_remove_exception") - return .dictionary(d) - case .extendedVersionHistoryChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("extended_version_history_change_policy") - return .dictionary(d) - case .externalDriveBackupPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("external_drive_backup_policy_changed") - return .dictionary(d) - case .fileCommentsChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("file_comments_change_policy") - return .dictionary(d) - case .fileLockingPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("file_locking_policy_changed") - return .dictionary(d) - case .fileProviderMigrationPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("file_provider_migration_policy_changed") - return .dictionary(d) - case .fileRequestsChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("file_requests_change_policy") - return .dictionary(d) - case .fileRequestsEmailsEnabled: - var d = [String: JSON]() - d[".tag"] = .str("file_requests_emails_enabled") - return .dictionary(d) - case .fileRequestsEmailsRestrictedToTeamOnly: - var d = [String: JSON]() - d[".tag"] = .str("file_requests_emails_restricted_to_team_only") - return .dictionary(d) - case .fileTransfersPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("file_transfers_policy_changed") - return .dictionary(d) - case .folderLinkRestrictionPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("folder_link_restriction_policy_changed") - return .dictionary(d) - case .googleSsoChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("google_sso_change_policy") - return .dictionary(d) - case .groupUserManagementChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("group_user_management_change_policy") - return .dictionary(d) - case .integrationPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("integration_policy_changed") - return .dictionary(d) - case .inviteAcceptanceEmailPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("invite_acceptance_email_policy_changed") - return .dictionary(d) - case .memberRequestsChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("member_requests_change_policy") - return .dictionary(d) - case .memberSendInvitePolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("member_send_invite_policy_changed") - return .dictionary(d) - case .memberSpaceLimitsAddException: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_add_exception") - return .dictionary(d) - case .memberSpaceLimitsChangeCapsTypePolicy: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_change_caps_type_policy") - return .dictionary(d) - case .memberSpaceLimitsChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_change_policy") - return .dictionary(d) - case .memberSpaceLimitsRemoveException: - var d = [String: JSON]() - d[".tag"] = .str("member_space_limits_remove_exception") - return .dictionary(d) - case .memberSuggestionsChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("member_suggestions_change_policy") - return .dictionary(d) - case .microsoftOfficeAddinChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("microsoft_office_addin_change_policy") - return .dictionary(d) - case .networkControlChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("network_control_change_policy") - return .dictionary(d) - case .paperChangeDeploymentPolicy: - var d = [String: JSON]() - d[".tag"] = .str("paper_change_deployment_policy") - return .dictionary(d) - case .paperChangeMemberLinkPolicy: - var d = [String: JSON]() - d[".tag"] = .str("paper_change_member_link_policy") - return .dictionary(d) - case .paperChangeMemberPolicy: - var d = [String: JSON]() - d[".tag"] = .str("paper_change_member_policy") - return .dictionary(d) - case .paperChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("paper_change_policy") - return .dictionary(d) - case .paperDefaultFolderPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("paper_default_folder_policy_changed") - return .dictionary(d) - case .paperDesktopPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("paper_desktop_policy_changed") - return .dictionary(d) - case .paperEnabledUsersGroupAddition: - var d = [String: JSON]() - d[".tag"] = .str("paper_enabled_users_group_addition") - return .dictionary(d) - case .paperEnabledUsersGroupRemoval: - var d = [String: JSON]() - d[".tag"] = .str("paper_enabled_users_group_removal") - return .dictionary(d) - case .passwordStrengthRequirementsChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("password_strength_requirements_change_policy") - return .dictionary(d) - case .permanentDeleteChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("permanent_delete_change_policy") - return .dictionary(d) - case .resellerSupportChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("reseller_support_change_policy") - return .dictionary(d) - case .rewindPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("rewind_policy_changed") - return .dictionary(d) - case .sendForSignaturePolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("send_for_signature_policy_changed") - return .dictionary(d) - case .sharingChangeFolderJoinPolicy: - var d = [String: JSON]() - d[".tag"] = .str("sharing_change_folder_join_policy") - return .dictionary(d) - case .sharingChangeLinkAllowChangeExpirationPolicy: - var d = [String: JSON]() - d[".tag"] = .str("sharing_change_link_allow_change_expiration_policy") - return .dictionary(d) - case .sharingChangeLinkDefaultExpirationPolicy: - var d = [String: JSON]() - d[".tag"] = .str("sharing_change_link_default_expiration_policy") - return .dictionary(d) - case .sharingChangeLinkEnforcePasswordPolicy: - var d = [String: JSON]() - d[".tag"] = .str("sharing_change_link_enforce_password_policy") - return .dictionary(d) - case .sharingChangeLinkPolicy: - var d = [String: JSON]() - d[".tag"] = .str("sharing_change_link_policy") - return .dictionary(d) - case .sharingChangeMemberPolicy: - var d = [String: JSON]() - d[".tag"] = .str("sharing_change_member_policy") - return .dictionary(d) - case .showcaseChangeDownloadPolicy: - var d = [String: JSON]() - d[".tag"] = .str("showcase_change_download_policy") - return .dictionary(d) - case .showcaseChangeEnabledPolicy: - var d = [String: JSON]() - d[".tag"] = .str("showcase_change_enabled_policy") - return .dictionary(d) - case .showcaseChangeExternalSharingPolicy: - var d = [String: JSON]() - d[".tag"] = .str("showcase_change_external_sharing_policy") - return .dictionary(d) - case .smarterSmartSyncPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("smarter_smart_sync_policy_changed") - return .dictionary(d) - case .smartSyncChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("smart_sync_change_policy") - return .dictionary(d) - case .smartSyncNotOptOut: - var d = [String: JSON]() - d[".tag"] = .str("smart_sync_not_opt_out") - return .dictionary(d) - case .smartSyncOptOut: - var d = [String: JSON]() - d[".tag"] = .str("smart_sync_opt_out") - return .dictionary(d) - case .ssoChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("sso_change_policy") - return .dictionary(d) - case .teamBrandingPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("team_branding_policy_changed") - return .dictionary(d) - case .teamExtensionsPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("team_extensions_policy_changed") - return .dictionary(d) - case .teamSelectiveSyncPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("team_selective_sync_policy_changed") - return .dictionary(d) - case .teamSharingWhitelistSubjectsChanged: - var d = [String: JSON]() - d[".tag"] = .str("team_sharing_whitelist_subjects_changed") - return .dictionary(d) - case .tfaAddException: - var d = [String: JSON]() - d[".tag"] = .str("tfa_add_exception") - return .dictionary(d) - case .tfaChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("tfa_change_policy") - return .dictionary(d) - case .tfaRemoveException: - var d = [String: JSON]() - d[".tag"] = .str("tfa_remove_exception") - return .dictionary(d) - case .twoAccountChangePolicy: - var d = [String: JSON]() - d[".tag"] = .str("two_account_change_policy") - return .dictionary(d) - case .viewerInfoPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("viewer_info_policy_changed") - return .dictionary(d) - case .watermarkingPolicyChanged: - var d = [String: JSON]() - d[".tag"] = .str("watermarking_policy_changed") - return .dictionary(d) - case .webSessionsChangeActiveSessionLimit: - var d = [String: JSON]() - d[".tag"] = .str("web_sessions_change_active_session_limit") - return .dictionary(d) - case .webSessionsChangeFixedLengthPolicy: - var d = [String: JSON]() - d[".tag"] = .str("web_sessions_change_fixed_length_policy") - return .dictionary(d) - case .webSessionsChangeIdleLengthPolicy: - var d = [String: JSON]() - d[".tag"] = .str("web_sessions_change_idle_length_policy") - return .dictionary(d) - case .dataResidencyMigrationRequestSuccessful: - var d = [String: JSON]() - d[".tag"] = .str("data_residency_migration_request_successful") - return .dictionary(d) - case .dataResidencyMigrationRequestUnsuccessful: - var d = [String: JSON]() - d[".tag"] = .str("data_residency_migration_request_unsuccessful") - return .dictionary(d) - case .teamMergeFrom: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_from") - return .dictionary(d) - case .teamMergeTo: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_to") - return .dictionary(d) - case .teamProfileAddBackground: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_add_background") - return .dictionary(d) - case .teamProfileAddLogo: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_add_logo") - return .dictionary(d) - case .teamProfileChangeBackground: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_change_background") - return .dictionary(d) - case .teamProfileChangeDefaultLanguage: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_change_default_language") - return .dictionary(d) - case .teamProfileChangeLogo: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_change_logo") - return .dictionary(d) - case .teamProfileChangeName: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_change_name") - return .dictionary(d) - case .teamProfileRemoveBackground: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_remove_background") - return .dictionary(d) - case .teamProfileRemoveLogo: - var d = [String: JSON]() - d[".tag"] = .str("team_profile_remove_logo") - return .dictionary(d) - case .tfaAddBackupPhone: - var d = [String: JSON]() - d[".tag"] = .str("tfa_add_backup_phone") - return .dictionary(d) - case .tfaAddSecurityKey: - var d = [String: JSON]() - d[".tag"] = .str("tfa_add_security_key") - return .dictionary(d) - case .tfaChangeBackupPhone: - var d = [String: JSON]() - d[".tag"] = .str("tfa_change_backup_phone") - return .dictionary(d) - case .tfaChangeStatus: - var d = [String: JSON]() - d[".tag"] = .str("tfa_change_status") - return .dictionary(d) - case .tfaRemoveBackupPhone: - var d = [String: JSON]() - d[".tag"] = .str("tfa_remove_backup_phone") - return .dictionary(d) - case .tfaRemoveSecurityKey: - var d = [String: JSON]() - d[".tag"] = .str("tfa_remove_security_key") - return .dictionary(d) - case .tfaReset: - var d = [String: JSON]() - d[".tag"] = .str("tfa_reset") - return .dictionary(d) - case .changedEnterpriseAdminRole: - var d = [String: JSON]() - d[".tag"] = .str("changed_enterprise_admin_role") - return .dictionary(d) - case .changedEnterpriseConnectedTeamStatus: - var d = [String: JSON]() - d[".tag"] = .str("changed_enterprise_connected_team_status") - return .dictionary(d) - case .endedEnterpriseAdminSession: - var d = [String: JSON]() - d[".tag"] = .str("ended_enterprise_admin_session") - return .dictionary(d) - case .endedEnterpriseAdminSessionDeprecated: - var d = [String: JSON]() - d[".tag"] = .str("ended_enterprise_admin_session_deprecated") - return .dictionary(d) - case .enterpriseSettingsLocking: - var d = [String: JSON]() - d[".tag"] = .str("enterprise_settings_locking") - return .dictionary(d) - case .guestAdminChangeStatus: - var d = [String: JSON]() - d[".tag"] = .str("guest_admin_change_status") - return .dictionary(d) - case .startedEnterpriseAdminSession: - var d = [String: JSON]() - d[".tag"] = .str("started_enterprise_admin_session") - return .dictionary(d) - case .teamMergeRequestAccepted: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_accepted") - return .dictionary(d) - case .teamMergeRequestAcceptedShownToPrimaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_accepted_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestAcceptedShownToSecondaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_accepted_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestAutoCanceled: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_auto_canceled") - return .dictionary(d) - case .teamMergeRequestCanceled: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_canceled") - return .dictionary(d) - case .teamMergeRequestCanceledShownToPrimaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_canceled_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestCanceledShownToSecondaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_canceled_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestExpired: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_expired") - return .dictionary(d) - case .teamMergeRequestExpiredShownToPrimaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_expired_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestExpiredShownToSecondaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_expired_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestRejectedShownToPrimaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_rejected_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestRejectedShownToSecondaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_rejected_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestReminder: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_reminder") - return .dictionary(d) - case .teamMergeRequestReminderShownToPrimaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_reminder_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestReminderShownToSecondaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_reminder_shown_to_secondary_team") - return .dictionary(d) - case .teamMergeRequestRevoked: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_revoked") - return .dictionary(d) - case .teamMergeRequestSentShownToPrimaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_sent_shown_to_primary_team") - return .dictionary(d) - case .teamMergeRequestSentShownToSecondaryTeam: - var d = [String: JSON]() - d[".tag"] = .str("team_merge_request_sent_shown_to_secondary_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> EventTypeArg { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admin_alerting_alert_state_changed": - return EventTypeArg.adminAlertingAlertStateChanged - case "admin_alerting_changed_alert_config": - return EventTypeArg.adminAlertingChangedAlertConfig - case "admin_alerting_triggered_alert": - return EventTypeArg.adminAlertingTriggeredAlert - case "app_blocked_by_permissions": - return EventTypeArg.appBlockedByPermissions - case "app_link_team": - return EventTypeArg.appLinkTeam - case "app_link_user": - return EventTypeArg.appLinkUser - case "app_unlink_team": - return EventTypeArg.appUnlinkTeam - case "app_unlink_user": - return EventTypeArg.appUnlinkUser - case "integration_connected": - return EventTypeArg.integrationConnected - case "integration_disconnected": - return EventTypeArg.integrationDisconnected - case "file_add_comment": - return EventTypeArg.fileAddComment - case "file_change_comment_subscription": - return EventTypeArg.fileChangeCommentSubscription - case "file_delete_comment": - return EventTypeArg.fileDeleteComment - case "file_edit_comment": - return EventTypeArg.fileEditComment - case "file_like_comment": - return EventTypeArg.fileLikeComment - case "file_resolve_comment": - return EventTypeArg.fileResolveComment - case "file_unlike_comment": - return EventTypeArg.fileUnlikeComment - case "file_unresolve_comment": - return EventTypeArg.fileUnresolveComment - case "governance_policy_add_folders": - return EventTypeArg.governancePolicyAddFolders - case "governance_policy_add_folder_failed": - return EventTypeArg.governancePolicyAddFolderFailed - case "governance_policy_content_disposed": - return EventTypeArg.governancePolicyContentDisposed - case "governance_policy_create": - return EventTypeArg.governancePolicyCreate - case "governance_policy_delete": - return EventTypeArg.governancePolicyDelete - case "governance_policy_edit_details": - return EventTypeArg.governancePolicyEditDetails - case "governance_policy_edit_duration": - return EventTypeArg.governancePolicyEditDuration - case "governance_policy_export_created": - return EventTypeArg.governancePolicyExportCreated - case "governance_policy_export_removed": - return EventTypeArg.governancePolicyExportRemoved - case "governance_policy_remove_folders": - return EventTypeArg.governancePolicyRemoveFolders - case "governance_policy_report_created": - return EventTypeArg.governancePolicyReportCreated - case "governance_policy_zip_part_downloaded": - return EventTypeArg.governancePolicyZipPartDownloaded - case "legal_holds_activate_a_hold": - return EventTypeArg.legalHoldsActivateAHold - case "legal_holds_add_members": - return EventTypeArg.legalHoldsAddMembers - case "legal_holds_change_hold_details": - return EventTypeArg.legalHoldsChangeHoldDetails - case "legal_holds_change_hold_name": - return EventTypeArg.legalHoldsChangeHoldName - case "legal_holds_export_a_hold": - return EventTypeArg.legalHoldsExportAHold - case "legal_holds_export_cancelled": - return EventTypeArg.legalHoldsExportCancelled - case "legal_holds_export_downloaded": - return EventTypeArg.legalHoldsExportDownloaded - case "legal_holds_export_removed": - return EventTypeArg.legalHoldsExportRemoved - case "legal_holds_release_a_hold": - return EventTypeArg.legalHoldsReleaseAHold - case "legal_holds_remove_members": - return EventTypeArg.legalHoldsRemoveMembers - case "legal_holds_report_a_hold": - return EventTypeArg.legalHoldsReportAHold - case "device_change_ip_desktop": - return EventTypeArg.deviceChangeIpDesktop - case "device_change_ip_mobile": - return EventTypeArg.deviceChangeIpMobile - case "device_change_ip_web": - return EventTypeArg.deviceChangeIpWeb - case "device_delete_on_unlink_fail": - return EventTypeArg.deviceDeleteOnUnlinkFail - case "device_delete_on_unlink_success": - return EventTypeArg.deviceDeleteOnUnlinkSuccess - case "device_link_fail": - return EventTypeArg.deviceLinkFail - case "device_link_success": - return EventTypeArg.deviceLinkSuccess - case "device_management_disabled": - return EventTypeArg.deviceManagementDisabled - case "device_management_enabled": - return EventTypeArg.deviceManagementEnabled - case "device_sync_backup_status_changed": - return EventTypeArg.deviceSyncBackupStatusChanged - case "device_unlink": - return EventTypeArg.deviceUnlink - case "dropbox_passwords_exported": - return EventTypeArg.dropboxPasswordsExported - case "dropbox_passwords_new_device_enrolled": - return EventTypeArg.dropboxPasswordsNewDeviceEnrolled - case "emm_refresh_auth_token": - return EventTypeArg.emmRefreshAuthToken - case "external_drive_backup_eligibility_status_checked": - return EventTypeArg.externalDriveBackupEligibilityStatusChecked - case "external_drive_backup_status_changed": - return EventTypeArg.externalDriveBackupStatusChanged - case "account_capture_change_availability": - return EventTypeArg.accountCaptureChangeAvailability - case "account_capture_migrate_account": - return EventTypeArg.accountCaptureMigrateAccount - case "account_capture_notification_emails_sent": - return EventTypeArg.accountCaptureNotificationEmailsSent - case "account_capture_relinquish_account": - return EventTypeArg.accountCaptureRelinquishAccount - case "disabled_domain_invites": - return EventTypeArg.disabledDomainInvites - case "domain_invites_approve_request_to_join_team": - return EventTypeArg.domainInvitesApproveRequestToJoinTeam - case "domain_invites_decline_request_to_join_team": - return EventTypeArg.domainInvitesDeclineRequestToJoinTeam - case "domain_invites_email_existing_users": - return EventTypeArg.domainInvitesEmailExistingUsers - case "domain_invites_request_to_join_team": - return EventTypeArg.domainInvitesRequestToJoinTeam - case "domain_invites_set_invite_new_user_pref_to_no": - return EventTypeArg.domainInvitesSetInviteNewUserPrefToNo - case "domain_invites_set_invite_new_user_pref_to_yes": - return EventTypeArg.domainInvitesSetInviteNewUserPrefToYes - case "domain_verification_add_domain_fail": - return EventTypeArg.domainVerificationAddDomainFail - case "domain_verification_add_domain_success": - return EventTypeArg.domainVerificationAddDomainSuccess - case "domain_verification_remove_domain": - return EventTypeArg.domainVerificationRemoveDomain - case "enabled_domain_invites": - return EventTypeArg.enabledDomainInvites - case "apply_naming_convention": - return EventTypeArg.applyNamingConvention - case "create_folder": - return EventTypeArg.createFolder - case "file_add": - return EventTypeArg.fileAdd - case "file_copy": - return EventTypeArg.fileCopy - case "file_delete": - return EventTypeArg.fileDelete - case "file_download": - return EventTypeArg.fileDownload - case "file_edit": - return EventTypeArg.fileEdit - case "file_get_copy_reference": - return EventTypeArg.fileGetCopyReference - case "file_locking_lock_status_changed": - return EventTypeArg.fileLockingLockStatusChanged - case "file_move": - return EventTypeArg.fileMove - case "file_permanently_delete": - return EventTypeArg.filePermanentlyDelete - case "file_preview": - return EventTypeArg.filePreview - case "file_rename": - return EventTypeArg.fileRename - case "file_restore": - return EventTypeArg.fileRestore - case "file_revert": - return EventTypeArg.fileRevert - case "file_rollback_changes": - return EventTypeArg.fileRollbackChanges - case "file_save_copy_reference": - return EventTypeArg.fileSaveCopyReference - case "folder_overview_description_changed": - return EventTypeArg.folderOverviewDescriptionChanged - case "folder_overview_item_pinned": - return EventTypeArg.folderOverviewItemPinned - case "folder_overview_item_unpinned": - return EventTypeArg.folderOverviewItemUnpinned - case "object_label_added": - return EventTypeArg.objectLabelAdded - case "object_label_removed": - return EventTypeArg.objectLabelRemoved - case "object_label_updated_value": - return EventTypeArg.objectLabelUpdatedValue - case "organize_folder_with_tidy": - return EventTypeArg.organizeFolderWithTidy - case "rewind_folder": - return EventTypeArg.rewindFolder - case "undo_naming_convention": - return EventTypeArg.undoNamingConvention - case "undo_organize_folder_with_tidy": - return EventTypeArg.undoOrganizeFolderWithTidy - case "user_tags_added": - return EventTypeArg.userTagsAdded - case "user_tags_removed": - return EventTypeArg.userTagsRemoved - case "email_ingest_receive_file": - return EventTypeArg.emailIngestReceiveFile - case "file_request_change": - return EventTypeArg.fileRequestChange - case "file_request_close": - return EventTypeArg.fileRequestClose - case "file_request_create": - return EventTypeArg.fileRequestCreate - case "file_request_delete": - return EventTypeArg.fileRequestDelete - case "file_request_receive_file": - return EventTypeArg.fileRequestReceiveFile - case "group_add_external_id": - return EventTypeArg.groupAddExternalId - case "group_add_member": - return EventTypeArg.groupAddMember - case "group_change_external_id": - return EventTypeArg.groupChangeExternalId - case "group_change_management_type": - return EventTypeArg.groupChangeManagementType - case "group_change_member_role": - return EventTypeArg.groupChangeMemberRole - case "group_create": - return EventTypeArg.groupCreate - case "group_delete": - return EventTypeArg.groupDelete - case "group_description_updated": - return EventTypeArg.groupDescriptionUpdated - case "group_join_policy_updated": - return EventTypeArg.groupJoinPolicyUpdated - case "group_moved": - return EventTypeArg.groupMoved - case "group_remove_external_id": - return EventTypeArg.groupRemoveExternalId - case "group_remove_member": - return EventTypeArg.groupRemoveMember - case "group_rename": - return EventTypeArg.groupRename - case "account_lock_or_unlocked": - return EventTypeArg.accountLockOrUnlocked - case "emm_error": - return EventTypeArg.emmError - case "guest_admin_signed_in_via_trusted_teams": - return EventTypeArg.guestAdminSignedInViaTrustedTeams - case "guest_admin_signed_out_via_trusted_teams": - return EventTypeArg.guestAdminSignedOutViaTrustedTeams - case "login_fail": - return EventTypeArg.loginFail - case "login_success": - return EventTypeArg.loginSuccess - case "logout": - return EventTypeArg.logout - case "reseller_support_session_end": - return EventTypeArg.resellerSupportSessionEnd - case "reseller_support_session_start": - return EventTypeArg.resellerSupportSessionStart - case "sign_in_as_session_end": - return EventTypeArg.signInAsSessionEnd - case "sign_in_as_session_start": - return EventTypeArg.signInAsSessionStart - case "sso_error": - return EventTypeArg.ssoError - case "create_team_invite_link": - return EventTypeArg.createTeamInviteLink - case "delete_team_invite_link": - return EventTypeArg.deleteTeamInviteLink - case "member_add_external_id": - return EventTypeArg.memberAddExternalId - case "member_add_name": - return EventTypeArg.memberAddName - case "member_change_admin_role": - return EventTypeArg.memberChangeAdminRole - case "member_change_email": - return EventTypeArg.memberChangeEmail - case "member_change_external_id": - return EventTypeArg.memberChangeExternalId - case "member_change_membership_type": - return EventTypeArg.memberChangeMembershipType - case "member_change_name": - return EventTypeArg.memberChangeName - case "member_change_reseller_role": - return EventTypeArg.memberChangeResellerRole - case "member_change_status": - return EventTypeArg.memberChangeStatus - case "member_delete_manual_contacts": - return EventTypeArg.memberDeleteManualContacts - case "member_delete_profile_photo": - return EventTypeArg.memberDeleteProfilePhoto - case "member_permanently_delete_account_contents": - return EventTypeArg.memberPermanentlyDeleteAccountContents - case "member_remove_external_id": - return EventTypeArg.memberRemoveExternalId - case "member_set_profile_photo": - return EventTypeArg.memberSetProfilePhoto - case "member_space_limits_add_custom_quota": - return EventTypeArg.memberSpaceLimitsAddCustomQuota - case "member_space_limits_change_custom_quota": - return EventTypeArg.memberSpaceLimitsChangeCustomQuota - case "member_space_limits_change_status": - return EventTypeArg.memberSpaceLimitsChangeStatus - case "member_space_limits_remove_custom_quota": - return EventTypeArg.memberSpaceLimitsRemoveCustomQuota - case "member_suggest": - return EventTypeArg.memberSuggest - case "member_transfer_account_contents": - return EventTypeArg.memberTransferAccountContents - case "pending_secondary_email_added": - return EventTypeArg.pendingSecondaryEmailAdded - case "secondary_email_deleted": - return EventTypeArg.secondaryEmailDeleted - case "secondary_email_verified": - return EventTypeArg.secondaryEmailVerified - case "secondary_mails_policy_changed": - return EventTypeArg.secondaryMailsPolicyChanged - case "binder_add_page": - return EventTypeArg.binderAddPage - case "binder_add_section": - return EventTypeArg.binderAddSection - case "binder_remove_page": - return EventTypeArg.binderRemovePage - case "binder_remove_section": - return EventTypeArg.binderRemoveSection - case "binder_rename_page": - return EventTypeArg.binderRenamePage - case "binder_rename_section": - return EventTypeArg.binderRenameSection - case "binder_reorder_page": - return EventTypeArg.binderReorderPage - case "binder_reorder_section": - return EventTypeArg.binderReorderSection - case "paper_content_add_member": - return EventTypeArg.paperContentAddMember - case "paper_content_add_to_folder": - return EventTypeArg.paperContentAddToFolder - case "paper_content_archive": - return EventTypeArg.paperContentArchive - case "paper_content_create": - return EventTypeArg.paperContentCreate - case "paper_content_permanently_delete": - return EventTypeArg.paperContentPermanentlyDelete - case "paper_content_remove_from_folder": - return EventTypeArg.paperContentRemoveFromFolder - case "paper_content_remove_member": - return EventTypeArg.paperContentRemoveMember - case "paper_content_rename": - return EventTypeArg.paperContentRename - case "paper_content_restore": - return EventTypeArg.paperContentRestore - case "paper_doc_add_comment": - return EventTypeArg.paperDocAddComment - case "paper_doc_change_member_role": - return EventTypeArg.paperDocChangeMemberRole - case "paper_doc_change_sharing_policy": - return EventTypeArg.paperDocChangeSharingPolicy - case "paper_doc_change_subscription": - return EventTypeArg.paperDocChangeSubscription - case "paper_doc_deleted": - return EventTypeArg.paperDocDeleted - case "paper_doc_delete_comment": - return EventTypeArg.paperDocDeleteComment - case "paper_doc_download": - return EventTypeArg.paperDocDownload - case "paper_doc_edit": - return EventTypeArg.paperDocEdit - case "paper_doc_edit_comment": - return EventTypeArg.paperDocEditComment - case "paper_doc_followed": - return EventTypeArg.paperDocFollowed - case "paper_doc_mention": - return EventTypeArg.paperDocMention - case "paper_doc_ownership_changed": - return EventTypeArg.paperDocOwnershipChanged - case "paper_doc_request_access": - return EventTypeArg.paperDocRequestAccess - case "paper_doc_resolve_comment": - return EventTypeArg.paperDocResolveComment - case "paper_doc_revert": - return EventTypeArg.paperDocRevert - case "paper_doc_slack_share": - return EventTypeArg.paperDocSlackShare - case "paper_doc_team_invite": - return EventTypeArg.paperDocTeamInvite - case "paper_doc_trashed": - return EventTypeArg.paperDocTrashed - case "paper_doc_unresolve_comment": - return EventTypeArg.paperDocUnresolveComment - case "paper_doc_untrashed": - return EventTypeArg.paperDocUntrashed - case "paper_doc_view": - return EventTypeArg.paperDocView - case "paper_external_view_allow": - return EventTypeArg.paperExternalViewAllow - case "paper_external_view_default_team": - return EventTypeArg.paperExternalViewDefaultTeam - case "paper_external_view_forbid": - return EventTypeArg.paperExternalViewForbid - case "paper_folder_change_subscription": - return EventTypeArg.paperFolderChangeSubscription - case "paper_folder_deleted": - return EventTypeArg.paperFolderDeleted - case "paper_folder_followed": - return EventTypeArg.paperFolderFollowed - case "paper_folder_team_invite": - return EventTypeArg.paperFolderTeamInvite - case "paper_published_link_change_permission": - return EventTypeArg.paperPublishedLinkChangePermission - case "paper_published_link_create": - return EventTypeArg.paperPublishedLinkCreate - case "paper_published_link_disabled": - return EventTypeArg.paperPublishedLinkDisabled - case "paper_published_link_view": - return EventTypeArg.paperPublishedLinkView - case "password_change": - return EventTypeArg.passwordChange - case "password_reset": - return EventTypeArg.passwordReset - case "password_reset_all": - return EventTypeArg.passwordResetAll - case "classification_create_report": - return EventTypeArg.classificationCreateReport - case "classification_create_report_fail": - return EventTypeArg.classificationCreateReportFail - case "emm_create_exceptions_report": - return EventTypeArg.emmCreateExceptionsReport - case "emm_create_usage_report": - return EventTypeArg.emmCreateUsageReport - case "export_members_report": - return EventTypeArg.exportMembersReport - case "export_members_report_fail": - return EventTypeArg.exportMembersReportFail - case "external_sharing_create_report": - return EventTypeArg.externalSharingCreateReport - case "external_sharing_report_failed": - return EventTypeArg.externalSharingReportFailed - case "no_expiration_link_gen_create_report": - return EventTypeArg.noExpirationLinkGenCreateReport - case "no_expiration_link_gen_report_failed": - return EventTypeArg.noExpirationLinkGenReportFailed - case "no_password_link_gen_create_report": - return EventTypeArg.noPasswordLinkGenCreateReport - case "no_password_link_gen_report_failed": - return EventTypeArg.noPasswordLinkGenReportFailed - case "no_password_link_view_create_report": - return EventTypeArg.noPasswordLinkViewCreateReport - case "no_password_link_view_report_failed": - return EventTypeArg.noPasswordLinkViewReportFailed - case "outdated_link_view_create_report": - return EventTypeArg.outdatedLinkViewCreateReport - case "outdated_link_view_report_failed": - return EventTypeArg.outdatedLinkViewReportFailed - case "paper_admin_export_start": - return EventTypeArg.paperAdminExportStart - case "smart_sync_create_admin_privilege_report": - return EventTypeArg.smartSyncCreateAdminPrivilegeReport - case "team_activity_create_report": - return EventTypeArg.teamActivityCreateReport - case "team_activity_create_report_fail": - return EventTypeArg.teamActivityCreateReportFail - case "collection_share": - return EventTypeArg.collectionShare - case "file_transfers_file_add": - return EventTypeArg.fileTransfersFileAdd - case "file_transfers_transfer_delete": - return EventTypeArg.fileTransfersTransferDelete - case "file_transfers_transfer_download": - return EventTypeArg.fileTransfersTransferDownload - case "file_transfers_transfer_send": - return EventTypeArg.fileTransfersTransferSend - case "file_transfers_transfer_view": - return EventTypeArg.fileTransfersTransferView - case "note_acl_invite_only": - return EventTypeArg.noteAclInviteOnly - case "note_acl_link": - return EventTypeArg.noteAclLink - case "note_acl_team_link": - return EventTypeArg.noteAclTeamLink - case "note_shared": - return EventTypeArg.noteShared - case "note_share_receive": - return EventTypeArg.noteShareReceive - case "open_note_shared": - return EventTypeArg.openNoteShared - case "sf_add_group": - return EventTypeArg.sfAddGroup - case "sf_allow_non_members_to_view_shared_links": - return EventTypeArg.sfAllowNonMembersToViewSharedLinks - case "sf_external_invite_warn": - return EventTypeArg.sfExternalInviteWarn - case "sf_fb_invite": - return EventTypeArg.sfFbInvite - case "sf_fb_invite_change_role": - return EventTypeArg.sfFbInviteChangeRole - case "sf_fb_uninvite": - return EventTypeArg.sfFbUninvite - case "sf_invite_group": - return EventTypeArg.sfInviteGroup - case "sf_team_grant_access": - return EventTypeArg.sfTeamGrantAccess - case "sf_team_invite": - return EventTypeArg.sfTeamInvite - case "sf_team_invite_change_role": - return EventTypeArg.sfTeamInviteChangeRole - case "sf_team_join": - return EventTypeArg.sfTeamJoin - case "sf_team_join_from_oob_link": - return EventTypeArg.sfTeamJoinFromOobLink - case "sf_team_uninvite": - return EventTypeArg.sfTeamUninvite - case "shared_content_add_invitees": - return EventTypeArg.sharedContentAddInvitees - case "shared_content_add_link_expiry": - return EventTypeArg.sharedContentAddLinkExpiry - case "shared_content_add_link_password": - return EventTypeArg.sharedContentAddLinkPassword - case "shared_content_add_member": - return EventTypeArg.sharedContentAddMember - case "shared_content_change_downloads_policy": - return EventTypeArg.sharedContentChangeDownloadsPolicy - case "shared_content_change_invitee_role": - return EventTypeArg.sharedContentChangeInviteeRole - case "shared_content_change_link_audience": - return EventTypeArg.sharedContentChangeLinkAudience - case "shared_content_change_link_expiry": - return EventTypeArg.sharedContentChangeLinkExpiry - case "shared_content_change_link_password": - return EventTypeArg.sharedContentChangeLinkPassword - case "shared_content_change_member_role": - return EventTypeArg.sharedContentChangeMemberRole - case "shared_content_change_viewer_info_policy": - return EventTypeArg.sharedContentChangeViewerInfoPolicy - case "shared_content_claim_invitation": - return EventTypeArg.sharedContentClaimInvitation - case "shared_content_copy": - return EventTypeArg.sharedContentCopy - case "shared_content_download": - return EventTypeArg.sharedContentDownload - case "shared_content_relinquish_membership": - return EventTypeArg.sharedContentRelinquishMembership - case "shared_content_remove_invitees": - return EventTypeArg.sharedContentRemoveInvitees - case "shared_content_remove_link_expiry": - return EventTypeArg.sharedContentRemoveLinkExpiry - case "shared_content_remove_link_password": - return EventTypeArg.sharedContentRemoveLinkPassword - case "shared_content_remove_member": - return EventTypeArg.sharedContentRemoveMember - case "shared_content_request_access": - return EventTypeArg.sharedContentRequestAccess - case "shared_content_restore_invitees": - return EventTypeArg.sharedContentRestoreInvitees - case "shared_content_restore_member": - return EventTypeArg.sharedContentRestoreMember - case "shared_content_unshare": - return EventTypeArg.sharedContentUnshare - case "shared_content_view": - return EventTypeArg.sharedContentView - case "shared_folder_change_link_policy": - return EventTypeArg.sharedFolderChangeLinkPolicy - case "shared_folder_change_members_inheritance_policy": - return EventTypeArg.sharedFolderChangeMembersInheritancePolicy - case "shared_folder_change_members_management_policy": - return EventTypeArg.sharedFolderChangeMembersManagementPolicy - case "shared_folder_change_members_policy": - return EventTypeArg.sharedFolderChangeMembersPolicy - case "shared_folder_create": - return EventTypeArg.sharedFolderCreate - case "shared_folder_decline_invitation": - return EventTypeArg.sharedFolderDeclineInvitation - case "shared_folder_mount": - return EventTypeArg.sharedFolderMount - case "shared_folder_nest": - return EventTypeArg.sharedFolderNest - case "shared_folder_transfer_ownership": - return EventTypeArg.sharedFolderTransferOwnership - case "shared_folder_unmount": - return EventTypeArg.sharedFolderUnmount - case "shared_link_add_expiry": - return EventTypeArg.sharedLinkAddExpiry - case "shared_link_change_expiry": - return EventTypeArg.sharedLinkChangeExpiry - case "shared_link_change_visibility": - return EventTypeArg.sharedLinkChangeVisibility - case "shared_link_copy": - return EventTypeArg.sharedLinkCopy - case "shared_link_create": - return EventTypeArg.sharedLinkCreate - case "shared_link_disable": - return EventTypeArg.sharedLinkDisable - case "shared_link_download": - return EventTypeArg.sharedLinkDownload - case "shared_link_remove_expiry": - return EventTypeArg.sharedLinkRemoveExpiry - case "shared_link_settings_add_expiration": - return EventTypeArg.sharedLinkSettingsAddExpiration - case "shared_link_settings_add_password": - return EventTypeArg.sharedLinkSettingsAddPassword - case "shared_link_settings_allow_download_disabled": - return EventTypeArg.sharedLinkSettingsAllowDownloadDisabled - case "shared_link_settings_allow_download_enabled": - return EventTypeArg.sharedLinkSettingsAllowDownloadEnabled - case "shared_link_settings_change_audience": - return EventTypeArg.sharedLinkSettingsChangeAudience - case "shared_link_settings_change_expiration": - return EventTypeArg.sharedLinkSettingsChangeExpiration - case "shared_link_settings_change_password": - return EventTypeArg.sharedLinkSettingsChangePassword - case "shared_link_settings_remove_expiration": - return EventTypeArg.sharedLinkSettingsRemoveExpiration - case "shared_link_settings_remove_password": - return EventTypeArg.sharedLinkSettingsRemovePassword - case "shared_link_share": - return EventTypeArg.sharedLinkShare - case "shared_link_view": - return EventTypeArg.sharedLinkView - case "shared_note_opened": - return EventTypeArg.sharedNoteOpened - case "shmodel_disable_downloads": - return EventTypeArg.shmodelDisableDownloads - case "shmodel_enable_downloads": - return EventTypeArg.shmodelEnableDownloads - case "shmodel_group_share": - return EventTypeArg.shmodelGroupShare - case "showcase_access_granted": - return EventTypeArg.showcaseAccessGranted - case "showcase_add_member": - return EventTypeArg.showcaseAddMember - case "showcase_archived": - return EventTypeArg.showcaseArchived - case "showcase_created": - return EventTypeArg.showcaseCreated - case "showcase_delete_comment": - return EventTypeArg.showcaseDeleteComment - case "showcase_edited": - return EventTypeArg.showcaseEdited - case "showcase_edit_comment": - return EventTypeArg.showcaseEditComment - case "showcase_file_added": - return EventTypeArg.showcaseFileAdded - case "showcase_file_download": - return EventTypeArg.showcaseFileDownload - case "showcase_file_removed": - return EventTypeArg.showcaseFileRemoved - case "showcase_file_view": - return EventTypeArg.showcaseFileView - case "showcase_permanently_deleted": - return EventTypeArg.showcasePermanentlyDeleted - case "showcase_post_comment": - return EventTypeArg.showcasePostComment - case "showcase_remove_member": - return EventTypeArg.showcaseRemoveMember - case "showcase_renamed": - return EventTypeArg.showcaseRenamed - case "showcase_request_access": - return EventTypeArg.showcaseRequestAccess - case "showcase_resolve_comment": - return EventTypeArg.showcaseResolveComment - case "showcase_restored": - return EventTypeArg.showcaseRestored - case "showcase_trashed": - return EventTypeArg.showcaseTrashed - case "showcase_trashed_deprecated": - return EventTypeArg.showcaseTrashedDeprecated - case "showcase_unresolve_comment": - return EventTypeArg.showcaseUnresolveComment - case "showcase_untrashed": - return EventTypeArg.showcaseUntrashed - case "showcase_untrashed_deprecated": - return EventTypeArg.showcaseUntrashedDeprecated - case "showcase_view": - return EventTypeArg.showcaseView - case "sso_add_cert": - return EventTypeArg.ssoAddCert - case "sso_add_login_url": - return EventTypeArg.ssoAddLoginUrl - case "sso_add_logout_url": - return EventTypeArg.ssoAddLogoutUrl - case "sso_change_cert": - return EventTypeArg.ssoChangeCert - case "sso_change_login_url": - return EventTypeArg.ssoChangeLoginUrl - case "sso_change_logout_url": - return EventTypeArg.ssoChangeLogoutUrl - case "sso_change_saml_identity_mode": - return EventTypeArg.ssoChangeSamlIdentityMode - case "sso_remove_cert": - return EventTypeArg.ssoRemoveCert - case "sso_remove_login_url": - return EventTypeArg.ssoRemoveLoginUrl - case "sso_remove_logout_url": - return EventTypeArg.ssoRemoveLogoutUrl - case "team_folder_change_status": - return EventTypeArg.teamFolderChangeStatus - case "team_folder_create": - return EventTypeArg.teamFolderCreate - case "team_folder_downgrade": - return EventTypeArg.teamFolderDowngrade - case "team_folder_permanently_delete": - return EventTypeArg.teamFolderPermanentlyDelete - case "team_folder_rename": - return EventTypeArg.teamFolderRename - case "team_selective_sync_settings_changed": - return EventTypeArg.teamSelectiveSyncSettingsChanged - case "account_capture_change_policy": - return EventTypeArg.accountCaptureChangePolicy - case "admin_email_reminders_changed": - return EventTypeArg.adminEmailRemindersChanged - case "allow_download_disabled": - return EventTypeArg.allowDownloadDisabled - case "allow_download_enabled": - return EventTypeArg.allowDownloadEnabled - case "app_permissions_changed": - return EventTypeArg.appPermissionsChanged - case "camera_uploads_policy_changed": - return EventTypeArg.cameraUploadsPolicyChanged - case "capture_transcript_policy_changed": - return EventTypeArg.captureTranscriptPolicyChanged - case "classification_change_policy": - return EventTypeArg.classificationChangePolicy - case "computer_backup_policy_changed": - return EventTypeArg.computerBackupPolicyChanged - case "content_administration_policy_changed": - return EventTypeArg.contentAdministrationPolicyChanged - case "data_placement_restriction_change_policy": - return EventTypeArg.dataPlacementRestrictionChangePolicy - case "data_placement_restriction_satisfy_policy": - return EventTypeArg.dataPlacementRestrictionSatisfyPolicy - case "device_approvals_add_exception": - return EventTypeArg.deviceApprovalsAddException - case "device_approvals_change_desktop_policy": - return EventTypeArg.deviceApprovalsChangeDesktopPolicy - case "device_approvals_change_mobile_policy": - return EventTypeArg.deviceApprovalsChangeMobilePolicy - case "device_approvals_change_overage_action": - return EventTypeArg.deviceApprovalsChangeOverageAction - case "device_approvals_change_unlink_action": - return EventTypeArg.deviceApprovalsChangeUnlinkAction - case "device_approvals_remove_exception": - return EventTypeArg.deviceApprovalsRemoveException - case "directory_restrictions_add_members": - return EventTypeArg.directoryRestrictionsAddMembers - case "directory_restrictions_remove_members": - return EventTypeArg.directoryRestrictionsRemoveMembers - case "dropbox_passwords_policy_changed": - return EventTypeArg.dropboxPasswordsPolicyChanged - case "email_ingest_policy_changed": - return EventTypeArg.emailIngestPolicyChanged - case "emm_add_exception": - return EventTypeArg.emmAddException - case "emm_change_policy": - return EventTypeArg.emmChangePolicy - case "emm_remove_exception": - return EventTypeArg.emmRemoveException - case "extended_version_history_change_policy": - return EventTypeArg.extendedVersionHistoryChangePolicy - case "external_drive_backup_policy_changed": - return EventTypeArg.externalDriveBackupPolicyChanged - case "file_comments_change_policy": - return EventTypeArg.fileCommentsChangePolicy - case "file_locking_policy_changed": - return EventTypeArg.fileLockingPolicyChanged - case "file_provider_migration_policy_changed": - return EventTypeArg.fileProviderMigrationPolicyChanged - case "file_requests_change_policy": - return EventTypeArg.fileRequestsChangePolicy - case "file_requests_emails_enabled": - return EventTypeArg.fileRequestsEmailsEnabled - case "file_requests_emails_restricted_to_team_only": - return EventTypeArg.fileRequestsEmailsRestrictedToTeamOnly - case "file_transfers_policy_changed": - return EventTypeArg.fileTransfersPolicyChanged - case "folder_link_restriction_policy_changed": - return EventTypeArg.folderLinkRestrictionPolicyChanged - case "google_sso_change_policy": - return EventTypeArg.googleSsoChangePolicy - case "group_user_management_change_policy": - return EventTypeArg.groupUserManagementChangePolicy - case "integration_policy_changed": - return EventTypeArg.integrationPolicyChanged - case "invite_acceptance_email_policy_changed": - return EventTypeArg.inviteAcceptanceEmailPolicyChanged - case "member_requests_change_policy": - return EventTypeArg.memberRequestsChangePolicy - case "member_send_invite_policy_changed": - return EventTypeArg.memberSendInvitePolicyChanged - case "member_space_limits_add_exception": - return EventTypeArg.memberSpaceLimitsAddException - case "member_space_limits_change_caps_type_policy": - return EventTypeArg.memberSpaceLimitsChangeCapsTypePolicy - case "member_space_limits_change_policy": - return EventTypeArg.memberSpaceLimitsChangePolicy - case "member_space_limits_remove_exception": - return EventTypeArg.memberSpaceLimitsRemoveException - case "member_suggestions_change_policy": - return EventTypeArg.memberSuggestionsChangePolicy - case "microsoft_office_addin_change_policy": - return EventTypeArg.microsoftOfficeAddinChangePolicy - case "network_control_change_policy": - return EventTypeArg.networkControlChangePolicy - case "paper_change_deployment_policy": - return EventTypeArg.paperChangeDeploymentPolicy - case "paper_change_member_link_policy": - return EventTypeArg.paperChangeMemberLinkPolicy - case "paper_change_member_policy": - return EventTypeArg.paperChangeMemberPolicy - case "paper_change_policy": - return EventTypeArg.paperChangePolicy - case "paper_default_folder_policy_changed": - return EventTypeArg.paperDefaultFolderPolicyChanged - case "paper_desktop_policy_changed": - return EventTypeArg.paperDesktopPolicyChanged - case "paper_enabled_users_group_addition": - return EventTypeArg.paperEnabledUsersGroupAddition - case "paper_enabled_users_group_removal": - return EventTypeArg.paperEnabledUsersGroupRemoval - case "password_strength_requirements_change_policy": - return EventTypeArg.passwordStrengthRequirementsChangePolicy - case "permanent_delete_change_policy": - return EventTypeArg.permanentDeleteChangePolicy - case "reseller_support_change_policy": - return EventTypeArg.resellerSupportChangePolicy - case "rewind_policy_changed": - return EventTypeArg.rewindPolicyChanged - case "send_for_signature_policy_changed": - return EventTypeArg.sendForSignaturePolicyChanged - case "sharing_change_folder_join_policy": - return EventTypeArg.sharingChangeFolderJoinPolicy - case "sharing_change_link_allow_change_expiration_policy": - return EventTypeArg.sharingChangeLinkAllowChangeExpirationPolicy - case "sharing_change_link_default_expiration_policy": - return EventTypeArg.sharingChangeLinkDefaultExpirationPolicy - case "sharing_change_link_enforce_password_policy": - return EventTypeArg.sharingChangeLinkEnforcePasswordPolicy - case "sharing_change_link_policy": - return EventTypeArg.sharingChangeLinkPolicy - case "sharing_change_member_policy": - return EventTypeArg.sharingChangeMemberPolicy - case "showcase_change_download_policy": - return EventTypeArg.showcaseChangeDownloadPolicy - case "showcase_change_enabled_policy": - return EventTypeArg.showcaseChangeEnabledPolicy - case "showcase_change_external_sharing_policy": - return EventTypeArg.showcaseChangeExternalSharingPolicy - case "smarter_smart_sync_policy_changed": - return EventTypeArg.smarterSmartSyncPolicyChanged - case "smart_sync_change_policy": - return EventTypeArg.smartSyncChangePolicy - case "smart_sync_not_opt_out": - return EventTypeArg.smartSyncNotOptOut - case "smart_sync_opt_out": - return EventTypeArg.smartSyncOptOut - case "sso_change_policy": - return EventTypeArg.ssoChangePolicy - case "team_branding_policy_changed": - return EventTypeArg.teamBrandingPolicyChanged - case "team_extensions_policy_changed": - return EventTypeArg.teamExtensionsPolicyChanged - case "team_selective_sync_policy_changed": - return EventTypeArg.teamSelectiveSyncPolicyChanged - case "team_sharing_whitelist_subjects_changed": - return EventTypeArg.teamSharingWhitelistSubjectsChanged - case "tfa_add_exception": - return EventTypeArg.tfaAddException - case "tfa_change_policy": - return EventTypeArg.tfaChangePolicy - case "tfa_remove_exception": - return EventTypeArg.tfaRemoveException - case "two_account_change_policy": - return EventTypeArg.twoAccountChangePolicy - case "viewer_info_policy_changed": - return EventTypeArg.viewerInfoPolicyChanged - case "watermarking_policy_changed": - return EventTypeArg.watermarkingPolicyChanged - case "web_sessions_change_active_session_limit": - return EventTypeArg.webSessionsChangeActiveSessionLimit - case "web_sessions_change_fixed_length_policy": - return EventTypeArg.webSessionsChangeFixedLengthPolicy - case "web_sessions_change_idle_length_policy": - return EventTypeArg.webSessionsChangeIdleLengthPolicy - case "data_residency_migration_request_successful": - return EventTypeArg.dataResidencyMigrationRequestSuccessful - case "data_residency_migration_request_unsuccessful": - return EventTypeArg.dataResidencyMigrationRequestUnsuccessful - case "team_merge_from": - return EventTypeArg.teamMergeFrom - case "team_merge_to": - return EventTypeArg.teamMergeTo - case "team_profile_add_background": - return EventTypeArg.teamProfileAddBackground - case "team_profile_add_logo": - return EventTypeArg.teamProfileAddLogo - case "team_profile_change_background": - return EventTypeArg.teamProfileChangeBackground - case "team_profile_change_default_language": - return EventTypeArg.teamProfileChangeDefaultLanguage - case "team_profile_change_logo": - return EventTypeArg.teamProfileChangeLogo - case "team_profile_change_name": - return EventTypeArg.teamProfileChangeName - case "team_profile_remove_background": - return EventTypeArg.teamProfileRemoveBackground - case "team_profile_remove_logo": - return EventTypeArg.teamProfileRemoveLogo - case "tfa_add_backup_phone": - return EventTypeArg.tfaAddBackupPhone - case "tfa_add_security_key": - return EventTypeArg.tfaAddSecurityKey - case "tfa_change_backup_phone": - return EventTypeArg.tfaChangeBackupPhone - case "tfa_change_status": - return EventTypeArg.tfaChangeStatus - case "tfa_remove_backup_phone": - return EventTypeArg.tfaRemoveBackupPhone - case "tfa_remove_security_key": - return EventTypeArg.tfaRemoveSecurityKey - case "tfa_reset": - return EventTypeArg.tfaReset - case "changed_enterprise_admin_role": - return EventTypeArg.changedEnterpriseAdminRole - case "changed_enterprise_connected_team_status": - return EventTypeArg.changedEnterpriseConnectedTeamStatus - case "ended_enterprise_admin_session": - return EventTypeArg.endedEnterpriseAdminSession - case "ended_enterprise_admin_session_deprecated": - return EventTypeArg.endedEnterpriseAdminSessionDeprecated - case "enterprise_settings_locking": - return EventTypeArg.enterpriseSettingsLocking - case "guest_admin_change_status": - return EventTypeArg.guestAdminChangeStatus - case "started_enterprise_admin_session": - return EventTypeArg.startedEnterpriseAdminSession - case "team_merge_request_accepted": - return EventTypeArg.teamMergeRequestAccepted - case "team_merge_request_accepted_shown_to_primary_team": - return EventTypeArg.teamMergeRequestAcceptedShownToPrimaryTeam - case "team_merge_request_accepted_shown_to_secondary_team": - return EventTypeArg.teamMergeRequestAcceptedShownToSecondaryTeam - case "team_merge_request_auto_canceled": - return EventTypeArg.teamMergeRequestAutoCanceled - case "team_merge_request_canceled": - return EventTypeArg.teamMergeRequestCanceled - case "team_merge_request_canceled_shown_to_primary_team": - return EventTypeArg.teamMergeRequestCanceledShownToPrimaryTeam - case "team_merge_request_canceled_shown_to_secondary_team": - return EventTypeArg.teamMergeRequestCanceledShownToSecondaryTeam - case "team_merge_request_expired": - return EventTypeArg.teamMergeRequestExpired - case "team_merge_request_expired_shown_to_primary_team": - return EventTypeArg.teamMergeRequestExpiredShownToPrimaryTeam - case "team_merge_request_expired_shown_to_secondary_team": - return EventTypeArg.teamMergeRequestExpiredShownToSecondaryTeam - case "team_merge_request_rejected_shown_to_primary_team": - return EventTypeArg.teamMergeRequestRejectedShownToPrimaryTeam - case "team_merge_request_rejected_shown_to_secondary_team": - return EventTypeArg.teamMergeRequestRejectedShownToSecondaryTeam - case "team_merge_request_reminder": - return EventTypeArg.teamMergeRequestReminder - case "team_merge_request_reminder_shown_to_primary_team": - return EventTypeArg.teamMergeRequestReminderShownToPrimaryTeam - case "team_merge_request_reminder_shown_to_secondary_team": - return EventTypeArg.teamMergeRequestReminderShownToSecondaryTeam - case "team_merge_request_revoked": - return EventTypeArg.teamMergeRequestRevoked - case "team_merge_request_sent_shown_to_primary_team": - return EventTypeArg.teamMergeRequestSentShownToPrimaryTeam - case "team_merge_request_sent_shown_to_secondary_team": - return EventTypeArg.teamMergeRequestSentShownToSecondaryTeam - case "other": - return EventTypeArg.other - default: - return EventTypeArg.other - } - default: - fatalError("Failed to deserialize") + case .adminAlertingAlertStateChanged: + var d = [String: JSON]() + d[".tag"] = .str("admin_alerting_alert_state_changed") + return .dictionary(d) + case .adminAlertingChangedAlertConfig: + var d = [String: JSON]() + d[".tag"] = .str("admin_alerting_changed_alert_config") + return .dictionary(d) + case .adminAlertingTriggeredAlert: + var d = [String: JSON]() + d[".tag"] = .str("admin_alerting_triggered_alert") + return .dictionary(d) + case .ransomwareRestoreProcessCompleted: + var d = [String: JSON]() + d[".tag"] = .str("ransomware_restore_process_completed") + return .dictionary(d) + case .ransomwareRestoreProcessStarted: + var d = [String: JSON]() + d[".tag"] = .str("ransomware_restore_process_started") + return .dictionary(d) + case .appBlockedByPermissions: + var d = [String: JSON]() + d[".tag"] = .str("app_blocked_by_permissions") + return .dictionary(d) + case .appLinkTeam: + var d = [String: JSON]() + d[".tag"] = .str("app_link_team") + return .dictionary(d) + case .appLinkUser: + var d = [String: JSON]() + d[".tag"] = .str("app_link_user") + return .dictionary(d) + case .appUnlinkTeam: + var d = [String: JSON]() + d[".tag"] = .str("app_unlink_team") + return .dictionary(d) + case .appUnlinkUser: + var d = [String: JSON]() + d[".tag"] = .str("app_unlink_user") + return .dictionary(d) + case .integrationConnected: + var d = [String: JSON]() + d[".tag"] = .str("integration_connected") + return .dictionary(d) + case .integrationDisconnected: + var d = [String: JSON]() + d[".tag"] = .str("integration_disconnected") + return .dictionary(d) + case .fileAddComment: + var d = [String: JSON]() + d[".tag"] = .str("file_add_comment") + return .dictionary(d) + case .fileChangeCommentSubscription: + var d = [String: JSON]() + d[".tag"] = .str("file_change_comment_subscription") + return .dictionary(d) + case .fileDeleteComment: + var d = [String: JSON]() + d[".tag"] = .str("file_delete_comment") + return .dictionary(d) + case .fileEditComment: + var d = [String: JSON]() + d[".tag"] = .str("file_edit_comment") + return .dictionary(d) + case .fileLikeComment: + var d = [String: JSON]() + d[".tag"] = .str("file_like_comment") + return .dictionary(d) + case .fileResolveComment: + var d = [String: JSON]() + d[".tag"] = .str("file_resolve_comment") + return .dictionary(d) + case .fileUnlikeComment: + var d = [String: JSON]() + d[".tag"] = .str("file_unlike_comment") + return .dictionary(d) + case .fileUnresolveComment: + var d = [String: JSON]() + d[".tag"] = .str("file_unresolve_comment") + return .dictionary(d) + case .governancePolicyAddFolders: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_add_folders") + return .dictionary(d) + case .governancePolicyAddFolderFailed: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_add_folder_failed") + return .dictionary(d) + case .governancePolicyContentDisposed: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_content_disposed") + return .dictionary(d) + case .governancePolicyCreate: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_create") + return .dictionary(d) + case .governancePolicyDelete: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_delete") + return .dictionary(d) + case .governancePolicyEditDetails: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_edit_details") + return .dictionary(d) + case .governancePolicyEditDuration: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_edit_duration") + return .dictionary(d) + case .governancePolicyExportCreated: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_export_created") + return .dictionary(d) + case .governancePolicyExportRemoved: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_export_removed") + return .dictionary(d) + case .governancePolicyRemoveFolders: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_remove_folders") + return .dictionary(d) + case .governancePolicyReportCreated: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_report_created") + return .dictionary(d) + case .governancePolicyZipPartDownloaded: + var d = [String: JSON]() + d[".tag"] = .str("governance_policy_zip_part_downloaded") + return .dictionary(d) + case .legalHoldsActivateAHold: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_activate_a_hold") + return .dictionary(d) + case .legalHoldsAddMembers: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_add_members") + return .dictionary(d) + case .legalHoldsChangeHoldDetails: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_change_hold_details") + return .dictionary(d) + case .legalHoldsChangeHoldName: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_change_hold_name") + return .dictionary(d) + case .legalHoldsExportAHold: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_export_a_hold") + return .dictionary(d) + case .legalHoldsExportCancelled: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_export_cancelled") + return .dictionary(d) + case .legalHoldsExportDownloaded: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_export_downloaded") + return .dictionary(d) + case .legalHoldsExportRemoved: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_export_removed") + return .dictionary(d) + case .legalHoldsReleaseAHold: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_release_a_hold") + return .dictionary(d) + case .legalHoldsRemoveMembers: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_remove_members") + return .dictionary(d) + case .legalHoldsReportAHold: + var d = [String: JSON]() + d[".tag"] = .str("legal_holds_report_a_hold") + return .dictionary(d) + case .deviceChangeIpDesktop: + var d = [String: JSON]() + d[".tag"] = .str("device_change_ip_desktop") + return .dictionary(d) + case .deviceChangeIpMobile: + var d = [String: JSON]() + d[".tag"] = .str("device_change_ip_mobile") + return .dictionary(d) + case .deviceChangeIpWeb: + var d = [String: JSON]() + d[".tag"] = .str("device_change_ip_web") + return .dictionary(d) + case .deviceDeleteOnUnlinkFail: + var d = [String: JSON]() + d[".tag"] = .str("device_delete_on_unlink_fail") + return .dictionary(d) + case .deviceDeleteOnUnlinkSuccess: + var d = [String: JSON]() + d[".tag"] = .str("device_delete_on_unlink_success") + return .dictionary(d) + case .deviceLinkFail: + var d = [String: JSON]() + d[".tag"] = .str("device_link_fail") + return .dictionary(d) + case .deviceLinkSuccess: + var d = [String: JSON]() + d[".tag"] = .str("device_link_success") + return .dictionary(d) + case .deviceManagementDisabled: + var d = [String: JSON]() + d[".tag"] = .str("device_management_disabled") + return .dictionary(d) + case .deviceManagementEnabled: + var d = [String: JSON]() + d[".tag"] = .str("device_management_enabled") + return .dictionary(d) + case .deviceSyncBackupStatusChanged: + var d = [String: JSON]() + d[".tag"] = .str("device_sync_backup_status_changed") + return .dictionary(d) + case .deviceUnlink: + var d = [String: JSON]() + d[".tag"] = .str("device_unlink") + return .dictionary(d) + case .dropboxPasswordsExported: + var d = [String: JSON]() + d[".tag"] = .str("dropbox_passwords_exported") + return .dictionary(d) + case .dropboxPasswordsNewDeviceEnrolled: + var d = [String: JSON]() + d[".tag"] = .str("dropbox_passwords_new_device_enrolled") + return .dictionary(d) + case .emmRefreshAuthToken: + var d = [String: JSON]() + d[".tag"] = .str("emm_refresh_auth_token") + return .dictionary(d) + case .externalDriveBackupEligibilityStatusChecked: + var d = [String: JSON]() + d[".tag"] = .str("external_drive_backup_eligibility_status_checked") + return .dictionary(d) + case .externalDriveBackupStatusChanged: + var d = [String: JSON]() + d[".tag"] = .str("external_drive_backup_status_changed") + return .dictionary(d) + case .accountCaptureChangeAvailability: + var d = [String: JSON]() + d[".tag"] = .str("account_capture_change_availability") + return .dictionary(d) + case .accountCaptureMigrateAccount: + var d = [String: JSON]() + d[".tag"] = .str("account_capture_migrate_account") + return .dictionary(d) + case .accountCaptureNotificationEmailsSent: + var d = [String: JSON]() + d[".tag"] = .str("account_capture_notification_emails_sent") + return .dictionary(d) + case .accountCaptureRelinquishAccount: + var d = [String: JSON]() + d[".tag"] = .str("account_capture_relinquish_account") + return .dictionary(d) + case .disabledDomainInvites: + var d = [String: JSON]() + d[".tag"] = .str("disabled_domain_invites") + return .dictionary(d) + case .domainInvitesApproveRequestToJoinTeam: + var d = [String: JSON]() + d[".tag"] = .str("domain_invites_approve_request_to_join_team") + return .dictionary(d) + case .domainInvitesDeclineRequestToJoinTeam: + var d = [String: JSON]() + d[".tag"] = .str("domain_invites_decline_request_to_join_team") + return .dictionary(d) + case .domainInvitesEmailExistingUsers: + var d = [String: JSON]() + d[".tag"] = .str("domain_invites_email_existing_users") + return .dictionary(d) + case .domainInvitesRequestToJoinTeam: + var d = [String: JSON]() + d[".tag"] = .str("domain_invites_request_to_join_team") + return .dictionary(d) + case .domainInvitesSetInviteNewUserPrefToNo: + var d = [String: JSON]() + d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_no") + return .dictionary(d) + case .domainInvitesSetInviteNewUserPrefToYes: + var d = [String: JSON]() + d[".tag"] = .str("domain_invites_set_invite_new_user_pref_to_yes") + return .dictionary(d) + case .domainVerificationAddDomainFail: + var d = [String: JSON]() + d[".tag"] = .str("domain_verification_add_domain_fail") + return .dictionary(d) + case .domainVerificationAddDomainSuccess: + var d = [String: JSON]() + d[".tag"] = .str("domain_verification_add_domain_success") + return .dictionary(d) + case .domainVerificationRemoveDomain: + var d = [String: JSON]() + d[".tag"] = .str("domain_verification_remove_domain") + return .dictionary(d) + case .enabledDomainInvites: + var d = [String: JSON]() + d[".tag"] = .str("enabled_domain_invites") + return .dictionary(d) + case .teamEncryptionKeyCancelKeyDeletion: + var d = [String: JSON]() + d[".tag"] = .str("team_encryption_key_cancel_key_deletion") + return .dictionary(d) + case .teamEncryptionKeyCreateKey: + var d = [String: JSON]() + d[".tag"] = .str("team_encryption_key_create_key") + return .dictionary(d) + case .teamEncryptionKeyDeleteKey: + var d = [String: JSON]() + d[".tag"] = .str("team_encryption_key_delete_key") + return .dictionary(d) + case .teamEncryptionKeyDisableKey: + var d = [String: JSON]() + d[".tag"] = .str("team_encryption_key_disable_key") + return .dictionary(d) + case .teamEncryptionKeyEnableKey: + var d = [String: JSON]() + d[".tag"] = .str("team_encryption_key_enable_key") + return .dictionary(d) + case .teamEncryptionKeyRotateKey: + var d = [String: JSON]() + d[".tag"] = .str("team_encryption_key_rotate_key") + return .dictionary(d) + case .teamEncryptionKeyScheduleKeyDeletion: + var d = [String: JSON]() + d[".tag"] = .str("team_encryption_key_schedule_key_deletion") + return .dictionary(d) + case .applyNamingConvention: + var d = [String: JSON]() + d[".tag"] = .str("apply_naming_convention") + return .dictionary(d) + case .createFolder: + var d = [String: JSON]() + d[".tag"] = .str("create_folder") + return .dictionary(d) + case .fileAdd: + var d = [String: JSON]() + d[".tag"] = .str("file_add") + return .dictionary(d) + case .fileAddFromAutomation: + var d = [String: JSON]() + d[".tag"] = .str("file_add_from_automation") + return .dictionary(d) + case .fileCopy: + var d = [String: JSON]() + d[".tag"] = .str("file_copy") + return .dictionary(d) + case .fileDelete: + var d = [String: JSON]() + d[".tag"] = .str("file_delete") + return .dictionary(d) + case .fileDownload: + var d = [String: JSON]() + d[".tag"] = .str("file_download") + return .dictionary(d) + case .fileEdit: + var d = [String: JSON]() + d[".tag"] = .str("file_edit") + return .dictionary(d) + case .fileGetCopyReference: + var d = [String: JSON]() + d[".tag"] = .str("file_get_copy_reference") + return .dictionary(d) + case .fileLockingLockStatusChanged: + var d = [String: JSON]() + d[".tag"] = .str("file_locking_lock_status_changed") + return .dictionary(d) + case .fileMove: + var d = [String: JSON]() + d[".tag"] = .str("file_move") + return .dictionary(d) + case .filePermanentlyDelete: + var d = [String: JSON]() + d[".tag"] = .str("file_permanently_delete") + return .dictionary(d) + case .filePreview: + var d = [String: JSON]() + d[".tag"] = .str("file_preview") + return .dictionary(d) + case .fileRename: + var d = [String: JSON]() + d[".tag"] = .str("file_rename") + return .dictionary(d) + case .fileRestore: + var d = [String: JSON]() + d[".tag"] = .str("file_restore") + return .dictionary(d) + case .fileRevert: + var d = [String: JSON]() + d[".tag"] = .str("file_revert") + return .dictionary(d) + case .fileRollbackChanges: + var d = [String: JSON]() + d[".tag"] = .str("file_rollback_changes") + return .dictionary(d) + case .fileSaveCopyReference: + var d = [String: JSON]() + d[".tag"] = .str("file_save_copy_reference") + return .dictionary(d) + case .folderOverviewDescriptionChanged: + var d = [String: JSON]() + d[".tag"] = .str("folder_overview_description_changed") + return .dictionary(d) + case .folderOverviewItemPinned: + var d = [String: JSON]() + d[".tag"] = .str("folder_overview_item_pinned") + return .dictionary(d) + case .folderOverviewItemUnpinned: + var d = [String: JSON]() + d[".tag"] = .str("folder_overview_item_unpinned") + return .dictionary(d) + case .objectLabelAdded: + var d = [String: JSON]() + d[".tag"] = .str("object_label_added") + return .dictionary(d) + case .objectLabelRemoved: + var d = [String: JSON]() + d[".tag"] = .str("object_label_removed") + return .dictionary(d) + case .objectLabelUpdatedValue: + var d = [String: JSON]() + d[".tag"] = .str("object_label_updated_value") + return .dictionary(d) + case .organizeFolderWithTidy: + var d = [String: JSON]() + d[".tag"] = .str("organize_folder_with_tidy") + return .dictionary(d) + case .replayFileDelete: + var d = [String: JSON]() + d[".tag"] = .str("replay_file_delete") + return .dictionary(d) + case .rewindFolder: + var d = [String: JSON]() + d[".tag"] = .str("rewind_folder") + return .dictionary(d) + case .undoNamingConvention: + var d = [String: JSON]() + d[".tag"] = .str("undo_naming_convention") + return .dictionary(d) + case .undoOrganizeFolderWithTidy: + var d = [String: JSON]() + d[".tag"] = .str("undo_organize_folder_with_tidy") + return .dictionary(d) + case .userTagsAdded: + var d = [String: JSON]() + d[".tag"] = .str("user_tags_added") + return .dictionary(d) + case .userTagsRemoved: + var d = [String: JSON]() + d[".tag"] = .str("user_tags_removed") + return .dictionary(d) + case .emailIngestReceiveFile: + var d = [String: JSON]() + d[".tag"] = .str("email_ingest_receive_file") + return .dictionary(d) + case .fileRequestChange: + var d = [String: JSON]() + d[".tag"] = .str("file_request_change") + return .dictionary(d) + case .fileRequestClose: + var d = [String: JSON]() + d[".tag"] = .str("file_request_close") + return .dictionary(d) + case .fileRequestCreate: + var d = [String: JSON]() + d[".tag"] = .str("file_request_create") + return .dictionary(d) + case .fileRequestDelete: + var d = [String: JSON]() + d[".tag"] = .str("file_request_delete") + return .dictionary(d) + case .fileRequestReceiveFile: + var d = [String: JSON]() + d[".tag"] = .str("file_request_receive_file") + return .dictionary(d) + case .groupAddExternalId: + var d = [String: JSON]() + d[".tag"] = .str("group_add_external_id") + return .dictionary(d) + case .groupAddMember: + var d = [String: JSON]() + d[".tag"] = .str("group_add_member") + return .dictionary(d) + case .groupChangeExternalId: + var d = [String: JSON]() + d[".tag"] = .str("group_change_external_id") + return .dictionary(d) + case .groupChangeManagementType: + var d = [String: JSON]() + d[".tag"] = .str("group_change_management_type") + return .dictionary(d) + case .groupChangeMemberRole: + var d = [String: JSON]() + d[".tag"] = .str("group_change_member_role") + return .dictionary(d) + case .groupCreate: + var d = [String: JSON]() + d[".tag"] = .str("group_create") + return .dictionary(d) + case .groupDelete: + var d = [String: JSON]() + d[".tag"] = .str("group_delete") + return .dictionary(d) + case .groupDescriptionUpdated: + var d = [String: JSON]() + d[".tag"] = .str("group_description_updated") + return .dictionary(d) + case .groupJoinPolicyUpdated: + var d = [String: JSON]() + d[".tag"] = .str("group_join_policy_updated") + return .dictionary(d) + case .groupMoved: + var d = [String: JSON]() + d[".tag"] = .str("group_moved") + return .dictionary(d) + case .groupRemoveExternalId: + var d = [String: JSON]() + d[".tag"] = .str("group_remove_external_id") + return .dictionary(d) + case .groupRemoveMember: + var d = [String: JSON]() + d[".tag"] = .str("group_remove_member") + return .dictionary(d) + case .groupRename: + var d = [String: JSON]() + d[".tag"] = .str("group_rename") + return .dictionary(d) + case .accountLockOrUnlocked: + var d = [String: JSON]() + d[".tag"] = .str("account_lock_or_unlocked") + return .dictionary(d) + case .emmError: + var d = [String: JSON]() + d[".tag"] = .str("emm_error") + return .dictionary(d) + case .guestAdminSignedInViaTrustedTeams: + var d = [String: JSON]() + d[".tag"] = .str("guest_admin_signed_in_via_trusted_teams") + return .dictionary(d) + case .guestAdminSignedOutViaTrustedTeams: + var d = [String: JSON]() + d[".tag"] = .str("guest_admin_signed_out_via_trusted_teams") + return .dictionary(d) + case .loginFail: + var d = [String: JSON]() + d[".tag"] = .str("login_fail") + return .dictionary(d) + case .loginSuccess: + var d = [String: JSON]() + d[".tag"] = .str("login_success") + return .dictionary(d) + case .logout: + var d = [String: JSON]() + d[".tag"] = .str("logout") + return .dictionary(d) + case .resellerSupportSessionEnd: + var d = [String: JSON]() + d[".tag"] = .str("reseller_support_session_end") + return .dictionary(d) + case .resellerSupportSessionStart: + var d = [String: JSON]() + d[".tag"] = .str("reseller_support_session_start") + return .dictionary(d) + case .signInAsSessionEnd: + var d = [String: JSON]() + d[".tag"] = .str("sign_in_as_session_end") + return .dictionary(d) + case .signInAsSessionStart: + var d = [String: JSON]() + d[".tag"] = .str("sign_in_as_session_start") + return .dictionary(d) + case .ssoError: + var d = [String: JSON]() + d[".tag"] = .str("sso_error") + return .dictionary(d) + case .backupAdminInvitationSent: + var d = [String: JSON]() + d[".tag"] = .str("backup_admin_invitation_sent") + return .dictionary(d) + case .backupInvitationOpened: + var d = [String: JSON]() + d[".tag"] = .str("backup_invitation_opened") + return .dictionary(d) + case .createTeamInviteLink: + var d = [String: JSON]() + d[".tag"] = .str("create_team_invite_link") + return .dictionary(d) + case .deleteTeamInviteLink: + var d = [String: JSON]() + d[".tag"] = .str("delete_team_invite_link") + return .dictionary(d) + case .memberAddExternalId: + var d = [String: JSON]() + d[".tag"] = .str("member_add_external_id") + return .dictionary(d) + case .memberAddName: + var d = [String: JSON]() + d[".tag"] = .str("member_add_name") + return .dictionary(d) + case .memberChangeAdminRole: + var d = [String: JSON]() + d[".tag"] = .str("member_change_admin_role") + return .dictionary(d) + case .memberChangeEmail: + var d = [String: JSON]() + d[".tag"] = .str("member_change_email") + return .dictionary(d) + case .memberChangeExternalId: + var d = [String: JSON]() + d[".tag"] = .str("member_change_external_id") + return .dictionary(d) + case .memberChangeMembershipType: + var d = [String: JSON]() + d[".tag"] = .str("member_change_membership_type") + return .dictionary(d) + case .memberChangeName: + var d = [String: JSON]() + d[".tag"] = .str("member_change_name") + return .dictionary(d) + case .memberChangeResellerRole: + var d = [String: JSON]() + d[".tag"] = .str("member_change_reseller_role") + return .dictionary(d) + case .memberChangeStatus: + var d = [String: JSON]() + d[".tag"] = .str("member_change_status") + return .dictionary(d) + case .memberDeleteManualContacts: + var d = [String: JSON]() + d[".tag"] = .str("member_delete_manual_contacts") + return .dictionary(d) + case .memberDeleteProfilePhoto: + var d = [String: JSON]() + d[".tag"] = .str("member_delete_profile_photo") + return .dictionary(d) + case .memberPermanentlyDeleteAccountContents: + var d = [String: JSON]() + d[".tag"] = .str("member_permanently_delete_account_contents") + return .dictionary(d) + case .memberRemoveExternalId: + var d = [String: JSON]() + d[".tag"] = .str("member_remove_external_id") + return .dictionary(d) + case .memberSetProfilePhoto: + var d = [String: JSON]() + d[".tag"] = .str("member_set_profile_photo") + return .dictionary(d) + case .memberSpaceLimitsAddCustomQuota: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_add_custom_quota") + return .dictionary(d) + case .memberSpaceLimitsChangeCustomQuota: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_change_custom_quota") + return .dictionary(d) + case .memberSpaceLimitsChangeStatus: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_change_status") + return .dictionary(d) + case .memberSpaceLimitsRemoveCustomQuota: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_remove_custom_quota") + return .dictionary(d) + case .memberSuggest: + var d = [String: JSON]() + d[".tag"] = .str("member_suggest") + return .dictionary(d) + case .memberTransferAccountContents: + var d = [String: JSON]() + d[".tag"] = .str("member_transfer_account_contents") + return .dictionary(d) + case .pendingSecondaryEmailAdded: + var d = [String: JSON]() + d[".tag"] = .str("pending_secondary_email_added") + return .dictionary(d) + case .secondaryEmailDeleted: + var d = [String: JSON]() + d[".tag"] = .str("secondary_email_deleted") + return .dictionary(d) + case .secondaryEmailVerified: + var d = [String: JSON]() + d[".tag"] = .str("secondary_email_verified") + return .dictionary(d) + case .secondaryMailsPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("secondary_mails_policy_changed") + return .dictionary(d) + case .binderAddPage: + var d = [String: JSON]() + d[".tag"] = .str("binder_add_page") + return .dictionary(d) + case .binderAddSection: + var d = [String: JSON]() + d[".tag"] = .str("binder_add_section") + return .dictionary(d) + case .binderRemovePage: + var d = [String: JSON]() + d[".tag"] = .str("binder_remove_page") + return .dictionary(d) + case .binderRemoveSection: + var d = [String: JSON]() + d[".tag"] = .str("binder_remove_section") + return .dictionary(d) + case .binderRenamePage: + var d = [String: JSON]() + d[".tag"] = .str("binder_rename_page") + return .dictionary(d) + case .binderRenameSection: + var d = [String: JSON]() + d[".tag"] = .str("binder_rename_section") + return .dictionary(d) + case .binderReorderPage: + var d = [String: JSON]() + d[".tag"] = .str("binder_reorder_page") + return .dictionary(d) + case .binderReorderSection: + var d = [String: JSON]() + d[".tag"] = .str("binder_reorder_section") + return .dictionary(d) + case .paperContentAddMember: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_add_member") + return .dictionary(d) + case .paperContentAddToFolder: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_add_to_folder") + return .dictionary(d) + case .paperContentArchive: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_archive") + return .dictionary(d) + case .paperContentCreate: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_create") + return .dictionary(d) + case .paperContentPermanentlyDelete: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_permanently_delete") + return .dictionary(d) + case .paperContentRemoveFromFolder: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_remove_from_folder") + return .dictionary(d) + case .paperContentRemoveMember: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_remove_member") + return .dictionary(d) + case .paperContentRename: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_rename") + return .dictionary(d) + case .paperContentRestore: + var d = [String: JSON]() + d[".tag"] = .str("paper_content_restore") + return .dictionary(d) + case .paperDocAddComment: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_add_comment") + return .dictionary(d) + case .paperDocChangeMemberRole: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_change_member_role") + return .dictionary(d) + case .paperDocChangeSharingPolicy: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_change_sharing_policy") + return .dictionary(d) + case .paperDocChangeSubscription: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_change_subscription") + return .dictionary(d) + case .paperDocDeleted: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_deleted") + return .dictionary(d) + case .paperDocDeleteComment: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_delete_comment") + return .dictionary(d) + case .paperDocDownload: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_download") + return .dictionary(d) + case .paperDocEdit: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_edit") + return .dictionary(d) + case .paperDocEditComment: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_edit_comment") + return .dictionary(d) + case .paperDocFollowed: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_followed") + return .dictionary(d) + case .paperDocMention: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_mention") + return .dictionary(d) + case .paperDocOwnershipChanged: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_ownership_changed") + return .dictionary(d) + case .paperDocRequestAccess: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_request_access") + return .dictionary(d) + case .paperDocResolveComment: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_resolve_comment") + return .dictionary(d) + case .paperDocRevert: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_revert") + return .dictionary(d) + case .paperDocSlackShare: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_slack_share") + return .dictionary(d) + case .paperDocTeamInvite: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_team_invite") + return .dictionary(d) + case .paperDocTrashed: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_trashed") + return .dictionary(d) + case .paperDocUnresolveComment: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_unresolve_comment") + return .dictionary(d) + case .paperDocUntrashed: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_untrashed") + return .dictionary(d) + case .paperDocView: + var d = [String: JSON]() + d[".tag"] = .str("paper_doc_view") + return .dictionary(d) + case .paperExternalViewAllow: + var d = [String: JSON]() + d[".tag"] = .str("paper_external_view_allow") + return .dictionary(d) + case .paperExternalViewDefaultTeam: + var d = [String: JSON]() + d[".tag"] = .str("paper_external_view_default_team") + return .dictionary(d) + case .paperExternalViewForbid: + var d = [String: JSON]() + d[".tag"] = .str("paper_external_view_forbid") + return .dictionary(d) + case .paperFolderChangeSubscription: + var d = [String: JSON]() + d[".tag"] = .str("paper_folder_change_subscription") + return .dictionary(d) + case .paperFolderDeleted: + var d = [String: JSON]() + d[".tag"] = .str("paper_folder_deleted") + return .dictionary(d) + case .paperFolderFollowed: + var d = [String: JSON]() + d[".tag"] = .str("paper_folder_followed") + return .dictionary(d) + case .paperFolderTeamInvite: + var d = [String: JSON]() + d[".tag"] = .str("paper_folder_team_invite") + return .dictionary(d) + case .paperPublishedLinkChangePermission: + var d = [String: JSON]() + d[".tag"] = .str("paper_published_link_change_permission") + return .dictionary(d) + case .paperPublishedLinkCreate: + var d = [String: JSON]() + d[".tag"] = .str("paper_published_link_create") + return .dictionary(d) + case .paperPublishedLinkDisabled: + var d = [String: JSON]() + d[".tag"] = .str("paper_published_link_disabled") + return .dictionary(d) + case .paperPublishedLinkView: + var d = [String: JSON]() + d[".tag"] = .str("paper_published_link_view") + return .dictionary(d) + case .passwordChange: + var d = [String: JSON]() + d[".tag"] = .str("password_change") + return .dictionary(d) + case .passwordReset: + var d = [String: JSON]() + d[".tag"] = .str("password_reset") + return .dictionary(d) + case .passwordResetAll: + var d = [String: JSON]() + d[".tag"] = .str("password_reset_all") + return .dictionary(d) + case .classificationCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("classification_create_report") + return .dictionary(d) + case .classificationCreateReportFail: + var d = [String: JSON]() + d[".tag"] = .str("classification_create_report_fail") + return .dictionary(d) + case .emmCreateExceptionsReport: + var d = [String: JSON]() + d[".tag"] = .str("emm_create_exceptions_report") + return .dictionary(d) + case .emmCreateUsageReport: + var d = [String: JSON]() + d[".tag"] = .str("emm_create_usage_report") + return .dictionary(d) + case .exportMembersReport: + var d = [String: JSON]() + d[".tag"] = .str("export_members_report") + return .dictionary(d) + case .exportMembersReportFail: + var d = [String: JSON]() + d[".tag"] = .str("export_members_report_fail") + return .dictionary(d) + case .externalSharingCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("external_sharing_create_report") + return .dictionary(d) + case .externalSharingReportFailed: + var d = [String: JSON]() + d[".tag"] = .str("external_sharing_report_failed") + return .dictionary(d) + case .noExpirationLinkGenCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("no_expiration_link_gen_create_report") + return .dictionary(d) + case .noExpirationLinkGenReportFailed: + var d = [String: JSON]() + d[".tag"] = .str("no_expiration_link_gen_report_failed") + return .dictionary(d) + case .noPasswordLinkGenCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("no_password_link_gen_create_report") + return .dictionary(d) + case .noPasswordLinkGenReportFailed: + var d = [String: JSON]() + d[".tag"] = .str("no_password_link_gen_report_failed") + return .dictionary(d) + case .noPasswordLinkViewCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("no_password_link_view_create_report") + return .dictionary(d) + case .noPasswordLinkViewReportFailed: + var d = [String: JSON]() + d[".tag"] = .str("no_password_link_view_report_failed") + return .dictionary(d) + case .outdatedLinkViewCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("outdated_link_view_create_report") + return .dictionary(d) + case .outdatedLinkViewReportFailed: + var d = [String: JSON]() + d[".tag"] = .str("outdated_link_view_report_failed") + return .dictionary(d) + case .paperAdminExportStart: + var d = [String: JSON]() + d[".tag"] = .str("paper_admin_export_start") + return .dictionary(d) + case .ransomwareAlertCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("ransomware_alert_create_report") + return .dictionary(d) + case .ransomwareAlertCreateReportFailed: + var d = [String: JSON]() + d[".tag"] = .str("ransomware_alert_create_report_failed") + return .dictionary(d) + case .smartSyncCreateAdminPrivilegeReport: + var d = [String: JSON]() + d[".tag"] = .str("smart_sync_create_admin_privilege_report") + return .dictionary(d) + case .teamActivityCreateReport: + var d = [String: JSON]() + d[".tag"] = .str("team_activity_create_report") + return .dictionary(d) + case .teamActivityCreateReportFail: + var d = [String: JSON]() + d[".tag"] = .str("team_activity_create_report_fail") + return .dictionary(d) + case .collectionShare: + var d = [String: JSON]() + d[".tag"] = .str("collection_share") + return .dictionary(d) + case .fileTransfersFileAdd: + var d = [String: JSON]() + d[".tag"] = .str("file_transfers_file_add") + return .dictionary(d) + case .fileTransfersTransferDelete: + var d = [String: JSON]() + d[".tag"] = .str("file_transfers_transfer_delete") + return .dictionary(d) + case .fileTransfersTransferDownload: + var d = [String: JSON]() + d[".tag"] = .str("file_transfers_transfer_download") + return .dictionary(d) + case .fileTransfersTransferSend: + var d = [String: JSON]() + d[".tag"] = .str("file_transfers_transfer_send") + return .dictionary(d) + case .fileTransfersTransferView: + var d = [String: JSON]() + d[".tag"] = .str("file_transfers_transfer_view") + return .dictionary(d) + case .noteAclInviteOnly: + var d = [String: JSON]() + d[".tag"] = .str("note_acl_invite_only") + return .dictionary(d) + case .noteAclLink: + var d = [String: JSON]() + d[".tag"] = .str("note_acl_link") + return .dictionary(d) + case .noteAclTeamLink: + var d = [String: JSON]() + d[".tag"] = .str("note_acl_team_link") + return .dictionary(d) + case .noteShared: + var d = [String: JSON]() + d[".tag"] = .str("note_shared") + return .dictionary(d) + case .noteShareReceive: + var d = [String: JSON]() + d[".tag"] = .str("note_share_receive") + return .dictionary(d) + case .openNoteShared: + var d = [String: JSON]() + d[".tag"] = .str("open_note_shared") + return .dictionary(d) + case .replayFileSharedLinkCreated: + var d = [String: JSON]() + d[".tag"] = .str("replay_file_shared_link_created") + return .dictionary(d) + case .replayFileSharedLinkModified: + var d = [String: JSON]() + d[".tag"] = .str("replay_file_shared_link_modified") + return .dictionary(d) + case .replayProjectTeamAdd: + var d = [String: JSON]() + d[".tag"] = .str("replay_project_team_add") + return .dictionary(d) + case .replayProjectTeamDelete: + var d = [String: JSON]() + d[".tag"] = .str("replay_project_team_delete") + return .dictionary(d) + case .sfAddGroup: + var d = [String: JSON]() + d[".tag"] = .str("sf_add_group") + return .dictionary(d) + case .sfAllowNonMembersToViewSharedLinks: + var d = [String: JSON]() + d[".tag"] = .str("sf_allow_non_members_to_view_shared_links") + return .dictionary(d) + case .sfExternalInviteWarn: + var d = [String: JSON]() + d[".tag"] = .str("sf_external_invite_warn") + return .dictionary(d) + case .sfFbInvite: + var d = [String: JSON]() + d[".tag"] = .str("sf_fb_invite") + return .dictionary(d) + case .sfFbInviteChangeRole: + var d = [String: JSON]() + d[".tag"] = .str("sf_fb_invite_change_role") + return .dictionary(d) + case .sfFbUninvite: + var d = [String: JSON]() + d[".tag"] = .str("sf_fb_uninvite") + return .dictionary(d) + case .sfInviteGroup: + var d = [String: JSON]() + d[".tag"] = .str("sf_invite_group") + return .dictionary(d) + case .sfTeamGrantAccess: + var d = [String: JSON]() + d[".tag"] = .str("sf_team_grant_access") + return .dictionary(d) + case .sfTeamInvite: + var d = [String: JSON]() + d[".tag"] = .str("sf_team_invite") + return .dictionary(d) + case .sfTeamInviteChangeRole: + var d = [String: JSON]() + d[".tag"] = .str("sf_team_invite_change_role") + return .dictionary(d) + case .sfTeamJoin: + var d = [String: JSON]() + d[".tag"] = .str("sf_team_join") + return .dictionary(d) + case .sfTeamJoinFromOobLink: + var d = [String: JSON]() + d[".tag"] = .str("sf_team_join_from_oob_link") + return .dictionary(d) + case .sfTeamUninvite: + var d = [String: JSON]() + d[".tag"] = .str("sf_team_uninvite") + return .dictionary(d) + case .sharedContentAddInvitees: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_add_invitees") + return .dictionary(d) + case .sharedContentAddLinkExpiry: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_add_link_expiry") + return .dictionary(d) + case .sharedContentAddLinkPassword: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_add_link_password") + return .dictionary(d) + case .sharedContentAddMember: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_add_member") + return .dictionary(d) + case .sharedContentChangeDownloadsPolicy: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_change_downloads_policy") + return .dictionary(d) + case .sharedContentChangeInviteeRole: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_change_invitee_role") + return .dictionary(d) + case .sharedContentChangeLinkAudience: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_change_link_audience") + return .dictionary(d) + case .sharedContentChangeLinkExpiry: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_change_link_expiry") + return .dictionary(d) + case .sharedContentChangeLinkPassword: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_change_link_password") + return .dictionary(d) + case .sharedContentChangeMemberRole: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_change_member_role") + return .dictionary(d) + case .sharedContentChangeViewerInfoPolicy: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_change_viewer_info_policy") + return .dictionary(d) + case .sharedContentClaimInvitation: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_claim_invitation") + return .dictionary(d) + case .sharedContentCopy: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_copy") + return .dictionary(d) + case .sharedContentDownload: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_download") + return .dictionary(d) + case .sharedContentRelinquishMembership: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_relinquish_membership") + return .dictionary(d) + case .sharedContentRemoveInvitees: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_remove_invitees") + return .dictionary(d) + case .sharedContentRemoveLinkExpiry: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_remove_link_expiry") + return .dictionary(d) + case .sharedContentRemoveLinkPassword: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_remove_link_password") + return .dictionary(d) + case .sharedContentRemoveMember: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_remove_member") + return .dictionary(d) + case .sharedContentRequestAccess: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_request_access") + return .dictionary(d) + case .sharedContentRestoreInvitees: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_restore_invitees") + return .dictionary(d) + case .sharedContentRestoreMember: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_restore_member") + return .dictionary(d) + case .sharedContentUnshare: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_unshare") + return .dictionary(d) + case .sharedContentView: + var d = [String: JSON]() + d[".tag"] = .str("shared_content_view") + return .dictionary(d) + case .sharedFolderChangeLinkPolicy: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_change_link_policy") + return .dictionary(d) + case .sharedFolderChangeMembersInheritancePolicy: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_change_members_inheritance_policy") + return .dictionary(d) + case .sharedFolderChangeMembersManagementPolicy: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_change_members_management_policy") + return .dictionary(d) + case .sharedFolderChangeMembersPolicy: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_change_members_policy") + return .dictionary(d) + case .sharedFolderCreate: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_create") + return .dictionary(d) + case .sharedFolderDeclineInvitation: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_decline_invitation") + return .dictionary(d) + case .sharedFolderMount: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_mount") + return .dictionary(d) + case .sharedFolderNest: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_nest") + return .dictionary(d) + case .sharedFolderTransferOwnership: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_transfer_ownership") + return .dictionary(d) + case .sharedFolderUnmount: + var d = [String: JSON]() + d[".tag"] = .str("shared_folder_unmount") + return .dictionary(d) + case .sharedLinkAddExpiry: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_add_expiry") + return .dictionary(d) + case .sharedLinkChangeExpiry: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_change_expiry") + return .dictionary(d) + case .sharedLinkChangeVisibility: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_change_visibility") + return .dictionary(d) + case .sharedLinkCopy: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_copy") + return .dictionary(d) + case .sharedLinkCreate: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_create") + return .dictionary(d) + case .sharedLinkDisable: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_disable") + return .dictionary(d) + case .sharedLinkDownload: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_download") + return .dictionary(d) + case .sharedLinkRemoveExpiry: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_remove_expiry") + return .dictionary(d) + case .sharedLinkSettingsAddExpiration: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_add_expiration") + return .dictionary(d) + case .sharedLinkSettingsAddPassword: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_add_password") + return .dictionary(d) + case .sharedLinkSettingsAllowDownloadDisabled: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_allow_download_disabled") + return .dictionary(d) + case .sharedLinkSettingsAllowDownloadEnabled: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_allow_download_enabled") + return .dictionary(d) + case .sharedLinkSettingsChangeAudience: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_change_audience") + return .dictionary(d) + case .sharedLinkSettingsChangeExpiration: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_change_expiration") + return .dictionary(d) + case .sharedLinkSettingsChangePassword: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_change_password") + return .dictionary(d) + case .sharedLinkSettingsRemoveExpiration: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_remove_expiration") + return .dictionary(d) + case .sharedLinkSettingsRemovePassword: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_settings_remove_password") + return .dictionary(d) + case .sharedLinkShare: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_share") + return .dictionary(d) + case .sharedLinkView: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_view") + return .dictionary(d) + case .sharedNoteOpened: + var d = [String: JSON]() + d[".tag"] = .str("shared_note_opened") + return .dictionary(d) + case .shmodelDisableDownloads: + var d = [String: JSON]() + d[".tag"] = .str("shmodel_disable_downloads") + return .dictionary(d) + case .shmodelEnableDownloads: + var d = [String: JSON]() + d[".tag"] = .str("shmodel_enable_downloads") + return .dictionary(d) + case .shmodelGroupShare: + var d = [String: JSON]() + d[".tag"] = .str("shmodel_group_share") + return .dictionary(d) + case .showcaseAccessGranted: + var d = [String: JSON]() + d[".tag"] = .str("showcase_access_granted") + return .dictionary(d) + case .showcaseAddMember: + var d = [String: JSON]() + d[".tag"] = .str("showcase_add_member") + return .dictionary(d) + case .showcaseArchived: + var d = [String: JSON]() + d[".tag"] = .str("showcase_archived") + return .dictionary(d) + case .showcaseCreated: + var d = [String: JSON]() + d[".tag"] = .str("showcase_created") + return .dictionary(d) + case .showcaseDeleteComment: + var d = [String: JSON]() + d[".tag"] = .str("showcase_delete_comment") + return .dictionary(d) + case .showcaseEdited: + var d = [String: JSON]() + d[".tag"] = .str("showcase_edited") + return .dictionary(d) + case .showcaseEditComment: + var d = [String: JSON]() + d[".tag"] = .str("showcase_edit_comment") + return .dictionary(d) + case .showcaseFileAdded: + var d = [String: JSON]() + d[".tag"] = .str("showcase_file_added") + return .dictionary(d) + case .showcaseFileDownload: + var d = [String: JSON]() + d[".tag"] = .str("showcase_file_download") + return .dictionary(d) + case .showcaseFileRemoved: + var d = [String: JSON]() + d[".tag"] = .str("showcase_file_removed") + return .dictionary(d) + case .showcaseFileView: + var d = [String: JSON]() + d[".tag"] = .str("showcase_file_view") + return .dictionary(d) + case .showcasePermanentlyDeleted: + var d = [String: JSON]() + d[".tag"] = .str("showcase_permanently_deleted") + return .dictionary(d) + case .showcasePostComment: + var d = [String: JSON]() + d[".tag"] = .str("showcase_post_comment") + return .dictionary(d) + case .showcaseRemoveMember: + var d = [String: JSON]() + d[".tag"] = .str("showcase_remove_member") + return .dictionary(d) + case .showcaseRenamed: + var d = [String: JSON]() + d[".tag"] = .str("showcase_renamed") + return .dictionary(d) + case .showcaseRequestAccess: + var d = [String: JSON]() + d[".tag"] = .str("showcase_request_access") + return .dictionary(d) + case .showcaseResolveComment: + var d = [String: JSON]() + d[".tag"] = .str("showcase_resolve_comment") + return .dictionary(d) + case .showcaseRestored: + var d = [String: JSON]() + d[".tag"] = .str("showcase_restored") + return .dictionary(d) + case .showcaseTrashed: + var d = [String: JSON]() + d[".tag"] = .str("showcase_trashed") + return .dictionary(d) + case .showcaseTrashedDeprecated: + var d = [String: JSON]() + d[".tag"] = .str("showcase_trashed_deprecated") + return .dictionary(d) + case .showcaseUnresolveComment: + var d = [String: JSON]() + d[".tag"] = .str("showcase_unresolve_comment") + return .dictionary(d) + case .showcaseUntrashed: + var d = [String: JSON]() + d[".tag"] = .str("showcase_untrashed") + return .dictionary(d) + case .showcaseUntrashedDeprecated: + var d = [String: JSON]() + d[".tag"] = .str("showcase_untrashed_deprecated") + return .dictionary(d) + case .showcaseView: + var d = [String: JSON]() + d[".tag"] = .str("showcase_view") + return .dictionary(d) + case .ssoAddCert: + var d = [String: JSON]() + d[".tag"] = .str("sso_add_cert") + return .dictionary(d) + case .ssoAddLoginUrl: + var d = [String: JSON]() + d[".tag"] = .str("sso_add_login_url") + return .dictionary(d) + case .ssoAddLogoutUrl: + var d = [String: JSON]() + d[".tag"] = .str("sso_add_logout_url") + return .dictionary(d) + case .ssoChangeCert: + var d = [String: JSON]() + d[".tag"] = .str("sso_change_cert") + return .dictionary(d) + case .ssoChangeLoginUrl: + var d = [String: JSON]() + d[".tag"] = .str("sso_change_login_url") + return .dictionary(d) + case .ssoChangeLogoutUrl: + var d = [String: JSON]() + d[".tag"] = .str("sso_change_logout_url") + return .dictionary(d) + case .ssoChangeSamlIdentityMode: + var d = [String: JSON]() + d[".tag"] = .str("sso_change_saml_identity_mode") + return .dictionary(d) + case .ssoRemoveCert: + var d = [String: JSON]() + d[".tag"] = .str("sso_remove_cert") + return .dictionary(d) + case .ssoRemoveLoginUrl: + var d = [String: JSON]() + d[".tag"] = .str("sso_remove_login_url") + return .dictionary(d) + case .ssoRemoveLogoutUrl: + var d = [String: JSON]() + d[".tag"] = .str("sso_remove_logout_url") + return .dictionary(d) + case .teamFolderChangeStatus: + var d = [String: JSON]() + d[".tag"] = .str("team_folder_change_status") + return .dictionary(d) + case .teamFolderCreate: + var d = [String: JSON]() + d[".tag"] = .str("team_folder_create") + return .dictionary(d) + case .teamFolderDowngrade: + var d = [String: JSON]() + d[".tag"] = .str("team_folder_downgrade") + return .dictionary(d) + case .teamFolderPermanentlyDelete: + var d = [String: JSON]() + d[".tag"] = .str("team_folder_permanently_delete") + return .dictionary(d) + case .teamFolderRename: + var d = [String: JSON]() + d[".tag"] = .str("team_folder_rename") + return .dictionary(d) + case .teamSelectiveSyncSettingsChanged: + var d = [String: JSON]() + d[".tag"] = .str("team_selective_sync_settings_changed") + return .dictionary(d) + case .accountCaptureChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("account_capture_change_policy") + return .dictionary(d) + case .adminEmailRemindersChanged: + var d = [String: JSON]() + d[".tag"] = .str("admin_email_reminders_changed") + return .dictionary(d) + case .allowDownloadDisabled: + var d = [String: JSON]() + d[".tag"] = .str("allow_download_disabled") + return .dictionary(d) + case .allowDownloadEnabled: + var d = [String: JSON]() + d[".tag"] = .str("allow_download_enabled") + return .dictionary(d) + case .appPermissionsChanged: + var d = [String: JSON]() + d[".tag"] = .str("app_permissions_changed") + return .dictionary(d) + case .cameraUploadsPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("camera_uploads_policy_changed") + return .dictionary(d) + case .captureTranscriptPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("capture_transcript_policy_changed") + return .dictionary(d) + case .classificationChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("classification_change_policy") + return .dictionary(d) + case .computerBackupPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("computer_backup_policy_changed") + return .dictionary(d) + case .contentAdministrationPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("content_administration_policy_changed") + return .dictionary(d) + case .dataPlacementRestrictionChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("data_placement_restriction_change_policy") + return .dictionary(d) + case .dataPlacementRestrictionSatisfyPolicy: + var d = [String: JSON]() + d[".tag"] = .str("data_placement_restriction_satisfy_policy") + return .dictionary(d) + case .deviceApprovalsAddException: + var d = [String: JSON]() + d[".tag"] = .str("device_approvals_add_exception") + return .dictionary(d) + case .deviceApprovalsChangeDesktopPolicy: + var d = [String: JSON]() + d[".tag"] = .str("device_approvals_change_desktop_policy") + return .dictionary(d) + case .deviceApprovalsChangeMobilePolicy: + var d = [String: JSON]() + d[".tag"] = .str("device_approvals_change_mobile_policy") + return .dictionary(d) + case .deviceApprovalsChangeOverageAction: + var d = [String: JSON]() + d[".tag"] = .str("device_approvals_change_overage_action") + return .dictionary(d) + case .deviceApprovalsChangeUnlinkAction: + var d = [String: JSON]() + d[".tag"] = .str("device_approvals_change_unlink_action") + return .dictionary(d) + case .deviceApprovalsRemoveException: + var d = [String: JSON]() + d[".tag"] = .str("device_approvals_remove_exception") + return .dictionary(d) + case .directoryRestrictionsAddMembers: + var d = [String: JSON]() + d[".tag"] = .str("directory_restrictions_add_members") + return .dictionary(d) + case .directoryRestrictionsRemoveMembers: + var d = [String: JSON]() + d[".tag"] = .str("directory_restrictions_remove_members") + return .dictionary(d) + case .dropboxPasswordsPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("dropbox_passwords_policy_changed") + return .dictionary(d) + case .emailIngestPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("email_ingest_policy_changed") + return .dictionary(d) + case .emmAddException: + var d = [String: JSON]() + d[".tag"] = .str("emm_add_exception") + return .dictionary(d) + case .emmChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("emm_change_policy") + return .dictionary(d) + case .emmRemoveException: + var d = [String: JSON]() + d[".tag"] = .str("emm_remove_exception") + return .dictionary(d) + case .extendedVersionHistoryChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("extended_version_history_change_policy") + return .dictionary(d) + case .externalDriveBackupPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("external_drive_backup_policy_changed") + return .dictionary(d) + case .fileCommentsChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("file_comments_change_policy") + return .dictionary(d) + case .fileLockingPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("file_locking_policy_changed") + return .dictionary(d) + case .fileProviderMigrationPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("file_provider_migration_policy_changed") + return .dictionary(d) + case .fileRequestsChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("file_requests_change_policy") + return .dictionary(d) + case .fileRequestsEmailsEnabled: + var d = [String: JSON]() + d[".tag"] = .str("file_requests_emails_enabled") + return .dictionary(d) + case .fileRequestsEmailsRestrictedToTeamOnly: + var d = [String: JSON]() + d[".tag"] = .str("file_requests_emails_restricted_to_team_only") + return .dictionary(d) + case .fileTransfersPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("file_transfers_policy_changed") + return .dictionary(d) + case .folderLinkRestrictionPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("folder_link_restriction_policy_changed") + return .dictionary(d) + case .googleSsoChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("google_sso_change_policy") + return .dictionary(d) + case .groupUserManagementChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("group_user_management_change_policy") + return .dictionary(d) + case .integrationPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("integration_policy_changed") + return .dictionary(d) + case .inviteAcceptanceEmailPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("invite_acceptance_email_policy_changed") + return .dictionary(d) + case .memberRequestsChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("member_requests_change_policy") + return .dictionary(d) + case .memberSendInvitePolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("member_send_invite_policy_changed") + return .dictionary(d) + case .memberSpaceLimitsAddException: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_add_exception") + return .dictionary(d) + case .memberSpaceLimitsChangeCapsTypePolicy: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_change_caps_type_policy") + return .dictionary(d) + case .memberSpaceLimitsChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_change_policy") + return .dictionary(d) + case .memberSpaceLimitsRemoveException: + var d = [String: JSON]() + d[".tag"] = .str("member_space_limits_remove_exception") + return .dictionary(d) + case .memberSuggestionsChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("member_suggestions_change_policy") + return .dictionary(d) + case .microsoftOfficeAddinChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("microsoft_office_addin_change_policy") + return .dictionary(d) + case .networkControlChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("network_control_change_policy") + return .dictionary(d) + case .paperChangeDeploymentPolicy: + var d = [String: JSON]() + d[".tag"] = .str("paper_change_deployment_policy") + return .dictionary(d) + case .paperChangeMemberLinkPolicy: + var d = [String: JSON]() + d[".tag"] = .str("paper_change_member_link_policy") + return .dictionary(d) + case .paperChangeMemberPolicy: + var d = [String: JSON]() + d[".tag"] = .str("paper_change_member_policy") + return .dictionary(d) + case .paperChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("paper_change_policy") + return .dictionary(d) + case .paperDefaultFolderPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("paper_default_folder_policy_changed") + return .dictionary(d) + case .paperDesktopPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("paper_desktop_policy_changed") + return .dictionary(d) + case .paperEnabledUsersGroupAddition: + var d = [String: JSON]() + d[".tag"] = .str("paper_enabled_users_group_addition") + return .dictionary(d) + case .paperEnabledUsersGroupRemoval: + var d = [String: JSON]() + d[".tag"] = .str("paper_enabled_users_group_removal") + return .dictionary(d) + case .passwordStrengthRequirementsChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("password_strength_requirements_change_policy") + return .dictionary(d) + case .permanentDeleteChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("permanent_delete_change_policy") + return .dictionary(d) + case .resellerSupportChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("reseller_support_change_policy") + return .dictionary(d) + case .rewindPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("rewind_policy_changed") + return .dictionary(d) + case .sendForSignaturePolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("send_for_signature_policy_changed") + return .dictionary(d) + case .sharingChangeFolderJoinPolicy: + var d = [String: JSON]() + d[".tag"] = .str("sharing_change_folder_join_policy") + return .dictionary(d) + case .sharingChangeLinkAllowChangeExpirationPolicy: + var d = [String: JSON]() + d[".tag"] = .str("sharing_change_link_allow_change_expiration_policy") + return .dictionary(d) + case .sharingChangeLinkDefaultExpirationPolicy: + var d = [String: JSON]() + d[".tag"] = .str("sharing_change_link_default_expiration_policy") + return .dictionary(d) + case .sharingChangeLinkEnforcePasswordPolicy: + var d = [String: JSON]() + d[".tag"] = .str("sharing_change_link_enforce_password_policy") + return .dictionary(d) + case .sharingChangeLinkPolicy: + var d = [String: JSON]() + d[".tag"] = .str("sharing_change_link_policy") + return .dictionary(d) + case .sharingChangeMemberPolicy: + var d = [String: JSON]() + d[".tag"] = .str("sharing_change_member_policy") + return .dictionary(d) + case .showcaseChangeDownloadPolicy: + var d = [String: JSON]() + d[".tag"] = .str("showcase_change_download_policy") + return .dictionary(d) + case .showcaseChangeEnabledPolicy: + var d = [String: JSON]() + d[".tag"] = .str("showcase_change_enabled_policy") + return .dictionary(d) + case .showcaseChangeExternalSharingPolicy: + var d = [String: JSON]() + d[".tag"] = .str("showcase_change_external_sharing_policy") + return .dictionary(d) + case .smarterSmartSyncPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("smarter_smart_sync_policy_changed") + return .dictionary(d) + case .smartSyncChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("smart_sync_change_policy") + return .dictionary(d) + case .smartSyncNotOptOut: + var d = [String: JSON]() + d[".tag"] = .str("smart_sync_not_opt_out") + return .dictionary(d) + case .smartSyncOptOut: + var d = [String: JSON]() + d[".tag"] = .str("smart_sync_opt_out") + return .dictionary(d) + case .ssoChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("sso_change_policy") + return .dictionary(d) + case .teamBrandingPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("team_branding_policy_changed") + return .dictionary(d) + case .teamExtensionsPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("team_extensions_policy_changed") + return .dictionary(d) + case .teamSelectiveSyncPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("team_selective_sync_policy_changed") + return .dictionary(d) + case .teamSharingWhitelistSubjectsChanged: + var d = [String: JSON]() + d[".tag"] = .str("team_sharing_whitelist_subjects_changed") + return .dictionary(d) + case .tfaAddException: + var d = [String: JSON]() + d[".tag"] = .str("tfa_add_exception") + return .dictionary(d) + case .tfaChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("tfa_change_policy") + return .dictionary(d) + case .tfaRemoveException: + var d = [String: JSON]() + d[".tag"] = .str("tfa_remove_exception") + return .dictionary(d) + case .twoAccountChangePolicy: + var d = [String: JSON]() + d[".tag"] = .str("two_account_change_policy") + return .dictionary(d) + case .viewerInfoPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("viewer_info_policy_changed") + return .dictionary(d) + case .watermarkingPolicyChanged: + var d = [String: JSON]() + d[".tag"] = .str("watermarking_policy_changed") + return .dictionary(d) + case .webSessionsChangeActiveSessionLimit: + var d = [String: JSON]() + d[".tag"] = .str("web_sessions_change_active_session_limit") + return .dictionary(d) + case .webSessionsChangeFixedLengthPolicy: + var d = [String: JSON]() + d[".tag"] = .str("web_sessions_change_fixed_length_policy") + return .dictionary(d) + case .webSessionsChangeIdleLengthPolicy: + var d = [String: JSON]() + d[".tag"] = .str("web_sessions_change_idle_length_policy") + return .dictionary(d) + case .dataResidencyMigrationRequestSuccessful: + var d = [String: JSON]() + d[".tag"] = .str("data_residency_migration_request_successful") + return .dictionary(d) + case .dataResidencyMigrationRequestUnsuccessful: + var d = [String: JSON]() + d[".tag"] = .str("data_residency_migration_request_unsuccessful") + return .dictionary(d) + case .teamMergeFrom: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_from") + return .dictionary(d) + case .teamMergeTo: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_to") + return .dictionary(d) + case .teamProfileAddBackground: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_add_background") + return .dictionary(d) + case .teamProfileAddLogo: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_add_logo") + return .dictionary(d) + case .teamProfileChangeBackground: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_change_background") + return .dictionary(d) + case .teamProfileChangeDefaultLanguage: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_change_default_language") + return .dictionary(d) + case .teamProfileChangeLogo: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_change_logo") + return .dictionary(d) + case .teamProfileChangeName: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_change_name") + return .dictionary(d) + case .teamProfileRemoveBackground: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_remove_background") + return .dictionary(d) + case .teamProfileRemoveLogo: + var d = [String: JSON]() + d[".tag"] = .str("team_profile_remove_logo") + return .dictionary(d) + case .tfaAddBackupPhone: + var d = [String: JSON]() + d[".tag"] = .str("tfa_add_backup_phone") + return .dictionary(d) + case .tfaAddSecurityKey: + var d = [String: JSON]() + d[".tag"] = .str("tfa_add_security_key") + return .dictionary(d) + case .tfaChangeBackupPhone: + var d = [String: JSON]() + d[".tag"] = .str("tfa_change_backup_phone") + return .dictionary(d) + case .tfaChangeStatus: + var d = [String: JSON]() + d[".tag"] = .str("tfa_change_status") + return .dictionary(d) + case .tfaRemoveBackupPhone: + var d = [String: JSON]() + d[".tag"] = .str("tfa_remove_backup_phone") + return .dictionary(d) + case .tfaRemoveSecurityKey: + var d = [String: JSON]() + d[".tag"] = .str("tfa_remove_security_key") + return .dictionary(d) + case .tfaReset: + var d = [String: JSON]() + d[".tag"] = .str("tfa_reset") + return .dictionary(d) + case .changedEnterpriseAdminRole: + var d = [String: JSON]() + d[".tag"] = .str("changed_enterprise_admin_role") + return .dictionary(d) + case .changedEnterpriseConnectedTeamStatus: + var d = [String: JSON]() + d[".tag"] = .str("changed_enterprise_connected_team_status") + return .dictionary(d) + case .endedEnterpriseAdminSession: + var d = [String: JSON]() + d[".tag"] = .str("ended_enterprise_admin_session") + return .dictionary(d) + case .endedEnterpriseAdminSessionDeprecated: + var d = [String: JSON]() + d[".tag"] = .str("ended_enterprise_admin_session_deprecated") + return .dictionary(d) + case .enterpriseSettingsLocking: + var d = [String: JSON]() + d[".tag"] = .str("enterprise_settings_locking") + return .dictionary(d) + case .guestAdminChangeStatus: + var d = [String: JSON]() + d[".tag"] = .str("guest_admin_change_status") + return .dictionary(d) + case .startedEnterpriseAdminSession: + var d = [String: JSON]() + d[".tag"] = .str("started_enterprise_admin_session") + return .dictionary(d) + case .teamMergeRequestAccepted: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_accepted") + return .dictionary(d) + case .teamMergeRequestAcceptedShownToPrimaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_accepted_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestAcceptedShownToSecondaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_accepted_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestAutoCanceled: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_auto_canceled") + return .dictionary(d) + case .teamMergeRequestCanceled: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_canceled") + return .dictionary(d) + case .teamMergeRequestCanceledShownToPrimaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_canceled_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestCanceledShownToSecondaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_canceled_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestExpired: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_expired") + return .dictionary(d) + case .teamMergeRequestExpiredShownToPrimaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_expired_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestExpiredShownToSecondaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_expired_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestRejectedShownToPrimaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_rejected_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestRejectedShownToSecondaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_rejected_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestReminder: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_reminder") + return .dictionary(d) + case .teamMergeRequestReminderShownToPrimaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_reminder_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestReminderShownToSecondaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_reminder_shown_to_secondary_team") + return .dictionary(d) + case .teamMergeRequestRevoked: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_revoked") + return .dictionary(d) + case .teamMergeRequestSentShownToPrimaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_sent_shown_to_primary_team") + return .dictionary(d) + case .teamMergeRequestSentShownToSecondaryTeam: + var d = [String: JSON]() + d[".tag"] = .str("team_merge_request_sent_shown_to_secondary_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> EventTypeArg { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admin_alerting_alert_state_changed": + return EventTypeArg.adminAlertingAlertStateChanged + case "admin_alerting_changed_alert_config": + return EventTypeArg.adminAlertingChangedAlertConfig + case "admin_alerting_triggered_alert": + return EventTypeArg.adminAlertingTriggeredAlert + case "ransomware_restore_process_completed": + return EventTypeArg.ransomwareRestoreProcessCompleted + case "ransomware_restore_process_started": + return EventTypeArg.ransomwareRestoreProcessStarted + case "app_blocked_by_permissions": + return EventTypeArg.appBlockedByPermissions + case "app_link_team": + return EventTypeArg.appLinkTeam + case "app_link_user": + return EventTypeArg.appLinkUser + case "app_unlink_team": + return EventTypeArg.appUnlinkTeam + case "app_unlink_user": + return EventTypeArg.appUnlinkUser + case "integration_connected": + return EventTypeArg.integrationConnected + case "integration_disconnected": + return EventTypeArg.integrationDisconnected + case "file_add_comment": + return EventTypeArg.fileAddComment + case "file_change_comment_subscription": + return EventTypeArg.fileChangeCommentSubscription + case "file_delete_comment": + return EventTypeArg.fileDeleteComment + case "file_edit_comment": + return EventTypeArg.fileEditComment + case "file_like_comment": + return EventTypeArg.fileLikeComment + case "file_resolve_comment": + return EventTypeArg.fileResolveComment + case "file_unlike_comment": + return EventTypeArg.fileUnlikeComment + case "file_unresolve_comment": + return EventTypeArg.fileUnresolveComment + case "governance_policy_add_folders": + return EventTypeArg.governancePolicyAddFolders + case "governance_policy_add_folder_failed": + return EventTypeArg.governancePolicyAddFolderFailed + case "governance_policy_content_disposed": + return EventTypeArg.governancePolicyContentDisposed + case "governance_policy_create": + return EventTypeArg.governancePolicyCreate + case "governance_policy_delete": + return EventTypeArg.governancePolicyDelete + case "governance_policy_edit_details": + return EventTypeArg.governancePolicyEditDetails + case "governance_policy_edit_duration": + return EventTypeArg.governancePolicyEditDuration + case "governance_policy_export_created": + return EventTypeArg.governancePolicyExportCreated + case "governance_policy_export_removed": + return EventTypeArg.governancePolicyExportRemoved + case "governance_policy_remove_folders": + return EventTypeArg.governancePolicyRemoveFolders + case "governance_policy_report_created": + return EventTypeArg.governancePolicyReportCreated + case "governance_policy_zip_part_downloaded": + return EventTypeArg.governancePolicyZipPartDownloaded + case "legal_holds_activate_a_hold": + return EventTypeArg.legalHoldsActivateAHold + case "legal_holds_add_members": + return EventTypeArg.legalHoldsAddMembers + case "legal_holds_change_hold_details": + return EventTypeArg.legalHoldsChangeHoldDetails + case "legal_holds_change_hold_name": + return EventTypeArg.legalHoldsChangeHoldName + case "legal_holds_export_a_hold": + return EventTypeArg.legalHoldsExportAHold + case "legal_holds_export_cancelled": + return EventTypeArg.legalHoldsExportCancelled + case "legal_holds_export_downloaded": + return EventTypeArg.legalHoldsExportDownloaded + case "legal_holds_export_removed": + return EventTypeArg.legalHoldsExportRemoved + case "legal_holds_release_a_hold": + return EventTypeArg.legalHoldsReleaseAHold + case "legal_holds_remove_members": + return EventTypeArg.legalHoldsRemoveMembers + case "legal_holds_report_a_hold": + return EventTypeArg.legalHoldsReportAHold + case "device_change_ip_desktop": + return EventTypeArg.deviceChangeIpDesktop + case "device_change_ip_mobile": + return EventTypeArg.deviceChangeIpMobile + case "device_change_ip_web": + return EventTypeArg.deviceChangeIpWeb + case "device_delete_on_unlink_fail": + return EventTypeArg.deviceDeleteOnUnlinkFail + case "device_delete_on_unlink_success": + return EventTypeArg.deviceDeleteOnUnlinkSuccess + case "device_link_fail": + return EventTypeArg.deviceLinkFail + case "device_link_success": + return EventTypeArg.deviceLinkSuccess + case "device_management_disabled": + return EventTypeArg.deviceManagementDisabled + case "device_management_enabled": + return EventTypeArg.deviceManagementEnabled + case "device_sync_backup_status_changed": + return EventTypeArg.deviceSyncBackupStatusChanged + case "device_unlink": + return EventTypeArg.deviceUnlink + case "dropbox_passwords_exported": + return EventTypeArg.dropboxPasswordsExported + case "dropbox_passwords_new_device_enrolled": + return EventTypeArg.dropboxPasswordsNewDeviceEnrolled + case "emm_refresh_auth_token": + return EventTypeArg.emmRefreshAuthToken + case "external_drive_backup_eligibility_status_checked": + return EventTypeArg.externalDriveBackupEligibilityStatusChecked + case "external_drive_backup_status_changed": + return EventTypeArg.externalDriveBackupStatusChanged + case "account_capture_change_availability": + return EventTypeArg.accountCaptureChangeAvailability + case "account_capture_migrate_account": + return EventTypeArg.accountCaptureMigrateAccount + case "account_capture_notification_emails_sent": + return EventTypeArg.accountCaptureNotificationEmailsSent + case "account_capture_relinquish_account": + return EventTypeArg.accountCaptureRelinquishAccount + case "disabled_domain_invites": + return EventTypeArg.disabledDomainInvites + case "domain_invites_approve_request_to_join_team": + return EventTypeArg.domainInvitesApproveRequestToJoinTeam + case "domain_invites_decline_request_to_join_team": + return EventTypeArg.domainInvitesDeclineRequestToJoinTeam + case "domain_invites_email_existing_users": + return EventTypeArg.domainInvitesEmailExistingUsers + case "domain_invites_request_to_join_team": + return EventTypeArg.domainInvitesRequestToJoinTeam + case "domain_invites_set_invite_new_user_pref_to_no": + return EventTypeArg.domainInvitesSetInviteNewUserPrefToNo + case "domain_invites_set_invite_new_user_pref_to_yes": + return EventTypeArg.domainInvitesSetInviteNewUserPrefToYes + case "domain_verification_add_domain_fail": + return EventTypeArg.domainVerificationAddDomainFail + case "domain_verification_add_domain_success": + return EventTypeArg.domainVerificationAddDomainSuccess + case "domain_verification_remove_domain": + return EventTypeArg.domainVerificationRemoveDomain + case "enabled_domain_invites": + return EventTypeArg.enabledDomainInvites + case "team_encryption_key_cancel_key_deletion": + return EventTypeArg.teamEncryptionKeyCancelKeyDeletion + case "team_encryption_key_create_key": + return EventTypeArg.teamEncryptionKeyCreateKey + case "team_encryption_key_delete_key": + return EventTypeArg.teamEncryptionKeyDeleteKey + case "team_encryption_key_disable_key": + return EventTypeArg.teamEncryptionKeyDisableKey + case "team_encryption_key_enable_key": + return EventTypeArg.teamEncryptionKeyEnableKey + case "team_encryption_key_rotate_key": + return EventTypeArg.teamEncryptionKeyRotateKey + case "team_encryption_key_schedule_key_deletion": + return EventTypeArg.teamEncryptionKeyScheduleKeyDeletion + case "apply_naming_convention": + return EventTypeArg.applyNamingConvention + case "create_folder": + return EventTypeArg.createFolder + case "file_add": + return EventTypeArg.fileAdd + case "file_add_from_automation": + return EventTypeArg.fileAddFromAutomation + case "file_copy": + return EventTypeArg.fileCopy + case "file_delete": + return EventTypeArg.fileDelete + case "file_download": + return EventTypeArg.fileDownload + case "file_edit": + return EventTypeArg.fileEdit + case "file_get_copy_reference": + return EventTypeArg.fileGetCopyReference + case "file_locking_lock_status_changed": + return EventTypeArg.fileLockingLockStatusChanged + case "file_move": + return EventTypeArg.fileMove + case "file_permanently_delete": + return EventTypeArg.filePermanentlyDelete + case "file_preview": + return EventTypeArg.filePreview + case "file_rename": + return EventTypeArg.fileRename + case "file_restore": + return EventTypeArg.fileRestore + case "file_revert": + return EventTypeArg.fileRevert + case "file_rollback_changes": + return EventTypeArg.fileRollbackChanges + case "file_save_copy_reference": + return EventTypeArg.fileSaveCopyReference + case "folder_overview_description_changed": + return EventTypeArg.folderOverviewDescriptionChanged + case "folder_overview_item_pinned": + return EventTypeArg.folderOverviewItemPinned + case "folder_overview_item_unpinned": + return EventTypeArg.folderOverviewItemUnpinned + case "object_label_added": + return EventTypeArg.objectLabelAdded + case "object_label_removed": + return EventTypeArg.objectLabelRemoved + case "object_label_updated_value": + return EventTypeArg.objectLabelUpdatedValue + case "organize_folder_with_tidy": + return EventTypeArg.organizeFolderWithTidy + case "replay_file_delete": + return EventTypeArg.replayFileDelete + case "rewind_folder": + return EventTypeArg.rewindFolder + case "undo_naming_convention": + return EventTypeArg.undoNamingConvention + case "undo_organize_folder_with_tidy": + return EventTypeArg.undoOrganizeFolderWithTidy + case "user_tags_added": + return EventTypeArg.userTagsAdded + case "user_tags_removed": + return EventTypeArg.userTagsRemoved + case "email_ingest_receive_file": + return EventTypeArg.emailIngestReceiveFile + case "file_request_change": + return EventTypeArg.fileRequestChange + case "file_request_close": + return EventTypeArg.fileRequestClose + case "file_request_create": + return EventTypeArg.fileRequestCreate + case "file_request_delete": + return EventTypeArg.fileRequestDelete + case "file_request_receive_file": + return EventTypeArg.fileRequestReceiveFile + case "group_add_external_id": + return EventTypeArg.groupAddExternalId + case "group_add_member": + return EventTypeArg.groupAddMember + case "group_change_external_id": + return EventTypeArg.groupChangeExternalId + case "group_change_management_type": + return EventTypeArg.groupChangeManagementType + case "group_change_member_role": + return EventTypeArg.groupChangeMemberRole + case "group_create": + return EventTypeArg.groupCreate + case "group_delete": + return EventTypeArg.groupDelete + case "group_description_updated": + return EventTypeArg.groupDescriptionUpdated + case "group_join_policy_updated": + return EventTypeArg.groupJoinPolicyUpdated + case "group_moved": + return EventTypeArg.groupMoved + case "group_remove_external_id": + return EventTypeArg.groupRemoveExternalId + case "group_remove_member": + return EventTypeArg.groupRemoveMember + case "group_rename": + return EventTypeArg.groupRename + case "account_lock_or_unlocked": + return EventTypeArg.accountLockOrUnlocked + case "emm_error": + return EventTypeArg.emmError + case "guest_admin_signed_in_via_trusted_teams": + return EventTypeArg.guestAdminSignedInViaTrustedTeams + case "guest_admin_signed_out_via_trusted_teams": + return EventTypeArg.guestAdminSignedOutViaTrustedTeams + case "login_fail": + return EventTypeArg.loginFail + case "login_success": + return EventTypeArg.loginSuccess + case "logout": + return EventTypeArg.logout + case "reseller_support_session_end": + return EventTypeArg.resellerSupportSessionEnd + case "reseller_support_session_start": + return EventTypeArg.resellerSupportSessionStart + case "sign_in_as_session_end": + return EventTypeArg.signInAsSessionEnd + case "sign_in_as_session_start": + return EventTypeArg.signInAsSessionStart + case "sso_error": + return EventTypeArg.ssoError + case "backup_admin_invitation_sent": + return EventTypeArg.backupAdminInvitationSent + case "backup_invitation_opened": + return EventTypeArg.backupInvitationOpened + case "create_team_invite_link": + return EventTypeArg.createTeamInviteLink + case "delete_team_invite_link": + return EventTypeArg.deleteTeamInviteLink + case "member_add_external_id": + return EventTypeArg.memberAddExternalId + case "member_add_name": + return EventTypeArg.memberAddName + case "member_change_admin_role": + return EventTypeArg.memberChangeAdminRole + case "member_change_email": + return EventTypeArg.memberChangeEmail + case "member_change_external_id": + return EventTypeArg.memberChangeExternalId + case "member_change_membership_type": + return EventTypeArg.memberChangeMembershipType + case "member_change_name": + return EventTypeArg.memberChangeName + case "member_change_reseller_role": + return EventTypeArg.memberChangeResellerRole + case "member_change_status": + return EventTypeArg.memberChangeStatus + case "member_delete_manual_contacts": + return EventTypeArg.memberDeleteManualContacts + case "member_delete_profile_photo": + return EventTypeArg.memberDeleteProfilePhoto + case "member_permanently_delete_account_contents": + return EventTypeArg.memberPermanentlyDeleteAccountContents + case "member_remove_external_id": + return EventTypeArg.memberRemoveExternalId + case "member_set_profile_photo": + return EventTypeArg.memberSetProfilePhoto + case "member_space_limits_add_custom_quota": + return EventTypeArg.memberSpaceLimitsAddCustomQuota + case "member_space_limits_change_custom_quota": + return EventTypeArg.memberSpaceLimitsChangeCustomQuota + case "member_space_limits_change_status": + return EventTypeArg.memberSpaceLimitsChangeStatus + case "member_space_limits_remove_custom_quota": + return EventTypeArg.memberSpaceLimitsRemoveCustomQuota + case "member_suggest": + return EventTypeArg.memberSuggest + case "member_transfer_account_contents": + return EventTypeArg.memberTransferAccountContents + case "pending_secondary_email_added": + return EventTypeArg.pendingSecondaryEmailAdded + case "secondary_email_deleted": + return EventTypeArg.secondaryEmailDeleted + case "secondary_email_verified": + return EventTypeArg.secondaryEmailVerified + case "secondary_mails_policy_changed": + return EventTypeArg.secondaryMailsPolicyChanged + case "binder_add_page": + return EventTypeArg.binderAddPage + case "binder_add_section": + return EventTypeArg.binderAddSection + case "binder_remove_page": + return EventTypeArg.binderRemovePage + case "binder_remove_section": + return EventTypeArg.binderRemoveSection + case "binder_rename_page": + return EventTypeArg.binderRenamePage + case "binder_rename_section": + return EventTypeArg.binderRenameSection + case "binder_reorder_page": + return EventTypeArg.binderReorderPage + case "binder_reorder_section": + return EventTypeArg.binderReorderSection + case "paper_content_add_member": + return EventTypeArg.paperContentAddMember + case "paper_content_add_to_folder": + return EventTypeArg.paperContentAddToFolder + case "paper_content_archive": + return EventTypeArg.paperContentArchive + case "paper_content_create": + return EventTypeArg.paperContentCreate + case "paper_content_permanently_delete": + return EventTypeArg.paperContentPermanentlyDelete + case "paper_content_remove_from_folder": + return EventTypeArg.paperContentRemoveFromFolder + case "paper_content_remove_member": + return EventTypeArg.paperContentRemoveMember + case "paper_content_rename": + return EventTypeArg.paperContentRename + case "paper_content_restore": + return EventTypeArg.paperContentRestore + case "paper_doc_add_comment": + return EventTypeArg.paperDocAddComment + case "paper_doc_change_member_role": + return EventTypeArg.paperDocChangeMemberRole + case "paper_doc_change_sharing_policy": + return EventTypeArg.paperDocChangeSharingPolicy + case "paper_doc_change_subscription": + return EventTypeArg.paperDocChangeSubscription + case "paper_doc_deleted": + return EventTypeArg.paperDocDeleted + case "paper_doc_delete_comment": + return EventTypeArg.paperDocDeleteComment + case "paper_doc_download": + return EventTypeArg.paperDocDownload + case "paper_doc_edit": + return EventTypeArg.paperDocEdit + case "paper_doc_edit_comment": + return EventTypeArg.paperDocEditComment + case "paper_doc_followed": + return EventTypeArg.paperDocFollowed + case "paper_doc_mention": + return EventTypeArg.paperDocMention + case "paper_doc_ownership_changed": + return EventTypeArg.paperDocOwnershipChanged + case "paper_doc_request_access": + return EventTypeArg.paperDocRequestAccess + case "paper_doc_resolve_comment": + return EventTypeArg.paperDocResolveComment + case "paper_doc_revert": + return EventTypeArg.paperDocRevert + case "paper_doc_slack_share": + return EventTypeArg.paperDocSlackShare + case "paper_doc_team_invite": + return EventTypeArg.paperDocTeamInvite + case "paper_doc_trashed": + return EventTypeArg.paperDocTrashed + case "paper_doc_unresolve_comment": + return EventTypeArg.paperDocUnresolveComment + case "paper_doc_untrashed": + return EventTypeArg.paperDocUntrashed + case "paper_doc_view": + return EventTypeArg.paperDocView + case "paper_external_view_allow": + return EventTypeArg.paperExternalViewAllow + case "paper_external_view_default_team": + return EventTypeArg.paperExternalViewDefaultTeam + case "paper_external_view_forbid": + return EventTypeArg.paperExternalViewForbid + case "paper_folder_change_subscription": + return EventTypeArg.paperFolderChangeSubscription + case "paper_folder_deleted": + return EventTypeArg.paperFolderDeleted + case "paper_folder_followed": + return EventTypeArg.paperFolderFollowed + case "paper_folder_team_invite": + return EventTypeArg.paperFolderTeamInvite + case "paper_published_link_change_permission": + return EventTypeArg.paperPublishedLinkChangePermission + case "paper_published_link_create": + return EventTypeArg.paperPublishedLinkCreate + case "paper_published_link_disabled": + return EventTypeArg.paperPublishedLinkDisabled + case "paper_published_link_view": + return EventTypeArg.paperPublishedLinkView + case "password_change": + return EventTypeArg.passwordChange + case "password_reset": + return EventTypeArg.passwordReset + case "password_reset_all": + return EventTypeArg.passwordResetAll + case "classification_create_report": + return EventTypeArg.classificationCreateReport + case "classification_create_report_fail": + return EventTypeArg.classificationCreateReportFail + case "emm_create_exceptions_report": + return EventTypeArg.emmCreateExceptionsReport + case "emm_create_usage_report": + return EventTypeArg.emmCreateUsageReport + case "export_members_report": + return EventTypeArg.exportMembersReport + case "export_members_report_fail": + return EventTypeArg.exportMembersReportFail + case "external_sharing_create_report": + return EventTypeArg.externalSharingCreateReport + case "external_sharing_report_failed": + return EventTypeArg.externalSharingReportFailed + case "no_expiration_link_gen_create_report": + return EventTypeArg.noExpirationLinkGenCreateReport + case "no_expiration_link_gen_report_failed": + return EventTypeArg.noExpirationLinkGenReportFailed + case "no_password_link_gen_create_report": + return EventTypeArg.noPasswordLinkGenCreateReport + case "no_password_link_gen_report_failed": + return EventTypeArg.noPasswordLinkGenReportFailed + case "no_password_link_view_create_report": + return EventTypeArg.noPasswordLinkViewCreateReport + case "no_password_link_view_report_failed": + return EventTypeArg.noPasswordLinkViewReportFailed + case "outdated_link_view_create_report": + return EventTypeArg.outdatedLinkViewCreateReport + case "outdated_link_view_report_failed": + return EventTypeArg.outdatedLinkViewReportFailed + case "paper_admin_export_start": + return EventTypeArg.paperAdminExportStart + case "ransomware_alert_create_report": + return EventTypeArg.ransomwareAlertCreateReport + case "ransomware_alert_create_report_failed": + return EventTypeArg.ransomwareAlertCreateReportFailed + case "smart_sync_create_admin_privilege_report": + return EventTypeArg.smartSyncCreateAdminPrivilegeReport + case "team_activity_create_report": + return EventTypeArg.teamActivityCreateReport + case "team_activity_create_report_fail": + return EventTypeArg.teamActivityCreateReportFail + case "collection_share": + return EventTypeArg.collectionShare + case "file_transfers_file_add": + return EventTypeArg.fileTransfersFileAdd + case "file_transfers_transfer_delete": + return EventTypeArg.fileTransfersTransferDelete + case "file_transfers_transfer_download": + return EventTypeArg.fileTransfersTransferDownload + case "file_transfers_transfer_send": + return EventTypeArg.fileTransfersTransferSend + case "file_transfers_transfer_view": + return EventTypeArg.fileTransfersTransferView + case "note_acl_invite_only": + return EventTypeArg.noteAclInviteOnly + case "note_acl_link": + return EventTypeArg.noteAclLink + case "note_acl_team_link": + return EventTypeArg.noteAclTeamLink + case "note_shared": + return EventTypeArg.noteShared + case "note_share_receive": + return EventTypeArg.noteShareReceive + case "open_note_shared": + return EventTypeArg.openNoteShared + case "replay_file_shared_link_created": + return EventTypeArg.replayFileSharedLinkCreated + case "replay_file_shared_link_modified": + return EventTypeArg.replayFileSharedLinkModified + case "replay_project_team_add": + return EventTypeArg.replayProjectTeamAdd + case "replay_project_team_delete": + return EventTypeArg.replayProjectTeamDelete + case "sf_add_group": + return EventTypeArg.sfAddGroup + case "sf_allow_non_members_to_view_shared_links": + return EventTypeArg.sfAllowNonMembersToViewSharedLinks + case "sf_external_invite_warn": + return EventTypeArg.sfExternalInviteWarn + case "sf_fb_invite": + return EventTypeArg.sfFbInvite + case "sf_fb_invite_change_role": + return EventTypeArg.sfFbInviteChangeRole + case "sf_fb_uninvite": + return EventTypeArg.sfFbUninvite + case "sf_invite_group": + return EventTypeArg.sfInviteGroup + case "sf_team_grant_access": + return EventTypeArg.sfTeamGrantAccess + case "sf_team_invite": + return EventTypeArg.sfTeamInvite + case "sf_team_invite_change_role": + return EventTypeArg.sfTeamInviteChangeRole + case "sf_team_join": + return EventTypeArg.sfTeamJoin + case "sf_team_join_from_oob_link": + return EventTypeArg.sfTeamJoinFromOobLink + case "sf_team_uninvite": + return EventTypeArg.sfTeamUninvite + case "shared_content_add_invitees": + return EventTypeArg.sharedContentAddInvitees + case "shared_content_add_link_expiry": + return EventTypeArg.sharedContentAddLinkExpiry + case "shared_content_add_link_password": + return EventTypeArg.sharedContentAddLinkPassword + case "shared_content_add_member": + return EventTypeArg.sharedContentAddMember + case "shared_content_change_downloads_policy": + return EventTypeArg.sharedContentChangeDownloadsPolicy + case "shared_content_change_invitee_role": + return EventTypeArg.sharedContentChangeInviteeRole + case "shared_content_change_link_audience": + return EventTypeArg.sharedContentChangeLinkAudience + case "shared_content_change_link_expiry": + return EventTypeArg.sharedContentChangeLinkExpiry + case "shared_content_change_link_password": + return EventTypeArg.sharedContentChangeLinkPassword + case "shared_content_change_member_role": + return EventTypeArg.sharedContentChangeMemberRole + case "shared_content_change_viewer_info_policy": + return EventTypeArg.sharedContentChangeViewerInfoPolicy + case "shared_content_claim_invitation": + return EventTypeArg.sharedContentClaimInvitation + case "shared_content_copy": + return EventTypeArg.sharedContentCopy + case "shared_content_download": + return EventTypeArg.sharedContentDownload + case "shared_content_relinquish_membership": + return EventTypeArg.sharedContentRelinquishMembership + case "shared_content_remove_invitees": + return EventTypeArg.sharedContentRemoveInvitees + case "shared_content_remove_link_expiry": + return EventTypeArg.sharedContentRemoveLinkExpiry + case "shared_content_remove_link_password": + return EventTypeArg.sharedContentRemoveLinkPassword + case "shared_content_remove_member": + return EventTypeArg.sharedContentRemoveMember + case "shared_content_request_access": + return EventTypeArg.sharedContentRequestAccess + case "shared_content_restore_invitees": + return EventTypeArg.sharedContentRestoreInvitees + case "shared_content_restore_member": + return EventTypeArg.sharedContentRestoreMember + case "shared_content_unshare": + return EventTypeArg.sharedContentUnshare + case "shared_content_view": + return EventTypeArg.sharedContentView + case "shared_folder_change_link_policy": + return EventTypeArg.sharedFolderChangeLinkPolicy + case "shared_folder_change_members_inheritance_policy": + return EventTypeArg.sharedFolderChangeMembersInheritancePolicy + case "shared_folder_change_members_management_policy": + return EventTypeArg.sharedFolderChangeMembersManagementPolicy + case "shared_folder_change_members_policy": + return EventTypeArg.sharedFolderChangeMembersPolicy + case "shared_folder_create": + return EventTypeArg.sharedFolderCreate + case "shared_folder_decline_invitation": + return EventTypeArg.sharedFolderDeclineInvitation + case "shared_folder_mount": + return EventTypeArg.sharedFolderMount + case "shared_folder_nest": + return EventTypeArg.sharedFolderNest + case "shared_folder_transfer_ownership": + return EventTypeArg.sharedFolderTransferOwnership + case "shared_folder_unmount": + return EventTypeArg.sharedFolderUnmount + case "shared_link_add_expiry": + return EventTypeArg.sharedLinkAddExpiry + case "shared_link_change_expiry": + return EventTypeArg.sharedLinkChangeExpiry + case "shared_link_change_visibility": + return EventTypeArg.sharedLinkChangeVisibility + case "shared_link_copy": + return EventTypeArg.sharedLinkCopy + case "shared_link_create": + return EventTypeArg.sharedLinkCreate + case "shared_link_disable": + return EventTypeArg.sharedLinkDisable + case "shared_link_download": + return EventTypeArg.sharedLinkDownload + case "shared_link_remove_expiry": + return EventTypeArg.sharedLinkRemoveExpiry + case "shared_link_settings_add_expiration": + return EventTypeArg.sharedLinkSettingsAddExpiration + case "shared_link_settings_add_password": + return EventTypeArg.sharedLinkSettingsAddPassword + case "shared_link_settings_allow_download_disabled": + return EventTypeArg.sharedLinkSettingsAllowDownloadDisabled + case "shared_link_settings_allow_download_enabled": + return EventTypeArg.sharedLinkSettingsAllowDownloadEnabled + case "shared_link_settings_change_audience": + return EventTypeArg.sharedLinkSettingsChangeAudience + case "shared_link_settings_change_expiration": + return EventTypeArg.sharedLinkSettingsChangeExpiration + case "shared_link_settings_change_password": + return EventTypeArg.sharedLinkSettingsChangePassword + case "shared_link_settings_remove_expiration": + return EventTypeArg.sharedLinkSettingsRemoveExpiration + case "shared_link_settings_remove_password": + return EventTypeArg.sharedLinkSettingsRemovePassword + case "shared_link_share": + return EventTypeArg.sharedLinkShare + case "shared_link_view": + return EventTypeArg.sharedLinkView + case "shared_note_opened": + return EventTypeArg.sharedNoteOpened + case "shmodel_disable_downloads": + return EventTypeArg.shmodelDisableDownloads + case "shmodel_enable_downloads": + return EventTypeArg.shmodelEnableDownloads + case "shmodel_group_share": + return EventTypeArg.shmodelGroupShare + case "showcase_access_granted": + return EventTypeArg.showcaseAccessGranted + case "showcase_add_member": + return EventTypeArg.showcaseAddMember + case "showcase_archived": + return EventTypeArg.showcaseArchived + case "showcase_created": + return EventTypeArg.showcaseCreated + case "showcase_delete_comment": + return EventTypeArg.showcaseDeleteComment + case "showcase_edited": + return EventTypeArg.showcaseEdited + case "showcase_edit_comment": + return EventTypeArg.showcaseEditComment + case "showcase_file_added": + return EventTypeArg.showcaseFileAdded + case "showcase_file_download": + return EventTypeArg.showcaseFileDownload + case "showcase_file_removed": + return EventTypeArg.showcaseFileRemoved + case "showcase_file_view": + return EventTypeArg.showcaseFileView + case "showcase_permanently_deleted": + return EventTypeArg.showcasePermanentlyDeleted + case "showcase_post_comment": + return EventTypeArg.showcasePostComment + case "showcase_remove_member": + return EventTypeArg.showcaseRemoveMember + case "showcase_renamed": + return EventTypeArg.showcaseRenamed + case "showcase_request_access": + return EventTypeArg.showcaseRequestAccess + case "showcase_resolve_comment": + return EventTypeArg.showcaseResolveComment + case "showcase_restored": + return EventTypeArg.showcaseRestored + case "showcase_trashed": + return EventTypeArg.showcaseTrashed + case "showcase_trashed_deprecated": + return EventTypeArg.showcaseTrashedDeprecated + case "showcase_unresolve_comment": + return EventTypeArg.showcaseUnresolveComment + case "showcase_untrashed": + return EventTypeArg.showcaseUntrashed + case "showcase_untrashed_deprecated": + return EventTypeArg.showcaseUntrashedDeprecated + case "showcase_view": + return EventTypeArg.showcaseView + case "sso_add_cert": + return EventTypeArg.ssoAddCert + case "sso_add_login_url": + return EventTypeArg.ssoAddLoginUrl + case "sso_add_logout_url": + return EventTypeArg.ssoAddLogoutUrl + case "sso_change_cert": + return EventTypeArg.ssoChangeCert + case "sso_change_login_url": + return EventTypeArg.ssoChangeLoginUrl + case "sso_change_logout_url": + return EventTypeArg.ssoChangeLogoutUrl + case "sso_change_saml_identity_mode": + return EventTypeArg.ssoChangeSamlIdentityMode + case "sso_remove_cert": + return EventTypeArg.ssoRemoveCert + case "sso_remove_login_url": + return EventTypeArg.ssoRemoveLoginUrl + case "sso_remove_logout_url": + return EventTypeArg.ssoRemoveLogoutUrl + case "team_folder_change_status": + return EventTypeArg.teamFolderChangeStatus + case "team_folder_create": + return EventTypeArg.teamFolderCreate + case "team_folder_downgrade": + return EventTypeArg.teamFolderDowngrade + case "team_folder_permanently_delete": + return EventTypeArg.teamFolderPermanentlyDelete + case "team_folder_rename": + return EventTypeArg.teamFolderRename + case "team_selective_sync_settings_changed": + return EventTypeArg.teamSelectiveSyncSettingsChanged + case "account_capture_change_policy": + return EventTypeArg.accountCaptureChangePolicy + case "admin_email_reminders_changed": + return EventTypeArg.adminEmailRemindersChanged + case "allow_download_disabled": + return EventTypeArg.allowDownloadDisabled + case "allow_download_enabled": + return EventTypeArg.allowDownloadEnabled + case "app_permissions_changed": + return EventTypeArg.appPermissionsChanged + case "camera_uploads_policy_changed": + return EventTypeArg.cameraUploadsPolicyChanged + case "capture_transcript_policy_changed": + return EventTypeArg.captureTranscriptPolicyChanged + case "classification_change_policy": + return EventTypeArg.classificationChangePolicy + case "computer_backup_policy_changed": + return EventTypeArg.computerBackupPolicyChanged + case "content_administration_policy_changed": + return EventTypeArg.contentAdministrationPolicyChanged + case "data_placement_restriction_change_policy": + return EventTypeArg.dataPlacementRestrictionChangePolicy + case "data_placement_restriction_satisfy_policy": + return EventTypeArg.dataPlacementRestrictionSatisfyPolicy + case "device_approvals_add_exception": + return EventTypeArg.deviceApprovalsAddException + case "device_approvals_change_desktop_policy": + return EventTypeArg.deviceApprovalsChangeDesktopPolicy + case "device_approvals_change_mobile_policy": + return EventTypeArg.deviceApprovalsChangeMobilePolicy + case "device_approvals_change_overage_action": + return EventTypeArg.deviceApprovalsChangeOverageAction + case "device_approvals_change_unlink_action": + return EventTypeArg.deviceApprovalsChangeUnlinkAction + case "device_approvals_remove_exception": + return EventTypeArg.deviceApprovalsRemoveException + case "directory_restrictions_add_members": + return EventTypeArg.directoryRestrictionsAddMembers + case "directory_restrictions_remove_members": + return EventTypeArg.directoryRestrictionsRemoveMembers + case "dropbox_passwords_policy_changed": + return EventTypeArg.dropboxPasswordsPolicyChanged + case "email_ingest_policy_changed": + return EventTypeArg.emailIngestPolicyChanged + case "emm_add_exception": + return EventTypeArg.emmAddException + case "emm_change_policy": + return EventTypeArg.emmChangePolicy + case "emm_remove_exception": + return EventTypeArg.emmRemoveException + case "extended_version_history_change_policy": + return EventTypeArg.extendedVersionHistoryChangePolicy + case "external_drive_backup_policy_changed": + return EventTypeArg.externalDriveBackupPolicyChanged + case "file_comments_change_policy": + return EventTypeArg.fileCommentsChangePolicy + case "file_locking_policy_changed": + return EventTypeArg.fileLockingPolicyChanged + case "file_provider_migration_policy_changed": + return EventTypeArg.fileProviderMigrationPolicyChanged + case "file_requests_change_policy": + return EventTypeArg.fileRequestsChangePolicy + case "file_requests_emails_enabled": + return EventTypeArg.fileRequestsEmailsEnabled + case "file_requests_emails_restricted_to_team_only": + return EventTypeArg.fileRequestsEmailsRestrictedToTeamOnly + case "file_transfers_policy_changed": + return EventTypeArg.fileTransfersPolicyChanged + case "folder_link_restriction_policy_changed": + return EventTypeArg.folderLinkRestrictionPolicyChanged + case "google_sso_change_policy": + return EventTypeArg.googleSsoChangePolicy + case "group_user_management_change_policy": + return EventTypeArg.groupUserManagementChangePolicy + case "integration_policy_changed": + return EventTypeArg.integrationPolicyChanged + case "invite_acceptance_email_policy_changed": + return EventTypeArg.inviteAcceptanceEmailPolicyChanged + case "member_requests_change_policy": + return EventTypeArg.memberRequestsChangePolicy + case "member_send_invite_policy_changed": + return EventTypeArg.memberSendInvitePolicyChanged + case "member_space_limits_add_exception": + return EventTypeArg.memberSpaceLimitsAddException + case "member_space_limits_change_caps_type_policy": + return EventTypeArg.memberSpaceLimitsChangeCapsTypePolicy + case "member_space_limits_change_policy": + return EventTypeArg.memberSpaceLimitsChangePolicy + case "member_space_limits_remove_exception": + return EventTypeArg.memberSpaceLimitsRemoveException + case "member_suggestions_change_policy": + return EventTypeArg.memberSuggestionsChangePolicy + case "microsoft_office_addin_change_policy": + return EventTypeArg.microsoftOfficeAddinChangePolicy + case "network_control_change_policy": + return EventTypeArg.networkControlChangePolicy + case "paper_change_deployment_policy": + return EventTypeArg.paperChangeDeploymentPolicy + case "paper_change_member_link_policy": + return EventTypeArg.paperChangeMemberLinkPolicy + case "paper_change_member_policy": + return EventTypeArg.paperChangeMemberPolicy + case "paper_change_policy": + return EventTypeArg.paperChangePolicy + case "paper_default_folder_policy_changed": + return EventTypeArg.paperDefaultFolderPolicyChanged + case "paper_desktop_policy_changed": + return EventTypeArg.paperDesktopPolicyChanged + case "paper_enabled_users_group_addition": + return EventTypeArg.paperEnabledUsersGroupAddition + case "paper_enabled_users_group_removal": + return EventTypeArg.paperEnabledUsersGroupRemoval + case "password_strength_requirements_change_policy": + return EventTypeArg.passwordStrengthRequirementsChangePolicy + case "permanent_delete_change_policy": + return EventTypeArg.permanentDeleteChangePolicy + case "reseller_support_change_policy": + return EventTypeArg.resellerSupportChangePolicy + case "rewind_policy_changed": + return EventTypeArg.rewindPolicyChanged + case "send_for_signature_policy_changed": + return EventTypeArg.sendForSignaturePolicyChanged + case "sharing_change_folder_join_policy": + return EventTypeArg.sharingChangeFolderJoinPolicy + case "sharing_change_link_allow_change_expiration_policy": + return EventTypeArg.sharingChangeLinkAllowChangeExpirationPolicy + case "sharing_change_link_default_expiration_policy": + return EventTypeArg.sharingChangeLinkDefaultExpirationPolicy + case "sharing_change_link_enforce_password_policy": + return EventTypeArg.sharingChangeLinkEnforcePasswordPolicy + case "sharing_change_link_policy": + return EventTypeArg.sharingChangeLinkPolicy + case "sharing_change_member_policy": + return EventTypeArg.sharingChangeMemberPolicy + case "showcase_change_download_policy": + return EventTypeArg.showcaseChangeDownloadPolicy + case "showcase_change_enabled_policy": + return EventTypeArg.showcaseChangeEnabledPolicy + case "showcase_change_external_sharing_policy": + return EventTypeArg.showcaseChangeExternalSharingPolicy + case "smarter_smart_sync_policy_changed": + return EventTypeArg.smarterSmartSyncPolicyChanged + case "smart_sync_change_policy": + return EventTypeArg.smartSyncChangePolicy + case "smart_sync_not_opt_out": + return EventTypeArg.smartSyncNotOptOut + case "smart_sync_opt_out": + return EventTypeArg.smartSyncOptOut + case "sso_change_policy": + return EventTypeArg.ssoChangePolicy + case "team_branding_policy_changed": + return EventTypeArg.teamBrandingPolicyChanged + case "team_extensions_policy_changed": + return EventTypeArg.teamExtensionsPolicyChanged + case "team_selective_sync_policy_changed": + return EventTypeArg.teamSelectiveSyncPolicyChanged + case "team_sharing_whitelist_subjects_changed": + return EventTypeArg.teamSharingWhitelistSubjectsChanged + case "tfa_add_exception": + return EventTypeArg.tfaAddException + case "tfa_change_policy": + return EventTypeArg.tfaChangePolicy + case "tfa_remove_exception": + return EventTypeArg.tfaRemoveException + case "two_account_change_policy": + return EventTypeArg.twoAccountChangePolicy + case "viewer_info_policy_changed": + return EventTypeArg.viewerInfoPolicyChanged + case "watermarking_policy_changed": + return EventTypeArg.watermarkingPolicyChanged + case "web_sessions_change_active_session_limit": + return EventTypeArg.webSessionsChangeActiveSessionLimit + case "web_sessions_change_fixed_length_policy": + return EventTypeArg.webSessionsChangeFixedLengthPolicy + case "web_sessions_change_idle_length_policy": + return EventTypeArg.webSessionsChangeIdleLengthPolicy + case "data_residency_migration_request_successful": + return EventTypeArg.dataResidencyMigrationRequestSuccessful + case "data_residency_migration_request_unsuccessful": + return EventTypeArg.dataResidencyMigrationRequestUnsuccessful + case "team_merge_from": + return EventTypeArg.teamMergeFrom + case "team_merge_to": + return EventTypeArg.teamMergeTo + case "team_profile_add_background": + return EventTypeArg.teamProfileAddBackground + case "team_profile_add_logo": + return EventTypeArg.teamProfileAddLogo + case "team_profile_change_background": + return EventTypeArg.teamProfileChangeBackground + case "team_profile_change_default_language": + return EventTypeArg.teamProfileChangeDefaultLanguage + case "team_profile_change_logo": + return EventTypeArg.teamProfileChangeLogo + case "team_profile_change_name": + return EventTypeArg.teamProfileChangeName + case "team_profile_remove_background": + return EventTypeArg.teamProfileRemoveBackground + case "team_profile_remove_logo": + return EventTypeArg.teamProfileRemoveLogo + case "tfa_add_backup_phone": + return EventTypeArg.tfaAddBackupPhone + case "tfa_add_security_key": + return EventTypeArg.tfaAddSecurityKey + case "tfa_change_backup_phone": + return EventTypeArg.tfaChangeBackupPhone + case "tfa_change_status": + return EventTypeArg.tfaChangeStatus + case "tfa_remove_backup_phone": + return EventTypeArg.tfaRemoveBackupPhone + case "tfa_remove_security_key": + return EventTypeArg.tfaRemoveSecurityKey + case "tfa_reset": + return EventTypeArg.tfaReset + case "changed_enterprise_admin_role": + return EventTypeArg.changedEnterpriseAdminRole + case "changed_enterprise_connected_team_status": + return EventTypeArg.changedEnterpriseConnectedTeamStatus + case "ended_enterprise_admin_session": + return EventTypeArg.endedEnterpriseAdminSession + case "ended_enterprise_admin_session_deprecated": + return EventTypeArg.endedEnterpriseAdminSessionDeprecated + case "enterprise_settings_locking": + return EventTypeArg.enterpriseSettingsLocking + case "guest_admin_change_status": + return EventTypeArg.guestAdminChangeStatus + case "started_enterprise_admin_session": + return EventTypeArg.startedEnterpriseAdminSession + case "team_merge_request_accepted": + return EventTypeArg.teamMergeRequestAccepted + case "team_merge_request_accepted_shown_to_primary_team": + return EventTypeArg.teamMergeRequestAcceptedShownToPrimaryTeam + case "team_merge_request_accepted_shown_to_secondary_team": + return EventTypeArg.teamMergeRequestAcceptedShownToSecondaryTeam + case "team_merge_request_auto_canceled": + return EventTypeArg.teamMergeRequestAutoCanceled + case "team_merge_request_canceled": + return EventTypeArg.teamMergeRequestCanceled + case "team_merge_request_canceled_shown_to_primary_team": + return EventTypeArg.teamMergeRequestCanceledShownToPrimaryTeam + case "team_merge_request_canceled_shown_to_secondary_team": + return EventTypeArg.teamMergeRequestCanceledShownToSecondaryTeam + case "team_merge_request_expired": + return EventTypeArg.teamMergeRequestExpired + case "team_merge_request_expired_shown_to_primary_team": + return EventTypeArg.teamMergeRequestExpiredShownToPrimaryTeam + case "team_merge_request_expired_shown_to_secondary_team": + return EventTypeArg.teamMergeRequestExpiredShownToSecondaryTeam + case "team_merge_request_rejected_shown_to_primary_team": + return EventTypeArg.teamMergeRequestRejectedShownToPrimaryTeam + case "team_merge_request_rejected_shown_to_secondary_team": + return EventTypeArg.teamMergeRequestRejectedShownToSecondaryTeam + case "team_merge_request_reminder": + return EventTypeArg.teamMergeRequestReminder + case "team_merge_request_reminder_shown_to_primary_team": + return EventTypeArg.teamMergeRequestReminderShownToPrimaryTeam + case "team_merge_request_reminder_shown_to_secondary_team": + return EventTypeArg.teamMergeRequestReminderShownToSecondaryTeam + case "team_merge_request_revoked": + return EventTypeArg.teamMergeRequestRevoked + case "team_merge_request_sent_shown_to_primary_team": + return EventTypeArg.teamMergeRequestSentShownToPrimaryTeam + case "team_merge_request_sent_shown_to_secondary_team": + return EventTypeArg.teamMergeRequestSentShownToSecondaryTeam + case "other": + return EventTypeArg.other + default: + return EventTypeArg.other + } + default: + throw JSONSerializerError.deserializeError(type: EventTypeArg.self, json: json) } } } /// Created member data report. - open class ExportMembersReportDetails: CustomStringConvertible { - public init() { + public class ExportMembersReportDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ExportMembersReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportMembersReportDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportMembersReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportMembersReportDetails: \(error)" + } } } - open class ExportMembersReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportMembersReportDetails) -> JSON { + + public class ExportMembersReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportMembersReportDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportMembersReportDetails { + + public func deserialize(_ json: JSON) throws -> ExportMembersReportDetails { switch json { - case .dictionary(_): - return ExportMembersReportDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return ExportMembersReportDetails() + default: + throw JSONSerializerError.deserializeError(type: ExportMembersReportDetails.self, json: json) } } } /// Failed to create members data report. - open class ExportMembersReportFailDetails: CustomStringConvertible { + public class ExportMembersReportFailDetails: CustomStringConvertible, JSONRepresentable { /// Failure reason. public let failureReason: Team.TeamReportFailureReason public init(failureReason: Team.TeamReportFailureReason) { self.failureReason = failureReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportMembersReportFailDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExportMembersReportFailDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportMembersReportFailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportMembersReportFailDetails: \(error)" + } } } - open class ExportMembersReportFailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportMembersReportFailDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), + + public class ExportMembersReportFailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportMembersReportFailDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportMembersReportFailDetails { + + public func deserialize(_ json: JSON) throws -> ExportMembersReportFailDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return ExportMembersReportFailDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return ExportMembersReportFailDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: ExportMembersReportFailDetails.self, json: json) } } } /// The ExportMembersReportFailType struct - open class ExportMembersReportFailType: CustomStringConvertible { + public class ExportMembersReportFailType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportMembersReportFailTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExportMembersReportFailTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportMembersReportFailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportMembersReportFailType: \(error)" + } } } - open class ExportMembersReportFailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportMembersReportFailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExportMembersReportFailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportMembersReportFailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportMembersReportFailType { + + public func deserialize(_ json: JSON) throws -> ExportMembersReportFailType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExportMembersReportFailType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExportMembersReportFailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExportMembersReportFailType.self, json: json) } } } /// The ExportMembersReportType struct - open class ExportMembersReportType: CustomStringConvertible { + public class ExportMembersReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExportMembersReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExportMembersReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExportMembersReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExportMembersReportType: \(error)" + } } } - open class ExportMembersReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExportMembersReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExportMembersReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExportMembersReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExportMembersReportType { + + public func deserialize(_ json: JSON) throws -> ExportMembersReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExportMembersReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExportMembersReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExportMembersReportType.self, json: json) } } } /// Accepted/opted out of extended version history. - open class ExtendedVersionHistoryChangePolicyDetails: CustomStringConvertible { + public class ExtendedVersionHistoryChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New extended version history policy. public let newValue: TeamLog.ExtendedVersionHistoryPolicy /// Previous extended version history policy. Might be missing due to historical data gap. @@ -21583,64 +24785,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExtendedVersionHistoryChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExtendedVersionHistoryChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExtendedVersionHistoryChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExtendedVersionHistoryChangePolicyDetails: \(error)" + } } } - open class ExtendedVersionHistoryChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExtendedVersionHistoryChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.ExtendedVersionHistoryPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.ExtendedVersionHistoryPolicySerializer()).serialize(value.previousValue), + + public class ExtendedVersionHistoryChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExtendedVersionHistoryChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ExtendedVersionHistoryPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.ExtendedVersionHistoryPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExtendedVersionHistoryChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> ExtendedVersionHistoryChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ExtendedVersionHistoryPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.ExtendedVersionHistoryPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return ExtendedVersionHistoryChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ExtendedVersionHistoryPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.ExtendedVersionHistoryPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return ExtendedVersionHistoryChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ExtendedVersionHistoryChangePolicyDetails.self, json: json) } } } /// The ExtendedVersionHistoryChangePolicyType struct - open class ExtendedVersionHistoryChangePolicyType: CustomStringConvertible { + public class ExtendedVersionHistoryChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExtendedVersionHistoryChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExtendedVersionHistoryChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExtendedVersionHistoryChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExtendedVersionHistoryChangePolicyType: \(error)" + } } } - open class ExtendedVersionHistoryChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExtendedVersionHistoryChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExtendedVersionHistoryChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExtendedVersionHistoryChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExtendedVersionHistoryChangePolicyType { + + public func deserialize(_ json: JSON) throws -> ExtendedVersionHistoryChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExtendedVersionHistoryChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExtendedVersionHistoryChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExtendedVersionHistoryChangePolicyType.self, json: json) } } } /// The ExtendedVersionHistoryPolicy union - public enum ExtendedVersionHistoryPolicy: CustomStringConvertible { + public enum ExtendedVersionHistoryPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case explicitlyLimited /// An unspecified error. @@ -21652,62 +24876,72 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ExtendedVersionHistoryPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExtendedVersionHistoryPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExtendedVersionHistoryPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExtendedVersionHistoryPolicy: \(error)" + } } } - open class ExtendedVersionHistoryPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExtendedVersionHistoryPolicy) -> JSON { + + public class ExtendedVersionHistoryPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExtendedVersionHistoryPolicy) throws -> JSON { switch value { - case .explicitlyLimited: - var d = [String: JSON]() - d[".tag"] = .str("explicitly_limited") - return .dictionary(d) - case .explicitlyUnlimited: - var d = [String: JSON]() - d[".tag"] = .str("explicitly_unlimited") - return .dictionary(d) - case .implicitlyLimited: - var d = [String: JSON]() - d[".tag"] = .str("implicitly_limited") - return .dictionary(d) - case .implicitlyUnlimited: - var d = [String: JSON]() - d[".tag"] = .str("implicitly_unlimited") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExtendedVersionHistoryPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "explicitly_limited": - return ExtendedVersionHistoryPolicy.explicitlyLimited - case "explicitly_unlimited": - return ExtendedVersionHistoryPolicy.explicitlyUnlimited - case "implicitly_limited": - return ExtendedVersionHistoryPolicy.implicitlyLimited - case "implicitly_unlimited": - return ExtendedVersionHistoryPolicy.implicitlyUnlimited - case "other": - return ExtendedVersionHistoryPolicy.other - default: - return ExtendedVersionHistoryPolicy.other - } - default: - fatalError("Failed to deserialize") + case .explicitlyLimited: + var d = [String: JSON]() + d[".tag"] = .str("explicitly_limited") + return .dictionary(d) + case .explicitlyUnlimited: + var d = [String: JSON]() + d[".tag"] = .str("explicitly_unlimited") + return .dictionary(d) + case .implicitlyLimited: + var d = [String: JSON]() + d[".tag"] = .str("implicitly_limited") + return .dictionary(d) + case .implicitlyUnlimited: + var d = [String: JSON]() + d[".tag"] = .str("implicitly_unlimited") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExtendedVersionHistoryPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "explicitly_limited": + return ExtendedVersionHistoryPolicy.explicitlyLimited + case "explicitly_unlimited": + return ExtendedVersionHistoryPolicy.explicitlyUnlimited + case "implicitly_limited": + return ExtendedVersionHistoryPolicy.implicitlyLimited + case "implicitly_unlimited": + return ExtendedVersionHistoryPolicy.implicitlyUnlimited + case "other": + return ExtendedVersionHistoryPolicy.other + default: + return ExtendedVersionHistoryPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ExtendedVersionHistoryPolicy.self, json: json) } } } /// External Drive Backup eligibility status - public enum ExternalDriveBackupEligibilityStatus: CustomStringConvertible { + public enum ExternalDriveBackupEligibilityStatus: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case exceedLicenseCap /// An unspecified error. @@ -21715,122 +24949,162 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ExternalDriveBackupEligibilityStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupEligibilityStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupEligibilityStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupEligibilityStatus: \(error)" + } } } - open class ExternalDriveBackupEligibilityStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupEligibilityStatus) -> JSON { + + public class ExternalDriveBackupEligibilityStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupEligibilityStatus) throws -> JSON { switch value { - case .exceedLicenseCap: - var d = [String: JSON]() - d[".tag"] = .str("exceed_license_cap") - return .dictionary(d) - case .success: - var d = [String: JSON]() - d[".tag"] = .str("success") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExternalDriveBackupEligibilityStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "exceed_license_cap": - return ExternalDriveBackupEligibilityStatus.exceedLicenseCap - case "success": - return ExternalDriveBackupEligibilityStatus.success - case "other": - return ExternalDriveBackupEligibilityStatus.other - default: - return ExternalDriveBackupEligibilityStatus.other - } + case .exceedLicenseCap: + var d = [String: JSON]() + d[".tag"] = .str("exceed_license_cap") + return .dictionary(d) + case .success: + var d = [String: JSON]() + d[".tag"] = .str("success") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupEligibilityStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "exceed_license_cap": + return ExternalDriveBackupEligibilityStatus.exceedLicenseCap + case "success": + return ExternalDriveBackupEligibilityStatus.success + case "other": + return ExternalDriveBackupEligibilityStatus.other default: - fatalError("Failed to deserialize") + return ExternalDriveBackupEligibilityStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupEligibilityStatus.self, json: json) } } } /// Checked external drive backup eligibility status. - open class ExternalDriveBackupEligibilityStatusCheckedDetails: CustomStringConvertible { + public class ExternalDriveBackupEligibilityStatusCheckedDetails: CustomStringConvertible, JSONRepresentable { /// Device's session logged information. public let desktopDeviceSessionInfo: TeamLog.DesktopDeviceSessionLogInfo /// Current eligibility status of external drive backup. public let status: TeamLog.ExternalDriveBackupEligibilityStatus /// Total number of valid external drive backup for all the team members. public let numberOfExternalDriveBackup: UInt64 - public init(desktopDeviceSessionInfo: TeamLog.DesktopDeviceSessionLogInfo, status: TeamLog.ExternalDriveBackupEligibilityStatus, numberOfExternalDriveBackup: UInt64) { + public init( + desktopDeviceSessionInfo: TeamLog.DesktopDeviceSessionLogInfo, + status: TeamLog.ExternalDriveBackupEligibilityStatus, + numberOfExternalDriveBackup: UInt64 + ) { self.desktopDeviceSessionInfo = desktopDeviceSessionInfo self.status = status comparableValidator()(numberOfExternalDriveBackup) self.numberOfExternalDriveBackup = numberOfExternalDriveBackup } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupEligibilityStatusCheckedDetails: \(error)" + } } } - open class ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupEligibilityStatusCheckedDetails) -> JSON { - let output = [ - "desktop_device_session_info": TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(value.desktopDeviceSessionInfo), - "status": TeamLog.ExternalDriveBackupEligibilityStatusSerializer().serialize(value.status), - "number_of_external_drive_backup": Serialization._UInt64Serializer.serialize(value.numberOfExternalDriveBackup), + + public class ExternalDriveBackupEligibilityStatusCheckedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupEligibilityStatusCheckedDetails) throws -> JSON { + let output = [ + "desktop_device_session_info": try TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(value.desktopDeviceSessionInfo), + "status": try TeamLog.ExternalDriveBackupEligibilityStatusSerializer().serialize(value.status), + "number_of_external_drive_backup": try Serialization._UInt64Serializer.serialize(value.numberOfExternalDriveBackup), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalDriveBackupEligibilityStatusCheckedDetails { + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupEligibilityStatusCheckedDetails { switch json { - case .dictionary(let dict): - let desktopDeviceSessionInfo = TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(dict["desktop_device_session_info"] ?? .null) - let status = TeamLog.ExternalDriveBackupEligibilityStatusSerializer().deserialize(dict["status"] ?? .null) - let numberOfExternalDriveBackup = Serialization._UInt64Serializer.deserialize(dict["number_of_external_drive_backup"] ?? .null) - return ExternalDriveBackupEligibilityStatusCheckedDetails(desktopDeviceSessionInfo: desktopDeviceSessionInfo, status: status, numberOfExternalDriveBackup: numberOfExternalDriveBackup) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let desktopDeviceSessionInfo = try TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(dict["desktop_device_session_info"] ?? .null) + let status = try TeamLog.ExternalDriveBackupEligibilityStatusSerializer().deserialize(dict["status"] ?? .null) + let numberOfExternalDriveBackup = try Serialization._UInt64Serializer.deserialize(dict["number_of_external_drive_backup"] ?? .null) + return ExternalDriveBackupEligibilityStatusCheckedDetails( + desktopDeviceSessionInfo: desktopDeviceSessionInfo, + status: status, + numberOfExternalDriveBackup: numberOfExternalDriveBackup + ) + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupEligibilityStatusCheckedDetails.self, json: json) } } } /// The ExternalDriveBackupEligibilityStatusCheckedType struct - open class ExternalDriveBackupEligibilityStatusCheckedType: CustomStringConvertible { + public class ExternalDriveBackupEligibilityStatusCheckedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupEligibilityStatusCheckedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalDriveBackupEligibilityStatusCheckedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupEligibilityStatusCheckedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupEligibilityStatusCheckedType: \(error)" + } } } - open class ExternalDriveBackupEligibilityStatusCheckedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupEligibilityStatusCheckedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExternalDriveBackupEligibilityStatusCheckedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupEligibilityStatusCheckedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalDriveBackupEligibilityStatusCheckedType { + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupEligibilityStatusCheckedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExternalDriveBackupEligibilityStatusCheckedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExternalDriveBackupEligibilityStatusCheckedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupEligibilityStatusCheckedType.self, json: json) } } } /// Policy for controlling team access to external drive backup feature - public enum ExternalDriveBackupPolicy: CustomStringConvertible { + public enum ExternalDriveBackupPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case default_ /// An unspecified error. @@ -21840,56 +25114,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ExternalDriveBackupPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupPolicy: \(error)" + } } } - open class ExternalDriveBackupPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupPolicy) -> JSON { + + public class ExternalDriveBackupPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupPolicy) throws -> JSON { switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExternalDriveBackupPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return ExternalDriveBackupPolicy.default_ - case "disabled": - return ExternalDriveBackupPolicy.disabled - case "enabled": - return ExternalDriveBackupPolicy.enabled - case "other": - return ExternalDriveBackupPolicy.other - default: - return ExternalDriveBackupPolicy.other - } - default: - fatalError("Failed to deserialize") + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return ExternalDriveBackupPolicy.default_ + case "disabled": + return ExternalDriveBackupPolicy.disabled + case "enabled": + return ExternalDriveBackupPolicy.enabled + case "other": + return ExternalDriveBackupPolicy.other + default: + return ExternalDriveBackupPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupPolicy.self, json: json) } } } /// Changed external drive backup policy for team. - open class ExternalDriveBackupPolicyChangedDetails: CustomStringConvertible { + public class ExternalDriveBackupPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New external drive backup policy. public let newValue: TeamLog.ExternalDriveBackupPolicy /// Previous external drive backup policy. @@ -21898,64 +25182,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalDriveBackupPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupPolicyChangedDetails: \(error)" + } } } - open class ExternalDriveBackupPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.ExternalDriveBackupPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.ExternalDriveBackupPolicySerializer().serialize(value.previousValue), + + public class ExternalDriveBackupPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ExternalDriveBackupPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.ExternalDriveBackupPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalDriveBackupPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ExternalDriveBackupPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.ExternalDriveBackupPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return ExternalDriveBackupPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ExternalDriveBackupPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.ExternalDriveBackupPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return ExternalDriveBackupPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupPolicyChangedDetails.self, json: json) } } } /// The ExternalDriveBackupPolicyChangedType struct - open class ExternalDriveBackupPolicyChangedType: CustomStringConvertible { + public class ExternalDriveBackupPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalDriveBackupPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupPolicyChangedType: \(error)" + } } } - open class ExternalDriveBackupPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExternalDriveBackupPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalDriveBackupPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExternalDriveBackupPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExternalDriveBackupPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupPolicyChangedType.self, json: json) } } } /// External Drive Backup status - public enum ExternalDriveBackupStatus: CustomStringConvertible { + public enum ExternalDriveBackupStatus: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case broken /// An unspecified error. @@ -21971,261 +25277,342 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ExternalDriveBackupStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupStatus: \(error)" + } } } - open class ExternalDriveBackupStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupStatus) -> JSON { + + public class ExternalDriveBackupStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupStatus) throws -> JSON { switch value { - case .broken: - var d = [String: JSON]() - d[".tag"] = .str("broken") - return .dictionary(d) - case .created: - var d = [String: JSON]() - d[".tag"] = .str("created") - return .dictionary(d) - case .createdOrBroken: - var d = [String: JSON]() - d[".tag"] = .str("created_or_broken") - return .dictionary(d) - case .deleted: - var d = [String: JSON]() - d[".tag"] = .str("deleted") - return .dictionary(d) - case .empty: - var d = [String: JSON]() - d[".tag"] = .str("empty") - return .dictionary(d) - case .unknown: - var d = [String: JSON]() - d[".tag"] = .str("unknown") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExternalDriveBackupStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "broken": - return ExternalDriveBackupStatus.broken - case "created": - return ExternalDriveBackupStatus.created - case "created_or_broken": - return ExternalDriveBackupStatus.createdOrBroken - case "deleted": - return ExternalDriveBackupStatus.deleted - case "empty": - return ExternalDriveBackupStatus.empty - case "unknown": - return ExternalDriveBackupStatus.unknown - case "other": - return ExternalDriveBackupStatus.other - default: - return ExternalDriveBackupStatus.other - } - default: - fatalError("Failed to deserialize") + case .broken: + var d = [String: JSON]() + d[".tag"] = .str("broken") + return .dictionary(d) + case .created: + var d = [String: JSON]() + d[".tag"] = .str("created") + return .dictionary(d) + case .createdOrBroken: + var d = [String: JSON]() + d[".tag"] = .str("created_or_broken") + return .dictionary(d) + case .deleted: + var d = [String: JSON]() + d[".tag"] = .str("deleted") + return .dictionary(d) + case .empty: + var d = [String: JSON]() + d[".tag"] = .str("empty") + return .dictionary(d) + case .unknown: + var d = [String: JSON]() + d[".tag"] = .str("unknown") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "broken": + return ExternalDriveBackupStatus.broken + case "created": + return ExternalDriveBackupStatus.created + case "created_or_broken": + return ExternalDriveBackupStatus.createdOrBroken + case "deleted": + return ExternalDriveBackupStatus.deleted + case "empty": + return ExternalDriveBackupStatus.empty + case "unknown": + return ExternalDriveBackupStatus.unknown + case "other": + return ExternalDriveBackupStatus.other + default: + return ExternalDriveBackupStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupStatus.self, json: json) } } } /// Modified external drive backup. - open class ExternalDriveBackupStatusChangedDetails: CustomStringConvertible { + public class ExternalDriveBackupStatusChangedDetails: CustomStringConvertible, JSONRepresentable { /// Device's session logged information. public let desktopDeviceSessionInfo: TeamLog.DesktopDeviceSessionLogInfo /// Previous status of this external drive backup. public let previousValue: TeamLog.ExternalDriveBackupStatus /// Next status of this external drive backup. public let newValue: TeamLog.ExternalDriveBackupStatus - public init(desktopDeviceSessionInfo: TeamLog.DesktopDeviceSessionLogInfo, previousValue: TeamLog.ExternalDriveBackupStatus, newValue: TeamLog.ExternalDriveBackupStatus) { + public init( + desktopDeviceSessionInfo: TeamLog.DesktopDeviceSessionLogInfo, + previousValue: TeamLog.ExternalDriveBackupStatus, + newValue: TeamLog.ExternalDriveBackupStatus + ) { self.desktopDeviceSessionInfo = desktopDeviceSessionInfo self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupStatusChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalDriveBackupStatusChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupStatusChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupStatusChangedDetails: \(error)" + } } } - open class ExternalDriveBackupStatusChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupStatusChangedDetails) -> JSON { - let output = [ - "desktop_device_session_info": TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(value.desktopDeviceSessionInfo), - "previous_value": TeamLog.ExternalDriveBackupStatusSerializer().serialize(value.previousValue), - "new_value": TeamLog.ExternalDriveBackupStatusSerializer().serialize(value.newValue), + + public class ExternalDriveBackupStatusChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupStatusChangedDetails) throws -> JSON { + let output = [ + "desktop_device_session_info": try TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(value.desktopDeviceSessionInfo), + "previous_value": try TeamLog.ExternalDriveBackupStatusSerializer().serialize(value.previousValue), + "new_value": try TeamLog.ExternalDriveBackupStatusSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalDriveBackupStatusChangedDetails { + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupStatusChangedDetails { switch json { - case .dictionary(let dict): - let desktopDeviceSessionInfo = TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(dict["desktop_device_session_info"] ?? .null) - let previousValue = TeamLog.ExternalDriveBackupStatusSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.ExternalDriveBackupStatusSerializer().deserialize(dict["new_value"] ?? .null) - return ExternalDriveBackupStatusChangedDetails(desktopDeviceSessionInfo: desktopDeviceSessionInfo, previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let desktopDeviceSessionInfo = try TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(dict["desktop_device_session_info"] ?? .null) + let previousValue = try TeamLog.ExternalDriveBackupStatusSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.ExternalDriveBackupStatusSerializer().deserialize(dict["new_value"] ?? .null) + return ExternalDriveBackupStatusChangedDetails( + desktopDeviceSessionInfo: desktopDeviceSessionInfo, + previousValue: previousValue, + newValue: newValue + ) + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupStatusChangedDetails.self, json: json) } } } /// The ExternalDriveBackupStatusChangedType struct - open class ExternalDriveBackupStatusChangedType: CustomStringConvertible { + public class ExternalDriveBackupStatusChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupStatusChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalDriveBackupStatusChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupStatusChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupStatusChangedType: \(error)" + } } } - open class ExternalDriveBackupStatusChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupStatusChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExternalDriveBackupStatusChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupStatusChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalDriveBackupStatusChangedType { + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupStatusChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExternalDriveBackupStatusChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExternalDriveBackupStatusChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupStatusChangedType.self, json: json) } } } /// Created External sharing report. - open class ExternalSharingCreateReportDetails: CustomStringConvertible { - public init() { + public class ExternalSharingCreateReportDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ExternalSharingCreateReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalSharingCreateReportDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalSharingCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalSharingCreateReportDetails: \(error)" + } } } - open class ExternalSharingCreateReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalSharingCreateReportDetails) -> JSON { + + public class ExternalSharingCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalSharingCreateReportDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalSharingCreateReportDetails { + + public func deserialize(_ json: JSON) throws -> ExternalSharingCreateReportDetails { switch json { - case .dictionary(_): - return ExternalSharingCreateReportDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return ExternalSharingCreateReportDetails() + default: + throw JSONSerializerError.deserializeError(type: ExternalSharingCreateReportDetails.self, json: json) } } } /// The ExternalSharingCreateReportType struct - open class ExternalSharingCreateReportType: CustomStringConvertible { + public class ExternalSharingCreateReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalSharingCreateReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalSharingCreateReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalSharingCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalSharingCreateReportType: \(error)" + } } } - open class ExternalSharingCreateReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalSharingCreateReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExternalSharingCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalSharingCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalSharingCreateReportType { + + public func deserialize(_ json: JSON) throws -> ExternalSharingCreateReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExternalSharingCreateReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExternalSharingCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExternalSharingCreateReportType.self, json: json) } } } /// Couldn't create External sharing report. - open class ExternalSharingReportFailedDetails: CustomStringConvertible { + public class ExternalSharingReportFailedDetails: CustomStringConvertible, JSONRepresentable { /// Failure reason. public let failureReason: Team.TeamReportFailureReason public init(failureReason: Team.TeamReportFailureReason) { self.failureReason = failureReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalSharingReportFailedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalSharingReportFailedDetailsSerializer().serialize(self) } - } - open class ExternalSharingReportFailedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalSharingReportFailedDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalSharingReportFailedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalSharingReportFailedDetails: \(error)" + } + } + } + + public class ExternalSharingReportFailedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalSharingReportFailedDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalSharingReportFailedDetails { + + public func deserialize(_ json: JSON) throws -> ExternalSharingReportFailedDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return ExternalSharingReportFailedDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return ExternalSharingReportFailedDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: ExternalSharingReportFailedDetails.self, json: json) } } } /// The ExternalSharingReportFailedType struct - open class ExternalSharingReportFailedType: CustomStringConvertible { + public class ExternalSharingReportFailedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalSharingReportFailedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalSharingReportFailedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalSharingReportFailedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalSharingReportFailedType: \(error)" + } } } - open class ExternalSharingReportFailedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalSharingReportFailedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ExternalSharingReportFailedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalSharingReportFailedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalSharingReportFailedType { + + public func deserialize(_ json: JSON) throws -> ExternalSharingReportFailedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ExternalSharingReportFailedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ExternalSharingReportFailedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ExternalSharingReportFailedType.self, json: json) } } } /// A user without a Dropbox account. - open class ExternalUserLogInfo: CustomStringConvertible { + public class ExternalUserLogInfo: CustomStringConvertible, JSONRepresentable { /// An external user identifier. public let userIdentifier: String /// Identifier type. @@ -22235,33 +25622,44 @@ open class TeamLog { self.userIdentifier = userIdentifier self.identifierType = identifierType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalUserLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try ExternalUserLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalUserLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalUserLogInfo: \(error)" + } } } - open class ExternalUserLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalUserLogInfo) -> JSON { - let output = [ - "user_identifier": Serialization._StringSerializer.serialize(value.userIdentifier), - "identifier_type": TeamLog.IdentifierTypeSerializer().serialize(value.identifierType), + + public class ExternalUserLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalUserLogInfo) throws -> JSON { + let output = [ + "user_identifier": try Serialization._StringSerializer.serialize(value.userIdentifier), + "identifier_type": try TeamLog.IdentifierTypeSerializer().serialize(value.identifierType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ExternalUserLogInfo { + + public func deserialize(_ json: JSON) throws -> ExternalUserLogInfo { switch json { - case .dictionary(let dict): - let userIdentifier = Serialization._StringSerializer.deserialize(dict["user_identifier"] ?? .null) - let identifierType = TeamLog.IdentifierTypeSerializer().deserialize(dict["identifier_type"] ?? .null) - return ExternalUserLogInfo(userIdentifier: userIdentifier, identifierType: identifierType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let userIdentifier = try Serialization._StringSerializer.deserialize(dict["user_identifier"] ?? .null) + let identifierType = try TeamLog.IdentifierTypeSerializer().deserialize(dict["identifier_type"] ?? .null) + return ExternalUserLogInfo(userIdentifier: userIdentifier, identifierType: identifierType) + default: + throw JSONSerializerError.deserializeError(type: ExternalUserLogInfo.self, json: json) } } } /// Provides details about a failure - open class FailureDetailsLogInfo: CustomStringConvertible { + public class FailureDetailsLogInfo: CustomStringConvertible, JSONRepresentable { /// A user friendly explanation of the error. public let userFriendlyMessage: String? /// A technical explanation of the error. This is relevant for some errors. @@ -22272,33 +25670,44 @@ open class TeamLog { nullableValidator(stringValidator())(technicalErrorMessage) self.technicalErrorMessage = technicalErrorMessage } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FailureDetailsLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try FailureDetailsLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FailureDetailsLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FailureDetailsLogInfo: \(error)" + } } } - open class FailureDetailsLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FailureDetailsLogInfo) -> JSON { - let output = [ - "user_friendly_message": NullableSerializer(Serialization._StringSerializer).serialize(value.userFriendlyMessage), - "technical_error_message": NullableSerializer(Serialization._StringSerializer).serialize(value.technicalErrorMessage), + + public class FailureDetailsLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FailureDetailsLogInfo) throws -> JSON { + let output = [ + "user_friendly_message": try NullableSerializer(Serialization._StringSerializer).serialize(value.userFriendlyMessage), + "technical_error_message": try NullableSerializer(Serialization._StringSerializer).serialize(value.technicalErrorMessage), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FailureDetailsLogInfo { + + public func deserialize(_ json: JSON) throws -> FailureDetailsLogInfo { switch json { - case .dictionary(let dict): - let userFriendlyMessage = NullableSerializer(Serialization._StringSerializer).deserialize(dict["user_friendly_message"] ?? .null) - let technicalErrorMessage = NullableSerializer(Serialization._StringSerializer).deserialize(dict["technical_error_message"] ?? .null) - return FailureDetailsLogInfo(userFriendlyMessage: userFriendlyMessage, technicalErrorMessage: technicalErrorMessage) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let userFriendlyMessage = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["user_friendly_message"] ?? .null) + let technicalErrorMessage = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["technical_error_message"] ?? .null) + return FailureDetailsLogInfo(userFriendlyMessage: userFriendlyMessage, technicalErrorMessage: technicalErrorMessage) + default: + throw JSONSerializerError.deserializeError(type: FailureDetailsLogInfo.self, json: json) } } } /// The FedAdminRole union - public enum FedAdminRole: CustomStringConvertible { + public enum FedAdminRole: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case enterpriseAdmin /// An unspecified error. @@ -22306,50 +25715,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FedAdminRoleSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FedAdminRoleSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FedAdminRoleSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FedAdminRole: \(error)" + } } } - open class FedAdminRoleSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FedAdminRole) -> JSON { + + public class FedAdminRoleSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FedAdminRole) throws -> JSON { switch value { - case .enterpriseAdmin: - var d = [String: JSON]() - d[".tag"] = .str("enterprise_admin") - return .dictionary(d) - case .notEnterpriseAdmin: - var d = [String: JSON]() - d[".tag"] = .str("not_enterprise_admin") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FedAdminRole { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "enterprise_admin": - return FedAdminRole.enterpriseAdmin - case "not_enterprise_admin": - return FedAdminRole.notEnterpriseAdmin - case "other": - return FedAdminRole.other - default: - return FedAdminRole.other - } + case .enterpriseAdmin: + var d = [String: JSON]() + d[".tag"] = .str("enterprise_admin") + return .dictionary(d) + case .notEnterpriseAdmin: + var d = [String: JSON]() + d[".tag"] = .str("not_enterprise_admin") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FedAdminRole { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "enterprise_admin": + return FedAdminRole.enterpriseAdmin + case "not_enterprise_admin": + return FedAdminRole.notEnterpriseAdmin + case "other": + return FedAdminRole.other default: - fatalError("Failed to deserialize") + return FedAdminRole.other + } + default: + throw JSONSerializerError.deserializeError(type: FedAdminRole.self, json: json) } } } /// More details about the organization or team. - public enum FedExtraDetails: CustomStringConvertible { + public enum FedExtraDetails: CustomStringConvertible, JSONRepresentable { /// More details about the organization. case organization(TeamLog.OrganizationDetails) /// More details about the team. @@ -22357,52 +25776,62 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FedExtraDetailsSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FedExtraDetailsSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FedExtraDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FedExtraDetails: \(error)" + } } } - open class FedExtraDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FedExtraDetails) -> JSON { + + public class FedExtraDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FedExtraDetails) throws -> JSON { switch value { - case .organization(let arg): - var d = Serialization.getFields(TeamLog.OrganizationDetailsSerializer().serialize(arg)) - d[".tag"] = .str("organization") - return .dictionary(d) - case .team(let arg): - var d = Serialization.getFields(TeamLog.TeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FedExtraDetails { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "organization": - let v = TeamLog.OrganizationDetailsSerializer().deserialize(json) - return FedExtraDetails.organization(v) - case "team": - let v = TeamLog.TeamDetailsSerializer().deserialize(json) - return FedExtraDetails.team(v) - case "other": - return FedExtraDetails.other - default: - return FedExtraDetails.other - } + case .organization(let arg): + var d = try Serialization.getFields(TeamLog.OrganizationDetailsSerializer().serialize(arg)) + d[".tag"] = .str("organization") + return .dictionary(d) + case .team(let arg): + var d = try Serialization.getFields(TeamLog.TeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FedExtraDetails { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "organization": + let v = try TeamLog.OrganizationDetailsSerializer().deserialize(json) + return FedExtraDetails.organization(v) + case "team": + let v = try TeamLog.TeamDetailsSerializer().deserialize(json) + return FedExtraDetails.team(v) + case "other": + return FedExtraDetails.other default: - fatalError("Failed to deserialize") + return FedExtraDetails.other + } + default: + throw JSONSerializerError.deserializeError(type: FedExtraDetails.self, json: json) } } } /// The FedHandshakeAction union - public enum FedHandshakeAction: CustomStringConvertible { + public enum FedHandshakeAction: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case acceptedInvite /// An unspecified error. @@ -22418,74 +25847,84 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FedHandshakeActionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FedHandshakeActionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FedHandshakeActionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FedHandshakeAction: \(error)" + } } } - open class FedHandshakeActionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FedHandshakeAction) -> JSON { + + public class FedHandshakeActionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FedHandshakeAction) throws -> JSON { switch value { - case .acceptedInvite: - var d = [String: JSON]() - d[".tag"] = .str("accepted_invite") - return .dictionary(d) - case .canceledInvite: - var d = [String: JSON]() - d[".tag"] = .str("canceled_invite") - return .dictionary(d) - case .inviteExpired: - var d = [String: JSON]() - d[".tag"] = .str("invite_expired") - return .dictionary(d) - case .invited: - var d = [String: JSON]() - d[".tag"] = .str("invited") - return .dictionary(d) - case .rejectedInvite: - var d = [String: JSON]() - d[".tag"] = .str("rejected_invite") - return .dictionary(d) - case .removedTeam: - var d = [String: JSON]() - d[".tag"] = .str("removed_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FedHandshakeAction { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "accepted_invite": - return FedHandshakeAction.acceptedInvite - case "canceled_invite": - return FedHandshakeAction.canceledInvite - case "invite_expired": - return FedHandshakeAction.inviteExpired - case "invited": - return FedHandshakeAction.invited - case "rejected_invite": - return FedHandshakeAction.rejectedInvite - case "removed_team": - return FedHandshakeAction.removedTeam - case "other": - return FedHandshakeAction.other - default: - return FedHandshakeAction.other - } - default: - fatalError("Failed to deserialize") + case .acceptedInvite: + var d = [String: JSON]() + d[".tag"] = .str("accepted_invite") + return .dictionary(d) + case .canceledInvite: + var d = [String: JSON]() + d[".tag"] = .str("canceled_invite") + return .dictionary(d) + case .inviteExpired: + var d = [String: JSON]() + d[".tag"] = .str("invite_expired") + return .dictionary(d) + case .invited: + var d = [String: JSON]() + d[".tag"] = .str("invited") + return .dictionary(d) + case .rejectedInvite: + var d = [String: JSON]() + d[".tag"] = .str("rejected_invite") + return .dictionary(d) + case .removedTeam: + var d = [String: JSON]() + d[".tag"] = .str("removed_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FedHandshakeAction { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "accepted_invite": + return FedHandshakeAction.acceptedInvite + case "canceled_invite": + return FedHandshakeAction.canceledInvite + case "invite_expired": + return FedHandshakeAction.inviteExpired + case "invited": + return FedHandshakeAction.invited + case "rejected_invite": + return FedHandshakeAction.rejectedInvite + case "removed_team": + return FedHandshakeAction.removedTeam + case "other": + return FedHandshakeAction.other + default: + return FedHandshakeAction.other + } + default: + throw JSONSerializerError.deserializeError(type: FedHandshakeAction.self, json: json) } } } /// Additional information about the organization or connected team - public enum FederationStatusChangeAdditionalInfo: CustomStringConvertible { + public enum FederationStatusChangeAdditionalInfo: CustomStringConvertible, JSONRepresentable { /// The name of the team. case connectedTeamName(TeamLog.ConnectedTeamName) /// The email to which the request was sent. @@ -22495,176 +25934,301 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FederationStatusChangeAdditionalInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FederationStatusChangeAdditionalInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FederationStatusChangeAdditionalInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FederationStatusChangeAdditionalInfo: \(error)" + } } } - open class FederationStatusChangeAdditionalInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FederationStatusChangeAdditionalInfo) -> JSON { + + public class FederationStatusChangeAdditionalInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FederationStatusChangeAdditionalInfo) throws -> JSON { switch value { - case .connectedTeamName(let arg): - var d = Serialization.getFields(TeamLog.ConnectedTeamNameSerializer().serialize(arg)) - d[".tag"] = .str("connected_team_name") - return .dictionary(d) - case .nonTrustedTeamDetails(let arg): - var d = Serialization.getFields(TeamLog.NonTrustedTeamDetailsSerializer().serialize(arg)) - d[".tag"] = .str("non_trusted_team_details") - return .dictionary(d) - case .organizationName(let arg): - var d = Serialization.getFields(TeamLog.OrganizationNameSerializer().serialize(arg)) - d[".tag"] = .str("organization_name") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FederationStatusChangeAdditionalInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "connected_team_name": - let v = TeamLog.ConnectedTeamNameSerializer().deserialize(json) - return FederationStatusChangeAdditionalInfo.connectedTeamName(v) - case "non_trusted_team_details": - let v = TeamLog.NonTrustedTeamDetailsSerializer().deserialize(json) - return FederationStatusChangeAdditionalInfo.nonTrustedTeamDetails(v) - case "organization_name": - let v = TeamLog.OrganizationNameSerializer().deserialize(json) - return FederationStatusChangeAdditionalInfo.organizationName(v) - case "other": - return FederationStatusChangeAdditionalInfo.other - default: - return FederationStatusChangeAdditionalInfo.other - } - default: - fatalError("Failed to deserialize") + case .connectedTeamName(let arg): + var d = try Serialization.getFields(TeamLog.ConnectedTeamNameSerializer().serialize(arg)) + d[".tag"] = .str("connected_team_name") + return .dictionary(d) + case .nonTrustedTeamDetails(let arg): + var d = try Serialization.getFields(TeamLog.NonTrustedTeamDetailsSerializer().serialize(arg)) + d[".tag"] = .str("non_trusted_team_details") + return .dictionary(d) + case .organizationName(let arg): + var d = try Serialization.getFields(TeamLog.OrganizationNameSerializer().serialize(arg)) + d[".tag"] = .str("organization_name") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FederationStatusChangeAdditionalInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "connected_team_name": + let v = try TeamLog.ConnectedTeamNameSerializer().deserialize(json) + return FederationStatusChangeAdditionalInfo.connectedTeamName(v) + case "non_trusted_team_details": + let v = try TeamLog.NonTrustedTeamDetailsSerializer().deserialize(json) + return FederationStatusChangeAdditionalInfo.nonTrustedTeamDetails(v) + case "organization_name": + let v = try TeamLog.OrganizationNameSerializer().deserialize(json) + return FederationStatusChangeAdditionalInfo.organizationName(v) + case "other": + return FederationStatusChangeAdditionalInfo.other + default: + return FederationStatusChangeAdditionalInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: FederationStatusChangeAdditionalInfo.self, json: json) } } } /// Added file comment. - open class FileAddCommentDetails: CustomStringConvertible { + public class FileAddCommentDetails: CustomStringConvertible, JSONRepresentable { /// Comment text. public let commentText: String? public init(commentText: String? = nil) { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileAddCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileAddCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileAddCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileAddCommentDetails: \(error)" + } } } - open class FileAddCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileAddCommentDetails) -> JSON { - let output = [ - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class FileAddCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileAddCommentDetails) throws -> JSON { + let output = [ + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileAddCommentDetails { + + public func deserialize(_ json: JSON) throws -> FileAddCommentDetails { switch json { - case .dictionary(let dict): - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return FileAddCommentDetails(commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return FileAddCommentDetails(commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: FileAddCommentDetails.self, json: json) } } } /// The FileAddCommentType struct - open class FileAddCommentType: CustomStringConvertible { + public class FileAddCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileAddCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileAddCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileAddCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileAddCommentType: \(error)" + } } } - open class FileAddCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileAddCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileAddCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileAddCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileAddCommentType { + + public func deserialize(_ json: JSON) throws -> FileAddCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileAddCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileAddCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileAddCommentType.self, json: json) } } } /// Added files and/or folders. - open class FileAddDetails: CustomStringConvertible { - public init() { + public class FileAddDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileAddDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileAddDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileAddDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileAddDetails: \(error)" + } } } - open class FileAddDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileAddDetails) -> JSON { + + public class FileAddDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileAddDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileAddDetails { + + public func deserialize(_ json: JSON) throws -> FileAddDetails { switch json { - case .dictionary(_): - return FileAddDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileAddDetails() + default: + throw JSONSerializerError.deserializeError(type: FileAddDetails.self, json: json) + } + } + } + + /// Added files and/or folders from automation. + public class FileAddFromAutomationDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileAddFromAutomationDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileAddFromAutomationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileAddFromAutomationDetails: \(error)" + } + } + } + + public class FileAddFromAutomationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileAddFromAutomationDetails) throws -> JSON { + let output = [String: JSON]() + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> FileAddFromAutomationDetails { + switch json { + case .dictionary: + return FileAddFromAutomationDetails() + default: + throw JSONSerializerError.deserializeError(type: FileAddFromAutomationDetails.self, json: json) + } + } + } + + /// The FileAddFromAutomationType struct + public class FileAddFromAutomationType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try FileAddFromAutomationTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileAddFromAutomationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileAddFromAutomationType: \(error)" + } + } + } + + public class FileAddFromAutomationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileAddFromAutomationType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> FileAddFromAutomationType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileAddFromAutomationType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileAddFromAutomationType.self, json: json) } } } /// The FileAddType struct - open class FileAddType: CustomStringConvertible { + public class FileAddType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileAddTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileAddTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileAddTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileAddType: \(error)" + } } } - open class FileAddTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileAddType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileAddTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileAddType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileAddType { + + public func deserialize(_ json: JSON) throws -> FileAddType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileAddType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileAddType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileAddType.self, json: json) } } } /// Subscribed to or unsubscribed from comment notifications for file. - open class FileChangeCommentSubscriptionDetails: CustomStringConvertible { + public class FileChangeCommentSubscriptionDetails: CustomStringConvertible, JSONRepresentable { /// New file comment subscription. public let newValue: TeamLog.FileCommentNotificationPolicy /// Previous file comment subscription. Might be missing due to historical data gap. @@ -22673,64 +26237,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileChangeCommentSubscriptionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileChangeCommentSubscriptionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileChangeCommentSubscriptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileChangeCommentSubscriptionDetails: \(error)" + } } } - open class FileChangeCommentSubscriptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileChangeCommentSubscriptionDetails) -> JSON { - let output = [ - "new_value": TeamLog.FileCommentNotificationPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.FileCommentNotificationPolicySerializer()).serialize(value.previousValue), + + public class FileChangeCommentSubscriptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileChangeCommentSubscriptionDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.FileCommentNotificationPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.FileCommentNotificationPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileChangeCommentSubscriptionDetails { + + public func deserialize(_ json: JSON) throws -> FileChangeCommentSubscriptionDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.FileCommentNotificationPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.FileCommentNotificationPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return FileChangeCommentSubscriptionDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.FileCommentNotificationPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.FileCommentNotificationPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return FileChangeCommentSubscriptionDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: FileChangeCommentSubscriptionDetails.self, json: json) } } } /// The FileChangeCommentSubscriptionType struct - open class FileChangeCommentSubscriptionType: CustomStringConvertible { + public class FileChangeCommentSubscriptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileChangeCommentSubscriptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileChangeCommentSubscriptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileChangeCommentSubscriptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileChangeCommentSubscriptionType: \(error)" + } } } - open class FileChangeCommentSubscriptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileChangeCommentSubscriptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileChangeCommentSubscriptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileChangeCommentSubscriptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileChangeCommentSubscriptionType { + + public func deserialize(_ json: JSON) throws -> FileChangeCommentSubscriptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileChangeCommentSubscriptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileChangeCommentSubscriptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileChangeCommentSubscriptionType.self, json: json) } } } /// Enable or disable file comments notifications - public enum FileCommentNotificationPolicy: CustomStringConvertible { + public enum FileCommentNotificationPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -22738,50 +26324,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FileCommentNotificationPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileCommentNotificationPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileCommentNotificationPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileCommentNotificationPolicy: \(error)" + } } } - open class FileCommentNotificationPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileCommentNotificationPolicy) -> JSON { + + public class FileCommentNotificationPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileCommentNotificationPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileCommentNotificationPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return FileCommentNotificationPolicy.disabled - case "enabled": - return FileCommentNotificationPolicy.enabled - case "other": - return FileCommentNotificationPolicy.other - default: - return FileCommentNotificationPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileCommentNotificationPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return FileCommentNotificationPolicy.disabled + case "enabled": + return FileCommentNotificationPolicy.enabled + case "other": + return FileCommentNotificationPolicy.other default: - fatalError("Failed to deserialize") + return FileCommentNotificationPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: FileCommentNotificationPolicy.self, json: json) } } } /// Enabled/disabled commenting on team files. - open class FileCommentsChangePolicyDetails: CustomStringConvertible { + public class FileCommentsChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New commenting on team files policy. public let newValue: TeamLog.FileCommentsPolicy /// Previous commenting on team files policy. Might be missing due to historical data gap. @@ -22790,64 +26386,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileCommentsChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileCommentsChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileCommentsChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileCommentsChangePolicyDetails: \(error)" + } } } - open class FileCommentsChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileCommentsChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.FileCommentsPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.FileCommentsPolicySerializer()).serialize(value.previousValue), + + public class FileCommentsChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileCommentsChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.FileCommentsPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.FileCommentsPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileCommentsChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> FileCommentsChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.FileCommentsPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.FileCommentsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return FileCommentsChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.FileCommentsPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.FileCommentsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return FileCommentsChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: FileCommentsChangePolicyDetails.self, json: json) } } } /// The FileCommentsChangePolicyType struct - open class FileCommentsChangePolicyType: CustomStringConvertible { + public class FileCommentsChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileCommentsChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileCommentsChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileCommentsChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileCommentsChangePolicyType: \(error)" + } } } - open class FileCommentsChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileCommentsChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileCommentsChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileCommentsChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileCommentsChangePolicyType { + + public func deserialize(_ json: JSON) throws -> FileCommentsChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileCommentsChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileCommentsChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileCommentsChangePolicyType.self, json: json) } } } /// File comments policy - public enum FileCommentsPolicy: CustomStringConvertible { + public enum FileCommentsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -22855,283 +26473,376 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FileCommentsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileCommentsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileCommentsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileCommentsPolicy: \(error)" + } } } - open class FileCommentsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileCommentsPolicy) -> JSON { + + public class FileCommentsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileCommentsPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileCommentsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return FileCommentsPolicy.disabled - case "enabled": - return FileCommentsPolicy.enabled - case "other": - return FileCommentsPolicy.other - default: - return FileCommentsPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileCommentsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return FileCommentsPolicy.disabled + case "enabled": + return FileCommentsPolicy.enabled + case "other": + return FileCommentsPolicy.other default: - fatalError("Failed to deserialize") + return FileCommentsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: FileCommentsPolicy.self, json: json) } } } /// Copied files and/or folders. - open class FileCopyDetails: CustomStringConvertible { + public class FileCopyDetails: CustomStringConvertible, JSONRepresentable { /// Relocate action details. - public let relocateActionDetails: Array - public init(relocateActionDetails: Array) { + public let relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo] + public init(relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo]) { self.relocateActionDetails = relocateActionDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileCopyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileCopyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileCopyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileCopyDetails: \(error)" + } } } - open class FileCopyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileCopyDetails) -> JSON { - let output = [ - "relocate_action_details": ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), + + public class FileCopyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileCopyDetails) throws -> JSON { + let output = [ + "relocate_action_details": try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileCopyDetails { + + public func deserialize(_ json: JSON) throws -> FileCopyDetails { switch json { - case .dictionary(let dict): - let relocateActionDetails = ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).deserialize(dict["relocate_action_details"] ?? .null) - return FileCopyDetails(relocateActionDetails: relocateActionDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let relocateActionDetails = try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()) + .deserialize(dict["relocate_action_details"] ?? .null) + return FileCopyDetails(relocateActionDetails: relocateActionDetails) + default: + throw JSONSerializerError.deserializeError(type: FileCopyDetails.self, json: json) } } } /// The FileCopyType struct - open class FileCopyType: CustomStringConvertible { + public class FileCopyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileCopyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileCopyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileCopyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileCopyType: \(error)" + } } } - open class FileCopyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileCopyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileCopyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileCopyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileCopyType { + + public func deserialize(_ json: JSON) throws -> FileCopyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileCopyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileCopyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileCopyType.self, json: json) } } } /// Deleted file comment. - open class FileDeleteCommentDetails: CustomStringConvertible { + public class FileDeleteCommentDetails: CustomStringConvertible, JSONRepresentable { /// Comment text. public let commentText: String? public init(commentText: String? = nil) { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileDeleteCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileDeleteCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileDeleteCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileDeleteCommentDetails: \(error)" + } } } - open class FileDeleteCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileDeleteCommentDetails) -> JSON { - let output = [ - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class FileDeleteCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileDeleteCommentDetails) throws -> JSON { + let output = [ + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileDeleteCommentDetails { + + public func deserialize(_ json: JSON) throws -> FileDeleteCommentDetails { switch json { - case .dictionary(let dict): - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return FileDeleteCommentDetails(commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return FileDeleteCommentDetails(commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: FileDeleteCommentDetails.self, json: json) } } } /// The FileDeleteCommentType struct - open class FileDeleteCommentType: CustomStringConvertible { + public class FileDeleteCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileDeleteCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileDeleteCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileDeleteCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileDeleteCommentType: \(error)" + } } } - open class FileDeleteCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileDeleteCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileDeleteCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileDeleteCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileDeleteCommentType { + + public func deserialize(_ json: JSON) throws -> FileDeleteCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileDeleteCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileDeleteCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileDeleteCommentType.self, json: json) } } } /// Deleted files and/or folders. - open class FileDeleteDetails: CustomStringConvertible { - public init() { + public class FileDeleteDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileDeleteDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileDeleteDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileDeleteDetails: \(error)" + } } } - open class FileDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileDeleteDetails) -> JSON { + + public class FileDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileDeleteDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileDeleteDetails { + + public func deserialize(_ json: JSON) throws -> FileDeleteDetails { switch json { - case .dictionary(_): - return FileDeleteDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileDeleteDetails() + default: + throw JSONSerializerError.deserializeError(type: FileDeleteDetails.self, json: json) } } } /// The FileDeleteType struct - open class FileDeleteType: CustomStringConvertible { + public class FileDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileDeleteType: \(error)" + } } } - open class FileDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileDeleteType { + + public func deserialize(_ json: JSON) throws -> FileDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileDeleteType.self, json: json) } } } /// Downloaded files and/or folders. - open class FileDownloadDetails: CustomStringConvertible { - public init() { + public class FileDownloadDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileDownloadDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileDownloadDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileDownloadDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileDownloadDetails: \(error)" + } } } - open class FileDownloadDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileDownloadDetails) -> JSON { + + public class FileDownloadDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileDownloadDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileDownloadDetails { + + public func deserialize(_ json: JSON) throws -> FileDownloadDetails { switch json { - case .dictionary(_): - return FileDownloadDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileDownloadDetails() + default: + throw JSONSerializerError.deserializeError(type: FileDownloadDetails.self, json: json) } } } /// The FileDownloadType struct - open class FileDownloadType: CustomStringConvertible { + public class FileDownloadType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileDownloadTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileDownloadTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileDownloadTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileDownloadType: \(error)" + } } } - open class FileDownloadTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileDownloadType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileDownloadTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileDownloadType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileDownloadType { + + public func deserialize(_ json: JSON) throws -> FileDownloadType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileDownloadType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileDownloadType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileDownloadType.self, json: json) } } } /// Edited file comment. - open class FileEditCommentDetails: CustomStringConvertible { + public class FileEditCommentDetails: CustomStringConvertible, JSONRepresentable { /// Comment text. public let commentText: String? /// Previous comment text. @@ -23142,236 +26853,318 @@ open class TeamLog { stringValidator()(previousCommentText) self.previousCommentText = previousCommentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileEditCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileEditCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileEditCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileEditCommentDetails: \(error)" + } } } - open class FileEditCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileEditCommentDetails) -> JSON { - let output = [ - "previous_comment_text": Serialization._StringSerializer.serialize(value.previousCommentText), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class FileEditCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileEditCommentDetails) throws -> JSON { + let output = [ + "previous_comment_text": try Serialization._StringSerializer.serialize(value.previousCommentText), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileEditCommentDetails { + + public func deserialize(_ json: JSON) throws -> FileEditCommentDetails { switch json { - case .dictionary(let dict): - let previousCommentText = Serialization._StringSerializer.deserialize(dict["previous_comment_text"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return FileEditCommentDetails(previousCommentText: previousCommentText, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousCommentText = try Serialization._StringSerializer.deserialize(dict["previous_comment_text"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return FileEditCommentDetails(previousCommentText: previousCommentText, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: FileEditCommentDetails.self, json: json) } } } /// The FileEditCommentType struct - open class FileEditCommentType: CustomStringConvertible { + public class FileEditCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileEditCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileEditCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileEditCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileEditCommentType: \(error)" + } } } - open class FileEditCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileEditCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileEditCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileEditCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileEditCommentType { + + public func deserialize(_ json: JSON) throws -> FileEditCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileEditCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileEditCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileEditCommentType.self, json: json) } } } /// Edited files. - open class FileEditDetails: CustomStringConvertible { - public init() { + public class FileEditDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileEditDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileEditDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileEditDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileEditDetails: \(error)" + } } } - open class FileEditDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileEditDetails) -> JSON { + + public class FileEditDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileEditDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileEditDetails { + + public func deserialize(_ json: JSON) throws -> FileEditDetails { switch json { - case .dictionary(_): - return FileEditDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileEditDetails() + default: + throw JSONSerializerError.deserializeError(type: FileEditDetails.self, json: json) } } } /// The FileEditType struct - open class FileEditType: CustomStringConvertible { + public class FileEditType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileEditTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileEditTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileEditTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileEditType: \(error)" + } } } - open class FileEditTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileEditType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileEditTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileEditType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileEditType { + + public func deserialize(_ json: JSON) throws -> FileEditType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileEditType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileEditType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileEditType.self, json: json) } } } /// Created copy reference to file/folder. - open class FileGetCopyReferenceDetails: CustomStringConvertible { - public init() { + public class FileGetCopyReferenceDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileGetCopyReferenceDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileGetCopyReferenceDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileGetCopyReferenceDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileGetCopyReferenceDetails: \(error)" + } } } - open class FileGetCopyReferenceDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileGetCopyReferenceDetails) -> JSON { + + public class FileGetCopyReferenceDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileGetCopyReferenceDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileGetCopyReferenceDetails { + + public func deserialize(_ json: JSON) throws -> FileGetCopyReferenceDetails { switch json { - case .dictionary(_): - return FileGetCopyReferenceDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileGetCopyReferenceDetails() + default: + throw JSONSerializerError.deserializeError(type: FileGetCopyReferenceDetails.self, json: json) } } } /// The FileGetCopyReferenceType struct - open class FileGetCopyReferenceType: CustomStringConvertible { + public class FileGetCopyReferenceType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileGetCopyReferenceTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileGetCopyReferenceTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileGetCopyReferenceTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileGetCopyReferenceType: \(error)" + } } } - open class FileGetCopyReferenceTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileGetCopyReferenceType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileGetCopyReferenceTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileGetCopyReferenceType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileGetCopyReferenceType { + + public func deserialize(_ json: JSON) throws -> FileGetCopyReferenceType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileGetCopyReferenceType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileGetCopyReferenceType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileGetCopyReferenceType.self, json: json) } } } /// Liked file comment. - open class FileLikeCommentDetails: CustomStringConvertible { + public class FileLikeCommentDetails: CustomStringConvertible, JSONRepresentable { /// Comment text. public let commentText: String? public init(commentText: String? = nil) { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLikeCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLikeCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLikeCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLikeCommentDetails: \(error)" + } } } - open class FileLikeCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLikeCommentDetails) -> JSON { - let output = [ - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class FileLikeCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLikeCommentDetails) throws -> JSON { + let output = [ + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLikeCommentDetails { + + public func deserialize(_ json: JSON) throws -> FileLikeCommentDetails { switch json { - case .dictionary(let dict): - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return FileLikeCommentDetails(commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return FileLikeCommentDetails(commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: FileLikeCommentDetails.self, json: json) } } } /// The FileLikeCommentType struct - open class FileLikeCommentType: CustomStringConvertible { + public class FileLikeCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLikeCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLikeCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLikeCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLikeCommentType: \(error)" + } } } - open class FileLikeCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLikeCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileLikeCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLikeCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLikeCommentType { + + public func deserialize(_ json: JSON) throws -> FileLikeCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileLikeCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileLikeCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileLikeCommentType.self, json: json) } } } /// Locked/unlocked editing for a file. - open class FileLockingLockStatusChangedDetails: CustomStringConvertible { + public class FileLockingLockStatusChangedDetails: CustomStringConvertible, JSONRepresentable { /// Previous lock status of the file. public let previousValue: TeamLog.LockStatus /// New lock status of the file. @@ -23380,64 +27173,86 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockingLockStatusChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLockingLockStatusChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockingLockStatusChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockingLockStatusChangedDetails: \(error)" + } } } - open class FileLockingLockStatusChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockingLockStatusChangedDetails) -> JSON { - let output = [ - "previous_value": TeamLog.LockStatusSerializer().serialize(value.previousValue), - "new_value": TeamLog.LockStatusSerializer().serialize(value.newValue), + + public class FileLockingLockStatusChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockingLockStatusChangedDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.LockStatusSerializer().serialize(value.previousValue), + "new_value": try TeamLog.LockStatusSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLockingLockStatusChangedDetails { + + public func deserialize(_ json: JSON) throws -> FileLockingLockStatusChangedDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.LockStatusSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.LockStatusSerializer().deserialize(dict["new_value"] ?? .null) - return FileLockingLockStatusChangedDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.LockStatusSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.LockStatusSerializer().deserialize(dict["new_value"] ?? .null) + return FileLockingLockStatusChangedDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: FileLockingLockStatusChangedDetails.self, json: json) } } } /// The FileLockingLockStatusChangedType struct - open class FileLockingLockStatusChangedType: CustomStringConvertible { + public class FileLockingLockStatusChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockingLockStatusChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLockingLockStatusChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockingLockStatusChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockingLockStatusChangedType: \(error)" + } } } - open class FileLockingLockStatusChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockingLockStatusChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileLockingLockStatusChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockingLockStatusChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLockingLockStatusChangedType { + + public func deserialize(_ json: JSON) throws -> FileLockingLockStatusChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileLockingLockStatusChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileLockingLockStatusChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileLockingLockStatusChangedType.self, json: json) } } } /// Changed file locking policy for team. - open class FileLockingPolicyChangedDetails: CustomStringConvertible { + public class FileLockingPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New file locking policy. public let newValue: TeamPolicies.FileLockingPolicyState /// Previous file locking policy. @@ -23446,64 +27261,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockingPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLockingPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockingPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockingPolicyChangedDetails: \(error)" + } } } - open class FileLockingPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockingPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.FileLockingPolicyStateSerializer().serialize(value.newValue), - "previous_value": TeamPolicies.FileLockingPolicyStateSerializer().serialize(value.previousValue), + + public class FileLockingPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockingPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.FileLockingPolicyStateSerializer().serialize(value.newValue), + "previous_value": try TeamPolicies.FileLockingPolicyStateSerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLockingPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> FileLockingPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.FileLockingPolicyStateSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamPolicies.FileLockingPolicyStateSerializer().deserialize(dict["previous_value"] ?? .null) - return FileLockingPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamPolicies.FileLockingPolicyStateSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamPolicies.FileLockingPolicyStateSerializer().deserialize(dict["previous_value"] ?? .null) + return FileLockingPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: FileLockingPolicyChangedDetails.self, json: json) } } } /// The FileLockingPolicyChangedType struct - open class FileLockingPolicyChangedType: CustomStringConvertible { + public class FileLockingPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockingPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileLockingPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockingPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockingPolicyChangedType: \(error)" + } } } - open class FileLockingPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockingPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileLockingPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockingPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLockingPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> FileLockingPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileLockingPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileLockingPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileLockingPolicyChangedType.self, json: json) } } } /// Generic information relevant both for files and folders - open class FileOrFolderLogInfo: CustomStringConvertible { + public class FileOrFolderLogInfo: CustomStringConvertible, JSONRepresentable { /// Path relative to event context. public let path: TeamLog.PathLogInfo /// Display name. @@ -23521,239 +27358,317 @@ open class TeamLog { nullableValidator(comparableValidator())(fileSize) self.fileSize = fileSize } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileOrFolderLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileOrFolderLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileOrFolderLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileOrFolderLogInfo: \(error)" + } } } - open class FileOrFolderLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileOrFolderLogInfo) -> JSON { - let output = [ - "path": TeamLog.PathLogInfoSerializer().serialize(value.path), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "file_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileId), - "file_size": NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileSize), + + public class FileOrFolderLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileOrFolderLogInfo) throws -> JSON { + let output = [ + "path": try TeamLog.PathLogInfoSerializer().serialize(value.path), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "file_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileId), + "file_size": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileSize), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileOrFolderLogInfo { + + public func deserialize(_ json: JSON) throws -> FileOrFolderLogInfo { switch json { - case .dictionary(let dict): - let path = TeamLog.PathLogInfoSerializer().deserialize(dict["path"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let fileId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_id"] ?? .null) - let fileSize = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_size"] ?? .null) - return FileOrFolderLogInfo(path: path, displayName: displayName, fileId: fileId, fileSize: fileSize) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try TeamLog.PathLogInfoSerializer().deserialize(dict["path"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let fileId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_id"] ?? .null) + let fileSize = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_size"] ?? .null) + return FileOrFolderLogInfo(path: path, displayName: displayName, fileId: fileId, fileSize: fileSize) + default: + throw JSONSerializerError.deserializeError(type: FileOrFolderLogInfo.self, json: json) } } } /// File's logged information. - open class FileLogInfo: TeamLog.FileOrFolderLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLogInfoSerializer().serialize(self)))" + public class FileLogInfo: TeamLog.FileOrFolderLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLogInfo: \(error)" + } } } - open class FileLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLogInfo) -> JSON { - let output = [ - "path": TeamLog.PathLogInfoSerializer().serialize(value.path), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "file_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileId), - "file_size": NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileSize), + + public class FileLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLogInfo) throws -> JSON { + let output = [ + "path": try TeamLog.PathLogInfoSerializer().serialize(value.path), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "file_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileId), + "file_size": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileSize), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileLogInfo { + + public func deserialize(_ json: JSON) throws -> FileLogInfo { switch json { - case .dictionary(let dict): - let path = TeamLog.PathLogInfoSerializer().deserialize(dict["path"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let fileId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_id"] ?? .null) - let fileSize = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_size"] ?? .null) - return FileLogInfo(path: path, displayName: displayName, fileId: fileId, fileSize: fileSize) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try TeamLog.PathLogInfoSerializer().deserialize(dict["path"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let fileId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_id"] ?? .null) + let fileSize = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_size"] ?? .null) + return FileLogInfo(path: path, displayName: displayName, fileId: fileId, fileSize: fileSize) + default: + throw JSONSerializerError.deserializeError(type: FileLogInfo.self, json: json) } } } /// Moved files and/or folders. - open class FileMoveDetails: CustomStringConvertible { + public class FileMoveDetails: CustomStringConvertible, JSONRepresentable { /// Relocate action details. - public let relocateActionDetails: Array - public init(relocateActionDetails: Array) { + public let relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo] + public init(relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo]) { self.relocateActionDetails = relocateActionDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileMoveDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileMoveDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileMoveDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileMoveDetails: \(error)" + } } } - open class FileMoveDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileMoveDetails) -> JSON { - let output = [ - "relocate_action_details": ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), + + public class FileMoveDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileMoveDetails) throws -> JSON { + let output = [ + "relocate_action_details": try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileMoveDetails { + + public func deserialize(_ json: JSON) throws -> FileMoveDetails { switch json { - case .dictionary(let dict): - let relocateActionDetails = ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).deserialize(dict["relocate_action_details"] ?? .null) - return FileMoveDetails(relocateActionDetails: relocateActionDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let relocateActionDetails = try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()) + .deserialize(dict["relocate_action_details"] ?? .null) + return FileMoveDetails(relocateActionDetails: relocateActionDetails) + default: + throw JSONSerializerError.deserializeError(type: FileMoveDetails.self, json: json) } } } /// The FileMoveType struct - open class FileMoveType: CustomStringConvertible { + public class FileMoveType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileMoveTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileMoveTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileMoveTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileMoveType: \(error)" + } } } - open class FileMoveTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileMoveType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileMoveTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileMoveType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileMoveType { + + public func deserialize(_ json: JSON) throws -> FileMoveType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileMoveType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileMoveType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileMoveType.self, json: json) } } } /// Permanently deleted files and/or folders. - open class FilePermanentlyDeleteDetails: CustomStringConvertible { - public init() { + public class FilePermanentlyDeleteDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FilePermanentlyDeleteDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FilePermanentlyDeleteDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FilePermanentlyDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FilePermanentlyDeleteDetails: \(error)" + } } } - open class FilePermanentlyDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FilePermanentlyDeleteDetails) -> JSON { + + public class FilePermanentlyDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FilePermanentlyDeleteDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FilePermanentlyDeleteDetails { + + public func deserialize(_ json: JSON) throws -> FilePermanentlyDeleteDetails { switch json { - case .dictionary(_): - return FilePermanentlyDeleteDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FilePermanentlyDeleteDetails() + default: + throw JSONSerializerError.deserializeError(type: FilePermanentlyDeleteDetails.self, json: json) } } } /// The FilePermanentlyDeleteType struct - open class FilePermanentlyDeleteType: CustomStringConvertible { + public class FilePermanentlyDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FilePermanentlyDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FilePermanentlyDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FilePermanentlyDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FilePermanentlyDeleteType: \(error)" + } } } - open class FilePermanentlyDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FilePermanentlyDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FilePermanentlyDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FilePermanentlyDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FilePermanentlyDeleteType { + + public func deserialize(_ json: JSON) throws -> FilePermanentlyDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FilePermanentlyDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FilePermanentlyDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FilePermanentlyDeleteType.self, json: json) } } } /// Previewed files and/or folders. - open class FilePreviewDetails: CustomStringConvertible { - public init() { + public class FilePreviewDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FilePreviewDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FilePreviewDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FilePreviewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FilePreviewDetails: \(error)" + } } } - open class FilePreviewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FilePreviewDetails) -> JSON { + + public class FilePreviewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FilePreviewDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FilePreviewDetails { + + public func deserialize(_ json: JSON) throws -> FilePreviewDetails { switch json { - case .dictionary(_): - return FilePreviewDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FilePreviewDetails() + default: + throw JSONSerializerError.deserializeError(type: FilePreviewDetails.self, json: json) } } } /// The FilePreviewType struct - open class FilePreviewType: CustomStringConvertible { + public class FilePreviewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FilePreviewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FilePreviewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FilePreviewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FilePreviewType: \(error)" + } } } - open class FilePreviewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FilePreviewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FilePreviewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FilePreviewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FilePreviewType { + + public func deserialize(_ json: JSON) throws -> FilePreviewType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FilePreviewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FilePreviewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FilePreviewType.self, json: json) } } } /// Changed File Provider Migration policy for team. - open class FileProviderMigrationPolicyChangedDetails: CustomStringConvertible { + public class FileProviderMigrationPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// To. public let newValue: TeamPolicies.FileProviderMigrationPolicyState /// From. @@ -23762,125 +27677,170 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileProviderMigrationPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileProviderMigrationPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileProviderMigrationPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileProviderMigrationPolicyChangedDetails: \(error)" + } } } - open class FileProviderMigrationPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileProviderMigrationPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.FileProviderMigrationPolicyStateSerializer().serialize(value.newValue), - "previous_value": TeamPolicies.FileProviderMigrationPolicyStateSerializer().serialize(value.previousValue), + + public class FileProviderMigrationPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileProviderMigrationPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.FileProviderMigrationPolicyStateSerializer().serialize(value.newValue), + "previous_value": try TeamPolicies.FileProviderMigrationPolicyStateSerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileProviderMigrationPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> FileProviderMigrationPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.FileProviderMigrationPolicyStateSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamPolicies.FileProviderMigrationPolicyStateSerializer().deserialize(dict["previous_value"] ?? .null) - return FileProviderMigrationPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamPolicies.FileProviderMigrationPolicyStateSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamPolicies.FileProviderMigrationPolicyStateSerializer().deserialize(dict["previous_value"] ?? .null) + return FileProviderMigrationPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: FileProviderMigrationPolicyChangedDetails.self, json: json) } } } /// The FileProviderMigrationPolicyChangedType struct - open class FileProviderMigrationPolicyChangedType: CustomStringConvertible { + public class FileProviderMigrationPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileProviderMigrationPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileProviderMigrationPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileProviderMigrationPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileProviderMigrationPolicyChangedType: \(error)" + } } } - open class FileProviderMigrationPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileProviderMigrationPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileProviderMigrationPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileProviderMigrationPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileProviderMigrationPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> FileProviderMigrationPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileProviderMigrationPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileProviderMigrationPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileProviderMigrationPolicyChangedType.self, json: json) } } } /// Renamed files and/or folders. - open class FileRenameDetails: CustomStringConvertible { + public class FileRenameDetails: CustomStringConvertible, JSONRepresentable { /// Relocate action details. - public let relocateActionDetails: Array - public init(relocateActionDetails: Array) { + public let relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo] + public init(relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo]) { self.relocateActionDetails = relocateActionDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRenameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRenameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRenameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRenameDetails: \(error)" + } } } - open class FileRenameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRenameDetails) -> JSON { - let output = [ - "relocate_action_details": ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), + + public class FileRenameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRenameDetails) throws -> JSON { + let output = [ + "relocate_action_details": try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRenameDetails { + + public func deserialize(_ json: JSON) throws -> FileRenameDetails { switch json { - case .dictionary(let dict): - let relocateActionDetails = ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).deserialize(dict["relocate_action_details"] ?? .null) - return FileRenameDetails(relocateActionDetails: relocateActionDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let relocateActionDetails = try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()) + .deserialize(dict["relocate_action_details"] ?? .null) + return FileRenameDetails(relocateActionDetails: relocateActionDetails) + default: + throw JSONSerializerError.deserializeError(type: FileRenameDetails.self, json: json) } } } /// The FileRenameType struct - open class FileRenameType: CustomStringConvertible { + public class FileRenameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRenameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRenameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRenameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRenameType: \(error)" + } } } - open class FileRenameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRenameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRenameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRenameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRenameType { + + public func deserialize(_ json: JSON) throws -> FileRenameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRenameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRenameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRenameType.self, json: json) } } } /// Changed file request. - open class FileRequestChangeDetails: CustomStringConvertible { + public class FileRequestChangeDetails: CustomStringConvertible, JSONRepresentable { /// File request id. Might be missing due to historical data gap. public let fileRequestId: String? /// Previous file request details. Might be missing due to historical data gap. @@ -23893,66 +27853,88 @@ open class TeamLog { self.previousDetails = previousDetails self.newDetails = newDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestChangeDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestChangeDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestChangeDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestChangeDetails: \(error)" + } } } - open class FileRequestChangeDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestChangeDetails) -> JSON { - let output = [ - "new_details": TeamLog.FileRequestDetailsSerializer().serialize(value.newDetails), - "file_request_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), - "previous_details": NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.previousDetails), + + public class FileRequestChangeDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestChangeDetails) throws -> JSON { + let output = [ + "new_details": try TeamLog.FileRequestDetailsSerializer().serialize(value.newDetails), + "file_request_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), + "previous_details": try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.previousDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestChangeDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestChangeDetails { switch json { - case .dictionary(let dict): - let newDetails = TeamLog.FileRequestDetailsSerializer().deserialize(dict["new_details"] ?? .null) - let fileRequestId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) - let previousDetails = NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["previous_details"] ?? .null) - return FileRequestChangeDetails(newDetails: newDetails, fileRequestId: fileRequestId, previousDetails: previousDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newDetails = try TeamLog.FileRequestDetailsSerializer().deserialize(dict["new_details"] ?? .null) + let fileRequestId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) + let previousDetails = try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["previous_details"] ?? .null) + return FileRequestChangeDetails(newDetails: newDetails, fileRequestId: fileRequestId, previousDetails: previousDetails) + default: + throw JSONSerializerError.deserializeError(type: FileRequestChangeDetails.self, json: json) } } } /// The FileRequestChangeType struct - open class FileRequestChangeType: CustomStringConvertible { + public class FileRequestChangeType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestChangeTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestChangeTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestChangeTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestChangeType: \(error)" + } } } - open class FileRequestChangeTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestChangeType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestChangeTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestChangeType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestChangeType { + + public func deserialize(_ json: JSON) throws -> FileRequestChangeType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestChangeType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestChangeType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestChangeType.self, json: json) } } } /// Closed file request. - open class FileRequestCloseDetails: CustomStringConvertible { + public class FileRequestCloseDetails: CustomStringConvertible, JSONRepresentable { /// File request id. Might be missing due to historical data gap. public let fileRequestId: String? /// Previous file request details. Might be missing due to historical data gap. @@ -23962,64 +27944,86 @@ open class TeamLog { self.fileRequestId = fileRequestId self.previousDetails = previousDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestCloseDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestCloseDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestCloseDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestCloseDetails: \(error)" + } } } - open class FileRequestCloseDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestCloseDetails) -> JSON { - let output = [ - "file_request_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), - "previous_details": NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.previousDetails), + + public class FileRequestCloseDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestCloseDetails) throws -> JSON { + let output = [ + "file_request_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), + "previous_details": try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.previousDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestCloseDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestCloseDetails { switch json { - case .dictionary(let dict): - let fileRequestId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) - let previousDetails = NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["previous_details"] ?? .null) - return FileRequestCloseDetails(fileRequestId: fileRequestId, previousDetails: previousDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequestId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) + let previousDetails = try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["previous_details"] ?? .null) + return FileRequestCloseDetails(fileRequestId: fileRequestId, previousDetails: previousDetails) + default: + throw JSONSerializerError.deserializeError(type: FileRequestCloseDetails.self, json: json) } } } /// The FileRequestCloseType struct - open class FileRequestCloseType: CustomStringConvertible { + public class FileRequestCloseType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestCloseTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestCloseTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestCloseTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestCloseType: \(error)" + } } } - open class FileRequestCloseTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestCloseType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestCloseTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestCloseType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestCloseType { + + public func deserialize(_ json: JSON) throws -> FileRequestCloseType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestCloseType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestCloseType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestCloseType.self, json: json) } } } /// Created file request. - open class FileRequestCreateDetails: CustomStringConvertible { + public class FileRequestCreateDetails: CustomStringConvertible, JSONRepresentable { /// File request id. Might be missing due to historical data gap. public let fileRequestId: String? /// File request details. Might be missing due to historical data gap. @@ -24029,64 +28033,86 @@ open class TeamLog { self.fileRequestId = fileRequestId self.requestDetails = requestDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestCreateDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestCreateDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestCreateDetails: \(error)" + } } } - open class FileRequestCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestCreateDetails) -> JSON { - let output = [ - "file_request_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), - "request_details": NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.requestDetails), + + public class FileRequestCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestCreateDetails) throws -> JSON { + let output = [ + "file_request_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), + "request_details": try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.requestDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestCreateDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestCreateDetails { switch json { - case .dictionary(let dict): - let fileRequestId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) - let requestDetails = NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["request_details"] ?? .null) - return FileRequestCreateDetails(fileRequestId: fileRequestId, requestDetails: requestDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequestId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) + let requestDetails = try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["request_details"] ?? .null) + return FileRequestCreateDetails(fileRequestId: fileRequestId, requestDetails: requestDetails) + default: + throw JSONSerializerError.deserializeError(type: FileRequestCreateDetails.self, json: json) } } } /// The FileRequestCreateType struct - open class FileRequestCreateType: CustomStringConvertible { + public class FileRequestCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestCreateType: \(error)" + } } } - open class FileRequestCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestCreateType { + + public func deserialize(_ json: JSON) throws -> FileRequestCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestCreateType.self, json: json) } } } /// File request deadline - open class FileRequestDeadline: CustomStringConvertible { + public class FileRequestDeadline: CustomStringConvertible, JSONRepresentable { /// The deadline for this file request. Might be missing due to historical data gap. public let deadline: Date? /// If set, allow uploads after the deadline has passed. @@ -24096,33 +28122,44 @@ open class TeamLog { nullableValidator(stringValidator())(allowLateUploads) self.allowLateUploads = allowLateUploads } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestDeadlineSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestDeadlineSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestDeadlineSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestDeadline: \(error)" + } } } - open class FileRequestDeadlineSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestDeadline) -> JSON { - let output = [ - "deadline": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.deadline), - "allow_late_uploads": NullableSerializer(Serialization._StringSerializer).serialize(value.allowLateUploads), + + public class FileRequestDeadlineSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestDeadline) throws -> JSON { + let output = [ + "deadline": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.deadline), + "allow_late_uploads": try NullableSerializer(Serialization._StringSerializer).serialize(value.allowLateUploads), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestDeadline { + + public func deserialize(_ json: JSON) throws -> FileRequestDeadline { switch json { - case .dictionary(let dict): - let deadline = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["deadline"] ?? .null) - let allowLateUploads = NullableSerializer(Serialization._StringSerializer).deserialize(dict["allow_late_uploads"] ?? .null) - return FileRequestDeadline(deadline: deadline, allowLateUploads: allowLateUploads) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let deadline = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["deadline"] ?? .null) + let allowLateUploads = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["allow_late_uploads"] ?? .null) + return FileRequestDeadline(deadline: deadline, allowLateUploads: allowLateUploads) + default: + throw JSONSerializerError.deserializeError(type: FileRequestDeadline.self, json: json) } } } /// Delete file request. - open class FileRequestDeleteDetails: CustomStringConvertible { + public class FileRequestDeleteDetails: CustomStringConvertible, JSONRepresentable { /// File request id. Might be missing due to historical data gap. public let fileRequestId: String? /// Previous file request details. Might be missing due to historical data gap. @@ -24132,64 +28169,86 @@ open class TeamLog { self.fileRequestId = fileRequestId self.previousDetails = previousDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestDeleteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestDeleteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestDeleteDetails: \(error)" + } } } - open class FileRequestDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestDeleteDetails) -> JSON { - let output = [ - "file_request_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), - "previous_details": NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.previousDetails), + + public class FileRequestDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestDeleteDetails) throws -> JSON { + let output = [ + "file_request_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), + "previous_details": try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.previousDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestDeleteDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestDeleteDetails { switch json { - case .dictionary(let dict): - let fileRequestId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) - let previousDetails = NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["previous_details"] ?? .null) - return FileRequestDeleteDetails(fileRequestId: fileRequestId, previousDetails: previousDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileRequestId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) + let previousDetails = try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["previous_details"] ?? .null) + return FileRequestDeleteDetails(fileRequestId: fileRequestId, previousDetails: previousDetails) + default: + throw JSONSerializerError.deserializeError(type: FileRequestDeleteDetails.self, json: json) } } } /// The FileRequestDeleteType struct - open class FileRequestDeleteType: CustomStringConvertible { + public class FileRequestDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestDeleteType: \(error)" + } } } - open class FileRequestDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestDeleteType { + + public func deserialize(_ json: JSON) throws -> FileRequestDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestDeleteType.self, json: json) } } } /// File request details - open class FileRequestDetails: CustomStringConvertible { + public class FileRequestDetails: CustomStringConvertible, JSONRepresentable { /// Asset position in the Assets list. public let assetIndex: UInt64 /// File request deadline. @@ -24199,44 +28258,61 @@ open class TeamLog { self.assetIndex = assetIndex self.deadline = deadline } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestDetails: \(error)" + } } } - open class FileRequestDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestDetails) -> JSON { - let output = [ - "asset_index": Serialization._UInt64Serializer.serialize(value.assetIndex), - "deadline": NullableSerializer(TeamLog.FileRequestDeadlineSerializer()).serialize(value.deadline), + + public class FileRequestDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestDetails) throws -> JSON { + let output = [ + "asset_index": try Serialization._UInt64Serializer.serialize(value.assetIndex), + "deadline": try NullableSerializer(TeamLog.FileRequestDeadlineSerializer()).serialize(value.deadline), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestDetails { switch json { - case .dictionary(let dict): - let assetIndex = Serialization._UInt64Serializer.deserialize(dict["asset_index"] ?? .null) - let deadline = NullableSerializer(TeamLog.FileRequestDeadlineSerializer()).deserialize(dict["deadline"] ?? .null) - return FileRequestDetails(assetIndex: assetIndex, deadline: deadline) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let assetIndex = try Serialization._UInt64Serializer.deserialize(dict["asset_index"] ?? .null) + let deadline = try NullableSerializer(TeamLog.FileRequestDeadlineSerializer()).deserialize(dict["deadline"] ?? .null) + return FileRequestDetails(assetIndex: assetIndex, deadline: deadline) + default: + throw JSONSerializerError.deserializeError(type: FileRequestDetails.self, json: json) } } } /// Received files for file request. - open class FileRequestReceiveFileDetails: CustomStringConvertible { + public class FileRequestReceiveFileDetails: CustomStringConvertible, JSONRepresentable { /// File request id. Might be missing due to historical data gap. public let fileRequestId: String? /// File request details. Might be missing due to historical data gap. public let fileRequestDetails: TeamLog.FileRequestDetails? /// Submitted file names. - public let submittedFileNames: Array + public let submittedFileNames: [String] /// The name as provided by the submitter. public let submitterName: String? /// The email as provided by the submitter. public let submitterEmail: String? - public init(submittedFileNames: Array, fileRequestId: String? = nil, fileRequestDetails: TeamLog.FileRequestDetails? = nil, submitterName: String? = nil, submitterEmail: String? = nil) { + public init( + submittedFileNames: [String], + fileRequestId: String? = nil, + fileRequestDetails: TeamLog.FileRequestDetails? = nil, + submitterName: String? = nil, + submitterEmail: String? = nil + ) { nullableValidator(stringValidator(minLength: 1, pattern: "[-_0-9a-zA-Z]+"))(fileRequestId) self.fileRequestId = fileRequestId self.fileRequestDetails = fileRequestDetails @@ -24247,70 +28323,98 @@ open class TeamLog { nullableValidator(stringValidator(maxLength: 255))(submitterEmail) self.submitterEmail = submitterEmail } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestReceiveFileDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestReceiveFileDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestReceiveFileDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestReceiveFileDetails: \(error)" + } } } - open class FileRequestReceiveFileDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestReceiveFileDetails) -> JSON { - let output = [ - "submitted_file_names": ArraySerializer(Serialization._StringSerializer).serialize(value.submittedFileNames), - "file_request_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), - "file_request_details": NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.fileRequestDetails), - "submitter_name": NullableSerializer(Serialization._StringSerializer).serialize(value.submitterName), - "submitter_email": NullableSerializer(Serialization._StringSerializer).serialize(value.submitterEmail), + + public class FileRequestReceiveFileDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestReceiveFileDetails) throws -> JSON { + let output = [ + "submitted_file_names": try ArraySerializer(Serialization._StringSerializer).serialize(value.submittedFileNames), + "file_request_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileRequestId), + "file_request_details": try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).serialize(value.fileRequestDetails), + "submitter_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.submitterName), + "submitter_email": try NullableSerializer(Serialization._StringSerializer).serialize(value.submitterEmail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestReceiveFileDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestReceiveFileDetails { switch json { - case .dictionary(let dict): - let submittedFileNames = ArraySerializer(Serialization._StringSerializer).deserialize(dict["submitted_file_names"] ?? .null) - let fileRequestId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) - let fileRequestDetails = NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["file_request_details"] ?? .null) - let submitterName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["submitter_name"] ?? .null) - let submitterEmail = NullableSerializer(Serialization._StringSerializer).deserialize(dict["submitter_email"] ?? .null) - return FileRequestReceiveFileDetails(submittedFileNames: submittedFileNames, fileRequestId: fileRequestId, fileRequestDetails: fileRequestDetails, submitterName: submitterName, submitterEmail: submitterEmail) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let submittedFileNames = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["submitted_file_names"] ?? .null) + let fileRequestId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_request_id"] ?? .null) + let fileRequestDetails = try NullableSerializer(TeamLog.FileRequestDetailsSerializer()).deserialize(dict["file_request_details"] ?? .null) + let submitterName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["submitter_name"] ?? .null) + let submitterEmail = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["submitter_email"] ?? .null) + return FileRequestReceiveFileDetails( + submittedFileNames: submittedFileNames, + fileRequestId: fileRequestId, + fileRequestDetails: fileRequestDetails, + submitterName: submitterName, + submitterEmail: submitterEmail + ) + default: + throw JSONSerializerError.deserializeError(type: FileRequestReceiveFileDetails.self, json: json) } } } /// The FileRequestReceiveFileType struct - open class FileRequestReceiveFileType: CustomStringConvertible { + public class FileRequestReceiveFileType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestReceiveFileTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestReceiveFileTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestReceiveFileTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestReceiveFileType: \(error)" + } } } - open class FileRequestReceiveFileTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestReceiveFileType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestReceiveFileTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestReceiveFileType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestReceiveFileType { + + public func deserialize(_ json: JSON) throws -> FileRequestReceiveFileType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestReceiveFileType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestReceiveFileType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestReceiveFileType.self, json: json) } } } /// Enabled/disabled file requests. - open class FileRequestsChangePolicyDetails: CustomStringConvertible { + public class FileRequestsChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New file requests policy. public let newValue: TeamLog.FileRequestsPolicy /// Previous file requests policy. Might be missing due to historical data gap. @@ -24319,174 +28423,234 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestsChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestsChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestsChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestsChangePolicyDetails: \(error)" + } } } - open class FileRequestsChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestsChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.FileRequestsPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.FileRequestsPolicySerializer()).serialize(value.previousValue), + + public class FileRequestsChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestsChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.FileRequestsPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.FileRequestsPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestsChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestsChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.FileRequestsPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.FileRequestsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return FileRequestsChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.FileRequestsPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.FileRequestsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return FileRequestsChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: FileRequestsChangePolicyDetails.self, json: json) } } } /// The FileRequestsChangePolicyType struct - open class FileRequestsChangePolicyType: CustomStringConvertible { + public class FileRequestsChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestsChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestsChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestsChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestsChangePolicyType: \(error)" + } } } - open class FileRequestsChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestsChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestsChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestsChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestsChangePolicyType { + + public func deserialize(_ json: JSON) throws -> FileRequestsChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestsChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestsChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestsChangePolicyType.self, json: json) } } } /// Enabled file request emails for everyone. - open class FileRequestsEmailsEnabledDetails: CustomStringConvertible { - public init() { + public class FileRequestsEmailsEnabledDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileRequestsEmailsEnabledDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestsEmailsEnabledDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestsEmailsEnabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestsEmailsEnabledDetails: \(error)" + } } } - open class FileRequestsEmailsEnabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestsEmailsEnabledDetails) -> JSON { + + public class FileRequestsEmailsEnabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestsEmailsEnabledDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestsEmailsEnabledDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestsEmailsEnabledDetails { switch json { - case .dictionary(_): - return FileRequestsEmailsEnabledDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileRequestsEmailsEnabledDetails() + default: + throw JSONSerializerError.deserializeError(type: FileRequestsEmailsEnabledDetails.self, json: json) } } } /// The FileRequestsEmailsEnabledType struct - open class FileRequestsEmailsEnabledType: CustomStringConvertible { + public class FileRequestsEmailsEnabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestsEmailsEnabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestsEmailsEnabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestsEmailsEnabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestsEmailsEnabledType: \(error)" + } } } - open class FileRequestsEmailsEnabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestsEmailsEnabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestsEmailsEnabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestsEmailsEnabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestsEmailsEnabledType { + + public func deserialize(_ json: JSON) throws -> FileRequestsEmailsEnabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestsEmailsEnabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestsEmailsEnabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestsEmailsEnabledType.self, json: json) } } } /// Enabled file request emails for team. - open class FileRequestsEmailsRestrictedToTeamOnlyDetails: CustomStringConvertible { - public init() { + public class FileRequestsEmailsRestrictedToTeamOnlyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestsEmailsRestrictedToTeamOnlyDetails: \(error)" + } } } - open class FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestsEmailsRestrictedToTeamOnlyDetails) -> JSON { + + public class FileRequestsEmailsRestrictedToTeamOnlyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestsEmailsRestrictedToTeamOnlyDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestsEmailsRestrictedToTeamOnlyDetails { + + public func deserialize(_ json: JSON) throws -> FileRequestsEmailsRestrictedToTeamOnlyDetails { switch json { - case .dictionary(_): - return FileRequestsEmailsRestrictedToTeamOnlyDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileRequestsEmailsRestrictedToTeamOnlyDetails() + default: + throw JSONSerializerError.deserializeError(type: FileRequestsEmailsRestrictedToTeamOnlyDetails.self, json: json) } } } /// The FileRequestsEmailsRestrictedToTeamOnlyType struct - open class FileRequestsEmailsRestrictedToTeamOnlyType: CustomStringConvertible { + public class FileRequestsEmailsRestrictedToTeamOnlyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestsEmailsRestrictedToTeamOnlyType: \(error)" + } } } - open class FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestsEmailsRestrictedToTeamOnlyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRequestsEmailsRestrictedToTeamOnlyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestsEmailsRestrictedToTeamOnlyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRequestsEmailsRestrictedToTeamOnlyType { + + public func deserialize(_ json: JSON) throws -> FileRequestsEmailsRestrictedToTeamOnlyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRequestsEmailsRestrictedToTeamOnlyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRequestsEmailsRestrictedToTeamOnlyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRequestsEmailsRestrictedToTeamOnlyType.self, json: json) } } } /// File requests policy - public enum FileRequestsPolicy: CustomStringConvertible { + public enum FileRequestsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -24494,400 +28658,534 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FileRequestsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRequestsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRequestsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRequestsPolicy: \(error)" + } } } - open class FileRequestsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRequestsPolicy) -> JSON { + + public class FileRequestsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRequestsPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileRequestsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return FileRequestsPolicy.disabled - case "enabled": - return FileRequestsPolicy.enabled - case "other": - return FileRequestsPolicy.other - default: - return FileRequestsPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileRequestsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return FileRequestsPolicy.disabled + case "enabled": + return FileRequestsPolicy.enabled + case "other": + return FileRequestsPolicy.other default: - fatalError("Failed to deserialize") + return FileRequestsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: FileRequestsPolicy.self, json: json) } } } /// Resolved file comment. - open class FileResolveCommentDetails: CustomStringConvertible { + public class FileResolveCommentDetails: CustomStringConvertible, JSONRepresentable { /// Comment text. public let commentText: String? public init(commentText: String? = nil) { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileResolveCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileResolveCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileResolveCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileResolveCommentDetails: \(error)" + } } } - open class FileResolveCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileResolveCommentDetails) -> JSON { - let output = [ - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class FileResolveCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileResolveCommentDetails) throws -> JSON { + let output = [ + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileResolveCommentDetails { + + public func deserialize(_ json: JSON) throws -> FileResolveCommentDetails { switch json { - case .dictionary(let dict): - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return FileResolveCommentDetails(commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return FileResolveCommentDetails(commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: FileResolveCommentDetails.self, json: json) } } } /// The FileResolveCommentType struct - open class FileResolveCommentType: CustomStringConvertible { + public class FileResolveCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileResolveCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileResolveCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileResolveCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileResolveCommentType: \(error)" + } } } - open class FileResolveCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileResolveCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileResolveCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileResolveCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileResolveCommentType { + + public func deserialize(_ json: JSON) throws -> FileResolveCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileResolveCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileResolveCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileResolveCommentType.self, json: json) } } } /// Restored deleted files and/or folders. - open class FileRestoreDetails: CustomStringConvertible { - public init() { + public class FileRestoreDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileRestoreDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRestoreDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRestoreDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRestoreDetails: \(error)" + } } } - open class FileRestoreDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRestoreDetails) -> JSON { + + public class FileRestoreDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRestoreDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRestoreDetails { + + public func deserialize(_ json: JSON) throws -> FileRestoreDetails { switch json { - case .dictionary(_): - return FileRestoreDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileRestoreDetails() + default: + throw JSONSerializerError.deserializeError(type: FileRestoreDetails.self, json: json) } } } /// The FileRestoreType struct - open class FileRestoreType: CustomStringConvertible { + public class FileRestoreType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRestoreTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRestoreTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRestoreTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRestoreType: \(error)" + } } } - open class FileRestoreTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRestoreType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRestoreTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRestoreType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRestoreType { + + public func deserialize(_ json: JSON) throws -> FileRestoreType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRestoreType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRestoreType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRestoreType.self, json: json) } } } /// Reverted files to previous version. - open class FileRevertDetails: CustomStringConvertible { - public init() { + public class FileRevertDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileRevertDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRevertDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRevertDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRevertDetails: \(error)" + } } } - open class FileRevertDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRevertDetails) -> JSON { + + public class FileRevertDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRevertDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRevertDetails { + + public func deserialize(_ json: JSON) throws -> FileRevertDetails { switch json { - case .dictionary(_): - return FileRevertDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileRevertDetails() + default: + throw JSONSerializerError.deserializeError(type: FileRevertDetails.self, json: json) } } } /// The FileRevertType struct - open class FileRevertType: CustomStringConvertible { + public class FileRevertType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRevertTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRevertTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRevertTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRevertType: \(error)" + } } } - open class FileRevertTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRevertType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRevertTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRevertType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRevertType { + + public func deserialize(_ json: JSON) throws -> FileRevertType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRevertType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRevertType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRevertType.self, json: json) } } } /// Rolled back file actions. - open class FileRollbackChangesDetails: CustomStringConvertible { - public init() { + public class FileRollbackChangesDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try FileRollbackChangesDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRollbackChangesDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRollbackChangesDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRollbackChangesDetails: \(error)" + } } } - open class FileRollbackChangesDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRollbackChangesDetails) -> JSON { + + public class FileRollbackChangesDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRollbackChangesDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRollbackChangesDetails { + + public func deserialize(_ json: JSON) throws -> FileRollbackChangesDetails { switch json { - case .dictionary(_): - return FileRollbackChangesDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return FileRollbackChangesDetails() + default: + throw JSONSerializerError.deserializeError(type: FileRollbackChangesDetails.self, json: json) } } } /// The FileRollbackChangesType struct - open class FileRollbackChangesType: CustomStringConvertible { + public class FileRollbackChangesType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileRollbackChangesTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileRollbackChangesTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileRollbackChangesTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileRollbackChangesType: \(error)" + } } } - open class FileRollbackChangesTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileRollbackChangesType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileRollbackChangesTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileRollbackChangesType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileRollbackChangesType { + + public func deserialize(_ json: JSON) throws -> FileRollbackChangesType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileRollbackChangesType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileRollbackChangesType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileRollbackChangesType.self, json: json) } } } /// Saved file/folder using copy reference. - open class FileSaveCopyReferenceDetails: CustomStringConvertible { + public class FileSaveCopyReferenceDetails: CustomStringConvertible, JSONRepresentable { /// Relocate action details. - public let relocateActionDetails: Array - public init(relocateActionDetails: Array) { + public let relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo] + public init(relocateActionDetails: [TeamLog.RelocateAssetReferencesLogInfo]) { self.relocateActionDetails = relocateActionDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileSaveCopyReferenceDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileSaveCopyReferenceDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileSaveCopyReferenceDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileSaveCopyReferenceDetails: \(error)" + } } } - open class FileSaveCopyReferenceDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileSaveCopyReferenceDetails) -> JSON { - let output = [ - "relocate_action_details": ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), + + public class FileSaveCopyReferenceDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileSaveCopyReferenceDetails) throws -> JSON { + let output = [ + "relocate_action_details": try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).serialize(value.relocateActionDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileSaveCopyReferenceDetails { + + public func deserialize(_ json: JSON) throws -> FileSaveCopyReferenceDetails { switch json { - case .dictionary(let dict): - let relocateActionDetails = ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()).deserialize(dict["relocate_action_details"] ?? .null) - return FileSaveCopyReferenceDetails(relocateActionDetails: relocateActionDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let relocateActionDetails = try ArraySerializer(TeamLog.RelocateAssetReferencesLogInfoSerializer()) + .deserialize(dict["relocate_action_details"] ?? .null) + return FileSaveCopyReferenceDetails(relocateActionDetails: relocateActionDetails) + default: + throw JSONSerializerError.deserializeError(type: FileSaveCopyReferenceDetails.self, json: json) } } } /// The FileSaveCopyReferenceType struct - open class FileSaveCopyReferenceType: CustomStringConvertible { + public class FileSaveCopyReferenceType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileSaveCopyReferenceTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileSaveCopyReferenceTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileSaveCopyReferenceTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileSaveCopyReferenceType: \(error)" + } } } - open class FileSaveCopyReferenceTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileSaveCopyReferenceType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileSaveCopyReferenceTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileSaveCopyReferenceType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileSaveCopyReferenceType { + + public func deserialize(_ json: JSON) throws -> FileSaveCopyReferenceType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileSaveCopyReferenceType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileSaveCopyReferenceType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileSaveCopyReferenceType.self, json: json) } } } /// Transfer files added. - open class FileTransfersFileAddDetails: CustomStringConvertible { + public class FileTransfersFileAddDetails: CustomStringConvertible, JSONRepresentable { /// Transfer id. public let fileTransferId: String public init(fileTransferId: String) { stringValidator()(fileTransferId) self.fileTransferId = fileTransferId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersFileAddDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersFileAddDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersFileAddDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersFileAddDetails: \(error)" + } } } - open class FileTransfersFileAddDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersFileAddDetails) -> JSON { - let output = [ - "file_transfer_id": Serialization._StringSerializer.serialize(value.fileTransferId), + + public class FileTransfersFileAddDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersFileAddDetails) throws -> JSON { + let output = [ + "file_transfer_id": try Serialization._StringSerializer.serialize(value.fileTransferId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersFileAddDetails { + + public func deserialize(_ json: JSON) throws -> FileTransfersFileAddDetails { switch json { - case .dictionary(let dict): - let fileTransferId = Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) - return FileTransfersFileAddDetails(fileTransferId: fileTransferId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileTransferId = try Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) + return FileTransfersFileAddDetails(fileTransferId: fileTransferId) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersFileAddDetails.self, json: json) } } } /// The FileTransfersFileAddType struct - open class FileTransfersFileAddType: CustomStringConvertible { + public class FileTransfersFileAddType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersFileAddTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersFileAddTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersFileAddTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersFileAddType: \(error)" + } } } - open class FileTransfersFileAddTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersFileAddType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileTransfersFileAddTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersFileAddType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersFileAddType { + + public func deserialize(_ json: JSON) throws -> FileTransfersFileAddType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileTransfersFileAddType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileTransfersFileAddType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersFileAddType.self, json: json) } } } /// File transfers policy - public enum FileTransfersPolicy: CustomStringConvertible { + public enum FileTransfersPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -24895,50 +29193,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FileTransfersPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersPolicy: \(error)" + } } } - open class FileTransfersPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersPolicy) -> JSON { + + public class FileTransfersPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileTransfersPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return FileTransfersPolicy.disabled - case "enabled": - return FileTransfersPolicy.enabled - case "other": - return FileTransfersPolicy.other - default: - return FileTransfersPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileTransfersPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return FileTransfersPolicy.disabled + case "enabled": + return FileTransfersPolicy.enabled + case "other": + return FileTransfersPolicy.other default: - fatalError("Failed to deserialize") + return FileTransfersPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: FileTransfersPolicy.self, json: json) } } } /// Changed file transfers policy for team. - open class FileTransfersPolicyChangedDetails: CustomStringConvertible { + public class FileTransfersPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New file transfers policy. public let newValue: TeamLog.FileTransfersPolicy /// Previous file transfers policy. @@ -24947,436 +29255,590 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersPolicyChangedDetails: \(error)" + } } } - open class FileTransfersPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.FileTransfersPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.FileTransfersPolicySerializer().serialize(value.previousValue), + + public class FileTransfersPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.FileTransfersPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.FileTransfersPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> FileTransfersPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.FileTransfersPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.FileTransfersPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return FileTransfersPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.FileTransfersPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.FileTransfersPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return FileTransfersPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersPolicyChangedDetails.self, json: json) } } } /// The FileTransfersPolicyChangedType struct - open class FileTransfersPolicyChangedType: CustomStringConvertible { + public class FileTransfersPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersPolicyChangedType: \(error)" + } } } - open class FileTransfersPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileTransfersPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> FileTransfersPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileTransfersPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileTransfersPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersPolicyChangedType.self, json: json) } } } /// Deleted transfer. - open class FileTransfersTransferDeleteDetails: CustomStringConvertible { + public class FileTransfersTransferDeleteDetails: CustomStringConvertible, JSONRepresentable { /// Transfer id. public let fileTransferId: String public init(fileTransferId: String) { stringValidator()(fileTransferId) self.fileTransferId = fileTransferId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferDeleteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferDeleteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferDeleteDetails: \(error)" + } } } - open class FileTransfersTransferDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferDeleteDetails) -> JSON { - let output = [ - "file_transfer_id": Serialization._StringSerializer.serialize(value.fileTransferId), + + public class FileTransfersTransferDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferDeleteDetails) throws -> JSON { + let output = [ + "file_transfer_id": try Serialization._StringSerializer.serialize(value.fileTransferId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferDeleteDetails { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferDeleteDetails { switch json { - case .dictionary(let dict): - let fileTransferId = Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) - return FileTransfersTransferDeleteDetails(fileTransferId: fileTransferId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileTransferId = try Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) + return FileTransfersTransferDeleteDetails(fileTransferId: fileTransferId) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferDeleteDetails.self, json: json) } } } /// The FileTransfersTransferDeleteType struct - open class FileTransfersTransferDeleteType: CustomStringConvertible { + public class FileTransfersTransferDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferDeleteType: \(error)" + } } } - open class FileTransfersTransferDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileTransfersTransferDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferDeleteType { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileTransfersTransferDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileTransfersTransferDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferDeleteType.self, json: json) } } } /// Transfer downloaded. - open class FileTransfersTransferDownloadDetails: CustomStringConvertible { + public class FileTransfersTransferDownloadDetails: CustomStringConvertible, JSONRepresentable { /// Transfer id. public let fileTransferId: String public init(fileTransferId: String) { stringValidator()(fileTransferId) self.fileTransferId = fileTransferId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferDownloadDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferDownloadDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferDownloadDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferDownloadDetails: \(error)" + } } } - open class FileTransfersTransferDownloadDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferDownloadDetails) -> JSON { - let output = [ - "file_transfer_id": Serialization._StringSerializer.serialize(value.fileTransferId), + + public class FileTransfersTransferDownloadDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferDownloadDetails) throws -> JSON { + let output = [ + "file_transfer_id": try Serialization._StringSerializer.serialize(value.fileTransferId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferDownloadDetails { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferDownloadDetails { switch json { - case .dictionary(let dict): - let fileTransferId = Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) - return FileTransfersTransferDownloadDetails(fileTransferId: fileTransferId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileTransferId = try Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) + return FileTransfersTransferDownloadDetails(fileTransferId: fileTransferId) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferDownloadDetails.self, json: json) } } } /// The FileTransfersTransferDownloadType struct - open class FileTransfersTransferDownloadType: CustomStringConvertible { + public class FileTransfersTransferDownloadType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferDownloadTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferDownloadTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferDownloadTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferDownloadType: \(error)" + } } } - open class FileTransfersTransferDownloadTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferDownloadType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileTransfersTransferDownloadTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferDownloadType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferDownloadType { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferDownloadType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileTransfersTransferDownloadType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileTransfersTransferDownloadType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferDownloadType.self, json: json) } } } /// Sent transfer. - open class FileTransfersTransferSendDetails: CustomStringConvertible { + public class FileTransfersTransferSendDetails: CustomStringConvertible, JSONRepresentable { /// Transfer id. public let fileTransferId: String public init(fileTransferId: String) { stringValidator()(fileTransferId) self.fileTransferId = fileTransferId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferSendDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferSendDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferSendDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferSendDetails: \(error)" + } } } - open class FileTransfersTransferSendDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferSendDetails) -> JSON { - let output = [ - "file_transfer_id": Serialization._StringSerializer.serialize(value.fileTransferId), + + public class FileTransfersTransferSendDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferSendDetails) throws -> JSON { + let output = [ + "file_transfer_id": try Serialization._StringSerializer.serialize(value.fileTransferId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferSendDetails { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferSendDetails { switch json { - case .dictionary(let dict): - let fileTransferId = Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) - return FileTransfersTransferSendDetails(fileTransferId: fileTransferId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileTransferId = try Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) + return FileTransfersTransferSendDetails(fileTransferId: fileTransferId) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferSendDetails.self, json: json) } } } /// The FileTransfersTransferSendType struct - open class FileTransfersTransferSendType: CustomStringConvertible { + public class FileTransfersTransferSendType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferSendTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferSendTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferSendTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferSendType: \(error)" + } } } - open class FileTransfersTransferSendTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferSendType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileTransfersTransferSendTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferSendType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferSendType { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferSendType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileTransfersTransferSendType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileTransfersTransferSendType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferSendType.self, json: json) } } } /// Viewed transfer. - open class FileTransfersTransferViewDetails: CustomStringConvertible { + public class FileTransfersTransferViewDetails: CustomStringConvertible, JSONRepresentable { /// Transfer id. public let fileTransferId: String public init(fileTransferId: String) { stringValidator()(fileTransferId) self.fileTransferId = fileTransferId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferViewDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferViewDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferViewDetails: \(error)" + } } } - open class FileTransfersTransferViewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferViewDetails) -> JSON { - let output = [ - "file_transfer_id": Serialization._StringSerializer.serialize(value.fileTransferId), + + public class FileTransfersTransferViewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferViewDetails) throws -> JSON { + let output = [ + "file_transfer_id": try Serialization._StringSerializer.serialize(value.fileTransferId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferViewDetails { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferViewDetails { switch json { - case .dictionary(let dict): - let fileTransferId = Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) - return FileTransfersTransferViewDetails(fileTransferId: fileTransferId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let fileTransferId = try Serialization._StringSerializer.deserialize(dict["file_transfer_id"] ?? .null) + return FileTransfersTransferViewDetails(fileTransferId: fileTransferId) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferViewDetails.self, json: json) } } } /// The FileTransfersTransferViewType struct - open class FileTransfersTransferViewType: CustomStringConvertible { + public class FileTransfersTransferViewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileTransfersTransferViewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileTransfersTransferViewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileTransfersTransferViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileTransfersTransferViewType: \(error)" + } } } - open class FileTransfersTransferViewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileTransfersTransferViewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileTransfersTransferViewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileTransfersTransferViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileTransfersTransferViewType { + + public func deserialize(_ json: JSON) throws -> FileTransfersTransferViewType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileTransfersTransferViewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileTransfersTransferViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileTransfersTransferViewType.self, json: json) } } } /// Unliked file comment. - open class FileUnlikeCommentDetails: CustomStringConvertible { + public class FileUnlikeCommentDetails: CustomStringConvertible, JSONRepresentable { /// Comment text. public let commentText: String? public init(commentText: String? = nil) { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileUnlikeCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileUnlikeCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileUnlikeCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileUnlikeCommentDetails: \(error)" + } } } - open class FileUnlikeCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileUnlikeCommentDetails) -> JSON { - let output = [ - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class FileUnlikeCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileUnlikeCommentDetails) throws -> JSON { + let output = [ + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileUnlikeCommentDetails { + + public func deserialize(_ json: JSON) throws -> FileUnlikeCommentDetails { switch json { - case .dictionary(let dict): - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return FileUnlikeCommentDetails(commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return FileUnlikeCommentDetails(commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: FileUnlikeCommentDetails.self, json: json) } } } /// The FileUnlikeCommentType struct - open class FileUnlikeCommentType: CustomStringConvertible { + public class FileUnlikeCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileUnlikeCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileUnlikeCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileUnlikeCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileUnlikeCommentType: \(error)" + } } } - open class FileUnlikeCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileUnlikeCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FileUnlikeCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileUnlikeCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileUnlikeCommentType { + + public func deserialize(_ json: JSON) throws -> FileUnlikeCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileUnlikeCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileUnlikeCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileUnlikeCommentType.self, json: json) } } } /// Unresolved file comment. - open class FileUnresolveCommentDetails: CustomStringConvertible { + public class FileUnresolveCommentDetails: CustomStringConvertible, JSONRepresentable { /// Comment text. public let commentText: String? public init(commentText: String? = nil) { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileUnresolveCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileUnresolveCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileUnresolveCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileUnresolveCommentDetails: \(error)" + } } } - open class FileUnresolveCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileUnresolveCommentDetails) -> JSON { - let output = [ - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class FileUnresolveCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileUnresolveCommentDetails) throws -> JSON { + let output = [ + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileUnresolveCommentDetails { + + public func deserialize(_ json: JSON) throws -> FileUnresolveCommentDetails { switch json { - case .dictionary(let dict): - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return FileUnresolveCommentDetails(commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return FileUnresolveCommentDetails(commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: FileUnresolveCommentDetails.self, json: json) } } } /// The FileUnresolveCommentType struct - open class FileUnresolveCommentType: CustomStringConvertible { + public class FileUnresolveCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileUnresolveCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FileUnresolveCommentTypeSerializer().serialize(self) } - } - open class FileUnresolveCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileUnresolveCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileUnresolveCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileUnresolveCommentType: \(error)" + } + } + } + + public class FileUnresolveCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileUnresolveCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FileUnresolveCommentType { + + public func deserialize(_ json: JSON) throws -> FileUnresolveCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FileUnresolveCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FileUnresolveCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FileUnresolveCommentType.self, json: json) } } } /// Policy for deciding whether applying link restrictions on all team owned folders - public enum FolderLinkRestrictionPolicy: CustomStringConvertible { + public enum FolderLinkRestrictionPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -25384,50 +29846,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try FolderLinkRestrictionPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderLinkRestrictionPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderLinkRestrictionPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderLinkRestrictionPolicy: \(error)" + } } } - open class FolderLinkRestrictionPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderLinkRestrictionPolicy) -> JSON { + + public class FolderLinkRestrictionPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderLinkRestrictionPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FolderLinkRestrictionPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return FolderLinkRestrictionPolicy.disabled - case "enabled": - return FolderLinkRestrictionPolicy.enabled - case "other": - return FolderLinkRestrictionPolicy.other - default: - return FolderLinkRestrictionPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FolderLinkRestrictionPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return FolderLinkRestrictionPolicy.disabled + case "enabled": + return FolderLinkRestrictionPolicy.enabled + case "other": + return FolderLinkRestrictionPolicy.other default: - fatalError("Failed to deserialize") + return FolderLinkRestrictionPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: FolderLinkRestrictionPolicy.self, json: json) } } } /// Changed folder link restrictions policy for team. - open class FolderLinkRestrictionPolicyChangedDetails: CustomStringConvertible { + public class FolderLinkRestrictionPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// To. public let newValue: TeamLog.FolderLinkRestrictionPolicy /// From. @@ -25436,64 +29908,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderLinkRestrictionPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderLinkRestrictionPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderLinkRestrictionPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderLinkRestrictionPolicyChangedDetails: \(error)" + } } } - open class FolderLinkRestrictionPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderLinkRestrictionPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.FolderLinkRestrictionPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.FolderLinkRestrictionPolicySerializer().serialize(value.previousValue), + + public class FolderLinkRestrictionPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderLinkRestrictionPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.FolderLinkRestrictionPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.FolderLinkRestrictionPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderLinkRestrictionPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> FolderLinkRestrictionPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.FolderLinkRestrictionPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.FolderLinkRestrictionPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return FolderLinkRestrictionPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.FolderLinkRestrictionPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.FolderLinkRestrictionPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return FolderLinkRestrictionPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: FolderLinkRestrictionPolicyChangedDetails.self, json: json) } } } /// The FolderLinkRestrictionPolicyChangedType struct - open class FolderLinkRestrictionPolicyChangedType: CustomStringConvertible { + public class FolderLinkRestrictionPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderLinkRestrictionPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderLinkRestrictionPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderLinkRestrictionPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderLinkRestrictionPolicyChangedType: \(error)" + } } } - open class FolderLinkRestrictionPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderLinkRestrictionPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FolderLinkRestrictionPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderLinkRestrictionPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderLinkRestrictionPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> FolderLinkRestrictionPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FolderLinkRestrictionPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FolderLinkRestrictionPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FolderLinkRestrictionPolicyChangedType.self, json: json) } } } /// Folder's logged information. - open class FolderLogInfo: TeamLog.FileOrFolderLogInfo { + public class FolderLogInfo: TeamLog.FileOrFolderLogInfo { /// Number of files within the folder. public let fileCount: UInt64? public init(path: TeamLog.PathLogInfo, displayName: String? = nil, fileId: String? = nil, fileSize: UInt64? = nil, fileCount: UInt64? = nil) { @@ -25501,237 +29995,316 @@ open class TeamLog { self.fileCount = fileCount super.init(path: path, displayName: displayName, fileId: fileId, fileSize: fileSize) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderLogInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderLogInfo: \(error)" + } } } - open class FolderLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderLogInfo) -> JSON { - let output = [ - "path": TeamLog.PathLogInfoSerializer().serialize(value.path), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "file_id": NullableSerializer(Serialization._StringSerializer).serialize(value.fileId), - "file_size": NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileSize), - "file_count": NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileCount), + + public class FolderLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderLogInfo) throws -> JSON { + let output = [ + "path": try TeamLog.PathLogInfoSerializer().serialize(value.path), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "file_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileId), + "file_size": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileSize), + "file_count": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.fileCount), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderLogInfo { + + public func deserialize(_ json: JSON) throws -> FolderLogInfo { switch json { - case .dictionary(let dict): - let path = TeamLog.PathLogInfoSerializer().deserialize(dict["path"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let fileId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_id"] ?? .null) - let fileSize = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_size"] ?? .null) - let fileCount = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_count"] ?? .null) - return FolderLogInfo(path: path, displayName: displayName, fileId: fileId, fileSize: fileSize, fileCount: fileCount) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let path = try TeamLog.PathLogInfoSerializer().deserialize(dict["path"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let fileId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_id"] ?? .null) + let fileSize = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_size"] ?? .null) + let fileCount = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["file_count"] ?? .null) + return FolderLogInfo(path: path, displayName: displayName, fileId: fileId, fileSize: fileSize, fileCount: fileCount) + default: + throw JSONSerializerError.deserializeError(type: FolderLogInfo.self, json: json) } } } /// Updated folder overview. - open class FolderOverviewDescriptionChangedDetails: CustomStringConvertible { + public class FolderOverviewDescriptionChangedDetails: CustomStringConvertible, JSONRepresentable { /// Folder Overview location position in the Assets list. public let folderOverviewLocationAsset: UInt64 public init(folderOverviewLocationAsset: UInt64) { comparableValidator()(folderOverviewLocationAsset) self.folderOverviewLocationAsset = folderOverviewLocationAsset } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderOverviewDescriptionChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderOverviewDescriptionChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderOverviewDescriptionChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderOverviewDescriptionChangedDetails: \(error)" + } } } - open class FolderOverviewDescriptionChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderOverviewDescriptionChangedDetails) -> JSON { - let output = [ - "folder_overview_location_asset": Serialization._UInt64Serializer.serialize(value.folderOverviewLocationAsset), + + public class FolderOverviewDescriptionChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderOverviewDescriptionChangedDetails) throws -> JSON { + let output = [ + "folder_overview_location_asset": try Serialization._UInt64Serializer.serialize(value.folderOverviewLocationAsset), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderOverviewDescriptionChangedDetails { + + public func deserialize(_ json: JSON) throws -> FolderOverviewDescriptionChangedDetails { switch json { - case .dictionary(let dict): - let folderOverviewLocationAsset = Serialization._UInt64Serializer.deserialize(dict["folder_overview_location_asset"] ?? .null) - return FolderOverviewDescriptionChangedDetails(folderOverviewLocationAsset: folderOverviewLocationAsset) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let folderOverviewLocationAsset = try Serialization._UInt64Serializer.deserialize(dict["folder_overview_location_asset"] ?? .null) + return FolderOverviewDescriptionChangedDetails(folderOverviewLocationAsset: folderOverviewLocationAsset) + default: + throw JSONSerializerError.deserializeError(type: FolderOverviewDescriptionChangedDetails.self, json: json) } } } /// The FolderOverviewDescriptionChangedType struct - open class FolderOverviewDescriptionChangedType: CustomStringConvertible { + public class FolderOverviewDescriptionChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderOverviewDescriptionChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderOverviewDescriptionChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderOverviewDescriptionChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderOverviewDescriptionChangedType: \(error)" + } } } - open class FolderOverviewDescriptionChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderOverviewDescriptionChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FolderOverviewDescriptionChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderOverviewDescriptionChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderOverviewDescriptionChangedType { + + public func deserialize(_ json: JSON) throws -> FolderOverviewDescriptionChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FolderOverviewDescriptionChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FolderOverviewDescriptionChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FolderOverviewDescriptionChangedType.self, json: json) } } } /// Pinned item to folder overview. - open class FolderOverviewItemPinnedDetails: CustomStringConvertible { + public class FolderOverviewItemPinnedDetails: CustomStringConvertible, JSONRepresentable { /// Folder Overview location position in the Assets list. public let folderOverviewLocationAsset: UInt64 /// Pinned items positions in the Assets list. - public let pinnedItemsAssetIndices: Array - public init(folderOverviewLocationAsset: UInt64, pinnedItemsAssetIndices: Array) { + public let pinnedItemsAssetIndices: [UInt64] + public init(folderOverviewLocationAsset: UInt64, pinnedItemsAssetIndices: [UInt64]) { comparableValidator()(folderOverviewLocationAsset) self.folderOverviewLocationAsset = folderOverviewLocationAsset arrayValidator(itemValidator: comparableValidator())(pinnedItemsAssetIndices) self.pinnedItemsAssetIndices = pinnedItemsAssetIndices } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderOverviewItemPinnedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderOverviewItemPinnedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderOverviewItemPinnedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderOverviewItemPinnedDetails: \(error)" + } } } - open class FolderOverviewItemPinnedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderOverviewItemPinnedDetails) -> JSON { - let output = [ - "folder_overview_location_asset": Serialization._UInt64Serializer.serialize(value.folderOverviewLocationAsset), - "pinned_items_asset_indices": ArraySerializer(Serialization._UInt64Serializer).serialize(value.pinnedItemsAssetIndices), + + public class FolderOverviewItemPinnedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderOverviewItemPinnedDetails) throws -> JSON { + let output = [ + "folder_overview_location_asset": try Serialization._UInt64Serializer.serialize(value.folderOverviewLocationAsset), + "pinned_items_asset_indices": try ArraySerializer(Serialization._UInt64Serializer).serialize(value.pinnedItemsAssetIndices), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderOverviewItemPinnedDetails { + + public func deserialize(_ json: JSON) throws -> FolderOverviewItemPinnedDetails { switch json { - case .dictionary(let dict): - let folderOverviewLocationAsset = Serialization._UInt64Serializer.deserialize(dict["folder_overview_location_asset"] ?? .null) - let pinnedItemsAssetIndices = ArraySerializer(Serialization._UInt64Serializer).deserialize(dict["pinned_items_asset_indices"] ?? .null) - return FolderOverviewItemPinnedDetails(folderOverviewLocationAsset: folderOverviewLocationAsset, pinnedItemsAssetIndices: pinnedItemsAssetIndices) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let folderOverviewLocationAsset = try Serialization._UInt64Serializer.deserialize(dict["folder_overview_location_asset"] ?? .null) + let pinnedItemsAssetIndices = try ArraySerializer(Serialization._UInt64Serializer).deserialize(dict["pinned_items_asset_indices"] ?? .null) + return FolderOverviewItemPinnedDetails( + folderOverviewLocationAsset: folderOverviewLocationAsset, + pinnedItemsAssetIndices: pinnedItemsAssetIndices + ) + default: + throw JSONSerializerError.deserializeError(type: FolderOverviewItemPinnedDetails.self, json: json) } } } /// The FolderOverviewItemPinnedType struct - open class FolderOverviewItemPinnedType: CustomStringConvertible { + public class FolderOverviewItemPinnedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderOverviewItemPinnedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderOverviewItemPinnedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderOverviewItemPinnedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderOverviewItemPinnedType: \(error)" + } } } - open class FolderOverviewItemPinnedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderOverviewItemPinnedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FolderOverviewItemPinnedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderOverviewItemPinnedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderOverviewItemPinnedType { + + public func deserialize(_ json: JSON) throws -> FolderOverviewItemPinnedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FolderOverviewItemPinnedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FolderOverviewItemPinnedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FolderOverviewItemPinnedType.self, json: json) } } } /// Unpinned item from folder overview. - open class FolderOverviewItemUnpinnedDetails: CustomStringConvertible { + public class FolderOverviewItemUnpinnedDetails: CustomStringConvertible, JSONRepresentable { /// Folder Overview location position in the Assets list. public let folderOverviewLocationAsset: UInt64 /// Pinned items positions in the Assets list. - public let pinnedItemsAssetIndices: Array - public init(folderOverviewLocationAsset: UInt64, pinnedItemsAssetIndices: Array) { + public let pinnedItemsAssetIndices: [UInt64] + public init(folderOverviewLocationAsset: UInt64, pinnedItemsAssetIndices: [UInt64]) { comparableValidator()(folderOverviewLocationAsset) self.folderOverviewLocationAsset = folderOverviewLocationAsset arrayValidator(itemValidator: comparableValidator())(pinnedItemsAssetIndices) self.pinnedItemsAssetIndices = pinnedItemsAssetIndices } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderOverviewItemUnpinnedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderOverviewItemUnpinnedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderOverviewItemUnpinnedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderOverviewItemUnpinnedDetails: \(error)" + } } } - open class FolderOverviewItemUnpinnedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderOverviewItemUnpinnedDetails) -> JSON { - let output = [ - "folder_overview_location_asset": Serialization._UInt64Serializer.serialize(value.folderOverviewLocationAsset), - "pinned_items_asset_indices": ArraySerializer(Serialization._UInt64Serializer).serialize(value.pinnedItemsAssetIndices), + + public class FolderOverviewItemUnpinnedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderOverviewItemUnpinnedDetails) throws -> JSON { + let output = [ + "folder_overview_location_asset": try Serialization._UInt64Serializer.serialize(value.folderOverviewLocationAsset), + "pinned_items_asset_indices": try ArraySerializer(Serialization._UInt64Serializer).serialize(value.pinnedItemsAssetIndices), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderOverviewItemUnpinnedDetails { + + public func deserialize(_ json: JSON) throws -> FolderOverviewItemUnpinnedDetails { switch json { - case .dictionary(let dict): - let folderOverviewLocationAsset = Serialization._UInt64Serializer.deserialize(dict["folder_overview_location_asset"] ?? .null) - let pinnedItemsAssetIndices = ArraySerializer(Serialization._UInt64Serializer).deserialize(dict["pinned_items_asset_indices"] ?? .null) - return FolderOverviewItemUnpinnedDetails(folderOverviewLocationAsset: folderOverviewLocationAsset, pinnedItemsAssetIndices: pinnedItemsAssetIndices) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let folderOverviewLocationAsset = try Serialization._UInt64Serializer.deserialize(dict["folder_overview_location_asset"] ?? .null) + let pinnedItemsAssetIndices = try ArraySerializer(Serialization._UInt64Serializer).deserialize(dict["pinned_items_asset_indices"] ?? .null) + return FolderOverviewItemUnpinnedDetails( + folderOverviewLocationAsset: folderOverviewLocationAsset, + pinnedItemsAssetIndices: pinnedItemsAssetIndices + ) + default: + throw JSONSerializerError.deserializeError(type: FolderOverviewItemUnpinnedDetails.self, json: json) } } } /// The FolderOverviewItemUnpinnedType struct - open class FolderOverviewItemUnpinnedType: CustomStringConvertible { + public class FolderOverviewItemUnpinnedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FolderOverviewItemUnpinnedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try FolderOverviewItemUnpinnedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FolderOverviewItemUnpinnedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FolderOverviewItemUnpinnedType: \(error)" + } } } - open class FolderOverviewItemUnpinnedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FolderOverviewItemUnpinnedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class FolderOverviewItemUnpinnedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FolderOverviewItemUnpinnedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FolderOverviewItemUnpinnedType { + + public func deserialize(_ json: JSON) throws -> FolderOverviewItemUnpinnedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return FolderOverviewItemUnpinnedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return FolderOverviewItemUnpinnedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: FolderOverviewItemUnpinnedType.self, json: json) } } } /// Geographic location details. - open class GeoLocationLogInfo: CustomStringConvertible { + public class GeoLocationLogInfo: CustomStringConvertible, JSONRepresentable { /// City name. public let city: String? /// Region name. @@ -25750,40 +30323,51 @@ open class TeamLog { stringValidator()(ipAddress) self.ipAddress = ipAddress } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GeoLocationLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try GeoLocationLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GeoLocationLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GeoLocationLogInfo: \(error)" + } } } - open class GeoLocationLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GeoLocationLogInfo) -> JSON { - let output = [ - "ip_address": Serialization._StringSerializer.serialize(value.ipAddress), - "city": NullableSerializer(Serialization._StringSerializer).serialize(value.city), - "region": NullableSerializer(Serialization._StringSerializer).serialize(value.region), - "country": NullableSerializer(Serialization._StringSerializer).serialize(value.country), + + public class GeoLocationLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GeoLocationLogInfo) throws -> JSON { + let output = [ + "ip_address": try Serialization._StringSerializer.serialize(value.ipAddress), + "city": try NullableSerializer(Serialization._StringSerializer).serialize(value.city), + "region": try NullableSerializer(Serialization._StringSerializer).serialize(value.region), + "country": try NullableSerializer(Serialization._StringSerializer).serialize(value.country), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GeoLocationLogInfo { + + public func deserialize(_ json: JSON) throws -> GeoLocationLogInfo { switch json { - case .dictionary(let dict): - let ipAddress = Serialization._StringSerializer.deserialize(dict["ip_address"] ?? .null) - let city = NullableSerializer(Serialization._StringSerializer).deserialize(dict["city"] ?? .null) - let region = NullableSerializer(Serialization._StringSerializer).deserialize(dict["region"] ?? .null) - let country = NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) - return GeoLocationLogInfo(ipAddress: ipAddress, city: city, region: region, country: country) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let ipAddress = try Serialization._StringSerializer.deserialize(dict["ip_address"] ?? .null) + let city = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["city"] ?? .null) + let region = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["region"] ?? .null) + let country = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) + return GeoLocationLogInfo(ipAddress: ipAddress, city: city, region: region, country: country) + default: + throw JSONSerializerError.deserializeError(type: GeoLocationLogInfo.self, json: json) } } } /// The GetTeamEventsArg struct - open class GetTeamEventsArg: CustomStringConvertible { + public class GetTeamEventsArg: CustomStringConvertible, JSONRepresentable { /// The maximal number of results to return per call. Note that some calls may not return limit number of - /// events, and may even return no events, even with `has_more` set to true. In this case, callers should fetch - /// again using getEventsContinue. + /// events, and may even return no events, even with `has_more` set to true. In this case, callers + /// should fetch again using getEventsContinue. public let limit: UInt32 /// Filter the events by account ID. Return only events with this account_id as either Actor, Context, or /// Participants. @@ -25796,8 +30380,14 @@ open class TeamLog { /// Filter the returned events to a single event type. Note that event_type shouldn't be provided together with /// category. public let eventType: TeamLog.EventTypeArg? - public init(limit: UInt32 = 1000, accountId: String? = nil, time: TeamCommon.TimeRange? = nil, category: TeamLog.EventCategory? = nil, eventType: TeamLog.EventTypeArg? = nil) { - comparableValidator(minValue: 1, maxValue: 1000)(limit) + public init( + limit: UInt32 = 1_000, + accountId: String? = nil, + time: TeamCommon.TimeRange? = nil, + category: TeamLog.EventCategory? = nil, + eventType: TeamLog.EventTypeArg? = nil + ) { + comparableValidator(minValue: 1, maxValue: 1_000)(limit) self.limit = limit nullableValidator(stringValidator(minLength: 40, maxLength: 40))(accountId) self.accountId = accountId @@ -25805,125 +30395,157 @@ open class TeamLog { self.category = category self.eventType = eventType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTeamEventsArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTeamEventsArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTeamEventsArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTeamEventsArg: \(error)" + } } } - open class GetTeamEventsArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTeamEventsArg) -> JSON { - let output = [ - "limit": Serialization._UInt32Serializer.serialize(value.limit), - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), - "time": NullableSerializer(TeamCommon.TimeRangeSerializer()).serialize(value.time), - "category": NullableSerializer(TeamLog.EventCategorySerializer()).serialize(value.category), - "event_type": NullableSerializer(TeamLog.EventTypeArgSerializer()).serialize(value.eventType), + + public class GetTeamEventsArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTeamEventsArg) throws -> JSON { + let output = [ + "limit": try Serialization._UInt32Serializer.serialize(value.limit), + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + "time": try NullableSerializer(TeamCommon.TimeRangeSerializer()).serialize(value.time), + "category": try NullableSerializer(TeamLog.EventCategorySerializer()).serialize(value.category), + "event_type": try NullableSerializer(TeamLog.EventTypeArgSerializer()).serialize(value.eventType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTeamEventsArg { + + public func deserialize(_ json: JSON) throws -> GetTeamEventsArg { switch json { - case .dictionary(let dict): - let limit = Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1000)) - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - let time = NullableSerializer(TeamCommon.TimeRangeSerializer()).deserialize(dict["time"] ?? .null) - let category = NullableSerializer(TeamLog.EventCategorySerializer()).deserialize(dict["category"] ?? .null) - let eventType = NullableSerializer(TeamLog.EventTypeArgSerializer()).deserialize(dict["event_type"] ?? .null) - return GetTeamEventsArg(limit: limit, accountId: accountId, time: time, category: category, eventType: eventType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let limit = try Serialization._UInt32Serializer.deserialize(dict["limit"] ?? .number(1_000)) + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + let time = try NullableSerializer(TeamCommon.TimeRangeSerializer()).deserialize(dict["time"] ?? .null) + let category = try NullableSerializer(TeamLog.EventCategorySerializer()).deserialize(dict["category"] ?? .null) + let eventType = try NullableSerializer(TeamLog.EventTypeArgSerializer()).deserialize(dict["event_type"] ?? .null) + return GetTeamEventsArg(limit: limit, accountId: accountId, time: time, category: category, eventType: eventType) + default: + throw JSONSerializerError.deserializeError(type: GetTeamEventsArg.self, json: json) } } } /// The GetTeamEventsContinueArg struct - open class GetTeamEventsContinueArg: CustomStringConvertible { + public class GetTeamEventsContinueArg: CustomStringConvertible, JSONRepresentable { /// Indicates from what point to get the next set of events. public let cursor: String public init(cursor: String) { stringValidator()(cursor) self.cursor = cursor } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTeamEventsContinueArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTeamEventsContinueArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTeamEventsContinueArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTeamEventsContinueArg: \(error)" + } } } - open class GetTeamEventsContinueArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTeamEventsContinueArg) -> JSON { - let output = [ - "cursor": Serialization._StringSerializer.serialize(value.cursor), + + public class GetTeamEventsContinueArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTeamEventsContinueArg) throws -> JSON { + let output = [ + "cursor": try Serialization._StringSerializer.serialize(value.cursor), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTeamEventsContinueArg { + + public func deserialize(_ json: JSON) throws -> GetTeamEventsContinueArg { switch json { - case .dictionary(let dict): - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - return GetTeamEventsContinueArg(cursor: cursor) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + return GetTeamEventsContinueArg(cursor: cursor) + default: + throw JSONSerializerError.deserializeError(type: GetTeamEventsContinueArg.self, json: json) } } } /// Errors that can be raised when calling getEventsContinue. - public enum GetTeamEventsContinueError: CustomStringConvertible { + public enum GetTeamEventsContinueError: CustomStringConvertible, JSONRepresentable { /// Bad cursor. case badCursor /// Cursors are intended to be used quickly. Individual cursor values are normally valid for days, but in rare - /// cases may be reset sooner. Cursor reset errors should be handled by fetching a new cursor from getEvents. - /// The associated value is the approximate timestamp of the most recent event returned by the cursor. This - /// should be used as a resumption point when calling getEvents to obtain a new cursor. + /// cases may be reset sooner. Cursor reset errors should be handled by fetching a new cursor from + /// getEvents. The associated value is the approximate timestamp of the most recent event returned by + /// the cursor. This should be used as a resumption point when calling getEvents to obtain a new cursor. case reset(Date) /// An unspecified error. case other + func json() throws -> JSON { + try GetTeamEventsContinueErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTeamEventsContinueErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTeamEventsContinueErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTeamEventsContinueError: \(error)" + } } } - open class GetTeamEventsContinueErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTeamEventsContinueError) -> JSON { + + public class GetTeamEventsContinueErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTeamEventsContinueError) throws -> JSON { switch value { - case .badCursor: - var d = [String: JSON]() - d[".tag"] = .str("bad_cursor") - return .dictionary(d) - case .reset(let arg): - var d = ["reset": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(arg)] - d[".tag"] = .str("reset") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetTeamEventsContinueError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "bad_cursor": - return GetTeamEventsContinueError.badCursor - case "reset": - let v = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(d["reset"] ?? .null) - return GetTeamEventsContinueError.reset(v) - case "other": - return GetTeamEventsContinueError.other - default: - return GetTeamEventsContinueError.other - } + case .badCursor: + var d = [String: JSON]() + d[".tag"] = .str("bad_cursor") + return .dictionary(d) + case .reset(let arg): + var d = try ["reset": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(arg)] + d[".tag"] = .str("reset") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetTeamEventsContinueError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "bad_cursor": + return GetTeamEventsContinueError.badCursor + case "reset": + let v = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(d["reset"] ?? .null) + return GetTeamEventsContinueError.reset(v) + case "other": + return GetTeamEventsContinueError.other default: - fatalError("Failed to deserialize") + return GetTeamEventsContinueError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetTeamEventsContinueError.self, json: json) } } } /// Errors that can be raised when calling getEvents. - public enum GetTeamEventsError: CustomStringConvertible { + public enum GetTeamEventsError: CustomStringConvertible, JSONRepresentable { /// No user found matching the provided account_id. case accountIdNotFound /// Invalid time range. @@ -25933,102 +30555,123 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try GetTeamEventsErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTeamEventsErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTeamEventsErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTeamEventsError: \(error)" + } } } - open class GetTeamEventsErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTeamEventsError) -> JSON { + + public class GetTeamEventsErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTeamEventsError) throws -> JSON { switch value { - case .accountIdNotFound: - var d = [String: JSON]() - d[".tag"] = .str("account_id_not_found") - return .dictionary(d) - case .invalidTimeRange: - var d = [String: JSON]() - d[".tag"] = .str("invalid_time_range") - return .dictionary(d) - case .invalidFilters: - var d = [String: JSON]() - d[".tag"] = .str("invalid_filters") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GetTeamEventsError { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "account_id_not_found": - return GetTeamEventsError.accountIdNotFound - case "invalid_time_range": - return GetTeamEventsError.invalidTimeRange - case "invalid_filters": - return GetTeamEventsError.invalidFilters - case "other": - return GetTeamEventsError.other - default: - return GetTeamEventsError.other - } - default: - fatalError("Failed to deserialize") + case .accountIdNotFound: + var d = [String: JSON]() + d[".tag"] = .str("account_id_not_found") + return .dictionary(d) + case .invalidTimeRange: + var d = [String: JSON]() + d[".tag"] = .str("invalid_time_range") + return .dictionary(d) + case .invalidFilters: + var d = [String: JSON]() + d[".tag"] = .str("invalid_filters") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetTeamEventsError { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "account_id_not_found": + return GetTeamEventsError.accountIdNotFound + case "invalid_time_range": + return GetTeamEventsError.invalidTimeRange + case "invalid_filters": + return GetTeamEventsError.invalidFilters + case "other": + return GetTeamEventsError.other + default: + return GetTeamEventsError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetTeamEventsError.self, json: json) } } } /// The GetTeamEventsResult struct - open class GetTeamEventsResult: CustomStringConvertible { + public class GetTeamEventsResult: CustomStringConvertible, JSONRepresentable { /// List of events. Note that events are not guaranteed to be sorted by their timestamp value. - public let events: Array + public let events: [TeamLog.TeamEvent] /// Pass the cursor into getEventsContinue to obtain additional events. The value of cursor may change for each - /// response from getEventsContinue, regardless of the value of hasMore; older cursor strings may expire. Thus, - /// callers should ensure that they update their cursor based on the latest value of cursor after each call, and - /// poll regularly if they wish to poll for new events. Callers should handle reset exceptions for expired - /// cursors. + /// response from getEventsContinue, regardless of the value of hasMore; older cursor strings may + /// expire. Thus, callers should ensure that they update their cursor based on the latest value of + /// cursor after each call, and poll regularly if they wish to poll for new events. Callers should + /// handle reset exceptions for expired cursors. public let cursor: String /// Is true if there may be additional events that have not been returned yet. An additional call to /// getEventsContinue can retrieve them. Note that hasMore may be true, even if events is empty. public let hasMore: Bool - public init(events: Array, cursor: String, hasMore: Bool) { + public init(events: [TeamLog.TeamEvent], cursor: String, hasMore: Bool) { self.events = events stringValidator()(cursor) self.cursor = cursor self.hasMore = hasMore } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetTeamEventsResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetTeamEventsResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTeamEventsResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTeamEventsResult: \(error)" + } } } - open class GetTeamEventsResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetTeamEventsResult) -> JSON { - let output = [ - "events": ArraySerializer(TeamLog.TeamEventSerializer()).serialize(value.events), - "cursor": Serialization._StringSerializer.serialize(value.cursor), - "has_more": Serialization._BoolSerializer.serialize(value.hasMore), + + public class GetTeamEventsResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTeamEventsResult) throws -> JSON { + let output = [ + "events": try ArraySerializer(TeamLog.TeamEventSerializer()).serialize(value.events), + "cursor": try Serialization._StringSerializer.serialize(value.cursor), + "has_more": try Serialization._BoolSerializer.serialize(value.hasMore), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetTeamEventsResult { + + public func deserialize(_ json: JSON) throws -> GetTeamEventsResult { switch json { - case .dictionary(let dict): - let events = ArraySerializer(TeamLog.TeamEventSerializer()).deserialize(dict["events"] ?? .null) - let cursor = Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) - let hasMore = Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) - return GetTeamEventsResult(events: events, cursor: cursor, hasMore: hasMore) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let events = try ArraySerializer(TeamLog.TeamEventSerializer()).deserialize(dict["events"] ?? .null) + let cursor = try Serialization._StringSerializer.deserialize(dict["cursor"] ?? .null) + let hasMore = try Serialization._BoolSerializer.deserialize(dict["has_more"] ?? .null) + return GetTeamEventsResult(events: events, cursor: cursor, hasMore: hasMore) + default: + throw JSONSerializerError.deserializeError(type: GetTeamEventsResult.self, json: json) } } } /// Enabled/disabled Google single sign-on for team. - open class GoogleSsoChangePolicyDetails: CustomStringConvertible { + public class GoogleSsoChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New Google single sign-on policy. public let newValue: TeamLog.GoogleSsoPolicy /// Previous Google single sign-on policy. Might be missing due to historical data gap. @@ -26037,64 +30680,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GoogleSsoChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GoogleSsoChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GoogleSsoChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GoogleSsoChangePolicyDetails: \(error)" + } } } - open class GoogleSsoChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GoogleSsoChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.GoogleSsoPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.GoogleSsoPolicySerializer()).serialize(value.previousValue), + + public class GoogleSsoChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GoogleSsoChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.GoogleSsoPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.GoogleSsoPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GoogleSsoChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> GoogleSsoChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.GoogleSsoPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.GoogleSsoPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return GoogleSsoChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.GoogleSsoPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.GoogleSsoPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return GoogleSsoChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: GoogleSsoChangePolicyDetails.self, json: json) } } } /// The GoogleSsoChangePolicyType struct - open class GoogleSsoChangePolicyType: CustomStringConvertible { + public class GoogleSsoChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GoogleSsoChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GoogleSsoChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GoogleSsoChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GoogleSsoChangePolicyType: \(error)" + } } } - open class GoogleSsoChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GoogleSsoChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GoogleSsoChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GoogleSsoChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GoogleSsoChangePolicyType { + + public func deserialize(_ json: JSON) throws -> GoogleSsoChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GoogleSsoChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GoogleSsoChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GoogleSsoChangePolicyType.self, json: json) } } } /// Google SSO policy - public enum GoogleSsoPolicy: CustomStringConvertible { + public enum GoogleSsoPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -26102,50 +30767,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try GoogleSsoPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GoogleSsoPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GoogleSsoPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for GoogleSsoPolicy: \(error)" + } } } - open class GoogleSsoPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GoogleSsoPolicy) -> JSON { + + public class GoogleSsoPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GoogleSsoPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GoogleSsoPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return GoogleSsoPolicy.disabled - case "enabled": - return GoogleSsoPolicy.enabled - case "other": - return GoogleSsoPolicy.other - default: - return GoogleSsoPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GoogleSsoPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return GoogleSsoPolicy.disabled + case "enabled": + return GoogleSsoPolicy.enabled + case "other": + return GoogleSsoPolicy.other default: - fatalError("Failed to deserialize") + return GoogleSsoPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: GoogleSsoPolicy.self, json: json) } } } /// Couldn't add a folder to a policy. - open class GovernancePolicyAddFolderFailedDetails: CustomStringConvertible { + public class GovernancePolicyAddFolderFailedDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26167,70 +30842,98 @@ open class TeamLog { nullableValidator(stringValidator())(reason) self.reason = reason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyAddFolderFailedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyAddFolderFailedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyAddFolderFailedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyAddFolderFailedDetails: \(error)" + } } } - open class GovernancePolicyAddFolderFailedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyAddFolderFailedDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "folder": Serialization._StringSerializer.serialize(value.folder), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), - "reason": NullableSerializer(Serialization._StringSerializer).serialize(value.reason), + + public class GovernancePolicyAddFolderFailedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyAddFolderFailedDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "folder": try Serialization._StringSerializer.serialize(value.folder), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + "reason": try NullableSerializer(Serialization._StringSerializer).serialize(value.reason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyAddFolderFailedDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyAddFolderFailedDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let folder = Serialization._StringSerializer.deserialize(dict["folder"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - let reason = NullableSerializer(Serialization._StringSerializer).deserialize(dict["reason"] ?? .null) - return GovernancePolicyAddFolderFailedDetails(governancePolicyId: governancePolicyId, name: name, folder: folder, policyType: policyType, reason: reason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let folder = try Serialization._StringSerializer.deserialize(dict["folder"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + let reason = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["reason"] ?? .null) + return GovernancePolicyAddFolderFailedDetails( + governancePolicyId: governancePolicyId, + name: name, + folder: folder, + policyType: policyType, + reason: reason + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyAddFolderFailedDetails.self, json: json) } } } /// The GovernancePolicyAddFolderFailedType struct - open class GovernancePolicyAddFolderFailedType: CustomStringConvertible { + public class GovernancePolicyAddFolderFailedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyAddFolderFailedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyAddFolderFailedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyAddFolderFailedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyAddFolderFailedType: \(error)" + } } } - open class GovernancePolicyAddFolderFailedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyAddFolderFailedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyAddFolderFailedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyAddFolderFailedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyAddFolderFailedType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyAddFolderFailedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyAddFolderFailedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyAddFolderFailedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyAddFolderFailedType.self, json: json) } } } /// Added folders to policy. - open class GovernancePolicyAddFoldersDetails: CustomStringConvertible { + public class GovernancePolicyAddFoldersDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26238,8 +30941,8 @@ open class TeamLog { /// Policy type. public let policyType: TeamLog.PolicyType? /// Folders. - public let folders: Array? - public init(governancePolicyId: String, name: String, policyType: TeamLog.PolicyType? = nil, folders: Array? = nil) { + public let folders: [String]? + public init(governancePolicyId: String, name: String, policyType: TeamLog.PolicyType? = nil, folders: [String]? = nil) { stringValidator()(governancePolicyId) self.governancePolicyId = governancePolicyId stringValidator()(name) @@ -26248,68 +30951,90 @@ open class TeamLog { nullableValidator(arrayValidator(itemValidator: stringValidator()))(folders) self.folders = folders } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyAddFoldersDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyAddFoldersDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyAddFoldersDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyAddFoldersDetails: \(error)" + } } } - open class GovernancePolicyAddFoldersDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyAddFoldersDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), - "folders": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.folders), + + public class GovernancePolicyAddFoldersDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyAddFoldersDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + "folders": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.folders), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyAddFoldersDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyAddFoldersDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - let folders = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["folders"] ?? .null) - return GovernancePolicyAddFoldersDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType, folders: folders) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + let folders = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["folders"] ?? .null) + return GovernancePolicyAddFoldersDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType, folders: folders) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyAddFoldersDetails.self, json: json) } } } /// The GovernancePolicyAddFoldersType struct - open class GovernancePolicyAddFoldersType: CustomStringConvertible { + public class GovernancePolicyAddFoldersType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyAddFoldersTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyAddFoldersTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyAddFoldersTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyAddFoldersType: \(error)" + } } } - open class GovernancePolicyAddFoldersTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyAddFoldersType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyAddFoldersTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyAddFoldersType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyAddFoldersType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyAddFoldersType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyAddFoldersType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyAddFoldersType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyAddFoldersType.self, json: json) } } } /// Content disposed. - open class GovernancePolicyContentDisposedDetails: CustomStringConvertible { + public class GovernancePolicyContentDisposedDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26326,68 +31051,95 @@ open class TeamLog { self.policyType = policyType self.dispositionType = dispositionType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyContentDisposedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyContentDisposedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyContentDisposedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyContentDisposedDetails: \(error)" + } } } - open class GovernancePolicyContentDisposedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyContentDisposedDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "disposition_type": TeamLog.DispositionActionTypeSerializer().serialize(value.dispositionType), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + + public class GovernancePolicyContentDisposedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyContentDisposedDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "disposition_type": try TeamLog.DispositionActionTypeSerializer().serialize(value.dispositionType), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyContentDisposedDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyContentDisposedDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let dispositionType = TeamLog.DispositionActionTypeSerializer().deserialize(dict["disposition_type"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - return GovernancePolicyContentDisposedDetails(governancePolicyId: governancePolicyId, name: name, dispositionType: dispositionType, policyType: policyType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let dispositionType = try TeamLog.DispositionActionTypeSerializer().deserialize(dict["disposition_type"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + return GovernancePolicyContentDisposedDetails( + governancePolicyId: governancePolicyId, + name: name, + dispositionType: dispositionType, + policyType: policyType + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyContentDisposedDetails.self, json: json) } } } /// The GovernancePolicyContentDisposedType struct - open class GovernancePolicyContentDisposedType: CustomStringConvertible { + public class GovernancePolicyContentDisposedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyContentDisposedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyContentDisposedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyContentDisposedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyContentDisposedType: \(error)" + } } } - open class GovernancePolicyContentDisposedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyContentDisposedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyContentDisposedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyContentDisposedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyContentDisposedType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyContentDisposedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyContentDisposedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyContentDisposedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyContentDisposedType.self, json: json) } } } /// Activated a new policy. - open class GovernancePolicyCreateDetails: CustomStringConvertible { + public class GovernancePolicyCreateDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26397,8 +31149,14 @@ open class TeamLog { /// Duration in days. public let duration: TeamLog.DurationLogInfo /// Folders. - public let folders: Array? - public init(governancePolicyId: String, name: String, duration: TeamLog.DurationLogInfo, policyType: TeamLog.PolicyType? = nil, folders: Array? = nil) { + public let folders: [String]? + public init( + governancePolicyId: String, + name: String, + duration: TeamLog.DurationLogInfo, + policyType: TeamLog.PolicyType? = nil, + folders: [String]? = nil + ) { stringValidator()(governancePolicyId) self.governancePolicyId = governancePolicyId stringValidator()(name) @@ -26408,70 +31166,98 @@ open class TeamLog { nullableValidator(arrayValidator(itemValidator: stringValidator()))(folders) self.folders = folders } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyCreateDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyCreateDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyCreateDetails: \(error)" + } } } - open class GovernancePolicyCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyCreateDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "duration": TeamLog.DurationLogInfoSerializer().serialize(value.duration), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), - "folders": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.folders), + + public class GovernancePolicyCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyCreateDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "duration": try TeamLog.DurationLogInfoSerializer().serialize(value.duration), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + "folders": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.folders), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyCreateDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyCreateDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let duration = TeamLog.DurationLogInfoSerializer().deserialize(dict["duration"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - let folders = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["folders"] ?? .null) - return GovernancePolicyCreateDetails(governancePolicyId: governancePolicyId, name: name, duration: duration, policyType: policyType, folders: folders) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let duration = try TeamLog.DurationLogInfoSerializer().deserialize(dict["duration"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + let folders = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["folders"] ?? .null) + return GovernancePolicyCreateDetails( + governancePolicyId: governancePolicyId, + name: name, + duration: duration, + policyType: policyType, + folders: folders + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyCreateDetails.self, json: json) } } } /// The GovernancePolicyCreateType struct - open class GovernancePolicyCreateType: CustomStringConvertible { + public class GovernancePolicyCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyCreateType: \(error)" + } } } - open class GovernancePolicyCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyCreateType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyCreateType.self, json: json) } } } /// Deleted a policy. - open class GovernancePolicyDeleteDetails: CustomStringConvertible { + public class GovernancePolicyDeleteDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26485,66 +31271,88 @@ open class TeamLog { self.name = name self.policyType = policyType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyDeleteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyDeleteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyDeleteDetails: \(error)" + } } } - open class GovernancePolicyDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyDeleteDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + + public class GovernancePolicyDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyDeleteDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyDeleteDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyDeleteDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - return GovernancePolicyDeleteDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + return GovernancePolicyDeleteDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyDeleteDetails.self, json: json) } } } /// The GovernancePolicyDeleteType struct - open class GovernancePolicyDeleteType: CustomStringConvertible { + public class GovernancePolicyDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyDeleteType: \(error)" + } } } - open class GovernancePolicyDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyDeleteType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyDeleteType.self, json: json) } } } /// Edited policy. - open class GovernancePolicyEditDetailsDetails: CustomStringConvertible { + public class GovernancePolicyEditDetailsDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26557,7 +31365,14 @@ open class TeamLog { public let previousValue: String /// To. public let newValue: String - public init(governancePolicyId: String, name: String, attribute: String, previousValue: String, newValue: String, policyType: TeamLog.PolicyType? = nil) { + public init( + governancePolicyId: String, + name: String, + attribute: String, + previousValue: String, + newValue: String, + policyType: TeamLog.PolicyType? = nil + ) { stringValidator()(governancePolicyId) self.governancePolicyId = governancePolicyId stringValidator()(name) @@ -26570,72 +31385,101 @@ open class TeamLog { stringValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyEditDetailsDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyEditDetailsDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyEditDetailsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyEditDetailsDetails: \(error)" + } } } - open class GovernancePolicyEditDetailsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyEditDetailsDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "attribute": Serialization._StringSerializer.serialize(value.attribute), - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - "new_value": Serialization._StringSerializer.serialize(value.newValue), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + + public class GovernancePolicyEditDetailsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyEditDetailsDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "attribute": try Serialization._StringSerializer.serialize(value.attribute), + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyEditDetailsDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyEditDetailsDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let attribute = Serialization._StringSerializer.deserialize(dict["attribute"] ?? .null) - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - return GovernancePolicyEditDetailsDetails(governancePolicyId: governancePolicyId, name: name, attribute: attribute, previousValue: previousValue, newValue: newValue, policyType: policyType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let attribute = try Serialization._StringSerializer.deserialize(dict["attribute"] ?? .null) + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + return GovernancePolicyEditDetailsDetails( + governancePolicyId: governancePolicyId, + name: name, + attribute: attribute, + previousValue: previousValue, + newValue: newValue, + policyType: policyType + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyEditDetailsDetails.self, json: json) } } } /// The GovernancePolicyEditDetailsType struct - open class GovernancePolicyEditDetailsType: CustomStringConvertible { + public class GovernancePolicyEditDetailsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyEditDetailsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyEditDetailsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyEditDetailsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyEditDetailsType: \(error)" + } } } - open class GovernancePolicyEditDetailsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyEditDetailsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyEditDetailsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyEditDetailsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyEditDetailsType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyEditDetailsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyEditDetailsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyEditDetailsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyEditDetailsType.self, json: json) } } } /// Changed policy duration. - open class GovernancePolicyEditDurationDetails: CustomStringConvertible { + public class GovernancePolicyEditDurationDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26646,7 +31490,13 @@ open class TeamLog { public let previousValue: TeamLog.DurationLogInfo /// To. public let newValue: TeamLog.DurationLogInfo - public init(governancePolicyId: String, name: String, previousValue: TeamLog.DurationLogInfo, newValue: TeamLog.DurationLogInfo, policyType: TeamLog.PolicyType? = nil) { + public init( + governancePolicyId: String, + name: String, + previousValue: TeamLog.DurationLogInfo, + newValue: TeamLog.DurationLogInfo, + policyType: TeamLog.PolicyType? = nil + ) { stringValidator()(governancePolicyId) self.governancePolicyId = governancePolicyId stringValidator()(name) @@ -26655,70 +31505,98 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyEditDurationDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyEditDurationDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyEditDurationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyEditDurationDetails: \(error)" + } } } - open class GovernancePolicyEditDurationDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyEditDurationDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "previous_value": TeamLog.DurationLogInfoSerializer().serialize(value.previousValue), - "new_value": TeamLog.DurationLogInfoSerializer().serialize(value.newValue), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + + public class GovernancePolicyEditDurationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyEditDurationDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "previous_value": try TeamLog.DurationLogInfoSerializer().serialize(value.previousValue), + "new_value": try TeamLog.DurationLogInfoSerializer().serialize(value.newValue), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyEditDurationDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyEditDurationDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let previousValue = TeamLog.DurationLogInfoSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.DurationLogInfoSerializer().deserialize(dict["new_value"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - return GovernancePolicyEditDurationDetails(governancePolicyId: governancePolicyId, name: name, previousValue: previousValue, newValue: newValue, policyType: policyType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let previousValue = try TeamLog.DurationLogInfoSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.DurationLogInfoSerializer().deserialize(dict["new_value"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + return GovernancePolicyEditDurationDetails( + governancePolicyId: governancePolicyId, + name: name, + previousValue: previousValue, + newValue: newValue, + policyType: policyType + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyEditDurationDetails.self, json: json) } } } /// The GovernancePolicyEditDurationType struct - open class GovernancePolicyEditDurationType: CustomStringConvertible { + public class GovernancePolicyEditDurationType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyEditDurationTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyEditDurationTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyEditDurationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyEditDurationType: \(error)" + } } } - open class GovernancePolicyEditDurationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyEditDurationType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyEditDurationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyEditDurationType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyEditDurationType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyEditDurationType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyEditDurationType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyEditDurationType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyEditDurationType.self, json: json) } } } /// Created a policy download. - open class GovernancePolicyExportCreatedDetails: CustomStringConvertible { + public class GovernancePolicyExportCreatedDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26736,68 +31614,95 @@ open class TeamLog { stringValidator()(exportName) self.exportName = exportName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyExportCreatedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyExportCreatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyExportCreatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyExportCreatedDetails: \(error)" + } } } - open class GovernancePolicyExportCreatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyExportCreatedDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "export_name": Serialization._StringSerializer.serialize(value.exportName), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + + public class GovernancePolicyExportCreatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyExportCreatedDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "export_name": try Serialization._StringSerializer.serialize(value.exportName), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyExportCreatedDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyExportCreatedDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let exportName = Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - return GovernancePolicyExportCreatedDetails(governancePolicyId: governancePolicyId, name: name, exportName: exportName, policyType: policyType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let exportName = try Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + return GovernancePolicyExportCreatedDetails( + governancePolicyId: governancePolicyId, + name: name, + exportName: exportName, + policyType: policyType + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyExportCreatedDetails.self, json: json) } } } /// The GovernancePolicyExportCreatedType struct - open class GovernancePolicyExportCreatedType: CustomStringConvertible { + public class GovernancePolicyExportCreatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyExportCreatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyExportCreatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyExportCreatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyExportCreatedType: \(error)" + } } } - open class GovernancePolicyExportCreatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyExportCreatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyExportCreatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyExportCreatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyExportCreatedType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyExportCreatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyExportCreatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyExportCreatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyExportCreatedType.self, json: json) } } } /// Removed a policy download. - open class GovernancePolicyExportRemovedDetails: CustomStringConvertible { + public class GovernancePolicyExportRemovedDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26815,68 +31720,95 @@ open class TeamLog { stringValidator()(exportName) self.exportName = exportName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyExportRemovedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyExportRemovedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyExportRemovedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyExportRemovedDetails: \(error)" + } } } - open class GovernancePolicyExportRemovedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyExportRemovedDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "export_name": Serialization._StringSerializer.serialize(value.exportName), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + + public class GovernancePolicyExportRemovedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyExportRemovedDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "export_name": try Serialization._StringSerializer.serialize(value.exportName), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyExportRemovedDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyExportRemovedDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let exportName = Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - return GovernancePolicyExportRemovedDetails(governancePolicyId: governancePolicyId, name: name, exportName: exportName, policyType: policyType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let exportName = try Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + return GovernancePolicyExportRemovedDetails( + governancePolicyId: governancePolicyId, + name: name, + exportName: exportName, + policyType: policyType + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyExportRemovedDetails.self, json: json) } } } /// The GovernancePolicyExportRemovedType struct - open class GovernancePolicyExportRemovedType: CustomStringConvertible { + public class GovernancePolicyExportRemovedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyExportRemovedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyExportRemovedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyExportRemovedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyExportRemovedType: \(error)" + } } } - open class GovernancePolicyExportRemovedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyExportRemovedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyExportRemovedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyExportRemovedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyExportRemovedType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyExportRemovedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyExportRemovedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyExportRemovedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyExportRemovedType.self, json: json) } } } /// Removed folders from policy. - open class GovernancePolicyRemoveFoldersDetails: CustomStringConvertible { + public class GovernancePolicyRemoveFoldersDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26884,10 +31816,10 @@ open class TeamLog { /// Policy type. public let policyType: TeamLog.PolicyType? /// Folders. - public let folders: Array? + public let folders: [String]? /// Reason. public let reason: String? - public init(governancePolicyId: String, name: String, policyType: TeamLog.PolicyType? = nil, folders: Array? = nil, reason: String? = nil) { + public init(governancePolicyId: String, name: String, policyType: TeamLog.PolicyType? = nil, folders: [String]? = nil, reason: String? = nil) { stringValidator()(governancePolicyId) self.governancePolicyId = governancePolicyId stringValidator()(name) @@ -26898,70 +31830,98 @@ open class TeamLog { nullableValidator(stringValidator())(reason) self.reason = reason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyRemoveFoldersDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyRemoveFoldersDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyRemoveFoldersDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyRemoveFoldersDetails: \(error)" + } } } - open class GovernancePolicyRemoveFoldersDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyRemoveFoldersDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), - "folders": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.folders), - "reason": NullableSerializer(Serialization._StringSerializer).serialize(value.reason), + + public class GovernancePolicyRemoveFoldersDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyRemoveFoldersDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + "folders": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.folders), + "reason": try NullableSerializer(Serialization._StringSerializer).serialize(value.reason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyRemoveFoldersDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyRemoveFoldersDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - let folders = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["folders"] ?? .null) - let reason = NullableSerializer(Serialization._StringSerializer).deserialize(dict["reason"] ?? .null) - return GovernancePolicyRemoveFoldersDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType, folders: folders, reason: reason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + let folders = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["folders"] ?? .null) + let reason = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["reason"] ?? .null) + return GovernancePolicyRemoveFoldersDetails( + governancePolicyId: governancePolicyId, + name: name, + policyType: policyType, + folders: folders, + reason: reason + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyRemoveFoldersDetails.self, json: json) } } } /// The GovernancePolicyRemoveFoldersType struct - open class GovernancePolicyRemoveFoldersType: CustomStringConvertible { + public class GovernancePolicyRemoveFoldersType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyRemoveFoldersTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyRemoveFoldersTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyRemoveFoldersTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyRemoveFoldersType: \(error)" + } } } - open class GovernancePolicyRemoveFoldersTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyRemoveFoldersType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyRemoveFoldersTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyRemoveFoldersType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyRemoveFoldersType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyRemoveFoldersType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyRemoveFoldersType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyRemoveFoldersType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyRemoveFoldersType.self, json: json) } } } /// Created a summary report for a policy. - open class GovernancePolicyReportCreatedDetails: CustomStringConvertible { + public class GovernancePolicyReportCreatedDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -26975,66 +31935,88 @@ open class TeamLog { self.name = name self.policyType = policyType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyReportCreatedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyReportCreatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyReportCreatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyReportCreatedDetails: \(error)" + } } } - open class GovernancePolicyReportCreatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyReportCreatedDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + + public class GovernancePolicyReportCreatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyReportCreatedDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyReportCreatedDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyReportCreatedDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - return GovernancePolicyReportCreatedDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + return GovernancePolicyReportCreatedDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyReportCreatedDetails.self, json: json) } } } /// The GovernancePolicyReportCreatedType struct - open class GovernancePolicyReportCreatedType: CustomStringConvertible { + public class GovernancePolicyReportCreatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyReportCreatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyReportCreatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyReportCreatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyReportCreatedType: \(error)" + } } } - open class GovernancePolicyReportCreatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyReportCreatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyReportCreatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyReportCreatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyReportCreatedType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyReportCreatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyReportCreatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyReportCreatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyReportCreatedType.self, json: json) } } } /// Downloaded content from a policy. - open class GovernancePolicyZipPartDownloadedDetails: CustomStringConvertible { + public class GovernancePolicyZipPartDownloadedDetails: CustomStringConvertible, JSONRepresentable { /// Policy ID. public let governancePolicyId: String /// Policy name. @@ -27056,193 +32038,265 @@ open class TeamLog { nullableValidator(stringValidator())(part) self.part = part } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyZipPartDownloadedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyZipPartDownloadedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyZipPartDownloadedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyZipPartDownloadedDetails: \(error)" + } } } - open class GovernancePolicyZipPartDownloadedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyZipPartDownloadedDetails) -> JSON { - let output = [ - "governance_policy_id": Serialization._StringSerializer.serialize(value.governancePolicyId), - "name": Serialization._StringSerializer.serialize(value.name), - "export_name": Serialization._StringSerializer.serialize(value.exportName), - "policy_type": NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), - "part": NullableSerializer(Serialization._StringSerializer).serialize(value.part), + + public class GovernancePolicyZipPartDownloadedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyZipPartDownloadedDetails) throws -> JSON { + let output = [ + "governance_policy_id": try Serialization._StringSerializer.serialize(value.governancePolicyId), + "name": try Serialization._StringSerializer.serialize(value.name), + "export_name": try Serialization._StringSerializer.serialize(value.exportName), + "policy_type": try NullableSerializer(TeamLog.PolicyTypeSerializer()).serialize(value.policyType), + "part": try NullableSerializer(Serialization._StringSerializer).serialize(value.part), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyZipPartDownloadedDetails { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyZipPartDownloadedDetails { switch json { - case .dictionary(let dict): - let governancePolicyId = Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let exportName = Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) - let policyType = NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) - let part = NullableSerializer(Serialization._StringSerializer).deserialize(dict["part"] ?? .null) - return GovernancePolicyZipPartDownloadedDetails(governancePolicyId: governancePolicyId, name: name, exportName: exportName, policyType: policyType, part: part) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let governancePolicyId = try Serialization._StringSerializer.deserialize(dict["governance_policy_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let exportName = try Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) + let policyType = try NullableSerializer(TeamLog.PolicyTypeSerializer()).deserialize(dict["policy_type"] ?? .null) + let part = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["part"] ?? .null) + return GovernancePolicyZipPartDownloadedDetails( + governancePolicyId: governancePolicyId, + name: name, + exportName: exportName, + policyType: policyType, + part: part + ) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyZipPartDownloadedDetails.self, json: json) } } } /// The GovernancePolicyZipPartDownloadedType struct - open class GovernancePolicyZipPartDownloadedType: CustomStringConvertible { + public class GovernancePolicyZipPartDownloadedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GovernancePolicyZipPartDownloadedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GovernancePolicyZipPartDownloadedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GovernancePolicyZipPartDownloadedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GovernancePolicyZipPartDownloadedType: \(error)" + } } } - open class GovernancePolicyZipPartDownloadedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GovernancePolicyZipPartDownloadedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GovernancePolicyZipPartDownloadedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GovernancePolicyZipPartDownloadedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GovernancePolicyZipPartDownloadedType { + + public func deserialize(_ json: JSON) throws -> GovernancePolicyZipPartDownloadedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GovernancePolicyZipPartDownloadedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GovernancePolicyZipPartDownloadedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GovernancePolicyZipPartDownloadedType.self, json: json) } } } /// Added external ID for group. - open class GroupAddExternalIdDetails: CustomStringConvertible { + public class GroupAddExternalIdDetails: CustomStringConvertible, JSONRepresentable { /// Current external id. public let newValue: String public init(newValue: String) { stringValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupAddExternalIdDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupAddExternalIdDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupAddExternalIdDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupAddExternalIdDetails: \(error)" + } } } - open class GroupAddExternalIdDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupAddExternalIdDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public class GroupAddExternalIdDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupAddExternalIdDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupAddExternalIdDetails { + + public func deserialize(_ json: JSON) throws -> GroupAddExternalIdDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return GroupAddExternalIdDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return GroupAddExternalIdDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: GroupAddExternalIdDetails.self, json: json) } } } /// The GroupAddExternalIdType struct - open class GroupAddExternalIdType: CustomStringConvertible { + public class GroupAddExternalIdType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupAddExternalIdTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupAddExternalIdTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupAddExternalIdTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupAddExternalIdType: \(error)" + } } } - open class GroupAddExternalIdTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupAddExternalIdType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupAddExternalIdTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupAddExternalIdType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupAddExternalIdType { + + public func deserialize(_ json: JSON) throws -> GroupAddExternalIdType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupAddExternalIdType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupAddExternalIdType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupAddExternalIdType.self, json: json) } } } /// Added team members to group. - open class GroupAddMemberDetails: CustomStringConvertible { + public class GroupAddMemberDetails: CustomStringConvertible, JSONRepresentable { /// Is group owner. public let isGroupOwner: Bool public init(isGroupOwner: Bool) { self.isGroupOwner = isGroupOwner } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupAddMemberDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupAddMemberDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupAddMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupAddMemberDetails: \(error)" + } } } - open class GroupAddMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupAddMemberDetails) -> JSON { - let output = [ - "is_group_owner": Serialization._BoolSerializer.serialize(value.isGroupOwner), + + public class GroupAddMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupAddMemberDetails) throws -> JSON { + let output = [ + "is_group_owner": try Serialization._BoolSerializer.serialize(value.isGroupOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupAddMemberDetails { + + public func deserialize(_ json: JSON) throws -> GroupAddMemberDetails { switch json { - case .dictionary(let dict): - let isGroupOwner = Serialization._BoolSerializer.deserialize(dict["is_group_owner"] ?? .null) - return GroupAddMemberDetails(isGroupOwner: isGroupOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isGroupOwner = try Serialization._BoolSerializer.deserialize(dict["is_group_owner"] ?? .null) + return GroupAddMemberDetails(isGroupOwner: isGroupOwner) + default: + throw JSONSerializerError.deserializeError(type: GroupAddMemberDetails.self, json: json) } } } /// The GroupAddMemberType struct - open class GroupAddMemberType: CustomStringConvertible { + public class GroupAddMemberType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupAddMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupAddMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupAddMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupAddMemberType: \(error)" + } } } - open class GroupAddMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupAddMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupAddMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupAddMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupAddMemberType { + + public func deserialize(_ json: JSON) throws -> GroupAddMemberType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupAddMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupAddMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupAddMemberType.self, json: json) } } } /// Changed external ID for group. - open class GroupChangeExternalIdDetails: CustomStringConvertible { + public class GroupChangeExternalIdDetails: CustomStringConvertible, JSONRepresentable { /// Current external id. public let newValue: String /// Old external id. @@ -27253,64 +32307,86 @@ open class TeamLog { stringValidator()(previousValue) self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupChangeExternalIdDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupChangeExternalIdDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupChangeExternalIdDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupChangeExternalIdDetails: \(error)" + } } } - open class GroupChangeExternalIdDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupChangeExternalIdDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), + + public class GroupChangeExternalIdDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupChangeExternalIdDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupChangeExternalIdDetails { + + public func deserialize(_ json: JSON) throws -> GroupChangeExternalIdDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return GroupChangeExternalIdDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return GroupChangeExternalIdDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: GroupChangeExternalIdDetails.self, json: json) } } } /// The GroupChangeExternalIdType struct - open class GroupChangeExternalIdType: CustomStringConvertible { + public class GroupChangeExternalIdType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupChangeExternalIdTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupChangeExternalIdTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupChangeExternalIdTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupChangeExternalIdType: \(error)" + } } } - open class GroupChangeExternalIdTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupChangeExternalIdType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupChangeExternalIdTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupChangeExternalIdType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupChangeExternalIdType { + + public func deserialize(_ json: JSON) throws -> GroupChangeExternalIdType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupChangeExternalIdType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupChangeExternalIdType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupChangeExternalIdType.self, json: json) } } } /// Changed group management type. - open class GroupChangeManagementTypeDetails: CustomStringConvertible { + public class GroupChangeManagementTypeDetails: CustomStringConvertible, JSONRepresentable { /// New group management type. public let newValue: TeamCommon.GroupManagementType /// Previous group management type. Might be missing due to historical data gap. @@ -27319,125 +32395,169 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupChangeManagementTypeDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupChangeManagementTypeDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupChangeManagementTypeDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupChangeManagementTypeDetails: \(error)" + } } } - open class GroupChangeManagementTypeDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupChangeManagementTypeDetails) -> JSON { - let output = [ - "new_value": TeamCommon.GroupManagementTypeSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).serialize(value.previousValue), + + public class GroupChangeManagementTypeDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupChangeManagementTypeDetails) throws -> JSON { + let output = [ + "new_value": try TeamCommon.GroupManagementTypeSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupChangeManagementTypeDetails { + + public func deserialize(_ json: JSON) throws -> GroupChangeManagementTypeDetails { switch json { - case .dictionary(let dict): - let newValue = TeamCommon.GroupManagementTypeSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).deserialize(dict["previous_value"] ?? .null) - return GroupChangeManagementTypeDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamCommon.GroupManagementTypeSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamCommon.GroupManagementTypeSerializer()).deserialize(dict["previous_value"] ?? .null) + return GroupChangeManagementTypeDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: GroupChangeManagementTypeDetails.self, json: json) } } } /// The GroupChangeManagementTypeType struct - open class GroupChangeManagementTypeType: CustomStringConvertible { + public class GroupChangeManagementTypeType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupChangeManagementTypeTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupChangeManagementTypeTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupChangeManagementTypeTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupChangeManagementTypeType: \(error)" + } } } - open class GroupChangeManagementTypeTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupChangeManagementTypeType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupChangeManagementTypeTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupChangeManagementTypeType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupChangeManagementTypeType { + + public func deserialize(_ json: JSON) throws -> GroupChangeManagementTypeType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupChangeManagementTypeType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupChangeManagementTypeType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupChangeManagementTypeType.self, json: json) } } } /// Changed manager permissions of group member. - open class GroupChangeMemberRoleDetails: CustomStringConvertible { + public class GroupChangeMemberRoleDetails: CustomStringConvertible, JSONRepresentable { /// Is group owner. public let isGroupOwner: Bool public init(isGroupOwner: Bool) { self.isGroupOwner = isGroupOwner } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupChangeMemberRoleDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupChangeMemberRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupChangeMemberRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupChangeMemberRoleDetails: \(error)" + } } } - open class GroupChangeMemberRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupChangeMemberRoleDetails) -> JSON { - let output = [ - "is_group_owner": Serialization._BoolSerializer.serialize(value.isGroupOwner), + + public class GroupChangeMemberRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupChangeMemberRoleDetails) throws -> JSON { + let output = [ + "is_group_owner": try Serialization._BoolSerializer.serialize(value.isGroupOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupChangeMemberRoleDetails { + + public func deserialize(_ json: JSON) throws -> GroupChangeMemberRoleDetails { switch json { - case .dictionary(let dict): - let isGroupOwner = Serialization._BoolSerializer.deserialize(dict["is_group_owner"] ?? .null) - return GroupChangeMemberRoleDetails(isGroupOwner: isGroupOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isGroupOwner = try Serialization._BoolSerializer.deserialize(dict["is_group_owner"] ?? .null) + return GroupChangeMemberRoleDetails(isGroupOwner: isGroupOwner) + default: + throw JSONSerializerError.deserializeError(type: GroupChangeMemberRoleDetails.self, json: json) } } } /// The GroupChangeMemberRoleType struct - open class GroupChangeMemberRoleType: CustomStringConvertible { + public class GroupChangeMemberRoleType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupChangeMemberRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupChangeMemberRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupChangeMemberRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupChangeMemberRoleType: \(error)" + } } } - open class GroupChangeMemberRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupChangeMemberRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupChangeMemberRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupChangeMemberRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupChangeMemberRoleType { + + public func deserialize(_ json: JSON) throws -> GroupChangeMemberRoleType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupChangeMemberRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupChangeMemberRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupChangeMemberRoleType.self, json: json) } } } /// Created group. - open class GroupCreateDetails: CustomStringConvertible { + public class GroupCreateDetails: CustomStringConvertible, JSONRepresentable { /// Is company managed group. public let isCompanyManaged: Bool? /// Group join policy. @@ -27446,180 +32566,243 @@ open class TeamLog { self.isCompanyManaged = isCompanyManaged self.joinPolicy = joinPolicy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupCreateDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupCreateDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupCreateDetails: \(error)" + } } } - open class GroupCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupCreateDetails) -> JSON { - let output = [ - "is_company_managed": NullableSerializer(Serialization._BoolSerializer).serialize(value.isCompanyManaged), - "join_policy": NullableSerializer(TeamLog.GroupJoinPolicySerializer()).serialize(value.joinPolicy), + + public class GroupCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupCreateDetails) throws -> JSON { + let output = [ + "is_company_managed": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isCompanyManaged), + "join_policy": try NullableSerializer(TeamLog.GroupJoinPolicySerializer()).serialize(value.joinPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupCreateDetails { + + public func deserialize(_ json: JSON) throws -> GroupCreateDetails { switch json { - case .dictionary(let dict): - let isCompanyManaged = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_company_managed"] ?? .null) - let joinPolicy = NullableSerializer(TeamLog.GroupJoinPolicySerializer()).deserialize(dict["join_policy"] ?? .null) - return GroupCreateDetails(isCompanyManaged: isCompanyManaged, joinPolicy: joinPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isCompanyManaged = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_company_managed"] ?? .null) + let joinPolicy = try NullableSerializer(TeamLog.GroupJoinPolicySerializer()).deserialize(dict["join_policy"] ?? .null) + return GroupCreateDetails(isCompanyManaged: isCompanyManaged, joinPolicy: joinPolicy) + default: + throw JSONSerializerError.deserializeError(type: GroupCreateDetails.self, json: json) } } } /// The GroupCreateType struct - open class GroupCreateType: CustomStringConvertible { + public class GroupCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupCreateType: \(error)" + } } } - open class GroupCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupCreateType { + + public func deserialize(_ json: JSON) throws -> GroupCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupCreateType.self, json: json) } } } /// Deleted group. - open class GroupDeleteDetails: CustomStringConvertible { + public class GroupDeleteDetails: CustomStringConvertible, JSONRepresentable { /// Is company managed group. public let isCompanyManaged: Bool? public init(isCompanyManaged: Bool? = nil) { self.isCompanyManaged = isCompanyManaged } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupDeleteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupDeleteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupDeleteDetails: \(error)" + } } } - open class GroupDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupDeleteDetails) -> JSON { - let output = [ - "is_company_managed": NullableSerializer(Serialization._BoolSerializer).serialize(value.isCompanyManaged), + + public class GroupDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupDeleteDetails) throws -> JSON { + let output = [ + "is_company_managed": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isCompanyManaged), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupDeleteDetails { + + public func deserialize(_ json: JSON) throws -> GroupDeleteDetails { switch json { - case .dictionary(let dict): - let isCompanyManaged = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_company_managed"] ?? .null) - return GroupDeleteDetails(isCompanyManaged: isCompanyManaged) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isCompanyManaged = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_company_managed"] ?? .null) + return GroupDeleteDetails(isCompanyManaged: isCompanyManaged) + default: + throw JSONSerializerError.deserializeError(type: GroupDeleteDetails.self, json: json) } } } /// The GroupDeleteType struct - open class GroupDeleteType: CustomStringConvertible { + public class GroupDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupDeleteType: \(error)" + } } } - open class GroupDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupDeleteType { + + public func deserialize(_ json: JSON) throws -> GroupDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupDeleteType.self, json: json) } } } /// Updated group. - open class GroupDescriptionUpdatedDetails: CustomStringConvertible { - public init() { + public class GroupDescriptionUpdatedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try GroupDescriptionUpdatedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupDescriptionUpdatedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupDescriptionUpdatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupDescriptionUpdatedDetails: \(error)" + } } } - open class GroupDescriptionUpdatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupDescriptionUpdatedDetails) -> JSON { + + public class GroupDescriptionUpdatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupDescriptionUpdatedDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupDescriptionUpdatedDetails { + + public func deserialize(_ json: JSON) throws -> GroupDescriptionUpdatedDetails { switch json { - case .dictionary(_): - return GroupDescriptionUpdatedDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return GroupDescriptionUpdatedDetails() + default: + throw JSONSerializerError.deserializeError(type: GroupDescriptionUpdatedDetails.self, json: json) } } } /// The GroupDescriptionUpdatedType struct - open class GroupDescriptionUpdatedType: CustomStringConvertible { + public class GroupDescriptionUpdatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupDescriptionUpdatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupDescriptionUpdatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupDescriptionUpdatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupDescriptionUpdatedType: \(error)" + } } } - open class GroupDescriptionUpdatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupDescriptionUpdatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupDescriptionUpdatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupDescriptionUpdatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupDescriptionUpdatedType { + + public func deserialize(_ json: JSON) throws -> GroupDescriptionUpdatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupDescriptionUpdatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupDescriptionUpdatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupDescriptionUpdatedType.self, json: json) } } } /// The GroupJoinPolicy union - public enum GroupJoinPolicy: CustomStringConvertible { + public enum GroupJoinPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case open /// An unspecified error. @@ -27627,50 +32810,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try GroupJoinPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupJoinPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupJoinPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupJoinPolicy: \(error)" + } } } - open class GroupJoinPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupJoinPolicy) -> JSON { + + public class GroupJoinPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupJoinPolicy) throws -> JSON { switch value { - case .open: - var d = [String: JSON]() - d[".tag"] = .str("open") - return .dictionary(d) - case .requestToJoin: - var d = [String: JSON]() - d[".tag"] = .str("request_to_join") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> GroupJoinPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "open": - return GroupJoinPolicy.open - case "request_to_join": - return GroupJoinPolicy.requestToJoin - case "other": - return GroupJoinPolicy.other - default: - return GroupJoinPolicy.other - } + case .open: + var d = [String: JSON]() + d[".tag"] = .str("open") + return .dictionary(d) + case .requestToJoin: + var d = [String: JSON]() + d[".tag"] = .str("request_to_join") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GroupJoinPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "open": + return GroupJoinPolicy.open + case "request_to_join": + return GroupJoinPolicy.requestToJoin + case "other": + return GroupJoinPolicy.other default: - fatalError("Failed to deserialize") + return GroupJoinPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: GroupJoinPolicy.self, json: json) } } } /// Updated group join policy. - open class GroupJoinPolicyUpdatedDetails: CustomStringConvertible { + public class GroupJoinPolicyUpdatedDetails: CustomStringConvertible, JSONRepresentable { /// Is company managed group. public let isCompanyManaged: Bool? /// Group join policy. @@ -27679,64 +32872,86 @@ open class TeamLog { self.isCompanyManaged = isCompanyManaged self.joinPolicy = joinPolicy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupJoinPolicyUpdatedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupJoinPolicyUpdatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupJoinPolicyUpdatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupJoinPolicyUpdatedDetails: \(error)" + } } } - open class GroupJoinPolicyUpdatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupJoinPolicyUpdatedDetails) -> JSON { - let output = [ - "is_company_managed": NullableSerializer(Serialization._BoolSerializer).serialize(value.isCompanyManaged), - "join_policy": NullableSerializer(TeamLog.GroupJoinPolicySerializer()).serialize(value.joinPolicy), + + public class GroupJoinPolicyUpdatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupJoinPolicyUpdatedDetails) throws -> JSON { + let output = [ + "is_company_managed": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isCompanyManaged), + "join_policy": try NullableSerializer(TeamLog.GroupJoinPolicySerializer()).serialize(value.joinPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupJoinPolicyUpdatedDetails { + + public func deserialize(_ json: JSON) throws -> GroupJoinPolicyUpdatedDetails { switch json { - case .dictionary(let dict): - let isCompanyManaged = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_company_managed"] ?? .null) - let joinPolicy = NullableSerializer(TeamLog.GroupJoinPolicySerializer()).deserialize(dict["join_policy"] ?? .null) - return GroupJoinPolicyUpdatedDetails(isCompanyManaged: isCompanyManaged, joinPolicy: joinPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isCompanyManaged = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_company_managed"] ?? .null) + let joinPolicy = try NullableSerializer(TeamLog.GroupJoinPolicySerializer()).deserialize(dict["join_policy"] ?? .null) + return GroupJoinPolicyUpdatedDetails(isCompanyManaged: isCompanyManaged, joinPolicy: joinPolicy) + default: + throw JSONSerializerError.deserializeError(type: GroupJoinPolicyUpdatedDetails.self, json: json) } } } /// The GroupJoinPolicyUpdatedType struct - open class GroupJoinPolicyUpdatedType: CustomStringConvertible { + public class GroupJoinPolicyUpdatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupJoinPolicyUpdatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupJoinPolicyUpdatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupJoinPolicyUpdatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupJoinPolicyUpdatedType: \(error)" + } } } - open class GroupJoinPolicyUpdatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupJoinPolicyUpdatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupJoinPolicyUpdatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupJoinPolicyUpdatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupJoinPolicyUpdatedType { + + public func deserialize(_ json: JSON) throws -> GroupJoinPolicyUpdatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupJoinPolicyUpdatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupJoinPolicyUpdatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupJoinPolicyUpdatedType.self, json: json) } } } /// Group's logged information. - open class GroupLogInfo: CustomStringConvertible { + public class GroupLogInfo: CustomStringConvertible, JSONRepresentable { /// The unique id of this group. public let groupId: String? /// The name of this group. @@ -27751,207 +32966,278 @@ open class TeamLog { nullableValidator(stringValidator())(externalId) self.externalId = externalId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupLogInfo: \(error)" + } } } - open class GroupLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupLogInfo) -> JSON { - let output = [ - "display_name": Serialization._StringSerializer.serialize(value.displayName), - "group_id": NullableSerializer(Serialization._StringSerializer).serialize(value.groupId), - "external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.externalId), + + public class GroupLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupLogInfo) throws -> JSON { + let output = [ + "display_name": try Serialization._StringSerializer.serialize(value.displayName), + "group_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.groupId), + "external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.externalId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupLogInfo { + + public func deserialize(_ json: JSON) throws -> GroupLogInfo { switch json { - case .dictionary(let dict): - let displayName = Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) - let groupId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_id"] ?? .null) - let externalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["external_id"] ?? .null) - return GroupLogInfo(displayName: displayName, groupId: groupId, externalId: externalId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let displayName = try Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) + let groupId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["group_id"] ?? .null) + let externalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["external_id"] ?? .null) + return GroupLogInfo(displayName: displayName, groupId: groupId, externalId: externalId) + default: + throw JSONSerializerError.deserializeError(type: GroupLogInfo.self, json: json) } } } /// Moved group. - open class GroupMovedDetails: CustomStringConvertible { - public init() { + public class GroupMovedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try GroupMovedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMovedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMovedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMovedDetails: \(error)" + } } } - open class GroupMovedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMovedDetails) -> JSON { + + public class GroupMovedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMovedDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMovedDetails { + + public func deserialize(_ json: JSON) throws -> GroupMovedDetails { switch json { - case .dictionary(_): - return GroupMovedDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return GroupMovedDetails() + default: + throw JSONSerializerError.deserializeError(type: GroupMovedDetails.self, json: json) } } } /// The GroupMovedType struct - open class GroupMovedType: CustomStringConvertible { + public class GroupMovedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupMovedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupMovedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupMovedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupMovedType: \(error)" + } } } - open class GroupMovedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupMovedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupMovedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupMovedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupMovedType { + + public func deserialize(_ json: JSON) throws -> GroupMovedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupMovedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupMovedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupMovedType.self, json: json) } } } /// Removed external ID for group. - open class GroupRemoveExternalIdDetails: CustomStringConvertible { + public class GroupRemoveExternalIdDetails: CustomStringConvertible, JSONRepresentable { /// Old external id. public let previousValue: String public init(previousValue: String) { stringValidator()(previousValue) self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupRemoveExternalIdDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupRemoveExternalIdDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupRemoveExternalIdDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupRemoveExternalIdDetails: \(error)" + } } } - open class GroupRemoveExternalIdDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupRemoveExternalIdDetails) -> JSON { - let output = [ - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), + + public class GroupRemoveExternalIdDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupRemoveExternalIdDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupRemoveExternalIdDetails { + + public func deserialize(_ json: JSON) throws -> GroupRemoveExternalIdDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return GroupRemoveExternalIdDetails(previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return GroupRemoveExternalIdDetails(previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: GroupRemoveExternalIdDetails.self, json: json) } } } /// The GroupRemoveExternalIdType struct - open class GroupRemoveExternalIdType: CustomStringConvertible { + public class GroupRemoveExternalIdType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupRemoveExternalIdTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupRemoveExternalIdTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupRemoveExternalIdTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupRemoveExternalIdType: \(error)" + } } } - open class GroupRemoveExternalIdTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupRemoveExternalIdType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupRemoveExternalIdTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupRemoveExternalIdType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupRemoveExternalIdType { + + public func deserialize(_ json: JSON) throws -> GroupRemoveExternalIdType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupRemoveExternalIdType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupRemoveExternalIdType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupRemoveExternalIdType.self, json: json) } } } /// Removed team members from group. - open class GroupRemoveMemberDetails: CustomStringConvertible { - public init() { + public class GroupRemoveMemberDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try GroupRemoveMemberDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupRemoveMemberDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupRemoveMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupRemoveMemberDetails: \(error)" + } } } - open class GroupRemoveMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupRemoveMemberDetails) -> JSON { + + public class GroupRemoveMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupRemoveMemberDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupRemoveMemberDetails { + + public func deserialize(_ json: JSON) throws -> GroupRemoveMemberDetails { switch json { - case .dictionary(_): - return GroupRemoveMemberDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return GroupRemoveMemberDetails() + default: + throw JSONSerializerError.deserializeError(type: GroupRemoveMemberDetails.self, json: json) } } } /// The GroupRemoveMemberType struct - open class GroupRemoveMemberType: CustomStringConvertible { + public class GroupRemoveMemberType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupRemoveMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupRemoveMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupRemoveMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupRemoveMemberType: \(error)" + } } } - open class GroupRemoveMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupRemoveMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupRemoveMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupRemoveMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupRemoveMemberType { + + public func deserialize(_ json: JSON) throws -> GroupRemoveMemberType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupRemoveMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupRemoveMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupRemoveMemberType.self, json: json) } } } /// Renamed group. - open class GroupRenameDetails: CustomStringConvertible { + public class GroupRenameDetails: CustomStringConvertible, JSONRepresentable { /// Previous display name. public let previousValue: String /// New display name. @@ -27962,64 +33248,86 @@ open class TeamLog { stringValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupRenameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupRenameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupRenameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupRenameDetails: \(error)" + } } } - open class GroupRenameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupRenameDetails) -> JSON { - let output = [ - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public class GroupRenameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupRenameDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), + "new_value": try Serialization._StringSerializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupRenameDetails { + + public func deserialize(_ json: JSON) throws -> GroupRenameDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return GroupRenameDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return GroupRenameDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: GroupRenameDetails.self, json: json) } } } /// The GroupRenameType struct - open class GroupRenameType: CustomStringConvertible { + public class GroupRenameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupRenameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupRenameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupRenameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupRenameType: \(error)" + } } } - open class GroupRenameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupRenameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupRenameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupRenameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupRenameType { + + public func deserialize(_ json: JSON) throws -> GroupRenameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupRenameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupRenameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupRenameType.self, json: json) } } } /// Changed who can create groups. - open class GroupUserManagementChangePolicyDetails: CustomStringConvertible { + public class GroupUserManagementChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New group users management policy. public let newValue: TeamPolicies.GroupCreation /// Previous group users management policy. Might be missing due to historical data gap. @@ -28028,64 +33336,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupUserManagementChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupUserManagementChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupUserManagementChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupUserManagementChangePolicyDetails: \(error)" + } } } - open class GroupUserManagementChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupUserManagementChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.GroupCreationSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.GroupCreationSerializer()).serialize(value.previousValue), + + public class GroupUserManagementChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupUserManagementChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.GroupCreationSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.GroupCreationSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupUserManagementChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> GroupUserManagementChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.GroupCreationSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.GroupCreationSerializer()).deserialize(dict["previous_value"] ?? .null) - return GroupUserManagementChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamPolicies.GroupCreationSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.GroupCreationSerializer()).deserialize(dict["previous_value"] ?? .null) + return GroupUserManagementChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: GroupUserManagementChangePolicyDetails.self, json: json) } } } /// The GroupUserManagementChangePolicyType struct - open class GroupUserManagementChangePolicyType: CustomStringConvertible { + public class GroupUserManagementChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupUserManagementChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GroupUserManagementChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupUserManagementChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupUserManagementChangePolicyType: \(error)" + } } } - open class GroupUserManagementChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupUserManagementChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GroupUserManagementChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupUserManagementChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GroupUserManagementChangePolicyType { + + public func deserialize(_ json: JSON) throws -> GroupUserManagementChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GroupUserManagementChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GroupUserManagementChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GroupUserManagementChangePolicyType.self, json: json) } } } /// Changed guest team admin status. - open class GuestAdminChangeStatusDetails: CustomStringConvertible { + public class GuestAdminChangeStatusDetails: CustomStringConvertible, JSONRepresentable { /// True for guest, false for host. public let isGuest: Bool /// The name of the guest team. @@ -28098,7 +33428,14 @@ open class TeamLog { public let newValue: TeamLog.TrustedTeamsRequestState /// Action details. public let actionDetails: TeamLog.TrustedTeamsRequestAction - public init(isGuest: Bool, previousValue: TeamLog.TrustedTeamsRequestState, newValue: TeamLog.TrustedTeamsRequestState, actionDetails: TeamLog.TrustedTeamsRequestAction, guestTeamName: String? = nil, hostTeamName: String? = nil) { + public init( + isGuest: Bool, + previousValue: TeamLog.TrustedTeamsRequestState, + newValue: TeamLog.TrustedTeamsRequestState, + actionDetails: TeamLog.TrustedTeamsRequestAction, + guestTeamName: String? = nil, + hostTeamName: String? = nil + ) { self.isGuest = isGuest nullableValidator(stringValidator())(guestTeamName) self.guestTeamName = guestTeamName @@ -28108,72 +33445,101 @@ open class TeamLog { self.newValue = newValue self.actionDetails = actionDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GuestAdminChangeStatusDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GuestAdminChangeStatusDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GuestAdminChangeStatusDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GuestAdminChangeStatusDetails: \(error)" + } } } - open class GuestAdminChangeStatusDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GuestAdminChangeStatusDetails) -> JSON { - let output = [ - "is_guest": Serialization._BoolSerializer.serialize(value.isGuest), - "previous_value": TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.previousValue), - "new_value": TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.newValue), - "action_details": TeamLog.TrustedTeamsRequestActionSerializer().serialize(value.actionDetails), - "guest_team_name": NullableSerializer(Serialization._StringSerializer).serialize(value.guestTeamName), - "host_team_name": NullableSerializer(Serialization._StringSerializer).serialize(value.hostTeamName), + + public class GuestAdminChangeStatusDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GuestAdminChangeStatusDetails) throws -> JSON { + let output = [ + "is_guest": try Serialization._BoolSerializer.serialize(value.isGuest), + "previous_value": try TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.previousValue), + "new_value": try TeamLog.TrustedTeamsRequestStateSerializer().serialize(value.newValue), + "action_details": try TeamLog.TrustedTeamsRequestActionSerializer().serialize(value.actionDetails), + "guest_team_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.guestTeamName), + "host_team_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.hostTeamName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GuestAdminChangeStatusDetails { + + public func deserialize(_ json: JSON) throws -> GuestAdminChangeStatusDetails { switch json { - case .dictionary(let dict): - let isGuest = Serialization._BoolSerializer.deserialize(dict["is_guest"] ?? .null) - let previousValue = TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["new_value"] ?? .null) - let actionDetails = TeamLog.TrustedTeamsRequestActionSerializer().deserialize(dict["action_details"] ?? .null) - let guestTeamName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["guest_team_name"] ?? .null) - let hostTeamName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["host_team_name"] ?? .null) - return GuestAdminChangeStatusDetails(isGuest: isGuest, previousValue: previousValue, newValue: newValue, actionDetails: actionDetails, guestTeamName: guestTeamName, hostTeamName: hostTeamName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let isGuest = try Serialization._BoolSerializer.deserialize(dict["is_guest"] ?? .null) + let previousValue = try TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.TrustedTeamsRequestStateSerializer().deserialize(dict["new_value"] ?? .null) + let actionDetails = try TeamLog.TrustedTeamsRequestActionSerializer().deserialize(dict["action_details"] ?? .null) + let guestTeamName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["guest_team_name"] ?? .null) + let hostTeamName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["host_team_name"] ?? .null) + return GuestAdminChangeStatusDetails( + isGuest: isGuest, + previousValue: previousValue, + newValue: newValue, + actionDetails: actionDetails, + guestTeamName: guestTeamName, + hostTeamName: hostTeamName + ) + default: + throw JSONSerializerError.deserializeError(type: GuestAdminChangeStatusDetails.self, json: json) } } } /// The GuestAdminChangeStatusType struct - open class GuestAdminChangeStatusType: CustomStringConvertible { + public class GuestAdminChangeStatusType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GuestAdminChangeStatusTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GuestAdminChangeStatusTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GuestAdminChangeStatusTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GuestAdminChangeStatusType: \(error)" + } } } - open class GuestAdminChangeStatusTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GuestAdminChangeStatusType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GuestAdminChangeStatusTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GuestAdminChangeStatusType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GuestAdminChangeStatusType { + + public func deserialize(_ json: JSON) throws -> GuestAdminChangeStatusType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GuestAdminChangeStatusType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GuestAdminChangeStatusType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GuestAdminChangeStatusType.self, json: json) } } } /// Started trusted team admin session. - open class GuestAdminSignedInViaTrustedTeamsDetails: CustomStringConvertible { + public class GuestAdminSignedInViaTrustedTeamsDetails: CustomStringConvertible, JSONRepresentable { /// Host team name. public let teamName: String? /// Trusted team name. @@ -28184,64 +33550,86 @@ open class TeamLog { nullableValidator(stringValidator())(trustedTeamName) self.trustedTeamName = trustedTeamName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GuestAdminSignedInViaTrustedTeamsDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GuestAdminSignedInViaTrustedTeamsDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GuestAdminSignedInViaTrustedTeamsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GuestAdminSignedInViaTrustedTeamsDetails: \(error)" + } } } - open class GuestAdminSignedInViaTrustedTeamsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GuestAdminSignedInViaTrustedTeamsDetails) -> JSON { - let output = [ - "team_name": NullableSerializer(Serialization._StringSerializer).serialize(value.teamName), - "trusted_team_name": NullableSerializer(Serialization._StringSerializer).serialize(value.trustedTeamName), + + public class GuestAdminSignedInViaTrustedTeamsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GuestAdminSignedInViaTrustedTeamsDetails) throws -> JSON { + let output = [ + "team_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamName), + "trusted_team_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.trustedTeamName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GuestAdminSignedInViaTrustedTeamsDetails { + + public func deserialize(_ json: JSON) throws -> GuestAdminSignedInViaTrustedTeamsDetails { switch json { - case .dictionary(let dict): - let teamName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_name"] ?? .null) - let trustedTeamName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["trusted_team_name"] ?? .null) - return GuestAdminSignedInViaTrustedTeamsDetails(teamName: teamName, trustedTeamName: trustedTeamName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_name"] ?? .null) + let trustedTeamName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["trusted_team_name"] ?? .null) + return GuestAdminSignedInViaTrustedTeamsDetails(teamName: teamName, trustedTeamName: trustedTeamName) + default: + throw JSONSerializerError.deserializeError(type: GuestAdminSignedInViaTrustedTeamsDetails.self, json: json) } } } /// The GuestAdminSignedInViaTrustedTeamsType struct - open class GuestAdminSignedInViaTrustedTeamsType: CustomStringConvertible { + public class GuestAdminSignedInViaTrustedTeamsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GuestAdminSignedInViaTrustedTeamsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GuestAdminSignedInViaTrustedTeamsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GuestAdminSignedInViaTrustedTeamsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GuestAdminSignedInViaTrustedTeamsType: \(error)" + } } } - open class GuestAdminSignedInViaTrustedTeamsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GuestAdminSignedInViaTrustedTeamsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GuestAdminSignedInViaTrustedTeamsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GuestAdminSignedInViaTrustedTeamsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GuestAdminSignedInViaTrustedTeamsType { + + public func deserialize(_ json: JSON) throws -> GuestAdminSignedInViaTrustedTeamsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GuestAdminSignedInViaTrustedTeamsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GuestAdminSignedInViaTrustedTeamsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GuestAdminSignedInViaTrustedTeamsType.self, json: json) } } } /// Ended trusted team admin session. - open class GuestAdminSignedOutViaTrustedTeamsDetails: CustomStringConvertible { + public class GuestAdminSignedOutViaTrustedTeamsDetails: CustomStringConvertible, JSONRepresentable { /// Host team name. public let teamName: String? /// Trusted team name. @@ -28252,64 +33640,86 @@ open class TeamLog { nullableValidator(stringValidator())(trustedTeamName) self.trustedTeamName = trustedTeamName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GuestAdminSignedOutViaTrustedTeamsDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try GuestAdminSignedOutViaTrustedTeamsDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GuestAdminSignedOutViaTrustedTeamsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GuestAdminSignedOutViaTrustedTeamsDetails: \(error)" + } } } - open class GuestAdminSignedOutViaTrustedTeamsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GuestAdminSignedOutViaTrustedTeamsDetails) -> JSON { - let output = [ - "team_name": NullableSerializer(Serialization._StringSerializer).serialize(value.teamName), - "trusted_team_name": NullableSerializer(Serialization._StringSerializer).serialize(value.trustedTeamName), + + public class GuestAdminSignedOutViaTrustedTeamsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GuestAdminSignedOutViaTrustedTeamsDetails) throws -> JSON { + let output = [ + "team_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamName), + "trusted_team_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.trustedTeamName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GuestAdminSignedOutViaTrustedTeamsDetails { + + public func deserialize(_ json: JSON) throws -> GuestAdminSignedOutViaTrustedTeamsDetails { switch json { - case .dictionary(let dict): - let teamName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_name"] ?? .null) - let trustedTeamName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["trusted_team_name"] ?? .null) - return GuestAdminSignedOutViaTrustedTeamsDetails(teamName: teamName, trustedTeamName: trustedTeamName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_name"] ?? .null) + let trustedTeamName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["trusted_team_name"] ?? .null) + return GuestAdminSignedOutViaTrustedTeamsDetails(teamName: teamName, trustedTeamName: trustedTeamName) + default: + throw JSONSerializerError.deserializeError(type: GuestAdminSignedOutViaTrustedTeamsDetails.self, json: json) } } } /// The GuestAdminSignedOutViaTrustedTeamsType struct - open class GuestAdminSignedOutViaTrustedTeamsType: CustomStringConvertible { + public class GuestAdminSignedOutViaTrustedTeamsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GuestAdminSignedOutViaTrustedTeamsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try GuestAdminSignedOutViaTrustedTeamsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GuestAdminSignedOutViaTrustedTeamsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GuestAdminSignedOutViaTrustedTeamsType: \(error)" + } } } - open class GuestAdminSignedOutViaTrustedTeamsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GuestAdminSignedOutViaTrustedTeamsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class GuestAdminSignedOutViaTrustedTeamsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GuestAdminSignedOutViaTrustedTeamsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GuestAdminSignedOutViaTrustedTeamsType { + + public func deserialize(_ json: JSON) throws -> GuestAdminSignedOutViaTrustedTeamsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return GuestAdminSignedOutViaTrustedTeamsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return GuestAdminSignedOutViaTrustedTeamsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: GuestAdminSignedOutViaTrustedTeamsType.self, json: json) } } } /// The IdentifierType union - public enum IdentifierType: CustomStringConvertible { + public enum IdentifierType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case email /// An unspecified error. @@ -28317,174 +33727,228 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try IdentifierTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IdentifierTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IdentifierTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IdentifierType: \(error)" + } } } - open class IdentifierTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IdentifierType) -> JSON { + + public class IdentifierTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IdentifierType) throws -> JSON { switch value { - case .email: - var d = [String: JSON]() - d[".tag"] = .str("email") - return .dictionary(d) - case .facebookProfileName: - var d = [String: JSON]() - d[".tag"] = .str("facebook_profile_name") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> IdentifierType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "email": - return IdentifierType.email - case "facebook_profile_name": - return IdentifierType.facebookProfileName - case "other": - return IdentifierType.other - default: - return IdentifierType.other - } + case .email: + var d = [String: JSON]() + d[".tag"] = .str("email") + return .dictionary(d) + case .facebookProfileName: + var d = [String: JSON]() + d[".tag"] = .str("facebook_profile_name") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> IdentifierType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "email": + return IdentifierType.email + case "facebook_profile_name": + return IdentifierType.facebookProfileName + case "other": + return IdentifierType.other default: - fatalError("Failed to deserialize") + return IdentifierType.other + } + default: + throw JSONSerializerError.deserializeError(type: IdentifierType.self, json: json) } } } /// Connected integration for member. - open class IntegrationConnectedDetails: CustomStringConvertible { + public class IntegrationConnectedDetails: CustomStringConvertible, JSONRepresentable { /// Name of the third-party integration. public let integrationName: String public init(integrationName: String) { stringValidator()(integrationName) self.integrationName = integrationName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IntegrationConnectedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try IntegrationConnectedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IntegrationConnectedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IntegrationConnectedDetails: \(error)" + } } } - open class IntegrationConnectedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IntegrationConnectedDetails) -> JSON { - let output = [ - "integration_name": Serialization._StringSerializer.serialize(value.integrationName), + + public class IntegrationConnectedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IntegrationConnectedDetails) throws -> JSON { + let output = [ + "integration_name": try Serialization._StringSerializer.serialize(value.integrationName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IntegrationConnectedDetails { + + public func deserialize(_ json: JSON) throws -> IntegrationConnectedDetails { switch json { - case .dictionary(let dict): - let integrationName = Serialization._StringSerializer.deserialize(dict["integration_name"] ?? .null) - return IntegrationConnectedDetails(integrationName: integrationName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let integrationName = try Serialization._StringSerializer.deserialize(dict["integration_name"] ?? .null) + return IntegrationConnectedDetails(integrationName: integrationName) + default: + throw JSONSerializerError.deserializeError(type: IntegrationConnectedDetails.self, json: json) } } } /// The IntegrationConnectedType struct - open class IntegrationConnectedType: CustomStringConvertible { + public class IntegrationConnectedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IntegrationConnectedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try IntegrationConnectedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IntegrationConnectedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IntegrationConnectedType: \(error)" + } } } - open class IntegrationConnectedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IntegrationConnectedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class IntegrationConnectedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IntegrationConnectedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IntegrationConnectedType { + + public func deserialize(_ json: JSON) throws -> IntegrationConnectedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return IntegrationConnectedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return IntegrationConnectedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: IntegrationConnectedType.self, json: json) } } } /// Disconnected integration for member. - open class IntegrationDisconnectedDetails: CustomStringConvertible { + public class IntegrationDisconnectedDetails: CustomStringConvertible, JSONRepresentable { /// Name of the third-party integration. public let integrationName: String public init(integrationName: String) { stringValidator()(integrationName) self.integrationName = integrationName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IntegrationDisconnectedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try IntegrationDisconnectedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IntegrationDisconnectedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IntegrationDisconnectedDetails: \(error)" + } } } - open class IntegrationDisconnectedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IntegrationDisconnectedDetails) -> JSON { - let output = [ - "integration_name": Serialization._StringSerializer.serialize(value.integrationName), + + public class IntegrationDisconnectedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IntegrationDisconnectedDetails) throws -> JSON { + let output = [ + "integration_name": try Serialization._StringSerializer.serialize(value.integrationName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IntegrationDisconnectedDetails { + + public func deserialize(_ json: JSON) throws -> IntegrationDisconnectedDetails { switch json { - case .dictionary(let dict): - let integrationName = Serialization._StringSerializer.deserialize(dict["integration_name"] ?? .null) - return IntegrationDisconnectedDetails(integrationName: integrationName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let integrationName = try Serialization._StringSerializer.deserialize(dict["integration_name"] ?? .null) + return IntegrationDisconnectedDetails(integrationName: integrationName) + default: + throw JSONSerializerError.deserializeError(type: IntegrationDisconnectedDetails.self, json: json) } } } /// The IntegrationDisconnectedType struct - open class IntegrationDisconnectedType: CustomStringConvertible { + public class IntegrationDisconnectedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IntegrationDisconnectedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try IntegrationDisconnectedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IntegrationDisconnectedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IntegrationDisconnectedType: \(error)" + } } } - open class IntegrationDisconnectedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IntegrationDisconnectedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class IntegrationDisconnectedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IntegrationDisconnectedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IntegrationDisconnectedType { + + public func deserialize(_ json: JSON) throws -> IntegrationDisconnectedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return IntegrationDisconnectedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return IntegrationDisconnectedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: IntegrationDisconnectedType.self, json: json) } } } /// Policy for controlling whether a service integration is enabled for the team. - public enum IntegrationPolicy: CustomStringConvertible { + public enum IntegrationPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -28492,50 +33956,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try IntegrationPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IntegrationPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IntegrationPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for IntegrationPolicy: \(error)" + } } } - open class IntegrationPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IntegrationPolicy) -> JSON { + + public class IntegrationPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IntegrationPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> IntegrationPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return IntegrationPolicy.disabled - case "enabled": - return IntegrationPolicy.enabled - case "other": - return IntegrationPolicy.other - default: - return IntegrationPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> IntegrationPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return IntegrationPolicy.disabled + case "enabled": + return IntegrationPolicy.enabled + case "other": + return IntegrationPolicy.other default: - fatalError("Failed to deserialize") + return IntegrationPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: IntegrationPolicy.self, json: json) } } } /// Changed integration policy for team. - open class IntegrationPolicyChangedDetails: CustomStringConvertible { + public class IntegrationPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// Name of the third-party integration. public let integrationName: String /// New integration policy. @@ -28548,66 +34022,88 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IntegrationPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try IntegrationPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IntegrationPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IntegrationPolicyChangedDetails: \(error)" + } } } - open class IntegrationPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IntegrationPolicyChangedDetails) -> JSON { - let output = [ - "integration_name": Serialization._StringSerializer.serialize(value.integrationName), - "new_value": TeamLog.IntegrationPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.IntegrationPolicySerializer().serialize(value.previousValue), + + public class IntegrationPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IntegrationPolicyChangedDetails) throws -> JSON { + let output = [ + "integration_name": try Serialization._StringSerializer.serialize(value.integrationName), + "new_value": try TeamLog.IntegrationPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.IntegrationPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IntegrationPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> IntegrationPolicyChangedDetails { switch json { - case .dictionary(let dict): - let integrationName = Serialization._StringSerializer.deserialize(dict["integration_name"] ?? .null) - let newValue = TeamLog.IntegrationPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.IntegrationPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return IntegrationPolicyChangedDetails(integrationName: integrationName, newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let integrationName = try Serialization._StringSerializer.deserialize(dict["integration_name"] ?? .null) + let newValue = try TeamLog.IntegrationPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.IntegrationPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return IntegrationPolicyChangedDetails(integrationName: integrationName, newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: IntegrationPolicyChangedDetails.self, json: json) } } } /// The IntegrationPolicyChangedType struct - open class IntegrationPolicyChangedType: CustomStringConvertible { + public class IntegrationPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IntegrationPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try IntegrationPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IntegrationPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IntegrationPolicyChangedType: \(error)" + } } } - open class IntegrationPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IntegrationPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class IntegrationPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IntegrationPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IntegrationPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> IntegrationPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return IntegrationPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return IntegrationPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: IntegrationPolicyChangedType.self, json: json) } } } /// Policy for deciding whether team admins receive email when an invitation to join the team is accepted - public enum InviteAcceptanceEmailPolicy: CustomStringConvertible { + public enum InviteAcceptanceEmailPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -28615,50 +34111,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try InviteAcceptanceEmailPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InviteAcceptanceEmailPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InviteAcceptanceEmailPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for InviteAcceptanceEmailPolicy: \(error)" + } } } - open class InviteAcceptanceEmailPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InviteAcceptanceEmailPolicy) -> JSON { + + public class InviteAcceptanceEmailPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InviteAcceptanceEmailPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> InviteAcceptanceEmailPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return InviteAcceptanceEmailPolicy.disabled - case "enabled": - return InviteAcceptanceEmailPolicy.enabled - case "other": - return InviteAcceptanceEmailPolicy.other - default: - return InviteAcceptanceEmailPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> InviteAcceptanceEmailPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return InviteAcceptanceEmailPolicy.disabled + case "enabled": + return InviteAcceptanceEmailPolicy.enabled + case "other": + return InviteAcceptanceEmailPolicy.other default: - fatalError("Failed to deserialize") + return InviteAcceptanceEmailPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: InviteAcceptanceEmailPolicy.self, json: json) } } } /// Changed invite accept email policy for team. - open class InviteAcceptanceEmailPolicyChangedDetails: CustomStringConvertible { + public class InviteAcceptanceEmailPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// To. public let newValue: TeamLog.InviteAcceptanceEmailPolicy /// From. @@ -28667,64 +34173,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InviteAcceptanceEmailPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try InviteAcceptanceEmailPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InviteAcceptanceEmailPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InviteAcceptanceEmailPolicyChangedDetails: \(error)" + } } } - open class InviteAcceptanceEmailPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InviteAcceptanceEmailPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.InviteAcceptanceEmailPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.InviteAcceptanceEmailPolicySerializer().serialize(value.previousValue), + + public class InviteAcceptanceEmailPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InviteAcceptanceEmailPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.InviteAcceptanceEmailPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.InviteAcceptanceEmailPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> InviteAcceptanceEmailPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> InviteAcceptanceEmailPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.InviteAcceptanceEmailPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.InviteAcceptanceEmailPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return InviteAcceptanceEmailPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.InviteAcceptanceEmailPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.InviteAcceptanceEmailPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return InviteAcceptanceEmailPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: InviteAcceptanceEmailPolicyChangedDetails.self, json: json) } } } /// The InviteAcceptanceEmailPolicyChangedType struct - open class InviteAcceptanceEmailPolicyChangedType: CustomStringConvertible { + public class InviteAcceptanceEmailPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InviteAcceptanceEmailPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try InviteAcceptanceEmailPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InviteAcceptanceEmailPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InviteAcceptanceEmailPolicyChangedType: \(error)" + } } } - open class InviteAcceptanceEmailPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InviteAcceptanceEmailPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class InviteAcceptanceEmailPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InviteAcceptanceEmailPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> InviteAcceptanceEmailPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> InviteAcceptanceEmailPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return InviteAcceptanceEmailPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return InviteAcceptanceEmailPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: InviteAcceptanceEmailPolicyChangedType.self, json: json) } } } /// The InviteMethod union - public enum InviteMethod: CustomStringConvertible { + public enum InviteMethod: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case autoApprove /// An unspecified error. @@ -28736,68 +34264,78 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try InviteMethodSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(InviteMethodSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try InviteMethodSerializer().serialize(self)))" + } catch { + return "Failed to generate description for InviteMethod: \(error)" + } } } - open class InviteMethodSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: InviteMethod) -> JSON { + + public class InviteMethodSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: InviteMethod) throws -> JSON { switch value { - case .autoApprove: - var d = [String: JSON]() - d[".tag"] = .str("auto_approve") - return .dictionary(d) - case .inviteLink: - var d = [String: JSON]() - d[".tag"] = .str("invite_link") - return .dictionary(d) - case .memberInvite: - var d = [String: JSON]() - d[".tag"] = .str("member_invite") - return .dictionary(d) - case .movedFromAnotherTeam: - var d = [String: JSON]() - d[".tag"] = .str("moved_from_another_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> InviteMethod { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "auto_approve": - return InviteMethod.autoApprove - case "invite_link": - return InviteMethod.inviteLink - case "member_invite": - return InviteMethod.memberInvite - case "moved_from_another_team": - return InviteMethod.movedFromAnotherTeam - case "other": - return InviteMethod.other - default: - return InviteMethod.other - } - default: - fatalError("Failed to deserialize") + case .autoApprove: + var d = [String: JSON]() + d[".tag"] = .str("auto_approve") + return .dictionary(d) + case .inviteLink: + var d = [String: JSON]() + d[".tag"] = .str("invite_link") + return .dictionary(d) + case .memberInvite: + var d = [String: JSON]() + d[".tag"] = .str("member_invite") + return .dictionary(d) + case .movedFromAnotherTeam: + var d = [String: JSON]() + d[".tag"] = .str("moved_from_another_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> InviteMethod { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "auto_approve": + return InviteMethod.autoApprove + case "invite_link": + return InviteMethod.inviteLink + case "member_invite": + return InviteMethod.memberInvite + case "moved_from_another_team": + return InviteMethod.movedFromAnotherTeam + case "other": + return InviteMethod.other + default: + return InviteMethod.other + } + default: + throw JSONSerializerError.deserializeError(type: InviteMethod.self, json: json) } } } /// Additional information relevant when a new member joins the team. - open class JoinTeamDetails: CustomStringConvertible { + public class JoinTeamDetails: CustomStringConvertible, JSONRepresentable { /// Linked applications. (Deprecated) Please use has_linked_apps boolean field instead. - public let linkedApps: Array + public let linkedApps: [TeamLog.UserLinkedAppLogInfo] /// Linked devices. (Deprecated) Please use has_linked_devices boolean field instead. - public let linkedDevices: Array + public let linkedDevices: [TeamLog.LinkedDeviceLogInfo] /// Linked shared folders. (Deprecated) Please use has_linked_shared_folders boolean field instead. - public let linkedSharedFolders: Array + public let linkedSharedFolders: [TeamLog.FolderLogInfo] /// (Deprecated) True if the linked_apps list was truncated to the maximum supported length (50). public let wasLinkedAppsTruncated: Bool? /// (Deprecated) True if the linked_devices list was truncated to the maximum supported length (50). @@ -28810,7 +34348,17 @@ open class TeamLog { public let hasLinkedDevices: Bool? /// True if the user had linked shared folders at event time. public let hasLinkedSharedFolders: Bool? - public init(linkedApps: Array, linkedDevices: Array, linkedSharedFolders: Array, wasLinkedAppsTruncated: Bool? = nil, wasLinkedDevicesTruncated: Bool? = nil, wasLinkedSharedFoldersTruncated: Bool? = nil, hasLinkedApps: Bool? = nil, hasLinkedDevices: Bool? = nil, hasLinkedSharedFolders: Bool? = nil) { + public init( + linkedApps: [TeamLog.UserLinkedAppLogInfo], + linkedDevices: [TeamLog.LinkedDeviceLogInfo], + linkedSharedFolders: [TeamLog.FolderLogInfo], + wasLinkedAppsTruncated: Bool? = nil, + wasLinkedDevicesTruncated: Bool? = nil, + wasLinkedSharedFoldersTruncated: Bool? = nil, + hasLinkedApps: Bool? = nil, + hasLinkedDevices: Bool? = nil, + hasLinkedSharedFolders: Bool? = nil + ) { self.linkedApps = linkedApps self.linkedDevices = linkedDevices self.linkedSharedFolders = linkedSharedFolders @@ -28821,47 +34369,70 @@ open class TeamLog { self.hasLinkedDevices = hasLinkedDevices self.hasLinkedSharedFolders = hasLinkedSharedFolders } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(JoinTeamDetailsSerializer().serialize(self)))" - } - } - open class JoinTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: JoinTeamDetails) -> JSON { - let output = [ - "linked_apps": ArraySerializer(TeamLog.UserLinkedAppLogInfoSerializer()).serialize(value.linkedApps), - "linked_devices": ArraySerializer(TeamLog.LinkedDeviceLogInfoSerializer()).serialize(value.linkedDevices), - "linked_shared_folders": ArraySerializer(TeamLog.FolderLogInfoSerializer()).serialize(value.linkedSharedFolders), - "was_linked_apps_truncated": NullableSerializer(Serialization._BoolSerializer).serialize(value.wasLinkedAppsTruncated), - "was_linked_devices_truncated": NullableSerializer(Serialization._BoolSerializer).serialize(value.wasLinkedDevicesTruncated), - "was_linked_shared_folders_truncated": NullableSerializer(Serialization._BoolSerializer).serialize(value.wasLinkedSharedFoldersTruncated), - "has_linked_apps": NullableSerializer(Serialization._BoolSerializer).serialize(value.hasLinkedApps), - "has_linked_devices": NullableSerializer(Serialization._BoolSerializer).serialize(value.hasLinkedDevices), - "has_linked_shared_folders": NullableSerializer(Serialization._BoolSerializer).serialize(value.hasLinkedSharedFolders), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> JoinTeamDetails { - switch json { - case .dictionary(let dict): - let linkedApps = ArraySerializer(TeamLog.UserLinkedAppLogInfoSerializer()).deserialize(dict["linked_apps"] ?? .null) - let linkedDevices = ArraySerializer(TeamLog.LinkedDeviceLogInfoSerializer()).deserialize(dict["linked_devices"] ?? .null) - let linkedSharedFolders = ArraySerializer(TeamLog.FolderLogInfoSerializer()).deserialize(dict["linked_shared_folders"] ?? .null) - let wasLinkedAppsTruncated = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["was_linked_apps_truncated"] ?? .null) - let wasLinkedDevicesTruncated = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["was_linked_devices_truncated"] ?? .null) - let wasLinkedSharedFoldersTruncated = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["was_linked_shared_folders_truncated"] ?? .null) - let hasLinkedApps = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["has_linked_apps"] ?? .null) - let hasLinkedDevices = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["has_linked_devices"] ?? .null) - let hasLinkedSharedFolders = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["has_linked_shared_folders"] ?? .null) - return JoinTeamDetails(linkedApps: linkedApps, linkedDevices: linkedDevices, linkedSharedFolders: linkedSharedFolders, wasLinkedAppsTruncated: wasLinkedAppsTruncated, wasLinkedDevicesTruncated: wasLinkedDevicesTruncated, wasLinkedSharedFoldersTruncated: wasLinkedSharedFoldersTruncated, hasLinkedApps: hasLinkedApps, hasLinkedDevices: hasLinkedDevices, hasLinkedSharedFolders: hasLinkedSharedFolders) - default: - fatalError("Type error deserializing") + + func json() throws -> JSON { + try JoinTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try JoinTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for JoinTeamDetails: \(error)" + } + } + } + + public class JoinTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: JoinTeamDetails) throws -> JSON { + let output = [ + "linked_apps": try ArraySerializer(TeamLog.UserLinkedAppLogInfoSerializer()).serialize(value.linkedApps), + "linked_devices": try ArraySerializer(TeamLog.LinkedDeviceLogInfoSerializer()).serialize(value.linkedDevices), + "linked_shared_folders": try ArraySerializer(TeamLog.FolderLogInfoSerializer()).serialize(value.linkedSharedFolders), + "was_linked_apps_truncated": try NullableSerializer(Serialization._BoolSerializer).serialize(value.wasLinkedAppsTruncated), + "was_linked_devices_truncated": try NullableSerializer(Serialization._BoolSerializer).serialize(value.wasLinkedDevicesTruncated), + "was_linked_shared_folders_truncated": try NullableSerializer(Serialization._BoolSerializer).serialize(value.wasLinkedSharedFoldersTruncated), + "has_linked_apps": try NullableSerializer(Serialization._BoolSerializer).serialize(value.hasLinkedApps), + "has_linked_devices": try NullableSerializer(Serialization._BoolSerializer).serialize(value.hasLinkedDevices), + "has_linked_shared_folders": try NullableSerializer(Serialization._BoolSerializer).serialize(value.hasLinkedSharedFolders), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> JoinTeamDetails { + switch json { + case .dictionary(let dict): + let linkedApps = try ArraySerializer(TeamLog.UserLinkedAppLogInfoSerializer()).deserialize(dict["linked_apps"] ?? .null) + let linkedDevices = try ArraySerializer(TeamLog.LinkedDeviceLogInfoSerializer()).deserialize(dict["linked_devices"] ?? .null) + let linkedSharedFolders = try ArraySerializer(TeamLog.FolderLogInfoSerializer()).deserialize(dict["linked_shared_folders"] ?? .null) + let wasLinkedAppsTruncated = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["was_linked_apps_truncated"] ?? .null) + let wasLinkedDevicesTruncated = try NullableSerializer(Serialization._BoolSerializer) + .deserialize(dict["was_linked_devices_truncated"] ?? .null) + let wasLinkedSharedFoldersTruncated = try NullableSerializer(Serialization._BoolSerializer) + .deserialize(dict["was_linked_shared_folders_truncated"] ?? .null) + let hasLinkedApps = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["has_linked_apps"] ?? .null) + let hasLinkedDevices = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["has_linked_devices"] ?? .null) + let hasLinkedSharedFolders = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["has_linked_shared_folders"] ?? .null) + return JoinTeamDetails( + linkedApps: linkedApps, + linkedDevices: linkedDevices, + linkedSharedFolders: linkedSharedFolders, + wasLinkedAppsTruncated: wasLinkedAppsTruncated, + wasLinkedDevicesTruncated: wasLinkedDevicesTruncated, + wasLinkedSharedFoldersTruncated: wasLinkedSharedFoldersTruncated, + hasLinkedApps: hasLinkedApps, + hasLinkedDevices: hasLinkedDevices, + hasLinkedSharedFolders: hasLinkedSharedFolders + ) + default: + throw JSONSerializerError.deserializeError(type: JoinTeamDetails.self, json: json) } } } /// Label type - public enum LabelType: CustomStringConvertible { + public enum LabelType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case personalInformation /// An unspecified error. @@ -28871,56 +34442,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try LabelTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LabelTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LabelTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LabelType: \(error)" + } } } - open class LabelTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LabelType) -> JSON { + + public class LabelTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LabelType) throws -> JSON { switch value { - case .personalInformation: - var d = [String: JSON]() - d[".tag"] = .str("personal_information") - return .dictionary(d) - case .testOnly: - var d = [String: JSON]() - d[".tag"] = .str("test_only") - return .dictionary(d) - case .userDefinedTag: - var d = [String: JSON]() - d[".tag"] = .str("user_defined_tag") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LabelType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "personal_information": - return LabelType.personalInformation - case "test_only": - return LabelType.testOnly - case "user_defined_tag": - return LabelType.userDefinedTag - case "other": - return LabelType.other - default: - return LabelType.other - } - default: - fatalError("Failed to deserialize") + case .personalInformation: + var d = [String: JSON]() + d[".tag"] = .str("personal_information") + return .dictionary(d) + case .testOnly: + var d = [String: JSON]() + d[".tag"] = .str("test_only") + return .dictionary(d) + case .userDefinedTag: + var d = [String: JSON]() + d[".tag"] = .str("user_defined_tag") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LabelType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "personal_information": + return LabelType.personalInformation + case "test_only": + return LabelType.testOnly + case "user_defined_tag": + return LabelType.userDefinedTag + case "other": + return LabelType.other + default: + return LabelType.other + } + default: + throw JSONSerializerError.deserializeError(type: LabelType.self, json: json) } } } /// Information on sessions, in legacy format - open class LegacyDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { + public class LegacyDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { /// Session unique id. public let sessionInfo: TeamLog.SessionLogInfo? /// The device name. Might be missing due to historical data gap. @@ -28940,7 +34521,20 @@ open class TeamLog { /// Alternative unique device session id, instead of session id field. Might be missing due to historical data /// gap. public let legacyUniqId: String? - public init(ipAddress: String? = nil, created: Date? = nil, updated: Date? = nil, sessionInfo: TeamLog.SessionLogInfo? = nil, displayName: String? = nil, isEmmManaged: Bool? = nil, platform: String? = nil, macAddress: String? = nil, osVersion: String? = nil, deviceType: String? = nil, clientVersion: String? = nil, legacyUniqId: String? = nil) { + public init( + ipAddress: String? = nil, + created: Date? = nil, + updated: Date? = nil, + sessionInfo: TeamLog.SessionLogInfo? = nil, + displayName: String? = nil, + isEmmManaged: Bool? = nil, + platform: String? = nil, + macAddress: String? = nil, + osVersion: String? = nil, + deviceType: String? = nil, + clientVersion: String? = nil, + legacyUniqId: String? = nil + ) { self.sessionInfo = sessionInfo nullableValidator(stringValidator())(displayName) self.displayName = displayName @@ -28959,53 +34553,73 @@ open class TeamLog { self.legacyUniqId = legacyUniqId super.init(ipAddress: ipAddress, created: created, updated: updated) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegacyDeviceSessionLogInfoSerializer().serialize(self)))" - } - } - open class LegacyDeviceSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegacyDeviceSessionLogInfo) -> JSON { - let output = [ - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), - "session_info": NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "is_emm_managed": NullableSerializer(Serialization._BoolSerializer).serialize(value.isEmmManaged), - "platform": NullableSerializer(Serialization._StringSerializer).serialize(value.platform), - "mac_address": NullableSerializer(Serialization._StringSerializer).serialize(value.macAddress), - "os_version": NullableSerializer(Serialization._StringSerializer).serialize(value.osVersion), - "device_type": NullableSerializer(Serialization._StringSerializer).serialize(value.deviceType), - "client_version": NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), - "legacy_uniq_id": NullableSerializer(Serialization._StringSerializer).serialize(value.legacyUniqId), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> LegacyDeviceSessionLogInfo { - switch json { - case .dictionary(let dict): - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - let sessionInfo = NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let isEmmManaged = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_emm_managed"] ?? .null) - let platform = NullableSerializer(Serialization._StringSerializer).deserialize(dict["platform"] ?? .null) - let macAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["mac_address"] ?? .null) - let osVersion = NullableSerializer(Serialization._StringSerializer).deserialize(dict["os_version"] ?? .null) - let deviceType = NullableSerializer(Serialization._StringSerializer).deserialize(dict["device_type"] ?? .null) - let clientVersion = NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) - let legacyUniqId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["legacy_uniq_id"] ?? .null) - return LegacyDeviceSessionLogInfo(ipAddress: ipAddress, created: created, updated: updated, sessionInfo: sessionInfo, displayName: displayName, isEmmManaged: isEmmManaged, platform: platform, macAddress: macAddress, osVersion: osVersion, deviceType: deviceType, clientVersion: clientVersion, legacyUniqId: legacyUniqId) - default: - fatalError("Type error deserializing") + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegacyDeviceSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegacyDeviceSessionLogInfo: \(error)" + } + } + } + + public class LegacyDeviceSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegacyDeviceSessionLogInfo) throws -> JSON { + let output = [ + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + "session_info": try NullableSerializer(TeamLog.SessionLogInfoSerializer()).serialize(value.sessionInfo), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "is_emm_managed": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isEmmManaged), + "platform": try NullableSerializer(Serialization._StringSerializer).serialize(value.platform), + "mac_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.macAddress), + "os_version": try NullableSerializer(Serialization._StringSerializer).serialize(value.osVersion), + "device_type": try NullableSerializer(Serialization._StringSerializer).serialize(value.deviceType), + "client_version": try NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), + "legacy_uniq_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.legacyUniqId), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> LegacyDeviceSessionLogInfo { + switch json { + case .dictionary(let dict): + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + let sessionInfo = try NullableSerializer(TeamLog.SessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let isEmmManaged = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_emm_managed"] ?? .null) + let platform = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["platform"] ?? .null) + let macAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["mac_address"] ?? .null) + let osVersion = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["os_version"] ?? .null) + let deviceType = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["device_type"] ?? .null) + let clientVersion = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) + let legacyUniqId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["legacy_uniq_id"] ?? .null) + return LegacyDeviceSessionLogInfo( + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo, + displayName: displayName, + isEmmManaged: isEmmManaged, + platform: platform, + macAddress: macAddress, + osVersion: osVersion, + deviceType: deviceType, + clientVersion: clientVersion, + legacyUniqId: legacyUniqId + ) + default: + throw JSONSerializerError.deserializeError(type: LegacyDeviceSessionLogInfo.self, json: json) } } } /// Activated a hold. - open class LegalHoldsActivateAHoldDetails: CustomStringConvertible { + public class LegalHoldsActivateAHoldDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29022,68 +34636,90 @@ open class TeamLog { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsActivateAHoldDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsActivateAHoldDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsActivateAHoldDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsActivateAHoldDetails: \(error)" + } } } - open class LegalHoldsActivateAHoldDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsActivateAHoldDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), - "start_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), - "end_date": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endDate), + + public class LegalHoldsActivateAHoldDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsActivateAHoldDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), + "start_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), + "end_date": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsActivateAHoldDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsActivateAHoldDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let startDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) - let endDate = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_date"] ?? .null) - return LegalHoldsActivateAHoldDetails(legalHoldId: legalHoldId, name: name, startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let startDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) + let endDate = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["end_date"] ?? .null) + return LegalHoldsActivateAHoldDetails(legalHoldId: legalHoldId, name: name, startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsActivateAHoldDetails.self, json: json) } } } /// The LegalHoldsActivateAHoldType struct - open class LegalHoldsActivateAHoldType: CustomStringConvertible { + public class LegalHoldsActivateAHoldType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsActivateAHoldTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsActivateAHoldTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsActivateAHoldTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsActivateAHoldType: \(error)" + } } } - open class LegalHoldsActivateAHoldTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsActivateAHoldType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsActivateAHoldTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsActivateAHoldType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsActivateAHoldType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsActivateAHoldType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsActivateAHoldType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsActivateAHoldType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsActivateAHoldType.self, json: json) } } } /// Added members to a hold. - open class LegalHoldsAddMembersDetails: CustomStringConvertible { + public class LegalHoldsAddMembersDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29094,64 +34730,86 @@ open class TeamLog { stringValidator()(name) self.name = name } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsAddMembersDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsAddMembersDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsAddMembersDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsAddMembersDetails: \(error)" + } } } - open class LegalHoldsAddMembersDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsAddMembersDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), + + public class LegalHoldsAddMembersDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsAddMembersDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsAddMembersDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsAddMembersDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return LegalHoldsAddMembersDetails(legalHoldId: legalHoldId, name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return LegalHoldsAddMembersDetails(legalHoldId: legalHoldId, name: name) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsAddMembersDetails.self, json: json) } } } /// The LegalHoldsAddMembersType struct - open class LegalHoldsAddMembersType: CustomStringConvertible { + public class LegalHoldsAddMembersType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsAddMembersTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsAddMembersTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsAddMembersTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsAddMembersType: \(error)" + } } } - open class LegalHoldsAddMembersTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsAddMembersType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsAddMembersTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsAddMembersType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsAddMembersType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsAddMembersType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsAddMembersType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsAddMembersType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsAddMembersType.self, json: json) } } } /// Edited details for a hold. - open class LegalHoldsChangeHoldDetailsDetails: CustomStringConvertible { + public class LegalHoldsChangeHoldDetailsDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29170,68 +34828,90 @@ open class TeamLog { stringValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsChangeHoldDetailsDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsChangeHoldDetailsDetailsSerializer().serialize(self) } - } - open class LegalHoldsChangeHoldDetailsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsChangeHoldDetailsDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsChangeHoldDetailsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsChangeHoldDetailsDetails: \(error)" + } + } + } + + public class LegalHoldsChangeHoldDetailsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsChangeHoldDetailsDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), + "new_value": try Serialization._StringSerializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsChangeHoldDetailsDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsChangeHoldDetailsDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return LegalHoldsChangeHoldDetailsDetails(legalHoldId: legalHoldId, name: name, previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return LegalHoldsChangeHoldDetailsDetails(legalHoldId: legalHoldId, name: name, previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsChangeHoldDetailsDetails.self, json: json) } } } /// The LegalHoldsChangeHoldDetailsType struct - open class LegalHoldsChangeHoldDetailsType: CustomStringConvertible { + public class LegalHoldsChangeHoldDetailsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsChangeHoldDetailsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsChangeHoldDetailsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsChangeHoldDetailsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsChangeHoldDetailsType: \(error)" + } } } - open class LegalHoldsChangeHoldDetailsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsChangeHoldDetailsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsChangeHoldDetailsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsChangeHoldDetailsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsChangeHoldDetailsType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsChangeHoldDetailsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsChangeHoldDetailsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsChangeHoldDetailsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsChangeHoldDetailsType.self, json: json) } } } /// Renamed a hold. - open class LegalHoldsChangeHoldNameDetails: CustomStringConvertible { + public class LegalHoldsChangeHoldNameDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Previous Name. @@ -29246,66 +34926,88 @@ open class TeamLog { stringValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsChangeHoldNameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsChangeHoldNameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsChangeHoldNameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsChangeHoldNameDetails: \(error)" + } } } - open class LegalHoldsChangeHoldNameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsChangeHoldNameDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public class LegalHoldsChangeHoldNameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsChangeHoldNameDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), + "new_value": try Serialization._StringSerializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsChangeHoldNameDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsChangeHoldNameDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return LegalHoldsChangeHoldNameDetails(legalHoldId: legalHoldId, previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return LegalHoldsChangeHoldNameDetails(legalHoldId: legalHoldId, previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsChangeHoldNameDetails.self, json: json) } } } /// The LegalHoldsChangeHoldNameType struct - open class LegalHoldsChangeHoldNameType: CustomStringConvertible { + public class LegalHoldsChangeHoldNameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsChangeHoldNameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsChangeHoldNameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsChangeHoldNameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsChangeHoldNameType: \(error)" + } } } - open class LegalHoldsChangeHoldNameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsChangeHoldNameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsChangeHoldNameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsChangeHoldNameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsChangeHoldNameType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsChangeHoldNameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsChangeHoldNameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsChangeHoldNameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsChangeHoldNameType.self, json: json) } } } /// Exported hold. - open class LegalHoldsExportAHoldDetails: CustomStringConvertible { + public class LegalHoldsExportAHoldDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29320,66 +35022,88 @@ open class TeamLog { nullableValidator(stringValidator())(exportName) self.exportName = exportName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportAHoldDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportAHoldDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportAHoldDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportAHoldDetails: \(error)" + } } } - open class LegalHoldsExportAHoldDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportAHoldDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), - "export_name": NullableSerializer(Serialization._StringSerializer).serialize(value.exportName), + + public class LegalHoldsExportAHoldDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportAHoldDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), + "export_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.exportName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportAHoldDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportAHoldDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let exportName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_name"] ?? .null) - return LegalHoldsExportAHoldDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let exportName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["export_name"] ?? .null) + return LegalHoldsExportAHoldDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportAHoldDetails.self, json: json) } } } /// The LegalHoldsExportAHoldType struct - open class LegalHoldsExportAHoldType: CustomStringConvertible { + public class LegalHoldsExportAHoldType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportAHoldTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportAHoldTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportAHoldTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportAHoldType: \(error)" + } } } - open class LegalHoldsExportAHoldTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportAHoldType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsExportAHoldTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportAHoldType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportAHoldType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportAHoldType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsExportAHoldType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsExportAHoldType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportAHoldType.self, json: json) } } } /// Canceled export for a hold. - open class LegalHoldsExportCancelledDetails: CustomStringConvertible { + public class LegalHoldsExportCancelledDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29394,66 +35118,88 @@ open class TeamLog { stringValidator()(exportName) self.exportName = exportName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportCancelledDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportCancelledDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportCancelledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportCancelledDetails: \(error)" + } } } - open class LegalHoldsExportCancelledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportCancelledDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), - "export_name": Serialization._StringSerializer.serialize(value.exportName), + + public class LegalHoldsExportCancelledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportCancelledDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), + "export_name": try Serialization._StringSerializer.serialize(value.exportName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportCancelledDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportCancelledDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let exportName = Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) - return LegalHoldsExportCancelledDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let exportName = try Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) + return LegalHoldsExportCancelledDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportCancelledDetails.self, json: json) } } } /// The LegalHoldsExportCancelledType struct - open class LegalHoldsExportCancelledType: CustomStringConvertible { + public class LegalHoldsExportCancelledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportCancelledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportCancelledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportCancelledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportCancelledType: \(error)" + } } } - open class LegalHoldsExportCancelledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportCancelledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsExportCancelledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportCancelledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportCancelledType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportCancelledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsExportCancelledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsExportCancelledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportCancelledType.self, json: json) } } } /// Downloaded export for a hold. - open class LegalHoldsExportDownloadedDetails: CustomStringConvertible { + public class LegalHoldsExportDownloadedDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29476,70 +35222,92 @@ open class TeamLog { nullableValidator(stringValidator())(fileName) self.fileName = fileName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportDownloadedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportDownloadedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportDownloadedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportDownloadedDetails: \(error)" + } } } - open class LegalHoldsExportDownloadedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportDownloadedDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), - "export_name": Serialization._StringSerializer.serialize(value.exportName), - "part": NullableSerializer(Serialization._StringSerializer).serialize(value.part), - "file_name": NullableSerializer(Serialization._StringSerializer).serialize(value.fileName), + + public class LegalHoldsExportDownloadedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportDownloadedDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), + "export_name": try Serialization._StringSerializer.serialize(value.exportName), + "part": try NullableSerializer(Serialization._StringSerializer).serialize(value.part), + "file_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.fileName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportDownloadedDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportDownloadedDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let exportName = Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) - let part = NullableSerializer(Serialization._StringSerializer).deserialize(dict["part"] ?? .null) - let fileName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_name"] ?? .null) - return LegalHoldsExportDownloadedDetails(legalHoldId: legalHoldId, name: name, exportName: exportName, part: part, fileName: fileName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let exportName = try Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) + let part = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["part"] ?? .null) + let fileName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["file_name"] ?? .null) + return LegalHoldsExportDownloadedDetails(legalHoldId: legalHoldId, name: name, exportName: exportName, part: part, fileName: fileName) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportDownloadedDetails.self, json: json) } } } /// The LegalHoldsExportDownloadedType struct - open class LegalHoldsExportDownloadedType: CustomStringConvertible { + public class LegalHoldsExportDownloadedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportDownloadedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportDownloadedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportDownloadedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportDownloadedType: \(error)" + } } } - open class LegalHoldsExportDownloadedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportDownloadedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsExportDownloadedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportDownloadedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportDownloadedType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportDownloadedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsExportDownloadedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsExportDownloadedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportDownloadedType.self, json: json) } } } /// Removed export for a hold. - open class LegalHoldsExportRemovedDetails: CustomStringConvertible { + public class LegalHoldsExportRemovedDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29554,66 +35322,88 @@ open class TeamLog { stringValidator()(exportName) self.exportName = exportName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportRemovedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportRemovedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportRemovedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportRemovedDetails: \(error)" + } } } - open class LegalHoldsExportRemovedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportRemovedDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), - "export_name": Serialization._StringSerializer.serialize(value.exportName), + + public class LegalHoldsExportRemovedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportRemovedDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), + "export_name": try Serialization._StringSerializer.serialize(value.exportName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportRemovedDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportRemovedDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let exportName = Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) - return LegalHoldsExportRemovedDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let exportName = try Serialization._StringSerializer.deserialize(dict["export_name"] ?? .null) + return LegalHoldsExportRemovedDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportRemovedDetails.self, json: json) } } } /// The LegalHoldsExportRemovedType struct - open class LegalHoldsExportRemovedType: CustomStringConvertible { + public class LegalHoldsExportRemovedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsExportRemovedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsExportRemovedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsExportRemovedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsExportRemovedType: \(error)" + } } } - open class LegalHoldsExportRemovedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsExportRemovedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsExportRemovedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsExportRemovedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsExportRemovedType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsExportRemovedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsExportRemovedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsExportRemovedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsExportRemovedType.self, json: json) } } } /// Released a hold. - open class LegalHoldsReleaseAHoldDetails: CustomStringConvertible { + public class LegalHoldsReleaseAHoldDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29624,64 +35414,86 @@ open class TeamLog { stringValidator()(name) self.name = name } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsReleaseAHoldDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsReleaseAHoldDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsReleaseAHoldDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsReleaseAHoldDetails: \(error)" + } } } - open class LegalHoldsReleaseAHoldDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsReleaseAHoldDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), + + public class LegalHoldsReleaseAHoldDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsReleaseAHoldDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsReleaseAHoldDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsReleaseAHoldDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return LegalHoldsReleaseAHoldDetails(legalHoldId: legalHoldId, name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return LegalHoldsReleaseAHoldDetails(legalHoldId: legalHoldId, name: name) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsReleaseAHoldDetails.self, json: json) } } } /// The LegalHoldsReleaseAHoldType struct - open class LegalHoldsReleaseAHoldType: CustomStringConvertible { + public class LegalHoldsReleaseAHoldType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsReleaseAHoldTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsReleaseAHoldTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsReleaseAHoldTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsReleaseAHoldType: \(error)" + } } } - open class LegalHoldsReleaseAHoldTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsReleaseAHoldType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsReleaseAHoldTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsReleaseAHoldType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsReleaseAHoldType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsReleaseAHoldType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsReleaseAHoldType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsReleaseAHoldType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsReleaseAHoldType.self, json: json) } } } /// Removed members from a hold. - open class LegalHoldsRemoveMembersDetails: CustomStringConvertible { + public class LegalHoldsRemoveMembersDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29692,64 +35504,86 @@ open class TeamLog { stringValidator()(name) self.name = name } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsRemoveMembersDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsRemoveMembersDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsRemoveMembersDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsRemoveMembersDetails: \(error)" + } } } - open class LegalHoldsRemoveMembersDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsRemoveMembersDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), + + public class LegalHoldsRemoveMembersDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsRemoveMembersDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsRemoveMembersDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsRemoveMembersDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return LegalHoldsRemoveMembersDetails(legalHoldId: legalHoldId, name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return LegalHoldsRemoveMembersDetails(legalHoldId: legalHoldId, name: name) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsRemoveMembersDetails.self, json: json) } } } /// The LegalHoldsRemoveMembersType struct - open class LegalHoldsRemoveMembersType: CustomStringConvertible { + public class LegalHoldsRemoveMembersType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsRemoveMembersTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsRemoveMembersTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsRemoveMembersTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsRemoveMembersType: \(error)" + } } } - open class LegalHoldsRemoveMembersTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsRemoveMembersType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsRemoveMembersTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsRemoveMembersType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsRemoveMembersType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsRemoveMembersType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsRemoveMembersType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsRemoveMembersType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsRemoveMembersType.self, json: json) } } } /// Created a summary report for a hold. - open class LegalHoldsReportAHoldDetails: CustomStringConvertible { + public class LegalHoldsReportAHoldDetails: CustomStringConvertible, JSONRepresentable { /// Hold ID. public let legalHoldId: String /// Hold name. @@ -29760,64 +35594,86 @@ open class TeamLog { stringValidator()(name) self.name = name } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsReportAHoldDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsReportAHoldDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsReportAHoldDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsReportAHoldDetails: \(error)" + } } } - open class LegalHoldsReportAHoldDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsReportAHoldDetails) -> JSON { - let output = [ - "legal_hold_id": Serialization._StringSerializer.serialize(value.legalHoldId), - "name": Serialization._StringSerializer.serialize(value.name), + + public class LegalHoldsReportAHoldDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsReportAHoldDetails) throws -> JSON { + let output = [ + "legal_hold_id": try Serialization._StringSerializer.serialize(value.legalHoldId), + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsReportAHoldDetails { + + public func deserialize(_ json: JSON) throws -> LegalHoldsReportAHoldDetails { switch json { - case .dictionary(let dict): - let legalHoldId = Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return LegalHoldsReportAHoldDetails(legalHoldId: legalHoldId, name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let legalHoldId = try Serialization._StringSerializer.deserialize(dict["legal_hold_id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return LegalHoldsReportAHoldDetails(legalHoldId: legalHoldId, name: name) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsReportAHoldDetails.self, json: json) } } } /// The LegalHoldsReportAHoldType struct - open class LegalHoldsReportAHoldType: CustomStringConvertible { + public class LegalHoldsReportAHoldType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LegalHoldsReportAHoldTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LegalHoldsReportAHoldTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LegalHoldsReportAHoldTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LegalHoldsReportAHoldType: \(error)" + } } } - open class LegalHoldsReportAHoldTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LegalHoldsReportAHoldType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LegalHoldsReportAHoldTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LegalHoldsReportAHoldType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LegalHoldsReportAHoldType { + + public func deserialize(_ json: JSON) throws -> LegalHoldsReportAHoldType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LegalHoldsReportAHoldType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LegalHoldsReportAHoldType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LegalHoldsReportAHoldType.self, json: json) } } } /// The device sessions that user is linked to. - public enum LinkedDeviceLogInfo: CustomStringConvertible { + public enum LinkedDeviceLogInfo: CustomStringConvertible, JSONRepresentable { /// desktop device session's details. case desktopDeviceSession(TeamLog.DesktopDeviceSessionLogInfo) /// legacy device session's details. @@ -29829,66 +35685,76 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try LinkedDeviceLogInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LinkedDeviceLogInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LinkedDeviceLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LinkedDeviceLogInfo: \(error)" + } } } - open class LinkedDeviceLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LinkedDeviceLogInfo) -> JSON { + + public class LinkedDeviceLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LinkedDeviceLogInfo) throws -> JSON { switch value { - case .desktopDeviceSession(let arg): - var d = Serialization.getFields(TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("desktop_device_session") - return .dictionary(d) - case .legacyDeviceSession(let arg): - var d = Serialization.getFields(TeamLog.LegacyDeviceSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("legacy_device_session") - return .dictionary(d) - case .mobileDeviceSession(let arg): - var d = Serialization.getFields(TeamLog.MobileDeviceSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("mobile_device_session") - return .dictionary(d) - case .webDeviceSession(let arg): - var d = Serialization.getFields(TeamLog.WebDeviceSessionLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("web_device_session") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LinkedDeviceLogInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "desktop_device_session": - let v = TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(json) - return LinkedDeviceLogInfo.desktopDeviceSession(v) - case "legacy_device_session": - let v = TeamLog.LegacyDeviceSessionLogInfoSerializer().deserialize(json) - return LinkedDeviceLogInfo.legacyDeviceSession(v) - case "mobile_device_session": - let v = TeamLog.MobileDeviceSessionLogInfoSerializer().deserialize(json) - return LinkedDeviceLogInfo.mobileDeviceSession(v) - case "web_device_session": - let v = TeamLog.WebDeviceSessionLogInfoSerializer().deserialize(json) - return LinkedDeviceLogInfo.webDeviceSession(v) - case "other": - return LinkedDeviceLogInfo.other - default: - return LinkedDeviceLogInfo.other - } - default: - fatalError("Failed to deserialize") + case .desktopDeviceSession(let arg): + var d = try Serialization.getFields(TeamLog.DesktopDeviceSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("desktop_device_session") + return .dictionary(d) + case .legacyDeviceSession(let arg): + var d = try Serialization.getFields(TeamLog.LegacyDeviceSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("legacy_device_session") + return .dictionary(d) + case .mobileDeviceSession(let arg): + var d = try Serialization.getFields(TeamLog.MobileDeviceSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("mobile_device_session") + return .dictionary(d) + case .webDeviceSession(let arg): + var d = try Serialization.getFields(TeamLog.WebDeviceSessionLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("web_device_session") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LinkedDeviceLogInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "desktop_device_session": + let v = try TeamLog.DesktopDeviceSessionLogInfoSerializer().deserialize(json) + return LinkedDeviceLogInfo.desktopDeviceSession(v) + case "legacy_device_session": + let v = try TeamLog.LegacyDeviceSessionLogInfoSerializer().deserialize(json) + return LinkedDeviceLogInfo.legacyDeviceSession(v) + case "mobile_device_session": + let v = try TeamLog.MobileDeviceSessionLogInfoSerializer().deserialize(json) + return LinkedDeviceLogInfo.mobileDeviceSession(v) + case "web_device_session": + let v = try TeamLog.WebDeviceSessionLogInfoSerializer().deserialize(json) + return LinkedDeviceLogInfo.webDeviceSession(v) + case "other": + return LinkedDeviceLogInfo.other + default: + return LinkedDeviceLogInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: LinkedDeviceLogInfo.self, json: json) } } } /// File lock status - public enum LockStatus: CustomStringConvertible { + public enum LockStatus: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case locked /// An unspecified error. @@ -29896,50 +35762,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try LockStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LockStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LockStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LockStatus: \(error)" + } } } - open class LockStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LockStatus) -> JSON { + + public class LockStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LockStatus) throws -> JSON { switch value { - case .locked: - var d = [String: JSON]() - d[".tag"] = .str("locked") - return .dictionary(d) - case .unlocked: - var d = [String: JSON]() - d[".tag"] = .str("unlocked") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LockStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "locked": - return LockStatus.locked - case "unlocked": - return LockStatus.unlocked - case "other": - return LockStatus.other - default: - return LockStatus.other - } + case .locked: + var d = [String: JSON]() + d[".tag"] = .str("locked") + return .dictionary(d) + case .unlocked: + var d = [String: JSON]() + d[".tag"] = .str("unlocked") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LockStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "locked": + return LockStatus.locked + case "unlocked": + return LockStatus.unlocked + case "other": + return LockStatus.other default: - fatalError("Failed to deserialize") + return LockStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: LockStatus.self, json: json) } } } /// Failed to sign in. - open class LoginFailDetails: CustomStringConvertible { + public class LoginFailDetails: CustomStringConvertible, JSONRepresentable { /// Tells if the login device is EMM managed. Might be missing due to historical data gap. public let isEmmManaged: Bool? /// Login method. @@ -29951,66 +35827,88 @@ open class TeamLog { self.loginMethod = loginMethod self.errorDetails = errorDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LoginFailDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LoginFailDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LoginFailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LoginFailDetails: \(error)" + } } } - open class LoginFailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LoginFailDetails) -> JSON { - let output = [ - "login_method": TeamLog.LoginMethodSerializer().serialize(value.loginMethod), - "error_details": TeamLog.FailureDetailsLogInfoSerializer().serialize(value.errorDetails), - "is_emm_managed": NullableSerializer(Serialization._BoolSerializer).serialize(value.isEmmManaged), + + public class LoginFailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LoginFailDetails) throws -> JSON { + let output = [ + "login_method": try TeamLog.LoginMethodSerializer().serialize(value.loginMethod), + "error_details": try TeamLog.FailureDetailsLogInfoSerializer().serialize(value.errorDetails), + "is_emm_managed": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isEmmManaged), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LoginFailDetails { + + public func deserialize(_ json: JSON) throws -> LoginFailDetails { switch json { - case .dictionary(let dict): - let loginMethod = TeamLog.LoginMethodSerializer().deserialize(dict["login_method"] ?? .null) - let errorDetails = TeamLog.FailureDetailsLogInfoSerializer().deserialize(dict["error_details"] ?? .null) - let isEmmManaged = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_emm_managed"] ?? .null) - return LoginFailDetails(loginMethod: loginMethod, errorDetails: errorDetails, isEmmManaged: isEmmManaged) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let loginMethod = try TeamLog.LoginMethodSerializer().deserialize(dict["login_method"] ?? .null) + let errorDetails = try TeamLog.FailureDetailsLogInfoSerializer().deserialize(dict["error_details"] ?? .null) + let isEmmManaged = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_emm_managed"] ?? .null) + return LoginFailDetails(loginMethod: loginMethod, errorDetails: errorDetails, isEmmManaged: isEmmManaged) + default: + throw JSONSerializerError.deserializeError(type: LoginFailDetails.self, json: json) } } } /// The LoginFailType struct - open class LoginFailType: CustomStringConvertible { + public class LoginFailType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LoginFailTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LoginFailTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LoginFailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LoginFailType: \(error)" + } } } - open class LoginFailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LoginFailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LoginFailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LoginFailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LoginFailType { + + public func deserialize(_ json: JSON) throws -> LoginFailType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LoginFailType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LoginFailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LoginFailType.self, json: json) } } } /// The LoginMethod union - public enum LoginMethod: CustomStringConvertible { + public enum LoginMethod: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case appleOauth /// An unspecified error. @@ -30018,6 +35916,8 @@ open class TeamLog { /// An unspecified error. case googleOauth /// An unspecified error. + case lenovoOauth + /// An unspecified error. case password /// An unspecified error. case qrCode @@ -30030,86 +35930,102 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try LoginMethodSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LoginMethodSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LoginMethodSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LoginMethod: \(error)" + } } } - open class LoginMethodSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LoginMethod) -> JSON { + + public class LoginMethodSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LoginMethod) throws -> JSON { switch value { - case .appleOauth: - var d = [String: JSON]() - d[".tag"] = .str("apple_oauth") - return .dictionary(d) - case .firstPartyTokenExchange: - var d = [String: JSON]() - d[".tag"] = .str("first_party_token_exchange") - return .dictionary(d) - case .googleOauth: - var d = [String: JSON]() - d[".tag"] = .str("google_oauth") - return .dictionary(d) - case .password: - var d = [String: JSON]() - d[".tag"] = .str("password") - return .dictionary(d) - case .qrCode: - var d = [String: JSON]() - d[".tag"] = .str("qr_code") - return .dictionary(d) - case .saml: - var d = [String: JSON]() - d[".tag"] = .str("saml") - return .dictionary(d) - case .twoFactorAuthentication: - var d = [String: JSON]() - d[".tag"] = .str("two_factor_authentication") - return .dictionary(d) - case .webSession: - var d = [String: JSON]() - d[".tag"] = .str("web_session") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> LoginMethod { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "apple_oauth": - return LoginMethod.appleOauth - case "first_party_token_exchange": - return LoginMethod.firstPartyTokenExchange - case "google_oauth": - return LoginMethod.googleOauth - case "password": - return LoginMethod.password - case "qr_code": - return LoginMethod.qrCode - case "saml": - return LoginMethod.saml - case "two_factor_authentication": - return LoginMethod.twoFactorAuthentication - case "web_session": - return LoginMethod.webSession - case "other": - return LoginMethod.other - default: - return LoginMethod.other - } - default: - fatalError("Failed to deserialize") + case .appleOauth: + var d = [String: JSON]() + d[".tag"] = .str("apple_oauth") + return .dictionary(d) + case .firstPartyTokenExchange: + var d = [String: JSON]() + d[".tag"] = .str("first_party_token_exchange") + return .dictionary(d) + case .googleOauth: + var d = [String: JSON]() + d[".tag"] = .str("google_oauth") + return .dictionary(d) + case .lenovoOauth: + var d = [String: JSON]() + d[".tag"] = .str("lenovo_oauth") + return .dictionary(d) + case .password: + var d = [String: JSON]() + d[".tag"] = .str("password") + return .dictionary(d) + case .qrCode: + var d = [String: JSON]() + d[".tag"] = .str("qr_code") + return .dictionary(d) + case .saml: + var d = [String: JSON]() + d[".tag"] = .str("saml") + return .dictionary(d) + case .twoFactorAuthentication: + var d = [String: JSON]() + d[".tag"] = .str("two_factor_authentication") + return .dictionary(d) + case .webSession: + var d = [String: JSON]() + d[".tag"] = .str("web_session") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> LoginMethod { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "apple_oauth": + return LoginMethod.appleOauth + case "first_party_token_exchange": + return LoginMethod.firstPartyTokenExchange + case "google_oauth": + return LoginMethod.googleOauth + case "lenovo_oauth": + return LoginMethod.lenovoOauth + case "password": + return LoginMethod.password + case "qr_code": + return LoginMethod.qrCode + case "saml": + return LoginMethod.saml + case "two_factor_authentication": + return LoginMethod.twoFactorAuthentication + case "web_session": + return LoginMethod.webSession + case "other": + return LoginMethod.other + default: + return LoginMethod.other + } + default: + throw JSONSerializerError.deserializeError(type: LoginMethod.self, json: json) } } } /// Signed in. - open class LoginSuccessDetails: CustomStringConvertible { + public class LoginSuccessDetails: CustomStringConvertible, JSONRepresentable { /// Tells if the login device is EMM managed. Might be missing due to historical data gap. public let isEmmManaged: Bool? /// Login method. @@ -30118,249 +36034,337 @@ open class TeamLog { self.isEmmManaged = isEmmManaged self.loginMethod = loginMethod } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LoginSuccessDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LoginSuccessDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LoginSuccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LoginSuccessDetails: \(error)" + } } } - open class LoginSuccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LoginSuccessDetails) -> JSON { - let output = [ - "login_method": TeamLog.LoginMethodSerializer().serialize(value.loginMethod), - "is_emm_managed": NullableSerializer(Serialization._BoolSerializer).serialize(value.isEmmManaged), + + public class LoginSuccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LoginSuccessDetails) throws -> JSON { + let output = [ + "login_method": try TeamLog.LoginMethodSerializer().serialize(value.loginMethod), + "is_emm_managed": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isEmmManaged), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LoginSuccessDetails { + + public func deserialize(_ json: JSON) throws -> LoginSuccessDetails { switch json { - case .dictionary(let dict): - let loginMethod = TeamLog.LoginMethodSerializer().deserialize(dict["login_method"] ?? .null) - let isEmmManaged = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_emm_managed"] ?? .null) - return LoginSuccessDetails(loginMethod: loginMethod, isEmmManaged: isEmmManaged) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let loginMethod = try TeamLog.LoginMethodSerializer().deserialize(dict["login_method"] ?? .null) + let isEmmManaged = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_emm_managed"] ?? .null) + return LoginSuccessDetails(loginMethod: loginMethod, isEmmManaged: isEmmManaged) + default: + throw JSONSerializerError.deserializeError(type: LoginSuccessDetails.self, json: json) } } } /// The LoginSuccessType struct - open class LoginSuccessType: CustomStringConvertible { + public class LoginSuccessType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LoginSuccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LoginSuccessTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LoginSuccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LoginSuccessType: \(error)" + } } } - open class LoginSuccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LoginSuccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LoginSuccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LoginSuccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LoginSuccessType { + + public func deserialize(_ json: JSON) throws -> LoginSuccessType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LoginSuccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LoginSuccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LoginSuccessType.self, json: json) } } } /// Signed out. - open class LogoutDetails: CustomStringConvertible { + public class LogoutDetails: CustomStringConvertible, JSONRepresentable { /// Login session id. public let loginId: String? public init(loginId: String? = nil) { nullableValidator(stringValidator())(loginId) self.loginId = loginId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LogoutDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try LogoutDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LogoutDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LogoutDetails: \(error)" + } } } - open class LogoutDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LogoutDetails) -> JSON { - let output = [ - "login_id": NullableSerializer(Serialization._StringSerializer).serialize(value.loginId), + + public class LogoutDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LogoutDetails) throws -> JSON { + let output = [ + "login_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.loginId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LogoutDetails { + + public func deserialize(_ json: JSON) throws -> LogoutDetails { switch json { - case .dictionary(let dict): - let loginId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["login_id"] ?? .null) - return LogoutDetails(loginId: loginId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let loginId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["login_id"] ?? .null) + return LogoutDetails(loginId: loginId) + default: + throw JSONSerializerError.deserializeError(type: LogoutDetails.self, json: json) } } } /// The LogoutType struct - open class LogoutType: CustomStringConvertible { + public class LogoutType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(LogoutTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try LogoutTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try LogoutTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for LogoutType: \(error)" + } } } - open class LogoutTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: LogoutType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class LogoutTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: LogoutType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> LogoutType { + + public func deserialize(_ json: JSON) throws -> LogoutType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return LogoutType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return LogoutType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: LogoutType.self, json: json) } } } /// Added an external ID for team member. - open class MemberAddExternalIdDetails: CustomStringConvertible { + public class MemberAddExternalIdDetails: CustomStringConvertible, JSONRepresentable { /// Current external id. public let newValue: String public init(newValue: String) { stringValidator(maxLength: 64)(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddExternalIdDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberAddExternalIdDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddExternalIdDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddExternalIdDetails: \(error)" + } } } - open class MemberAddExternalIdDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddExternalIdDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public class MemberAddExternalIdDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddExternalIdDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberAddExternalIdDetails { + + public func deserialize(_ json: JSON) throws -> MemberAddExternalIdDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return MemberAddExternalIdDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return MemberAddExternalIdDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberAddExternalIdDetails.self, json: json) } } } /// The MemberAddExternalIdType struct - open class MemberAddExternalIdType: CustomStringConvertible { + public class MemberAddExternalIdType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddExternalIdTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberAddExternalIdTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddExternalIdTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddExternalIdType: \(error)" + } } } - open class MemberAddExternalIdTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddExternalIdType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberAddExternalIdTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddExternalIdType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberAddExternalIdType { + + public func deserialize(_ json: JSON) throws -> MemberAddExternalIdType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberAddExternalIdType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberAddExternalIdType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberAddExternalIdType.self, json: json) } } } /// Added team member name. - open class MemberAddNameDetails: CustomStringConvertible { + public class MemberAddNameDetails: CustomStringConvertible, JSONRepresentable { /// New user's name. public let newValue: TeamLog.UserNameLogInfo public init(newValue: TeamLog.UserNameLogInfo) { self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddNameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberAddNameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddNameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddNameDetails: \(error)" + } } } - open class MemberAddNameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddNameDetails) -> JSON { - let output = [ - "new_value": TeamLog.UserNameLogInfoSerializer().serialize(value.newValue), + + public class MemberAddNameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddNameDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.UserNameLogInfoSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberAddNameDetails { + + public func deserialize(_ json: JSON) throws -> MemberAddNameDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.UserNameLogInfoSerializer().deserialize(dict["new_value"] ?? .null) - return MemberAddNameDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.UserNameLogInfoSerializer().deserialize(dict["new_value"] ?? .null) + return MemberAddNameDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberAddNameDetails.self, json: json) } } } /// The MemberAddNameType struct - open class MemberAddNameType: CustomStringConvertible { + public class MemberAddNameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberAddNameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberAddNameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberAddNameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberAddNameType: \(error)" + } } } - open class MemberAddNameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberAddNameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberAddNameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberAddNameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberAddNameType { + + public func deserialize(_ json: JSON) throws -> MemberAddNameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberAddNameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberAddNameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberAddNameType.self, json: json) } } } /// Changed team member admin role. - open class MemberChangeAdminRoleDetails: CustomStringConvertible { + public class MemberChangeAdminRoleDetails: CustomStringConvertible, JSONRepresentable { /// New admin role. This field is relevant when the admin role is changed or whenthe user role changes from no /// admin rights to with admin rights. public let newValue: TeamLog.AdminRole? @@ -30371,64 +36375,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeAdminRoleDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeAdminRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeAdminRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeAdminRoleDetails: \(error)" + } } } - open class MemberChangeAdminRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeAdminRoleDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamLog.AdminRoleSerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.AdminRoleSerializer()).serialize(value.previousValue), + + public class MemberChangeAdminRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeAdminRoleDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamLog.AdminRoleSerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.AdminRoleSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeAdminRoleDetails { + + public func deserialize(_ json: JSON) throws -> MemberChangeAdminRoleDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamLog.AdminRoleSerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.AdminRoleSerializer()).deserialize(dict["previous_value"] ?? .null) - return MemberChangeAdminRoleDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamLog.AdminRoleSerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.AdminRoleSerializer()).deserialize(dict["previous_value"] ?? .null) + return MemberChangeAdminRoleDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeAdminRoleDetails.self, json: json) } } } /// The MemberChangeAdminRoleType struct - open class MemberChangeAdminRoleType: CustomStringConvertible { + public class MemberChangeAdminRoleType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeAdminRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeAdminRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeAdminRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeAdminRoleType: \(error)" + } } } - open class MemberChangeAdminRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeAdminRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberChangeAdminRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeAdminRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeAdminRoleType { + + public func deserialize(_ json: JSON) throws -> MemberChangeAdminRoleType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberChangeAdminRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberChangeAdminRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeAdminRoleType.self, json: json) } } } /// Changed team member email. - open class MemberChangeEmailDetails: CustomStringConvertible { + public class MemberChangeEmailDetails: CustomStringConvertible, JSONRepresentable { /// New email. public let newValue: String /// Previous email. Might be missing due to historical data gap. @@ -30439,64 +36465,86 @@ open class TeamLog { nullableValidator(stringValidator(maxLength: 255))(previousValue) self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeEmailDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeEmailDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeEmailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeEmailDetails: \(error)" + } } } - open class MemberChangeEmailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeEmailDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), - "previous_value": NullableSerializer(Serialization._StringSerializer).serialize(value.previousValue), + + public class MemberChangeEmailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeEmailDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + "previous_value": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeEmailDetails { + + public func deserialize(_ json: JSON) throws -> MemberChangeEmailDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_value"] ?? .null) - return MemberChangeEmailDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_value"] ?? .null) + return MemberChangeEmailDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeEmailDetails.self, json: json) } } } /// The MemberChangeEmailType struct - open class MemberChangeEmailType: CustomStringConvertible { + public class MemberChangeEmailType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeEmailTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeEmailTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeEmailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeEmailType: \(error)" + } } } - open class MemberChangeEmailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeEmailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberChangeEmailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeEmailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeEmailType { + + public func deserialize(_ json: JSON) throws -> MemberChangeEmailType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberChangeEmailType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberChangeEmailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeEmailType.self, json: json) } } } /// Changed the external ID for team member. - open class MemberChangeExternalIdDetails: CustomStringConvertible { + public class MemberChangeExternalIdDetails: CustomStringConvertible, JSONRepresentable { /// Current external id. public let newValue: String /// Old external id. @@ -30507,64 +36555,86 @@ open class TeamLog { stringValidator(maxLength: 64)(previousValue) self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeExternalIdDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeExternalIdDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeExternalIdDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeExternalIdDetails: \(error)" + } } } - open class MemberChangeExternalIdDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeExternalIdDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), + + public class MemberChangeExternalIdDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeExternalIdDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeExternalIdDetails { + + public func deserialize(_ json: JSON) throws -> MemberChangeExternalIdDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return MemberChangeExternalIdDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return MemberChangeExternalIdDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeExternalIdDetails.self, json: json) } } } /// The MemberChangeExternalIdType struct - open class MemberChangeExternalIdType: CustomStringConvertible { + public class MemberChangeExternalIdType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeExternalIdTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeExternalIdTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeExternalIdTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeExternalIdType: \(error)" + } } } - open class MemberChangeExternalIdTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeExternalIdType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberChangeExternalIdTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeExternalIdType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeExternalIdType { + + public func deserialize(_ json: JSON) throws -> MemberChangeExternalIdType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberChangeExternalIdType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberChangeExternalIdType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeExternalIdType.self, json: json) } } } /// Changed membership type (limited/full) of member. - open class MemberChangeMembershipTypeDetails: CustomStringConvertible { + public class MemberChangeMembershipTypeDetails: CustomStringConvertible, JSONRepresentable { /// Previous membership type. public let prevValue: TeamLog.TeamMembershipType /// New membership type. @@ -30573,64 +36643,86 @@ open class TeamLog { self.prevValue = prevValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeMembershipTypeDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeMembershipTypeDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeMembershipTypeDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeMembershipTypeDetails: \(error)" + } } } - open class MemberChangeMembershipTypeDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeMembershipTypeDetails) -> JSON { - let output = [ - "prev_value": TeamLog.TeamMembershipTypeSerializer().serialize(value.prevValue), - "new_value": TeamLog.TeamMembershipTypeSerializer().serialize(value.newValue), + + public class MemberChangeMembershipTypeDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeMembershipTypeDetails) throws -> JSON { + let output = [ + "prev_value": try TeamLog.TeamMembershipTypeSerializer().serialize(value.prevValue), + "new_value": try TeamLog.TeamMembershipTypeSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeMembershipTypeDetails { + + public func deserialize(_ json: JSON) throws -> MemberChangeMembershipTypeDetails { switch json { - case .dictionary(let dict): - let prevValue = TeamLog.TeamMembershipTypeSerializer().deserialize(dict["prev_value"] ?? .null) - let newValue = TeamLog.TeamMembershipTypeSerializer().deserialize(dict["new_value"] ?? .null) - return MemberChangeMembershipTypeDetails(prevValue: prevValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let prevValue = try TeamLog.TeamMembershipTypeSerializer().deserialize(dict["prev_value"] ?? .null) + let newValue = try TeamLog.TeamMembershipTypeSerializer().deserialize(dict["new_value"] ?? .null) + return MemberChangeMembershipTypeDetails(prevValue: prevValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeMembershipTypeDetails.self, json: json) } } } /// The MemberChangeMembershipTypeType struct - open class MemberChangeMembershipTypeType: CustomStringConvertible { + public class MemberChangeMembershipTypeType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeMembershipTypeTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeMembershipTypeTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeMembershipTypeTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeMembershipTypeType: \(error)" + } } } - open class MemberChangeMembershipTypeTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeMembershipTypeType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberChangeMembershipTypeTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeMembershipTypeType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeMembershipTypeType { + + public func deserialize(_ json: JSON) throws -> MemberChangeMembershipTypeType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberChangeMembershipTypeType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberChangeMembershipTypeType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeMembershipTypeType.self, json: json) } } } /// Changed team member name. - open class MemberChangeNameDetails: CustomStringConvertible { + public class MemberChangeNameDetails: CustomStringConvertible, JSONRepresentable { /// New user's name. public let newValue: TeamLog.UserNameLogInfo /// Previous user's name. Might be missing due to historical data gap. @@ -30639,64 +36731,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeNameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeNameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeNameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeNameDetails: \(error)" + } } } - open class MemberChangeNameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeNameDetails) -> JSON { - let output = [ - "new_value": TeamLog.UserNameLogInfoSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.UserNameLogInfoSerializer()).serialize(value.previousValue), + + public class MemberChangeNameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeNameDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.UserNameLogInfoSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.UserNameLogInfoSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeNameDetails { + + public func deserialize(_ json: JSON) throws -> MemberChangeNameDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.UserNameLogInfoSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.UserNameLogInfoSerializer()).deserialize(dict["previous_value"] ?? .null) - return MemberChangeNameDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.UserNameLogInfoSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.UserNameLogInfoSerializer()).deserialize(dict["previous_value"] ?? .null) + return MemberChangeNameDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeNameDetails.self, json: json) } } } /// The MemberChangeNameType struct - open class MemberChangeNameType: CustomStringConvertible { + public class MemberChangeNameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeNameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeNameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeNameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeNameType: \(error)" + } } } - open class MemberChangeNameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeNameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberChangeNameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeNameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeNameType { + + public func deserialize(_ json: JSON) throws -> MemberChangeNameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberChangeNameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberChangeNameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeNameType.self, json: json) } } } /// Changed team member reseller role. - open class MemberChangeResellerRoleDetails: CustomStringConvertible { + public class MemberChangeResellerRoleDetails: CustomStringConvertible, JSONRepresentable { /// New reseller role. This field is relevant when the reseller role is changed. public let newValue: TeamLog.ResellerRole /// Previous reseller role. This field is relevant when the reseller role is changed or when the reseller role @@ -30706,64 +36820,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeResellerRoleDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeResellerRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeResellerRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeResellerRoleDetails: \(error)" + } } } - open class MemberChangeResellerRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeResellerRoleDetails) -> JSON { - let output = [ - "new_value": TeamLog.ResellerRoleSerializer().serialize(value.newValue), - "previous_value": TeamLog.ResellerRoleSerializer().serialize(value.previousValue), + + public class MemberChangeResellerRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeResellerRoleDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ResellerRoleSerializer().serialize(value.newValue), + "previous_value": try TeamLog.ResellerRoleSerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeResellerRoleDetails { + + public func deserialize(_ json: JSON) throws -> MemberChangeResellerRoleDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ResellerRoleSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.ResellerRoleSerializer().deserialize(dict["previous_value"] ?? .null) - return MemberChangeResellerRoleDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ResellerRoleSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.ResellerRoleSerializer().deserialize(dict["previous_value"] ?? .null) + return MemberChangeResellerRoleDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeResellerRoleDetails.self, json: json) } } } /// The MemberChangeResellerRoleType struct - open class MemberChangeResellerRoleType: CustomStringConvertible { + public class MemberChangeResellerRoleType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeResellerRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeResellerRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeResellerRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeResellerRoleType: \(error)" + } } } - open class MemberChangeResellerRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeResellerRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberChangeResellerRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeResellerRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeResellerRoleType { + + public func deserialize(_ json: JSON) throws -> MemberChangeResellerRoleType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberChangeResellerRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberChangeResellerRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeResellerRoleType.self, json: json) } } } /// Changed member status (invited, joined, suspended, etc.). - open class MemberChangeStatusDetails: CustomStringConvertible { + public class MemberChangeStatusDetails: CustomStringConvertible, JSONRepresentable { /// Previous member status. Might be missing due to historical data gap. public let previousValue: TeamLog.MemberStatus? /// New member status. @@ -30774,7 +36910,13 @@ open class TeamLog { public let newTeam: String? /// The user's previous team name. This field is relevant when the user is transferred onto the team. public let previousTeam: String? - public init(newValue: TeamLog.MemberStatus, previousValue: TeamLog.MemberStatus? = nil, action: TeamLog.ActionDetails? = nil, newTeam: String? = nil, previousTeam: String? = nil) { + public init( + newValue: TeamLog.MemberStatus, + previousValue: TeamLog.MemberStatus? = nil, + action: TeamLog.ActionDetails? = nil, + newTeam: String? = nil, + previousTeam: String? = nil + ) { self.previousValue = previousValue self.newValue = newValue self.action = action @@ -30783,235 +36925,320 @@ open class TeamLog { nullableValidator(stringValidator())(previousTeam) self.previousTeam = previousTeam } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeStatusDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeStatusDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeStatusDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeStatusDetails: \(error)" + } } } - open class MemberChangeStatusDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeStatusDetails) -> JSON { - let output = [ - "new_value": TeamLog.MemberStatusSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.MemberStatusSerializer()).serialize(value.previousValue), - "action": NullableSerializer(TeamLog.ActionDetailsSerializer()).serialize(value.action), - "new_team": NullableSerializer(Serialization._StringSerializer).serialize(value.newTeam), - "previous_team": NullableSerializer(Serialization._StringSerializer).serialize(value.previousTeam), + + public class MemberChangeStatusDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeStatusDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.MemberStatusSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.MemberStatusSerializer()).serialize(value.previousValue), + "action": try NullableSerializer(TeamLog.ActionDetailsSerializer()).serialize(value.action), + "new_team": try NullableSerializer(Serialization._StringSerializer).serialize(value.newTeam), + "previous_team": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousTeam), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeStatusDetails { + + public func deserialize(_ json: JSON) throws -> MemberChangeStatusDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.MemberStatusSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.MemberStatusSerializer()).deserialize(dict["previous_value"] ?? .null) - let action = NullableSerializer(TeamLog.ActionDetailsSerializer()).deserialize(dict["action"] ?? .null) - let newTeam = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_team"] ?? .null) - let previousTeam = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_team"] ?? .null) - return MemberChangeStatusDetails(newValue: newValue, previousValue: previousValue, action: action, newTeam: newTeam, previousTeam: previousTeam) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.MemberStatusSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.MemberStatusSerializer()).deserialize(dict["previous_value"] ?? .null) + let action = try NullableSerializer(TeamLog.ActionDetailsSerializer()).deserialize(dict["action"] ?? .null) + let newTeam = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_team"] ?? .null) + let previousTeam = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_team"] ?? .null) + return MemberChangeStatusDetails( + newValue: newValue, + previousValue: previousValue, + action: action, + newTeam: newTeam, + previousTeam: previousTeam + ) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeStatusDetails.self, json: json) } } } /// The MemberChangeStatusType struct - open class MemberChangeStatusType: CustomStringConvertible { + public class MemberChangeStatusType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberChangeStatusTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberChangeStatusTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberChangeStatusTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberChangeStatusType: \(error)" + } } } - open class MemberChangeStatusTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberChangeStatusType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberChangeStatusTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberChangeStatusType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberChangeStatusType { + + public func deserialize(_ json: JSON) throws -> MemberChangeStatusType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberChangeStatusType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberChangeStatusType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberChangeStatusType.self, json: json) } } } /// Cleared manually added contacts. - open class MemberDeleteManualContactsDetails: CustomStringConvertible { - public init() { + public class MemberDeleteManualContactsDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberDeleteManualContactsDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberDeleteManualContactsDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberDeleteManualContactsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberDeleteManualContactsDetails: \(error)" + } } } - open class MemberDeleteManualContactsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberDeleteManualContactsDetails) -> JSON { + + public class MemberDeleteManualContactsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberDeleteManualContactsDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberDeleteManualContactsDetails { + + public func deserialize(_ json: JSON) throws -> MemberDeleteManualContactsDetails { switch json { - case .dictionary(_): - return MemberDeleteManualContactsDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberDeleteManualContactsDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberDeleteManualContactsDetails.self, json: json) } } } /// The MemberDeleteManualContactsType struct - open class MemberDeleteManualContactsType: CustomStringConvertible { + public class MemberDeleteManualContactsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberDeleteManualContactsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberDeleteManualContactsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberDeleteManualContactsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberDeleteManualContactsType: \(error)" + } } } - open class MemberDeleteManualContactsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberDeleteManualContactsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberDeleteManualContactsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberDeleteManualContactsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberDeleteManualContactsType { + + public func deserialize(_ json: JSON) throws -> MemberDeleteManualContactsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberDeleteManualContactsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberDeleteManualContactsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberDeleteManualContactsType.self, json: json) } } } /// Deleted team member profile photo. - open class MemberDeleteProfilePhotoDetails: CustomStringConvertible { - public init() { + public class MemberDeleteProfilePhotoDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberDeleteProfilePhotoDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberDeleteProfilePhotoDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberDeleteProfilePhotoDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberDeleteProfilePhotoDetails: \(error)" + } } } - open class MemberDeleteProfilePhotoDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberDeleteProfilePhotoDetails) -> JSON { + + public class MemberDeleteProfilePhotoDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberDeleteProfilePhotoDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberDeleteProfilePhotoDetails { + + public func deserialize(_ json: JSON) throws -> MemberDeleteProfilePhotoDetails { switch json { - case .dictionary(_): - return MemberDeleteProfilePhotoDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberDeleteProfilePhotoDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberDeleteProfilePhotoDetails.self, json: json) } } } /// The MemberDeleteProfilePhotoType struct - open class MemberDeleteProfilePhotoType: CustomStringConvertible { + public class MemberDeleteProfilePhotoType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberDeleteProfilePhotoTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberDeleteProfilePhotoTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberDeleteProfilePhotoTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberDeleteProfilePhotoType: \(error)" + } } } - open class MemberDeleteProfilePhotoTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberDeleteProfilePhotoType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberDeleteProfilePhotoTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberDeleteProfilePhotoType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberDeleteProfilePhotoType { + + public func deserialize(_ json: JSON) throws -> MemberDeleteProfilePhotoType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberDeleteProfilePhotoType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberDeleteProfilePhotoType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberDeleteProfilePhotoType.self, json: json) } } } /// Permanently deleted contents of deleted team member account. - open class MemberPermanentlyDeleteAccountContentsDetails: CustomStringConvertible { - public init() { + public class MemberPermanentlyDeleteAccountContentsDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberPermanentlyDeleteAccountContentsDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberPermanentlyDeleteAccountContentsDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberPermanentlyDeleteAccountContentsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberPermanentlyDeleteAccountContentsDetails: \(error)" + } } } - open class MemberPermanentlyDeleteAccountContentsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberPermanentlyDeleteAccountContentsDetails) -> JSON { + + public class MemberPermanentlyDeleteAccountContentsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberPermanentlyDeleteAccountContentsDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberPermanentlyDeleteAccountContentsDetails { + + public func deserialize(_ json: JSON) throws -> MemberPermanentlyDeleteAccountContentsDetails { switch json { - case .dictionary(_): - return MemberPermanentlyDeleteAccountContentsDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberPermanentlyDeleteAccountContentsDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberPermanentlyDeleteAccountContentsDetails.self, json: json) } } } /// The MemberPermanentlyDeleteAccountContentsType struct - open class MemberPermanentlyDeleteAccountContentsType: CustomStringConvertible { + public class MemberPermanentlyDeleteAccountContentsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberPermanentlyDeleteAccountContentsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberPermanentlyDeleteAccountContentsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberPermanentlyDeleteAccountContentsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberPermanentlyDeleteAccountContentsType: \(error)" + } } } - open class MemberPermanentlyDeleteAccountContentsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberPermanentlyDeleteAccountContentsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberPermanentlyDeleteAccountContentsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberPermanentlyDeleteAccountContentsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberPermanentlyDeleteAccountContentsType { + + public func deserialize(_ json: JSON) throws -> MemberPermanentlyDeleteAccountContentsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberPermanentlyDeleteAccountContentsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberPermanentlyDeleteAccountContentsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberPermanentlyDeleteAccountContentsType.self, json: json) } } } /// The MemberRemoveActionType union - public enum MemberRemoveActionType: CustomStringConvertible { + public enum MemberRemoveActionType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case delete /// An unspecified error. @@ -31023,124 +37250,156 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try MemberRemoveActionTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberRemoveActionTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberRemoveActionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberRemoveActionType: \(error)" + } } } - open class MemberRemoveActionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberRemoveActionType) -> JSON { + + public class MemberRemoveActionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberRemoveActionType) throws -> JSON { switch value { - case .delete: - var d = [String: JSON]() - d[".tag"] = .str("delete") - return .dictionary(d) - case .leave: - var d = [String: JSON]() - d[".tag"] = .str("leave") - return .dictionary(d) - case .offboard: - var d = [String: JSON]() - d[".tag"] = .str("offboard") - return .dictionary(d) - case .offboardAndRetainTeamFolders: - var d = [String: JSON]() - d[".tag"] = .str("offboard_and_retain_team_folders") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberRemoveActionType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "delete": - return MemberRemoveActionType.delete - case "leave": - return MemberRemoveActionType.leave - case "offboard": - return MemberRemoveActionType.offboard - case "offboard_and_retain_team_folders": - return MemberRemoveActionType.offboardAndRetainTeamFolders - case "other": - return MemberRemoveActionType.other - default: - return MemberRemoveActionType.other - } - default: - fatalError("Failed to deserialize") + case .delete: + var d = [String: JSON]() + d[".tag"] = .str("delete") + return .dictionary(d) + case .leave: + var d = [String: JSON]() + d[".tag"] = .str("leave") + return .dictionary(d) + case .offboard: + var d = [String: JSON]() + d[".tag"] = .str("offboard") + return .dictionary(d) + case .offboardAndRetainTeamFolders: + var d = [String: JSON]() + d[".tag"] = .str("offboard_and_retain_team_folders") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberRemoveActionType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "delete": + return MemberRemoveActionType.delete + case "leave": + return MemberRemoveActionType.leave + case "offboard": + return MemberRemoveActionType.offboard + case "offboard_and_retain_team_folders": + return MemberRemoveActionType.offboardAndRetainTeamFolders + case "other": + return MemberRemoveActionType.other + default: + return MemberRemoveActionType.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberRemoveActionType.self, json: json) } } } /// Removed the external ID for team member. - open class MemberRemoveExternalIdDetails: CustomStringConvertible { + public class MemberRemoveExternalIdDetails: CustomStringConvertible, JSONRepresentable { /// Old external id. public let previousValue: String public init(previousValue: String) { stringValidator(maxLength: 64)(previousValue) self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberRemoveExternalIdDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberRemoveExternalIdDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberRemoveExternalIdDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberRemoveExternalIdDetails: \(error)" + } } } - open class MemberRemoveExternalIdDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberRemoveExternalIdDetails) -> JSON { - let output = [ - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), + + public class MemberRemoveExternalIdDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberRemoveExternalIdDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberRemoveExternalIdDetails { + + public func deserialize(_ json: JSON) throws -> MemberRemoveExternalIdDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return MemberRemoveExternalIdDetails(previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return MemberRemoveExternalIdDetails(previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberRemoveExternalIdDetails.self, json: json) } } } /// The MemberRemoveExternalIdType struct - open class MemberRemoveExternalIdType: CustomStringConvertible { + public class MemberRemoveExternalIdType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberRemoveExternalIdTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberRemoveExternalIdTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberRemoveExternalIdTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberRemoveExternalIdType: \(error)" + } } } - open class MemberRemoveExternalIdTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberRemoveExternalIdType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberRemoveExternalIdTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberRemoveExternalIdType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberRemoveExternalIdType { + + public func deserialize(_ json: JSON) throws -> MemberRemoveExternalIdType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberRemoveExternalIdType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberRemoveExternalIdType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberRemoveExternalIdType.self, json: json) } } } /// Changed whether users can find team when not invited. - open class MemberRequestsChangePolicyDetails: CustomStringConvertible { + public class MemberRequestsChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New member change requests policy. public let newValue: TeamLog.MemberRequestsPolicy /// Previous member change requests policy. Might be missing due to historical data gap. @@ -31149,64 +37408,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberRequestsChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberRequestsChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberRequestsChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberRequestsChangePolicyDetails: \(error)" + } } } - open class MemberRequestsChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberRequestsChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.MemberRequestsPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.MemberRequestsPolicySerializer()).serialize(value.previousValue), + + public class MemberRequestsChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberRequestsChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.MemberRequestsPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.MemberRequestsPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberRequestsChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> MemberRequestsChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.MemberRequestsPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.MemberRequestsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return MemberRequestsChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.MemberRequestsPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.MemberRequestsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return MemberRequestsChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberRequestsChangePolicyDetails.self, json: json) } } } /// The MemberRequestsChangePolicyType struct - open class MemberRequestsChangePolicyType: CustomStringConvertible { + public class MemberRequestsChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberRequestsChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberRequestsChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberRequestsChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberRequestsChangePolicyType: \(error)" + } } } - open class MemberRequestsChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberRequestsChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberRequestsChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberRequestsChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberRequestsChangePolicyType { + + public func deserialize(_ json: JSON) throws -> MemberRequestsChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberRequestsChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberRequestsChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberRequestsChangePolicyType.self, json: json) } } } /// The MemberRequestsPolicy union - public enum MemberRequestsPolicy: CustomStringConvertible { + public enum MemberRequestsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case autoAccept /// An unspecified error. @@ -31216,56 +37497,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try MemberRequestsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberRequestsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberRequestsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberRequestsPolicy: \(error)" + } } } - open class MemberRequestsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberRequestsPolicy) -> JSON { + + public class MemberRequestsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberRequestsPolicy) throws -> JSON { switch value { - case .autoAccept: - var d = [String: JSON]() - d[".tag"] = .str("auto_accept") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .requireApproval: - var d = [String: JSON]() - d[".tag"] = .str("require_approval") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberRequestsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "auto_accept": - return MemberRequestsPolicy.autoAccept - case "disabled": - return MemberRequestsPolicy.disabled - case "require_approval": - return MemberRequestsPolicy.requireApproval - case "other": - return MemberRequestsPolicy.other - default: - return MemberRequestsPolicy.other - } - default: - fatalError("Failed to deserialize") + case .autoAccept: + var d = [String: JSON]() + d[".tag"] = .str("auto_accept") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .requireApproval: + var d = [String: JSON]() + d[".tag"] = .str("require_approval") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberRequestsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "auto_accept": + return MemberRequestsPolicy.autoAccept + case "disabled": + return MemberRequestsPolicy.disabled + case "require_approval": + return MemberRequestsPolicy.requireApproval + case "other": + return MemberRequestsPolicy.other + default: + return MemberRequestsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberRequestsPolicy.self, json: json) } } } /// Policy for controlling whether team members can send team invites - public enum MemberSendInvitePolicy: CustomStringConvertible { + public enum MemberSendInvitePolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -31275,56 +37566,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try MemberSendInvitePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSendInvitePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSendInvitePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSendInvitePolicy: \(error)" + } } } - open class MemberSendInvitePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSendInvitePolicy) -> JSON { + + public class MemberSendInvitePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSendInvitePolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .everyone: - var d = [String: JSON]() - d[".tag"] = .str("everyone") - return .dictionary(d) - case .specificMembers: - var d = [String: JSON]() - d[".tag"] = .str("specific_members") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberSendInvitePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return MemberSendInvitePolicy.disabled - case "everyone": - return MemberSendInvitePolicy.everyone - case "specific_members": - return MemberSendInvitePolicy.specificMembers - case "other": - return MemberSendInvitePolicy.other - default: - return MemberSendInvitePolicy.other - } - default: - fatalError("Failed to deserialize") + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .everyone: + var d = [String: JSON]() + d[".tag"] = .str("everyone") + return .dictionary(d) + case .specificMembers: + var d = [String: JSON]() + d[".tag"] = .str("specific_members") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberSendInvitePolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return MemberSendInvitePolicy.disabled + case "everyone": + return MemberSendInvitePolicy.everyone + case "specific_members": + return MemberSendInvitePolicy.specificMembers + case "other": + return MemberSendInvitePolicy.other + default: + return MemberSendInvitePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberSendInvitePolicy.self, json: json) } } } /// Changed member send invite policy for team. - open class MemberSendInvitePolicyChangedDetails: CustomStringConvertible { + public class MemberSendInvitePolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New team member send invite policy. public let newValue: TeamLog.MemberSendInvitePolicy /// Previous team member send invite policy. @@ -31333,236 +37634,318 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSendInvitePolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSendInvitePolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSendInvitePolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSendInvitePolicyChangedDetails: \(error)" + } } } - open class MemberSendInvitePolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSendInvitePolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.MemberSendInvitePolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.MemberSendInvitePolicySerializer().serialize(value.previousValue), + + public class MemberSendInvitePolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSendInvitePolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.MemberSendInvitePolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.MemberSendInvitePolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSendInvitePolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> MemberSendInvitePolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.MemberSendInvitePolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.MemberSendInvitePolicySerializer().deserialize(dict["previous_value"] ?? .null) - return MemberSendInvitePolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.MemberSendInvitePolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.MemberSendInvitePolicySerializer().deserialize(dict["previous_value"] ?? .null) + return MemberSendInvitePolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberSendInvitePolicyChangedDetails.self, json: json) } } } /// The MemberSendInvitePolicyChangedType struct - open class MemberSendInvitePolicyChangedType: CustomStringConvertible { + public class MemberSendInvitePolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSendInvitePolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSendInvitePolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSendInvitePolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSendInvitePolicyChangedType: \(error)" + } } } - open class MemberSendInvitePolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSendInvitePolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSendInvitePolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSendInvitePolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSendInvitePolicyChangedType { + + public func deserialize(_ json: JSON) throws -> MemberSendInvitePolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSendInvitePolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSendInvitePolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSendInvitePolicyChangedType.self, json: json) } } } /// Set team member profile photo. - open class MemberSetProfilePhotoDetails: CustomStringConvertible { - public init() { + public class MemberSetProfilePhotoDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberSetProfilePhotoDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSetProfilePhotoDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSetProfilePhotoDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSetProfilePhotoDetails: \(error)" + } } } - open class MemberSetProfilePhotoDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSetProfilePhotoDetails) -> JSON { + + public class MemberSetProfilePhotoDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSetProfilePhotoDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSetProfilePhotoDetails { + + public func deserialize(_ json: JSON) throws -> MemberSetProfilePhotoDetails { switch json { - case .dictionary(_): - return MemberSetProfilePhotoDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberSetProfilePhotoDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberSetProfilePhotoDetails.self, json: json) } } } /// The MemberSetProfilePhotoType struct - open class MemberSetProfilePhotoType: CustomStringConvertible { + public class MemberSetProfilePhotoType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSetProfilePhotoTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSetProfilePhotoTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSetProfilePhotoTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSetProfilePhotoType: \(error)" + } } } - open class MemberSetProfilePhotoTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSetProfilePhotoType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSetProfilePhotoTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSetProfilePhotoType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSetProfilePhotoType { + + public func deserialize(_ json: JSON) throws -> MemberSetProfilePhotoType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSetProfilePhotoType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSetProfilePhotoType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSetProfilePhotoType.self, json: json) } } } /// Set custom member space limit. - open class MemberSpaceLimitsAddCustomQuotaDetails: CustomStringConvertible { + public class MemberSpaceLimitsAddCustomQuotaDetails: CustomStringConvertible, JSONRepresentable { /// New custom quota value in bytes. public let newValue: UInt64 public init(newValue: UInt64) { comparableValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsAddCustomQuotaDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsAddCustomQuotaDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsAddCustomQuotaDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsAddCustomQuotaDetails: \(error)" + } } } - open class MemberSpaceLimitsAddCustomQuotaDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsAddCustomQuotaDetails) -> JSON { - let output = [ - "new_value": Serialization._UInt64Serializer.serialize(value.newValue), + + public class MemberSpaceLimitsAddCustomQuotaDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsAddCustomQuotaDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._UInt64Serializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsAddCustomQuotaDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsAddCustomQuotaDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._UInt64Serializer.deserialize(dict["new_value"] ?? .null) - return MemberSpaceLimitsAddCustomQuotaDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._UInt64Serializer.deserialize(dict["new_value"] ?? .null) + return MemberSpaceLimitsAddCustomQuotaDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsAddCustomQuotaDetails.self, json: json) } } } /// The MemberSpaceLimitsAddCustomQuotaType struct - open class MemberSpaceLimitsAddCustomQuotaType: CustomStringConvertible { + public class MemberSpaceLimitsAddCustomQuotaType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsAddCustomQuotaTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsAddCustomQuotaTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsAddCustomQuotaTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsAddCustomQuotaType: \(error)" + } } } - open class MemberSpaceLimitsAddCustomQuotaTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsAddCustomQuotaType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsAddCustomQuotaTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsAddCustomQuotaType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsAddCustomQuotaType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsAddCustomQuotaType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsAddCustomQuotaType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsAddCustomQuotaType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsAddCustomQuotaType.self, json: json) } } } /// Added members to member space limit exception list. - open class MemberSpaceLimitsAddExceptionDetails: CustomStringConvertible { - public init() { + public class MemberSpaceLimitsAddExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberSpaceLimitsAddExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsAddExceptionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsAddExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsAddExceptionDetails: \(error)" + } } } - open class MemberSpaceLimitsAddExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsAddExceptionDetails) -> JSON { + + public class MemberSpaceLimitsAddExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsAddExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsAddExceptionDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsAddExceptionDetails { switch json { - case .dictionary(_): - return MemberSpaceLimitsAddExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberSpaceLimitsAddExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsAddExceptionDetails.self, json: json) } } } /// The MemberSpaceLimitsAddExceptionType struct - open class MemberSpaceLimitsAddExceptionType: CustomStringConvertible { + public class MemberSpaceLimitsAddExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsAddExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsAddExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsAddExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsAddExceptionType: \(error)" + } } } - open class MemberSpaceLimitsAddExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsAddExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsAddExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsAddExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsAddExceptionType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsAddExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsAddExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsAddExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsAddExceptionType.self, json: json) } } } /// Changed member space limit type for team. - open class MemberSpaceLimitsChangeCapsTypePolicyDetails: CustomStringConvertible { + public class MemberSpaceLimitsChangeCapsTypePolicyDetails: CustomStringConvertible, JSONRepresentable { /// Previous space limit type. public let previousValue: TeamLog.SpaceCapsType /// New space limit type. @@ -31571,64 +37954,86 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangeCapsTypePolicyDetails: \(error)" + } } } - open class MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangeCapsTypePolicyDetails) -> JSON { - let output = [ - "previous_value": TeamLog.SpaceCapsTypeSerializer().serialize(value.previousValue), - "new_value": TeamLog.SpaceCapsTypeSerializer().serialize(value.newValue), + + public class MemberSpaceLimitsChangeCapsTypePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangeCapsTypePolicyDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.SpaceCapsTypeSerializer().serialize(value.previousValue), + "new_value": try TeamLog.SpaceCapsTypeSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangeCapsTypePolicyDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangeCapsTypePolicyDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.SpaceCapsTypeSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.SpaceCapsTypeSerializer().deserialize(dict["new_value"] ?? .null) - return MemberSpaceLimitsChangeCapsTypePolicyDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.SpaceCapsTypeSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.SpaceCapsTypeSerializer().deserialize(dict["new_value"] ?? .null) + return MemberSpaceLimitsChangeCapsTypePolicyDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangeCapsTypePolicyDetails.self, json: json) } } } /// The MemberSpaceLimitsChangeCapsTypePolicyType struct - open class MemberSpaceLimitsChangeCapsTypePolicyType: CustomStringConvertible { + public class MemberSpaceLimitsChangeCapsTypePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangeCapsTypePolicyType: \(error)" + } } } - open class MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangeCapsTypePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsChangeCapsTypePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangeCapsTypePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangeCapsTypePolicyType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangeCapsTypePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsChangeCapsTypePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsChangeCapsTypePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangeCapsTypePolicyType.self, json: json) } } } /// Changed custom member space limit. - open class MemberSpaceLimitsChangeCustomQuotaDetails: CustomStringConvertible { + public class MemberSpaceLimitsChangeCustomQuotaDetails: CustomStringConvertible, JSONRepresentable { /// Previous custom quota value in bytes. public let previousValue: UInt64 /// New custom quota value in bytes. @@ -31639,64 +38044,86 @@ open class TeamLog { comparableValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangeCustomQuotaDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangeCustomQuotaDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangeCustomQuotaDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangeCustomQuotaDetails: \(error)" + } } } - open class MemberSpaceLimitsChangeCustomQuotaDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangeCustomQuotaDetails) -> JSON { - let output = [ - "previous_value": Serialization._UInt64Serializer.serialize(value.previousValue), - "new_value": Serialization._UInt64Serializer.serialize(value.newValue), + + public class MemberSpaceLimitsChangeCustomQuotaDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangeCustomQuotaDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._UInt64Serializer.serialize(value.previousValue), + "new_value": try Serialization._UInt64Serializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangeCustomQuotaDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangeCustomQuotaDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._UInt64Serializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._UInt64Serializer.deserialize(dict["new_value"] ?? .null) - return MemberSpaceLimitsChangeCustomQuotaDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._UInt64Serializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._UInt64Serializer.deserialize(dict["new_value"] ?? .null) + return MemberSpaceLimitsChangeCustomQuotaDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangeCustomQuotaDetails.self, json: json) } } } /// The MemberSpaceLimitsChangeCustomQuotaType struct - open class MemberSpaceLimitsChangeCustomQuotaType: CustomStringConvertible { + public class MemberSpaceLimitsChangeCustomQuotaType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangeCustomQuotaTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangeCustomQuotaTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangeCustomQuotaTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangeCustomQuotaType: \(error)" + } } } - open class MemberSpaceLimitsChangeCustomQuotaTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangeCustomQuotaType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsChangeCustomQuotaTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangeCustomQuotaType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangeCustomQuotaType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangeCustomQuotaType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsChangeCustomQuotaType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsChangeCustomQuotaType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangeCustomQuotaType.self, json: json) } } } /// Changed team default member space limit. - open class MemberSpaceLimitsChangePolicyDetails: CustomStringConvertible { + public class MemberSpaceLimitsChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// Previous team default limit value in bytes. Might be missing due to historical data gap. public let previousValue: UInt64? /// New team default limit value in bytes. Might be missing due to historical data gap. @@ -31707,64 +38134,86 @@ open class TeamLog { nullableValidator(comparableValidator())(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangePolicyDetails: \(error)" + } } } - open class MemberSpaceLimitsChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangePolicyDetails) -> JSON { - let output = [ - "previous_value": NullableSerializer(Serialization._UInt64Serializer).serialize(value.previousValue), - "new_value": NullableSerializer(Serialization._UInt64Serializer).serialize(value.newValue), + + public class MemberSpaceLimitsChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangePolicyDetails) throws -> JSON { + let output = [ + "previous_value": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.previousValue), + "new_value": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangePolicyDetails { switch json { - case .dictionary(let dict): - let previousValue = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["previous_value"] ?? .null) - let newValue = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["new_value"] ?? .null) - return MemberSpaceLimitsChangePolicyDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["previous_value"] ?? .null) + let newValue = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["new_value"] ?? .null) + return MemberSpaceLimitsChangePolicyDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangePolicyDetails.self, json: json) } } } /// The MemberSpaceLimitsChangePolicyType struct - open class MemberSpaceLimitsChangePolicyType: CustomStringConvertible { + public class MemberSpaceLimitsChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangePolicyType: \(error)" + } } } - open class MemberSpaceLimitsChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangePolicyType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangePolicyType.self, json: json) } } } /// Changed space limit status. - open class MemberSpaceLimitsChangeStatusDetails: CustomStringConvertible { + public class MemberSpaceLimitsChangeStatusDetails: CustomStringConvertible, JSONRepresentable { /// Previous storage quota status. public let previousValue: TeamLog.SpaceLimitsStatus /// New storage quota status. @@ -31773,174 +38222,234 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangeStatusDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangeStatusDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangeStatusDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangeStatusDetails: \(error)" + } } } - open class MemberSpaceLimitsChangeStatusDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangeStatusDetails) -> JSON { - let output = [ - "previous_value": TeamLog.SpaceLimitsStatusSerializer().serialize(value.previousValue), - "new_value": TeamLog.SpaceLimitsStatusSerializer().serialize(value.newValue), + + public class MemberSpaceLimitsChangeStatusDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangeStatusDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.SpaceLimitsStatusSerializer().serialize(value.previousValue), + "new_value": try TeamLog.SpaceLimitsStatusSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangeStatusDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangeStatusDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.SpaceLimitsStatusSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.SpaceLimitsStatusSerializer().deserialize(dict["new_value"] ?? .null) - return MemberSpaceLimitsChangeStatusDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.SpaceLimitsStatusSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.SpaceLimitsStatusSerializer().deserialize(dict["new_value"] ?? .null) + return MemberSpaceLimitsChangeStatusDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangeStatusDetails.self, json: json) } } } /// The MemberSpaceLimitsChangeStatusType struct - open class MemberSpaceLimitsChangeStatusType: CustomStringConvertible { + public class MemberSpaceLimitsChangeStatusType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsChangeStatusTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsChangeStatusTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsChangeStatusTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsChangeStatusType: \(error)" + } } } - open class MemberSpaceLimitsChangeStatusTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsChangeStatusType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsChangeStatusTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsChangeStatusType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsChangeStatusType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsChangeStatusType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsChangeStatusType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsChangeStatusType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsChangeStatusType.self, json: json) } } } /// Removed custom member space limit. - open class MemberSpaceLimitsRemoveCustomQuotaDetails: CustomStringConvertible { - public init() { + public class MemberSpaceLimitsRemoveCustomQuotaDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsRemoveCustomQuotaDetails: \(error)" + } } } - open class MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsRemoveCustomQuotaDetails) -> JSON { + + public class MemberSpaceLimitsRemoveCustomQuotaDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsRemoveCustomQuotaDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsRemoveCustomQuotaDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsRemoveCustomQuotaDetails { switch json { - case .dictionary(_): - return MemberSpaceLimitsRemoveCustomQuotaDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberSpaceLimitsRemoveCustomQuotaDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsRemoveCustomQuotaDetails.self, json: json) } } } /// The MemberSpaceLimitsRemoveCustomQuotaType struct - open class MemberSpaceLimitsRemoveCustomQuotaType: CustomStringConvertible { + public class MemberSpaceLimitsRemoveCustomQuotaType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsRemoveCustomQuotaTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsRemoveCustomQuotaTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsRemoveCustomQuotaTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsRemoveCustomQuotaType: \(error)" + } } } - open class MemberSpaceLimitsRemoveCustomQuotaTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsRemoveCustomQuotaType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsRemoveCustomQuotaTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsRemoveCustomQuotaType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsRemoveCustomQuotaType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsRemoveCustomQuotaType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsRemoveCustomQuotaType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsRemoveCustomQuotaType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsRemoveCustomQuotaType.self, json: json) } } } /// Removed members from member space limit exception list. - open class MemberSpaceLimitsRemoveExceptionDetails: CustomStringConvertible { - public init() { + public class MemberSpaceLimitsRemoveExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberSpaceLimitsRemoveExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsRemoveExceptionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsRemoveExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsRemoveExceptionDetails: \(error)" + } } } - open class MemberSpaceLimitsRemoveExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsRemoveExceptionDetails) -> JSON { + + public class MemberSpaceLimitsRemoveExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsRemoveExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsRemoveExceptionDetails { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsRemoveExceptionDetails { switch json { - case .dictionary(_): - return MemberSpaceLimitsRemoveExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberSpaceLimitsRemoveExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsRemoveExceptionDetails.self, json: json) } } } /// The MemberSpaceLimitsRemoveExceptionType struct - open class MemberSpaceLimitsRemoveExceptionType: CustomStringConvertible { + public class MemberSpaceLimitsRemoveExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSpaceLimitsRemoveExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSpaceLimitsRemoveExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSpaceLimitsRemoveExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSpaceLimitsRemoveExceptionType: \(error)" + } } } - open class MemberSpaceLimitsRemoveExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSpaceLimitsRemoveExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSpaceLimitsRemoveExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSpaceLimitsRemoveExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSpaceLimitsRemoveExceptionType { + + public func deserialize(_ json: JSON) throws -> MemberSpaceLimitsRemoveExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSpaceLimitsRemoveExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSpaceLimitsRemoveExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSpaceLimitsRemoveExceptionType.self, json: json) } } } /// The MemberStatus union - public enum MemberStatus: CustomStringConvertible { + public enum MemberStatus: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case active /// An unspecified error. @@ -31956,136 +38465,168 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try MemberStatusSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberStatus: \(error)" + } } } - open class MemberStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberStatus) -> JSON { + + public class MemberStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberStatus) throws -> JSON { switch value { - case .active: - var d = [String: JSON]() - d[".tag"] = .str("active") - return .dictionary(d) - case .invited: - var d = [String: JSON]() - d[".tag"] = .str("invited") - return .dictionary(d) - case .movedToAnotherTeam: - var d = [String: JSON]() - d[".tag"] = .str("moved_to_another_team") - return .dictionary(d) - case .notJoined: - var d = [String: JSON]() - d[".tag"] = .str("not_joined") - return .dictionary(d) - case .removed: - var d = [String: JSON]() - d[".tag"] = .str("removed") - return .dictionary(d) - case .suspended: - var d = [String: JSON]() - d[".tag"] = .str("suspended") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "active": - return MemberStatus.active - case "invited": - return MemberStatus.invited - case "moved_to_another_team": - return MemberStatus.movedToAnotherTeam - case "not_joined": - return MemberStatus.notJoined - case "removed": - return MemberStatus.removed - case "suspended": - return MemberStatus.suspended - case "other": - return MemberStatus.other - default: - return MemberStatus.other - } - default: - fatalError("Failed to deserialize") + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .invited: + var d = [String: JSON]() + d[".tag"] = .str("invited") + return .dictionary(d) + case .movedToAnotherTeam: + var d = [String: JSON]() + d[".tag"] = .str("moved_to_another_team") + return .dictionary(d) + case .notJoined: + var d = [String: JSON]() + d[".tag"] = .str("not_joined") + return .dictionary(d) + case .removed: + var d = [String: JSON]() + d[".tag"] = .str("removed") + return .dictionary(d) + case .suspended: + var d = [String: JSON]() + d[".tag"] = .str("suspended") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return MemberStatus.active + case "invited": + return MemberStatus.invited + case "moved_to_another_team": + return MemberStatus.movedToAnotherTeam + case "not_joined": + return MemberStatus.notJoined + case "removed": + return MemberStatus.removed + case "suspended": + return MemberStatus.suspended + case "other": + return MemberStatus.other + default: + return MemberStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberStatus.self, json: json) } } } /// Suggested person to add to team. - open class MemberSuggestDetails: CustomStringConvertible { + public class MemberSuggestDetails: CustomStringConvertible, JSONRepresentable { /// suggested users emails. - public let suggestedMembers: Array - public init(suggestedMembers: Array) { + public let suggestedMembers: [String] + public init(suggestedMembers: [String]) { arrayValidator(itemValidator: stringValidator(maxLength: 255))(suggestedMembers) self.suggestedMembers = suggestedMembers } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSuggestDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSuggestDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSuggestDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSuggestDetails: \(error)" + } } } - open class MemberSuggestDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSuggestDetails) -> JSON { - let output = [ - "suggested_members": ArraySerializer(Serialization._StringSerializer).serialize(value.suggestedMembers), + + public class MemberSuggestDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSuggestDetails) throws -> JSON { + let output = [ + "suggested_members": try ArraySerializer(Serialization._StringSerializer).serialize(value.suggestedMembers), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSuggestDetails { + + public func deserialize(_ json: JSON) throws -> MemberSuggestDetails { switch json { - case .dictionary(let dict): - let suggestedMembers = ArraySerializer(Serialization._StringSerializer).deserialize(dict["suggested_members"] ?? .null) - return MemberSuggestDetails(suggestedMembers: suggestedMembers) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let suggestedMembers = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["suggested_members"] ?? .null) + return MemberSuggestDetails(suggestedMembers: suggestedMembers) + default: + throw JSONSerializerError.deserializeError(type: MemberSuggestDetails.self, json: json) } } } /// The MemberSuggestType struct - open class MemberSuggestType: CustomStringConvertible { + public class MemberSuggestType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSuggestTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSuggestTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSuggestTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSuggestType: \(error)" + } } } - open class MemberSuggestTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSuggestType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSuggestTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSuggestType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSuggestType { + + public func deserialize(_ json: JSON) throws -> MemberSuggestType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSuggestType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSuggestType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSuggestType.self, json: json) } } } /// Enabled/disabled option for team members to suggest people to add to team. - open class MemberSuggestionsChangePolicyDetails: CustomStringConvertible { + public class MemberSuggestionsChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New team member suggestions policy. public let newValue: TeamLog.MemberSuggestionsPolicy /// Previous team member suggestions policy. Might be missing due to historical data gap. @@ -32094,64 +38635,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSuggestionsChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSuggestionsChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSuggestionsChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSuggestionsChangePolicyDetails: \(error)" + } } } - open class MemberSuggestionsChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSuggestionsChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.MemberSuggestionsPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.MemberSuggestionsPolicySerializer()).serialize(value.previousValue), + + public class MemberSuggestionsChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSuggestionsChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.MemberSuggestionsPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.MemberSuggestionsPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSuggestionsChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> MemberSuggestionsChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.MemberSuggestionsPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.MemberSuggestionsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return MemberSuggestionsChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.MemberSuggestionsPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.MemberSuggestionsPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return MemberSuggestionsChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MemberSuggestionsChangePolicyDetails.self, json: json) } } } /// The MemberSuggestionsChangePolicyType struct - open class MemberSuggestionsChangePolicyType: CustomStringConvertible { + public class MemberSuggestionsChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSuggestionsChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberSuggestionsChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSuggestionsChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSuggestionsChangePolicyType: \(error)" + } } } - open class MemberSuggestionsChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSuggestionsChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberSuggestionsChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSuggestionsChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberSuggestionsChangePolicyType { + + public func deserialize(_ json: JSON) throws -> MemberSuggestionsChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberSuggestionsChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberSuggestionsChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberSuggestionsChangePolicyType.self, json: json) } } } /// Member suggestions policy - public enum MemberSuggestionsPolicy: CustomStringConvertible { + public enum MemberSuggestionsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -32159,105 +38722,134 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try MemberSuggestionsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberSuggestionsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberSuggestionsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberSuggestionsPolicy: \(error)" + } } } - open class MemberSuggestionsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberSuggestionsPolicy) -> JSON { + + public class MemberSuggestionsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberSuggestionsPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MemberSuggestionsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return MemberSuggestionsPolicy.disabled - case "enabled": - return MemberSuggestionsPolicy.enabled - case "other": - return MemberSuggestionsPolicy.other - default: - return MemberSuggestionsPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MemberSuggestionsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return MemberSuggestionsPolicy.disabled + case "enabled": + return MemberSuggestionsPolicy.enabled + case "other": + return MemberSuggestionsPolicy.other default: - fatalError("Failed to deserialize") + return MemberSuggestionsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: MemberSuggestionsPolicy.self, json: json) } } } /// Transferred contents of deleted member account to another member. - open class MemberTransferAccountContentsDetails: CustomStringConvertible { - public init() { + public class MemberTransferAccountContentsDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try MemberTransferAccountContentsDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberTransferAccountContentsDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberTransferAccountContentsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberTransferAccountContentsDetails: \(error)" + } } } - open class MemberTransferAccountContentsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberTransferAccountContentsDetails) -> JSON { + + public class MemberTransferAccountContentsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberTransferAccountContentsDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberTransferAccountContentsDetails { + + public func deserialize(_ json: JSON) throws -> MemberTransferAccountContentsDetails { switch json { - case .dictionary(_): - return MemberTransferAccountContentsDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return MemberTransferAccountContentsDetails() + default: + throw JSONSerializerError.deserializeError(type: MemberTransferAccountContentsDetails.self, json: json) } } } /// The MemberTransferAccountContentsType struct - open class MemberTransferAccountContentsType: CustomStringConvertible { + public class MemberTransferAccountContentsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberTransferAccountContentsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberTransferAccountContentsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberTransferAccountContentsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberTransferAccountContentsType: \(error)" + } } } - open class MemberTransferAccountContentsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberTransferAccountContentsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MemberTransferAccountContentsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberTransferAccountContentsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberTransferAccountContentsType { + + public func deserialize(_ json: JSON) throws -> MemberTransferAccountContentsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MemberTransferAccountContentsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MemberTransferAccountContentsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MemberTransferAccountContentsType.self, json: json) } } } /// Internal only - fields for target team computations - open class MemberTransferredInternalFields: CustomStringConvertible { + public class MemberTransferredInternalFields: CustomStringConvertible, JSONRepresentable { /// Internal only - team user was moved from. public let sourceTeamId: String /// Internal only - team user was moved to. @@ -32268,33 +38860,44 @@ open class TeamLog { stringValidator()(targetTeamId) self.targetTeamId = targetTeamId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MemberTransferredInternalFieldsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MemberTransferredInternalFieldsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MemberTransferredInternalFieldsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MemberTransferredInternalFields: \(error)" + } } } - open class MemberTransferredInternalFieldsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MemberTransferredInternalFields) -> JSON { - let output = [ - "source_team_id": Serialization._StringSerializer.serialize(value.sourceTeamId), - "target_team_id": Serialization._StringSerializer.serialize(value.targetTeamId), + + public class MemberTransferredInternalFieldsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MemberTransferredInternalFields) throws -> JSON { + let output = [ + "source_team_id": try Serialization._StringSerializer.serialize(value.sourceTeamId), + "target_team_id": try Serialization._StringSerializer.serialize(value.targetTeamId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MemberTransferredInternalFields { + + public func deserialize(_ json: JSON) throws -> MemberTransferredInternalFields { switch json { - case .dictionary(let dict): - let sourceTeamId = Serialization._StringSerializer.deserialize(dict["source_team_id"] ?? .null) - let targetTeamId = Serialization._StringSerializer.deserialize(dict["target_team_id"] ?? .null) - return MemberTransferredInternalFields(sourceTeamId: sourceTeamId, targetTeamId: targetTeamId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sourceTeamId = try Serialization._StringSerializer.deserialize(dict["source_team_id"] ?? .null) + let targetTeamId = try Serialization._StringSerializer.deserialize(dict["target_team_id"] ?? .null) + return MemberTransferredInternalFields(sourceTeamId: sourceTeamId, targetTeamId: targetTeamId) + default: + throw JSONSerializerError.deserializeError(type: MemberTransferredInternalFields.self, json: json) } } } /// Enabled/disabled Microsoft Office add-in. - open class MicrosoftOfficeAddinChangePolicyDetails: CustomStringConvertible { + public class MicrosoftOfficeAddinChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New Microsoft Office addin policy. public let newValue: TeamLog.MicrosoftOfficeAddinPolicy /// Previous Microsoft Office addin policy. Might be missing due to historical data gap. @@ -32303,64 +38906,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MicrosoftOfficeAddinChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MicrosoftOfficeAddinChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MicrosoftOfficeAddinChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MicrosoftOfficeAddinChangePolicyDetails: \(error)" + } } } - open class MicrosoftOfficeAddinChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MicrosoftOfficeAddinChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.MicrosoftOfficeAddinPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.MicrosoftOfficeAddinPolicySerializer()).serialize(value.previousValue), + + public class MicrosoftOfficeAddinChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MicrosoftOfficeAddinChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.MicrosoftOfficeAddinPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.MicrosoftOfficeAddinPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MicrosoftOfficeAddinChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> MicrosoftOfficeAddinChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.MicrosoftOfficeAddinPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.MicrosoftOfficeAddinPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return MicrosoftOfficeAddinChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.MicrosoftOfficeAddinPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.MicrosoftOfficeAddinPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return MicrosoftOfficeAddinChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: MicrosoftOfficeAddinChangePolicyDetails.self, json: json) } } } /// The MicrosoftOfficeAddinChangePolicyType struct - open class MicrosoftOfficeAddinChangePolicyType: CustomStringConvertible { + public class MicrosoftOfficeAddinChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MicrosoftOfficeAddinChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try MicrosoftOfficeAddinChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MicrosoftOfficeAddinChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MicrosoftOfficeAddinChangePolicyType: \(error)" + } } } - open class MicrosoftOfficeAddinChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MicrosoftOfficeAddinChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class MicrosoftOfficeAddinChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MicrosoftOfficeAddinChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MicrosoftOfficeAddinChangePolicyType { + + public func deserialize(_ json: JSON) throws -> MicrosoftOfficeAddinChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return MicrosoftOfficeAddinChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return MicrosoftOfficeAddinChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: MicrosoftOfficeAddinChangePolicyType.self, json: json) } } } /// Microsoft Office addin policy - public enum MicrosoftOfficeAddinPolicy: CustomStringConvertible { + public enum MicrosoftOfficeAddinPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -32368,82 +38993,103 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try MicrosoftOfficeAddinPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MicrosoftOfficeAddinPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MicrosoftOfficeAddinPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for MicrosoftOfficeAddinPolicy: \(error)" + } } } - open class MicrosoftOfficeAddinPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MicrosoftOfficeAddinPolicy) -> JSON { + + public class MicrosoftOfficeAddinPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MicrosoftOfficeAddinPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> MicrosoftOfficeAddinPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return MicrosoftOfficeAddinPolicy.disabled - case "enabled": - return MicrosoftOfficeAddinPolicy.enabled - case "other": - return MicrosoftOfficeAddinPolicy.other - default: - return MicrosoftOfficeAddinPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MicrosoftOfficeAddinPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return MicrosoftOfficeAddinPolicy.disabled + case "enabled": + return MicrosoftOfficeAddinPolicy.enabled + case "other": + return MicrosoftOfficeAddinPolicy.other default: - fatalError("Failed to deserialize") + return MicrosoftOfficeAddinPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: MicrosoftOfficeAddinPolicy.self, json: json) } } } /// An indication that an error occurred while retrieving the event. Some attributes of the event may be omitted as /// a result. - open class MissingDetails: CustomStringConvertible { + public class MissingDetails: CustomStringConvertible, JSONRepresentable { /// All the data that could be retrieved and converted from the source event. public let sourceEventFields: String? public init(sourceEventFields: String? = nil) { nullableValidator(stringValidator())(sourceEventFields) self.sourceEventFields = sourceEventFields } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MissingDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try MissingDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MissingDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MissingDetails: \(error)" + } } } - open class MissingDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MissingDetails) -> JSON { - let output = [ - "source_event_fields": NullableSerializer(Serialization._StringSerializer).serialize(value.sourceEventFields), + + public class MissingDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MissingDetails) throws -> JSON { + let output = [ + "source_event_fields": try NullableSerializer(Serialization._StringSerializer).serialize(value.sourceEventFields), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MissingDetails { + + public func deserialize(_ json: JSON) throws -> MissingDetails { switch json { - case .dictionary(let dict): - let sourceEventFields = NullableSerializer(Serialization._StringSerializer).deserialize(dict["source_event_fields"] ?? .null) - return MissingDetails(sourceEventFields: sourceEventFields) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sourceEventFields = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["source_event_fields"] ?? .null) + return MissingDetails(sourceEventFields: sourceEventFields) + default: + throw JSONSerializerError.deserializeError(type: MissingDetails.self, json: json) } } } /// Information about linked Dropbox mobile client sessions - open class MobileDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { + public class MobileDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { /// Mobile session unique id. public let sessionInfo: TeamLog.MobileSessionLogInfo? /// The device name. @@ -32456,7 +39102,17 @@ open class TeamLog { public let osVersion: String? /// last carrier used by the device. public let lastCarrier: String? - public init(deviceName: String, clientType: Team.MobileClientPlatform, ipAddress: String? = nil, created: Date? = nil, updated: Date? = nil, sessionInfo: TeamLog.MobileSessionLogInfo? = nil, clientVersion: String? = nil, osVersion: String? = nil, lastCarrier: String? = nil) { + public init( + deviceName: String, + clientType: Team.MobileClientPlatform, + ipAddress: String? = nil, + created: Date? = nil, + updated: Date? = nil, + sessionInfo: TeamLog.MobileSessionLogInfo? = nil, + clientVersion: String? = nil, + osVersion: String? = nil, + lastCarrier: String? = nil + ) { self.sessionInfo = sessionInfo stringValidator()(deviceName) self.deviceName = deviceName @@ -32469,72 +39125,95 @@ open class TeamLog { self.lastCarrier = lastCarrier super.init(ipAddress: ipAddress, created: created, updated: updated) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MobileDeviceSessionLogInfoSerializer().serialize(self)))" - } - } - open class MobileDeviceSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MobileDeviceSessionLogInfo) -> JSON { - let output = [ - "device_name": Serialization._StringSerializer.serialize(value.deviceName), - "client_type": Team.MobileClientPlatformSerializer().serialize(value.clientType), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), - "session_info": NullableSerializer(TeamLog.MobileSessionLogInfoSerializer()).serialize(value.sessionInfo), - "client_version": NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), - "os_version": NullableSerializer(Serialization._StringSerializer).serialize(value.osVersion), - "last_carrier": NullableSerializer(Serialization._StringSerializer).serialize(value.lastCarrier), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> MobileDeviceSessionLogInfo { - switch json { - case .dictionary(let dict): - let deviceName = Serialization._StringSerializer.deserialize(dict["device_name"] ?? .null) - let clientType = Team.MobileClientPlatformSerializer().deserialize(dict["client_type"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - let sessionInfo = NullableSerializer(TeamLog.MobileSessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) - let clientVersion = NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) - let osVersion = NullableSerializer(Serialization._StringSerializer).deserialize(dict["os_version"] ?? .null) - let lastCarrier = NullableSerializer(Serialization._StringSerializer).deserialize(dict["last_carrier"] ?? .null) - return MobileDeviceSessionLogInfo(deviceName: deviceName, clientType: clientType, ipAddress: ipAddress, created: created, updated: updated, sessionInfo: sessionInfo, clientVersion: clientVersion, osVersion: osVersion, lastCarrier: lastCarrier) - default: - fatalError("Type error deserializing") + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MobileDeviceSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MobileDeviceSessionLogInfo: \(error)" + } + } + } + + public class MobileDeviceSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MobileDeviceSessionLogInfo) throws -> JSON { + let output = [ + "device_name": try Serialization._StringSerializer.serialize(value.deviceName), + "client_type": try Team.MobileClientPlatformSerializer().serialize(value.clientType), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + "session_info": try NullableSerializer(TeamLog.MobileSessionLogInfoSerializer()).serialize(value.sessionInfo), + "client_version": try NullableSerializer(Serialization._StringSerializer).serialize(value.clientVersion), + "os_version": try NullableSerializer(Serialization._StringSerializer).serialize(value.osVersion), + "last_carrier": try NullableSerializer(Serialization._StringSerializer).serialize(value.lastCarrier), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> MobileDeviceSessionLogInfo { + switch json { + case .dictionary(let dict): + let deviceName = try Serialization._StringSerializer.deserialize(dict["device_name"] ?? .null) + let clientType = try Team.MobileClientPlatformSerializer().deserialize(dict["client_type"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + let sessionInfo = try NullableSerializer(TeamLog.MobileSessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) + let clientVersion = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["client_version"] ?? .null) + let osVersion = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["os_version"] ?? .null) + let lastCarrier = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["last_carrier"] ?? .null) + return MobileDeviceSessionLogInfo( + deviceName: deviceName, + clientType: clientType, + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo, + clientVersion: clientVersion, + osVersion: osVersion, + lastCarrier: lastCarrier + ) + default: + throw JSONSerializerError.deserializeError(type: MobileDeviceSessionLogInfo.self, json: json) } } } /// Mobile session. - open class MobileSessionLogInfo: TeamLog.SessionLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(MobileSessionLogInfoSerializer().serialize(self)))" + public class MobileSessionLogInfo: TeamLog.SessionLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MobileSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MobileSessionLogInfo: \(error)" + } } } - open class MobileSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: MobileSessionLogInfo) -> JSON { - let output = [ - "session_id": NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), + + public class MobileSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MobileSessionLogInfo) throws -> JSON { + let output = [ + "session_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> MobileSessionLogInfo { + + public func deserialize(_ json: JSON) throws -> MobileSessionLogInfo { switch json { - case .dictionary(let dict): - let sessionId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) - return MobileSessionLogInfo(sessionId: sessionId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) + return MobileSessionLogInfo(sessionId: sessionId) + default: + throw JSONSerializerError.deserializeError(type: MobileSessionLogInfo.self, json: json) } } } /// Namespace relative path details. - open class NamespaceRelativePathLogInfo: CustomStringConvertible { + public class NamespaceRelativePathLogInfo: CustomStringConvertible, JSONRepresentable { /// Namespace ID. public let nsId: String? /// A path relative to the specified namespace ID. @@ -32548,35 +39227,46 @@ open class TeamLog { self.relativePath = relativePath self.isSharedNamespace = isSharedNamespace } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NamespaceRelativePathLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try NamespaceRelativePathLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NamespaceRelativePathLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NamespaceRelativePathLogInfo: \(error)" + } } } - open class NamespaceRelativePathLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NamespaceRelativePathLogInfo) -> JSON { - let output = [ - "ns_id": NullableSerializer(Serialization._StringSerializer).serialize(value.nsId), - "relative_path": NullableSerializer(Serialization._StringSerializer).serialize(value.relativePath), - "is_shared_namespace": NullableSerializer(Serialization._BoolSerializer).serialize(value.isSharedNamespace), + + public class NamespaceRelativePathLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NamespaceRelativePathLogInfo) throws -> JSON { + let output = [ + "ns_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.nsId), + "relative_path": try NullableSerializer(Serialization._StringSerializer).serialize(value.relativePath), + "is_shared_namespace": try NullableSerializer(Serialization._BoolSerializer).serialize(value.isSharedNamespace), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NamespaceRelativePathLogInfo { + + public func deserialize(_ json: JSON) throws -> NamespaceRelativePathLogInfo { switch json { - case .dictionary(let dict): - let nsId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ns_id"] ?? .null) - let relativePath = NullableSerializer(Serialization._StringSerializer).deserialize(dict["relative_path"] ?? .null) - let isSharedNamespace = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_shared_namespace"] ?? .null) - return NamespaceRelativePathLogInfo(nsId: nsId, relativePath: relativePath, isSharedNamespace: isSharedNamespace) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let nsId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ns_id"] ?? .null) + let relativePath = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["relative_path"] ?? .null) + let isSharedNamespace = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["is_shared_namespace"] ?? .null) + return NamespaceRelativePathLogInfo(nsId: nsId, relativePath: relativePath, isSharedNamespace: isSharedNamespace) + default: + throw JSONSerializerError.deserializeError(type: NamespaceRelativePathLogInfo.self, json: json) } } } /// Enabled/disabled network control. - open class NetworkControlChangePolicyDetails: CustomStringConvertible { + public class NetworkControlChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New network control policy. public let newValue: TeamLog.NetworkControlPolicy /// Previous network control policy. Might be missing due to historical data gap. @@ -32585,64 +39275,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NetworkControlChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NetworkControlChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NetworkControlChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NetworkControlChangePolicyDetails: \(error)" + } } } - open class NetworkControlChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NetworkControlChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.NetworkControlPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.NetworkControlPolicySerializer()).serialize(value.previousValue), + + public class NetworkControlChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NetworkControlChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.NetworkControlPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.NetworkControlPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NetworkControlChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> NetworkControlChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.NetworkControlPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.NetworkControlPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return NetworkControlChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.NetworkControlPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.NetworkControlPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return NetworkControlChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: NetworkControlChangePolicyDetails.self, json: json) } } } /// The NetworkControlChangePolicyType struct - open class NetworkControlChangePolicyType: CustomStringConvertible { + public class NetworkControlChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NetworkControlChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NetworkControlChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NetworkControlChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NetworkControlChangePolicyType: \(error)" + } } } - open class NetworkControlChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NetworkControlChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NetworkControlChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NetworkControlChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NetworkControlChangePolicyType { + + public func deserialize(_ json: JSON) throws -> NetworkControlChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NetworkControlChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NetworkControlChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NetworkControlChangePolicyType.self, json: json) } } } /// Network control policy - public enum NetworkControlPolicy: CustomStringConvertible { + public enum NetworkControlPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -32650,50 +39362,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try NetworkControlPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NetworkControlPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NetworkControlPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for NetworkControlPolicy: \(error)" + } } } - open class NetworkControlPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NetworkControlPolicy) -> JSON { + + public class NetworkControlPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NetworkControlPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> NetworkControlPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return NetworkControlPolicy.disabled - case "enabled": - return NetworkControlPolicy.enabled - case "other": - return NetworkControlPolicy.other - default: - return NetworkControlPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> NetworkControlPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return NetworkControlPolicy.disabled + case "enabled": + return NetworkControlPolicy.enabled + case "other": + return NetworkControlPolicy.other default: - fatalError("Failed to deserialize") + return NetworkControlPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: NetworkControlPolicy.self, json: json) } } } /// Report created: Links created with no expiration. - open class NoExpirationLinkGenCreateReportDetails: CustomStringConvertible { + public class NoExpirationLinkGenCreateReportDetails: CustomStringConvertible, JSONRepresentable { /// Report start date. public let startDate: Date /// Report end date. @@ -32702,125 +39424,169 @@ open class TeamLog { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoExpirationLinkGenCreateReportDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoExpirationLinkGenCreateReportDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoExpirationLinkGenCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoExpirationLinkGenCreateReportDetails: \(error)" + } } } - open class NoExpirationLinkGenCreateReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoExpirationLinkGenCreateReportDetails) -> JSON { - let output = [ - "start_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), - "end_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), + + public class NoExpirationLinkGenCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoExpirationLinkGenCreateReportDetails) throws -> JSON { + let output = [ + "start_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), + "end_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoExpirationLinkGenCreateReportDetails { + + public func deserialize(_ json: JSON) throws -> NoExpirationLinkGenCreateReportDetails { switch json { - case .dictionary(let dict): - let startDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) - let endDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) - return NoExpirationLinkGenCreateReportDetails(startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) + let endDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) + return NoExpirationLinkGenCreateReportDetails(startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: NoExpirationLinkGenCreateReportDetails.self, json: json) } } } /// The NoExpirationLinkGenCreateReportType struct - open class NoExpirationLinkGenCreateReportType: CustomStringConvertible { + public class NoExpirationLinkGenCreateReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoExpirationLinkGenCreateReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoExpirationLinkGenCreateReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoExpirationLinkGenCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoExpirationLinkGenCreateReportType: \(error)" + } } } - open class NoExpirationLinkGenCreateReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoExpirationLinkGenCreateReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoExpirationLinkGenCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoExpirationLinkGenCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoExpirationLinkGenCreateReportType { + + public func deserialize(_ json: JSON) throws -> NoExpirationLinkGenCreateReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoExpirationLinkGenCreateReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoExpirationLinkGenCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoExpirationLinkGenCreateReportType.self, json: json) } } } /// Couldn't create report: Links created with no expiration. - open class NoExpirationLinkGenReportFailedDetails: CustomStringConvertible { + public class NoExpirationLinkGenReportFailedDetails: CustomStringConvertible, JSONRepresentable { /// Failure reason. public let failureReason: Team.TeamReportFailureReason public init(failureReason: Team.TeamReportFailureReason) { self.failureReason = failureReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoExpirationLinkGenReportFailedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoExpirationLinkGenReportFailedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoExpirationLinkGenReportFailedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoExpirationLinkGenReportFailedDetails: \(error)" + } } } - open class NoExpirationLinkGenReportFailedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoExpirationLinkGenReportFailedDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), + + public class NoExpirationLinkGenReportFailedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoExpirationLinkGenReportFailedDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoExpirationLinkGenReportFailedDetails { + + public func deserialize(_ json: JSON) throws -> NoExpirationLinkGenReportFailedDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return NoExpirationLinkGenReportFailedDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return NoExpirationLinkGenReportFailedDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: NoExpirationLinkGenReportFailedDetails.self, json: json) } } } /// The NoExpirationLinkGenReportFailedType struct - open class NoExpirationLinkGenReportFailedType: CustomStringConvertible { + public class NoExpirationLinkGenReportFailedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoExpirationLinkGenReportFailedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoExpirationLinkGenReportFailedTypeSerializer().serialize(self) } - } - open class NoExpirationLinkGenReportFailedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoExpirationLinkGenReportFailedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoExpirationLinkGenReportFailedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoExpirationLinkGenReportFailedType: \(error)" + } + } + } + + public class NoExpirationLinkGenReportFailedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoExpirationLinkGenReportFailedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoExpirationLinkGenReportFailedType { + + public func deserialize(_ json: JSON) throws -> NoExpirationLinkGenReportFailedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoExpirationLinkGenReportFailedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoExpirationLinkGenReportFailedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoExpirationLinkGenReportFailedType.self, json: json) } } } /// Report created: Links created without passwords. - open class NoPasswordLinkGenCreateReportDetails: CustomStringConvertible { + public class NoPasswordLinkGenCreateReportDetails: CustomStringConvertible, JSONRepresentable { /// Report start date. public let startDate: Date /// Report end date. @@ -32829,125 +39595,169 @@ open class TeamLog { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkGenCreateReportDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkGenCreateReportDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkGenCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkGenCreateReportDetails: \(error)" + } } } - open class NoPasswordLinkGenCreateReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkGenCreateReportDetails) -> JSON { - let output = [ - "start_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), - "end_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), + + public class NoPasswordLinkGenCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkGenCreateReportDetails) throws -> JSON { + let output = [ + "start_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), + "end_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkGenCreateReportDetails { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkGenCreateReportDetails { switch json { - case .dictionary(let dict): - let startDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) - let endDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) - return NoPasswordLinkGenCreateReportDetails(startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) + let endDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) + return NoPasswordLinkGenCreateReportDetails(startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkGenCreateReportDetails.self, json: json) } } } /// The NoPasswordLinkGenCreateReportType struct - open class NoPasswordLinkGenCreateReportType: CustomStringConvertible { + public class NoPasswordLinkGenCreateReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkGenCreateReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkGenCreateReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkGenCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkGenCreateReportType: \(error)" + } } } - open class NoPasswordLinkGenCreateReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkGenCreateReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoPasswordLinkGenCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkGenCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkGenCreateReportType { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkGenCreateReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoPasswordLinkGenCreateReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoPasswordLinkGenCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkGenCreateReportType.self, json: json) } } } /// Couldn't create report: Links created without passwords. - open class NoPasswordLinkGenReportFailedDetails: CustomStringConvertible { + public class NoPasswordLinkGenReportFailedDetails: CustomStringConvertible, JSONRepresentable { /// Failure reason. public let failureReason: Team.TeamReportFailureReason public init(failureReason: Team.TeamReportFailureReason) { self.failureReason = failureReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkGenReportFailedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkGenReportFailedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkGenReportFailedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkGenReportFailedDetails: \(error)" + } } } - open class NoPasswordLinkGenReportFailedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkGenReportFailedDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), + + public class NoPasswordLinkGenReportFailedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkGenReportFailedDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkGenReportFailedDetails { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkGenReportFailedDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return NoPasswordLinkGenReportFailedDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return NoPasswordLinkGenReportFailedDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkGenReportFailedDetails.self, json: json) } } } /// The NoPasswordLinkGenReportFailedType struct - open class NoPasswordLinkGenReportFailedType: CustomStringConvertible { + public class NoPasswordLinkGenReportFailedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkGenReportFailedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkGenReportFailedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkGenReportFailedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkGenReportFailedType: \(error)" + } } } - open class NoPasswordLinkGenReportFailedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkGenReportFailedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoPasswordLinkGenReportFailedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkGenReportFailedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkGenReportFailedType { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkGenReportFailedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoPasswordLinkGenReportFailedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoPasswordLinkGenReportFailedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkGenReportFailedType.self, json: json) } } } /// Report created: Views of links without passwords. - open class NoPasswordLinkViewCreateReportDetails: CustomStringConvertible { + public class NoPasswordLinkViewCreateReportDetails: CustomStringConvertible, JSONRepresentable { /// Report start date. public let startDate: Date /// Report end date. @@ -32956,125 +39766,169 @@ open class TeamLog { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkViewCreateReportDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkViewCreateReportDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkViewCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkViewCreateReportDetails: \(error)" + } } } - open class NoPasswordLinkViewCreateReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkViewCreateReportDetails) -> JSON { - let output = [ - "start_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), - "end_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), + + public class NoPasswordLinkViewCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkViewCreateReportDetails) throws -> JSON { + let output = [ + "start_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), + "end_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkViewCreateReportDetails { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkViewCreateReportDetails { switch json { - case .dictionary(let dict): - let startDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) - let endDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) - return NoPasswordLinkViewCreateReportDetails(startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) + let endDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) + return NoPasswordLinkViewCreateReportDetails(startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkViewCreateReportDetails.self, json: json) } } } /// The NoPasswordLinkViewCreateReportType struct - open class NoPasswordLinkViewCreateReportType: CustomStringConvertible { + public class NoPasswordLinkViewCreateReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkViewCreateReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkViewCreateReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkViewCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkViewCreateReportType: \(error)" + } } } - open class NoPasswordLinkViewCreateReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkViewCreateReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoPasswordLinkViewCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkViewCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkViewCreateReportType { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkViewCreateReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoPasswordLinkViewCreateReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoPasswordLinkViewCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkViewCreateReportType.self, json: json) } } } /// Couldn't create report: Views of links without passwords. - open class NoPasswordLinkViewReportFailedDetails: CustomStringConvertible { + public class NoPasswordLinkViewReportFailedDetails: CustomStringConvertible, JSONRepresentable { /// Failure reason. public let failureReason: Team.TeamReportFailureReason public init(failureReason: Team.TeamReportFailureReason) { self.failureReason = failureReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkViewReportFailedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkViewReportFailedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkViewReportFailedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkViewReportFailedDetails: \(error)" + } } } - open class NoPasswordLinkViewReportFailedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkViewReportFailedDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), + + public class NoPasswordLinkViewReportFailedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkViewReportFailedDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkViewReportFailedDetails { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkViewReportFailedDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return NoPasswordLinkViewReportFailedDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return NoPasswordLinkViewReportFailedDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkViewReportFailedDetails.self, json: json) } } } /// The NoPasswordLinkViewReportFailedType struct - open class NoPasswordLinkViewReportFailedType: CustomStringConvertible { + public class NoPasswordLinkViewReportFailedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoPasswordLinkViewReportFailedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoPasswordLinkViewReportFailedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoPasswordLinkViewReportFailedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoPasswordLinkViewReportFailedType: \(error)" + } } } - open class NoPasswordLinkViewReportFailedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoPasswordLinkViewReportFailedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoPasswordLinkViewReportFailedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoPasswordLinkViewReportFailedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoPasswordLinkViewReportFailedType { + + public func deserialize(_ json: JSON) throws -> NoPasswordLinkViewReportFailedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoPasswordLinkViewReportFailedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoPasswordLinkViewReportFailedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoPasswordLinkViewReportFailedType.self, json: json) } } } /// User's logged information. - open class UserLogInfo: CustomStringConvertible { + public class UserLogInfo: CustomStringConvertible, JSONRepresentable { /// User unique ID. public let accountId: String? /// User display name. @@ -33089,753 +39943,1003 @@ open class TeamLog { nullableValidator(stringValidator(maxLength: 255))(email) self.email = email } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserLogInfo: \(error)" + } } } - open class UserLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserLogInfo) -> JSON { - var output = [ - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "email": NullableSerializer(Serialization._StringSerializer).serialize(value.email), + + public class UserLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserLogInfo) throws -> JSON { + var output = [ + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "email": try NullableSerializer(Serialization._StringSerializer).serialize(value.email), ] switch value { - case let teamMember as TeamLog.TeamMemberLogInfo: - for (k, v) in Serialization.getFields(TeamLog.TeamMemberLogInfoSerializer().serialize(teamMember)) { - output[k] = v - } - output[".tag"] = .str("team_member") - case let trustedNonTeamMember as TeamLog.TrustedNonTeamMemberLogInfo: - for (k, v) in Serialization.getFields(TeamLog.TrustedNonTeamMemberLogInfoSerializer().serialize(trustedNonTeamMember)) { - output[k] = v - } - output[".tag"] = .str("trusted_non_team_member") - case let nonTeamMember as TeamLog.NonTeamMemberLogInfo: - for (k, v) in Serialization.getFields(TeamLog.NonTeamMemberLogInfoSerializer().serialize(nonTeamMember)) { - output[k] = v - } - output[".tag"] = .str("non_team_member") - default: fatalError("Tried to serialize unexpected subtype") - } - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> UserLogInfo { - switch json { - case .dictionary(let dict): - let tag = Serialization.getTag(dict) - switch tag { - case "team_member": - return TeamLog.TeamMemberLogInfoSerializer().deserialize(json) - case "trusted_non_team_member": - return TeamLog.TrustedNonTeamMemberLogInfoSerializer().deserialize(json) - case "non_team_member": - return TeamLog.NonTeamMemberLogInfoSerializer().deserialize(json) - default: - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let email = NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) - return UserLogInfo(accountId: accountId, displayName: displayName, email: email) - } - default: - fatalError("Type error deserializing") + case let teamMember as TeamLog.TeamMemberLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.TeamMemberLogInfoSerializer().serialize(teamMember)) { + output[k] = v + } + output[".tag"] = .str("team_member") + case let trustedNonTeamMember as TeamLog.TrustedNonTeamMemberLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.TrustedNonTeamMemberLogInfoSerializer().serialize(trustedNonTeamMember)) { + output[k] = v + } + output[".tag"] = .str("trusted_non_team_member") + case let nonTeamMember as TeamLog.NonTeamMemberLogInfo: + for (k, v) in try Serialization.getFields(TeamLog.NonTeamMemberLogInfoSerializer().serialize(nonTeamMember)) { + output[k] = v + } + output[".tag"] = .str("non_team_member") + default: + throw JSONSerializerError.unexpectedSubtype(type: UserLogInfo.self, subtype: value) + } + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> UserLogInfo { + switch json { + case .dictionary(let dict): + let tag = try Serialization.getTag(dict) + switch tag { + case "team_member": + return try TeamLog.TeamMemberLogInfoSerializer().deserialize(json) + case "trusted_non_team_member": + return try TeamLog.TrustedNonTeamMemberLogInfoSerializer().deserialize(json) + case "non_team_member": + return try TeamLog.NonTeamMemberLogInfoSerializer().deserialize(json) + default: + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let email = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) + return UserLogInfo(accountId: accountId, displayName: displayName, email: email) + } + default: + throw JSONSerializerError.deserializeError(type: UserLogInfo.self, json: json) } } } /// Non team member's logged information. - open class NonTeamMemberLogInfo: TeamLog.UserLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NonTeamMemberLogInfoSerializer().serialize(self)))" + public class NonTeamMemberLogInfo: TeamLog.UserLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NonTeamMemberLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NonTeamMemberLogInfo: \(error)" + } } } - open class NonTeamMemberLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NonTeamMemberLogInfo) -> JSON { - let output = [ - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "email": NullableSerializer(Serialization._StringSerializer).serialize(value.email), + + public class NonTeamMemberLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NonTeamMemberLogInfo) throws -> JSON { + let output = [ + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "email": try NullableSerializer(Serialization._StringSerializer).serialize(value.email), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NonTeamMemberLogInfo { + + public func deserialize(_ json: JSON) throws -> NonTeamMemberLogInfo { switch json { - case .dictionary(let dict): - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let email = NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) - return NonTeamMemberLogInfo(accountId: accountId, displayName: displayName, email: email) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let email = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) + return NonTeamMemberLogInfo(accountId: accountId, displayName: displayName, email: email) + default: + throw JSONSerializerError.deserializeError(type: NonTeamMemberLogInfo.self, json: json) } } } /// The email to which the request was sent - open class NonTrustedTeamDetails: CustomStringConvertible { + public class NonTrustedTeamDetails: CustomStringConvertible, JSONRepresentable { /// The email to which the request was sent. public let team: String public init(team: String) { stringValidator()(team) self.team = team } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NonTrustedTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try NonTrustedTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NonTrustedTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NonTrustedTeamDetails: \(error)" + } } } - open class NonTrustedTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NonTrustedTeamDetails) -> JSON { - let output = [ - "team": Serialization._StringSerializer.serialize(value.team), + + public class NonTrustedTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NonTrustedTeamDetails) throws -> JSON { + let output = [ + "team": try Serialization._StringSerializer.serialize(value.team), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NonTrustedTeamDetails { + + public func deserialize(_ json: JSON) throws -> NonTrustedTeamDetails { switch json { - case .dictionary(let dict): - let team = Serialization._StringSerializer.deserialize(dict["team"] ?? .null) - return NonTrustedTeamDetails(team: team) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let team = try Serialization._StringSerializer.deserialize(dict["team"] ?? .null) + return NonTrustedTeamDetails(team: team) + default: + throw JSONSerializerError.deserializeError(type: NonTrustedTeamDetails.self, json: json) } } } /// Changed Paper doc to invite-only. - open class NoteAclInviteOnlyDetails: CustomStringConvertible { - public init() { + public class NoteAclInviteOnlyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try NoteAclInviteOnlyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteAclInviteOnlyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteAclInviteOnlyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteAclInviteOnlyDetails: \(error)" + } } } - open class NoteAclInviteOnlyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteAclInviteOnlyDetails) -> JSON { + + public class NoteAclInviteOnlyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteAclInviteOnlyDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteAclInviteOnlyDetails { + + public func deserialize(_ json: JSON) throws -> NoteAclInviteOnlyDetails { switch json { - case .dictionary(_): - return NoteAclInviteOnlyDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return NoteAclInviteOnlyDetails() + default: + throw JSONSerializerError.deserializeError(type: NoteAclInviteOnlyDetails.self, json: json) } } } /// The NoteAclInviteOnlyType struct - open class NoteAclInviteOnlyType: CustomStringConvertible { + public class NoteAclInviteOnlyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteAclInviteOnlyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoteAclInviteOnlyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteAclInviteOnlyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteAclInviteOnlyType: \(error)" + } } } - open class NoteAclInviteOnlyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteAclInviteOnlyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoteAclInviteOnlyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteAclInviteOnlyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteAclInviteOnlyType { + + public func deserialize(_ json: JSON) throws -> NoteAclInviteOnlyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoteAclInviteOnlyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoteAclInviteOnlyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoteAclInviteOnlyType.self, json: json) } } } /// Changed Paper doc to link-accessible. - open class NoteAclLinkDetails: CustomStringConvertible { - public init() { + public class NoteAclLinkDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try NoteAclLinkDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteAclLinkDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteAclLinkDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteAclLinkDetails: \(error)" + } } } - open class NoteAclLinkDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteAclLinkDetails) -> JSON { + + public class NoteAclLinkDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteAclLinkDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteAclLinkDetails { + + public func deserialize(_ json: JSON) throws -> NoteAclLinkDetails { switch json { - case .dictionary(_): - return NoteAclLinkDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return NoteAclLinkDetails() + default: + throw JSONSerializerError.deserializeError(type: NoteAclLinkDetails.self, json: json) } } } /// The NoteAclLinkType struct - open class NoteAclLinkType: CustomStringConvertible { + public class NoteAclLinkType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteAclLinkTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoteAclLinkTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteAclLinkTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteAclLinkType: \(error)" + } } } - open class NoteAclLinkTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteAclLinkType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoteAclLinkTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteAclLinkType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteAclLinkType { + + public func deserialize(_ json: JSON) throws -> NoteAclLinkType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoteAclLinkType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoteAclLinkType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoteAclLinkType.self, json: json) } } } /// Changed Paper doc to link-accessible for team. - open class NoteAclTeamLinkDetails: CustomStringConvertible { - public init() { + public class NoteAclTeamLinkDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try NoteAclTeamLinkDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteAclTeamLinkDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteAclTeamLinkDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteAclTeamLinkDetails: \(error)" + } } } - open class NoteAclTeamLinkDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteAclTeamLinkDetails) -> JSON { + + public class NoteAclTeamLinkDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteAclTeamLinkDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteAclTeamLinkDetails { + + public func deserialize(_ json: JSON) throws -> NoteAclTeamLinkDetails { switch json { - case .dictionary(_): - return NoteAclTeamLinkDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return NoteAclTeamLinkDetails() + default: + throw JSONSerializerError.deserializeError(type: NoteAclTeamLinkDetails.self, json: json) } } } /// The NoteAclTeamLinkType struct - open class NoteAclTeamLinkType: CustomStringConvertible { + public class NoteAclTeamLinkType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteAclTeamLinkTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoteAclTeamLinkTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteAclTeamLinkTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteAclTeamLinkType: \(error)" + } } } - open class NoteAclTeamLinkTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteAclTeamLinkType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoteAclTeamLinkTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteAclTeamLinkType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteAclTeamLinkType { + + public func deserialize(_ json: JSON) throws -> NoteAclTeamLinkType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoteAclTeamLinkType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoteAclTeamLinkType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoteAclTeamLinkType.self, json: json) } } } /// Shared received Paper doc. - open class NoteShareReceiveDetails: CustomStringConvertible { - public init() { + public class NoteShareReceiveDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try NoteShareReceiveDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteShareReceiveDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteShareReceiveDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteShareReceiveDetails: \(error)" + } } } - open class NoteShareReceiveDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteShareReceiveDetails) -> JSON { + + public class NoteShareReceiveDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteShareReceiveDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteShareReceiveDetails { + + public func deserialize(_ json: JSON) throws -> NoteShareReceiveDetails { switch json { - case .dictionary(_): - return NoteShareReceiveDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return NoteShareReceiveDetails() + default: + throw JSONSerializerError.deserializeError(type: NoteShareReceiveDetails.self, json: json) } } } /// The NoteShareReceiveType struct - open class NoteShareReceiveType: CustomStringConvertible { + public class NoteShareReceiveType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteShareReceiveTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoteShareReceiveTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteShareReceiveTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteShareReceiveType: \(error)" + } } } - open class NoteShareReceiveTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteShareReceiveType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoteShareReceiveTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteShareReceiveType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteShareReceiveType { + + public func deserialize(_ json: JSON) throws -> NoteShareReceiveType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoteShareReceiveType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoteShareReceiveType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoteShareReceiveType.self, json: json) } } } /// Shared Paper doc. - open class NoteSharedDetails: CustomStringConvertible { - public init() { + public class NoteSharedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try NoteSharedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteSharedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteSharedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteSharedDetails: \(error)" + } } } - open class NoteSharedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteSharedDetails) -> JSON { + + public class NoteSharedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteSharedDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteSharedDetails { + + public func deserialize(_ json: JSON) throws -> NoteSharedDetails { switch json { - case .dictionary(_): - return NoteSharedDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return NoteSharedDetails() + default: + throw JSONSerializerError.deserializeError(type: NoteSharedDetails.self, json: json) } } } /// The NoteSharedType struct - open class NoteSharedType: CustomStringConvertible { + public class NoteSharedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NoteSharedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try NoteSharedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NoteSharedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for NoteSharedType: \(error)" + } } } - open class NoteSharedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: NoteSharedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class NoteSharedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: NoteSharedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> NoteSharedType { + + public func deserialize(_ json: JSON) throws -> NoteSharedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return NoteSharedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return NoteSharedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: NoteSharedType.self, json: json) } } } /// Added a label. - open class ObjectLabelAddedDetails: CustomStringConvertible { + public class ObjectLabelAddedDetails: CustomStringConvertible, JSONRepresentable { /// Labels mark a file or folder. public let labelType: TeamLog.LabelType public init(labelType: TeamLog.LabelType) { self.labelType = labelType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ObjectLabelAddedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ObjectLabelAddedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ObjectLabelAddedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ObjectLabelAddedDetails: \(error)" + } } } - open class ObjectLabelAddedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ObjectLabelAddedDetails) -> JSON { - let output = [ - "label_type": TeamLog.LabelTypeSerializer().serialize(value.labelType), + + public class ObjectLabelAddedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ObjectLabelAddedDetails) throws -> JSON { + let output = [ + "label_type": try TeamLog.LabelTypeSerializer().serialize(value.labelType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ObjectLabelAddedDetails { + + public func deserialize(_ json: JSON) throws -> ObjectLabelAddedDetails { switch json { - case .dictionary(let dict): - let labelType = TeamLog.LabelTypeSerializer().deserialize(dict["label_type"] ?? .null) - return ObjectLabelAddedDetails(labelType: labelType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let labelType = try TeamLog.LabelTypeSerializer().deserialize(dict["label_type"] ?? .null) + return ObjectLabelAddedDetails(labelType: labelType) + default: + throw JSONSerializerError.deserializeError(type: ObjectLabelAddedDetails.self, json: json) } } } /// The ObjectLabelAddedType struct - open class ObjectLabelAddedType: CustomStringConvertible { + public class ObjectLabelAddedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ObjectLabelAddedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ObjectLabelAddedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ObjectLabelAddedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ObjectLabelAddedType: \(error)" + } } } - open class ObjectLabelAddedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ObjectLabelAddedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ObjectLabelAddedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ObjectLabelAddedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ObjectLabelAddedType { + + public func deserialize(_ json: JSON) throws -> ObjectLabelAddedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ObjectLabelAddedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ObjectLabelAddedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ObjectLabelAddedType.self, json: json) } } } /// Removed a label. - open class ObjectLabelRemovedDetails: CustomStringConvertible { + public class ObjectLabelRemovedDetails: CustomStringConvertible, JSONRepresentable { /// Labels mark a file or folder. public let labelType: TeamLog.LabelType public init(labelType: TeamLog.LabelType) { self.labelType = labelType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ObjectLabelRemovedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ObjectLabelRemovedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ObjectLabelRemovedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ObjectLabelRemovedDetails: \(error)" + } } } - open class ObjectLabelRemovedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ObjectLabelRemovedDetails) -> JSON { - let output = [ - "label_type": TeamLog.LabelTypeSerializer().serialize(value.labelType), + + public class ObjectLabelRemovedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ObjectLabelRemovedDetails) throws -> JSON { + let output = [ + "label_type": try TeamLog.LabelTypeSerializer().serialize(value.labelType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ObjectLabelRemovedDetails { + + public func deserialize(_ json: JSON) throws -> ObjectLabelRemovedDetails { switch json { - case .dictionary(let dict): - let labelType = TeamLog.LabelTypeSerializer().deserialize(dict["label_type"] ?? .null) - return ObjectLabelRemovedDetails(labelType: labelType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let labelType = try TeamLog.LabelTypeSerializer().deserialize(dict["label_type"] ?? .null) + return ObjectLabelRemovedDetails(labelType: labelType) + default: + throw JSONSerializerError.deserializeError(type: ObjectLabelRemovedDetails.self, json: json) } } } /// The ObjectLabelRemovedType struct - open class ObjectLabelRemovedType: CustomStringConvertible { + public class ObjectLabelRemovedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ObjectLabelRemovedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ObjectLabelRemovedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ObjectLabelRemovedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ObjectLabelRemovedType: \(error)" + } } } - open class ObjectLabelRemovedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ObjectLabelRemovedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ObjectLabelRemovedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ObjectLabelRemovedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ObjectLabelRemovedType { + + public func deserialize(_ json: JSON) throws -> ObjectLabelRemovedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ObjectLabelRemovedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ObjectLabelRemovedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ObjectLabelRemovedType.self, json: json) } } } /// Updated a label's value. - open class ObjectLabelUpdatedValueDetails: CustomStringConvertible { + public class ObjectLabelUpdatedValueDetails: CustomStringConvertible, JSONRepresentable { /// Labels mark a file or folder. public let labelType: TeamLog.LabelType public init(labelType: TeamLog.LabelType) { self.labelType = labelType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ObjectLabelUpdatedValueDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ObjectLabelUpdatedValueDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ObjectLabelUpdatedValueDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ObjectLabelUpdatedValueDetails: \(error)" + } } } - open class ObjectLabelUpdatedValueDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ObjectLabelUpdatedValueDetails) -> JSON { - let output = [ - "label_type": TeamLog.LabelTypeSerializer().serialize(value.labelType), + + public class ObjectLabelUpdatedValueDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ObjectLabelUpdatedValueDetails) throws -> JSON { + let output = [ + "label_type": try TeamLog.LabelTypeSerializer().serialize(value.labelType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ObjectLabelUpdatedValueDetails { + + public func deserialize(_ json: JSON) throws -> ObjectLabelUpdatedValueDetails { switch json { - case .dictionary(let dict): - let labelType = TeamLog.LabelTypeSerializer().deserialize(dict["label_type"] ?? .null) - return ObjectLabelUpdatedValueDetails(labelType: labelType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let labelType = try TeamLog.LabelTypeSerializer().deserialize(dict["label_type"] ?? .null) + return ObjectLabelUpdatedValueDetails(labelType: labelType) + default: + throw JSONSerializerError.deserializeError(type: ObjectLabelUpdatedValueDetails.self, json: json) } } } /// The ObjectLabelUpdatedValueType struct - open class ObjectLabelUpdatedValueType: CustomStringConvertible { + public class ObjectLabelUpdatedValueType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ObjectLabelUpdatedValueTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ObjectLabelUpdatedValueTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ObjectLabelUpdatedValueTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ObjectLabelUpdatedValueType: \(error)" + } } } - open class ObjectLabelUpdatedValueTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ObjectLabelUpdatedValueType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ObjectLabelUpdatedValueTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ObjectLabelUpdatedValueType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ObjectLabelUpdatedValueType { + + public func deserialize(_ json: JSON) throws -> ObjectLabelUpdatedValueType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ObjectLabelUpdatedValueType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ObjectLabelUpdatedValueType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ObjectLabelUpdatedValueType.self, json: json) } } } /// Opened shared Paper doc. - open class OpenNoteSharedDetails: CustomStringConvertible { - public init() { + public class OpenNoteSharedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try OpenNoteSharedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OpenNoteSharedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OpenNoteSharedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OpenNoteSharedDetails: \(error)" + } } } - open class OpenNoteSharedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OpenNoteSharedDetails) -> JSON { + + public class OpenNoteSharedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OpenNoteSharedDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> OpenNoteSharedDetails { + + public func deserialize(_ json: JSON) throws -> OpenNoteSharedDetails { switch json { - case .dictionary(_): - return OpenNoteSharedDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return OpenNoteSharedDetails() + default: + throw JSONSerializerError.deserializeError(type: OpenNoteSharedDetails.self, json: json) } } } /// The OpenNoteSharedType struct - open class OpenNoteSharedType: CustomStringConvertible { + public class OpenNoteSharedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OpenNoteSharedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try OpenNoteSharedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OpenNoteSharedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OpenNoteSharedType: \(error)" + } } } - open class OpenNoteSharedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OpenNoteSharedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class OpenNoteSharedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OpenNoteSharedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OpenNoteSharedType { + + public func deserialize(_ json: JSON) throws -> OpenNoteSharedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return OpenNoteSharedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return OpenNoteSharedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: OpenNoteSharedType.self, json: json) } } } /// More details about the organization. - open class OrganizationDetails: CustomStringConvertible { + public class OrganizationDetails: CustomStringConvertible, JSONRepresentable { /// The name of the organization. public let organization: String public init(organization: String) { stringValidator()(organization) self.organization = organization } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OrganizationDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try OrganizationDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OrganizationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OrganizationDetails: \(error)" + } } } - open class OrganizationDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OrganizationDetails) -> JSON { - let output = [ - "organization": Serialization._StringSerializer.serialize(value.organization), + + public class OrganizationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OrganizationDetails) throws -> JSON { + let output = [ + "organization": try Serialization._StringSerializer.serialize(value.organization), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OrganizationDetails { + + public func deserialize(_ json: JSON) throws -> OrganizationDetails { switch json { - case .dictionary(let dict): - let organization = Serialization._StringSerializer.deserialize(dict["organization"] ?? .null) - return OrganizationDetails(organization: organization) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let organization = try Serialization._StringSerializer.deserialize(dict["organization"] ?? .null) + return OrganizationDetails(organization: organization) + default: + throw JSONSerializerError.deserializeError(type: OrganizationDetails.self, json: json) } } } /// The name of the organization - open class OrganizationName: CustomStringConvertible { + public class OrganizationName: CustomStringConvertible, JSONRepresentable { /// The name of the organization. public let organization: String public init(organization: String) { stringValidator()(organization) self.organization = organization } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OrganizationNameSerializer().serialize(self)))" + + func json() throws -> JSON { + try OrganizationNameSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OrganizationNameSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OrganizationName: \(error)" + } } } - open class OrganizationNameSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OrganizationName) -> JSON { - let output = [ - "organization": Serialization._StringSerializer.serialize(value.organization), + + public class OrganizationNameSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OrganizationName) throws -> JSON { + let output = [ + "organization": try Serialization._StringSerializer.serialize(value.organization), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OrganizationName { + + public func deserialize(_ json: JSON) throws -> OrganizationName { switch json { - case .dictionary(let dict): - let organization = Serialization._StringSerializer.deserialize(dict["organization"] ?? .null) - return OrganizationName(organization: organization) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let organization = try Serialization._StringSerializer.deserialize(dict["organization"] ?? .null) + return OrganizationName(organization: organization) + default: + throw JSONSerializerError.deserializeError(type: OrganizationName.self, json: json) } } } /// Organized a folder with multi-file organize. - open class OrganizeFolderWithTidyDetails: CustomStringConvertible { - public init() { + public class OrganizeFolderWithTidyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try OrganizeFolderWithTidyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OrganizeFolderWithTidyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OrganizeFolderWithTidyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OrganizeFolderWithTidyDetails: \(error)" + } } } - open class OrganizeFolderWithTidyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OrganizeFolderWithTidyDetails) -> JSON { + + public class OrganizeFolderWithTidyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OrganizeFolderWithTidyDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> OrganizeFolderWithTidyDetails { + + public func deserialize(_ json: JSON) throws -> OrganizeFolderWithTidyDetails { switch json { - case .dictionary(_): - return OrganizeFolderWithTidyDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return OrganizeFolderWithTidyDetails() + default: + throw JSONSerializerError.deserializeError(type: OrganizeFolderWithTidyDetails.self, json: json) } } } /// The OrganizeFolderWithTidyType struct - open class OrganizeFolderWithTidyType: CustomStringConvertible { + public class OrganizeFolderWithTidyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OrganizeFolderWithTidyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try OrganizeFolderWithTidyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OrganizeFolderWithTidyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OrganizeFolderWithTidyType: \(error)" + } } } - open class OrganizeFolderWithTidyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OrganizeFolderWithTidyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class OrganizeFolderWithTidyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OrganizeFolderWithTidyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OrganizeFolderWithTidyType { + + public func deserialize(_ json: JSON) throws -> OrganizeFolderWithTidyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return OrganizeFolderWithTidyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return OrganizeFolderWithTidyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: OrganizeFolderWithTidyType.self, json: json) } } } /// The origin from which the actor performed the action. - open class OriginLogInfo: CustomStringConvertible { + public class OriginLogInfo: CustomStringConvertible, JSONRepresentable { /// Geographic location details. public let geoLocation: TeamLog.GeoLocationLogInfo? /// The method that was used to perform the action. @@ -33844,33 +40948,44 @@ open class TeamLog { self.geoLocation = geoLocation self.accessMethod = accessMethod } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OriginLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try OriginLogInfoSerializer().serialize(self) } - } - open class OriginLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OriginLogInfo) -> JSON { - let output = [ - "access_method": TeamLog.AccessMethodLogInfoSerializer().serialize(value.accessMethod), - "geo_location": NullableSerializer(TeamLog.GeoLocationLogInfoSerializer()).serialize(value.geoLocation), - ] + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OriginLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OriginLogInfo: \(error)" + } + } + } + + public class OriginLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OriginLogInfo) throws -> JSON { + let output = [ + "access_method": try TeamLog.AccessMethodLogInfoSerializer().serialize(value.accessMethod), + "geo_location": try NullableSerializer(TeamLog.GeoLocationLogInfoSerializer()).serialize(value.geoLocation), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OriginLogInfo { + + public func deserialize(_ json: JSON) throws -> OriginLogInfo { switch json { - case .dictionary(let dict): - let accessMethod = TeamLog.AccessMethodLogInfoSerializer().deserialize(dict["access_method"] ?? .null) - let geoLocation = NullableSerializer(TeamLog.GeoLocationLogInfoSerializer()).deserialize(dict["geo_location"] ?? .null) - return OriginLogInfo(accessMethod: accessMethod, geoLocation: geoLocation) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accessMethod = try TeamLog.AccessMethodLogInfoSerializer().deserialize(dict["access_method"] ?? .null) + let geoLocation = try NullableSerializer(TeamLog.GeoLocationLogInfoSerializer()).deserialize(dict["geo_location"] ?? .null) + return OriginLogInfo(accessMethod: accessMethod, geoLocation: geoLocation) + default: + throw JSONSerializerError.deserializeError(type: OriginLogInfo.self, json: json) } } } /// Report created: Views of old links. - open class OutdatedLinkViewCreateReportDetails: CustomStringConvertible { + public class OutdatedLinkViewCreateReportDetails: CustomStringConvertible, JSONRepresentable { /// Report start date. public let startDate: Date /// Report end date. @@ -33879,125 +40994,169 @@ open class TeamLog { self.startDate = startDate self.endDate = endDate } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OutdatedLinkViewCreateReportDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try OutdatedLinkViewCreateReportDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OutdatedLinkViewCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OutdatedLinkViewCreateReportDetails: \(error)" + } } } - open class OutdatedLinkViewCreateReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OutdatedLinkViewCreateReportDetails) -> JSON { - let output = [ - "start_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), - "end_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), + + public class OutdatedLinkViewCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OutdatedLinkViewCreateReportDetails) throws -> JSON { + let output = [ + "start_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), + "end_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OutdatedLinkViewCreateReportDetails { + + public func deserialize(_ json: JSON) throws -> OutdatedLinkViewCreateReportDetails { switch json { - case .dictionary(let dict): - let startDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) - let endDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) - return OutdatedLinkViewCreateReportDetails(startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) + let endDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) + return OutdatedLinkViewCreateReportDetails(startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: OutdatedLinkViewCreateReportDetails.self, json: json) } } } /// The OutdatedLinkViewCreateReportType struct - open class OutdatedLinkViewCreateReportType: CustomStringConvertible { + public class OutdatedLinkViewCreateReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OutdatedLinkViewCreateReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try OutdatedLinkViewCreateReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OutdatedLinkViewCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OutdatedLinkViewCreateReportType: \(error)" + } } } - open class OutdatedLinkViewCreateReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OutdatedLinkViewCreateReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class OutdatedLinkViewCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OutdatedLinkViewCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OutdatedLinkViewCreateReportType { + + public func deserialize(_ json: JSON) throws -> OutdatedLinkViewCreateReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return OutdatedLinkViewCreateReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return OutdatedLinkViewCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: OutdatedLinkViewCreateReportType.self, json: json) } } } /// Couldn't create report: Views of old links. - open class OutdatedLinkViewReportFailedDetails: CustomStringConvertible { + public class OutdatedLinkViewReportFailedDetails: CustomStringConvertible, JSONRepresentable { /// Failure reason. public let failureReason: Team.TeamReportFailureReason public init(failureReason: Team.TeamReportFailureReason) { self.failureReason = failureReason } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OutdatedLinkViewReportFailedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try OutdatedLinkViewReportFailedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OutdatedLinkViewReportFailedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OutdatedLinkViewReportFailedDetails: \(error)" + } } } - open class OutdatedLinkViewReportFailedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OutdatedLinkViewReportFailedDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), + + public class OutdatedLinkViewReportFailedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OutdatedLinkViewReportFailedDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OutdatedLinkViewReportFailedDetails { + + public func deserialize(_ json: JSON) throws -> OutdatedLinkViewReportFailedDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return OutdatedLinkViewReportFailedDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return OutdatedLinkViewReportFailedDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: OutdatedLinkViewReportFailedDetails.self, json: json) } } } /// The OutdatedLinkViewReportFailedType struct - open class OutdatedLinkViewReportFailedType: CustomStringConvertible { + public class OutdatedLinkViewReportFailedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OutdatedLinkViewReportFailedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try OutdatedLinkViewReportFailedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OutdatedLinkViewReportFailedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OutdatedLinkViewReportFailedType: \(error)" + } } } - open class OutdatedLinkViewReportFailedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OutdatedLinkViewReportFailedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class OutdatedLinkViewReportFailedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OutdatedLinkViewReportFailedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> OutdatedLinkViewReportFailedType { + + public func deserialize(_ json: JSON) throws -> OutdatedLinkViewReportFailedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return OutdatedLinkViewReportFailedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return OutdatedLinkViewReportFailedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: OutdatedLinkViewReportFailedType.self, json: json) } } } /// The PaperAccessType union - public enum PaperAccessType: CustomStringConvertible { + public enum PaperAccessType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case commenter /// An unspecified error. @@ -34007,111 +41166,140 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PaperAccessTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperAccessTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperAccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperAccessType: \(error)" + } } } - open class PaperAccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperAccessType) -> JSON { + + public class PaperAccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperAccessType) throws -> JSON { switch value { - case .commenter: - var d = [String: JSON]() - d[".tag"] = .str("commenter") - return .dictionary(d) - case .editor: - var d = [String: JSON]() - d[".tag"] = .str("editor") - return .dictionary(d) - case .viewer: - var d = [String: JSON]() - d[".tag"] = .str("viewer") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperAccessType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "commenter": - return PaperAccessType.commenter - case "editor": - return PaperAccessType.editor - case "viewer": - return PaperAccessType.viewer - case "other": - return PaperAccessType.other - default: - return PaperAccessType.other - } - default: - fatalError("Failed to deserialize") + case .commenter: + var d = [String: JSON]() + d[".tag"] = .str("commenter") + return .dictionary(d) + case .editor: + var d = [String: JSON]() + d[".tag"] = .str("editor") + return .dictionary(d) + case .viewer: + var d = [String: JSON]() + d[".tag"] = .str("viewer") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperAccessType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "commenter": + return PaperAccessType.commenter + case "editor": + return PaperAccessType.editor + case "viewer": + return PaperAccessType.viewer + case "other": + return PaperAccessType.other + default: + return PaperAccessType.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperAccessType.self, json: json) } } } /// Exported all team Paper docs. - open class PaperAdminExportStartDetails: CustomStringConvertible { - public init() { + public class PaperAdminExportStartDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try PaperAdminExportStartDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperAdminExportStartDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperAdminExportStartDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperAdminExportStartDetails: \(error)" + } } } - open class PaperAdminExportStartDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperAdminExportStartDetails) -> JSON { + + public class PaperAdminExportStartDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperAdminExportStartDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperAdminExportStartDetails { + + public func deserialize(_ json: JSON) throws -> PaperAdminExportStartDetails { switch json { - case .dictionary(_): - return PaperAdminExportStartDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return PaperAdminExportStartDetails() + default: + throw JSONSerializerError.deserializeError(type: PaperAdminExportStartDetails.self, json: json) } } } /// The PaperAdminExportStartType struct - open class PaperAdminExportStartType: CustomStringConvertible { + public class PaperAdminExportStartType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperAdminExportStartTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperAdminExportStartTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperAdminExportStartTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperAdminExportStartType: \(error)" + } } } - open class PaperAdminExportStartTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperAdminExportStartType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperAdminExportStartTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperAdminExportStartType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperAdminExportStartType { + + public func deserialize(_ json: JSON) throws -> PaperAdminExportStartType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperAdminExportStartType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperAdminExportStartType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperAdminExportStartType.self, json: json) } } } /// Changed whether Dropbox Paper, when enabled, is deployed to all members or to specific members. - open class PaperChangeDeploymentPolicyDetails: CustomStringConvertible { + public class PaperChangeDeploymentPolicyDetails: CustomStringConvertible, JSONRepresentable { /// New Dropbox Paper deployment policy. public let newValue: TeamPolicies.PaperDeploymentPolicy /// Previous Dropbox Paper deployment policy. Might be missing due to historical data gap. @@ -34120,126 +41308,170 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangeDeploymentPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangeDeploymentPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangeDeploymentPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangeDeploymentPolicyDetails: \(error)" + } } } - open class PaperChangeDeploymentPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangeDeploymentPolicyDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.PaperDeploymentPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.PaperDeploymentPolicySerializer()).serialize(value.previousValue), + + public class PaperChangeDeploymentPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangeDeploymentPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.PaperDeploymentPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.PaperDeploymentPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangeDeploymentPolicyDetails { + + public func deserialize(_ json: JSON) throws -> PaperChangeDeploymentPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.PaperDeploymentPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.PaperDeploymentPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return PaperChangeDeploymentPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamPolicies.PaperDeploymentPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.PaperDeploymentPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return PaperChangeDeploymentPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: PaperChangeDeploymentPolicyDetails.self, json: json) } } } /// The PaperChangeDeploymentPolicyType struct - open class PaperChangeDeploymentPolicyType: CustomStringConvertible { + public class PaperChangeDeploymentPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangeDeploymentPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangeDeploymentPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangeDeploymentPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangeDeploymentPolicyType: \(error)" + } } } - open class PaperChangeDeploymentPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangeDeploymentPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperChangeDeploymentPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangeDeploymentPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangeDeploymentPolicyType { + + public func deserialize(_ json: JSON) throws -> PaperChangeDeploymentPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperChangeDeploymentPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperChangeDeploymentPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperChangeDeploymentPolicyType.self, json: json) } } } /// Changed whether non-members can view Paper docs with link. - open class PaperChangeMemberLinkPolicyDetails: CustomStringConvertible { + public class PaperChangeMemberLinkPolicyDetails: CustomStringConvertible, JSONRepresentable { /// New paper external link accessibility policy. public let newValue: TeamLog.PaperMemberPolicy public init(newValue: TeamLog.PaperMemberPolicy) { self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangeMemberLinkPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangeMemberLinkPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangeMemberLinkPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangeMemberLinkPolicyDetails: \(error)" + } } } - open class PaperChangeMemberLinkPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangeMemberLinkPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.PaperMemberPolicySerializer().serialize(value.newValue), + + public class PaperChangeMemberLinkPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangeMemberLinkPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.PaperMemberPolicySerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangeMemberLinkPolicyDetails { + + public func deserialize(_ json: JSON) throws -> PaperChangeMemberLinkPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.PaperMemberPolicySerializer().deserialize(dict["new_value"] ?? .null) - return PaperChangeMemberLinkPolicyDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.PaperMemberPolicySerializer().deserialize(dict["new_value"] ?? .null) + return PaperChangeMemberLinkPolicyDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: PaperChangeMemberLinkPolicyDetails.self, json: json) } } } /// The PaperChangeMemberLinkPolicyType struct - open class PaperChangeMemberLinkPolicyType: CustomStringConvertible { + public class PaperChangeMemberLinkPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangeMemberLinkPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangeMemberLinkPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangeMemberLinkPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangeMemberLinkPolicyType: \(error)" + } } } - open class PaperChangeMemberLinkPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangeMemberLinkPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperChangeMemberLinkPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangeMemberLinkPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangeMemberLinkPolicyType { + + public func deserialize(_ json: JSON) throws -> PaperChangeMemberLinkPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperChangeMemberLinkPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperChangeMemberLinkPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperChangeMemberLinkPolicyType.self, json: json) } } } /// Changed whether members can share Paper docs outside team, and if docs are accessible only by team members or /// anyone by default. - open class PaperChangeMemberPolicyDetails: CustomStringConvertible { + public class PaperChangeMemberPolicyDetails: CustomStringConvertible, JSONRepresentable { /// New paper external accessibility policy. public let newValue: TeamLog.PaperMemberPolicy /// Previous paper external accessibility policy. Might be missing due to historical data gap. @@ -34248,64 +41480,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangeMemberPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangeMemberPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangeMemberPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangeMemberPolicyDetails: \(error)" + } } } - open class PaperChangeMemberPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangeMemberPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.PaperMemberPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.PaperMemberPolicySerializer()).serialize(value.previousValue), + + public class PaperChangeMemberPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangeMemberPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.PaperMemberPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.PaperMemberPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangeMemberPolicyDetails { + + public func deserialize(_ json: JSON) throws -> PaperChangeMemberPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.PaperMemberPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.PaperMemberPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return PaperChangeMemberPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.PaperMemberPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.PaperMemberPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return PaperChangeMemberPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: PaperChangeMemberPolicyDetails.self, json: json) } } } /// The PaperChangeMemberPolicyType struct - open class PaperChangeMemberPolicyType: CustomStringConvertible { + public class PaperChangeMemberPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangeMemberPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangeMemberPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangeMemberPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangeMemberPolicyType: \(error)" + } } } - open class PaperChangeMemberPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangeMemberPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperChangeMemberPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangeMemberPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangeMemberPolicyType { + + public func deserialize(_ json: JSON) throws -> PaperChangeMemberPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperChangeMemberPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperChangeMemberPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperChangeMemberPolicyType.self, json: json) } } } /// Enabled/disabled Dropbox Paper for team. - open class PaperChangePolicyDetails: CustomStringConvertible { + public class PaperChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New Dropbox Paper policy. public let newValue: TeamPolicies.PaperEnabledPolicy /// Previous Dropbox Paper policy. Might be missing due to historical data gap. @@ -34314,126 +41568,170 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangePolicyDetails: \(error)" + } } } - open class PaperChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.PaperEnabledPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.PaperEnabledPolicySerializer()).serialize(value.previousValue), + + public class PaperChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.PaperEnabledPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.PaperEnabledPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> PaperChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.PaperEnabledPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.PaperEnabledPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return PaperChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamPolicies.PaperEnabledPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.PaperEnabledPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return PaperChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: PaperChangePolicyDetails.self, json: json) } } } /// The PaperChangePolicyType struct - open class PaperChangePolicyType: CustomStringConvertible { + public class PaperChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperChangePolicyType: \(error)" + } } } - open class PaperChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperChangePolicyType { + + public func deserialize(_ json: JSON) throws -> PaperChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperChangePolicyType.self, json: json) } } } /// Added users and/or groups to Paper doc/folder. - open class PaperContentAddMemberDetails: CustomStringConvertible { + public class PaperContentAddMemberDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentAddMemberDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentAddMemberDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentAddMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentAddMemberDetails: \(error)" + } } } - open class PaperContentAddMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentAddMemberDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperContentAddMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentAddMemberDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentAddMemberDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentAddMemberDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperContentAddMemberDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperContentAddMemberDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperContentAddMemberDetails.self, json: json) } } } /// The PaperContentAddMemberType struct - open class PaperContentAddMemberType: CustomStringConvertible { + public class PaperContentAddMemberType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentAddMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentAddMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentAddMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentAddMemberType: \(error)" + } } } - open class PaperContentAddMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentAddMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentAddMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentAddMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentAddMemberType { + + public func deserialize(_ json: JSON) throws -> PaperContentAddMemberType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentAddMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentAddMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentAddMemberType.self, json: json) } } } /// Added Paper doc/folder to folder. - open class PaperContentAddToFolderDetails: CustomStringConvertible { + public class PaperContentAddToFolderDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Target asset position in the Assets list. @@ -34448,252 +41746,340 @@ open class TeamLog { comparableValidator()(parentAssetIndex) self.parentAssetIndex = parentAssetIndex } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentAddToFolderDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentAddToFolderDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentAddToFolderDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentAddToFolderDetails: \(error)" + } } } - open class PaperContentAddToFolderDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentAddToFolderDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "parent_asset_index": Serialization._UInt64Serializer.serialize(value.parentAssetIndex), + + public class PaperContentAddToFolderDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentAddToFolderDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "parent_asset_index": try Serialization._UInt64Serializer.serialize(value.parentAssetIndex), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentAddToFolderDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentAddToFolderDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let parentAssetIndex = Serialization._UInt64Serializer.deserialize(dict["parent_asset_index"] ?? .null) - return PaperContentAddToFolderDetails(eventUuid: eventUuid, targetAssetIndex: targetAssetIndex, parentAssetIndex: parentAssetIndex) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let parentAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["parent_asset_index"] ?? .null) + return PaperContentAddToFolderDetails(eventUuid: eventUuid, targetAssetIndex: targetAssetIndex, parentAssetIndex: parentAssetIndex) + default: + throw JSONSerializerError.deserializeError(type: PaperContentAddToFolderDetails.self, json: json) } } } /// The PaperContentAddToFolderType struct - open class PaperContentAddToFolderType: CustomStringConvertible { + public class PaperContentAddToFolderType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentAddToFolderTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentAddToFolderTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentAddToFolderTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentAddToFolderType: \(error)" + } } } - open class PaperContentAddToFolderTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentAddToFolderType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentAddToFolderTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentAddToFolderType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentAddToFolderType { + + public func deserialize(_ json: JSON) throws -> PaperContentAddToFolderType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentAddToFolderType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentAddToFolderType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentAddToFolderType.self, json: json) } } } /// Archived Paper doc/folder. - open class PaperContentArchiveDetails: CustomStringConvertible { + public class PaperContentArchiveDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentArchiveDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentArchiveDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentArchiveDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentArchiveDetails: \(error)" + } } } - open class PaperContentArchiveDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentArchiveDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperContentArchiveDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentArchiveDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentArchiveDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentArchiveDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperContentArchiveDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperContentArchiveDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperContentArchiveDetails.self, json: json) } } } /// The PaperContentArchiveType struct - open class PaperContentArchiveType: CustomStringConvertible { + public class PaperContentArchiveType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentArchiveTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentArchiveTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentArchiveTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentArchiveType: \(error)" + } } } - open class PaperContentArchiveTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentArchiveType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentArchiveTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentArchiveType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentArchiveType { + + public func deserialize(_ json: JSON) throws -> PaperContentArchiveType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentArchiveType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentArchiveType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentArchiveType.self, json: json) } } } /// Created Paper doc/folder. - open class PaperContentCreateDetails: CustomStringConvertible { + public class PaperContentCreateDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentCreateDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentCreateDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentCreateDetails: \(error)" + } } } - open class PaperContentCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentCreateDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperContentCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentCreateDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentCreateDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentCreateDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperContentCreateDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperContentCreateDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperContentCreateDetails.self, json: json) } } } /// The PaperContentCreateType struct - open class PaperContentCreateType: CustomStringConvertible { + public class PaperContentCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentCreateType: \(error)" + } } } - open class PaperContentCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentCreateType { + + public func deserialize(_ json: JSON) throws -> PaperContentCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentCreateType.self, json: json) } } } /// Permanently deleted Paper doc/folder. - open class PaperContentPermanentlyDeleteDetails: CustomStringConvertible { + public class PaperContentPermanentlyDeleteDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentPermanentlyDeleteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentPermanentlyDeleteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentPermanentlyDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentPermanentlyDeleteDetails: \(error)" + } } } - open class PaperContentPermanentlyDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentPermanentlyDeleteDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperContentPermanentlyDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentPermanentlyDeleteDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentPermanentlyDeleteDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentPermanentlyDeleteDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperContentPermanentlyDeleteDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperContentPermanentlyDeleteDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperContentPermanentlyDeleteDetails.self, json: json) } } } /// The PaperContentPermanentlyDeleteType struct - open class PaperContentPermanentlyDeleteType: CustomStringConvertible { + public class PaperContentPermanentlyDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentPermanentlyDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentPermanentlyDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentPermanentlyDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentPermanentlyDeleteType: \(error)" + } } } - open class PaperContentPermanentlyDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentPermanentlyDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentPermanentlyDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentPermanentlyDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentPermanentlyDeleteType { + + public func deserialize(_ json: JSON) throws -> PaperContentPermanentlyDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentPermanentlyDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentPermanentlyDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentPermanentlyDeleteType.self, json: json) } } } /// Removed Paper doc/folder from folder. - open class PaperContentRemoveFromFolderDetails: CustomStringConvertible { + public class PaperContentRemoveFromFolderDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Target asset position in the Assets list. @@ -34708,252 +42094,340 @@ open class TeamLog { nullableValidator(comparableValidator())(parentAssetIndex) self.parentAssetIndex = parentAssetIndex } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRemoveFromFolderDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRemoveFromFolderDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRemoveFromFolderDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRemoveFromFolderDetails: \(error)" + } } } - open class PaperContentRemoveFromFolderDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRemoveFromFolderDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "target_asset_index": NullableSerializer(Serialization._UInt64Serializer).serialize(value.targetAssetIndex), - "parent_asset_index": NullableSerializer(Serialization._UInt64Serializer).serialize(value.parentAssetIndex), + + public class PaperContentRemoveFromFolderDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRemoveFromFolderDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "target_asset_index": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.targetAssetIndex), + "parent_asset_index": try NullableSerializer(Serialization._UInt64Serializer).serialize(value.parentAssetIndex), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRemoveFromFolderDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentRemoveFromFolderDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let targetAssetIndex = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["target_asset_index"] ?? .null) - let parentAssetIndex = NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["parent_asset_index"] ?? .null) - return PaperContentRemoveFromFolderDetails(eventUuid: eventUuid, targetAssetIndex: targetAssetIndex, parentAssetIndex: parentAssetIndex) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let targetAssetIndex = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["target_asset_index"] ?? .null) + let parentAssetIndex = try NullableSerializer(Serialization._UInt64Serializer).deserialize(dict["parent_asset_index"] ?? .null) + return PaperContentRemoveFromFolderDetails(eventUuid: eventUuid, targetAssetIndex: targetAssetIndex, parentAssetIndex: parentAssetIndex) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRemoveFromFolderDetails.self, json: json) } } } /// The PaperContentRemoveFromFolderType struct - open class PaperContentRemoveFromFolderType: CustomStringConvertible { + public class PaperContentRemoveFromFolderType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRemoveFromFolderTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRemoveFromFolderTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRemoveFromFolderTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRemoveFromFolderType: \(error)" + } } } - open class PaperContentRemoveFromFolderTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRemoveFromFolderType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentRemoveFromFolderTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRemoveFromFolderType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRemoveFromFolderType { + + public func deserialize(_ json: JSON) throws -> PaperContentRemoveFromFolderType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentRemoveFromFolderType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentRemoveFromFolderType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRemoveFromFolderType.self, json: json) } } } /// Removed users and/or groups from Paper doc/folder. - open class PaperContentRemoveMemberDetails: CustomStringConvertible { + public class PaperContentRemoveMemberDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRemoveMemberDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRemoveMemberDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRemoveMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRemoveMemberDetails: \(error)" + } } } - open class PaperContentRemoveMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRemoveMemberDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperContentRemoveMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRemoveMemberDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRemoveMemberDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentRemoveMemberDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperContentRemoveMemberDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperContentRemoveMemberDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRemoveMemberDetails.self, json: json) } } } /// The PaperContentRemoveMemberType struct - open class PaperContentRemoveMemberType: CustomStringConvertible { + public class PaperContentRemoveMemberType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRemoveMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRemoveMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRemoveMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRemoveMemberType: \(error)" + } } } - open class PaperContentRemoveMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRemoveMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentRemoveMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRemoveMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRemoveMemberType { + + public func deserialize(_ json: JSON) throws -> PaperContentRemoveMemberType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentRemoveMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentRemoveMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRemoveMemberType.self, json: json) } } } /// Renamed Paper doc/folder. - open class PaperContentRenameDetails: CustomStringConvertible { + public class PaperContentRenameDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRenameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRenameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRenameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRenameDetails: \(error)" + } } } - open class PaperContentRenameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRenameDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperContentRenameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRenameDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRenameDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentRenameDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperContentRenameDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperContentRenameDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRenameDetails.self, json: json) } } } /// The PaperContentRenameType struct - open class PaperContentRenameType: CustomStringConvertible { + public class PaperContentRenameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRenameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRenameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRenameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRenameType: \(error)" + } } } - open class PaperContentRenameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRenameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentRenameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRenameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRenameType { + + public func deserialize(_ json: JSON) throws -> PaperContentRenameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentRenameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentRenameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRenameType.self, json: json) } } } /// Restored archived Paper doc/folder. - open class PaperContentRestoreDetails: CustomStringConvertible { + public class PaperContentRestoreDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRestoreDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRestoreDetailsSerializer().serialize(self) } - } - open class PaperContentRestoreDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRestoreDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - ] - return .dictionary(output) + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRestoreDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRestoreDetails: \(error)" + } + } + } + + public class PaperContentRestoreDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRestoreDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + ] + return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRestoreDetails { + + public func deserialize(_ json: JSON) throws -> PaperContentRestoreDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperContentRestoreDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperContentRestoreDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRestoreDetails.self, json: json) } } } /// The PaperContentRestoreType struct - open class PaperContentRestoreType: CustomStringConvertible { + public class PaperContentRestoreType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperContentRestoreTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperContentRestoreTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperContentRestoreTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperContentRestoreType: \(error)" + } } } - open class PaperContentRestoreTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperContentRestoreType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperContentRestoreTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperContentRestoreType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperContentRestoreType { + + public func deserialize(_ json: JSON) throws -> PaperContentRestoreType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperContentRestoreType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperContentRestoreType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperContentRestoreType.self, json: json) } } } /// Policy to set default access for newly created Paper folders. - public enum PaperDefaultFolderPolicy: CustomStringConvertible { + public enum PaperDefaultFolderPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case everyoneInTeam /// An unspecified error. @@ -34961,50 +42435,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDefaultFolderPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDefaultFolderPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDefaultFolderPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDefaultFolderPolicy: \(error)" + } } } - open class PaperDefaultFolderPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDefaultFolderPolicy) -> JSON { + + public class PaperDefaultFolderPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDefaultFolderPolicy) throws -> JSON { switch value { - case .everyoneInTeam: - var d = [String: JSON]() - d[".tag"] = .str("everyone_in_team") - return .dictionary(d) - case .inviteOnly: - var d = [String: JSON]() - d[".tag"] = .str("invite_only") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDefaultFolderPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "everyone_in_team": - return PaperDefaultFolderPolicy.everyoneInTeam - case "invite_only": - return PaperDefaultFolderPolicy.inviteOnly - case "other": - return PaperDefaultFolderPolicy.other - default: - return PaperDefaultFolderPolicy.other - } + case .everyoneInTeam: + var d = [String: JSON]() + d[".tag"] = .str("everyone_in_team") + return .dictionary(d) + case .inviteOnly: + var d = [String: JSON]() + d[".tag"] = .str("invite_only") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDefaultFolderPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "everyone_in_team": + return PaperDefaultFolderPolicy.everyoneInTeam + case "invite_only": + return PaperDefaultFolderPolicy.inviteOnly + case "other": + return PaperDefaultFolderPolicy.other default: - fatalError("Failed to deserialize") + return PaperDefaultFolderPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDefaultFolderPolicy.self, json: json) } } } /// Changed Paper Default Folder Policy setting for team. - open class PaperDefaultFolderPolicyChangedDetails: CustomStringConvertible { + public class PaperDefaultFolderPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New Paper Default Folder Policy. public let newValue: TeamLog.PaperDefaultFolderPolicy /// Previous Paper Default Folder Policy. @@ -35013,64 +42497,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDefaultFolderPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDefaultFolderPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDefaultFolderPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDefaultFolderPolicyChangedDetails: \(error)" + } } } - open class PaperDefaultFolderPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDefaultFolderPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.PaperDefaultFolderPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.PaperDefaultFolderPolicySerializer().serialize(value.previousValue), + + public class PaperDefaultFolderPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDefaultFolderPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.PaperDefaultFolderPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.PaperDefaultFolderPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDefaultFolderPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> PaperDefaultFolderPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.PaperDefaultFolderPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.PaperDefaultFolderPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return PaperDefaultFolderPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.PaperDefaultFolderPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.PaperDefaultFolderPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return PaperDefaultFolderPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: PaperDefaultFolderPolicyChangedDetails.self, json: json) } } } /// The PaperDefaultFolderPolicyChangedType struct - open class PaperDefaultFolderPolicyChangedType: CustomStringConvertible { + public class PaperDefaultFolderPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDefaultFolderPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDefaultFolderPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDefaultFolderPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDefaultFolderPolicyChangedType: \(error)" + } } } - open class PaperDefaultFolderPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDefaultFolderPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDefaultFolderPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDefaultFolderPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDefaultFolderPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> PaperDefaultFolderPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDefaultFolderPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDefaultFolderPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDefaultFolderPolicyChangedType.self, json: json) } } } /// Policy for controlling if team members can use Paper Desktop - public enum PaperDesktopPolicy: CustomStringConvertible { + public enum PaperDesktopPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -35078,50 +42584,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDesktopPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDesktopPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDesktopPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDesktopPolicy: \(error)" + } } } - open class PaperDesktopPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDesktopPolicy) -> JSON { + + public class PaperDesktopPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDesktopPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDesktopPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return PaperDesktopPolicy.disabled - case "enabled": - return PaperDesktopPolicy.enabled - case "other": - return PaperDesktopPolicy.other - default: - return PaperDesktopPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDesktopPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return PaperDesktopPolicy.disabled + case "enabled": + return PaperDesktopPolicy.enabled + case "other": + return PaperDesktopPolicy.other default: - fatalError("Failed to deserialize") + return PaperDesktopPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDesktopPolicy.self, json: json) } } } /// Enabled/disabled Paper Desktop for team. - open class PaperDesktopPolicyChangedDetails: CustomStringConvertible { + public class PaperDesktopPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New Paper Desktop policy. public let newValue: TeamLog.PaperDesktopPolicy /// Previous Paper Desktop policy. @@ -35130,64 +42646,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDesktopPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDesktopPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDesktopPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDesktopPolicyChangedDetails: \(error)" + } } } - open class PaperDesktopPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDesktopPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.PaperDesktopPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.PaperDesktopPolicySerializer().serialize(value.previousValue), + + public class PaperDesktopPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDesktopPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.PaperDesktopPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.PaperDesktopPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDesktopPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> PaperDesktopPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.PaperDesktopPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.PaperDesktopPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return PaperDesktopPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.PaperDesktopPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.PaperDesktopPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return PaperDesktopPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: PaperDesktopPolicyChangedDetails.self, json: json) } } } /// The PaperDesktopPolicyChangedType struct - open class PaperDesktopPolicyChangedType: CustomStringConvertible { + public class PaperDesktopPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDesktopPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDesktopPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDesktopPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDesktopPolicyChangedType: \(error)" + } } } - open class PaperDesktopPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDesktopPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDesktopPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDesktopPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDesktopPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> PaperDesktopPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDesktopPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDesktopPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDesktopPolicyChangedType.self, json: json) } } } /// Added Paper doc comment. - open class PaperDocAddCommentDetails: CustomStringConvertible { + public class PaperDocAddCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Comment text. @@ -35198,64 +42736,86 @@ open class TeamLog { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocAddCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocAddCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocAddCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocAddCommentDetails: \(error)" + } } } - open class PaperDocAddCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocAddCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class PaperDocAddCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocAddCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocAddCommentDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocAddCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return PaperDocAddCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return PaperDocAddCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: PaperDocAddCommentDetails.self, json: json) } } } /// The PaperDocAddCommentType struct - open class PaperDocAddCommentType: CustomStringConvertible { + public class PaperDocAddCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocAddCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocAddCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocAddCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocAddCommentType: \(error)" + } } } - open class PaperDocAddCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocAddCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocAddCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocAddCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocAddCommentType { + + public func deserialize(_ json: JSON) throws -> PaperDocAddCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocAddCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocAddCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocAddCommentType.self, json: json) } } } /// Changed member permissions for Paper doc. - open class PaperDocChangeMemberRoleDetails: CustomStringConvertible { + public class PaperDocChangeMemberRoleDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Paper doc access type. @@ -35265,64 +42825,86 @@ open class TeamLog { self.eventUuid = eventUuid self.accessType = accessType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocChangeMemberRoleDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocChangeMemberRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocChangeMemberRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocChangeMemberRoleDetails: \(error)" + } } } - open class PaperDocChangeMemberRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocChangeMemberRoleDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "access_type": TeamLog.PaperAccessTypeSerializer().serialize(value.accessType), + + public class PaperDocChangeMemberRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocChangeMemberRoleDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "access_type": try TeamLog.PaperAccessTypeSerializer().serialize(value.accessType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocChangeMemberRoleDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocChangeMemberRoleDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let accessType = TeamLog.PaperAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) - return PaperDocChangeMemberRoleDetails(eventUuid: eventUuid, accessType: accessType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let accessType = try TeamLog.PaperAccessTypeSerializer().deserialize(dict["access_type"] ?? .null) + return PaperDocChangeMemberRoleDetails(eventUuid: eventUuid, accessType: accessType) + default: + throw JSONSerializerError.deserializeError(type: PaperDocChangeMemberRoleDetails.self, json: json) } } } /// The PaperDocChangeMemberRoleType struct - open class PaperDocChangeMemberRoleType: CustomStringConvertible { + public class PaperDocChangeMemberRoleType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocChangeMemberRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocChangeMemberRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocChangeMemberRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocChangeMemberRoleType: \(error)" + } } } - open class PaperDocChangeMemberRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocChangeMemberRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocChangeMemberRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocChangeMemberRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocChangeMemberRoleType { + + public func deserialize(_ json: JSON) throws -> PaperDocChangeMemberRoleType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocChangeMemberRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocChangeMemberRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocChangeMemberRoleType.self, json: json) } } } /// Changed sharing setting for Paper doc. - open class PaperDocChangeSharingPolicyDetails: CustomStringConvertible { + public class PaperDocChangeSharingPolicyDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Sharing policy with external users. @@ -35337,66 +42919,92 @@ open class TeamLog { nullableValidator(stringValidator())(teamSharingPolicy) self.teamSharingPolicy = teamSharingPolicy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocChangeSharingPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocChangeSharingPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocChangeSharingPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocChangeSharingPolicyDetails: \(error)" + } } } - open class PaperDocChangeSharingPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocChangeSharingPolicyDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "public_sharing_policy": NullableSerializer(Serialization._StringSerializer).serialize(value.publicSharingPolicy), - "team_sharing_policy": NullableSerializer(Serialization._StringSerializer).serialize(value.teamSharingPolicy), + + public class PaperDocChangeSharingPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocChangeSharingPolicyDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "public_sharing_policy": try NullableSerializer(Serialization._StringSerializer).serialize(value.publicSharingPolicy), + "team_sharing_policy": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamSharingPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocChangeSharingPolicyDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocChangeSharingPolicyDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let publicSharingPolicy = NullableSerializer(Serialization._StringSerializer).deserialize(dict["public_sharing_policy"] ?? .null) - let teamSharingPolicy = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_sharing_policy"] ?? .null) - return PaperDocChangeSharingPolicyDetails(eventUuid: eventUuid, publicSharingPolicy: publicSharingPolicy, teamSharingPolicy: teamSharingPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let publicSharingPolicy = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["public_sharing_policy"] ?? .null) + let teamSharingPolicy = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_sharing_policy"] ?? .null) + return PaperDocChangeSharingPolicyDetails( + eventUuid: eventUuid, + publicSharingPolicy: publicSharingPolicy, + teamSharingPolicy: teamSharingPolicy + ) + default: + throw JSONSerializerError.deserializeError(type: PaperDocChangeSharingPolicyDetails.self, json: json) } } } /// The PaperDocChangeSharingPolicyType struct - open class PaperDocChangeSharingPolicyType: CustomStringConvertible { + public class PaperDocChangeSharingPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocChangeSharingPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocChangeSharingPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocChangeSharingPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocChangeSharingPolicyType: \(error)" + } } } - open class PaperDocChangeSharingPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocChangeSharingPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocChangeSharingPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocChangeSharingPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocChangeSharingPolicyType { + + public func deserialize(_ json: JSON) throws -> PaperDocChangeSharingPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocChangeSharingPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocChangeSharingPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocChangeSharingPolicyType.self, json: json) } } } /// Followed/unfollowed Paper doc. - open class PaperDocChangeSubscriptionDetails: CustomStringConvertible { + public class PaperDocChangeSubscriptionDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// New doc subscription level. @@ -35411,66 +43019,93 @@ open class TeamLog { nullableValidator(stringValidator())(previousSubscriptionLevel) self.previousSubscriptionLevel = previousSubscriptionLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocChangeSubscriptionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocChangeSubscriptionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocChangeSubscriptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocChangeSubscriptionDetails: \(error)" + } } } - open class PaperDocChangeSubscriptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocChangeSubscriptionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "new_subscription_level": Serialization._StringSerializer.serialize(value.newSubscriptionLevel), - "previous_subscription_level": NullableSerializer(Serialization._StringSerializer).serialize(value.previousSubscriptionLevel), + + public class PaperDocChangeSubscriptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocChangeSubscriptionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "new_subscription_level": try Serialization._StringSerializer.serialize(value.newSubscriptionLevel), + "previous_subscription_level": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousSubscriptionLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocChangeSubscriptionDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocChangeSubscriptionDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let newSubscriptionLevel = Serialization._StringSerializer.deserialize(dict["new_subscription_level"] ?? .null) - let previousSubscriptionLevel = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_subscription_level"] ?? .null) - return PaperDocChangeSubscriptionDetails(eventUuid: eventUuid, newSubscriptionLevel: newSubscriptionLevel, previousSubscriptionLevel: previousSubscriptionLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let newSubscriptionLevel = try Serialization._StringSerializer.deserialize(dict["new_subscription_level"] ?? .null) + let previousSubscriptionLevel = try NullableSerializer(Serialization._StringSerializer) + .deserialize(dict["previous_subscription_level"] ?? .null) + return PaperDocChangeSubscriptionDetails( + eventUuid: eventUuid, + newSubscriptionLevel: newSubscriptionLevel, + previousSubscriptionLevel: previousSubscriptionLevel + ) + default: + throw JSONSerializerError.deserializeError(type: PaperDocChangeSubscriptionDetails.self, json: json) } } } /// The PaperDocChangeSubscriptionType struct - open class PaperDocChangeSubscriptionType: CustomStringConvertible { + public class PaperDocChangeSubscriptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocChangeSubscriptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocChangeSubscriptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocChangeSubscriptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocChangeSubscriptionType: \(error)" + } } } - open class PaperDocChangeSubscriptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocChangeSubscriptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocChangeSubscriptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocChangeSubscriptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocChangeSubscriptionType { + + public func deserialize(_ json: JSON) throws -> PaperDocChangeSubscriptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocChangeSubscriptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocChangeSubscriptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocChangeSubscriptionType.self, json: json) } } } /// Deleted Paper doc comment. - open class PaperDocDeleteCommentDetails: CustomStringConvertible { + public class PaperDocDeleteCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Comment text. @@ -35481,126 +43116,170 @@ open class TeamLog { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocDeleteCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocDeleteCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocDeleteCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocDeleteCommentDetails: \(error)" + } } } - open class PaperDocDeleteCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocDeleteCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class PaperDocDeleteCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocDeleteCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocDeleteCommentDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocDeleteCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return PaperDocDeleteCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return PaperDocDeleteCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: PaperDocDeleteCommentDetails.self, json: json) } } } /// The PaperDocDeleteCommentType struct - open class PaperDocDeleteCommentType: CustomStringConvertible { + public class PaperDocDeleteCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocDeleteCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocDeleteCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocDeleteCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocDeleteCommentType: \(error)" + } } } - open class PaperDocDeleteCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocDeleteCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocDeleteCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocDeleteCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocDeleteCommentType { + + public func deserialize(_ json: JSON) throws -> PaperDocDeleteCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocDeleteCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocDeleteCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocDeleteCommentType.self, json: json) } } } /// Archived Paper doc. - open class PaperDocDeletedDetails: CustomStringConvertible { + public class PaperDocDeletedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocDeletedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocDeletedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocDeletedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocDeletedDetails: \(error)" + } } } - open class PaperDocDeletedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocDeletedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocDeletedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocDeletedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocDeletedDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocDeletedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocDeletedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocDeletedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocDeletedDetails.self, json: json) } } } /// The PaperDocDeletedType struct - open class PaperDocDeletedType: CustomStringConvertible { + public class PaperDocDeletedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocDeletedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocDeletedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocDeletedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocDeletedType: \(error)" + } } } - open class PaperDocDeletedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocDeletedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocDeletedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocDeletedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocDeletedType { + + public func deserialize(_ json: JSON) throws -> PaperDocDeletedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocDeletedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocDeletedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocDeletedType.self, json: json) } } } /// Downloaded Paper doc in specific format. - open class PaperDocDownloadDetails: CustomStringConvertible { + public class PaperDocDownloadDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Export file format. @@ -35610,64 +43289,86 @@ open class TeamLog { self.eventUuid = eventUuid self.exportFileFormat = exportFileFormat } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocDownloadDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocDownloadDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocDownloadDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocDownloadDetails: \(error)" + } } } - open class PaperDocDownloadDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocDownloadDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "export_file_format": TeamLog.PaperDownloadFormatSerializer().serialize(value.exportFileFormat), + + public class PaperDocDownloadDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocDownloadDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "export_file_format": try TeamLog.PaperDownloadFormatSerializer().serialize(value.exportFileFormat), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocDownloadDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocDownloadDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let exportFileFormat = TeamLog.PaperDownloadFormatSerializer().deserialize(dict["export_file_format"] ?? .null) - return PaperDocDownloadDetails(eventUuid: eventUuid, exportFileFormat: exportFileFormat) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let exportFileFormat = try TeamLog.PaperDownloadFormatSerializer().deserialize(dict["export_file_format"] ?? .null) + return PaperDocDownloadDetails(eventUuid: eventUuid, exportFileFormat: exportFileFormat) + default: + throw JSONSerializerError.deserializeError(type: PaperDocDownloadDetails.self, json: json) } } } /// The PaperDocDownloadType struct - open class PaperDocDownloadType: CustomStringConvertible { + public class PaperDocDownloadType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocDownloadTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocDownloadTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocDownloadTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocDownloadType: \(error)" + } } } - open class PaperDocDownloadTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocDownloadType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocDownloadTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocDownloadType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocDownloadType { + + public func deserialize(_ json: JSON) throws -> PaperDocDownloadType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocDownloadType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocDownloadType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocDownloadType.self, json: json) } } } /// Edited Paper doc comment. - open class PaperDocEditCommentDetails: CustomStringConvertible { + public class PaperDocEditCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Comment text. @@ -35678,250 +43379,338 @@ open class TeamLog { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocEditCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocEditCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocEditCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocEditCommentDetails: \(error)" + } } } - open class PaperDocEditCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocEditCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class PaperDocEditCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocEditCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocEditCommentDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocEditCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return PaperDocEditCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return PaperDocEditCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: PaperDocEditCommentDetails.self, json: json) } } } /// The PaperDocEditCommentType struct - open class PaperDocEditCommentType: CustomStringConvertible { + public class PaperDocEditCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocEditCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocEditCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocEditCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocEditCommentType: \(error)" + } } } - open class PaperDocEditCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocEditCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocEditCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocEditCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocEditCommentType { + + public func deserialize(_ json: JSON) throws -> PaperDocEditCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocEditCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocEditCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocEditCommentType.self, json: json) } } } /// Edited Paper doc. - open class PaperDocEditDetails: CustomStringConvertible { + public class PaperDocEditDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocEditDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocEditDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocEditDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocEditDetails: \(error)" + } } } - open class PaperDocEditDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocEditDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocEditDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocEditDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocEditDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocEditDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocEditDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocEditDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocEditDetails.self, json: json) } } } /// The PaperDocEditType struct - open class PaperDocEditType: CustomStringConvertible { + public class PaperDocEditType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocEditTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocEditTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocEditTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocEditType: \(error)" + } } } - open class PaperDocEditTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocEditType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocEditTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocEditType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocEditType { + + public func deserialize(_ json: JSON) throws -> PaperDocEditType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocEditType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocEditType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocEditType.self, json: json) } } } /// Followed Paper doc. - open class PaperDocFollowedDetails: CustomStringConvertible { + public class PaperDocFollowedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocFollowedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocFollowedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocFollowedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocFollowedDetails: \(error)" + } } } - open class PaperDocFollowedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocFollowedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocFollowedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocFollowedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocFollowedDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocFollowedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocFollowedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocFollowedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocFollowedDetails.self, json: json) } } } /// The PaperDocFollowedType struct - open class PaperDocFollowedType: CustomStringConvertible { + public class PaperDocFollowedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocFollowedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocFollowedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocFollowedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocFollowedType: \(error)" + } } } - open class PaperDocFollowedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocFollowedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocFollowedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocFollowedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocFollowedType { + + public func deserialize(_ json: JSON) throws -> PaperDocFollowedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocFollowedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocFollowedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocFollowedType.self, json: json) } } } /// Mentioned user in Paper doc. - open class PaperDocMentionDetails: CustomStringConvertible { + public class PaperDocMentionDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocMentionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocMentionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocMentionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocMentionDetails: \(error)" + } } } - open class PaperDocMentionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocMentionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocMentionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocMentionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocMentionDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocMentionDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocMentionDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocMentionDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocMentionDetails.self, json: json) } } } /// The PaperDocMentionType struct - open class PaperDocMentionType: CustomStringConvertible { + public class PaperDocMentionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocMentionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocMentionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocMentionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocMentionType: \(error)" + } } } - open class PaperDocMentionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocMentionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocMentionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocMentionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocMentionType { + + public func deserialize(_ json: JSON) throws -> PaperDocMentionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocMentionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocMentionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocMentionType.self, json: json) } } } /// Transferred ownership of Paper doc. - open class PaperDocOwnershipChangedDetails: CustomStringConvertible { + public class PaperDocOwnershipChangedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Previous owner. @@ -35936,128 +43725,172 @@ open class TeamLog { stringValidator(minLength: 40, maxLength: 40)(newOwnerUserId) self.newOwnerUserId = newOwnerUserId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocOwnershipChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocOwnershipChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocOwnershipChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocOwnershipChangedDetails: \(error)" + } } } - open class PaperDocOwnershipChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocOwnershipChangedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "new_owner_user_id": Serialization._StringSerializer.serialize(value.newOwnerUserId), - "old_owner_user_id": NullableSerializer(Serialization._StringSerializer).serialize(value.oldOwnerUserId), + + public class PaperDocOwnershipChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocOwnershipChangedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "new_owner_user_id": try Serialization._StringSerializer.serialize(value.newOwnerUserId), + "old_owner_user_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.oldOwnerUserId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocOwnershipChangedDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocOwnershipChangedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let newOwnerUserId = Serialization._StringSerializer.deserialize(dict["new_owner_user_id"] ?? .null) - let oldOwnerUserId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["old_owner_user_id"] ?? .null) - return PaperDocOwnershipChangedDetails(eventUuid: eventUuid, newOwnerUserId: newOwnerUserId, oldOwnerUserId: oldOwnerUserId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let newOwnerUserId = try Serialization._StringSerializer.deserialize(dict["new_owner_user_id"] ?? .null) + let oldOwnerUserId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["old_owner_user_id"] ?? .null) + return PaperDocOwnershipChangedDetails(eventUuid: eventUuid, newOwnerUserId: newOwnerUserId, oldOwnerUserId: oldOwnerUserId) + default: + throw JSONSerializerError.deserializeError(type: PaperDocOwnershipChangedDetails.self, json: json) } } } /// The PaperDocOwnershipChangedType struct - open class PaperDocOwnershipChangedType: CustomStringConvertible { + public class PaperDocOwnershipChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocOwnershipChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocOwnershipChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocOwnershipChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocOwnershipChangedType: \(error)" + } } } - open class PaperDocOwnershipChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocOwnershipChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocOwnershipChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocOwnershipChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocOwnershipChangedType { + + public func deserialize(_ json: JSON) throws -> PaperDocOwnershipChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocOwnershipChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocOwnershipChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocOwnershipChangedType.self, json: json) } } } /// Requested access to Paper doc. - open class PaperDocRequestAccessDetails: CustomStringConvertible { + public class PaperDocRequestAccessDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocRequestAccessDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocRequestAccessDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocRequestAccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocRequestAccessDetails: \(error)" + } } } - open class PaperDocRequestAccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocRequestAccessDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocRequestAccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocRequestAccessDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocRequestAccessDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocRequestAccessDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocRequestAccessDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocRequestAccessDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocRequestAccessDetails.self, json: json) } } } /// The PaperDocRequestAccessType struct - open class PaperDocRequestAccessType: CustomStringConvertible { + public class PaperDocRequestAccessType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocRequestAccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocRequestAccessTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocRequestAccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocRequestAccessType: \(error)" + } } } - open class PaperDocRequestAccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocRequestAccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocRequestAccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocRequestAccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocRequestAccessType { + + public func deserialize(_ json: JSON) throws -> PaperDocRequestAccessType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocRequestAccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocRequestAccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocRequestAccessType.self, json: json) } } } /// Resolved Paper doc comment. - open class PaperDocResolveCommentDetails: CustomStringConvertible { + public class PaperDocResolveCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Comment text. @@ -36068,312 +43901,422 @@ open class TeamLog { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocResolveCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocResolveCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocResolveCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocResolveCommentDetails: \(error)" + } } } - open class PaperDocResolveCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocResolveCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class PaperDocResolveCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocResolveCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocResolveCommentDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocResolveCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return PaperDocResolveCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return PaperDocResolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: PaperDocResolveCommentDetails.self, json: json) } } } /// The PaperDocResolveCommentType struct - open class PaperDocResolveCommentType: CustomStringConvertible { + public class PaperDocResolveCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocResolveCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocResolveCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocResolveCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocResolveCommentType: \(error)" + } } } - open class PaperDocResolveCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocResolveCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocResolveCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocResolveCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocResolveCommentType { + + public func deserialize(_ json: JSON) throws -> PaperDocResolveCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocResolveCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocResolveCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocResolveCommentType.self, json: json) } } } /// Restored Paper doc to previous version. - open class PaperDocRevertDetails: CustomStringConvertible { + public class PaperDocRevertDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocRevertDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocRevertDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocRevertDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocRevertDetails: \(error)" + } } } - open class PaperDocRevertDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocRevertDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocRevertDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocRevertDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocRevertDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocRevertDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocRevertDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocRevertDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocRevertDetails.self, json: json) } } } /// The PaperDocRevertType struct - open class PaperDocRevertType: CustomStringConvertible { + public class PaperDocRevertType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocRevertTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocRevertTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocRevertTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocRevertType: \(error)" + } } } - open class PaperDocRevertTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocRevertType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocRevertTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocRevertType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocRevertType { + + public func deserialize(_ json: JSON) throws -> PaperDocRevertType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocRevertType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocRevertType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocRevertType.self, json: json) } } } /// Shared Paper doc via Slack. - open class PaperDocSlackShareDetails: CustomStringConvertible { + public class PaperDocSlackShareDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocSlackShareDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocSlackShareDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocSlackShareDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocSlackShareDetails: \(error)" + } } } - open class PaperDocSlackShareDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocSlackShareDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocSlackShareDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocSlackShareDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocSlackShareDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocSlackShareDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocSlackShareDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocSlackShareDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocSlackShareDetails.self, json: json) } } } /// The PaperDocSlackShareType struct - open class PaperDocSlackShareType: CustomStringConvertible { + public class PaperDocSlackShareType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocSlackShareTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocSlackShareTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocSlackShareTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocSlackShareType: \(error)" + } } } - open class PaperDocSlackShareTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocSlackShareType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocSlackShareTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocSlackShareType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocSlackShareType { + + public func deserialize(_ json: JSON) throws -> PaperDocSlackShareType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocSlackShareType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocSlackShareType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocSlackShareType.self, json: json) } } } /// Shared Paper doc with users and/or groups. - open class PaperDocTeamInviteDetails: CustomStringConvertible { + public class PaperDocTeamInviteDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocTeamInviteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocTeamInviteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocTeamInviteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocTeamInviteDetails: \(error)" + } } } - open class PaperDocTeamInviteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocTeamInviteDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocTeamInviteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocTeamInviteDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocTeamInviteDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocTeamInviteDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocTeamInviteDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocTeamInviteDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocTeamInviteDetails.self, json: json) } } } /// The PaperDocTeamInviteType struct - open class PaperDocTeamInviteType: CustomStringConvertible { + public class PaperDocTeamInviteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocTeamInviteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocTeamInviteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocTeamInviteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocTeamInviteType: \(error)" + } } } - open class PaperDocTeamInviteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocTeamInviteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocTeamInviteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocTeamInviteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocTeamInviteType { + + public func deserialize(_ json: JSON) throws -> PaperDocTeamInviteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocTeamInviteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocTeamInviteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocTeamInviteType.self, json: json) } } } /// Deleted Paper doc. - open class PaperDocTrashedDetails: CustomStringConvertible { + public class PaperDocTrashedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocTrashedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocTrashedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocTrashedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocTrashedDetails: \(error)" + } } } - open class PaperDocTrashedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocTrashedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocTrashedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocTrashedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocTrashedDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocTrashedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocTrashedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocTrashedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocTrashedDetails.self, json: json) } } } /// The PaperDocTrashedType struct - open class PaperDocTrashedType: CustomStringConvertible { + public class PaperDocTrashedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocTrashedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocTrashedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocTrashedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocTrashedType: \(error)" + } } } - open class PaperDocTrashedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocTrashedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocTrashedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocTrashedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocTrashedType { + + public func deserialize(_ json: JSON) throws -> PaperDocTrashedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocTrashedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocTrashedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocTrashedType.self, json: json) } } } /// Unresolved Paper doc comment. - open class PaperDocUnresolveCommentDetails: CustomStringConvertible { + public class PaperDocUnresolveCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Comment text. @@ -36384,188 +44327,254 @@ open class TeamLog { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUnresolveCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocUnresolveCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUnresolveCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUnresolveCommentDetails: \(error)" + } } } - open class PaperDocUnresolveCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUnresolveCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class PaperDocUnresolveCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUnresolveCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocUnresolveCommentDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocUnresolveCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return PaperDocUnresolveCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return PaperDocUnresolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: PaperDocUnresolveCommentDetails.self, json: json) } } } /// The PaperDocUnresolveCommentType struct - open class PaperDocUnresolveCommentType: CustomStringConvertible { + public class PaperDocUnresolveCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUnresolveCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocUnresolveCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUnresolveCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUnresolveCommentType: \(error)" + } } } - open class PaperDocUnresolveCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUnresolveCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocUnresolveCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUnresolveCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocUnresolveCommentType { + + public func deserialize(_ json: JSON) throws -> PaperDocUnresolveCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocUnresolveCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocUnresolveCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocUnresolveCommentType.self, json: json) } } } /// Restored Paper doc. - open class PaperDocUntrashedDetails: CustomStringConvertible { + public class PaperDocUntrashedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUntrashedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocUntrashedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUntrashedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUntrashedDetails: \(error)" + } } } - open class PaperDocUntrashedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUntrashedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocUntrashedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUntrashedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocUntrashedDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocUntrashedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocUntrashedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocUntrashedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocUntrashedDetails.self, json: json) } } } /// The PaperDocUntrashedType struct - open class PaperDocUntrashedType: CustomStringConvertible { + public class PaperDocUntrashedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocUntrashedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocUntrashedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocUntrashedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocUntrashedType: \(error)" + } } } - open class PaperDocUntrashedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocUntrashedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocUntrashedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocUntrashedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocUntrashedType { + + public func deserialize(_ json: JSON) throws -> PaperDocUntrashedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocUntrashedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocUntrashedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocUntrashedType.self, json: json) } } } /// Viewed Paper doc. - open class PaperDocViewDetails: CustomStringConvertible { + public class PaperDocViewDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocViewDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocViewDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocViewDetails: \(error)" + } } } - open class PaperDocViewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocViewDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperDocViewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocViewDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocViewDetails { + + public func deserialize(_ json: JSON) throws -> PaperDocViewDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperDocViewDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperDocViewDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperDocViewDetails.self, json: json) } } } /// The PaperDocViewType struct - open class PaperDocViewType: CustomStringConvertible { + public class PaperDocViewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocViewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocViewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocViewType: \(error)" + } } } - open class PaperDocViewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocViewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperDocViewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocViewType { + + public func deserialize(_ json: JSON) throws -> PaperDocViewType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperDocViewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperDocViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperDocViewType.self, json: json) } } } /// Paper document's logged information. - open class PaperDocumentLogInfo: CustomStringConvertible { + public class PaperDocumentLogInfo: CustomStringConvertible, JSONRepresentable { /// Papers document Id. public let docId: String /// Paper document title. @@ -36576,33 +44585,44 @@ open class TeamLog { stringValidator()(docTitle) self.docTitle = docTitle } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDocumentLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperDocumentLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDocumentLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDocumentLogInfo: \(error)" + } } } - open class PaperDocumentLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDocumentLogInfo) -> JSON { - let output = [ - "doc_id": Serialization._StringSerializer.serialize(value.docId), - "doc_title": Serialization._StringSerializer.serialize(value.docTitle), + + public class PaperDocumentLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDocumentLogInfo) throws -> JSON { + let output = [ + "doc_id": try Serialization._StringSerializer.serialize(value.docId), + "doc_title": try Serialization._StringSerializer.serialize(value.docTitle), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperDocumentLogInfo { + + public func deserialize(_ json: JSON) throws -> PaperDocumentLogInfo { switch json { - case .dictionary(let dict): - let docId = Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) - let docTitle = Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) - return PaperDocumentLogInfo(docId: docId, docTitle: docTitle) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let docId = try Serialization._StringSerializer.deserialize(dict["doc_id"] ?? .null) + let docTitle = try Serialization._StringSerializer.deserialize(dict["doc_title"] ?? .null) + return PaperDocumentLogInfo(docId: docId, docTitle: docTitle) + default: + throw JSONSerializerError.deserializeError(type: PaperDocumentLogInfo.self, json: json) } } } /// The PaperDownloadFormat union - public enum PaperDownloadFormat: CustomStringConvertible { + public enum PaperDownloadFormat: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case docx /// An unspecified error. @@ -36614,358 +44634,472 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDownloadFormatSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDownloadFormatSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDownloadFormatSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDownloadFormat: \(error)" + } } } - open class PaperDownloadFormatSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDownloadFormat) -> JSON { + + public class PaperDownloadFormatSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDownloadFormat) throws -> JSON { switch value { - case .docx: - var d = [String: JSON]() - d[".tag"] = .str("docx") - return .dictionary(d) - case .html: - var d = [String: JSON]() - d[".tag"] = .str("html") - return .dictionary(d) - case .markdown: - var d = [String: JSON]() - d[".tag"] = .str("markdown") - return .dictionary(d) - case .pdf: - var d = [String: JSON]() - d[".tag"] = .str("pdf") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDownloadFormat { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "docx": - return PaperDownloadFormat.docx - case "html": - return PaperDownloadFormat.html - case "markdown": - return PaperDownloadFormat.markdown - case "pdf": - return PaperDownloadFormat.pdf - case "other": - return PaperDownloadFormat.other - default: - return PaperDownloadFormat.other - } - default: - fatalError("Failed to deserialize") + case .docx: + var d = [String: JSON]() + d[".tag"] = .str("docx") + return .dictionary(d) + case .html: + var d = [String: JSON]() + d[".tag"] = .str("html") + return .dictionary(d) + case .markdown: + var d = [String: JSON]() + d[".tag"] = .str("markdown") + return .dictionary(d) + case .pdf: + var d = [String: JSON]() + d[".tag"] = .str("pdf") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDownloadFormat { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "docx": + return PaperDownloadFormat.docx + case "html": + return PaperDownloadFormat.html + case "markdown": + return PaperDownloadFormat.markdown + case "pdf": + return PaperDownloadFormat.pdf + case "other": + return PaperDownloadFormat.other + default: + return PaperDownloadFormat.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDownloadFormat.self, json: json) } } } /// Added users to Paper-enabled users list. - open class PaperEnabledUsersGroupAdditionDetails: CustomStringConvertible { - public init() { + public class PaperEnabledUsersGroupAdditionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try PaperEnabledUsersGroupAdditionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperEnabledUsersGroupAdditionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperEnabledUsersGroupAdditionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperEnabledUsersGroupAdditionDetails: \(error)" + } } } - open class PaperEnabledUsersGroupAdditionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperEnabledUsersGroupAdditionDetails) -> JSON { + + public class PaperEnabledUsersGroupAdditionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperEnabledUsersGroupAdditionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperEnabledUsersGroupAdditionDetails { + + public func deserialize(_ json: JSON) throws -> PaperEnabledUsersGroupAdditionDetails { switch json { - case .dictionary(_): - return PaperEnabledUsersGroupAdditionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return PaperEnabledUsersGroupAdditionDetails() + default: + throw JSONSerializerError.deserializeError(type: PaperEnabledUsersGroupAdditionDetails.self, json: json) } } } /// The PaperEnabledUsersGroupAdditionType struct - open class PaperEnabledUsersGroupAdditionType: CustomStringConvertible { + public class PaperEnabledUsersGroupAdditionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperEnabledUsersGroupAdditionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperEnabledUsersGroupAdditionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperEnabledUsersGroupAdditionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperEnabledUsersGroupAdditionType: \(error)" + } } } - open class PaperEnabledUsersGroupAdditionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperEnabledUsersGroupAdditionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperEnabledUsersGroupAdditionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperEnabledUsersGroupAdditionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperEnabledUsersGroupAdditionType { + + public func deserialize(_ json: JSON) throws -> PaperEnabledUsersGroupAdditionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperEnabledUsersGroupAdditionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperEnabledUsersGroupAdditionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperEnabledUsersGroupAdditionType.self, json: json) } } } /// Removed users from Paper-enabled users list. - open class PaperEnabledUsersGroupRemovalDetails: CustomStringConvertible { - public init() { + public class PaperEnabledUsersGroupRemovalDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try PaperEnabledUsersGroupRemovalDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperEnabledUsersGroupRemovalDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperEnabledUsersGroupRemovalDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperEnabledUsersGroupRemovalDetails: \(error)" + } } } - open class PaperEnabledUsersGroupRemovalDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperEnabledUsersGroupRemovalDetails) -> JSON { + + public class PaperEnabledUsersGroupRemovalDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperEnabledUsersGroupRemovalDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperEnabledUsersGroupRemovalDetails { + + public func deserialize(_ json: JSON) throws -> PaperEnabledUsersGroupRemovalDetails { switch json { - case .dictionary(_): - return PaperEnabledUsersGroupRemovalDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return PaperEnabledUsersGroupRemovalDetails() + default: + throw JSONSerializerError.deserializeError(type: PaperEnabledUsersGroupRemovalDetails.self, json: json) } } } /// The PaperEnabledUsersGroupRemovalType struct - open class PaperEnabledUsersGroupRemovalType: CustomStringConvertible { + public class PaperEnabledUsersGroupRemovalType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperEnabledUsersGroupRemovalTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperEnabledUsersGroupRemovalTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperEnabledUsersGroupRemovalTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperEnabledUsersGroupRemovalType: \(error)" + } } } - open class PaperEnabledUsersGroupRemovalTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperEnabledUsersGroupRemovalType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperEnabledUsersGroupRemovalTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperEnabledUsersGroupRemovalType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperEnabledUsersGroupRemovalType { + + public func deserialize(_ json: JSON) throws -> PaperEnabledUsersGroupRemovalType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperEnabledUsersGroupRemovalType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperEnabledUsersGroupRemovalType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperEnabledUsersGroupRemovalType.self, json: json) } } } /// Changed Paper external sharing setting to anyone. - open class PaperExternalViewAllowDetails: CustomStringConvertible { + public class PaperExternalViewAllowDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperExternalViewAllowDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperExternalViewAllowDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperExternalViewAllowDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperExternalViewAllowDetails: \(error)" + } } } - open class PaperExternalViewAllowDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperExternalViewAllowDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperExternalViewAllowDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperExternalViewAllowDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperExternalViewAllowDetails { + + public func deserialize(_ json: JSON) throws -> PaperExternalViewAllowDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperExternalViewAllowDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperExternalViewAllowDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperExternalViewAllowDetails.self, json: json) } } } /// The PaperExternalViewAllowType struct - open class PaperExternalViewAllowType: CustomStringConvertible { + public class PaperExternalViewAllowType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperExternalViewAllowTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperExternalViewAllowTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperExternalViewAllowTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperExternalViewAllowType: \(error)" + } } } - open class PaperExternalViewAllowTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperExternalViewAllowType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperExternalViewAllowTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperExternalViewAllowType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperExternalViewAllowType { + + public func deserialize(_ json: JSON) throws -> PaperExternalViewAllowType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperExternalViewAllowType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperExternalViewAllowType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperExternalViewAllowType.self, json: json) } } } /// Changed Paper external sharing setting to default team. - open class PaperExternalViewDefaultTeamDetails: CustomStringConvertible { + public class PaperExternalViewDefaultTeamDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperExternalViewDefaultTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperExternalViewDefaultTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperExternalViewDefaultTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperExternalViewDefaultTeamDetails: \(error)" + } } } - open class PaperExternalViewDefaultTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperExternalViewDefaultTeamDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperExternalViewDefaultTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperExternalViewDefaultTeamDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperExternalViewDefaultTeamDetails { + + public func deserialize(_ json: JSON) throws -> PaperExternalViewDefaultTeamDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperExternalViewDefaultTeamDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperExternalViewDefaultTeamDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperExternalViewDefaultTeamDetails.self, json: json) } } } /// The PaperExternalViewDefaultTeamType struct - open class PaperExternalViewDefaultTeamType: CustomStringConvertible { + public class PaperExternalViewDefaultTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperExternalViewDefaultTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperExternalViewDefaultTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperExternalViewDefaultTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperExternalViewDefaultTeamType: \(error)" + } } } - open class PaperExternalViewDefaultTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperExternalViewDefaultTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperExternalViewDefaultTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperExternalViewDefaultTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperExternalViewDefaultTeamType { + + public func deserialize(_ json: JSON) throws -> PaperExternalViewDefaultTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperExternalViewDefaultTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperExternalViewDefaultTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperExternalViewDefaultTeamType.self, json: json) } } } /// Changed Paper external sharing setting to team-only. - open class PaperExternalViewForbidDetails: CustomStringConvertible { + public class PaperExternalViewForbidDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperExternalViewForbidDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperExternalViewForbidDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperExternalViewForbidDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperExternalViewForbidDetails: \(error)" + } } } - open class PaperExternalViewForbidDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperExternalViewForbidDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperExternalViewForbidDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperExternalViewForbidDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperExternalViewForbidDetails { + + public func deserialize(_ json: JSON) throws -> PaperExternalViewForbidDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperExternalViewForbidDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperExternalViewForbidDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperExternalViewForbidDetails.self, json: json) } } } /// The PaperExternalViewForbidType struct - open class PaperExternalViewForbidType: CustomStringConvertible { + public class PaperExternalViewForbidType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperExternalViewForbidTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperExternalViewForbidTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperExternalViewForbidTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperExternalViewForbidType: \(error)" + } } } - open class PaperExternalViewForbidTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperExternalViewForbidType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperExternalViewForbidTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperExternalViewForbidType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperExternalViewForbidType { + + public func deserialize(_ json: JSON) throws -> PaperExternalViewForbidType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperExternalViewForbidType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperExternalViewForbidType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperExternalViewForbidType.self, json: json) } } } /// Followed/unfollowed Paper folder. - open class PaperFolderChangeSubscriptionDetails: CustomStringConvertible { + public class PaperFolderChangeSubscriptionDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// New folder subscription level. @@ -36980,190 +45114,261 @@ open class TeamLog { nullableValidator(stringValidator())(previousSubscriptionLevel) self.previousSubscriptionLevel = previousSubscriptionLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderChangeSubscriptionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderChangeSubscriptionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderChangeSubscriptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderChangeSubscriptionDetails: \(error)" + } } } - open class PaperFolderChangeSubscriptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderChangeSubscriptionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "new_subscription_level": Serialization._StringSerializer.serialize(value.newSubscriptionLevel), - "previous_subscription_level": NullableSerializer(Serialization._StringSerializer).serialize(value.previousSubscriptionLevel), + + public class PaperFolderChangeSubscriptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderChangeSubscriptionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "new_subscription_level": try Serialization._StringSerializer.serialize(value.newSubscriptionLevel), + "previous_subscription_level": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousSubscriptionLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderChangeSubscriptionDetails { + + public func deserialize(_ json: JSON) throws -> PaperFolderChangeSubscriptionDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let newSubscriptionLevel = Serialization._StringSerializer.deserialize(dict["new_subscription_level"] ?? .null) - let previousSubscriptionLevel = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_subscription_level"] ?? .null) - return PaperFolderChangeSubscriptionDetails(eventUuid: eventUuid, newSubscriptionLevel: newSubscriptionLevel, previousSubscriptionLevel: previousSubscriptionLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let newSubscriptionLevel = try Serialization._StringSerializer.deserialize(dict["new_subscription_level"] ?? .null) + let previousSubscriptionLevel = try NullableSerializer(Serialization._StringSerializer) + .deserialize(dict["previous_subscription_level"] ?? .null) + return PaperFolderChangeSubscriptionDetails( + eventUuid: eventUuid, + newSubscriptionLevel: newSubscriptionLevel, + previousSubscriptionLevel: previousSubscriptionLevel + ) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderChangeSubscriptionDetails.self, json: json) } } } /// The PaperFolderChangeSubscriptionType struct - open class PaperFolderChangeSubscriptionType: CustomStringConvertible { + public class PaperFolderChangeSubscriptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderChangeSubscriptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderChangeSubscriptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderChangeSubscriptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderChangeSubscriptionType: \(error)" + } } } - open class PaperFolderChangeSubscriptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderChangeSubscriptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperFolderChangeSubscriptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderChangeSubscriptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderChangeSubscriptionType { + + public func deserialize(_ json: JSON) throws -> PaperFolderChangeSubscriptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperFolderChangeSubscriptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperFolderChangeSubscriptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderChangeSubscriptionType.self, json: json) } } } /// Archived Paper folder. - open class PaperFolderDeletedDetails: CustomStringConvertible { + public class PaperFolderDeletedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderDeletedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderDeletedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderDeletedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderDeletedDetails: \(error)" + } } } - open class PaperFolderDeletedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderDeletedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperFolderDeletedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderDeletedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderDeletedDetails { + + public func deserialize(_ json: JSON) throws -> PaperFolderDeletedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperFolderDeletedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperFolderDeletedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderDeletedDetails.self, json: json) } } } /// The PaperFolderDeletedType struct - open class PaperFolderDeletedType: CustomStringConvertible { + public class PaperFolderDeletedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderDeletedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderDeletedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderDeletedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderDeletedType: \(error)" + } } } - open class PaperFolderDeletedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderDeletedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperFolderDeletedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderDeletedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderDeletedType { + + public func deserialize(_ json: JSON) throws -> PaperFolderDeletedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperFolderDeletedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperFolderDeletedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderDeletedType.self, json: json) } } } /// Followed Paper folder. - open class PaperFolderFollowedDetails: CustomStringConvertible { + public class PaperFolderFollowedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderFollowedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderFollowedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderFollowedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderFollowedDetails: \(error)" + } } } - open class PaperFolderFollowedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderFollowedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperFolderFollowedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderFollowedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderFollowedDetails { + + public func deserialize(_ json: JSON) throws -> PaperFolderFollowedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperFolderFollowedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperFolderFollowedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderFollowedDetails.self, json: json) } } } /// The PaperFolderFollowedType struct - open class PaperFolderFollowedType: CustomStringConvertible { + public class PaperFolderFollowedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderFollowedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderFollowedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderFollowedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderFollowedType: \(error)" + } } } - open class PaperFolderFollowedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderFollowedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperFolderFollowedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderFollowedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderFollowedType { + + public func deserialize(_ json: JSON) throws -> PaperFolderFollowedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperFolderFollowedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperFolderFollowedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderFollowedType.self, json: json) } } } /// Paper folder's logged information. - open class PaperFolderLogInfo: CustomStringConvertible { + public class PaperFolderLogInfo: CustomStringConvertible, JSONRepresentable { /// Papers folder Id. public let folderId: String /// Paper folder name. @@ -37174,95 +45379,128 @@ open class TeamLog { stringValidator()(folderName) self.folderName = folderName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderLogInfo: \(error)" + } } } - open class PaperFolderLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderLogInfo) -> JSON { - let output = [ - "folder_id": Serialization._StringSerializer.serialize(value.folderId), - "folder_name": Serialization._StringSerializer.serialize(value.folderName), + + public class PaperFolderLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderLogInfo) throws -> JSON { + let output = [ + "folder_id": try Serialization._StringSerializer.serialize(value.folderId), + "folder_name": try Serialization._StringSerializer.serialize(value.folderName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderLogInfo { + + public func deserialize(_ json: JSON) throws -> PaperFolderLogInfo { switch json { - case .dictionary(let dict): - let folderId = Serialization._StringSerializer.deserialize(dict["folder_id"] ?? .null) - let folderName = Serialization._StringSerializer.deserialize(dict["folder_name"] ?? .null) - return PaperFolderLogInfo(folderId: folderId, folderName: folderName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let folderId = try Serialization._StringSerializer.deserialize(dict["folder_id"] ?? .null) + let folderName = try Serialization._StringSerializer.deserialize(dict["folder_name"] ?? .null) + return PaperFolderLogInfo(folderId: folderId, folderName: folderName) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderLogInfo.self, json: json) } } } /// Shared Paper folder with users and/or groups. - open class PaperFolderTeamInviteDetails: CustomStringConvertible { + public class PaperFolderTeamInviteDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderTeamInviteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderTeamInviteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderTeamInviteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderTeamInviteDetails: \(error)" + } } } - open class PaperFolderTeamInviteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderTeamInviteDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperFolderTeamInviteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderTeamInviteDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderTeamInviteDetails { + + public func deserialize(_ json: JSON) throws -> PaperFolderTeamInviteDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperFolderTeamInviteDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperFolderTeamInviteDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderTeamInviteDetails.self, json: json) } } } /// The PaperFolderTeamInviteType struct - open class PaperFolderTeamInviteType: CustomStringConvertible { + public class PaperFolderTeamInviteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperFolderTeamInviteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperFolderTeamInviteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperFolderTeamInviteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperFolderTeamInviteType: \(error)" + } } } - open class PaperFolderTeamInviteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperFolderTeamInviteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperFolderTeamInviteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperFolderTeamInviteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperFolderTeamInviteType { + + public func deserialize(_ json: JSON) throws -> PaperFolderTeamInviteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperFolderTeamInviteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperFolderTeamInviteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperFolderTeamInviteType.self, json: json) } } } /// Policy for controlling if team members can share Paper documents externally. - public enum PaperMemberPolicy: CustomStringConvertible { + public enum PaperMemberPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case anyoneWithLink /// An unspecified error. @@ -37272,56 +45510,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PaperMemberPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperMemberPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperMemberPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperMemberPolicy: \(error)" + } } } - open class PaperMemberPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperMemberPolicy) -> JSON { + + public class PaperMemberPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperMemberPolicy) throws -> JSON { switch value { - case .anyoneWithLink: - var d = [String: JSON]() - d[".tag"] = .str("anyone_with_link") - return .dictionary(d) - case .onlyTeam: - var d = [String: JSON]() - d[".tag"] = .str("only_team") - return .dictionary(d) - case .teamAndExplicitlyShared: - var d = [String: JSON]() - d[".tag"] = .str("team_and_explicitly_shared") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperMemberPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "anyone_with_link": - return PaperMemberPolicy.anyoneWithLink - case "only_team": - return PaperMemberPolicy.onlyTeam - case "team_and_explicitly_shared": - return PaperMemberPolicy.teamAndExplicitlyShared - case "other": - return PaperMemberPolicy.other - default: - return PaperMemberPolicy.other - } - default: - fatalError("Failed to deserialize") + case .anyoneWithLink: + var d = [String: JSON]() + d[".tag"] = .str("anyone_with_link") + return .dictionary(d) + case .onlyTeam: + var d = [String: JSON]() + d[".tag"] = .str("only_team") + return .dictionary(d) + case .teamAndExplicitlyShared: + var d = [String: JSON]() + d[".tag"] = .str("team_and_explicitly_shared") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperMemberPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "anyone_with_link": + return PaperMemberPolicy.anyoneWithLink + case "only_team": + return PaperMemberPolicy.onlyTeam + case "team_and_explicitly_shared": + return PaperMemberPolicy.teamAndExplicitlyShared + case "other": + return PaperMemberPolicy.other + default: + return PaperMemberPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperMemberPolicy.self, json: json) } } } /// Changed permissions for published doc. - open class PaperPublishedLinkChangePermissionDetails: CustomStringConvertible { + public class PaperPublishedLinkChangePermissionDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// New permission level. @@ -37336,252 +45584,344 @@ open class TeamLog { stringValidator()(previousPermissionLevel) self.previousPermissionLevel = previousPermissionLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkChangePermissionDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkChangePermissionDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkChangePermissionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkChangePermissionDetails: \(error)" + } } } - open class PaperPublishedLinkChangePermissionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkChangePermissionDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "new_permission_level": Serialization._StringSerializer.serialize(value.newPermissionLevel), - "previous_permission_level": Serialization._StringSerializer.serialize(value.previousPermissionLevel), + + public class PaperPublishedLinkChangePermissionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkChangePermissionDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "new_permission_level": try Serialization._StringSerializer.serialize(value.newPermissionLevel), + "previous_permission_level": try Serialization._StringSerializer.serialize(value.previousPermissionLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkChangePermissionDetails { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkChangePermissionDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let newPermissionLevel = Serialization._StringSerializer.deserialize(dict["new_permission_level"] ?? .null) - let previousPermissionLevel = Serialization._StringSerializer.deserialize(dict["previous_permission_level"] ?? .null) - return PaperPublishedLinkChangePermissionDetails(eventUuid: eventUuid, newPermissionLevel: newPermissionLevel, previousPermissionLevel: previousPermissionLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let newPermissionLevel = try Serialization._StringSerializer.deserialize(dict["new_permission_level"] ?? .null) + let previousPermissionLevel = try Serialization._StringSerializer.deserialize(dict["previous_permission_level"] ?? .null) + return PaperPublishedLinkChangePermissionDetails( + eventUuid: eventUuid, + newPermissionLevel: newPermissionLevel, + previousPermissionLevel: previousPermissionLevel + ) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkChangePermissionDetails.self, json: json) } } } /// The PaperPublishedLinkChangePermissionType struct - open class PaperPublishedLinkChangePermissionType: CustomStringConvertible { + public class PaperPublishedLinkChangePermissionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkChangePermissionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkChangePermissionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkChangePermissionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkChangePermissionType: \(error)" + } } } - open class PaperPublishedLinkChangePermissionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkChangePermissionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperPublishedLinkChangePermissionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkChangePermissionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkChangePermissionType { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkChangePermissionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperPublishedLinkChangePermissionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperPublishedLinkChangePermissionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkChangePermissionType.self, json: json) } } } /// Published doc. - open class PaperPublishedLinkCreateDetails: CustomStringConvertible { + public class PaperPublishedLinkCreateDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkCreateDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkCreateDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkCreateDetails: \(error)" + } } } - open class PaperPublishedLinkCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkCreateDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperPublishedLinkCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkCreateDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkCreateDetails { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkCreateDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperPublishedLinkCreateDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperPublishedLinkCreateDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkCreateDetails.self, json: json) } } } /// The PaperPublishedLinkCreateType struct - open class PaperPublishedLinkCreateType: CustomStringConvertible { + public class PaperPublishedLinkCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkCreateType: \(error)" + } } } - open class PaperPublishedLinkCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperPublishedLinkCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkCreateType { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperPublishedLinkCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperPublishedLinkCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkCreateType.self, json: json) } } } /// Unpublished doc. - open class PaperPublishedLinkDisabledDetails: CustomStringConvertible { + public class PaperPublishedLinkDisabledDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkDisabledDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkDisabledDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkDisabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkDisabledDetails: \(error)" + } } } - open class PaperPublishedLinkDisabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkDisabledDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperPublishedLinkDisabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkDisabledDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkDisabledDetails { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkDisabledDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperPublishedLinkDisabledDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperPublishedLinkDisabledDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkDisabledDetails.self, json: json) } } } /// The PaperPublishedLinkDisabledType struct - open class PaperPublishedLinkDisabledType: CustomStringConvertible { + public class PaperPublishedLinkDisabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkDisabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkDisabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkDisabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkDisabledType: \(error)" + } } } - open class PaperPublishedLinkDisabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkDisabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperPublishedLinkDisabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkDisabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkDisabledType { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkDisabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperPublishedLinkDisabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperPublishedLinkDisabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkDisabledType.self, json: json) } } } /// Viewed published doc. - open class PaperPublishedLinkViewDetails: CustomStringConvertible { + public class PaperPublishedLinkViewDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkViewDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkViewDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkViewDetails: \(error)" + } } } - open class PaperPublishedLinkViewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkViewDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class PaperPublishedLinkViewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkViewDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkViewDetails { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkViewDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return PaperPublishedLinkViewDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return PaperPublishedLinkViewDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkViewDetails.self, json: json) } } } /// The PaperPublishedLinkViewType struct - open class PaperPublishedLinkViewType: CustomStringConvertible { + public class PaperPublishedLinkViewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperPublishedLinkViewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PaperPublishedLinkViewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperPublishedLinkViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperPublishedLinkViewType: \(error)" + } } } - open class PaperPublishedLinkViewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperPublishedLinkViewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PaperPublishedLinkViewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperPublishedLinkViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PaperPublishedLinkViewType { + + public func deserialize(_ json: JSON) throws -> PaperPublishedLinkViewType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PaperPublishedLinkViewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PaperPublishedLinkViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PaperPublishedLinkViewType.self, json: json) } } } /// A user or group - public enum ParticipantLogInfo: CustomStringConvertible { + public enum ParticipantLogInfo: CustomStringConvertible, JSONRepresentable { /// Group details. case group(TeamLog.GroupLogInfo) /// A user with a Dropbox account. @@ -37589,52 +45929,62 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ParticipantLogInfoSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ParticipantLogInfoSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ParticipantLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ParticipantLogInfo: \(error)" + } } } - open class ParticipantLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ParticipantLogInfo) -> JSON { + + public class ParticipantLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ParticipantLogInfo) throws -> JSON { switch value { - case .group(let arg): - var d = Serialization.getFields(TeamLog.GroupLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("group") - return .dictionary(d) - case .user(let arg): - var d = ["user": TeamLog.UserLogInfoSerializer().serialize(arg)] - d[".tag"] = .str("user") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ParticipantLogInfo { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "group": - let v = TeamLog.GroupLogInfoSerializer().deserialize(json) - return ParticipantLogInfo.group(v) - case "user": - let v = TeamLog.UserLogInfoSerializer().deserialize(d["user"] ?? .null) - return ParticipantLogInfo.user(v) - case "other": - return ParticipantLogInfo.other - default: - return ParticipantLogInfo.other - } + case .group(let arg): + var d = try Serialization.getFields(TeamLog.GroupLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("group") + return .dictionary(d) + case .user(let arg): + var d = try ["user": TeamLog.UserLogInfoSerializer().serialize(arg)] + d[".tag"] = .str("user") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ParticipantLogInfo { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "group": + let v = try TeamLog.GroupLogInfoSerializer().deserialize(json) + return ParticipantLogInfo.group(v) + case "user": + let v = try TeamLog.UserLogInfoSerializer().deserialize(d["user"] ?? .null) + return ParticipantLogInfo.user(v) + case "other": + return ParticipantLogInfo.other default: - fatalError("Failed to deserialize") + return ParticipantLogInfo.other + } + default: + throw JSONSerializerError.deserializeError(type: ParticipantLogInfo.self, json: json) } } } /// The PassPolicy union - public enum PassPolicy: CustomStringConvertible { + public enum PassPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case allow /// An unspecified error. @@ -37644,221 +45994,288 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PassPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PassPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PassPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PassPolicy: \(error)" + } } } - open class PassPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PassPolicy) -> JSON { + + public class PassPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PassPolicy) throws -> JSON { switch value { - case .allow: - var d = [String: JSON]() - d[".tag"] = .str("allow") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PassPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "allow": - return PassPolicy.allow - case "disabled": - return PassPolicy.disabled - case "enabled": - return PassPolicy.enabled - case "other": - return PassPolicy.other - default: - return PassPolicy.other - } - default: - fatalError("Failed to deserialize") + case .allow: + var d = [String: JSON]() + d[".tag"] = .str("allow") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PassPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "allow": + return PassPolicy.allow + case "disabled": + return PassPolicy.disabled + case "enabled": + return PassPolicy.enabled + case "other": + return PassPolicy.other + default: + return PassPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PassPolicy.self, json: json) } } } /// Changed password. - open class PasswordChangeDetails: CustomStringConvertible { - public init() { + public class PasswordChangeDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try PasswordChangeDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordChangeDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordChangeDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordChangeDetails: \(error)" + } } } - open class PasswordChangeDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordChangeDetails) -> JSON { + + public class PasswordChangeDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordChangeDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordChangeDetails { + + public func deserialize(_ json: JSON) throws -> PasswordChangeDetails { switch json { - case .dictionary(_): - return PasswordChangeDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return PasswordChangeDetails() + default: + throw JSONSerializerError.deserializeError(type: PasswordChangeDetails.self, json: json) } } } /// The PasswordChangeType struct - open class PasswordChangeType: CustomStringConvertible { + public class PasswordChangeType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordChangeTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PasswordChangeTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordChangeTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordChangeType: \(error)" + } } } - open class PasswordChangeTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordChangeType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PasswordChangeTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordChangeType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordChangeType { + + public func deserialize(_ json: JSON) throws -> PasswordChangeType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PasswordChangeType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PasswordChangeType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PasswordChangeType.self, json: json) } } } /// Reset all team member passwords. - open class PasswordResetAllDetails: CustomStringConvertible { - public init() { + public class PasswordResetAllDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try PasswordResetAllDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordResetAllDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordResetAllDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordResetAllDetails: \(error)" + } } } - open class PasswordResetAllDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordResetAllDetails) -> JSON { + + public class PasswordResetAllDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordResetAllDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordResetAllDetails { + + public func deserialize(_ json: JSON) throws -> PasswordResetAllDetails { switch json { - case .dictionary(_): - return PasswordResetAllDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return PasswordResetAllDetails() + default: + throw JSONSerializerError.deserializeError(type: PasswordResetAllDetails.self, json: json) } } } /// The PasswordResetAllType struct - open class PasswordResetAllType: CustomStringConvertible { + public class PasswordResetAllType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordResetAllTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PasswordResetAllTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordResetAllTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordResetAllType: \(error)" + } } } - open class PasswordResetAllTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordResetAllType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PasswordResetAllTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordResetAllType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordResetAllType { + + public func deserialize(_ json: JSON) throws -> PasswordResetAllType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PasswordResetAllType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PasswordResetAllType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PasswordResetAllType.self, json: json) } } } /// Reset password. - open class PasswordResetDetails: CustomStringConvertible { - public init() { + public class PasswordResetDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try PasswordResetDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordResetDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordResetDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordResetDetails: \(error)" + } } } - open class PasswordResetDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordResetDetails) -> JSON { + + public class PasswordResetDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordResetDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordResetDetails { + + public func deserialize(_ json: JSON) throws -> PasswordResetDetails { switch json { - case .dictionary(_): - return PasswordResetDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return PasswordResetDetails() + default: + throw JSONSerializerError.deserializeError(type: PasswordResetDetails.self, json: json) } } } /// The PasswordResetType struct - open class PasswordResetType: CustomStringConvertible { + public class PasswordResetType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordResetTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PasswordResetTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordResetTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordResetType: \(error)" + } } } - open class PasswordResetTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordResetType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PasswordResetTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordResetType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordResetType { + + public func deserialize(_ json: JSON) throws -> PasswordResetType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PasswordResetType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PasswordResetType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PasswordResetType.self, json: json) } } } /// Changed team password strength requirements. - open class PasswordStrengthRequirementsChangePolicyDetails: CustomStringConvertible { + public class PasswordStrengthRequirementsChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// Old password strength policy. public let previousValue: TeamPolicies.PasswordStrengthPolicy /// New password strength policy. @@ -37867,64 +46284,86 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordStrengthRequirementsChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PasswordStrengthRequirementsChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordStrengthRequirementsChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordStrengthRequirementsChangePolicyDetails: \(error)" + } } } - open class PasswordStrengthRequirementsChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordStrengthRequirementsChangePolicyDetails) -> JSON { - let output = [ - "previous_value": TeamPolicies.PasswordStrengthPolicySerializer().serialize(value.previousValue), - "new_value": TeamPolicies.PasswordStrengthPolicySerializer().serialize(value.newValue), + + public class PasswordStrengthRequirementsChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordStrengthRequirementsChangePolicyDetails) throws -> JSON { + let output = [ + "previous_value": try TeamPolicies.PasswordStrengthPolicySerializer().serialize(value.previousValue), + "new_value": try TeamPolicies.PasswordStrengthPolicySerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordStrengthRequirementsChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> PasswordStrengthRequirementsChangePolicyDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamPolicies.PasswordStrengthPolicySerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamPolicies.PasswordStrengthPolicySerializer().deserialize(dict["new_value"] ?? .null) - return PasswordStrengthRequirementsChangePolicyDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamPolicies.PasswordStrengthPolicySerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamPolicies.PasswordStrengthPolicySerializer().deserialize(dict["new_value"] ?? .null) + return PasswordStrengthRequirementsChangePolicyDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: PasswordStrengthRequirementsChangePolicyDetails.self, json: json) } } } /// The PasswordStrengthRequirementsChangePolicyType struct - open class PasswordStrengthRequirementsChangePolicyType: CustomStringConvertible { + public class PasswordStrengthRequirementsChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordStrengthRequirementsChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PasswordStrengthRequirementsChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordStrengthRequirementsChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordStrengthRequirementsChangePolicyType: \(error)" + } } } - open class PasswordStrengthRequirementsChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordStrengthRequirementsChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PasswordStrengthRequirementsChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordStrengthRequirementsChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PasswordStrengthRequirementsChangePolicyType { + + public func deserialize(_ json: JSON) throws -> PasswordStrengthRequirementsChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PasswordStrengthRequirementsChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PasswordStrengthRequirementsChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PasswordStrengthRequirementsChangePolicyType.self, json: json) } } } /// Path's details. - open class PathLogInfo: CustomStringConvertible { + public class PathLogInfo: CustomStringConvertible, JSONRepresentable { /// Fully qualified path relative to event's context. public let contextual: String? /// Path relative to the namespace containing the content. @@ -37934,95 +46373,128 @@ open class TeamLog { self.contextual = contextual self.namespaceRelative = namespaceRelative } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PathLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try PathLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PathLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PathLogInfo: \(error)" + } } } - open class PathLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PathLogInfo) -> JSON { - let output = [ - "namespace_relative": TeamLog.NamespaceRelativePathLogInfoSerializer().serialize(value.namespaceRelative), - "contextual": NullableSerializer(Serialization._StringSerializer).serialize(value.contextual), + + public class PathLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PathLogInfo) throws -> JSON { + let output = [ + "namespace_relative": try TeamLog.NamespaceRelativePathLogInfoSerializer().serialize(value.namespaceRelative), + "contextual": try NullableSerializer(Serialization._StringSerializer).serialize(value.contextual), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PathLogInfo { + + public func deserialize(_ json: JSON) throws -> PathLogInfo { switch json { - case .dictionary(let dict): - let namespaceRelative = TeamLog.NamespaceRelativePathLogInfoSerializer().deserialize(dict["namespace_relative"] ?? .null) - let contextual = NullableSerializer(Serialization._StringSerializer).deserialize(dict["contextual"] ?? .null) - return PathLogInfo(namespaceRelative: namespaceRelative, contextual: contextual) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let namespaceRelative = try TeamLog.NamespaceRelativePathLogInfoSerializer().deserialize(dict["namespace_relative"] ?? .null) + let contextual = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["contextual"] ?? .null) + return PathLogInfo(namespaceRelative: namespaceRelative, contextual: contextual) + default: + throw JSONSerializerError.deserializeError(type: PathLogInfo.self, json: json) } } } /// Added pending secondary email. - open class PendingSecondaryEmailAddedDetails: CustomStringConvertible { + public class PendingSecondaryEmailAddedDetails: CustomStringConvertible, JSONRepresentable { /// New pending secondary email. public let secondaryEmail: String public init(secondaryEmail: String) { stringValidator(maxLength: 255)(secondaryEmail) self.secondaryEmail = secondaryEmail } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PendingSecondaryEmailAddedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PendingSecondaryEmailAddedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PendingSecondaryEmailAddedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PendingSecondaryEmailAddedDetails: \(error)" + } } } - open class PendingSecondaryEmailAddedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PendingSecondaryEmailAddedDetails) -> JSON { - let output = [ - "secondary_email": Serialization._StringSerializer.serialize(value.secondaryEmail), + + public class PendingSecondaryEmailAddedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PendingSecondaryEmailAddedDetails) throws -> JSON { + let output = [ + "secondary_email": try Serialization._StringSerializer.serialize(value.secondaryEmail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PendingSecondaryEmailAddedDetails { + + public func deserialize(_ json: JSON) throws -> PendingSecondaryEmailAddedDetails { switch json { - case .dictionary(let dict): - let secondaryEmail = Serialization._StringSerializer.deserialize(dict["secondary_email"] ?? .null) - return PendingSecondaryEmailAddedDetails(secondaryEmail: secondaryEmail) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryEmail = try Serialization._StringSerializer.deserialize(dict["secondary_email"] ?? .null) + return PendingSecondaryEmailAddedDetails(secondaryEmail: secondaryEmail) + default: + throw JSONSerializerError.deserializeError(type: PendingSecondaryEmailAddedDetails.self, json: json) } } } /// The PendingSecondaryEmailAddedType struct - open class PendingSecondaryEmailAddedType: CustomStringConvertible { + public class PendingSecondaryEmailAddedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PendingSecondaryEmailAddedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PendingSecondaryEmailAddedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PendingSecondaryEmailAddedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PendingSecondaryEmailAddedType: \(error)" + } } } - open class PendingSecondaryEmailAddedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PendingSecondaryEmailAddedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PendingSecondaryEmailAddedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PendingSecondaryEmailAddedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PendingSecondaryEmailAddedType { + + public func deserialize(_ json: JSON) throws -> PendingSecondaryEmailAddedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PendingSecondaryEmailAddedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PendingSecondaryEmailAddedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PendingSecondaryEmailAddedType.self, json: json) } } } /// Enabled/disabled ability of team members to permanently delete content. - open class PermanentDeleteChangePolicyDetails: CustomStringConvertible { + public class PermanentDeleteChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New permanent delete content policy. public let newValue: TeamLog.ContentPermanentDeletePolicy /// Previous permanent delete content policy. Might be missing due to historical data gap. @@ -38031,64 +46503,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PermanentDeleteChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PermanentDeleteChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PermanentDeleteChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PermanentDeleteChangePolicyDetails: \(error)" + } } } - open class PermanentDeleteChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PermanentDeleteChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.ContentPermanentDeletePolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.ContentPermanentDeletePolicySerializer()).serialize(value.previousValue), + + public class PermanentDeleteChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PermanentDeleteChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ContentPermanentDeletePolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.ContentPermanentDeletePolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PermanentDeleteChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> PermanentDeleteChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ContentPermanentDeletePolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.ContentPermanentDeletePolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return PermanentDeleteChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ContentPermanentDeletePolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.ContentPermanentDeletePolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return PermanentDeleteChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: PermanentDeleteChangePolicyDetails.self, json: json) } } } /// The PermanentDeleteChangePolicyType struct - open class PermanentDeleteChangePolicyType: CustomStringConvertible { + public class PermanentDeleteChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PermanentDeleteChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try PermanentDeleteChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PermanentDeleteChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PermanentDeleteChangePolicyType: \(error)" + } } } - open class PermanentDeleteChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PermanentDeleteChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class PermanentDeleteChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PermanentDeleteChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PermanentDeleteChangePolicyType { + + public func deserialize(_ json: JSON) throws -> PermanentDeleteChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return PermanentDeleteChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return PermanentDeleteChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: PermanentDeleteChangePolicyType.self, json: json) } } } /// The PlacementRestriction union - public enum PlacementRestriction: CustomStringConvertible { + public enum PlacementRestriction: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case australiaOnly /// An unspecified error. @@ -38104,74 +46598,84 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PlacementRestrictionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PlacementRestrictionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PlacementRestrictionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PlacementRestriction: \(error)" + } } } - open class PlacementRestrictionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PlacementRestriction) -> JSON { + + public class PlacementRestrictionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PlacementRestriction) throws -> JSON { switch value { - case .australiaOnly: - var d = [String: JSON]() - d[".tag"] = .str("australia_only") - return .dictionary(d) - case .europeOnly: - var d = [String: JSON]() - d[".tag"] = .str("europe_only") - return .dictionary(d) - case .japanOnly: - var d = [String: JSON]() - d[".tag"] = .str("japan_only") - return .dictionary(d) - case .none: - var d = [String: JSON]() - d[".tag"] = .str("none") - return .dictionary(d) - case .ukOnly: - var d = [String: JSON]() - d[".tag"] = .str("uk_only") - return .dictionary(d) - case .usS3Only: - var d = [String: JSON]() - d[".tag"] = .str("us_s3_only") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PlacementRestriction { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "australia_only": - return PlacementRestriction.australiaOnly - case "europe_only": - return PlacementRestriction.europeOnly - case "japan_only": - return PlacementRestriction.japanOnly - case "none": - return PlacementRestriction.none - case "uk_only": - return PlacementRestriction.ukOnly - case "us_s3_only": - return PlacementRestriction.usS3Only - case "other": - return PlacementRestriction.other - default: - return PlacementRestriction.other - } - default: - fatalError("Failed to deserialize") + case .australiaOnly: + var d = [String: JSON]() + d[".tag"] = .str("australia_only") + return .dictionary(d) + case .europeOnly: + var d = [String: JSON]() + d[".tag"] = .str("europe_only") + return .dictionary(d) + case .japanOnly: + var d = [String: JSON]() + d[".tag"] = .str("japan_only") + return .dictionary(d) + case .none: + var d = [String: JSON]() + d[".tag"] = .str("none") + return .dictionary(d) + case .ukOnly: + var d = [String: JSON]() + d[".tag"] = .str("uk_only") + return .dictionary(d) + case .usS3Only: + var d = [String: JSON]() + d[".tag"] = .str("us_s3_only") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PlacementRestriction { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "australia_only": + return PlacementRestriction.australiaOnly + case "europe_only": + return PlacementRestriction.europeOnly + case "japan_only": + return PlacementRestriction.japanOnly + case "none": + return PlacementRestriction.none + case "uk_only": + return PlacementRestriction.ukOnly + case "us_s3_only": + return PlacementRestriction.usS3Only + case "other": + return PlacementRestriction.other + default: + return PlacementRestriction.other + } + default: + throw JSONSerializerError.deserializeError(type: PlacementRestriction.self, json: json) } } } /// The PolicyType union - public enum PolicyType: CustomStringConvertible { + public enum PolicyType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disposition /// An unspecified error. @@ -38179,50 +46683,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try PolicyTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PolicyTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PolicyType: \(error)" + } } } - open class PolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PolicyType) -> JSON { + + public class PolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PolicyType) throws -> JSON { switch value { - case .disposition: - var d = [String: JSON]() - d[".tag"] = .str("disposition") - return .dictionary(d) - case .retention: - var d = [String: JSON]() - d[".tag"] = .str("retention") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PolicyType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disposition": - return PolicyType.disposition - case "retention": - return PolicyType.retention - case "other": - return PolicyType.other - default: - return PolicyType.other - } + case .disposition: + var d = [String: JSON]() + d[".tag"] = .str("disposition") + return .dictionary(d) + case .retention: + var d = [String: JSON]() + d[".tag"] = .str("retention") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PolicyType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disposition": + return PolicyType.disposition + case "retention": + return PolicyType.retention + case "other": + return PolicyType.other default: - fatalError("Failed to deserialize") + return PolicyType.other + } + default: + throw JSONSerializerError.deserializeError(type: PolicyType.self, json: json) } } } /// Team merge request acceptance details shown to the primary team - open class PrimaryTeamRequestAcceptedDetails: CustomStringConvertible { + public class PrimaryTeamRequestAcceptedDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -38233,33 +46747,44 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PrimaryTeamRequestAcceptedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PrimaryTeamRequestAcceptedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PrimaryTeamRequestAcceptedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PrimaryTeamRequestAcceptedDetails: \(error)" + } } } - open class PrimaryTeamRequestAcceptedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PrimaryTeamRequestAcceptedDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class PrimaryTeamRequestAcceptedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PrimaryTeamRequestAcceptedDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PrimaryTeamRequestAcceptedDetails { + + public func deserialize(_ json: JSON) throws -> PrimaryTeamRequestAcceptedDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return PrimaryTeamRequestAcceptedDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return PrimaryTeamRequestAcceptedDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: PrimaryTeamRequestAcceptedDetails.self, json: json) } } } /// Team merge request cancellation details shown to the primary team - open class PrimaryTeamRequestCanceledDetails: CustomStringConvertible { + public class PrimaryTeamRequestCanceledDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -38270,33 +46795,44 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PrimaryTeamRequestCanceledDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PrimaryTeamRequestCanceledDetailsSerializer().serialize(self) } - } - open class PrimaryTeamRequestCanceledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PrimaryTeamRequestCanceledDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), - ] - return .dictionary(output) + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PrimaryTeamRequestCanceledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PrimaryTeamRequestCanceledDetails: \(error)" + } + } + } + + public class PrimaryTeamRequestCanceledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PrimaryTeamRequestCanceledDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), + ] + return .dictionary(output) } - open func deserialize(_ json: JSON) -> PrimaryTeamRequestCanceledDetails { + + public func deserialize(_ json: JSON) throws -> PrimaryTeamRequestCanceledDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return PrimaryTeamRequestCanceledDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return PrimaryTeamRequestCanceledDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: PrimaryTeamRequestCanceledDetails.self, json: json) } } } /// Team merge request expiration details shown to the primary team - open class PrimaryTeamRequestExpiredDetails: CustomStringConvertible { + public class PrimaryTeamRequestExpiredDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -38307,33 +46843,44 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PrimaryTeamRequestExpiredDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PrimaryTeamRequestExpiredDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PrimaryTeamRequestExpiredDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PrimaryTeamRequestExpiredDetails: \(error)" + } } } - open class PrimaryTeamRequestExpiredDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PrimaryTeamRequestExpiredDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class PrimaryTeamRequestExpiredDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PrimaryTeamRequestExpiredDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PrimaryTeamRequestExpiredDetails { + + public func deserialize(_ json: JSON) throws -> PrimaryTeamRequestExpiredDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return PrimaryTeamRequestExpiredDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return PrimaryTeamRequestExpiredDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: PrimaryTeamRequestExpiredDetails.self, json: json) } } } /// Team merge request reminder details shown to the primary team - open class PrimaryTeamRequestReminderDetails: CustomStringConvertible { + public class PrimaryTeamRequestReminderDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the primary team admin the request was sent to. @@ -38344,33 +46891,44 @@ open class TeamLog { stringValidator()(sentTo) self.sentTo = sentTo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PrimaryTeamRequestReminderDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try PrimaryTeamRequestReminderDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PrimaryTeamRequestReminderDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PrimaryTeamRequestReminderDetails: \(error)" + } } } - open class PrimaryTeamRequestReminderDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PrimaryTeamRequestReminderDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class PrimaryTeamRequestReminderDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PrimaryTeamRequestReminderDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> PrimaryTeamRequestReminderDetails { + + public func deserialize(_ json: JSON) throws -> PrimaryTeamRequestReminderDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return PrimaryTeamRequestReminderDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return PrimaryTeamRequestReminderDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: PrimaryTeamRequestReminderDetails.self, json: json) } } } /// Quick action type. - public enum QuickActionType: CustomStringConvertible { + public enum QuickActionType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case deleteSharedLink /// An unspecified error. @@ -38386,1023 +46944,1094 @@ open class TeamLog { /// An unspecified error. case other - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(QuickActionTypeSerializer().serialize(self)))" + func json() throws -> JSON { + try QuickActionTypeSerializer().serialize(self) } - } - open class QuickActionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: QuickActionType) -> JSON { - switch value { - case .deleteSharedLink: - var d = [String: JSON]() - d[".tag"] = .str("delete_shared_link") - return .dictionary(d) - case .resetPassword: - var d = [String: JSON]() - d[".tag"] = .str("reset_password") - return .dictionary(d) - case .restoreFileOrFolder: - var d = [String: JSON]() - d[".tag"] = .str("restore_file_or_folder") - return .dictionary(d) - case .unlinkApp: - var d = [String: JSON]() - d[".tag"] = .str("unlink_app") - return .dictionary(d) - case .unlinkDevice: - var d = [String: JSON]() - d[".tag"] = .str("unlink_device") - return .dictionary(d) - case .unlinkSession: - var d = [String: JSON]() - d[".tag"] = .str("unlink_session") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> QuickActionType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "delete_shared_link": - return QuickActionType.deleteSharedLink - case "reset_password": - return QuickActionType.resetPassword - case "restore_file_or_folder": - return QuickActionType.restoreFileOrFolder - case "unlink_app": - return QuickActionType.unlinkApp - case "unlink_device": - return QuickActionType.unlinkDevice - case "unlink_session": - return QuickActionType.unlinkSession - case "other": - return QuickActionType.other - default: - return QuickActionType.other - } - default: - fatalError("Failed to deserialize") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try QuickActionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for QuickActionType: \(error)" } } } - /// Recipients Configuration - open class RecipientsConfiguration: CustomStringConvertible { - /// Recipients setting type. - public let recipientSettingType: TeamLog.AlertRecipientsSettingType? - /// A list of user emails to notify. - public let emails: Array? - /// A list of groups to notify. - public let groups: Array? - public init(recipientSettingType: TeamLog.AlertRecipientsSettingType? = nil, emails: Array? = nil, groups: Array? = nil) { - self.recipientSettingType = recipientSettingType - nullableValidator(arrayValidator(itemValidator: stringValidator(maxLength: 255)))(emails) - self.emails = emails - nullableValidator(arrayValidator(itemValidator: stringValidator()))(groups) - self.groups = groups + public class QuickActionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: QuickActionType) throws -> JSON { + switch value { + case .deleteSharedLink: + var d = [String: JSON]() + d[".tag"] = .str("delete_shared_link") + return .dictionary(d) + case .resetPassword: + var d = [String: JSON]() + d[".tag"] = .str("reset_password") + return .dictionary(d) + case .restoreFileOrFolder: + var d = [String: JSON]() + d[".tag"] = .str("restore_file_or_folder") + return .dictionary(d) + case .unlinkApp: + var d = [String: JSON]() + d[".tag"] = .str("unlink_app") + return .dictionary(d) + case .unlinkDevice: + var d = [String: JSON]() + d[".tag"] = .str("unlink_device") + return .dictionary(d) + case .unlinkSession: + var d = [String: JSON]() + d[".tag"] = .str("unlink_session") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> QuickActionType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "delete_shared_link": + return QuickActionType.deleteSharedLink + case "reset_password": + return QuickActionType.resetPassword + case "restore_file_or_folder": + return QuickActionType.restoreFileOrFolder + case "unlink_app": + return QuickActionType.unlinkApp + case "unlink_device": + return QuickActionType.unlinkDevice + case "unlink_session": + return QuickActionType.unlinkSession + case "other": + return QuickActionType.other + default: + return QuickActionType.other + } + default: + throw JSONSerializerError.deserializeError(type: QuickActionType.self, json: json) + } + } + } + + /// Created ransomware report. + public class RansomwareAlertCreateReportDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try RansomwareAlertCreateReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RecipientsConfigurationSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareAlertCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareAlertCreateReportDetails: \(error)" + } } } - open class RecipientsConfigurationSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RecipientsConfiguration) -> JSON { - let output = [ - "recipient_setting_type": NullableSerializer(TeamLog.AlertRecipientsSettingTypeSerializer()).serialize(value.recipientSettingType), - "emails": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.emails), - "groups": NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.groups), - ] + + public class RansomwareAlertCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareAlertCreateReportDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> RecipientsConfiguration { + + public func deserialize(_ json: JSON) throws -> RansomwareAlertCreateReportDetails { switch json { - case .dictionary(let dict): - let recipientSettingType = NullableSerializer(TeamLog.AlertRecipientsSettingTypeSerializer()).deserialize(dict["recipient_setting_type"] ?? .null) - let emails = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["emails"] ?? .null) - let groups = NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["groups"] ?? .null) - return RecipientsConfiguration(recipientSettingType: recipientSettingType, emails: emails, groups: groups) - default: - fatalError("Type error deserializing") + case .dictionary: + return RansomwareAlertCreateReportDetails() + default: + throw JSONSerializerError.deserializeError(type: RansomwareAlertCreateReportDetails.self, json: json) } } } - /// Provides the indices of the source asset and the destination asset for a relocate action. - open class RelocateAssetReferencesLogInfo: CustomStringConvertible { - /// Source asset position in the Assets list. - public let srcAssetIndex: UInt64 - /// Destination asset position in the Assets list. - public let destAssetIndex: UInt64 - public init(srcAssetIndex: UInt64, destAssetIndex: UInt64) { - comparableValidator()(srcAssetIndex) - self.srcAssetIndex = srcAssetIndex - comparableValidator()(destAssetIndex) - self.destAssetIndex = destAssetIndex + /// Couldn't generate ransomware report. + public class RansomwareAlertCreateReportFailedDetails: CustomStringConvertible, JSONRepresentable { + /// Failure reason. + public let failureReason: Team.TeamReportFailureReason + public init(failureReason: Team.TeamReportFailureReason) { + self.failureReason = failureReason + } + + func json() throws -> JSON { + try RansomwareAlertCreateReportFailedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RelocateAssetReferencesLogInfoSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareAlertCreateReportFailedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareAlertCreateReportFailedDetails: \(error)" + } } } - open class RelocateAssetReferencesLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RelocateAssetReferencesLogInfo) -> JSON { - let output = [ - "src_asset_index": Serialization._UInt64Serializer.serialize(value.srcAssetIndex), - "dest_asset_index": Serialization._UInt64Serializer.serialize(value.destAssetIndex), + + public class RansomwareAlertCreateReportFailedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareAlertCreateReportFailedDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RelocateAssetReferencesLogInfo { + + public func deserialize(_ json: JSON) throws -> RansomwareAlertCreateReportFailedDetails { switch json { - case .dictionary(let dict): - let srcAssetIndex = Serialization._UInt64Serializer.deserialize(dict["src_asset_index"] ?? .null) - let destAssetIndex = Serialization._UInt64Serializer.deserialize(dict["dest_asset_index"] ?? .null) - return RelocateAssetReferencesLogInfo(srcAssetIndex: srcAssetIndex, destAssetIndex: destAssetIndex) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return RansomwareAlertCreateReportFailedDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: RansomwareAlertCreateReportFailedDetails.self, json: json) } } } - /// Reseller information. - open class ResellerLogInfo: CustomStringConvertible { - /// Reseller name. - public let resellerName: String - /// Reseller email. - public let resellerEmail: String - public init(resellerName: String, resellerEmail: String) { - stringValidator()(resellerName) - self.resellerName = resellerName - stringValidator(maxLength: 255)(resellerEmail) - self.resellerEmail = resellerEmail + /// The RansomwareAlertCreateReportFailedType struct + public class RansomwareAlertCreateReportFailedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try RansomwareAlertCreateReportFailedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareAlertCreateReportFailedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareAlertCreateReportFailedType: \(error)" + } } } - open class ResellerLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerLogInfo) -> JSON { - let output = [ - "reseller_name": Serialization._StringSerializer.serialize(value.resellerName), - "reseller_email": Serialization._StringSerializer.serialize(value.resellerEmail), + + public class RansomwareAlertCreateReportFailedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareAlertCreateReportFailedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResellerLogInfo { + + public func deserialize(_ json: JSON) throws -> RansomwareAlertCreateReportFailedType { switch json { - case .dictionary(let dict): - let resellerName = Serialization._StringSerializer.deserialize(dict["reseller_name"] ?? .null) - let resellerEmail = Serialization._StringSerializer.deserialize(dict["reseller_email"] ?? .null) - return ResellerLogInfo(resellerName: resellerName, resellerEmail: resellerEmail) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return RansomwareAlertCreateReportFailedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: RansomwareAlertCreateReportFailedType.self, json: json) } } } - /// The ResellerRole union - public enum ResellerRole: CustomStringConvertible { - /// An unspecified error. - case notReseller - /// An unspecified error. - case resellerAdmin - /// An unspecified error. - case other + /// The RansomwareAlertCreateReportType struct + public class RansomwareAlertCreateReportType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try RansomwareAlertCreateReportTypeSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerRoleSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareAlertCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareAlertCreateReportType: \(error)" + } } } - open class ResellerRoleSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerRole) -> JSON { - switch value { - case .notReseller: - var d = [String: JSON]() - d[".tag"] = .str("not_reseller") - return .dictionary(d) - case .resellerAdmin: - var d = [String: JSON]() - d[".tag"] = .str("reseller_admin") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ResellerRole { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "not_reseller": - return ResellerRole.notReseller - case "reseller_admin": - return ResellerRole.resellerAdmin - case "other": - return ResellerRole.other - default: - return ResellerRole.other - } - default: - fatalError("Failed to deserialize") + + public class RansomwareAlertCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareAlertCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> RansomwareAlertCreateReportType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return RansomwareAlertCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: RansomwareAlertCreateReportType.self, json: json) } } } - /// Enabled/disabled reseller support. - open class ResellerSupportChangePolicyDetails: CustomStringConvertible { - /// New Reseller support policy. - public let newValue: TeamLog.ResellerSupportPolicy - /// Previous Reseller support policy. - public let previousValue: TeamLog.ResellerSupportPolicy - public init(newValue: TeamLog.ResellerSupportPolicy, previousValue: TeamLog.ResellerSupportPolicy) { - self.newValue = newValue - self.previousValue = previousValue + /// Completed ransomware restore process. + public class RansomwareRestoreProcessCompletedDetails: CustomStringConvertible, JSONRepresentable { + /// The status of the restore process. + public let status: String + /// Restored files count. + public let restoredFilesCount: Int64 + /// Restored files failed count. + public let restoredFilesFailedCount: Int64 + public init(status: String, restoredFilesCount: Int64, restoredFilesFailedCount: Int64) { + stringValidator()(status) + self.status = status + comparableValidator()(restoredFilesCount) + self.restoredFilesCount = restoredFilesCount + comparableValidator()(restoredFilesFailedCount) + self.restoredFilesFailedCount = restoredFilesFailedCount + } + + func json() throws -> JSON { + try RansomwareRestoreProcessCompletedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerSupportChangePolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareRestoreProcessCompletedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareRestoreProcessCompletedDetails: \(error)" + } } } - open class ResellerSupportChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerSupportChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.ResellerSupportPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.ResellerSupportPolicySerializer().serialize(value.previousValue), + + public class RansomwareRestoreProcessCompletedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareRestoreProcessCompletedDetails) throws -> JSON { + let output = [ + "status": try Serialization._StringSerializer.serialize(value.status), + "restored_files_count": try Serialization._Int64Serializer.serialize(value.restoredFilesCount), + "restored_files_failed_count": try Serialization._Int64Serializer.serialize(value.restoredFilesFailedCount), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResellerSupportChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> RansomwareRestoreProcessCompletedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ResellerSupportPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.ResellerSupportPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return ResellerSupportChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let status = try Serialization._StringSerializer.deserialize(dict["status"] ?? .null) + let restoredFilesCount = try Serialization._Int64Serializer.deserialize(dict["restored_files_count"] ?? .null) + let restoredFilesFailedCount = try Serialization._Int64Serializer.deserialize(dict["restored_files_failed_count"] ?? .null) + return RansomwareRestoreProcessCompletedDetails( + status: status, + restoredFilesCount: restoredFilesCount, + restoredFilesFailedCount: restoredFilesFailedCount + ) + default: + throw JSONSerializerError.deserializeError(type: RansomwareRestoreProcessCompletedDetails.self, json: json) } } } - /// The ResellerSupportChangePolicyType struct - open class ResellerSupportChangePolicyType: CustomStringConvertible { + /// The RansomwareRestoreProcessCompletedType struct + public class RansomwareRestoreProcessCompletedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerSupportChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try RansomwareRestoreProcessCompletedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareRestoreProcessCompletedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareRestoreProcessCompletedType: \(error)" + } } } - open class ResellerSupportChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerSupportChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class RansomwareRestoreProcessCompletedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareRestoreProcessCompletedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResellerSupportChangePolicyType { + + public func deserialize(_ json: JSON) throws -> RansomwareRestoreProcessCompletedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ResellerSupportChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return RansomwareRestoreProcessCompletedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: RansomwareRestoreProcessCompletedType.self, json: json) } } } - /// Policy for controlling if reseller can access the admin console as administrator - public enum ResellerSupportPolicy: CustomStringConvertible { - /// An unspecified error. - case disabled - /// An unspecified error. - case enabled - /// An unspecified error. - case other + /// Started ransomware restore process. + public class RansomwareRestoreProcessStartedDetails: CustomStringConvertible, JSONRepresentable { + /// Ransomware filename extension. + public let extension_: String + public init(extension_: String) { + stringValidator()(extension_) + self.extension_ = extension_ + } - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerSupportPolicySerializer().serialize(self)))" + func json() throws -> JSON { + try RansomwareRestoreProcessStartedDetailsSerializer().serialize(self) } - } - open class ResellerSupportPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerSupportPolicy) -> JSON { - switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ResellerSupportPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ResellerSupportPolicy.disabled - case "enabled": - return ResellerSupportPolicy.enabled - case "other": - return ResellerSupportPolicy.other - default: - return ResellerSupportPolicy.other - } - default: - fatalError("Failed to deserialize") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareRestoreProcessStartedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareRestoreProcessStartedDetails: \(error)" } } } - /// Ended reseller support session. - open class ResellerSupportSessionEndDetails: CustomStringConvertible { - public init() { - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerSupportSessionEndDetailsSerializer().serialize(self)))" - } - } - open class ResellerSupportSessionEndDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerSupportSessionEndDetails) -> JSON { - let output = [String: JSON]() + public class RansomwareRestoreProcessStartedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareRestoreProcessStartedDetails) throws -> JSON { + let output = [ + "extension": try Serialization._StringSerializer.serialize(value.extension_), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResellerSupportSessionEndDetails { + + public func deserialize(_ json: JSON) throws -> RansomwareRestoreProcessStartedDetails { switch json { - case .dictionary(_): - return ResellerSupportSessionEndDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let extension_ = try Serialization._StringSerializer.deserialize(dict["extension"] ?? .null) + return RansomwareRestoreProcessStartedDetails(extension_: extension_) + default: + throw JSONSerializerError.deserializeError(type: RansomwareRestoreProcessStartedDetails.self, json: json) } } } - /// The ResellerSupportSessionEndType struct - open class ResellerSupportSessionEndType: CustomStringConvertible { + /// The RansomwareRestoreProcessStartedType struct + public class RansomwareRestoreProcessStartedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerSupportSessionEndTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try RansomwareRestoreProcessStartedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RansomwareRestoreProcessStartedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RansomwareRestoreProcessStartedType: \(error)" + } } } - open class ResellerSupportSessionEndTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerSupportSessionEndType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class RansomwareRestoreProcessStartedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RansomwareRestoreProcessStartedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResellerSupportSessionEndType { + + public func deserialize(_ json: JSON) throws -> RansomwareRestoreProcessStartedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ResellerSupportSessionEndType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return RansomwareRestoreProcessStartedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: RansomwareRestoreProcessStartedType.self, json: json) } } } - /// Started reseller support session. - open class ResellerSupportSessionStartDetails: CustomStringConvertible { - public init() { + /// Recipients Configuration + public class RecipientsConfiguration: CustomStringConvertible, JSONRepresentable { + /// Recipients setting type. + public let recipientSettingType: TeamLog.AlertRecipientsSettingType? + /// A list of user emails to notify. + public let emails: [String]? + /// A list of groups to notify. + public let groups: [String]? + public init(recipientSettingType: TeamLog.AlertRecipientsSettingType? = nil, emails: [String]? = nil, groups: [String]? = nil) { + self.recipientSettingType = recipientSettingType + nullableValidator(arrayValidator(itemValidator: stringValidator(maxLength: 255)))(emails) + self.emails = emails + nullableValidator(arrayValidator(itemValidator: stringValidator()))(groups) + self.groups = groups } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerSupportSessionStartDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try RecipientsConfigurationSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RecipientsConfigurationSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RecipientsConfiguration: \(error)" + } } } - open class ResellerSupportSessionStartDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerSupportSessionStartDetails) -> JSON { - let output = [String: JSON]() + + public class RecipientsConfigurationSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RecipientsConfiguration) throws -> JSON { + let output = [ + "recipient_setting_type": try NullableSerializer(TeamLog.AlertRecipientsSettingTypeSerializer()).serialize(value.recipientSettingType), + "emails": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.emails), + "groups": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.groups), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResellerSupportSessionStartDetails { + + public func deserialize(_ json: JSON) throws -> RecipientsConfiguration { switch json { - case .dictionary(_): - return ResellerSupportSessionStartDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let recipientSettingType = try NullableSerializer(TeamLog.AlertRecipientsSettingTypeSerializer()) + .deserialize(dict["recipient_setting_type"] ?? .null) + let emails = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["emails"] ?? .null) + let groups = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["groups"] ?? .null) + return RecipientsConfiguration(recipientSettingType: recipientSettingType, emails: emails, groups: groups) + default: + throw JSONSerializerError.deserializeError(type: RecipientsConfiguration.self, json: json) } } } - /// The ResellerSupportSessionStartType struct - open class ResellerSupportSessionStartType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ + /// Provides the indices of the source asset and the destination asset for a relocate action. + public class RelocateAssetReferencesLogInfo: CustomStringConvertible, JSONRepresentable { + /// Source asset position in the Assets list. + public let srcAssetIndex: UInt64 + /// Destination asset position in the Assets list. + public let destAssetIndex: UInt64 + public init(srcAssetIndex: UInt64, destAssetIndex: UInt64) { + comparableValidator()(srcAssetIndex) + self.srcAssetIndex = srcAssetIndex + comparableValidator()(destAssetIndex) + self.destAssetIndex = destAssetIndex + } + + func json() throws -> JSON { + try RelocateAssetReferencesLogInfoSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ResellerSupportSessionStartTypeSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RelocateAssetReferencesLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RelocateAssetReferencesLogInfo: \(error)" + } } } - open class ResellerSupportSessionStartTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ResellerSupportSessionStartType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class RelocateAssetReferencesLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RelocateAssetReferencesLogInfo) throws -> JSON { + let output = [ + "src_asset_index": try Serialization._UInt64Serializer.serialize(value.srcAssetIndex), + "dest_asset_index": try Serialization._UInt64Serializer.serialize(value.destAssetIndex), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ResellerSupportSessionStartType { + + public func deserialize(_ json: JSON) throws -> RelocateAssetReferencesLogInfo { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ResellerSupportSessionStartType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let srcAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["src_asset_index"] ?? .null) + let destAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["dest_asset_index"] ?? .null) + return RelocateAssetReferencesLogInfo(srcAssetIndex: srcAssetIndex, destAssetIndex: destAssetIndex) + default: + throw JSONSerializerError.deserializeError(type: RelocateAssetReferencesLogInfo.self, json: json) } } } - /// Rewound a folder. - open class RewindFolderDetails: CustomStringConvertible { - /// Folder was Rewound to this date. - public let rewindFolderTargetTsMs: Date - public init(rewindFolderTargetTsMs: Date) { - self.rewindFolderTargetTsMs = rewindFolderTargetTsMs + /// Deleted files in Replay. + public class ReplayFileDeleteDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ReplayFileDeleteDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RewindFolderDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayFileDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayFileDeleteDetails: \(error)" + } } } - open class RewindFolderDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RewindFolderDetails) -> JSON { - let output = [ - "rewind_folder_target_ts_ms": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.rewindFolderTargetTsMs), - ] + + public class ReplayFileDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayFileDeleteDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> RewindFolderDetails { + + public func deserialize(_ json: JSON) throws -> ReplayFileDeleteDetails { switch json { - case .dictionary(let dict): - let rewindFolderTargetTsMs = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["rewind_folder_target_ts_ms"] ?? .null) - return RewindFolderDetails(rewindFolderTargetTsMs: rewindFolderTargetTsMs) - default: - fatalError("Type error deserializing") + case .dictionary: + return ReplayFileDeleteDetails() + default: + throw JSONSerializerError.deserializeError(type: ReplayFileDeleteDetails.self, json: json) } } } - /// The RewindFolderType struct - open class RewindFolderType: CustomStringConvertible { + /// The ReplayFileDeleteType struct + public class ReplayFileDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RewindFolderTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ReplayFileDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayFileDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayFileDeleteType: \(error)" + } } } - open class RewindFolderTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RewindFolderType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ReplayFileDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayFileDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RewindFolderType { + + public func deserialize(_ json: JSON) throws -> ReplayFileDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return RewindFolderType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ReplayFileDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ReplayFileDeleteType.self, json: json) } } } - /// Policy for controlling whether team members can rewind - public enum RewindPolicy: CustomStringConvertible { - /// An unspecified error. - case adminsOnly - /// An unspecified error. - case everyone - /// An unspecified error. - case other + /// Created shared link in Replay. + public class ReplayFileSharedLinkCreatedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ReplayFileSharedLinkCreatedDetailsSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RewindPolicySerializer().serialize(self)))" - } - } - open class RewindPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RewindPolicy) -> JSON { - switch value { - case .adminsOnly: - var d = [String: JSON]() - d[".tag"] = .str("admins_only") - return .dictionary(d) - case .everyone: - var d = [String: JSON]() - d[".tag"] = .str("everyone") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RewindPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admins_only": - return RewindPolicy.adminsOnly - case "everyone": - return RewindPolicy.everyone - case "other": - return RewindPolicy.other - default: - return RewindPolicy.other - } - default: - fatalError("Failed to deserialize") + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayFileSharedLinkCreatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayFileSharedLinkCreatedDetails: \(error)" } } } - /// Changed Rewind policy for team. - open class RewindPolicyChangedDetails: CustomStringConvertible { - /// New Dropbox Rewind policy. - public let newValue: TeamLog.RewindPolicy - /// Previous Dropbox Rewind policy. - public let previousValue: TeamLog.RewindPolicy - public init(newValue: TeamLog.RewindPolicy, previousValue: TeamLog.RewindPolicy) { - self.newValue = newValue - self.previousValue = previousValue - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RewindPolicyChangedDetailsSerializer().serialize(self)))" - } - } - open class RewindPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RewindPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.RewindPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.RewindPolicySerializer().serialize(value.previousValue), - ] + public class ReplayFileSharedLinkCreatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayFileSharedLinkCreatedDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> RewindPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> ReplayFileSharedLinkCreatedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.RewindPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.RewindPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return RewindPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return ReplayFileSharedLinkCreatedDetails() + default: + throw JSONSerializerError.deserializeError(type: ReplayFileSharedLinkCreatedDetails.self, json: json) } } } - /// The RewindPolicyChangedType struct - open class RewindPolicyChangedType: CustomStringConvertible { + /// The ReplayFileSharedLinkCreatedType struct + public class ReplayFileSharedLinkCreatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RewindPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ReplayFileSharedLinkCreatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayFileSharedLinkCreatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayFileSharedLinkCreatedType: \(error)" + } } } - open class RewindPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RewindPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ReplayFileSharedLinkCreatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayFileSharedLinkCreatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> RewindPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> ReplayFileSharedLinkCreatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return RewindPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ReplayFileSharedLinkCreatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ReplayFileSharedLinkCreatedType.self, json: json) } } } - /// Deleted secondary email. - open class SecondaryEmailDeletedDetails: CustomStringConvertible { - /// Deleted secondary email. - public let secondaryEmail: String - public init(secondaryEmail: String) { - stringValidator(maxLength: 255)(secondaryEmail) - self.secondaryEmail = secondaryEmail + /// Modified shared link in Replay. + public class ReplayFileSharedLinkModifiedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ReplayFileSharedLinkModifiedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryEmailDeletedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayFileSharedLinkModifiedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayFileSharedLinkModifiedDetails: \(error)" + } } } - open class SecondaryEmailDeletedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryEmailDeletedDetails) -> JSON { - let output = [ - "secondary_email": Serialization._StringSerializer.serialize(value.secondaryEmail), - ] + + public class ReplayFileSharedLinkModifiedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayFileSharedLinkModifiedDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryEmailDeletedDetails { + + public func deserialize(_ json: JSON) throws -> ReplayFileSharedLinkModifiedDetails { switch json { - case .dictionary(let dict): - let secondaryEmail = Serialization._StringSerializer.deserialize(dict["secondary_email"] ?? .null) - return SecondaryEmailDeletedDetails(secondaryEmail: secondaryEmail) - default: - fatalError("Type error deserializing") + case .dictionary: + return ReplayFileSharedLinkModifiedDetails() + default: + throw JSONSerializerError.deserializeError(type: ReplayFileSharedLinkModifiedDetails.self, json: json) } } } - /// The SecondaryEmailDeletedType struct - open class SecondaryEmailDeletedType: CustomStringConvertible { + /// The ReplayFileSharedLinkModifiedType struct + public class ReplayFileSharedLinkModifiedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryEmailDeletedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ReplayFileSharedLinkModifiedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayFileSharedLinkModifiedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayFileSharedLinkModifiedType: \(error)" + } } } - open class SecondaryEmailDeletedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryEmailDeletedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ReplayFileSharedLinkModifiedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayFileSharedLinkModifiedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryEmailDeletedType { + + public func deserialize(_ json: JSON) throws -> ReplayFileSharedLinkModifiedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SecondaryEmailDeletedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ReplayFileSharedLinkModifiedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ReplayFileSharedLinkModifiedType.self, json: json) } } } - /// Verified secondary email. - open class SecondaryEmailVerifiedDetails: CustomStringConvertible { - /// Verified secondary email. - public let secondaryEmail: String - public init(secondaryEmail: String) { - stringValidator(maxLength: 255)(secondaryEmail) - self.secondaryEmail = secondaryEmail + /// Added member to Replay Project. + public class ReplayProjectTeamAddDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ReplayProjectTeamAddDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryEmailVerifiedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayProjectTeamAddDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayProjectTeamAddDetails: \(error)" + } } } - open class SecondaryEmailVerifiedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryEmailVerifiedDetails) -> JSON { - let output = [ - "secondary_email": Serialization._StringSerializer.serialize(value.secondaryEmail), - ] + + public class ReplayProjectTeamAddDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayProjectTeamAddDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryEmailVerifiedDetails { + + public func deserialize(_ json: JSON) throws -> ReplayProjectTeamAddDetails { switch json { - case .dictionary(let dict): - let secondaryEmail = Serialization._StringSerializer.deserialize(dict["secondary_email"] ?? .null) - return SecondaryEmailVerifiedDetails(secondaryEmail: secondaryEmail) - default: - fatalError("Type error deserializing") + case .dictionary: + return ReplayProjectTeamAddDetails() + default: + throw JSONSerializerError.deserializeError(type: ReplayProjectTeamAddDetails.self, json: json) } } } - /// The SecondaryEmailVerifiedType struct - open class SecondaryEmailVerifiedType: CustomStringConvertible { + /// The ReplayProjectTeamAddType struct + public class ReplayProjectTeamAddType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryEmailVerifiedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ReplayProjectTeamAddTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayProjectTeamAddTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayProjectTeamAddType: \(error)" + } } } - open class SecondaryEmailVerifiedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryEmailVerifiedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ReplayProjectTeamAddTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayProjectTeamAddType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryEmailVerifiedType { + + public func deserialize(_ json: JSON) throws -> ReplayProjectTeamAddType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SecondaryEmailVerifiedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ReplayProjectTeamAddType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ReplayProjectTeamAddType.self, json: json) } } } - /// The SecondaryMailsPolicy union - public enum SecondaryMailsPolicy: CustomStringConvertible { - /// An unspecified error. - case disabled - /// An unspecified error. - case enabled - /// An unspecified error. - case other + /// Removed member from Replay Project. + public class ReplayProjectTeamDeleteDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ReplayProjectTeamDeleteDetailsSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryMailsPolicySerializer().serialize(self)))" - } - } - open class SecondaryMailsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryMailsPolicy) -> JSON { - switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SecondaryMailsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return SecondaryMailsPolicy.disabled - case "enabled": - return SecondaryMailsPolicy.enabled - case "other": - return SecondaryMailsPolicy.other - default: - return SecondaryMailsPolicy.other - } - default: - fatalError("Failed to deserialize") + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayProjectTeamDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayProjectTeamDeleteDetails: \(error)" } } } - /// Secondary mails policy changed. - open class SecondaryMailsPolicyChangedDetails: CustomStringConvertible { - /// Previous secondary mails policy. - public let previousValue: TeamLog.SecondaryMailsPolicy - /// New secondary mails policy. - public let newValue: TeamLog.SecondaryMailsPolicy - public init(previousValue: TeamLog.SecondaryMailsPolicy, newValue: TeamLog.SecondaryMailsPolicy) { - self.previousValue = previousValue - self.newValue = newValue - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryMailsPolicyChangedDetailsSerializer().serialize(self)))" - } - } - open class SecondaryMailsPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryMailsPolicyChangedDetails) -> JSON { - let output = [ - "previous_value": TeamLog.SecondaryMailsPolicySerializer().serialize(value.previousValue), - "new_value": TeamLog.SecondaryMailsPolicySerializer().serialize(value.newValue), - ] + public class ReplayProjectTeamDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayProjectTeamDeleteDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryMailsPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> ReplayProjectTeamDeleteDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.SecondaryMailsPolicySerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.SecondaryMailsPolicySerializer().deserialize(dict["new_value"] ?? .null) - return SecondaryMailsPolicyChangedDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return ReplayProjectTeamDeleteDetails() + default: + throw JSONSerializerError.deserializeError(type: ReplayProjectTeamDeleteDetails.self, json: json) } } } - /// The SecondaryMailsPolicyChangedType struct - open class SecondaryMailsPolicyChangedType: CustomStringConvertible { + /// The ReplayProjectTeamDeleteType struct + public class ReplayProjectTeamDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryMailsPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ReplayProjectTeamDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ReplayProjectTeamDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ReplayProjectTeamDeleteType: \(error)" + } } } - open class SecondaryMailsPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryMailsPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ReplayProjectTeamDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ReplayProjectTeamDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryMailsPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> ReplayProjectTeamDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SecondaryMailsPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ReplayProjectTeamDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ReplayProjectTeamDeleteType.self, json: json) } } } - /// Team merge request acceptance details shown to the secondary team - open class SecondaryTeamRequestAcceptedDetails: CustomStringConvertible { - /// The primary team name. - public let primaryTeam: String - /// The name of the secondary team admin who sent the request originally. - public let sentBy: String - public init(primaryTeam: String, sentBy: String) { - stringValidator()(primaryTeam) - self.primaryTeam = primaryTeam - stringValidator()(sentBy) - self.sentBy = sentBy + /// Reseller information. + public class ResellerLogInfo: CustomStringConvertible, JSONRepresentable { + /// Reseller name. + public let resellerName: String + /// Reseller email. + public let resellerEmail: String + public init(resellerName: String, resellerEmail: String) { + stringValidator()(resellerName) + self.resellerName = resellerName + stringValidator(maxLength: 255)(resellerEmail) + self.resellerEmail = resellerEmail + } + + func json() throws -> JSON { + try ResellerLogInfoSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryTeamRequestAcceptedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerLogInfo: \(error)" + } } } - open class SecondaryTeamRequestAcceptedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryTeamRequestAcceptedDetails) -> JSON { - let output = [ - "primary_team": Serialization._StringSerializer.serialize(value.primaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class ResellerLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerLogInfo) throws -> JSON { + let output = [ + "reseller_name": try Serialization._StringSerializer.serialize(value.resellerName), + "reseller_email": try Serialization._StringSerializer.serialize(value.resellerEmail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryTeamRequestAcceptedDetails { + + public func deserialize(_ json: JSON) throws -> ResellerLogInfo { switch json { - case .dictionary(let dict): - let primaryTeam = Serialization._StringSerializer.deserialize(dict["primary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return SecondaryTeamRequestAcceptedDetails(primaryTeam: primaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let resellerName = try Serialization._StringSerializer.deserialize(dict["reseller_name"] ?? .null) + let resellerEmail = try Serialization._StringSerializer.deserialize(dict["reseller_email"] ?? .null) + return ResellerLogInfo(resellerName: resellerName, resellerEmail: resellerEmail) + default: + throw JSONSerializerError.deserializeError(type: ResellerLogInfo.self, json: json) } } } - /// Team merge request cancellation details shown to the secondary team - open class SecondaryTeamRequestCanceledDetails: CustomStringConvertible { - /// The email of the primary team admin that the request was sent to. - public let sentTo: String - /// The name of the secondary team admin who sent the request originally. - public let sentBy: String - public init(sentTo: String, sentBy: String) { - stringValidator()(sentTo) - self.sentTo = sentTo - stringValidator()(sentBy) - self.sentBy = sentBy + /// The ResellerRole union + public enum ResellerRole: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case notReseller + /// An unspecified error. + case resellerAdmin + /// An unspecified error. + case other + + func json() throws -> JSON { + try ResellerRoleSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryTeamRequestCanceledDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerRoleSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerRole: \(error)" + } } } - open class SecondaryTeamRequestCanceledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryTeamRequestCanceledDetails) -> JSON { - let output = [ - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), - ] - return .dictionary(output) + + public class ResellerRoleSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerRole) throws -> JSON { + switch value { + case .notReseller: + var d = [String: JSON]() + d[".tag"] = .str("not_reseller") + return .dictionary(d) + case .resellerAdmin: + var d = [String: JSON]() + d[".tag"] = .str("reseller_admin") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } } - open func deserialize(_ json: JSON) -> SecondaryTeamRequestCanceledDetails { + + public func deserialize(_ json: JSON) throws -> ResellerRole { switch json { - case .dictionary(let dict): - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return SecondaryTeamRequestCanceledDetails(sentTo: sentTo, sentBy: sentBy) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "not_reseller": + return ResellerRole.notReseller + case "reseller_admin": + return ResellerRole.resellerAdmin + case "other": + return ResellerRole.other default: - fatalError("Type error deserializing") + return ResellerRole.other + } + default: + throw JSONSerializerError.deserializeError(type: ResellerRole.self, json: json) } } } - /// Team merge request expiration details shown to the secondary team - open class SecondaryTeamRequestExpiredDetails: CustomStringConvertible { - /// The email of the primary team admin the request was sent to. - public let sentTo: String - public init(sentTo: String) { - stringValidator()(sentTo) - self.sentTo = sentTo + /// Enabled/disabled reseller support. + public class ResellerSupportChangePolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New Reseller support policy. + public let newValue: TeamLog.ResellerSupportPolicy + /// Previous Reseller support policy. + public let previousValue: TeamLog.ResellerSupportPolicy + public init(newValue: TeamLog.ResellerSupportPolicy, previousValue: TeamLog.ResellerSupportPolicy) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try ResellerSupportChangePolicyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryTeamRequestExpiredDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerSupportChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerSupportChangePolicyDetails: \(error)" + } } } - open class SecondaryTeamRequestExpiredDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryTeamRequestExpiredDetails) -> JSON { - let output = [ - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class ResellerSupportChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerSupportChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ResellerSupportPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.ResellerSupportPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryTeamRequestExpiredDetails { + + public func deserialize(_ json: JSON) throws -> ResellerSupportChangePolicyDetails { switch json { - case .dictionary(let dict): - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return SecondaryTeamRequestExpiredDetails(sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ResellerSupportPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.ResellerSupportPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return ResellerSupportChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ResellerSupportChangePolicyDetails.self, json: json) } } } - /// Team merge request reminder details shown to the secondary team - open class SecondaryTeamRequestReminderDetails: CustomStringConvertible { - /// The email of the primary team admin the request was sent to. - public let sentTo: String - public init(sentTo: String) { - stringValidator()(sentTo) - self.sentTo = sentTo + /// The ResellerSupportChangePolicyType struct + public class ResellerSupportChangePolicyType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ResellerSupportChangePolicyTypeSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SecondaryTeamRequestReminderDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerSupportChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerSupportChangePolicyType: \(error)" + } } } - open class SecondaryTeamRequestReminderDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SecondaryTeamRequestReminderDetails) -> JSON { - let output = [ - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class ResellerSupportChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerSupportChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SecondaryTeamRequestReminderDetails { + + public func deserialize(_ json: JSON) throws -> ResellerSupportChangePolicyType { switch json { - case .dictionary(let dict): - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return SecondaryTeamRequestReminderDetails(sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ResellerSupportChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ResellerSupportChangePolicyType.self, json: json) } } } - /// Policy for controlling team access to send for signature feature - public enum SendForSignaturePolicy: CustomStringConvertible { + /// Policy for controlling if reseller can access the admin console as administrator + public enum ResellerSupportPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -39410,5922 +48039,9757 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try ResellerSupportPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SendForSignaturePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerSupportPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerSupportPolicy: \(error)" + } } } - open class SendForSignaturePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SendForSignaturePolicy) -> JSON { + + public class ResellerSupportPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerSupportPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SendForSignaturePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return SendForSignaturePolicy.disabled - case "enabled": - return SendForSignaturePolicy.enabled - case "other": - return SendForSignaturePolicy.other - default: - return SendForSignaturePolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ResellerSupportPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ResellerSupportPolicy.disabled + case "enabled": + return ResellerSupportPolicy.enabled + case "other": + return ResellerSupportPolicy.other default: - fatalError("Failed to deserialize") + return ResellerSupportPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ResellerSupportPolicy.self, json: json) } } } - /// Changed send for signature policy for team. - open class SendForSignaturePolicyChangedDetails: CustomStringConvertible { - /// New send for signature policy. - public let newValue: TeamLog.SendForSignaturePolicy - /// Previous send for signature policy. - public let previousValue: TeamLog.SendForSignaturePolicy - public init(newValue: TeamLog.SendForSignaturePolicy, previousValue: TeamLog.SendForSignaturePolicy) { - self.newValue = newValue - self.previousValue = previousValue + /// Ended reseller support session. + public class ResellerSupportSessionEndDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ResellerSupportSessionEndDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SendForSignaturePolicyChangedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerSupportSessionEndDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerSupportSessionEndDetails: \(error)" + } } } - open class SendForSignaturePolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SendForSignaturePolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.SendForSignaturePolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.SendForSignaturePolicySerializer().serialize(value.previousValue), - ] + + public class ResellerSupportSessionEndDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerSupportSessionEndDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SendForSignaturePolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> ResellerSupportSessionEndDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.SendForSignaturePolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.SendForSignaturePolicySerializer().deserialize(dict["previous_value"] ?? .null) - return SendForSignaturePolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return ResellerSupportSessionEndDetails() + default: + throw JSONSerializerError.deserializeError(type: ResellerSupportSessionEndDetails.self, json: json) } } } - /// The SendForSignaturePolicyChangedType struct - open class SendForSignaturePolicyChangedType: CustomStringConvertible { + /// The ResellerSupportSessionEndType struct + public class ResellerSupportSessionEndType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SendForSignaturePolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ResellerSupportSessionEndTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerSupportSessionEndTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerSupportSessionEndType: \(error)" + } } } - open class SendForSignaturePolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SendForSignaturePolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ResellerSupportSessionEndTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerSupportSessionEndType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SendForSignaturePolicyChangedType { + + public func deserialize(_ json: JSON) throws -> ResellerSupportSessionEndType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SendForSignaturePolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ResellerSupportSessionEndType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ResellerSupportSessionEndType.self, json: json) } } } - /// Added team to shared folder. - open class SfAddGroupDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// Sharing permission. - public let sharingPermission: String? - /// Team name. - public let teamName: String - public init(targetAssetIndex: UInt64, originalFolderName: String, teamName: String, sharingPermission: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(sharingPermission) - self.sharingPermission = sharingPermission - stringValidator()(teamName) - self.teamName = teamName + /// Started reseller support session. + public class ResellerSupportSessionStartDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ResellerSupportSessionStartDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfAddGroupDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerSupportSessionStartDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerSupportSessionStartDetails: \(error)" + } } } - open class SfAddGroupDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfAddGroupDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "team_name": Serialization._StringSerializer.serialize(value.teamName), - "sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), - ] + + public class ResellerSupportSessionStartDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerSupportSessionStartDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfAddGroupDetails { + + public func deserialize(_ json: JSON) throws -> ResellerSupportSessionStartDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let teamName = Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) - let sharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) - return SfAddGroupDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, teamName: teamName, sharingPermission: sharingPermission) - default: - fatalError("Type error deserializing") + case .dictionary: + return ResellerSupportSessionStartDetails() + default: + throw JSONSerializerError.deserializeError(type: ResellerSupportSessionStartDetails.self, json: json) } } } - /// The SfAddGroupType struct - open class SfAddGroupType: CustomStringConvertible { + /// The ResellerSupportSessionStartType struct + public class ResellerSupportSessionStartType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfAddGroupTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ResellerSupportSessionStartTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ResellerSupportSessionStartTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ResellerSupportSessionStartType: \(error)" + } } } - open class SfAddGroupTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfAddGroupType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ResellerSupportSessionStartTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ResellerSupportSessionStartType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfAddGroupType { + + public func deserialize(_ json: JSON) throws -> ResellerSupportSessionStartType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfAddGroupType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ResellerSupportSessionStartType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ResellerSupportSessionStartType.self, json: json) } } } - /// Allowed non-collaborators to view links to files in shared folder. - open class SfAllowNonMembersToViewSharedLinksDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// Shared folder type. - public let sharedFolderType: String? - public init(targetAssetIndex: UInt64, originalFolderName: String, sharedFolderType: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(sharedFolderType) - self.sharedFolderType = sharedFolderType + /// Rewound a folder. + public class RewindFolderDetails: CustomStringConvertible, JSONRepresentable { + /// Folder was Rewound to this date. + public let rewindFolderTargetTsMs: Date + public init(rewindFolderTargetTsMs: Date) { + self.rewindFolderTargetTsMs = rewindFolderTargetTsMs } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfAllowNonMembersToViewSharedLinksDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try RewindFolderDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RewindFolderDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RewindFolderDetails: \(error)" + } } } - open class SfAllowNonMembersToViewSharedLinksDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfAllowNonMembersToViewSharedLinksDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "shared_folder_type": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedFolderType), + + public class RewindFolderDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RewindFolderDetails) throws -> JSON { + let output = [ + "rewind_folder_target_ts_ms": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.rewindFolderTargetTsMs), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfAllowNonMembersToViewSharedLinksDetails { + + public func deserialize(_ json: JSON) throws -> RewindFolderDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let sharedFolderType = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_folder_type"] ?? .null) - return SfAllowNonMembersToViewSharedLinksDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, sharedFolderType: sharedFolderType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let rewindFolderTargetTsMs = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["rewind_folder_target_ts_ms"] ?? .null) + return RewindFolderDetails(rewindFolderTargetTsMs: rewindFolderTargetTsMs) + default: + throw JSONSerializerError.deserializeError(type: RewindFolderDetails.self, json: json) } } } - /// The SfAllowNonMembersToViewSharedLinksType struct - open class SfAllowNonMembersToViewSharedLinksType: CustomStringConvertible { + /// The RewindFolderType struct + public class RewindFolderType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfAllowNonMembersToViewSharedLinksTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try RewindFolderTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RewindFolderTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RewindFolderType: \(error)" + } } } - open class SfAllowNonMembersToViewSharedLinksTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfAllowNonMembersToViewSharedLinksType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class RewindFolderTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RewindFolderType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfAllowNonMembersToViewSharedLinksType { + + public func deserialize(_ json: JSON) throws -> RewindFolderType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return RewindFolderType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: RewindFolderType.self, json: json) + } + } + } + + /// Policy for controlling whether team members can rewind + public enum RewindPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case adminsOnly + /// An unspecified error. + case everyone + /// An unspecified error. + case other + + func json() throws -> JSON { + try RewindPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RewindPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for RewindPolicy: \(error)" + } + } + } + + public class RewindPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RewindPolicy) throws -> JSON { + switch value { + case .adminsOnly: + var d = [String: JSON]() + d[".tag"] = .str("admins_only") + return .dictionary(d) + case .everyone: + var d = [String: JSON]() + d[".tag"] = .str("everyone") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RewindPolicy { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfAllowNonMembersToViewSharedLinksType(description_: description_) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admins_only": + return RewindPolicy.adminsOnly + case "everyone": + return RewindPolicy.everyone + case "other": + return RewindPolicy.other default: - fatalError("Type error deserializing") + return RewindPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: RewindPolicy.self, json: json) } } } - /// Set team members to see warning before sharing folders outside team. - open class SfExternalInviteWarnDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// New sharing permission. - public let newSharingPermission: String? - /// Previous sharing permission. - public let previousSharingPermission: String? - public init(targetAssetIndex: UInt64, originalFolderName: String, newSharingPermission: String? = nil, previousSharingPermission: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(newSharingPermission) - self.newSharingPermission = newSharingPermission - nullableValidator(stringValidator())(previousSharingPermission) - self.previousSharingPermission = previousSharingPermission + /// Changed Rewind policy for team. + public class RewindPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { + /// New Dropbox Rewind policy. + public let newValue: TeamLog.RewindPolicy + /// Previous Dropbox Rewind policy. + public let previousValue: TeamLog.RewindPolicy + public init(newValue: TeamLog.RewindPolicy, previousValue: TeamLog.RewindPolicy) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try RewindPolicyChangedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfExternalInviteWarnDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RewindPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RewindPolicyChangedDetails: \(error)" + } } } - open class SfExternalInviteWarnDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfExternalInviteWarnDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "new_sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.newSharingPermission), - "previous_sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.previousSharingPermission), + + public class RewindPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RewindPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.RewindPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.RewindPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfExternalInviteWarnDetails { + + public func deserialize(_ json: JSON) throws -> RewindPolicyChangedDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let newSharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_sharing_permission"] ?? .null) - let previousSharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_sharing_permission"] ?? .null) - return SfExternalInviteWarnDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, newSharingPermission: newSharingPermission, previousSharingPermission: previousSharingPermission) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.RewindPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.RewindPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return RewindPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: RewindPolicyChangedDetails.self, json: json) } } } - /// The SfExternalInviteWarnType struct - open class SfExternalInviteWarnType: CustomStringConvertible { + /// The RewindPolicyChangedType struct + public class RewindPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfExternalInviteWarnTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try RewindPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RewindPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RewindPolicyChangedType: \(error)" + } } } - open class SfExternalInviteWarnTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfExternalInviteWarnType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class RewindPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RewindPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfExternalInviteWarnType { + + public func deserialize(_ json: JSON) throws -> RewindPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfExternalInviteWarnType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return RewindPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: RewindPolicyChangedType.self, json: json) } } } - /// Changed Facebook user's role in shared folder. - open class SfFbInviteChangeRoleDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// Previous sharing permission. - public let previousSharingPermission: String? - /// New sharing permission. - public let newSharingPermission: String? - public init(targetAssetIndex: UInt64, originalFolderName: String, previousSharingPermission: String? = nil, newSharingPermission: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(previousSharingPermission) - self.previousSharingPermission = previousSharingPermission - nullableValidator(stringValidator())(newSharingPermission) - self.newSharingPermission = newSharingPermission + /// Deleted secondary email. + public class SecondaryEmailDeletedDetails: CustomStringConvertible, JSONRepresentable { + /// Deleted secondary email. + public let secondaryEmail: String + public init(secondaryEmail: String) { + stringValidator(maxLength: 255)(secondaryEmail) + self.secondaryEmail = secondaryEmail + } + + func json() throws -> JSON { + try SecondaryEmailDeletedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfFbInviteChangeRoleDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryEmailDeletedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryEmailDeletedDetails: \(error)" + } } } - open class SfFbInviteChangeRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfFbInviteChangeRoleDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "previous_sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.previousSharingPermission), - "new_sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.newSharingPermission), + + public class SecondaryEmailDeletedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryEmailDeletedDetails) throws -> JSON { + let output = [ + "secondary_email": try Serialization._StringSerializer.serialize(value.secondaryEmail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfFbInviteChangeRoleDetails { + + public func deserialize(_ json: JSON) throws -> SecondaryEmailDeletedDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let previousSharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_sharing_permission"] ?? .null) - let newSharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_sharing_permission"] ?? .null) - return SfFbInviteChangeRoleDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, previousSharingPermission: previousSharingPermission, newSharingPermission: newSharingPermission) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryEmail = try Serialization._StringSerializer.deserialize(dict["secondary_email"] ?? .null) + return SecondaryEmailDeletedDetails(secondaryEmail: secondaryEmail) + default: + throw JSONSerializerError.deserializeError(type: SecondaryEmailDeletedDetails.self, json: json) } } } - /// The SfFbInviteChangeRoleType struct - open class SfFbInviteChangeRoleType: CustomStringConvertible { + /// The SecondaryEmailDeletedType struct + public class SecondaryEmailDeletedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfFbInviteChangeRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SecondaryEmailDeletedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryEmailDeletedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryEmailDeletedType: \(error)" + } } } - open class SfFbInviteChangeRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfFbInviteChangeRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SecondaryEmailDeletedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryEmailDeletedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfFbInviteChangeRoleType { + + public func deserialize(_ json: JSON) throws -> SecondaryEmailDeletedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfFbInviteChangeRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SecondaryEmailDeletedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SecondaryEmailDeletedType.self, json: json) } } } - /// Invited Facebook users to shared folder. - open class SfFbInviteDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// Sharing permission. - public let sharingPermission: String? - public init(targetAssetIndex: UInt64, originalFolderName: String, sharingPermission: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(sharingPermission) - self.sharingPermission = sharingPermission + /// Verified secondary email. + public class SecondaryEmailVerifiedDetails: CustomStringConvertible, JSONRepresentable { + /// Verified secondary email. + public let secondaryEmail: String + public init(secondaryEmail: String) { + stringValidator(maxLength: 255)(secondaryEmail) + self.secondaryEmail = secondaryEmail + } + + func json() throws -> JSON { + try SecondaryEmailVerifiedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfFbInviteDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryEmailVerifiedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryEmailVerifiedDetails: \(error)" + } } } - open class SfFbInviteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfFbInviteDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), + + public class SecondaryEmailVerifiedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryEmailVerifiedDetails) throws -> JSON { + let output = [ + "secondary_email": try Serialization._StringSerializer.serialize(value.secondaryEmail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfFbInviteDetails { + + public func deserialize(_ json: JSON) throws -> SecondaryEmailVerifiedDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let sharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) - return SfFbInviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, sharingPermission: sharingPermission) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryEmail = try Serialization._StringSerializer.deserialize(dict["secondary_email"] ?? .null) + return SecondaryEmailVerifiedDetails(secondaryEmail: secondaryEmail) + default: + throw JSONSerializerError.deserializeError(type: SecondaryEmailVerifiedDetails.self, json: json) } } } - /// The SfFbInviteType struct - open class SfFbInviteType: CustomStringConvertible { + /// The SecondaryEmailVerifiedType struct + public class SecondaryEmailVerifiedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfFbInviteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SecondaryEmailVerifiedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryEmailVerifiedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryEmailVerifiedType: \(error)" + } } } - open class SfFbInviteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfFbInviteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SecondaryEmailVerifiedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryEmailVerifiedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfFbInviteType { + + public func deserialize(_ json: JSON) throws -> SecondaryEmailVerifiedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SecondaryEmailVerifiedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SecondaryEmailVerifiedType.self, json: json) + } + } + } + + /// The SecondaryMailsPolicy union + public enum SecondaryMailsPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case disabled + /// An unspecified error. + case enabled + /// An unspecified error. + case other + + func json() throws -> JSON { + try SecondaryMailsPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryMailsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryMailsPolicy: \(error)" + } + } + } + + public class SecondaryMailsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryMailsPolicy) throws -> JSON { + switch value { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SecondaryMailsPolicy { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfFbInviteType(description_: description_) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return SecondaryMailsPolicy.disabled + case "enabled": + return SecondaryMailsPolicy.enabled + case "other": + return SecondaryMailsPolicy.other default: - fatalError("Type error deserializing") + return SecondaryMailsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SecondaryMailsPolicy.self, json: json) } } } - /// Uninvited Facebook user from shared folder. - open class SfFbUninviteDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - public init(targetAssetIndex: UInt64, originalFolderName: String) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName + /// Secondary mails policy changed. + public class SecondaryMailsPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { + /// Previous secondary mails policy. + public let previousValue: TeamLog.SecondaryMailsPolicy + /// New secondary mails policy. + public let newValue: TeamLog.SecondaryMailsPolicy + public init(previousValue: TeamLog.SecondaryMailsPolicy, newValue: TeamLog.SecondaryMailsPolicy) { + self.previousValue = previousValue + self.newValue = newValue + } + + func json() throws -> JSON { + try SecondaryMailsPolicyChangedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfFbUninviteDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryMailsPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryMailsPolicyChangedDetails: \(error)" + } } } - open class SfFbUninviteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfFbUninviteDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), + + public class SecondaryMailsPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryMailsPolicyChangedDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.SecondaryMailsPolicySerializer().serialize(value.previousValue), + "new_value": try TeamLog.SecondaryMailsPolicySerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfFbUninviteDetails { + + public func deserialize(_ json: JSON) throws -> SecondaryMailsPolicyChangedDetails { + switch json { + case .dictionary(let dict): + let previousValue = try TeamLog.SecondaryMailsPolicySerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.SecondaryMailsPolicySerializer().deserialize(dict["new_value"] ?? .null) + return SecondaryMailsPolicyChangedDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SecondaryMailsPolicyChangedDetails.self, json: json) + } + } + } + + /// The SecondaryMailsPolicyChangedType struct + public class SecondaryMailsPolicyChangedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SecondaryMailsPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryMailsPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryMailsPolicyChangedType: \(error)" + } + } + } + + public class SecondaryMailsPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryMailsPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SecondaryMailsPolicyChangedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SecondaryMailsPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SecondaryMailsPolicyChangedType.self, json: json) + } + } + } + + /// Team merge request acceptance details shown to the secondary team + public class SecondaryTeamRequestAcceptedDetails: CustomStringConvertible, JSONRepresentable { + /// The primary team name. + public let primaryTeam: String + /// The name of the secondary team admin who sent the request originally. + public let sentBy: String + public init(primaryTeam: String, sentBy: String) { + stringValidator()(primaryTeam) + self.primaryTeam = primaryTeam + stringValidator()(sentBy) + self.sentBy = sentBy + } + + func json() throws -> JSON { + try SecondaryTeamRequestAcceptedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryTeamRequestAcceptedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryTeamRequestAcceptedDetails: \(error)" + } + } + } + + public class SecondaryTeamRequestAcceptedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryTeamRequestAcceptedDetails) throws -> JSON { + let output = [ + "primary_team": try Serialization._StringSerializer.serialize(value.primaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SecondaryTeamRequestAcceptedDetails { + switch json { + case .dictionary(let dict): + let primaryTeam = try Serialization._StringSerializer.deserialize(dict["primary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return SecondaryTeamRequestAcceptedDetails(primaryTeam: primaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: SecondaryTeamRequestAcceptedDetails.self, json: json) + } + } + } + + /// Team merge request cancellation details shown to the secondary team + public class SecondaryTeamRequestCanceledDetails: CustomStringConvertible, JSONRepresentable { + /// The email of the primary team admin that the request was sent to. + public let sentTo: String + /// The name of the secondary team admin who sent the request originally. + public let sentBy: String + public init(sentTo: String, sentBy: String) { + stringValidator()(sentTo) + self.sentTo = sentTo + stringValidator()(sentBy) + self.sentBy = sentBy + } + + func json() throws -> JSON { + try SecondaryTeamRequestCanceledDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryTeamRequestCanceledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryTeamRequestCanceledDetails: \(error)" + } + } + } + + public class SecondaryTeamRequestCanceledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryTeamRequestCanceledDetails) throws -> JSON { + let output = [ + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SecondaryTeamRequestCanceledDetails { + switch json { + case .dictionary(let dict): + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return SecondaryTeamRequestCanceledDetails(sentTo: sentTo, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: SecondaryTeamRequestCanceledDetails.self, json: json) + } + } + } + + /// Team merge request expiration details shown to the secondary team + public class SecondaryTeamRequestExpiredDetails: CustomStringConvertible, JSONRepresentable { + /// The email of the primary team admin the request was sent to. + public let sentTo: String + public init(sentTo: String) { + stringValidator()(sentTo) + self.sentTo = sentTo + } + + func json() throws -> JSON { + try SecondaryTeamRequestExpiredDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryTeamRequestExpiredDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryTeamRequestExpiredDetails: \(error)" + } + } + } + + public class SecondaryTeamRequestExpiredDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryTeamRequestExpiredDetails) throws -> JSON { + let output = [ + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SecondaryTeamRequestExpiredDetails { + switch json { + case .dictionary(let dict): + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return SecondaryTeamRequestExpiredDetails(sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: SecondaryTeamRequestExpiredDetails.self, json: json) + } + } + } + + /// Team merge request reminder details shown to the secondary team + public class SecondaryTeamRequestReminderDetails: CustomStringConvertible, JSONRepresentable { + /// The email of the primary team admin the request was sent to. + public let sentTo: String + public init(sentTo: String) { + stringValidator()(sentTo) + self.sentTo = sentTo + } + + func json() throws -> JSON { + try SecondaryTeamRequestReminderDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SecondaryTeamRequestReminderDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SecondaryTeamRequestReminderDetails: \(error)" + } + } + } + + public class SecondaryTeamRequestReminderDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SecondaryTeamRequestReminderDetails) throws -> JSON { + let output = [ + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SecondaryTeamRequestReminderDetails { + switch json { + case .dictionary(let dict): + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return SecondaryTeamRequestReminderDetails(sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: SecondaryTeamRequestReminderDetails.self, json: json) + } + } + } + + /// Policy for controlling team access to send for signature feature + public enum SendForSignaturePolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case disabled + /// An unspecified error. + case enabled + /// An unspecified error. + case other + + func json() throws -> JSON { + try SendForSignaturePolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SendForSignaturePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SendForSignaturePolicy: \(error)" + } + } + } + + public class SendForSignaturePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SendForSignaturePolicy) throws -> JSON { + switch value { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SendForSignaturePolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return SendForSignaturePolicy.disabled + case "enabled": + return SendForSignaturePolicy.enabled + case "other": + return SendForSignaturePolicy.other + default: + return SendForSignaturePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SendForSignaturePolicy.self, json: json) + } + } + } + + /// Changed send for signature policy for team. + public class SendForSignaturePolicyChangedDetails: CustomStringConvertible, JSONRepresentable { + /// New send for signature policy. + public let newValue: TeamLog.SendForSignaturePolicy + /// Previous send for signature policy. + public let previousValue: TeamLog.SendForSignaturePolicy + public init(newValue: TeamLog.SendForSignaturePolicy, previousValue: TeamLog.SendForSignaturePolicy) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SendForSignaturePolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SendForSignaturePolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SendForSignaturePolicyChangedDetails: \(error)" + } + } + } + + public class SendForSignaturePolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SendForSignaturePolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.SendForSignaturePolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.SendForSignaturePolicySerializer().serialize(value.previousValue), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SendForSignaturePolicyChangedDetails { + switch json { + case .dictionary(let dict): + let newValue = try TeamLog.SendForSignaturePolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.SendForSignaturePolicySerializer().deserialize(dict["previous_value"] ?? .null) + return SendForSignaturePolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SendForSignaturePolicyChangedDetails.self, json: json) + } + } + } + + /// The SendForSignaturePolicyChangedType struct + public class SendForSignaturePolicyChangedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SendForSignaturePolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SendForSignaturePolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SendForSignaturePolicyChangedType: \(error)" + } + } + } + + public class SendForSignaturePolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SendForSignaturePolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SendForSignaturePolicyChangedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SendForSignaturePolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SendForSignaturePolicyChangedType.self, json: json) + } + } + } + + /// Added team to shared folder. + public class SfAddGroupDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// Sharing permission. + public let sharingPermission: String? + /// Team name. + public let teamName: String + public init(targetAssetIndex: UInt64, originalFolderName: String, teamName: String, sharingPermission: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(sharingPermission) + self.sharingPermission = sharingPermission + stringValidator()(teamName) + self.teamName = teamName + } + + func json() throws -> JSON { + try SfAddGroupDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfAddGroupDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfAddGroupDetails: \(error)" + } + } + } + + public class SfAddGroupDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfAddGroupDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "team_name": try Serialization._StringSerializer.serialize(value.teamName), + "sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfAddGroupDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let teamName = try Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) + let sharingPermission = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) + return SfAddGroupDetails( + targetAssetIndex: targetAssetIndex, + originalFolderName: originalFolderName, + teamName: teamName, + sharingPermission: sharingPermission + ) + default: + throw JSONSerializerError.deserializeError(type: SfAddGroupDetails.self, json: json) + } + } + } + + /// The SfAddGroupType struct + public class SfAddGroupType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfAddGroupTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfAddGroupTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfAddGroupType: \(error)" + } + } + } + + public class SfAddGroupTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfAddGroupType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfAddGroupType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfAddGroupType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfAddGroupType.self, json: json) + } + } + } + + /// Allowed non-collaborators to view links to files in shared folder. + public class SfAllowNonMembersToViewSharedLinksDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// Shared folder type. + public let sharedFolderType: String? + public init(targetAssetIndex: UInt64, originalFolderName: String, sharedFolderType: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(sharedFolderType) + self.sharedFolderType = sharedFolderType + } + + func json() throws -> JSON { + try SfAllowNonMembersToViewSharedLinksDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfAllowNonMembersToViewSharedLinksDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfAllowNonMembersToViewSharedLinksDetails: \(error)" + } + } + } + + public class SfAllowNonMembersToViewSharedLinksDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfAllowNonMembersToViewSharedLinksDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "shared_folder_type": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedFolderType), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfAllowNonMembersToViewSharedLinksDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let sharedFolderType = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_folder_type"] ?? .null) + return SfAllowNonMembersToViewSharedLinksDetails( + targetAssetIndex: targetAssetIndex, + originalFolderName: originalFolderName, + sharedFolderType: sharedFolderType + ) + default: + throw JSONSerializerError.deserializeError(type: SfAllowNonMembersToViewSharedLinksDetails.self, json: json) + } + } + } + + /// The SfAllowNonMembersToViewSharedLinksType struct + public class SfAllowNonMembersToViewSharedLinksType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfAllowNonMembersToViewSharedLinksTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfAllowNonMembersToViewSharedLinksTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfAllowNonMembersToViewSharedLinksType: \(error)" + } + } + } + + public class SfAllowNonMembersToViewSharedLinksTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfAllowNonMembersToViewSharedLinksType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfAllowNonMembersToViewSharedLinksType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfAllowNonMembersToViewSharedLinksType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfAllowNonMembersToViewSharedLinksType.self, json: json) + } + } + } + + /// Set team members to see warning before sharing folders outside team. + public class SfExternalInviteWarnDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// New sharing permission. + public let newSharingPermission: String? + /// Previous sharing permission. + public let previousSharingPermission: String? + public init(targetAssetIndex: UInt64, originalFolderName: String, newSharingPermission: String? = nil, previousSharingPermission: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(newSharingPermission) + self.newSharingPermission = newSharingPermission + nullableValidator(stringValidator())(previousSharingPermission) + self.previousSharingPermission = previousSharingPermission + } + + func json() throws -> JSON { + try SfExternalInviteWarnDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfExternalInviteWarnDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfExternalInviteWarnDetails: \(error)" + } + } + } + + public class SfExternalInviteWarnDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfExternalInviteWarnDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "new_sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.newSharingPermission), + "previous_sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousSharingPermission), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfExternalInviteWarnDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let newSharingPermission = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_sharing_permission"] ?? .null) + let previousSharingPermission = try NullableSerializer(Serialization._StringSerializer) + .deserialize(dict["previous_sharing_permission"] ?? .null) + return SfExternalInviteWarnDetails( + targetAssetIndex: targetAssetIndex, + originalFolderName: originalFolderName, + newSharingPermission: newSharingPermission, + previousSharingPermission: previousSharingPermission + ) + default: + throw JSONSerializerError.deserializeError(type: SfExternalInviteWarnDetails.self, json: json) + } + } + } + + /// The SfExternalInviteWarnType struct + public class SfExternalInviteWarnType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfExternalInviteWarnTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfExternalInviteWarnTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfExternalInviteWarnType: \(error)" + } + } + } + + public class SfExternalInviteWarnTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfExternalInviteWarnType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfExternalInviteWarnType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfExternalInviteWarnType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfExternalInviteWarnType.self, json: json) + } + } + } + + /// Changed Facebook user's role in shared folder. + public class SfFbInviteChangeRoleDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// Previous sharing permission. + public let previousSharingPermission: String? + /// New sharing permission. + public let newSharingPermission: String? + public init(targetAssetIndex: UInt64, originalFolderName: String, previousSharingPermission: String? = nil, newSharingPermission: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(previousSharingPermission) + self.previousSharingPermission = previousSharingPermission + nullableValidator(stringValidator())(newSharingPermission) + self.newSharingPermission = newSharingPermission + } + + func json() throws -> JSON { + try SfFbInviteChangeRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfFbInviteChangeRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfFbInviteChangeRoleDetails: \(error)" + } + } + } + + public class SfFbInviteChangeRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfFbInviteChangeRoleDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "previous_sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousSharingPermission), + "new_sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.newSharingPermission), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfFbInviteChangeRoleDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let previousSharingPermission = try NullableSerializer(Serialization._StringSerializer) + .deserialize(dict["previous_sharing_permission"] ?? .null) + let newSharingPermission = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_sharing_permission"] ?? .null) + return SfFbInviteChangeRoleDetails( + targetAssetIndex: targetAssetIndex, + originalFolderName: originalFolderName, + previousSharingPermission: previousSharingPermission, + newSharingPermission: newSharingPermission + ) + default: + throw JSONSerializerError.deserializeError(type: SfFbInviteChangeRoleDetails.self, json: json) + } + } + } + + /// The SfFbInviteChangeRoleType struct + public class SfFbInviteChangeRoleType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfFbInviteChangeRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfFbInviteChangeRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfFbInviteChangeRoleType: \(error)" + } + } + } + + public class SfFbInviteChangeRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfFbInviteChangeRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfFbInviteChangeRoleType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfFbInviteChangeRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfFbInviteChangeRoleType.self, json: json) + } + } + } + + /// Invited Facebook users to shared folder. + public class SfFbInviteDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// Sharing permission. + public let sharingPermission: String? + public init(targetAssetIndex: UInt64, originalFolderName: String, sharingPermission: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(sharingPermission) + self.sharingPermission = sharingPermission + } + + func json() throws -> JSON { + try SfFbInviteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfFbInviteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfFbInviteDetails: \(error)" + } + } + } + + public class SfFbInviteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfFbInviteDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfFbInviteDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let sharingPermission = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) + return SfFbInviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, sharingPermission: sharingPermission) + default: + throw JSONSerializerError.deserializeError(type: SfFbInviteDetails.self, json: json) + } + } + } + + /// The SfFbInviteType struct + public class SfFbInviteType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfFbInviteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfFbInviteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfFbInviteType: \(error)" + } + } + } + + public class SfFbInviteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfFbInviteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfFbInviteType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfFbInviteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfFbInviteType.self, json: json) + } + } + } + + /// Uninvited Facebook user from shared folder. + public class SfFbUninviteDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + public init(targetAssetIndex: UInt64, originalFolderName: String) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + } + + func json() throws -> JSON { + try SfFbUninviteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfFbUninviteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfFbUninviteDetails: \(error)" + } + } + } + + public class SfFbUninviteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfFbUninviteDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfFbUninviteDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + return SfFbUninviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) + default: + throw JSONSerializerError.deserializeError(type: SfFbUninviteDetails.self, json: json) + } + } + } + + /// The SfFbUninviteType struct + public class SfFbUninviteType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfFbUninviteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfFbUninviteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfFbUninviteType: \(error)" + } + } + } + + public class SfFbUninviteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfFbUninviteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfFbUninviteType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfFbUninviteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfFbUninviteType.self, json: json) + } + } + } + + /// Invited group to shared folder. + public class SfInviteGroupDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + public init(targetAssetIndex: UInt64) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + } + + func json() throws -> JSON { + try SfInviteGroupDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfInviteGroupDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfInviteGroupDetails: \(error)" + } + } + } + + public class SfInviteGroupDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfInviteGroupDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfInviteGroupDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + return SfInviteGroupDetails(targetAssetIndex: targetAssetIndex) + default: + throw JSONSerializerError.deserializeError(type: SfInviteGroupDetails.self, json: json) + } + } + } + + /// The SfInviteGroupType struct + public class SfInviteGroupType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfInviteGroupTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfInviteGroupTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfInviteGroupType: \(error)" + } + } + } + + public class SfInviteGroupTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfInviteGroupType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfInviteGroupType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfInviteGroupType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfInviteGroupType.self, json: json) + } + } + } + + /// Granted access to shared folder. + public class SfTeamGrantAccessDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + public init(targetAssetIndex: UInt64, originalFolderName: String) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + } + + func json() throws -> JSON { + try SfTeamGrantAccessDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamGrantAccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamGrantAccessDetails: \(error)" + } + } + } + + public class SfTeamGrantAccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamGrantAccessDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamGrantAccessDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + return SfTeamGrantAccessDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) + default: + throw JSONSerializerError.deserializeError(type: SfTeamGrantAccessDetails.self, json: json) + } + } + } + + /// The SfTeamGrantAccessType struct + public class SfTeamGrantAccessType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfTeamGrantAccessTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamGrantAccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamGrantAccessType: \(error)" + } + } + } + + public class SfTeamGrantAccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamGrantAccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamGrantAccessType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfTeamGrantAccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfTeamGrantAccessType.self, json: json) + } + } + } + + /// Changed team member's role in shared folder. + public class SfTeamInviteChangeRoleDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// New sharing permission. + public let newSharingPermission: String? + /// Previous sharing permission. + public let previousSharingPermission: String? + public init(targetAssetIndex: UInt64, originalFolderName: String, newSharingPermission: String? = nil, previousSharingPermission: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(newSharingPermission) + self.newSharingPermission = newSharingPermission + nullableValidator(stringValidator())(previousSharingPermission) + self.previousSharingPermission = previousSharingPermission + } + + func json() throws -> JSON { + try SfTeamInviteChangeRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamInviteChangeRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamInviteChangeRoleDetails: \(error)" + } + } + } + + public class SfTeamInviteChangeRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamInviteChangeRoleDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "new_sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.newSharingPermission), + "previous_sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousSharingPermission), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamInviteChangeRoleDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let newSharingPermission = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_sharing_permission"] ?? .null) + let previousSharingPermission = try NullableSerializer(Serialization._StringSerializer) + .deserialize(dict["previous_sharing_permission"] ?? .null) + return SfTeamInviteChangeRoleDetails( + targetAssetIndex: targetAssetIndex, + originalFolderName: originalFolderName, + newSharingPermission: newSharingPermission, + previousSharingPermission: previousSharingPermission + ) + default: + throw JSONSerializerError.deserializeError(type: SfTeamInviteChangeRoleDetails.self, json: json) + } + } + } + + /// The SfTeamInviteChangeRoleType struct + public class SfTeamInviteChangeRoleType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfTeamInviteChangeRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamInviteChangeRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamInviteChangeRoleType: \(error)" + } + } + } + + public class SfTeamInviteChangeRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamInviteChangeRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamInviteChangeRoleType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfTeamInviteChangeRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfTeamInviteChangeRoleType.self, json: json) + } + } + } + + /// Invited team members to shared folder. + public class SfTeamInviteDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// Sharing permission. + public let sharingPermission: String? + public init(targetAssetIndex: UInt64, originalFolderName: String, sharingPermission: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(sharingPermission) + self.sharingPermission = sharingPermission + } + + func json() throws -> JSON { + try SfTeamInviteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamInviteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamInviteDetails: \(error)" + } + } + } + + public class SfTeamInviteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamInviteDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamInviteDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let sharingPermission = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) + return SfTeamInviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, sharingPermission: sharingPermission) + default: + throw JSONSerializerError.deserializeError(type: SfTeamInviteDetails.self, json: json) + } + } + } + + /// The SfTeamInviteType struct + public class SfTeamInviteType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfTeamInviteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamInviteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamInviteType: \(error)" + } + } + } + + public class SfTeamInviteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamInviteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamInviteType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfTeamInviteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfTeamInviteType.self, json: json) + } + } + } + + /// Joined team member's shared folder. + public class SfTeamJoinDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + public init(targetAssetIndex: UInt64, originalFolderName: String) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + } + + func json() throws -> JSON { + try SfTeamJoinDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamJoinDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamJoinDetails: \(error)" + } + } + } + + public class SfTeamJoinDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamJoinDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamJoinDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + return SfTeamJoinDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) + default: + throw JSONSerializerError.deserializeError(type: SfTeamJoinDetails.self, json: json) + } + } + } + + /// Joined team member's shared folder from link. + public class SfTeamJoinFromOobLinkDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + /// Shared link token key. + public let tokenKey: String? + /// Sharing permission. + public let sharingPermission: String? + public init(targetAssetIndex: UInt64, originalFolderName: String, tokenKey: String? = nil, sharingPermission: String? = nil) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + nullableValidator(stringValidator())(tokenKey) + self.tokenKey = tokenKey + nullableValidator(stringValidator())(sharingPermission) + self.sharingPermission = sharingPermission + } + + func json() throws -> JSON { + try SfTeamJoinFromOobLinkDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamJoinFromOobLinkDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamJoinFromOobLinkDetails: \(error)" + } + } + } + + public class SfTeamJoinFromOobLinkDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamJoinFromOobLinkDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + "token_key": try NullableSerializer(Serialization._StringSerializer).serialize(value.tokenKey), + "sharing_permission": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamJoinFromOobLinkDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + let tokenKey = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["token_key"] ?? .null) + let sharingPermission = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) + return SfTeamJoinFromOobLinkDetails( + targetAssetIndex: targetAssetIndex, + originalFolderName: originalFolderName, + tokenKey: tokenKey, + sharingPermission: sharingPermission + ) + default: + throw JSONSerializerError.deserializeError(type: SfTeamJoinFromOobLinkDetails.self, json: json) + } + } + } + + /// The SfTeamJoinFromOobLinkType struct + public class SfTeamJoinFromOobLinkType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfTeamJoinFromOobLinkTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamJoinFromOobLinkTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamJoinFromOobLinkType: \(error)" + } + } + } + + public class SfTeamJoinFromOobLinkTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamJoinFromOobLinkType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamJoinFromOobLinkType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfTeamJoinFromOobLinkType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfTeamJoinFromOobLinkType.self, json: json) + } + } + } + + /// The SfTeamJoinType struct + public class SfTeamJoinType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfTeamJoinTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamJoinTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamJoinType: \(error)" + } + } + } + + public class SfTeamJoinTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamJoinType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamJoinType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfTeamJoinType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfTeamJoinType.self, json: json) + } + } + } + + /// Unshared folder with team member. + public class SfTeamUninviteDetails: CustomStringConvertible, JSONRepresentable { + /// Target asset position in the Assets list. + public let targetAssetIndex: UInt64 + /// Original shared folder name. + public let originalFolderName: String + public init(targetAssetIndex: UInt64, originalFolderName: String) { + comparableValidator()(targetAssetIndex) + self.targetAssetIndex = targetAssetIndex + stringValidator()(originalFolderName) + self.originalFolderName = originalFolderName + } + + func json() throws -> JSON { + try SfTeamUninviteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamUninviteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamUninviteDetails: \(error)" + } + } + } + + public class SfTeamUninviteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamUninviteDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + "original_folder_name": try Serialization._StringSerializer.serialize(value.originalFolderName), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamUninviteDetails { + switch json { + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + let originalFolderName = try Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) + return SfTeamUninviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) + default: + throw JSONSerializerError.deserializeError(type: SfTeamUninviteDetails.self, json: json) + } + } + } + + /// The SfTeamUninviteType struct + public class SfTeamUninviteType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SfTeamUninviteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SfTeamUninviteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SfTeamUninviteType: \(error)" + } + } + } + + public class SfTeamUninviteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SfTeamUninviteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SfTeamUninviteType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SfTeamUninviteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SfTeamUninviteType.self, json: json) + } + } + } + + /// Invited user to Dropbox and added them to shared file/folder. + public class SharedContentAddInviteesDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// A list of invitees. + public let invitees: [String] + public init(sharedContentAccessLevel: Sharing.AccessLevel, invitees: [String]) { + self.sharedContentAccessLevel = sharedContentAccessLevel + arrayValidator(itemValidator: stringValidator(maxLength: 255))(invitees) + self.invitees = invitees + } + + func json() throws -> JSON { + try SharedContentAddInviteesDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddInviteesDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddInviteesDetails: \(error)" + } + } + } + + public class SharedContentAddInviteesDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddInviteesDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "invitees": try ArraySerializer(Serialization._StringSerializer).serialize(value.invitees), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddInviteesDetails { + switch json { + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let invitees = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["invitees"] ?? .null) + return SharedContentAddInviteesDetails(sharedContentAccessLevel: sharedContentAccessLevel, invitees: invitees) + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddInviteesDetails.self, json: json) + } + } + } + + /// The SharedContentAddInviteesType struct + public class SharedContentAddInviteesType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SharedContentAddInviteesTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddInviteesTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddInviteesType: \(error)" + } + } + } + + public class SharedContentAddInviteesTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddInviteesType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddInviteesType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentAddInviteesType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddInviteesType.self, json: json) + } + } + } + + /// Added expiration date to link for shared file/folder. + public class SharedContentAddLinkExpiryDetails: CustomStringConvertible, JSONRepresentable { + /// New shared content link expiration date. Might be missing due to historical data gap. + public let newValue: Date? + public init(newValue: Date? = nil) { + self.newValue = newValue + } + + func json() throws -> JSON { + try SharedContentAddLinkExpiryDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddLinkExpiryDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddLinkExpiryDetails: \(error)" + } + } + } + + public class SharedContentAddLinkExpiryDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddLinkExpiryDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddLinkExpiryDetails { + switch json { + case .dictionary(let dict): + let newValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) + return SharedContentAddLinkExpiryDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddLinkExpiryDetails.self, json: json) + } + } + } + + /// The SharedContentAddLinkExpiryType struct + public class SharedContentAddLinkExpiryType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SharedContentAddLinkExpiryTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddLinkExpiryTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddLinkExpiryType: \(error)" + } + } + } + + public class SharedContentAddLinkExpiryTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddLinkExpiryType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddLinkExpiryType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentAddLinkExpiryType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddLinkExpiryType.self, json: json) + } + } + } + + /// Added password to link for shared file/folder. + public class SharedContentAddLinkPasswordDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedContentAddLinkPasswordDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddLinkPasswordDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddLinkPasswordDetails: \(error)" + } + } + } + + public class SharedContentAddLinkPasswordDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddLinkPasswordDetails) throws -> JSON { + let output = [String: JSON]() + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddLinkPasswordDetails { + switch json { + case .dictionary: + return SharedContentAddLinkPasswordDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddLinkPasswordDetails.self, json: json) + } + } + } + + /// The SharedContentAddLinkPasswordType struct + public class SharedContentAddLinkPasswordType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SharedContentAddLinkPasswordTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddLinkPasswordTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddLinkPasswordType: \(error)" + } + } + } + + public class SharedContentAddLinkPasswordTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddLinkPasswordType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddLinkPasswordType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentAddLinkPasswordType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddLinkPasswordType.self, json: json) + } + } + } + + /// Added users and/or groups to shared file/folder. + public class SharedContentAddMemberDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + public init(sharedContentAccessLevel: Sharing.AccessLevel) { + self.sharedContentAccessLevel = sharedContentAccessLevel + } + + func json() throws -> JSON { + try SharedContentAddMemberDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddMemberDetails: \(error)" + } + } + } + + public class SharedContentAddMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddMemberDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddMemberDetails { + switch json { + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + return SharedContentAddMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel) + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddMemberDetails.self, json: json) + } + } + } + + /// The SharedContentAddMemberType struct + public class SharedContentAddMemberType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SharedContentAddMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentAddMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentAddMemberType: \(error)" + } + } + } + + public class SharedContentAddMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentAddMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentAddMemberType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentAddMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentAddMemberType.self, json: json) + } + } + } + + /// Changed whether members can download shared file/folder. + public class SharedContentChangeDownloadsPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New downloads policy. + public let newValue: TeamLog.DownloadPolicyType + /// Previous downloads policy. Might be missing due to historical data gap. + public let previousValue: TeamLog.DownloadPolicyType? + public init(newValue: TeamLog.DownloadPolicyType, previousValue: TeamLog.DownloadPolicyType? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedContentChangeDownloadsPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeDownloadsPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeDownloadsPolicyDetails: \(error)" + } + } + } + + public class SharedContentChangeDownloadsPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeDownloadsPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.DownloadPolicyTypeSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.DownloadPolicyTypeSerializer()).serialize(value.previousValue), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentChangeDownloadsPolicyDetails { + switch json { + case .dictionary(let dict): + let newValue = try TeamLog.DownloadPolicyTypeSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.DownloadPolicyTypeSerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedContentChangeDownloadsPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeDownloadsPolicyDetails.self, json: json) + } + } + } + + /// The SharedContentChangeDownloadsPolicyType struct + public class SharedContentChangeDownloadsPolicyType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SharedContentChangeDownloadsPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeDownloadsPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeDownloadsPolicyType: \(error)" + } + } + } + + public class SharedContentChangeDownloadsPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeDownloadsPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentChangeDownloadsPolicyType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentChangeDownloadsPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeDownloadsPolicyType.self, json: json) + } + } + } + + /// Changed access type of invitee to shared file/folder before invite was accepted. + public class SharedContentChangeInviteeRoleDetails: CustomStringConvertible, JSONRepresentable { + /// Previous access level. Might be missing due to historical data gap. + public let previousAccessLevel: Sharing.AccessLevel? + /// New access level. + public let newAccessLevel: Sharing.AccessLevel + /// The invitee whose role was changed. + public let invitee: String + public init(newAccessLevel: Sharing.AccessLevel, invitee: String, previousAccessLevel: Sharing.AccessLevel? = nil) { + self.previousAccessLevel = previousAccessLevel + self.newAccessLevel = newAccessLevel + stringValidator(maxLength: 255)(invitee) + self.invitee = invitee + } + + func json() throws -> JSON { + try SharedContentChangeInviteeRoleDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeInviteeRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeInviteeRoleDetails: \(error)" + } + } + } + + public class SharedContentChangeInviteeRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeInviteeRoleDetails) throws -> JSON { + let output = [ + "new_access_level": try Sharing.AccessLevelSerializer().serialize(value.newAccessLevel), + "invitee": try Serialization._StringSerializer.serialize(value.invitee), + "previous_access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.previousAccessLevel), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SharedContentChangeInviteeRoleDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - return SfFbUninviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["new_access_level"] ?? .null) + let invitee = try Serialization._StringSerializer.deserialize(dict["invitee"] ?? .null) + let previousAccessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["previous_access_level"] ?? .null) + return SharedContentChangeInviteeRoleDetails(newAccessLevel: newAccessLevel, invitee: invitee, previousAccessLevel: previousAccessLevel) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeInviteeRoleDetails.self, json: json) } } } - /// The SfFbUninviteType struct - open class SfFbUninviteType: CustomStringConvertible { + /// The SharedContentChangeInviteeRoleType struct + public class SharedContentChangeInviteeRoleType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfFbUninviteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentChangeInviteeRoleTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeInviteeRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeInviteeRoleType: \(error)" + } } } - open class SfFbUninviteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfFbUninviteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentChangeInviteeRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeInviteeRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfFbUninviteType { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeInviteeRoleType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfFbUninviteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentChangeInviteeRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeInviteeRoleType.self, json: json) } } } - /// Invited group to shared folder. - open class SfInviteGroupDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - public init(targetAssetIndex: UInt64) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex + /// Changed link audience of shared file/folder. + public class SharedContentChangeLinkAudienceDetails: CustomStringConvertible, JSONRepresentable { + /// New link audience value. + public let newValue: Sharing.LinkAudience + /// Previous link audience value. + public let previousValue: Sharing.LinkAudience? + public init(newValue: Sharing.LinkAudience, previousValue: Sharing.LinkAudience? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedContentChangeLinkAudienceDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfInviteGroupDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeLinkAudienceDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeLinkAudienceDetails: \(error)" + } } } - open class SfInviteGroupDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfInviteGroupDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + + public class SharedContentChangeLinkAudienceDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeLinkAudienceDetails) throws -> JSON { + let output = [ + "new_value": try Sharing.LinkAudienceSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfInviteGroupDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeLinkAudienceDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - return SfInviteGroupDetails(targetAssetIndex: targetAssetIndex) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Sharing.LinkAudienceSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedContentChangeLinkAudienceDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeLinkAudienceDetails.self, json: json) } } } - /// The SfInviteGroupType struct - open class SfInviteGroupType: CustomStringConvertible { + /// The SharedContentChangeLinkAudienceType struct + public class SharedContentChangeLinkAudienceType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfInviteGroupTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentChangeLinkAudienceTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeLinkAudienceTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeLinkAudienceType: \(error)" + } } } - open class SfInviteGroupTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfInviteGroupType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentChangeLinkAudienceTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeLinkAudienceType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfInviteGroupType { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeLinkAudienceType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfInviteGroupType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentChangeLinkAudienceType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeLinkAudienceType.self, json: json) } } } - /// Granted access to shared folder. - open class SfTeamGrantAccessDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - public init(targetAssetIndex: UInt64, originalFolderName: String) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName + /// Changed link expiration of shared file/folder. + public class SharedContentChangeLinkExpiryDetails: CustomStringConvertible, JSONRepresentable { + /// New shared content link expiration date. Might be missing due to historical data gap. + public let newValue: Date? + /// Previous shared content link expiration date. Might be missing due to historical data gap. + public let previousValue: Date? + public init(newValue: Date? = nil, previousValue: Date? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedContentChangeLinkExpiryDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamGrantAccessDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeLinkExpiryDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeLinkExpiryDetails: \(error)" + } } } - open class SfTeamGrantAccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamGrantAccessDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), + + public class SharedContentChangeLinkExpiryDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeLinkExpiryDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), + "previous_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamGrantAccessDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeLinkExpiryDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - return SfTeamGrantAccessDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) + return SharedContentChangeLinkExpiryDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeLinkExpiryDetails.self, json: json) } } } - /// The SfTeamGrantAccessType struct - open class SfTeamGrantAccessType: CustomStringConvertible { + /// The SharedContentChangeLinkExpiryType struct + public class SharedContentChangeLinkExpiryType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamGrantAccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentChangeLinkExpiryTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeLinkExpiryTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeLinkExpiryType: \(error)" + } } } - open class SfTeamGrantAccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamGrantAccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentChangeLinkExpiryTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeLinkExpiryType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamGrantAccessType { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeLinkExpiryType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfTeamGrantAccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentChangeLinkExpiryType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeLinkExpiryType.self, json: json) } } } - /// Changed team member's role in shared folder. - open class SfTeamInviteChangeRoleDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// New sharing permission. - public let newSharingPermission: String? - /// Previous sharing permission. - public let previousSharingPermission: String? - public init(targetAssetIndex: UInt64, originalFolderName: String, newSharingPermission: String? = nil, previousSharingPermission: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(newSharingPermission) - self.newSharingPermission = newSharingPermission - nullableValidator(stringValidator())(previousSharingPermission) - self.previousSharingPermission = previousSharingPermission + /// Changed link password of shared file/folder. + public class SharedContentChangeLinkPasswordDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedContentChangeLinkPasswordDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamInviteChangeRoleDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeLinkPasswordDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeLinkPasswordDetails: \(error)" + } } } - open class SfTeamInviteChangeRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamInviteChangeRoleDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "new_sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.newSharingPermission), - "previous_sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.previousSharingPermission), - ] + + public class SharedContentChangeLinkPasswordDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeLinkPasswordDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamInviteChangeRoleDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeLinkPasswordDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let newSharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_sharing_permission"] ?? .null) - let previousSharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_sharing_permission"] ?? .null) - return SfTeamInviteChangeRoleDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, newSharingPermission: newSharingPermission, previousSharingPermission: previousSharingPermission) - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedContentChangeLinkPasswordDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeLinkPasswordDetails.self, json: json) } } } - /// The SfTeamInviteChangeRoleType struct - open class SfTeamInviteChangeRoleType: CustomStringConvertible { + /// The SharedContentChangeLinkPasswordType struct + public class SharedContentChangeLinkPasswordType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamInviteChangeRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentChangeLinkPasswordTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeLinkPasswordTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeLinkPasswordType: \(error)" + } } } - open class SfTeamInviteChangeRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamInviteChangeRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentChangeLinkPasswordTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeLinkPasswordType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamInviteChangeRoleType { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeLinkPasswordType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfTeamInviteChangeRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentChangeLinkPasswordType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeLinkPasswordType.self, json: json) } } } - /// Invited team members to shared folder. - open class SfTeamInviteDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// Sharing permission. - public let sharingPermission: String? - public init(targetAssetIndex: UInt64, originalFolderName: String, sharingPermission: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(sharingPermission) - self.sharingPermission = sharingPermission + /// Changed access type of shared file/folder member. + public class SharedContentChangeMemberRoleDetails: CustomStringConvertible, JSONRepresentable { + /// Previous access level. Might be missing due to historical data gap. + public let previousAccessLevel: Sharing.AccessLevel? + /// New access level. + public let newAccessLevel: Sharing.AccessLevel + public init(newAccessLevel: Sharing.AccessLevel, previousAccessLevel: Sharing.AccessLevel? = nil) { + self.previousAccessLevel = previousAccessLevel + self.newAccessLevel = newAccessLevel + } + + func json() throws -> JSON { + try SharedContentChangeMemberRoleDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamInviteDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeMemberRoleDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeMemberRoleDetails: \(error)" + } } } - open class SfTeamInviteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamInviteDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), + + public class SharedContentChangeMemberRoleDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeMemberRoleDetails) throws -> JSON { + let output = [ + "new_access_level": try Sharing.AccessLevelSerializer().serialize(value.newAccessLevel), + "previous_access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.previousAccessLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamInviteDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeMemberRoleDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let sharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) - return SfTeamInviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, sharingPermission: sharingPermission) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["new_access_level"] ?? .null) + let previousAccessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["previous_access_level"] ?? .null) + return SharedContentChangeMemberRoleDetails(newAccessLevel: newAccessLevel, previousAccessLevel: previousAccessLevel) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeMemberRoleDetails.self, json: json) } } } - /// The SfTeamInviteType struct - open class SfTeamInviteType: CustomStringConvertible { + /// The SharedContentChangeMemberRoleType struct + public class SharedContentChangeMemberRoleType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamInviteTypeSerializer().serialize(self)))" - } - } - open class SfTeamInviteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamInviteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try SharedContentChangeMemberRoleTypeSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> SfTeamInviteType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfTeamInviteType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeMemberRoleTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeMemberRoleType: \(error)" } } } - /// Joined team member's shared folder. - open class SfTeamJoinDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - public init(targetAssetIndex: UInt64, originalFolderName: String) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamJoinDetailsSerializer().serialize(self)))" - } - } - open class SfTeamJoinDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamJoinDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), + public class SharedContentChangeMemberRoleTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeMemberRoleType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamJoinDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeMemberRoleType { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - return SfTeamJoinDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentChangeMemberRoleType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeMemberRoleType.self, json: json) } } } - /// Joined team member's shared folder from link. - open class SfTeamJoinFromOobLinkDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - /// Shared link token key. - public let tokenKey: String? - /// Sharing permission. - public let sharingPermission: String? - public init(targetAssetIndex: UInt64, originalFolderName: String, tokenKey: String? = nil, sharingPermission: String? = nil) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName - nullableValidator(stringValidator())(tokenKey) - self.tokenKey = tokenKey - nullableValidator(stringValidator())(sharingPermission) - self.sharingPermission = sharingPermission - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamJoinFromOobLinkDetailsSerializer().serialize(self)))" + /// Changed whether members can see who viewed shared file/folder. + public class SharedContentChangeViewerInfoPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New viewer info policy. + public let newValue: Sharing.ViewerInfoPolicy + /// Previous view info policy. + public let previousValue: Sharing.ViewerInfoPolicy? + public init(newValue: Sharing.ViewerInfoPolicy, previousValue: Sharing.ViewerInfoPolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue } - } - open class SfTeamJoinFromOobLinkDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamJoinFromOobLinkDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), - "token_key": NullableSerializer(Serialization._StringSerializer).serialize(value.tokenKey), - "sharing_permission": NullableSerializer(Serialization._StringSerializer).serialize(value.sharingPermission), - ] - return .dictionary(output) + + func json() throws -> JSON { + try SharedContentChangeViewerInfoPolicyDetailsSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> SfTeamJoinFromOobLinkDetails { - switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - let tokenKey = NullableSerializer(Serialization._StringSerializer).deserialize(dict["token_key"] ?? .null) - let sharingPermission = NullableSerializer(Serialization._StringSerializer).deserialize(dict["sharing_permission"] ?? .null) - return SfTeamJoinFromOobLinkDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName, tokenKey: tokenKey, sharingPermission: sharingPermission) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeViewerInfoPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeViewerInfoPolicyDetails: \(error)" } } } - /// The SfTeamJoinFromOobLinkType struct - open class SfTeamJoinFromOobLinkType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamJoinFromOobLinkTypeSerializer().serialize(self)))" - } - } - open class SfTeamJoinFromOobLinkTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamJoinFromOobLinkType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + public class SharedContentChangeViewerInfoPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeViewerInfoPolicyDetails) throws -> JSON { + let output = [ + "new_value": try Sharing.ViewerInfoPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamJoinFromOobLinkType { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeViewerInfoPolicyDetails { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfTeamJoinFromOobLinkType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Sharing.ViewerInfoPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedContentChangeViewerInfoPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeViewerInfoPolicyDetails.self, json: json) } } } - /// The SfTeamJoinType struct - open class SfTeamJoinType: CustomStringConvertible { + /// The SharedContentChangeViewerInfoPolicyType struct + public class SharedContentChangeViewerInfoPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamJoinTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentChangeViewerInfoPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentChangeViewerInfoPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentChangeViewerInfoPolicyType: \(error)" + } } } - open class SfTeamJoinTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamJoinType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentChangeViewerInfoPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentChangeViewerInfoPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamJoinType { + + public func deserialize(_ json: JSON) throws -> SharedContentChangeViewerInfoPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfTeamJoinType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentChangeViewerInfoPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentChangeViewerInfoPolicyType.self, json: json) } } } - /// Unshared folder with team member. - open class SfTeamUninviteDetails: CustomStringConvertible { - /// Target asset position in the Assets list. - public let targetAssetIndex: UInt64 - /// Original shared folder name. - public let originalFolderName: String - public init(targetAssetIndex: UInt64, originalFolderName: String) { - comparableValidator()(targetAssetIndex) - self.targetAssetIndex = targetAssetIndex - stringValidator()(originalFolderName) - self.originalFolderName = originalFolderName + /// Acquired membership of shared file/folder by accepting invite. + public class SharedContentClaimInvitationDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content link. + public let sharedContentLink: String? + public init(sharedContentLink: String? = nil) { + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamUninviteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentClaimInvitationDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentClaimInvitationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentClaimInvitationDetails: \(error)" + } } } - open class SfTeamUninviteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamUninviteDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), - "original_folder_name": Serialization._StringSerializer.serialize(value.originalFolderName), + + public class SharedContentClaimInvitationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentClaimInvitationDetails) throws -> JSON { + let output = [ + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamUninviteDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentClaimInvitationDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - let originalFolderName = Serialization._StringSerializer.deserialize(dict["original_folder_name"] ?? .null) - return SfTeamUninviteDetails(targetAssetIndex: targetAssetIndex, originalFolderName: originalFolderName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + return SharedContentClaimInvitationDetails(sharedContentLink: sharedContentLink) + default: + throw JSONSerializerError.deserializeError(type: SharedContentClaimInvitationDetails.self, json: json) } } } - /// The SfTeamUninviteType struct - open class SfTeamUninviteType: CustomStringConvertible { + /// The SharedContentClaimInvitationType struct + public class SharedContentClaimInvitationType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SfTeamUninviteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentClaimInvitationTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentClaimInvitationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentClaimInvitationType: \(error)" + } } } - open class SfTeamUninviteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SfTeamUninviteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentClaimInvitationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentClaimInvitationType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SfTeamUninviteType { + + public func deserialize(_ json: JSON) throws -> SharedContentClaimInvitationType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SfTeamUninviteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentClaimInvitationType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentClaimInvitationType.self, json: json) } } } - /// Invited user to Dropbox and added them to shared file/folder. - open class SharedContentAddInviteesDetails: CustomStringConvertible { + /// Copied shared file/folder to own Dropbox. + public class SharedContentCopyDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content link. + public let sharedContentLink: String + /// The shared content owner. + public let sharedContentOwner: TeamLog.UserLogInfo? /// Shared content access level. public let sharedContentAccessLevel: Sharing.AccessLevel - /// A list of invitees. - public let invitees: Array - public init(sharedContentAccessLevel: Sharing.AccessLevel, invitees: Array) { + /// The path where the member saved the content. + public let destinationPath: String + public init( + sharedContentLink: String, + sharedContentAccessLevel: Sharing.AccessLevel, + destinationPath: String, + sharedContentOwner: TeamLog.UserLogInfo? = nil + ) { + stringValidator()(sharedContentLink) + self.sharedContentLink = sharedContentLink + self.sharedContentOwner = sharedContentOwner self.sharedContentAccessLevel = sharedContentAccessLevel - arrayValidator(itemValidator: stringValidator(maxLength: 255))(invitees) - self.invitees = invitees + stringValidator()(destinationPath) + self.destinationPath = destinationPath + } + + func json() throws -> JSON { + try SharedContentCopyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddInviteesDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentCopyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentCopyDetails: \(error)" + } } } - open class SharedContentAddInviteesDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddInviteesDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "invitees": ArraySerializer(Serialization._StringSerializer).serialize(value.invitees), + + public class SharedContentCopyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentCopyDetails) throws -> JSON { + let output = [ + "shared_content_link": try Serialization._StringSerializer.serialize(value.sharedContentLink), + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "destination_path": try Serialization._StringSerializer.serialize(value.destinationPath), + "shared_content_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedContentOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddInviteesDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentCopyDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let invitees = ArraySerializer(Serialization._StringSerializer).deserialize(dict["invitees"] ?? .null) - return SharedContentAddInviteesDetails(sharedContentAccessLevel: sharedContentAccessLevel, invitees: invitees) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentLink = try Serialization._StringSerializer.deserialize(dict["shared_content_link"] ?? .null) + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let destinationPath = try Serialization._StringSerializer.deserialize(dict["destination_path"] ?? .null) + let sharedContentOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_content_owner"] ?? .null) + return SharedContentCopyDetails( + sharedContentLink: sharedContentLink, + sharedContentAccessLevel: sharedContentAccessLevel, + destinationPath: destinationPath, + sharedContentOwner: sharedContentOwner + ) + default: + throw JSONSerializerError.deserializeError(type: SharedContentCopyDetails.self, json: json) } } } - /// The SharedContentAddInviteesType struct - open class SharedContentAddInviteesType: CustomStringConvertible { + /// The SharedContentCopyType struct + public class SharedContentCopyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddInviteesTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentCopyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentCopyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentCopyType: \(error)" + } } } - open class SharedContentAddInviteesTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddInviteesType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentCopyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentCopyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddInviteesType { + + public func deserialize(_ json: JSON) throws -> SharedContentCopyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentAddInviteesType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentCopyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentCopyType.self, json: json) } } } - /// Added expiration date to link for shared file/folder. - open class SharedContentAddLinkExpiryDetails: CustomStringConvertible { - /// New shared content link expiration date. Might be missing due to historical data gap. - public let newValue: Date? - public init(newValue: Date? = nil) { - self.newValue = newValue + /// Downloaded shared file/folder. + public class SharedContentDownloadDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content link. + public let sharedContentLink: String + /// The shared content owner. + public let sharedContentOwner: TeamLog.UserLogInfo? + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + public init(sharedContentLink: String, sharedContentAccessLevel: Sharing.AccessLevel, sharedContentOwner: TeamLog.UserLogInfo? = nil) { + stringValidator()(sharedContentLink) + self.sharedContentLink = sharedContentLink + self.sharedContentOwner = sharedContentOwner + self.sharedContentAccessLevel = sharedContentAccessLevel + } + + func json() throws -> JSON { + try SharedContentDownloadDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddLinkExpiryDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentDownloadDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentDownloadDetails: \(error)" + } } } - open class SharedContentAddLinkExpiryDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddLinkExpiryDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), + + public class SharedContentDownloadDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentDownloadDetails) throws -> JSON { + let output = [ + "shared_content_link": try Serialization._StringSerializer.serialize(value.sharedContentLink), + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedContentOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddLinkExpiryDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentDownloadDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) - return SharedContentAddLinkExpiryDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentLink = try Serialization._StringSerializer.deserialize(dict["shared_content_link"] ?? .null) + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_content_owner"] ?? .null) + return SharedContentDownloadDetails( + sharedContentLink: sharedContentLink, + sharedContentAccessLevel: sharedContentAccessLevel, + sharedContentOwner: sharedContentOwner + ) + default: + throw JSONSerializerError.deserializeError(type: SharedContentDownloadDetails.self, json: json) } } } - /// The SharedContentAddLinkExpiryType struct - open class SharedContentAddLinkExpiryType: CustomStringConvertible { + /// The SharedContentDownloadType struct + public class SharedContentDownloadType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddLinkExpiryTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentDownloadTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentDownloadTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentDownloadType: \(error)" + } } } - open class SharedContentAddLinkExpiryTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddLinkExpiryType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentDownloadTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentDownloadType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddLinkExpiryType { + + public func deserialize(_ json: JSON) throws -> SharedContentDownloadType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentAddLinkExpiryType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentDownloadType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentDownloadType.self, json: json) } } } - /// Added password to link for shared file/folder. - open class SharedContentAddLinkPasswordDetails: CustomStringConvertible { - public init() { + /// Left shared file/folder. + public class SharedContentRelinquishMembershipDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedContentRelinquishMembershipDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddLinkPasswordDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRelinquishMembershipDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRelinquishMembershipDetails: \(error)" + } } } - open class SharedContentAddLinkPasswordDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddLinkPasswordDetails) -> JSON { + + public class SharedContentRelinquishMembershipDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRelinquishMembershipDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddLinkPasswordDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRelinquishMembershipDetails { switch json { - case .dictionary(_): - return SharedContentAddLinkPasswordDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedContentRelinquishMembershipDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedContentRelinquishMembershipDetails.self, json: json) } } } - /// The SharedContentAddLinkPasswordType struct - open class SharedContentAddLinkPasswordType: CustomStringConvertible { + /// The SharedContentRelinquishMembershipType struct + public class SharedContentRelinquishMembershipType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddLinkPasswordTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRelinquishMembershipTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRelinquishMembershipTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRelinquishMembershipType: \(error)" + } } } - open class SharedContentAddLinkPasswordTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddLinkPasswordType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRelinquishMembershipTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRelinquishMembershipType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddLinkPasswordType { + + public func deserialize(_ json: JSON) throws -> SharedContentRelinquishMembershipType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentAddLinkPasswordType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRelinquishMembershipType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRelinquishMembershipType.self, json: json) } } } - /// Added users and/or groups to shared file/folder. - open class SharedContentAddMemberDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - public init(sharedContentAccessLevel: Sharing.AccessLevel) { - self.sharedContentAccessLevel = sharedContentAccessLevel + /// Removed invitee from shared file/folder before invite was accepted. + public class SharedContentRemoveInviteesDetails: CustomStringConvertible, JSONRepresentable { + /// A list of invitees. + public let invitees: [String] + public init(invitees: [String]) { + arrayValidator(itemValidator: stringValidator(maxLength: 255))(invitees) + self.invitees = invitees + } + + func json() throws -> JSON { + try SharedContentRemoveInviteesDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddMemberDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveInviteesDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveInviteesDetails: \(error)" + } } } - open class SharedContentAddMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddMemberDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + + public class SharedContentRemoveInviteesDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveInviteesDetails) throws -> JSON { + let output = [ + "invitees": try ArraySerializer(Serialization._StringSerializer).serialize(value.invitees), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddMemberDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveInviteesDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - return SharedContentAddMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let invitees = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["invitees"] ?? .null) + return SharedContentRemoveInviteesDetails(invitees: invitees) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveInviteesDetails.self, json: json) } } } - /// The SharedContentAddMemberType struct - open class SharedContentAddMemberType: CustomStringConvertible { + /// The SharedContentRemoveInviteesType struct + public class SharedContentRemoveInviteesType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentAddMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRemoveInviteesTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveInviteesTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveInviteesType: \(error)" + } } } - open class SharedContentAddMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentAddMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRemoveInviteesTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveInviteesType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentAddMemberType { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveInviteesType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentAddMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRemoveInviteesType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveInviteesType.self, json: json) } } } - /// Changed whether members can download shared file/folder. - open class SharedContentChangeDownloadsPolicyDetails: CustomStringConvertible { - /// New downloads policy. - public let newValue: TeamLog.DownloadPolicyType - /// Previous downloads policy. Might be missing due to historical data gap. - public let previousValue: TeamLog.DownloadPolicyType? - public init(newValue: TeamLog.DownloadPolicyType, previousValue: TeamLog.DownloadPolicyType? = nil) { - self.newValue = newValue + /// Removed link expiration date of shared file/folder. + public class SharedContentRemoveLinkExpiryDetails: CustomStringConvertible, JSONRepresentable { + /// Previous shared content link expiration date. Might be missing due to historical data gap. + public let previousValue: Date? + public init(previousValue: Date? = nil) { self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeDownloadsPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRemoveLinkExpiryDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveLinkExpiryDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveLinkExpiryDetails: \(error)" + } } } - open class SharedContentChangeDownloadsPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeDownloadsPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.DownloadPolicyTypeSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.DownloadPolicyTypeSerializer()).serialize(value.previousValue), + + public class SharedContentRemoveLinkExpiryDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveLinkExpiryDetails) throws -> JSON { + let output = [ + "previous_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeDownloadsPolicyDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveLinkExpiryDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.DownloadPolicyTypeSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.DownloadPolicyTypeSerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedContentChangeDownloadsPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) + return SharedContentRemoveLinkExpiryDetails(previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveLinkExpiryDetails.self, json: json) } } } - /// The SharedContentChangeDownloadsPolicyType struct - open class SharedContentChangeDownloadsPolicyType: CustomStringConvertible { + /// The SharedContentRemoveLinkExpiryType struct + public class SharedContentRemoveLinkExpiryType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeDownloadsPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRemoveLinkExpiryTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveLinkExpiryTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveLinkExpiryType: \(error)" + } } } - open class SharedContentChangeDownloadsPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeDownloadsPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRemoveLinkExpiryTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveLinkExpiryType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeDownloadsPolicyType { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveLinkExpiryType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentChangeDownloadsPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRemoveLinkExpiryType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveLinkExpiryType.self, json: json) } } } - /// Changed access type of invitee to shared file/folder before invite was accepted. - open class SharedContentChangeInviteeRoleDetails: CustomStringConvertible { - /// Previous access level. Might be missing due to historical data gap. - public let previousAccessLevel: Sharing.AccessLevel? - /// New access level. - public let newAccessLevel: Sharing.AccessLevel - /// The invitee whose role was changed. - public let invitee: String - public init(newAccessLevel: Sharing.AccessLevel, invitee: String, previousAccessLevel: Sharing.AccessLevel? = nil) { - self.previousAccessLevel = previousAccessLevel - self.newAccessLevel = newAccessLevel - stringValidator(maxLength: 255)(invitee) - self.invitee = invitee + /// Removed link password of shared file/folder. + public class SharedContentRemoveLinkPasswordDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedContentRemoveLinkPasswordDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeInviteeRoleDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveLinkPasswordDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveLinkPasswordDetails: \(error)" + } } } - open class SharedContentChangeInviteeRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeInviteeRoleDetails) -> JSON { - let output = [ - "new_access_level": Sharing.AccessLevelSerializer().serialize(value.newAccessLevel), - "invitee": Serialization._StringSerializer.serialize(value.invitee), - "previous_access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.previousAccessLevel), - ] + + public class SharedContentRemoveLinkPasswordDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveLinkPasswordDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeInviteeRoleDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveLinkPasswordDetails { switch json { - case .dictionary(let dict): - let newAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["new_access_level"] ?? .null) - let invitee = Serialization._StringSerializer.deserialize(dict["invitee"] ?? .null) - let previousAccessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["previous_access_level"] ?? .null) - return SharedContentChangeInviteeRoleDetails(newAccessLevel: newAccessLevel, invitee: invitee, previousAccessLevel: previousAccessLevel) - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedContentRemoveLinkPasswordDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveLinkPasswordDetails.self, json: json) } } } - /// The SharedContentChangeInviteeRoleType struct - open class SharedContentChangeInviteeRoleType: CustomStringConvertible { + /// The SharedContentRemoveLinkPasswordType struct + public class SharedContentRemoveLinkPasswordType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeInviteeRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRemoveLinkPasswordTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveLinkPasswordTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveLinkPasswordType: \(error)" + } } } - open class SharedContentChangeInviteeRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeInviteeRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRemoveLinkPasswordTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveLinkPasswordType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeInviteeRoleType { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveLinkPasswordType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentChangeInviteeRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRemoveLinkPasswordType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveLinkPasswordType.self, json: json) } } } - /// Changed link audience of shared file/folder. - open class SharedContentChangeLinkAudienceDetails: CustomStringConvertible { - /// New link audience value. - public let newValue: Sharing.LinkAudience - /// Previous link audience value. - public let previousValue: Sharing.LinkAudience? - public init(newValue: Sharing.LinkAudience, previousValue: Sharing.LinkAudience? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Removed user/group from shared file/folder. + public class SharedContentRemoveMemberDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel? + public init(sharedContentAccessLevel: Sharing.AccessLevel? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + } + + func json() throws -> JSON { + try SharedContentRemoveMemberDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeLinkAudienceDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveMemberDetails: \(error)" + } } } - open class SharedContentChangeLinkAudienceDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeLinkAudienceDetails) -> JSON { - let output = [ - "new_value": Sharing.LinkAudienceSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.previousValue), + + public class SharedContentRemoveMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveMemberDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.sharedContentAccessLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeLinkAudienceDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveMemberDetails { switch json { - case .dictionary(let dict): - let newValue = Sharing.LinkAudienceSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedContentChangeLinkAudienceDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try NullableSerializer(Sharing.AccessLevelSerializer()) + .deserialize(dict["shared_content_access_level"] ?? .null) + return SharedContentRemoveMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveMemberDetails.self, json: json) } } } - /// The SharedContentChangeLinkAudienceType struct - open class SharedContentChangeLinkAudienceType: CustomStringConvertible { + /// The SharedContentRemoveMemberType struct + public class SharedContentRemoveMemberType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeLinkAudienceTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRemoveMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRemoveMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRemoveMemberType: \(error)" + } } } - open class SharedContentChangeLinkAudienceTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeLinkAudienceType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRemoveMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRemoveMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeLinkAudienceType { + + public func deserialize(_ json: JSON) throws -> SharedContentRemoveMemberType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentChangeLinkAudienceType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRemoveMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRemoveMemberType.self, json: json) } } } - /// Changed link expiration of shared file/folder. - open class SharedContentChangeLinkExpiryDetails: CustomStringConvertible { - /// New shared content link expiration date. Might be missing due to historical data gap. - public let newValue: Date? - /// Previous shared content link expiration date. Might be missing due to historical data gap. - public let previousValue: Date? - public init(newValue: Date? = nil, previousValue: Date? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Requested access to shared file/folder. + public class SharedContentRequestAccessDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content link. + public let sharedContentLink: String? + public init(sharedContentLink: String? = nil) { + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + } + + func json() throws -> JSON { + try SharedContentRequestAccessDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeLinkExpiryDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRequestAccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRequestAccessDetails: \(error)" + } } } - open class SharedContentChangeLinkExpiryDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeLinkExpiryDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), - "previous_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), + + public class SharedContentRequestAccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRequestAccessDetails) throws -> JSON { + let output = [ + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeLinkExpiryDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRequestAccessDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) - return SharedContentChangeLinkExpiryDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + return SharedContentRequestAccessDetails(sharedContentLink: sharedContentLink) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRequestAccessDetails.self, json: json) } } } - /// The SharedContentChangeLinkExpiryType struct - open class SharedContentChangeLinkExpiryType: CustomStringConvertible { + /// The SharedContentRequestAccessType struct + public class SharedContentRequestAccessType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeLinkExpiryTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRequestAccessTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRequestAccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRequestAccessType: \(error)" + } } } - open class SharedContentChangeLinkExpiryTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeLinkExpiryType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRequestAccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRequestAccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeLinkExpiryType { + + public func deserialize(_ json: JSON) throws -> SharedContentRequestAccessType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentChangeLinkExpiryType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRequestAccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRequestAccessType.self, json: json) } } } - /// Changed link password of shared file/folder. - open class SharedContentChangeLinkPasswordDetails: CustomStringConvertible { - public init() { + /// Restored shared file/folder invitees. + public class SharedContentRestoreInviteesDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// A list of invitees. + public let invitees: [String] + public init(sharedContentAccessLevel: Sharing.AccessLevel, invitees: [String]) { + self.sharedContentAccessLevel = sharedContentAccessLevel + arrayValidator(itemValidator: stringValidator(maxLength: 255))(invitees) + self.invitees = invitees + } + + func json() throws -> JSON { + try SharedContentRestoreInviteesDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeLinkPasswordDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRestoreInviteesDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRestoreInviteesDetails: \(error)" + } } } - open class SharedContentChangeLinkPasswordDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeLinkPasswordDetails) -> JSON { - let output = [String: JSON]() + + public class SharedContentRestoreInviteesDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRestoreInviteesDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "invitees": try ArraySerializer(Serialization._StringSerializer).serialize(value.invitees), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeLinkPasswordDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRestoreInviteesDetails { switch json { - case .dictionary(_): - return SharedContentChangeLinkPasswordDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let invitees = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["invitees"] ?? .null) + return SharedContentRestoreInviteesDetails(sharedContentAccessLevel: sharedContentAccessLevel, invitees: invitees) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRestoreInviteesDetails.self, json: json) } } } - /// The SharedContentChangeLinkPasswordType struct - open class SharedContentChangeLinkPasswordType: CustomStringConvertible { + /// The SharedContentRestoreInviteesType struct + public class SharedContentRestoreInviteesType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeLinkPasswordTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRestoreInviteesTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRestoreInviteesTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRestoreInviteesType: \(error)" + } } } - open class SharedContentChangeLinkPasswordTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeLinkPasswordType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRestoreInviteesTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRestoreInviteesType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeLinkPasswordType { + + public func deserialize(_ json: JSON) throws -> SharedContentRestoreInviteesType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentChangeLinkPasswordType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRestoreInviteesType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRestoreInviteesType.self, json: json) } } } - /// Changed access type of shared file/folder member. - open class SharedContentChangeMemberRoleDetails: CustomStringConvertible { - /// Previous access level. Might be missing due to historical data gap. - public let previousAccessLevel: Sharing.AccessLevel? - /// New access level. - public let newAccessLevel: Sharing.AccessLevel - public init(newAccessLevel: Sharing.AccessLevel, previousAccessLevel: Sharing.AccessLevel? = nil) { - self.previousAccessLevel = previousAccessLevel - self.newAccessLevel = newAccessLevel + /// Restored users and/or groups to membership of shared file/folder. + public class SharedContentRestoreMemberDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + public init(sharedContentAccessLevel: Sharing.AccessLevel) { + self.sharedContentAccessLevel = sharedContentAccessLevel } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeMemberRoleDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRestoreMemberDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRestoreMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRestoreMemberDetails: \(error)" + } } } - open class SharedContentChangeMemberRoleDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeMemberRoleDetails) -> JSON { - let output = [ - "new_access_level": Sharing.AccessLevelSerializer().serialize(value.newAccessLevel), - "previous_access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.previousAccessLevel), + + public class SharedContentRestoreMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRestoreMemberDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeMemberRoleDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentRestoreMemberDetails { switch json { - case .dictionary(let dict): - let newAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["new_access_level"] ?? .null) - let previousAccessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["previous_access_level"] ?? .null) - return SharedContentChangeMemberRoleDetails(newAccessLevel: newAccessLevel, previousAccessLevel: previousAccessLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + return SharedContentRestoreMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRestoreMemberDetails.self, json: json) } } } - /// The SharedContentChangeMemberRoleType struct - open class SharedContentChangeMemberRoleType: CustomStringConvertible { + /// The SharedContentRestoreMemberType struct + public class SharedContentRestoreMemberType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeMemberRoleTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentRestoreMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentRestoreMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentRestoreMemberType: \(error)" + } } } - open class SharedContentChangeMemberRoleTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeMemberRoleType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentRestoreMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentRestoreMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeMemberRoleType { + + public func deserialize(_ json: JSON) throws -> SharedContentRestoreMemberType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentChangeMemberRoleType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentRestoreMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentRestoreMemberType.self, json: json) } } } - /// Changed whether members can see who viewed shared file/folder. - open class SharedContentChangeViewerInfoPolicyDetails: CustomStringConvertible { - /// New viewer info policy. - public let newValue: Sharing.ViewerInfoPolicy - /// Previous view info policy. - public let previousValue: Sharing.ViewerInfoPolicy? - public init(newValue: Sharing.ViewerInfoPolicy, previousValue: Sharing.ViewerInfoPolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Unshared file/folder by clearing membership. + public class SharedContentUnshareDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedContentUnshareDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeViewerInfoPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentUnshareDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentUnshareDetails: \(error)" + } } } - open class SharedContentChangeViewerInfoPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeViewerInfoPolicyDetails) -> JSON { - let output = [ - "new_value": Sharing.ViewerInfoPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(Sharing.ViewerInfoPolicySerializer()).serialize(value.previousValue), - ] + + public class SharedContentUnshareDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentUnshareDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeViewerInfoPolicyDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentUnshareDetails { switch json { - case .dictionary(let dict): - let newValue = Sharing.ViewerInfoPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(Sharing.ViewerInfoPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedContentChangeViewerInfoPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedContentUnshareDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedContentUnshareDetails.self, json: json) } } } - /// The SharedContentChangeViewerInfoPolicyType struct - open class SharedContentChangeViewerInfoPolicyType: CustomStringConvertible { + /// The SharedContentUnshareType struct + public class SharedContentUnshareType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentChangeViewerInfoPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentUnshareTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentUnshareTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentUnshareType: \(error)" + } } } - open class SharedContentChangeViewerInfoPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentChangeViewerInfoPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentUnshareTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentUnshareType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentChangeViewerInfoPolicyType { + + public func deserialize(_ json: JSON) throws -> SharedContentUnshareType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentChangeViewerInfoPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentUnshareType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentUnshareType.self, json: json) } } } - /// Acquired membership of shared file/folder by accepting invite. - open class SharedContentClaimInvitationDetails: CustomStringConvertible { + /// Previewed shared file/folder. + public class SharedContentViewDetails: CustomStringConvertible, JSONRepresentable { /// Shared content link. - public let sharedContentLink: String? - public init(sharedContentLink: String? = nil) { - nullableValidator(stringValidator())(sharedContentLink) + public let sharedContentLink: String + /// The shared content owner. + public let sharedContentOwner: TeamLog.UserLogInfo? + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + public init(sharedContentLink: String, sharedContentAccessLevel: Sharing.AccessLevel, sharedContentOwner: TeamLog.UserLogInfo? = nil) { + stringValidator()(sharedContentLink) self.sharedContentLink = sharedContentLink + self.sharedContentOwner = sharedContentOwner + self.sharedContentAccessLevel = sharedContentAccessLevel + } + + func json() throws -> JSON { + try SharedContentViewDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentClaimInvitationDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentViewDetails: \(error)" + } } } - open class SharedContentClaimInvitationDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentClaimInvitationDetails) -> JSON { - let output = [ - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + + public class SharedContentViewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentViewDetails) throws -> JSON { + let output = [ + "shared_content_link": try Serialization._StringSerializer.serialize(value.sharedContentLink), + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedContentOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentClaimInvitationDetails { + + public func deserialize(_ json: JSON) throws -> SharedContentViewDetails { switch json { - case .dictionary(let dict): - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - return SharedContentClaimInvitationDetails(sharedContentLink: sharedContentLink) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentLink = try Serialization._StringSerializer.deserialize(dict["shared_content_link"] ?? .null) + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_content_owner"] ?? .null) + return SharedContentViewDetails( + sharedContentLink: sharedContentLink, + sharedContentAccessLevel: sharedContentAccessLevel, + sharedContentOwner: sharedContentOwner + ) + default: + throw JSONSerializerError.deserializeError(type: SharedContentViewDetails.self, json: json) } } } - /// The SharedContentClaimInvitationType struct - open class SharedContentClaimInvitationType: CustomStringConvertible { + /// The SharedContentViewType struct + public class SharedContentViewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentClaimInvitationTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedContentViewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedContentViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedContentViewType: \(error)" + } } } - open class SharedContentClaimInvitationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentClaimInvitationType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedContentViewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedContentViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentClaimInvitationType { + + public func deserialize(_ json: JSON) throws -> SharedContentViewType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentClaimInvitationType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedContentViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedContentViewType.self, json: json) } } } - /// Copied shared file/folder to own Dropbox. - open class SharedContentCopyDetails: CustomStringConvertible { - /// Shared content link. - public let sharedContentLink: String - /// The shared content owner. - public let sharedContentOwner: TeamLog.UserLogInfo? - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// The path where the member saved the content. - public let destinationPath: String - public init(sharedContentLink: String, sharedContentAccessLevel: Sharing.AccessLevel, destinationPath: String, sharedContentOwner: TeamLog.UserLogInfo? = nil) { - stringValidator()(sharedContentLink) - self.sharedContentLink = sharedContentLink - self.sharedContentOwner = sharedContentOwner - self.sharedContentAccessLevel = sharedContentAccessLevel - stringValidator()(destinationPath) - self.destinationPath = destinationPath + /// Changed who can access shared folder via link. + public class SharedFolderChangeLinkPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New shared folder link policy. + public let newValue: Sharing.SharedLinkPolicy + /// Previous shared folder link policy. Might be missing due to historical data gap. + public let previousValue: Sharing.SharedLinkPolicy? + public init(newValue: Sharing.SharedLinkPolicy, previousValue: Sharing.SharedLinkPolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentCopyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderChangeLinkPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeLinkPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeLinkPolicyDetails: \(error)" + } } } - open class SharedContentCopyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentCopyDetails) -> JSON { - let output = [ - "shared_content_link": Serialization._StringSerializer.serialize(value.sharedContentLink), - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "destination_path": Serialization._StringSerializer.serialize(value.destinationPath), - "shared_content_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedContentOwner), + + public class SharedFolderChangeLinkPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeLinkPolicyDetails) throws -> JSON { + let output = [ + "new_value": try Sharing.SharedLinkPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentCopyDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeLinkPolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentLink = Serialization._StringSerializer.deserialize(dict["shared_content_link"] ?? .null) - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let destinationPath = Serialization._StringSerializer.deserialize(dict["destination_path"] ?? .null) - let sharedContentOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_content_owner"] ?? .null) - return SharedContentCopyDetails(sharedContentLink: sharedContentLink, sharedContentAccessLevel: sharedContentAccessLevel, destinationPath: destinationPath, sharedContentOwner: sharedContentOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Sharing.SharedLinkPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedFolderChangeLinkPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeLinkPolicyDetails.self, json: json) } } } - /// The SharedContentCopyType struct - open class SharedContentCopyType: CustomStringConvertible { + /// The SharedFolderChangeLinkPolicyType struct + public class SharedFolderChangeLinkPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentCopyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderChangeLinkPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeLinkPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeLinkPolicyType: \(error)" + } } } - open class SharedContentCopyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentCopyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderChangeLinkPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeLinkPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentCopyType { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeLinkPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentCopyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderChangeLinkPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeLinkPolicyType.self, json: json) } } } - /// Downloaded shared file/folder. - open class SharedContentDownloadDetails: CustomStringConvertible { - /// Shared content link. - public let sharedContentLink: String - /// The shared content owner. - public let sharedContentOwner: TeamLog.UserLogInfo? - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - public init(sharedContentLink: String, sharedContentAccessLevel: Sharing.AccessLevel, sharedContentOwner: TeamLog.UserLogInfo? = nil) { - stringValidator()(sharedContentLink) - self.sharedContentLink = sharedContentLink - self.sharedContentOwner = sharedContentOwner - self.sharedContentAccessLevel = sharedContentAccessLevel + /// Changed whether shared folder inherits members from parent folder. + public class SharedFolderChangeMembersInheritancePolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New member inheritance policy. + public let newValue: TeamLog.SharedFolderMembersInheritancePolicy + /// Previous member inheritance policy. Might be missing due to historical data gap. + public let previousValue: TeamLog.SharedFolderMembersInheritancePolicy? + public init(newValue: TeamLog.SharedFolderMembersInheritancePolicy, previousValue: TeamLog.SharedFolderMembersInheritancePolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedFolderChangeMembersInheritancePolicyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentDownloadDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeMembersInheritancePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeMembersInheritancePolicyDetails: \(error)" + } } } - open class SharedContentDownloadDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentDownloadDetails) -> JSON { - let output = [ - "shared_content_link": Serialization._StringSerializer.serialize(value.sharedContentLink), - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedContentOwner), + + public class SharedFolderChangeMembersInheritancePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeMembersInheritancePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.SharedFolderMembersInheritancePolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.SharedFolderMembersInheritancePolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentDownloadDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeMembersInheritancePolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentLink = Serialization._StringSerializer.deserialize(dict["shared_content_link"] ?? .null) - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_content_owner"] ?? .null) - return SharedContentDownloadDetails(sharedContentLink: sharedContentLink, sharedContentAccessLevel: sharedContentAccessLevel, sharedContentOwner: sharedContentOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.SharedFolderMembersInheritancePolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.SharedFolderMembersInheritancePolicySerializer()) + .deserialize(dict["previous_value"] ?? .null) + return SharedFolderChangeMembersInheritancePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeMembersInheritancePolicyDetails.self, json: json) } } } - /// The SharedContentDownloadType struct - open class SharedContentDownloadType: CustomStringConvertible { + /// The SharedFolderChangeMembersInheritancePolicyType struct + public class SharedFolderChangeMembersInheritancePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentDownloadTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderChangeMembersInheritancePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeMembersInheritancePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeMembersInheritancePolicyType: \(error)" + } } } - open class SharedContentDownloadTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentDownloadType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderChangeMembersInheritancePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeMembersInheritancePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentDownloadType { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeMembersInheritancePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentDownloadType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderChangeMembersInheritancePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeMembersInheritancePolicyType.self, json: json) } } } - /// Left shared file/folder. - open class SharedContentRelinquishMembershipDetails: CustomStringConvertible { - public init() { + /// Changed who can add/remove members of shared folder. + public class SharedFolderChangeMembersManagementPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New members management policy. + public let newValue: Sharing.AclUpdatePolicy + /// Previous members management policy. Might be missing due to historical data gap. + public let previousValue: Sharing.AclUpdatePolicy? + public init(newValue: Sharing.AclUpdatePolicy, previousValue: Sharing.AclUpdatePolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedFolderChangeMembersManagementPolicyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRelinquishMembershipDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeMembersManagementPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeMembersManagementPolicyDetails: \(error)" + } } } - open class SharedContentRelinquishMembershipDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRelinquishMembershipDetails) -> JSON { - let output = [String: JSON]() + + public class SharedFolderChangeMembersManagementPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeMembersManagementPolicyDetails) throws -> JSON { + let output = [ + "new_value": try Sharing.AclUpdatePolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.previousValue), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRelinquishMembershipDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeMembersManagementPolicyDetails { switch json { - case .dictionary(_): - return SharedContentRelinquishMembershipDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Sharing.AclUpdatePolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedFolderChangeMembersManagementPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeMembersManagementPolicyDetails.self, json: json) } } } - /// The SharedContentRelinquishMembershipType struct - open class SharedContentRelinquishMembershipType: CustomStringConvertible { + /// The SharedFolderChangeMembersManagementPolicyType struct + public class SharedFolderChangeMembersManagementPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRelinquishMembershipTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderChangeMembersManagementPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeMembersManagementPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeMembersManagementPolicyType: \(error)" + } } } - open class SharedContentRelinquishMembershipTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRelinquishMembershipType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderChangeMembersManagementPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeMembersManagementPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRelinquishMembershipType { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeMembersManagementPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRelinquishMembershipType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderChangeMembersManagementPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeMembersManagementPolicyType.self, json: json) } } } - /// Removed invitee from shared file/folder before invite was accepted. - open class SharedContentRemoveInviteesDetails: CustomStringConvertible { - /// A list of invitees. - public let invitees: Array - public init(invitees: Array) { - arrayValidator(itemValidator: stringValidator(maxLength: 255))(invitees) - self.invitees = invitees + /// Changed who can become member of shared folder. + public class SharedFolderChangeMembersPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New external invite policy. + public let newValue: Sharing.MemberPolicy + /// Previous external invite policy. Might be missing due to historical data gap. + public let previousValue: Sharing.MemberPolicy? + public init(newValue: Sharing.MemberPolicy, previousValue: Sharing.MemberPolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedFolderChangeMembersPolicyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveInviteesDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeMembersPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeMembersPolicyDetails: \(error)" + } } } - open class SharedContentRemoveInviteesDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveInviteesDetails) -> JSON { - let output = [ - "invitees": ArraySerializer(Serialization._StringSerializer).serialize(value.invitees), + + public class SharedFolderChangeMembersPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeMembersPolicyDetails) throws -> JSON { + let output = [ + "new_value": try Sharing.MemberPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveInviteesDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeMembersPolicyDetails { switch json { - case .dictionary(let dict): - let invitees = ArraySerializer(Serialization._StringSerializer).deserialize(dict["invitees"] ?? .null) - return SharedContentRemoveInviteesDetails(invitees: invitees) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Sharing.MemberPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedFolderChangeMembersPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeMembersPolicyDetails.self, json: json) } } } - /// The SharedContentRemoveInviteesType struct - open class SharedContentRemoveInviteesType: CustomStringConvertible { + /// The SharedFolderChangeMembersPolicyType struct + public class SharedFolderChangeMembersPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveInviteesTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderChangeMembersPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderChangeMembersPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderChangeMembersPolicyType: \(error)" + } } } - open class SharedContentRemoveInviteesTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveInviteesType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderChangeMembersPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderChangeMembersPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveInviteesType { + + public func deserialize(_ json: JSON) throws -> SharedFolderChangeMembersPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRemoveInviteesType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderChangeMembersPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderChangeMembersPolicyType.self, json: json) } } } - /// Removed link expiration date of shared file/folder. - open class SharedContentRemoveLinkExpiryDetails: CustomStringConvertible { - /// Previous shared content link expiration date. Might be missing due to historical data gap. - public let previousValue: Date? - public init(previousValue: Date? = nil) { - self.previousValue = previousValue + /// Created shared folder. + public class SharedFolderCreateDetails: CustomStringConvertible, JSONRepresentable { + /// Target namespace ID. + public let targetNsId: String? + public init(targetNsId: String? = nil) { + nullableValidator(stringValidator())(targetNsId) + self.targetNsId = targetNsId + } + + func json() throws -> JSON { + try SharedFolderCreateDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveLinkExpiryDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderCreateDetails: \(error)" + } } } - open class SharedContentRemoveLinkExpiryDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveLinkExpiryDetails) -> JSON { - let output = [ - "previous_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), + + public class SharedFolderCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderCreateDetails) throws -> JSON { + let output = [ + "target_ns_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.targetNsId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveLinkExpiryDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderCreateDetails { switch json { - case .dictionary(let dict): - let previousValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) - return SharedContentRemoveLinkExpiryDetails(previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let targetNsId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["target_ns_id"] ?? .null) + return SharedFolderCreateDetails(targetNsId: targetNsId) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderCreateDetails.self, json: json) } } } - /// The SharedContentRemoveLinkExpiryType struct - open class SharedContentRemoveLinkExpiryType: CustomStringConvertible { + /// The SharedFolderCreateType struct + public class SharedFolderCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveLinkExpiryTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderCreateType: \(error)" + } } } - open class SharedContentRemoveLinkExpiryTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveLinkExpiryType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveLinkExpiryType { + + public func deserialize(_ json: JSON) throws -> SharedFolderCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRemoveLinkExpiryType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderCreateType.self, json: json) } } } - /// Removed link password of shared file/folder. - open class SharedContentRemoveLinkPasswordDetails: CustomStringConvertible { - public init() { + /// Declined team member's invite to shared folder. + public class SharedFolderDeclineInvitationDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedFolderDeclineInvitationDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveLinkPasswordDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderDeclineInvitationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderDeclineInvitationDetails: \(error)" + } } } - open class SharedContentRemoveLinkPasswordDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveLinkPasswordDetails) -> JSON { + + public class SharedFolderDeclineInvitationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderDeclineInvitationDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveLinkPasswordDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderDeclineInvitationDetails { switch json { - case .dictionary(_): - return SharedContentRemoveLinkPasswordDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedFolderDeclineInvitationDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedFolderDeclineInvitationDetails.self, json: json) } } } - /// The SharedContentRemoveLinkPasswordType struct - open class SharedContentRemoveLinkPasswordType: CustomStringConvertible { + /// The SharedFolderDeclineInvitationType struct + public class SharedFolderDeclineInvitationType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveLinkPasswordTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderDeclineInvitationTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderDeclineInvitationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderDeclineInvitationType: \(error)" + } } } - open class SharedContentRemoveLinkPasswordTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveLinkPasswordType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderDeclineInvitationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderDeclineInvitationType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveLinkPasswordType { + + public func deserialize(_ json: JSON) throws -> SharedFolderDeclineInvitationType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderDeclineInvitationType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderDeclineInvitationType.self, json: json) + } + } + } + + /// Specifies if a shared folder inherits its members from the parent folder. + public enum SharedFolderMembersInheritancePolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case dontInheritMembers + /// An unspecified error. + case inheritMembers + /// An unspecified error. + case other + + func json() throws -> JSON { + try SharedFolderMembersInheritancePolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMembersInheritancePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMembersInheritancePolicy: \(error)" + } + } + } + + public class SharedFolderMembersInheritancePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMembersInheritancePolicy) throws -> JSON { + switch value { + case .dontInheritMembers: + var d = [String: JSON]() + d[".tag"] = .str("dont_inherit_members") + return .dictionary(d) + case .inheritMembers: + var d = [String: JSON]() + d[".tag"] = .str("inherit_members") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedFolderMembersInheritancePolicy { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRemoveLinkPasswordType(description_: description_) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "dont_inherit_members": + return SharedFolderMembersInheritancePolicy.dontInheritMembers + case "inherit_members": + return SharedFolderMembersInheritancePolicy.inheritMembers + case "other": + return SharedFolderMembersInheritancePolicy.other default: - fatalError("Type error deserializing") + return SharedFolderMembersInheritancePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMembersInheritancePolicy.self, json: json) } } } - /// Removed user/group from shared file/folder. - open class SharedContentRemoveMemberDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel? - public init(sharedContentAccessLevel: Sharing.AccessLevel? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel + /// Added shared folder to own Dropbox. + public class SharedFolderMountDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedFolderMountDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveMemberDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMountDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMountDetails: \(error)" + } } } - open class SharedContentRemoveMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveMemberDetails) -> JSON { - let output = [ - "shared_content_access_level": NullableSerializer(Sharing.AccessLevelSerializer()).serialize(value.sharedContentAccessLevel), - ] + + public class SharedFolderMountDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMountDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveMemberDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderMountDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = NullableSerializer(Sharing.AccessLevelSerializer()).deserialize(dict["shared_content_access_level"] ?? .null) - return SharedContentRemoveMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel) - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedFolderMountDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMountDetails.self, json: json) } } } - /// The SharedContentRemoveMemberType struct - open class SharedContentRemoveMemberType: CustomStringConvertible { + /// The SharedFolderMountType struct + public class SharedFolderMountType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRemoveMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderMountTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMountTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMountType: \(error)" + } } } - open class SharedContentRemoveMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRemoveMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderMountTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMountType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRemoveMemberType { + + public func deserialize(_ json: JSON) throws -> SharedFolderMountType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRemoveMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderMountType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMountType.self, json: json) } } } - /// Requested access to shared file/folder. - open class SharedContentRequestAccessDetails: CustomStringConvertible { - /// Shared content link. - public let sharedContentLink: String? - public init(sharedContentLink: String? = nil) { - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink + /// Changed parent of shared folder. + public class SharedFolderNestDetails: CustomStringConvertible, JSONRepresentable { + /// Previous parent namespace ID. + public let previousParentNsId: String? + /// New parent namespace ID. + public let newParentNsId: String? + /// Previous namespace path. + public let previousNsPath: String? + /// New namespace path. + public let newNsPath: String? + public init(previousParentNsId: String? = nil, newParentNsId: String? = nil, previousNsPath: String? = nil, newNsPath: String? = nil) { + nullableValidator(stringValidator())(previousParentNsId) + self.previousParentNsId = previousParentNsId + nullableValidator(stringValidator())(newParentNsId) + self.newParentNsId = newParentNsId + nullableValidator(stringValidator())(previousNsPath) + self.previousNsPath = previousNsPath + nullableValidator(stringValidator())(newNsPath) + self.newNsPath = newNsPath + } + + func json() throws -> JSON { + try SharedFolderNestDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRequestAccessDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderNestDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderNestDetails: \(error)" + } } } - open class SharedContentRequestAccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRequestAccessDetails) -> JSON { - let output = [ - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + + public class SharedFolderNestDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderNestDetails) throws -> JSON { + let output = [ + "previous_parent_ns_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousParentNsId), + "new_parent_ns_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.newParentNsId), + "previous_ns_path": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousNsPath), + "new_ns_path": try NullableSerializer(Serialization._StringSerializer).serialize(value.newNsPath), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRequestAccessDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderNestDetails { switch json { - case .dictionary(let dict): - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - return SharedContentRequestAccessDetails(sharedContentLink: sharedContentLink) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousParentNsId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_parent_ns_id"] ?? .null) + let newParentNsId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_parent_ns_id"] ?? .null) + let previousNsPath = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_ns_path"] ?? .null) + let newNsPath = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_ns_path"] ?? .null) + return SharedFolderNestDetails( + previousParentNsId: previousParentNsId, + newParentNsId: newParentNsId, + previousNsPath: previousNsPath, + newNsPath: newNsPath + ) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderNestDetails.self, json: json) } } } - /// The SharedContentRequestAccessType struct - open class SharedContentRequestAccessType: CustomStringConvertible { + /// The SharedFolderNestType struct + public class SharedFolderNestType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRequestAccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderNestTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderNestTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderNestType: \(error)" + } } } - open class SharedContentRequestAccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRequestAccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderNestTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderNestType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRequestAccessType { + + public func deserialize(_ json: JSON) throws -> SharedFolderNestType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRequestAccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderNestType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderNestType.self, json: json) } } } - /// Restored shared file/folder invitees. - open class SharedContentRestoreInviteesDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// A list of invitees. - public let invitees: Array - public init(sharedContentAccessLevel: Sharing.AccessLevel, invitees: Array) { - self.sharedContentAccessLevel = sharedContentAccessLevel - arrayValidator(itemValidator: stringValidator(maxLength: 255))(invitees) - self.invitees = invitees + /// Transferred ownership of shared folder to another member. + public class SharedFolderTransferOwnershipDetails: CustomStringConvertible, JSONRepresentable { + /// The email address of the previous shared folder owner. + public let previousOwnerEmail: String? + /// The email address of the new shared folder owner. + public let newOwnerEmail: String + public init(newOwnerEmail: String, previousOwnerEmail: String? = nil) { + nullableValidator(stringValidator(maxLength: 255))(previousOwnerEmail) + self.previousOwnerEmail = previousOwnerEmail + stringValidator(maxLength: 255)(newOwnerEmail) + self.newOwnerEmail = newOwnerEmail } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRestoreInviteesDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderTransferOwnershipDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderTransferOwnershipDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderTransferOwnershipDetails: \(error)" + } } } - open class SharedContentRestoreInviteesDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRestoreInviteesDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "invitees": ArraySerializer(Serialization._StringSerializer).serialize(value.invitees), + + public class SharedFolderTransferOwnershipDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderTransferOwnershipDetails) throws -> JSON { + let output = [ + "new_owner_email": try Serialization._StringSerializer.serialize(value.newOwnerEmail), + "previous_owner_email": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousOwnerEmail), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRestoreInviteesDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderTransferOwnershipDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let invitees = ArraySerializer(Serialization._StringSerializer).deserialize(dict["invitees"] ?? .null) - return SharedContentRestoreInviteesDetails(sharedContentAccessLevel: sharedContentAccessLevel, invitees: invitees) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newOwnerEmail = try Serialization._StringSerializer.deserialize(dict["new_owner_email"] ?? .null) + let previousOwnerEmail = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_owner_email"] ?? .null) + return SharedFolderTransferOwnershipDetails(newOwnerEmail: newOwnerEmail, previousOwnerEmail: previousOwnerEmail) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderTransferOwnershipDetails.self, json: json) } } } - /// The SharedContentRestoreInviteesType struct - open class SharedContentRestoreInviteesType: CustomStringConvertible { + /// The SharedFolderTransferOwnershipType struct + public class SharedFolderTransferOwnershipType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRestoreInviteesTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderTransferOwnershipTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderTransferOwnershipTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderTransferOwnershipType: \(error)" + } } } - open class SharedContentRestoreInviteesTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRestoreInviteesType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderTransferOwnershipTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderTransferOwnershipType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRestoreInviteesType { + + public func deserialize(_ json: JSON) throws -> SharedFolderTransferOwnershipType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRestoreInviteesType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderTransferOwnershipType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderTransferOwnershipType.self, json: json) } } } - /// Restored users and/or groups to membership of shared file/folder. - open class SharedContentRestoreMemberDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - public init(sharedContentAccessLevel: Sharing.AccessLevel) { - self.sharedContentAccessLevel = sharedContentAccessLevel + /// Deleted shared folder from Dropbox. + public class SharedFolderUnmountDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedFolderUnmountDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRestoreMemberDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderUnmountDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderUnmountDetails: \(error)" + } } } - open class SharedContentRestoreMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRestoreMemberDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - ] + + public class SharedFolderUnmountDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderUnmountDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRestoreMemberDetails { + + public func deserialize(_ json: JSON) throws -> SharedFolderUnmountDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - return SharedContentRestoreMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel) - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedFolderUnmountDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedFolderUnmountDetails.self, json: json) } } } - /// The SharedContentRestoreMemberType struct - open class SharedContentRestoreMemberType: CustomStringConvertible { + /// The SharedFolderUnmountType struct + public class SharedFolderUnmountType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentRestoreMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedFolderUnmountTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderUnmountTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderUnmountType: \(error)" + } } } - open class SharedContentRestoreMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentRestoreMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedFolderUnmountTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderUnmountType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentRestoreMemberType { + + public func deserialize(_ json: JSON) throws -> SharedFolderUnmountType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentRestoreMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedFolderUnmountType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedFolderUnmountType.self, json: json) } } } - /// Unshared file/folder by clearing membership. - open class SharedContentUnshareDetails: CustomStringConvertible { - public init() { + /// Shared link access level. + public enum SharedLinkAccessLevel: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case none + /// An unspecified error. + case reader + /// An unspecified error. + case writer + /// An unspecified error. + case other + + func json() throws -> JSON { + try SharedLinkAccessLevelSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentUnshareDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkAccessLevelSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkAccessLevel: \(error)" + } } } - open class SharedContentUnshareDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentUnshareDetails) -> JSON { - let output = [String: JSON]() + + public class SharedLinkAccessLevelSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkAccessLevel) throws -> JSON { + switch value { + case .none: + var d = [String: JSON]() + d[".tag"] = .str("none") + return .dictionary(d) + case .reader: + var d = [String: JSON]() + d[".tag"] = .str("reader") + return .dictionary(d) + case .writer: + var d = [String: JSON]() + d[".tag"] = .str("writer") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkAccessLevel { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "none": + return SharedLinkAccessLevel.none + case "reader": + return SharedLinkAccessLevel.reader + case "writer": + return SharedLinkAccessLevel.writer + case "other": + return SharedLinkAccessLevel.other + default: + return SharedLinkAccessLevel.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkAccessLevel.self, json: json) + } + } + } + + /// Added shared link expiration date. + public class SharedLinkAddExpiryDetails: CustomStringConvertible, JSONRepresentable { + /// New shared link expiration date. + public let newValue: Date + public init(newValue: Date) { + self.newValue = newValue + } + + func json() throws -> JSON { + try SharedLinkAddExpiryDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkAddExpiryDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkAddExpiryDetails: \(error)" + } + } + } + + public class SharedLinkAddExpiryDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkAddExpiryDetails) throws -> JSON { + let output = [ + "new_value": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.newValue), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentUnshareDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkAddExpiryDetails { switch json { - case .dictionary(_): - return SharedContentUnshareDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["new_value"] ?? .null) + return SharedLinkAddExpiryDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkAddExpiryDetails.self, json: json) } } } - /// The SharedContentUnshareType struct - open class SharedContentUnshareType: CustomStringConvertible { + /// The SharedLinkAddExpiryType struct + public class SharedLinkAddExpiryType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentUnshareTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkAddExpiryTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkAddExpiryTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkAddExpiryType: \(error)" + } } } - open class SharedContentUnshareTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentUnshareType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkAddExpiryTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkAddExpiryType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentUnshareType { + + public func deserialize(_ json: JSON) throws -> SharedLinkAddExpiryType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentUnshareType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkAddExpiryType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkAddExpiryType.self, json: json) } } } - /// Previewed shared file/folder. - open class SharedContentViewDetails: CustomStringConvertible { - /// Shared content link. - public let sharedContentLink: String - /// The shared content owner. - public let sharedContentOwner: TeamLog.UserLogInfo? - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - public init(sharedContentLink: String, sharedContentAccessLevel: Sharing.AccessLevel, sharedContentOwner: TeamLog.UserLogInfo? = nil) { - stringValidator()(sharedContentLink) - self.sharedContentLink = sharedContentLink - self.sharedContentOwner = sharedContentOwner - self.sharedContentAccessLevel = sharedContentAccessLevel + /// Changed shared link expiration date. + public class SharedLinkChangeExpiryDetails: CustomStringConvertible, JSONRepresentable { + /// New shared link expiration date. Might be missing due to historical data gap. + public let newValue: Date? + /// Previous shared link expiration date. Might be missing due to historical data gap. + public let previousValue: Date? + public init(newValue: Date? = nil, previousValue: Date? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedLinkChangeExpiryDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentViewDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkChangeExpiryDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkChangeExpiryDetails: \(error)" + } } } - open class SharedContentViewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentViewDetails) -> JSON { - let output = [ - "shared_content_link": Serialization._StringSerializer.serialize(value.sharedContentLink), - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedContentOwner), + + public class SharedLinkChangeExpiryDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkChangeExpiryDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), + "previous_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentViewDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkChangeExpiryDetails { switch json { - case .dictionary(let dict): - let sharedContentLink = Serialization._StringSerializer.deserialize(dict["shared_content_link"] ?? .null) - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_content_owner"] ?? .null) - return SharedContentViewDetails(sharedContentLink: sharedContentLink, sharedContentAccessLevel: sharedContentAccessLevel, sharedContentOwner: sharedContentOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) + return SharedLinkChangeExpiryDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkChangeExpiryDetails.self, json: json) } } } - /// The SharedContentViewType struct - open class SharedContentViewType: CustomStringConvertible { + /// The SharedLinkChangeExpiryType struct + public class SharedLinkChangeExpiryType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedContentViewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkChangeExpiryTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkChangeExpiryTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkChangeExpiryType: \(error)" + } } } - open class SharedContentViewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedContentViewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkChangeExpiryTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkChangeExpiryType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedContentViewType { + + public func deserialize(_ json: JSON) throws -> SharedLinkChangeExpiryType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedContentViewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkChangeExpiryType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkChangeExpiryType.self, json: json) } } } - /// Changed who can access shared folder via link. - open class SharedFolderChangeLinkPolicyDetails: CustomStringConvertible { - /// New shared folder link policy. - public let newValue: Sharing.SharedLinkPolicy - /// Previous shared folder link policy. Might be missing due to historical data gap. - public let previousValue: Sharing.SharedLinkPolicy? - public init(newValue: Sharing.SharedLinkPolicy, previousValue: Sharing.SharedLinkPolicy? = nil) { + /// Changed visibility of shared link. + public class SharedLinkChangeVisibilityDetails: CustomStringConvertible, JSONRepresentable { + /// New shared link visibility. + public let newValue: TeamLog.SharedLinkVisibility + /// Previous shared link visibility. Might be missing due to historical data gap. + public let previousValue: TeamLog.SharedLinkVisibility? + public init(newValue: TeamLog.SharedLinkVisibility, previousValue: TeamLog.SharedLinkVisibility? = nil) { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeLinkPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkChangeVisibilityDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkChangeVisibilityDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkChangeVisibilityDetails: \(error)" + } } } - open class SharedFolderChangeLinkPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeLinkPolicyDetails) -> JSON { - let output = [ - "new_value": Sharing.SharedLinkPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(Sharing.SharedLinkPolicySerializer()).serialize(value.previousValue), + + public class SharedLinkChangeVisibilityDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkChangeVisibilityDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.SharedLinkVisibilitySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.SharedLinkVisibilitySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeLinkPolicyDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkChangeVisibilityDetails { switch json { - case .dictionary(let dict): - let newValue = Sharing.SharedLinkPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(Sharing.SharedLinkPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedFolderChangeLinkPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.SharedLinkVisibilitySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.SharedLinkVisibilitySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedLinkChangeVisibilityDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkChangeVisibilityDetails.self, json: json) } } } - /// The SharedFolderChangeLinkPolicyType struct - open class SharedFolderChangeLinkPolicyType: CustomStringConvertible { + /// The SharedLinkChangeVisibilityType struct + public class SharedLinkChangeVisibilityType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeLinkPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkChangeVisibilityTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkChangeVisibilityTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkChangeVisibilityType: \(error)" + } } } - open class SharedFolderChangeLinkPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeLinkPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkChangeVisibilityTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkChangeVisibilityType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeLinkPolicyType { + + public func deserialize(_ json: JSON) throws -> SharedLinkChangeVisibilityType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderChangeLinkPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkChangeVisibilityType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkChangeVisibilityType.self, json: json) } } } - /// Changed whether shared folder inherits members from parent folder. - open class SharedFolderChangeMembersInheritancePolicyDetails: CustomStringConvertible { - /// New member inheritance policy. - public let newValue: TeamLog.SharedFolderMembersInheritancePolicy - /// Previous member inheritance policy. Might be missing due to historical data gap. - public let previousValue: TeamLog.SharedFolderMembersInheritancePolicy? - public init(newValue: TeamLog.SharedFolderMembersInheritancePolicy, previousValue: TeamLog.SharedFolderMembersInheritancePolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Added file/folder to Dropbox from shared link. + public class SharedLinkCopyDetails: CustomStringConvertible, JSONRepresentable { + /// Shared link owner details. Might be missing due to historical data gap. + public let sharedLinkOwner: TeamLog.UserLogInfo? + public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { + self.sharedLinkOwner = sharedLinkOwner + } + + func json() throws -> JSON { + try SharedLinkCopyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeMembersInheritancePolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkCopyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkCopyDetails: \(error)" + } } } - open class SharedFolderChangeMembersInheritancePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeMembersInheritancePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.SharedFolderMembersInheritancePolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.SharedFolderMembersInheritancePolicySerializer()).serialize(value.previousValue), + + public class SharedLinkCopyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkCopyDetails) throws -> JSON { + let output = [ + "shared_link_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeMembersInheritancePolicyDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkCopyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.SharedFolderMembersInheritancePolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.SharedFolderMembersInheritancePolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedFolderChangeMembersInheritancePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) + return SharedLinkCopyDetails(sharedLinkOwner: sharedLinkOwner) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkCopyDetails.self, json: json) } } } - /// The SharedFolderChangeMembersInheritancePolicyType struct - open class SharedFolderChangeMembersInheritancePolicyType: CustomStringConvertible { + /// The SharedLinkCopyType struct + public class SharedLinkCopyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeMembersInheritancePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkCopyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkCopyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkCopyType: \(error)" + } } } - open class SharedFolderChangeMembersInheritancePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeMembersInheritancePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkCopyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkCopyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeMembersInheritancePolicyType { + + public func deserialize(_ json: JSON) throws -> SharedLinkCopyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderChangeMembersInheritancePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkCopyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkCopyType.self, json: json) } } } - /// Changed who can add/remove members of shared folder. - open class SharedFolderChangeMembersManagementPolicyDetails: CustomStringConvertible { - /// New members management policy. - public let newValue: Sharing.AclUpdatePolicy - /// Previous members management policy. Might be missing due to historical data gap. - public let previousValue: Sharing.AclUpdatePolicy? - public init(newValue: Sharing.AclUpdatePolicy, previousValue: Sharing.AclUpdatePolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Created shared link. + public class SharedLinkCreateDetails: CustomStringConvertible, JSONRepresentable { + /// Defines who can access the shared link. Might be missing due to historical data gap. + public let sharedLinkAccessLevel: TeamLog.SharedLinkAccessLevel? + public init(sharedLinkAccessLevel: TeamLog.SharedLinkAccessLevel? = nil) { + self.sharedLinkAccessLevel = sharedLinkAccessLevel + } + + func json() throws -> JSON { + try SharedLinkCreateDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeMembersManagementPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkCreateDetails: \(error)" + } } } - open class SharedFolderChangeMembersManagementPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeMembersManagementPolicyDetails) -> JSON { - let output = [ - "new_value": Sharing.AclUpdatePolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(Sharing.AclUpdatePolicySerializer()).serialize(value.previousValue), + + public class SharedLinkCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkCreateDetails) throws -> JSON { + let output = [ + "shared_link_access_level": try NullableSerializer(TeamLog.SharedLinkAccessLevelSerializer()).serialize(value.sharedLinkAccessLevel), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeMembersManagementPolicyDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkCreateDetails { switch json { - case .dictionary(let dict): - let newValue = Sharing.AclUpdatePolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(Sharing.AclUpdatePolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedFolderChangeMembersManagementPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkAccessLevel = try NullableSerializer(TeamLog.SharedLinkAccessLevelSerializer()) + .deserialize(dict["shared_link_access_level"] ?? .null) + return SharedLinkCreateDetails(sharedLinkAccessLevel: sharedLinkAccessLevel) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkCreateDetails.self, json: json) } } } - /// The SharedFolderChangeMembersManagementPolicyType struct - open class SharedFolderChangeMembersManagementPolicyType: CustomStringConvertible { + /// The SharedLinkCreateType struct + public class SharedLinkCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeMembersManagementPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkCreateType: \(error)" + } } } - open class SharedFolderChangeMembersManagementPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeMembersManagementPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeMembersManagementPolicyType { + + public func deserialize(_ json: JSON) throws -> SharedLinkCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderChangeMembersManagementPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkCreateType.self, json: json) } } } - /// Changed who can become member of shared folder. - open class SharedFolderChangeMembersPolicyDetails: CustomStringConvertible { - /// New external invite policy. - public let newValue: Sharing.MemberPolicy - /// Previous external invite policy. Might be missing due to historical data gap. - public let previousValue: Sharing.MemberPolicy? - public init(newValue: Sharing.MemberPolicy, previousValue: Sharing.MemberPolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Removed shared link. + public class SharedLinkDisableDetails: CustomStringConvertible, JSONRepresentable { + /// Shared link owner details. Might be missing due to historical data gap. + public let sharedLinkOwner: TeamLog.UserLogInfo? + public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { + self.sharedLinkOwner = sharedLinkOwner + } + + func json() throws -> JSON { + try SharedLinkDisableDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeMembersPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkDisableDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkDisableDetails: \(error)" + } } } - open class SharedFolderChangeMembersPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeMembersPolicyDetails) -> JSON { - let output = [ - "new_value": Sharing.MemberPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(Sharing.MemberPolicySerializer()).serialize(value.previousValue), + + public class SharedLinkDisableDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkDisableDetails) throws -> JSON { + let output = [ + "shared_link_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeMembersPolicyDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkDisableDetails { switch json { - case .dictionary(let dict): - let newValue = Sharing.MemberPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(Sharing.MemberPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedFolderChangeMembersPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) + return SharedLinkDisableDetails(sharedLinkOwner: sharedLinkOwner) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkDisableDetails.self, json: json) } } } - /// The SharedFolderChangeMembersPolicyType struct - open class SharedFolderChangeMembersPolicyType: CustomStringConvertible { + /// The SharedLinkDisableType struct + public class SharedLinkDisableType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderChangeMembersPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkDisableTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkDisableTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkDisableType: \(error)" + } } } - open class SharedFolderChangeMembersPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderChangeMembersPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkDisableTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkDisableType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderChangeMembersPolicyType { + + public func deserialize(_ json: JSON) throws -> SharedLinkDisableType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderChangeMembersPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkDisableType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkDisableType.self, json: json) } } } - /// Created shared folder. - open class SharedFolderCreateDetails: CustomStringConvertible { - /// Target namespace ID. - public let targetNsId: String? - public init(targetNsId: String? = nil) { - nullableValidator(stringValidator())(targetNsId) - self.targetNsId = targetNsId + /// Downloaded file/folder from shared link. + public class SharedLinkDownloadDetails: CustomStringConvertible, JSONRepresentable { + /// Shared link owner details. Might be missing due to historical data gap. + public let sharedLinkOwner: TeamLog.UserLogInfo? + public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { + self.sharedLinkOwner = sharedLinkOwner + } + + func json() throws -> JSON { + try SharedLinkDownloadDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderCreateDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkDownloadDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkDownloadDetails: \(error)" + } } } - open class SharedFolderCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderCreateDetails) -> JSON { - let output = [ - "target_ns_id": NullableSerializer(Serialization._StringSerializer).serialize(value.targetNsId), + + public class SharedLinkDownloadDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkDownloadDetails) throws -> JSON { + let output = [ + "shared_link_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderCreateDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkDownloadDetails { switch json { - case .dictionary(let dict): - let targetNsId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["target_ns_id"] ?? .null) - return SharedFolderCreateDetails(targetNsId: targetNsId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) + return SharedLinkDownloadDetails(sharedLinkOwner: sharedLinkOwner) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkDownloadDetails.self, json: json) } } } - /// The SharedFolderCreateType struct - open class SharedFolderCreateType: CustomStringConvertible { + /// The SharedLinkDownloadType struct + public class SharedLinkDownloadType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkDownloadTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkDownloadTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkDownloadType: \(error)" + } } } - open class SharedFolderCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkDownloadTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkDownloadType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderCreateType { + + public func deserialize(_ json: JSON) throws -> SharedLinkDownloadType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkDownloadType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkDownloadType.self, json: json) } } } - /// Declined team member's invite to shared folder. - open class SharedFolderDeclineInvitationDetails: CustomStringConvertible { - public init() { + /// Removed shared link expiration date. + public class SharedLinkRemoveExpiryDetails: CustomStringConvertible, JSONRepresentable { + /// Previous shared link expiration date. Might be missing due to historical data gap. + public let previousValue: Date? + public init(previousValue: Date? = nil) { + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedLinkRemoveExpiryDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderDeclineInvitationDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkRemoveExpiryDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkRemoveExpiryDetails: \(error)" + } } } - open class SharedFolderDeclineInvitationDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderDeclineInvitationDetails) -> JSON { - let output = [String: JSON]() + + public class SharedLinkRemoveExpiryDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkRemoveExpiryDetails) throws -> JSON { + let output = [ + "previous_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderDeclineInvitationDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkRemoveExpiryDetails { switch json { - case .dictionary(_): - return SharedFolderDeclineInvitationDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) + return SharedLinkRemoveExpiryDetails(previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkRemoveExpiryDetails.self, json: json) } } } - /// The SharedFolderDeclineInvitationType struct - open class SharedFolderDeclineInvitationType: CustomStringConvertible { + /// The SharedLinkRemoveExpiryType struct + public class SharedLinkRemoveExpiryType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderDeclineInvitationTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkRemoveExpiryTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkRemoveExpiryTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkRemoveExpiryType: \(error)" + } } } - open class SharedFolderDeclineInvitationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderDeclineInvitationType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkRemoveExpiryTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkRemoveExpiryType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderDeclineInvitationType { + + public func deserialize(_ json: JSON) throws -> SharedLinkRemoveExpiryType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderDeclineInvitationType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkRemoveExpiryType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkRemoveExpiryType.self, json: json) } } } - /// Specifies if a shared folder inherits its members from the parent folder. - public enum SharedFolderMembersInheritancePolicy: CustomStringConvertible { - /// An unspecified error. - case dontInheritMembers - /// An unspecified error. - case inheritMembers - /// An unspecified error. - case other + /// Added an expiration date to the shared link. + public class SharedLinkSettingsAddExpirationDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + /// New shared content link expiration date. Might be missing due to historical data gap. + public let newValue: Date? + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil, newValue: Date? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + self.newValue = newValue + } - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMembersInheritancePolicySerializer().serialize(self)))" + func json() throws -> JSON { + try SharedLinkSettingsAddExpirationDetailsSerializer().serialize(self) } - } - open class SharedFolderMembersInheritancePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMembersInheritancePolicy) -> JSON { - switch value { - case .dontInheritMembers: - var d = [String: JSON]() - d[".tag"] = .str("dont_inherit_members") - return .dictionary(d) - case .inheritMembers: - var d = [String: JSON]() - d[".tag"] = .str("inherit_members") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedFolderMembersInheritancePolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "dont_inherit_members": - return SharedFolderMembersInheritancePolicy.dontInheritMembers - case "inherit_members": - return SharedFolderMembersInheritancePolicy.inheritMembers - case "other": - return SharedFolderMembersInheritancePolicy.other - default: - return SharedFolderMembersInheritancePolicy.other - } - default: - fatalError("Failed to deserialize") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAddExpirationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAddExpirationDetails: \(error)" } } } - /// Added shared folder to own Dropbox. - open class SharedFolderMountDetails: CustomStringConvertible { - public init() { - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMountDetailsSerializer().serialize(self)))" - } - } - open class SharedFolderMountDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMountDetails) -> JSON { - let output = [String: JSON]() + public class SharedLinkSettingsAddExpirationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAddExpirationDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + "new_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderMountDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAddExpirationDetails { switch json { - case .dictionary(_): - return SharedFolderMountDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + let newValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) + return SharedLinkSettingsAddExpirationDetails( + sharedContentAccessLevel: sharedContentAccessLevel, + sharedContentLink: sharedContentLink, + newValue: newValue + ) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAddExpirationDetails.self, json: json) } } } - /// The SharedFolderMountType struct - open class SharedFolderMountType: CustomStringConvertible { + /// The SharedLinkSettingsAddExpirationType struct + public class SharedLinkSettingsAddExpirationType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMountTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsAddExpirationTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAddExpirationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAddExpirationType: \(error)" + } } } - open class SharedFolderMountTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMountType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsAddExpirationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAddExpirationType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderMountType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAddExpirationType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderMountType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsAddExpirationType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAddExpirationType.self, json: json) } } } - /// Changed parent of shared folder. - open class SharedFolderNestDetails: CustomStringConvertible { - /// Previous parent namespace ID. - public let previousParentNsId: String? - /// New parent namespace ID. - public let newParentNsId: String? - /// Previous namespace path. - public let previousNsPath: String? - /// New namespace path. - public let newNsPath: String? - public init(previousParentNsId: String? = nil, newParentNsId: String? = nil, previousNsPath: String? = nil, newNsPath: String? = nil) { - nullableValidator(stringValidator())(previousParentNsId) - self.previousParentNsId = previousParentNsId - nullableValidator(stringValidator())(newParentNsId) - self.newParentNsId = newParentNsId - nullableValidator(stringValidator())(previousNsPath) - self.previousNsPath = previousNsPath - nullableValidator(stringValidator())(newNsPath) - self.newNsPath = newNsPath + /// Added a password to the shared link. + public class SharedLinkSettingsAddPasswordDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + } + + func json() throws -> JSON { + try SharedLinkSettingsAddPasswordDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderNestDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAddPasswordDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAddPasswordDetails: \(error)" + } } } - open class SharedFolderNestDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderNestDetails) -> JSON { - let output = [ - "previous_parent_ns_id": NullableSerializer(Serialization._StringSerializer).serialize(value.previousParentNsId), - "new_parent_ns_id": NullableSerializer(Serialization._StringSerializer).serialize(value.newParentNsId), - "previous_ns_path": NullableSerializer(Serialization._StringSerializer).serialize(value.previousNsPath), - "new_ns_path": NullableSerializer(Serialization._StringSerializer).serialize(value.newNsPath), + + public class SharedLinkSettingsAddPasswordDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAddPasswordDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderNestDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAddPasswordDetails { switch json { - case .dictionary(let dict): - let previousParentNsId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_parent_ns_id"] ?? .null) - let newParentNsId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_parent_ns_id"] ?? .null) - let previousNsPath = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_ns_path"] ?? .null) - let newNsPath = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_ns_path"] ?? .null) - return SharedFolderNestDetails(previousParentNsId: previousParentNsId, newParentNsId: newParentNsId, previousNsPath: previousNsPath, newNsPath: newNsPath) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + return SharedLinkSettingsAddPasswordDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAddPasswordDetails.self, json: json) } } } - /// The SharedFolderNestType struct - open class SharedFolderNestType: CustomStringConvertible { + /// The SharedLinkSettingsAddPasswordType struct + public class SharedLinkSettingsAddPasswordType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderNestTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsAddPasswordTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAddPasswordTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAddPasswordType: \(error)" + } } } - open class SharedFolderNestTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderNestType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsAddPasswordTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAddPasswordType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderNestType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAddPasswordType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderNestType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsAddPasswordType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAddPasswordType.self, json: json) } } } - /// Transferred ownership of shared folder to another member. - open class SharedFolderTransferOwnershipDetails: CustomStringConvertible { - /// The email address of the previous shared folder owner. - public let previousOwnerEmail: String? - /// The email address of the new shared folder owner. - public let newOwnerEmail: String - public init(newOwnerEmail: String, previousOwnerEmail: String? = nil) { - nullableValidator(stringValidator(maxLength: 255))(previousOwnerEmail) - self.previousOwnerEmail = previousOwnerEmail - stringValidator(maxLength: 255)(newOwnerEmail) - self.newOwnerEmail = newOwnerEmail + /// Disabled downloads. + public class SharedLinkSettingsAllowDownloadDisabledDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + } + + func json() throws -> JSON { + try SharedLinkSettingsAllowDownloadDisabledDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderTransferOwnershipDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAllowDownloadDisabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAllowDownloadDisabledDetails: \(error)" + } } } - open class SharedFolderTransferOwnershipDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderTransferOwnershipDetails) -> JSON { - let output = [ - "new_owner_email": Serialization._StringSerializer.serialize(value.newOwnerEmail), - "previous_owner_email": NullableSerializer(Serialization._StringSerializer).serialize(value.previousOwnerEmail), + + public class SharedLinkSettingsAllowDownloadDisabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAllowDownloadDisabledDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderTransferOwnershipDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAllowDownloadDisabledDetails { switch json { - case .dictionary(let dict): - let newOwnerEmail = Serialization._StringSerializer.deserialize(dict["new_owner_email"] ?? .null) - let previousOwnerEmail = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_owner_email"] ?? .null) - return SharedFolderTransferOwnershipDetails(newOwnerEmail: newOwnerEmail, previousOwnerEmail: previousOwnerEmail) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + return SharedLinkSettingsAllowDownloadDisabledDetails( + sharedContentAccessLevel: sharedContentAccessLevel, + sharedContentLink: sharedContentLink + ) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAllowDownloadDisabledDetails.self, json: json) } } } - /// The SharedFolderTransferOwnershipType struct - open class SharedFolderTransferOwnershipType: CustomStringConvertible { + /// The SharedLinkSettingsAllowDownloadDisabledType struct + public class SharedLinkSettingsAllowDownloadDisabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderTransferOwnershipTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsAllowDownloadDisabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAllowDownloadDisabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAllowDownloadDisabledType: \(error)" + } } } - open class SharedFolderTransferOwnershipTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderTransferOwnershipType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsAllowDownloadDisabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAllowDownloadDisabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderTransferOwnershipType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAllowDownloadDisabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderTransferOwnershipType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsAllowDownloadDisabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAllowDownloadDisabledType.self, json: json) } } } - /// Deleted shared folder from Dropbox. - open class SharedFolderUnmountDetails: CustomStringConvertible { - public init() { + /// Enabled downloads. + public class SharedLinkSettingsAllowDownloadEnabledDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + } + + func json() throws -> JSON { + try SharedLinkSettingsAllowDownloadEnabledDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderUnmountDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAllowDownloadEnabledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAllowDownloadEnabledDetails: \(error)" + } } } - open class SharedFolderUnmountDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderUnmountDetails) -> JSON { - let output = [String: JSON]() + + public class SharedLinkSettingsAllowDownloadEnabledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAllowDownloadEnabledDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderUnmountDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAllowDownloadEnabledDetails { switch json { - case .dictionary(_): - return SharedFolderUnmountDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + return SharedLinkSettingsAllowDownloadEnabledDetails( + sharedContentAccessLevel: sharedContentAccessLevel, + sharedContentLink: sharedContentLink + ) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAllowDownloadEnabledDetails.self, json: json) } } } - /// The SharedFolderUnmountType struct - open class SharedFolderUnmountType: CustomStringConvertible { + /// The SharedLinkSettingsAllowDownloadEnabledType struct + public class SharedLinkSettingsAllowDownloadEnabledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderUnmountTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsAllowDownloadEnabledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsAllowDownloadEnabledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsAllowDownloadEnabledType: \(error)" + } } } - open class SharedFolderUnmountTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderUnmountType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsAllowDownloadEnabledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsAllowDownloadEnabledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedFolderUnmountType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsAllowDownloadEnabledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedFolderUnmountType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsAllowDownloadEnabledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsAllowDownloadEnabledType.self, json: json) } } } - /// Shared link access level. - public enum SharedLinkAccessLevel: CustomStringConvertible { - /// An unspecified error. - case none - /// An unspecified error. - case reader - /// An unspecified error. - case writer - /// An unspecified error. - case other + /// Changed the audience of the shared link. + public class SharedLinkSettingsChangeAudienceDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + /// New link audience value. + public let newValue: Sharing.LinkAudience + /// Previous link audience value. + public let previousValue: Sharing.LinkAudience? + public init( + sharedContentAccessLevel: Sharing.AccessLevel, + newValue: Sharing.LinkAudience, + sharedContentLink: String? = nil, + previousValue: Sharing.LinkAudience? = nil + ) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + self.newValue = newValue + self.previousValue = previousValue + } - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkAccessLevelSerializer().serialize(self)))" + func json() throws -> JSON { + try SharedLinkSettingsChangeAudienceDetailsSerializer().serialize(self) } - } - open class SharedLinkAccessLevelSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkAccessLevel) -> JSON { - switch value { - case .none: - var d = [String: JSON]() - d[".tag"] = .str("none") - return .dictionary(d) - case .reader: - var d = [String: JSON]() - d[".tag"] = .str("reader") - return .dictionary(d) - case .writer: - var d = [String: JSON]() - d[".tag"] = .str("writer") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkAccessLevel { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "none": - return SharedLinkAccessLevel.none - case "reader": - return SharedLinkAccessLevel.reader - case "writer": - return SharedLinkAccessLevel.writer - case "other": - return SharedLinkAccessLevel.other - default: - return SharedLinkAccessLevel.other - } - default: - fatalError("Failed to deserialize") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsChangeAudienceDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsChangeAudienceDetails: \(error)" } } } - /// Added shared link expiration date. - open class SharedLinkAddExpiryDetails: CustomStringConvertible { - /// New shared link expiration date. - public let newValue: Date - public init(newValue: Date) { - self.newValue = newValue - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkAddExpiryDetailsSerializer().serialize(self)))" - } - } - open class SharedLinkAddExpiryDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkAddExpiryDetails) -> JSON { - let output = [ - "new_value": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.newValue), + public class SharedLinkSettingsChangeAudienceDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsChangeAudienceDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "new_value": try Sharing.LinkAudienceSerializer().serialize(value.newValue), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + "previous_value": try NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkAddExpiryDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsChangeAudienceDetails { switch json { - case .dictionary(let dict): - let newValue = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["new_value"] ?? .null) - return SharedLinkAddExpiryDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let newValue = try Sharing.LinkAudienceSerializer().deserialize(dict["new_value"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + let previousValue = try NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["previous_value"] ?? .null) + return SharedLinkSettingsChangeAudienceDetails( + sharedContentAccessLevel: sharedContentAccessLevel, + newValue: newValue, + sharedContentLink: sharedContentLink, + previousValue: previousValue + ) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsChangeAudienceDetails.self, json: json) } } } - /// The SharedLinkAddExpiryType struct - open class SharedLinkAddExpiryType: CustomStringConvertible { + /// The SharedLinkSettingsChangeAudienceType struct + public class SharedLinkSettingsChangeAudienceType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkAddExpiryTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsChangeAudienceTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsChangeAudienceTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsChangeAudienceType: \(error)" + } } } - open class SharedLinkAddExpiryTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkAddExpiryType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsChangeAudienceTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsChangeAudienceType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkAddExpiryType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsChangeAudienceType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkAddExpiryType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsChangeAudienceType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsChangeAudienceType.self, json: json) } } } - /// Changed shared link expiration date. - open class SharedLinkChangeExpiryDetails: CustomStringConvertible { - /// New shared link expiration date. Might be missing due to historical data gap. + /// Changed the expiration date of the shared link. + public class SharedLinkSettingsChangeExpirationDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + /// New shared content link expiration date. Might be missing due to historical data gap. public let newValue: Date? - /// Previous shared link expiration date. Might be missing due to historical data gap. + /// Previous shared content link expiration date. Might be missing due to historical data gap. public let previousValue: Date? - public init(newValue: Date? = nil, previousValue: Date? = nil) { + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil, newValue: Date? = nil, previousValue: Date? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkChangeExpiryDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsChangeExpirationDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsChangeExpirationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsChangeExpirationDetails: \(error)" + } } } - open class SharedLinkChangeExpiryDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkChangeExpiryDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), - "previous_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), + + public class SharedLinkSettingsChangeExpirationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsChangeExpirationDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + "new_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), + "previous_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkChangeExpiryDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsChangeExpirationDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) - return SharedLinkChangeExpiryDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + let newValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) + return SharedLinkSettingsChangeExpirationDetails( + sharedContentAccessLevel: sharedContentAccessLevel, + sharedContentLink: sharedContentLink, + newValue: newValue, + previousValue: previousValue + ) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsChangeExpirationDetails.self, json: json) } } } - /// The SharedLinkChangeExpiryType struct - open class SharedLinkChangeExpiryType: CustomStringConvertible { + /// The SharedLinkSettingsChangeExpirationType struct + public class SharedLinkSettingsChangeExpirationType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkChangeExpiryTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsChangeExpirationTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsChangeExpirationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsChangeExpirationType: \(error)" + } } } - open class SharedLinkChangeExpiryTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkChangeExpiryType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsChangeExpirationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsChangeExpirationType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkChangeExpiryType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsChangeExpirationType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkChangeExpiryType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsChangeExpirationType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsChangeExpirationType.self, json: json) } } } - /// Changed visibility of shared link. - open class SharedLinkChangeVisibilityDetails: CustomStringConvertible { - /// New shared link visibility. - public let newValue: TeamLog.SharedLinkVisibility - /// Previous shared link visibility. Might be missing due to historical data gap. - public let previousValue: TeamLog.SharedLinkVisibility? - public init(newValue: TeamLog.SharedLinkVisibility, previousValue: TeamLog.SharedLinkVisibility? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Changed the password of the shared link. + public class SharedLinkSettingsChangePasswordDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + } + + func json() throws -> JSON { + try SharedLinkSettingsChangePasswordDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkChangeVisibilityDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsChangePasswordDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsChangePasswordDetails: \(error)" + } } } - open class SharedLinkChangeVisibilityDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkChangeVisibilityDetails) -> JSON { - let output = [ - "new_value": TeamLog.SharedLinkVisibilitySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.SharedLinkVisibilitySerializer()).serialize(value.previousValue), + + public class SharedLinkSettingsChangePasswordDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsChangePasswordDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkChangeVisibilityDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsChangePasswordDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.SharedLinkVisibilitySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.SharedLinkVisibilitySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedLinkChangeVisibilityDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + return SharedLinkSettingsChangePasswordDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsChangePasswordDetails.self, json: json) } } } - /// The SharedLinkChangeVisibilityType struct - open class SharedLinkChangeVisibilityType: CustomStringConvertible { + /// The SharedLinkSettingsChangePasswordType struct + public class SharedLinkSettingsChangePasswordType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkChangeVisibilityTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsChangePasswordTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsChangePasswordTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsChangePasswordType: \(error)" + } } } - open class SharedLinkChangeVisibilityTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkChangeVisibilityType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsChangePasswordTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsChangePasswordType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkChangeVisibilityType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsChangePasswordType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkChangeVisibilityType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsChangePasswordType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsChangePasswordType.self, json: json) } } } - /// Added file/folder to Dropbox from shared link. - open class SharedLinkCopyDetails: CustomStringConvertible { - /// Shared link owner details. Might be missing due to historical data gap. - public let sharedLinkOwner: TeamLog.UserLogInfo? - public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { - self.sharedLinkOwner = sharedLinkOwner + /// Removed the expiration date from the shared link. + public class SharedLinkSettingsRemoveExpirationDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + /// Previous shared link expiration date. Might be missing due to historical data gap. + public let previousValue: Date? + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil, previousValue: Date? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharedLinkSettingsRemoveExpirationDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkCopyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsRemoveExpirationDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsRemoveExpirationDetails: \(error)" + } } } - open class SharedLinkCopyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkCopyDetails) -> JSON { - let output = [ - "shared_link_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), + + public class SharedLinkSettingsRemoveExpirationDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsRemoveExpirationDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + "previous_value": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkCopyDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsRemoveExpirationDetails { switch json { - case .dictionary(let dict): - let sharedLinkOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) - return SharedLinkCopyDetails(sharedLinkOwner: sharedLinkOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + let previousValue = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) + return SharedLinkSettingsRemoveExpirationDetails( + sharedContentAccessLevel: sharedContentAccessLevel, + sharedContentLink: sharedContentLink, + previousValue: previousValue + ) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsRemoveExpirationDetails.self, json: json) } } } - /// The SharedLinkCopyType struct - open class SharedLinkCopyType: CustomStringConvertible { + /// The SharedLinkSettingsRemoveExpirationType struct + public class SharedLinkSettingsRemoveExpirationType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkCopyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsRemoveExpirationTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsRemoveExpirationTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsRemoveExpirationType: \(error)" + } } } - open class SharedLinkCopyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkCopyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsRemoveExpirationTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsRemoveExpirationType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkCopyType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsRemoveExpirationType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkCopyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsRemoveExpirationType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsRemoveExpirationType.self, json: json) } } } - /// Created shared link. - open class SharedLinkCreateDetails: CustomStringConvertible { - /// Defines who can access the shared link. Might be missing due to historical data gap. - public let sharedLinkAccessLevel: TeamLog.SharedLinkAccessLevel? - public init(sharedLinkAccessLevel: TeamLog.SharedLinkAccessLevel? = nil) { - self.sharedLinkAccessLevel = sharedLinkAccessLevel + /// Removed the password from the shared link. + public class SharedLinkSettingsRemovePasswordDetails: CustomStringConvertible, JSONRepresentable { + /// Shared content access level. + public let sharedContentAccessLevel: Sharing.AccessLevel + /// Shared content link. + public let sharedContentLink: String? + public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { + self.sharedContentAccessLevel = sharedContentAccessLevel + nullableValidator(stringValidator())(sharedContentLink) + self.sharedContentLink = sharedContentLink + } + + func json() throws -> JSON { + try SharedLinkSettingsRemovePasswordDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkCreateDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsRemovePasswordDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsRemovePasswordDetails: \(error)" + } } } - open class SharedLinkCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkCreateDetails) -> JSON { - let output = [ - "shared_link_access_level": NullableSerializer(TeamLog.SharedLinkAccessLevelSerializer()).serialize(value.sharedLinkAccessLevel), + + public class SharedLinkSettingsRemovePasswordDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsRemovePasswordDetails) throws -> JSON { + let output = [ + "shared_content_access_level": try Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), + "shared_content_link": try NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkCreateDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsRemovePasswordDetails { switch json { - case .dictionary(let dict): - let sharedLinkAccessLevel = NullableSerializer(TeamLog.SharedLinkAccessLevelSerializer()).deserialize(dict["shared_link_access_level"] ?? .null) - return SharedLinkCreateDetails(sharedLinkAccessLevel: sharedLinkAccessLevel) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedContentAccessLevel = try Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) + let sharedContentLink = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) + return SharedLinkSettingsRemovePasswordDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsRemovePasswordDetails.self, json: json) } } } - /// The SharedLinkCreateType struct - open class SharedLinkCreateType: CustomStringConvertible { + /// The SharedLinkSettingsRemovePasswordType struct + public class SharedLinkSettingsRemovePasswordType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkSettingsRemovePasswordTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkSettingsRemovePasswordTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkSettingsRemovePasswordType: \(error)" + } } } - open class SharedLinkCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkSettingsRemovePasswordTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkSettingsRemovePasswordType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkCreateType { + + public func deserialize(_ json: JSON) throws -> SharedLinkSettingsRemovePasswordType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkSettingsRemovePasswordType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkSettingsRemovePasswordType.self, json: json) } } } - /// Removed shared link. - open class SharedLinkDisableDetails: CustomStringConvertible { + /// Added members as audience of shared link. + public class SharedLinkShareDetails: CustomStringConvertible, JSONRepresentable { /// Shared link owner details. Might be missing due to historical data gap. public let sharedLinkOwner: TeamLog.UserLogInfo? - public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { + /// Users without a Dropbox account that were added as shared link audience. + public let externalUsers: [TeamLog.ExternalUserLogInfo]? + public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil, externalUsers: [TeamLog.ExternalUserLogInfo]? = nil) { self.sharedLinkOwner = sharedLinkOwner + self.externalUsers = externalUsers } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkDisableDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkShareDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkShareDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkShareDetails: \(error)" + } } } - open class SharedLinkDisableDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkDisableDetails) -> JSON { - let output = [ - "shared_link_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), + + public class SharedLinkShareDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkShareDetails) throws -> JSON { + let output = [ + "shared_link_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), + "external_users": try NullableSerializer(ArraySerializer(TeamLog.ExternalUserLogInfoSerializer())).serialize(value.externalUsers), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkDisableDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkShareDetails { switch json { - case .dictionary(let dict): - let sharedLinkOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) - return SharedLinkDisableDetails(sharedLinkOwner: sharedLinkOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) + let externalUsers = try NullableSerializer(ArraySerializer(TeamLog.ExternalUserLogInfoSerializer())) + .deserialize(dict["external_users"] ?? .null) + return SharedLinkShareDetails(sharedLinkOwner: sharedLinkOwner, externalUsers: externalUsers) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkShareDetails.self, json: json) } } } - /// The SharedLinkDisableType struct - open class SharedLinkDisableType: CustomStringConvertible { + /// The SharedLinkShareType struct + public class SharedLinkShareType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkDisableTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkShareTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkShareTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkShareType: \(error)" + } } } - open class SharedLinkDisableTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkDisableType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharedLinkShareTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkShareType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkDisableType { + + public func deserialize(_ json: JSON) throws -> SharedLinkShareType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkDisableType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkShareType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkShareType.self, json: json) } } } - /// Downloaded file/folder from shared link. - open class SharedLinkDownloadDetails: CustomStringConvertible { + /// Opened shared link. + public class SharedLinkViewDetails: CustomStringConvertible, JSONRepresentable { /// Shared link owner details. Might be missing due to historical data gap. public let sharedLinkOwner: TeamLog.UserLogInfo? public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { self.sharedLinkOwner = sharedLinkOwner } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkDownloadDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharedLinkViewDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkViewDetails: \(error)" + } } } - open class SharedLinkDownloadDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkDownloadDetails) -> JSON { - let output = [ - "shared_link_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), + + public class SharedLinkViewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkViewDetails) throws -> JSON { + let output = [ + "shared_link_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkDownloadDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkViewDetails { switch json { - case .dictionary(let dict): - let sharedLinkOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) - return SharedLinkDownloadDetails(sharedLinkOwner: sharedLinkOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) + return SharedLinkViewDetails(sharedLinkOwner: sharedLinkOwner) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkViewDetails.self, json: json) } } } - /// The SharedLinkDownloadType struct - open class SharedLinkDownloadType: CustomStringConvertible { + /// The SharedLinkViewType struct + public class SharedLinkViewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkDownloadTypeSerializer().serialize(self)))" - } - } - open class SharedLinkDownloadTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkDownloadType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try SharedLinkViewTypeSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> SharedLinkDownloadType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkDownloadType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkViewType: \(error)" } } } - /// Removed shared link expiration date. - open class SharedLinkRemoveExpiryDetails: CustomStringConvertible { - /// Previous shared link expiration date. Might be missing due to historical data gap. - public let previousValue: Date? - public init(previousValue: Date? = nil) { - self.previousValue = previousValue - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkRemoveExpiryDetailsSerializer().serialize(self)))" - } - } - open class SharedLinkRemoveExpiryDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkRemoveExpiryDetails) -> JSON { - let output = [ - "previous_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), + public class SharedLinkViewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkRemoveExpiryDetails { + + public func deserialize(_ json: JSON) throws -> SharedLinkViewType { switch json { - case .dictionary(let dict): - let previousValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) - return SharedLinkRemoveExpiryDetails(previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedLinkViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedLinkViewType.self, json: json) } } } - /// The SharedLinkRemoveExpiryType struct - open class SharedLinkRemoveExpiryType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ + /// Defines who has access to a shared link. + public enum SharedLinkVisibility: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case noOne + /// An unspecified error. + case password + /// An unspecified error. + case public_ + /// An unspecified error. + case teamOnly + /// An unspecified error. + case other + + func json() throws -> JSON { + try SharedLinkVisibilitySerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkRemoveExpiryTypeSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkVisibilitySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkVisibility: \(error)" + } } } - open class SharedLinkRemoveExpiryTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkRemoveExpiryType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> SharedLinkRemoveExpiryType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkRemoveExpiryType(description_: description_) - default: - fatalError("Type error deserializing") + + public class SharedLinkVisibilitySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkVisibility) throws -> JSON { + switch value { + case .noOne: + var d = [String: JSON]() + d[".tag"] = .str("no_one") + return .dictionary(d) + case .password: + var d = [String: JSON]() + d[".tag"] = .str("password") + return .dictionary(d) + case .public_: + var d = [String: JSON]() + d[".tag"] = .str("public") + return .dictionary(d) + case .teamOnly: + var d = [String: JSON]() + d[".tag"] = .str("team_only") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkVisibility { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "no_one": + return SharedLinkVisibility.noOne + case "password": + return SharedLinkVisibility.password + case "public": + return SharedLinkVisibility.public_ + case "team_only": + return SharedLinkVisibility.teamOnly + case "other": + return SharedLinkVisibility.other + default: + return SharedLinkVisibility.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkVisibility.self, json: json) } } } - /// Added an expiration date to the shared link. - open class SharedLinkSettingsAddExpirationDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - /// New shared content link expiration date. Might be missing due to historical data gap. - public let newValue: Date? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil, newValue: Date? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink - self.newValue = newValue + /// Opened shared Paper doc. + public class SharedNoteOpenedDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SharedNoteOpenedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAddExpirationDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedNoteOpenedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedNoteOpenedDetails: \(error)" + } } } - open class SharedLinkSettingsAddExpirationDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAddExpirationDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), - "new_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), - ] + + public class SharedNoteOpenedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedNoteOpenedDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAddExpirationDetails { + + public func deserialize(_ json: JSON) throws -> SharedNoteOpenedDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - let newValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) - return SharedLinkSettingsAddExpirationDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return SharedNoteOpenedDetails() + default: + throw JSONSerializerError.deserializeError(type: SharedNoteOpenedDetails.self, json: json) } } } - /// The SharedLinkSettingsAddExpirationType struct - open class SharedLinkSettingsAddExpirationType: CustomStringConvertible { + /// The SharedNoteOpenedType struct + public class SharedNoteOpenedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAddExpirationTypeSerializer().serialize(self)))" - } - } - open class SharedLinkSettingsAddExpirationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAddExpirationType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try SharedNoteOpenedTypeSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAddExpirationType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsAddExpirationType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedNoteOpenedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedNoteOpenedType: \(error)" } } } - /// Added a password to the shared link. - open class SharedLinkSettingsAddPasswordDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAddPasswordDetailsSerializer().serialize(self)))" - } - } - open class SharedLinkSettingsAddPasswordDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAddPasswordDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + public class SharedNoteOpenedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedNoteOpenedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAddPasswordDetails { + + public func deserialize(_ json: JSON) throws -> SharedNoteOpenedType { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - return SharedLinkSettingsAddPasswordDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharedNoteOpenedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharedNoteOpenedType.self, json: json) } } } - /// The SharedLinkSettingsAddPasswordType struct - open class SharedLinkSettingsAddPasswordType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAddPasswordTypeSerializer().serialize(self)))" + /// Changed whether team members can join shared folders owned outside team. + public class SharingChangeFolderJoinPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New external join policy. + public let newValue: TeamLog.SharingFolderJoinPolicy + /// Previous external join policy. Might be missing due to historical data gap. + public let previousValue: TeamLog.SharingFolderJoinPolicy? + public init(newValue: TeamLog.SharingFolderJoinPolicy, previousValue: TeamLog.SharingFolderJoinPolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue } - } - open class SharedLinkSettingsAddPasswordTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAddPasswordType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try SharingChangeFolderJoinPolicyDetailsSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAddPasswordType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsAddPasswordType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeFolderJoinPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeFolderJoinPolicyDetails: \(error)" } } } - /// Disabled downloads. - open class SharedLinkSettingsAllowDownloadDisabledDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAllowDownloadDisabledDetailsSerializer().serialize(self)))" - } - } - open class SharedLinkSettingsAllowDownloadDisabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAllowDownloadDisabledDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + public class SharingChangeFolderJoinPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeFolderJoinPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.SharingFolderJoinPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.SharingFolderJoinPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAllowDownloadDisabledDetails { + + public func deserialize(_ json: JSON) throws -> SharingChangeFolderJoinPolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - return SharedLinkSettingsAllowDownloadDisabledDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.SharingFolderJoinPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.SharingFolderJoinPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharingChangeFolderJoinPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeFolderJoinPolicyDetails.self, json: json) } } } - /// The SharedLinkSettingsAllowDownloadDisabledType struct - open class SharedLinkSettingsAllowDownloadDisabledType: CustomStringConvertible { + /// The SharingChangeFolderJoinPolicyType struct + public class SharingChangeFolderJoinPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAllowDownloadDisabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeFolderJoinPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeFolderJoinPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeFolderJoinPolicyType: \(error)" + } } } - open class SharedLinkSettingsAllowDownloadDisabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAllowDownloadDisabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharingChangeFolderJoinPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeFolderJoinPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAllowDownloadDisabledType { + + public func deserialize(_ json: JSON) throws -> SharingChangeFolderJoinPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsAllowDownloadDisabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharingChangeFolderJoinPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeFolderJoinPolicyType.self, json: json) } } } - /// Enabled downloads. - open class SharedLinkSettingsAllowDownloadEnabledDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink + /// Changed the allow remove or change expiration policy for the links shared outside of the team. + public class SharingChangeLinkAllowChangeExpirationPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// To. + public let newValue: TeamLog.EnforceLinkPasswordPolicy + /// From. + public let previousValue: TeamLog.EnforceLinkPasswordPolicy? + public init(newValue: TeamLog.EnforceLinkPasswordPolicy, previousValue: TeamLog.EnforceLinkPasswordPolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAllowDownloadEnabledDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkAllowChangeExpirationPolicyDetails: \(error)" + } } } - open class SharedLinkSettingsAllowDownloadEnabledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAllowDownloadEnabledDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + + public class SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkAllowChangeExpirationPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.EnforceLinkPasswordPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.EnforceLinkPasswordPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAllowDownloadEnabledDetails { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkAllowChangeExpirationPolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - return SharedLinkSettingsAllowDownloadEnabledDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.EnforceLinkPasswordPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.EnforceLinkPasswordPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharingChangeLinkAllowChangeExpirationPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkAllowChangeExpirationPolicyDetails.self, json: json) } } } - /// The SharedLinkSettingsAllowDownloadEnabledType struct - open class SharedLinkSettingsAllowDownloadEnabledType: CustomStringConvertible { + /// The SharingChangeLinkAllowChangeExpirationPolicyType struct + public class SharingChangeLinkAllowChangeExpirationPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsAllowDownloadEnabledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkAllowChangeExpirationPolicyType: \(error)" + } } } - open class SharedLinkSettingsAllowDownloadEnabledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsAllowDownloadEnabledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkAllowChangeExpirationPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsAllowDownloadEnabledType { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkAllowChangeExpirationPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsAllowDownloadEnabledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharingChangeLinkAllowChangeExpirationPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkAllowChangeExpirationPolicyType.self, json: json) } } } - /// Changed the audience of the shared link. - open class SharedLinkSettingsChangeAudienceDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - /// New link audience value. - public let newValue: Sharing.LinkAudience - /// Previous link audience value. - public let previousValue: Sharing.LinkAudience? - public init(sharedContentAccessLevel: Sharing.AccessLevel, newValue: Sharing.LinkAudience, sharedContentLink: String? = nil, previousValue: Sharing.LinkAudience? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink + /// Changed the default expiration for the links shared outside of the team. + public class SharingChangeLinkDefaultExpirationPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// To. + public let newValue: TeamLog.DefaultLinkExpirationDaysPolicy + /// From. + public let previousValue: TeamLog.DefaultLinkExpirationDaysPolicy? + public init(newValue: TeamLog.DefaultLinkExpirationDaysPolicy, previousValue: TeamLog.DefaultLinkExpirationDaysPolicy? = nil) { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsChangeAudienceDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeLinkDefaultExpirationPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkDefaultExpirationPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkDefaultExpirationPolicyDetails: \(error)" + } } } - open class SharedLinkSettingsChangeAudienceDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsChangeAudienceDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "new_value": Sharing.LinkAudienceSerializer().serialize(value.newValue), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), - "previous_value": NullableSerializer(Sharing.LinkAudienceSerializer()).serialize(value.previousValue), + + public class SharingChangeLinkDefaultExpirationPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkDefaultExpirationPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.DefaultLinkExpirationDaysPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.DefaultLinkExpirationDaysPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsChangeAudienceDetails { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkDefaultExpirationPolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let newValue = Sharing.LinkAudienceSerializer().deserialize(dict["new_value"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - let previousValue = NullableSerializer(Sharing.LinkAudienceSerializer()).deserialize(dict["previous_value"] ?? .null) - return SharedLinkSettingsChangeAudienceDetails(sharedContentAccessLevel: sharedContentAccessLevel, newValue: newValue, sharedContentLink: sharedContentLink, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.DefaultLinkExpirationDaysPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.DefaultLinkExpirationDaysPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharingChangeLinkDefaultExpirationPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkDefaultExpirationPolicyDetails.self, json: json) } } } - /// The SharedLinkSettingsChangeAudienceType struct - open class SharedLinkSettingsChangeAudienceType: CustomStringConvertible { + /// The SharingChangeLinkDefaultExpirationPolicyType struct + public class SharingChangeLinkDefaultExpirationPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsChangeAudienceTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeLinkDefaultExpirationPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkDefaultExpirationPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkDefaultExpirationPolicyType: \(error)" + } } } - open class SharedLinkSettingsChangeAudienceTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsChangeAudienceType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharingChangeLinkDefaultExpirationPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkDefaultExpirationPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsChangeAudienceType { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkDefaultExpirationPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsChangeAudienceType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharingChangeLinkDefaultExpirationPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkDefaultExpirationPolicyType.self, json: json) } } } - /// Changed the expiration date of the shared link. - open class SharedLinkSettingsChangeExpirationDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - /// New shared content link expiration date. Might be missing due to historical data gap. - public let newValue: Date? - /// Previous shared content link expiration date. Might be missing due to historical data gap. - public let previousValue: Date? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil, newValue: Date? = nil, previousValue: Date? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink + /// Changed the password requirement for the links shared outside of the team. + public class SharingChangeLinkEnforcePasswordPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// To. + public let newValue: TeamLog.ChangeLinkExpirationPolicy + /// From. + public let previousValue: TeamLog.ChangeLinkExpirationPolicy? + public init(newValue: TeamLog.ChangeLinkExpirationPolicy, previousValue: TeamLog.ChangeLinkExpirationPolicy? = nil) { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsChangeExpirationDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeLinkEnforcePasswordPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkEnforcePasswordPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkEnforcePasswordPolicyDetails: \(error)" + } } } - open class SharedLinkSettingsChangeExpirationDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsChangeExpirationDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), - "new_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.newValue), - "previous_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), + + public class SharingChangeLinkEnforcePasswordPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkEnforcePasswordPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ChangeLinkExpirationPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.ChangeLinkExpirationPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsChangeExpirationDetails { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkEnforcePasswordPolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - let newValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) - return SharedLinkSettingsChangeExpirationDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink, newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ChangeLinkExpirationPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.ChangeLinkExpirationPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharingChangeLinkEnforcePasswordPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkEnforcePasswordPolicyDetails.self, json: json) } } } - /// The SharedLinkSettingsChangeExpirationType struct - open class SharedLinkSettingsChangeExpirationType: CustomStringConvertible { + /// The SharingChangeLinkEnforcePasswordPolicyType struct + public class SharingChangeLinkEnforcePasswordPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsChangeExpirationTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeLinkEnforcePasswordPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkEnforcePasswordPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkEnforcePasswordPolicyType: \(error)" + } } } - open class SharedLinkSettingsChangeExpirationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsChangeExpirationType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharingChangeLinkEnforcePasswordPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkEnforcePasswordPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsChangeExpirationType { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkEnforcePasswordPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsChangeExpirationType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharingChangeLinkEnforcePasswordPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkEnforcePasswordPolicyType.self, json: json) } } } - /// Changed the password of the shared link. - open class SharedLinkSettingsChangePasswordDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink + /// Changed whether members can share links outside team, and if links are accessible only by team members or anyone + /// by default. + public class SharingChangeLinkPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New external link accessibility policy. + public let newValue: TeamLog.SharingLinkPolicy + /// Previous external link accessibility policy. Might be missing due to historical data gap. + public let previousValue: TeamLog.SharingLinkPolicy? + public init(newValue: TeamLog.SharingLinkPolicy, previousValue: TeamLog.SharingLinkPolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsChangePasswordDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeLinkPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkPolicyDetails: \(error)" + } } } - open class SharedLinkSettingsChangePasswordDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsChangePasswordDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), + + public class SharingChangeLinkPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.SharingLinkPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.SharingLinkPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsChangePasswordDetails { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkPolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - return SharedLinkSettingsChangePasswordDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.SharingLinkPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.SharingLinkPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharingChangeLinkPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkPolicyDetails.self, json: json) } } } - /// The SharedLinkSettingsChangePasswordType struct - open class SharedLinkSettingsChangePasswordType: CustomStringConvertible { + /// The SharingChangeLinkPolicyType struct + public class SharingChangeLinkPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsChangePasswordTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeLinkPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeLinkPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeLinkPolicyType: \(error)" + } } } - open class SharedLinkSettingsChangePasswordTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsChangePasswordType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharingChangeLinkPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeLinkPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsChangePasswordType { + + public func deserialize(_ json: JSON) throws -> SharingChangeLinkPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsChangePasswordType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharingChangeLinkPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeLinkPolicyType.self, json: json) } } } - /// Removed the expiration date from the shared link. - open class SharedLinkSettingsRemoveExpirationDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - /// Previous shared link expiration date. Might be missing due to historical data gap. - public let previousValue: Date? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil, previousValue: Date? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink + /// Changed whether members can share files/folders outside team. + public class SharingChangeMemberPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New external invite policy. + public let newValue: TeamLog.SharingMemberPolicy + /// Previous external invite policy. Might be missing due to historical data gap. + public let previousValue: TeamLog.SharingMemberPolicy? + public init(newValue: TeamLog.SharingMemberPolicy, previousValue: TeamLog.SharingMemberPolicy? = nil) { + self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsRemoveExpirationDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeMemberPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeMemberPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeMemberPolicyDetails: \(error)" + } } } - open class SharedLinkSettingsRemoveExpirationDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsRemoveExpirationDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), - "previous_value": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.previousValue), + + public class SharingChangeMemberPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeMemberPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.SharingMemberPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.SharingMemberPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsRemoveExpirationDetails { + + public func deserialize(_ json: JSON) throws -> SharingChangeMemberPolicyDetails { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - let previousValue = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["previous_value"] ?? .null) - return SharedLinkSettingsRemoveExpirationDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.SharingMemberPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.SharingMemberPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SharingChangeMemberPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeMemberPolicyDetails.self, json: json) } } } - /// The SharedLinkSettingsRemoveExpirationType struct - open class SharedLinkSettingsRemoveExpirationType: CustomStringConvertible { + /// The SharingChangeMemberPolicyType struct + public class SharingChangeMemberPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsRemoveExpirationTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SharingChangeMemberPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingChangeMemberPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingChangeMemberPolicyType: \(error)" + } } } - open class SharedLinkSettingsRemoveExpirationTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsRemoveExpirationType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SharingChangeMemberPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingChangeMemberPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkSettingsRemoveExpirationType { + + public func deserialize(_ json: JSON) throws -> SharingChangeMemberPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsRemoveExpirationType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SharingChangeMemberPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SharingChangeMemberPolicyType.self, json: json) } } } - /// Removed the password from the shared link. - open class SharedLinkSettingsRemovePasswordDetails: CustomStringConvertible { - /// Shared content access level. - public let sharedContentAccessLevel: Sharing.AccessLevel - /// Shared content link. - public let sharedContentLink: String? - public init(sharedContentAccessLevel: Sharing.AccessLevel, sharedContentLink: String? = nil) { - self.sharedContentAccessLevel = sharedContentAccessLevel - nullableValidator(stringValidator())(sharedContentLink) - self.sharedContentLink = sharedContentLink + /// Policy for controlling if team members can join shared folders owned by non team members. + public enum SharingFolderJoinPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case fromAnyone + /// An unspecified error. + case fromTeamOnly + /// An unspecified error. + case other + + func json() throws -> JSON { + try SharingFolderJoinPolicySerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsRemovePasswordDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingFolderJoinPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingFolderJoinPolicy: \(error)" + } } } - open class SharedLinkSettingsRemovePasswordDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsRemovePasswordDetails) -> JSON { - let output = [ - "shared_content_access_level": Sharing.AccessLevelSerializer().serialize(value.sharedContentAccessLevel), - "shared_content_link": NullableSerializer(Serialization._StringSerializer).serialize(value.sharedContentLink), - ] - return .dictionary(output) + + public class SharingFolderJoinPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingFolderJoinPolicy) throws -> JSON { + switch value { + case .fromAnyone: + var d = [String: JSON]() + d[".tag"] = .str("from_anyone") + return .dictionary(d) + case .fromTeamOnly: + var d = [String: JSON]() + d[".tag"] = .str("from_team_only") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } } - open func deserialize(_ json: JSON) -> SharedLinkSettingsRemovePasswordDetails { + + public func deserialize(_ json: JSON) throws -> SharingFolderJoinPolicy { switch json { - case .dictionary(let dict): - let sharedContentAccessLevel = Sharing.AccessLevelSerializer().deserialize(dict["shared_content_access_level"] ?? .null) - let sharedContentLink = NullableSerializer(Serialization._StringSerializer).deserialize(dict["shared_content_link"] ?? .null) - return SharedLinkSettingsRemovePasswordDetails(sharedContentAccessLevel: sharedContentAccessLevel, sharedContentLink: sharedContentLink) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "from_anyone": + return SharingFolderJoinPolicy.fromAnyone + case "from_team_only": + return SharingFolderJoinPolicy.fromTeamOnly + case "other": + return SharingFolderJoinPolicy.other default: - fatalError("Type error deserializing") + return SharingFolderJoinPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingFolderJoinPolicy.self, json: json) } } } - /// The SharedLinkSettingsRemovePasswordType struct - open class SharedLinkSettingsRemovePasswordType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ + /// Policy for controlling if team members can share links externally + public enum SharingLinkPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case defaultNoOne + /// An unspecified error. + case defaultPrivate + /// An unspecified error. + case defaultPublic + /// An unspecified error. + case onlyPrivate + /// An unspecified error. + case other + + func json() throws -> JSON { + try SharingLinkPolicySerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkSettingsRemovePasswordTypeSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingLinkPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingLinkPolicy: \(error)" + } } } - open class SharedLinkSettingsRemovePasswordTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkSettingsRemovePasswordType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + public class SharingLinkPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingLinkPolicy) throws -> JSON { + switch value { + case .defaultNoOne: + var d = [String: JSON]() + d[".tag"] = .str("default_no_one") + return .dictionary(d) + case .defaultPrivate: + var d = [String: JSON]() + d[".tag"] = .str("default_private") + return .dictionary(d) + case .defaultPublic: + var d = [String: JSON]() + d[".tag"] = .str("default_public") + return .dictionary(d) + case .onlyPrivate: + var d = [String: JSON]() + d[".tag"] = .str("only_private") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingLinkPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default_no_one": + return SharingLinkPolicy.defaultNoOne + case "default_private": + return SharingLinkPolicy.defaultPrivate + case "default_public": + return SharingLinkPolicy.defaultPublic + case "only_private": + return SharingLinkPolicy.onlyPrivate + case "other": + return SharingLinkPolicy.other + default: + return SharingLinkPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingLinkPolicy.self, json: json) + } } - open func deserialize(_ json: JSON) -> SharedLinkSettingsRemovePasswordType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkSettingsRemovePasswordType(description_: description_) - default: - fatalError("Type error deserializing") + } + + /// External sharing policy + public enum SharingMemberPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case allow + /// An unspecified error. + case forbid + /// An unspecified error. + case forbidWithExclusions + /// An unspecified error. + case other + + func json() throws -> JSON { + try SharingMemberPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharingMemberPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharingMemberPolicy: \(error)" } } } - /// Added members as audience of shared link. - open class SharedLinkShareDetails: CustomStringConvertible { + public class SharingMemberPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharingMemberPolicy) throws -> JSON { + switch value { + case .allow: + var d = [String: JSON]() + d[".tag"] = .str("allow") + return .dictionary(d) + case .forbid: + var d = [String: JSON]() + d[".tag"] = .str("forbid") + return .dictionary(d) + case .forbidWithExclusions: + var d = [String: JSON]() + d[".tag"] = .str("forbid_with_exclusions") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharingMemberPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "allow": + return SharingMemberPolicy.allow + case "forbid": + return SharingMemberPolicy.forbid + case "forbid_with_exclusions": + return SharingMemberPolicy.forbidWithExclusions + case "other": + return SharingMemberPolicy.other + default: + return SharingMemberPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharingMemberPolicy.self, json: json) + } + } + } + + /// Disabled downloads for link. + public class ShmodelDisableDownloadsDetails: CustomStringConvertible, JSONRepresentable { /// Shared link owner details. Might be missing due to historical data gap. public let sharedLinkOwner: TeamLog.UserLogInfo? - /// Users without a Dropbox account that were added as shared link audience. - public let externalUsers: Array? - public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil, externalUsers: Array? = nil) { + public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { self.sharedLinkOwner = sharedLinkOwner - self.externalUsers = externalUsers } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkShareDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShmodelDisableDownloadsDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShmodelDisableDownloadsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShmodelDisableDownloadsDetails: \(error)" + } } } - open class SharedLinkShareDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkShareDetails) -> JSON { - let output = [ - "shared_link_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), - "external_users": NullableSerializer(ArraySerializer(TeamLog.ExternalUserLogInfoSerializer())).serialize(value.externalUsers), + + public class ShmodelDisableDownloadsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShmodelDisableDownloadsDetails) throws -> JSON { + let output = [ + "shared_link_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkShareDetails { + + public func deserialize(_ json: JSON) throws -> ShmodelDisableDownloadsDetails { switch json { - case .dictionary(let dict): - let sharedLinkOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) - let externalUsers = NullableSerializer(ArraySerializer(TeamLog.ExternalUserLogInfoSerializer())).deserialize(dict["external_users"] ?? .null) - return SharedLinkShareDetails(sharedLinkOwner: sharedLinkOwner, externalUsers: externalUsers) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) + return ShmodelDisableDownloadsDetails(sharedLinkOwner: sharedLinkOwner) + default: + throw JSONSerializerError.deserializeError(type: ShmodelDisableDownloadsDetails.self, json: json) } } } - /// The SharedLinkShareType struct - open class SharedLinkShareType: CustomStringConvertible { + /// The ShmodelDisableDownloadsType struct + public class ShmodelDisableDownloadsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkShareTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShmodelDisableDownloadsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShmodelDisableDownloadsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShmodelDisableDownloadsType: \(error)" + } } } - open class SharedLinkShareTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkShareType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShmodelDisableDownloadsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShmodelDisableDownloadsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkShareType { + + public func deserialize(_ json: JSON) throws -> ShmodelDisableDownloadsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkShareType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShmodelDisableDownloadsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShmodelDisableDownloadsType.self, json: json) } } } - /// Opened shared link. - open class SharedLinkViewDetails: CustomStringConvertible { + /// Enabled downloads for link. + public class ShmodelEnableDownloadsDetails: CustomStringConvertible, JSONRepresentable { /// Shared link owner details. Might be missing due to historical data gap. public let sharedLinkOwner: TeamLog.UserLogInfo? public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { self.sharedLinkOwner = sharedLinkOwner } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkViewDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShmodelEnableDownloadsDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShmodelEnableDownloadsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShmodelEnableDownloadsDetails: \(error)" + } } } - open class SharedLinkViewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkViewDetails) -> JSON { - let output = [ - "shared_link_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), + + public class ShmodelEnableDownloadsDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShmodelEnableDownloadsDetails) throws -> JSON { + let output = [ + "shared_link_owner": try NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkViewDetails { + + public func deserialize(_ json: JSON) throws -> ShmodelEnableDownloadsDetails { switch json { - case .dictionary(let dict): - let sharedLinkOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) - return SharedLinkViewDetails(sharedLinkOwner: sharedLinkOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedLinkOwner = try NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) + return ShmodelEnableDownloadsDetails(sharedLinkOwner: sharedLinkOwner) + default: + throw JSONSerializerError.deserializeError(type: ShmodelEnableDownloadsDetails.self, json: json) } } } - /// The SharedLinkViewType struct - open class SharedLinkViewType: CustomStringConvertible { + /// The ShmodelEnableDownloadsType struct + public class ShmodelEnableDownloadsType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkViewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShmodelEnableDownloadsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShmodelEnableDownloadsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShmodelEnableDownloadsType: \(error)" + } } } - open class SharedLinkViewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkViewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShmodelEnableDownloadsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShmodelEnableDownloadsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedLinkViewType { + + public func deserialize(_ json: JSON) throws -> ShmodelEnableDownloadsType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedLinkViewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShmodelEnableDownloadsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShmodelEnableDownloadsType.self, json: json) } } } - /// Defines who has access to a shared link. - public enum SharedLinkVisibility: CustomStringConvertible { - /// An unspecified error. - case noOne - /// An unspecified error. - case password - /// An unspecified error. - case public_ - /// An unspecified error. - case teamOnly - /// An unspecified error. - case other + /// Shared link with group. + public class ShmodelGroupShareDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try ShmodelGroupShareDetailsSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkVisibilitySerializer().serialize(self)))" - } - } - open class SharedLinkVisibilitySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkVisibility) -> JSON { - switch value { - case .noOne: - var d = [String: JSON]() - d[".tag"] = .str("no_one") - return .dictionary(d) - case .password: - var d = [String: JSON]() - d[".tag"] = .str("password") - return .dictionary(d) - case .public_: - var d = [String: JSON]() - d[".tag"] = .str("public") - return .dictionary(d) - case .teamOnly: - var d = [String: JSON]() - d[".tag"] = .str("team_only") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkVisibility { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "no_one": - return SharedLinkVisibility.noOne - case "password": - return SharedLinkVisibility.password - case "public": - return SharedLinkVisibility.public_ - case "team_only": - return SharedLinkVisibility.teamOnly - case "other": - return SharedLinkVisibility.other - default: - return SharedLinkVisibility.other - } - default: - fatalError("Failed to deserialize") + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShmodelGroupShareDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShmodelGroupShareDetails: \(error)" } } } - /// Opened shared Paper doc. - open class SharedNoteOpenedDetails: CustomStringConvertible { - public init() { - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedNoteOpenedDetailsSerializer().serialize(self)))" - } - } - open class SharedNoteOpenedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedNoteOpenedDetails) -> JSON { + public class ShmodelGroupShareDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShmodelGroupShareDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedNoteOpenedDetails { + + public func deserialize(_ json: JSON) throws -> ShmodelGroupShareDetails { switch json { - case .dictionary(_): - return SharedNoteOpenedDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return ShmodelGroupShareDetails() + default: + throw JSONSerializerError.deserializeError(type: ShmodelGroupShareDetails.self, json: json) } } } - /// The SharedNoteOpenedType struct - open class SharedNoteOpenedType: CustomStringConvertible { + /// The ShmodelGroupShareType struct + public class ShmodelGroupShareType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedNoteOpenedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShmodelGroupShareTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShmodelGroupShareTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShmodelGroupShareType: \(error)" + } } } - open class SharedNoteOpenedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedNoteOpenedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShmodelGroupShareTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShmodelGroupShareType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharedNoteOpenedType { + + public func deserialize(_ json: JSON) throws -> ShmodelGroupShareType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharedNoteOpenedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShmodelGroupShareType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShmodelGroupShareType.self, json: json) } } } - /// Changed whether team members can join shared folders owned outside team. - open class SharingChangeFolderJoinPolicyDetails: CustomStringConvertible { - /// New external join policy. - public let newValue: TeamLog.SharingFolderJoinPolicy - /// Previous external join policy. Might be missing due to historical data gap. - public let previousValue: TeamLog.SharingFolderJoinPolicy? - public init(newValue: TeamLog.SharingFolderJoinPolicy, previousValue: TeamLog.SharingFolderJoinPolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Granted access to showcase. + public class ShowcaseAccessGrantedDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + } + + func json() throws -> JSON { + try ShowcaseAccessGrantedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeFolderJoinPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseAccessGrantedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseAccessGrantedDetails: \(error)" + } } } - open class SharingChangeFolderJoinPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeFolderJoinPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.SharingFolderJoinPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.SharingFolderJoinPolicySerializer()).serialize(value.previousValue), + + public class ShowcaseAccessGrantedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseAccessGrantedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeFolderJoinPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseAccessGrantedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.SharingFolderJoinPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.SharingFolderJoinPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharingChangeFolderJoinPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseAccessGrantedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseAccessGrantedDetails.self, json: json) } } } - /// The SharingChangeFolderJoinPolicyType struct - open class SharingChangeFolderJoinPolicyType: CustomStringConvertible { + /// The ShowcaseAccessGrantedType struct + public class ShowcaseAccessGrantedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeFolderJoinPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseAccessGrantedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseAccessGrantedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseAccessGrantedType: \(error)" + } } } - open class SharingChangeFolderJoinPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeFolderJoinPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseAccessGrantedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseAccessGrantedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeFolderJoinPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseAccessGrantedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharingChangeFolderJoinPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseAccessGrantedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseAccessGrantedType.self, json: json) } } } - /// Changed the allow remove or change expiration policy for the links shared outside of the team. - open class SharingChangeLinkAllowChangeExpirationPolicyDetails: CustomStringConvertible { - /// To. - public let newValue: TeamLog.EnforceLinkPasswordPolicy - /// From. - public let previousValue: TeamLog.EnforceLinkPasswordPolicy? - public init(newValue: TeamLog.EnforceLinkPasswordPolicy, previousValue: TeamLog.EnforceLinkPasswordPolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Added member to showcase. + public class ShowcaseAddMemberDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + } + + func json() throws -> JSON { + try ShowcaseAddMemberDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseAddMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseAddMemberDetails: \(error)" + } } } - open class SharingChangeLinkAllowChangeExpirationPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkAllowChangeExpirationPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.EnforceLinkPasswordPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.EnforceLinkPasswordPolicySerializer()).serialize(value.previousValue), + + public class ShowcaseAddMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseAddMemberDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkAllowChangeExpirationPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseAddMemberDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.EnforceLinkPasswordPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.EnforceLinkPasswordPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharingChangeLinkAllowChangeExpirationPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseAddMemberDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseAddMemberDetails.self, json: json) } } } - /// The SharingChangeLinkAllowChangeExpirationPolicyType struct - open class SharingChangeLinkAllowChangeExpirationPolicyType: CustomStringConvertible { + /// The ShowcaseAddMemberType struct + public class ShowcaseAddMemberType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseAddMemberTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseAddMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseAddMemberType: \(error)" + } } } - open class SharingChangeLinkAllowChangeExpirationPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkAllowChangeExpirationPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseAddMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseAddMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkAllowChangeExpirationPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseAddMemberType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharingChangeLinkAllowChangeExpirationPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseAddMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseAddMemberType.self, json: json) } } } - /// Changed the default expiration for the links shared outside of the team. - open class SharingChangeLinkDefaultExpirationPolicyDetails: CustomStringConvertible { - /// To. - public let newValue: TeamLog.DefaultLinkExpirationDaysPolicy - /// From. - public let previousValue: TeamLog.DefaultLinkExpirationDaysPolicy? - public init(newValue: TeamLog.DefaultLinkExpirationDaysPolicy, previousValue: TeamLog.DefaultLinkExpirationDaysPolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Archived showcase. + public class ShowcaseArchivedDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + } + + func json() throws -> JSON { + try ShowcaseArchivedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkDefaultExpirationPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseArchivedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseArchivedDetails: \(error)" + } } } - open class SharingChangeLinkDefaultExpirationPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkDefaultExpirationPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.DefaultLinkExpirationDaysPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.DefaultLinkExpirationDaysPolicySerializer()).serialize(value.previousValue), + + public class ShowcaseArchivedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseArchivedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkDefaultExpirationPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseArchivedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.DefaultLinkExpirationDaysPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.DefaultLinkExpirationDaysPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharingChangeLinkDefaultExpirationPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseArchivedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseArchivedDetails.self, json: json) } } } - /// The SharingChangeLinkDefaultExpirationPolicyType struct - open class SharingChangeLinkDefaultExpirationPolicyType: CustomStringConvertible { + /// The ShowcaseArchivedType struct + public class ShowcaseArchivedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkDefaultExpirationPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseArchivedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseArchivedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseArchivedType: \(error)" + } } } - open class SharingChangeLinkDefaultExpirationPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkDefaultExpirationPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseArchivedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseArchivedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkDefaultExpirationPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseArchivedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharingChangeLinkDefaultExpirationPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseArchivedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseArchivedType.self, json: json) } } } - /// Changed the password requirement for the links shared outside of the team. - open class SharingChangeLinkEnforcePasswordPolicyDetails: CustomStringConvertible { - /// To. - public let newValue: TeamLog.ChangeLinkExpirationPolicy - /// From. - public let previousValue: TeamLog.ChangeLinkExpirationPolicy? - public init(newValue: TeamLog.ChangeLinkExpirationPolicy, previousValue: TeamLog.ChangeLinkExpirationPolicy? = nil) { + /// Enabled/disabled downloading files from Dropbox Showcase for team. + public class ShowcaseChangeDownloadPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New Dropbox Showcase download policy. + public let newValue: TeamLog.ShowcaseDownloadPolicy + /// Previous Dropbox Showcase download policy. + public let previousValue: TeamLog.ShowcaseDownloadPolicy + public init(newValue: TeamLog.ShowcaseDownloadPolicy, previousValue: TeamLog.ShowcaseDownloadPolicy) { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkEnforcePasswordPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseChangeDownloadPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseChangeDownloadPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseChangeDownloadPolicyDetails: \(error)" + } } } - open class SharingChangeLinkEnforcePasswordPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkEnforcePasswordPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.ChangeLinkExpirationPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.ChangeLinkExpirationPolicySerializer()).serialize(value.previousValue), + + public class ShowcaseChangeDownloadPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseChangeDownloadPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ShowcaseDownloadPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.ShowcaseDownloadPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkEnforcePasswordPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseChangeDownloadPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ChangeLinkExpirationPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.ChangeLinkExpirationPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharingChangeLinkEnforcePasswordPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ShowcaseDownloadPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.ShowcaseDownloadPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return ShowcaseChangeDownloadPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseChangeDownloadPolicyDetails.self, json: json) } } } - /// The SharingChangeLinkEnforcePasswordPolicyType struct - open class SharingChangeLinkEnforcePasswordPolicyType: CustomStringConvertible { + /// The ShowcaseChangeDownloadPolicyType struct + public class ShowcaseChangeDownloadPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkEnforcePasswordPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseChangeDownloadPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseChangeDownloadPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseChangeDownloadPolicyType: \(error)" + } } } - open class SharingChangeLinkEnforcePasswordPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkEnforcePasswordPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseChangeDownloadPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseChangeDownloadPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkEnforcePasswordPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseChangeDownloadPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharingChangeLinkEnforcePasswordPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseChangeDownloadPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseChangeDownloadPolicyType.self, json: json) } } } - /// Changed whether members can share links outside team, and if links are accessible only by team members or anyone - /// by default. - open class SharingChangeLinkPolicyDetails: CustomStringConvertible { - /// New external link accessibility policy. - public let newValue: TeamLog.SharingLinkPolicy - /// Previous external link accessibility policy. Might be missing due to historical data gap. - public let previousValue: TeamLog.SharingLinkPolicy? - public init(newValue: TeamLog.SharingLinkPolicy, previousValue: TeamLog.SharingLinkPolicy? = nil) { + /// Enabled/disabled Dropbox Showcase for team. + public class ShowcaseChangeEnabledPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New Dropbox Showcase policy. + public let newValue: TeamLog.ShowcaseEnabledPolicy + /// Previous Dropbox Showcase policy. + public let previousValue: TeamLog.ShowcaseEnabledPolicy + public init(newValue: TeamLog.ShowcaseEnabledPolicy, previousValue: TeamLog.ShowcaseEnabledPolicy) { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseChangeEnabledPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseChangeEnabledPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseChangeEnabledPolicyDetails: \(error)" + } } } - open class SharingChangeLinkPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.SharingLinkPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.SharingLinkPolicySerializer()).serialize(value.previousValue), + + public class ShowcaseChangeEnabledPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseChangeEnabledPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ShowcaseEnabledPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.ShowcaseEnabledPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseChangeEnabledPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.SharingLinkPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.SharingLinkPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharingChangeLinkPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ShowcaseEnabledPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.ShowcaseEnabledPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return ShowcaseChangeEnabledPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseChangeEnabledPolicyDetails.self, json: json) } } } - /// The SharingChangeLinkPolicyType struct - open class SharingChangeLinkPolicyType: CustomStringConvertible { + /// The ShowcaseChangeEnabledPolicyType struct + public class ShowcaseChangeEnabledPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeLinkPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseChangeEnabledPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseChangeEnabledPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseChangeEnabledPolicyType: \(error)" + } } } - open class SharingChangeLinkPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeLinkPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseChangeEnabledPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseChangeEnabledPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeLinkPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseChangeEnabledPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharingChangeLinkPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseChangeEnabledPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseChangeEnabledPolicyType.self, json: json) } } } - /// Changed whether members can share files/folders outside team. - open class SharingChangeMemberPolicyDetails: CustomStringConvertible { - /// New external invite policy. - public let newValue: TeamLog.SharingMemberPolicy - /// Previous external invite policy. Might be missing due to historical data gap. - public let previousValue: TeamLog.SharingMemberPolicy? - public init(newValue: TeamLog.SharingMemberPolicy, previousValue: TeamLog.SharingMemberPolicy? = nil) { + /// Enabled/disabled sharing Dropbox Showcase externally for team. + public class ShowcaseChangeExternalSharingPolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New Dropbox Showcase external sharing policy. + public let newValue: TeamLog.ShowcaseExternalSharingPolicy + /// Previous Dropbox Showcase external sharing policy. + public let previousValue: TeamLog.ShowcaseExternalSharingPolicy + public init(newValue: TeamLog.ShowcaseExternalSharingPolicy, previousValue: TeamLog.ShowcaseExternalSharingPolicy) { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeMemberPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseChangeExternalSharingPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseChangeExternalSharingPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseChangeExternalSharingPolicyDetails: \(error)" + } } } - open class SharingChangeMemberPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeMemberPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.SharingMemberPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.SharingMemberPolicySerializer()).serialize(value.previousValue), + + public class ShowcaseChangeExternalSharingPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseChangeExternalSharingPolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.ShowcaseExternalSharingPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.ShowcaseExternalSharingPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SharingChangeMemberPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseChangeExternalSharingPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.SharingMemberPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.SharingMemberPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SharingChangeMemberPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.ShowcaseExternalSharingPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.ShowcaseExternalSharingPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return ShowcaseChangeExternalSharingPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseChangeExternalSharingPolicyDetails.self, json: json) } } } - /// The SharingChangeMemberPolicyType struct - open class SharingChangeMemberPolicyType: CustomStringConvertible { + /// The ShowcaseChangeExternalSharingPolicyType struct + public class ShowcaseChangeExternalSharingPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingChangeMemberPolicyTypeSerializer().serialize(self)))" - } - } - open class SharingChangeMemberPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingChangeMemberPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> SharingChangeMemberPolicyType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SharingChangeMemberPolicyType(description_: description_) - default: - fatalError("Type error deserializing") - } - } - } - /// Policy for controlling if team members can join shared folders owned by non team members. - public enum SharingFolderJoinPolicy: CustomStringConvertible { - /// An unspecified error. - case fromAnyone - /// An unspecified error. - case fromTeamOnly - /// An unspecified error. - case other + func json() throws -> JSON { + try ShowcaseChangeExternalSharingPolicyTypeSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingFolderJoinPolicySerializer().serialize(self)))" - } - } - open class SharingFolderJoinPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingFolderJoinPolicy) -> JSON { - switch value { - case .fromAnyone: - var d = [String: JSON]() - d[".tag"] = .str("from_anyone") - return .dictionary(d) - case .fromTeamOnly: - var d = [String: JSON]() - d[".tag"] = .str("from_team_only") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingFolderJoinPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "from_anyone": - return SharingFolderJoinPolicy.fromAnyone - case "from_team_only": - return SharingFolderJoinPolicy.fromTeamOnly - case "other": - return SharingFolderJoinPolicy.other - default: - return SharingFolderJoinPolicy.other - } - default: - fatalError("Failed to deserialize") + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseChangeExternalSharingPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseChangeExternalSharingPolicyType: \(error)" } } } - /// Policy for controlling if team members can share links externally - public enum SharingLinkPolicy: CustomStringConvertible { - /// An unspecified error. - case defaultNoOne - /// An unspecified error. - case defaultPrivate - /// An unspecified error. - case defaultPublic - /// An unspecified error. - case onlyPrivate - /// An unspecified error. - case other - - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingLinkPolicySerializer().serialize(self)))" + public class ShowcaseChangeExternalSharingPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseChangeExternalSharingPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) } - } - open class SharingLinkPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingLinkPolicy) -> JSON { - switch value { - case .defaultNoOne: - var d = [String: JSON]() - d[".tag"] = .str("default_no_one") - return .dictionary(d) - case .defaultPrivate: - var d = [String: JSON]() - d[".tag"] = .str("default_private") - return .dictionary(d) - case .defaultPublic: - var d = [String: JSON]() - d[".tag"] = .str("default_public") - return .dictionary(d) - case .onlyPrivate: - var d = [String: JSON]() - d[".tag"] = .str("only_private") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingLinkPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default_no_one": - return SharingLinkPolicy.defaultNoOne - case "default_private": - return SharingLinkPolicy.defaultPrivate - case "default_public": - return SharingLinkPolicy.defaultPublic - case "only_private": - return SharingLinkPolicy.onlyPrivate - case "other": - return SharingLinkPolicy.other - default: - return SharingLinkPolicy.other - } - default: - fatalError("Failed to deserialize") + + public func deserialize(_ json: JSON) throws -> ShowcaseChangeExternalSharingPolicyType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseChangeExternalSharingPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseChangeExternalSharingPolicyType.self, json: json) } } } - /// External sharing policy - public enum SharingMemberPolicy: CustomStringConvertible { - /// An unspecified error. - case allow - /// An unspecified error. - case forbid - /// An unspecified error. - case forbidWithExclusions - /// An unspecified error. - case other - - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharingMemberPolicySerializer().serialize(self)))" - } - } - open class SharingMemberPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharingMemberPolicy) -> JSON { - switch value { - case .allow: - var d = [String: JSON]() - d[".tag"] = .str("allow") - return .dictionary(d) - case .forbid: - var d = [String: JSON]() - d[".tag"] = .str("forbid") - return .dictionary(d) - case .forbidWithExclusions: - var d = [String: JSON]() - d[".tag"] = .str("forbid_with_exclusions") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharingMemberPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "allow": - return SharingMemberPolicy.allow - case "forbid": - return SharingMemberPolicy.forbid - case "forbid_with_exclusions": - return SharingMemberPolicy.forbidWithExclusions - case "other": - return SharingMemberPolicy.other - default: - return SharingMemberPolicy.other - } - default: - fatalError("Failed to deserialize") - } + /// Created showcase. + public class ShowcaseCreatedDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid } - } - /// Disabled downloads for link. - open class ShmodelDisableDownloadsDetails: CustomStringConvertible { - /// Shared link owner details. Might be missing due to historical data gap. - public let sharedLinkOwner: TeamLog.UserLogInfo? - public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { - self.sharedLinkOwner = sharedLinkOwner + func json() throws -> JSON { + try ShowcaseCreatedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShmodelDisableDownloadsDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseCreatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseCreatedDetails: \(error)" + } } } - open class ShmodelDisableDownloadsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShmodelDisableDownloadsDetails) -> JSON { - let output = [ - "shared_link_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), + + public class ShowcaseCreatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseCreatedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShmodelDisableDownloadsDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseCreatedDetails { switch json { - case .dictionary(let dict): - let sharedLinkOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) - return ShmodelDisableDownloadsDetails(sharedLinkOwner: sharedLinkOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseCreatedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseCreatedDetails.self, json: json) } } } - /// The ShmodelDisableDownloadsType struct - open class ShmodelDisableDownloadsType: CustomStringConvertible { + /// The ShowcaseCreatedType struct + public class ShowcaseCreatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShmodelDisableDownloadsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseCreatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseCreatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseCreatedType: \(error)" + } } } - open class ShmodelDisableDownloadsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShmodelDisableDownloadsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseCreatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseCreatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShmodelDisableDownloadsType { + + public func deserialize(_ json: JSON) throws -> ShowcaseCreatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShmodelDisableDownloadsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseCreatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseCreatedType.self, json: json) } } } - /// Enabled downloads for link. - open class ShmodelEnableDownloadsDetails: CustomStringConvertible { - /// Shared link owner details. Might be missing due to historical data gap. - public let sharedLinkOwner: TeamLog.UserLogInfo? - public init(sharedLinkOwner: TeamLog.UserLogInfo? = nil) { - self.sharedLinkOwner = sharedLinkOwner + /// Deleted showcase comment. + public class ShowcaseDeleteCommentDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + /// Comment text. + public let commentText: String? + public init(eventUuid: String, commentText: String? = nil) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + nullableValidator(stringValidator())(commentText) + self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShmodelEnableDownloadsDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseDeleteCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseDeleteCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseDeleteCommentDetails: \(error)" + } } } - open class ShmodelEnableDownloadsDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShmodelEnableDownloadsDetails) -> JSON { - let output = [ - "shared_link_owner": NullableSerializer(TeamLog.UserLogInfoSerializer()).serialize(value.sharedLinkOwner), + + public class ShowcaseDeleteCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseDeleteCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShmodelEnableDownloadsDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseDeleteCommentDetails { switch json { - case .dictionary(let dict): - let sharedLinkOwner = NullableSerializer(TeamLog.UserLogInfoSerializer()).deserialize(dict["shared_link_owner"] ?? .null) - return ShmodelEnableDownloadsDetails(sharedLinkOwner: sharedLinkOwner) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return ShowcaseDeleteCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseDeleteCommentDetails.self, json: json) } } } - /// The ShmodelEnableDownloadsType struct - open class ShmodelEnableDownloadsType: CustomStringConvertible { + /// The ShowcaseDeleteCommentType struct + public class ShowcaseDeleteCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShmodelEnableDownloadsTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseDeleteCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseDeleteCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseDeleteCommentType: \(error)" + } } } - open class ShmodelEnableDownloadsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShmodelEnableDownloadsType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseDeleteCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseDeleteCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShmodelEnableDownloadsType { + + public func deserialize(_ json: JSON) throws -> ShowcaseDeleteCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShmodelEnableDownloadsType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseDeleteCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseDeleteCommentType.self, json: json) } } } - /// Shared link with group. - open class ShmodelGroupShareDetails: CustomStringConvertible { - public init() { + /// Showcase document's logged information. + public class ShowcaseDocumentLogInfo: CustomStringConvertible, JSONRepresentable { + /// Showcase document Id. + public let showcaseId: String + /// Showcase document title. + public let showcaseTitle: String + public init(showcaseId: String, showcaseTitle: String) { + stringValidator()(showcaseId) + self.showcaseId = showcaseId + stringValidator()(showcaseTitle) + self.showcaseTitle = showcaseTitle + } + + func json() throws -> JSON { + try ShowcaseDocumentLogInfoSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShmodelGroupShareDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseDocumentLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseDocumentLogInfo: \(error)" + } } } - open class ShmodelGroupShareDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShmodelGroupShareDetails) -> JSON { - let output = [String: JSON]() + + public class ShowcaseDocumentLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseDocumentLogInfo) throws -> JSON { + let output = [ + "showcase_id": try Serialization._StringSerializer.serialize(value.showcaseId), + "showcase_title": try Serialization._StringSerializer.serialize(value.showcaseTitle), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShmodelGroupShareDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseDocumentLogInfo { switch json { - case .dictionary(_): - return ShmodelGroupShareDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let showcaseId = try Serialization._StringSerializer.deserialize(dict["showcase_id"] ?? .null) + let showcaseTitle = try Serialization._StringSerializer.deserialize(dict["showcase_title"] ?? .null) + return ShowcaseDocumentLogInfo(showcaseId: showcaseId, showcaseTitle: showcaseTitle) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseDocumentLogInfo.self, json: json) } } } - /// The ShmodelGroupShareType struct - open class ShmodelGroupShareType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ + /// Policy for controlling if files can be downloaded from Showcases by team members + public enum ShowcaseDownloadPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case disabled + /// An unspecified error. + case enabled + /// An unspecified error. + case other + + func json() throws -> JSON { + try ShowcaseDownloadPolicySerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShmodelGroupShareTypeSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseDownloadPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseDownloadPolicy: \(error)" + } } } - open class ShmodelGroupShareTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShmodelGroupShareType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + public class ShowcaseDownloadPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseDownloadPolicy) throws -> JSON { + switch value { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } } - open func deserialize(_ json: JSON) -> ShmodelGroupShareType { + + public func deserialize(_ json: JSON) throws -> ShowcaseDownloadPolicy { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShmodelGroupShareType(description_: description_) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ShowcaseDownloadPolicy.disabled + case "enabled": + return ShowcaseDownloadPolicy.enabled + case "other": + return ShowcaseDownloadPolicy.other default: - fatalError("Type error deserializing") + return ShowcaseDownloadPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ShowcaseDownloadPolicy.self, json: json) } } } - /// Granted access to showcase. - open class ShowcaseAccessGrantedDetails: CustomStringConvertible { + /// Edited showcase comment. + public class ShowcaseEditCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String - public init(eventUuid: String) { + /// Comment text. + public let commentText: String? + public init(eventUuid: String, commentText: String? = nil) { stringValidator()(eventUuid) self.eventUuid = eventUuid + nullableValidator(stringValidator())(commentText) + self.commentText = commentText + } + + func json() throws -> JSON { + try ShowcaseEditCommentDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseAccessGrantedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseEditCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseEditCommentDetails: \(error)" + } } } - open class ShowcaseAccessGrantedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseAccessGrantedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseEditCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseEditCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseAccessGrantedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseEditCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseAccessGrantedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return ShowcaseEditCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseEditCommentDetails.self, json: json) } } } - /// The ShowcaseAccessGrantedType struct - open class ShowcaseAccessGrantedType: CustomStringConvertible { + /// The ShowcaseEditCommentType struct + public class ShowcaseEditCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseAccessGrantedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseEditCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseEditCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseEditCommentType: \(error)" + } } } - open class ShowcaseAccessGrantedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseAccessGrantedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseEditCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseEditCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseAccessGrantedType { + + public func deserialize(_ json: JSON) throws -> ShowcaseEditCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseAccessGrantedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseEditCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseEditCommentType.self, json: json) } } } - /// Added member to showcase. - open class ShowcaseAddMemberDetails: CustomStringConvertible { + /// Edited showcase. + public class ShowcaseEditedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseAddMemberDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseEditedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseEditedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseEditedDetails: \(error)" + } } } - open class ShowcaseAddMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseAddMemberDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseEditedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseEditedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseAddMemberDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseEditedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseAddMemberDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseEditedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseEditedDetails.self, json: json) } } } - /// The ShowcaseAddMemberType struct - open class ShowcaseAddMemberType: CustomStringConvertible { + /// The ShowcaseEditedType struct + public class ShowcaseEditedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseAddMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseEditedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseEditedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseEditedType: \(error)" + } } } - open class ShowcaseAddMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseAddMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseEditedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseEditedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseAddMemberType { + + public func deserialize(_ json: JSON) throws -> ShowcaseEditedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseEditedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseEditedType.self, json: json) + } + } + } + + /// Policy for controlling whether Showcase is enabled. + public enum ShowcaseEnabledPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case disabled + /// An unspecified error. + case enabled + /// An unspecified error. + case other + + func json() throws -> JSON { + try ShowcaseEnabledPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseEnabledPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseEnabledPolicy: \(error)" + } + } + } + + public class ShowcaseEnabledPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseEnabledPolicy) throws -> JSON { + switch value { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShowcaseEnabledPolicy { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseAddMemberType(description_: description_) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ShowcaseEnabledPolicy.disabled + case "enabled": + return ShowcaseEnabledPolicy.enabled + case "other": + return ShowcaseEnabledPolicy.other default: - fatalError("Type error deserializing") + return ShowcaseEnabledPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ShowcaseEnabledPolicy.self, json: json) } } } - /// Archived showcase. - open class ShowcaseArchivedDetails: CustomStringConvertible { + /// Policy for controlling if team members can share Showcases externally. + public enum ShowcaseExternalSharingPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case disabled + /// An unspecified error. + case enabled + /// An unspecified error. + case other + + func json() throws -> JSON { + try ShowcaseExternalSharingPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseExternalSharingPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseExternalSharingPolicy: \(error)" + } + } + } + + public class ShowcaseExternalSharingPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseExternalSharingPolicy) throws -> JSON { + switch value { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShowcaseExternalSharingPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ShowcaseExternalSharingPolicy.disabled + case "enabled": + return ShowcaseExternalSharingPolicy.enabled + case "other": + return ShowcaseExternalSharingPolicy.other + default: + return ShowcaseExternalSharingPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ShowcaseExternalSharingPolicy.self, json: json) + } + } + } + + /// Added file to showcase. + public class ShowcaseFileAddedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseArchivedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseFileAddedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileAddedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileAddedDetails: \(error)" + } } } - open class ShowcaseArchivedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseArchivedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseFileAddedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileAddedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseArchivedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileAddedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseArchivedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseFileAddedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileAddedDetails.self, json: json) } } } - /// The ShowcaseArchivedType struct - open class ShowcaseArchivedType: CustomStringConvertible { + /// The ShowcaseFileAddedType struct + public class ShowcaseFileAddedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseArchivedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseFileAddedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileAddedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileAddedType: \(error)" + } } } - open class ShowcaseArchivedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseArchivedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseFileAddedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileAddedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseArchivedType { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileAddedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseArchivedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseFileAddedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileAddedType.self, json: json) } } } - /// Enabled/disabled downloading files from Dropbox Showcase for team. - open class ShowcaseChangeDownloadPolicyDetails: CustomStringConvertible { - /// New Dropbox Showcase download policy. - public let newValue: TeamLog.ShowcaseDownloadPolicy - /// Previous Dropbox Showcase download policy. - public let previousValue: TeamLog.ShowcaseDownloadPolicy - public init(newValue: TeamLog.ShowcaseDownloadPolicy, previousValue: TeamLog.ShowcaseDownloadPolicy) { - self.newValue = newValue - self.previousValue = previousValue + /// Downloaded file from showcase. + public class ShowcaseFileDownloadDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + /// Showcase download type. + public let downloadType: String + public init(eventUuid: String, downloadType: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + stringValidator()(downloadType) + self.downloadType = downloadType + } + + func json() throws -> JSON { + try ShowcaseFileDownloadDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseChangeDownloadPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileDownloadDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileDownloadDetails: \(error)" + } } } - open class ShowcaseChangeDownloadPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseChangeDownloadPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.ShowcaseDownloadPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.ShowcaseDownloadPolicySerializer().serialize(value.previousValue), + + public class ShowcaseFileDownloadDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileDownloadDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "download_type": try Serialization._StringSerializer.serialize(value.downloadType), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseChangeDownloadPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileDownloadDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ShowcaseDownloadPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.ShowcaseDownloadPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return ShowcaseChangeDownloadPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let downloadType = try Serialization._StringSerializer.deserialize(dict["download_type"] ?? .null) + return ShowcaseFileDownloadDetails(eventUuid: eventUuid, downloadType: downloadType) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileDownloadDetails.self, json: json) } } } - /// The ShowcaseChangeDownloadPolicyType struct - open class ShowcaseChangeDownloadPolicyType: CustomStringConvertible { + /// The ShowcaseFileDownloadType struct + public class ShowcaseFileDownloadType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseChangeDownloadPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseFileDownloadTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileDownloadTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileDownloadType: \(error)" + } } } - open class ShowcaseChangeDownloadPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseChangeDownloadPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseFileDownloadTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileDownloadType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseChangeDownloadPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileDownloadType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseChangeDownloadPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseFileDownloadType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileDownloadType.self, json: json) } } - } + } + + /// Removed file from showcase. + public class ShowcaseFileRemovedDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + } - /// Enabled/disabled Dropbox Showcase for team. - open class ShowcaseChangeEnabledPolicyDetails: CustomStringConvertible { - /// New Dropbox Showcase policy. - public let newValue: TeamLog.ShowcaseEnabledPolicy - /// Previous Dropbox Showcase policy. - public let previousValue: TeamLog.ShowcaseEnabledPolicy - public init(newValue: TeamLog.ShowcaseEnabledPolicy, previousValue: TeamLog.ShowcaseEnabledPolicy) { - self.newValue = newValue - self.previousValue = previousValue + func json() throws -> JSON { + try ShowcaseFileRemovedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseChangeEnabledPolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileRemovedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileRemovedDetails: \(error)" + } } } - open class ShowcaseChangeEnabledPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseChangeEnabledPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.ShowcaseEnabledPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.ShowcaseEnabledPolicySerializer().serialize(value.previousValue), + + public class ShowcaseFileRemovedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileRemovedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseChangeEnabledPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileRemovedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ShowcaseEnabledPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.ShowcaseEnabledPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return ShowcaseChangeEnabledPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseFileRemovedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileRemovedDetails.self, json: json) } } } - /// The ShowcaseChangeEnabledPolicyType struct - open class ShowcaseChangeEnabledPolicyType: CustomStringConvertible { + /// The ShowcaseFileRemovedType struct + public class ShowcaseFileRemovedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseChangeEnabledPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseFileRemovedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileRemovedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileRemovedType: \(error)" + } } } - open class ShowcaseChangeEnabledPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseChangeEnabledPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseFileRemovedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileRemovedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseChangeEnabledPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileRemovedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseChangeEnabledPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseFileRemovedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileRemovedType.self, json: json) } } } - /// Enabled/disabled sharing Dropbox Showcase externally for team. - open class ShowcaseChangeExternalSharingPolicyDetails: CustomStringConvertible { - /// New Dropbox Showcase external sharing policy. - public let newValue: TeamLog.ShowcaseExternalSharingPolicy - /// Previous Dropbox Showcase external sharing policy. - public let previousValue: TeamLog.ShowcaseExternalSharingPolicy - public init(newValue: TeamLog.ShowcaseExternalSharingPolicy, previousValue: TeamLog.ShowcaseExternalSharingPolicy) { - self.newValue = newValue - self.previousValue = previousValue + /// Viewed file in showcase. + public class ShowcaseFileViewDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseChangeExternalSharingPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseFileViewDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileViewDetails: \(error)" + } } } - open class ShowcaseChangeExternalSharingPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseChangeExternalSharingPolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.ShowcaseExternalSharingPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.ShowcaseExternalSharingPolicySerializer().serialize(value.previousValue), + + public class ShowcaseFileViewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileViewDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseChangeExternalSharingPolicyDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileViewDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.ShowcaseExternalSharingPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.ShowcaseExternalSharingPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return ShowcaseChangeExternalSharingPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseFileViewDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileViewDetails.self, json: json) } } } - /// The ShowcaseChangeExternalSharingPolicyType struct - open class ShowcaseChangeExternalSharingPolicyType: CustomStringConvertible { + /// The ShowcaseFileViewType struct + public class ShowcaseFileViewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseChangeExternalSharingPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseFileViewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseFileViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseFileViewType: \(error)" + } } } - open class ShowcaseChangeExternalSharingPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseChangeExternalSharingPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseFileViewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseFileViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseChangeExternalSharingPolicyType { + + public func deserialize(_ json: JSON) throws -> ShowcaseFileViewType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseChangeExternalSharingPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseFileViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseFileViewType.self, json: json) } } } - /// Created showcase. - open class ShowcaseCreatedDetails: CustomStringConvertible { + /// Permanently deleted showcase. + public class ShowcasePermanentlyDeletedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseCreatedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcasePermanentlyDeletedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcasePermanentlyDeletedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcasePermanentlyDeletedDetails: \(error)" + } } } - open class ShowcaseCreatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseCreatedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcasePermanentlyDeletedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcasePermanentlyDeletedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseCreatedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcasePermanentlyDeletedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseCreatedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcasePermanentlyDeletedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcasePermanentlyDeletedDetails.self, json: json) } } } - /// The ShowcaseCreatedType struct - open class ShowcaseCreatedType: CustomStringConvertible { + /// The ShowcasePermanentlyDeletedType struct + public class ShowcasePermanentlyDeletedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseCreatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcasePermanentlyDeletedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcasePermanentlyDeletedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcasePermanentlyDeletedType: \(error)" + } } } - open class ShowcaseCreatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseCreatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcasePermanentlyDeletedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcasePermanentlyDeletedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseCreatedType { + + public func deserialize(_ json: JSON) throws -> ShowcasePermanentlyDeletedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseCreatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcasePermanentlyDeletedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcasePermanentlyDeletedType.self, json: json) } } } - /// Deleted showcase comment. - open class ShowcaseDeleteCommentDetails: CustomStringConvertible { + /// Added showcase comment. + public class ShowcasePostCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String /// Comment text. @@ -45336,3157 +57800,3781 @@ open class TeamLog { nullableValidator(stringValidator())(commentText) self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseDeleteCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcasePostCommentDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcasePostCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcasePostCommentDetails: \(error)" + } } } - open class ShowcaseDeleteCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseDeleteCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class ShowcasePostCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcasePostCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseDeleteCommentDetails { + + public func deserialize(_ json: JSON) throws -> ShowcasePostCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return ShowcaseDeleteCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return ShowcasePostCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: ShowcasePostCommentDetails.self, json: json) } } } - /// The ShowcaseDeleteCommentType struct - open class ShowcaseDeleteCommentType: CustomStringConvertible { + /// The ShowcasePostCommentType struct + public class ShowcasePostCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseDeleteCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcasePostCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcasePostCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcasePostCommentType: \(error)" + } } } - open class ShowcaseDeleteCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseDeleteCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcasePostCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcasePostCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseDeleteCommentType { + + public func deserialize(_ json: JSON) throws -> ShowcasePostCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseDeleteCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcasePostCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcasePostCommentType.self, json: json) } } } - /// Showcase document's logged information. - open class ShowcaseDocumentLogInfo: CustomStringConvertible { - /// Showcase document Id. - public let showcaseId: String - /// Showcase document title. - public let showcaseTitle: String - public init(showcaseId: String, showcaseTitle: String) { - stringValidator()(showcaseId) - self.showcaseId = showcaseId - stringValidator()(showcaseTitle) - self.showcaseTitle = showcaseTitle + /// Removed member from showcase. + public class ShowcaseRemoveMemberDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { + stringValidator()(eventUuid) + self.eventUuid = eventUuid + } + + func json() throws -> JSON { + try ShowcaseRemoveMemberDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseDocumentLogInfoSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRemoveMemberDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRemoveMemberDetails: \(error)" + } } } - open class ShowcaseDocumentLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseDocumentLogInfo) -> JSON { - let output = [ - "showcase_id": Serialization._StringSerializer.serialize(value.showcaseId), - "showcase_title": Serialization._StringSerializer.serialize(value.showcaseTitle), + + public class ShowcaseRemoveMemberDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRemoveMemberDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseDocumentLogInfo { + + public func deserialize(_ json: JSON) throws -> ShowcaseRemoveMemberDetails { switch json { - case .dictionary(let dict): - let showcaseId = Serialization._StringSerializer.deserialize(dict["showcase_id"] ?? .null) - let showcaseTitle = Serialization._StringSerializer.deserialize(dict["showcase_title"] ?? .null) - return ShowcaseDocumentLogInfo(showcaseId: showcaseId, showcaseTitle: showcaseTitle) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseRemoveMemberDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRemoveMemberDetails.self, json: json) } } } - /// Policy for controlling if files can be downloaded from Showcases by team members - public enum ShowcaseDownloadPolicy: CustomStringConvertible { - /// An unspecified error. - case disabled - /// An unspecified error. - case enabled - /// An unspecified error. - case other + /// The ShowcaseRemoveMemberType struct + public class ShowcaseRemoveMemberType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ShowcaseRemoveMemberTypeSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseDownloadPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRemoveMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRemoveMemberType: \(error)" + } } } - open class ShowcaseDownloadPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseDownloadPolicy) -> JSON { - switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShowcaseDownloadPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ShowcaseDownloadPolicy.disabled - case "enabled": - return ShowcaseDownloadPolicy.enabled - case "other": - return ShowcaseDownloadPolicy.other - default: - return ShowcaseDownloadPolicy.other - } - default: - fatalError("Failed to deserialize") + + public class ShowcaseRemoveMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRemoveMemberType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> ShowcaseRemoveMemberType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseRemoveMemberType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRemoveMemberType.self, json: json) } } } - /// Edited showcase comment. - open class ShowcaseEditCommentDetails: CustomStringConvertible { + /// Renamed showcase. + public class ShowcaseRenamedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String - /// Comment text. - public let commentText: String? - public init(eventUuid: String, commentText: String? = nil) { + public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid - nullableValidator(stringValidator())(commentText) - self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseEditCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseRenamedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRenamedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRenamedDetails: \(error)" + } } } - open class ShowcaseEditCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseEditCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class ShowcaseRenamedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRenamedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseEditCommentDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseRenamedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return ShowcaseEditCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseRenamedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRenamedDetails.self, json: json) } } } - /// The ShowcaseEditCommentType struct - open class ShowcaseEditCommentType: CustomStringConvertible { + /// The ShowcaseRenamedType struct + public class ShowcaseRenamedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseEditCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseRenamedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRenamedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRenamedType: \(error)" + } } } - open class ShowcaseEditCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseEditCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseRenamedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRenamedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseEditCommentType { + + public func deserialize(_ json: JSON) throws -> ShowcaseRenamedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseEditCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseRenamedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRenamedType.self, json: json) } } } - /// Edited showcase. - open class ShowcaseEditedDetails: CustomStringConvertible { + /// Requested access to showcase. + public class ShowcaseRequestAccessDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseEditedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseRequestAccessDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRequestAccessDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRequestAccessDetails: \(error)" + } } } - open class ShowcaseEditedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseEditedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseRequestAccessDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRequestAccessDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseEditedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseRequestAccessDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseEditedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseRequestAccessDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRequestAccessDetails.self, json: json) } } } - /// The ShowcaseEditedType struct - open class ShowcaseEditedType: CustomStringConvertible { + /// The ShowcaseRequestAccessType struct + public class ShowcaseRequestAccessType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseEditedTypeSerializer().serialize(self)))" - } - } - open class ShowcaseEditedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseEditedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> ShowcaseEditedType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseEditedType(description_: description_) - default: - fatalError("Type error deserializing") - } - } - } - /// Policy for controlling whether Showcase is enabled. - public enum ShowcaseEnabledPolicy: CustomStringConvertible { - /// An unspecified error. - case disabled - /// An unspecified error. - case enabled - /// An unspecified error. - case other + func json() throws -> JSON { + try ShowcaseRequestAccessTypeSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseEnabledPolicySerializer().serialize(self)))" - } - } - open class ShowcaseEnabledPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseEnabledPolicy) -> JSON { - switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShowcaseEnabledPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ShowcaseEnabledPolicy.disabled - case "enabled": - return ShowcaseEnabledPolicy.enabled - case "other": - return ShowcaseEnabledPolicy.other - default: - return ShowcaseEnabledPolicy.other - } - default: - fatalError("Failed to deserialize") + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRequestAccessTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRequestAccessType: \(error)" } } } - /// Policy for controlling if team members can share Showcases externally. - public enum ShowcaseExternalSharingPolicy: CustomStringConvertible { - /// An unspecified error. - case disabled - /// An unspecified error. - case enabled - /// An unspecified error. - case other - - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseExternalSharingPolicySerializer().serialize(self)))" + public class ShowcaseRequestAccessTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRequestAccessType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) } - } - open class ShowcaseExternalSharingPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseExternalSharingPolicy) -> JSON { - switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShowcaseExternalSharingPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ShowcaseExternalSharingPolicy.disabled - case "enabled": - return ShowcaseExternalSharingPolicy.enabled - case "other": - return ShowcaseExternalSharingPolicy.other - default: - return ShowcaseExternalSharingPolicy.other - } - default: - fatalError("Failed to deserialize") + + public func deserialize(_ json: JSON) throws -> ShowcaseRequestAccessType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseRequestAccessType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRequestAccessType.self, json: json) } } } - /// Added file to showcase. - open class ShowcaseFileAddedDetails: CustomStringConvertible { + /// Resolved showcase comment. + public class ShowcaseResolveCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String - public init(eventUuid: String) { + /// Comment text. + public let commentText: String? + public init(eventUuid: String, commentText: String? = nil) { stringValidator()(eventUuid) self.eventUuid = eventUuid + nullableValidator(stringValidator())(commentText) + self.commentText = commentText + } + + func json() throws -> JSON { + try ShowcaseResolveCommentDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileAddedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseResolveCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseResolveCommentDetails: \(error)" + } } } - open class ShowcaseFileAddedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileAddedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseResolveCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseResolveCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileAddedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseResolveCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseFileAddedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return ShowcaseResolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseResolveCommentDetails.self, json: json) } } } - /// The ShowcaseFileAddedType struct - open class ShowcaseFileAddedType: CustomStringConvertible { + /// The ShowcaseResolveCommentType struct + public class ShowcaseResolveCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileAddedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseResolveCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseResolveCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseResolveCommentType: \(error)" + } } } - open class ShowcaseFileAddedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileAddedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseResolveCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseResolveCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileAddedType { + + public func deserialize(_ json: JSON) throws -> ShowcaseResolveCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseFileAddedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseResolveCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseResolveCommentType.self, json: json) } } } - /// Downloaded file from showcase. - open class ShowcaseFileDownloadDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - /// Showcase download type. - public let downloadType: String - public init(eventUuid: String, downloadType: String) { + /// Unarchived showcase. + public class ShowcaseRestoredDetails: CustomStringConvertible, JSONRepresentable { + /// Event unique identifier. + public let eventUuid: String + public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid - stringValidator()(downloadType) - self.downloadType = downloadType } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileDownloadDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseRestoredDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRestoredDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRestoredDetails: \(error)" + } } } - open class ShowcaseFileDownloadDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileDownloadDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "download_type": Serialization._StringSerializer.serialize(value.downloadType), + + public class ShowcaseRestoredDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRestoredDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileDownloadDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseRestoredDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let downloadType = Serialization._StringSerializer.deserialize(dict["download_type"] ?? .null) - return ShowcaseFileDownloadDetails(eventUuid: eventUuid, downloadType: downloadType) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseRestoredDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRestoredDetails.self, json: json) } } } - /// The ShowcaseFileDownloadType struct - open class ShowcaseFileDownloadType: CustomStringConvertible { + /// The ShowcaseRestoredType struct + public class ShowcaseRestoredType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileDownloadTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseRestoredTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseRestoredTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseRestoredType: \(error)" + } } } - open class ShowcaseFileDownloadTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileDownloadType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseRestoredTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseRestoredType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileDownloadType { + + public func deserialize(_ json: JSON) throws -> ShowcaseRestoredType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseFileDownloadType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseRestoredType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseRestoredType.self, json: json) } } } - /// Removed file from showcase. - open class ShowcaseFileRemovedDetails: CustomStringConvertible { + /// Deleted showcase (old version). + public class ShowcaseTrashedDeprecatedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileRemovedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseTrashedDeprecatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseTrashedDeprecatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseTrashedDeprecatedDetails: \(error)" + } } } - open class ShowcaseFileRemovedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileRemovedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseTrashedDeprecatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseTrashedDeprecatedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileRemovedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseTrashedDeprecatedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseFileRemovedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseTrashedDeprecatedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseTrashedDeprecatedDetails.self, json: json) } } } - /// The ShowcaseFileRemovedType struct - open class ShowcaseFileRemovedType: CustomStringConvertible { + /// The ShowcaseTrashedDeprecatedType struct + public class ShowcaseTrashedDeprecatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileRemovedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseTrashedDeprecatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseTrashedDeprecatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseTrashedDeprecatedType: \(error)" + } } } - open class ShowcaseFileRemovedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileRemovedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseTrashedDeprecatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseTrashedDeprecatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileRemovedType { + + public func deserialize(_ json: JSON) throws -> ShowcaseTrashedDeprecatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseFileRemovedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseTrashedDeprecatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseTrashedDeprecatedType.self, json: json) } } } - /// Viewed file in showcase. - open class ShowcaseFileViewDetails: CustomStringConvertible { + /// Deleted showcase. + public class ShowcaseTrashedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileViewDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseTrashedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseTrashedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseTrashedDetails: \(error)" + } } } - open class ShowcaseFileViewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileViewDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseTrashedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseTrashedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileViewDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseTrashedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseFileViewDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseTrashedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseTrashedDetails.self, json: json) } } } - /// The ShowcaseFileViewType struct - open class ShowcaseFileViewType: CustomStringConvertible { + /// The ShowcaseTrashedType struct + public class ShowcaseTrashedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseFileViewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseTrashedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseTrashedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseTrashedType: \(error)" + } } } - open class ShowcaseFileViewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseFileViewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseTrashedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseTrashedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseFileViewType { + + public func deserialize(_ json: JSON) throws -> ShowcaseTrashedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseFileViewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseTrashedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseTrashedType.self, json: json) } } } - /// Permanently deleted showcase. - open class ShowcasePermanentlyDeletedDetails: CustomStringConvertible { + /// Unresolved showcase comment. + public class ShowcaseUnresolveCommentDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String - public init(eventUuid: String) { + /// Comment text. + public let commentText: String? + public init(eventUuid: String, commentText: String? = nil) { stringValidator()(eventUuid) self.eventUuid = eventUuid + nullableValidator(stringValidator())(commentText) + self.commentText = commentText + } + + func json() throws -> JSON { + try ShowcaseUnresolveCommentDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcasePermanentlyDeletedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseUnresolveCommentDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseUnresolveCommentDetails: \(error)" + } } } - open class ShowcasePermanentlyDeletedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcasePermanentlyDeletedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseUnresolveCommentDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseUnresolveCommentDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), + "comment_text": try NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcasePermanentlyDeletedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseUnresolveCommentDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcasePermanentlyDeletedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + let commentText = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) + return ShowcaseUnresolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseUnresolveCommentDetails.self, json: json) } } } - /// The ShowcasePermanentlyDeletedType struct - open class ShowcasePermanentlyDeletedType: CustomStringConvertible { + /// The ShowcaseUnresolveCommentType struct + public class ShowcaseUnresolveCommentType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcasePermanentlyDeletedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseUnresolveCommentTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseUnresolveCommentTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseUnresolveCommentType: \(error)" + } } } - open class ShowcasePermanentlyDeletedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcasePermanentlyDeletedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseUnresolveCommentTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseUnresolveCommentType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcasePermanentlyDeletedType { + + public func deserialize(_ json: JSON) throws -> ShowcaseUnresolveCommentType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcasePermanentlyDeletedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseUnresolveCommentType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseUnresolveCommentType.self, json: json) } } } - /// Added showcase comment. - open class ShowcasePostCommentDetails: CustomStringConvertible { + /// Restored showcase (old version). + public class ShowcaseUntrashedDeprecatedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String - /// Comment text. - public let commentText: String? - public init(eventUuid: String, commentText: String? = nil) { + public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid - nullableValidator(stringValidator())(commentText) - self.commentText = commentText } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcasePostCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseUntrashedDeprecatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseUntrashedDeprecatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseUntrashedDeprecatedDetails: \(error)" + } } } - open class ShowcasePostCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcasePostCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class ShowcaseUntrashedDeprecatedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseUntrashedDeprecatedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcasePostCommentDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseUntrashedDeprecatedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return ShowcasePostCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseUntrashedDeprecatedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseUntrashedDeprecatedDetails.self, json: json) } } } - /// The ShowcasePostCommentType struct - open class ShowcasePostCommentType: CustomStringConvertible { + /// The ShowcaseUntrashedDeprecatedType struct + public class ShowcaseUntrashedDeprecatedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcasePostCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseUntrashedDeprecatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseUntrashedDeprecatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseUntrashedDeprecatedType: \(error)" + } } } - open class ShowcasePostCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcasePostCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseUntrashedDeprecatedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseUntrashedDeprecatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcasePostCommentType { + + public func deserialize(_ json: JSON) throws -> ShowcaseUntrashedDeprecatedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcasePostCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseUntrashedDeprecatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseUntrashedDeprecatedType.self, json: json) } } } - /// Removed member from showcase. - open class ShowcaseRemoveMemberDetails: CustomStringConvertible { + /// Restored showcase. + public class ShowcaseUntrashedDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRemoveMemberDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseUntrashedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseUntrashedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseUntrashedDetails: \(error)" + } } } - open class ShowcaseRemoveMemberDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRemoveMemberDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseUntrashedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseUntrashedDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRemoveMemberDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseUntrashedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseRemoveMemberDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseUntrashedDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseUntrashedDetails.self, json: json) } } } - /// The ShowcaseRemoveMemberType struct - open class ShowcaseRemoveMemberType: CustomStringConvertible { + /// The ShowcaseUntrashedType struct + public class ShowcaseUntrashedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRemoveMemberTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseUntrashedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseUntrashedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseUntrashedType: \(error)" + } } } - open class ShowcaseRemoveMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRemoveMemberType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseUntrashedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseUntrashedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRemoveMemberType { + + public func deserialize(_ json: JSON) throws -> ShowcaseUntrashedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseRemoveMemberType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseUntrashedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseUntrashedType.self, json: json) } } } - /// Renamed showcase. - open class ShowcaseRenamedDetails: CustomStringConvertible { + /// Viewed showcase. + public class ShowcaseViewDetails: CustomStringConvertible, JSONRepresentable { /// Event unique identifier. public let eventUuid: String public init(eventUuid: String) { stringValidator()(eventUuid) self.eventUuid = eventUuid } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRenamedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseViewDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseViewDetails: \(error)" + } } } - open class ShowcaseRenamedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRenamedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class ShowcaseViewDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseViewDetails) throws -> JSON { + let output = [ + "event_uuid": try Serialization._StringSerializer.serialize(value.eventUuid), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRenamedDetails { + + public func deserialize(_ json: JSON) throws -> ShowcaseViewDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseRenamedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let eventUuid = try Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) + return ShowcaseViewDetails(eventUuid: eventUuid) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseViewDetails.self, json: json) } } } - /// The ShowcaseRenamedType struct - open class ShowcaseRenamedType: CustomStringConvertible { + /// The ShowcaseViewType struct + public class ShowcaseViewType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRenamedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ShowcaseViewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseViewType: \(error)" + } } } - open class ShowcaseRenamedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRenamedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ShowcaseViewTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRenamedType { + + public func deserialize(_ json: JSON) throws -> ShowcaseViewType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseRenamedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ShowcaseViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ShowcaseViewType.self, json: json) } } } - /// Requested access to showcase. - open class ShowcaseRequestAccessDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - public init(eventUuid: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid + /// Ended admin sign-in-as session. + public class SignInAsSessionEndDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SignInAsSessionEndDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRequestAccessDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SignInAsSessionEndDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SignInAsSessionEndDetails: \(error)" + } } } - open class ShowcaseRequestAccessDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRequestAccessDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - ] + + public class SignInAsSessionEndDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SignInAsSessionEndDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRequestAccessDetails { + + public func deserialize(_ json: JSON) throws -> SignInAsSessionEndDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseRequestAccessDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary: + return SignInAsSessionEndDetails() + default: + throw JSONSerializerError.deserializeError(type: SignInAsSessionEndDetails.self, json: json) } } } - /// The ShowcaseRequestAccessType struct - open class ShowcaseRequestAccessType: CustomStringConvertible { + /// The SignInAsSessionEndType struct + public class SignInAsSessionEndType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRequestAccessTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SignInAsSessionEndTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SignInAsSessionEndTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SignInAsSessionEndType: \(error)" + } } } - open class ShowcaseRequestAccessTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRequestAccessType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SignInAsSessionEndTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SignInAsSessionEndType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRequestAccessType { + + public func deserialize(_ json: JSON) throws -> SignInAsSessionEndType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseRequestAccessType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SignInAsSessionEndType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SignInAsSessionEndType.self, json: json) } } } - /// Resolved showcase comment. - open class ShowcaseResolveCommentDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - /// Comment text. - public let commentText: String? - public init(eventUuid: String, commentText: String? = nil) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid - nullableValidator(stringValidator())(commentText) - self.commentText = commentText + /// Started admin sign-in-as session. + public class SignInAsSessionStartDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SignInAsSessionStartDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseResolveCommentDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SignInAsSessionStartDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SignInAsSessionStartDetails: \(error)" + } } } - open class ShowcaseResolveCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseResolveCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), - ] + + public class SignInAsSessionStartDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SignInAsSessionStartDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseResolveCommentDetails { + + public func deserialize(_ json: JSON) throws -> SignInAsSessionStartDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return ShowcaseResolveCommentDetails(eventUuid: eventUuid, commentText: commentText) - default: - fatalError("Type error deserializing") + case .dictionary: + return SignInAsSessionStartDetails() + default: + throw JSONSerializerError.deserializeError(type: SignInAsSessionStartDetails.self, json: json) } } } - /// The ShowcaseResolveCommentType struct - open class ShowcaseResolveCommentType: CustomStringConvertible { + /// The SignInAsSessionStartType struct + public class SignInAsSessionStartType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseResolveCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SignInAsSessionStartTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SignInAsSessionStartTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SignInAsSessionStartType: \(error)" + } } } - open class ShowcaseResolveCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseResolveCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SignInAsSessionStartTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SignInAsSessionStartType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseResolveCommentType { + + public func deserialize(_ json: JSON) throws -> SignInAsSessionStartType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseResolveCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SignInAsSessionStartType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SignInAsSessionStartType.self, json: json) } } } - /// Unarchived showcase. - open class ShowcaseRestoredDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - public init(eventUuid: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid + /// Changed default Smart Sync setting for team members. + public class SmartSyncChangePolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New smart sync policy. + public let newValue: TeamPolicies.SmartSyncPolicy? + /// Previous smart sync policy. + public let previousValue: TeamPolicies.SmartSyncPolicy? + public init(newValue: TeamPolicies.SmartSyncPolicy? = nil, previousValue: TeamPolicies.SmartSyncPolicy? = nil) { + self.newValue = newValue + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SmartSyncChangePolicyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRestoredDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncChangePolicyDetails: \(error)" + } } } - open class ShowcaseRestoredDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRestoredDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class SmartSyncChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRestoredDetails { + + public func deserialize(_ json: JSON) throws -> SmartSyncChangePolicyDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseRestoredDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SmartSyncChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SmartSyncChangePolicyDetails.self, json: json) } } } - /// The ShowcaseRestoredType struct - open class ShowcaseRestoredType: CustomStringConvertible { + /// The SmartSyncChangePolicyType struct + public class SmartSyncChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseRestoredTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SmartSyncChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncChangePolicyType: \(error)" + } } } - open class ShowcaseRestoredTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseRestoredType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SmartSyncChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseRestoredType { + + public func deserialize(_ json: JSON) throws -> SmartSyncChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseRestoredType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SmartSyncChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SmartSyncChangePolicyType.self, json: json) } } } - /// Deleted showcase (old version). - open class ShowcaseTrashedDeprecatedDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - public init(eventUuid: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid + /// Created Smart Sync non-admin devices report. + public class SmartSyncCreateAdminPrivilegeReportDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SmartSyncCreateAdminPrivilegeReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseTrashedDeprecatedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncCreateAdminPrivilegeReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncCreateAdminPrivilegeReportDetails: \(error)" + } } } - open class ShowcaseTrashedDeprecatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseTrashedDeprecatedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - ] + + public class SmartSyncCreateAdminPrivilegeReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncCreateAdminPrivilegeReportDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseTrashedDeprecatedDetails { + + public func deserialize(_ json: JSON) throws -> SmartSyncCreateAdminPrivilegeReportDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseTrashedDeprecatedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary: + return SmartSyncCreateAdminPrivilegeReportDetails() + default: + throw JSONSerializerError.deserializeError(type: SmartSyncCreateAdminPrivilegeReportDetails.self, json: json) } } } - /// The ShowcaseTrashedDeprecatedType struct - open class ShowcaseTrashedDeprecatedType: CustomStringConvertible { + /// The SmartSyncCreateAdminPrivilegeReportType struct + public class SmartSyncCreateAdminPrivilegeReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseTrashedDeprecatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SmartSyncCreateAdminPrivilegeReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncCreateAdminPrivilegeReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncCreateAdminPrivilegeReportType: \(error)" + } } } - open class ShowcaseTrashedDeprecatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseTrashedDeprecatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SmartSyncCreateAdminPrivilegeReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncCreateAdminPrivilegeReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseTrashedDeprecatedType { + + public func deserialize(_ json: JSON) throws -> SmartSyncCreateAdminPrivilegeReportType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseTrashedDeprecatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SmartSyncCreateAdminPrivilegeReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SmartSyncCreateAdminPrivilegeReportType.self, json: json) } } } - /// Deleted showcase. - open class ShowcaseTrashedDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - public init(eventUuid: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid + /// Opted team into Smart Sync. + public class SmartSyncNotOptOutDetails: CustomStringConvertible, JSONRepresentable { + /// Previous Smart Sync opt out policy. + public let previousValue: TeamLog.SmartSyncOptOutPolicy + /// New Smart Sync opt out policy. + public let newValue: TeamLog.SmartSyncOptOutPolicy + public init(previousValue: TeamLog.SmartSyncOptOutPolicy, newValue: TeamLog.SmartSyncOptOutPolicy) { + self.previousValue = previousValue + self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseTrashedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SmartSyncNotOptOutDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncNotOptOutDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncNotOptOutDetails: \(error)" + } } } - open class ShowcaseTrashedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseTrashedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class SmartSyncNotOptOutDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncNotOptOutDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.previousValue), + "new_value": try TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseTrashedDetails { + + public func deserialize(_ json: JSON) throws -> SmartSyncNotOptOutDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseTrashedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["new_value"] ?? .null) + return SmartSyncNotOptOutDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SmartSyncNotOptOutDetails.self, json: json) } } } - /// The ShowcaseTrashedType struct - open class ShowcaseTrashedType: CustomStringConvertible { + /// The SmartSyncNotOptOutType struct + public class SmartSyncNotOptOutType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseTrashedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SmartSyncNotOptOutTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncNotOptOutTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncNotOptOutType: \(error)" + } } } - open class ShowcaseTrashedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseTrashedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SmartSyncNotOptOutTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncNotOptOutType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseTrashedType { + + public func deserialize(_ json: JSON) throws -> SmartSyncNotOptOutType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseTrashedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SmartSyncNotOptOutType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SmartSyncNotOptOutType.self, json: json) } } } - /// Unresolved showcase comment. - open class ShowcaseUnresolveCommentDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - /// Comment text. - public let commentText: String? - public init(eventUuid: String, commentText: String? = nil) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid - nullableValidator(stringValidator())(commentText) - self.commentText = commentText + /// Opted team out of Smart Sync. + public class SmartSyncOptOutDetails: CustomStringConvertible, JSONRepresentable { + /// Previous Smart Sync opt out policy. + public let previousValue: TeamLog.SmartSyncOptOutPolicy + /// New Smart Sync opt out policy. + public let newValue: TeamLog.SmartSyncOptOutPolicy + public init(previousValue: TeamLog.SmartSyncOptOutPolicy, newValue: TeamLog.SmartSyncOptOutPolicy) { + self.previousValue = previousValue + self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseUnresolveCommentDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SmartSyncOptOutDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncOptOutDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncOptOutDetails: \(error)" + } } } - open class ShowcaseUnresolveCommentDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseUnresolveCommentDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - "comment_text": NullableSerializer(Serialization._StringSerializer).serialize(value.commentText), + + public class SmartSyncOptOutDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncOptOutDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.previousValue), + "new_value": try TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseUnresolveCommentDetails { + + public func deserialize(_ json: JSON) throws -> SmartSyncOptOutDetails { + switch json { + case .dictionary(let dict): + let previousValue = try TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["new_value"] ?? .null) + return SmartSyncOptOutDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SmartSyncOptOutDetails.self, json: json) + } + } + } + + /// The SmartSyncOptOutPolicy union + public enum SmartSyncOptOutPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case default_ + /// An unspecified error. + case optedOut + /// An unspecified error. + case other + + func json() throws -> JSON { + try SmartSyncOptOutPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncOptOutPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncOptOutPolicy: \(error)" + } + } + } + + public class SmartSyncOptOutPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncOptOutPolicy) throws -> JSON { + switch value { + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .optedOut: + var d = [String: JSON]() + d[".tag"] = .str("opted_out") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SmartSyncOptOutPolicy { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - let commentText = NullableSerializer(Serialization._StringSerializer).deserialize(dict["comment_text"] ?? .null) - return ShowcaseUnresolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default": + return SmartSyncOptOutPolicy.default_ + case "opted_out": + return SmartSyncOptOutPolicy.optedOut + case "other": + return SmartSyncOptOutPolicy.other default: - fatalError("Type error deserializing") + return SmartSyncOptOutPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SmartSyncOptOutPolicy.self, json: json) } } } - /// The ShowcaseUnresolveCommentType struct - open class ShowcaseUnresolveCommentType: CustomStringConvertible { + /// The SmartSyncOptOutType struct + public class SmartSyncOptOutType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseUnresolveCommentTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SmartSyncOptOutTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncOptOutTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncOptOutType: \(error)" + } } } - open class ShowcaseUnresolveCommentTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseUnresolveCommentType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SmartSyncOptOutTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncOptOutType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseUnresolveCommentType { + + public func deserialize(_ json: JSON) throws -> SmartSyncOptOutType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseUnresolveCommentType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SmartSyncOptOutType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SmartSyncOptOutType.self, json: json) } } } - /// Restored showcase (old version). - open class ShowcaseUntrashedDeprecatedDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - public init(eventUuid: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid + /// Changed automatic Smart Sync setting for team. + public class SmarterSmartSyncPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { + /// Previous automatic Smart Sync setting. + public let previousValue: TeamPolicies.SmarterSmartSyncPolicyState + /// New automatic Smart Sync setting. + public let newValue: TeamPolicies.SmarterSmartSyncPolicyState + public init(previousValue: TeamPolicies.SmarterSmartSyncPolicyState, newValue: TeamPolicies.SmarterSmartSyncPolicyState) { + self.previousValue = previousValue + self.newValue = newValue + } + + func json() throws -> JSON { + try SmarterSmartSyncPolicyChangedDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseUntrashedDeprecatedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmarterSmartSyncPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmarterSmartSyncPolicyChangedDetails: \(error)" + } } } - open class ShowcaseUntrashedDeprecatedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseUntrashedDeprecatedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class SmarterSmartSyncPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmarterSmartSyncPolicyChangedDetails) throws -> JSON { + let output = [ + "previous_value": try TeamPolicies.SmarterSmartSyncPolicyStateSerializer().serialize(value.previousValue), + "new_value": try TeamPolicies.SmarterSmartSyncPolicyStateSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseUntrashedDeprecatedDetails { + + public func deserialize(_ json: JSON) throws -> SmarterSmartSyncPolicyChangedDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseUntrashedDeprecatedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamPolicies.SmarterSmartSyncPolicyStateSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamPolicies.SmarterSmartSyncPolicyStateSerializer().deserialize(dict["new_value"] ?? .null) + return SmarterSmartSyncPolicyChangedDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SmarterSmartSyncPolicyChangedDetails.self, json: json) } } } - /// The ShowcaseUntrashedDeprecatedType struct - open class ShowcaseUntrashedDeprecatedType: CustomStringConvertible { + /// The SmarterSmartSyncPolicyChangedType struct + public class SmarterSmartSyncPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseUntrashedDeprecatedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SmarterSmartSyncPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmarterSmartSyncPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmarterSmartSyncPolicyChangedType: \(error)" + } } } - open class ShowcaseUntrashedDeprecatedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseUntrashedDeprecatedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SmarterSmartSyncPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmarterSmartSyncPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseUntrashedDeprecatedType { + + public func deserialize(_ json: JSON) throws -> SmarterSmartSyncPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseUntrashedDeprecatedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SmarterSmartSyncPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SmarterSmartSyncPolicyChangedType.self, json: json) } } } - /// Restored showcase. - open class ShowcaseUntrashedDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - public init(eventUuid: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid + /// Space limit alert policy + public enum SpaceCapsType: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case hard + /// An unspecified error. + case off + /// An unspecified error. + case soft + /// An unspecified error. + case other + + func json() throws -> JSON { + try SpaceCapsTypeSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseUntrashedDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SpaceCapsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SpaceCapsType: \(error)" + } } } - open class ShowcaseUntrashedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseUntrashedDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> ShowcaseUntrashedDetails { - switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseUntrashedDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + + public class SpaceCapsTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SpaceCapsType) throws -> JSON { + switch value { + case .hard: + var d = [String: JSON]() + d[".tag"] = .str("hard") + return .dictionary(d) + case .off: + var d = [String: JSON]() + d[".tag"] = .str("off") + return .dictionary(d) + case .soft: + var d = [String: JSON]() + d[".tag"] = .str("soft") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SpaceCapsType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "hard": + return SpaceCapsType.hard + case "off": + return SpaceCapsType.off + case "soft": + return SpaceCapsType.soft + case "other": + return SpaceCapsType.other + default: + return SpaceCapsType.other + } + default: + throw JSONSerializerError.deserializeError(type: SpaceCapsType.self, json: json) } } } - /// The ShowcaseUntrashedType struct - open class ShowcaseUntrashedType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ + /// The SpaceLimitsStatus union + public enum SpaceLimitsStatus: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case nearQuota + /// An unspecified error. + case overQuota + /// An unspecified error. + case withinQuota + /// An unspecified error. + case other + + func json() throws -> JSON { + try SpaceLimitsStatusSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseUntrashedTypeSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SpaceLimitsStatusSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SpaceLimitsStatus: \(error)" + } } } - open class ShowcaseUntrashedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseUntrashedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> ShowcaseUntrashedType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseUntrashedType(description_: description_) - default: - fatalError("Type error deserializing") + + public class SpaceLimitsStatusSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SpaceLimitsStatus) throws -> JSON { + switch value { + case .nearQuota: + var d = [String: JSON]() + d[".tag"] = .str("near_quota") + return .dictionary(d) + case .overQuota: + var d = [String: JSON]() + d[".tag"] = .str("over_quota") + return .dictionary(d) + case .withinQuota: + var d = [String: JSON]() + d[".tag"] = .str("within_quota") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SpaceLimitsStatus { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "near_quota": + return SpaceLimitsStatus.nearQuota + case "over_quota": + return SpaceLimitsStatus.overQuota + case "within_quota": + return SpaceLimitsStatus.withinQuota + case "other": + return SpaceLimitsStatus.other + default: + return SpaceLimitsStatus.other + } + default: + throw JSONSerializerError.deserializeError(type: SpaceLimitsStatus.self, json: json) } } } - /// Viewed showcase. - open class ShowcaseViewDetails: CustomStringConvertible { - /// Event unique identifier. - public let eventUuid: String - public init(eventUuid: String) { - stringValidator()(eventUuid) - self.eventUuid = eventUuid + /// Added X.509 certificate for SSO. + public class SsoAddCertDetails: CustomStringConvertible, JSONRepresentable { + /// SSO certificate details. + public let certificateDetails: TeamLog.Certificate + public init(certificateDetails: TeamLog.Certificate) { + self.certificateDetails = certificateDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseViewDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoAddCertDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoAddCertDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoAddCertDetails: \(error)" + } } } - open class ShowcaseViewDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseViewDetails) -> JSON { - let output = [ - "event_uuid": Serialization._StringSerializer.serialize(value.eventUuid), + + public class SsoAddCertDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoAddCertDetails) throws -> JSON { + let output = [ + "certificate_details": try TeamLog.CertificateSerializer().serialize(value.certificateDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseViewDetails { + + public func deserialize(_ json: JSON) throws -> SsoAddCertDetails { switch json { - case .dictionary(let dict): - let eventUuid = Serialization._StringSerializer.deserialize(dict["event_uuid"] ?? .null) - return ShowcaseViewDetails(eventUuid: eventUuid) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let certificateDetails = try TeamLog.CertificateSerializer().deserialize(dict["certificate_details"] ?? .null) + return SsoAddCertDetails(certificateDetails: certificateDetails) + default: + throw JSONSerializerError.deserializeError(type: SsoAddCertDetails.self, json: json) } } } - /// The ShowcaseViewType struct - open class ShowcaseViewType: CustomStringConvertible { + /// The SsoAddCertType struct + public class SsoAddCertType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseViewTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoAddCertTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoAddCertTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoAddCertType: \(error)" + } } } - open class ShowcaseViewTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseViewType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoAddCertTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoAddCertType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ShowcaseViewType { + + public func deserialize(_ json: JSON) throws -> SsoAddCertType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ShowcaseViewType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoAddCertType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoAddCertType.self, json: json) } } } - /// Ended admin sign-in-as session. - open class SignInAsSessionEndDetails: CustomStringConvertible { - public init() { + /// Added sign-in URL for SSO. + public class SsoAddLoginUrlDetails: CustomStringConvertible, JSONRepresentable { + /// New single sign-on login URL. + public let newValue: String + public init(newValue: String) { + stringValidator()(newValue) + self.newValue = newValue + } + + func json() throws -> JSON { + try SsoAddLoginUrlDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SignInAsSessionEndDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoAddLoginUrlDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoAddLoginUrlDetails: \(error)" + } } } - open class SignInAsSessionEndDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SignInAsSessionEndDetails) -> JSON { - let output = [String: JSON]() + + public class SsoAddLoginUrlDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoAddLoginUrlDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SignInAsSessionEndDetails { + + public func deserialize(_ json: JSON) throws -> SsoAddLoginUrlDetails { switch json { - case .dictionary(_): - return SignInAsSessionEndDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return SsoAddLoginUrlDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SsoAddLoginUrlDetails.self, json: json) } } } - /// The SignInAsSessionEndType struct - open class SignInAsSessionEndType: CustomStringConvertible { + /// The SsoAddLoginUrlType struct + public class SsoAddLoginUrlType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SignInAsSessionEndTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoAddLoginUrlTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoAddLoginUrlTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoAddLoginUrlType: \(error)" + } } } - open class SignInAsSessionEndTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SignInAsSessionEndType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoAddLoginUrlTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoAddLoginUrlType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SignInAsSessionEndType { + + public func deserialize(_ json: JSON) throws -> SsoAddLoginUrlType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SignInAsSessionEndType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoAddLoginUrlType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoAddLoginUrlType.self, json: json) + } + } + } + + /// Added sign-out URL for SSO. + public class SsoAddLogoutUrlDetails: CustomStringConvertible, JSONRepresentable { + /// New single sign-on logout URL. + public let newValue: String? + public init(newValue: String? = nil) { + nullableValidator(stringValidator())(newValue) + self.newValue = newValue + } + + func json() throws -> JSON { + try SsoAddLogoutUrlDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoAddLogoutUrlDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoAddLogoutUrlDetails: \(error)" } } } - /// Started admin sign-in-as session. - open class SignInAsSessionStartDetails: CustomStringConvertible { - public init() { - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SignInAsSessionStartDetailsSerializer().serialize(self)))" - } - } - open class SignInAsSessionStartDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SignInAsSessionStartDetails) -> JSON { - let output = [String: JSON]() + public class SsoAddLogoutUrlDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoAddLogoutUrlDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(Serialization._StringSerializer).serialize(value.newValue), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SignInAsSessionStartDetails { + + public func deserialize(_ json: JSON) throws -> SsoAddLogoutUrlDetails { switch json { - case .dictionary(_): - return SignInAsSessionStartDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_value"] ?? .null) + return SsoAddLogoutUrlDetails(newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SsoAddLogoutUrlDetails.self, json: json) } } } - /// The SignInAsSessionStartType struct - open class SignInAsSessionStartType: CustomStringConvertible { + /// The SsoAddLogoutUrlType struct + public class SsoAddLogoutUrlType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SignInAsSessionStartTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoAddLogoutUrlTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoAddLogoutUrlTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoAddLogoutUrlType: \(error)" + } } } - open class SignInAsSessionStartTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SignInAsSessionStartType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoAddLogoutUrlTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoAddLogoutUrlType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SignInAsSessionStartType { + + public func deserialize(_ json: JSON) throws -> SsoAddLogoutUrlType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SignInAsSessionStartType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoAddLogoutUrlType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoAddLogoutUrlType.self, json: json) } } } - /// Changed default Smart Sync setting for team members. - open class SmartSyncChangePolicyDetails: CustomStringConvertible { - /// New smart sync policy. - public let newValue: TeamPolicies.SmartSyncPolicy? - /// Previous smart sync policy. - public let previousValue: TeamPolicies.SmartSyncPolicy? - public init(newValue: TeamPolicies.SmartSyncPolicy? = nil, previousValue: TeamPolicies.SmartSyncPolicy? = nil) { - self.newValue = newValue - self.previousValue = previousValue + /// Changed X.509 certificate for SSO. + public class SsoChangeCertDetails: CustomStringConvertible, JSONRepresentable { + /// Previous SSO certificate details. Might be missing due to historical data gap. + public let previousCertificateDetails: TeamLog.Certificate? + /// New SSO certificate details. + public let newCertificateDetails: TeamLog.Certificate + public init(newCertificateDetails: TeamLog.Certificate, previousCertificateDetails: TeamLog.Certificate? = nil) { + self.previousCertificateDetails = previousCertificateDetails + self.newCertificateDetails = newCertificateDetails + } + + func json() throws -> JSON { + try SsoChangeCertDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncChangePolicyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeCertDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeCertDetails: \(error)" + } } } - open class SmartSyncChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncChangePolicyDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).serialize(value.previousValue), + + public class SsoChangeCertDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeCertDetails) throws -> JSON { + let output = [ + "new_certificate_details": try TeamLog.CertificateSerializer().serialize(value.newCertificateDetails), + "previous_certificate_details": try NullableSerializer(TeamLog.CertificateSerializer()).serialize(value.previousCertificateDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmartSyncChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> SsoChangeCertDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.SmartSyncPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SmartSyncChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newCertificateDetails = try TeamLog.CertificateSerializer().deserialize(dict["new_certificate_details"] ?? .null) + let previousCertificateDetails = try NullableSerializer(TeamLog.CertificateSerializer()) + .deserialize(dict["previous_certificate_details"] ?? .null) + return SsoChangeCertDetails(newCertificateDetails: newCertificateDetails, previousCertificateDetails: previousCertificateDetails) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeCertDetails.self, json: json) } } } - /// The SmartSyncChangePolicyType struct - open class SmartSyncChangePolicyType: CustomStringConvertible { + /// The SsoChangeCertType struct + public class SsoChangeCertType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoChangeCertTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeCertTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeCertType: \(error)" + } } } - open class SmartSyncChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoChangeCertTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeCertType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmartSyncChangePolicyType { + + public func deserialize(_ json: JSON) throws -> SsoChangeCertType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SmartSyncChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoChangeCertType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeCertType.self, json: json) } } } - /// Created Smart Sync non-admin devices report. - open class SmartSyncCreateAdminPrivilegeReportDetails: CustomStringConvertible { - public init() { + /// Changed sign-in URL for SSO. + public class SsoChangeLoginUrlDetails: CustomStringConvertible, JSONRepresentable { + /// Previous single sign-on login URL. + public let previousValue: String + /// New single sign-on login URL. + public let newValue: String + public init(previousValue: String, newValue: String) { + stringValidator()(previousValue) + self.previousValue = previousValue + stringValidator()(newValue) + self.newValue = newValue + } + + func json() throws -> JSON { + try SsoChangeLoginUrlDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncCreateAdminPrivilegeReportDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeLoginUrlDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeLoginUrlDetails: \(error)" + } } } - open class SmartSyncCreateAdminPrivilegeReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncCreateAdminPrivilegeReportDetails) -> JSON { - let output = [String: JSON]() + + public class SsoChangeLoginUrlDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeLoginUrlDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmartSyncCreateAdminPrivilegeReportDetails { + + public func deserialize(_ json: JSON) throws -> SsoChangeLoginUrlDetails { switch json { - case .dictionary(_): - return SmartSyncCreateAdminPrivilegeReportDetails() - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return SsoChangeLoginUrlDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeLoginUrlDetails.self, json: json) } } } - /// The SmartSyncCreateAdminPrivilegeReportType struct - open class SmartSyncCreateAdminPrivilegeReportType: CustomStringConvertible { + /// The SsoChangeLoginUrlType struct + public class SsoChangeLoginUrlType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncCreateAdminPrivilegeReportTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoChangeLoginUrlTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeLoginUrlTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeLoginUrlType: \(error)" + } } } - open class SmartSyncCreateAdminPrivilegeReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncCreateAdminPrivilegeReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoChangeLoginUrlTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeLoginUrlType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmartSyncCreateAdminPrivilegeReportType { + + public func deserialize(_ json: JSON) throws -> SsoChangeLoginUrlType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SmartSyncCreateAdminPrivilegeReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoChangeLoginUrlType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeLoginUrlType.self, json: json) } } } - /// Opted team into Smart Sync. - open class SmartSyncNotOptOutDetails: CustomStringConvertible { - /// Previous Smart Sync opt out policy. - public let previousValue: TeamLog.SmartSyncOptOutPolicy - /// New Smart Sync opt out policy. - public let newValue: TeamLog.SmartSyncOptOutPolicy - public init(previousValue: TeamLog.SmartSyncOptOutPolicy, newValue: TeamLog.SmartSyncOptOutPolicy) { + /// Changed sign-out URL for SSO. + public class SsoChangeLogoutUrlDetails: CustomStringConvertible, JSONRepresentable { + /// Previous single sign-on logout URL. Might be missing due to historical data gap. + public let previousValue: String? + /// New single sign-on logout URL. + public let newValue: String? + public init(previousValue: String? = nil, newValue: String? = nil) { + nullableValidator(stringValidator())(previousValue) self.previousValue = previousValue + nullableValidator(stringValidator())(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncNotOptOutDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoChangeLogoutUrlDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeLogoutUrlDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeLogoutUrlDetails: \(error)" + } } } - open class SmartSyncNotOptOutDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncNotOptOutDetails) -> JSON { - let output = [ - "previous_value": TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.previousValue), - "new_value": TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.newValue), + + public class SsoChangeLogoutUrlDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeLogoutUrlDetails) throws -> JSON { + let output = [ + "previous_value": try NullableSerializer(Serialization._StringSerializer).serialize(value.previousValue), + "new_value": try NullableSerializer(Serialization._StringSerializer).serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmartSyncNotOptOutDetails { + + public func deserialize(_ json: JSON) throws -> SsoChangeLogoutUrlDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["new_value"] ?? .null) - return SmartSyncNotOptOutDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_value"] ?? .null) + let newValue = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_value"] ?? .null) + return SsoChangeLogoutUrlDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeLogoutUrlDetails.self, json: json) } } } - /// The SmartSyncNotOptOutType struct - open class SmartSyncNotOptOutType: CustomStringConvertible { + /// The SsoChangeLogoutUrlType struct + public class SsoChangeLogoutUrlType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncNotOptOutTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoChangeLogoutUrlTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeLogoutUrlTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeLogoutUrlType: \(error)" + } } } - open class SmartSyncNotOptOutTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncNotOptOutType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoChangeLogoutUrlTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeLogoutUrlType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmartSyncNotOptOutType { + + public func deserialize(_ json: JSON) throws -> SsoChangeLogoutUrlType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SmartSyncNotOptOutType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoChangeLogoutUrlType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeLogoutUrlType.self, json: json) } } } - /// Opted team out of Smart Sync. - open class SmartSyncOptOutDetails: CustomStringConvertible { - /// Previous Smart Sync opt out policy. - public let previousValue: TeamLog.SmartSyncOptOutPolicy - /// New Smart Sync opt out policy. - public let newValue: TeamLog.SmartSyncOptOutPolicy - public init(previousValue: TeamLog.SmartSyncOptOutPolicy, newValue: TeamLog.SmartSyncOptOutPolicy) { - self.previousValue = previousValue + /// Changed single sign-on setting for team. + public class SsoChangePolicyDetails: CustomStringConvertible, JSONRepresentable { + /// New single sign-on policy. + public let newValue: TeamPolicies.SsoPolicy + /// Previous single sign-on policy. Might be missing due to historical data gap. + public let previousValue: TeamPolicies.SsoPolicy? + public init(newValue: TeamPolicies.SsoPolicy, previousValue: TeamPolicies.SsoPolicy? = nil) { self.newValue = newValue + self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncOptOutDetailsSerializer().serialize(self)))" - } - } - open class SmartSyncOptOutDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncOptOutDetails) -> JSON { - let output = [ - "previous_value": TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.previousValue), - "new_value": TeamLog.SmartSyncOptOutPolicySerializer().serialize(value.newValue), - ] - return .dictionary(output) + + func json() throws -> JSON { + try SsoChangePolicyDetailsSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> SmartSyncOptOutDetails { - switch json { - case .dictionary(let dict): - let previousValue = TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.SmartSyncOptOutPolicySerializer().deserialize(dict["new_value"] ?? .null) - return SmartSyncOptOutDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangePolicyDetails: \(error)" } } } - /// The SmartSyncOptOutPolicy union - public enum SmartSyncOptOutPolicy: CustomStringConvertible { - /// An unspecified error. - case default_ - /// An unspecified error. - case optedOut - /// An unspecified error. - case other - - public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncOptOutPolicySerializer().serialize(self)))" + public class SsoChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.SsoPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.SsoPolicySerializer()).serialize(value.previousValue), + ] + return .dictionary(output) } - } - open class SmartSyncOptOutPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncOptOutPolicy) -> JSON { - switch value { - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .optedOut: - var d = [String: JSON]() - d[".tag"] = .str("opted_out") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SmartSyncOptOutPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default": - return SmartSyncOptOutPolicy.default_ - case "opted_out": - return SmartSyncOptOutPolicy.optedOut - case "other": - return SmartSyncOptOutPolicy.other - default: - return SmartSyncOptOutPolicy.other - } - default: - fatalError("Failed to deserialize") + + public func deserialize(_ json: JSON) throws -> SsoChangePolicyDetails { + switch json { + case .dictionary(let dict): + let newValue = try TeamPolicies.SsoPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.SsoPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return SsoChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SsoChangePolicyDetails.self, json: json) } } } - /// The SmartSyncOptOutType struct - open class SmartSyncOptOutType: CustomStringConvertible { + /// The SsoChangePolicyType struct + public class SsoChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncOptOutTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangePolicyType: \(error)" + } } } - open class SmartSyncOptOutTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncOptOutType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmartSyncOptOutType { + + public func deserialize(_ json: JSON) throws -> SsoChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SmartSyncOptOutType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoChangePolicyType.self, json: json) } } } - /// Changed automatic Smart Sync setting for team. - open class SmarterSmartSyncPolicyChangedDetails: CustomStringConvertible { - /// Previous automatic Smart Sync setting. - public let previousValue: TeamPolicies.SmarterSmartSyncPolicyState - /// New automatic Smart Sync setting. - public let newValue: TeamPolicies.SmarterSmartSyncPolicyState - public init(previousValue: TeamPolicies.SmarterSmartSyncPolicyState, newValue: TeamPolicies.SmarterSmartSyncPolicyState) { + /// Changed SAML identity mode for SSO. + public class SsoChangeSamlIdentityModeDetails: CustomStringConvertible, JSONRepresentable { + /// Previous single sign-on identity mode. + public let previousValue: Int64 + /// New single sign-on identity mode. + public let newValue: Int64 + public init(previousValue: Int64, newValue: Int64) { + comparableValidator()(previousValue) self.previousValue = previousValue + comparableValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmarterSmartSyncPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoChangeSamlIdentityModeDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeSamlIdentityModeDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeSamlIdentityModeDetails: \(error)" + } } } - open class SmarterSmartSyncPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmarterSmartSyncPolicyChangedDetails) -> JSON { - let output = [ - "previous_value": TeamPolicies.SmarterSmartSyncPolicyStateSerializer().serialize(value.previousValue), - "new_value": TeamPolicies.SmarterSmartSyncPolicyStateSerializer().serialize(value.newValue), + + public class SsoChangeSamlIdentityModeDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeSamlIdentityModeDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._Int64Serializer.serialize(value.previousValue), + "new_value": try Serialization._Int64Serializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmarterSmartSyncPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> SsoChangeSamlIdentityModeDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamPolicies.SmarterSmartSyncPolicyStateSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamPolicies.SmarterSmartSyncPolicyStateSerializer().deserialize(dict["new_value"] ?? .null) - return SmarterSmartSyncPolicyChangedDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._Int64Serializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._Int64Serializer.deserialize(dict["new_value"] ?? .null) + return SsoChangeSamlIdentityModeDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeSamlIdentityModeDetails.self, json: json) } } } - /// The SmarterSmartSyncPolicyChangedType struct - open class SmarterSmartSyncPolicyChangedType: CustomStringConvertible { + /// The SsoChangeSamlIdentityModeType struct + public class SsoChangeSamlIdentityModeType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmarterSmartSyncPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoChangeSamlIdentityModeTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoChangeSamlIdentityModeTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoChangeSamlIdentityModeType: \(error)" + } } } - open class SmarterSmartSyncPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmarterSmartSyncPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoChangeSamlIdentityModeTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoChangeSamlIdentityModeType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SmarterSmartSyncPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> SsoChangeSamlIdentityModeType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SmarterSmartSyncPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoChangeSamlIdentityModeType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoChangeSamlIdentityModeType.self, json: json) } } } - /// Space limit alert policy - public enum SpaceCapsType: CustomStringConvertible { - /// An unspecified error. - case hard - /// An unspecified error. - case off - /// An unspecified error. - case soft - /// An unspecified error. - case other + /// Failed to sign in via SSO. + public class SsoErrorDetails: CustomStringConvertible, JSONRepresentable { + /// Error details. + public let errorDetails: TeamLog.FailureDetailsLogInfo + public init(errorDetails: TeamLog.FailureDetailsLogInfo) { + self.errorDetails = errorDetails + } + + func json() throws -> JSON { + try SsoErrorDetailsSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SpaceCapsTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoErrorDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoErrorDetails: \(error)" + } } } - open class SpaceCapsTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SpaceCapsType) -> JSON { - switch value { - case .hard: - var d = [String: JSON]() - d[".tag"] = .str("hard") - return .dictionary(d) - case .off: - var d = [String: JSON]() - d[".tag"] = .str("off") - return .dictionary(d) - case .soft: - var d = [String: JSON]() - d[".tag"] = .str("soft") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SpaceCapsType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "hard": - return SpaceCapsType.hard - case "off": - return SpaceCapsType.off - case "soft": - return SpaceCapsType.soft - case "other": - return SpaceCapsType.other - default: - return SpaceCapsType.other - } - default: - fatalError("Failed to deserialize") + + public class SsoErrorDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoErrorDetails) throws -> JSON { + let output = [ + "error_details": try TeamLog.FailureDetailsLogInfoSerializer().serialize(value.errorDetails), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SsoErrorDetails { + switch json { + case .dictionary(let dict): + let errorDetails = try TeamLog.FailureDetailsLogInfoSerializer().deserialize(dict["error_details"] ?? .null) + return SsoErrorDetails(errorDetails: errorDetails) + default: + throw JSONSerializerError.deserializeError(type: SsoErrorDetails.self, json: json) } } } - /// The SpaceLimitsStatus union - public enum SpaceLimitsStatus: CustomStringConvertible { - /// An unspecified error. - case nearQuota - /// An unspecified error. - case overQuota - /// An unspecified error. - case withinQuota - /// An unspecified error. - case other + /// The SsoErrorType struct + public class SsoErrorType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try SsoErrorTypeSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SpaceLimitsStatusSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoErrorTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoErrorType: \(error)" + } } } - open class SpaceLimitsStatusSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SpaceLimitsStatus) -> JSON { - switch value { - case .nearQuota: - var d = [String: JSON]() - d[".tag"] = .str("near_quota") - return .dictionary(d) - case .overQuota: - var d = [String: JSON]() - d[".tag"] = .str("over_quota") - return .dictionary(d) - case .withinQuota: - var d = [String: JSON]() - d[".tag"] = .str("within_quota") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SpaceLimitsStatus { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "near_quota": - return SpaceLimitsStatus.nearQuota - case "over_quota": - return SpaceLimitsStatus.overQuota - case "within_quota": - return SpaceLimitsStatus.withinQuota - case "other": - return SpaceLimitsStatus.other - default: - return SpaceLimitsStatus.other - } - default: - fatalError("Failed to deserialize") + + public class SsoErrorTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoErrorType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> SsoErrorType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoErrorType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoErrorType.self, json: json) } } } - /// Added X.509 certificate for SSO. - open class SsoAddCertDetails: CustomStringConvertible { - /// SSO certificate details. - public let certificateDetails: TeamLog.Certificate - public init(certificateDetails: TeamLog.Certificate) { - self.certificateDetails = certificateDetails + /// Removed X.509 certificate for SSO. + public class SsoRemoveCertDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try SsoRemoveCertDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoAddCertDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoRemoveCertDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoRemoveCertDetails: \(error)" + } } } - open class SsoAddCertDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoAddCertDetails) -> JSON { - let output = [ - "certificate_details": TeamLog.CertificateSerializer().serialize(value.certificateDetails), - ] + + public class SsoRemoveCertDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoRemoveCertDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoAddCertDetails { + + public func deserialize(_ json: JSON) throws -> SsoRemoveCertDetails { switch json { - case .dictionary(let dict): - let certificateDetails = TeamLog.CertificateSerializer().deserialize(dict["certificate_details"] ?? .null) - return SsoAddCertDetails(certificateDetails: certificateDetails) - default: - fatalError("Type error deserializing") + case .dictionary: + return SsoRemoveCertDetails() + default: + throw JSONSerializerError.deserializeError(type: SsoRemoveCertDetails.self, json: json) } } } - /// The SsoAddCertType struct - open class SsoAddCertType: CustomStringConvertible { + /// The SsoRemoveCertType struct + public class SsoRemoveCertType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoAddCertTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoRemoveCertTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoRemoveCertTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoRemoveCertType: \(error)" + } } } - open class SsoAddCertTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoAddCertType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoRemoveCertTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoRemoveCertType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoAddCertType { + + public func deserialize(_ json: JSON) throws -> SsoRemoveCertType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoAddCertType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoRemoveCertType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoRemoveCertType.self, json: json) } } } - /// Added sign-in URL for SSO. - open class SsoAddLoginUrlDetails: CustomStringConvertible { - /// New single sign-on login URL. - public let newValue: String - public init(newValue: String) { - stringValidator()(newValue) - self.newValue = newValue + /// Removed sign-in URL for SSO. + public class SsoRemoveLoginUrlDetails: CustomStringConvertible, JSONRepresentable { + /// Previous single sign-on login URL. + public let previousValue: String + public init(previousValue: String) { + stringValidator()(previousValue) + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SsoRemoveLoginUrlDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoAddLoginUrlDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoRemoveLoginUrlDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoRemoveLoginUrlDetails: \(error)" + } } } - open class SsoAddLoginUrlDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoAddLoginUrlDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public class SsoRemoveLoginUrlDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoRemoveLoginUrlDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoAddLoginUrlDetails { + + public func deserialize(_ json: JSON) throws -> SsoRemoveLoginUrlDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return SsoAddLoginUrlDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return SsoRemoveLoginUrlDetails(previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SsoRemoveLoginUrlDetails.self, json: json) } } } - /// The SsoAddLoginUrlType struct - open class SsoAddLoginUrlType: CustomStringConvertible { + /// The SsoRemoveLoginUrlType struct + public class SsoRemoveLoginUrlType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoAddLoginUrlTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoRemoveLoginUrlTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoRemoveLoginUrlTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoRemoveLoginUrlType: \(error)" + } } } - open class SsoAddLoginUrlTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoAddLoginUrlType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoRemoveLoginUrlTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoRemoveLoginUrlType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoAddLoginUrlType { + + public func deserialize(_ json: JSON) throws -> SsoRemoveLoginUrlType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoAddLoginUrlType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoRemoveLoginUrlType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoRemoveLoginUrlType.self, json: json) } } } - /// Added sign-out URL for SSO. - open class SsoAddLogoutUrlDetails: CustomStringConvertible { - /// New single sign-on logout URL. - public let newValue: String? - public init(newValue: String? = nil) { - nullableValidator(stringValidator())(newValue) - self.newValue = newValue + /// Removed sign-out URL for SSO. + public class SsoRemoveLogoutUrlDetails: CustomStringConvertible, JSONRepresentable { + /// Previous single sign-on logout URL. + public let previousValue: String + public init(previousValue: String) { + stringValidator()(previousValue) + self.previousValue = previousValue + } + + func json() throws -> JSON { + try SsoRemoveLogoutUrlDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoAddLogoutUrlDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoRemoveLogoutUrlDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoRemoveLogoutUrlDetails: \(error)" + } } } - open class SsoAddLogoutUrlDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoAddLogoutUrlDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(Serialization._StringSerializer).serialize(value.newValue), + + public class SsoRemoveLogoutUrlDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoRemoveLogoutUrlDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoAddLogoutUrlDetails { + + public func deserialize(_ json: JSON) throws -> SsoRemoveLogoutUrlDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_value"] ?? .null) - return SsoAddLogoutUrlDetails(newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return SsoRemoveLogoutUrlDetails(previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: SsoRemoveLogoutUrlDetails.self, json: json) } } } - /// The SsoAddLogoutUrlType struct - open class SsoAddLogoutUrlType: CustomStringConvertible { + /// The SsoRemoveLogoutUrlType struct + public class SsoRemoveLogoutUrlType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoAddLogoutUrlTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try SsoRemoveLogoutUrlTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoRemoveLogoutUrlTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoRemoveLogoutUrlType: \(error)" + } } } - open class SsoAddLogoutUrlTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoAddLogoutUrlType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class SsoRemoveLogoutUrlTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoRemoveLogoutUrlType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoAddLogoutUrlType { + + public func deserialize(_ json: JSON) throws -> SsoRemoveLogoutUrlType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoAddLogoutUrlType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return SsoRemoveLogoutUrlType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: SsoRemoveLogoutUrlType.self, json: json) } } } - /// Changed X.509 certificate for SSO. - open class SsoChangeCertDetails: CustomStringConvertible { - /// Previous SSO certificate details. Might be missing due to historical data gap. - public let previousCertificateDetails: TeamLog.Certificate? - /// New SSO certificate details. - public let newCertificateDetails: TeamLog.Certificate - public init(newCertificateDetails: TeamLog.Certificate, previousCertificateDetails: TeamLog.Certificate? = nil) { - self.previousCertificateDetails = previousCertificateDetails - self.newCertificateDetails = newCertificateDetails + /// Started enterprise admin session. + public class StartedEnterpriseAdminSessionDetails: CustomStringConvertible, JSONRepresentable { + /// More information about the organization or team. + public let federationExtraDetails: TeamLog.FedExtraDetails + public init(federationExtraDetails: TeamLog.FedExtraDetails) { + self.federationExtraDetails = federationExtraDetails + } + + func json() throws -> JSON { + try StartedEnterpriseAdminSessionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeCertDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try StartedEnterpriseAdminSessionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for StartedEnterpriseAdminSessionDetails: \(error)" + } } } - open class SsoChangeCertDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeCertDetails) -> JSON { - let output = [ - "new_certificate_details": TeamLog.CertificateSerializer().serialize(value.newCertificateDetails), - "previous_certificate_details": NullableSerializer(TeamLog.CertificateSerializer()).serialize(value.previousCertificateDetails), + + public class StartedEnterpriseAdminSessionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: StartedEnterpriseAdminSessionDetails) throws -> JSON { + let output = [ + "federation_extra_details": try TeamLog.FedExtraDetailsSerializer().serialize(value.federationExtraDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeCertDetails { + + public func deserialize(_ json: JSON) throws -> StartedEnterpriseAdminSessionDetails { switch json { - case .dictionary(let dict): - let newCertificateDetails = TeamLog.CertificateSerializer().deserialize(dict["new_certificate_details"] ?? .null) - let previousCertificateDetails = NullableSerializer(TeamLog.CertificateSerializer()).deserialize(dict["previous_certificate_details"] ?? .null) - return SsoChangeCertDetails(newCertificateDetails: newCertificateDetails, previousCertificateDetails: previousCertificateDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let federationExtraDetails = try TeamLog.FedExtraDetailsSerializer().deserialize(dict["federation_extra_details"] ?? .null) + return StartedEnterpriseAdminSessionDetails(federationExtraDetails: federationExtraDetails) + default: + throw JSONSerializerError.deserializeError(type: StartedEnterpriseAdminSessionDetails.self, json: json) } } } - /// The SsoChangeCertType struct - open class SsoChangeCertType: CustomStringConvertible { + /// The StartedEnterpriseAdminSessionType struct + public class StartedEnterpriseAdminSessionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeCertTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try StartedEnterpriseAdminSessionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try StartedEnterpriseAdminSessionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for StartedEnterpriseAdminSessionType: \(error)" + } } } - open class SsoChangeCertTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeCertType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class StartedEnterpriseAdminSessionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: StartedEnterpriseAdminSessionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeCertType { + + public func deserialize(_ json: JSON) throws -> StartedEnterpriseAdminSessionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoChangeCertType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return StartedEnterpriseAdminSessionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: StartedEnterpriseAdminSessionType.self, json: json) } } } - /// Changed sign-in URL for SSO. - open class SsoChangeLoginUrlDetails: CustomStringConvertible { - /// Previous single sign-on login URL. - public let previousValue: String - /// New single sign-on login URL. - public let newValue: String - public init(previousValue: String, newValue: String) { - stringValidator()(previousValue) - self.previousValue = previousValue - stringValidator()(newValue) - self.newValue = newValue + /// Created team activity report. + public class TeamActivityCreateReportDetails: CustomStringConvertible, JSONRepresentable { + /// Report start date. + public let startDate: Date + /// Report end date. + public let endDate: Date + public init(startDate: Date, endDate: Date) { + self.startDate = startDate + self.endDate = endDate + } + + func json() throws -> JSON { + try TeamActivityCreateReportDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeLoginUrlDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamActivityCreateReportDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamActivityCreateReportDetails: \(error)" + } } } - open class SsoChangeLoginUrlDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeLoginUrlDetails) -> JSON { - let output = [ - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public class TeamActivityCreateReportDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamActivityCreateReportDetails) throws -> JSON { + let output = [ + "start_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), + "end_date": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeLoginUrlDetails { + + public func deserialize(_ json: JSON) throws -> TeamActivityCreateReportDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return SsoChangeLoginUrlDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let startDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) + let endDate = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) + return TeamActivityCreateReportDetails(startDate: startDate, endDate: endDate) + default: + throw JSONSerializerError.deserializeError(type: TeamActivityCreateReportDetails.self, json: json) } } } - /// The SsoChangeLoginUrlType struct - open class SsoChangeLoginUrlType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ + /// Couldn't generate team activity report. + public class TeamActivityCreateReportFailDetails: CustomStringConvertible, JSONRepresentable { + /// Failure reason. + public let failureReason: Team.TeamReportFailureReason + public init(failureReason: Team.TeamReportFailureReason) { + self.failureReason = failureReason + } + + func json() throws -> JSON { + try TeamActivityCreateReportFailDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeLoginUrlTypeSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamActivityCreateReportFailDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamActivityCreateReportFailDetails: \(error)" + } } } - open class SsoChangeLoginUrlTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeLoginUrlType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamActivityCreateReportFailDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamActivityCreateReportFailDetails) throws -> JSON { + let output = [ + "failure_reason": try Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeLoginUrlType { + + public func deserialize(_ json: JSON) throws -> TeamActivityCreateReportFailDetails { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoChangeLoginUrlType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let failureReason = try Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) + return TeamActivityCreateReportFailDetails(failureReason: failureReason) + default: + throw JSONSerializerError.deserializeError(type: TeamActivityCreateReportFailDetails.self, json: json) } } } - /// Changed sign-out URL for SSO. - open class SsoChangeLogoutUrlDetails: CustomStringConvertible { - /// Previous single sign-on logout URL. Might be missing due to historical data gap. - public let previousValue: String? - /// New single sign-on logout URL. - public let newValue: String? - public init(previousValue: String? = nil, newValue: String? = nil) { - nullableValidator(stringValidator())(previousValue) - self.previousValue = previousValue - nullableValidator(stringValidator())(newValue) - self.newValue = newValue + /// The TeamActivityCreateReportFailType struct + public class TeamActivityCreateReportFailType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try TeamActivityCreateReportFailTypeSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeLogoutUrlDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamActivityCreateReportFailTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamActivityCreateReportFailType: \(error)" + } } } - open class SsoChangeLogoutUrlDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeLogoutUrlDetails) -> JSON { - let output = [ - "previous_value": NullableSerializer(Serialization._StringSerializer).serialize(value.previousValue), - "new_value": NullableSerializer(Serialization._StringSerializer).serialize(value.newValue), + + public class TeamActivityCreateReportFailTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamActivityCreateReportFailType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeLogoutUrlDetails { + + public func deserialize(_ json: JSON) throws -> TeamActivityCreateReportFailType { switch json { - case .dictionary(let dict): - let previousValue = NullableSerializer(Serialization._StringSerializer).deserialize(dict["previous_value"] ?? .null) - let newValue = NullableSerializer(Serialization._StringSerializer).deserialize(dict["new_value"] ?? .null) - return SsoChangeLogoutUrlDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamActivityCreateReportFailType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamActivityCreateReportFailType.self, json: json) } } } - /// The SsoChangeLogoutUrlType struct - open class SsoChangeLogoutUrlType: CustomStringConvertible { + /// The TeamActivityCreateReportType struct + public class TeamActivityCreateReportType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeLogoutUrlTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamActivityCreateReportTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamActivityCreateReportTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamActivityCreateReportType: \(error)" + } } } - open class SsoChangeLogoutUrlTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeLogoutUrlType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamActivityCreateReportTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamActivityCreateReportType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeLogoutUrlType { + + public func deserialize(_ json: JSON) throws -> TeamActivityCreateReportType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamActivityCreateReportType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamActivityCreateReportType.self, json: json) + } + } + } + + /// Policy for controlling team access to setting up branding feature + public enum TeamBrandingPolicy: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case disabled + /// An unspecified error. + case enabled + /// An unspecified error. + case other + + func json() throws -> JSON { + try TeamBrandingPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamBrandingPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamBrandingPolicy: \(error)" + } + } + } + + public class TeamBrandingPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamBrandingPolicy) throws -> JSON { + switch value { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamBrandingPolicy { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoChangeLogoutUrlType(description_: description_) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return TeamBrandingPolicy.disabled + case "enabled": + return TeamBrandingPolicy.enabled + case "other": + return TeamBrandingPolicy.other default: - fatalError("Type error deserializing") + return TeamBrandingPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamBrandingPolicy.self, json: json) } } } - /// Changed single sign-on setting for team. - open class SsoChangePolicyDetails: CustomStringConvertible { - /// New single sign-on policy. - public let newValue: TeamPolicies.SsoPolicy - /// Previous single sign-on policy. Might be missing due to historical data gap. - public let previousValue: TeamPolicies.SsoPolicy? - public init(newValue: TeamPolicies.SsoPolicy, previousValue: TeamPolicies.SsoPolicy? = nil) { + /// Changed team branding policy for team. + public class TeamBrandingPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { + /// New team branding policy. + public let newValue: TeamLog.TeamBrandingPolicy + /// Previous team branding policy. + public let previousValue: TeamLog.TeamBrandingPolicy + public init(newValue: TeamLog.TeamBrandingPolicy, previousValue: TeamLog.TeamBrandingPolicy) { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamBrandingPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamBrandingPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamBrandingPolicyChangedDetails: \(error)" + } } } - open class SsoChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.SsoPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.SsoPolicySerializer()).serialize(value.previousValue), + + public class TeamBrandingPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamBrandingPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.TeamBrandingPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.TeamBrandingPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> TeamBrandingPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.SsoPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.SsoPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return SsoChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.TeamBrandingPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.TeamBrandingPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return TeamBrandingPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TeamBrandingPolicyChangedDetails.self, json: json) } } } - /// The SsoChangePolicyType struct - open class SsoChangePolicyType: CustomStringConvertible { + /// The TeamBrandingPolicyChangedType struct + public class TeamBrandingPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangePolicyTypeSerializer().serialize(self)))" - } - } - open class SsoChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try TeamBrandingPolicyChangedTypeSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> SsoChangePolicyType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamBrandingPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamBrandingPolicyChangedType: \(error)" } } } - /// Changed SAML identity mode for SSO. - open class SsoChangeSamlIdentityModeDetails: CustomStringConvertible { - /// Previous single sign-on identity mode. - public let previousValue: Int64 - /// New single sign-on identity mode. - public let newValue: Int64 - public init(previousValue: Int64, newValue: Int64) { - comparableValidator()(previousValue) - self.previousValue = previousValue - comparableValidator()(newValue) - self.newValue = newValue - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeSamlIdentityModeDetailsSerializer().serialize(self)))" - } - } - open class SsoChangeSamlIdentityModeDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeSamlIdentityModeDetails) -> JSON { - let output = [ - "previous_value": Serialization._Int64Serializer.serialize(value.previousValue), - "new_value": Serialization._Int64Serializer.serialize(value.newValue), + public class TeamBrandingPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamBrandingPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeSamlIdentityModeDetails { + + public func deserialize(_ json: JSON) throws -> TeamBrandingPolicyChangedType { switch json { - case .dictionary(let dict): - let previousValue = Serialization._Int64Serializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._Int64Serializer.deserialize(dict["new_value"] ?? .null) - return SsoChangeSamlIdentityModeDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamBrandingPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamBrandingPolicyChangedType.self, json: json) } } } - /// The SsoChangeSamlIdentityModeType struct - open class SsoChangeSamlIdentityModeType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ + /// More details about the team. + public class TeamDetails: CustomStringConvertible, JSONRepresentable { + /// The name of the team. + public let team: String + public init(team: String) { + stringValidator()(team) + self.team = team } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoChangeSamlIdentityModeTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamDetails: \(error)" + } } } - open class SsoChangeSamlIdentityModeTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoChangeSamlIdentityModeType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamDetails) throws -> JSON { + let output = [ + "team": try Serialization._StringSerializer.serialize(value.team), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoChangeSamlIdentityModeType { + + public func deserialize(_ json: JSON) throws -> TeamDetails { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoChangeSamlIdentityModeType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let team = try Serialization._StringSerializer.deserialize(dict["team"] ?? .null) + return TeamDetails(team: team) + default: + throw JSONSerializerError.deserializeError(type: TeamDetails.self, json: json) } } } - /// Failed to sign in via SSO. - open class SsoErrorDetails: CustomStringConvertible { - /// Error details. - public let errorDetails: TeamLog.FailureDetailsLogInfo - public init(errorDetails: TeamLog.FailureDetailsLogInfo) { - self.errorDetails = errorDetails + /// Canceled team encryption key deletion. + public class TeamEncryptionKeyCancelKeyDeletionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamEncryptionKeyCancelKeyDeletionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoErrorDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyCancelKeyDeletionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyCancelKeyDeletionDetails: \(error)" + } } } - open class SsoErrorDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoErrorDetails) -> JSON { - let output = [ - "error_details": TeamLog.FailureDetailsLogInfoSerializer().serialize(value.errorDetails), - ] + + public class TeamEncryptionKeyCancelKeyDeletionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyCancelKeyDeletionDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoErrorDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyCancelKeyDeletionDetails { switch json { - case .dictionary(let dict): - let errorDetails = TeamLog.FailureDetailsLogInfoSerializer().deserialize(dict["error_details"] ?? .null) - return SsoErrorDetails(errorDetails: errorDetails) - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamEncryptionKeyCancelKeyDeletionDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyCancelKeyDeletionDetails.self, json: json) } } } - /// The SsoErrorType struct - open class SsoErrorType: CustomStringConvertible { + /// The TeamEncryptionKeyCancelKeyDeletionType struct + public class TeamEncryptionKeyCancelKeyDeletionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoErrorTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamEncryptionKeyCancelKeyDeletionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyCancelKeyDeletionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyCancelKeyDeletionType: \(error)" + } } } - open class SsoErrorTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoErrorType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamEncryptionKeyCancelKeyDeletionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyCancelKeyDeletionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoErrorType { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyCancelKeyDeletionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoErrorType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamEncryptionKeyCancelKeyDeletionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyCancelKeyDeletionType.self, json: json) } } } - /// Removed X.509 certificate for SSO. - open class SsoRemoveCertDetails: CustomStringConvertible { - public init() { + /// Created team encryption key. + public class TeamEncryptionKeyCreateKeyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamEncryptionKeyCreateKeyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoRemoveCertDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyCreateKeyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyCreateKeyDetails: \(error)" + } } } - open class SsoRemoveCertDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoRemoveCertDetails) -> JSON { + + public class TeamEncryptionKeyCreateKeyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyCreateKeyDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoRemoveCertDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyCreateKeyDetails { switch json { - case .dictionary(_): - return SsoRemoveCertDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamEncryptionKeyCreateKeyDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyCreateKeyDetails.self, json: json) } } } - /// The SsoRemoveCertType struct - open class SsoRemoveCertType: CustomStringConvertible { + /// The TeamEncryptionKeyCreateKeyType struct + public class TeamEncryptionKeyCreateKeyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoRemoveCertTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamEncryptionKeyCreateKeyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyCreateKeyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyCreateKeyType: \(error)" + } } } - open class SsoRemoveCertTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoRemoveCertType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamEncryptionKeyCreateKeyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyCreateKeyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoRemoveCertType { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyCreateKeyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoRemoveCertType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamEncryptionKeyCreateKeyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyCreateKeyType.self, json: json) } } } - /// Removed sign-in URL for SSO. - open class SsoRemoveLoginUrlDetails: CustomStringConvertible { - /// Previous single sign-on login URL. - public let previousValue: String - public init(previousValue: String) { - stringValidator()(previousValue) - self.previousValue = previousValue + /// Deleted team encryption key. + public class TeamEncryptionKeyDeleteKeyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamEncryptionKeyDeleteKeyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoRemoveLoginUrlDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyDeleteKeyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyDeleteKeyDetails: \(error)" + } } } - open class SsoRemoveLoginUrlDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoRemoveLoginUrlDetails) -> JSON { - let output = [ - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - ] + + public class TeamEncryptionKeyDeleteKeyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyDeleteKeyDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoRemoveLoginUrlDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyDeleteKeyDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return SsoRemoveLoginUrlDetails(previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamEncryptionKeyDeleteKeyDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyDeleteKeyDetails.self, json: json) } } } - /// The SsoRemoveLoginUrlType struct - open class SsoRemoveLoginUrlType: CustomStringConvertible { + /// The TeamEncryptionKeyDeleteKeyType struct + public class TeamEncryptionKeyDeleteKeyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoRemoveLoginUrlTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamEncryptionKeyDeleteKeyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyDeleteKeyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyDeleteKeyType: \(error)" + } } } - open class SsoRemoveLoginUrlTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoRemoveLoginUrlType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamEncryptionKeyDeleteKeyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyDeleteKeyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoRemoveLoginUrlType { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyDeleteKeyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoRemoveLoginUrlType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamEncryptionKeyDeleteKeyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyDeleteKeyType.self, json: json) } } } - /// Removed sign-out URL for SSO. - open class SsoRemoveLogoutUrlDetails: CustomStringConvertible { - /// Previous single sign-on logout URL. - public let previousValue: String - public init(previousValue: String) { - stringValidator()(previousValue) - self.previousValue = previousValue + /// Disabled team encryption key. + public class TeamEncryptionKeyDisableKeyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamEncryptionKeyDisableKeyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoRemoveLogoutUrlDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyDisableKeyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyDisableKeyDetails: \(error)" + } } } - open class SsoRemoveLogoutUrlDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoRemoveLogoutUrlDetails) -> JSON { - let output = [ - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - ] + + public class TeamEncryptionKeyDisableKeyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyDisableKeyDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoRemoveLogoutUrlDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyDisableKeyDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return SsoRemoveLogoutUrlDetails(previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamEncryptionKeyDisableKeyDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyDisableKeyDetails.self, json: json) } } } - /// The SsoRemoveLogoutUrlType struct - open class SsoRemoveLogoutUrlType: CustomStringConvertible { + /// The TeamEncryptionKeyDisableKeyType struct + public class TeamEncryptionKeyDisableKeyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoRemoveLogoutUrlTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamEncryptionKeyDisableKeyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyDisableKeyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyDisableKeyType: \(error)" + } } } - open class SsoRemoveLogoutUrlTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoRemoveLogoutUrlType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamEncryptionKeyDisableKeyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyDisableKeyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SsoRemoveLogoutUrlType { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyDisableKeyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return SsoRemoveLogoutUrlType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamEncryptionKeyDisableKeyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyDisableKeyType.self, json: json) } } } - /// Started enterprise admin session. - open class StartedEnterpriseAdminSessionDetails: CustomStringConvertible { - /// More information about the organization or team. - public let federationExtraDetails: TeamLog.FedExtraDetails - public init(federationExtraDetails: TeamLog.FedExtraDetails) { - self.federationExtraDetails = federationExtraDetails + /// Enabled team encryption key. + public class TeamEncryptionKeyEnableKeyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamEncryptionKeyEnableKeyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(StartedEnterpriseAdminSessionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyEnableKeyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyEnableKeyDetails: \(error)" + } } } - open class StartedEnterpriseAdminSessionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: StartedEnterpriseAdminSessionDetails) -> JSON { - let output = [ - "federation_extra_details": TeamLog.FedExtraDetailsSerializer().serialize(value.federationExtraDetails), - ] + + public class TeamEncryptionKeyEnableKeyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyEnableKeyDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> StartedEnterpriseAdminSessionDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyEnableKeyDetails { switch json { - case .dictionary(let dict): - let federationExtraDetails = TeamLog.FedExtraDetailsSerializer().deserialize(dict["federation_extra_details"] ?? .null) - return StartedEnterpriseAdminSessionDetails(federationExtraDetails: federationExtraDetails) - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamEncryptionKeyEnableKeyDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyEnableKeyDetails.self, json: json) } } } - /// The StartedEnterpriseAdminSessionType struct - open class StartedEnterpriseAdminSessionType: CustomStringConvertible { + /// The TeamEncryptionKeyEnableKeyType struct + public class TeamEncryptionKeyEnableKeyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(StartedEnterpriseAdminSessionTypeSerializer().serialize(self)))" - } - } - open class StartedEnterpriseAdminSessionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: StartedEnterpriseAdminSessionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try TeamEncryptionKeyEnableKeyTypeSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> StartedEnterpriseAdminSessionType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return StartedEnterpriseAdminSessionType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyEnableKeyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyEnableKeyType: \(error)" } } } - /// Created team activity report. - open class TeamActivityCreateReportDetails: CustomStringConvertible { - /// Report start date. - public let startDate: Date - /// Report end date. - public let endDate: Date - public init(startDate: Date, endDate: Date) { - self.startDate = startDate - self.endDate = endDate - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamActivityCreateReportDetailsSerializer().serialize(self)))" - } - } - open class TeamActivityCreateReportDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamActivityCreateReportDetails) -> JSON { - let output = [ - "start_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.startDate), - "end_date": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.endDate), + public class TeamEncryptionKeyEnableKeyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyEnableKeyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamActivityCreateReportDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyEnableKeyType { switch json { - case .dictionary(let dict): - let startDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["start_date"] ?? .null) - let endDate = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["end_date"] ?? .null) - return TeamActivityCreateReportDetails(startDate: startDate, endDate: endDate) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamEncryptionKeyEnableKeyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyEnableKeyType.self, json: json) } } } - /// Couldn't generate team activity report. - open class TeamActivityCreateReportFailDetails: CustomStringConvertible { - /// Failure reason. - public let failureReason: Team.TeamReportFailureReason - public init(failureReason: Team.TeamReportFailureReason) { - self.failureReason = failureReason + /// Rotated team encryption key. + public class TeamEncryptionKeyRotateKeyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamEncryptionKeyRotateKeyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamActivityCreateReportFailDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyRotateKeyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyRotateKeyDetails: \(error)" + } } } - open class TeamActivityCreateReportFailDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamActivityCreateReportFailDetails) -> JSON { - let output = [ - "failure_reason": Team.TeamReportFailureReasonSerializer().serialize(value.failureReason), - ] + + public class TeamEncryptionKeyRotateKeyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyRotateKeyDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamActivityCreateReportFailDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyRotateKeyDetails { switch json { - case .dictionary(let dict): - let failureReason = Team.TeamReportFailureReasonSerializer().deserialize(dict["failure_reason"] ?? .null) - return TeamActivityCreateReportFailDetails(failureReason: failureReason) - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamEncryptionKeyRotateKeyDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyRotateKeyDetails.self, json: json) } } } - /// The TeamActivityCreateReportFailType struct - open class TeamActivityCreateReportFailType: CustomStringConvertible { + /// The TeamEncryptionKeyRotateKeyType struct + public class TeamEncryptionKeyRotateKeyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamActivityCreateReportFailTypeSerializer().serialize(self)))" - } - } - open class TeamActivityCreateReportFailTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamActivityCreateReportFailType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try TeamEncryptionKeyRotateKeyTypeSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> TeamActivityCreateReportFailType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamActivityCreateReportFailType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyRotateKeyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyRotateKeyType: \(error)" } } } - /// The TeamActivityCreateReportType struct - open class TeamActivityCreateReportType: CustomStringConvertible { - /// (no description) - public let description_: String - public init(description_: String) { - stringValidator()(description_) - self.description_ = description_ - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamActivityCreateReportTypeSerializer().serialize(self)))" - } - } - open class TeamActivityCreateReportTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamActivityCreateReportType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + public class TeamEncryptionKeyRotateKeyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyRotateKeyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamActivityCreateReportType { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyRotateKeyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamActivityCreateReportType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamEncryptionKeyRotateKeyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyRotateKeyType.self, json: json) } } } - /// Policy for controlling team access to setting up branding feature - public enum TeamBrandingPolicy: CustomStringConvertible { - /// An unspecified error. - case disabled - /// An unspecified error. - case enabled - /// An unspecified error. - case other + /// Scheduled encryption key deletion. + public class TeamEncryptionKeyScheduleKeyDeletionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamEncryptionKeyScheduleKeyDeletionDetailsSerializer().serialize(self) + } public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamBrandingPolicySerializer().serialize(self)))" - } - } - open class TeamBrandingPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamBrandingPolicy) -> JSON { - switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamBrandingPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return TeamBrandingPolicy.disabled - case "enabled": - return TeamBrandingPolicy.enabled - case "other": - return TeamBrandingPolicy.other - default: - return TeamBrandingPolicy.other - } - default: - fatalError("Failed to deserialize") + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyScheduleKeyDeletionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyScheduleKeyDeletionDetails: \(error)" } } } - /// Changed team branding policy for team. - open class TeamBrandingPolicyChangedDetails: CustomStringConvertible { - /// New team branding policy. - public let newValue: TeamLog.TeamBrandingPolicy - /// Previous team branding policy. - public let previousValue: TeamLog.TeamBrandingPolicy - public init(newValue: TeamLog.TeamBrandingPolicy, previousValue: TeamLog.TeamBrandingPolicy) { - self.newValue = newValue - self.previousValue = previousValue - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamBrandingPolicyChangedDetailsSerializer().serialize(self)))" - } - } - open class TeamBrandingPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamBrandingPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.TeamBrandingPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.TeamBrandingPolicySerializer().serialize(value.previousValue), - ] + public class TeamEncryptionKeyScheduleKeyDeletionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyScheduleKeyDeletionDetails) throws -> JSON { + let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamBrandingPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyScheduleKeyDeletionDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.TeamBrandingPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.TeamBrandingPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return TeamBrandingPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamEncryptionKeyScheduleKeyDeletionDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyScheduleKeyDeletionDetails.self, json: json) } } } - /// The TeamBrandingPolicyChangedType struct - open class TeamBrandingPolicyChangedType: CustomStringConvertible { + /// The TeamEncryptionKeyScheduleKeyDeletionType struct + public class TeamEncryptionKeyScheduleKeyDeletionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamBrandingPolicyChangedTypeSerializer().serialize(self)))" - } - } - open class TeamBrandingPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamBrandingPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), - ] - return .dictionary(output) + + func json() throws -> JSON { + try TeamEncryptionKeyScheduleKeyDeletionTypeSerializer().serialize(self) } - open func deserialize(_ json: JSON) -> TeamBrandingPolicyChangedType { - switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamBrandingPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEncryptionKeyScheduleKeyDeletionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEncryptionKeyScheduleKeyDeletionType: \(error)" } } } - /// More details about the team. - open class TeamDetails: CustomStringConvertible { - /// The name of the team. - public let team: String - public init(team: String) { - stringValidator()(team) - self.team = team - } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamDetailsSerializer().serialize(self)))" - } - } - open class TeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamDetails) -> JSON { - let output = [ - "team": Serialization._StringSerializer.serialize(value.team), + public class TeamEncryptionKeyScheduleKeyDeletionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEncryptionKeyScheduleKeyDeletionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamEncryptionKeyScheduleKeyDeletionType { switch json { - case .dictionary(let dict): - let team = Serialization._StringSerializer.deserialize(dict["team"] ?? .null) - return TeamDetails(team: team) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamEncryptionKeyScheduleKeyDeletionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamEncryptionKeyScheduleKeyDeletionType.self, json: json) } } } /// An audit log event. - open class TeamEvent: CustomStringConvertible { + public class TeamEvent: CustomStringConvertible, JSONRepresentable { /// The Dropbox timestamp representing when the action was taken. public let timestamp_: Date /// The category that this type of action belongs to. @@ -48494,7 +61582,8 @@ open class TeamLog { /// The entity who actually performed the action. Might be missing due to historical data gap. public let actor: TeamLog.ActorLogInfo? /// The origin from which the actor performed the action including information about host, ip address, location, - /// session, etc. If the action was performed programmatically via the API the origin represents the API client. + /// session, etc. If the action was performed programmatically via the API the origin represents the API + /// client. public let origin: TeamLog.OriginLogInfo? /// True if the action involved a non team member either as the actor or as one of the affected users. Might be /// missing due to historical data gap. @@ -48504,16 +61593,27 @@ open class TeamLog { public let context: TeamLog.ContextLogInfo? /// Zero or more users and/or groups that are affected by the action. Note that this list doesn't include any /// actors or users in context. - public let participants: Array? + public let participants: [TeamLog.ParticipantLogInfo]? /// Zero or more content assets involved in the action. Currently these include Dropbox files and folders but in /// the future we might add other asset types such as Paper documents, folders, projects, etc. - public let assets: Array? + public let assets: [TeamLog.AssetLogInfo]? /// The particular type of action taken. public let eventType: TeamLog.EventType /// The variable event schema applicable to this type of action, instantiated with respect to this particular /// action. public let details: TeamLog.EventDetails - public init(timestamp_: Date, eventCategory: TeamLog.EventCategory, eventType: TeamLog.EventType, details: TeamLog.EventDetails, actor: TeamLog.ActorLogInfo? = nil, origin: TeamLog.OriginLogInfo? = nil, involveNonTeamMember: Bool? = nil, context: TeamLog.ContextLogInfo? = nil, participants: Array? = nil, assets: Array? = nil) { + public init( + timestamp_: Date, + eventCategory: TeamLog.EventCategory, + eventType: TeamLog.EventType, + details: TeamLog.EventDetails, + actor: TeamLog.ActorLogInfo? = nil, + origin: TeamLog.OriginLogInfo? = nil, + involveNonTeamMember: Bool? = nil, + context: TeamLog.ContextLogInfo? = nil, + participants: [TeamLog.ParticipantLogInfo]? = nil, + assets: [TeamLog.AssetLogInfo]? = nil + ) { self.timestamp_ = timestamp_ self.eventCategory = eventCategory self.actor = actor @@ -48525,49 +61625,72 @@ open class TeamLog { self.eventType = eventType self.details = details } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamEventSerializer().serialize(self)))" - } - } - open class TeamEventSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamEvent) -> JSON { - let output = [ - "timestamp": NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.timestamp_), - "event_category": TeamLog.EventCategorySerializer().serialize(value.eventCategory), - "event_type": TeamLog.EventTypeSerializer().serialize(value.eventType), - "details": TeamLog.EventDetailsSerializer().serialize(value.details), - "actor": NullableSerializer(TeamLog.ActorLogInfoSerializer()).serialize(value.actor), - "origin": NullableSerializer(TeamLog.OriginLogInfoSerializer()).serialize(value.origin), - "involve_non_team_member": NullableSerializer(Serialization._BoolSerializer).serialize(value.involveNonTeamMember), - "context": NullableSerializer(TeamLog.ContextLogInfoSerializer()).serialize(value.context), - "participants": NullableSerializer(ArraySerializer(TeamLog.ParticipantLogInfoSerializer())).serialize(value.participants), - "assets": NullableSerializer(ArraySerializer(TeamLog.AssetLogInfoSerializer())).serialize(value.assets), - ] - return .dictionary(output) - } - open func deserialize(_ json: JSON) -> TeamEvent { - switch json { - case .dictionary(let dict): - let timestamp_ = NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["timestamp"] ?? .null) - let eventCategory = TeamLog.EventCategorySerializer().deserialize(dict["event_category"] ?? .null) - let eventType = TeamLog.EventTypeSerializer().deserialize(dict["event_type"] ?? .null) - let details = TeamLog.EventDetailsSerializer().deserialize(dict["details"] ?? .null) - let actor = NullableSerializer(TeamLog.ActorLogInfoSerializer()).deserialize(dict["actor"] ?? .null) - let origin = NullableSerializer(TeamLog.OriginLogInfoSerializer()).deserialize(dict["origin"] ?? .null) - let involveNonTeamMember = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["involve_non_team_member"] ?? .null) - let context = NullableSerializer(TeamLog.ContextLogInfoSerializer()).deserialize(dict["context"] ?? .null) - let participants = NullableSerializer(ArraySerializer(TeamLog.ParticipantLogInfoSerializer())).deserialize(dict["participants"] ?? .null) - let assets = NullableSerializer(ArraySerializer(TeamLog.AssetLogInfoSerializer())).deserialize(dict["assets"] ?? .null) - return TeamEvent(timestamp_: timestamp_, eventCategory: eventCategory, eventType: eventType, details: details, actor: actor, origin: origin, involveNonTeamMember: involveNonTeamMember, context: context, participants: participants, assets: assets) - default: - fatalError("Type error deserializing") + + func json() throws -> JSON { + try TeamEventSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamEventSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamEvent: \(error)" + } + } + } + + public class TeamEventSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamEvent) throws -> JSON { + let output = [ + "timestamp": try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").serialize(value.timestamp_), + "event_category": try TeamLog.EventCategorySerializer().serialize(value.eventCategory), + "event_type": try TeamLog.EventTypeSerializer().serialize(value.eventType), + "details": try TeamLog.EventDetailsSerializer().serialize(value.details), + "actor": try NullableSerializer(TeamLog.ActorLogInfoSerializer()).serialize(value.actor), + "origin": try NullableSerializer(TeamLog.OriginLogInfoSerializer()).serialize(value.origin), + "involve_non_team_member": try NullableSerializer(Serialization._BoolSerializer).serialize(value.involveNonTeamMember), + "context": try NullableSerializer(TeamLog.ContextLogInfoSerializer()).serialize(value.context), + "participants": try NullableSerializer(ArraySerializer(TeamLog.ParticipantLogInfoSerializer())).serialize(value.participants), + "assets": try NullableSerializer(ArraySerializer(TeamLog.AssetLogInfoSerializer())).serialize(value.assets), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> TeamEvent { + switch json { + case .dictionary(let dict): + let timestamp_ = try NSDateSerializer("%Y-%m-%dT%H:%M:%SZ").deserialize(dict["timestamp"] ?? .null) + let eventCategory = try TeamLog.EventCategorySerializer().deserialize(dict["event_category"] ?? .null) + let eventType = try TeamLog.EventTypeSerializer().deserialize(dict["event_type"] ?? .null) + let details = try TeamLog.EventDetailsSerializer().deserialize(dict["details"] ?? .null) + let actor = try NullableSerializer(TeamLog.ActorLogInfoSerializer()).deserialize(dict["actor"] ?? .null) + let origin = try NullableSerializer(TeamLog.OriginLogInfoSerializer()).deserialize(dict["origin"] ?? .null) + let involveNonTeamMember = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["involve_non_team_member"] ?? .null) + let context = try NullableSerializer(TeamLog.ContextLogInfoSerializer()).deserialize(dict["context"] ?? .null) + let participants = try NullableSerializer(ArraySerializer(TeamLog.ParticipantLogInfoSerializer())) + .deserialize(dict["participants"] ?? .null) + let assets = try NullableSerializer(ArraySerializer(TeamLog.AssetLogInfoSerializer())).deserialize(dict["assets"] ?? .null) + return TeamEvent( + timestamp_: timestamp_, + eventCategory: eventCategory, + eventType: eventType, + details: details, + actor: actor, + origin: origin, + involveNonTeamMember: involveNonTeamMember, + context: context, + participants: participants, + assets: assets + ) + default: + throw JSONSerializerError.deserializeError(type: TeamEvent.self, json: json) } } } /// Policy for controlling whether App Integrations are enabled for the team. - public enum TeamExtensionsPolicy: CustomStringConvertible { + public enum TeamExtensionsPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -48575,50 +61698,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TeamExtensionsPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamExtensionsPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamExtensionsPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamExtensionsPolicy: \(error)" + } } } - open class TeamExtensionsPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamExtensionsPolicy) -> JSON { + + public class TeamExtensionsPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamExtensionsPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamExtensionsPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return TeamExtensionsPolicy.disabled - case "enabled": - return TeamExtensionsPolicy.enabled - case "other": - return TeamExtensionsPolicy.other - default: - return TeamExtensionsPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamExtensionsPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return TeamExtensionsPolicy.disabled + case "enabled": + return TeamExtensionsPolicy.enabled + case "other": + return TeamExtensionsPolicy.other default: - fatalError("Failed to deserialize") + return TeamExtensionsPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamExtensionsPolicy.self, json: json) } } } /// Changed App Integrations setting for team. - open class TeamExtensionsPolicyChangedDetails: CustomStringConvertible { + public class TeamExtensionsPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New Extensions policy. public let newValue: TeamLog.TeamExtensionsPolicy /// Previous Extensions policy. @@ -48627,64 +61760,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamExtensionsPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamExtensionsPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamExtensionsPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamExtensionsPolicyChangedDetails: \(error)" + } } } - open class TeamExtensionsPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamExtensionsPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.TeamExtensionsPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.TeamExtensionsPolicySerializer().serialize(value.previousValue), + + public class TeamExtensionsPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamExtensionsPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.TeamExtensionsPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.TeamExtensionsPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamExtensionsPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> TeamExtensionsPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.TeamExtensionsPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.TeamExtensionsPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return TeamExtensionsPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.TeamExtensionsPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.TeamExtensionsPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return TeamExtensionsPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TeamExtensionsPolicyChangedDetails.self, json: json) } } } /// The TeamExtensionsPolicyChangedType struct - open class TeamExtensionsPolicyChangedType: CustomStringConvertible { + public class TeamExtensionsPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamExtensionsPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamExtensionsPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamExtensionsPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamExtensionsPolicyChangedType: \(error)" + } } } - open class TeamExtensionsPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamExtensionsPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamExtensionsPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamExtensionsPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamExtensionsPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> TeamExtensionsPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamExtensionsPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamExtensionsPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamExtensionsPolicyChangedType.self, json: json) } } } /// Changed archival status of team folder. - open class TeamFolderChangeStatusDetails: CustomStringConvertible { + public class TeamFolderChangeStatusDetails: CustomStringConvertible, JSONRepresentable { /// New team folder status. public let newValue: Team.TeamFolderStatus /// Previous team folder status. Might be missing due to historical data gap. @@ -48693,236 +61848,318 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderChangeStatusDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderChangeStatusDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderChangeStatusDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderChangeStatusDetails: \(error)" + } } } - open class TeamFolderChangeStatusDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderChangeStatusDetails) -> JSON { - let output = [ - "new_value": Team.TeamFolderStatusSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(Team.TeamFolderStatusSerializer()).serialize(value.previousValue), + + public class TeamFolderChangeStatusDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderChangeStatusDetails) throws -> JSON { + let output = [ + "new_value": try Team.TeamFolderStatusSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(Team.TeamFolderStatusSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderChangeStatusDetails { + + public func deserialize(_ json: JSON) throws -> TeamFolderChangeStatusDetails { switch json { - case .dictionary(let dict): - let newValue = Team.TeamFolderStatusSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(Team.TeamFolderStatusSerializer()).deserialize(dict["previous_value"] ?? .null) - return TeamFolderChangeStatusDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Team.TeamFolderStatusSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(Team.TeamFolderStatusSerializer()).deserialize(dict["previous_value"] ?? .null) + return TeamFolderChangeStatusDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderChangeStatusDetails.self, json: json) } } } /// The TeamFolderChangeStatusType struct - open class TeamFolderChangeStatusType: CustomStringConvertible { + public class TeamFolderChangeStatusType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderChangeStatusTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderChangeStatusTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderChangeStatusTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderChangeStatusType: \(error)" + } } } - open class TeamFolderChangeStatusTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderChangeStatusType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamFolderChangeStatusTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderChangeStatusType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderChangeStatusType { + + public func deserialize(_ json: JSON) throws -> TeamFolderChangeStatusType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamFolderChangeStatusType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamFolderChangeStatusType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderChangeStatusType.self, json: json) } } } /// Created team folder in active status. - open class TeamFolderCreateDetails: CustomStringConvertible { - public init() { + public class TeamFolderCreateDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamFolderCreateDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderCreateDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderCreateDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderCreateDetails: \(error)" + } } } - open class TeamFolderCreateDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderCreateDetails) -> JSON { + + public class TeamFolderCreateDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderCreateDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderCreateDetails { + + public func deserialize(_ json: JSON) throws -> TeamFolderCreateDetails { switch json { - case .dictionary(_): - return TeamFolderCreateDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamFolderCreateDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamFolderCreateDetails.self, json: json) } } } /// The TeamFolderCreateType struct - open class TeamFolderCreateType: CustomStringConvertible { + public class TeamFolderCreateType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderCreateTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderCreateTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderCreateTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderCreateType: \(error)" + } } } - open class TeamFolderCreateTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderCreateType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamFolderCreateTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderCreateType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderCreateType { + + public func deserialize(_ json: JSON) throws -> TeamFolderCreateType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamFolderCreateType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamFolderCreateType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderCreateType.self, json: json) } } } /// Downgraded team folder to regular shared folder. - open class TeamFolderDowngradeDetails: CustomStringConvertible { + public class TeamFolderDowngradeDetails: CustomStringConvertible, JSONRepresentable { /// Target asset position in the Assets list. public let targetAssetIndex: UInt64 public init(targetAssetIndex: UInt64) { comparableValidator()(targetAssetIndex) self.targetAssetIndex = targetAssetIndex } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderDowngradeDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderDowngradeDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderDowngradeDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderDowngradeDetails: \(error)" + } } } - open class TeamFolderDowngradeDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderDowngradeDetails) -> JSON { - let output = [ - "target_asset_index": Serialization._UInt64Serializer.serialize(value.targetAssetIndex), + + public class TeamFolderDowngradeDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderDowngradeDetails) throws -> JSON { + let output = [ + "target_asset_index": try Serialization._UInt64Serializer.serialize(value.targetAssetIndex), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderDowngradeDetails { + + public func deserialize(_ json: JSON) throws -> TeamFolderDowngradeDetails { switch json { - case .dictionary(let dict): - let targetAssetIndex = Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) - return TeamFolderDowngradeDetails(targetAssetIndex: targetAssetIndex) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let targetAssetIndex = try Serialization._UInt64Serializer.deserialize(dict["target_asset_index"] ?? .null) + return TeamFolderDowngradeDetails(targetAssetIndex: targetAssetIndex) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderDowngradeDetails.self, json: json) } } } /// The TeamFolderDowngradeType struct - open class TeamFolderDowngradeType: CustomStringConvertible { + public class TeamFolderDowngradeType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderDowngradeTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderDowngradeTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderDowngradeTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderDowngradeType: \(error)" + } } } - open class TeamFolderDowngradeTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderDowngradeType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamFolderDowngradeTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderDowngradeType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderDowngradeType { + + public func deserialize(_ json: JSON) throws -> TeamFolderDowngradeType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamFolderDowngradeType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamFolderDowngradeType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderDowngradeType.self, json: json) } } } /// Permanently deleted archived team folder. - open class TeamFolderPermanentlyDeleteDetails: CustomStringConvertible { - public init() { + public class TeamFolderPermanentlyDeleteDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamFolderPermanentlyDeleteDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderPermanentlyDeleteDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderPermanentlyDeleteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderPermanentlyDeleteDetails: \(error)" + } } } - open class TeamFolderPermanentlyDeleteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderPermanentlyDeleteDetails) -> JSON { + + public class TeamFolderPermanentlyDeleteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderPermanentlyDeleteDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderPermanentlyDeleteDetails { + + public func deserialize(_ json: JSON) throws -> TeamFolderPermanentlyDeleteDetails { switch json { - case .dictionary(_): - return TeamFolderPermanentlyDeleteDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamFolderPermanentlyDeleteDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamFolderPermanentlyDeleteDetails.self, json: json) } } } /// The TeamFolderPermanentlyDeleteType struct - open class TeamFolderPermanentlyDeleteType: CustomStringConvertible { + public class TeamFolderPermanentlyDeleteType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderPermanentlyDeleteTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderPermanentlyDeleteTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderPermanentlyDeleteTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderPermanentlyDeleteType: \(error)" + } } } - open class TeamFolderPermanentlyDeleteTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderPermanentlyDeleteType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamFolderPermanentlyDeleteTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderPermanentlyDeleteType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderPermanentlyDeleteType { + + public func deserialize(_ json: JSON) throws -> TeamFolderPermanentlyDeleteType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamFolderPermanentlyDeleteType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamFolderPermanentlyDeleteType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderPermanentlyDeleteType.self, json: json) } } } /// Renamed active/archived team folder. - open class TeamFolderRenameDetails: CustomStringConvertible { + public class TeamFolderRenameDetails: CustomStringConvertible, JSONRepresentable { /// Previous folder name. public let previousFolderName: String /// New folder name. @@ -48933,64 +62170,86 @@ open class TeamLog { stringValidator()(newFolderName) self.newFolderName = newFolderName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderRenameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderRenameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderRenameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderRenameDetails: \(error)" + } } } - open class TeamFolderRenameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderRenameDetails) -> JSON { - let output = [ - "previous_folder_name": Serialization._StringSerializer.serialize(value.previousFolderName), - "new_folder_name": Serialization._StringSerializer.serialize(value.newFolderName), + + public class TeamFolderRenameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderRenameDetails) throws -> JSON { + let output = [ + "previous_folder_name": try Serialization._StringSerializer.serialize(value.previousFolderName), + "new_folder_name": try Serialization._StringSerializer.serialize(value.newFolderName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderRenameDetails { + + public func deserialize(_ json: JSON) throws -> TeamFolderRenameDetails { switch json { - case .dictionary(let dict): - let previousFolderName = Serialization._StringSerializer.deserialize(dict["previous_folder_name"] ?? .null) - let newFolderName = Serialization._StringSerializer.deserialize(dict["new_folder_name"] ?? .null) - return TeamFolderRenameDetails(previousFolderName: previousFolderName, newFolderName: newFolderName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousFolderName = try Serialization._StringSerializer.deserialize(dict["previous_folder_name"] ?? .null) + let newFolderName = try Serialization._StringSerializer.deserialize(dict["new_folder_name"] ?? .null) + return TeamFolderRenameDetails(previousFolderName: previousFolderName, newFolderName: newFolderName) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderRenameDetails.self, json: json) } } } /// The TeamFolderRenameType struct - open class TeamFolderRenameType: CustomStringConvertible { + public class TeamFolderRenameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamFolderRenameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamFolderRenameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamFolderRenameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamFolderRenameType: \(error)" + } } } - open class TeamFolderRenameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamFolderRenameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamFolderRenameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamFolderRenameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamFolderRenameType { + + public func deserialize(_ json: JSON) throws -> TeamFolderRenameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamFolderRenameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamFolderRenameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamFolderRenameType.self, json: json) } } } /// Details about team invites - open class TeamInviteDetails: CustomStringConvertible { + public class TeamInviteDetails: CustomStringConvertible, JSONRepresentable { /// How the user was invited to the team. public let inviteMethod: TeamLog.InviteMethod /// True if the invitation incurred an additional license purchase. @@ -48999,98 +62258,134 @@ open class TeamLog { self.inviteMethod = inviteMethod self.additionalLicensePurchase = additionalLicensePurchase } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamInviteDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamInviteDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamInviteDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamInviteDetails: \(error)" + } } } - open class TeamInviteDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamInviteDetails) -> JSON { - let output = [ - "invite_method": TeamLog.InviteMethodSerializer().serialize(value.inviteMethod), - "additional_license_purchase": NullableSerializer(Serialization._BoolSerializer).serialize(value.additionalLicensePurchase), + + public class TeamInviteDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamInviteDetails) throws -> JSON { + let output = [ + "invite_method": try TeamLog.InviteMethodSerializer().serialize(value.inviteMethod), + "additional_license_purchase": try NullableSerializer(Serialization._BoolSerializer).serialize(value.additionalLicensePurchase), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamInviteDetails { + + public func deserialize(_ json: JSON) throws -> TeamInviteDetails { switch json { - case .dictionary(let dict): - let inviteMethod = TeamLog.InviteMethodSerializer().deserialize(dict["invite_method"] ?? .null) - let additionalLicensePurchase = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["additional_license_purchase"] ?? .null) - return TeamInviteDetails(inviteMethod: inviteMethod, additionalLicensePurchase: additionalLicensePurchase) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let inviteMethod = try TeamLog.InviteMethodSerializer().deserialize(dict["invite_method"] ?? .null) + let additionalLicensePurchase = try NullableSerializer(Serialization._BoolSerializer) + .deserialize(dict["additional_license_purchase"] ?? .null) + return TeamInviteDetails(inviteMethod: inviteMethod, additionalLicensePurchase: additionalLicensePurchase) + default: + throw JSONSerializerError.deserializeError(type: TeamInviteDetails.self, json: json) } } } /// Team linked app - open class TeamLinkedAppLogInfo: TeamLog.AppLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamLinkedAppLogInfoSerializer().serialize(self)))" + public class TeamLinkedAppLogInfo: TeamLog.AppLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamLinkedAppLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamLinkedAppLogInfo: \(error)" + } } } - open class TeamLinkedAppLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamLinkedAppLogInfo) -> JSON { - let output = [ - "app_id": NullableSerializer(Serialization._StringSerializer).serialize(value.appId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + + public class TeamLinkedAppLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamLinkedAppLogInfo) throws -> JSON { + let output = [ + "app_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.appId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamLinkedAppLogInfo { + + public func deserialize(_ json: JSON) throws -> TeamLinkedAppLogInfo { switch json { - case .dictionary(let dict): - let appId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - return TeamLinkedAppLogInfo(appId: appId, displayName: displayName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + return TeamLinkedAppLogInfo(appId: appId, displayName: displayName) + default: + throw JSONSerializerError.deserializeError(type: TeamLinkedAppLogInfo.self, json: json) } } } /// Team's logged information. - open class TeamLogInfo: CustomStringConvertible { + public class TeamLogInfo: CustomStringConvertible, JSONRepresentable { /// Team display name. public let displayName: String public init(displayName: String) { stringValidator()(displayName) self.displayName = displayName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamLogInfo: \(error)" + } } } - open class TeamLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamLogInfo) -> JSON { - let output = [ - "display_name": Serialization._StringSerializer.serialize(value.displayName), + + public class TeamLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamLogInfo) throws -> JSON { + let output = [ + "display_name": try Serialization._StringSerializer.serialize(value.displayName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamLogInfo { + + public func deserialize(_ json: JSON) throws -> TeamLogInfo { switch json { - case .dictionary(let dict): - let displayName = Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) - return TeamLogInfo(displayName: displayName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let displayName = try Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) + return TeamLogInfo(displayName: displayName) + default: + throw JSONSerializerError.deserializeError(type: TeamLogInfo.self, json: json) } } } /// Team member's logged information. - open class TeamMemberLogInfo: TeamLog.UserLogInfo { + public class TeamMemberLogInfo: TeamLog.UserLogInfo { /// Team member ID. public let teamMemberId: String? /// Team member external ID. public let memberExternalId: String? /// Details about this user’s team for enterprise event. public let team: TeamLog.TeamLogInfo? - public init(accountId: String? = nil, displayName: String? = nil, email: String? = nil, teamMemberId: String? = nil, memberExternalId: String? = nil, team: TeamLog.TeamLogInfo? = nil) { + public init( + accountId: String? = nil, + displayName: String? = nil, + email: String? = nil, + teamMemberId: String? = nil, + memberExternalId: String? = nil, + team: TeamLog.TeamLogInfo? = nil + ) { nullableValidator(stringValidator())(teamMemberId) self.teamMemberId = teamMemberId nullableValidator(stringValidator(maxLength: 64))(memberExternalId) @@ -49098,41 +62393,55 @@ open class TeamLog { self.team = team super.init(accountId: accountId, displayName: displayName, email: email) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberLogInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberLogInfo: \(error)" + } } } - open class TeamMemberLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberLogInfo) -> JSON { - let output = [ - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "email": NullableSerializer(Serialization._StringSerializer).serialize(value.email), - "team_member_id": NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), - "member_external_id": NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), - "team": NullableSerializer(TeamLog.TeamLogInfoSerializer()).serialize(value.team), + + public class TeamMemberLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberLogInfo) throws -> JSON { + let output = [ + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "email": try NullableSerializer(Serialization._StringSerializer).serialize(value.email), + "team_member_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), + "member_external_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.memberExternalId), + "team": try NullableSerializer(TeamLog.TeamLogInfoSerializer()).serialize(value.team), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMemberLogInfo { + + public func deserialize(_ json: JSON) throws -> TeamMemberLogInfo { switch json { - case .dictionary(let dict): - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let email = NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) - let teamMemberId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) - let memberExternalId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) - let team = NullableSerializer(TeamLog.TeamLogInfoSerializer()).deserialize(dict["team"] ?? .null) - return TeamMemberLogInfo(accountId: accountId, displayName: displayName, email: email, teamMemberId: teamMemberId, memberExternalId: memberExternalId, team: team) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let email = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) + let teamMemberId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) + let memberExternalId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["member_external_id"] ?? .null) + let team = try NullableSerializer(TeamLog.TeamLogInfoSerializer()).deserialize(dict["team"] ?? .null) + return TeamMemberLogInfo( + accountId: accountId, + displayName: displayName, + email: email, + teamMemberId: teamMemberId, + memberExternalId: memberExternalId, + team: team + ) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberLogInfo.self, json: json) } } } /// The TeamMembershipType union - public enum TeamMembershipType: CustomStringConvertible { + public enum TeamMembershipType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case free /// An unspecified error. @@ -49142,148 +62451,192 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TeamMembershipTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMembershipTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMembershipTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMembershipType: \(error)" + } } } - open class TeamMembershipTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMembershipType) -> JSON { + + public class TeamMembershipTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMembershipType) throws -> JSON { switch value { - case .free: - var d = [String: JSON]() - d[".tag"] = .str("free") - return .dictionary(d) - case .full: - var d = [String: JSON]() - d[".tag"] = .str("full") - return .dictionary(d) - case .guest: - var d = [String: JSON]() - d[".tag"] = .str("guest") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamMembershipType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "free": - return TeamMembershipType.free - case "full": - return TeamMembershipType.full - case "guest": - return TeamMembershipType.guest - case "other": - return TeamMembershipType.other - default: - return TeamMembershipType.other - } - default: - fatalError("Failed to deserialize") + case .free: + var d = [String: JSON]() + d[".tag"] = .str("free") + return .dictionary(d) + case .full: + var d = [String: JSON]() + d[".tag"] = .str("full") + return .dictionary(d) + case .guest: + var d = [String: JSON]() + d[".tag"] = .str("guest") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamMembershipType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "free": + return TeamMembershipType.free + case "full": + return TeamMembershipType.full + case "guest": + return TeamMembershipType.guest + case "other": + return TeamMembershipType.other + default: + return TeamMembershipType.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamMembershipType.self, json: json) } } } /// Merged another team into this team. - open class TeamMergeFromDetails: CustomStringConvertible { + public class TeamMergeFromDetails: CustomStringConvertible, JSONRepresentable { /// The name of the team that was merged into this team. public let teamName: String public init(teamName: String) { stringValidator()(teamName) self.teamName = teamName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeFromDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeFromDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeFromDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeFromDetails: \(error)" + } } } - open class TeamMergeFromDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeFromDetails) -> JSON { - let output = [ - "team_name": Serialization._StringSerializer.serialize(value.teamName), + + public class TeamMergeFromDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeFromDetails) throws -> JSON { + let output = [ + "team_name": try Serialization._StringSerializer.serialize(value.teamName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeFromDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeFromDetails { switch json { - case .dictionary(let dict): - let teamName = Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) - return TeamMergeFromDetails(teamName: teamName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamName = try Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) + return TeamMergeFromDetails(teamName: teamName) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeFromDetails.self, json: json) } } } /// The TeamMergeFromType struct - open class TeamMergeFromType: CustomStringConvertible { + public class TeamMergeFromType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeFromTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeFromTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeFromTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeFromType: \(error)" + } } } - open class TeamMergeFromTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeFromType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeFromTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeFromType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeFromType { + + public func deserialize(_ json: JSON) throws -> TeamMergeFromType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeFromType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeFromType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeFromType.self, json: json) } } } /// Accepted a team merge request. - open class TeamMergeRequestAcceptedDetails: CustomStringConvertible { + public class TeamMergeRequestAcceptedDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request acceptance details. public let requestAcceptedDetails: TeamLog.TeamMergeRequestAcceptedExtraDetails public init(requestAcceptedDetails: TeamLog.TeamMergeRequestAcceptedExtraDetails) { self.requestAcceptedDetails = requestAcceptedDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAcceptedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAcceptedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAcceptedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAcceptedDetails: \(error)" + } } } - open class TeamMergeRequestAcceptedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAcceptedDetails) -> JSON { - let output = [ - "request_accepted_details": TeamLog.TeamMergeRequestAcceptedExtraDetailsSerializer().serialize(value.requestAcceptedDetails), + + public class TeamMergeRequestAcceptedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAcceptedDetails) throws -> JSON { + let output = [ + "request_accepted_details": try TeamLog.TeamMergeRequestAcceptedExtraDetailsSerializer().serialize(value.requestAcceptedDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAcceptedDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAcceptedDetails { switch json { - case .dictionary(let dict): - let requestAcceptedDetails = TeamLog.TeamMergeRequestAcceptedExtraDetailsSerializer().deserialize(dict["request_accepted_details"] ?? .null) - return TeamMergeRequestAcceptedDetails(requestAcceptedDetails: requestAcceptedDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let requestAcceptedDetails = try TeamLog.TeamMergeRequestAcceptedExtraDetailsSerializer() + .deserialize(dict["request_accepted_details"] ?? .null) + return TeamMergeRequestAcceptedDetails(requestAcceptedDetails: requestAcceptedDetails) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAcceptedDetails.self, json: json) } } } /// Team merge request acceptance details - public enum TeamMergeRequestAcceptedExtraDetails: CustomStringConvertible { + public enum TeamMergeRequestAcceptedExtraDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request accepted details shown to the primary team. case primaryTeam(TeamLog.PrimaryTeamRequestAcceptedDetails) /// Team merge request accepted details shown to the secondary team. @@ -49291,52 +62644,62 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TeamMergeRequestAcceptedExtraDetailsSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAcceptedExtraDetailsSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAcceptedExtraDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAcceptedExtraDetails: \(error)" + } } } - open class TeamMergeRequestAcceptedExtraDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAcceptedExtraDetails) -> JSON { + + public class TeamMergeRequestAcceptedExtraDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAcceptedExtraDetails) throws -> JSON { switch value { - case .primaryTeam(let arg): - var d = Serialization.getFields(TeamLog.PrimaryTeamRequestAcceptedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("primary_team") - return .dictionary(d) - case .secondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.SecondaryTeamRequestAcceptedDetailsSerializer().serialize(arg)) - d[".tag"] = .str("secondary_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamMergeRequestAcceptedExtraDetails { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "primary_team": - let v = TeamLog.PrimaryTeamRequestAcceptedDetailsSerializer().deserialize(json) - return TeamMergeRequestAcceptedExtraDetails.primaryTeam(v) - case "secondary_team": - let v = TeamLog.SecondaryTeamRequestAcceptedDetailsSerializer().deserialize(json) - return TeamMergeRequestAcceptedExtraDetails.secondaryTeam(v) - case "other": - return TeamMergeRequestAcceptedExtraDetails.other - default: - return TeamMergeRequestAcceptedExtraDetails.other - } + case .primaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.PrimaryTeamRequestAcceptedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("primary_team") + return .dictionary(d) + case .secondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryTeamRequestAcceptedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("secondary_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAcceptedExtraDetails { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "primary_team": + let v = try TeamLog.PrimaryTeamRequestAcceptedDetailsSerializer().deserialize(json) + return TeamMergeRequestAcceptedExtraDetails.primaryTeam(v) + case "secondary_team": + let v = try TeamLog.SecondaryTeamRequestAcceptedDetailsSerializer().deserialize(json) + return TeamMergeRequestAcceptedExtraDetails.secondaryTeam(v) + case "other": + return TeamMergeRequestAcceptedExtraDetails.other default: - fatalError("Failed to deserialize") + return TeamMergeRequestAcceptedExtraDetails.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAcceptedExtraDetails.self, json: json) } } } /// Accepted a team merge request. - open class TeamMergeRequestAcceptedShownToPrimaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestAcceptedShownToPrimaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -49347,64 +62710,86 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAcceptedShownToPrimaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAcceptedShownToPrimaryTeamDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class TeamMergeRequestAcceptedShownToPrimaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAcceptedShownToPrimaryTeamDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAcceptedShownToPrimaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAcceptedShownToPrimaryTeamDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return TeamMergeRequestAcceptedShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return TeamMergeRequestAcceptedShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAcceptedShownToPrimaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestAcceptedShownToPrimaryTeamType struct - open class TeamMergeRequestAcceptedShownToPrimaryTeamType: CustomStringConvertible { + public class TeamMergeRequestAcceptedShownToPrimaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAcceptedShownToPrimaryTeamType: \(error)" + } } } - open class TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAcceptedShownToPrimaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestAcceptedShownToPrimaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAcceptedShownToPrimaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAcceptedShownToPrimaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAcceptedShownToPrimaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestAcceptedShownToPrimaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestAcceptedShownToPrimaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAcceptedShownToPrimaryTeamType.self, json: json) } } } /// Accepted a team merge request. - open class TeamMergeRequestAcceptedShownToSecondaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestAcceptedShownToSecondaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The primary team name. public let primaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -49415,187 +62800,254 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAcceptedShownToSecondaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAcceptedShownToSecondaryTeamDetails) -> JSON { - let output = [ - "primary_team": Serialization._StringSerializer.serialize(value.primaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class TeamMergeRequestAcceptedShownToSecondaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAcceptedShownToSecondaryTeamDetails) throws -> JSON { + let output = [ + "primary_team": try Serialization._StringSerializer.serialize(value.primaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAcceptedShownToSecondaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAcceptedShownToSecondaryTeamDetails { switch json { - case .dictionary(let dict): - let primaryTeam = Serialization._StringSerializer.deserialize(dict["primary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return TeamMergeRequestAcceptedShownToSecondaryTeamDetails(primaryTeam: primaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let primaryTeam = try Serialization._StringSerializer.deserialize(dict["primary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return TeamMergeRequestAcceptedShownToSecondaryTeamDetails(primaryTeam: primaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAcceptedShownToSecondaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestAcceptedShownToSecondaryTeamType struct - open class TeamMergeRequestAcceptedShownToSecondaryTeamType: CustomStringConvertible { + public class TeamMergeRequestAcceptedShownToSecondaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAcceptedShownToSecondaryTeamType: \(error)" + } } } - open class TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAcceptedShownToSecondaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestAcceptedShownToSecondaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAcceptedShownToSecondaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAcceptedShownToSecondaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAcceptedShownToSecondaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestAcceptedShownToSecondaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestAcceptedShownToSecondaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAcceptedShownToSecondaryTeamType.self, json: json) } } } /// The TeamMergeRequestAcceptedType struct - open class TeamMergeRequestAcceptedType: CustomStringConvertible { + public class TeamMergeRequestAcceptedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAcceptedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAcceptedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAcceptedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAcceptedType: \(error)" + } } } - open class TeamMergeRequestAcceptedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAcceptedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestAcceptedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAcceptedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAcceptedType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAcceptedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestAcceptedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestAcceptedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAcceptedType.self, json: json) } } } /// Automatically canceled team merge request. - open class TeamMergeRequestAutoCanceledDetails: CustomStringConvertible { + public class TeamMergeRequestAutoCanceledDetails: CustomStringConvertible, JSONRepresentable { /// The cancellation reason. public let details: String? public init(details: String? = nil) { nullableValidator(stringValidator())(details) self.details = details } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAutoCanceledDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAutoCanceledDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAutoCanceledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAutoCanceledDetails: \(error)" + } } } - open class TeamMergeRequestAutoCanceledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAutoCanceledDetails) -> JSON { - let output = [ - "details": NullableSerializer(Serialization._StringSerializer).serialize(value.details), + + public class TeamMergeRequestAutoCanceledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAutoCanceledDetails) throws -> JSON { + let output = [ + "details": try NullableSerializer(Serialization._StringSerializer).serialize(value.details), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAutoCanceledDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAutoCanceledDetails { switch json { - case .dictionary(let dict): - let details = NullableSerializer(Serialization._StringSerializer).deserialize(dict["details"] ?? .null) - return TeamMergeRequestAutoCanceledDetails(details: details) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let details = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["details"] ?? .null) + return TeamMergeRequestAutoCanceledDetails(details: details) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAutoCanceledDetails.self, json: json) } } } /// The TeamMergeRequestAutoCanceledType struct - open class TeamMergeRequestAutoCanceledType: CustomStringConvertible { + public class TeamMergeRequestAutoCanceledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestAutoCanceledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestAutoCanceledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestAutoCanceledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestAutoCanceledType: \(error)" + } } } - open class TeamMergeRequestAutoCanceledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestAutoCanceledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestAutoCanceledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestAutoCanceledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestAutoCanceledType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestAutoCanceledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestAutoCanceledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestAutoCanceledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestAutoCanceledType.self, json: json) } } } /// Canceled a team merge request. - open class TeamMergeRequestCanceledDetails: CustomStringConvertible { + public class TeamMergeRequestCanceledDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request cancellation details. public let requestCanceledDetails: TeamLog.TeamMergeRequestCanceledExtraDetails public init(requestCanceledDetails: TeamLog.TeamMergeRequestCanceledExtraDetails) { self.requestCanceledDetails = requestCanceledDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestCanceledDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestCanceledDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestCanceledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestCanceledDetails: \(error)" + } } } - open class TeamMergeRequestCanceledDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestCanceledDetails) -> JSON { - let output = [ - "request_canceled_details": TeamLog.TeamMergeRequestCanceledExtraDetailsSerializer().serialize(value.requestCanceledDetails), + + public class TeamMergeRequestCanceledDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestCanceledDetails) throws -> JSON { + let output = [ + "request_canceled_details": try TeamLog.TeamMergeRequestCanceledExtraDetailsSerializer().serialize(value.requestCanceledDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestCanceledDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestCanceledDetails { switch json { - case .dictionary(let dict): - let requestCanceledDetails = TeamLog.TeamMergeRequestCanceledExtraDetailsSerializer().deserialize(dict["request_canceled_details"] ?? .null) - return TeamMergeRequestCanceledDetails(requestCanceledDetails: requestCanceledDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let requestCanceledDetails = try TeamLog.TeamMergeRequestCanceledExtraDetailsSerializer() + .deserialize(dict["request_canceled_details"] ?? .null) + return TeamMergeRequestCanceledDetails(requestCanceledDetails: requestCanceledDetails) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestCanceledDetails.self, json: json) } } } /// Team merge request cancellation details - public enum TeamMergeRequestCanceledExtraDetails: CustomStringConvertible { + public enum TeamMergeRequestCanceledExtraDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request cancellation details shown to the primary team. case primaryTeam(TeamLog.PrimaryTeamRequestCanceledDetails) /// Team merge request cancellation details shown to the secondary team. @@ -49603,52 +63055,62 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TeamMergeRequestCanceledExtraDetailsSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestCanceledExtraDetailsSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestCanceledExtraDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestCanceledExtraDetails: \(error)" + } } } - open class TeamMergeRequestCanceledExtraDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestCanceledExtraDetails) -> JSON { + + public class TeamMergeRequestCanceledExtraDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestCanceledExtraDetails) throws -> JSON { switch value { - case .primaryTeam(let arg): - var d = Serialization.getFields(TeamLog.PrimaryTeamRequestCanceledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("primary_team") - return .dictionary(d) - case .secondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.SecondaryTeamRequestCanceledDetailsSerializer().serialize(arg)) - d[".tag"] = .str("secondary_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamMergeRequestCanceledExtraDetails { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "primary_team": - let v = TeamLog.PrimaryTeamRequestCanceledDetailsSerializer().deserialize(json) - return TeamMergeRequestCanceledExtraDetails.primaryTeam(v) - case "secondary_team": - let v = TeamLog.SecondaryTeamRequestCanceledDetailsSerializer().deserialize(json) - return TeamMergeRequestCanceledExtraDetails.secondaryTeam(v) - case "other": - return TeamMergeRequestCanceledExtraDetails.other - default: - return TeamMergeRequestCanceledExtraDetails.other - } + case .primaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.PrimaryTeamRequestCanceledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("primary_team") + return .dictionary(d) + case .secondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryTeamRequestCanceledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("secondary_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestCanceledExtraDetails { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "primary_team": + let v = try TeamLog.PrimaryTeamRequestCanceledDetailsSerializer().deserialize(json) + return TeamMergeRequestCanceledExtraDetails.primaryTeam(v) + case "secondary_team": + let v = try TeamLog.SecondaryTeamRequestCanceledDetailsSerializer().deserialize(json) + return TeamMergeRequestCanceledExtraDetails.secondaryTeam(v) + case "other": + return TeamMergeRequestCanceledExtraDetails.other default: - fatalError("Failed to deserialize") + return TeamMergeRequestCanceledExtraDetails.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestCanceledExtraDetails.self, json: json) } } } /// Canceled a team merge request. - open class TeamMergeRequestCanceledShownToPrimaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestCanceledShownToPrimaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -49659,64 +63121,86 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestCanceledShownToPrimaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestCanceledShownToPrimaryTeamDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class TeamMergeRequestCanceledShownToPrimaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestCanceledShownToPrimaryTeamDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestCanceledShownToPrimaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestCanceledShownToPrimaryTeamDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return TeamMergeRequestCanceledShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return TeamMergeRequestCanceledShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestCanceledShownToPrimaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestCanceledShownToPrimaryTeamType struct - open class TeamMergeRequestCanceledShownToPrimaryTeamType: CustomStringConvertible { + public class TeamMergeRequestCanceledShownToPrimaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestCanceledShownToPrimaryTeamType: \(error)" + } } } - open class TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestCanceledShownToPrimaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestCanceledShownToPrimaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestCanceledShownToPrimaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestCanceledShownToPrimaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestCanceledShownToPrimaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestCanceledShownToPrimaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestCanceledShownToPrimaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestCanceledShownToPrimaryTeamType.self, json: json) } } } /// Canceled a team merge request. - open class TeamMergeRequestCanceledShownToSecondaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestCanceledShownToSecondaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The email of the primary team admin that the request was sent to. public let sentTo: String /// The name of the secondary team admin who sent the request originally. @@ -49727,125 +63211,170 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestCanceledShownToSecondaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestCanceledShownToSecondaryTeamDetails) -> JSON { - let output = [ - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class TeamMergeRequestCanceledShownToSecondaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestCanceledShownToSecondaryTeamDetails) throws -> JSON { + let output = [ + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestCanceledShownToSecondaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestCanceledShownToSecondaryTeamDetails { switch json { - case .dictionary(let dict): - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return TeamMergeRequestCanceledShownToSecondaryTeamDetails(sentTo: sentTo, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return TeamMergeRequestCanceledShownToSecondaryTeamDetails(sentTo: sentTo, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestCanceledShownToSecondaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestCanceledShownToSecondaryTeamType struct - open class TeamMergeRequestCanceledShownToSecondaryTeamType: CustomStringConvertible { + public class TeamMergeRequestCanceledShownToSecondaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestCanceledShownToSecondaryTeamType: \(error)" + } } } - open class TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestCanceledShownToSecondaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestCanceledShownToSecondaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestCanceledShownToSecondaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestCanceledShownToSecondaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestCanceledShownToSecondaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestCanceledShownToSecondaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestCanceledShownToSecondaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestCanceledShownToSecondaryTeamType.self, json: json) } } } /// The TeamMergeRequestCanceledType struct - open class TeamMergeRequestCanceledType: CustomStringConvertible { + public class TeamMergeRequestCanceledType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestCanceledTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestCanceledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestCanceledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestCanceledType: \(error)" + } } } - open class TeamMergeRequestCanceledTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestCanceledType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestCanceledTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestCanceledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestCanceledType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestCanceledType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestCanceledType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestCanceledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestCanceledType.self, json: json) } } } /// Team merge request expired. - open class TeamMergeRequestExpiredDetails: CustomStringConvertible { + public class TeamMergeRequestExpiredDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request expiration details. public let requestExpiredDetails: TeamLog.TeamMergeRequestExpiredExtraDetails public init(requestExpiredDetails: TeamLog.TeamMergeRequestExpiredExtraDetails) { self.requestExpiredDetails = requestExpiredDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestExpiredDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestExpiredDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestExpiredDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestExpiredDetails: \(error)" + } } } - open class TeamMergeRequestExpiredDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestExpiredDetails) -> JSON { - let output = [ - "request_expired_details": TeamLog.TeamMergeRequestExpiredExtraDetailsSerializer().serialize(value.requestExpiredDetails), + + public class TeamMergeRequestExpiredDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestExpiredDetails) throws -> JSON { + let output = [ + "request_expired_details": try TeamLog.TeamMergeRequestExpiredExtraDetailsSerializer().serialize(value.requestExpiredDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestExpiredDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestExpiredDetails { switch json { - case .dictionary(let dict): - let requestExpiredDetails = TeamLog.TeamMergeRequestExpiredExtraDetailsSerializer().deserialize(dict["request_expired_details"] ?? .null) - return TeamMergeRequestExpiredDetails(requestExpiredDetails: requestExpiredDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let requestExpiredDetails = try TeamLog.TeamMergeRequestExpiredExtraDetailsSerializer() + .deserialize(dict["request_expired_details"] ?? .null) + return TeamMergeRequestExpiredDetails(requestExpiredDetails: requestExpiredDetails) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestExpiredDetails.self, json: json) } } } /// Team merge request expiration details - public enum TeamMergeRequestExpiredExtraDetails: CustomStringConvertible { + public enum TeamMergeRequestExpiredExtraDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request canceled details shown to the primary team. case primaryTeam(TeamLog.PrimaryTeamRequestExpiredDetails) /// Team merge request canceled details shown to the secondary team. @@ -49853,52 +63382,62 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TeamMergeRequestExpiredExtraDetailsSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestExpiredExtraDetailsSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestExpiredExtraDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestExpiredExtraDetails: \(error)" + } } } - open class TeamMergeRequestExpiredExtraDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestExpiredExtraDetails) -> JSON { + + public class TeamMergeRequestExpiredExtraDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestExpiredExtraDetails) throws -> JSON { switch value { - case .primaryTeam(let arg): - var d = Serialization.getFields(TeamLog.PrimaryTeamRequestExpiredDetailsSerializer().serialize(arg)) - d[".tag"] = .str("primary_team") - return .dictionary(d) - case .secondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.SecondaryTeamRequestExpiredDetailsSerializer().serialize(arg)) - d[".tag"] = .str("secondary_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamMergeRequestExpiredExtraDetails { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "primary_team": - let v = TeamLog.PrimaryTeamRequestExpiredDetailsSerializer().deserialize(json) - return TeamMergeRequestExpiredExtraDetails.primaryTeam(v) - case "secondary_team": - let v = TeamLog.SecondaryTeamRequestExpiredDetailsSerializer().deserialize(json) - return TeamMergeRequestExpiredExtraDetails.secondaryTeam(v) - case "other": - return TeamMergeRequestExpiredExtraDetails.other - default: - return TeamMergeRequestExpiredExtraDetails.other - } + case .primaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.PrimaryTeamRequestExpiredDetailsSerializer().serialize(arg)) + d[".tag"] = .str("primary_team") + return .dictionary(d) + case .secondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryTeamRequestExpiredDetailsSerializer().serialize(arg)) + d[".tag"] = .str("secondary_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestExpiredExtraDetails { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "primary_team": + let v = try TeamLog.PrimaryTeamRequestExpiredDetailsSerializer().deserialize(json) + return TeamMergeRequestExpiredExtraDetails.primaryTeam(v) + case "secondary_team": + let v = try TeamLog.SecondaryTeamRequestExpiredDetailsSerializer().deserialize(json) + return TeamMergeRequestExpiredExtraDetails.secondaryTeam(v) + case "other": + return TeamMergeRequestExpiredExtraDetails.other default: - fatalError("Failed to deserialize") + return TeamMergeRequestExpiredExtraDetails.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestExpiredExtraDetails.self, json: json) } } } /// Team merge request expired. - open class TeamMergeRequestExpiredShownToPrimaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestExpiredShownToPrimaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -49909,157 +63448,212 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestExpiredShownToPrimaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestExpiredShownToPrimaryTeamDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class TeamMergeRequestExpiredShownToPrimaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestExpiredShownToPrimaryTeamDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestExpiredShownToPrimaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestExpiredShownToPrimaryTeamDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return TeamMergeRequestExpiredShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return TeamMergeRequestExpiredShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestExpiredShownToPrimaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestExpiredShownToPrimaryTeamType struct - open class TeamMergeRequestExpiredShownToPrimaryTeamType: CustomStringConvertible { + public class TeamMergeRequestExpiredShownToPrimaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestExpiredShownToPrimaryTeamType: \(error)" + } } } - open class TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestExpiredShownToPrimaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestExpiredShownToPrimaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestExpiredShownToPrimaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestExpiredShownToPrimaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestExpiredShownToPrimaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestExpiredShownToPrimaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestExpiredShownToPrimaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestExpiredShownToPrimaryTeamType.self, json: json) } } } /// Team merge request expired. - open class TeamMergeRequestExpiredShownToSecondaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestExpiredShownToSecondaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The email of the primary team admin the request was sent to. public let sentTo: String public init(sentTo: String) { stringValidator()(sentTo) self.sentTo = sentTo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestExpiredShownToSecondaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestExpiredShownToSecondaryTeamDetails) -> JSON { - let output = [ - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class TeamMergeRequestExpiredShownToSecondaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestExpiredShownToSecondaryTeamDetails) throws -> JSON { + let output = [ + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestExpiredShownToSecondaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestExpiredShownToSecondaryTeamDetails { switch json { - case .dictionary(let dict): - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return TeamMergeRequestExpiredShownToSecondaryTeamDetails(sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return TeamMergeRequestExpiredShownToSecondaryTeamDetails(sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestExpiredShownToSecondaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestExpiredShownToSecondaryTeamType struct - open class TeamMergeRequestExpiredShownToSecondaryTeamType: CustomStringConvertible { + public class TeamMergeRequestExpiredShownToSecondaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestExpiredShownToSecondaryTeamType: \(error)" + } } } - open class TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestExpiredShownToSecondaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestExpiredShownToSecondaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestExpiredShownToSecondaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestExpiredShownToSecondaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestExpiredShownToSecondaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestExpiredShownToSecondaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestExpiredShownToSecondaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestExpiredShownToSecondaryTeamType.self, json: json) } } } /// The TeamMergeRequestExpiredType struct - open class TeamMergeRequestExpiredType: CustomStringConvertible { + public class TeamMergeRequestExpiredType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestExpiredTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestExpiredTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestExpiredTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestExpiredType: \(error)" + } } } - open class TeamMergeRequestExpiredTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestExpiredType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestExpiredTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestExpiredType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestExpiredType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestExpiredType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestExpiredType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestExpiredType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestExpiredType.self, json: json) } } } /// Rejected a team merge request. - open class TeamMergeRequestRejectedShownToPrimaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestRejectedShownToPrimaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the secondary team admin who sent the request originally. @@ -50070,156 +63664,212 @@ open class TeamLog { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestRejectedShownToPrimaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestRejectedShownToPrimaryTeamDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class TeamMergeRequestRejectedShownToPrimaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestRejectedShownToPrimaryTeamDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestRejectedShownToPrimaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestRejectedShownToPrimaryTeamDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return TeamMergeRequestRejectedShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return TeamMergeRequestRejectedShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestRejectedShownToPrimaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestRejectedShownToPrimaryTeamType struct - open class TeamMergeRequestRejectedShownToPrimaryTeamType: CustomStringConvertible { + public class TeamMergeRequestRejectedShownToPrimaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestRejectedShownToPrimaryTeamType: \(error)" + } } } - open class TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestRejectedShownToPrimaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestRejectedShownToPrimaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestRejectedShownToPrimaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestRejectedShownToPrimaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestRejectedShownToPrimaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestRejectedShownToPrimaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestRejectedShownToPrimaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestRejectedShownToPrimaryTeamType.self, json: json) } } } /// Rejected a team merge request. - open class TeamMergeRequestRejectedShownToSecondaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestRejectedShownToSecondaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The name of the secondary team admin who sent the request originally. public let sentBy: String public init(sentBy: String) { stringValidator()(sentBy) self.sentBy = sentBy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestRejectedShownToSecondaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestRejectedShownToSecondaryTeamDetails) -> JSON { - let output = [ - "sent_by": Serialization._StringSerializer.serialize(value.sentBy), + + public class TeamMergeRequestRejectedShownToSecondaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestRejectedShownToSecondaryTeamDetails) throws -> JSON { + let output = [ + "sent_by": try Serialization._StringSerializer.serialize(value.sentBy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestRejectedShownToSecondaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestRejectedShownToSecondaryTeamDetails { switch json { - case .dictionary(let dict): - let sentBy = Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) - return TeamMergeRequestRejectedShownToSecondaryTeamDetails(sentBy: sentBy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sentBy = try Serialization._StringSerializer.deserialize(dict["sent_by"] ?? .null) + return TeamMergeRequestRejectedShownToSecondaryTeamDetails(sentBy: sentBy) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestRejectedShownToSecondaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestRejectedShownToSecondaryTeamType struct - open class TeamMergeRequestRejectedShownToSecondaryTeamType: CustomStringConvertible { + public class TeamMergeRequestRejectedShownToSecondaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestRejectedShownToSecondaryTeamType: \(error)" + } } } - open class TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestRejectedShownToSecondaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestRejectedShownToSecondaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestRejectedShownToSecondaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestRejectedShownToSecondaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestRejectedShownToSecondaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestRejectedShownToSecondaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestRejectedShownToSecondaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestRejectedShownToSecondaryTeamType.self, json: json) } } } /// Sent a team merge request reminder. - open class TeamMergeRequestReminderDetails: CustomStringConvertible { + public class TeamMergeRequestReminderDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request reminder details. public let requestReminderDetails: TeamLog.TeamMergeRequestReminderExtraDetails public init(requestReminderDetails: TeamLog.TeamMergeRequestReminderExtraDetails) { self.requestReminderDetails = requestReminderDetails } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestReminderDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestReminderDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestReminderDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestReminderDetails: \(error)" + } } } - open class TeamMergeRequestReminderDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestReminderDetails) -> JSON { - let output = [ - "request_reminder_details": TeamLog.TeamMergeRequestReminderExtraDetailsSerializer().serialize(value.requestReminderDetails), + + public class TeamMergeRequestReminderDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestReminderDetails) throws -> JSON { + let output = [ + "request_reminder_details": try TeamLog.TeamMergeRequestReminderExtraDetailsSerializer().serialize(value.requestReminderDetails), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestReminderDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestReminderDetails { switch json { - case .dictionary(let dict): - let requestReminderDetails = TeamLog.TeamMergeRequestReminderExtraDetailsSerializer().deserialize(dict["request_reminder_details"] ?? .null) - return TeamMergeRequestReminderDetails(requestReminderDetails: requestReminderDetails) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let requestReminderDetails = try TeamLog.TeamMergeRequestReminderExtraDetailsSerializer() + .deserialize(dict["request_reminder_details"] ?? .null) + return TeamMergeRequestReminderDetails(requestReminderDetails: requestReminderDetails) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestReminderDetails.self, json: json) } } } /// Team merge request reminder details - public enum TeamMergeRequestReminderExtraDetails: CustomStringConvertible { + public enum TeamMergeRequestReminderExtraDetails: CustomStringConvertible, JSONRepresentable { /// Team merge request reminder details shown to the primary team. case primaryTeam(TeamLog.PrimaryTeamRequestReminderDetails) /// Team merge request reminder details shown to the secondary team. @@ -50227,52 +63877,62 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TeamMergeRequestReminderExtraDetailsSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestReminderExtraDetailsSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestReminderExtraDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestReminderExtraDetails: \(error)" + } } } - open class TeamMergeRequestReminderExtraDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestReminderExtraDetails) -> JSON { + + public class TeamMergeRequestReminderExtraDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestReminderExtraDetails) throws -> JSON { switch value { - case .primaryTeam(let arg): - var d = Serialization.getFields(TeamLog.PrimaryTeamRequestReminderDetailsSerializer().serialize(arg)) - d[".tag"] = .str("primary_team") - return .dictionary(d) - case .secondaryTeam(let arg): - var d = Serialization.getFields(TeamLog.SecondaryTeamRequestReminderDetailsSerializer().serialize(arg)) - d[".tag"] = .str("secondary_team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamMergeRequestReminderExtraDetails { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "primary_team": - let v = TeamLog.PrimaryTeamRequestReminderDetailsSerializer().deserialize(json) - return TeamMergeRequestReminderExtraDetails.primaryTeam(v) - case "secondary_team": - let v = TeamLog.SecondaryTeamRequestReminderDetailsSerializer().deserialize(json) - return TeamMergeRequestReminderExtraDetails.secondaryTeam(v) - case "other": - return TeamMergeRequestReminderExtraDetails.other - default: - return TeamMergeRequestReminderExtraDetails.other - } + case .primaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.PrimaryTeamRequestReminderDetailsSerializer().serialize(arg)) + d[".tag"] = .str("primary_team") + return .dictionary(d) + case .secondaryTeam(let arg): + var d = try Serialization.getFields(TeamLog.SecondaryTeamRequestReminderDetailsSerializer().serialize(arg)) + d[".tag"] = .str("secondary_team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestReminderExtraDetails { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "primary_team": + let v = try TeamLog.PrimaryTeamRequestReminderDetailsSerializer().deserialize(json) + return TeamMergeRequestReminderExtraDetails.primaryTeam(v) + case "secondary_team": + let v = try TeamLog.SecondaryTeamRequestReminderDetailsSerializer().deserialize(json) + return TeamMergeRequestReminderExtraDetails.secondaryTeam(v) + case "other": + return TeamMergeRequestReminderExtraDetails.other default: - fatalError("Failed to deserialize") + return TeamMergeRequestReminderExtraDetails.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestReminderExtraDetails.self, json: json) } } } /// Sent a team merge request reminder. - open class TeamMergeRequestReminderShownToPrimaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestReminderShownToPrimaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the primary team admin the request was sent to. @@ -50283,219 +63943,296 @@ open class TeamLog { stringValidator()(sentTo) self.sentTo = sentTo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestReminderShownToPrimaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestReminderShownToPrimaryTeamDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class TeamMergeRequestReminderShownToPrimaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestReminderShownToPrimaryTeamDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestReminderShownToPrimaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestReminderShownToPrimaryTeamDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return TeamMergeRequestReminderShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return TeamMergeRequestReminderShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestReminderShownToPrimaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestReminderShownToPrimaryTeamType struct - open class TeamMergeRequestReminderShownToPrimaryTeamType: CustomStringConvertible { + public class TeamMergeRequestReminderShownToPrimaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestReminderShownToPrimaryTeamType: \(error)" + } } } - open class TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestReminderShownToPrimaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestReminderShownToPrimaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestReminderShownToPrimaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestReminderShownToPrimaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestReminderShownToPrimaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestReminderShownToPrimaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestReminderShownToPrimaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestReminderShownToPrimaryTeamType.self, json: json) } } } /// Sent a team merge request reminder. - open class TeamMergeRequestReminderShownToSecondaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestReminderShownToSecondaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The email of the primary team admin the request was sent to. public let sentTo: String public init(sentTo: String) { stringValidator()(sentTo) self.sentTo = sentTo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestReminderShownToSecondaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestReminderShownToSecondaryTeamDetails) -> JSON { - let output = [ - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class TeamMergeRequestReminderShownToSecondaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestReminderShownToSecondaryTeamDetails) throws -> JSON { + let output = [ + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestReminderShownToSecondaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestReminderShownToSecondaryTeamDetails { switch json { - case .dictionary(let dict): - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return TeamMergeRequestReminderShownToSecondaryTeamDetails(sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return TeamMergeRequestReminderShownToSecondaryTeamDetails(sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestReminderShownToSecondaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestReminderShownToSecondaryTeamType struct - open class TeamMergeRequestReminderShownToSecondaryTeamType: CustomStringConvertible { + public class TeamMergeRequestReminderShownToSecondaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestReminderShownToSecondaryTeamType: \(error)" + } } } - open class TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestReminderShownToSecondaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestReminderShownToSecondaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestReminderShownToSecondaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestReminderShownToSecondaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestReminderShownToSecondaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestReminderShownToSecondaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestReminderShownToSecondaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestReminderShownToSecondaryTeamType.self, json: json) } } } /// The TeamMergeRequestReminderType struct - open class TeamMergeRequestReminderType: CustomStringConvertible { + public class TeamMergeRequestReminderType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestReminderTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestReminderTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestReminderTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestReminderType: \(error)" + } } } - open class TeamMergeRequestReminderTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestReminderType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestReminderTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestReminderType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestReminderType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestReminderType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestReminderType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestReminderType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestReminderType.self, json: json) } } } /// Canceled the team merge. - open class TeamMergeRequestRevokedDetails: CustomStringConvertible { + public class TeamMergeRequestRevokedDetails: CustomStringConvertible, JSONRepresentable { /// The name of the other team. public let team: String public init(team: String) { stringValidator()(team) self.team = team } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestRevokedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestRevokedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestRevokedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestRevokedDetails: \(error)" + } } } - open class TeamMergeRequestRevokedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestRevokedDetails) -> JSON { - let output = [ - "team": Serialization._StringSerializer.serialize(value.team), + + public class TeamMergeRequestRevokedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestRevokedDetails) throws -> JSON { + let output = [ + "team": try Serialization._StringSerializer.serialize(value.team), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestRevokedDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestRevokedDetails { switch json { - case .dictionary(let dict): - let team = Serialization._StringSerializer.deserialize(dict["team"] ?? .null) - return TeamMergeRequestRevokedDetails(team: team) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let team = try Serialization._StringSerializer.deserialize(dict["team"] ?? .null) + return TeamMergeRequestRevokedDetails(team: team) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestRevokedDetails.self, json: json) } } } /// The TeamMergeRequestRevokedType struct - open class TeamMergeRequestRevokedType: CustomStringConvertible { + public class TeamMergeRequestRevokedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestRevokedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestRevokedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestRevokedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestRevokedType: \(error)" + } } } - open class TeamMergeRequestRevokedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestRevokedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestRevokedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestRevokedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestRevokedType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestRevokedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestRevokedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestRevokedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestRevokedType.self, json: json) } } } /// Requested to merge their Dropbox team into yours. - open class TeamMergeRequestSentShownToPrimaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestSentShownToPrimaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The secondary team name. public let secondaryTeam: String /// The name of the primary team admin the request was sent to. @@ -50506,188 +64243,254 @@ open class TeamLog { stringValidator()(sentTo) self.sentTo = sentTo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestSentShownToPrimaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestSentShownToPrimaryTeamDetails) -> JSON { - let output = [ - "secondary_team": Serialization._StringSerializer.serialize(value.secondaryTeam), - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class TeamMergeRequestSentShownToPrimaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestSentShownToPrimaryTeamDetails) throws -> JSON { + let output = [ + "secondary_team": try Serialization._StringSerializer.serialize(value.secondaryTeam), + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestSentShownToPrimaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestSentShownToPrimaryTeamDetails { switch json { - case .dictionary(let dict): - let secondaryTeam = Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return TeamMergeRequestSentShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let secondaryTeam = try Serialization._StringSerializer.deserialize(dict["secondary_team"] ?? .null) + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return TeamMergeRequestSentShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestSentShownToPrimaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestSentShownToPrimaryTeamType struct - open class TeamMergeRequestSentShownToPrimaryTeamType: CustomStringConvertible { + public class TeamMergeRequestSentShownToPrimaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestSentShownToPrimaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestSentShownToPrimaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestSentShownToPrimaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestSentShownToPrimaryTeamType: \(error)" + } } } - open class TeamMergeRequestSentShownToPrimaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestSentShownToPrimaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestSentShownToPrimaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestSentShownToPrimaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestSentShownToPrimaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestSentShownToPrimaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestSentShownToPrimaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestSentShownToPrimaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestSentShownToPrimaryTeamType.self, json: json) } } } /// Requested to merge your team into another Dropbox team. - open class TeamMergeRequestSentShownToSecondaryTeamDetails: CustomStringConvertible { + public class TeamMergeRequestSentShownToSecondaryTeamDetails: CustomStringConvertible, JSONRepresentable { /// The email of the primary team admin the request was sent to. public let sentTo: String public init(sentTo: String) { stringValidator()(sentTo) self.sentTo = sentTo } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestSentShownToSecondaryTeamDetails: \(error)" + } } } - open class TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestSentShownToSecondaryTeamDetails) -> JSON { - let output = [ - "sent_to": Serialization._StringSerializer.serialize(value.sentTo), + + public class TeamMergeRequestSentShownToSecondaryTeamDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestSentShownToSecondaryTeamDetails) throws -> JSON { + let output = [ + "sent_to": try Serialization._StringSerializer.serialize(value.sentTo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestSentShownToSecondaryTeamDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestSentShownToSecondaryTeamDetails { switch json { - case .dictionary(let dict): - let sentTo = Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) - return TeamMergeRequestSentShownToSecondaryTeamDetails(sentTo: sentTo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sentTo = try Serialization._StringSerializer.deserialize(dict["sent_to"] ?? .null) + return TeamMergeRequestSentShownToSecondaryTeamDetails(sentTo: sentTo) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestSentShownToSecondaryTeamDetails.self, json: json) } } } /// The TeamMergeRequestSentShownToSecondaryTeamType struct - open class TeamMergeRequestSentShownToSecondaryTeamType: CustomStringConvertible { + public class TeamMergeRequestSentShownToSecondaryTeamType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeRequestSentShownToSecondaryTeamTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeRequestSentShownToSecondaryTeamTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeRequestSentShownToSecondaryTeamTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeRequestSentShownToSecondaryTeamType: \(error)" + } } } - open class TeamMergeRequestSentShownToSecondaryTeamTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeRequestSentShownToSecondaryTeamType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeRequestSentShownToSecondaryTeamTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeRequestSentShownToSecondaryTeamType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeRequestSentShownToSecondaryTeamType { + + public func deserialize(_ json: JSON) throws -> TeamMergeRequestSentShownToSecondaryTeamType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeRequestSentShownToSecondaryTeamType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeRequestSentShownToSecondaryTeamType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeRequestSentShownToSecondaryTeamType.self, json: json) } } } /// Merged this team into another team. - open class TeamMergeToDetails: CustomStringConvertible { + public class TeamMergeToDetails: CustomStringConvertible, JSONRepresentable { /// The name of the team that this team was merged into. public let teamName: String public init(teamName: String) { stringValidator()(teamName) self.teamName = teamName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeToDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeToDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeToDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeToDetails: \(error)" + } } } - open class TeamMergeToDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeToDetails) -> JSON { - let output = [ - "team_name": Serialization._StringSerializer.serialize(value.teamName), + + public class TeamMergeToDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeToDetails) throws -> JSON { + let output = [ + "team_name": try Serialization._StringSerializer.serialize(value.teamName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeToDetails { + + public func deserialize(_ json: JSON) throws -> TeamMergeToDetails { switch json { - case .dictionary(let dict): - let teamName = Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) - return TeamMergeToDetails(teamName: teamName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamName = try Serialization._StringSerializer.deserialize(dict["team_name"] ?? .null) + return TeamMergeToDetails(teamName: teamName) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeToDetails.self, json: json) } } } /// The TeamMergeToType struct - open class TeamMergeToType: CustomStringConvertible { + public class TeamMergeToType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMergeToTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMergeToTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMergeToTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMergeToType: \(error)" + } } } - open class TeamMergeToTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMergeToType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamMergeToTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMergeToType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMergeToType { + + public func deserialize(_ json: JSON) throws -> TeamMergeToType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamMergeToType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamMergeToType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamMergeToType.self, json: json) } } } /// Team name details - open class TeamName: CustomStringConvertible { + public class TeamName: CustomStringConvertible, JSONRepresentable { /// Team's display name. public let teamDisplayName: String /// Team's legal name. @@ -50698,198 +64501,266 @@ open class TeamLog { stringValidator()(teamLegalName) self.teamLegalName = teamLegalName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamNameSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamNameSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamNameSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamName: \(error)" + } } } - open class TeamNameSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamName) -> JSON { - let output = [ - "team_display_name": Serialization._StringSerializer.serialize(value.teamDisplayName), - "team_legal_name": Serialization._StringSerializer.serialize(value.teamLegalName), + + public class TeamNameSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamName) throws -> JSON { + let output = [ + "team_display_name": try Serialization._StringSerializer.serialize(value.teamDisplayName), + "team_legal_name": try Serialization._StringSerializer.serialize(value.teamLegalName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamName { + + public func deserialize(_ json: JSON) throws -> TeamName { switch json { - case .dictionary(let dict): - let teamDisplayName = Serialization._StringSerializer.deserialize(dict["team_display_name"] ?? .null) - let teamLegalName = Serialization._StringSerializer.deserialize(dict["team_legal_name"] ?? .null) - return TeamName(teamDisplayName: teamDisplayName, teamLegalName: teamLegalName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let teamDisplayName = try Serialization._StringSerializer.deserialize(dict["team_display_name"] ?? .null) + let teamLegalName = try Serialization._StringSerializer.deserialize(dict["team_legal_name"] ?? .null) + return TeamName(teamDisplayName: teamDisplayName, teamLegalName: teamLegalName) + default: + throw JSONSerializerError.deserializeError(type: TeamName.self, json: json) } } } /// Added team background to display on shared link headers. - open class TeamProfileAddBackgroundDetails: CustomStringConvertible { - public init() { + public class TeamProfileAddBackgroundDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamProfileAddBackgroundDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileAddBackgroundDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileAddBackgroundDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileAddBackgroundDetails: \(error)" + } } } - open class TeamProfileAddBackgroundDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileAddBackgroundDetails) -> JSON { + + public class TeamProfileAddBackgroundDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileAddBackgroundDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileAddBackgroundDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileAddBackgroundDetails { switch json { - case .dictionary(_): - return TeamProfileAddBackgroundDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamProfileAddBackgroundDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamProfileAddBackgroundDetails.self, json: json) } } } /// The TeamProfileAddBackgroundType struct - open class TeamProfileAddBackgroundType: CustomStringConvertible { + public class TeamProfileAddBackgroundType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileAddBackgroundTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileAddBackgroundTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileAddBackgroundTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileAddBackgroundType: \(error)" + } } } - open class TeamProfileAddBackgroundTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileAddBackgroundType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileAddBackgroundTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileAddBackgroundType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileAddBackgroundType { + + public func deserialize(_ json: JSON) throws -> TeamProfileAddBackgroundType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileAddBackgroundType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileAddBackgroundType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileAddBackgroundType.self, json: json) } } } /// Added team logo to display on shared link headers. - open class TeamProfileAddLogoDetails: CustomStringConvertible { - public init() { + public class TeamProfileAddLogoDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamProfileAddLogoDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileAddLogoDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileAddLogoDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileAddLogoDetails: \(error)" + } } } - open class TeamProfileAddLogoDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileAddLogoDetails) -> JSON { + + public class TeamProfileAddLogoDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileAddLogoDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileAddLogoDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileAddLogoDetails { switch json { - case .dictionary(_): - return TeamProfileAddLogoDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamProfileAddLogoDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamProfileAddLogoDetails.self, json: json) } } } /// The TeamProfileAddLogoType struct - open class TeamProfileAddLogoType: CustomStringConvertible { + public class TeamProfileAddLogoType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileAddLogoTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileAddLogoTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileAddLogoTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileAddLogoType: \(error)" + } } } - open class TeamProfileAddLogoTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileAddLogoType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileAddLogoTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileAddLogoType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileAddLogoType { + + public func deserialize(_ json: JSON) throws -> TeamProfileAddLogoType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileAddLogoType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileAddLogoType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileAddLogoType.self, json: json) } } } /// Changed team background displayed on shared link headers. - open class TeamProfileChangeBackgroundDetails: CustomStringConvertible { - public init() { + public class TeamProfileChangeBackgroundDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamProfileChangeBackgroundDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeBackgroundDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeBackgroundDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeBackgroundDetails: \(error)" + } } } - open class TeamProfileChangeBackgroundDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeBackgroundDetails) -> JSON { + + public class TeamProfileChangeBackgroundDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeBackgroundDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeBackgroundDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeBackgroundDetails { switch json { - case .dictionary(_): - return TeamProfileChangeBackgroundDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamProfileChangeBackgroundDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeBackgroundDetails.self, json: json) } } } /// The TeamProfileChangeBackgroundType struct - open class TeamProfileChangeBackgroundType: CustomStringConvertible { + public class TeamProfileChangeBackgroundType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeBackgroundTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileChangeBackgroundTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeBackgroundTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeBackgroundType: \(error)" + } } } - open class TeamProfileChangeBackgroundTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeBackgroundType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileChangeBackgroundTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeBackgroundType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeBackgroundType { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeBackgroundType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileChangeBackgroundType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileChangeBackgroundType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeBackgroundType.self, json: json) } } } /// Changed default language for team. - open class TeamProfileChangeDefaultLanguageDetails: CustomStringConvertible { + public class TeamProfileChangeDefaultLanguageDetails: CustomStringConvertible, JSONRepresentable { /// New team's default language. public let newValue: String /// Previous team's default language. @@ -50900,119 +64771,160 @@ open class TeamLog { stringValidator(minLength: 2)(previousValue) self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeDefaultLanguageDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileChangeDefaultLanguageDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeDefaultLanguageDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeDefaultLanguageDetails: \(error)" + } } } - open class TeamProfileChangeDefaultLanguageDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeDefaultLanguageDetails) -> JSON { - let output = [ - "new_value": Serialization._StringSerializer.serialize(value.newValue), - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), + + public class TeamProfileChangeDefaultLanguageDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeDefaultLanguageDetails) throws -> JSON { + let output = [ + "new_value": try Serialization._StringSerializer.serialize(value.newValue), + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeDefaultLanguageDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeDefaultLanguageDetails { switch json { - case .dictionary(let dict): - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - return TeamProfileChangeDefaultLanguageDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + return TeamProfileChangeDefaultLanguageDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeDefaultLanguageDetails.self, json: json) } } } /// The TeamProfileChangeDefaultLanguageType struct - open class TeamProfileChangeDefaultLanguageType: CustomStringConvertible { + public class TeamProfileChangeDefaultLanguageType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeDefaultLanguageTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileChangeDefaultLanguageTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeDefaultLanguageTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeDefaultLanguageType: \(error)" + } } } - open class TeamProfileChangeDefaultLanguageTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeDefaultLanguageType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileChangeDefaultLanguageTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeDefaultLanguageType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeDefaultLanguageType { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeDefaultLanguageType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileChangeDefaultLanguageType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileChangeDefaultLanguageType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeDefaultLanguageType.self, json: json) } } } /// Changed team logo displayed on shared link headers. - open class TeamProfileChangeLogoDetails: CustomStringConvertible { - public init() { + public class TeamProfileChangeLogoDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamProfileChangeLogoDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeLogoDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeLogoDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeLogoDetails: \(error)" + } } } - open class TeamProfileChangeLogoDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeLogoDetails) -> JSON { + + public class TeamProfileChangeLogoDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeLogoDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeLogoDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeLogoDetails { switch json { - case .dictionary(_): - return TeamProfileChangeLogoDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamProfileChangeLogoDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeLogoDetails.self, json: json) } } } /// The TeamProfileChangeLogoType struct - open class TeamProfileChangeLogoType: CustomStringConvertible { + public class TeamProfileChangeLogoType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeLogoTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileChangeLogoTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeLogoTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeLogoType: \(error)" + } } } - open class TeamProfileChangeLogoTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeLogoType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileChangeLogoTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeLogoType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeLogoType { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeLogoType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileChangeLogoType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileChangeLogoType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeLogoType.self, json: json) } } } /// Changed team name. - open class TeamProfileChangeNameDetails: CustomStringConvertible { + public class TeamProfileChangeNameDetails: CustomStringConvertible, JSONRepresentable { /// Previous teams name. Might be missing due to historical data gap. public let previousValue: TeamLog.TeamName? /// New team name. @@ -51021,174 +64933,234 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeNameDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileChangeNameDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeNameDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeNameDetails: \(error)" + } } } - open class TeamProfileChangeNameDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeNameDetails) -> JSON { - let output = [ - "new_value": TeamLog.TeamNameSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.TeamNameSerializer()).serialize(value.previousValue), + + public class TeamProfileChangeNameDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeNameDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.TeamNameSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.TeamNameSerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeNameDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeNameDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.TeamNameSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.TeamNameSerializer()).deserialize(dict["previous_value"] ?? .null) - return TeamProfileChangeNameDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.TeamNameSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.TeamNameSerializer()).deserialize(dict["previous_value"] ?? .null) + return TeamProfileChangeNameDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeNameDetails.self, json: json) } } } /// The TeamProfileChangeNameType struct - open class TeamProfileChangeNameType: CustomStringConvertible { + public class TeamProfileChangeNameType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileChangeNameTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileChangeNameTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileChangeNameTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileChangeNameType: \(error)" + } } } - open class TeamProfileChangeNameTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileChangeNameType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileChangeNameTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileChangeNameType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileChangeNameType { + + public func deserialize(_ json: JSON) throws -> TeamProfileChangeNameType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileChangeNameType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileChangeNameType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileChangeNameType.self, json: json) } } } /// Removed team background displayed on shared link headers. - open class TeamProfileRemoveBackgroundDetails: CustomStringConvertible { - public init() { + public class TeamProfileRemoveBackgroundDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamProfileRemoveBackgroundDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileRemoveBackgroundDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileRemoveBackgroundDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileRemoveBackgroundDetails: \(error)" + } } } - open class TeamProfileRemoveBackgroundDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileRemoveBackgroundDetails) -> JSON { + + public class TeamProfileRemoveBackgroundDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileRemoveBackgroundDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileRemoveBackgroundDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileRemoveBackgroundDetails { switch json { - case .dictionary(_): - return TeamProfileRemoveBackgroundDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamProfileRemoveBackgroundDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamProfileRemoveBackgroundDetails.self, json: json) } } } /// The TeamProfileRemoveBackgroundType struct - open class TeamProfileRemoveBackgroundType: CustomStringConvertible { + public class TeamProfileRemoveBackgroundType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileRemoveBackgroundTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileRemoveBackgroundTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileRemoveBackgroundTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileRemoveBackgroundType: \(error)" + } } } - open class TeamProfileRemoveBackgroundTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileRemoveBackgroundType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileRemoveBackgroundTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileRemoveBackgroundType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileRemoveBackgroundType { + + public func deserialize(_ json: JSON) throws -> TeamProfileRemoveBackgroundType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileRemoveBackgroundType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileRemoveBackgroundType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileRemoveBackgroundType.self, json: json) } } } /// Removed team logo displayed on shared link headers. - open class TeamProfileRemoveLogoDetails: CustomStringConvertible { - public init() { + public class TeamProfileRemoveLogoDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TeamProfileRemoveLogoDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileRemoveLogoDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileRemoveLogoDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileRemoveLogoDetails: \(error)" + } } } - open class TeamProfileRemoveLogoDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileRemoveLogoDetails) -> JSON { + + public class TeamProfileRemoveLogoDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileRemoveLogoDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileRemoveLogoDetails { + + public func deserialize(_ json: JSON) throws -> TeamProfileRemoveLogoDetails { switch json { - case .dictionary(_): - return TeamProfileRemoveLogoDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TeamProfileRemoveLogoDetails() + default: + throw JSONSerializerError.deserializeError(type: TeamProfileRemoveLogoDetails.self, json: json) } } } /// The TeamProfileRemoveLogoType struct - open class TeamProfileRemoveLogoType: CustomStringConvertible { + public class TeamProfileRemoveLogoType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamProfileRemoveLogoTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamProfileRemoveLogoTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamProfileRemoveLogoTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamProfileRemoveLogoType: \(error)" + } } } - open class TeamProfileRemoveLogoTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamProfileRemoveLogoType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamProfileRemoveLogoTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamProfileRemoveLogoType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamProfileRemoveLogoType { + + public func deserialize(_ json: JSON) throws -> TeamProfileRemoveLogoType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamProfileRemoveLogoType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamProfileRemoveLogoType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamProfileRemoveLogoType.self, json: json) } } } /// Policy for controlling whether team selective sync is enabled for team. - public enum TeamSelectiveSyncPolicy: CustomStringConvertible { + public enum TeamSelectiveSyncPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -51196,50 +65168,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TeamSelectiveSyncPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSelectiveSyncPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSelectiveSyncPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSelectiveSyncPolicy: \(error)" + } } } - open class TeamSelectiveSyncPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSelectiveSyncPolicy) -> JSON { + + public class TeamSelectiveSyncPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSelectiveSyncPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TeamSelectiveSyncPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return TeamSelectiveSyncPolicy.disabled - case "enabled": - return TeamSelectiveSyncPolicy.enabled - case "other": - return TeamSelectiveSyncPolicy.other - default: - return TeamSelectiveSyncPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TeamSelectiveSyncPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return TeamSelectiveSyncPolicy.disabled + case "enabled": + return TeamSelectiveSyncPolicy.enabled + case "other": + return TeamSelectiveSyncPolicy.other default: - fatalError("Failed to deserialize") + return TeamSelectiveSyncPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: TeamSelectiveSyncPolicy.self, json: json) } } } /// Enabled/disabled Team Selective Sync for team. - open class TeamSelectiveSyncPolicyChangedDetails: CustomStringConvertible { + public class TeamSelectiveSyncPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New Team Selective Sync policy. public let newValue: TeamLog.TeamSelectiveSyncPolicy /// Previous Team Selective Sync policy. @@ -51248,64 +65230,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSelectiveSyncPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSelectiveSyncPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSelectiveSyncPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSelectiveSyncPolicyChangedDetails: \(error)" + } } } - open class TeamSelectiveSyncPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSelectiveSyncPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.TeamSelectiveSyncPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.TeamSelectiveSyncPolicySerializer().serialize(value.previousValue), + + public class TeamSelectiveSyncPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSelectiveSyncPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.TeamSelectiveSyncPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.TeamSelectiveSyncPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSelectiveSyncPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> TeamSelectiveSyncPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.TeamSelectiveSyncPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.TeamSelectiveSyncPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return TeamSelectiveSyncPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.TeamSelectiveSyncPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.TeamSelectiveSyncPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return TeamSelectiveSyncPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TeamSelectiveSyncPolicyChangedDetails.self, json: json) } } } /// The TeamSelectiveSyncPolicyChangedType struct - open class TeamSelectiveSyncPolicyChangedType: CustomStringConvertible { + public class TeamSelectiveSyncPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSelectiveSyncPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSelectiveSyncPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSelectiveSyncPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSelectiveSyncPolicyChangedType: \(error)" + } } } - open class TeamSelectiveSyncPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSelectiveSyncPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamSelectiveSyncPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSelectiveSyncPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSelectiveSyncPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> TeamSelectiveSyncPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamSelectiveSyncPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamSelectiveSyncPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamSelectiveSyncPolicyChangedType.self, json: json) } } } /// Changed sync default. - open class TeamSelectiveSyncSettingsChangedDetails: CustomStringConvertible { + public class TeamSelectiveSyncSettingsChangedDetails: CustomStringConvertible, JSONRepresentable { /// Previous value. public let previousValue: Files.SyncSetting /// New value. @@ -51314,352 +65318,475 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSelectiveSyncSettingsChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSelectiveSyncSettingsChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSelectiveSyncSettingsChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSelectiveSyncSettingsChangedDetails: \(error)" + } } } - open class TeamSelectiveSyncSettingsChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSelectiveSyncSettingsChangedDetails) -> JSON { - let output = [ - "previous_value": Files.SyncSettingSerializer().serialize(value.previousValue), - "new_value": Files.SyncSettingSerializer().serialize(value.newValue), + + public class TeamSelectiveSyncSettingsChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSelectiveSyncSettingsChangedDetails) throws -> JSON { + let output = [ + "previous_value": try Files.SyncSettingSerializer().serialize(value.previousValue), + "new_value": try Files.SyncSettingSerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSelectiveSyncSettingsChangedDetails { + + public func deserialize(_ json: JSON) throws -> TeamSelectiveSyncSettingsChangedDetails { switch json { - case .dictionary(let dict): - let previousValue = Files.SyncSettingSerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = Files.SyncSettingSerializer().deserialize(dict["new_value"] ?? .null) - return TeamSelectiveSyncSettingsChangedDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Files.SyncSettingSerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try Files.SyncSettingSerializer().deserialize(dict["new_value"] ?? .null) + return TeamSelectiveSyncSettingsChangedDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: TeamSelectiveSyncSettingsChangedDetails.self, json: json) } } } /// The TeamSelectiveSyncSettingsChangedType struct - open class TeamSelectiveSyncSettingsChangedType: CustomStringConvertible { + public class TeamSelectiveSyncSettingsChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSelectiveSyncSettingsChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSelectiveSyncSettingsChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSelectiveSyncSettingsChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSelectiveSyncSettingsChangedType: \(error)" + } } } - open class TeamSelectiveSyncSettingsChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSelectiveSyncSettingsChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamSelectiveSyncSettingsChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSelectiveSyncSettingsChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSelectiveSyncSettingsChangedType { + + public func deserialize(_ json: JSON) throws -> TeamSelectiveSyncSettingsChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamSelectiveSyncSettingsChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamSelectiveSyncSettingsChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamSelectiveSyncSettingsChangedType.self, json: json) } } } /// Edited the approved list for sharing externally. - open class TeamSharingWhitelistSubjectsChangedDetails: CustomStringConvertible { + public class TeamSharingWhitelistSubjectsChangedDetails: CustomStringConvertible, JSONRepresentable { /// Domains or emails added to the approved list for sharing externally. - public let addedWhitelistSubjects: Array + public let addedWhitelistSubjects: [String] /// Domains or emails removed from the approved list for sharing externally. - public let removedWhitelistSubjects: Array - public init(addedWhitelistSubjects: Array, removedWhitelistSubjects: Array) { + public let removedWhitelistSubjects: [String] + public init(addedWhitelistSubjects: [String], removedWhitelistSubjects: [String]) { arrayValidator(itemValidator: stringValidator())(addedWhitelistSubjects) self.addedWhitelistSubjects = addedWhitelistSubjects arrayValidator(itemValidator: stringValidator())(removedWhitelistSubjects) self.removedWhitelistSubjects = removedWhitelistSubjects } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSharingWhitelistSubjectsChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSharingWhitelistSubjectsChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSharingWhitelistSubjectsChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSharingWhitelistSubjectsChangedDetails: \(error)" + } } } - open class TeamSharingWhitelistSubjectsChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSharingWhitelistSubjectsChangedDetails) -> JSON { - let output = [ - "added_whitelist_subjects": ArraySerializer(Serialization._StringSerializer).serialize(value.addedWhitelistSubjects), - "removed_whitelist_subjects": ArraySerializer(Serialization._StringSerializer).serialize(value.removedWhitelistSubjects), + + public class TeamSharingWhitelistSubjectsChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSharingWhitelistSubjectsChangedDetails) throws -> JSON { + let output = [ + "added_whitelist_subjects": try ArraySerializer(Serialization._StringSerializer).serialize(value.addedWhitelistSubjects), + "removed_whitelist_subjects": try ArraySerializer(Serialization._StringSerializer).serialize(value.removedWhitelistSubjects), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSharingWhitelistSubjectsChangedDetails { + + public func deserialize(_ json: JSON) throws -> TeamSharingWhitelistSubjectsChangedDetails { switch json { - case .dictionary(let dict): - let addedWhitelistSubjects = ArraySerializer(Serialization._StringSerializer).deserialize(dict["added_whitelist_subjects"] ?? .null) - let removedWhitelistSubjects = ArraySerializer(Serialization._StringSerializer).deserialize(dict["removed_whitelist_subjects"] ?? .null) - return TeamSharingWhitelistSubjectsChangedDetails(addedWhitelistSubjects: addedWhitelistSubjects, removedWhitelistSubjects: removedWhitelistSubjects) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let addedWhitelistSubjects = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["added_whitelist_subjects"] ?? .null) + let removedWhitelistSubjects = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["removed_whitelist_subjects"] ?? .null) + return TeamSharingWhitelistSubjectsChangedDetails( + addedWhitelistSubjects: addedWhitelistSubjects, + removedWhitelistSubjects: removedWhitelistSubjects + ) + default: + throw JSONSerializerError.deserializeError(type: TeamSharingWhitelistSubjectsChangedDetails.self, json: json) } } } /// The TeamSharingWhitelistSubjectsChangedType struct - open class TeamSharingWhitelistSubjectsChangedType: CustomStringConvertible { + public class TeamSharingWhitelistSubjectsChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSharingWhitelistSubjectsChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSharingWhitelistSubjectsChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSharingWhitelistSubjectsChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSharingWhitelistSubjectsChangedType: \(error)" + } } } - open class TeamSharingWhitelistSubjectsChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSharingWhitelistSubjectsChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TeamSharingWhitelistSubjectsChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSharingWhitelistSubjectsChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSharingWhitelistSubjectsChangedType { + + public func deserialize(_ json: JSON) throws -> TeamSharingWhitelistSubjectsChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TeamSharingWhitelistSubjectsChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamSharingWhitelistSubjectsChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamSharingWhitelistSubjectsChangedType.self, json: json) } } } /// Added backup phone for two-step verification. - open class TfaAddBackupPhoneDetails: CustomStringConvertible { - public init() { + public class TfaAddBackupPhoneDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaAddBackupPhoneDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaAddBackupPhoneDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaAddBackupPhoneDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaAddBackupPhoneDetails: \(error)" + } } } - open class TfaAddBackupPhoneDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaAddBackupPhoneDetails) -> JSON { + + public class TfaAddBackupPhoneDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaAddBackupPhoneDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaAddBackupPhoneDetails { + + public func deserialize(_ json: JSON) throws -> TfaAddBackupPhoneDetails { switch json { - case .dictionary(_): - return TfaAddBackupPhoneDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaAddBackupPhoneDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaAddBackupPhoneDetails.self, json: json) } } } /// The TfaAddBackupPhoneType struct - open class TfaAddBackupPhoneType: CustomStringConvertible { + public class TfaAddBackupPhoneType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaAddBackupPhoneTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaAddBackupPhoneTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaAddBackupPhoneTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaAddBackupPhoneType: \(error)" + } } } - open class TfaAddBackupPhoneTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaAddBackupPhoneType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaAddBackupPhoneTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaAddBackupPhoneType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaAddBackupPhoneType { + + public func deserialize(_ json: JSON) throws -> TfaAddBackupPhoneType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaAddBackupPhoneType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaAddBackupPhoneType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaAddBackupPhoneType.self, json: json) } } } /// Added members to two factor authentication exception list. - open class TfaAddExceptionDetails: CustomStringConvertible { - public init() { + public class TfaAddExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaAddExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaAddExceptionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaAddExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaAddExceptionDetails: \(error)" + } } } - open class TfaAddExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaAddExceptionDetails) -> JSON { + + public class TfaAddExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaAddExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaAddExceptionDetails { + + public func deserialize(_ json: JSON) throws -> TfaAddExceptionDetails { switch json { - case .dictionary(_): - return TfaAddExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaAddExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaAddExceptionDetails.self, json: json) } } } /// The TfaAddExceptionType struct - open class TfaAddExceptionType: CustomStringConvertible { + public class TfaAddExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaAddExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaAddExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaAddExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaAddExceptionType: \(error)" + } } } - open class TfaAddExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaAddExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaAddExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaAddExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaAddExceptionType { + + public func deserialize(_ json: JSON) throws -> TfaAddExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaAddExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaAddExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaAddExceptionType.self, json: json) } } } /// Added security key for two-step verification. - open class TfaAddSecurityKeyDetails: CustomStringConvertible { - public init() { + public class TfaAddSecurityKeyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaAddSecurityKeyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaAddSecurityKeyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaAddSecurityKeyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaAddSecurityKeyDetails: \(error)" + } } } - open class TfaAddSecurityKeyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaAddSecurityKeyDetails) -> JSON { + + public class TfaAddSecurityKeyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaAddSecurityKeyDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaAddSecurityKeyDetails { + + public func deserialize(_ json: JSON) throws -> TfaAddSecurityKeyDetails { switch json { - case .dictionary(_): - return TfaAddSecurityKeyDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaAddSecurityKeyDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaAddSecurityKeyDetails.self, json: json) } } } /// The TfaAddSecurityKeyType struct - open class TfaAddSecurityKeyType: CustomStringConvertible { + public class TfaAddSecurityKeyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaAddSecurityKeyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaAddSecurityKeyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaAddSecurityKeyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaAddSecurityKeyType: \(error)" + } } } - open class TfaAddSecurityKeyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaAddSecurityKeyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaAddSecurityKeyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaAddSecurityKeyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaAddSecurityKeyType { + + public func deserialize(_ json: JSON) throws -> TfaAddSecurityKeyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaAddSecurityKeyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaAddSecurityKeyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaAddSecurityKeyType.self, json: json) } } } /// Changed backup phone for two-step verification. - open class TfaChangeBackupPhoneDetails: CustomStringConvertible { - public init() { + public class TfaChangeBackupPhoneDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaChangeBackupPhoneDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaChangeBackupPhoneDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaChangeBackupPhoneDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaChangeBackupPhoneDetails: \(error)" + } } } - open class TfaChangeBackupPhoneDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaChangeBackupPhoneDetails) -> JSON { + + public class TfaChangeBackupPhoneDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaChangeBackupPhoneDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaChangeBackupPhoneDetails { + + public func deserialize(_ json: JSON) throws -> TfaChangeBackupPhoneDetails { switch json { - case .dictionary(_): - return TfaChangeBackupPhoneDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaChangeBackupPhoneDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaChangeBackupPhoneDetails.self, json: json) } } } /// The TfaChangeBackupPhoneType struct - open class TfaChangeBackupPhoneType: CustomStringConvertible { + public class TfaChangeBackupPhoneType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaChangeBackupPhoneTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaChangeBackupPhoneTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaChangeBackupPhoneTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaChangeBackupPhoneType: \(error)" + } } } - open class TfaChangeBackupPhoneTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaChangeBackupPhoneType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaChangeBackupPhoneTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaChangeBackupPhoneType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaChangeBackupPhoneType { + + public func deserialize(_ json: JSON) throws -> TfaChangeBackupPhoneType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaChangeBackupPhoneType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaChangeBackupPhoneType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaChangeBackupPhoneType.self, json: json) } } } /// Changed two-step verification setting for team. - open class TfaChangePolicyDetails: CustomStringConvertible { + public class TfaChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New change policy. public let newValue: TeamPolicies.TwoStepVerificationPolicy /// Previous change policy. Might be missing due to historical data gap. @@ -51668,64 +65795,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaChangePolicyDetails: \(error)" + } } } - open class TfaChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamPolicies.TwoStepVerificationPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamPolicies.TwoStepVerificationPolicySerializer()).serialize(value.previousValue), + + public class TfaChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamPolicies.TwoStepVerificationPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamPolicies.TwoStepVerificationPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> TfaChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamPolicies.TwoStepVerificationPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamPolicies.TwoStepVerificationPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return TfaChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamPolicies.TwoStepVerificationPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamPolicies.TwoStepVerificationPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return TfaChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TfaChangePolicyDetails.self, json: json) } } } /// The TfaChangePolicyType struct - open class TfaChangePolicyType: CustomStringConvertible { + public class TfaChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaChangePolicyType: \(error)" + } } } - open class TfaChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaChangePolicyType { + + public func deserialize(_ json: JSON) throws -> TfaChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaChangePolicyType.self, json: json) } } } /// Enabled/disabled/changed two-step verification setting. - open class TfaChangeStatusDetails: CustomStringConvertible { + public class TfaChangeStatusDetails: CustomStringConvertible, JSONRepresentable { /// The new two factor authentication configuration. public let newValue: TeamLog.TfaConfiguration /// The previous two factor authentication configuration. Might be missing due to historical data gap. @@ -51738,66 +65887,88 @@ open class TeamLog { self.previousValue = previousValue self.usedRescueCode = usedRescueCode } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaChangeStatusDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaChangeStatusDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaChangeStatusDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaChangeStatusDetails: \(error)" + } } } - open class TfaChangeStatusDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaChangeStatusDetails) -> JSON { - let output = [ - "new_value": TeamLog.TfaConfigurationSerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.TfaConfigurationSerializer()).serialize(value.previousValue), - "used_rescue_code": NullableSerializer(Serialization._BoolSerializer).serialize(value.usedRescueCode), + + public class TfaChangeStatusDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaChangeStatusDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.TfaConfigurationSerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.TfaConfigurationSerializer()).serialize(value.previousValue), + "used_rescue_code": try NullableSerializer(Serialization._BoolSerializer).serialize(value.usedRescueCode), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaChangeStatusDetails { + + public func deserialize(_ json: JSON) throws -> TfaChangeStatusDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.TfaConfigurationSerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.TfaConfigurationSerializer()).deserialize(dict["previous_value"] ?? .null) - let usedRescueCode = NullableSerializer(Serialization._BoolSerializer).deserialize(dict["used_rescue_code"] ?? .null) - return TfaChangeStatusDetails(newValue: newValue, previousValue: previousValue, usedRescueCode: usedRescueCode) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.TfaConfigurationSerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.TfaConfigurationSerializer()).deserialize(dict["previous_value"] ?? .null) + let usedRescueCode = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["used_rescue_code"] ?? .null) + return TfaChangeStatusDetails(newValue: newValue, previousValue: previousValue, usedRescueCode: usedRescueCode) + default: + throw JSONSerializerError.deserializeError(type: TfaChangeStatusDetails.self, json: json) } } } /// The TfaChangeStatusType struct - open class TfaChangeStatusType: CustomStringConvertible { + public class TfaChangeStatusType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaChangeStatusTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaChangeStatusTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaChangeStatusTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaChangeStatusType: \(error)" + } } } - open class TfaChangeStatusTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaChangeStatusType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaChangeStatusTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaChangeStatusType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaChangeStatusType { + + public func deserialize(_ json: JSON) throws -> TfaChangeStatusType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaChangeStatusType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaChangeStatusType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaChangeStatusType.self, json: json) } } } /// Two factor authentication configuration. Note: the enabled option is deprecated. - public enum TfaConfiguration: CustomStringConvertible { + public enum TfaConfiguration: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case authenticator /// An unspecified error. @@ -51809,282 +65980,368 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TfaConfigurationSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaConfigurationSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaConfigurationSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaConfiguration: \(error)" + } } } - open class TfaConfigurationSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaConfiguration) -> JSON { + + public class TfaConfigurationSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaConfiguration) throws -> JSON { switch value { - case .authenticator: - var d = [String: JSON]() - d[".tag"] = .str("authenticator") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .sms: - var d = [String: JSON]() - d[".tag"] = .str("sms") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TfaConfiguration { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "authenticator": - return TfaConfiguration.authenticator - case "disabled": - return TfaConfiguration.disabled - case "enabled": - return TfaConfiguration.enabled - case "sms": - return TfaConfiguration.sms - case "other": - return TfaConfiguration.other - default: - return TfaConfiguration.other - } - default: - fatalError("Failed to deserialize") + case .authenticator: + var d = [String: JSON]() + d[".tag"] = .str("authenticator") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .sms: + var d = [String: JSON]() + d[".tag"] = .str("sms") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TfaConfiguration { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "authenticator": + return TfaConfiguration.authenticator + case "disabled": + return TfaConfiguration.disabled + case "enabled": + return TfaConfiguration.enabled + case "sms": + return TfaConfiguration.sms + case "other": + return TfaConfiguration.other + default: + return TfaConfiguration.other + } + default: + throw JSONSerializerError.deserializeError(type: TfaConfiguration.self, json: json) } } } /// Removed backup phone for two-step verification. - open class TfaRemoveBackupPhoneDetails: CustomStringConvertible { - public init() { + public class TfaRemoveBackupPhoneDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaRemoveBackupPhoneDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaRemoveBackupPhoneDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaRemoveBackupPhoneDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaRemoveBackupPhoneDetails: \(error)" + } } } - open class TfaRemoveBackupPhoneDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaRemoveBackupPhoneDetails) -> JSON { + + public class TfaRemoveBackupPhoneDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaRemoveBackupPhoneDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaRemoveBackupPhoneDetails { + + public func deserialize(_ json: JSON) throws -> TfaRemoveBackupPhoneDetails { switch json { - case .dictionary(_): - return TfaRemoveBackupPhoneDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaRemoveBackupPhoneDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaRemoveBackupPhoneDetails.self, json: json) } } } /// The TfaRemoveBackupPhoneType struct - open class TfaRemoveBackupPhoneType: CustomStringConvertible { + public class TfaRemoveBackupPhoneType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaRemoveBackupPhoneTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaRemoveBackupPhoneTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaRemoveBackupPhoneTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaRemoveBackupPhoneType: \(error)" + } } } - open class TfaRemoveBackupPhoneTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaRemoveBackupPhoneType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaRemoveBackupPhoneTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaRemoveBackupPhoneType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaRemoveBackupPhoneType { + + public func deserialize(_ json: JSON) throws -> TfaRemoveBackupPhoneType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaRemoveBackupPhoneType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaRemoveBackupPhoneType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaRemoveBackupPhoneType.self, json: json) } } } /// Removed members from two factor authentication exception list. - open class TfaRemoveExceptionDetails: CustomStringConvertible { - public init() { + public class TfaRemoveExceptionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaRemoveExceptionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaRemoveExceptionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaRemoveExceptionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaRemoveExceptionDetails: \(error)" + } } } - open class TfaRemoveExceptionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaRemoveExceptionDetails) -> JSON { + + public class TfaRemoveExceptionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaRemoveExceptionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaRemoveExceptionDetails { + + public func deserialize(_ json: JSON) throws -> TfaRemoveExceptionDetails { switch json { - case .dictionary(_): - return TfaRemoveExceptionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaRemoveExceptionDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaRemoveExceptionDetails.self, json: json) } } } /// The TfaRemoveExceptionType struct - open class TfaRemoveExceptionType: CustomStringConvertible { + public class TfaRemoveExceptionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaRemoveExceptionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaRemoveExceptionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaRemoveExceptionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaRemoveExceptionType: \(error)" + } } } - open class TfaRemoveExceptionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaRemoveExceptionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaRemoveExceptionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaRemoveExceptionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaRemoveExceptionType { + + public func deserialize(_ json: JSON) throws -> TfaRemoveExceptionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaRemoveExceptionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaRemoveExceptionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaRemoveExceptionType.self, json: json) } } } /// Removed security key for two-step verification. - open class TfaRemoveSecurityKeyDetails: CustomStringConvertible { - public init() { + public class TfaRemoveSecurityKeyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaRemoveSecurityKeyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaRemoveSecurityKeyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaRemoveSecurityKeyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaRemoveSecurityKeyDetails: \(error)" + } } } - open class TfaRemoveSecurityKeyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaRemoveSecurityKeyDetails) -> JSON { + + public class TfaRemoveSecurityKeyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaRemoveSecurityKeyDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaRemoveSecurityKeyDetails { + + public func deserialize(_ json: JSON) throws -> TfaRemoveSecurityKeyDetails { switch json { - case .dictionary(_): - return TfaRemoveSecurityKeyDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaRemoveSecurityKeyDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaRemoveSecurityKeyDetails.self, json: json) } } } /// The TfaRemoveSecurityKeyType struct - open class TfaRemoveSecurityKeyType: CustomStringConvertible { + public class TfaRemoveSecurityKeyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaRemoveSecurityKeyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaRemoveSecurityKeyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaRemoveSecurityKeyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaRemoveSecurityKeyType: \(error)" + } } } - open class TfaRemoveSecurityKeyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaRemoveSecurityKeyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaRemoveSecurityKeyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaRemoveSecurityKeyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaRemoveSecurityKeyType { + + public func deserialize(_ json: JSON) throws -> TfaRemoveSecurityKeyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaRemoveSecurityKeyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaRemoveSecurityKeyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaRemoveSecurityKeyType.self, json: json) } } } /// Reset two-step verification for team member. - open class TfaResetDetails: CustomStringConvertible { - public init() { + public class TfaResetDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try TfaResetDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaResetDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaResetDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaResetDetails: \(error)" + } } } - open class TfaResetDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaResetDetails) -> JSON { + + public class TfaResetDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaResetDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaResetDetails { + + public func deserialize(_ json: JSON) throws -> TfaResetDetails { switch json { - case .dictionary(_): - return TfaResetDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return TfaResetDetails() + default: + throw JSONSerializerError.deserializeError(type: TfaResetDetails.self, json: json) } } } /// The TfaResetType struct - open class TfaResetType: CustomStringConvertible { + public class TfaResetType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TfaResetTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TfaResetTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TfaResetTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TfaResetType: \(error)" + } } } - open class TfaResetTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TfaResetType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TfaResetTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TfaResetType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TfaResetType { + + public func deserialize(_ json: JSON) throws -> TfaResetType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TfaResetType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TfaResetType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TfaResetType.self, json: json) } } } /// The TimeUnit union - public enum TimeUnit: CustomStringConvertible { + public enum TimeUnit: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case days /// An unspecified error. @@ -52104,128 +66361,157 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TimeUnitSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TimeUnitSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TimeUnitSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TimeUnit: \(error)" + } } } - open class TimeUnitSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TimeUnit) -> JSON { + + public class TimeUnitSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TimeUnit) throws -> JSON { switch value { - case .days: - var d = [String: JSON]() - d[".tag"] = .str("days") - return .dictionary(d) - case .hours: - var d = [String: JSON]() - d[".tag"] = .str("hours") - return .dictionary(d) - case .milliseconds: - var d = [String: JSON]() - d[".tag"] = .str("milliseconds") - return .dictionary(d) - case .minutes: - var d = [String: JSON]() - d[".tag"] = .str("minutes") - return .dictionary(d) - case .months: - var d = [String: JSON]() - d[".tag"] = .str("months") - return .dictionary(d) - case .seconds: - var d = [String: JSON]() - d[".tag"] = .str("seconds") - return .dictionary(d) - case .weeks: - var d = [String: JSON]() - d[".tag"] = .str("weeks") - return .dictionary(d) - case .years: - var d = [String: JSON]() - d[".tag"] = .str("years") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TimeUnit { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "days": - return TimeUnit.days - case "hours": - return TimeUnit.hours - case "milliseconds": - return TimeUnit.milliseconds - case "minutes": - return TimeUnit.minutes - case "months": - return TimeUnit.months - case "seconds": - return TimeUnit.seconds - case "weeks": - return TimeUnit.weeks - case "years": - return TimeUnit.years - case "other": - return TimeUnit.other - default: - return TimeUnit.other - } - default: - fatalError("Failed to deserialize") + case .days: + var d = [String: JSON]() + d[".tag"] = .str("days") + return .dictionary(d) + case .hours: + var d = [String: JSON]() + d[".tag"] = .str("hours") + return .dictionary(d) + case .milliseconds: + var d = [String: JSON]() + d[".tag"] = .str("milliseconds") + return .dictionary(d) + case .minutes: + var d = [String: JSON]() + d[".tag"] = .str("minutes") + return .dictionary(d) + case .months: + var d = [String: JSON]() + d[".tag"] = .str("months") + return .dictionary(d) + case .seconds: + var d = [String: JSON]() + d[".tag"] = .str("seconds") + return .dictionary(d) + case .weeks: + var d = [String: JSON]() + d[".tag"] = .str("weeks") + return .dictionary(d) + case .years: + var d = [String: JSON]() + d[".tag"] = .str("years") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TimeUnit { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "days": + return TimeUnit.days + case "hours": + return TimeUnit.hours + case "milliseconds": + return TimeUnit.milliseconds + case "minutes": + return TimeUnit.minutes + case "months": + return TimeUnit.months + case "seconds": + return TimeUnit.seconds + case "weeks": + return TimeUnit.weeks + case "years": + return TimeUnit.years + case "other": + return TimeUnit.other + default: + return TimeUnit.other + } + default: + throw JSONSerializerError.deserializeError(type: TimeUnit.self, json: json) } } } /// User that is not a member of the team but considered trusted. - open class TrustedNonTeamMemberLogInfo: TeamLog.UserLogInfo { + public class TrustedNonTeamMemberLogInfo: TeamLog.UserLogInfo { /// Indicates the type of the member of a trusted team. public let trustedNonTeamMemberType: TeamLog.TrustedNonTeamMemberType /// Details about this user's trusted team. public let team: TeamLog.TeamLogInfo? - public init(trustedNonTeamMemberType: TeamLog.TrustedNonTeamMemberType, accountId: String? = nil, displayName: String? = nil, email: String? = nil, team: TeamLog.TeamLogInfo? = nil) { + public init( + trustedNonTeamMemberType: TeamLog.TrustedNonTeamMemberType, + accountId: String? = nil, + displayName: String? = nil, + email: String? = nil, + team: TeamLog.TeamLogInfo? = nil + ) { self.trustedNonTeamMemberType = trustedNonTeamMemberType self.team = team super.init(accountId: accountId, displayName: displayName, email: email) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TrustedNonTeamMemberLogInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TrustedNonTeamMemberLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TrustedNonTeamMemberLogInfo: \(error)" + } } } - open class TrustedNonTeamMemberLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TrustedNonTeamMemberLogInfo) -> JSON { - let output = [ - "trusted_non_team_member_type": TeamLog.TrustedNonTeamMemberTypeSerializer().serialize(value.trustedNonTeamMemberType), - "account_id": NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), - "email": NullableSerializer(Serialization._StringSerializer).serialize(value.email), - "team": NullableSerializer(TeamLog.TeamLogInfoSerializer()).serialize(value.team), + + public class TrustedNonTeamMemberLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TrustedNonTeamMemberLogInfo) throws -> JSON { + let output = [ + "trusted_non_team_member_type": try TeamLog.TrustedNonTeamMemberTypeSerializer().serialize(value.trustedNonTeamMemberType), + "account_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.accountId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + "email": try NullableSerializer(Serialization._StringSerializer).serialize(value.email), + "team": try NullableSerializer(TeamLog.TeamLogInfoSerializer()).serialize(value.team), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TrustedNonTeamMemberLogInfo { + + public func deserialize(_ json: JSON) throws -> TrustedNonTeamMemberLogInfo { switch json { - case .dictionary(let dict): - let trustedNonTeamMemberType = TeamLog.TrustedNonTeamMemberTypeSerializer().deserialize(dict["trusted_non_team_member_type"] ?? .null) - let accountId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - let email = NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) - let team = NullableSerializer(TeamLog.TeamLogInfoSerializer()).deserialize(dict["team"] ?? .null) - return TrustedNonTeamMemberLogInfo(trustedNonTeamMemberType: trustedNonTeamMemberType, accountId: accountId, displayName: displayName, email: email, team: team) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let trustedNonTeamMemberType = try TeamLog.TrustedNonTeamMemberTypeSerializer().deserialize(dict["trusted_non_team_member_type"] ?? .null) + let accountId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["account_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + let email = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["email"] ?? .null) + let team = try NullableSerializer(TeamLog.TeamLogInfoSerializer()).deserialize(dict["team"] ?? .null) + return TrustedNonTeamMemberLogInfo( + trustedNonTeamMemberType: trustedNonTeamMemberType, + accountId: accountId, + displayName: displayName, + email: email, + team: team + ) + default: + throw JSONSerializerError.deserializeError(type: TrustedNonTeamMemberLogInfo.self, json: json) } } } /// The TrustedNonTeamMemberType union - public enum TrustedNonTeamMemberType: CustomStringConvertible { + public enum TrustedNonTeamMemberType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case enterpriseAdmin /// An unspecified error. @@ -52233,50 +66519,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TrustedNonTeamMemberTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TrustedNonTeamMemberTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TrustedNonTeamMemberTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TrustedNonTeamMemberType: \(error)" + } } } - open class TrustedNonTeamMemberTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TrustedNonTeamMemberType) -> JSON { + + public class TrustedNonTeamMemberTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TrustedNonTeamMemberType) throws -> JSON { switch value { - case .enterpriseAdmin: - var d = [String: JSON]() - d[".tag"] = .str("enterprise_admin") - return .dictionary(d) - case .multiInstanceAdmin: - var d = [String: JSON]() - d[".tag"] = .str("multi_instance_admin") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TrustedNonTeamMemberType { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "enterprise_admin": - return TrustedNonTeamMemberType.enterpriseAdmin - case "multi_instance_admin": - return TrustedNonTeamMemberType.multiInstanceAdmin - case "other": - return TrustedNonTeamMemberType.other - default: - return TrustedNonTeamMemberType.other - } + case .enterpriseAdmin: + var d = [String: JSON]() + d[".tag"] = .str("enterprise_admin") + return .dictionary(d) + case .multiInstanceAdmin: + var d = [String: JSON]() + d[".tag"] = .str("multi_instance_admin") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TrustedNonTeamMemberType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "enterprise_admin": + return TrustedNonTeamMemberType.enterpriseAdmin + case "multi_instance_admin": + return TrustedNonTeamMemberType.multiInstanceAdmin + case "other": + return TrustedNonTeamMemberType.other default: - fatalError("Failed to deserialize") + return TrustedNonTeamMemberType.other + } + default: + throw JSONSerializerError.deserializeError(type: TrustedNonTeamMemberType.self, json: json) } } } /// The TrustedTeamsRequestAction union - public enum TrustedTeamsRequestAction: CustomStringConvertible { + public enum TrustedTeamsRequestAction: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case accepted /// An unspecified error. @@ -52290,68 +66586,78 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TrustedTeamsRequestActionSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TrustedTeamsRequestActionSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TrustedTeamsRequestActionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TrustedTeamsRequestAction: \(error)" + } } } - open class TrustedTeamsRequestActionSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TrustedTeamsRequestAction) -> JSON { + + public class TrustedTeamsRequestActionSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TrustedTeamsRequestAction) throws -> JSON { switch value { - case .accepted: - var d = [String: JSON]() - d[".tag"] = .str("accepted") - return .dictionary(d) - case .declined: - var d = [String: JSON]() - d[".tag"] = .str("declined") - return .dictionary(d) - case .expired: - var d = [String: JSON]() - d[".tag"] = .str("expired") - return .dictionary(d) - case .invited: - var d = [String: JSON]() - d[".tag"] = .str("invited") - return .dictionary(d) - case .revoked: - var d = [String: JSON]() - d[".tag"] = .str("revoked") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TrustedTeamsRequestAction { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "accepted": - return TrustedTeamsRequestAction.accepted - case "declined": - return TrustedTeamsRequestAction.declined - case "expired": - return TrustedTeamsRequestAction.expired - case "invited": - return TrustedTeamsRequestAction.invited - case "revoked": - return TrustedTeamsRequestAction.revoked - case "other": - return TrustedTeamsRequestAction.other - default: - return TrustedTeamsRequestAction.other - } - default: - fatalError("Failed to deserialize") + case .accepted: + var d = [String: JSON]() + d[".tag"] = .str("accepted") + return .dictionary(d) + case .declined: + var d = [String: JSON]() + d[".tag"] = .str("declined") + return .dictionary(d) + case .expired: + var d = [String: JSON]() + d[".tag"] = .str("expired") + return .dictionary(d) + case .invited: + var d = [String: JSON]() + d[".tag"] = .str("invited") + return .dictionary(d) + case .revoked: + var d = [String: JSON]() + d[".tag"] = .str("revoked") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TrustedTeamsRequestAction { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "accepted": + return TrustedTeamsRequestAction.accepted + case "declined": + return TrustedTeamsRequestAction.declined + case "expired": + return TrustedTeamsRequestAction.expired + case "invited": + return TrustedTeamsRequestAction.invited + case "revoked": + return TrustedTeamsRequestAction.revoked + case "other": + return TrustedTeamsRequestAction.other + default: + return TrustedTeamsRequestAction.other + } + default: + throw JSONSerializerError.deserializeError(type: TrustedTeamsRequestAction.self, json: json) } } } /// The TrustedTeamsRequestState union - public enum TrustedTeamsRequestState: CustomStringConvertible { + public enum TrustedTeamsRequestState: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case invited /// An unspecified error. @@ -52361,56 +66667,66 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TrustedTeamsRequestStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TrustedTeamsRequestStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TrustedTeamsRequestStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TrustedTeamsRequestState: \(error)" + } } } - open class TrustedTeamsRequestStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TrustedTeamsRequestState) -> JSON { + + public class TrustedTeamsRequestStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TrustedTeamsRequestState) throws -> JSON { switch value { - case .invited: - var d = [String: JSON]() - d[".tag"] = .str("invited") - return .dictionary(d) - case .linked: - var d = [String: JSON]() - d[".tag"] = .str("linked") - return .dictionary(d) - case .unlinked: - var d = [String: JSON]() - d[".tag"] = .str("unlinked") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TrustedTeamsRequestState { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "invited": - return TrustedTeamsRequestState.invited - case "linked": - return TrustedTeamsRequestState.linked - case "unlinked": - return TrustedTeamsRequestState.unlinked - case "other": - return TrustedTeamsRequestState.other - default: - return TrustedTeamsRequestState.other - } - default: - fatalError("Failed to deserialize") + case .invited: + var d = [String: JSON]() + d[".tag"] = .str("invited") + return .dictionary(d) + case .linked: + var d = [String: JSON]() + d[".tag"] = .str("linked") + return .dictionary(d) + case .unlinked: + var d = [String: JSON]() + d[".tag"] = .str("unlinked") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TrustedTeamsRequestState { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "invited": + return TrustedTeamsRequestState.invited + case "linked": + return TrustedTeamsRequestState.linked + case "unlinked": + return TrustedTeamsRequestState.unlinked + case "other": + return TrustedTeamsRequestState.other + default: + return TrustedTeamsRequestState.other + } + default: + throw JSONSerializerError.deserializeError(type: TrustedTeamsRequestState.self, json: json) } } } /// Enabled/disabled option for members to link personal Dropbox account and team account to same computer. - open class TwoAccountChangePolicyDetails: CustomStringConvertible { + public class TwoAccountChangePolicyDetails: CustomStringConvertible, JSONRepresentable { /// New two account policy. public let newValue: TeamLog.TwoAccountPolicy /// Previous two account policy. Might be missing due to historical data gap. @@ -52419,64 +66735,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TwoAccountChangePolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try TwoAccountChangePolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TwoAccountChangePolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TwoAccountChangePolicyDetails: \(error)" + } } } - open class TwoAccountChangePolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TwoAccountChangePolicyDetails) -> JSON { - let output = [ - "new_value": TeamLog.TwoAccountPolicySerializer().serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.TwoAccountPolicySerializer()).serialize(value.previousValue), + + public class TwoAccountChangePolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TwoAccountChangePolicyDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.TwoAccountPolicySerializer().serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.TwoAccountPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TwoAccountChangePolicyDetails { + + public func deserialize(_ json: JSON) throws -> TwoAccountChangePolicyDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.TwoAccountPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.TwoAccountPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return TwoAccountChangePolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.TwoAccountPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.TwoAccountPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return TwoAccountChangePolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: TwoAccountChangePolicyDetails.self, json: json) } } } /// The TwoAccountChangePolicyType struct - open class TwoAccountChangePolicyType: CustomStringConvertible { + public class TwoAccountChangePolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TwoAccountChangePolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try TwoAccountChangePolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TwoAccountChangePolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TwoAccountChangePolicyType: \(error)" + } } } - open class TwoAccountChangePolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TwoAccountChangePolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class TwoAccountChangePolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TwoAccountChangePolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TwoAccountChangePolicyType { + + public func deserialize(_ json: JSON) throws -> TwoAccountChangePolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return TwoAccountChangePolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TwoAccountChangePolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TwoAccountChangePolicyType.self, json: json) } } } /// Policy for pairing personal account to work account - public enum TwoAccountPolicy: CustomStringConvertible { + public enum TwoAccountPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -52484,187 +66822,241 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try TwoAccountPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TwoAccountPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TwoAccountPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for TwoAccountPolicy: \(error)" + } } } - open class TwoAccountPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TwoAccountPolicy) -> JSON { + + public class TwoAccountPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TwoAccountPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TwoAccountPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return TwoAccountPolicy.disabled - case "enabled": - return TwoAccountPolicy.enabled - case "other": - return TwoAccountPolicy.other - default: - return TwoAccountPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TwoAccountPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return TwoAccountPolicy.disabled + case "enabled": + return TwoAccountPolicy.enabled + case "other": + return TwoAccountPolicy.other default: - fatalError("Failed to deserialize") + return TwoAccountPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: TwoAccountPolicy.self, json: json) } } } /// Reverted naming convention. - open class UndoNamingConventionDetails: CustomStringConvertible { - public init() { + public class UndoNamingConventionDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try UndoNamingConventionDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UndoNamingConventionDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UndoNamingConventionDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UndoNamingConventionDetails: \(error)" + } } } - open class UndoNamingConventionDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UndoNamingConventionDetails) -> JSON { + + public class UndoNamingConventionDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UndoNamingConventionDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> UndoNamingConventionDetails { + + public func deserialize(_ json: JSON) throws -> UndoNamingConventionDetails { switch json { - case .dictionary(_): - return UndoNamingConventionDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return UndoNamingConventionDetails() + default: + throw JSONSerializerError.deserializeError(type: UndoNamingConventionDetails.self, json: json) } } } /// The UndoNamingConventionType struct - open class UndoNamingConventionType: CustomStringConvertible { + public class UndoNamingConventionType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UndoNamingConventionTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try UndoNamingConventionTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UndoNamingConventionTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UndoNamingConventionType: \(error)" + } } } - open class UndoNamingConventionTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UndoNamingConventionType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class UndoNamingConventionTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UndoNamingConventionType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UndoNamingConventionType { + + public func deserialize(_ json: JSON) throws -> UndoNamingConventionType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return UndoNamingConventionType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return UndoNamingConventionType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: UndoNamingConventionType.self, json: json) } } } /// Removed multi-file organize. - open class UndoOrganizeFolderWithTidyDetails: CustomStringConvertible { - public init() { + public class UndoOrganizeFolderWithTidyDetails: CustomStringConvertible, JSONRepresentable { + func json() throws -> JSON { + try UndoOrganizeFolderWithTidyDetailsSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UndoOrganizeFolderWithTidyDetailsSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UndoOrganizeFolderWithTidyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UndoOrganizeFolderWithTidyDetails: \(error)" + } } } - open class UndoOrganizeFolderWithTidyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UndoOrganizeFolderWithTidyDetails) -> JSON { + + public class UndoOrganizeFolderWithTidyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UndoOrganizeFolderWithTidyDetails) throws -> JSON { let output = [String: JSON]() return .dictionary(output) } - open func deserialize(_ json: JSON) -> UndoOrganizeFolderWithTidyDetails { + + public func deserialize(_ json: JSON) throws -> UndoOrganizeFolderWithTidyDetails { switch json { - case .dictionary(_): - return UndoOrganizeFolderWithTidyDetails() - default: - fatalError("Type error deserializing") + case .dictionary: + return UndoOrganizeFolderWithTidyDetails() + default: + throw JSONSerializerError.deserializeError(type: UndoOrganizeFolderWithTidyDetails.self, json: json) } } } /// The UndoOrganizeFolderWithTidyType struct - open class UndoOrganizeFolderWithTidyType: CustomStringConvertible { + public class UndoOrganizeFolderWithTidyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UndoOrganizeFolderWithTidyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try UndoOrganizeFolderWithTidyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UndoOrganizeFolderWithTidyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UndoOrganizeFolderWithTidyType: \(error)" + } } } - open class UndoOrganizeFolderWithTidyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UndoOrganizeFolderWithTidyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class UndoOrganizeFolderWithTidyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UndoOrganizeFolderWithTidyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UndoOrganizeFolderWithTidyType { + + public func deserialize(_ json: JSON) throws -> UndoOrganizeFolderWithTidyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return UndoOrganizeFolderWithTidyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return UndoOrganizeFolderWithTidyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: UndoOrganizeFolderWithTidyType.self, json: json) } } } /// User linked app - open class UserLinkedAppLogInfo: TeamLog.AppLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserLinkedAppLogInfoSerializer().serialize(self)))" + public class UserLinkedAppLogInfo: TeamLog.AppLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserLinkedAppLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserLinkedAppLogInfo: \(error)" + } } } - open class UserLinkedAppLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserLinkedAppLogInfo) -> JSON { - let output = [ - "app_id": NullableSerializer(Serialization._StringSerializer).serialize(value.appId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + + public class UserLinkedAppLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserLinkedAppLogInfo) throws -> JSON { + let output = [ + "app_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.appId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserLinkedAppLogInfo { + + public func deserialize(_ json: JSON) throws -> UserLinkedAppLogInfo { switch json { - case .dictionary(let dict): - let appId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - return UserLinkedAppLogInfo(appId: appId, displayName: displayName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + return UserLinkedAppLogInfo(appId: appId, displayName: displayName) + default: + throw JSONSerializerError.deserializeError(type: UserLinkedAppLogInfo.self, json: json) } } } /// User's name logged information - open class UserNameLogInfo: CustomStringConvertible { + public class UserNameLogInfo: CustomStringConvertible, JSONRepresentable { /// Given name. public let givenName: String /// Surname. @@ -52679,186 +67071,247 @@ open class TeamLog { nullableValidator(stringValidator())(locale) self.locale = locale } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserNameLogInfoSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserNameLogInfoSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserNameLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserNameLogInfo: \(error)" + } } } - open class UserNameLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserNameLogInfo) -> JSON { - let output = [ - "given_name": Serialization._StringSerializer.serialize(value.givenName), - "surname": Serialization._StringSerializer.serialize(value.surname), - "locale": NullableSerializer(Serialization._StringSerializer).serialize(value.locale), + + public class UserNameLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserNameLogInfo) throws -> JSON { + let output = [ + "given_name": try Serialization._StringSerializer.serialize(value.givenName), + "surname": try Serialization._StringSerializer.serialize(value.surname), + "locale": try NullableSerializer(Serialization._StringSerializer).serialize(value.locale), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserNameLogInfo { + + public func deserialize(_ json: JSON) throws -> UserNameLogInfo { switch json { - case .dictionary(let dict): - let givenName = Serialization._StringSerializer.deserialize(dict["given_name"] ?? .null) - let surname = Serialization._StringSerializer.deserialize(dict["surname"] ?? .null) - let locale = NullableSerializer(Serialization._StringSerializer).deserialize(dict["locale"] ?? .null) - return UserNameLogInfo(givenName: givenName, surname: surname, locale: locale) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let givenName = try Serialization._StringSerializer.deserialize(dict["given_name"] ?? .null) + let surname = try Serialization._StringSerializer.deserialize(dict["surname"] ?? .null) + let locale = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["locale"] ?? .null) + return UserNameLogInfo(givenName: givenName, surname: surname, locale: locale) + default: + throw JSONSerializerError.deserializeError(type: UserNameLogInfo.self, json: json) } } } /// User or team linked app. Used when linked type is missing due to historical data gap. - open class UserOrTeamLinkedAppLogInfo: TeamLog.AppLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserOrTeamLinkedAppLogInfoSerializer().serialize(self)))" + public class UserOrTeamLinkedAppLogInfo: TeamLog.AppLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserOrTeamLinkedAppLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserOrTeamLinkedAppLogInfo: \(error)" + } } } - open class UserOrTeamLinkedAppLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserOrTeamLinkedAppLogInfo) -> JSON { - let output = [ - "app_id": NullableSerializer(Serialization._StringSerializer).serialize(value.appId), - "display_name": NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), + + public class UserOrTeamLinkedAppLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserOrTeamLinkedAppLogInfo) throws -> JSON { + let output = [ + "app_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.appId), + "display_name": try NullableSerializer(Serialization._StringSerializer).serialize(value.displayName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserOrTeamLinkedAppLogInfo { + + public func deserialize(_ json: JSON) throws -> UserOrTeamLinkedAppLogInfo { switch json { - case .dictionary(let dict): - let appId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) - let displayName = NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) - return UserOrTeamLinkedAppLogInfo(appId: appId, displayName: displayName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let appId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["app_id"] ?? .null) + let displayName = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["display_name"] ?? .null) + return UserOrTeamLinkedAppLogInfo(appId: appId, displayName: displayName) + default: + throw JSONSerializerError.deserializeError(type: UserOrTeamLinkedAppLogInfo.self, json: json) } } } /// Tagged a file. - open class UserTagsAddedDetails: CustomStringConvertible { + public class UserTagsAddedDetails: CustomStringConvertible, JSONRepresentable { /// values. - public let values: Array - public init(values: Array) { + public let values: [String] + public init(values: [String]) { arrayValidator(itemValidator: stringValidator())(values) self.values = values } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserTagsAddedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserTagsAddedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserTagsAddedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserTagsAddedDetails: \(error)" + } } } - open class UserTagsAddedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserTagsAddedDetails) -> JSON { - let output = [ - "values": ArraySerializer(Serialization._StringSerializer).serialize(value.values), + + public class UserTagsAddedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserTagsAddedDetails) throws -> JSON { + let output = [ + "values": try ArraySerializer(Serialization._StringSerializer).serialize(value.values), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserTagsAddedDetails { + + public func deserialize(_ json: JSON) throws -> UserTagsAddedDetails { switch json { - case .dictionary(let dict): - let values = ArraySerializer(Serialization._StringSerializer).deserialize(dict["values"] ?? .null) - return UserTagsAddedDetails(values: values) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let values = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["values"] ?? .null) + return UserTagsAddedDetails(values: values) + default: + throw JSONSerializerError.deserializeError(type: UserTagsAddedDetails.self, json: json) } } } /// The UserTagsAddedType struct - open class UserTagsAddedType: CustomStringConvertible { + public class UserTagsAddedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserTagsAddedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserTagsAddedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserTagsAddedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserTagsAddedType: \(error)" + } } } - open class UserTagsAddedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserTagsAddedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class UserTagsAddedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserTagsAddedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserTagsAddedType { + + public func deserialize(_ json: JSON) throws -> UserTagsAddedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return UserTagsAddedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return UserTagsAddedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: UserTagsAddedType.self, json: json) } } } /// Removed tags. - open class UserTagsRemovedDetails: CustomStringConvertible { + public class UserTagsRemovedDetails: CustomStringConvertible, JSONRepresentable { /// values. - public let values: Array - public init(values: Array) { + public let values: [String] + public init(values: [String]) { arrayValidator(itemValidator: stringValidator())(values) self.values = values } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserTagsRemovedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserTagsRemovedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserTagsRemovedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserTagsRemovedDetails: \(error)" + } } } - open class UserTagsRemovedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserTagsRemovedDetails) -> JSON { - let output = [ - "values": ArraySerializer(Serialization._StringSerializer).serialize(value.values), + + public class UserTagsRemovedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserTagsRemovedDetails) throws -> JSON { + let output = [ + "values": try ArraySerializer(Serialization._StringSerializer).serialize(value.values), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserTagsRemovedDetails { + + public func deserialize(_ json: JSON) throws -> UserTagsRemovedDetails { switch json { - case .dictionary(let dict): - let values = ArraySerializer(Serialization._StringSerializer).deserialize(dict["values"] ?? .null) - return UserTagsRemovedDetails(values: values) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let values = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["values"] ?? .null) + return UserTagsRemovedDetails(values: values) + default: + throw JSONSerializerError.deserializeError(type: UserTagsRemovedDetails.self, json: json) } } } /// The UserTagsRemovedType struct - open class UserTagsRemovedType: CustomStringConvertible { + public class UserTagsRemovedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserTagsRemovedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserTagsRemovedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserTagsRemovedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserTagsRemovedType: \(error)" + } } } - open class UserTagsRemovedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserTagsRemovedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class UserTagsRemovedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserTagsRemovedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserTagsRemovedType { + + public func deserialize(_ json: JSON) throws -> UserTagsRemovedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return UserTagsRemovedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return UserTagsRemovedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: UserTagsRemovedType.self, json: json) } } } /// Changed team policy for viewer info. - open class ViewerInfoPolicyChangedDetails: CustomStringConvertible { + public class ViewerInfoPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// Previous Viewer Info policy. public let previousValue: TeamLog.PassPolicy /// New Viewer Info policy. @@ -52867,64 +67320,86 @@ open class TeamLog { self.previousValue = previousValue self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ViewerInfoPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try ViewerInfoPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ViewerInfoPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ViewerInfoPolicyChangedDetails: \(error)" + } } } - open class ViewerInfoPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ViewerInfoPolicyChangedDetails) -> JSON { - let output = [ - "previous_value": TeamLog.PassPolicySerializer().serialize(value.previousValue), - "new_value": TeamLog.PassPolicySerializer().serialize(value.newValue), + + public class ViewerInfoPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ViewerInfoPolicyChangedDetails) throws -> JSON { + let output = [ + "previous_value": try TeamLog.PassPolicySerializer().serialize(value.previousValue), + "new_value": try TeamLog.PassPolicySerializer().serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ViewerInfoPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> ViewerInfoPolicyChangedDetails { switch json { - case .dictionary(let dict): - let previousValue = TeamLog.PassPolicySerializer().deserialize(dict["previous_value"] ?? .null) - let newValue = TeamLog.PassPolicySerializer().deserialize(dict["new_value"] ?? .null) - return ViewerInfoPolicyChangedDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try TeamLog.PassPolicySerializer().deserialize(dict["previous_value"] ?? .null) + let newValue = try TeamLog.PassPolicySerializer().deserialize(dict["new_value"] ?? .null) + return ViewerInfoPolicyChangedDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: ViewerInfoPolicyChangedDetails.self, json: json) } } } /// The ViewerInfoPolicyChangedType struct - open class ViewerInfoPolicyChangedType: CustomStringConvertible { + public class ViewerInfoPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ViewerInfoPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try ViewerInfoPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ViewerInfoPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ViewerInfoPolicyChangedType: \(error)" + } } } - open class ViewerInfoPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ViewerInfoPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class ViewerInfoPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ViewerInfoPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> ViewerInfoPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> ViewerInfoPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return ViewerInfoPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ViewerInfoPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ViewerInfoPolicyChangedType.self, json: json) } } } /// Policy for controlling team access to watermarking feature - public enum WatermarkingPolicy: CustomStringConvertible { + public enum WatermarkingPolicy: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case disabled /// An unspecified error. @@ -52932,50 +67407,60 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try WatermarkingPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WatermarkingPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WatermarkingPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for WatermarkingPolicy: \(error)" + } } } - open class WatermarkingPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WatermarkingPolicy) -> JSON { + + public class WatermarkingPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WatermarkingPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> WatermarkingPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return WatermarkingPolicy.disabled - case "enabled": - return WatermarkingPolicy.enabled - case "other": - return WatermarkingPolicy.other - default: - return WatermarkingPolicy.other - } + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> WatermarkingPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return WatermarkingPolicy.disabled + case "enabled": + return WatermarkingPolicy.enabled + case "other": + return WatermarkingPolicy.other default: - fatalError("Failed to deserialize") + return WatermarkingPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: WatermarkingPolicy.self, json: json) } } } /// Changed watermarking policy for team. - open class WatermarkingPolicyChangedDetails: CustomStringConvertible { + public class WatermarkingPolicyChangedDetails: CustomStringConvertible, JSONRepresentable { /// New watermarking policy. public let newValue: TeamLog.WatermarkingPolicy /// Previous watermarking policy. @@ -52984,64 +67469,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WatermarkingPolicyChangedDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try WatermarkingPolicyChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WatermarkingPolicyChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WatermarkingPolicyChangedDetails: \(error)" + } } } - open class WatermarkingPolicyChangedDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WatermarkingPolicyChangedDetails) -> JSON { - let output = [ - "new_value": TeamLog.WatermarkingPolicySerializer().serialize(value.newValue), - "previous_value": TeamLog.WatermarkingPolicySerializer().serialize(value.previousValue), + + public class WatermarkingPolicyChangedDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WatermarkingPolicyChangedDetails) throws -> JSON { + let output = [ + "new_value": try TeamLog.WatermarkingPolicySerializer().serialize(value.newValue), + "previous_value": try TeamLog.WatermarkingPolicySerializer().serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WatermarkingPolicyChangedDetails { + + public func deserialize(_ json: JSON) throws -> WatermarkingPolicyChangedDetails { switch json { - case .dictionary(let dict): - let newValue = TeamLog.WatermarkingPolicySerializer().deserialize(dict["new_value"] ?? .null) - let previousValue = TeamLog.WatermarkingPolicySerializer().deserialize(dict["previous_value"] ?? .null) - return WatermarkingPolicyChangedDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try TeamLog.WatermarkingPolicySerializer().deserialize(dict["new_value"] ?? .null) + let previousValue = try TeamLog.WatermarkingPolicySerializer().deserialize(dict["previous_value"] ?? .null) + return WatermarkingPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: WatermarkingPolicyChangedDetails.self, json: json) } } } /// The WatermarkingPolicyChangedType struct - open class WatermarkingPolicyChangedType: CustomStringConvertible { + public class WatermarkingPolicyChangedType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WatermarkingPolicyChangedTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try WatermarkingPolicyChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WatermarkingPolicyChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WatermarkingPolicyChangedType: \(error)" + } } } - open class WatermarkingPolicyChangedTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WatermarkingPolicyChangedType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class WatermarkingPolicyChangedTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WatermarkingPolicyChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WatermarkingPolicyChangedType { + + public func deserialize(_ json: JSON) throws -> WatermarkingPolicyChangedType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return WatermarkingPolicyChangedType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return WatermarkingPolicyChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: WatermarkingPolicyChangedType.self, json: json) } } } /// Information on active web sessions - open class WebDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { + public class WebDeviceSessionLogInfo: TeamLog.DeviceSessionLogInfo { /// Web session unique id. public let sessionInfo: TeamLog.WebSessionLogInfo? /// Information on the hosting device. @@ -53050,7 +67557,15 @@ open class TeamLog { public let os: String /// Information on the browser used for this web session. public let browser: String - public init(userAgent: String, os: String, browser: String, ipAddress: String? = nil, created: Date? = nil, updated: Date? = nil, sessionInfo: TeamLog.WebSessionLogInfo? = nil) { + public init( + userAgent: String, + os: String, + browser: String, + ipAddress: String? = nil, + created: Date? = nil, + updated: Date? = nil, + sessionInfo: TeamLog.WebSessionLogInfo? = nil + ) { self.sessionInfo = sessionInfo stringValidator()(userAgent) self.userAgent = userAgent @@ -53060,68 +67575,89 @@ open class TeamLog { self.browser = browser super.init(ipAddress: ipAddress, created: created, updated: updated) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebDeviceSessionLogInfoSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebDeviceSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebDeviceSessionLogInfo: \(error)" + } } } - open class WebDeviceSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebDeviceSessionLogInfo) -> JSON { - let output = [ - "user_agent": Serialization._StringSerializer.serialize(value.userAgent), - "os": Serialization._StringSerializer.serialize(value.os), - "browser": Serialization._StringSerializer.serialize(value.browser), - "ip_address": NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), - "created": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), - "updated": NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), - "session_info": NullableSerializer(TeamLog.WebSessionLogInfoSerializer()).serialize(value.sessionInfo), + + public class WebDeviceSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebDeviceSessionLogInfo) throws -> JSON { + let output = [ + "user_agent": try Serialization._StringSerializer.serialize(value.userAgent), + "os": try Serialization._StringSerializer.serialize(value.os), + "browser": try Serialization._StringSerializer.serialize(value.browser), + "ip_address": try NullableSerializer(Serialization._StringSerializer).serialize(value.ipAddress), + "created": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.created), + "updated": try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).serialize(value.updated), + "session_info": try NullableSerializer(TeamLog.WebSessionLogInfoSerializer()).serialize(value.sessionInfo), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebDeviceSessionLogInfo { + + public func deserialize(_ json: JSON) throws -> WebDeviceSessionLogInfo { switch json { - case .dictionary(let dict): - let userAgent = Serialization._StringSerializer.deserialize(dict["user_agent"] ?? .null) - let os = Serialization._StringSerializer.deserialize(dict["os"] ?? .null) - let browser = Serialization._StringSerializer.deserialize(dict["browser"] ?? .null) - let ipAddress = NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) - let created = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) - let updated = NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) - let sessionInfo = NullableSerializer(TeamLog.WebSessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) - return WebDeviceSessionLogInfo(userAgent: userAgent, os: os, browser: browser, ipAddress: ipAddress, created: created, updated: updated, sessionInfo: sessionInfo) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let userAgent = try Serialization._StringSerializer.deserialize(dict["user_agent"] ?? .null) + let os = try Serialization._StringSerializer.deserialize(dict["os"] ?? .null) + let browser = try Serialization._StringSerializer.deserialize(dict["browser"] ?? .null) + let ipAddress = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["ip_address"] ?? .null) + let created = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["created"] ?? .null) + let updated = try NullableSerializer(NSDateSerializer("%Y-%m-%dT%H:%M:%SZ")).deserialize(dict["updated"] ?? .null) + let sessionInfo = try NullableSerializer(TeamLog.WebSessionLogInfoSerializer()).deserialize(dict["session_info"] ?? .null) + return WebDeviceSessionLogInfo( + userAgent: userAgent, + os: os, + browser: browser, + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo + ) + default: + throw JSONSerializerError.deserializeError(type: WebDeviceSessionLogInfo.self, json: json) } } } /// Web session. - open class WebSessionLogInfo: TeamLog.SessionLogInfo { - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionLogInfoSerializer().serialize(self)))" + public class WebSessionLogInfo: TeamLog.SessionLogInfo { + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionLogInfoSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionLogInfo: \(error)" + } } } - open class WebSessionLogInfoSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionLogInfo) -> JSON { - let output = [ - "session_id": NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), + + public class WebSessionLogInfoSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionLogInfo) throws -> JSON { + let output = [ + "session_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.sessionId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebSessionLogInfo { + + public func deserialize(_ json: JSON) throws -> WebSessionLogInfo { switch json { - case .dictionary(let dict): - let sessionId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) - return WebSessionLogInfo(sessionId: sessionId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sessionId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["session_id"] ?? .null) + return WebSessionLogInfo(sessionId: sessionId) + default: + throw JSONSerializerError.deserializeError(type: WebSessionLogInfo.self, json: json) } } } /// Changed limit on active sessions per member. - open class WebSessionsChangeActiveSessionLimitDetails: CustomStringConvertible { + public class WebSessionsChangeActiveSessionLimitDetails: CustomStringConvertible, JSONRepresentable { /// Previous max number of concurrent active sessions policy. public let previousValue: String /// New max number of concurrent active sessions policy. @@ -53132,64 +67668,86 @@ open class TeamLog { stringValidator()(newValue) self.newValue = newValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsChangeActiveSessionLimitDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try WebSessionsChangeActiveSessionLimitDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsChangeActiveSessionLimitDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsChangeActiveSessionLimitDetails: \(error)" + } } } - open class WebSessionsChangeActiveSessionLimitDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsChangeActiveSessionLimitDetails) -> JSON { - let output = [ - "previous_value": Serialization._StringSerializer.serialize(value.previousValue), - "new_value": Serialization._StringSerializer.serialize(value.newValue), + + public class WebSessionsChangeActiveSessionLimitDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsChangeActiveSessionLimitDetails) throws -> JSON { + let output = [ + "previous_value": try Serialization._StringSerializer.serialize(value.previousValue), + "new_value": try Serialization._StringSerializer.serialize(value.newValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebSessionsChangeActiveSessionLimitDetails { + + public func deserialize(_ json: JSON) throws -> WebSessionsChangeActiveSessionLimitDetails { switch json { - case .dictionary(let dict): - let previousValue = Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) - let newValue = Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) - return WebSessionsChangeActiveSessionLimitDetails(previousValue: previousValue, newValue: newValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let previousValue = try Serialization._StringSerializer.deserialize(dict["previous_value"] ?? .null) + let newValue = try Serialization._StringSerializer.deserialize(dict["new_value"] ?? .null) + return WebSessionsChangeActiveSessionLimitDetails(previousValue: previousValue, newValue: newValue) + default: + throw JSONSerializerError.deserializeError(type: WebSessionsChangeActiveSessionLimitDetails.self, json: json) } } } /// The WebSessionsChangeActiveSessionLimitType struct - open class WebSessionsChangeActiveSessionLimitType: CustomStringConvertible { + public class WebSessionsChangeActiveSessionLimitType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsChangeActiveSessionLimitTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try WebSessionsChangeActiveSessionLimitTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsChangeActiveSessionLimitTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsChangeActiveSessionLimitType: \(error)" + } } } - open class WebSessionsChangeActiveSessionLimitTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsChangeActiveSessionLimitType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class WebSessionsChangeActiveSessionLimitTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsChangeActiveSessionLimitType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebSessionsChangeActiveSessionLimitType { + + public func deserialize(_ json: JSON) throws -> WebSessionsChangeActiveSessionLimitType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return WebSessionsChangeActiveSessionLimitType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return WebSessionsChangeActiveSessionLimitType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: WebSessionsChangeActiveSessionLimitType.self, json: json) } } } /// Changed how long members can stay signed in to Dropbox.com. - open class WebSessionsChangeFixedLengthPolicyDetails: CustomStringConvertible { + public class WebSessionsChangeFixedLengthPolicyDetails: CustomStringConvertible, JSONRepresentable { /// New session length policy. Might be missing due to historical data gap. public let newValue: TeamLog.WebSessionsFixedLengthPolicy? /// Previous session length policy. Might be missing due to historical data gap. @@ -53198,64 +67756,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsChangeFixedLengthPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try WebSessionsChangeFixedLengthPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsChangeFixedLengthPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsChangeFixedLengthPolicyDetails: \(error)" + } } } - open class WebSessionsChangeFixedLengthPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsChangeFixedLengthPolicyDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).serialize(value.previousValue), + + public class WebSessionsChangeFixedLengthPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsChangeFixedLengthPolicyDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebSessionsChangeFixedLengthPolicyDetails { + + public func deserialize(_ json: JSON) throws -> WebSessionsChangeFixedLengthPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return WebSessionsChangeFixedLengthPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.WebSessionsFixedLengthPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return WebSessionsChangeFixedLengthPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: WebSessionsChangeFixedLengthPolicyDetails.self, json: json) } } } /// The WebSessionsChangeFixedLengthPolicyType struct - open class WebSessionsChangeFixedLengthPolicyType: CustomStringConvertible { + public class WebSessionsChangeFixedLengthPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsChangeFixedLengthPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try WebSessionsChangeFixedLengthPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsChangeFixedLengthPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsChangeFixedLengthPolicyType: \(error)" + } } } - open class WebSessionsChangeFixedLengthPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsChangeFixedLengthPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class WebSessionsChangeFixedLengthPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsChangeFixedLengthPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebSessionsChangeFixedLengthPolicyType { + + public func deserialize(_ json: JSON) throws -> WebSessionsChangeFixedLengthPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return WebSessionsChangeFixedLengthPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return WebSessionsChangeFixedLengthPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: WebSessionsChangeFixedLengthPolicyType.self, json: json) } } } /// Changed how long team members can be idle while signed in to Dropbox.com. - open class WebSessionsChangeIdleLengthPolicyDetails: CustomStringConvertible { + public class WebSessionsChangeIdleLengthPolicyDetails: CustomStringConvertible, JSONRepresentable { /// New idle length policy. Might be missing due to historical data gap. public let newValue: TeamLog.WebSessionsIdleLengthPolicy? /// Previous idle length policy. Might be missing due to historical data gap. @@ -53264,64 +67844,86 @@ open class TeamLog { self.newValue = newValue self.previousValue = previousValue } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsChangeIdleLengthPolicyDetailsSerializer().serialize(self)))" + + func json() throws -> JSON { + try WebSessionsChangeIdleLengthPolicyDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsChangeIdleLengthPolicyDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsChangeIdleLengthPolicyDetails: \(error)" + } } } - open class WebSessionsChangeIdleLengthPolicyDetailsSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsChangeIdleLengthPolicyDetails) -> JSON { - let output = [ - "new_value": NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).serialize(value.newValue), - "previous_value": NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).serialize(value.previousValue), + + public class WebSessionsChangeIdleLengthPolicyDetailsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsChangeIdleLengthPolicyDetails) throws -> JSON { + let output = [ + "new_value": try NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).serialize(value.newValue), + "previous_value": try NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).serialize(value.previousValue), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebSessionsChangeIdleLengthPolicyDetails { + + public func deserialize(_ json: JSON) throws -> WebSessionsChangeIdleLengthPolicyDetails { switch json { - case .dictionary(let dict): - let newValue = NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).deserialize(dict["new_value"] ?? .null) - let previousValue = NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).deserialize(dict["previous_value"] ?? .null) - return WebSessionsChangeIdleLengthPolicyDetails(newValue: newValue, previousValue: previousValue) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let newValue = try NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).deserialize(dict["new_value"] ?? .null) + let previousValue = try NullableSerializer(TeamLog.WebSessionsIdleLengthPolicySerializer()).deserialize(dict["previous_value"] ?? .null) + return WebSessionsChangeIdleLengthPolicyDetails(newValue: newValue, previousValue: previousValue) + default: + throw JSONSerializerError.deserializeError(type: WebSessionsChangeIdleLengthPolicyDetails.self, json: json) } } } /// The WebSessionsChangeIdleLengthPolicyType struct - open class WebSessionsChangeIdleLengthPolicyType: CustomStringConvertible { + public class WebSessionsChangeIdleLengthPolicyType: CustomStringConvertible, JSONRepresentable { /// (no description) public let description_: String public init(description_: String) { stringValidator()(description_) self.description_ = description_ } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsChangeIdleLengthPolicyTypeSerializer().serialize(self)))" + + func json() throws -> JSON { + try WebSessionsChangeIdleLengthPolicyTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsChangeIdleLengthPolicyTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsChangeIdleLengthPolicyType: \(error)" + } } } - open class WebSessionsChangeIdleLengthPolicyTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsChangeIdleLengthPolicyType) -> JSON { - let output = [ - "description": Serialization._StringSerializer.serialize(value.description_), + + public class WebSessionsChangeIdleLengthPolicyTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsChangeIdleLengthPolicyType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> WebSessionsChangeIdleLengthPolicyType { + + public func deserialize(_ json: JSON) throws -> WebSessionsChangeIdleLengthPolicyType { switch json { - case .dictionary(let dict): - let description_ = Serialization._StringSerializer.deserialize(dict["description"] ?? .null) - return WebSessionsChangeIdleLengthPolicyType(description_: description_) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return WebSessionsChangeIdleLengthPolicyType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: WebSessionsChangeIdleLengthPolicyType.self, json: json) } } } /// Web sessions fixed length policy. - public enum WebSessionsFixedLengthPolicy: CustomStringConvertible { + public enum WebSessionsFixedLengthPolicy: CustomStringConvertible, JSONRepresentable { /// Defined fixed session length. case defined(TeamLog.DurationLogInfo) /// Undefined fixed session length. @@ -53329,51 +67931,61 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try WebSessionsFixedLengthPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsFixedLengthPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsFixedLengthPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsFixedLengthPolicy: \(error)" + } } } - open class WebSessionsFixedLengthPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsFixedLengthPolicy) -> JSON { + + public class WebSessionsFixedLengthPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsFixedLengthPolicy) throws -> JSON { switch value { - case .defined(let arg): - var d = Serialization.getFields(TeamLog.DurationLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("defined") - return .dictionary(d) - case .undefined: - var d = [String: JSON]() - d[".tag"] = .str("undefined") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> WebSessionsFixedLengthPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "defined": - let v = TeamLog.DurationLogInfoSerializer().deserialize(json) - return WebSessionsFixedLengthPolicy.defined(v) - case "undefined": - return WebSessionsFixedLengthPolicy.undefined - case "other": - return WebSessionsFixedLengthPolicy.other - default: - return WebSessionsFixedLengthPolicy.other - } + case .defined(let arg): + var d = try Serialization.getFields(TeamLog.DurationLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("defined") + return .dictionary(d) + case .undefined: + var d = [String: JSON]() + d[".tag"] = .str("undefined") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> WebSessionsFixedLengthPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "defined": + let v = try TeamLog.DurationLogInfoSerializer().deserialize(json) + return WebSessionsFixedLengthPolicy.defined(v) + case "undefined": + return WebSessionsFixedLengthPolicy.undefined + case "other": + return WebSessionsFixedLengthPolicy.other default: - fatalError("Failed to deserialize") + return WebSessionsFixedLengthPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: WebSessionsFixedLengthPolicy.self, json: json) } } } /// Web sessions idle length policy. - public enum WebSessionsIdleLengthPolicy: CustomStringConvertible { + public enum WebSessionsIdleLengthPolicy: CustomStringConvertible, JSONRepresentable { /// Defined idle session length. case defined(TeamLog.DurationLogInfo) /// Undefined idle session length. @@ -53381,50 +67993,59 @@ open class TeamLog { /// An unspecified error. case other + func json() throws -> JSON { + try WebSessionsIdleLengthPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(WebSessionsIdleLengthPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try WebSessionsIdleLengthPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for WebSessionsIdleLengthPolicy: \(error)" + } } } - open class WebSessionsIdleLengthPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: WebSessionsIdleLengthPolicy) -> JSON { + + public class WebSessionsIdleLengthPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: WebSessionsIdleLengthPolicy) throws -> JSON { switch value { - case .defined(let arg): - var d = Serialization.getFields(TeamLog.DurationLogInfoSerializer().serialize(arg)) - d[".tag"] = .str("defined") - return .dictionary(d) - case .undefined: - var d = [String: JSON]() - d[".tag"] = .str("undefined") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> WebSessionsIdleLengthPolicy { - switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "defined": - let v = TeamLog.DurationLogInfoSerializer().deserialize(json) - return WebSessionsIdleLengthPolicy.defined(v) - case "undefined": - return WebSessionsIdleLengthPolicy.undefined - case "other": - return WebSessionsIdleLengthPolicy.other - default: - return WebSessionsIdleLengthPolicy.other - } + case .defined(let arg): + var d = try Serialization.getFields(TeamLog.DurationLogInfoSerializer().serialize(arg)) + d[".tag"] = .str("defined") + return .dictionary(d) + case .undefined: + var d = [String: JSON]() + d[".tag"] = .str("undefined") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> WebSessionsIdleLengthPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "defined": + let v = try TeamLog.DurationLogInfoSerializer().deserialize(json) + return WebSessionsIdleLengthPolicy.defined(v) + case "undefined": + return WebSessionsIdleLengthPolicy.undefined + case "other": + return WebSessionsIdleLengthPolicy.other default: - fatalError("Failed to deserialize") + return WebSessionsIdleLengthPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: WebSessionsIdleLengthPolicy.self, json: json) } } } - /// Stone Route Objects static let getEvents = Route( @@ -53435,9 +68056,11 @@ open class TeamLog { argSerializer: TeamLog.GetTeamEventsArgSerializer(), responseSerializer: TeamLog.GetTeamEventsResultSerializer(), errorSerializer: TeamLog.GetTeamEventsErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) static let getEventsContinue = Route( name: "get_events/continue", @@ -53447,8 +68070,10 @@ open class TeamLog { argSerializer: TeamLog.GetTeamEventsContinueArgSerializer(), responseSerializer: TeamLog.GetTeamEventsResultSerializer(), errorSerializer: TeamLog.GetTeamEventsContinueErrorSerializer(), - attrs: ["auth": "team", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.team], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/TeamLogRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/TeamLogRoutes.swift index 8298e6a10..16bfffeae 100644 --- a/Source/SwiftyDropbox/Shared/Generated/TeamLogRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/TeamLogRoutes.swift @@ -7,23 +7,26 @@ import Foundation /// Routes for the team_log namespace -open class TeamLogRoutes { +/// For Objective-C compatible routes see DBTeamLogRoutes +public class TeamLogRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Retrieves team events. If the result's hasMore in GetTeamEventsResult field is true, call getEventsContinue with /// the returned cursor to retrieve more entries. If end_time is not specified in your request, you may use the - /// returned cursor to poll getEventsContinue for new events. Many attributes note 'may be missing due to historical - /// data gap'. Note that the file_operations category and & analogous paper events are not available on all Dropbox - /// Business plans /business/plans-comparison. Use features/get_values + /// returned cursor to poll getEventsContinue for new events. Many attributes note 'may be missing due to + /// historical data gap'. Note that the file_operations category and & analogous paper events are not available + /// on all Dropbox Business plans /business/plans-comparison. Use features/get_values /// /developers/documentation/http/teams#team-features-get_values to check for this feature. Permission : Team /// Auditing. /// + /// - scope: events.read + /// /// - parameter limit: The maximal number of results to return per call. Note that some calls may not return limit - /// number of events, and may even return no events, even with `has_more` set to true. In this case, callers should - /// fetch again using getEventsContinue. + /// number of events, and may even return no events, even with `has_more` set to true. In this case, callers + /// should fetch again using getEventsContinue. /// - parameter accountId: Filter the events by account ID. Return only events with this account_id as either Actor, /// Context, or Participants. /// - parameter time: Filter by time range. @@ -32,9 +35,15 @@ open class TeamLogRoutes { /// - parameter eventType: Filter the returned events to a single event type. Note that event_type shouldn't be /// provided together with category. /// - /// - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on + /// - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on /// success or a `TeamLog.GetTeamEventsError` object on failure. - @discardableResult open func getEvents(limit: UInt32 = 1000, accountId: String? = nil, time: TeamCommon.TimeRange? = nil, category: TeamLog.EventCategory? = nil, eventType: TeamLog.EventTypeArg? = nil) -> RpcRequest { + @discardableResult public func getEvents( + limit: UInt32 = 1_000, + accountId: String? = nil, + time: TeamCommon.TimeRange? = nil, + category: TeamLog.EventCategory? = nil, + eventType: TeamLog.EventTypeArg? = nil + ) -> RpcRequest { let route = TeamLog.getEvents let serverArgs = TeamLog.GetTeamEventsArg(limit: limit, accountId: accountId, time: time, category: category, eventType: eventType) return client.request(route, serverArgs: serverArgs) @@ -43,14 +52,16 @@ open class TeamLogRoutes { /// Once a cursor has been retrieved from getEvents, use this to paginate through all events. Permission : Team /// Auditing. /// + /// - scope: events.read + /// /// - parameter cursor: Indicates from what point to get the next set of events. /// - /// - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on + /// - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on /// success or a `TeamLog.GetTeamEventsContinueError` object on failure. - @discardableResult open func getEventsContinue(cursor: String) -> RpcRequest { + @discardableResult public func getEventsContinue(cursor: String) + -> RpcRequest { let route = TeamLog.getEventsContinue let serverArgs = TeamLog.GetTeamEventsContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/TeamPolicies.swift b/Source/SwiftyDropbox/Shared/Generated/TeamPolicies.swift index 58bd17ca2..1a67f5126 100644 --- a/Source/SwiftyDropbox/Shared/Generated/TeamPolicies.swift +++ b/Source/SwiftyDropbox/Shared/Generated/TeamPolicies.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the team_policies namespace -open class TeamPolicies { +public class TeamPolicies { /// The CameraUploadsPolicyState union - public enum CameraUploadsPolicyState: CustomStringConvertible { + public enum CameraUploadsPolicyState: CustomStringConvertible, JSONRepresentable { /// Background camera uploads are disabled. case disabled /// Background camera uploads are allowed. @@ -17,50 +17,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try CameraUploadsPolicyStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(CameraUploadsPolicyStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try CameraUploadsPolicyStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for CameraUploadsPolicyState: \(error)" + } } } - open class CameraUploadsPolicyStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: CameraUploadsPolicyState) -> JSON { + + public class CameraUploadsPolicyStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: CameraUploadsPolicyState) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> CameraUploadsPolicyState { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> CameraUploadsPolicyState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return CameraUploadsPolicyState.disabled - case "enabled": - return CameraUploadsPolicyState.enabled - case "other": - return CameraUploadsPolicyState.other - default: - return CameraUploadsPolicyState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return CameraUploadsPolicyState.disabled + case "enabled": + return CameraUploadsPolicyState.enabled + case "other": + return CameraUploadsPolicyState.other default: - fatalError("Failed to deserialize") + return CameraUploadsPolicyState.other + } + default: + throw JSONSerializerError.deserializeError(type: CameraUploadsPolicyState.self, json: json) } } } /// The ComputerBackupPolicyState union - public enum ComputerBackupPolicyState: CustomStringConvertible { + public enum ComputerBackupPolicyState: CustomStringConvertible, JSONRepresentable { /// Computer Backup feature is disabled. case disabled /// Computer Backup feature is enabled. @@ -70,56 +80,66 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try ComputerBackupPolicyStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ComputerBackupPolicyStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ComputerBackupPolicyStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ComputerBackupPolicyState: \(error)" + } } } - open class ComputerBackupPolicyStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ComputerBackupPolicyState) -> JSON { + + public class ComputerBackupPolicyStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ComputerBackupPolicyState) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ComputerBackupPolicyState { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ComputerBackupPolicyState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ComputerBackupPolicyState.disabled - case "enabled": - return ComputerBackupPolicyState.enabled - case "default": - return ComputerBackupPolicyState.default_ - case "other": - return ComputerBackupPolicyState.other - default: - return ComputerBackupPolicyState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ComputerBackupPolicyState.disabled + case "enabled": + return ComputerBackupPolicyState.enabled + case "default": + return ComputerBackupPolicyState.default_ + case "other": + return ComputerBackupPolicyState.other default: - fatalError("Failed to deserialize") + return ComputerBackupPolicyState.other + } + default: + throw JSONSerializerError.deserializeError(type: ComputerBackupPolicyState.self, json: json) } } } /// The EmmState union - public enum EmmState: CustomStringConvertible { + public enum EmmState: CustomStringConvertible, JSONRepresentable { /// Emm token is disabled. case disabled /// Emm token is optional. @@ -129,56 +149,66 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try EmmStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(EmmStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try EmmStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for EmmState: \(error)" + } } } - open class EmmStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: EmmState) -> JSON { + + public class EmmStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: EmmState) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .optional: - var d = [String: JSON]() - d[".tag"] = .str("optional") - return .dictionary(d) - case .required: - var d = [String: JSON]() - d[".tag"] = .str("required") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> EmmState { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .optional: + var d = [String: JSON]() + d[".tag"] = .str("optional") + return .dictionary(d) + case .required: + var d = [String: JSON]() + d[".tag"] = .str("required") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> EmmState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return EmmState.disabled - case "optional": - return EmmState.optional - case "required": - return EmmState.required - case "other": - return EmmState.other - default: - return EmmState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return EmmState.disabled + case "optional": + return EmmState.optional + case "required": + return EmmState.required + case "other": + return EmmState.other default: - fatalError("Failed to deserialize") + return EmmState.other + } + default: + throw JSONSerializerError.deserializeError(type: EmmState.self, json: json) } } } /// The ExternalDriveBackupPolicyState union - public enum ExternalDriveBackupPolicyState: CustomStringConvertible { + public enum ExternalDriveBackupPolicyState: CustomStringConvertible, JSONRepresentable { /// External Drive Backup feature is disabled. case disabled /// External Drive Backup feature is enabled. @@ -188,56 +218,66 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try ExternalDriveBackupPolicyStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ExternalDriveBackupPolicyStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalDriveBackupPolicyStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalDriveBackupPolicyState: \(error)" + } } } - open class ExternalDriveBackupPolicyStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ExternalDriveBackupPolicyState) -> JSON { + + public class ExternalDriveBackupPolicyStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ExternalDriveBackupPolicyState) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ExternalDriveBackupPolicyState { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ExternalDriveBackupPolicyState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ExternalDriveBackupPolicyState.disabled - case "enabled": - return ExternalDriveBackupPolicyState.enabled - case "default": - return ExternalDriveBackupPolicyState.default_ - case "other": - return ExternalDriveBackupPolicyState.other - default: - return ExternalDriveBackupPolicyState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ExternalDriveBackupPolicyState.disabled + case "enabled": + return ExternalDriveBackupPolicyState.enabled + case "default": + return ExternalDriveBackupPolicyState.default_ + case "other": + return ExternalDriveBackupPolicyState.other default: - fatalError("Failed to deserialize") + return ExternalDriveBackupPolicyState.other + } + default: + throw JSONSerializerError.deserializeError(type: ExternalDriveBackupPolicyState.self, json: json) } } } /// The FileLockingPolicyState union - public enum FileLockingPolicyState: CustomStringConvertible { + public enum FileLockingPolicyState: CustomStringConvertible, JSONRepresentable { /// File locking feature is disabled. case disabled /// File locking feature is allowed. @@ -245,50 +285,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try FileLockingPolicyStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockingPolicyStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockingPolicyStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockingPolicyState: \(error)" + } } } - open class FileLockingPolicyStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockingPolicyState) -> JSON { + + public class FileLockingPolicyStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockingPolicyState) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileLockingPolicyState { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileLockingPolicyState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return FileLockingPolicyState.disabled - case "enabled": - return FileLockingPolicyState.enabled - case "other": - return FileLockingPolicyState.other - default: - return FileLockingPolicyState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return FileLockingPolicyState.disabled + case "enabled": + return FileLockingPolicyState.enabled + case "other": + return FileLockingPolicyState.other default: - fatalError("Failed to deserialize") + return FileLockingPolicyState.other + } + default: + throw JSONSerializerError.deserializeError(type: FileLockingPolicyState.self, json: json) } } } /// The FileProviderMigrationPolicyState union - public enum FileProviderMigrationPolicyState: CustomStringConvertible { + public enum FileProviderMigrationPolicyState: CustomStringConvertible, JSONRepresentable { /// Team admin has opted out of File Provider Migration for team members. case disabled /// Team admin has not opted out of File Provider Migration for team members. @@ -298,99 +348,119 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try FileProviderMigrationPolicyStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileProviderMigrationPolicyStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileProviderMigrationPolicyStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileProviderMigrationPolicyState: \(error)" + } } } - open class FileProviderMigrationPolicyStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileProviderMigrationPolicyState) -> JSON { + + public class FileProviderMigrationPolicyStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileProviderMigrationPolicyState) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .default_: - var d = [String: JSON]() - d[".tag"] = .str("default") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> FileProviderMigrationPolicyState { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .default_: + var d = [String: JSON]() + d[".tag"] = .str("default") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> FileProviderMigrationPolicyState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return FileProviderMigrationPolicyState.disabled - case "enabled": - return FileProviderMigrationPolicyState.enabled - case "default": - return FileProviderMigrationPolicyState.default_ - case "other": - return FileProviderMigrationPolicyState.other - default: - return FileProviderMigrationPolicyState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return FileProviderMigrationPolicyState.disabled + case "enabled": + return FileProviderMigrationPolicyState.enabled + case "default": + return FileProviderMigrationPolicyState.default_ + case "other": + return FileProviderMigrationPolicyState.other default: - fatalError("Failed to deserialize") + return FileProviderMigrationPolicyState.other + } + default: + throw JSONSerializerError.deserializeError(type: FileProviderMigrationPolicyState.self, json: json) } } } /// The GroupCreation union - public enum GroupCreation: CustomStringConvertible { + public enum GroupCreation: CustomStringConvertible, JSONRepresentable { /// Team admins and members can create groups. case adminsAndMembers /// Only team admins can create groups. case adminsOnly + func json() throws -> JSON { + try GroupCreationSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GroupCreationSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GroupCreationSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GroupCreation: \(error)" + } } } - open class GroupCreationSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GroupCreation) -> JSON { + + public class GroupCreationSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GroupCreation) throws -> JSON { switch value { - case .adminsAndMembers: - var d = [String: JSON]() - d[".tag"] = .str("admins_and_members") - return .dictionary(d) - case .adminsOnly: - var d = [String: JSON]() - d[".tag"] = .str("admins_only") - return .dictionary(d) + case .adminsAndMembers: + var d = [String: JSON]() + d[".tag"] = .str("admins_and_members") + return .dictionary(d) + case .adminsOnly: + var d = [String: JSON]() + d[".tag"] = .str("admins_only") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GroupCreation { + + public func deserialize(_ json: JSON) throws -> GroupCreation { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "admins_and_members": - return GroupCreation.adminsAndMembers - case "admins_only": - return GroupCreation.adminsOnly - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "admins_and_members": + return GroupCreation.adminsAndMembers + case "admins_only": + return GroupCreation.adminsOnly default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: GroupCreation.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: GroupCreation.self, json: json) } } } /// The OfficeAddInPolicy union - public enum OfficeAddInPolicy: CustomStringConvertible { + public enum OfficeAddInPolicy: CustomStringConvertible, JSONRepresentable { /// Office Add-In is disabled. case disabled /// Office Add-In is enabled. @@ -398,50 +468,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try OfficeAddInPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(OfficeAddInPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OfficeAddInPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for OfficeAddInPolicy: \(error)" + } } } - open class OfficeAddInPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: OfficeAddInPolicy) -> JSON { + + public class OfficeAddInPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OfficeAddInPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> OfficeAddInPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> OfficeAddInPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return OfficeAddInPolicy.disabled - case "enabled": - return OfficeAddInPolicy.enabled - case "other": - return OfficeAddInPolicy.other - default: - return OfficeAddInPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return OfficeAddInPolicy.disabled + case "enabled": + return OfficeAddInPolicy.enabled + case "other": + return OfficeAddInPolicy.other default: - fatalError("Failed to deserialize") + return OfficeAddInPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: OfficeAddInPolicy.self, json: json) } } } /// The PaperDefaultFolderPolicy union - public enum PaperDefaultFolderPolicy: CustomStringConvertible { + public enum PaperDefaultFolderPolicy: CustomStringConvertible, JSONRepresentable { /// Everyone in team will be the default option when creating a folder in Paper. case everyoneInTeam /// Invite only will be the default option when creating a folder in Paper. @@ -449,50 +529,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDefaultFolderPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDefaultFolderPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDefaultFolderPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDefaultFolderPolicy: \(error)" + } } } - open class PaperDefaultFolderPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDefaultFolderPolicy) -> JSON { + + public class PaperDefaultFolderPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDefaultFolderPolicy) throws -> JSON { switch value { - case .everyoneInTeam: - var d = [String: JSON]() - d[".tag"] = .str("everyone_in_team") - return .dictionary(d) - case .inviteOnly: - var d = [String: JSON]() - d[".tag"] = .str("invite_only") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDefaultFolderPolicy { + case .everyoneInTeam: + var d = [String: JSON]() + d[".tag"] = .str("everyone_in_team") + return .dictionary(d) + case .inviteOnly: + var d = [String: JSON]() + d[".tag"] = .str("invite_only") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDefaultFolderPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "everyone_in_team": - return PaperDefaultFolderPolicy.everyoneInTeam - case "invite_only": - return PaperDefaultFolderPolicy.inviteOnly - case "other": - return PaperDefaultFolderPolicy.other - default: - return PaperDefaultFolderPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "everyone_in_team": + return PaperDefaultFolderPolicy.everyoneInTeam + case "invite_only": + return PaperDefaultFolderPolicy.inviteOnly + case "other": + return PaperDefaultFolderPolicy.other default: - fatalError("Failed to deserialize") + return PaperDefaultFolderPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDefaultFolderPolicy.self, json: json) } } } /// The PaperDeploymentPolicy union - public enum PaperDeploymentPolicy: CustomStringConvertible { + public enum PaperDeploymentPolicy: CustomStringConvertible, JSONRepresentable { /// All team members have access to Paper. case full /// Only whitelisted team members can access Paper. To see which user is whitelisted, check @@ -501,50 +591,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDeploymentPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDeploymentPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDeploymentPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDeploymentPolicy: \(error)" + } } } - open class PaperDeploymentPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDeploymentPolicy) -> JSON { + + public class PaperDeploymentPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDeploymentPolicy) throws -> JSON { switch value { - case .full: - var d = [String: JSON]() - d[".tag"] = .str("full") - return .dictionary(d) - case .partial: - var d = [String: JSON]() - d[".tag"] = .str("partial") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDeploymentPolicy { + case .full: + var d = [String: JSON]() + d[".tag"] = .str("full") + return .dictionary(d) + case .partial: + var d = [String: JSON]() + d[".tag"] = .str("partial") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDeploymentPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "full": - return PaperDeploymentPolicy.full - case "partial": - return PaperDeploymentPolicy.partial - case "other": - return PaperDeploymentPolicy.other - default: - return PaperDeploymentPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "full": + return PaperDeploymentPolicy.full + case "partial": + return PaperDeploymentPolicy.partial + case "other": + return PaperDeploymentPolicy.other default: - fatalError("Failed to deserialize") + return PaperDeploymentPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDeploymentPolicy.self, json: json) } } } /// The PaperDesktopPolicy union - public enum PaperDesktopPolicy: CustomStringConvertible { + public enum PaperDesktopPolicy: CustomStringConvertible, JSONRepresentable { /// Do not allow team members to use Paper Desktop. case disabled /// Allow team members to use Paper Desktop. @@ -552,50 +652,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try PaperDesktopPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperDesktopPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperDesktopPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperDesktopPolicy: \(error)" + } } } - open class PaperDesktopPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperDesktopPolicy) -> JSON { + + public class PaperDesktopPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperDesktopPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperDesktopPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperDesktopPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return PaperDesktopPolicy.disabled - case "enabled": - return PaperDesktopPolicy.enabled - case "other": - return PaperDesktopPolicy.other - default: - return PaperDesktopPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return PaperDesktopPolicy.disabled + case "enabled": + return PaperDesktopPolicy.enabled + case "other": + return PaperDesktopPolicy.other default: - fatalError("Failed to deserialize") + return PaperDesktopPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperDesktopPolicy.self, json: json) } } } /// The PaperEnabledPolicy union - public enum PaperEnabledPolicy: CustomStringConvertible { + public enum PaperEnabledPolicy: CustomStringConvertible, JSONRepresentable { /// Paper is disabled. case disabled /// Paper is enabled. @@ -605,56 +715,66 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try PaperEnabledPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperEnabledPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperEnabledPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperEnabledPolicy: \(error)" + } } } - open class PaperEnabledPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperEnabledPolicy) -> JSON { + + public class PaperEnabledPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperEnabledPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .unspecified: - var d = [String: JSON]() - d[".tag"] = .str("unspecified") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PaperEnabledPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .unspecified: + var d = [String: JSON]() + d[".tag"] = .str("unspecified") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PaperEnabledPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return PaperEnabledPolicy.disabled - case "enabled": - return PaperEnabledPolicy.enabled - case "unspecified": - return PaperEnabledPolicy.unspecified - case "other": - return PaperEnabledPolicy.other - default: - return PaperEnabledPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return PaperEnabledPolicy.disabled + case "enabled": + return PaperEnabledPolicy.enabled + case "unspecified": + return PaperEnabledPolicy.unspecified + case "other": + return PaperEnabledPolicy.other default: - fatalError("Failed to deserialize") + return PaperEnabledPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperEnabledPolicy.self, json: json) } } } /// The PasswordControlMode union - public enum PasswordControlMode: CustomStringConvertible { + public enum PasswordControlMode: CustomStringConvertible, JSONRepresentable { /// Password is disabled. case disabled /// Password is enabled. @@ -662,50 +782,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try PasswordControlModeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordControlModeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordControlModeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordControlMode: \(error)" + } } } - open class PasswordControlModeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordControlMode) -> JSON { + + public class PasswordControlModeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordControlMode) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PasswordControlMode { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PasswordControlMode { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return PasswordControlMode.disabled - case "enabled": - return PasswordControlMode.enabled - case "other": - return PasswordControlMode.other - default: - return PasswordControlMode.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return PasswordControlMode.disabled + case "enabled": + return PasswordControlMode.enabled + case "other": + return PasswordControlMode.other default: - fatalError("Failed to deserialize") + return PasswordControlMode.other + } + default: + throw JSONSerializerError.deserializeError(type: PasswordControlMode.self, json: json) } } } /// The PasswordStrengthPolicy union - public enum PasswordStrengthPolicy: CustomStringConvertible { + public enum PasswordStrengthPolicy: CustomStringConvertible, JSONRepresentable { /// User passwords will adhere to the minimal password strength policy. case minimalRequirements /// User passwords will adhere to the moderate password strength policy. @@ -715,56 +845,66 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try PasswordStrengthPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PasswordStrengthPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PasswordStrengthPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for PasswordStrengthPolicy: \(error)" + } } } - open class PasswordStrengthPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PasswordStrengthPolicy) -> JSON { + + public class PasswordStrengthPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PasswordStrengthPolicy) throws -> JSON { switch value { - case .minimalRequirements: - var d = [String: JSON]() - d[".tag"] = .str("minimal_requirements") - return .dictionary(d) - case .moderatePassword: - var d = [String: JSON]() - d[".tag"] = .str("moderate_password") - return .dictionary(d) - case .strongPassword: - var d = [String: JSON]() - d[".tag"] = .str("strong_password") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> PasswordStrengthPolicy { + case .minimalRequirements: + var d = [String: JSON]() + d[".tag"] = .str("minimal_requirements") + return .dictionary(d) + case .moderatePassword: + var d = [String: JSON]() + d[".tag"] = .str("moderate_password") + return .dictionary(d) + case .strongPassword: + var d = [String: JSON]() + d[".tag"] = .str("strong_password") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> PasswordStrengthPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "minimal_requirements": - return PasswordStrengthPolicy.minimalRequirements - case "moderate_password": - return PasswordStrengthPolicy.moderatePassword - case "strong_password": - return PasswordStrengthPolicy.strongPassword - case "other": - return PasswordStrengthPolicy.other - default: - return PasswordStrengthPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "minimal_requirements": + return PasswordStrengthPolicy.minimalRequirements + case "moderate_password": + return PasswordStrengthPolicy.moderatePassword + case "strong_password": + return PasswordStrengthPolicy.strongPassword + case "other": + return PasswordStrengthPolicy.other default: - fatalError("Failed to deserialize") + return PasswordStrengthPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: PasswordStrengthPolicy.self, json: json) } } } /// The RolloutMethod union - public enum RolloutMethod: CustomStringConvertible { + public enum RolloutMethod: CustomStringConvertible, JSONRepresentable { /// Unlink all. case unlinkAll /// Unlink devices with the most inactivity. @@ -772,50 +912,121 @@ open class TeamPolicies { /// Add member to Exceptions. case addMemberToExceptions + func json() throws -> JSON { + try RolloutMethodSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(RolloutMethodSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try RolloutMethodSerializer().serialize(self)))" + } catch { + return "Failed to generate description for RolloutMethod: \(error)" + } } } - open class RolloutMethodSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: RolloutMethod) -> JSON { + + public class RolloutMethodSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: RolloutMethod) throws -> JSON { switch value { - case .unlinkAll: - var d = [String: JSON]() - d[".tag"] = .str("unlink_all") - return .dictionary(d) - case .unlinkMostInactive: - var d = [String: JSON]() - d[".tag"] = .str("unlink_most_inactive") - return .dictionary(d) - case .addMemberToExceptions: - var d = [String: JSON]() - d[".tag"] = .str("add_member_to_exceptions") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> RolloutMethod { + case .unlinkAll: + var d = [String: JSON]() + d[".tag"] = .str("unlink_all") + return .dictionary(d) + case .unlinkMostInactive: + var d = [String: JSON]() + d[".tag"] = .str("unlink_most_inactive") + return .dictionary(d) + case .addMemberToExceptions: + var d = [String: JSON]() + d[".tag"] = .str("add_member_to_exceptions") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> RolloutMethod { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "unlink_all": - return RolloutMethod.unlinkAll - case "unlink_most_inactive": - return RolloutMethod.unlinkMostInactive - case "add_member_to_exceptions": - return RolloutMethod.addMemberToExceptions - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "unlink_all": + return RolloutMethod.unlinkAll + case "unlink_most_inactive": + return RolloutMethod.unlinkMostInactive + case "add_member_to_exceptions": + return RolloutMethod.addMemberToExceptions default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: RolloutMethod.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: RolloutMethod.self, json: json) + } + } + } + + /// Policy governing whether shared folder membership is required to access shared links. + public enum SharedFolderBlanketLinkRestrictionPolicy: CustomStringConvertible, JSONRepresentable { + /// Only members of shared folders can access folder content via shared link. + case members + /// Anyone can access folder content via shared link. + case anyone + /// An unspecified error. + case other + + func json() throws -> JSON { + try SharedFolderBlanketLinkRestrictionPolicySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderBlanketLinkRestrictionPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderBlanketLinkRestrictionPolicy: \(error)" + } + } + } + + public class SharedFolderBlanketLinkRestrictionPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderBlanketLinkRestrictionPolicy) throws -> JSON { + switch value { + case .members: + var d = [String: JSON]() + d[".tag"] = .str("members") + return .dictionary(d) + case .anyone: + var d = [String: JSON]() + d[".tag"] = .str("anyone") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedFolderBlanketLinkRestrictionPolicy { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "members": + return SharedFolderBlanketLinkRestrictionPolicy.members + case "anyone": + return SharedFolderBlanketLinkRestrictionPolicy.anyone + case "other": + return SharedFolderBlanketLinkRestrictionPolicy.other + default: + return SharedFolderBlanketLinkRestrictionPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedFolderBlanketLinkRestrictionPolicy.self, json: json) } } } /// Policy governing which shared folders a team member can join. - public enum SharedFolderJoinPolicy: CustomStringConvertible { + public enum SharedFolderJoinPolicy: CustomStringConvertible, JSONRepresentable { /// Team members can only join folders shared by teammates. case fromTeamOnly /// Team members can join any shared folder, including those shared by users outside the team. @@ -823,50 +1034,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try SharedFolderJoinPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderJoinPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderJoinPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderJoinPolicy: \(error)" + } } } - open class SharedFolderJoinPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderJoinPolicy) -> JSON { + + public class SharedFolderJoinPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderJoinPolicy) throws -> JSON { switch value { - case .fromTeamOnly: - var d = [String: JSON]() - d[".tag"] = .str("from_team_only") - return .dictionary(d) - case .fromAnyone: - var d = [String: JSON]() - d[".tag"] = .str("from_anyone") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedFolderJoinPolicy { + case .fromTeamOnly: + var d = [String: JSON]() + d[".tag"] = .str("from_team_only") + return .dictionary(d) + case .fromAnyone: + var d = [String: JSON]() + d[".tag"] = .str("from_anyone") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedFolderJoinPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "from_team_only": - return SharedFolderJoinPolicy.fromTeamOnly - case "from_anyone": - return SharedFolderJoinPolicy.fromAnyone - case "other": - return SharedFolderJoinPolicy.other - default: - return SharedFolderJoinPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "from_team_only": + return SharedFolderJoinPolicy.fromTeamOnly + case "from_anyone": + return SharedFolderJoinPolicy.fromAnyone + case "other": + return SharedFolderJoinPolicy.other default: - fatalError("Failed to deserialize") + return SharedFolderJoinPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedFolderJoinPolicy.self, json: json) } } } /// Policy governing who can be a member of a folder shared by a team member. - public enum SharedFolderMemberPolicy: CustomStringConvertible { + public enum SharedFolderMemberPolicy: CustomStringConvertible, JSONRepresentable { /// Only a teammate can be a member of a folder shared by a team member. case team /// Anyone can be a member of a folder shared by a team member. @@ -874,51 +1095,61 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try SharedFolderMemberPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedFolderMemberPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedFolderMemberPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedFolderMemberPolicy: \(error)" + } } } - open class SharedFolderMemberPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedFolderMemberPolicy) -> JSON { + + public class SharedFolderMemberPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedFolderMemberPolicy) throws -> JSON { switch value { - case .team: - var d = [String: JSON]() - d[".tag"] = .str("team") - return .dictionary(d) - case .anyone: - var d = [String: JSON]() - d[".tag"] = .str("anyone") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedFolderMemberPolicy { + case .team: + var d = [String: JSON]() + d[".tag"] = .str("team") + return .dictionary(d) + case .anyone: + var d = [String: JSON]() + d[".tag"] = .str("anyone") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedFolderMemberPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "team": - return SharedFolderMemberPolicy.team - case "anyone": - return SharedFolderMemberPolicy.anyone - case "other": - return SharedFolderMemberPolicy.other - default: - return SharedFolderMemberPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "team": + return SharedFolderMemberPolicy.team + case "anyone": + return SharedFolderMemberPolicy.anyone + case "other": + return SharedFolderMemberPolicy.other default: - fatalError("Failed to deserialize") + return SharedFolderMemberPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedFolderMemberPolicy.self, json: json) } } } /// Policy governing the visibility of shared links. This policy can apply to newly created shared links, or all /// shared links. - public enum SharedLinkCreatePolicy: CustomStringConvertible { + public enum SharedLinkCreatePolicy: CustomStringConvertible, JSONRepresentable { /// By default, anyone can access newly created shared links. No login will be required to access the shared /// links unless overridden. case defaultPublic @@ -934,62 +1165,72 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try SharedLinkCreatePolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SharedLinkCreatePolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SharedLinkCreatePolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SharedLinkCreatePolicy: \(error)" + } } } - open class SharedLinkCreatePolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SharedLinkCreatePolicy) -> JSON { + + public class SharedLinkCreatePolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SharedLinkCreatePolicy) throws -> JSON { switch value { - case .defaultPublic: - var d = [String: JSON]() - d[".tag"] = .str("default_public") - return .dictionary(d) - case .defaultTeamOnly: - var d = [String: JSON]() - d[".tag"] = .str("default_team_only") - return .dictionary(d) - case .teamOnly: - var d = [String: JSON]() - d[".tag"] = .str("team_only") - return .dictionary(d) - case .defaultNoOne: - var d = [String: JSON]() - d[".tag"] = .str("default_no_one") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SharedLinkCreatePolicy { + case .defaultPublic: + var d = [String: JSON]() + d[".tag"] = .str("default_public") + return .dictionary(d) + case .defaultTeamOnly: + var d = [String: JSON]() + d[".tag"] = .str("default_team_only") + return .dictionary(d) + case .teamOnly: + var d = [String: JSON]() + d[".tag"] = .str("team_only") + return .dictionary(d) + case .defaultNoOne: + var d = [String: JSON]() + d[".tag"] = .str("default_no_one") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SharedLinkCreatePolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "default_public": - return SharedLinkCreatePolicy.defaultPublic - case "default_team_only": - return SharedLinkCreatePolicy.defaultTeamOnly - case "team_only": - return SharedLinkCreatePolicy.teamOnly - case "default_no_one": - return SharedLinkCreatePolicy.defaultNoOne - case "other": - return SharedLinkCreatePolicy.other - default: - return SharedLinkCreatePolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "default_public": + return SharedLinkCreatePolicy.defaultPublic + case "default_team_only": + return SharedLinkCreatePolicy.defaultTeamOnly + case "team_only": + return SharedLinkCreatePolicy.teamOnly + case "default_no_one": + return SharedLinkCreatePolicy.defaultNoOne + case "other": + return SharedLinkCreatePolicy.other default: - fatalError("Failed to deserialize") + return SharedLinkCreatePolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SharedLinkCreatePolicy.self, json: json) } } } /// The ShowcaseDownloadPolicy union - public enum ShowcaseDownloadPolicy: CustomStringConvertible { + public enum ShowcaseDownloadPolicy: CustomStringConvertible, JSONRepresentable { /// Do not allow files to be downloaded from Showcases. case disabled /// Allow files to be downloaded from Showcases. @@ -997,50 +1238,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try ShowcaseDownloadPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseDownloadPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseDownloadPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseDownloadPolicy: \(error)" + } } } - open class ShowcaseDownloadPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseDownloadPolicy) -> JSON { + + public class ShowcaseDownloadPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseDownloadPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShowcaseDownloadPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShowcaseDownloadPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ShowcaseDownloadPolicy.disabled - case "enabled": - return ShowcaseDownloadPolicy.enabled - case "other": - return ShowcaseDownloadPolicy.other - default: - return ShowcaseDownloadPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ShowcaseDownloadPolicy.disabled + case "enabled": + return ShowcaseDownloadPolicy.enabled + case "other": + return ShowcaseDownloadPolicy.other default: - fatalError("Failed to deserialize") + return ShowcaseDownloadPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ShowcaseDownloadPolicy.self, json: json) } } } /// The ShowcaseEnabledPolicy union - public enum ShowcaseEnabledPolicy: CustomStringConvertible { + public enum ShowcaseEnabledPolicy: CustomStringConvertible, JSONRepresentable { /// Showcase is disabled. case disabled /// Showcase is enabled. @@ -1048,50 +1299,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try ShowcaseEnabledPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseEnabledPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseEnabledPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseEnabledPolicy: \(error)" + } } } - open class ShowcaseEnabledPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseEnabledPolicy) -> JSON { + + public class ShowcaseEnabledPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseEnabledPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShowcaseEnabledPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShowcaseEnabledPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ShowcaseEnabledPolicy.disabled - case "enabled": - return ShowcaseEnabledPolicy.enabled - case "other": - return ShowcaseEnabledPolicy.other - default: - return ShowcaseEnabledPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ShowcaseEnabledPolicy.disabled + case "enabled": + return ShowcaseEnabledPolicy.enabled + case "other": + return ShowcaseEnabledPolicy.other default: - fatalError("Failed to deserialize") + return ShowcaseEnabledPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ShowcaseEnabledPolicy.self, json: json) } } } /// The ShowcaseExternalSharingPolicy union - public enum ShowcaseExternalSharingPolicy: CustomStringConvertible { + public enum ShowcaseExternalSharingPolicy: CustomStringConvertible, JSONRepresentable { /// Do not allow showcases to be shared with people not on the team. case disabled /// Allow showcases to be shared with people not on the team. @@ -1099,50 +1360,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try ShowcaseExternalSharingPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(ShowcaseExternalSharingPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ShowcaseExternalSharingPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ShowcaseExternalSharingPolicy: \(error)" + } } } - open class ShowcaseExternalSharingPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: ShowcaseExternalSharingPolicy) -> JSON { + + public class ShowcaseExternalSharingPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ShowcaseExternalSharingPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> ShowcaseExternalSharingPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> ShowcaseExternalSharingPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return ShowcaseExternalSharingPolicy.disabled - case "enabled": - return ShowcaseExternalSharingPolicy.enabled - case "other": - return ShowcaseExternalSharingPolicy.other - default: - return ShowcaseExternalSharingPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return ShowcaseExternalSharingPolicy.disabled + case "enabled": + return ShowcaseExternalSharingPolicy.enabled + case "other": + return ShowcaseExternalSharingPolicy.other default: - fatalError("Failed to deserialize") + return ShowcaseExternalSharingPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: ShowcaseExternalSharingPolicy.self, json: json) } } } /// The SmartSyncPolicy union - public enum SmartSyncPolicy: CustomStringConvertible { + public enum SmartSyncPolicy: CustomStringConvertible, JSONRepresentable { /// The specified content will be synced as local files by default. case local /// The specified content will be synced as on-demand files by default. @@ -1150,50 +1421,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try SmartSyncPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmartSyncPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmartSyncPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmartSyncPolicy: \(error)" + } } } - open class SmartSyncPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmartSyncPolicy) -> JSON { + + public class SmartSyncPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmartSyncPolicy) throws -> JSON { switch value { - case .local: - var d = [String: JSON]() - d[".tag"] = .str("local") - return .dictionary(d) - case .onDemand: - var d = [String: JSON]() - d[".tag"] = .str("on_demand") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SmartSyncPolicy { + case .local: + var d = [String: JSON]() + d[".tag"] = .str("local") + return .dictionary(d) + case .onDemand: + var d = [String: JSON]() + d[".tag"] = .str("on_demand") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SmartSyncPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "local": - return SmartSyncPolicy.local - case "on_demand": - return SmartSyncPolicy.onDemand - case "other": - return SmartSyncPolicy.other - default: - return SmartSyncPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "local": + return SmartSyncPolicy.local + case "on_demand": + return SmartSyncPolicy.onDemand + case "other": + return SmartSyncPolicy.other default: - fatalError("Failed to deserialize") + return SmartSyncPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SmartSyncPolicy.self, json: json) } } } /// The SmarterSmartSyncPolicyState union - public enum SmarterSmartSyncPolicyState: CustomStringConvertible { + public enum SmarterSmartSyncPolicyState: CustomStringConvertible, JSONRepresentable { /// Smarter Smart Sync feature is disabled. case disabled /// Smarter Smart Sync feature is enabled. @@ -1201,50 +1482,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try SmarterSmartSyncPolicyStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SmarterSmartSyncPolicyStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SmarterSmartSyncPolicyStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SmarterSmartSyncPolicyState: \(error)" + } } } - open class SmarterSmartSyncPolicyStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SmarterSmartSyncPolicyState) -> JSON { + + public class SmarterSmartSyncPolicyStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SmarterSmartSyncPolicyState) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SmarterSmartSyncPolicyState { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SmarterSmartSyncPolicyState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return SmarterSmartSyncPolicyState.disabled - case "enabled": - return SmarterSmartSyncPolicyState.enabled - case "other": - return SmarterSmartSyncPolicyState.other - default: - return SmarterSmartSyncPolicyState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return SmarterSmartSyncPolicyState.disabled + case "enabled": + return SmarterSmartSyncPolicyState.enabled + case "other": + return SmarterSmartSyncPolicyState.other default: - fatalError("Failed to deserialize") + return SmarterSmartSyncPolicyState.other + } + default: + throw JSONSerializerError.deserializeError(type: SmarterSmartSyncPolicyState.self, json: json) } } } /// The SsoPolicy union - public enum SsoPolicy: CustomStringConvertible { + public enum SsoPolicy: CustomStringConvertible, JSONRepresentable { /// Users will be able to sign in with their Dropbox credentials. case disabled /// Users will be able to sign in with either their Dropbox or single sign-on credentials. @@ -1254,56 +1545,66 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try SsoPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SsoPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SsoPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SsoPolicy: \(error)" + } } } - open class SsoPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SsoPolicy) -> JSON { + + public class SsoPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SsoPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .optional: - var d = [String: JSON]() - d[".tag"] = .str("optional") - return .dictionary(d) - case .required: - var d = [String: JSON]() - d[".tag"] = .str("required") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SsoPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .optional: + var d = [String: JSON]() + d[".tag"] = .str("optional") + return .dictionary(d) + case .required: + var d = [String: JSON]() + d[".tag"] = .str("required") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SsoPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return SsoPolicy.disabled - case "optional": - return SsoPolicy.optional - case "required": - return SsoPolicy.required - case "other": - return SsoPolicy.other - default: - return SsoPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return SsoPolicy.disabled + case "optional": + return SsoPolicy.optional + case "required": + return SsoPolicy.required + case "other": + return SsoPolicy.other default: - fatalError("Failed to deserialize") + return SsoPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SsoPolicy.self, json: json) } } } /// The SuggestMembersPolicy union - public enum SuggestMembersPolicy: CustomStringConvertible { + public enum SuggestMembersPolicy: CustomStringConvertible, JSONRepresentable { /// Suggest members is disabled. case disabled /// Suggest members is enabled. @@ -1311,98 +1612,124 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try SuggestMembersPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SuggestMembersPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SuggestMembersPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for SuggestMembersPolicy: \(error)" + } } } - open class SuggestMembersPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SuggestMembersPolicy) -> JSON { + + public class SuggestMembersPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SuggestMembersPolicy) throws -> JSON { switch value { - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .enabled: - var d = [String: JSON]() - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> SuggestMembersPolicy { + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .enabled: + var d = [String: JSON]() + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> SuggestMembersPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "disabled": - return SuggestMembersPolicy.disabled - case "enabled": - return SuggestMembersPolicy.enabled - case "other": - return SuggestMembersPolicy.other - default: - return SuggestMembersPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "disabled": + return SuggestMembersPolicy.disabled + case "enabled": + return SuggestMembersPolicy.enabled + case "other": + return SuggestMembersPolicy.other default: - fatalError("Failed to deserialize") + return SuggestMembersPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: SuggestMembersPolicy.self, json: json) } } } /// Policies governing team members. - open class TeamMemberPolicies: CustomStringConvertible { + public class TeamMemberPolicies: CustomStringConvertible, JSONRepresentable { /// Policies governing sharing. public let sharing: TeamPolicies.TeamSharingPolicies /// This describes the Enterprise Mobility Management (EMM) state for this team. This information can be used to - /// understand if an organization is integrating with a third-party EMM vendor to further manage and apply - /// restrictions upon the team's Dropbox usage on mobile devices. This is a new feature and in the future we'll - /// be adding more new fields and additional documentation. + /// understand if an organization is integrating with a third-party EMM vendor to further manage and + /// apply restrictions upon the team's Dropbox usage on mobile devices. This is a new feature and in the + /// future we'll be adding more new fields and additional documentation. public let emmState: TeamPolicies.EmmState /// The admin policy around the Dropbox Office Add-In for this team. public let officeAddin: TeamPolicies.OfficeAddInPolicy /// The team policy on if teammembers are allowed to suggest users for admins to invite to the team. public let suggestMembersPolicy: TeamPolicies.SuggestMembersPolicy - public init(sharing: TeamPolicies.TeamSharingPolicies, emmState: TeamPolicies.EmmState, officeAddin: TeamPolicies.OfficeAddInPolicy, suggestMembersPolicy: TeamPolicies.SuggestMembersPolicy) { + public init( + sharing: TeamPolicies.TeamSharingPolicies, + emmState: TeamPolicies.EmmState, + officeAddin: TeamPolicies.OfficeAddInPolicy, + suggestMembersPolicy: TeamPolicies.SuggestMembersPolicy + ) { self.sharing = sharing self.emmState = emmState self.officeAddin = officeAddin self.suggestMembersPolicy = suggestMembersPolicy } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamMemberPoliciesSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamMemberPoliciesSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamMemberPoliciesSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamMemberPolicies: \(error)" + } } } - open class TeamMemberPoliciesSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamMemberPolicies) -> JSON { - let output = [ - "sharing": TeamPolicies.TeamSharingPoliciesSerializer().serialize(value.sharing), - "emm_state": TeamPolicies.EmmStateSerializer().serialize(value.emmState), - "office_addin": TeamPolicies.OfficeAddInPolicySerializer().serialize(value.officeAddin), - "suggest_members_policy": TeamPolicies.SuggestMembersPolicySerializer().serialize(value.suggestMembersPolicy), + + public class TeamMemberPoliciesSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamMemberPolicies) throws -> JSON { + let output = [ + "sharing": try TeamPolicies.TeamSharingPoliciesSerializer().serialize(value.sharing), + "emm_state": try TeamPolicies.EmmStateSerializer().serialize(value.emmState), + "office_addin": try TeamPolicies.OfficeAddInPolicySerializer().serialize(value.officeAddin), + "suggest_members_policy": try TeamPolicies.SuggestMembersPolicySerializer().serialize(value.suggestMembersPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamMemberPolicies { + + public func deserialize(_ json: JSON) throws -> TeamMemberPolicies { switch json { - case .dictionary(let dict): - let sharing = TeamPolicies.TeamSharingPoliciesSerializer().deserialize(dict["sharing"] ?? .null) - let emmState = TeamPolicies.EmmStateSerializer().deserialize(dict["emm_state"] ?? .null) - let officeAddin = TeamPolicies.OfficeAddInPolicySerializer().deserialize(dict["office_addin"] ?? .null) - let suggestMembersPolicy = TeamPolicies.SuggestMembersPolicySerializer().deserialize(dict["suggest_members_policy"] ?? .null) - return TeamMemberPolicies(sharing: sharing, emmState: emmState, officeAddin: officeAddin, suggestMembersPolicy: suggestMembersPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharing = try TeamPolicies.TeamSharingPoliciesSerializer().deserialize(dict["sharing"] ?? .null) + let emmState = try TeamPolicies.EmmStateSerializer().deserialize(dict["emm_state"] ?? .null) + let officeAddin = try TeamPolicies.OfficeAddInPolicySerializer().deserialize(dict["office_addin"] ?? .null) + let suggestMembersPolicy = try TeamPolicies.SuggestMembersPolicySerializer().deserialize(dict["suggest_members_policy"] ?? .null) + return TeamMemberPolicies(sharing: sharing, emmState: emmState, officeAddin: officeAddin, suggestMembersPolicy: suggestMembersPolicy) + default: + throw JSONSerializerError.deserializeError(type: TeamMemberPolicies.self, json: json) } } } /// Policies governing sharing within and outside of the team. - open class TeamSharingPolicies: CustomStringConvertible { + public class TeamSharingPolicies: CustomStringConvertible, JSONRepresentable { /// Who can join folders shared by team members. public let sharedFolderMemberPolicy: TeamPolicies.SharedFolderMemberPolicy /// Which shared folders team members can join. @@ -1411,43 +1738,74 @@ open class TeamPolicies { public let sharedLinkCreatePolicy: TeamPolicies.SharedLinkCreatePolicy /// Who can create groups. public let groupCreationPolicy: TeamPolicies.GroupCreation - public init(sharedFolderMemberPolicy: TeamPolicies.SharedFolderMemberPolicy, sharedFolderJoinPolicy: TeamPolicies.SharedFolderJoinPolicy, sharedLinkCreatePolicy: TeamPolicies.SharedLinkCreatePolicy, groupCreationPolicy: TeamPolicies.GroupCreation) { + /// Who can view links to content in shared folders. + public let sharedFolderLinkRestrictionPolicy: TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy + public init( + sharedFolderMemberPolicy: TeamPolicies.SharedFolderMemberPolicy, + sharedFolderJoinPolicy: TeamPolicies.SharedFolderJoinPolicy, + sharedLinkCreatePolicy: TeamPolicies.SharedLinkCreatePolicy, + groupCreationPolicy: TeamPolicies.GroupCreation, + sharedFolderLinkRestrictionPolicy: TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy + ) { self.sharedFolderMemberPolicy = sharedFolderMemberPolicy self.sharedFolderJoinPolicy = sharedFolderJoinPolicy self.sharedLinkCreatePolicy = sharedLinkCreatePolicy self.groupCreationPolicy = groupCreationPolicy + self.sharedFolderLinkRestrictionPolicy = sharedFolderLinkRestrictionPolicy + } + + func json() throws -> JSON { + try TeamSharingPoliciesSerializer().serialize(self) } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSharingPoliciesSerializer().serialize(self)))" + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSharingPoliciesSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSharingPolicies: \(error)" + } } } - open class TeamSharingPoliciesSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSharingPolicies) -> JSON { - let output = [ - "shared_folder_member_policy": TeamPolicies.SharedFolderMemberPolicySerializer().serialize(value.sharedFolderMemberPolicy), - "shared_folder_join_policy": TeamPolicies.SharedFolderJoinPolicySerializer().serialize(value.sharedFolderJoinPolicy), - "shared_link_create_policy": TeamPolicies.SharedLinkCreatePolicySerializer().serialize(value.sharedLinkCreatePolicy), - "group_creation_policy": TeamPolicies.GroupCreationSerializer().serialize(value.groupCreationPolicy), + + public class TeamSharingPoliciesSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSharingPolicies) throws -> JSON { + let output = [ + "shared_folder_member_policy": try TeamPolicies.SharedFolderMemberPolicySerializer().serialize(value.sharedFolderMemberPolicy), + "shared_folder_join_policy": try TeamPolicies.SharedFolderJoinPolicySerializer().serialize(value.sharedFolderJoinPolicy), + "shared_link_create_policy": try TeamPolicies.SharedLinkCreatePolicySerializer().serialize(value.sharedLinkCreatePolicy), + "group_creation_policy": try TeamPolicies.GroupCreationSerializer().serialize(value.groupCreationPolicy), + "shared_folder_link_restriction_policy": try TeamPolicies.SharedFolderBlanketLinkRestrictionPolicySerializer() + .serialize(value.sharedFolderLinkRestrictionPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSharingPolicies { + + public func deserialize(_ json: JSON) throws -> TeamSharingPolicies { switch json { - case .dictionary(let dict): - let sharedFolderMemberPolicy = TeamPolicies.SharedFolderMemberPolicySerializer().deserialize(dict["shared_folder_member_policy"] ?? .null) - let sharedFolderJoinPolicy = TeamPolicies.SharedFolderJoinPolicySerializer().deserialize(dict["shared_folder_join_policy"] ?? .null) - let sharedLinkCreatePolicy = TeamPolicies.SharedLinkCreatePolicySerializer().deserialize(dict["shared_link_create_policy"] ?? .null) - let groupCreationPolicy = TeamPolicies.GroupCreationSerializer().deserialize(dict["group_creation_policy"] ?? .null) - return TeamSharingPolicies(sharedFolderMemberPolicy: sharedFolderMemberPolicy, sharedFolderJoinPolicy: sharedFolderJoinPolicy, sharedLinkCreatePolicy: sharedLinkCreatePolicy, groupCreationPolicy: groupCreationPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let sharedFolderMemberPolicy = try TeamPolicies.SharedFolderMemberPolicySerializer() + .deserialize(dict["shared_folder_member_policy"] ?? .null) + let sharedFolderJoinPolicy = try TeamPolicies.SharedFolderJoinPolicySerializer().deserialize(dict["shared_folder_join_policy"] ?? .null) + let sharedLinkCreatePolicy = try TeamPolicies.SharedLinkCreatePolicySerializer().deserialize(dict["shared_link_create_policy"] ?? .null) + let groupCreationPolicy = try TeamPolicies.GroupCreationSerializer().deserialize(dict["group_creation_policy"] ?? .null) + let sharedFolderLinkRestrictionPolicy = try TeamPolicies.SharedFolderBlanketLinkRestrictionPolicySerializer() + .deserialize(dict["shared_folder_link_restriction_policy"] ?? .null) + return TeamSharingPolicies( + sharedFolderMemberPolicy: sharedFolderMemberPolicy, + sharedFolderJoinPolicy: sharedFolderJoinPolicy, + sharedLinkCreatePolicy: sharedLinkCreatePolicy, + groupCreationPolicy: groupCreationPolicy, + sharedFolderLinkRestrictionPolicy: sharedFolderLinkRestrictionPolicy + ) + default: + throw JSONSerializerError.deserializeError(type: TeamSharingPolicies.self, json: json) } } } /// The TwoStepVerificationPolicy union - public enum TwoStepVerificationPolicy: CustomStringConvertible { + public enum TwoStepVerificationPolicy: CustomStringConvertible, JSONRepresentable { /// Enabled require two factor authorization. case requireTfaEnable /// Disabled require two factor authorization. @@ -1455,50 +1813,60 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try TwoStepVerificationPolicySerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TwoStepVerificationPolicySerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TwoStepVerificationPolicySerializer().serialize(self)))" + } catch { + return "Failed to generate description for TwoStepVerificationPolicy: \(error)" + } } } - open class TwoStepVerificationPolicySerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TwoStepVerificationPolicy) -> JSON { + + public class TwoStepVerificationPolicySerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TwoStepVerificationPolicy) throws -> JSON { switch value { - case .requireTfaEnable: - var d = [String: JSON]() - d[".tag"] = .str("require_tfa_enable") - return .dictionary(d) - case .requireTfaDisable: - var d = [String: JSON]() - d[".tag"] = .str("require_tfa_disable") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TwoStepVerificationPolicy { + case .requireTfaEnable: + var d = [String: JSON]() + d[".tag"] = .str("require_tfa_enable") + return .dictionary(d) + case .requireTfaDisable: + var d = [String: JSON]() + d[".tag"] = .str("require_tfa_disable") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TwoStepVerificationPolicy { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "require_tfa_enable": - return TwoStepVerificationPolicy.requireTfaEnable - case "require_tfa_disable": - return TwoStepVerificationPolicy.requireTfaDisable - case "other": - return TwoStepVerificationPolicy.other - default: - return TwoStepVerificationPolicy.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "require_tfa_enable": + return TwoStepVerificationPolicy.requireTfaEnable + case "require_tfa_disable": + return TwoStepVerificationPolicy.requireTfaDisable + case "other": + return TwoStepVerificationPolicy.other default: - fatalError("Failed to deserialize") + return TwoStepVerificationPolicy.other + } + default: + throw JSONSerializerError.deserializeError(type: TwoStepVerificationPolicy.self, json: json) } } } /// The TwoStepVerificationState union - public enum TwoStepVerificationState: CustomStringConvertible { + public enum TwoStepVerificationState: CustomStringConvertible, JSONRepresentable { /// Enabled require two factor authorization. case required /// Optional require two factor authorization. @@ -1508,52 +1876,61 @@ open class TeamPolicies { /// An unspecified error. case other + func json() throws -> JSON { + try TwoStepVerificationStateSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TwoStepVerificationStateSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TwoStepVerificationStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TwoStepVerificationState: \(error)" + } } } - open class TwoStepVerificationStateSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TwoStepVerificationState) -> JSON { + + public class TwoStepVerificationStateSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TwoStepVerificationState) throws -> JSON { switch value { - case .required: - var d = [String: JSON]() - d[".tag"] = .str("required") - return .dictionary(d) - case .optional: - var d = [String: JSON]() - d[".tag"] = .str("optional") - return .dictionary(d) - case .disabled: - var d = [String: JSON]() - d[".tag"] = .str("disabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) - } - } - open func deserialize(_ json: JSON) -> TwoStepVerificationState { + case .required: + var d = [String: JSON]() + d[".tag"] = .str("required") + return .dictionary(d) + case .optional: + var d = [String: JSON]() + d[".tag"] = .str("optional") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> TwoStepVerificationState { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "required": - return TwoStepVerificationState.required - case "optional": - return TwoStepVerificationState.optional - case "disabled": - return TwoStepVerificationState.disabled - case "other": - return TwoStepVerificationState.other - default: - return TwoStepVerificationState.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "required": + return TwoStepVerificationState.required + case "optional": + return TwoStepVerificationState.optional + case "disabled": + return TwoStepVerificationState.disabled + case "other": + return TwoStepVerificationState.other default: - fatalError("Failed to deserialize") + return TwoStepVerificationState.other + } + default: + throw JSONSerializerError.deserializeError(type: TwoStepVerificationState.self, json: json) } } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/TeamRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/TeamRoutes.swift index 0f9ba0348..67e66bf65 100644 --- a/Source/SwiftyDropbox/Shared/Generated/TeamRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/TeamRoutes.swift @@ -7,46 +7,73 @@ import Foundation /// Routes for the team namespace -open class TeamRoutes { +/// For Objective-C compatible routes see DBTeamRoutes +public class TeamRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// List all device sessions of a team's member. /// + /// - scope: sessions.list + /// /// - parameter teamMemberId: The team's member id. /// - parameter includeWebSessions: Whether to list web sessions of the team's member. /// - parameter includeDesktopClients: Whether to list linked desktop devices of the team's member. /// - parameter includeMobileClients: Whether to list linked mobile devices of the team's member. /// - /// - returns: Through the response callback, the caller will receive a `Team.ListMemberDevicesResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ListMemberDevicesResult` object on /// success or a `Team.ListMemberDevicesError` object on failure. - @discardableResult open func devicesListMemberDevices(teamMemberId: String, includeWebSessions: Bool = true, includeDesktopClients: Bool = true, includeMobileClients: Bool = true) -> RpcRequest { + @discardableResult public func devicesListMemberDevices( + teamMemberId: String, + includeWebSessions: Bool = true, + includeDesktopClients: Bool = true, + includeMobileClients: Bool = true + ) -> RpcRequest { let route = Team.devicesListMemberDevices - let serverArgs = Team.ListMemberDevicesArg(teamMemberId: teamMemberId, includeWebSessions: includeWebSessions, includeDesktopClients: includeDesktopClients, includeMobileClients: includeMobileClients) + let serverArgs = Team.ListMemberDevicesArg( + teamMemberId: teamMemberId, + includeWebSessions: includeWebSessions, + includeDesktopClients: includeDesktopClients, + includeMobileClients: includeMobileClients + ) return client.request(route, serverArgs: serverArgs) } /// List all device sessions of a team. Permission : Team member file access. /// + /// - scope: sessions.list + /// /// - parameter cursor: At the first call to the devicesListMembersDevices the cursor shouldn't be passed. Then, if - /// the result of the call includes a cursor, the following requests should include the received cursors in order to - /// receive the next sub list of team devices. + /// the result of the call includes a cursor, the following requests should include the received cursors in + /// order to receive the next sub list of team devices. /// - parameter includeWebSessions: Whether to list web sessions of the team members. /// - parameter includeDesktopClients: Whether to list desktop clients of the team members. /// - parameter includeMobileClients: Whether to list mobile clients of the team members. /// - /// - returns: Through the response callback, the caller will receive a `Team.ListMembersDevicesResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ListMembersDevicesResult` object on /// success or a `Team.ListMembersDevicesError` object on failure. - @discardableResult open func devicesListMembersDevices(cursor: String? = nil, includeWebSessions: Bool = true, includeDesktopClients: Bool = true, includeMobileClients: Bool = true) -> RpcRequest { + @discardableResult public func devicesListMembersDevices( + cursor: String? = nil, + includeWebSessions: Bool = true, + includeDesktopClients: Bool = true, + includeMobileClients: Bool = true + ) -> RpcRequest { let route = Team.devicesListMembersDevices - let serverArgs = Team.ListMembersDevicesArg(cursor: cursor, includeWebSessions: includeWebSessions, includeDesktopClients: includeDesktopClients, includeMobileClients: includeMobileClients) + let serverArgs = Team.ListMembersDevicesArg( + cursor: cursor, + includeWebSessions: includeWebSessions, + includeDesktopClients: includeDesktopClients, + includeMobileClients: includeMobileClients + ) return client.request(route, serverArgs: serverArgs) } /// List all device sessions of a team. Permission : Team member file access. /// + /// - scope: sessions.list + /// /// - parameter cursor: At the first call to the devicesListTeamDevices the cursor shouldn't be passed. Then, if the /// result of the call includes a cursor, the following requests should include the received cursors in order to /// receive the next sub list of team devices. @@ -54,22 +81,37 @@ open class TeamRoutes { /// - parameter includeDesktopClients: Whether to list desktop clients of the team members. /// - parameter includeMobileClients: Whether to list mobile clients of the team members. /// - /// - returns: Through the response callback, the caller will receive a `Team.ListTeamDevicesResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ListTeamDevicesResult` object on /// success or a `Team.ListTeamDevicesError` object on failure. - @available(*, unavailable, message:"devicesListTeamDevices is deprecated. Use devicesListMembersDevices.") - @discardableResult open func devicesListTeamDevices(cursor: String? = nil, includeWebSessions: Bool = true, includeDesktopClients: Bool = true, includeMobileClients: Bool = true) -> RpcRequest { + @available(*, unavailable, message: "devicesListTeamDevices is deprecated. Use devicesListMembersDevices.") + @discardableResult public func devicesListTeamDevices( + cursor: String? = nil, + includeWebSessions: Bool = true, + includeDesktopClients: Bool = true, + includeMobileClients: Bool = true + ) -> RpcRequest { let route = Team.devicesListTeamDevices - let serverArgs = Team.ListTeamDevicesArg(cursor: cursor, includeWebSessions: includeWebSessions, includeDesktopClients: includeDesktopClients, includeMobileClients: includeMobileClients) + let serverArgs = Team.ListTeamDevicesArg( + cursor: cursor, + includeWebSessions: includeWebSessions, + includeDesktopClients: includeDesktopClients, + includeMobileClients: includeMobileClients + ) return client.request(route, serverArgs: serverArgs) } /// Revoke a device session of a team's member. /// + /// - scope: sessions.modify + /// /// - parameter revokeDeviceSessionArg: The RevokeDeviceSessionArg union /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.RevokeDeviceSessionError` object on failure. - @discardableResult open func devicesRevokeDeviceSession(revokeDeviceSessionArg: Team.RevokeDeviceSessionArg) -> RpcRequest { + @discardableResult public func devicesRevokeDeviceSession( + revokeDeviceSessionArg: Team + .RevokeDeviceSessionArg + ) -> RpcRequest { let route = Team.devicesRevokeDeviceSession let serverArgs = revokeDeviceSessionArg return client.request(route, serverArgs: serverArgs) @@ -77,10 +119,13 @@ open class TeamRoutes { /// Revoke a list of device sessions of team members. /// + /// - scope: sessions.modify + /// /// - /// - returns: Through the response callback, the caller will receive a `Team.RevokeDeviceSessionBatchResult` - /// object on success or a `Team.RevokeDeviceSessionBatchError` object on failure. - @discardableResult open func devicesRevokeDeviceSessionBatch(revokeDevices: Array) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.RevokeDeviceSessionBatchResult` object + /// on success or a `Team.RevokeDeviceSessionBatchError` object on failure. + @discardableResult public func devicesRevokeDeviceSessionBatch(revokeDevices: [Team.RevokeDeviceSessionArg]) + -> RpcRequest { let route = Team.devicesRevokeDeviceSessionBatch let serverArgs = Team.RevokeDeviceSessionBatchArg(revokeDevices: revokeDevices) return client.request(route, serverArgs: serverArgs) @@ -89,12 +134,15 @@ open class TeamRoutes { /// Get the values for one or more featues. This route allows you to check your account's capability for what /// feature you can access or what value you have for certain features. Permission : Team information. /// + /// - scope: team_info.read + /// /// - parameter features: A list of features in Feature. If the list is empty, this route will return /// FeaturesGetValuesBatchError. /// - /// - returns: Through the response callback, the caller will receive a `Team.FeaturesGetValuesBatchResult` object + /// - returns: Through the response callback, the caller will receive a `Team.FeaturesGetValuesBatchResult` object /// on success or a `Team.FeaturesGetValuesBatchError` object on failure. - @discardableResult open func featuresGetValues(features: Array) -> RpcRequest { + @discardableResult public func featuresGetValues(features: [Team.Feature]) + -> RpcRequest { let route = Team.featuresGetValues let serverArgs = Team.FeaturesGetValuesBatchArg(features: features) return client.request(route, serverArgs: serverArgs) @@ -102,38 +150,57 @@ open class TeamRoutes { /// Retrieves information about a team. /// + /// - scope: team_info.read + /// /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamGetInfoResult` object on success + /// - returns: Through the response callback, the caller will receive a `Team.TeamGetInfoResult` object on success /// or a `Void` object on failure. - @discardableResult open func getInfo() -> RpcRequest { + @discardableResult public func getInfo() -> RpcRequest { let route = Team.getInfo return client.request(route) } /// Creates a new, empty group, with a requested name. Permission : Team member management. /// + /// - scope: groups.write + /// /// - parameter groupName: Group name. /// - parameter addCreatorAsOwner: Automatically add the creator of the group. /// - parameter groupExternalId: The creator of a team can associate an arbitrary external ID to the group. /// - parameter groupManagementType: Whether the team can be managed by selected users, or only by team admins. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a + /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a /// `Team.GroupCreateError` object on failure. - @discardableResult open func groupsCreate(groupName: String, addCreatorAsOwner: Bool = false, groupExternalId: String? = nil, groupManagementType: TeamCommon.GroupManagementType? = nil) -> RpcRequest { + @discardableResult public func groupsCreate( + groupName: String, + addCreatorAsOwner: Bool = false, + groupExternalId: String? = nil, + groupManagementType: TeamCommon.GroupManagementType? = nil + ) -> RpcRequest { let route = Team.groupsCreate - let serverArgs = Team.GroupCreateArg(groupName: groupName, addCreatorAsOwner: addCreatorAsOwner, groupExternalId: groupExternalId, groupManagementType: groupManagementType) + let serverArgs = Team.GroupCreateArg( + groupName: groupName, + addCreatorAsOwner: addCreatorAsOwner, + groupExternalId: groupExternalId, + groupManagementType: groupManagementType + ) return client.request(route, serverArgs: serverArgs) } /// Deletes a group. The group is deleted immediately. However the revoking of group-owned resources may take - /// additional time. Use the groupsJobStatusGet to determine whether this process has completed. Permission : Team - /// member management. + /// additional time. Use the groupsJobStatusGet to determine whether this process has completed. Permission : + /// Team member management. + /// + /// - scope: groups.write /// /// - parameter groupSelector: Argument for selecting a single group, either by group_id or by external group ID. /// - /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success /// or a `Team.GroupDeleteError` object on failure. - @discardableResult open func groupsDelete(groupSelector: Team.GroupSelector) -> RpcRequest { + @discardableResult public func groupsDelete( + groupSelector: Team + .GroupSelector + ) -> RpcRequest { let route = Team.groupsDelete let serverArgs = groupSelector return client.request(route, serverArgs: serverArgs) @@ -142,26 +209,33 @@ open class TeamRoutes { /// Retrieves information about one or more groups. Note that the optional field members in GroupFullInfo is not /// returned for system-managed groups. Permission : Team Information. /// + /// - scope: groups.read + /// /// - parameter groupsSelector: Argument for selecting a list of groups, either by group_ids, or external group IDs. /// - /// - returns: Through the response callback, the caller will receive a `Array` object on + /// - returns: Through the response callback, the caller will receive a `Array` object on /// success or a `Team.GroupsGetInfoError` object on failure. - @discardableResult open func groupsGetInfo(groupsSelector: Team.GroupsSelector) -> RpcRequest, Team.GroupsGetInfoErrorSerializer> { + @discardableResult public func groupsGetInfo( + groupsSelector: Team + .GroupsSelector + ) -> RpcRequest, Team.GroupsGetInfoErrorSerializer> { let route = Team.groupsGetInfo let serverArgs = groupsSelector return client.request(route, serverArgs: serverArgs) } /// Once an async_job_id is returned from groupsDelete, groupsMembersAdd , or groupsMembersRemove use this method to - /// poll the status of granting/revoking group members' access to group-owned resources. Permission : Team member - /// management. + /// poll the status of granting/revoking group members' access to group-owned resources. Permission : Team + /// member management. + /// + /// - scope: groups.write /// /// - 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 `Async.PollEmptyResult` object on success - /// or a `Team.GroupsPollError` object on failure. - @discardableResult open func groupsJobStatusGet(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Async.PollEmptyResult` object on success or + /// a `Team.GroupsPollError` object on failure. + @discardableResult public func groupsJobStatusGet(asyncJobId: String) -> RpcRequest { let route = Team.groupsJobStatusGet let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -169,11 +243,13 @@ open class TeamRoutes { /// Lists groups on a team. Permission : Team Information. /// + /// - scope: groups.read + /// /// - parameter limit: Number of results to return per call. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupsListResult` object on success - /// or a `Void` object on failure. - @discardableResult open func groupsList(limit: UInt32 = 1000) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.GroupsListResult` object on success or + /// a `Void` object on failure. + @discardableResult public func groupsList(limit: UInt32 = 1_000) -> RpcRequest { let route = Team.groupsList let serverArgs = Team.GroupsListArg(limit: limit) return client.request(route, serverArgs: serverArgs) @@ -182,26 +258,34 @@ open class TeamRoutes { /// Once a cursor has been retrieved from groupsList, use this to paginate through all groups. Permission : Team /// Information. /// + /// - scope: groups.read + /// /// - parameter cursor: Indicates from what point to get the next set of groups. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupsListResult` object on success - /// or a `Team.GroupsListContinueError` object on failure. - @discardableResult open func groupsListContinue(cursor: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.GroupsListResult` object on success or + /// a `Team.GroupsListContinueError` object on failure. + @discardableResult public func groupsListContinue(cursor: String) -> RpcRequest { let route = Team.groupsListContinue let serverArgs = Team.GroupsListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) } /// Adds members to a group. The members are added immediately. However the granting of group-owned resources may - /// take additional time. Use the groupsJobStatusGet to determine whether this process has completed. Permission : - /// Team member management. + /// take additional time. Use the groupsJobStatusGet to determine whether this process has completed. Permission + /// : Team member management. + /// + /// - scope: groups.write /// /// - parameter group: Group to which users will be added. /// - parameter members: List of users to be added to the group. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on /// success or a `Team.GroupMembersAddError` object on failure. - @discardableResult open func groupsMembersAdd(group: Team.GroupSelector, members: Array, returnMembers: Bool = true) -> RpcRequest { + @discardableResult public func groupsMembersAdd( + group: Team.GroupSelector, + members: [Team.MemberAccess], + returnMembers: Bool = true + ) -> RpcRequest { let route = Team.groupsMembersAdd let serverArgs = Team.GroupMembersAddArg(group: group, members: members, returnMembers: returnMembers) return client.request(route, serverArgs: serverArgs) @@ -209,12 +293,17 @@ open class TeamRoutes { /// Lists members of a group. Permission : Team Information. /// + /// - scope: groups.read + /// /// - parameter group: The group whose members are to be listed. /// - parameter limit: Number of results to return per call. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupsMembersListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.GroupsMembersListResult` object on /// success or a `Team.GroupSelectorError` object on failure. - @discardableResult open func groupsMembersList(group: Team.GroupSelector, limit: UInt32 = 1000) -> RpcRequest { + @discardableResult public func groupsMembersList( + group: Team.GroupSelector, + limit: UInt32 = 1_000 + ) -> RpcRequest { let route = Team.groupsMembersList let serverArgs = Team.GroupsMembersListArg(group: group, limit: limit) return client.request(route, serverArgs: serverArgs) @@ -223,11 +312,14 @@ open class TeamRoutes { /// Once a cursor has been retrieved from groupsMembersList, use this to paginate through all members of the group. /// Permission : Team information. /// + /// - scope: groups.read + /// /// - parameter cursor: Indicates from what point to get the next set of groups. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupsMembersListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.GroupsMembersListResult` object on /// success or a `Team.GroupsMembersListContinueError` object on failure. - @discardableResult open func groupsMembersListContinue(cursor: String) -> RpcRequest { + @discardableResult public func groupsMembersListContinue(cursor: String) + -> RpcRequest { let route = Team.groupsMembersListContinue let serverArgs = Team.GroupsMembersListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -235,15 +327,21 @@ open class TeamRoutes { /// Removes members from a group. The members are removed immediately. However the revoking of group-owned resources /// may take additional time. Use the groupsJobStatusGet to determine whether this process has completed. This - /// method permits removing the only owner of a group, even in cases where this is not possible via the web client. - /// Permission : Team member management. + /// method permits removing the only owner of a group, even in cases where this is not possible via the web + /// client. Permission : Team member management. + /// + /// - scope: groups.write /// /// - parameter group: Group from which users will be removed. /// - parameter users: List of users to be removed from the group. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on /// success or a `Team.GroupMembersRemoveError` object on failure. - @discardableResult open func groupsMembersRemove(group: Team.GroupSelector, users: Array, returnMembers: Bool = true) -> RpcRequest { + @discardableResult public func groupsMembersRemove( + group: Team.GroupSelector, + users: [Team.UserSelectorArg], + returnMembers: Bool = true + ) -> RpcRequest { let route = Team.groupsMembersRemove let serverArgs = Team.GroupMembersRemoveArg(group: group, users: users, returnMembers: returnMembers) return client.request(route, serverArgs: serverArgs) @@ -251,13 +349,20 @@ open class TeamRoutes { /// Sets a member's access type in a group. Permission : Team member management. /// + /// - scope: groups.write + /// /// - parameter accessType: New group access type the user will have. /// - parameter returnMembers: Whether to return the list of members in the group. Note that the default value will /// cause all the group members to be returned in the response. This may take a long time for large groups. /// - /// - returns: Through the response callback, the caller will receive a `Array` object on + /// - returns: Through the response callback, the caller will receive a `Array` object on /// success or a `Team.GroupMemberSetAccessTypeError` object on failure. - @discardableResult open func groupsMembersSetAccessType(group: Team.GroupSelector, user: Team.UserSelectorArg, accessType: Team.GroupAccessType, returnMembers: Bool = true) -> RpcRequest, Team.GroupMemberSetAccessTypeErrorSerializer> { + @discardableResult public func groupsMembersSetAccessType( + group: Team.GroupSelector, + user: Team.UserSelectorArg, + accessType: Team.GroupAccessType, + returnMembers: Bool = true + ) -> RpcRequest, Team.GroupMemberSetAccessTypeErrorSerializer> { let route = Team.groupsMembersSetAccessType let serverArgs = Team.GroupMembersSetAccessTypeArg(group: group, user: user, accessType: accessType, returnMembers: returnMembers) return client.request(route, serverArgs: serverArgs) @@ -265,32 +370,54 @@ open class TeamRoutes { /// Updates a group's name and/or external ID. Permission : Team member management. /// + /// - scope: groups.write + /// /// - parameter group: Specify a group. /// - parameter newGroupName: Optional argument. Set group name to this if provided. /// - parameter newGroupExternalId: Optional argument. New group external ID. If the argument is None, the group's /// external_id won't be updated. If the argument is empty string, the group's external id will be cleared. /// - parameter newGroupManagementType: Set new group management type, if provided. /// - /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a + /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a /// `Team.GroupUpdateError` object on failure. - @discardableResult open func groupsUpdate(group: Team.GroupSelector, returnMembers: Bool = true, newGroupName: String? = nil, newGroupExternalId: String? = nil, newGroupManagementType: TeamCommon.GroupManagementType? = nil) -> RpcRequest { + @discardableResult public func groupsUpdate( + group: Team.GroupSelector, + returnMembers: Bool = true, + newGroupName: String? = nil, + newGroupExternalId: String? = nil, + newGroupManagementType: TeamCommon.GroupManagementType? = nil + ) -> RpcRequest { let route = Team.groupsUpdate - let serverArgs = Team.GroupUpdateArgs(group: group, returnMembers: returnMembers, newGroupName: newGroupName, newGroupExternalId: newGroupExternalId, newGroupManagementType: newGroupManagementType) + let serverArgs = Team.GroupUpdateArgs( + group: group, + returnMembers: returnMembers, + newGroupName: newGroupName, + newGroupExternalId: newGroupExternalId, + newGroupManagementType: newGroupManagementType + ) return client.request(route, serverArgs: serverArgs) } /// Creates new legal hold policy. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : /// Team member file access. /// + /// - scope: team_data.governance.write + /// /// - parameter name: Policy name. /// - parameter description_: A description of the legal hold policy. /// - parameter members: List of team member IDs added to the hold. /// - parameter startDate: start date of the legal hold policy. /// - parameter endDate: end date of the legal hold policy. /// - /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or /// a `Team.LegalHoldsPolicyCreateError` object on failure. - @discardableResult open func legalHoldsCreatePolicy(name: String, members: Array, description_: String? = nil, startDate: Date? = nil, endDate: Date? = nil) -> RpcRequest { + @discardableResult public func legalHoldsCreatePolicy( + name: String, + members: [String], + description_: String? = nil, + startDate: Date? = nil, + endDate: Date? = nil + ) -> RpcRequest { let route = Team.legalHoldsCreatePolicy let serverArgs = Team.LegalHoldsPolicyCreateArg(name: name, members: members, description_: description_, startDate: startDate, endDate: endDate) return client.request(route, serverArgs: serverArgs) @@ -299,11 +426,13 @@ open class TeamRoutes { /// Gets a legal hold by Id. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team /// member file access. /// + /// - scope: team_data.governance.write + /// /// - parameter id: The legal hold Id. /// - /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or /// a `Team.LegalHoldsGetPolicyError` object on failure. - @discardableResult open func legalHoldsGetPolicy(id: String) -> RpcRequest { + @discardableResult public func legalHoldsGetPolicy(id: String) -> RpcRequest { let route = Team.legalHoldsGetPolicy let serverArgs = Team.LegalHoldsGetPolicyArg(id: id) return client.request(route, serverArgs: serverArgs) @@ -312,11 +441,14 @@ open class TeamRoutes { /// List the file metadata that's under the hold. Note: Legal Holds is a paid add-on. Not all teams have the /// feature. Permission : Team member file access. /// + /// - scope: team_data.governance.write + /// /// - parameter id: The legal hold Id. /// - /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListHeldRevisionResult` + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListHeldRevisionResult` /// object on success or a `Team.LegalHoldsListHeldRevisionsError` object on failure. - @discardableResult open func legalHoldsListHeldRevisions(id: String) -> RpcRequest { + @discardableResult public func legalHoldsListHeldRevisions(id: String) + -> RpcRequest { let route = Team.legalHoldsListHeldRevisions let serverArgs = Team.LegalHoldsListHeldRevisionsArg(id: id) return client.request(route, serverArgs: serverArgs) @@ -325,13 +457,18 @@ open class TeamRoutes { /// Continue listing the file metadata that's under the hold. Note: Legal Holds is a paid add-on. Not all teams have /// the feature. Permission : Team member file access. /// + /// - scope: team_data.governance.write + /// /// - parameter id: The legal hold Id. /// - parameter cursor: The cursor idicates where to continue reading file metadata entries for the next API call. /// When there are no more entries, the cursor will return none. /// - /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListHeldRevisionResult` + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListHeldRevisionResult` /// object on success or a `Team.LegalHoldsListHeldRevisionsError` object on failure. - @discardableResult open func legalHoldsListHeldRevisionsContinue(id: String, cursor: String? = nil) -> RpcRequest { + @discardableResult public func legalHoldsListHeldRevisionsContinue( + id: String, + cursor: String? = nil + ) -> RpcRequest { let route = Team.legalHoldsListHeldRevisionsContinue let serverArgs = Team.LegalHoldsListHeldRevisionsContinueArg(id: id, cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -340,11 +477,14 @@ open class TeamRoutes { /// Lists legal holds on a team. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : /// Team member file access. /// + /// - scope: team_data.governance.write + /// /// - parameter includeReleased: Whether to return holds that were released. /// - /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListPoliciesResult` object + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListPoliciesResult` object /// on success or a `Team.LegalHoldsListPoliciesError` object on failure. - @discardableResult open func legalHoldsListPolicies(includeReleased: Bool = false) -> RpcRequest { + @discardableResult public func legalHoldsListPolicies(includeReleased: Bool = false) + -> RpcRequest { let route = Team.legalHoldsListPolicies let serverArgs = Team.LegalHoldsListPoliciesArg(includeReleased: includeReleased) return client.request(route, serverArgs: serverArgs) @@ -353,11 +493,13 @@ open class TeamRoutes { /// Releases a legal hold by Id. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : /// Team member file access. /// + /// - scope: team_data.governance.write + /// /// - parameter id: The legal hold Id. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.LegalHoldsPolicyReleaseError` object on failure. - @discardableResult open func legalHoldsReleasePolicy(id: String) -> RpcRequest { + @discardableResult public func legalHoldsReleasePolicy(id: String) -> RpcRequest { let route = Team.legalHoldsReleasePolicy let serverArgs = Team.LegalHoldsPolicyReleaseArg(id: id) return client.request(route, serverArgs: serverArgs) @@ -366,14 +508,21 @@ open class TeamRoutes { /// Updates a legal hold. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team /// member file access. /// + /// - scope: team_data.governance.write + /// /// - parameter id: The legal hold Id. /// - parameter name: Policy new name. /// - parameter description_: Policy new description. /// - parameter members: List of team member IDs to apply the policy on. /// - /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or /// a `Team.LegalHoldsPolicyUpdateError` object on failure. - @discardableResult open func legalHoldsUpdatePolicy(id: String, name: String? = nil, description_: String? = nil, members: Array? = nil) -> RpcRequest { + @discardableResult public func legalHoldsUpdatePolicy( + id: String, + name: String? = nil, + description_: String? = nil, + members: [String]? = nil + ) -> RpcRequest { let route = Team.legalHoldsUpdatePolicy let serverArgs = Team.LegalHoldsPolicyUpdateArg(id: id, name: name, description_: description_, members: members) return client.request(route, serverArgs: serverArgs) @@ -381,11 +530,14 @@ open class TeamRoutes { /// List all linked applications of the team member. Note, this endpoint does not list any team-linked applications. /// + /// - scope: sessions.list + /// /// - parameter teamMemberId: The team member id. /// - /// - returns: Through the response callback, the caller will receive a `Team.ListMemberAppsResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ListMemberAppsResult` object on /// success or a `Team.ListMemberAppsError` object on failure. - @discardableResult open func linkedAppsListMemberLinkedApps(teamMemberId: String) -> RpcRequest { + @discardableResult public func linkedAppsListMemberLinkedApps(teamMemberId: String) + -> RpcRequest { let route = Team.linkedAppsListMemberLinkedApps let serverArgs = Team.ListMemberAppsArg(teamMemberId: teamMemberId) return client.request(route, serverArgs: serverArgs) @@ -394,13 +546,16 @@ open class TeamRoutes { /// List all applications linked to the team members' accounts. Note, this endpoint does not list any team-linked /// applications. /// + /// - scope: sessions.list + /// /// - parameter cursor: At the first call to the linkedAppsListMembersLinkedApps the cursor shouldn't be passed. - /// Then, if the result of the call includes a cursor, the following requests should include the received cursors in - /// order to receive the next sub list of the team applications. + /// Then, if the result of the call includes a cursor, the following requests should include the received + /// cursors in order to receive the next sub list of the team applications. /// - /// - returns: Through the response callback, the caller will receive a `Team.ListMembersAppsResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ListMembersAppsResult` object on /// success or a `Team.ListMembersAppsError` object on failure. - @discardableResult open func linkedAppsListMembersLinkedApps(cursor: String? = nil) -> RpcRequest { + @discardableResult public func linkedAppsListMembersLinkedApps(cursor: String? = nil) + -> RpcRequest { let route = Team.linkedAppsListMembersLinkedApps let serverArgs = Team.ListMembersAppsArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -409,14 +564,17 @@ open class TeamRoutes { /// List all applications linked to the team members' accounts. Note, this endpoint doesn't list any team-linked /// applications. /// + /// - scope: sessions.list + /// /// - parameter cursor: At the first call to the linkedAppsListTeamLinkedApps the cursor shouldn't be passed. Then, - /// if the result of the call includes a cursor, the following requests should include the received cursors in order - /// to receive the next sub list of the team applications. + /// if the result of the call includes a cursor, the following requests should include the received cursors in + /// order to receive the next sub list of the team applications. /// - /// - returns: Through the response callback, the caller will receive a `Team.ListTeamAppsResult` object on success + /// - returns: Through the response callback, the caller will receive a `Team.ListTeamAppsResult` object on success /// or a `Team.ListTeamAppsError` object on failure. - @available(*, unavailable, message:"linkedAppsListTeamLinkedApps is deprecated. Use linkedAppsListMembersLinkedApps.") - @discardableResult open func linkedAppsListTeamLinkedApps(cursor: String? = nil) -> RpcRequest { + @available(*, unavailable, message: "linkedAppsListTeamLinkedApps is deprecated. Use linkedAppsListMembersLinkedApps.") + @discardableResult public func linkedAppsListTeamLinkedApps(cursor: String? = nil) + -> RpcRequest { let route = Team.linkedAppsListTeamLinkedApps let serverArgs = Team.ListTeamAppsArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -424,14 +582,20 @@ open class TeamRoutes { /// Revoke a linked application of the team member. /// + /// - scope: sessions.modify + /// /// - parameter appId: The application's unique id. /// - parameter teamMemberId: The unique id of the member owning the device. /// - parameter keepAppFolder: This flag is not longer supported, the application dedicated folder (in case the /// application uses one) will be kept. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.RevokeLinkedAppError` object on failure. - @discardableResult open func linkedAppsRevokeLinkedApp(appId: String, teamMemberId: String, keepAppFolder: Bool = true) -> RpcRequest { + @discardableResult public func linkedAppsRevokeLinkedApp( + appId: String, + teamMemberId: String, + keepAppFolder: Bool = true + ) -> RpcRequest { let route = Team.linkedAppsRevokeLinkedApp let serverArgs = Team.RevokeLinkedApiAppArg(appId: appId, teamMemberId: teamMemberId, keepAppFolder: keepAppFolder) return client.request(route, serverArgs: serverArgs) @@ -439,10 +603,13 @@ open class TeamRoutes { /// Revoke a list of linked applications of the team members. /// + /// - scope: sessions.modify + /// /// - /// - returns: Through the response callback, the caller will receive a `Team.RevokeLinkedAppBatchResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.RevokeLinkedAppBatchResult` object on /// success or a `Team.RevokeLinkedAppBatchError` object on failure. - @discardableResult open func linkedAppsRevokeLinkedAppBatch(revokeLinkedApp: Array) -> RpcRequest { + @discardableResult public func linkedAppsRevokeLinkedAppBatch(revokeLinkedApp: [Team.RevokeLinkedApiAppArg]) + -> RpcRequest { let route = Team.linkedAppsRevokeLinkedAppBatch let serverArgs = Team.RevokeLinkedApiAppBatchArg(revokeLinkedApp: revokeLinkedApp) return client.request(route, serverArgs: serverArgs) @@ -450,11 +617,14 @@ open class TeamRoutes { /// Add users to member space limits excluded users list. /// + /// - scope: members.write + /// /// - parameter users: List of users to be added/removed. /// - /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on /// success or a `Team.ExcludedUsersUpdateError` object on failure. - @discardableResult open func memberSpaceLimitsExcludedUsersAdd(users: Array? = nil) -> RpcRequest { + @discardableResult public func memberSpaceLimitsExcludedUsersAdd(users: [Team.UserSelectorArg]? = nil) + -> RpcRequest { let route = Team.memberSpaceLimitsExcludedUsersAdd let serverArgs = Team.ExcludedUsersUpdateArg(users: users) return client.request(route, serverArgs: serverArgs) @@ -462,11 +632,14 @@ open class TeamRoutes { /// List member space limits excluded users. /// + /// - scope: members.read + /// /// - parameter limit: Number of results to return per call. /// - /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersListResult` object on /// success or a `Team.ExcludedUsersListError` object on failure. - @discardableResult open func memberSpaceLimitsExcludedUsersList(limit: UInt32 = 1000) -> RpcRequest { + @discardableResult public func memberSpaceLimitsExcludedUsersList(limit: UInt32 = 1_000) + -> RpcRequest { let route = Team.memberSpaceLimitsExcludedUsersList let serverArgs = Team.ExcludedUsersListArg(limit: limit) return client.request(route, serverArgs: serverArgs) @@ -474,11 +647,14 @@ open class TeamRoutes { /// Continue listing member space limits excluded users. /// + /// - scope: members.read + /// /// - parameter cursor: Indicates from what point to get the next set of users. /// - /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersListResult` object on /// success or a `Team.ExcludedUsersListContinueError` object on failure. - @discardableResult open func memberSpaceLimitsExcludedUsersListContinue(cursor: String) -> RpcRequest { + @discardableResult public func memberSpaceLimitsExcludedUsersListContinue(cursor: String) + -> RpcRequest { let route = Team.memberSpaceLimitsExcludedUsersListContinue let serverArgs = Team.ExcludedUsersListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -486,85 +662,111 @@ open class TeamRoutes { /// Remove users from member space limits excluded users list. /// + /// - scope: members.write + /// /// - parameter users: List of users to be added/removed. /// - /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on /// success or a `Team.ExcludedUsersUpdateError` object on failure. - @discardableResult open func memberSpaceLimitsExcludedUsersRemove(users: Array? = nil) -> RpcRequest { + @discardableResult public func memberSpaceLimitsExcludedUsersRemove(users: [Team.UserSelectorArg]? = nil) + -> RpcRequest { let route = Team.memberSpaceLimitsExcludedUsersRemove let serverArgs = Team.ExcludedUsersUpdateArg(users: users) return client.request(route, serverArgs: serverArgs) } - /// Get users custom quota. Returns none as the custom quota if none was set. A maximum of 1000 members can be - /// specified in a single call. + /// Get users custom quota. A maximum of 1000 members can be specified in a single call. Note: to apply a custom + /// space limit, a team admin needs to set a member space limit for the team first. (the team admin can check + /// the settings here: https://www.dropbox.com/team/admin/settings/space). + /// + /// - scope: members.read /// /// - parameter users: List of users. /// - /// - returns: Through the response callback, the caller will receive a `Array` object on + /// - returns: Through the response callback, the caller will receive a `Array` object on /// success or a `Team.CustomQuotaError` object on failure. - @discardableResult open func memberSpaceLimitsGetCustomQuota(users: Array) -> RpcRequest, Team.CustomQuotaErrorSerializer> { + @discardableResult public func memberSpaceLimitsGetCustomQuota(users: [Team.UserSelectorArg]) + -> RpcRequest, Team.CustomQuotaErrorSerializer> { let route = Team.memberSpaceLimitsGetCustomQuota let serverArgs = Team.CustomQuotaUsersArg(users: users) return client.request(route, serverArgs: serverArgs) } - /// Remove users custom quota. A maximum of 1000 members can be specified in a single call. + /// Remove users custom quota. A maximum of 1000 members can be specified in a single call. Note: to apply a custom + /// space limit, a team admin needs to set a member space limit for the team first. (the team admin can check + /// the settings here: https://www.dropbox.com/team/admin/settings/space). + /// + /// - scope: members.write /// /// - parameter users: List of users. /// - /// - returns: Through the response callback, the caller will receive a `Array` - /// object on success or a `Team.CustomQuotaError` object on failure. - @discardableResult open func memberSpaceLimitsRemoveCustomQuota(users: Array) -> RpcRequest, Team.CustomQuotaErrorSerializer> { + /// - returns: Through the response callback, the caller will receive a `Array` object + /// on success or a `Team.CustomQuotaError` object on failure. + @discardableResult public func memberSpaceLimitsRemoveCustomQuota(users: [Team.UserSelectorArg]) + -> RpcRequest, Team.CustomQuotaErrorSerializer> { let route = Team.memberSpaceLimitsRemoveCustomQuota let serverArgs = Team.CustomQuotaUsersArg(users: users) return client.request(route, serverArgs: serverArgs) } /// Set users custom quota. Custom quota has to be at least 15GB. A maximum of 1000 members can be specified in a - /// single call. + /// single call. Note: to apply a custom space limit, a team admin needs to set a member space limit for the + /// team first. (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space). + /// + /// - scope: members.read /// /// - parameter usersAndQuotas: List of users and their custom quotas. /// - /// - returns: Through the response callback, the caller will receive a `Array` object on + /// - returns: Through the response callback, the caller will receive a `Array` object on /// success or a `Team.SetCustomQuotaError` object on failure. - @discardableResult open func memberSpaceLimitsSetCustomQuota(usersAndQuotas: Array) -> RpcRequest, Team.SetCustomQuotaErrorSerializer> { + @discardableResult public func memberSpaceLimitsSetCustomQuota(usersAndQuotas: [Team.UserCustomQuotaArg]) + -> RpcRequest, Team.SetCustomQuotaErrorSerializer> { let route = Team.memberSpaceLimitsSetCustomQuota let serverArgs = Team.SetCustomQuotaArg(usersAndQuotas: usersAndQuotas) return client.request(route, serverArgs: serverArgs) } /// Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single - /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created with - /// the given email address, and that account will be invited to the team. If a personal Dropbox account exists with - /// the email address specified in the call, this call will create a placeholder Dropbox account for the user on the - /// team and send an email inviting the user to migrate their existing personal account onto the team. Team member - /// management apps are required to set an initial given_name and surname for a user to use in the team invitation - /// and for 'Perform as team member' actions taken on the user before they become 'active'. + /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created + /// with the given email address, and that account will be invited to the team. If a personal Dropbox account + /// exists with the email address specified in the call, this call will create a placeholder Dropbox account for + /// the user on the team and send an email inviting the user to migrate their existing personal account onto the + /// team. Team member management apps are required to set an initial given_name and surname for a user to use in + /// the team invitation and for 'Perform as team member' actions taken on the user before they become 'active'. + /// + /// - scope: members.write /// /// - parameter newMembers: Details of new members to be added to the team. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunchV2Result` object on + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunchV2Result` object on /// success or a `Void` object on failure. - @discardableResult open func membersAddV2(newMembers: Array, forceAsync: Bool = false) -> RpcRequest { + @discardableResult public func membersAddV2( + newMembers: [Team.MemberAddV2Arg], + forceAsync: Bool = false + ) -> RpcRequest { let route = Team.membersAddV2 let serverArgs = Team.MembersAddV2Arg(newMembers: newMembers, forceAsync: forceAsync) return client.request(route, serverArgs: serverArgs) } /// Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single - /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created with - /// the given email address, and that account will be invited to the team. If a personal Dropbox account exists with - /// the email address specified in the call, this call will create a placeholder Dropbox account for the user on the - /// team and send an email inviting the user to migrate their existing personal account onto the team. Team member - /// management apps are required to set an initial given_name and surname for a user to use in the team invitation - /// and for 'Perform as team member' actions taken on the user before they become 'active'. + /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created + /// with the given email address, and that account will be invited to the team. If a personal Dropbox account + /// exists with the email address specified in the call, this call will create a placeholder Dropbox account for + /// the user on the team and send an email inviting the user to migrate their existing personal account onto the + /// team. Team member management apps are required to set an initial given_name and surname for a user to use in + /// the team invitation and for 'Perform as team member' actions taken on the user before they become 'active'. + /// + /// - scope: members.write /// /// - parameter newMembers: Details of new members to be added to the team. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunch` object on success - /// or a `Void` object on failure. - @discardableResult open func membersAdd(newMembers: Array, forceAsync: Bool = false) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunch` object on success or + /// a `Void` object on failure. + @discardableResult public func membersAdd( + newMembers: [Team.MemberAddArg], + forceAsync: Bool = false + ) -> RpcRequest { let route = Team.membersAdd let serverArgs = Team.MembersAddArg(newMembers: newMembers, forceAsync: forceAsync) return client.request(route, serverArgs: serverArgs) @@ -573,12 +775,15 @@ open class TeamRoutes { /// Once an async_job_id is returned from membersAddV2 , use this to poll the status of the asynchronous request. /// Permission : Team member management. /// + /// - scope: members.write + /// /// - 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 `Team.MembersAddJobStatusV2Result` object - /// on success or a `Async.PollError` object on failure. - @discardableResult open func membersAddJobStatusGetV2(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddJobStatusV2Result` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func membersAddJobStatusGetV2(asyncJobId: String) + -> RpcRequest { let route = Team.membersAddJobStatusGetV2 let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -587,12 +792,14 @@ open class TeamRoutes { /// Once an async_job_id is returned from membersAdd , use this to poll the status of the asynchronous request. /// Permission : Team member management. /// + /// - scope: members.write + /// /// - 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 `Team.MembersAddJobStatus` object on - /// success or a `Async.PollError` object on failure. - @discardableResult open func membersAddJobStatusGet(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddJobStatus` object on success + /// or a `Async.PollError` object on failure. + @discardableResult public func membersAddJobStatusGet(asyncJobId: String) -> RpcRequest { let route = Team.membersAddJobStatusGet let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -600,11 +807,16 @@ open class TeamRoutes { /// Deletes a team member's profile photo. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of the user whose profile photo will be deleted. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on /// success or a `Team.MembersDeleteProfilePhotoError` object on failure. - @discardableResult open func membersDeleteProfilePhotoV2(user: Team.UserSelectorArg) -> RpcRequest { + @discardableResult public func membersDeleteProfilePhotoV2( + user: Team + .UserSelectorArg + ) -> RpcRequest { let route = Team.membersDeleteProfilePhotoV2 let serverArgs = Team.MembersDeleteProfilePhotoArg(user: user) return client.request(route, serverArgs: serverArgs) @@ -612,11 +824,16 @@ open class TeamRoutes { /// Deletes a team member's profile photo. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of the user whose profile photo will be deleted. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or - /// a `Team.MembersDeleteProfilePhotoError` object on failure. - @discardableResult open func membersDeleteProfilePhoto(user: Team.UserSelectorArg) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or a + /// `Team.MembersDeleteProfilePhotoError` object on failure. + @discardableResult public func membersDeleteProfilePhoto( + user: Team + .UserSelectorArg + ) -> RpcRequest { let route = Team.membersDeleteProfilePhoto let serverArgs = Team.MembersDeleteProfilePhotoArg(user: user) return client.request(route, serverArgs: serverArgs) @@ -625,10 +842,12 @@ open class TeamRoutes { /// Get available TeamMemberRoles for the connected team. To be used with membersSetAdminPermissionsV2. Permission : /// Team member management. /// + /// - scope: members.read /// - /// - returns: Through the response callback, the caller will receive a + /// + /// - returns: Through the response callback, the caller will receive a /// `Team.MembersGetAvailableTeamMemberRolesResult` object on success or a `Void` object on failure. - @discardableResult open func membersGetAvailableTeamMemberRoles() -> RpcRequest { + @discardableResult public func membersGetAvailableTeamMemberRoles() -> RpcRequest { let route = Team.membersGetAvailableTeamMemberRoles return client.request(route) } @@ -636,11 +855,14 @@ open class TeamRoutes { /// Returns information about multiple team members. Permission : Team information This endpoint will return /// idNotFound in MembersGetInfoItem, for IDs (or emails) that cannot be matched to a valid team member. /// + /// - scope: members.read + /// /// - parameter members: List of team members. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersGetInfoV2Result` object on + /// - returns: Through the response callback, the caller will receive a `Team.MembersGetInfoV2Result` object on /// success or a `Team.MembersGetInfoError` object on failure. - @discardableResult open func membersGetInfoV2(members: Array) -> RpcRequest { + @discardableResult public func membersGetInfoV2(members: [Team.UserSelectorArg]) + -> RpcRequest { let route = Team.membersGetInfoV2 let serverArgs = Team.MembersGetInfoV2Arg(members: members) return client.request(route, serverArgs: serverArgs) @@ -649,11 +871,14 @@ open class TeamRoutes { /// Returns information about multiple team members. Permission : Team information This endpoint will return /// idNotFound in MembersGetInfoItem, for IDs (or emails) that cannot be matched to a valid team member. /// + /// - scope: members.read + /// /// - parameter members: List of team members. /// - /// - returns: Through the response callback, the caller will receive a `Array` object on + /// - returns: Through the response callback, the caller will receive a `Array` object on /// success or a `Team.MembersGetInfoError` object on failure. - @discardableResult open func membersGetInfo(members: Array) -> RpcRequest, Team.MembersGetInfoErrorSerializer> { + @discardableResult public func membersGetInfo(members: [Team.UserSelectorArg]) + -> RpcRequest, Team.MembersGetInfoErrorSerializer> { let route = Team.membersGetInfo let serverArgs = Team.MembersGetInfoArgs(members: members) return client.request(route, serverArgs: serverArgs) @@ -661,12 +886,17 @@ open class TeamRoutes { /// Lists members of a team. Permission : Team information. /// + /// - scope: members.read + /// /// - parameter limit: Number of results to return per call. /// - parameter includeRemoved: Whether to return removed members. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersListV2Result` object on - /// success or a `Team.MembersListError` object on failure. - @discardableResult open func membersListV2(limit: UInt32 = 1000, includeRemoved: Bool = false) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.MembersListV2Result` object on success + /// or a `Team.MembersListError` object on failure. + @discardableResult public func membersListV2( + limit: UInt32 = 1_000, + includeRemoved: Bool = false + ) -> RpcRequest { let route = Team.membersListV2 let serverArgs = Team.MembersListArg(limit: limit, includeRemoved: includeRemoved) return client.request(route, serverArgs: serverArgs) @@ -674,12 +904,17 @@ open class TeamRoutes { /// Lists members of a team. Permission : Team information. /// + /// - scope: members.read + /// /// - parameter limit: Number of results to return per call. /// - parameter includeRemoved: Whether to return removed members. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersListResult` object on success + /// - returns: Through the response callback, the caller will receive a `Team.MembersListResult` object on success /// or a `Team.MembersListError` object on failure. - @discardableResult open func membersList(limit: UInt32 = 1000, includeRemoved: Bool = false) -> RpcRequest { + @discardableResult public func membersList( + limit: UInt32 = 1_000, + includeRemoved: Bool = false + ) -> RpcRequest { let route = Team.membersList let serverArgs = Team.MembersListArg(limit: limit, includeRemoved: includeRemoved) return client.request(route, serverArgs: serverArgs) @@ -688,11 +923,14 @@ open class TeamRoutes { /// Once a cursor has been retrieved from membersListV2, use this to paginate through all team members. Permission : /// Team information. /// + /// - scope: members.read + /// /// - parameter cursor: Indicates from what point to get the next set of members. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersListV2Result` object on - /// success or a `Team.MembersListContinueError` object on failure. - @discardableResult open func membersListContinueV2(cursor: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.MembersListV2Result` object on success + /// or a `Team.MembersListContinueError` object on failure. + @discardableResult public func membersListContinueV2(cursor: String) + -> RpcRequest { let route = Team.membersListContinueV2 let serverArgs = Team.MembersListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -701,11 +939,14 @@ open class TeamRoutes { /// Once a cursor has been retrieved from membersList, use this to paginate through all team members. Permission : /// Team information. /// + /// - scope: members.read + /// /// - parameter cursor: Indicates from what point to get the next set of members. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersListResult` object on success + /// - returns: Through the response callback, the caller will receive a `Team.MembersListResult` object on success /// or a `Team.MembersListContinueError` object on failure. - @discardableResult open func membersListContinue(cursor: String) -> RpcRequest { + @discardableResult public func membersListContinue(cursor: String) + -> RpcRequest { let route = Team.membersListContinue let serverArgs = Team.MembersListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -715,12 +956,18 @@ open class TeamRoutes { /// final result of the job, the client should periodically poll membersMoveFormerMemberFilesJobStatusCheck. /// Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter transferDestId: Files from the deleted member account will be transferred to this user. /// - parameter transferAdminId: Errors during the transfer process will be sent via email to this user. /// - /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success /// or a `Team.MembersTransferFormerMembersFilesError` object on failure. - @discardableResult open func membersMoveFormerMemberFiles(user: Team.UserSelectorArg, transferDestId: Team.UserSelectorArg, transferAdminId: Team.UserSelectorArg) -> RpcRequest { + @discardableResult public func membersMoveFormerMemberFiles( + user: Team.UserSelectorArg, + transferDestId: Team.UserSelectorArg, + transferAdminId: Team.UserSelectorArg + ) -> RpcRequest { let route = Team.membersMoveFormerMemberFiles let serverArgs = Team.MembersDataTransferArg(user: user, transferDestId: transferDestId, transferAdminId: transferAdminId) return client.request(route, serverArgs: serverArgs) @@ -729,12 +976,15 @@ open class TeamRoutes { /// Once an async_job_id is returned from membersMoveFormerMemberFiles , use this to poll the status of the /// asynchronous request. Permission : Team member management. /// + /// - scope: members.write + /// /// - 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 `Async.PollEmptyResult` object on success - /// or a `Async.PollError` object on failure. - @discardableResult open func membersMoveFormerMemberFilesJobStatusCheck(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Async.PollEmptyResult` object on success or + /// a `Async.PollError` object on failure. + @discardableResult public func membersMoveFormerMemberFilesJobStatusCheck(asyncJobId: String) + -> RpcRequest { let route = Team.membersMoveFormerMemberFilesJobStatusCheck let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -743,24 +993,28 @@ open class TeamRoutes { /// Recover a deleted member. Permission : Team member management Exactly one of team_member_id, email, or /// external_id must be provided to identify the user account. /// + /// - scope: members.delete + /// /// - parameter user: Identity of user to recover. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.MembersRecoverError` object on failure. - @discardableResult open func membersRecover(user: Team.UserSelectorArg) -> RpcRequest { + @discardableResult public func membersRecover(user: Team.UserSelectorArg) -> RpcRequest { let route = Team.membersRecover let serverArgs = Team.MembersRecoverArg(user: user) return client.request(route, serverArgs: serverArgs) } /// Removes a member from a team. Permission : Team member management Exactly one of team_member_id, email, or - /// external_id must be provided to identify the user account. Accounts can be recovered via membersRecover for a 7 - /// day period or until the account has been permanently deleted or transferred to another account (whichever comes - /// first). Calling membersAdd while a user is still recoverable on your team will return with userAlreadyOnTeam in - /// MemberAddResult. Accounts can have their files transferred via the admin console for a limited time, based on - /// the version history length associated with the team (180 days for most teams). This endpoint may initiate an - /// asynchronous job. To obtain the final result of the job, the client should periodically poll - /// membersRemoveJobStatusGet. + /// external_id must be provided to identify the user account. Accounts can be recovered via membersRecover for + /// a 7 day period or until the account has been permanently deleted or transferred to another account + /// (whichever comes first). Calling membersAdd while a user is still recoverable on your team will return with + /// userAlreadyOnTeam in MemberAddResult. Accounts can have their files transferred via the admin console for a + /// limited time, based on the version history length associated with the team (180 days for most teams). This + /// endpoint may initiate an asynchronous job. To obtain the final result of the job, the client should + /// periodically poll membersRemoveJobStatusGet. + /// + /// - scope: members.delete /// /// - parameter transferDestId: If provided, files from the deleted member account will be transferred to this user. /// - parameter transferAdminId: If provided, errors during the transfer process will be sent via email to this @@ -773,23 +1027,39 @@ open class TeamRoutes { /// account. Users will not retain access to folders that do not allow external sharing. In order to keep the /// sharing relationships, the arguments wipeData should be set to false and keepAccount should be set to true. /// - /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success /// or a `Team.MembersRemoveError` object on failure. - @discardableResult open func membersRemove(user: Team.UserSelectorArg, wipeData: Bool = true, transferDestId: Team.UserSelectorArg? = nil, transferAdminId: Team.UserSelectorArg? = nil, keepAccount: Bool = false, retainTeamShares: Bool = false) -> RpcRequest { + @discardableResult public func membersRemove( + user: Team.UserSelectorArg, + wipeData: Bool = true, + transferDestId: Team.UserSelectorArg? = nil, + transferAdminId: Team.UserSelectorArg? = nil, + keepAccount: Bool = false, + retainTeamShares: Bool = false + ) -> RpcRequest { let route = Team.membersRemove - let serverArgs = Team.MembersRemoveArg(user: user, wipeData: wipeData, transferDestId: transferDestId, transferAdminId: transferAdminId, keepAccount: keepAccount, retainTeamShares: retainTeamShares) + let serverArgs = Team.MembersRemoveArg( + user: user, + wipeData: wipeData, + transferDestId: transferDestId, + transferAdminId: transferAdminId, + keepAccount: keepAccount, + retainTeamShares: retainTeamShares + ) return client.request(route, serverArgs: serverArgs) } /// Once an async_job_id is returned from membersRemove , use this to poll the status of the asynchronous request. /// Permission : Team member management. /// + /// - scope: members.delete + /// /// - 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 `Async.PollEmptyResult` object on success - /// or a `Async.PollError` object on failure. - @discardableResult open func membersRemoveJobStatusGet(asyncJobId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Async.PollEmptyResult` object on success or + /// a `Async.PollError` object on failure. + @discardableResult public func membersRemoveJobStatusGet(asyncJobId: String) -> RpcRequest { let route = Team.membersRemoveJobStatusGet let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -798,11 +1068,14 @@ open class TeamRoutes { /// Add secondary emails to users. Permission : Team member management. Emails that are on verified domains will be /// verified automatically. For each email address not on a verified domain a verification email will be sent. /// + /// - scope: members.write + /// /// - parameter newSecondaryEmails: List of users and secondary emails to add. /// - /// - returns: Through the response callback, the caller will receive a `Team.AddSecondaryEmailsResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.AddSecondaryEmailsResult` object on /// success or a `Team.AddSecondaryEmailsError` object on failure. - @discardableResult open func membersSecondaryEmailsAdd(newSecondaryEmails: Array) -> RpcRequest { + @discardableResult public func membersSecondaryEmailsAdd(newSecondaryEmails: [Team.UserSecondaryEmailsArg]) + -> RpcRequest { let route = Team.membersSecondaryEmailsAdd let serverArgs = Team.AddSecondaryEmailsArg(newSecondaryEmails: newSecondaryEmails) return client.request(route, serverArgs: serverArgs) @@ -811,11 +1084,14 @@ open class TeamRoutes { /// Delete secondary emails from users Permission : Team member management. Users will be notified of deletions of /// verified secondary emails at both the secondary email and their primary email. /// + /// - scope: members.write + /// /// - parameter emailsToDelete: List of users and their secondary emails to delete. /// - /// - returns: Through the response callback, the caller will receive a `Team.DeleteSecondaryEmailsResult` object - /// on success or a `Void` object on failure. - @discardableResult open func membersSecondaryEmailsDelete(emailsToDelete: Array) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.DeleteSecondaryEmailsResult` object on + /// success or a `Void` object on failure. + @discardableResult public func membersSecondaryEmailsDelete(emailsToDelete: [Team.UserSecondaryEmailsArg]) + -> RpcRequest { let route = Team.membersSecondaryEmailsDelete let serverArgs = Team.DeleteSecondaryEmailsArg(emailsToDelete: emailsToDelete) return client.request(route, serverArgs: serverArgs) @@ -823,11 +1099,14 @@ open class TeamRoutes { /// Resend secondary email verification emails. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter emailsToResend: List of users and secondary emails to resend verification emails to. /// - /// - returns: Through the response callback, the caller will receive a `Team.ResendVerificationEmailResult` object + /// - returns: Through the response callback, the caller will receive a `Team.ResendVerificationEmailResult` object /// on success or a `Void` object on failure. - @discardableResult open func membersSecondaryEmailsResendVerificationEmails(emailsToResend: Array) -> RpcRequest { + @discardableResult public func membersSecondaryEmailsResendVerificationEmails(emailsToResend: [Team.UserSecondaryEmailsArg]) + -> RpcRequest { let route = Team.membersSecondaryEmailsResendVerificationEmails let serverArgs = Team.ResendVerificationEmailArg(emailsToResend: emailsToResend) return client.request(route, serverArgs: serverArgs) @@ -836,12 +1115,17 @@ open class TeamRoutes { /// Sends welcome email to pending team member. Permission : Team member management Exactly one of team_member_id, /// email, or external_id must be provided to identify the user account. No-op if team member is not pending. /// + /// - scope: members.write + /// /// - parameter userSelectorArg: Argument for selecting a single user, either by team_member_id, external_id or /// email. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.MembersSendWelcomeError` object on failure. - @discardableResult open func membersSendWelcomeEmail(userSelectorArg: Team.UserSelectorArg) -> RpcRequest { + @discardableResult public func membersSendWelcomeEmail( + userSelectorArg: Team + .UserSelectorArg + ) -> RpcRequest { let route = Team.membersSendWelcomeEmail let serverArgs = userSelectorArg return client.request(route, serverArgs: serverArgs) @@ -849,13 +1133,18 @@ open class TeamRoutes { /// Updates a team member's permissions. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of user whose role will be set. /// - parameter newRoles: The new roles for the member. Send empty list to make user member only. For now, only up /// to one role is allowed. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersSetPermissions2Result` object + /// - returns: Through the response callback, the caller will receive a `Team.MembersSetPermissions2Result` object /// on success or a `Team.MembersSetPermissions2Error` object on failure. - @discardableResult open func membersSetAdminPermissionsV2(user: Team.UserSelectorArg, newRoles: Array? = nil) -> RpcRequest { + @discardableResult public func membersSetAdminPermissionsV2( + user: Team.UserSelectorArg, + newRoles: [String]? = nil + ) -> RpcRequest { let route = Team.membersSetAdminPermissionsV2 let serverArgs = Team.MembersSetPermissions2Arg(user: user, newRoles: newRoles) return client.request(route, serverArgs: serverArgs) @@ -863,12 +1152,17 @@ open class TeamRoutes { /// Updates a team member's permissions. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of user whose role will be set. /// - parameter newRole: The new role of the member. /// - /// - returns: Through the response callback, the caller will receive a `Team.MembersSetPermissionsResult` object - /// on success or a `Team.MembersSetPermissionsError` object on failure. - @discardableResult open func membersSetAdminPermissions(user: Team.UserSelectorArg, newRole: Team.AdminTier) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.MembersSetPermissionsResult` object on + /// success or a `Team.MembersSetPermissionsError` object on failure. + @discardableResult public func membersSetAdminPermissions( + user: Team.UserSelectorArg, + newRole: Team.AdminTier + ) -> RpcRequest { let route = Team.membersSetAdminPermissions let serverArgs = Team.MembersSetPermissionsArg(user: user, newRole: newRole) return client.request(route, serverArgs: serverArgs) @@ -876,6 +1170,8 @@ open class TeamRoutes { /// Updates a team member's profile. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of user whose profile will be set. /// - parameter newEmail: New email for member. /// - parameter newExternalId: New external ID for member. @@ -885,16 +1181,34 @@ open class TeamRoutes { /// configuration. /// - parameter newIsDirectoryRestricted: New value for whether the user is a directory restricted user. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on /// success or a `Team.MembersSetProfileError` object on failure. - @discardableResult open func membersSetProfileV2(user: Team.UserSelectorArg, newEmail: String? = nil, newExternalId: String? = nil, newGivenName: String? = nil, newSurname: String? = nil, newPersistentId: String? = nil, newIsDirectoryRestricted: Bool? = nil) -> RpcRequest { + @discardableResult public func membersSetProfileV2( + user: Team.UserSelectorArg, + newEmail: String? = nil, + newExternalId: String? = nil, + newGivenName: String? = nil, + newSurname: String? = nil, + newPersistentId: String? = nil, + newIsDirectoryRestricted: Bool? = nil + ) -> RpcRequest { let route = Team.membersSetProfileV2 - let serverArgs = Team.MembersSetProfileArg(user: user, newEmail: newEmail, newExternalId: newExternalId, newGivenName: newGivenName, newSurname: newSurname, newPersistentId: newPersistentId, newIsDirectoryRestricted: newIsDirectoryRestricted) + let serverArgs = Team.MembersSetProfileArg( + user: user, + newEmail: newEmail, + newExternalId: newExternalId, + newGivenName: newGivenName, + newSurname: newSurname, + newPersistentId: newPersistentId, + newIsDirectoryRestricted: newIsDirectoryRestricted + ) return client.request(route, serverArgs: serverArgs) } /// Updates a team member's profile. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of user whose profile will be set. /// - parameter newEmail: New email for member. /// - parameter newExternalId: New external ID for member. @@ -904,22 +1218,43 @@ open class TeamRoutes { /// configuration. /// - parameter newIsDirectoryRestricted: New value for whether the user is a directory restricted user. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or - /// a `Team.MembersSetProfileError` object on failure. - @discardableResult open func membersSetProfile(user: Team.UserSelectorArg, newEmail: String? = nil, newExternalId: String? = nil, newGivenName: String? = nil, newSurname: String? = nil, newPersistentId: String? = nil, newIsDirectoryRestricted: Bool? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or a + /// `Team.MembersSetProfileError` object on failure. + @discardableResult public func membersSetProfile( + user: Team.UserSelectorArg, + newEmail: String? = nil, + newExternalId: String? = nil, + newGivenName: String? = nil, + newSurname: String? = nil, + newPersistentId: String? = nil, + newIsDirectoryRestricted: Bool? = nil + ) -> RpcRequest { let route = Team.membersSetProfile - let serverArgs = Team.MembersSetProfileArg(user: user, newEmail: newEmail, newExternalId: newExternalId, newGivenName: newGivenName, newSurname: newSurname, newPersistentId: newPersistentId, newIsDirectoryRestricted: newIsDirectoryRestricted) + let serverArgs = Team.MembersSetProfileArg( + user: user, + newEmail: newEmail, + newExternalId: newExternalId, + newGivenName: newGivenName, + newSurname: newSurname, + newPersistentId: newPersistentId, + newIsDirectoryRestricted: newIsDirectoryRestricted + ) return client.request(route, serverArgs: serverArgs) } /// Updates a team member's profile photo. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of the user whose profile photo will be set. /// - parameter photo: Image to set as the member's new profile photo. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on /// success or a `Team.MembersSetProfilePhotoError` object on failure. - @discardableResult open func membersSetProfilePhotoV2(user: Team.UserSelectorArg, photo: Account.PhotoSourceArg) -> RpcRequest { + @discardableResult public func membersSetProfilePhotoV2( + user: Team.UserSelectorArg, + photo: Account.PhotoSourceArg + ) -> RpcRequest { let route = Team.membersSetProfilePhotoV2 let serverArgs = Team.MembersSetProfilePhotoArg(user: user, photo: photo) return client.request(route, serverArgs: serverArgs) @@ -927,12 +1262,17 @@ open class TeamRoutes { /// Updates a team member's profile photo. Permission : Team member management. /// + /// - scope: members.write + /// /// - parameter user: Identity of the user whose profile photo will be set. /// - parameter photo: Image to set as the member's new profile photo. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or - /// a `Team.MembersSetProfilePhotoError` object on failure. - @discardableResult open func membersSetProfilePhoto(user: Team.UserSelectorArg, photo: Account.PhotoSourceArg) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or a + /// `Team.MembersSetProfilePhotoError` object on failure. + @discardableResult public func membersSetProfilePhoto( + user: Team.UserSelectorArg, + photo: Account.PhotoSourceArg + ) -> RpcRequest { let route = Team.membersSetProfilePhoto let serverArgs = Team.MembersSetProfilePhotoArg(user: user, photo: photo) return client.request(route, serverArgs: serverArgs) @@ -941,11 +1281,16 @@ open class TeamRoutes { /// Suspend a member from a team. Permission : Team member management Exactly one of team_member_id, email, or /// external_id must be provided to identify the user account. /// + /// - scope: members.write + /// /// - parameter wipeData: If provided, controls if the user's data will be deleted on their linked devices. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.MembersSuspendError` object on failure. - @discardableResult open func membersSuspend(user: Team.UserSelectorArg, wipeData: Bool = true) -> RpcRequest { + @discardableResult public func membersSuspend( + user: Team.UserSelectorArg, + wipeData: Bool = true + ) -> RpcRequest { let route = Team.membersSuspend let serverArgs = Team.MembersDeactivateArg(user: user, wipeData: wipeData) return client.request(route, serverArgs: serverArgs) @@ -954,26 +1299,31 @@ open class TeamRoutes { /// Unsuspend a member from a team. Permission : Team member management Exactly one of team_member_id, email, or /// external_id must be provided to identify the user account. /// + /// - scope: members.write + /// /// - parameter user: Identity of user to unsuspend. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.MembersUnsuspendError` object on failure. - @discardableResult open func membersUnsuspend(user: Team.UserSelectorArg) -> RpcRequest { + @discardableResult public func membersUnsuspend(user: Team.UserSelectorArg) -> RpcRequest { let route = Team.membersUnsuspend let serverArgs = Team.MembersUnsuspendArg(user: user) return client.request(route, serverArgs: serverArgs) } /// Returns a list of all team-accessible namespaces. This list includes team folders, shared folders containing - /// team members, team members' home namespaces, and team members' app folders. Home namespaces and app folders are - /// always owned by this team or members of the team, but shared folders may be owned by other users or other teams. - /// Duplicates may occur in the list. + /// team members, team members' home namespaces, and team members' app folders. Home namespaces and app folders + /// are always owned by this team or members of the team, but shared folders may be owned by other users or + /// other teams. Duplicates may occur in the list. + /// + /// - scope: team_data.member /// /// - parameter limit: Specifying a value here has no effect. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamNamespacesListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamNamespacesListResult` object on /// success or a `Team.TeamNamespacesListError` object on failure. - @discardableResult open func namespacesList(limit: UInt32 = 1000) -> RpcRequest { + @discardableResult public func namespacesList(limit: UInt32 = 1_000) + -> RpcRequest { let route = Team.namespacesList let serverArgs = Team.TeamNamespacesListArg(limit: limit) return client.request(route, serverArgs: serverArgs) @@ -982,11 +1332,14 @@ open class TeamRoutes { /// Once a cursor has been retrieved from namespacesList, use this to paginate through all team-accessible /// namespaces. Duplicates may occur in the list. /// + /// - scope: team_data.member + /// /// - parameter cursor: Indicates from what point to get the next set of team-accessible namespaces. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamNamespacesListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamNamespacesListResult` object on /// success or a `Team.TeamNamespacesListContinueError` object on failure. - @discardableResult open func namespacesListContinue(cursor: String) -> RpcRequest { + @discardableResult public func namespacesListContinue(cursor: String) + -> RpcRequest { let route = Team.namespacesListContinue let serverArgs = Team.TeamNamespacesListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -994,11 +1347,18 @@ open class TeamRoutes { /// Permission : Team member file access. /// + /// - scope: files.team_metadata.write /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object - /// on success or a `FileProperties.ModifyTemplateError` object on failure. - @available(*, unavailable, message:"propertiesTemplateAdd is deprecated.") - @discardableResult open func propertiesTemplateAdd(name: String, description_: String, fields: Array) -> RpcRequest { + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object on + /// success or a `FileProperties.ModifyTemplateError` object on failure. + @available(*, unavailable, message: "propertiesTemplateAdd is deprecated.") + @discardableResult public func propertiesTemplateAdd( + name: String, + description_: String, + fields: [FileProperties.PropertyFieldTemplate] + ) + -> RpcRequest { let route = Team.propertiesTemplateAdd let serverArgs = FileProperties.AddTemplateArg(name: name, description_: description_, fields: fields) return client.request(route, serverArgs: serverArgs) @@ -1006,13 +1366,16 @@ open class TeamRoutes { /// Permission : Team member file access. The scope for the route is files.team_metadata.write. /// + /// - scope: files.team_metadata.write + /// /// - parameter templateId: An identifier for template added by route See templatesAddForUser or /// templatesAddForTeam. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object - /// on success or a `FileProperties.TemplateError` object on failure. - @available(*, unavailable, message:"propertiesTemplateGet is deprecated.") - @discardableResult open func propertiesTemplateGet(templateId: String) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object on + /// success or a `FileProperties.TemplateError` object on failure. + @available(*, unavailable, message: "propertiesTemplateGet is deprecated.") + @discardableResult public func propertiesTemplateGet(templateId: String) + -> RpcRequest { let route = Team.propertiesTemplateGet let serverArgs = FileProperties.GetTemplateArg(templateId: templateId) return client.request(route, serverArgs: serverArgs) @@ -1020,27 +1383,36 @@ open class TeamRoutes { /// Permission : Team member file access. The scope for the route is files.team_metadata.write. /// + /// - scope: files.team_metadata.write + /// /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object + /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object /// on success or a `FileProperties.TemplateError` object on failure. - @available(*, unavailable, message:"propertiesTemplateList is deprecated.") - @discardableResult open func propertiesTemplateList() -> RpcRequest { + @available(*, unavailable, message: "propertiesTemplateList is deprecated.") + @discardableResult public func propertiesTemplateList() -> RpcRequest { let route = Team.propertiesTemplateList return client.request(route) } /// Permission : Team member file access. /// + /// - scope: files.team_metadata.write + /// /// - parameter templateId: An identifier for template added by See templatesAddForUser or templatesAddForTeam. /// - parameter name: A display name for the template. template names can be up to 256 bytes. /// - parameter description_: Description for the new template. Template descriptions can be up to 1024 bytes. /// - parameter addFields: Property field templates to be added to the group template. There can be up to 32 /// properties in a single template. /// - /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` - /// object on success or a `FileProperties.ModifyTemplateError` object on failure. - @available(*, unavailable, message:"propertiesTemplateUpdate is deprecated.") - @discardableResult open func propertiesTemplateUpdate(templateId: String, name: String? = nil, description_: String? = nil, addFields: Array? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` object + /// on success or a `FileProperties.ModifyTemplateError` object on failure. + @available(*, unavailable, message: "propertiesTemplateUpdate is deprecated.") + @discardableResult public func propertiesTemplateUpdate( + templateId: String, + name: String? = nil, + description_: String? = nil, + addFields: [FileProperties.PropertyFieldTemplate]? = nil + ) -> RpcRequest { let route = Team.propertiesTemplateUpdate let serverArgs = FileProperties.UpdateTemplateArg(templateId: templateId, name: name, description_: description_, addFields: addFields) return client.request(route, serverArgs: serverArgs) @@ -1048,14 +1420,19 @@ open class TeamRoutes { /// Retrieves reporting data about a team's user activity. Deprecated: Will be removed on July 1st 2021. /// + /// - scope: team_info.read + /// /// - parameter startDate: Optional starting date (inclusive). If start_date is None or too long ago, this field /// will be set to 6 months ago. /// - parameter endDate: Optional ending date (exclusive). /// - /// - returns: Through the response callback, the caller will receive a `Team.GetActivityReport` object on success + /// - returns: Through the response callback, the caller will receive a `Team.GetActivityReport` object on success /// or a `Team.DateRangeError` object on failure. - @available(*, unavailable, message:"reportsGetActivity is deprecated.") - @discardableResult open func reportsGetActivity(startDate: Date? = nil, endDate: Date? = nil) -> RpcRequest { + @available(*, unavailable, message: "reportsGetActivity is deprecated.") + @discardableResult public func reportsGetActivity( + startDate: Date? = nil, + endDate: Date? = nil + ) -> RpcRequest { let route = Team.reportsGetActivity let serverArgs = Team.DateRange(startDate: startDate, endDate: endDate) return client.request(route, serverArgs: serverArgs) @@ -1063,14 +1440,19 @@ open class TeamRoutes { /// Retrieves reporting data about a team's linked devices. Deprecated: Will be removed on July 1st 2021. /// + /// - scope: team_info.read + /// /// - parameter startDate: Optional starting date (inclusive). If start_date is None or too long ago, this field /// will be set to 6 months ago. /// - parameter endDate: Optional ending date (exclusive). /// - /// - returns: Through the response callback, the caller will receive a `Team.GetDevicesReport` object on success - /// or a `Team.DateRangeError` object on failure. - @available(*, unavailable, message:"reportsGetDevices is deprecated.") - @discardableResult open func reportsGetDevices(startDate: Date? = nil, endDate: Date? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.GetDevicesReport` object on success or + /// a `Team.DateRangeError` object on failure. + @available(*, unavailable, message: "reportsGetDevices is deprecated.") + @discardableResult public func reportsGetDevices( + startDate: Date? = nil, + endDate: Date? = nil + ) -> RpcRequest { let route = Team.reportsGetDevices let serverArgs = Team.DateRange(startDate: startDate, endDate: endDate) return client.request(route, serverArgs: serverArgs) @@ -1078,14 +1460,19 @@ open class TeamRoutes { /// Retrieves reporting data about a team's membership. Deprecated: Will be removed on July 1st 2021. /// + /// - scope: team_info.read + /// /// - parameter startDate: Optional starting date (inclusive). If start_date is None or too long ago, this field /// will be set to 6 months ago. /// - parameter endDate: Optional ending date (exclusive). /// - /// - returns: Through the response callback, the caller will receive a `Team.GetMembershipReport` object on - /// success or a `Team.DateRangeError` object on failure. - @available(*, unavailable, message:"reportsGetMembership is deprecated.") - @discardableResult open func reportsGetMembership(startDate: Date? = nil, endDate: Date? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.GetMembershipReport` object on success + /// or a `Team.DateRangeError` object on failure. + @available(*, unavailable, message: "reportsGetMembership is deprecated.") + @discardableResult public func reportsGetMembership( + startDate: Date? = nil, + endDate: Date? = nil + ) -> RpcRequest { let route = Team.reportsGetMembership let serverArgs = Team.DateRange(startDate: startDate, endDate: endDate) return client.request(route, serverArgs: serverArgs) @@ -1093,30 +1480,40 @@ open class TeamRoutes { /// Retrieves reporting data about a team's storage usage. Deprecated: Will be removed on July 1st 2021. /// + /// - scope: team_info.read + /// /// - parameter startDate: Optional starting date (inclusive). If start_date is None or too long ago, this field /// will be set to 6 months ago. /// - parameter endDate: Optional ending date (exclusive). /// - /// - returns: Through the response callback, the caller will receive a `Team.GetStorageReport` object on success - /// or a `Team.DateRangeError` object on failure. - @available(*, unavailable, message:"reportsGetStorage is deprecated.") - @discardableResult open func reportsGetStorage(startDate: Date? = nil, endDate: Date? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.GetStorageReport` object on success or + /// a `Team.DateRangeError` object on failure. + @available(*, unavailable, message: "reportsGetStorage is deprecated.") + @discardableResult public func reportsGetStorage( + startDate: Date? = nil, + endDate: Date? = nil + ) -> RpcRequest { let route = Team.reportsGetStorage let serverArgs = Team.DateRange(startDate: startDate, endDate: endDate) return client.request(route, serverArgs: serverArgs) } /// Endpoint adds Approve List entries. Changes are effective immediately. Changes are committed in transaction. In - /// case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails (RFC-5322/822) - /// are accepted. Added entries cannot overflow limit of 10000 entries per team. Maximum 100 entries per call is - /// allowed. + /// case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails + /// (RFC-5322/822) are accepted. Added entries cannot overflow limit of 10000 entries per team. Maximum 100 + /// entries per call is allowed. + /// + /// - scope: team_info.write /// /// - parameter domains: List of domains represented by valid string representation (RFC-1034/5). /// - parameter emails: List of emails represented by valid string representation (RFC-5322/822). /// - /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistAddResponse` object - /// on success or a `Team.SharingAllowlistAddError` object on failure. - @discardableResult open func sharingAllowlistAdd(domains: Array? = nil, emails: Array? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistAddResponse` object on + /// success or a `Team.SharingAllowlistAddError` object on failure. + @discardableResult public func sharingAllowlistAdd( + domains: [String]? = nil, + emails: [String]? = nil + ) -> RpcRequest { let route = Team.sharingAllowlistAdd let serverArgs = Team.SharingAllowlistAddArgs(domains: domains, emails: emails) return client.request(route, serverArgs: serverArgs) @@ -1126,11 +1523,14 @@ open class TeamRoutes { /// there are more than `limit` entries associated with the current team, more can be fetched by passing the /// returned `cursor` to sharingAllowlistListContinue. /// + /// - scope: team_info.read + /// /// - parameter limit: The number of entries to fetch at one time. /// - /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistListResponse` object + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistListResponse` object /// on success or a `Team.SharingAllowlistListError` object on failure. - @discardableResult open func sharingAllowlistList(limit: UInt32 = 1000) -> RpcRequest { + @discardableResult public func sharingAllowlistList(limit: UInt32 = 1_000) + -> RpcRequest { let route = Team.sharingAllowlistList let serverArgs = Team.SharingAllowlistListArg(limit: limit) return client.request(route, serverArgs: serverArgs) @@ -1138,12 +1538,15 @@ open class TeamRoutes { /// Lists entries associated with given team, starting from a the cursor. See sharingAllowlistList. /// + /// - scope: team_info.read + /// /// - parameter cursor: The cursor returned from a previous call to sharingAllowlistList or /// sharingAllowlistListContinue. /// - /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistListResponse` object + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistListResponse` object /// on success or a `Team.SharingAllowlistListContinueError` object on failure. - @discardableResult open func sharingAllowlistListContinue(cursor: String) -> RpcRequest { + @discardableResult public func sharingAllowlistListContinue(cursor: String) + -> RpcRequest { let route = Team.sharingAllowlistListContinue let serverArgs = Team.SharingAllowlistListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -1151,15 +1554,20 @@ open class TeamRoutes { /// Endpoint removes Approve List entries. Changes are effective immediately. Changes are committed in transaction. /// In case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails - /// (RFC-5322/822) are accepted. Entries being removed have to be present on the list. Maximum 1000 entries per call - /// is allowed. + /// (RFC-5322/822) are accepted. Entries being removed have to be present on the list. Maximum 1000 entries per + /// call is allowed. + /// + /// - scope: team_info.write /// /// - parameter domains: List of domains represented by valid string representation (RFC-1034/5). /// - parameter emails: List of emails represented by valid string representation (RFC-5322/822). /// - /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistRemoveResponse` - /// object on success or a `Team.SharingAllowlistRemoveError` object on failure. - @discardableResult open func sharingAllowlistRemove(domains: Array? = nil, emails: Array? = nil) -> RpcRequest { + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistRemoveResponse` object + /// on success or a `Team.SharingAllowlistRemoveError` object on failure. + @discardableResult public func sharingAllowlistRemove( + domains: [String]? = nil, + emails: [String]? = nil + ) -> RpcRequest { let route = Team.sharingAllowlistRemove let serverArgs = Team.SharingAllowlistRemoveArgs(domains: domains, emails: emails) return client.request(route, serverArgs: serverArgs) @@ -1167,11 +1575,14 @@ open class TeamRoutes { /// Sets an archived team folder's status to active. Permission : Team member file access. /// + /// - scope: team_data.content.write + /// /// - parameter teamFolderId: The ID of the team folder. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success /// or a `Team.TeamFolderActivateError` object on failure. - @discardableResult open func teamFolderActivate(teamFolderId: String) -> RpcRequest { + @discardableResult public func teamFolderActivate(teamFolderId: String) + -> RpcRequest { let route = Team.teamFolderActivate let serverArgs = Team.TeamFolderIdArg(teamFolderId: teamFolderId) return client.request(route, serverArgs: serverArgs) @@ -1180,11 +1591,16 @@ open class TeamRoutes { /// Sets an active team folder's status to archived and removes all folder and file members. This endpoint cannot be /// used for teams that have a shared team space. Permission : Team member file access. /// + /// - scope: team_data.content.write + /// /// - parameter forceAsyncOff: Whether to force the archive to happen synchronously. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderArchiveLaunch` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderArchiveLaunch` object on /// success or a `Team.TeamFolderArchiveError` object on failure. - @discardableResult open func teamFolderArchive(teamFolderId: String, forceAsyncOff: Bool = false) -> RpcRequest { + @discardableResult public func teamFolderArchive( + teamFolderId: String, + forceAsyncOff: Bool = false + ) -> RpcRequest { let route = Team.teamFolderArchive let serverArgs = Team.TeamFolderArchiveArg(teamFolderId: teamFolderId, forceAsyncOff: forceAsyncOff) return client.request(route, serverArgs: serverArgs) @@ -1192,12 +1608,15 @@ open class TeamRoutes { /// Returns the status of an asynchronous job for archiving a team folder. Permission : Team member file access. /// + /// - scope: team_data.content.write + /// /// - 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 `Team.TeamFolderArchiveJobStatus` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderArchiveJobStatus` object on /// success or a `Async.PollError` object on failure. - @discardableResult open func teamFolderArchiveCheck(asyncJobId: String) -> RpcRequest { + @discardableResult public func teamFolderArchiveCheck(asyncJobId: String) + -> RpcRequest { let route = Team.teamFolderArchiveCheck let serverArgs = Async.PollArg(asyncJobId: asyncJobId) return client.request(route, serverArgs: serverArgs) @@ -1206,13 +1625,18 @@ open class TeamRoutes { /// Creates a new, active, team folder with no members. This endpoint can only be used for teams that do not already /// have a shared team space. Permission : Team member file access. /// + /// - scope: team_data.content.write + /// /// - parameter name: Name for the new team folder. /// - parameter syncSetting: The sync setting to apply to this team folder. Only permitted if the team has team /// selective sync enabled. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success /// or a `Team.TeamFolderCreateError` object on failure. - @discardableResult open func teamFolderCreate(name: String, syncSetting: Files.SyncSettingArg? = nil) -> RpcRequest { + @discardableResult public func teamFolderCreate( + name: String, + syncSetting: Files.SyncSettingArg? = nil + ) -> RpcRequest { let route = Team.teamFolderCreate let serverArgs = Team.TeamFolderCreateArg(name: name, syncSetting: syncSetting) return client.request(route, serverArgs: serverArgs) @@ -1220,11 +1644,14 @@ open class TeamRoutes { /// Retrieves metadata for team folders. Permission : Team member file access. /// + /// - scope: team_data.content.read + /// /// - parameter teamFolderIds: The list of team folder IDs. /// - /// - returns: Through the response callback, the caller will receive a `Array` object + /// - returns: Through the response callback, the caller will receive a `Array` object /// on success or a `Void` object on failure. - @discardableResult open func teamFolderGetInfo(teamFolderIds: Array) -> RpcRequest, VoidSerializer> { + @discardableResult public func teamFolderGetInfo(teamFolderIds: [String]) + -> RpcRequest, VoidSerializer> { let route = Team.teamFolderGetInfo let serverArgs = Team.TeamFolderIdListArg(teamFolderIds: teamFolderIds) return client.request(route, serverArgs: serverArgs) @@ -1232,11 +1659,14 @@ open class TeamRoutes { /// Lists all team folders. Permission : Team member file access. /// + /// - scope: team_data.content.read + /// /// - parameter limit: The maximum number of results to return per request. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderListResult` object on /// success or a `Team.TeamFolderListError` object on failure. - @discardableResult open func teamFolderList(limit: UInt32 = 1000) -> RpcRequest { + @discardableResult public func teamFolderList(limit: UInt32 = 1_000) + -> RpcRequest { let route = Team.teamFolderList let serverArgs = Team.TeamFolderListArg(limit: limit) return client.request(route, serverArgs: serverArgs) @@ -1245,11 +1675,14 @@ open class TeamRoutes { /// Once a cursor has been retrieved from teamFolderList, use this to paginate through all team folders. Permission /// : Team member file access. /// + /// - scope: team_data.content.read + /// /// - parameter cursor: Indicates from what point to get the next set of team folders. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderListResult` object on + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderListResult` object on /// success or a `Team.TeamFolderListContinueError` object on failure. - @discardableResult open func teamFolderListContinue(cursor: String) -> RpcRequest { + @discardableResult public func teamFolderListContinue(cursor: String) + -> RpcRequest { let route = Team.teamFolderListContinue let serverArgs = Team.TeamFolderListContinueArg(cursor: cursor) return client.request(route, serverArgs: serverArgs) @@ -1258,11 +1691,14 @@ open class TeamRoutes { /// Permanently deletes an archived team folder. This endpoint cannot be used for teams that have a shared team /// space. Permission : Team member file access. /// + /// - scope: team_data.content.write + /// /// - parameter teamFolderId: The ID of the team folder. /// - /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a /// `Team.TeamFolderPermanentlyDeleteError` object on failure. - @discardableResult open func teamFolderPermanentlyDelete(teamFolderId: String) -> RpcRequest { + @discardableResult public func teamFolderPermanentlyDelete(teamFolderId: String) + -> RpcRequest { let route = Team.teamFolderPermanentlyDelete let serverArgs = Team.TeamFolderIdArg(teamFolderId: teamFolderId) return client.request(route, serverArgs: serverArgs) @@ -1270,11 +1706,16 @@ open class TeamRoutes { /// Changes an active team folder's name. Permission : Team member file access. /// + /// - scope: team_data.content.write + /// /// - parameter name: New team folder name. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success /// or a `Team.TeamFolderRenameError` object on failure. - @discardableResult open func teamFolderRename(teamFolderId: String, name: String) -> RpcRequest { + @discardableResult public func teamFolderRename( + teamFolderId: String, + name: String + ) -> RpcRequest { let route = Team.teamFolderRename let serverArgs = Team.TeamFolderRenameArg(teamFolderId: teamFolderId, name: name) return client.request(route, serverArgs: serverArgs) @@ -1283,13 +1724,19 @@ open class TeamRoutes { /// Updates the sync settings on a team folder or its contents. Use of this endpoint requires that the team has /// team selective sync enabled. /// + /// - scope: team_data.content.write + /// /// - parameter syncSetting: Sync setting to apply to the team folder itself. Only meaningful if the team folder is /// not a shared team root. /// - parameter contentSyncSettings: Sync settings to apply to contents of this team folder. /// - /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success /// or a `Team.TeamFolderUpdateSyncSettingsError` object on failure. - @discardableResult open func teamFolderUpdateSyncSettings(teamFolderId: String, syncSetting: Files.SyncSettingArg? = nil, contentSyncSettings: Array? = nil) -> RpcRequest { + @discardableResult public func teamFolderUpdateSyncSettings( + teamFolderId: String, + syncSetting: Files.SyncSettingArg? = nil, + contentSyncSettings: [Files.ContentSyncSettingArg]? = nil + ) -> RpcRequest { let route = Team.teamFolderUpdateSyncSettings let serverArgs = Team.TeamFolderUpdateSyncSettingsArg(teamFolderId: teamFolderId, syncSetting: syncSetting, contentSyncSettings: contentSyncSettings) return client.request(route, serverArgs: serverArgs) @@ -1297,12 +1744,14 @@ open class TeamRoutes { /// Returns the member profile of the admin who generated the team access token used to make the call. /// + /// - scope: team_info.read + /// /// - /// - returns: Through the response callback, the caller will receive a `Team.TokenGetAuthenticatedAdminResult` + /// - returns: Through the response callback, the caller will receive a `Team.TokenGetAuthenticatedAdminResult` /// object on success or a `Team.TokenGetAuthenticatedAdminError` object on failure. - @discardableResult open func tokenGetAuthenticatedAdmin() -> RpcRequest { + @discardableResult public func tokenGetAuthenticatedAdmin() + -> RpcRequest { let route = Team.tokenGetAuthenticatedAdmin return client.request(route) } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/Users.swift b/Source/SwiftyDropbox/Shared/Generated/Users.swift index 7c2a44236..1ad5a496f 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Users.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Users.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the users namespace -open class Users { +public class Users { /// The amount of detail revealed about an account depends on the user being queried and the user making the query. - open class Account: CustomStringConvertible { + public class Account: CustomStringConvertible, JSONRepresentable { /// The user's unique Dropbox ID. public let accountId: String /// Details of a user's name. @@ -34,137 +34,190 @@ open class Users { self.profilePhotoUrl = profilePhotoUrl self.disabled = disabled } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountSerializer().serialize(self)))" + + func json() throws -> JSON { + try AccountSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Account: \(error)" + } } } - open class AccountSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Account) -> JSON { - let output = [ - "account_id": Serialization._StringSerializer.serialize(value.accountId), - "name": Users.NameSerializer().serialize(value.name), - "email": Serialization._StringSerializer.serialize(value.email), - "email_verified": Serialization._BoolSerializer.serialize(value.emailVerified), - "disabled": Serialization._BoolSerializer.serialize(value.disabled), - "profile_photo_url": NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), + + public class AccountSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Account) throws -> JSON { + let output = [ + "account_id": try Serialization._StringSerializer.serialize(value.accountId), + "name": try Users.NameSerializer().serialize(value.name), + "email": try Serialization._StringSerializer.serialize(value.email), + "email_verified": try Serialization._BoolSerializer.serialize(value.emailVerified), + "disabled": try Serialization._BoolSerializer.serialize(value.disabled), + "profile_photo_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> Account { + + public func deserialize(_ json: JSON) throws -> Account { switch json { - case .dictionary(let dict): - let accountId = Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) - let name = Users.NameSerializer().deserialize(dict["name"] ?? .null) - let email = Serialization._StringSerializer.deserialize(dict["email"] ?? .null) - let emailVerified = Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) - let disabled = Serialization._BoolSerializer.deserialize(dict["disabled"] ?? .null) - let profilePhotoUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) - return Account(accountId: accountId, name: name, email: email, emailVerified: emailVerified, disabled: disabled, profilePhotoUrl: profilePhotoUrl) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountId = try Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) + let name = try Users.NameSerializer().deserialize(dict["name"] ?? .null) + let email = try Serialization._StringSerializer.deserialize(dict["email"] ?? .null) + let emailVerified = try Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) + let disabled = try Serialization._BoolSerializer.deserialize(dict["disabled"] ?? .null) + let profilePhotoUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) + return Account( + accountId: accountId, + name: name, + email: email, + emailVerified: emailVerified, + disabled: disabled, + profilePhotoUrl: profilePhotoUrl + ) + default: + throw JSONSerializerError.deserializeError(type: Account.self, json: json) } } } /// Basic information about any account. - open class BasicAccount: Users.Account { + public class BasicAccount: Users.Account { /// Whether this user is a teammate of the current user. If this account is the current user's account, then /// this will be true. public let isTeammate: Bool /// The user's unique team member id. This field will only be present if the user is part of a team and /// isTeammate is true. public let teamMemberId: String? - public init(accountId: String, name: Users.Name, email: String, emailVerified: Bool, disabled: Bool, isTeammate: Bool, profilePhotoUrl: String? = nil, teamMemberId: String? = nil) { + public init( + accountId: String, + name: Users.Name, + email: String, + emailVerified: Bool, + disabled: Bool, + isTeammate: Bool, + profilePhotoUrl: String? = nil, + teamMemberId: String? = nil + ) { self.isTeammate = isTeammate nullableValidator(stringValidator())(teamMemberId) self.teamMemberId = teamMemberId super.init(accountId: accountId, name: name, email: email, emailVerified: emailVerified, disabled: disabled, profilePhotoUrl: profilePhotoUrl) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(BasicAccountSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try BasicAccountSerializer().serialize(self)))" + } catch { + return "Failed to generate description for BasicAccount: \(error)" + } } } - open class BasicAccountSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: BasicAccount) -> JSON { - let output = [ - "account_id": Serialization._StringSerializer.serialize(value.accountId), - "name": Users.NameSerializer().serialize(value.name), - "email": Serialization._StringSerializer.serialize(value.email), - "email_verified": Serialization._BoolSerializer.serialize(value.emailVerified), - "disabled": Serialization._BoolSerializer.serialize(value.disabled), - "is_teammate": Serialization._BoolSerializer.serialize(value.isTeammate), - "profile_photo_url": NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), - "team_member_id": NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), + + public class BasicAccountSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: BasicAccount) throws -> JSON { + let output = [ + "account_id": try Serialization._StringSerializer.serialize(value.accountId), + "name": try Users.NameSerializer().serialize(value.name), + "email": try Serialization._StringSerializer.serialize(value.email), + "email_verified": try Serialization._BoolSerializer.serialize(value.emailVerified), + "disabled": try Serialization._BoolSerializer.serialize(value.disabled), + "is_teammate": try Serialization._BoolSerializer.serialize(value.isTeammate), + "profile_photo_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), + "team_member_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> BasicAccount { + + public func deserialize(_ json: JSON) throws -> BasicAccount { switch json { - case .dictionary(let dict): - let accountId = Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) - let name = Users.NameSerializer().deserialize(dict["name"] ?? .null) - let email = Serialization._StringSerializer.deserialize(dict["email"] ?? .null) - let emailVerified = Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) - let disabled = Serialization._BoolSerializer.deserialize(dict["disabled"] ?? .null) - let isTeammate = Serialization._BoolSerializer.deserialize(dict["is_teammate"] ?? .null) - let profilePhotoUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) - let teamMemberId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) - return BasicAccount(accountId: accountId, name: name, email: email, emailVerified: emailVerified, disabled: disabled, isTeammate: isTeammate, profilePhotoUrl: profilePhotoUrl, teamMemberId: teamMemberId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountId = try Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) + let name = try Users.NameSerializer().deserialize(dict["name"] ?? .null) + let email = try Serialization._StringSerializer.deserialize(dict["email"] ?? .null) + let emailVerified = try Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) + let disabled = try Serialization._BoolSerializer.deserialize(dict["disabled"] ?? .null) + let isTeammate = try Serialization._BoolSerializer.deserialize(dict["is_teammate"] ?? .null) + let profilePhotoUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) + let teamMemberId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) + return BasicAccount( + accountId: accountId, + name: name, + email: email, + emailVerified: emailVerified, + disabled: disabled, + isTeammate: isTeammate, + profilePhotoUrl: profilePhotoUrl, + teamMemberId: teamMemberId + ) + default: + throw JSONSerializerError.deserializeError(type: BasicAccount.self, json: json) } } } /// The value for fileLocking in UserFeature. - public enum FileLockingValue: CustomStringConvertible { + public enum FileLockingValue: CustomStringConvertible, JSONRepresentable { /// When this value is True, the user can lock files in shared directories. When the value is False the user can /// unlock the files they have locked or request to unlock files locked by others. case enabled(Bool) /// An unspecified error. case other + func json() throws -> JSON { + try FileLockingValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FileLockingValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FileLockingValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FileLockingValue: \(error)" + } } } - open class FileLockingValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FileLockingValue) -> JSON { + + public class FileLockingValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FileLockingValue) throws -> JSON { switch value { - case .enabled(let arg): - var d = ["enabled": Serialization._BoolSerializer.serialize(arg)] - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .enabled(let arg): + var d = try ["enabled": Serialization._BoolSerializer.serialize(arg)] + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> FileLockingValue { + + public func deserialize(_ json: JSON) throws -> FileLockingValue { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "enabled": - let v = Serialization._BoolSerializer.deserialize(d["enabled"] ?? .null) - return FileLockingValue.enabled(v) - case "other": - return FileLockingValue.other - default: - return FileLockingValue.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "enabled": + let v = try Serialization._BoolSerializer.deserialize(d["enabled"] ?? .null) + return FileLockingValue.enabled(v) + case "other": + return FileLockingValue.other default: - fatalError("Failed to deserialize") + return FileLockingValue.other + } + default: + throw JSONSerializerError.deserializeError(type: FileLockingValue.self, json: json) } } } /// Detailed information about the current user's account. - open class FullAccount: Users.Account { + public class FullAccount: Users.Account { /// The user's two-letter country code, if available. Country codes are based on ISO 3166-1 /// http://en.wikipedia.org/wiki/ISO_3166-1. public let country: String? @@ -184,7 +237,22 @@ open class Users { public let accountType: UsersCommon.AccountType /// The root info for this account. public let rootInfo: Common.RootInfo - public init(accountId: String, name: Users.Name, email: String, emailVerified: Bool, disabled: Bool, locale: String, referralLink: String, isPaired: Bool, accountType: UsersCommon.AccountType, rootInfo: Common.RootInfo, profilePhotoUrl: String? = nil, country: String? = nil, team: Users.FullTeam? = nil, teamMemberId: String? = nil) { + public init( + accountId: String, + name: Users.Name, + email: String, + emailVerified: Bool, + disabled: Bool, + locale: String, + referralLink: String, + isPaired: Bool, + accountType: UsersCommon.AccountType, + rootInfo: Common.RootInfo, + profilePhotoUrl: String? = nil, + country: String? = nil, + team: Users.FullTeam? = nil, + teamMemberId: String? = nil + ) { nullableValidator(stringValidator(minLength: 2, maxLength: 2))(country) self.country = country stringValidator(minLength: 2)(locale) @@ -199,57 +267,79 @@ open class Users { self.rootInfo = rootInfo super.init(accountId: accountId, name: name, email: email, emailVerified: emailVerified, disabled: disabled, profilePhotoUrl: profilePhotoUrl) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FullAccountSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FullAccountSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FullAccount: \(error)" + } } } - open class FullAccountSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FullAccount) -> JSON { - let output = [ - "account_id": Serialization._StringSerializer.serialize(value.accountId), - "name": Users.NameSerializer().serialize(value.name), - "email": Serialization._StringSerializer.serialize(value.email), - "email_verified": Serialization._BoolSerializer.serialize(value.emailVerified), - "disabled": Serialization._BoolSerializer.serialize(value.disabled), - "locale": Serialization._StringSerializer.serialize(value.locale), - "referral_link": Serialization._StringSerializer.serialize(value.referralLink), - "is_paired": Serialization._BoolSerializer.serialize(value.isPaired), - "account_type": UsersCommon.AccountTypeSerializer().serialize(value.accountType), - "root_info": Common.RootInfoSerializer().serialize(value.rootInfo), - "profile_photo_url": NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), - "country": NullableSerializer(Serialization._StringSerializer).serialize(value.country), - "team": NullableSerializer(Users.FullTeamSerializer()).serialize(value.team), - "team_member_id": NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), + + public class FullAccountSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FullAccount) throws -> JSON { + let output = [ + "account_id": try Serialization._StringSerializer.serialize(value.accountId), + "name": try Users.NameSerializer().serialize(value.name), + "email": try Serialization._StringSerializer.serialize(value.email), + "email_verified": try Serialization._BoolSerializer.serialize(value.emailVerified), + "disabled": try Serialization._BoolSerializer.serialize(value.disabled), + "locale": try Serialization._StringSerializer.serialize(value.locale), + "referral_link": try Serialization._StringSerializer.serialize(value.referralLink), + "is_paired": try Serialization._BoolSerializer.serialize(value.isPaired), + "account_type": try UsersCommon.AccountTypeSerializer().serialize(value.accountType), + "root_info": try Common.RootInfoSerializer().serialize(value.rootInfo), + "profile_photo_url": try NullableSerializer(Serialization._StringSerializer).serialize(value.profilePhotoUrl), + "country": try NullableSerializer(Serialization._StringSerializer).serialize(value.country), + "team": try NullableSerializer(Users.FullTeamSerializer()).serialize(value.team), + "team_member_id": try NullableSerializer(Serialization._StringSerializer).serialize(value.teamMemberId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FullAccount { + + public func deserialize(_ json: JSON) throws -> FullAccount { switch json { - case .dictionary(let dict): - let accountId = Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) - let name = Users.NameSerializer().deserialize(dict["name"] ?? .null) - let email = Serialization._StringSerializer.deserialize(dict["email"] ?? .null) - let emailVerified = Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) - let disabled = Serialization._BoolSerializer.deserialize(dict["disabled"] ?? .null) - let locale = Serialization._StringSerializer.deserialize(dict["locale"] ?? .null) - let referralLink = Serialization._StringSerializer.deserialize(dict["referral_link"] ?? .null) - let isPaired = Serialization._BoolSerializer.deserialize(dict["is_paired"] ?? .null) - let accountType = UsersCommon.AccountTypeSerializer().deserialize(dict["account_type"] ?? .null) - let rootInfo = Common.RootInfoSerializer().deserialize(dict["root_info"] ?? .null) - let profilePhotoUrl = NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) - let country = NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) - let team = NullableSerializer(Users.FullTeamSerializer()).deserialize(dict["team"] ?? .null) - let teamMemberId = NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) - return FullAccount(accountId: accountId, name: name, email: email, emailVerified: emailVerified, disabled: disabled, locale: locale, referralLink: referralLink, isPaired: isPaired, accountType: accountType, rootInfo: rootInfo, profilePhotoUrl: profilePhotoUrl, country: country, team: team, teamMemberId: teamMemberId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountId = try Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) + let name = try Users.NameSerializer().deserialize(dict["name"] ?? .null) + let email = try Serialization._StringSerializer.deserialize(dict["email"] ?? .null) + let emailVerified = try Serialization._BoolSerializer.deserialize(dict["email_verified"] ?? .null) + let disabled = try Serialization._BoolSerializer.deserialize(dict["disabled"] ?? .null) + let locale = try Serialization._StringSerializer.deserialize(dict["locale"] ?? .null) + let referralLink = try Serialization._StringSerializer.deserialize(dict["referral_link"] ?? .null) + let isPaired = try Serialization._BoolSerializer.deserialize(dict["is_paired"] ?? .null) + let accountType = try UsersCommon.AccountTypeSerializer().deserialize(dict["account_type"] ?? .null) + let rootInfo = try Common.RootInfoSerializer().deserialize(dict["root_info"] ?? .null) + let profilePhotoUrl = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["profile_photo_url"] ?? .null) + let country = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["country"] ?? .null) + let team = try NullableSerializer(Users.FullTeamSerializer()).deserialize(dict["team"] ?? .null) + let teamMemberId = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["team_member_id"] ?? .null) + return FullAccount( + accountId: accountId, + name: name, + email: email, + emailVerified: emailVerified, + disabled: disabled, + locale: locale, + referralLink: referralLink, + isPaired: isPaired, + accountType: accountType, + rootInfo: rootInfo, + profilePhotoUrl: profilePhotoUrl, + country: country, + team: team, + teamMemberId: teamMemberId + ) + default: + throw JSONSerializerError.deserializeError(type: FullAccount.self, json: json) } } } /// Information about a team. - open class Team: CustomStringConvertible { + public class Team: CustomStringConvertible, JSONRepresentable { /// The team's unique ID. public let id: String /// The name of the team. @@ -260,33 +350,44 @@ open class Users { stringValidator()(name) self.name = name } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Team: \(error)" + } } } - open class TeamSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Team) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "name": Serialization._StringSerializer.serialize(value.name), + + public class TeamSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Team) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "name": try Serialization._StringSerializer.serialize(value.name), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> Team { + + public func deserialize(_ json: JSON) throws -> Team { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - return Team(id: id, name: name) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + return Team(id: id, name: name) + default: + throw JSONSerializerError.deserializeError(type: Team.self, json: json) } } } /// Detailed information about a team. - open class FullTeam: Users.Team { + public class FullTeam: Users.Team { /// Team policies governing sharing. public let sharingPolicies: TeamPolicies.TeamSharingPolicies /// Team policy governing the use of the Office Add-In. @@ -296,217 +397,277 @@ open class Users { self.officeAddinPolicy = officeAddinPolicy super.init(id: id, name: name) } - open override var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(FullTeamSerializer().serialize(self)))" + + public override var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try FullTeamSerializer().serialize(self)))" + } catch { + return "Failed to generate description for FullTeam: \(error)" + } } } - open class FullTeamSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: FullTeam) -> JSON { - let output = [ - "id": Serialization._StringSerializer.serialize(value.id), - "name": Serialization._StringSerializer.serialize(value.name), - "sharing_policies": TeamPolicies.TeamSharingPoliciesSerializer().serialize(value.sharingPolicies), - "office_addin_policy": TeamPolicies.OfficeAddInPolicySerializer().serialize(value.officeAddinPolicy), + + public class FullTeamSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: FullTeam) throws -> JSON { + let output = [ + "id": try Serialization._StringSerializer.serialize(value.id), + "name": try Serialization._StringSerializer.serialize(value.name), + "sharing_policies": try TeamPolicies.TeamSharingPoliciesSerializer().serialize(value.sharingPolicies), + "office_addin_policy": try TeamPolicies.OfficeAddInPolicySerializer().serialize(value.officeAddinPolicy), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> FullTeam { + + public func deserialize(_ json: JSON) throws -> FullTeam { switch json { - case .dictionary(let dict): - let id = Serialization._StringSerializer.deserialize(dict["id"] ?? .null) - let name = Serialization._StringSerializer.deserialize(dict["name"] ?? .null) - let sharingPolicies = TeamPolicies.TeamSharingPoliciesSerializer().deserialize(dict["sharing_policies"] ?? .null) - let officeAddinPolicy = TeamPolicies.OfficeAddInPolicySerializer().deserialize(dict["office_addin_policy"] ?? .null) - return FullTeam(id: id, name: name, sharingPolicies: sharingPolicies, officeAddinPolicy: officeAddinPolicy) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let id = try Serialization._StringSerializer.deserialize(dict["id"] ?? .null) + let name = try Serialization._StringSerializer.deserialize(dict["name"] ?? .null) + let sharingPolicies = try TeamPolicies.TeamSharingPoliciesSerializer().deserialize(dict["sharing_policies"] ?? .null) + let officeAddinPolicy = try TeamPolicies.OfficeAddInPolicySerializer().deserialize(dict["office_addin_policy"] ?? .null) + return FullTeam(id: id, name: name, sharingPolicies: sharingPolicies, officeAddinPolicy: officeAddinPolicy) + default: + throw JSONSerializerError.deserializeError(type: FullTeam.self, json: json) } } } /// The GetAccountArg struct - open class GetAccountArg: CustomStringConvertible { + public class GetAccountArg: CustomStringConvertible, JSONRepresentable { /// A user's account identifier. public let accountId: String public init(accountId: String) { stringValidator(minLength: 40, maxLength: 40)(accountId) self.accountId = accountId } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetAccountArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetAccountArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetAccountArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetAccountArg: \(error)" + } } } - open class GetAccountArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetAccountArg) -> JSON { - let output = [ - "account_id": Serialization._StringSerializer.serialize(value.accountId), + + public class GetAccountArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetAccountArg) throws -> JSON { + let output = [ + "account_id": try Serialization._StringSerializer.serialize(value.accountId), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetAccountArg { + + public func deserialize(_ json: JSON) throws -> GetAccountArg { switch json { - case .dictionary(let dict): - let accountId = Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) - return GetAccountArg(accountId: accountId) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountId = try Serialization._StringSerializer.deserialize(dict["account_id"] ?? .null) + return GetAccountArg(accountId: accountId) + default: + throw JSONSerializerError.deserializeError(type: GetAccountArg.self, json: json) } } } /// The GetAccountBatchArg struct - open class GetAccountBatchArg: CustomStringConvertible { + public class GetAccountBatchArg: CustomStringConvertible, JSONRepresentable { /// List of user account identifiers. Should not contain any duplicate account IDs. - public let accountIds: Array - public init(accountIds: Array) { + public let accountIds: [String] + public init(accountIds: [String]) { arrayValidator(minItems: 1, itemValidator: stringValidator(minLength: 40, maxLength: 40))(accountIds) self.accountIds = accountIds } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetAccountBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try GetAccountBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetAccountBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetAccountBatchArg: \(error)" + } } } - open class GetAccountBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetAccountBatchArg) -> JSON { - let output = [ - "account_ids": ArraySerializer(Serialization._StringSerializer).serialize(value.accountIds), + + public class GetAccountBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetAccountBatchArg) throws -> JSON { + let output = [ + "account_ids": try ArraySerializer(Serialization._StringSerializer).serialize(value.accountIds), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> GetAccountBatchArg { + + public func deserialize(_ json: JSON) throws -> GetAccountBatchArg { switch json { - case .dictionary(let dict): - let accountIds = ArraySerializer(Serialization._StringSerializer).deserialize(dict["account_ids"] ?? .null) - return GetAccountBatchArg(accountIds: accountIds) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let accountIds = try ArraySerializer(Serialization._StringSerializer).deserialize(dict["account_ids"] ?? .null) + return GetAccountBatchArg(accountIds: accountIds) + default: + throw JSONSerializerError.deserializeError(type: GetAccountBatchArg.self, json: json) } } } /// The GetAccountBatchError union - public enum GetAccountBatchError: CustomStringConvertible { + public enum GetAccountBatchError: CustomStringConvertible, JSONRepresentable { /// The value is an account ID specified in accountIds in GetAccountBatchArg that does not exist. case noAccount(String) /// An unspecified error. case other + func json() throws -> JSON { + try GetAccountBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetAccountBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetAccountBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetAccountBatchError: \(error)" + } } } - open class GetAccountBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetAccountBatchError) -> JSON { + + public class GetAccountBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetAccountBatchError) throws -> JSON { switch value { - case .noAccount(let arg): - var d = ["no_account": Serialization._StringSerializer.serialize(arg)] - d[".tag"] = .str("no_account") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .noAccount(let arg): + var d = try ["no_account": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("no_account") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GetAccountBatchError { + + public func deserialize(_ json: JSON) throws -> GetAccountBatchError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "no_account": - let v = Serialization._StringSerializer.deserialize(d["no_account"] ?? .null) - return GetAccountBatchError.noAccount(v) - case "other": - return GetAccountBatchError.other - default: - return GetAccountBatchError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "no_account": + let v = try Serialization._StringSerializer.deserialize(d["no_account"] ?? .null) + return GetAccountBatchError.noAccount(v) + case "other": + return GetAccountBatchError.other default: - fatalError("Failed to deserialize") + return GetAccountBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetAccountBatchError.self, json: json) } } } /// The GetAccountError union - public enum GetAccountError: CustomStringConvertible { + public enum GetAccountError: CustomStringConvertible, JSONRepresentable { /// The specified accountId in GetAccountArg does not exist. case noAccount /// An unspecified error. case other + func json() throws -> JSON { + try GetAccountErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(GetAccountErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetAccountErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetAccountError: \(error)" + } } } - open class GetAccountErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: GetAccountError) -> JSON { + + public class GetAccountErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetAccountError) throws -> JSON { switch value { - case .noAccount: - var d = [String: JSON]() - d[".tag"] = .str("no_account") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .noAccount: + var d = [String: JSON]() + d[".tag"] = .str("no_account") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> GetAccountError { + + public func deserialize(_ json: JSON) throws -> GetAccountError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "no_account": - return GetAccountError.noAccount - case "other": - return GetAccountError.other - default: - return GetAccountError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "no_account": + return GetAccountError.noAccount + case "other": + return GetAccountError.other default: - fatalError("Failed to deserialize") + return GetAccountError.other + } + default: + throw JSONSerializerError.deserializeError(type: GetAccountError.self, json: json) } } } /// The IndividualSpaceAllocation struct - open class IndividualSpaceAllocation: CustomStringConvertible { + public class IndividualSpaceAllocation: CustomStringConvertible, JSONRepresentable { /// The total space allocated to the user's account (bytes). public let allocated: UInt64 public init(allocated: UInt64) { comparableValidator()(allocated) self.allocated = allocated } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(IndividualSpaceAllocationSerializer().serialize(self)))" + + func json() throws -> JSON { + try IndividualSpaceAllocationSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try IndividualSpaceAllocationSerializer().serialize(self)))" + } catch { + return "Failed to generate description for IndividualSpaceAllocation: \(error)" + } } } - open class IndividualSpaceAllocationSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: IndividualSpaceAllocation) -> JSON { - let output = [ - "allocated": Serialization._UInt64Serializer.serialize(value.allocated), + + public class IndividualSpaceAllocationSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: IndividualSpaceAllocation) throws -> JSON { + let output = [ + "allocated": try Serialization._UInt64Serializer.serialize(value.allocated), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> IndividualSpaceAllocation { + + public func deserialize(_ json: JSON) throws -> IndividualSpaceAllocation { switch json { - case .dictionary(let dict): - let allocated = Serialization._UInt64Serializer.deserialize(dict["allocated"] ?? .null) - return IndividualSpaceAllocation(allocated: allocated) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let allocated = try Serialization._UInt64Serializer.deserialize(dict["allocated"] ?? .null) + return IndividualSpaceAllocation(allocated: allocated) + default: + throw JSONSerializerError.deserializeError(type: IndividualSpaceAllocation.self, json: json) } } } /// Representations for a person's name to assist with internationalization. - open class Name: CustomStringConvertible { + public class Name: CustomStringConvertible, JSONRepresentable { /// Also known as a first name. public let givenName: String /// Also known as a last name or family name. @@ -530,85 +691,106 @@ open class Users { stringValidator()(abbreviatedName) self.abbreviatedName = abbreviatedName } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(NameSerializer().serialize(self)))" + + func json() throws -> JSON { + try NameSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try NameSerializer().serialize(self)))" + } catch { + return "Failed to generate description for Name: \(error)" + } } } - open class NameSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: Name) -> JSON { - let output = [ - "given_name": Serialization._StringSerializer.serialize(value.givenName), - "surname": Serialization._StringSerializer.serialize(value.surname), - "familiar_name": Serialization._StringSerializer.serialize(value.familiarName), - "display_name": Serialization._StringSerializer.serialize(value.displayName), - "abbreviated_name": Serialization._StringSerializer.serialize(value.abbreviatedName), + + public class NameSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: Name) throws -> JSON { + let output = [ + "given_name": try Serialization._StringSerializer.serialize(value.givenName), + "surname": try Serialization._StringSerializer.serialize(value.surname), + "familiar_name": try Serialization._StringSerializer.serialize(value.familiarName), + "display_name": try Serialization._StringSerializer.serialize(value.displayName), + "abbreviated_name": try Serialization._StringSerializer.serialize(value.abbreviatedName), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> Name { + + public func deserialize(_ json: JSON) throws -> Name { switch json { - case .dictionary(let dict): - let givenName = Serialization._StringSerializer.deserialize(dict["given_name"] ?? .null) - let surname = Serialization._StringSerializer.deserialize(dict["surname"] ?? .null) - let familiarName = Serialization._StringSerializer.deserialize(dict["familiar_name"] ?? .null) - let displayName = Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) - let abbreviatedName = Serialization._StringSerializer.deserialize(dict["abbreviated_name"] ?? .null) - return Name(givenName: givenName, surname: surname, familiarName: familiarName, displayName: displayName, abbreviatedName: abbreviatedName) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let givenName = try Serialization._StringSerializer.deserialize(dict["given_name"] ?? .null) + let surname = try Serialization._StringSerializer.deserialize(dict["surname"] ?? .null) + let familiarName = try Serialization._StringSerializer.deserialize(dict["familiar_name"] ?? .null) + let displayName = try Serialization._StringSerializer.deserialize(dict["display_name"] ?? .null) + let abbreviatedName = try Serialization._StringSerializer.deserialize(dict["abbreviated_name"] ?? .null) + return Name(givenName: givenName, surname: surname, familiarName: familiarName, displayName: displayName, abbreviatedName: abbreviatedName) + default: + throw JSONSerializerError.deserializeError(type: Name.self, json: json) } } } /// The value for paperAsFiles in UserFeature. - public enum PaperAsFilesValue: CustomStringConvertible { + public enum PaperAsFilesValue: CustomStringConvertible, JSONRepresentable { /// When this value is true, the user's Paper docs are accessible in Dropbox with the .paper extension and must - /// be accessed via the /files endpoints. When this value is false, the user's Paper docs are stored separate - /// from Dropbox files and folders and should be accessed via the /paper endpoints. + /// be accessed via the /files endpoints. When this value is false, the user's Paper docs are stored + /// separate from Dropbox files and folders and should be accessed via the /paper endpoints. case enabled(Bool) /// An unspecified error. case other + func json() throws -> JSON { + try PaperAsFilesValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(PaperAsFilesValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try PaperAsFilesValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for PaperAsFilesValue: \(error)" + } } } - open class PaperAsFilesValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: PaperAsFilesValue) -> JSON { + + public class PaperAsFilesValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: PaperAsFilesValue) throws -> JSON { switch value { - case .enabled(let arg): - var d = ["enabled": Serialization._BoolSerializer.serialize(arg)] - d[".tag"] = .str("enabled") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .enabled(let arg): + var d = try ["enabled": Serialization._BoolSerializer.serialize(arg)] + d[".tag"] = .str("enabled") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> PaperAsFilesValue { + + public func deserialize(_ json: JSON) throws -> PaperAsFilesValue { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "enabled": - let v = Serialization._BoolSerializer.deserialize(d["enabled"] ?? .null) - return PaperAsFilesValue.enabled(v) - case "other": - return PaperAsFilesValue.other - default: - return PaperAsFilesValue.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "enabled": + let v = try Serialization._BoolSerializer.deserialize(d["enabled"] ?? .null) + return PaperAsFilesValue.enabled(v) + case "other": + return PaperAsFilesValue.other default: - fatalError("Failed to deserialize") + return PaperAsFilesValue.other + } + default: + throw JSONSerializerError.deserializeError(type: PaperAsFilesValue.self, json: json) } } } /// Space is allocated differently based on the type of account. - public enum SpaceAllocation: CustomStringConvertible { + public enum SpaceAllocation: CustomStringConvertible, JSONRepresentable { /// The user's space allocation applies only to their individual account. case individual(Users.IndividualSpaceAllocation) /// The user shares space with other members of their team. @@ -616,52 +798,62 @@ open class Users { /// An unspecified error. case other + func json() throws -> JSON { + try SpaceAllocationSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SpaceAllocationSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SpaceAllocationSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SpaceAllocation: \(error)" + } } } - open class SpaceAllocationSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SpaceAllocation) -> JSON { + + public class SpaceAllocationSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SpaceAllocation) throws -> JSON { switch value { - case .individual(let arg): - var d = Serialization.getFields(Users.IndividualSpaceAllocationSerializer().serialize(arg)) - d[".tag"] = .str("individual") - return .dictionary(d) - case .team(let arg): - var d = Serialization.getFields(Users.TeamSpaceAllocationSerializer().serialize(arg)) - d[".tag"] = .str("team") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .individual(let arg): + var d = try Serialization.getFields(Users.IndividualSpaceAllocationSerializer().serialize(arg)) + d[".tag"] = .str("individual") + return .dictionary(d) + case .team(let arg): + var d = try Serialization.getFields(Users.TeamSpaceAllocationSerializer().serialize(arg)) + d[".tag"] = .str("team") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> SpaceAllocation { + + public func deserialize(_ json: JSON) throws -> SpaceAllocation { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "individual": - let v = Users.IndividualSpaceAllocationSerializer().deserialize(json) - return SpaceAllocation.individual(v) - case "team": - let v = Users.TeamSpaceAllocationSerializer().deserialize(json) - return SpaceAllocation.team(v) - case "other": - return SpaceAllocation.other - default: - return SpaceAllocation.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "individual": + let v = try Users.IndividualSpaceAllocationSerializer().deserialize(json) + return SpaceAllocation.individual(v) + case "team": + let v = try Users.TeamSpaceAllocationSerializer().deserialize(json) + return SpaceAllocation.team(v) + case "other": + return SpaceAllocation.other default: - fatalError("Failed to deserialize") + return SpaceAllocation.other + } + default: + throw JSONSerializerError.deserializeError(type: SpaceAllocation.self, json: json) } } } /// Information about a user's space usage and quota. - open class SpaceUsage: CustomStringConvertible { + public class SpaceUsage: CustomStringConvertible, JSONRepresentable { /// The user's total space usage (bytes). public let used: UInt64 /// The user's space allocation. @@ -671,33 +863,44 @@ open class Users { self.used = used self.allocation = allocation } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(SpaceUsageSerializer().serialize(self)))" + + func json() throws -> JSON { + try SpaceUsageSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try SpaceUsageSerializer().serialize(self)))" + } catch { + return "Failed to generate description for SpaceUsage: \(error)" + } } } - open class SpaceUsageSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: SpaceUsage) -> JSON { - let output = [ - "used": Serialization._UInt64Serializer.serialize(value.used), - "allocation": Users.SpaceAllocationSerializer().serialize(value.allocation), + + public class SpaceUsageSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: SpaceUsage) throws -> JSON { + let output = [ + "used": try Serialization._UInt64Serializer.serialize(value.used), + "allocation": try Users.SpaceAllocationSerializer().serialize(value.allocation), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> SpaceUsage { + + public func deserialize(_ json: JSON) throws -> SpaceUsage { switch json { - case .dictionary(let dict): - let used = Serialization._UInt64Serializer.deserialize(dict["used"] ?? .null) - let allocation = Users.SpaceAllocationSerializer().deserialize(dict["allocation"] ?? .null) - return SpaceUsage(used: used, allocation: allocation) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let used = try Serialization._UInt64Serializer.deserialize(dict["used"] ?? .null) + let allocation = try Users.SpaceAllocationSerializer().deserialize(dict["allocation"] ?? .null) + return SpaceUsage(used: used, allocation: allocation) + default: + throw JSONSerializerError.deserializeError(type: SpaceUsage.self, json: json) } } } /// The TeamSpaceAllocation struct - open class TeamSpaceAllocation: CustomStringConvertible { + public class TeamSpaceAllocation: CustomStringConvertible, JSONRepresentable { /// The total space currently used by the user's team (bytes). public let used: UInt64 /// The total space allocated to the user's team (bytes). @@ -709,7 +912,13 @@ open class Users { public let userWithinTeamSpaceLimitType: TeamCommon.MemberSpaceLimitType /// An accurate cached calculation of a team member's total space usage (bytes). public let userWithinTeamSpaceUsedCached: UInt64 - public init(used: UInt64, allocated: UInt64, userWithinTeamSpaceAllocated: UInt64, userWithinTeamSpaceLimitType: TeamCommon.MemberSpaceLimitType, userWithinTeamSpaceUsedCached: UInt64) { + public init( + used: UInt64, + allocated: UInt64, + userWithinTeamSpaceAllocated: UInt64, + userWithinTeamSpaceLimitType: TeamCommon.MemberSpaceLimitType, + userWithinTeamSpaceUsedCached: UInt64 + ) { comparableValidator()(used) self.used = used comparableValidator()(allocated) @@ -720,39 +929,57 @@ open class Users { comparableValidator()(userWithinTeamSpaceUsedCached) self.userWithinTeamSpaceUsedCached = userWithinTeamSpaceUsedCached } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(TeamSpaceAllocationSerializer().serialize(self)))" + + func json() throws -> JSON { + try TeamSpaceAllocationSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamSpaceAllocationSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamSpaceAllocation: \(error)" + } } } - open class TeamSpaceAllocationSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: TeamSpaceAllocation) -> JSON { - let output = [ - "used": Serialization._UInt64Serializer.serialize(value.used), - "allocated": Serialization._UInt64Serializer.serialize(value.allocated), - "user_within_team_space_allocated": Serialization._UInt64Serializer.serialize(value.userWithinTeamSpaceAllocated), - "user_within_team_space_limit_type": TeamCommon.MemberSpaceLimitTypeSerializer().serialize(value.userWithinTeamSpaceLimitType), - "user_within_team_space_used_cached": Serialization._UInt64Serializer.serialize(value.userWithinTeamSpaceUsedCached), + + public class TeamSpaceAllocationSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TeamSpaceAllocation) throws -> JSON { + let output = [ + "used": try Serialization._UInt64Serializer.serialize(value.used), + "allocated": try Serialization._UInt64Serializer.serialize(value.allocated), + "user_within_team_space_allocated": try Serialization._UInt64Serializer.serialize(value.userWithinTeamSpaceAllocated), + "user_within_team_space_limit_type": try TeamCommon.MemberSpaceLimitTypeSerializer().serialize(value.userWithinTeamSpaceLimitType), + "user_within_team_space_used_cached": try Serialization._UInt64Serializer.serialize(value.userWithinTeamSpaceUsedCached), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> TeamSpaceAllocation { + + public func deserialize(_ json: JSON) throws -> TeamSpaceAllocation { switch json { - case .dictionary(let dict): - let used = Serialization._UInt64Serializer.deserialize(dict["used"] ?? .null) - let allocated = Serialization._UInt64Serializer.deserialize(dict["allocated"] ?? .null) - let userWithinTeamSpaceAllocated = Serialization._UInt64Serializer.deserialize(dict["user_within_team_space_allocated"] ?? .null) - let userWithinTeamSpaceLimitType = TeamCommon.MemberSpaceLimitTypeSerializer().deserialize(dict["user_within_team_space_limit_type"] ?? .null) - let userWithinTeamSpaceUsedCached = Serialization._UInt64Serializer.deserialize(dict["user_within_team_space_used_cached"] ?? .null) - return TeamSpaceAllocation(used: used, allocated: allocated, userWithinTeamSpaceAllocated: userWithinTeamSpaceAllocated, userWithinTeamSpaceLimitType: userWithinTeamSpaceLimitType, userWithinTeamSpaceUsedCached: userWithinTeamSpaceUsedCached) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let used = try Serialization._UInt64Serializer.deserialize(dict["used"] ?? .null) + let allocated = try Serialization._UInt64Serializer.deserialize(dict["allocated"] ?? .null) + let userWithinTeamSpaceAllocated = try Serialization._UInt64Serializer.deserialize(dict["user_within_team_space_allocated"] ?? .null) + let userWithinTeamSpaceLimitType = try TeamCommon.MemberSpaceLimitTypeSerializer() + .deserialize(dict["user_within_team_space_limit_type"] ?? .null) + let userWithinTeamSpaceUsedCached = try Serialization._UInt64Serializer.deserialize(dict["user_within_team_space_used_cached"] ?? .null) + return TeamSpaceAllocation( + used: used, + allocated: allocated, + userWithinTeamSpaceAllocated: userWithinTeamSpaceAllocated, + userWithinTeamSpaceLimitType: userWithinTeamSpaceLimitType, + userWithinTeamSpaceUsedCached: userWithinTeamSpaceUsedCached + ) + default: + throw JSONSerializerError.deserializeError(type: TeamSpaceAllocation.self, json: json) } } } /// A set of features that a Dropbox User account may have configured. - public enum UserFeature: CustomStringConvertible { + public enum UserFeature: CustomStringConvertible, JSONRepresentable { /// This feature contains information about how the user's Paper files are stored. case paperAsFiles /// This feature allows users to lock files in order to restrict other users from editing them. @@ -760,50 +987,60 @@ open class Users { /// An unspecified error. case other + func json() throws -> JSON { + try UserFeatureSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserFeatureSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserFeatureSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserFeature: \(error)" + } } } - open class UserFeatureSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserFeature) -> JSON { + + public class UserFeatureSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserFeature) throws -> JSON { switch value { - case .paperAsFiles: - var d = [String: JSON]() - d[".tag"] = .str("paper_as_files") - return .dictionary(d) - case .fileLocking: - var d = [String: JSON]() - d[".tag"] = .str("file_locking") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .paperAsFiles: + var d = [String: JSON]() + d[".tag"] = .str("paper_as_files") + return .dictionary(d) + case .fileLocking: + var d = [String: JSON]() + d[".tag"] = .str("file_locking") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> UserFeature { + + public func deserialize(_ json: JSON) throws -> UserFeature { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "paper_as_files": - return UserFeature.paperAsFiles - case "file_locking": - return UserFeature.fileLocking - case "other": - return UserFeature.other - default: - return UserFeature.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "paper_as_files": + return UserFeature.paperAsFiles + case "file_locking": + return UserFeature.fileLocking + case "other": + return UserFeature.other default: - fatalError("Failed to deserialize") + return UserFeature.other + } + default: + throw JSONSerializerError.deserializeError(type: UserFeature.self, json: json) } } } /// Values that correspond to entries in UserFeature. - public enum UserFeatureValue: CustomStringConvertible { + public enum UserFeatureValue: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case paperAsFiles(Users.PaperAsFilesValue) /// An unspecified error. @@ -811,155 +1048,196 @@ open class Users { /// An unspecified error. case other + func json() throws -> JSON { + try UserFeatureValueSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserFeatureValueSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserFeatureValueSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserFeatureValue: \(error)" + } } } - open class UserFeatureValueSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserFeatureValue) -> JSON { + + public class UserFeatureValueSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserFeatureValue) throws -> JSON { switch value { - case .paperAsFiles(let arg): - var d = ["paper_as_files": Users.PaperAsFilesValueSerializer().serialize(arg)] - d[".tag"] = .str("paper_as_files") - return .dictionary(d) - case .fileLocking(let arg): - var d = ["file_locking": Users.FileLockingValueSerializer().serialize(arg)] - d[".tag"] = .str("file_locking") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .paperAsFiles(let arg): + var d = try ["paper_as_files": Users.PaperAsFilesValueSerializer().serialize(arg)] + d[".tag"] = .str("paper_as_files") + return .dictionary(d) + case .fileLocking(let arg): + var d = try ["file_locking": Users.FileLockingValueSerializer().serialize(arg)] + d[".tag"] = .str("file_locking") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> UserFeatureValue { + + public func deserialize(_ json: JSON) throws -> UserFeatureValue { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "paper_as_files": - let v = Users.PaperAsFilesValueSerializer().deserialize(d["paper_as_files"] ?? .null) - return UserFeatureValue.paperAsFiles(v) - case "file_locking": - let v = Users.FileLockingValueSerializer().deserialize(d["file_locking"] ?? .null) - return UserFeatureValue.fileLocking(v) - case "other": - return UserFeatureValue.other - default: - return UserFeatureValue.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "paper_as_files": + let v = try Users.PaperAsFilesValueSerializer().deserialize(d["paper_as_files"] ?? .null) + return UserFeatureValue.paperAsFiles(v) + case "file_locking": + let v = try Users.FileLockingValueSerializer().deserialize(d["file_locking"] ?? .null) + return UserFeatureValue.fileLocking(v) + case "other": + return UserFeatureValue.other default: - fatalError("Failed to deserialize") + return UserFeatureValue.other + } + default: + throw JSONSerializerError.deserializeError(type: UserFeatureValue.self, json: json) } } } /// The UserFeaturesGetValuesBatchArg struct - open class UserFeaturesGetValuesBatchArg: CustomStringConvertible { + public class UserFeaturesGetValuesBatchArg: CustomStringConvertible, JSONRepresentable { /// A list of features in UserFeature. If the list is empty, this route will return /// UserFeaturesGetValuesBatchError. - public let features: Array - public init(features: Array) { + public let features: [Users.UserFeature] + public init(features: [Users.UserFeature]) { self.features = features } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserFeaturesGetValuesBatchArgSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserFeaturesGetValuesBatchArgSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserFeaturesGetValuesBatchArgSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserFeaturesGetValuesBatchArg: \(error)" + } } } - open class UserFeaturesGetValuesBatchArgSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserFeaturesGetValuesBatchArg) -> JSON { - let output = [ - "features": ArraySerializer(Users.UserFeatureSerializer()).serialize(value.features), + + public class UserFeaturesGetValuesBatchArgSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserFeaturesGetValuesBatchArg) throws -> JSON { + let output = [ + "features": try ArraySerializer(Users.UserFeatureSerializer()).serialize(value.features), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserFeaturesGetValuesBatchArg { + + public func deserialize(_ json: JSON) throws -> UserFeaturesGetValuesBatchArg { switch json { - case .dictionary(let dict): - let features = ArraySerializer(Users.UserFeatureSerializer()).deserialize(dict["features"] ?? .null) - return UserFeaturesGetValuesBatchArg(features: features) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let features = try ArraySerializer(Users.UserFeatureSerializer()).deserialize(dict["features"] ?? .null) + return UserFeaturesGetValuesBatchArg(features: features) + default: + throw JSONSerializerError.deserializeError(type: UserFeaturesGetValuesBatchArg.self, json: json) } } } /// The UserFeaturesGetValuesBatchError union - public enum UserFeaturesGetValuesBatchError: CustomStringConvertible { + public enum UserFeaturesGetValuesBatchError: CustomStringConvertible, JSONRepresentable { /// At least one UserFeature must be included in the UserFeaturesGetValuesBatchArg.features list. case emptyFeaturesList /// An unspecified error. case other + func json() throws -> JSON { + try UserFeaturesGetValuesBatchErrorSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserFeaturesGetValuesBatchErrorSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserFeaturesGetValuesBatchErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserFeaturesGetValuesBatchError: \(error)" + } } } - open class UserFeaturesGetValuesBatchErrorSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserFeaturesGetValuesBatchError) -> JSON { + + public class UserFeaturesGetValuesBatchErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserFeaturesGetValuesBatchError) throws -> JSON { switch value { - case .emptyFeaturesList: - var d = [String: JSON]() - d[".tag"] = .str("empty_features_list") - return .dictionary(d) - case .other: - var d = [String: JSON]() - d[".tag"] = .str("other") - return .dictionary(d) + case .emptyFeaturesList: + var d = [String: JSON]() + d[".tag"] = .str("empty_features_list") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> UserFeaturesGetValuesBatchError { + + public func deserialize(_ json: JSON) throws -> UserFeaturesGetValuesBatchError { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "empty_features_list": - return UserFeaturesGetValuesBatchError.emptyFeaturesList - case "other": - return UserFeaturesGetValuesBatchError.other - default: - return UserFeaturesGetValuesBatchError.other - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "empty_features_list": + return UserFeaturesGetValuesBatchError.emptyFeaturesList + case "other": + return UserFeaturesGetValuesBatchError.other default: - fatalError("Failed to deserialize") + return UserFeaturesGetValuesBatchError.other + } + default: + throw JSONSerializerError.deserializeError(type: UserFeaturesGetValuesBatchError.self, json: json) } } } /// The UserFeaturesGetValuesBatchResult struct - open class UserFeaturesGetValuesBatchResult: CustomStringConvertible { + public class UserFeaturesGetValuesBatchResult: CustomStringConvertible, JSONRepresentable { /// (no description) - public let values: Array - public init(values: Array) { + public let values: [Users.UserFeatureValue] + public init(values: [Users.UserFeatureValue]) { self.values = values } - open var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(UserFeaturesGetValuesBatchResultSerializer().serialize(self)))" + + func json() throws -> JSON { + try UserFeaturesGetValuesBatchResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try UserFeaturesGetValuesBatchResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for UserFeaturesGetValuesBatchResult: \(error)" + } } } - open class UserFeaturesGetValuesBatchResultSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: UserFeaturesGetValuesBatchResult) -> JSON { - let output = [ - "values": ArraySerializer(Users.UserFeatureValueSerializer()).serialize(value.values), + + public class UserFeaturesGetValuesBatchResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: UserFeaturesGetValuesBatchResult) throws -> JSON { + let output = [ + "values": try ArraySerializer(Users.UserFeatureValueSerializer()).serialize(value.values), ] return .dictionary(output) } - open func deserialize(_ json: JSON) -> UserFeaturesGetValuesBatchResult { + + public func deserialize(_ json: JSON) throws -> UserFeaturesGetValuesBatchResult { switch json { - case .dictionary(let dict): - let values = ArraySerializer(Users.UserFeatureValueSerializer()).deserialize(dict["values"] ?? .null) - return UserFeaturesGetValuesBatchResult(values: values) - default: - fatalError("Type error deserializing") + case .dictionary(let dict): + let values = try ArraySerializer(Users.UserFeatureValueSerializer()).deserialize(dict["values"] ?? .null) + return UserFeaturesGetValuesBatchResult(values: values) + default: + throw JSONSerializerError.deserializeError(type: UserFeaturesGetValuesBatchResult.self, json: json) } } } - /// Stone Route Objects static let featuresGetValues = Route( @@ -970,9 +1248,11 @@ open class Users { argSerializer: Users.UserFeaturesGetValuesBatchArgSerializer(), responseSerializer: Users.UserFeaturesGetValuesBatchResultSerializer(), errorSerializer: Users.UserFeaturesGetValuesBatchErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getAccount = Route( name: "get_account", @@ -982,9 +1262,11 @@ open class Users { argSerializer: Users.GetAccountArgSerializer(), responseSerializer: Users.BasicAccountSerializer(), errorSerializer: Users.GetAccountErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getAccountBatch = Route( name: "get_account_batch", @@ -994,9 +1276,11 @@ open class Users { argSerializer: Users.GetAccountBatchArgSerializer(), responseSerializer: ArraySerializer(Users.BasicAccountSerializer()), errorSerializer: Users.GetAccountBatchErrorSerializer(), - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getCurrentAccount = Route( name: "get_current_account", @@ -1006,9 +1290,11 @@ open class Users { argSerializer: Serialization._VoidSerializer, responseSerializer: Users.FullAccountSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) static let getSpaceUsage = Route( name: "get_space_usage", @@ -1018,8 +1304,10 @@ open class Users { argSerializer: Serialization._VoidSerializer, responseSerializer: Users.SpaceUsageSerializer(), errorSerializer: Serialization._VoidSerializer, - attrs: ["auth": "user", - "host": "api", - "style": "rpc"] + attributes: RouteAttributes( + auth: [.user], + host: .api, + style: .rpc + ) ) } diff --git a/Source/SwiftyDropbox/Shared/Generated/UsersCommon.swift b/Source/SwiftyDropbox/Shared/Generated/UsersCommon.swift index 23e80c5ea..d9bb2f583 100644 --- a/Source/SwiftyDropbox/Shared/Generated/UsersCommon.swift +++ b/Source/SwiftyDropbox/Shared/Generated/UsersCommon.swift @@ -7,9 +7,9 @@ import Foundation /// Datatypes and serializers for the users_common namespace -open class UsersCommon { +public class UsersCommon { /// What type of account this user has. - public enum AccountType: CustomStringConvertible { + public enum AccountType: CustomStringConvertible, JSONRepresentable { /// The basic account type. case basic /// The Dropbox Pro account type. @@ -17,46 +17,55 @@ open class UsersCommon { /// The Dropbox Business account type. case business + func json() throws -> JSON { + try AccountTypeSerializer().serialize(self) + } + public var description: String { - return "\(SerializeUtil.prepareJSONForSerialization(AccountTypeSerializer().serialize(self)))" + do { + return "\(SerializeUtil.prepareJSONForSerialization(try AccountTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for AccountType: \(error)" + } } } - open class AccountTypeSerializer: JSONSerializer { - public init() { } - open func serialize(_ value: AccountType) -> JSON { + + public class AccountTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: AccountType) throws -> JSON { switch value { - case .basic: - var d = [String: JSON]() - d[".tag"] = .str("basic") - return .dictionary(d) - case .pro: - var d = [String: JSON]() - d[".tag"] = .str("pro") - return .dictionary(d) - case .business: - var d = [String: JSON]() - d[".tag"] = .str("business") - return .dictionary(d) + case .basic: + var d = [String: JSON]() + d[".tag"] = .str("basic") + return .dictionary(d) + case .pro: + var d = [String: JSON]() + d[".tag"] = .str("pro") + return .dictionary(d) + case .business: + var d = [String: JSON]() + d[".tag"] = .str("business") + return .dictionary(d) } } - open func deserialize(_ json: JSON) -> AccountType { + + public func deserialize(_ json: JSON) throws -> AccountType { switch json { - case .dictionary(let d): - let tag = Serialization.getTag(d) - switch tag { - case "basic": - return AccountType.basic - case "pro": - return AccountType.pro - case "business": - return AccountType.business - default: - fatalError("Unknown tag \(tag)") - } + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "basic": + return AccountType.basic + case "pro": + return AccountType.pro + case "business": + return AccountType.business default: - fatalError("Failed to deserialize") + throw JSONSerializerError.unknownTag(type: AccountType.self, json: json, tag: tag) + } + default: + throw JSONSerializerError.deserializeError(type: AccountType.self, json: json) } } } - } diff --git a/Source/SwiftyDropbox/Shared/Generated/UsersRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/UsersRoutes.swift index c3c79fd49..7c3abd373 100644 --- a/Source/SwiftyDropbox/Shared/Generated/UsersRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/UsersRoutes.swift @@ -7,20 +7,24 @@ import Foundation /// Routes for the users namespace -open class UsersRoutes { +/// For Objective-C compatible routes see DBUsersRoutes +public class UsersRoutes: DropboxTransportClientOwning { public let client: DropboxTransportClient - init(client: DropboxTransportClient) { + required init(client: DropboxTransportClient) { self.client = client } /// Get a list of feature values that may be configured for the current account. /// + /// - scope: account_info.read + /// /// - parameter features: A list of features in UserFeature. If the list is empty, this route will return /// UserFeaturesGetValuesBatchError. /// - /// - returns: Through the response callback, the caller will receive a `Users.UserFeaturesGetValuesBatchResult` + /// - returns: Through the response callback, the caller will receive a `Users.UserFeaturesGetValuesBatchResult` /// object on success or a `Users.UserFeaturesGetValuesBatchError` object on failure. - @discardableResult open func featuresGetValues(features: Array) -> RpcRequest { + @discardableResult public func featuresGetValues(features: [Users.UserFeature]) + -> RpcRequest { let route = Users.featuresGetValues let serverArgs = Users.UserFeaturesGetValuesBatchArg(features: features) return client.request(route, serverArgs: serverArgs) @@ -28,11 +32,13 @@ open class UsersRoutes { /// Get information about a user's account. /// + /// - scope: sharing.read + /// /// - parameter accountId: A user's account identifier. /// - /// - returns: Through the response callback, the caller will receive a `Users.BasicAccount` object on success or a + /// - returns: Through the response callback, the caller will receive a `Users.BasicAccount` object on success or a /// `Users.GetAccountError` object on failure. - @discardableResult open func getAccount(accountId: String) -> RpcRequest { + @discardableResult public func getAccount(accountId: String) -> RpcRequest { let route = Users.getAccount let serverArgs = Users.GetAccountArg(accountId: accountId) return client.request(route, serverArgs: serverArgs) @@ -40,11 +46,14 @@ open class UsersRoutes { /// Get information about multiple user accounts. At most 300 accounts may be queried per request. /// + /// - scope: sharing.read + /// /// - parameter accountIds: List of user account identifiers. Should not contain any duplicate account IDs. /// - /// - returns: Through the response callback, the caller will receive a `Array` object on + /// - returns: Through the response callback, the caller will receive a `Array` object on /// success or a `Users.GetAccountBatchError` object on failure. - @discardableResult open func getAccountBatch(accountIds: Array) -> RpcRequest, Users.GetAccountBatchErrorSerializer> { + @discardableResult public func getAccountBatch(accountIds: [String]) + -> RpcRequest, Users.GetAccountBatchErrorSerializer> { let route = Users.getAccountBatch let serverArgs = Users.GetAccountBatchArg(accountIds: accountIds) return client.request(route, serverArgs: serverArgs) @@ -52,22 +61,25 @@ open class UsersRoutes { /// Get information about the current user's account. /// + /// - scope: account_info.read /// - /// - returns: Through the response callback, the caller will receive a `Users.FullAccount` object on success or a + /// + /// - returns: Through the response callback, the caller will receive a `Users.FullAccount` object on success or a /// `Void` object on failure. - @discardableResult open func getCurrentAccount() -> RpcRequest { + @discardableResult public func getCurrentAccount() -> RpcRequest { let route = Users.getCurrentAccount return client.request(route) } /// Get the space usage information for the current user's account. /// + /// - scope: account_info.read + /// /// - /// - returns: Through the response callback, the caller will receive a `Users.SpaceUsage` object on success or a + /// - returns: Through the response callback, the caller will receive a `Users.SpaceUsage` object on success or a /// `Void` object on failure. - @discardableResult open func getSpaceUsage() -> RpcRequest { + @discardableResult public func getSpaceUsage() -> RpcRequest { let route = Users.getSpaceUsage return client.request(route) } - } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/BackgroundClientSetupInfo.swift b/Source/SwiftyDropbox/Shared/Handwritten/BackgroundClientSetupInfo.swift new file mode 100644 index 000000000..8f2bf96cd --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/BackgroundClientSetupInfo.swift @@ -0,0 +1,61 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +public class DefaultBackgroundExtensionSessionCreationInfo { + let backgroundSessionIdentifier: String + let sharedContainerIdentifier: String + + public init(backgroundSessionIdentifier: String, sharedContainerIdentifier: String) { + self.backgroundSessionIdentifier = backgroundSessionIdentifier + self.sharedContainerIdentifier = sharedContainerIdentifier + } +} + +public class CustomBackgroundExtensionSessionCreationInfo { + let backgroundTransportClient: DropboxTransportClient? + let backgroundSessionConfiguration: NetworkSessionConfiguration? + + var backgroundSessionIdentifier: String? { + if let backgroundTransportClient = backgroundTransportClient { + return backgroundTransportClient.identifier + } else { + return backgroundSessionConfiguration?.identifier + } + } + + public init(backgroundTransportClient: DropboxTransportClient?) { + self.backgroundTransportClient = backgroundTransportClient + self.backgroundSessionConfiguration = nil + } + + public init(backgroundSessionConfiguration: NetworkSessionConfiguration?) { + self.backgroundTransportClient = nil + self.backgroundSessionConfiguration = backgroundSessionConfiguration + } +} + +public class BackgroundExtensionSessionCreationInfo { + let defaultInfo: DefaultBackgroundExtensionSessionCreationInfo? + let customInfo: CustomBackgroundExtensionSessionCreationInfo? + + var identifier: String? { + if let defaultInfo = defaultInfo { + return defaultInfo.backgroundSessionIdentifier + } else { + return customInfo?.backgroundSessionIdentifier + } + } + + public init(defaultInfo: DefaultBackgroundExtensionSessionCreationInfo) { + self.defaultInfo = defaultInfo + self.customInfo = nil + } + + public init(customInfo: CustomBackgroundExtensionSessionCreationInfo) { + self.defaultInfo = nil + self.customInfo = customInfo + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/CertificatePinning.swift b/Source/SwiftyDropbox/Shared/Handwritten/CertificatePinning.swift new file mode 100644 index 000000000..8c5110171 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/CertificatePinning.swift @@ -0,0 +1,9 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +public enum AuthChallenge { + public typealias Handler = (URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?) +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/ChunkInputStream.swift b/Source/SwiftyDropbox/Shared/Handwritten/Custom/ChunkInputStream.swift similarity index 98% rename from Source/SwiftyDropbox/Shared/Handwritten/ChunkInputStream.swift rename to Source/SwiftyDropbox/Shared/Handwritten/Custom/ChunkInputStream.swift index 5f5772f79..44a788bf2 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/ChunkInputStream.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/Custom/ChunkInputStream.swift @@ -37,7 +37,7 @@ class ChunkInputStream: InputStream, StreamDelegate { self.totalBytesToRead = end - start self.totalBytesRead = 0 super.init(data: Data()) - self.internalStream?.delegate = self + internalStream?.delegate = self self.delegate = self } @@ -68,7 +68,7 @@ class ChunkInputStream: InputStream, StreamDelegate { override func getBuffer( _ buffer: UnsafeMutablePointer?>, length len: UnsafeMutablePointer ) -> Bool { - return false + false } // MARK: Stream overrides diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Custom.swift b/Source/SwiftyDropbox/Shared/Handwritten/Custom/Custom.swift similarity index 67% rename from Source/SwiftyDropbox/Shared/Handwritten/Custom.swift rename to Source/SwiftyDropbox/Shared/Handwritten/Custom/Custom.swift index 1c3060a55..32a3ea0a5 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/Custom.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/Custom/Custom.swift @@ -13,14 +13,26 @@ import Foundation /// `/upload_session/finish_batch/check`. This object will be nonnull if there is a request error from the call to /// `/upload_session/finish_batch/check`. The fourth argument is a mapping of client-side NSURLs to general request /// errors, which occured during the upload of the corresponding file. -public typealias BatchUploadResponseBlock = ([URL: Files.UploadSessionFinishBatchResultEntry]?, CallError?, [URL: CallError]) -> Void +public typealias BatchUploadResponseBlock = ([URL: Files.UploadSessionFinishBatchResultEntry]?, BatchUploadError?, [URL: BatchUploadError]) -> Void public typealias ProgressBlock = (Progress) -> Void +public enum BatchUploadError { + case clientError(CallError) + case startError(CallError) + case appendError(CallError) + case finishError(CallError) +} + /// /// Stores data for a particular batch upload attempt. /// -open class BatchUploadData { +class BatchUploadData { + struct UrlPair: Hashable { + let callerUrl: URL + let copiedUrl: URL + } + /// The queue on which most response handling is performed. let queue: DispatchQueue /// The dispatch group that pairs upload requests with upload responses so that we can wait for all request/response @@ -28,9 +40,11 @@ open class BatchUploadData { /// limit), without waiting for the corresponding response. let uploadGroup = DispatchGroup() /// A client-supplied parameter that maps the file urls of the files to upload to the corresponding commit info objects. - let fileUrlsToCommitInfo: [URL: Files.CommitInfo] + let fileUrlPairsToCommitInfo: [UrlPair: Files.CommitInfo] /// Mapping of urls for files that were unsuccessfully uploaded to any request errors that were encounted. - var fileUrlsToRequestErrors: [URL: CallError] + var fileUrlPairsToRequestErrors: [UrlPair: BatchUploadError] + /// The location to which we copied the files to upload at the start of the batch. + var tempDirectoryUrl: URL /// List of finish args (which include commit info, cursor, etc.) which the SDK maintains and passes to /// `upload_session/finish_batch`. var finishArgs: [Files.UploadSessionFinishArg] @@ -42,10 +56,18 @@ open class BatchUploadData { var totalUploadProgress: Progress? /// The flag that determines whether upload continues or not. var cancel: Bool = false - /// The container object that stores all upload / download task objects for cancelling. -// let taskStorage: DBTasksStorage! - - public init(fileCommitInfo fileUrlsToCommitInfo: [URL: Files.CommitInfo], progressBlock: ProgressBlock?, responseBlock: @escaping BatchUploadResponseBlock, queue: DispatchQueue) { + /// The container objects that stores all in-flight upload / download request objects for cancelling. + var startRequests: [UrlPair: UploadRequest] + var appendRequests: [UrlPair: UploadRequest] + var finishRequest: RpcRequest? + + init( + fileCommitInfo fileUrlPairsToCommitInfo: [UrlPair: Files.CommitInfo], + tempDirectoryUrl: URL, + progressBlock: ProgressBlock?, + responseBlock: @escaping BatchUploadResponseBlock, + queue: DispatchQueue + ) { // we specifiy a custom queue so that the main thread is not blocked self.queue = queue // we want to make sure all of our file data has been uploaded @@ -53,13 +75,15 @@ open class BatchUploadData { // but we also don't want to wait for each response before making a // succeeding upload call, so we used dispatch groups to wait for all upload // calls to return before making our final batch commit call - self.fileUrlsToCommitInfo = fileUrlsToCommitInfo - self.fileUrlsToRequestErrors = [:] + self.fileUrlPairsToCommitInfo = fileUrlPairsToCommitInfo + self.fileUrlPairsToRequestErrors = [:] + self.tempDirectoryUrl = tempDirectoryUrl self.finishArgs = [] self.progressBlock = progressBlock self.responseBlock = responseBlock self.totalUploadProgress = nil -// self.taskStorage = DBTasksStorage() - + self.startRequests = [:] + self.appendRequests = [:] + self.finishRequest = nil } } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomRoutes.swift b/Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomRoutes.swift new file mode 100644 index 000000000..b2ccb85f4 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomRoutes.swift @@ -0,0 +1,348 @@ +/// +/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +// 24 MB file chunk size +let fileChunkSize: UInt64 = 24 * 1_024 * 1_024 +let timeoutInSec = 200 + +extension FilesRoutes { + @discardableResult public func batchUploadFiles( + fileUrlsToCommitInfo: [URL: Files.CommitInfo], + queue: DispatchQueue? = nil, + progressBlock: ProgressBlock? = nil, + responseBlock: @escaping BatchUploadResponseBlock + ) -> BatchUploadTask? { + if client.isBackgroundClient { + fatalError("batch upload is not supported for background clients") + } + + let tempDirectory = URL(fileURLWithPath: NSTemporaryDirectory()) + .appendingPathComponent("FilesRoutes.batchUploadFiles") + .appendingPathComponent(UUID().uuidString) + + let responseQueue = queue ?? DispatchQueue.main + + var copiedFileUrlPairsToCommitInfo: [BatchUploadData.UrlPair: Files.CommitInfo] + + do { + copiedFileUrlPairsToCommitInfo = try copyUrlsToTempDirectory(tempDirectory: tempDirectory, fileUrlsToCommitInfo: fileUrlsToCommitInfo) + } catch { + DropboxClientsManager.log(.error, "Error creating batch upload temp directory: \(error.localizedDescription)") + responseQueue.async { + responseBlock(nil, .clientError(.clientError(.fileAccessError(error))), [:]) + self.cleanUpTempDirectory(tempDirectory: tempDirectory) + } + return nil + } + + let uploadData = BatchUploadData( + fileCommitInfo: copiedFileUrlPairsToCommitInfo, + tempDirectoryUrl: tempDirectory, + progressBlock: progressBlock, + responseBlock: responseBlock, + queue: responseQueue + ) + let uploadTask = BatchUploadTask(uploadData: uploadData) + + let fileUrlPairs: [BatchUploadData.UrlPair] = Array(uploadData.fileUrlPairsToCommitInfo.keys) + + var fileUrlPairsToFileSize: [BatchUploadData.UrlPair: UInt64] = [:] + var totalUploadSize: UInt64 = 0 + // determine total upload size for progress handler + for fileUrlPair in fileUrlPairs { + var fileSize: UInt64 + + do { + let attr = try FileManager.default.attributesOfItem(atPath: fileUrlPair.copiedUrl.path) + fileSize = attr[FileAttributeKey.size] as? UInt64 ?? 0 + totalUploadSize += fileSize + fileUrlPairsToFileSize[fileUrlPair] = fileSize + } catch { + uploadData.queue.async { + let clientError: ClientError = .fileAccessError(error) + uploadData.responseBlock(nil, nil, [fileUrlPair.callerUrl: .clientError(.clientError(clientError))]) + self.cleanUpTempDirectory(tempDirectory: uploadData.tempDirectoryUrl) + } + return uploadTask + } + } + + uploadData.totalUploadProgress = Progress(totalUnitCount: Int64(totalUploadSize)) + + for fileUrlPair in fileUrlPairs { + guard let fileSize = fileUrlPairsToFileSize[fileUrlPair] else { continue } + if !uploadData.cancel { + if fileSize < fileChunkSize { + // file is small, so we won't chunk upload it. + startUploadSmallFile(uploadData: uploadData, fileUrlPair: fileUrlPair, fileSize: fileSize) + } else { + // file is somewhat large, so we will chunk upload it, repeatedly querying + // `/upload_session/append_v2` until the file is uploaded + startUploadLargeFile(uploadData: uploadData, fileUrlPair: fileUrlPair, fileSize: fileSize) + } + } else { + break + } + } + // small or large, we query `upload_session/finish_batch` to batch commit + // uploaded files. + batchFinishUponCompletion(uploadData: uploadData) + return uploadTask + } + + func startUploadSmallFile(uploadData: BatchUploadData, fileUrlPair: BatchUploadData.UrlPair, fileSize: UInt64) { // this is the copied URL + uploadData.uploadGroup.enter() + // immediately close session after first API call + // because file can be uploaded in one request + + let request = uploadSessionStart(close: true, input: fileUrlPair.copiedUrl).response(queue: uploadData.queue, completionHandler: { result, error in + if let result = result, let commitInfo = uploadData.fileUrlPairsToCommitInfo[fileUrlPair] { + let sessionId = result.sessionId + let offset = fileSize + let cursor = Files.UploadSessionCursor(sessionId: sessionId, offset: offset) + let finishArg = Files.UploadSessionFinishArg(cursor: cursor, commit: commitInfo) + // store commit info for this file + uploadData.finishArgs.append(finishArg) + } else if let error = error { + uploadData.fileUrlPairsToRequestErrors[fileUrlPair] = .startError(error) + } + uploadData.startRequests[fileUrlPair] = nil + uploadData.uploadGroup.leave() + }).progress { progress in + self.executeProgressHandler(uploadData: uploadData, progress: progress) + } + uploadData.startRequests[fileUrlPair] = request + } + + func startUploadLargeFile(uploadData: BatchUploadData, fileUrlPair: BatchUploadData.UrlPair, fileSize: UInt64) { + uploadData.uploadGroup.enter() + let startBytes = 0 + let endBytes = fileChunkSize + let fileChunkInputStream = ChunkInputStream(fileUrl: fileUrlPair.copiedUrl, startBytes: startBytes, endBytes: Int(endBytes)) + // use seperate continue upload queue so we don't block other files from + // commencing their upload + let chunkUploadContinueQueue = DispatchQueue(label: "chunk_upload_continue_queue") + // do not immediately close session + + let request = uploadSessionStart(input: fileChunkInputStream).response(queue: chunkUploadContinueQueue, completionHandler: { result, error in + if let result = result, let commitInfo = uploadData.fileUrlPairsToCommitInfo[fileUrlPair] { + let sessionId = result.sessionId + self.appendRemainingFileChunks(uploadData: uploadData, fileUrlPair: fileUrlPair, fileSize: fileSize, sessionId: sessionId) + let cursor = Files.UploadSessionCursor(sessionId: sessionId, offset: fileSize) + let finishArg = Files.UploadSessionFinishArg(cursor: cursor, commit: commitInfo) + // Store commit info for this file + uploadData.finishArgs.append(finishArg) + } else if let error = error { + uploadData.fileUrlPairsToRequestErrors[fileUrlPair] = .startError(error) + uploadData.uploadGroup.leave() + } + uploadData.startRequests[fileUrlPair] = nil + }).progress { progress in + progress.totalUnitCount = Int64(endBytes) + self.executeProgressHandler(uploadData: uploadData, progress: progress) + } + + uploadData.startRequests[fileUrlPair] = request + } + + func appendRemainingFileChunks(uploadData: BatchUploadData, fileUrlPair: BatchUploadData.UrlPair, fileSize: UInt64, sessionId: String) { + // use seperate response queue so we don't block response thread + // with dispatch_semaphore_t + let chunkUploadResponseQueue = DispatchQueue(label: "chunk_upload_response_queue") + + chunkUploadResponseQueue.async { + var numFileChunks = fileSize / fileChunkSize + if fileSize % fileChunkSize != 0 { + numFileChunks += 1 + } + var totalBytesSent: UInt64 = 0 + let chunkUploadFinished = DispatchSemaphore(value: 0) + // iterate through all remaining chunks and upload each one sequentially + for i in 1 ..< numFileChunks { + guard !uploadData.cancel else { break } + let startBytes = fileChunkSize * i + let endBytes = (i != numFileChunks - 1) ? fileChunkSize * (i + 1) : fileSize + let fileChunkInputStream = ChunkInputStream(fileUrl: fileUrlPair.copiedUrl, startBytes: Int(startBytes), endBytes: Int(endBytes)) + totalBytesSent += fileChunkSize + let cursor = Files.UploadSessionCursor(sessionId: sessionId, offset: totalBytesSent) + let shouldClose = (i != numFileChunks - 1) ? false : true + self.appendFileChunk( + uploadData: uploadData, + fileUrlPair: fileUrlPair, + cursor: cursor, + shouldClose: shouldClose, + fileChunkInputStream: fileChunkInputStream, + chunkUploadResponseQueue: chunkUploadResponseQueue, + chunkUploadFinished: chunkUploadFinished, + retryCount: 0, + startBytes: startBytes, + endBytes: endBytes + ) + // wait until each chunk upload completes before resuming loop iteration + _ = chunkUploadFinished.wait(timeout: DispatchTime.now() + .seconds(480)) + guard uploadData.fileUrlPairsToRequestErrors[fileUrlPair] == nil else { break } + } + uploadData.uploadGroup.leave() + } + } + + func appendFileChunk( + uploadData: BatchUploadData, + fileUrlPair: BatchUploadData.UrlPair, + cursor: Files.UploadSessionCursor, + shouldClose: Bool, + fileChunkInputStream: ChunkInputStream, + chunkUploadResponseQueue: DispatchQueue, + chunkUploadFinished: DispatchSemaphore, + retryCount: Int, + startBytes: UInt64, + endBytes: UInt64 + ) { + // close session on final append call + + let request = uploadSessionAppendV2(cursor: cursor, close: shouldClose, input: fileChunkInputStream).response( + queue: DispatchQueue(label: "chunk_append_response_queue"), + completionHandler: { result, error in + uploadData.appendRequests[fileUrlPair] = nil + if result == nil { + if let error = error { + switch error as CallError { + case .rateLimitError(let rateLimitError, _, _, _): + let backoffInSeconds = rateLimitError.retryAfter + DispatchQueue.main.asyncAfter(deadline: .now() + Double(backoffInSeconds)) { + if retryCount <= 3 { + self.appendFileChunk( + uploadData: uploadData, + fileUrlPair: fileUrlPair, + cursor: cursor, + shouldClose: shouldClose, + fileChunkInputStream: fileChunkInputStream, + chunkUploadResponseQueue: chunkUploadResponseQueue, + chunkUploadFinished: chunkUploadFinished, + retryCount: retryCount + 1, + startBytes: startBytes, + endBytes: endBytes + ) + } else { + uploadData.fileUrlPairsToRequestErrors[fileUrlPair] = .appendError(error) + } + } + default: + uploadData.fileUrlPairsToRequestErrors[fileUrlPair] = .appendError(error) + } + } + } + chunkUploadFinished.signal() + } + ).progress { progress in + if retryCount == 0 { + progress.totalUnitCount = Int64(endBytes - startBytes) + self.executeProgressHandler(uploadData: uploadData, progress: progress) + } + } + + uploadData.appendRequests[fileUrlPair] = request + } + + func finishBatch( + uploadData: BatchUploadData, + entries: [Files.UploadSessionFinishBatchResultEntry] + ) { + uploadData.queue.async { + var dropboxFilePathToNSURL = [String: URL]() + for (fileUrl, commitInfo) in uploadData.fileUrlPairsToCommitInfo { + dropboxFilePathToNSURL[commitInfo.path] = fileUrl.callerUrl + } + var fileUrlsToBatchResultEntries: [URL: Files.UploadSessionFinishBatchResultEntry] = [:] + var index = 0 + for finishArg in uploadData.finishArgs { + let path = finishArg.commit.path + guard let dropboxFilePathToNSURL = dropboxFilePathToNSURL[path] else { continue } + let resultEntry: Files.UploadSessionFinishBatchResultEntry? = entries[index] + fileUrlsToBatchResultEntries[dropboxFilePathToNSURL] = resultEntry + index += 1 + } + uploadData.responseBlock(fileUrlsToBatchResultEntries, nil, self.fileUrlsToRequestErrors(from: uploadData)) + self.cleanUpTempDirectory(tempDirectory: uploadData.tempDirectoryUrl) + } + } + + func batchFinishUponCompletion(uploadData: BatchUploadData) { + uploadData.uploadGroup.notify(queue: DispatchQueue.main) { + uploadData.finishArgs.sort { $0.commit.path < $1.commit.path } + + let request = self.uploadSessionFinishBatchV2(entries: uploadData.finishArgs).response { result, error in + if let result = result { + self.finishBatch(uploadData: uploadData, entries: result.entries) + } else { + uploadData.queue.async { + let batchError: BatchUploadError? = error.map { .finishError($0) } + uploadData.responseBlock(nil, batchError, self.fileUrlsToRequestErrors(from: uploadData)) + self.cleanUpTempDirectory(tempDirectory: uploadData.tempDirectoryUrl) + } + } + uploadData.finishRequest = nil + } + + uploadData.finishRequest = request + } + } + + func executeProgressHandler(uploadData: BatchUploadData, progress: Progress) { + if let progressBlock = uploadData.progressBlock, let totalUploadProgress = uploadData.totalUploadProgress { + uploadData.queue.async { + // Only increment total progress if one of the requests is completed + if progress.totalUnitCount == progress.completedUnitCount { + totalUploadProgress.completedUnitCount += progress.completedUnitCount + } + progressBlock(totalUploadProgress) + } + } + } + + func fileUrlsToRequestErrors(from uploadData: BatchUploadData) -> [URL: BatchUploadError] { + uploadData.fileUrlPairsToRequestErrors.reduce([:]) { partialResult, keyValuePair in + var dict = partialResult + dict[keyValuePair.key.callerUrl] = keyValuePair.value + return dict + } + } + + // Copying URLs for upload + + var fileManager: FileManager { + FileManager.default + } + + func copyUrlsToTempDirectory(tempDirectory: URL, fileUrlsToCommitInfo: [URL: Files.CommitInfo]) throws -> [BatchUploadData.UrlPair: Files.CommitInfo] { + var copiedPairs: [BatchUploadData.UrlPair: Files.CommitInfo] = [:] + + // Create temporary directory if it does not exist + if !fileManager.fileExists(atPath: tempDirectory.path) { + try fileManager.createDirectory(at: tempDirectory, withIntermediateDirectories: true, attributes: nil) + } + + // Copy each file URL to the temporary directory + for (fileUrl, commitInto) in fileUrlsToCommitInfo { + let copiedFileUrl = tempDirectory.appendingPathComponent(UUID().uuidString) + + try fileManager.copyItem(at: fileUrl, to: copiedFileUrl) + + let urlPair = BatchUploadData.UrlPair(callerUrl: fileUrl, copiedUrl: copiedFileUrl) + copiedPairs[urlPair] = commitInto + } + + return copiedPairs + } + + func cleanUpTempDirectory(tempDirectory: URL) { + do { + try fileManager.removeItem(at: tempDirectory) + } catch { + DropboxClientsManager.log(.error, "Error deleting batch upload temp directory: \(error.localizedDescription)") + } + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomTasks.swift b/Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomTasks.swift new file mode 100644 index 000000000..bd8f071c6 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/Custom/CustomTasks.swift @@ -0,0 +1,20 @@ +/// +/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +public class BatchUploadTask { + let uploadData: BatchUploadData + + init(uploadData: BatchUploadData) { + self.uploadData = uploadData + } + + public func cancel() { + uploadData.cancel = true + uploadData.startRequests.values.forEach { $0.cancel() } + uploadData.appendRequests.values.forEach { $0.cancel() } + uploadData.finishRequest?.cancel() + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/CustomRoutes.swift b/Source/SwiftyDropbox/Shared/Handwritten/CustomRoutes.swift deleted file mode 100644 index 4ed960ff5..000000000 --- a/Source/SwiftyDropbox/Shared/Handwritten/CustomRoutes.swift +++ /dev/null @@ -1,222 +0,0 @@ -/// -/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. -/// - -import Foundation - -// 10 MB file chunk size -let fileChunkSize: UInt64 = 10 * 1024 * 1024 -let timeoutInSec = 200 - -extension FilesRoutes { - - @discardableResult public func batchUploadFiles(fileUrlsToCommitInfo: [URL: Files.CommitInfo], queue: DispatchQueue? = nil, progressBlock: ProgressBlock? = nil, responseBlock: @escaping BatchUploadResponseBlock) -> BatchUploadTask { - let uploadData = BatchUploadData(fileCommitInfo: fileUrlsToCommitInfo, progressBlock: progressBlock, responseBlock: responseBlock, queue: queue ?? DispatchQueue.main) - let uploadTask = BatchUploadTask(uploadData: uploadData) - let fileUrls = fileUrlsToCommitInfo.keys - var fileUrlsToFileSize: [URL: UInt64] = [:] - var totalUploadSize: UInt64 = 0 - // determine total upload size for progress handler - for fileUrl: URL in fileUrls { - var fileSize : UInt64 - - do { - let attr = try FileManager.default.attributesOfItem(atPath: fileUrl.path) - fileSize = attr[FileAttributeKey.size] as! UInt64 - totalUploadSize += fileSize - fileUrlsToFileSize[fileUrl] = fileSize - } catch { - uploadData.queue.sync { - uploadData.responseBlock(nil, nil, [fileUrl: .clientError(error)]) - } - return uploadTask - } - } - - uploadData.totalUploadProgress = Progress(totalUnitCount: Int64(totalUploadSize)); - - for fileUrl: URL in fileUrls { - let fileSize = fileUrlsToFileSize[fileUrl]! - if !uploadData.cancel { - if fileSize < fileChunkSize { - // file is small, so we won't chunk upload it. - self.startUploadSmallFile(uploadData: uploadData, fileUrl: fileUrl, fileSize: fileSize) - } - else { - // file is somewhat large, so we will chunk upload it, repeatedly querying - // `/upload_session/append_v2` until the file is uploaded - self.startUploadLargeFile(uploadData: uploadData, fileUrl: fileUrl, fileSize: fileSize) - } - } - else { - break - } - } - // small or large, we query `upload_session/finish_batch` to batch commit - // uploaded files. - self.batchFinishUponCompletion(uploadData: uploadData) - return uploadTask - } - - func startUploadSmallFile(uploadData: BatchUploadData, fileUrl: URL, fileSize: UInt64) { - uploadData.uploadGroup.enter() - // immediately close session after first API call - // because file can be uploaded in one request - self.uploadSessionStart(close: true, input: fileUrl).response(queue: uploadData.queue, completionHandler: { result, error in - if let result = result { - let sessionId = result.sessionId - let offset = (fileSize) - let cursor = Files.UploadSessionCursor(sessionId: sessionId, offset: offset) - let commitInfo = uploadData.fileUrlsToCommitInfo[fileUrl]! - let finishArg = Files.UploadSessionFinishArg(cursor: cursor, commit: commitInfo) - // store commit info for this file - uploadData.finishArgs.append(finishArg) - } - else { -// uploadData.fileUrlsToRequestErrors[fileUrl] = error - } -// uploadData.taskStorage.removeUploadTask(task) - uploadData.uploadGroup.leave() - }) - } - - func startUploadLargeFile(uploadData: BatchUploadData, fileUrl: URL, fileSize: UInt64) { - uploadData.uploadGroup.enter() - let startBytes = 0 - let endBytes = fileChunkSize - let fileChunkInputStream = ChunkInputStream(fileUrl: fileUrl, startBytes: startBytes, endBytes: Int(endBytes)) - // use seperate continue upload queue so we don't block other files from - // commencing their upload - let chunkUploadContinueQueue = DispatchQueue(label: "chunk_upload_continue_queue") - // do not immediately close session - - self.uploadSessionStart(input: fileChunkInputStream).response(queue: chunkUploadContinueQueue, completionHandler: { result, error in - if let result = result { - let sessionId = result.sessionId - self.appendRemainingFileChunks(uploadData: uploadData, fileUrl: fileUrl, fileSize: fileSize, sessionId: sessionId) - let cursor = Files.UploadSessionCursor(sessionId: sessionId, offset: (fileSize)) - let commitInfo = uploadData.fileUrlsToCommitInfo[fileUrl]! - let finishArg = Files.UploadSessionFinishArg(cursor: cursor, commit: commitInfo) - // Store commit info for this file - uploadData.finishArgs.append(finishArg) - } else { -// uploadData.fileUrlsToRequestErrors[fileUrl] = error - uploadData.uploadGroup.leave() - } -// uploadData.taskStorage.remove(task) - }).progress { progress in - self.executeProgressHandler(uploadData:uploadData, progress: progress) - } - -// uploadData.taskStorage.add(task) - } - - func appendRemainingFileChunks(uploadData: BatchUploadData, fileUrl: URL, fileSize: UInt64, sessionId: String) { - // use seperate response queue so we don't block response thread - // with dispatch_semaphore_t - let chunkUploadResponseQueue = DispatchQueue(label: "chunk_upload_response_queue") - - chunkUploadResponseQueue.async { - var numFileChunks = fileSize / fileChunkSize - if fileSize % fileChunkSize != 0 { - numFileChunks += 1 - } - var totalBytesSent: UInt64 = 0 - let chunkUploadFinished = DispatchSemaphore(value: 0) - // iterate through all remaining chunks and upload each one sequentially - for i in 1..) { - uploadData.queue.async { - var dropboxFilePathToNSURL = [String: URL]() - for (fileUrl, commitInfo) in uploadData.fileUrlsToCommitInfo { - dropboxFilePathToNSURL[commitInfo.path] = fileUrl - } - var fileUrlsToBatchResultEntries: [URL: Files.UploadSessionFinishBatchResultEntry] = [:] - var index = 0 - for finishArg in uploadData.finishArgs { - let path = finishArg.commit.path - let resultEntry: Files.UploadSessionFinishBatchResultEntry? = entries[index] - fileUrlsToBatchResultEntries[dropboxFilePathToNSURL[path]!] = resultEntry - index += 1 - } - uploadData.responseBlock(fileUrlsToBatchResultEntries, nil, uploadData.fileUrlsToRequestErrors) - } - } - - func batchFinishUponCompletion(uploadData: BatchUploadData) { - uploadData.uploadGroup.notify(queue: DispatchQueue.main) { - uploadData.finishArgs.sort { $0.commit.path < $1.commit.path } - - self.uploadSessionFinishBatchV2(entries: uploadData.finishArgs).response { result, error in - if let result = result { - self.finishBatch(uploadData: uploadData, entries: result.entries) - } else { - uploadData.queue.async { -// uploadData.responseBlock(nil, nil, error, uploadData.fileUrlsToRequestErrors) - } - } - } - } - } - - func executeProgressHandler(uploadData: BatchUploadData, progress: Progress) { - if let progressBlock = uploadData.progressBlock { - uploadData.queue.async { - let workDone = progress.completedUnitCount - uploadData.totalUploadProgress!.completedUnitCount - uploadData.totalUploadProgress?.becomeCurrent(withPendingUnitCount: workDone) - uploadData.totalUploadProgress?.resignCurrent() - progressBlock(uploadData.totalUploadProgress!) -// progressBlock(progress.completedUnitCount, uploadData.totalUploadedSoFar, uploadData.totalUploadSize) - } - } - } -} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/CustomTasks.swift b/Source/SwiftyDropbox/Shared/Handwritten/CustomTasks.swift deleted file mode 100644 index 5a6e04119..000000000 --- a/Source/SwiftyDropbox/Shared/Handwritten/CustomTasks.swift +++ /dev/null @@ -1,20 +0,0 @@ -/// -/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. -/// - -import Foundation - -open class BatchUploadTask { - let uploadData: BatchUploadData - - public init(uploadData: BatchUploadData) { - self.uploadData = uploadData - - } - - public func cancel() { - self.uploadData.cancel = true -// self.uploadData.taskStorage.cancelAllTasks() - } -} - diff --git a/Source/SwiftyDropbox/Shared/Handwritten/DropboxAppClient.swift b/Source/SwiftyDropbox/Shared/Handwritten/DropboxAppClient.swift new file mode 100644 index 000000000..7d5bc7d65 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/DropboxAppClient.swift @@ -0,0 +1,27 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +/// The client for the App API. Call routes using the namespaces inside this object (inherited from parent). + +public class DropboxAppClient: DropboxAppBase { + private var transportClient: DropboxTransportClient + + /// Designated Initializer. + /// + /// - Parameter transportClient: The underlying DropboxTransportClient to make API calls. + public init(transportClient: DropboxTransportClient) { + self.transportClient = transportClient + super.init(client: transportClient) + } + + /// Initializer used by DropboxTransportClientOwning in tests. + /// + /// - Parameter client: The underlying DropboxTransportClient to make API calls. + required convenience init(client: DropboxTransportClient) { + self.init(transportClient: client) + } + +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/DropboxClient.swift b/Source/SwiftyDropbox/Shared/Handwritten/DropboxClient.swift index b456e525b..a808cee24 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/DropboxClient.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/DropboxClient.swift @@ -3,14 +3,15 @@ /// import Foundation -import Alamofire /// The client for the User API. Call routes using the namespaces inside this object (inherited from parent). -open class DropboxClient: DropboxBase { - private var transportClient: DropboxTransportClient - private var accessTokenProvider: AccessTokenProvider - private var selectUser: String? +public class DropboxClient: DropboxBase { + public let accessTokenProvider: AccessTokenProvider + public private(set) var selectUser: String? + public var identifier: String? { + client.identifier + } /// Initialize a client with a static accessToken string. /// Use this method if your access token is long-lived. @@ -18,9 +19,20 @@ open class DropboxClient: DropboxBase { /// - Parameters: /// - accessToken: Static access token string. /// - selectUser: Id of a team member. This allows the api client to makes call on a team member's behalf. + /// - sessionConfiguration: Optional custom network session configuration /// - pathRoot: User's path root. - public convenience init(accessToken: String, selectUser: String? = nil, pathRoot: Common.PathRoot? = nil) { - let transportClient = DropboxTransportClient(accessToken: accessToken, selectUser: selectUser, pathRoot: pathRoot) + public convenience init( + accessToken: String, + selectUser: String? = nil, + sessionConfiguration: NetworkSessionConfiguration? = nil, + pathRoot: Common.PathRoot? = nil + ) { + let transportClient = DropboxTransportClientImpl( + accessToken: accessToken, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration, + pathRoot: pathRoot + ) self.init(transportClient: transportClient) } @@ -31,42 +43,104 @@ open class DropboxClient: DropboxBase { /// - Parameters: /// - accessTokenProvider: Access token provider that wraps a short-lived token and its refresh logic. /// - selectUser: Id of a team member. This allows the api client to makes call on a team member's behalf. + /// - sessionConfiguration: Optional custom network session configuration /// - pathRoot: User's path root. public convenience init( - accessTokenProvider: AccessTokenProvider, selectUser: String? = nil, pathRoot: Common.PathRoot? = nil + accessTokenProvider: AccessTokenProvider, + selectUser: String? = nil, + sessionConfiguration: NetworkSessionConfiguration? = nil, + pathRoot: Common.PathRoot? = nil ) { - let transportClient = DropboxTransportClient( - accessTokenProvider: accessTokenProvider, selectUser: selectUser, pathRoot: pathRoot + let transportClient = DropboxTransportClientImpl( + accessTokenProvider: accessTokenProvider, selectUser: selectUser, sessionConfiguration: sessionConfiguration, pathRoot: pathRoot ) self.init(transportClient: transportClient) } - + /// Initialize a client with an `DropboxAccessToken`. /// /// - Parameters: /// - accessToken: The token itself, could be long or short lived. /// - dropboxOauthManager: an oauthManager, used for creating the token provider. - public convenience init(accessToken: DropboxAccessToken, dropboxOauthManager: DropboxOAuthManager) { + /// - sessionConfiguration: Optional custom network session configuration + public convenience init( + accessToken: DropboxAccessToken, + dropboxOauthManager: DropboxOAuthManager, + sessionConfiguration: NetworkSessionConfiguration? = nil + ) { let accessTokenProvider = dropboxOauthManager.accessTokenProviderForToken(accessToken) - let transportClient = DropboxTransportClient(accessTokenProvider: accessTokenProvider) + let transportClient = DropboxTransportClientImpl(accessTokenProvider: accessTokenProvider, sessionConfiguration: sessionConfiguration) self.init(transportClient: transportClient) } - + /// Designated Initializer. /// /// - Parameter transportClient: The underlying DropboxTransportClient to make API calls. public init(transportClient: DropboxTransportClient) { - self.transportClient = transportClient self.selectUser = transportClient.selectUser - self.accessTokenProvider = transportClient.accessTokenProvider + guard let accessTokenProvider = transportClient.accessTokenProvider else { + fatalError("misconfigured user auth transport client") + } + self.accessTokenProvider = accessTokenProvider super.init(client: transportClient) } + /// Initializer used by DropboxTransportClientOwning in tests. + /// + /// - Parameter client: The underlying DropboxTransportClient to make API calls. + required convenience init(client: DropboxTransportClient) { + self.init(transportClient: client) + } + /// Creates a new DropboxClient instance with the given path root. /// /// - Parameter pathRoot: User's path root. /// - Returns: A new DropboxClient instance for the same user but with an updated path root. - open func withPathRoot(_ pathRoot: Common.PathRoot) -> DropboxClient { - return DropboxClient(accessTokenProvider: accessTokenProvider, selectUser: selectUser, pathRoot: pathRoot) + public func withPathRoot(_ pathRoot: Common.PathRoot) -> DropboxClient { + DropboxClient(accessTokenProvider: accessTokenProvider, selectUser: selectUser, pathRoot: pathRoot) + } + + public var didFinishBackgroundEvents: (() -> Void)? { + set { + client.didFinishBackgroundEvents = newValue + } + get { + client.didFinishBackgroundEvents + } + } + + /// Fetches completed and running background tasks to be reconnected + /// + /// - Parameter completion: The callback closure to recieve the reconnected requests or errors + public func getAllRequests(completion: @escaping ([Result]) -> Void) { + guard let client = client as? DropboxTransportClientImpl else { + DropboxClientsManager.logBackgroundSession(.error, "background sessions only supported on DropboxTransportClientImpl") + fatalError("background sessions only supported on DropboxTransportClientImpl") + } + + client.manager.getAllTasks { apiRequests in + DropboxClientsManager.logBackgroundSession("getAllRequests transport client returned requests \(apiRequests.count)") + + let requests: [Result] = apiRequests.map { apiRequest in + do { + let request = try ReconnectionHelpers.rebuildRequest(apiRequest: apiRequest, client: client) + DropboxClientsManager.logBackgroundSession("getAllRequests reconstitute success \(apiRequest.identifier)") + return .success(request) + } catch { + DropboxClientsManager.logBackgroundSession(.error, "getAllRequests reconstitute error \(error)") + return .failure(ReconnectionError( + reconnectionErrorKind: (error as? ReconnectionErrorKind) ?? .unknown, + taskDescription: apiRequest.taskDescription + )) + } + } + + completion(requests) + } + } + + /// Cancels all tasks and invalidates all network sessions + public func shutdown() { + client.shutdown() } } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/DropboxClientsManager.swift b/Source/SwiftyDropbox/Shared/Handwritten/DropboxClientsManager.swift index f41770c65..ac84da445 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/DropboxClientsManager.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/DropboxClientsManager.swift @@ -3,92 +3,192 @@ /// import Foundation -import Alamofire + +public typealias RequestsToReconnect = ([Result]) -> Void /// This is a convenience class for the typical single user case. To use this /// class, see details in the tutorial at: /// https://www.dropbox.com/developers/documentation/swift#tutorial /// /// For information on the available API methods, see the documentation for DropboxClient -open class DropboxClientsManager { +public class DropboxClientsManager { /// An authorized client. This will be set to nil if unlinked. public static var authorizedClient: DropboxClient? + /// An authorized background client. This will be set to nil if unlinked. + public static var authorizedBackgroundClient: DropboxClient? + + /// Authorized background clients created in the course of handling background events from extensions, keyed by session identifiers. + public static var authorizedExtensionBackgroundClients: [String: DropboxClient] = [:] + /// An authorized team client. This will be set to nil if unlinked. public static var authorizedTeamClient: DropboxTeamClient? - /// Sets up access to the Dropbox User API - static func setupWithOAuthManager(_ appKey: String, oAuthManager: DropboxOAuthManager, transportClient: DropboxTransportClient?) { - precondition(DropboxOAuthManager.sharedOAuthManager == nil, "Only call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` once") - DropboxOAuthManager.sharedOAuthManager = oAuthManager + /// A sdk-caller provided logger + public static var loggingClosure: LoggingClosure? - if let token = DropboxOAuthManager.sharedOAuthManager.getFirstAccessToken() { - setupAuthorizedClient(token, transportClient:transportClient) + /// The installed version of the SDK + public static var sdkVersion: String { + Constants.versionSDK + } + + struct OAuthSetupContext { + enum UserKind { + case single + case multi(tokenUid: String?) } - Keychain.checkAccessibilityMigrationOneTime + + var userKind: UserKind + var isTeam: Bool + var includeBackgroundClient: Bool } - /// Sets up access to the Dropbox User API - static func setupWithOAuthManagerMultiUser(_ appKey: String, oAuthManager: DropboxOAuthManager, transportClient: DropboxTransportClient?, tokenUid: String?) { - precondition(DropboxOAuthManager.sharedOAuthManager == nil, "Only call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` once") + static func setupWithOAuthManager( + _ appKey: String, oAuthManager: DropboxOAuthManager, + transportClient: DropboxTransportClient?, + backgroundTransportClient: DropboxTransportClient? = nil, + oauthSetupIntent: OAuthSetupContext, + requestsToReconnect: RequestsToReconnect? = nil + ) { + precondition( + DropboxOAuthManager.sharedOAuthManager == nil, + "Only call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` once" + ) DropboxOAuthManager.sharedOAuthManager = oAuthManager - if let token = DropboxOAuthManager.sharedOAuthManager.getAccessToken(tokenUid) { - setupAuthorizedClient(token, transportClient:transportClient) - } - Keychain.checkAccessibilityMigrationOneTime + setUpAuthorizedClient( + transportClient: transportClient, + backgroundTransportClient: backgroundTransportClient, + sessionConfiguration: nil, + backgroundSessionConfiguration: nil, + oAuthManager: oAuthManager, + oauthSetupIntent: oauthSetupIntent, + requestsToReconnect: requestsToReconnect + ) + + checkAccessibilityMigrationOneTime(oauthManager: oAuthManager) } - /// Sets up access to the Dropbox Business (Team) API - static func setupWithOAuthManagerTeam(_ appKey: String, oAuthManager: DropboxOAuthManager, transportClient: DropboxTransportClient?) { - precondition(DropboxOAuthManager.sharedOAuthManager == nil, "Only call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` once") + static func setupWithOAuthManager( + _ appKey: String, + oAuthManager: DropboxOAuthManager, + sessionConfiguration: NetworkSessionConfiguration? = nil, + backgroundSessionConfiguration: NetworkSessionConfiguration? = nil, + oauthSetupIntent: OAuthSetupContext, + requestsToReconnect: RequestsToReconnect? = nil + ) { + precondition( + DropboxOAuthManager.sharedOAuthManager == nil, + "Only call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` once" + ) DropboxOAuthManager.sharedOAuthManager = oAuthManager - if let token = DropboxOAuthManager.sharedOAuthManager.getFirstAccessToken() { - setupAuthorizedTeamClient(token, transportClient:transportClient) + setUpAuthorizedClient( + transportClient: nil, + backgroundTransportClient: nil, + sessionConfiguration: sessionConfiguration, + backgroundSessionConfiguration: backgroundSessionConfiguration, + oAuthManager: oAuthManager, + oauthSetupIntent: oauthSetupIntent, + requestsToReconnect: requestsToReconnect + ) + + checkAccessibilityMigrationOneTime(oauthManager: oAuthManager) + } + + private static func token(for userKind: OAuthSetupContext.UserKind, using oAuthManager: DropboxOAuthManager) -> DropboxAccessToken? { + switch userKind { + case .single: + return oAuthManager.getFirstAccessToken() + case .multi(tokenUid: let tokenUid): + return oAuthManager.getAccessToken(tokenUid) } - Keychain.checkAccessibilityMigrationOneTime } - /// Sets up access to the Dropbox Business (Team) API in multi-user case - static func setupWithOAuthManagerMultiUserTeam(_ appKey: String, oAuthManager: DropboxOAuthManager, transportClient: DropboxTransportClient?, tokenUid: String?) { - precondition(DropboxOAuthManager.sharedOAuthManager == nil, "Only call `DropboxClientsManager.setupWithAppKey` or `DropboxClientsManager.setupWithTeamAppKey` once") - DropboxOAuthManager.sharedOAuthManager = oAuthManager + private static func setUpAuthorizedClient( + transportClient: DropboxTransportClient?, + backgroundTransportClient: DropboxTransportClient?, + sessionConfiguration: NetworkSessionConfiguration?, + backgroundSessionConfiguration: NetworkSessionConfiguration?, + oAuthManager: DropboxOAuthManager, + oauthSetupIntent: OAuthSetupContext, + requestsToReconnect: RequestsToReconnect? + ) { + let token = token(for: oauthSetupIntent.userKind, using: oAuthManager) + + if oauthSetupIntent.isTeam { + setupAuthorizedTeamClient(token, transportClient: transportClient, sessionConfiguration: sessionConfiguration) + } else { + setupAuthorizedClient(token, transportClient: transportClient, sessionConfiguration: sessionConfiguration) + + if oauthSetupIntent.includeBackgroundClient { + guard let requestsToReconnect = requestsToReconnect else { + assertionFailure("Cannot initialize a background session withouth a request reconnection block") + return + } + setupAuthorizedBackgroundClient( + token, + transportClient: backgroundTransportClient, + sessionConfiguration: backgroundSessionConfiguration, + requestsToReconnect: requestsToReconnect + ) + } + } + } + + public static func reauthorizeClient(_ tokenUid: String, sessionConfiguration: NetworkSessionConfiguration? = nil) { + precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") if let token = DropboxOAuthManager.sharedOAuthManager.getAccessToken(tokenUid) { - setupAuthorizedTeamClient(token, transportClient:transportClient) + setupAuthorizedClient(token, transportClient: nil, sessionConfiguration: sessionConfiguration) } - Keychain.checkAccessibilityMigrationOneTime + checkAccessibilityMigrationOneTime(oauthManager: DropboxOAuthManager.sharedOAuthManager) } - public static func reauthorizeClient(_ tokenUid: String) { + public static func reauthorizeBackgroundClient( + _ tokenUid: String, + sessionConfiguration: NetworkSessionConfiguration? = nil, + requestsToReconnect: @escaping RequestsToReconnect + ) { precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") if let token = DropboxOAuthManager.sharedOAuthManager.getAccessToken(tokenUid) { - setupAuthorizedClient(token, transportClient:nil) + setupAuthorizedBackgroundClient(token, transportClient: nil, sessionConfiguration: sessionConfiguration, requestsToReconnect: requestsToReconnect) } - Keychain.checkAccessibilityMigrationOneTime + checkAccessibilityMigrationOneTime(oauthManager: DropboxOAuthManager.sharedOAuthManager) } - public static func reauthorizeTeamClient(_ tokenUid: String) { + public static func reauthorizeTeamClient(_ tokenUid: String, sessionConfiguration: NetworkSessionConfiguration? = nil) { precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") if let token = DropboxOAuthManager.sharedOAuthManager.getAccessToken(tokenUid) { - setupAuthorizedTeamClient(token, transportClient:nil) + setupAuthorizedTeamClient(token, transportClient: nil, sessionConfiguration: sessionConfiguration) } - Keychain.checkAccessibilityMigrationOneTime + checkAccessibilityMigrationOneTime(oauthManager: DropboxOAuthManager.sharedOAuthManager) } - static func setupAuthorizedClient(_ accessToken: DropboxAccessToken?, transportClient: DropboxTransportClient?) { + static func setupAuthorizedClient( + _ accessToken: DropboxAccessToken?, + transportClient: DropboxTransportClient?, + sessionConfiguration: NetworkSessionConfiguration? + ) { precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") + if let sessionConfiguration = sessionConfiguration { + assert(transportClient == nil, "sessionConfiguration will be unused if a transportClient is already being passed.") + if case .background = sessionConfiguration.kind { + assertionFailure("Cannot use a background session configuration for non-background clients") + return + } + } + if let accessToken = accessToken, let oauthManager = DropboxOAuthManager.sharedOAuthManager { let accessTokenProvider = oauthManager.accessTokenProviderForToken(accessToken) - if let transportClient = transportClient { + if var transportClient = transportClient { transportClient.accessTokenProvider = accessTokenProvider authorizedClient = DropboxClient(transportClient: transportClient) } else { - authorizedClient = DropboxClient(accessTokenProvider: accessTokenProvider) + authorizedClient = DropboxClient(accessTokenProvider: accessTokenProvider, sessionConfiguration: sessionConfiguration) } } else { if let transportClient = transportClient { @@ -97,16 +197,115 @@ open class DropboxClientsManager { } } - static func setupAuthorizedTeamClient(_ accessToken: DropboxAccessToken?, transportClient: DropboxTransportClient?) { + static func setupAuthorizedBackgroundClient( + _ accessToken: DropboxAccessToken?, + transportClient: DropboxTransportClient?, + sessionConfiguration: NetworkSessionConfiguration?, + requestsToReconnect: @escaping ([Result]) -> Void + ) { + authorizedBackgroundClient = authorizedBackgroundClient( + accessToken, + transportClient: transportClient, + sessionConfiguration: sessionConfiguration, + isExtensionClient: false + ) + + // If a background session is recreated while it's running requests from a previous session + // AppDelegate.handleEventsForBackgroundURLSession will never be called. We check for requests + // to reconnect when a background session is created to handle this case. + authorizedBackgroundClient?.getAllRequests(completion: { requests in + requestsToReconnect(requests) + }) + } + + static func setupAuthorizedBackgroundExtensionClient( + _ accessToken: DropboxAccessToken?, + transportClient: DropboxTransportClient?, + sessionConfiguration: NetworkSessionConfiguration? + ) { + guard let identifier = sessionConfiguration?.identifier else { + assertionFailure("Must provide a background session configuration to create a background client") + return + } + + authorizedExtensionBackgroundClients[identifier] = authorizedBackgroundClient( + accessToken, + transportClient: transportClient, + sessionConfiguration: sessionConfiguration, + isExtensionClient: true + ) + } + + private static func authorizedBackgroundClient( + _ accessToken: DropboxAccessToken?, + transportClient: DropboxTransportClient?, + sessionConfiguration: NetworkSessionConfiguration?, + isExtensionClient: Bool + ) -> DropboxClient? { precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") + if let sessionConfiguration = sessionConfiguration { + assert(transportClient == nil, "sessionConfiguration will be unused if a transportClient is already being passed.") + guard case .background = sessionConfiguration.kind else { + assertionFailure("Must use a background session configuration for background clients") + return nil + } + } + + var authorizedBackgroundClient: DropboxClient? + if let accessToken = accessToken, let oauthManager = DropboxOAuthManager.sharedOAuthManager { let accessTokenProvider = oauthManager.accessTokenProviderForToken(accessToken) + if var transportClient = transportClient { + transportClient.accessTokenProvider = accessTokenProvider + authorizedBackgroundClient = DropboxClient(transportClient: transportClient) + } else { + let fallbackConfiguration = { + let bundleId = Bundle.main.bundleIdentifier ?? "unknown_bundle_id" + let fallbackConfigurationId = "\(bundleId).SwiftyDropbox.backgroundSession" + return NetworkSessionConfiguration(kind: .background(fallbackConfigurationId)) + } + + let sessionConfiguration = sessionConfiguration ?? fallbackConfiguration() + let transportClient = DropboxTransportClientImpl( + accessTokenProvider: accessTokenProvider, + userAgent: nil, + selectUser: nil, + sessionConfiguration: sessionConfiguration + ) + authorizedBackgroundClient = DropboxClient(transportClient: transportClient) + } + } else { if let transportClient = transportClient { + authorizedBackgroundClient = DropboxClient(transportClient: transportClient) + } + } + + return authorizedBackgroundClient + } + + static func setupAuthorizedTeamClient( + _ accessToken: DropboxAccessToken?, + transportClient: DropboxTransportClient?, + sessionConfiguration: NetworkSessionConfiguration? + ) { + precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") + + if let sessionConfiguration = sessionConfiguration { + assert(transportClient == nil, "sessionConfiguration will be unused if a transportClient is already being passed.") + if case .background = sessionConfiguration.kind { + assertionFailure("Cannot use a background session configuration for team clients") + return + } + } + + if let accessToken = accessToken, let oauthManager = DropboxOAuthManager.sharedOAuthManager { + let accessTokenProvider = oauthManager.accessTokenProviderForToken(accessToken) + if var transportClient = transportClient { transportClient.accessTokenProvider = accessTokenProvider authorizedTeamClient = DropboxTeamClient(transportClient: transportClient) } else { - authorizedTeamClient = DropboxTeamClient(accessTokenProvider: accessTokenProvider) + authorizedTeamClient = DropboxTeamClient(accessTokenProvider: accessTokenProvider, sessionConfiguration: sessionConfiguration) } } else { if let transportClient = transportClient { @@ -119,17 +318,33 @@ open class DropboxClientsManager { /// /// - parameters: /// - url: The URL to attempt to handle. + /// - includeBackgroundClient: Whether to additionally initialize an authorized background client. /// - completion: The callback closure to receive auth result. /// - returns: Whether the redirect URL can be handled. /// @discardableResult - public static func handleRedirectURL(_ url: URL, completion: @escaping DropboxOAuthCompletion) -> Bool { + public static func handleRedirectURL( + _ url: URL, + includeBackgroundClient: Bool, + sessionConfiguration: NetworkSessionConfiguration? = nil, + backgroundSessionConfiguration: NetworkSessionConfiguration? = nil, + completion: @escaping DropboxOAuthCompletion + ) -> Bool { precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") return DropboxOAuthManager.sharedOAuthManager.handleRedirectURL(url, completion: { result in if let result = result { switch result { case .success(let accessToken): - setupAuthorizedClient(accessToken, transportClient: nil) + setupAuthorizedClient(accessToken, transportClient: nil, sessionConfiguration: sessionConfiguration) + + if includeBackgroundClient { + setupAuthorizedBackgroundClient( + accessToken, + transportClient: nil, + sessionConfiguration: backgroundSessionConfiguration, + requestsToReconnect: { _ in } // No need for reconnect as no loads are in progress pre-auth + ) + } case .cancel, .error: break } @@ -146,13 +361,17 @@ open class DropboxClientsManager { /// - returns: Whether the redirect URL can be handled. /// @discardableResult - public static func handleRedirectURLTeam(_ url: URL, completion: @escaping DropboxOAuthCompletion) -> Bool { + public static func handleRedirectURLTeam( + _ url: URL, + sessionConfiguration: NetworkSessionConfiguration? = nil, + completion: @escaping DropboxOAuthCompletion + ) -> Bool { precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithTeamAppKey` before calling this method") return DropboxOAuthManager.sharedOAuthManager.handleRedirectURL(url, completion: { result in if let result = result { switch result { case .success(let accessToken): - setupAuthorizedTeamClient(accessToken, transportClient: nil) + setupAuthorizedTeamClient(accessToken, transportClient: nil, sessionConfiguration: sessionConfiguration) case .cancel, .error: break } @@ -161,6 +380,115 @@ open class DropboxClientsManager { }) } + /// Prepare the appropriate single user DropboxClient to handle incoming background session events and make ongoing tasks available for reconnection + /// + /// - parameters: + /// - identifier: The identifier of the URLSession for which events must be handled. + /// - creationInfos: Information to configure extension DropboxClients in the event that they must be recreated in the main app to handle events. + /// - completionHandler: The completion handler to be executed when the underlying URLSessionDelegate recieves urlSessionDidFinishEvents(forBackgroundURLSession:). + /// - requestsToReconnect: The callback closure to receive requests for reconnection. + public static func handleEventsForBackgroundURLSession( + with identifier: String, + creationInfos: [BackgroundExtensionSessionCreationInfo], + completionHandler: @escaping () -> Void, + requestsToReconnect: @escaping ([Result]) -> Void + ) { + _handleEventsForBackgroundURLSession( + with: identifier, + tokenUid: nil, + creationInfos: creationInfos, + completionHandler: completionHandler, + requestsToReconnect: requestsToReconnect + ) + } + + /// Prepare the appropriate multiuser DropboxClient to handle incoming background session events and make ongoing tasks available for reconnection + /// + /// - parameters: + /// - identifier: The identifier of the URLSession for which events must be handled. + /// - tokenUid: The uid of the token to authenticate this client with. + /// - creationInfos: Information to configure extension DropboxClients in the event that they must be recreated in the main app to handle events. + /// - completionHandler: The completion handler to be executed when the underlying URLSessionDelegate recieves urlSessionDidFinishEvents(forBackgroundURLSession:). + /// - requestsToReconnect: The callback closure to receive requests for reconnection. + public static func handleEventsForBackgroundURLSessionMultiUser( + with identifier: String, + tokenUid: String, + creationInfos: [BackgroundExtensionSessionCreationInfo], + completionHandler: @escaping () -> Void, + requestsToReconnect: @escaping ([Result]) -> Void + ) { + _handleEventsForBackgroundURLSession( + with: identifier, + tokenUid: tokenUid, + creationInfos: creationInfos, + completionHandler: completionHandler, + requestsToReconnect: requestsToReconnect + ) + } + + private static func _handleEventsForBackgroundURLSession( + with identifier: String, + tokenUid: String?, + creationInfos: [BackgroundExtensionSessionCreationInfo], + completionHandler: @escaping () -> Void, + requestsToReconnect: @escaping ([Result]) -> Void + ) { + precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method") + + let handleEvents: (DropboxClient) -> Void = { client in + client.didFinishBackgroundEvents = completionHandler + + client.getAllRequests(completion: { requests in + requestsToReconnect(requests) + }) + } + + let accessToken: DropboxAccessToken? + + if let tokenUid = tokenUid { + accessToken = token(for: .multi(tokenUid: tokenUid), using: DropboxOAuthManager.sharedOAuthManager) + } else { + accessToken = token(for: .single, using: DropboxOAuthManager.sharedOAuthManager) + } + + if let client = DropboxClientsManager.authorizedBackgroundClient, client.identifier == identifier { + // The main app background session should already exist, handle events. + handleEvents(client) + } else { + // For extension background sessions, recreate, store, then handle events. + let creationInfo = creationInfos.first(where: { $0.identifier == identifier }) + + guard let creationInfo = creationInfo else { + return DropboxClientsManager.logBackgroundSession( + .error, + "handleEventsForBackgroundURLSession recieved background identifier without session creation information" + ) + } + + if let defaultInfo = creationInfo.defaultInfo { + let backgroundNetworkSessionConfiguration = NetworkSessionConfiguration.background( + withIdentifier: defaultInfo.backgroundSessionIdentifier, + sharedContainerIdentifier: defaultInfo.sharedContainerIdentifier + ) + setupAuthorizedBackgroundExtensionClient(accessToken, transportClient: nil, sessionConfiguration: backgroundNetworkSessionConfiguration) + } + + if let customInfo = creationInfo.customInfo { + setupAuthorizedBackgroundExtensionClient( + accessToken, + transportClient: customInfo.backgroundTransportClient, + sessionConfiguration: customInfo.backgroundSessionConfiguration + ) + } + + if let client = authorizedExtensionBackgroundClients[identifier] { + handleEvents(client) + } else { + DropboxClientsManager.logBackgroundSession(.error, "handleEventsForBackgroundURLSession extension client creation failed") + } + } + } + /// Unlink the user. public static func unlinkClients() { if let oAuthManager = DropboxOAuthManager.sharedOAuthManager { @@ -171,12 +499,36 @@ open class DropboxClientsManager { /// Unlink the user. public static func resetClients() { - if DropboxClientsManager.authorizedClient == nil && DropboxClientsManager.authorizedTeamClient == nil { + if DropboxClientsManager.authorizedClient == nil + && DropboxClientsManager.authorizedTeamClient == nil + && DropboxClientsManager.authorizedBackgroundClient == nil + && DropboxClientsManager.authorizedExtensionBackgroundClients.isEmpty { // already unlinked return } DropboxClientsManager.authorizedClient = nil + DropboxClientsManager.authorizedBackgroundClient = nil + DropboxClientsManager.authorizedExtensionBackgroundClients = [:] DropboxClientsManager.authorizedTeamClient = nil } + + /// Logs to the provided logging closure + public static func log(_ level: LogLevel, _ message: String) { + LogHelper.log(level, message) + } + + /// Logs to the provided logging closure with background session tag and log level. + public static func logBackgroundSession(_ message: String) { + LogHelper.logBackgroundSession(message) + } + + /// Logs to the provided logging closure with background session tag. + public static func logBackgroundSession(_ level: LogLevel, _ message: String) { + LogHelper.logBackgroundSession(level, message) + } + + private static func checkAccessibilityMigrationOneTime(oauthManager: DropboxOAuthManager) { + oauthManager.checkAccessibilityMigrationOneTime() + } } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/DropboxTeamClient.swift b/Source/SwiftyDropbox/Shared/Handwritten/DropboxTeamClient.swift index dc2211340..09f34d927 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/DropboxTeamClient.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/DropboxTeamClient.swift @@ -3,20 +3,18 @@ /// import Foundation -import Alamofire /// The client for the Business API. Call routes using the namespaces inside this object (inherited from parent). -open class DropboxTeamClient: DropboxTeamBase { - private var transportClient: DropboxTransportClient - private var accessTokenProvider: AccessTokenProvider +public class DropboxTeamClient: DropboxTeamBase { + public let accessTokenProvider: AccessTokenProvider /// Initialize a client with a static accessToken string. /// Use this method if your access token is long-lived. /// /// - Parameter accessToken: Static access token string. public convenience init(accessToken: String) { - let transportClient = DropboxTransportClient(accessToken: accessToken) + let transportClient = DropboxTransportClientImpl(accessToken: accessToken) self.init(transportClient: transportClient) } @@ -24,20 +22,30 @@ open class DropboxTeamClient: DropboxTeamBase { /// Use this method if your access token is short-lived. /// See `ShortLivedAccessTokenProvider` for a default implementation. /// - /// - Parameter accessTokenProvider: Access token provider that wraps a short-lived token and its refresh logic. - public convenience init(accessTokenProvider: AccessTokenProvider) { - let transportClient = DropboxTransportClient(accessTokenProvider: accessTokenProvider) + /// - Parameters: + /// - accessTokenProvider: Access token provider that wraps a short-lived token and its refresh logic. + /// - sessionConfiguration: Optional custom network session configuration + public convenience init( + accessTokenProvider: AccessTokenProvider, + sessionConfiguration: NetworkSessionConfiguration? = nil + ) { + let transportClient = DropboxTransportClientImpl(accessTokenProvider: accessTokenProvider, sessionConfiguration: sessionConfiguration) self.init(transportClient: transportClient) } - + /// Initialize a client with an `DropboxAccessToken`. /// /// - Parameters: /// - accessToken: The token itself, could be long or short lived. /// - dropboxOauthManager: an oauthManager, used for creating the token provider. - public convenience init(accessToken: DropboxAccessToken, dropboxOauthManager: DropboxOAuthManager) { + /// - sessionConfiguration: Optional custom network session configuration + public convenience init( + accessToken: DropboxAccessToken, + dropboxOauthManager: DropboxOAuthManager, + sessionConfiguration: NetworkSessionConfiguration? = nil + ) { let accessTokenProvider = dropboxOauthManager.accessTokenProviderForToken(accessToken) - let transportClient = DropboxTransportClient(accessTokenProvider: accessTokenProvider) + let transportClient = DropboxTransportClientImpl(accessTokenProvider: accessTokenProvider, sessionConfiguration: sessionConfiguration) self.init(transportClient: transportClient) } @@ -45,16 +53,25 @@ open class DropboxTeamClient: DropboxTeamBase { /// /// - Parameter transportClient: The underlying DropboxTransportClient to make API calls. public init(transportClient: DropboxTransportClient) { - self.transportClient = transportClient - self.accessTokenProvider = transportClient.accessTokenProvider + guard let accessTokenProvider = transportClient.accessTokenProvider else { + fatalError("misconfigured user auth transport client") + } + self.accessTokenProvider = accessTokenProvider super.init(client: transportClient) } + /// Initializer used by DropboxTransportClientOwning in tests. + /// + /// - Parameter client: The underlying DropboxTransportClient to make API calls. + required convenience init(client: DropboxTransportClient) { + self.init(transportClient: client) + } + /// Creates a new DropboxClient instance for the team member id. /// /// - Parameter memberId: Team member id. /// - Returns: A new DropboxClient instance that can be used to call APIs on the team member's behalf. public func asMember(_ memberId: String) -> DropboxClient { - return DropboxClient(accessTokenProvider: accessTokenProvider, selectUser: memberId) + DropboxClient(accessTokenProvider: accessTokenProvider, selectUser: memberId) } } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClient.swift b/Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClient.swift index 0cdbe3920..2bd856d48 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClient.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClient.swift @@ -3,7 +3,6 @@ /// import Foundation -import Alamofire /// Constants used to make API requests. e.g. server addresses and default user agent to be used. enum ApiClientConstants { @@ -13,712 +12,541 @@ enum ApiClientConstants { static let defaultUserAgent = "OfficialDropboxSwiftSDKv2/\(Constants.versionSDK)" } -open class DropboxTransportClient { - struct SwiftyArgEncoding: ParameterEncoding { - fileprivate let rawJsonRequest: Data +public class DropboxTransportClientImpl: DropboxTransportClientInternal { + public var identifier: String? { + manager.identifier + } - init(rawJsonRequest: Data) { - self.rawJsonRequest = rawJsonRequest - } + public let filesAccess: FilesAccess + public var selectUser: String? + public var pathRoot: Common.PathRoot? + let manager: NetworkSessionManager + let longpollManager: NetworkSessionManager + var baseHosts: BaseHosts + var userAgent: String + var authStrategy: AuthStrategy + var headersForRouteHost: HeadersForRouteRequest? - func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = urlRequest.urlRequest - urlRequest!.httpBody = rawJsonRequest - return urlRequest! + public var accessTokenProvider: AccessTokenProvider? { + get { + authStrategy.accessTokenProvider + } + set { + if let newValue = newValue { + authStrategy = .accessToken(newValue) + } } } - public let manager: Session - public let longpollManager: Session - public var accessTokenProvider: AccessTokenProvider - open var selectUser: String? - open var pathRoot: Common.PathRoot? - var baseHosts: [String: String] - var userAgent: String + public var isBackgroundClient: Bool { + manager.isBackgroundManager + } + + public var didFinishBackgroundEvents: (() -> Void)? - public convenience init(accessToken: String, - selectUser: String? = nil, - pathRoot: Common.PathRoot? = nil) { - self.init(accessToken: accessToken, - baseHosts: nil, - userAgent: nil, - selectUser: selectUser, - pathRoot: pathRoot) + public convenience init( + appKey: String, + appSecret: String, + baseHosts: BaseHosts = .default, + firstPartyUserAgent: String?, + authChallengeHandler: @escaping AuthChallenge.Handler + ) { + self.init( + authStrategy: .appKeyAndSecret(appKey, appSecret), + baseHosts: baseHosts, + userAgent: nil, + firstPartyUserAgent: firstPartyUserAgent, + selectUser: nil, + sessionCreation: DefaultSessionCreation, + authChallengeHandler: authChallengeHandler + ) } public convenience init( accessToken: String, - baseHosts: [String: String]?, - userAgent: String?, - selectUser: String?, - sessionDelegate: SessionDelegate? = nil, - longpollSessionDelegate: SessionDelegate? = nil, - serverTrustPolicyManager: ServerTrustManager? = nil, - sharedContainerIdentifier: String? = nil, + selectUser: String? = nil, + sessionConfiguration: NetworkSessionConfiguration? = nil, pathRoot: Common.PathRoot? = nil + ) { + self.init( + accessToken: accessToken, + userAgent: nil, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration ?? .default, + pathRoot: pathRoot + ) + } + + public convenience init( + accessToken: String, + baseHosts: BaseHosts = .default, + userAgent: String? = nil, + firstPartyUserAgent: String? = nil, + selectUser: String? = nil, + sessionConfiguration: NetworkSessionConfiguration = .default, + longpollSessionConfiguration: NetworkSessionConfiguration = .defaultLongpoll, + filesAccess: FilesAccess = FilesAccessImpl(), + authChallengeHandler: AuthChallenge.Handler? = nil, + pathRoot: Common.PathRoot? = nil, + headersForRouteHost: HeadersForRouteRequest? = nil ) { self.init( accessTokenProvider: LongLivedAccessTokenProvider(accessToken: accessToken), baseHosts: baseHosts, userAgent: userAgent, + firstPartyUserAgent: firstPartyUserAgent, selectUser: selectUser, - sessionDelegate: sessionDelegate, - longpollSessionDelegate: longpollSessionDelegate, - serverTrustPolicyManager: serverTrustPolicyManager, - sharedContainerIdentifier: sharedContainerIdentifier, - pathRoot: pathRoot + sessionConfiguration: sessionConfiguration, + longpollSessionConfiguration: longpollSessionConfiguration, + filesAccess: filesAccess, + authChallengeHandler: authChallengeHandler, + pathRoot: pathRoot, + headersForRouteHost: headersForRouteHost ) } public convenience init( - accessTokenProvider: AccessTokenProvider, selectUser: String? = nil, pathRoot: Common.PathRoot? = nil + accessTokenProvider: AccessTokenProvider, + selectUser: String? = nil, + sessionConfiguration: NetworkSessionConfiguration? = nil, + pathRoot: Common.PathRoot? = nil ) { self.init( - accessTokenProvider: accessTokenProvider, baseHosts: nil, - userAgent: nil, selectUser: selectUser, pathRoot: pathRoot + accessTokenProvider: accessTokenProvider, userAgent: nil, + selectUser: selectUser, sessionConfiguration: sessionConfiguration ?? .default, pathRoot: pathRoot ) } - public init( + public convenience init( accessTokenProvider: AccessTokenProvider, - baseHosts: [String: String]?, + baseHosts: BaseHosts = .default, userAgent: String?, + firstPartyUserAgent: String? = nil, selectUser: String?, - sessionDelegate: SessionDelegate? = nil, - longpollSessionDelegate: SessionDelegate? = nil, - serverTrustPolicyManager: ServerTrustManager? = nil, - sharedContainerIdentifier: String? = nil, - pathRoot: Common.PathRoot? = nil + sessionConfiguration: NetworkSessionConfiguration = .default, + longpollSessionConfiguration: NetworkSessionConfiguration = .defaultLongpoll, + filesAccess: FilesAccess = FilesAccessImpl(), + authChallengeHandler: AuthChallenge.Handler? = nil, + pathRoot: Common.PathRoot? = nil, + headersForRouteHost: HeadersForRouteRequest? = nil ) { - let config = URLSessionConfiguration.default - let delegate = sessionDelegate ?? SessionDelegate() - let serverTrustPolicyManager = serverTrustPolicyManager ?? nil - let manager = Session(configuration: config, - delegate: delegate, - startRequestsImmediately: false, - serverTrustManager: serverTrustPolicyManager) + self.init( + authStrategy: .accessToken(accessTokenProvider), + baseHosts: baseHosts, + userAgent: userAgent, + firstPartyUserAgent: firstPartyUserAgent, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration, + sessionCreation: DefaultSessionCreation, + longpollSessionConfiguration: longpollSessionConfiguration, + longpollSessionCreation: DefaultSessionCreation, + filesAccess: filesAccess, + authChallengeHandler: authChallengeHandler, + pathRoot: pathRoot, + headersForRouteHost: headersForRouteHost + ) + } - let longpollConfig = URLSessionConfiguration.default - longpollConfig.timeoutIntervalForRequest = 480.0 + convenience init( + accessToken: String, + selectUser: String? = nil, + pathRoot: Common.PathRoot? = nil, + sessionCreation: SessionCreation = DefaultSessionCreation, + headersForRouteHost: HeadersForRouteRequest? = nil + ) { + self.init( + authStrategy: .accessToken( + LongLivedAccessTokenProvider(accessToken: accessToken) + ), + userAgent: nil, + firstPartyUserAgent: nil, + selectUser: selectUser, + sessionCreation: sessionCreation, + authChallengeHandler: nil, + pathRoot: pathRoot, + headersForRouteHost: headersForRouteHost + ) + } - let longpollSessionDelegate = longpollSessionDelegate ?? SessionDelegate() + init( + authStrategy: AuthStrategy, + baseHosts: BaseHosts = .default, + userAgent: String?, + firstPartyUserAgent: String?, + selectUser: String?, + sessionConfiguration: NetworkSessionConfiguration = .default, + sessionCreation: SessionCreation = DefaultSessionCreation, + longpollSessionConfiguration: NetworkSessionConfiguration = .defaultLongpoll, + longpollSessionCreation: SessionCreation = DefaultSessionCreation, + filesAccess: FilesAccess = FilesAccessImpl(), + authChallengeHandler: AuthChallenge.Handler?, + pathRoot: Common.PathRoot? = nil, + headersForRouteHost: HeadersForRouteRequest? = nil + ) { + self.filesAccess = filesAccess + + let apiRequestCreation: ApiRequestCreation = { taskCreation, onTaskCreation in + RequestWithTokenRefresh( + requestCreation: taskCreation, + onTaskCreation: onTaskCreation, + authStrategy: authStrategy, + filesAccess: filesAccess + ) + } - let longpollManager = Session(configuration: longpollConfig, - delegate: longpollSessionDelegate, - serverTrustManager: serverTrustPolicyManager) + let apiRequestReconnectionCreation: ((NetworkTask) -> ApiRequest)? = { task in + RequestWithTokenRefresh(backgroundRequest: task, filesAccess: filesAccess) + } - let defaultBaseHosts = [ - "api": "\(ApiClientConstants.apiHost)/2", - "content": "\(ApiClientConstants.contentHost)/2", - "notify": "\(ApiClientConstants.notifyHost)/2", - ] + self.manager = NetworkSessionManager( + sessionCreation: { delegate, queue in + sessionCreation(sessionConfiguration, delegate, queue) + }, + apiRequestCreation: apiRequestCreation, + apiRequestReconnectionCreation: apiRequestReconnectionCreation, + authChallengeHandler: authChallengeHandler + ) - let defaultUserAgent = ApiClientConstants.defaultUserAgent + self.longpollManager = NetworkSessionManager( + sessionCreation: { delegate, queue in + sessionCreation(longpollSessionConfiguration, delegate, queue) + }, + apiRequestCreation: apiRequestCreation, + apiRequestReconnectionCreation: nil, + authChallengeHandler: authChallengeHandler + ) - self.manager = manager - self.longpollManager = longpollManager - self.accessTokenProvider = accessTokenProvider + self.authStrategy = authStrategy self.selectUser = selectUser - self.pathRoot = pathRoot; - self.baseHosts = baseHosts ?? defaultBaseHosts - if let userAgent = userAgent { - let customUserAgent = "\(userAgent)/\(defaultUserAgent)" - self.userAgent = customUserAgent + self.pathRoot = pathRoot + self.baseHosts = baseHosts + + let defaultUserAgent = ApiClientConstants.defaultUserAgent + + if let firstPartyUserAgent = firstPartyUserAgent { + self.userAgent = firstPartyUserAgent + } else if let userAgent = userAgent { + self.userAgent = "\(userAgent)/\(defaultUserAgent)" } else { self.userAgent = defaultUserAgent } + + self.headersForRouteHost = headersForRouteHost } - open func request( - _ route: Route, serverArgs: ASerial.ValueType? = nil + public func shutdown() { + manager.shutdown() + longpollManager.shutdown() + } + + public func request(_ route: Route) -> RpcRequest where ASerial: JSONSerializer, + RSerial: JSONSerializer, ESerial: JSONSerializer { + request(route, serverArgs: nil) + } + + public func request( + _ route: Route, serverArgs: ASerial.ValueType? ) -> RpcRequest { - let requestCreation = { self.createRpcRequest(route: route, serverArgs: serverArgs) } - let request = RequestWithTokenRefresh(requestCreation: requestCreation, tokenProvider: accessTokenProvider) + let managerToUse = type(of: route) == type(of: Files.listFolderLongpoll) + ? longpollManager + : manager + + let urlRequest = { self.createRpcRequest(route: route, serverArgs: serverArgs) } + let apiRequest = managerToUse.apiRequestData(request: urlRequest) + return RpcRequest( - request: request, + request: apiRequest, responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer ) } - open func request( + public func request( _ route: Route, serverArgs: ASerial.ValueType, input: UploadBody ) -> UploadRequest { - let requestCreation = { self.createUploadRequest(route: route, serverArgs: serverArgs, input: input) } - let request = RequestWithTokenRefresh( - requestCreation: requestCreation, tokenProvider: accessTokenProvider + var apiRequest = manager.apiRequestUpload( + request: { self.createUploadRequest(route: route, serverArgs: serverArgs, input: input) }, + input: input ) + + if manager.isBackgroundManager { + let persistedInfo = ReconnectionHelpers.PersistedRequestInfo.upload( + .init( + originalSDKVersion: DropboxClientsManager.sdkVersion, + routeName: route.name, + routeNamespace: route.namespace, + clientProvidedInfo: nil + ) + ) + + apiRequest.taskDescription = try? persistedInfo.asJsonString() + } + return UploadRequest( - request: request, + request: apiRequest, + responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer + ) + } + + func reconnectRequest( + _ route: Route, + apiRequest: ApiRequest + ) -> UploadRequest { + UploadRequest( + request: apiRequest, responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer ) } - open func request( + public func request( _ route: Route, serverArgs: ASerial.ValueType, overwrite: Bool, - destination: @escaping (URL, HTTPURLResponse) -> URL + destination: URL ) -> DownloadRequestFile { - weak var weakDownloadRequest: DownloadRequestFile! - - let destinationWrapper: DownloadRequest.Destination = { url, resp in - var finalUrl = destination(url, resp) - - if 200 ... 299 ~= resp.statusCode { - if FileManager.default.fileExists(atPath: finalUrl.path) { - if overwrite { - do { - try FileManager.default.removeItem(at: finalUrl) - } catch let error as NSError { - print("Error: \(error)") - } - } else { - print("Error: File already exists at \(finalUrl.path)") - } - } - } else { - weakDownloadRequest.errorMessage = try! Data(contentsOf: url) - // Alamofire will "move" the file to the temporary location where it already resides, - // and where it will soon be automatically deleted - finalUrl = url - } + var apiRequest = manager.apiRequestDownloadFile( + request: { self.createDownloadRequest(route: route, serverArgs: serverArgs) } + ) - weakDownloadRequest.urlPath = finalUrl - return (finalUrl, []) - } - let requestCreation = { - self.createDownloadFileRequest( - route: route, serverArgs: serverArgs, - overwrite: overwrite, downloadFileDestination: destinationWrapper + if manager.isBackgroundManager { + let persistedInfo = ReconnectionHelpers.PersistedRequestInfo.downloadFile( + .init( + originalSDKVersion: DropboxClientsManager.sdkVersion, + routeName: route.name, + routeNamespace: route.namespace, + clientProvidedInfo: nil, + destination: destination, + overwrite: overwrite + ) ) + + apiRequest.taskDescription = try? persistedInfo.asJsonString() } - let request = RequestWithTokenRefresh(requestCreation: requestCreation, tokenProvider: accessTokenProvider) + let downloadRequest = DownloadRequestFile( - request: request, - responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer + request: apiRequest, + responseSerializer: route.responseSerializer, + errorSerializer: route.errorSerializer, + moveToDestination: { [weak self] temporaryLocation in + try (self.orThrow()).filesAccess.moveFile( + from: temporaryLocation, + to: destination, + overwrite: overwrite + ) + }, errorDataFromLocation: { [weak self] url in + try self?.filesAccess.errorData(from: url) + } ) - weakDownloadRequest = downloadRequest + return downloadRequest } - public func request(_ route: Route, - serverArgs: ASerial.ValueType) -> DownloadRequestMemory { - let requestCreation = { - self.createDownloadMemoryRequest(route: route, serverArgs: serverArgs) - } - let request = RequestWithTokenRefresh(requestCreation: requestCreation, tokenProvider: accessTokenProvider) + func reconnectRequest( + _ route: Route, + apiRequest: ApiRequest, + overwrite: Bool, + destination: URL + ) -> DownloadRequestFile { + let downloadRequest = DownloadRequestFile( + request: apiRequest, + responseSerializer: route.responseSerializer, + errorSerializer: route.errorSerializer, + moveToDestination: { [weak self] temporaryLocation in + try (self.orThrow()).filesAccess.moveFile( + from: temporaryLocation, + to: destination, + overwrite: overwrite + ) + }, errorDataFromLocation: { [weak self] url in + try self?.filesAccess.errorData(from: url) + } + ) + return downloadRequest + } + + public func request( + _ route: Route, + serverArgs: ASerial.ValueType + ) -> DownloadRequestMemory { + let urlRequest = { self.createDownloadRequest(route: route, serverArgs: serverArgs) } + let apiRequest = manager.apiRequestData(request: urlRequest) + return DownloadRequestMemory( - request: request, responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer + request: apiRequest, responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer ) } - private func getHeaders(_ routeStyle: RouteStyle, jsonRequest: Data?, host: String) -> HTTPHeaders { + private func getHeaders(_ attributes: RouteAttributes, jsonRequest: Data?) -> [String: String] { var headers = ["User-Agent": userAgent] - let noauth = (host == "notify") - if (!noauth) { - headers["Authorization"] = "Bearer \(accessTokenProvider.accessToken)" + let additionalHeaders = headersForRouteHost?(attributes.host) ?? [:] + for (key, value) in additionalHeaders { + headers[key] = value + } + + let noauth = (attributes.auth.contains(.noauth)) + + if !noauth { if let selectUser = selectUser { headers["Dropbox-Api-Select-User"] = selectUser } - if let pathRoot = pathRoot { - let obj = Common.PathRootSerializer().serialize(pathRoot) - headers["Dropbox-Api-Path-Root"] = utf8Decode(SerializeUtil.dumpJSON(obj)!) + if let pathRoot = pathRoot, + let obj = try? Common.PathRootSerializer().serialize(pathRoot), + let data = try? SerializeUtil.dumpJSON(obj) { + headers["Dropbox-Api-Path-Root"] = Utilities.utf8Decode(data) + } + + if attributes.auth.contains(.user) + || attributes.auth.contains(.team), + let headerValue = authStrategy.accessTokenHeaderValue { + headers["Authorization"] = headerValue + } else if attributes.auth.contains(.app), + let headerValue = authStrategy.appKeyAndSecretHeaderValue { + headers["Authorization"] = headerValue } } - if (routeStyle == RouteStyle.Rpc) { + switch attributes.style { + case .rpc: headers["Content-Type"] = "application/json" - } else if (routeStyle == RouteStyle.Upload) { + case .upload: headers["Content-Type"] = "application/octet-stream" if let jsonRequest = jsonRequest { - let value = asciiEscape(utf8Decode(jsonRequest)) + let value = Utilities.asciiEscape(Utilities.utf8Decode(jsonRequest)) headers["Dropbox-Api-Arg"] = value } - } else if (routeStyle == RouteStyle.Download) { + case .download: if let jsonRequest = jsonRequest { - let value = asciiEscape(utf8Decode(jsonRequest)) + let value = Utilities.asciiEscape(Utilities.utf8Decode(jsonRequest)) headers["Dropbox-Api-Arg"] = value } } - return headers.toHTTPHeaders() + + return headers } private func createRpcRequest( route: Route, serverArgs: ASerial.ValueType? = nil - ) -> Alamofire.DataRequest { - let host = route.attrs["host"]! ?? "api" - var routeName = route.name - if route.version > 1 { - routeName = String(format: "%@_v%d", route.name, route.version) - } - let url = "\(baseHosts[host]!)/\(route.namespace)/\(routeName)" - - let routeStyle: RouteStyle = RouteStyle(rawValue: route.attrs["style"]!!)! - - var rawJsonRequest: Data? - rawJsonRequest = nil - - if let serverArgs = serverArgs { - let jsonRequestObj = route.argSerializer.serialize(serverArgs) - rawJsonRequest = SerializeUtil.dumpJSON(jsonRequestObj) - } else { - let voidSerializer = route.argSerializer as! VoidSerializer - let jsonRequestObj = voidSerializer.serialize(()) - rawJsonRequest = SerializeUtil.dumpJSON(jsonRequestObj) - } - - let headers = getHeaders(routeStyle, jsonRequest: rawJsonRequest, host: host) - - let customEncoding = SwiftyArgEncoding(rawJsonRequest: rawJsonRequest!) - - let managerToUse = { () -> Session in - // longpoll requests have a much longer timeout period than other requests - if type(of: route) == type(of: Files.listFolderLongpoll) { - return self.longpollManager - } - return self.manager - }() - - let request = managerToUse.request( - url, method: .post, parameters: ["jsonRequest": rawJsonRequest!], - encoding: customEncoding, headers: headers + ) -> URLRequest { + let jsonRequestObj: JSON = serverArgs.flatMap { try? route.argSerializer.serialize($0) } ?? .null + let rawJSONData = try? SerializeUtil.dumpJSON(jsonRequestObj) + + return urlRequest( + for: route, + serverArgs: serverArgs, + bodyData: rawJSONData, + stream: nil ) - request.task?.priority = URLSessionTask.highPriority - return request } private func createUploadRequest( - route: Route, - serverArgs: ASerial.ValueType, input: UploadBody - ) -> Alamofire.UploadRequest { - let host = route.attrs["host"]! ?? "api" - var routeName = route.name - if route.version > 1 { - routeName = String(format: "%@_v%d", route.name, route.version) - } - let url = "\(baseHosts[host]!)/\(route.namespace)/\(routeName)" - let routeStyle: RouteStyle = RouteStyle(rawValue: route.attrs["style"]!!)! - - let jsonRequestObj = route.argSerializer.serialize(serverArgs) - let rawJsonRequest = SerializeUtil.dumpJSON(jsonRequestObj) - - let headers = getHeaders(routeStyle, jsonRequest: rawJsonRequest, host: host) - - let request: Alamofire.UploadRequest - switch input { - case let .data(data): - request = manager.upload(data, to: url, method: .post, headers: headers) - case let .file(file): - request = manager.upload(file, to: url, method: .post, headers: headers) - case let .stream(stream): - request = manager.upload(stream, to: url, method: .post, headers: headers) - } - return request - } - - private func createDownloadFileRequest( route: Route, serverArgs: ASerial.ValueType, - overwrite: Bool, - downloadFileDestination: @escaping DownloadRequest.Destination - ) -> DownloadRequest { - let host = route.attrs["host"]! ?? "api" - var routeName = route.name - if route.version > 1 { - routeName = String(format: "%@_v%d", route.name, route.version) + input: UploadBody + ) -> URLRequest { + switch input { + case .data, .file: + return urlRequest(for: route, serverArgs: serverArgs, bodyData: nil, stream: nil) + case .stream(let stream): + return urlRequest(for: route, serverArgs: serverArgs, bodyData: nil, stream: stream) } - let url = "\(baseHosts[host]!)/\(route.namespace)/\(routeName)" - let routeStyle: RouteStyle = RouteStyle(rawValue: route.attrs["style"]!!)! - let jsonRequestObj = route.argSerializer.serialize(serverArgs) - let rawJsonRequest = SerializeUtil.dumpJSON(jsonRequestObj) - let headers = getHeaders(routeStyle, jsonRequest: rawJsonRequest, host: host) - return manager.download(url, method: .post, headers: headers, to: downloadFileDestination) } - private func createDownloadMemoryRequest( + private func createDownloadRequest( route: Route, serverArgs: ASerial.ValueType - ) -> DataRequest { - let host = route.attrs["host"]! ?? "api" - let url = "\(baseHosts[host]!)/\(route.namespace)/\(route.name)" - let routeStyle: RouteStyle = RouteStyle(rawValue: route.attrs["style"]!!)! - let jsonRequestObj = route.argSerializer.serialize(serverArgs) - let rawJsonRequest = SerializeUtil.dumpJSON(jsonRequestObj) - let headers = getHeaders(routeStyle, jsonRequest: rawJsonRequest, host: host) - return manager.request(url, method: .post, headers: headers) + ) -> URLRequest { + urlRequest(for: route, serverArgs: serverArgs, bodyData: nil, stream: nil) } -} -open class Box { - public let unboxed: T - init (_ v: T) { self.unboxed = v } -} + private func urlRequest( + for route: Route, + serverArgs: ASerial.ValueType?, + bodyData: Data?, + stream: InputStream? + ) -> URLRequest { + let attributes = route.attributes -public enum DropboxTransportClientError: Error { - case objectAlreadyDeinit -} + let jsonRequestObj: JSON = serverArgs.flatMap { try? route.argSerializer.serialize($0) } ?? .null + let rawJsonRequest = try? SerializeUtil.dumpJSON(jsonRequestObj) -public enum CallError: CustomStringConvertible { - case internalServerError(Int, String?, String?) - case badInputError(String?, String?) - case rateLimitError(Auth.RateLimitError, String?, String?, String?) - case httpError(Int?, String?, String?) - case authError(Auth.AuthError, String?, String?, String?) - case accessError(Auth.AccessError, String?, String?, String?) - case routeError(Box, String?, String?, String?) - case clientError(Error?) - - public var description: String { - switch self { - case let .internalServerError(code, message, requestId): - var ret = "" - if let r = requestId { - ret += "[request-id \(r)] " - } - ret += "Internal Server Error \(code)" - if let m = message { - ret += ": \(m)" - } - return ret - case let .badInputError(message, requestId): - var ret = "" - if let r = requestId { - ret += "[request-id \(r)] " - } - ret += "Bad Input" - if let m = message { - ret += ": \(m)" - } - return ret - case let .authError(error, _, _, requestId): - var ret = "" - if let r = requestId { - ret += "[request-id \(r)] " - } - ret += "API auth error - \(error)" - return ret - case let .accessError(error, _, _, requestId): - var ret = "" - if let r = requestId { - ret += "[request-id \(r)] " - } - ret += "API access error - \(error)" - return ret - case let .httpError(code, message, requestId): - var ret = "" - if let r = requestId { - ret += "[request-id \(r)] " - } - ret += "HTTP Error" - if let c = code { - ret += "\(c)" - } - if let m = message { - ret += ": \(m)" - } - return ret - case let .routeError(box, _, _, requestId): - var ret = "" - if let r = requestId { - ret += "[request-id \(r)] " - } - ret += "API route error - \(box.unboxed)" - return ret - case let .rateLimitError(error, _, _, requestId): - var ret = "" - if let r = requestId { - ret += "[request-id \(r)] " - } - ret += "API rate limit error - \(error)" - return ret - case let .clientError(err): - if let e = err { - return "\(e)" - } - return "An unknown system error" - } - } -} + let headers = getHeaders(attributes, jsonRequest: rawJsonRequest) -func utf8Decode(_ data: Data) -> String { - return NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String -} + var urlRequest = URLRequest(url: Self.url(for: route, baseHosts: baseHosts)) -func asciiEscape(_ s: String) -> String { - var out: String = "" - out.reserveCapacity(s.maximumLengthOfBytes(using: .utf16)) + urlRequest.httpMethod = "POST" + urlRequest.allHTTPHeaderFields = headers - for char in s.utf16 { - var esc: String - if let unicodeScalar = Unicode.Scalar(char), unicodeScalar.isASCII { - esc = "\(unicodeScalar)" - } else { - esc = String(format: "\\u%04x", char) - } - out += esc - } - return out -} - -public enum RouteStyle: String { - case Rpc = "rpc" - case Upload = "upload" - case Download = "download" - case Other -} - -public enum UploadBody { - case data(Data) - case file(URL) - case stream(InputStream) -} - -/// These objects are constructed by the SDK; users of the SDK do not need to create them manually. -/// -/// Pass in a closure to the `response` method to handle a response or error. -open class Request { - let responseSerializer: RSerial - let errorSerializer: ESerial - - fileprivate let request: ApiRequest - private var selfRetain: AnyObject? - - init(request: ApiRequest, responseSerializer: RSerial, errorSerializer: ESerial) { - self.errorSerializer = errorSerializer - self.responseSerializer = responseSerializer - - self.request = request - self.selfRetain = self - request.setCleanupHandler { [weak self] in - self?.cleanupSelfRetain() + if attributes.style == .upload || attributes.style == .download { + urlRequest.networkServiceType = .responsiveData } - } - - public func cancel() { - request.cancel() - } - func handleResponseError(_ response: HTTPURLResponse?, data: Data?, error: Error?) -> CallError { - let requestId = response?.allHeaderFields["X-Dropbox-Request-Id"] as? String - if let code = response?.statusCode { - switch code { - case 500...599: - var message = "" - if let d = data { - message = utf8Decode(d) - } - return .internalServerError(code, message, requestId) - case 400: - var message = "" - if let d = data { - message = utf8Decode(d) - } - return .badInputError(message, requestId) - case 401: - let json = SerializeUtil.parseJSON(data!) - switch json { - case .dictionary(let d): - return .authError(Auth.AuthErrorSerializer().deserialize(d["error"]!), getStringFromJson(json: d, key: "user_message"), getStringFromJson(json: d, key: "error_summary"), requestId) - default: - fatalError("Failed to parse error type") - } - case 403: - let json = SerializeUtil.parseJSON(data!) - switch json { - case .dictionary(let d): - return .accessError(Auth.AccessErrorSerializer().deserialize(d["error"]!), getStringFromJson(json: d, key: "user_message"), getStringFromJson(json: d, key: "error_summary"),requestId) - default: - fatalError("Failed to parse error type") - } - case 409: - let json = SerializeUtil.parseJSON(data!) - switch json { - case .dictionary(let d): - return .routeError(Box(self.errorSerializer.deserialize(d["error"]!)), getStringFromJson(json: d, key: "user_message"), getStringFromJson(json: d, key: "error_summary"), requestId) - default: - fatalError("Failed to parse error type") - } - case 429: - let json = SerializeUtil.parseJSON(data!) - switch json { - case .dictionary(let d): - return .rateLimitError(Auth.RateLimitErrorSerializer().deserialize(d["error"]!), getStringFromJson(json: d, key: "user_message"), getStringFromJson(json: d, key: "error_summary"), requestId) - default: - fatalError("Failed to parse error type") - } - case 200: - return .clientError(error) - default: - return .httpError(code, "An error occurred.", requestId) - } - } else if response == nil { - return .clientError(error) - } else { - var message = "" - if let d = data { - message = utf8Decode(d) - } - return .httpError(nil, message, requestId) + if let bodyData = bodyData { + urlRequest.httpBody = bodyData } - } - - func getStringFromJson(json: [String : JSON], key: String) -> String { - if let jsonStr = json[key] { - switch jsonStr { - case .str(let str): - return str; - default: - break; - } + if let stream = stream { + urlRequest.httpBodyStream = stream } - - return ""; + return urlRequest } - private func cleanupSelfRetain() { - self.selfRetain = nil + static func url( + for route: Route, + baseHosts: BaseHosts = .default + ) -> URL { + let urlString = "\(baseHosts.url(for: route.attributes.host))/\(route.namespace)/\(route.name)" + return URL(string: urlString)! } -} -/// An "rpc-style" request -open class RpcRequest: Request { - @discardableResult - public func response( - queue: DispatchQueue? = nil, - completionHandler: @escaping (RSerial.ValueType?, CallError?) -> Void - ) -> Self { - request.setCompletionHandler(queue: queue, completionHandler: .dataCompletionHandler({ [weak self] response in - guard let strongSelf = self else { - completionHandler(nil, .clientError(DropboxTransportClientError.objectAlreadyDeinit)) - return - } - if let error = response.error { - completionHandler(nil, strongSelf.handleResponseError(response.response, data: response.data, error: error)) - } else { - completionHandler(strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(response.data!)), nil) - } - })) - return self - } -} - -/// An "upload-style" request -open class UploadRequest: Request { - @discardableResult - public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { - request.setProgressHandler(progressHandler) - return self - } - - @discardableResult - public func response( - queue: DispatchQueue? = nil, - completionHandler: @escaping (RSerial.ValueType?, CallError?) -> Void - ) -> Self { - request.setCompletionHandler(queue: queue, completionHandler: .dataCompletionHandler({ [weak self] response in - guard let strongSelf = self else { - completionHandler(nil, .clientError(DropboxTransportClientError.objectAlreadyDeinit)) - return - } - if let error = response.error { - completionHandler(nil, strongSelf.handleResponseError(response.response, data: response.data, error: error)) - } else { - completionHandler(strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(response.data!)), nil) - } - })) - return self + var __testing_only_backgroundUrlSession: URLSession? { + if manager.isBackgroundManager { + return manager.__testing_only_urlSession + } + return nil } } - -/// A "download-style" request to a file -open class DownloadRequestFile: Request { - var urlPath: URL? - var errorMessage: Data - - override init(request: ApiRequest, responseSerializer: RSerial, errorSerializer: ESerial) { - urlPath = nil - errorMessage = Data() - super.init(request: request, responseSerializer: responseSerializer, errorSerializer: errorSerializer) - } - - @discardableResult - public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { - request.setProgressHandler(progressHandler) - return self +@objc(DBXBaseHosts) +public class BaseHosts: NSObject { + @objc + let apiHost: String + @objc + let contentHost: String + @objc + let notifyHost: String + + @objc + public required init( + apiHost: String, + contentHost: String, + notifyHost: String + ) { + self.apiHost = apiHost + self.contentHost = contentHost + self.notifyHost = notifyHost } - @discardableResult - public func response( - queue: DispatchQueue? = nil, - completionHandler: @escaping ((RSerial.ValueType, URL)?, CallError?) -> Void - ) -> Self { - request.setCompletionHandler(queue: queue, completionHandler: .downloadFileCompletionHandler({ [weak self] response in - guard let strongSelf = self else { - completionHandler(nil, .clientError(DropboxTransportClientError.objectAlreadyDeinit)) - return - } - if let error = response.error { - completionHandler( - nil, strongSelf.handleResponseError(response.response, data: strongSelf.errorMessage, error: error) - ) - } else { - let headerFields: [AnyHashable : Any] = response.response!.allHeaderFields - let result = caseInsensitiveLookup("Dropbox-Api-Result", dictionary: headerFields)! - let resultData = result.data(using: .utf8, allowLossyConversion: false) - let resultObject = strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(resultData!)) - - completionHandler((resultObject, strongSelf.urlPath!), nil) - } - })) - return self + public static var `default`: Self { + .init( + apiHost: ApiClientConstants.apiHost, + contentHost: ApiClientConstants.contentHost, + notifyHost: ApiClientConstants.notifyHost + ) } } -/// A "download-style" request to memory -open class DownloadRequestMemory: Request { - @discardableResult - public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { - request.setProgressHandler(progressHandler) - return self - } - - @discardableResult - public func response( - queue: DispatchQueue? = nil, - completionHandler: @escaping ((RSerial.ValueType, Data)?, CallError?) -> Void - ) -> Self { - request.setCompletionHandler(queue: queue, completionHandler: .dataCompletionHandler({ [weak self] response in - guard let strongSelf = self else { - completionHandler(nil, .clientError(DropboxTransportClientError.objectAlreadyDeinit)) - return +extension BaseHosts { + func url(for host: RouteHost) -> String { + { + switch host { + case .api: + return apiHost + case .content: + return contentHost + case .notify: + return notifyHost } - if let error = response.error { - completionHandler(nil, strongSelf.handleResponseError(response.response, data: response.data, error: error)) - } else { - let headerFields: [AnyHashable : Any] = response.response!.allHeaderFields - let result = caseInsensitiveLookup("Dropbox-Api-Result", dictionary: headerFields)! - let resultData = result.data(using: .utf8, allowLossyConversion: false) - let resultObject = strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(resultData!)) - - // An empty file can cause the response data to be nil. - // If nil is encountered, we convert to an empty Data object. - completionHandler((resultObject, response.data ?? Data()), nil) - } - })) - return self - } -} - -func caseInsensitiveLookup(_ lookupKey: String, dictionary: [AnyHashable : Any]) -> String? { - for key in dictionary.keys { - let keyString = key as! String - if (keyString.lowercased() == lookupKey.lowercased()) { - return dictionary[key] as? String - } + }() + "/2" } - return nil } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClientInterface.swift b/Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClientInterface.swift new file mode 100644 index 000000000..856b66c3f --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/DropboxTransportClientInterface.swift @@ -0,0 +1,96 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +public protocol DropboxTransportClient { + var selectUser: String? { get set } + var pathRoot: Common.PathRoot? { get set } + var didFinishBackgroundEvents: (() -> Void)? { get set } + var accessTokenProvider: AccessTokenProvider? { get set } + var isBackgroundClient: Bool { get } + + var identifier: String? { get } + + func request( + _ route: Route + ) -> RpcRequest + + func request( + _ route: Route, + serverArgs: ASerial.ValueType? + ) -> RpcRequest + + func request( + _ route: Route, + serverArgs: ASerial.ValueType, + input: UploadBody + ) -> UploadRequest + + func request( + _ route: Route, + serverArgs: ASerial.ValueType, + overwrite: Bool, + destination: URL + ) -> DownloadRequestFile + + func request( + _ route: Route, + serverArgs: ASerial.ValueType + ) -> DownloadRequestMemory + + func shutdown() +} + +protocol DropboxTransportClientInternal: DropboxTransportClient { + var manager: NetworkSessionManager { get } + var longpollManager: NetworkSessionManager { get } + + func reconnectRequest( + _ route: Route, + apiRequest: ApiRequest + ) -> UploadRequest + + func reconnectRequest( + _ route: Route, + apiRequest: ApiRequest, + overwrite: Bool, + destination: URL + ) -> DownloadRequestFile +} + +typealias SessionCreation = (NetworkSessionConfiguration, CombinedURLSessionDelegate, OperationQueue) -> NetworkSession +let DefaultSessionCreation: SessionCreation = { configuration, delegate, queue in + URLSession(configuration: configuration.urlSessionConfiguration, delegate: delegate, delegateQueue: queue) +} + +public typealias HeadersForRouteRequest = (RouteHost) -> [String: String] + +public enum AuthStrategy { + case accessToken(AccessTokenProvider) + case appKeyAndSecret(String, String) + + var accessTokenHeaderValue: String? { + if case .accessToken(let provider) = self { + return "Bearer \(provider.accessToken)" + } + return nil + } + + var appKeyAndSecretHeaderValue: String? { + if case .appKeyAndSecret(let appKey, let appSecret) = self { + let authString = "\(appKey):\(appSecret)" + let authData = authString.data(using: .utf8) ?? .init() + return "Basic \(authData.base64EncodedString())" + } + return nil + } + + var accessTokenProvider: AccessTokenProvider? { + if case .accessToken(let provider) = self { + return provider + } + return nil + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Errors.swift b/Source/SwiftyDropbox/Shared/Handwritten/Errors.swift new file mode 100644 index 000000000..85e9ce520 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/Errors.swift @@ -0,0 +1,219 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +public struct LocalizedUserMessage { + public var text: String + public var locale: String +} + +public enum ClientError: Error { + case oauthError(Error) + case urlSessionError(Error) + case fileAccessError(Error) + case requestObjectDeallocated + case unexpectedState + case other(Error) +} + +public enum SerializationError: Error { + case missingResultHeader + case missingResultData +} + +public enum CallError: Error, CustomStringConvertible { + case internalServerError(Int, String?, String?) + case badInputError(String?, String?) + case rateLimitError(Auth.RateLimitError, LocalizedUserMessage?, String?, String?) + case httpError(Int?, String?, String?) + case authError(Auth.AuthError, LocalizedUserMessage?, String?, String?) + case accessError(Auth.AccessError, LocalizedUserMessage?, String?, String?) + case routeError(Box, LocalizedUserMessage?, String?, String?) + case serializationError(Error) + case reconnectionError(Error) + case clientError(ClientError) + + public var description: String { + switch self { + case let .internalServerError(code, message, requestId): + var ret = "" + if let r = requestId { + ret += "[request-id \(r)] " + } + ret += "Internal Server Error \(code)" + if let m = message { + ret += ": \(m)" + } + return ret + case let .badInputError(message, requestId): + var ret = "" + if let r = requestId { + ret += "[request-id \(r)] " + } + ret += "Bad Input" + if let m = message { + ret += ": \(m)" + } + return ret + case let .authError(error, _, _, requestId): + var ret = "" + if let r = requestId { + ret += "[request-id \(r)] " + } + ret += "API auth error - \(error)" + return ret + case let .accessError(error, _, _, requestId): + var ret = "" + if let r = requestId { + ret += "[request-id \(r)] " + } + ret += "API access error - \(error)" + return ret + case let .httpError(code, message, requestId): + var ret = "" + if let r = requestId { + ret += "[request-id \(r)] " + } + ret += "HTTP Error" + if let c = code { + ret += "\(c)" + } + if let m = message { + ret += ": \(m)" + } + return ret + case let .routeError(box, _, _, requestId): + var ret = "" + if let r = requestId { + ret += "[request-id \(r)] " + } + ret += "API route error - \(box.unboxed)" + return ret + case let .rateLimitError(error, _, _, requestId): + var ret = "" + if let r = requestId { + ret += "[request-id \(r)] " + } + ret += "API rate limit error - \(error)" + return ret + case let .serializationError(err): + return "\(err)" + case let .reconnectionError(err): + return "\(err)" + case let .clientError(err): + return "\(err)" + } + } + + static func error(response: HTTPURLResponse, data: Data?, errorSerializer: ESerial) throws -> CallError { + let requestId = requestId(from: response) + let code = response.statusCode + + switch code { + case 500 ... 599: + return .internalServerError(code, message(from: data), requestId) + case 400: + return .badInputError(message(from: data), requestId) + case 401: + let (errorJson, userMessage, errorSummary) = try components(from: data, errorSerializer: errorSerializer) + return .authError(try Auth.AuthErrorSerializer().deserialize(errorJson), userMessage, errorSummary, requestId) + case 403: + let (errorJson, userMessage, errorSummary) = try components(from: data, errorSerializer: errorSerializer) + return .accessError(try Auth.AccessErrorSerializer().deserialize(errorJson), userMessage, errorSummary, requestId) + case 409: + let (errorJson, userMessage, errorSummary) = try components(from: data, errorSerializer: errorSerializer) + return .routeError(try Box(errorSerializer.deserialize(errorJson)), userMessage, errorSummary, requestId) + case 429: + let (errorJson, userMessage, errorSummary) = try components(from: data, errorSerializer: errorSerializer) + return .rateLimitError(try Auth.RateLimitErrorSerializer().deserialize(errorJson), userMessage, errorSummary, requestId) + default: + return .httpError(code, "An error occurred.", requestId) + } + } + + init(clientError: ClientError) { + self = .clientError(clientError) + } + + init(_ response: HTTPURLResponse, data: Data, errorSerializer: ESerial) where ESerial.ValueType == EType { + do { + self = try Self.error(response: response, data: data, errorSerializer: errorSerializer) + } catch { + self = .serializationError(error) + } + } +} + +private func requestId(from response: HTTPURLResponse?) -> String? { + response?.allHeaderFields["X-Dropbox-Request-Id"] as? String +} + +private func message(from data: Data?) -> String { + var message = "" + if let d = data { + message = Utilities.utf8Decode(d) + } + return message +} + +private func components(from data: Data?, errorSerializer: ESerial) throws -> (JSON, LocalizedUserMessage, String) { + var jsonObject: [String: JSON] = [:] + var json: JSON = .null + + do { + json = try data.flatMap { try SerializeUtil.parseJSON($0) } ?? .null + + let dictionaryContents: ((JSON) -> [String: JSON]?) = { json in + if case .dictionary(let contents) = json { + return contents + } + return nil + } + + jsonObject = try dictionaryContents(json).orThrow() + + return ( + try jsonObject["error"].orThrow(), + getUserMessageFromJson(json: jsonObject, key: "user_message"), + getStringFromJson(json: jsonObject, key: "error_summary") + ) + } catch { + throw JSONSerializerError.deserializeError(type: ESerial.ValueType.self, json: json) + } +} + +private func getUserMessageFromJson(json: [String: JSON], key: String) -> LocalizedUserMessage { + if let json = json[key] { + switch json { + case .dictionary(let json): + let text = getStringFromJson(json: json, key: "text") + let locale = getStringFromJson(json: json, key: "locale") + let userMessage = LocalizedUserMessage(text: text, locale: locale) + return userMessage + default: + break + } + } + + return LocalizedUserMessage(text: "", locale: "") +} + +private func getStringFromJson(json: [String: JSON], key: String) -> String { + if let jsonStr = json[key] { + switch jsonStr { + case .str(let str): + return str + default: + break + } + } + + return "" +} + +public class Box { + public let unboxed: T + init(_ v: T) { self.unboxed = v } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/FilesAcccess.swift b/Source/SwiftyDropbox/Shared/Handwritten/FilesAcccess.swift new file mode 100644 index 000000000..61870623f --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/FilesAcccess.swift @@ -0,0 +1,91 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +public enum FilesAccessError: Error { + case errorMovingToTempLocation(Error) + case errorMovingFromTempLocation(Error) + case errorMovingFromTempLocationDestinationCollision(String) + case couldNotReadErrorDataAtUrl(Error) +} + +@objc(DBFilesAccess) +public protocol FilesAccess { + func moveFileToTemporaryLocation(from networkSessionTemporaryLocation: URL) throws -> URL + func moveFile(from temporaryLocation: URL, to finalUrl: URL, overwrite: Bool) throws -> URL + func errorData(from location: URL) throws -> Data +} + +public class FilesAccessImpl: FilesAccess { + var fileManager: FileManagerProtocol + let tempFolder = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) + + public convenience init() { + self.init(fileManager: FileManager.default) + } + + init(fileManager: FileManagerProtocol) { + self.fileManager = fileManager + setupDirectories() + } + + private func setupDirectories() { + if !fileManager.fileExists(atPath: tempFolder.path) { + try! fileManager.createDirectory(at: tempFolder, withIntermediateDirectories: true, attributes: nil) + } + } + + public func moveFileToTemporaryLocation(from networkSessionTemporaryLocation: URL) throws -> URL { + do { + let tempOutputURL = tempFolder.appendingPathComponent(UUID().uuidString) + try fileManager.moveItem(at: networkSessionTemporaryLocation, to: tempOutputURL) + return tempOutputURL + } catch { + throw FilesAccessError.errorMovingToTempLocation(error) + } + } + + public func moveFile(from temporaryLocation: URL, to finalUrl: URL, overwrite: Bool) throws -> URL { + if fileManager.fileExists(atPath: finalUrl.path) { + if overwrite { + do { + try fileManager.removeItem(at: finalUrl) + } catch { + throw FilesAccessError.errorMovingFromTempLocation(error) + } + } else { + throw FilesAccessError.errorMovingFromTempLocationDestinationCollision(finalUrl.path) + } + } + + do { + try fileManager.moveItem(at: temporaryLocation, to: finalUrl) + return finalUrl + } catch { + throw FilesAccessError.errorMovingFromTempLocation(error) + } + } + + public func errorData(from location: URL) throws -> Data { + do { + let data = try fileManager.contents(atPath: location.path).orThrow() + try fileManager.removeItem(at: location) + return data + } catch { + throw FilesAccessError.couldNotReadErrorDataAtUrl(error) + } + } +} + +protocol FileManagerProtocol { + func fileExists(atPath: String) -> Bool + func contents(atPath: String) -> Data? + func createDirectory(at: URL, withIntermediateDirectories: Bool, attributes: [FileAttributeKey: Any]?) throws + func moveItem(atPath: String, toPath: String) throws + func moveItem(at: URL, to: URL) throws + func removeItem(at: URL) throws +} + +extension FileManager: FileManagerProtocol {} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/MockApiRequest.swift b/Source/SwiftyDropbox/Shared/Handwritten/MockApiRequest.swift new file mode 100644 index 000000000..5e6e1387b --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/MockApiRequest.swift @@ -0,0 +1,153 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +class MockApiRequest: ApiRequest { + var handleCompletionSignal: (() -> Void)? + var handleRecieveDataSignal: (() -> Void)? + var handleDownloadFinishedSignal: (() -> Void)? + var handleSentBodyDataSignal: (() -> Void)? + var handleWroteDownloadDataSignal: (() -> Void)? + + var networkTask: NetworkTask? { + fatalError() + } + + var requestUrl: URL? + var completionHandler: RequestCompletionHandler? { + didSet { + guard completionHandler != nil else { + return + } + mockInput.flatMap { try? _handleMockInput($0) } + mockInput = nil + } + } + + /// If the completionHandler is not set yet, we keep around MockInput so we can call it later + private var mockInput: MockInput? + + public init(identifier: Int = Int.random(in: 1 ..< Int.max), requestUrl: URL? = nil) { + self.identifier = identifier + self.requestUrl = requestUrl + } + + var identifier: Int + var taskDescription: String? + var earliestBeginDate: Date? + + func handleCompletion(error: ClientError?) { + handleCompletionSignal?() + } + + func handleRecieve(data: Data) { + handleRecieveDataSignal?() + } + + func handleDownloadFinished(location: URL) { + handleDownloadFinishedSignal?() + } + + func handleSentBodyData(totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { + handleSentBodyDataSignal?() + } + + func handleWroteDownloadData(totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { + handleWroteDownloadDataSignal?() + } + + func setProgressHandler(_ handler: @escaping (Progress) -> Void) -> Self { self } + + func setCompletionHandler(queue: DispatchQueue?, completionHandler: RequestCompletionHandler) -> Self { + self.completionHandler = completionHandler + return self + } + + func cancel() {} + + func setCleanupHandler(_ handler: @escaping () -> Void) {} +} + +extension MockApiRequest { + func handleMockInput(_ mockInput: MockInput) throws { + try _handleMockInput(mockInput) + } + + func handleMockInput(_ mockInput: MockInputWithModel) throws { + var mappedInput: MockInput + + switch mockInput { + case .none: + mappedInput = .none + case .success(let model): + mappedInput = .success(json: try MockingUtilities.jsonObject(from: model)) + case .downloadSuccess(let model, let downloadLocation): + mappedInput = .downloadSuccess(json: try MockingUtilities.jsonObject(from: model), downloadLocation: downloadLocation) + case .requestError(let model, let code): + mappedInput = .requestError(json: try MockingUtilities.jsonObject(from: model), code: code) + case .routeError(let model): + mappedInput = .success(json: try MockingUtilities.jsonObject(from: model)) + } + + try _handleMockInput(mappedInput) + } +} + +enum MockApiRequestError: Error { + case badApiRequestType +} + +extension MockApiRequest { + func _handleMockInput(_ mockInput: MockInput) throws { + guard completionHandler != nil else { + self.mockInput = mockInput + return + } + + func callCompletion(data: Data?, response: HTTPURLResponse?, error: Error?, downloadLocation: URL? = nil) { + switch completionHandler { + case .dataCompletionHandler(let handler): + handler(.init( + data: data, + response: response, + error: error.flatMap { .urlSessionError($0) } + )) + case .downloadFileCompletionHandler(let handler): + handler(.init( + url: downloadLocation, + response: response, + error: error.flatMap { .urlSessionError($0) }, + errorDataFromLocation: { _ in .init() } + )) + case .none: + break + } + } + + switch mockInput { + case .none: + break + case .routeError(let json): + let (data, response) = try MockTaskHelpers.createResultComponents(requestUrl: requestUrl.orThrow(), json: json, code: 409) + + callCompletion(data: data, response: response, error: nil) + case .success(let json): + let (data, response) = try MockTaskHelpers.createResultComponents(requestUrl: requestUrl.orThrow(), json: json, code: 200) + + callCompletion(data: data, response: response, error: nil) + case .downloadSuccess(json: let json, downloadLocation: let downloadLocation): + let (data, response) = try MockTaskHelpers.createDownloadResultComponents(requestUrl: requestUrl.orThrow(), json: json, code: 200) + + callCompletion(data: data, response: response, error: nil, downloadLocation: downloadLocation) + case .requestError(let json, let code): + let (data, response) = try MockTaskHelpers.createResultComponents(requestUrl: requestUrl.orThrow(), json: json, code: code) + let error = NSError(domain: "MockNetworkSession", code: code, userInfo: nil) + + callCompletion(data: data, response: response, error: error) + case .clientError(error: let error): + callCompletion(data: nil, response: nil, error: error) + } + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/MockDropboxTransportClient.swift b/Source/SwiftyDropbox/Shared/Handwritten/MockDropboxTransportClient.swift new file mode 100644 index 000000000..42f296998 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/MockDropboxTransportClient.swift @@ -0,0 +1,173 @@ +/// +/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +protocol DropboxTransportClientOwning { + var client: DropboxTransportClient { get } + init(client: DropboxTransportClient) +} + +protocol JSONRepresentable { + func json() throws -> JSON +} + +enum MockingUtilities { + static func makeMock(forType: T.Type) -> (T, MockDropboxTransportClient) { + let mockTransportClient = MockDropboxTransportClient() + let namespaceObject = T(client: mockTransportClient) + return (namespaceObject, mockTransportClient) + } + + static func jsonObject(from result: T) throws -> [String: Any] { + let json = try result.json() + let jsonObject = try (SerializeUtil.prepareJSONForSerialization(json) as? [String: Any]).orThrow() + return jsonObject + } +} + +class MockDropboxTransportClient: DropboxTransportClient { + var identifier: String? + let filesAccess: FilesAccess = FilesAccessImpl() + + var selectUser: String? + var pathRoot: Common.PathRoot? + var didFinishBackgroundEvents: (() -> Void)? + var accessTokenProvider: AccessTokenProvider? = LongLivedAccessTokenProvider(accessToken: "accessToken") + var isBackgroundClient: Bool = false + + init() {} + + // MARK: Request Mocking + + fileprivate var allRequests = Requests() + typealias MockRequestHandler = (MockApiRequest) -> Void + /// This is called whenever a mock API request is created. By default it will do nothing, but you may be interested in `MockDropboxTransportClient.alwaysFailMockRequestHandler` to always fail requests + var mockRequestHandler: MockRequestHandler = noopMockRequestHandler + /// No-op: Does nothing additional to the request + static let noopMockRequestHandler: MockRequestHandler = { _ in } + /// Always fails the request with `MockError.intentionalFailure` + static let alwaysFailMockRequestHandler: MockRequestHandler = { + enum MockError: Error { + case intentionalFailure + } + try? $0.handleMockInput(.clientError(error: .other(MockError.intentionalFailure))) + } + + private func createRegisteredApiRequest( + for route: Route + ) -> MockApiRequest { + let apiRequest = MockApiRequest(requestUrl: DropboxTransportClientImpl.url(for: route)) + + mockRequestHandler(apiRequest) + + allRequests.record(request: apiRequest, with: route.name) + + return apiRequest + } + + func getLastRequest() -> MockApiRequest? { + allRequests.getLastRequest() + } + + func getRequest(with tag: String) -> MockApiRequest? { + allRequests.getRequest(with: tag) + } + + // MARK: DropboxTransportClient + + func request(_ route: Route) -> RpcRequest where ASerial: JSONSerializer, + RSerial: JSONSerializer, ESerial: JSONSerializer { + request(route, serverArgs: nil) + } + + func request( + _ route: Route, serverArgs: ASerial.ValueType? = nil + ) -> RpcRequest { + let apiRequest = createRegisteredApiRequest(for: route) + + return RpcRequest( + request: apiRequest, + responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer + ) + } + + func request( + _ route: Route, serverArgs: ASerial.ValueType, input: UploadBody + ) -> UploadRequest { + let apiRequest = createRegisteredApiRequest(for: route) + return UploadRequest( + request: apiRequest, + responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer + ) + } + + func request( + _ route: Route, + serverArgs: ASerial.ValueType, + overwrite: Bool, + destination: URL + ) -> DownloadRequestFile { + let apiRequest = createRegisteredApiRequest(for: route) + + return DownloadRequestFile( + request: apiRequest, + responseSerializer: route.responseSerializer, + errorSerializer: route.errorSerializer, + moveToDestination: { [weak self] temporaryLocation in + try (self.orThrow()).filesAccess.moveFile( + from: temporaryLocation, + to: destination, + overwrite: overwrite + ) + }, errorDataFromLocation: { [weak self] url in + try self?.filesAccess.errorData(from: url) + } + ) + } + + func request( + _ route: Route, + serverArgs: ASerial.ValueType + ) -> DownloadRequestMemory { + let apiRequest = createRegisteredApiRequest(for: route) + + return DownloadRequestMemory( + request: apiRequest, responseSerializer: route.responseSerializer, errorSerializer: route.errorSerializer + ) + } + + func reconnectRequest(_ route: Route, apiRequest: ApiRequest) -> UploadRequest + where ASerial: JSONSerializer, RSerial: JSONSerializer, ESerial: JSONSerializer { + fatalError("unimplemented") + } + + func reconnectRequest( + _ route: Route, + apiRequest: ApiRequest, + overwrite: Bool, + destination: URL + ) -> DownloadRequestFile where ASerial: JSONSerializer, RSerial: JSONSerializer, ESerial: JSONSerializer { + fatalError("unimplemented") + } + + func shutdown() {} +} + +private class Requests { + var allRequests: [(String, MockApiRequest)] = [] + + func getLastRequest() -> MockApiRequest? { + allRequests.last?.1 + } + + func getRequest(with tag: String) -> MockApiRequest? { + let tagsAreEqual: (String, ApiRequest) -> Bool = { requestTag, _ in requestTag == tag } + return allRequests.last(where: tagsAreEqual)?.1 + } + + func record(request: MockApiRequest, with tag: String) { + allRequests.append((tag, request)) + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkDataTask.swift b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkDataTask.swift new file mode 100644 index 000000000..40582141e --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkDataTask.swift @@ -0,0 +1,132 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +class MockNetworkTaskDelegate: NetworkDataTask, NetworkDownloadTask, NetworkUploadTask { + var error: Error? + var response: URLResponse? + var originalRequest: URLRequest? + var taskIdentifier: Int = 0 + var taskDescription: String? + var earliestBeginDate: Date? + + // MARK: Test utils + + var resumeCalled: Bool = false + var cancelCalled: Bool = false + + init(request: URLRequest) { + self.originalRequest = request + } + + func resume() { + resumeCalled = true + } + + func cancel() { + cancelCalled = true + } +} + +class MockNetworkDataTaskCompletion: NetworkDataTask { + var error: Error? + var state: URLSessionTask.State = .suspended + var response: URLResponse? + var originalRequest: URLRequest? + var taskIdentifier: Int = 0 + var taskDescription: String? + var earliestBeginDate: Date? + var completionHandler: NetworkDataTaskCompletion + var mockInput: () -> MockInput? + + init(request: URLRequest, mockInput: @escaping () -> MockInput? = { nil }, completionHandler: @escaping NetworkDataTaskCompletion) { + self.originalRequest = request + self.mockInput = mockInput + self.completionHandler = completionHandler + } + + func resume() { + let result: NetworkDataTaskResult + let mockInput = mockInput() ?? .none + + do { + switch mockInput { + case .none: + result = .failure(.failedWithError(.other(MockNetworkTaskResultError.noMockResultProvided))) + + case .routeError, .downloadSuccess: + fatalError("route and download calls use the delegate task") + + case .requestError(let json, let code): + let (data, response) = try MockTaskHelpers.createResultComponents(task: self, json: json, code: code) + result = .failure(.badStatusCode(data: data, code: code, response: response)) + + case .success(let json): + let (data, response) = try MockTaskHelpers.createResultComponents(task: self, json: json, code: 200) + result = .success((data: data, response: response)) + case .clientError(error: let error): + result = .failure(.failedWithError(error)) + } + } catch { + result = .failure(.failedWithError(.other(error))) + } + + completionHandler(result) + } + + func cancel() { + fatalError("todo") + } +} + +enum MockTaskHelpers { + static func createResultComponents(task: NetworkTask, json: [String: Any], code: NetworkStatusCode) throws -> (Data, HTTPURLResponse) { + let originalRequest = try task.originalRequest.orThrow() + let url = try originalRequest.url.orThrow(MockNetworkTaskResultError.badMockResultProvided) + + return try createResultComponents(requestUrl: url, json: json, code: code) + } + + static func createResultComponents(requestUrl: URL, json: [String: Any], code: NetworkStatusCode) throws -> (Data, HTTPURLResponse) { + do { + let data = try JSONSerialization.data(withJSONObject: json, options: []) + let response = try HTTPURLResponse(url: requestUrl, statusCode: code, httpVersion: "HTTP/2.0", headerFields: [:]) + .orThrow(MockNetworkTaskResultError.badMockResultProvided) + return (data: data, response: response) + } catch { + throw MockNetworkTaskResultError.badMockResultProvided + } + } + + static func createDownloadResultComponents(requestUrl: URL, json: [String: Any], code: NetworkStatusCode) throws -> (Data, HTTPURLResponse) { + do { + let data = try JSONSerialization.data(withJSONObject: json, options: []) + let response = try HTTPURLResponse( + url: requestUrl, + statusCode: code, + httpVersion: "HTTP/2.0", + headerFields: ["Dropbox-Api-Result": toSerializedString(json: json)] + ).orThrow(MockNetworkTaskResultError.badMockResultProvided) + + return (data: data, response: response) + } catch { + throw MockNetworkTaskResultError.badMockResultProvided + } + } + + private static func toSerializedString(json: [String: Any]) throws -> String { + let data = try JSONSerialization.data(withJSONObject: json, options: []) + guard let string = String(data: data, encoding: .utf8) else { + throw MockNetworkTaskResultError.badMockResultProvided + } + + return string + } +} + +enum MockNetworkTaskResultError: Error { + case noMockResultProvided + case badMockResultProvided +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkSession.swift b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkSession.swift new file mode 100644 index 000000000..1fea0b33c --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/Mocks/MockNetworkSession.swift @@ -0,0 +1,99 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +class MockNetworkSession: NetworkSession { + var identifier: String? + + init() {} + + required init(configuration: URLSessionConfiguration) { + fatalError() + } + + var tasksPendingReconnection: [NetworkTask] = [] + var tasks: [NetworkTaskTag: NetworkTask] = [:] + var mockInputs: [NetworkTaskTag: MockInput] = [:] + + var invalidateCalled = false + + func dataTask(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkDataTask { + register( + task: MockNetworkTaskDelegate(request: request), + networkTaskTag: networkTaskTag + ) + } + + func dataTask(request: URLRequest, networkTaskTag: NetworkTaskTag?, completionHandler: @escaping NetworkDataTaskCompletion) -> NetworkDataTask { + register( + task: MockNetworkDataTaskCompletion( + request: request, + mockInput: { [weak self] in + networkTaskTag.flatMap { self?.mockInputs[$0] } + }, + completionHandler: completionHandler + ), + networkTaskTag: networkTaskTag + ) + } + + func uploadTaskData(request: URLRequest, data: Data, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask { + register( + task: MockNetworkTaskDelegate(request: request), + networkTaskTag: networkTaskTag + ) + } + + func uploadTaskStream(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask { + register( + task: MockNetworkTaskDelegate(request: request), + networkTaskTag: networkTaskTag + ) + } + + func uploadTaskFile(request: URLRequest, file: URL, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask { + register( + task: MockNetworkTaskDelegate(request: request), + networkTaskTag: networkTaskTag + ) + } + + func downloadTask(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkDownloadTask { + register( + task: MockNetworkTaskDelegate(request: request), + networkTaskTag: networkTaskTag + ) + } + + func register(task: T, networkTaskTag: NetworkTaskTag?) -> T { + tasks[networkTaskTag ?? UUID().uuidString] = task + return task + } + + func getAllNetworkTasks(completionHandler: ([NetworkTask]) -> Void) { + completionHandler(tasksPendingReconnection) + } + + func invalidateAndCancel() { + invalidateCalled = true + } +} + +enum MockInput { + case none + case success(json: [String: Any]) + case downloadSuccess(json: [String: Any], downloadLocation: URL) + case requestError(json: [String: Any], code: NetworkStatusCode) + case routeError(json: [String: Any]) + case clientError(error: ClientError) +} + +enum MockInputWithModel { + case none + case success(model: JSONRepresentable) + case downloadSuccess(model: JSONRepresentable, downloadLocation: URL) + case requestError(model: JSONRepresentable, code: NetworkStatusCode) + case routeError(model: JSONRepresentable) +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSession.swift b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSession.swift new file mode 100644 index 000000000..e090976eb --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSession.swift @@ -0,0 +1,89 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +protocol NetworkSession: AnyObject { + var identifier: String? { get } + + init(configuration: URLSessionConfiguration) + + func dataTask(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkDataTask + func dataTask(request: URLRequest, networkTaskTag: NetworkTaskTag?, completionHandler: @escaping NetworkDataTaskCompletion) -> NetworkDataTask + + func uploadTaskData(request: URLRequest, data: Data, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask + func uploadTaskStream(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask + func uploadTaskFile(request: URLRequest, file: URL, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask + + func downloadTask(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkDownloadTask + + func getAllNetworkTasks(completionHandler: @escaping ([NetworkTask]) -> Void) + + func invalidateAndCancel() +} + +typealias CombinedURLSessionDelegate = URLSessionDataDelegate & URLSessionDownloadDelegate + +protocol NetworkSessionDelegate { + func networkSession(_ session: NetworkSession, dataTask: NetworkDataTask, didReceive data: Data) + + func networkSession(_ session: NetworkSession, task: NetworkTask, didCompleteWithError error: Error?) + func networkSession( + _ session: NetworkSession, + downloadTask: NetworkDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64 + ) + func networkSession(_ session: NetworkSession, downloadTask: NetworkDownloadTask, didFinishDownloadingTo location: URL) + + func networkSession(_ session: NetworkSession, task: NetworkTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + + func networkSession( + _ session: NetworkSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void + ) + + func networkSessionDidFinishEvents(forBackgroundNetworkSession session: NetworkSession) +} + +extension URLSession: NetworkSession { + var identifier: String? { + configuration.identifier + } + + func dataTask(request: URLRequest, networkTaskTag: NetworkTaskTag?, completionHandler: @escaping NetworkDataTaskCompletion) -> NetworkDataTask { + dataTask(with: request) { data, response, error in + completionHandler(.init(data: data, response: response, error: error.map { .urlSessionError($0) })) + } + } + + func dataTask(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkDataTask { + dataTask(with: request) + } + + func uploadTaskData(request: URLRequest, data: Data, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask { + uploadTask(with: request, from: data) + } + + func uploadTaskStream(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask { + uploadTask(withStreamedRequest: request) + } + + func uploadTaskFile(request: URLRequest, file: URL, networkTaskTag: NetworkTaskTag?) -> NetworkUploadTask { + uploadTask(with: request, fromFile: file) + } + + func downloadTask(request: URLRequest, networkTaskTag: NetworkTaskTag?) -> NetworkDownloadTask { + downloadTask(with: request) + } + + func getAllNetworkTasks(completionHandler: @escaping (([NetworkTask]) -> Void)) { + getAllTasks { urlSessionTasks in + let tasks: [URLSessionTask] = urlSessionTasks + completionHandler(tasks) + } + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionConfiguration.swift b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionConfiguration.swift new file mode 100644 index 000000000..ad228f97a --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionConfiguration.swift @@ -0,0 +1,139 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +public struct NetworkSessionConfiguration { + public enum Kind { + case `default` + case ephemeral + case background(String) + } + + public var identifier: String? { + switch kind { + case .default, .ephemeral: + return nil + case .background(let identifier): + return identifier + } + } + + public var timeoutIntervalForRequest: Double { + get { + urlSessionConfiguration.timeoutIntervalForRequest + } + set { + urlSessionConfiguration.timeoutIntervalForRequest = newValue + } + } + + public var timeoutIntervalForResource: Double { + get { + urlSessionConfiguration.timeoutIntervalForResource + } + set { + urlSessionConfiguration.timeoutIntervalForResource = newValue + } + } + + public var allowsCellularAccess: Bool { + get { + urlSessionConfiguration.allowsCellularAccess + } + set { + urlSessionConfiguration.allowsCellularAccess = newValue + } + } + + @available(iOS 13.0, macOS 10.15, *) + public var allowsExpensiveNetworkAccess: Bool { + get { + urlSessionConfiguration.allowsExpensiveNetworkAccess + } + set { + urlSessionConfiguration.allowsExpensiveNetworkAccess = newValue + } + } + + @available(iOS 13.0, macOS 10.15, *) + public var allowsConstrainedNetworkAccess: Bool { + get { + urlSessionConfiguration.allowsConstrainedNetworkAccess + } + set { + urlSessionConfiguration.allowsConstrainedNetworkAccess = newValue + } + } + + public var sharedContainerIdentifier: String? { + get { + urlSessionConfiguration.sharedContainerIdentifier + } + set { + urlSessionConfiguration.sharedContainerIdentifier = newValue + } + } + + public var httpMaximumConnectionsPerHost: Int { + get { + urlSessionConfiguration.httpMaximumConnectionsPerHost + } + set { + urlSessionConfiguration.httpMaximumConnectionsPerHost = newValue + } + } + + public var isDiscretionary: Bool { + get { + urlSessionConfiguration.isDiscretionary + } + set { + urlSessionConfiguration.isDiscretionary = newValue + } + } + + public var urlCache: URLCache? { + get { + urlSessionConfiguration.urlCache + } + set { + urlSessionConfiguration.urlCache = newValue + } + } + + public let kind: Kind + + internal var urlSessionConfiguration: URLSessionConfiguration + + public init(kind: Kind) { + self.kind = kind + switch kind { + case .default: + self.urlSessionConfiguration = .default + case .ephemeral: + self.urlSessionConfiguration = .ephemeral + case .background(let identifier): + self.urlSessionConfiguration = .background(withIdentifier: identifier) + } + } + + public static var `default`: Self = { + var instance = Self(kind: .default) + instance.timeoutIntervalForRequest = 100 + return instance + }() + + public static var defaultLongpoll: Self = { + var instance = Self(kind: .default) + instance.timeoutIntervalForRequest = 480 + return instance + }() + + public static func background(withIdentifier identifier: String, sharedContainerIdentifier: String? = nil) -> Self { + var configuration = Self(kind: .background(identifier)) + configuration.sharedContainerIdentifier = sharedContainerIdentifier + return configuration + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionManager.swift b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionManager.swift new file mode 100644 index 000000000..902bd4b90 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkSessionManager.swift @@ -0,0 +1,419 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +typealias NetworkTaskCreation = () -> NetworkTask +typealias OnTaskCreation = (ApiRequest) -> Void +typealias ApiRequestCreation = (@escaping NetworkTaskCreation, @escaping OnTaskCreation) -> ApiRequest + +@objc(DBNetworkSessionManager) +class NetworkSessionManager: NSObject { + let session: NetworkSession + let requestMap: RequestMap + var didFinishBackgroundEvents: (() -> Void)? + + let apiRequestCreation: ApiRequestCreation + var apiRequestReconnectionCreation: ((NetworkTask) -> ApiRequest)? + + private let authChallengeHandler: AuthChallenge.Handler? + private var isShutdown: Bool = false + + var isBackgroundManager: Bool { + session.identifier != nil + } + + var identifier: String? { + session.identifier + } + + let delegateQueue: OperationQueue = { + let instance = OperationQueue() + instance.maxConcurrentOperationCount = 1 + return instance + }() + + private let isolationQueue: DispatchQueue = DispatchQueue(label: "NetworkSessionManagerQueue") + + private let passthroughDelegate: NetworkSessionPassthroughDelegate = .init() + + init( + sessionCreation: (CombinedURLSessionDelegate, OperationQueue) -> NetworkSession, + apiRequestCreation: @escaping ApiRequestCreation, + apiRequestReconnectionCreation: ((NetworkTask) -> ApiRequest)?, + requestMap: RequestMap = RequestMapImpl(), + authChallengeHandler: AuthChallenge.Handler? + ) { + self.session = sessionCreation(passthroughDelegate, delegateQueue) + self.requestMap = requestMap + self.apiRequestCreation = apiRequestCreation + self.apiRequestReconnectionCreation = apiRequestReconnectionCreation + self.authChallengeHandler = authChallengeHandler + + super.init() + + passthroughDelegate.delegate = self + } + + func getAllTasks(completionHandler: @escaping ([ApiRequest]) -> Void) { + session.getAllNetworkTasks { [weak self] networkTasks in + self?.isolationQueue.async { [weak self] in + guard let self = self else { + return + } + DropboxClientsManager.logBackgroundSession("getAllTasks from URLSession returned \(networkTasks.count) \(networkTasks)") + + // All ongoing URLSessionTasks that the request map knows of + let existingRequestMapApiRequests = self.requestMap.getAllRequests() + let existingRequestMapTaskIdentifiers = existingRequestMapApiRequests.map(\.identifier) + + // All ongoing unowned URLSessionTasks that the request map knows of + let unownedRequestMapApiRequests = self.requestMap.getAllPendingReconnectionRequests() + + DropboxClientsManager + .logBackgroundSession( + "getAllTasks existingUnownedApiRequests in request map \(unownedRequestMapApiRequests.count) \(unownedRequestMapApiRequests)" + ) + + let untrackedApiRequestsFromClosure: [ApiRequest] = networkTasks.compactMap { + let isTracked = existingRequestMapTaskIdentifiers.contains($0.taskIdentifier) + + if isTracked { + // URLSessionDelegate learned of the task before getAllNetworkTasks. + // It is either an unowned request already rewrapped or an owned request. + // Neither need wrapping or registering. + return nil + } else { + // getAllNetworkTasks learned of the task before URLSessionDelegate. + // Include it here for rewrapping. + return self.registeredPendingReconnectionApiRequest(from: $0) + } + } + + // Note that we're only reconnecting unowned `ApiRequests` (those not retained by a `Request`) + // Owned `ApiRequests` could exist in the request map at the point if the app was backgrounded but not terminated, + // or if additional requests were created after the app was relaunched. + // For these, no reconnection is needed, the `Request` is in memory and already has a completion block if previously set. + let apiRequestsToReconnect = unownedRequestMapApiRequests + untrackedApiRequestsFromClosure + + // Guard against reentrancy issues by dispatching the completion async to main + DispatchQueue.main.async { + completionHandler( + apiRequestsToReconnect + ) + } + + // API requests are typically retained by a Request + // In the reconnection case, these requests don't yet exist so the request map retains them instead + // Once they've been vended for reconnection to a Request, weakify them in the request map + self.requestMap.weakifyReferencesToReconnectedRequests() + } + } + } + + public func shutdown() { + isolationQueue.sync { + self.isShutdown = true + self.session.invalidateAndCancel() + } + } + + var __testing_only_urlSession: URLSession? { + session as? URLSession + } +} + +extension NetworkSessionManager { + func apiRequestData(request: @escaping () -> URLRequest, networkTaskTag: NetworkTaskTag? = nil) -> ApiRequest { + registeredApiRequest { + self.session.dataTask(request: request(), networkTaskTag: networkTaskTag) + } + } + + func apiRequestUpload(request: @escaping () -> URLRequest, input: UploadBody, networkTaskTag: NetworkTaskTag? = nil) -> ApiRequest { + registeredApiRequest { + var task: NetworkTask + + switch input { + case let .data(data): + task = self.session.uploadTaskData(request: request(), data: data, networkTaskTag: networkTaskTag) + case let .file(file): + task = self.session.uploadTaskFile(request: request(), file: file, networkTaskTag: networkTaskTag) + case .stream: + task = self.session.uploadTaskStream(request: request(), networkTaskTag: networkTaskTag) + } + + return task + } + } + + func apiRequestDownloadFile(request: @escaping () -> URLRequest, networkTaskTag: NetworkTaskTag? = nil) -> ApiRequest { + registeredApiRequest { + self.session.downloadTask(request: request(), networkTaskTag: networkTaskTag) + } + } + + private func registeredApiRequest(from taskCreation: @escaping () -> NetworkTask) -> ApiRequest { + isolationQueue.sync { + if self.isShutdown { + return NoopApiRequest() + } + + let onTaskCreation = { [weak self] apiRequest in + guard let self = self else { + return + } + + self.isolationQueue.sync { + self.requestMap.set(request: apiRequest, taskIdentifier: apiRequest.identifier) + } + } + + let apiRequest = apiRequestCreation(taskCreation, onTaskCreation) + return apiRequest + } + } + + // TODO: programatically enforce isolated access to mutable state + // Only call on isolation queue + private func registeredPendingReconnectionApiRequest(from task: NetworkTask) -> ApiRequest? { + if let apiRequestReconnectionCreation = apiRequestReconnectionCreation { + let apiRequest = apiRequestReconnectionCreation(task) + requestMap.setPendingReconnection(request: apiRequest, taskIdentifier: apiRequest.identifier) + return apiRequest + } + return nil + } +} + +extension NetworkSessionManager: NetworkSessionDelegate { + func networkSession(_ session: NetworkSession, dataTask: NetworkDataTask, didReceive data: Data) { + executeWorkOnTask(networkTask: dataTask, async: true) { task in + task.handleRecieve(data: data) + } + } + + func networkSession(_ session: NetworkSession, task: NetworkTask, didCompleteWithError error: Error?) { + executeWorkOnTask(networkTask: task, async: true) { task in + task.handleCompletion(error: error.flatMap { .urlSessionError($0) }) + } + } + + func networkSession( + _ session: NetworkSession, + downloadTask: NetworkDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64 + ) { + executeWorkOnTask(networkTask: downloadTask, async: true) { task in + task.handleWroteDownloadData(totalBytesWritten: totalBytesWritten, totalBytesExpectedToWrite: totalBytesExpectedToWrite) + } + } + + func networkSession(_ session: NetworkSession, downloadTask: NetworkDownloadTask, didFinishDownloadingTo location: URL) { + executeWorkOnTask(networkTask: downloadTask, async: false) { task in + task.handleDownloadFinished(location: location) + } + } + + func networkSession( + _ session: NetworkSession, + task: NetworkTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64 + ) { + executeWorkOnTask(networkTask: task, async: true) { task in + task.handleSentBodyData(totalBytesSent: totalBytesSent, totalBytesExpectedToSend: totalBytesExpectedToSend) + } + } + + func networkSession( + _ session: NetworkSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void + ) { + if let (disposition, credential) = authChallengeHandler?(challenge) { + completionHandler(disposition, credential) + } else { + completionHandler(.performDefaultHandling, nil) + } + } + + func networkSessionDidFinishEvents(forBackgroundNetworkSession session: NetworkSession) { + DispatchQueue.main.async { + self.didFinishBackgroundEvents?() + } + } + + private func executeWorkOnTask(networkTask: NetworkTask, async: Bool, work: @escaping (ApiRequest) -> Void) { + let getRequestAndDoWork: () -> Void = { [weak self] in + guard let self = self else { + return + } + + if let apiRequest = self.requestMap.getRequest(taskIdentifier: networkTask.taskIdentifier) { + if self.isBackgroundManager { + DropboxClientsManager.logBackgroundSession("executeWorkOnTask taskFound \(networkTask.taskIdentifier)") + } + + work(apiRequest) + } else { + if self.isBackgroundManager { + DropboxClientsManager.logBackgroundSession("executeWorkOnTask task recreated \(networkTask.taskIdentifier)") + + guard let registeredPendingReconnectionApiRequest = self.registeredPendingReconnectionApiRequest(from: networkTask) else { + DropboxClientsManager.logBackgroundSession(.error, "apiRequestReconnectionCreation missing in background NetworkSessionManager") + return + } + + work( + registeredPendingReconnectionApiRequest + ) + } else { + DropboxClientsManager.log(.error, "executeWorkOnTask task not found \(networkTask.taskIdentifier)") + } + } + } + + // work produced by didFinishDownloadingTo must be dispatched sync while the temporary file exists + if async { + isolationQueue.async(execute: getRequestAndDoWork) + } else { + isolationQueue.sync(execute: getRequestAndDoWork) + } + } +} + +extension NetworkSessionManager: CombinedURLSessionDelegate { + @objc + public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + DropboxClientsManager.logBackgroundSession("\(#function) \(dataTask.taskIdentifier) bytes: \(data.count)") + networkSession(session, dataTask: dataTask, didReceive: data) + } + + @objc + public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + DropboxClientsManager.logBackgroundSession("\(#function) \(task.taskIdentifier) error: \(error?.localizedDescription ?? "none")") + networkSession(session, task: task, didCompleteWithError: error) + } + + @objc + public func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64 + ) { + DropboxClientsManager + .logBackgroundSession( + "\(#function) \(downloadTask.taskIdentifier) bytesWritten: \(bytesWritten), totalBytesWritten: \(totalBytesWritten), totalBytesExpectedToWrite: \(totalBytesExpectedToWrite)" + ) + networkSession( + session, + downloadTask: downloadTask, + didWriteData: bytesWritten, + totalBytesWritten: totalBytesWritten, + totalBytesExpectedToWrite: totalBytesExpectedToWrite + ) + } + + @objc + public func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { + DropboxClientsManager.logBackgroundSession("\(#function) \(downloadTask.taskIdentifier) didFinishDownloadingTolocation: \(location)") + networkSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) + } + + @objc + public func urlSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64 + ) { + DropboxClientsManager + .logBackgroundSession( + "\(#function) \(task.taskIdentifier) didSendBodyData: \(bytesSent), totalBytesSent: \(totalBytesSent), totalBytesExpectedToSend: \(totalBytesExpectedToSend)" + ) + networkSession(session, task: task, didSendBodyData: bytesSent, totalBytesSent: totalBytesSent, totalBytesExpectedToSend: totalBytesExpectedToSend) + } + + @objc + public func urlSession( + _ session: URLSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void + ) { + DropboxClientsManager.logBackgroundSession("\(#function)") + networkSession(session, didReceive: challenge, completionHandler: completionHandler) + } + + #if os(iOS) + @objc + func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { + DropboxClientsManager.logBackgroundSession("\(#function)") + networkSessionDidFinishEvents(forBackgroundNetworkSession: session) + } + #endif +} + +// Allows deferring setting a delegate to after session initialization +class NetworkSessionPassthroughDelegate: NSObject, CombinedURLSessionDelegate { + var delegate: CombinedURLSessionDelegate? + + func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + delegate?.urlSession?(session, dataTask: dataTask, didReceive: data) + } + + func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + delegate?.urlSession?(session, task: task, didCompleteWithError: error) + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64 + ) { + delegate?.urlSession?( + session, + downloadTask: downloadTask, + didWriteData: bytesWritten, + totalBytesWritten: totalBytesWritten, + totalBytesExpectedToWrite: totalBytesExpectedToWrite + ) + } + + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { + delegate?.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) + } + + func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { + delegate?.urlSession?( + session, + task: task, + didSendBodyData: bytesSent, + totalBytesSent: totalBytesSent, + totalBytesExpectedToSend: totalBytesExpectedToSend + ) + } + + func urlSession( + _ session: URLSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void + ) { + delegate?.urlSession?(session, didReceive: challenge, completionHandler: completionHandler) + } + + #if os(iOS) + func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { + delegate?.urlSessionDidFinishEvents?(forBackgroundURLSession: session) + } + #endif +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkTask.swift b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkTask.swift new file mode 100644 index 000000000..77f0a006a --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/NetworkSession/NetworkTask.swift @@ -0,0 +1,113 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +// MARK: Types + +public protocol NetworkTask: AnyObject { + func resume() + func cancel() + var response: URLResponse? { get } + var error: Error? { get } + var clientError: ClientError? { get } + var originalRequest: URLRequest? { get } + var taskIdentifier: Int { get } + var taskDescription: String? { get set } + + @available(iOS 13.0, macOS 10.13, *) + var earliestBeginDate: Date? { get set } +} + +public extension NetworkTask { + var clientError: ClientError? { + error.map { .urlSessionError($0) } + } +} + +public typealias NetworkTaskTag = String + +// TODO: are these needed +public protocol NetworkDataTask: NetworkTask {} +public protocol NetworkUploadTask: NetworkTask {} +public protocol NetworkDownloadTask: NetworkTask {} + +public typealias NetworkDataTaskCompletion = (NetworkDataTaskResult) -> Void + +public enum NetworkTaskFailure: Error { + case badStatusCode(data: Data, code: NetworkStatusCode, response: HTTPURLResponse) + case failedWithError(ClientError) +} + +public typealias NetworkDataTaskResult = Result<(data: Data, response: HTTPURLResponse), NetworkTaskFailure> +public typealias NetworkDownloadTaskResult = Result<(url: URL, response: HTTPURLResponse), NetworkTaskFailure> + +public typealias NetworkStatusCode = Int + +extension NetworkStatusCode { + var isSuccessful: Bool { + (200 ..< 300).contains(self) + } + + init(_ int: Int) { + self = int + } +} + +// MARK: Implementations + +extension URLSessionTask: NetworkTask {} +extension URLSessionDataTask: NetworkDataTask {} +extension URLSessionUploadTask: NetworkUploadTask {} +extension URLSessionDownloadTask: NetworkDownloadTask {} + +extension NetworkDataTaskResult { + init(data: Data?, response: URLResponse?, error: ClientError?) { + if let response = response as? HTTPURLResponse { + let data = data ?? .init() + + if NetworkStatusCode(response.statusCode).isSuccessful { + self = .success((data, response)) + } else { + self = .failure( + .badStatusCode( + data: data, + code: response.statusCode, + response: response + ) + ) + } + } else if let error = error { + self = .failure(.failedWithError(error)) + } else { + self = .failure(.failedWithError(.unexpectedState)) + } + } +} + +extension NetworkDownloadTaskResult { + init(url: URL?, response: URLResponse?, error: ClientError?, errorDataFromLocation: (URL) throws -> Data) { + if let url = url, let response = response as? HTTPURLResponse { + if NetworkStatusCode(response.statusCode).isSuccessful { + self = .success((url, response)) + } else { + do { + self = .failure( + .badStatusCode( + data: try errorDataFromLocation(url), + code: response.statusCode, + response: response + ) + ) + } catch { + self = .failure(.failedWithError(.fileAccessError(error))) + } + } + } else if let error = error { + self = .failure(.failedWithError(error)) + } else { + self = .failure(.failedWithError(.unexpectedState)) + } + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/NoopRequest.swift b/Source/SwiftyDropbox/Shared/Handwritten/NoopRequest.swift new file mode 100644 index 000000000..a3ed8d96c --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/NoopRequest.swift @@ -0,0 +1,60 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +/// Used internally when a URLSessionTask cannot be constructed during shutdown +class NoopApiRequest: ApiRequest { + init() {} + + func handleCompletion(error: ClientError?) {} + + func handleRecieve(data: Data) {} + + func handleDownloadFinished(location: URL) {} + + func handleSentBodyData(totalBytesSent: Int64, totalBytesExpectedToSend: Int64) {} + + func handleWroteDownloadData(totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) {} + + var identifier: Int { + networkTask?.taskIdentifier ?? -1 + } + + var taskDescription: String? + + var earliestBeginDate: Date? + + func setProgressHandler(_ handler: @escaping (Progress) -> Void) -> Self { + self + } + + func setCompletionHandler(queue: DispatchQueue?, completionHandler: RequestCompletionHandler) -> Self { + self + } + + func cancel() {} + + func setCleanupHandler(_ handler: @escaping () -> Void) {} + + var networkTask: NetworkTask? = NoopNetworkTask() +} + +class NoopNetworkTask: NetworkTask { + func resume() {} + + func cancel() {} + + var response: URLResponse? + + var error: Error? + + var originalRequest: URLRequest? + + var taskIdentifier: Int = Int.random(in: 1 ..< Int.max) + + var taskDescription: String? + + var earliestBeginDate: Date? +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AccessTokenProvider.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AccessTokenProvider.swift index e02410e9c..6d1ce8de9 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AccessTokenProvider.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AccessTokenProvider.swift @@ -16,6 +16,11 @@ public protocol AccessTokenProvider: Any { /// Wrapper for legacy long-lived access token. public struct LongLivedAccessTokenProvider: AccessTokenProvider { public let accessToken: String + + public init(accessToken: String) { + self.accessToken = accessToken + } + public func refreshAccessTokenIfNecessary(completion: @escaping DropboxOAuthCompletion) { // Complete with empty result, because it doesn't need a refresh. completion(nil) @@ -25,7 +30,11 @@ public struct LongLivedAccessTokenProvider: AccessTokenProvider { /// Wrapper for short-lived token. public class ShortLivedAccessTokenProvider: AccessTokenProvider { public var accessToken: String { - queue.sync { token.accessToken } + var tokenString: String + lock.lock() + tokenString = token.accessToken + lock.unlock() + return tokenString } private let queue = DispatchQueue( @@ -33,6 +42,7 @@ public class ShortLivedAccessTokenProvider: AccessTokenProvider { qos: .userInitiated, attributes: .concurrent ) + private let lock: NSLock = .init() private let tokenRefresher: AccessTokenRefreshing private var token: DropboxAccessToken private var completionBlocks = [(DropboxOAuthResult?) -> Void]() @@ -54,7 +64,7 @@ public class ShortLivedAccessTokenProvider: AccessTokenProvider { /// - Parameters: /// - token: The `DropboxAccessToken` object for a short-lived token. /// - tokenRefresher: Helper object that refreshes a token over network. - init(token: DropboxAccessToken, tokenRefresher: AccessTokenRefreshing) { + public init(token: DropboxAccessToken, tokenRefresher: AccessTokenRefreshing) { self.token = token self.tokenRefresher = tokenRefresher } @@ -81,7 +91,9 @@ public class ShortLivedAccessTokenProvider: AccessTokenProvider { private func handleRefreshResult(_ result: DropboxOAuthResult?) { queue.async(flags: .barrier) { if case let .success(token) = result { + self.lock.lock() self.token = token + self.lock.unlock() } self.completionBlocks.forEach { block in block(result) diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AuthSession.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AuthSession.swift index d48f52ae1..870a5ca29 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AuthSession.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/AuthSession.swift @@ -2,8 +2,8 @@ /// Copyright (c) 2020 Dropbox, Inc. All rights reserved. /// -import Foundation import CommonCrypto +import Foundation // MARK: Public @@ -16,14 +16,14 @@ public struct ScopeRequest { } /// An array of scopes to be granted. - let scopes: [String] + public let scopes: [String] /// Boolean indicating whether to keep all previously granted scopes. - let includeGrantedScopes: Bool + public let includeGrantedScopes: Bool /// Type of the scopes to be granted. - let scopeType: ScopeType + public let scopeType: ScopeType /// String representation of the scopes, used in URL query. Nil if the array is empty. - var scopeString: String? { + public var scopeString: String? { guard !scopes.isEmpty else { return nil } return scopes.joined(separator: " ") } @@ -53,7 +53,7 @@ struct OAuthPKCESession { // PKCE data generated for this auth session. let pkceData: PkceData // A string of colon-delimited options/state - used primarily to indicate if the token type to be returned. - let state: String + private(set) var state: String // Token access type, hardcoded to "offline" to indicate short-lived access token + refresh token. let tokenAccessType = "offline" // Type of the auth response, hardcoded to "code" to indicate code flow. @@ -81,6 +81,12 @@ struct OAuthPKCESession { } } +extension OAuthPKCESession { + mutating func __test_only_setState(value: String) { + state = value + } +} + /// PKCE data for OAuth 2 Authorization Code Flow. struct PkceData { // A random string generated for each code flow. @@ -96,12 +102,12 @@ struct PkceData { private static func randomStringOfLength(_ length: Int) -> String { let alphanumerics = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - return String((0.. String { guard let data = codeVerifier.data(using: .ascii) else { fatalError("Failed to create code challenge.") } - var digest = [UInt8](repeating: 0, count:Int(CC_SHA256_DIGEST_LENGTH)) + var digest = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH)) _ = data.withUnsafeBytes { CC_SHA256($0.baseAddress, UInt32(data.count), &digest) } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuth.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuth.swift index 4414e91f2..30dc3ba53 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuth.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuth.swift @@ -2,12 +2,11 @@ /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// -import SystemConfiguration import Foundation public protocol SharedApplication: AnyObject { func presentErrorMessage(_ message: String, title: String) - func presentErrorMessageWithHandlers(_ message: String, title: String, buttonHandlers: Dictionary Void>) + func presentErrorMessageWithHandlers(_ message: String, title: String, buttonHandlers: [String: () -> Void]) func presentPlatformSpecificAuth(_ authURL: URL) -> Bool func presentAuthChannel(_ authURL: URL, tryIntercept: @escaping ((URL) -> Bool), cancelHandler: @escaping (() -> Void)) func presentExternalApp(_ url: URL) @@ -37,6 +36,7 @@ public protocol AccessTokenRefreshing { /// Protocol for handling loading status during auth flow. /// Implementing class could show custom UX to reflect loading status. +@objc(DBXLoadingStatusDelegate) public protocol LoadingStatusDelegate: AnyObject { // Called when auth flow is loading/waiting for some data. e.g. Waiting for a network request to finish. func showLoading() @@ -47,423 +47,10 @@ public protocol LoadingStatusDelegate: AnyObject { /// Callback block for oauth result. public typealias DropboxOAuthCompletion = (DropboxOAuthResult?) -> Void -/// Manages access token storage and authentication -/// -/// Use the `DropboxOAuthManager` to authenticate users through OAuth2, save access tokens, and retrieve access tokens. -/// -/// @note OAuth flow webviews localize to enviroment locale. -/// -open class DropboxOAuthManager: AccessTokenRefreshing { - public let locale: Locale? - let appKey: String - let redirectURL: URL - let host: String - var urls: Array - /// Session data for OAuth2 code flow with PKCE. - /// nil if we are in the legacy token flow. - var authSession: OAuthPKCESession? - weak var sharedApplication: SharedApplication? - - private var localeIdentifier: String { - return locale?.identifier ?? (Bundle.main.preferredLocalizations.first ?? "en") - } - - // MARK: Shared instance - /// A shared instance of a `DropboxOAuthManager` for convenience - public static var sharedOAuthManager: DropboxOAuthManager! - - // MARK: Functions - public init(appKey: String, host: String) { - self.appKey = appKey - self.redirectURL = URL(string: "db-\(self.appKey)://2/token")! - self.host = host - self.urls = [self.redirectURL] - self.locale = nil; - } - - /// - /// Create an instance - /// parameter appKey: The app key from the developer console that identifies this app. - /// - convenience public init(appKey: String) { - self.init(appKey: appKey, host: "www.dropbox.com") - } - - /// - /// Try to handle a redirect back into the application - /// - /// - parameters: - /// - url: The URL to attempt to handle. - /// - completion: The callback closure to receive auth result. - /// - returns: Whether the redirect URL can be handled. - /// - open func handleRedirectURL(_ url: URL, completion: @escaping DropboxOAuthCompletion) -> Bool { - // check if url is a cancel url - if (url.host == "1" && url.path == "/cancel") || (url.host == "2" && url.path == "/cancel") { - completion(.cancel) - return true - } - if self.canHandleURL(url) { - extractFromUrl(url) { result in - if case let .success(token) = result { - self.storeAccessToken(token) - } - completion(result) - } - return true - } else { - completion(nil) - return false - } - } - - /// - /// Present the OAuth2 authorization request page by presenting a web view controller modally. - /// - /// - parameters: - /// - controller: The controller to present from. - /// - usePKCE: Whether to use OAuth2 code flow with PKCE. Default is false, i.e. use the legacy token flow. - /// - scopeRequest: The ScopeRequest, only used in code flow with PKCE. - open func authorizeFromSharedApplication( - _ sharedApplication: SharedApplication, usePKCE: Bool = false, scopeRequest: ScopeRequest? = nil) { - let cancelHandler: (() -> Void) = { - let cancelUrl = URL(string: "db-\(self.appKey)://2/cancel")! - sharedApplication.presentExternalApp(cancelUrl) - } - - if !Reachability.connectedToNetwork() { - let message = "Try again once you have an internet connection" - let title = "No internet connection" - - let buttonHandlers: [String: () -> Void] = [ - "Cancel": { cancelHandler() }, - "Retry": { self.authorizeFromSharedApplication(sharedApplication, usePKCE: usePKCE, scopeRequest: scopeRequest) }, - ] - sharedApplication.presentErrorMessageWithHandlers(message, title: title, buttonHandlers: buttonHandlers) - - return - } - - if !self.conformsToAppScheme() { - let message = "DropboxSDK: unable to link; app isn't registered for correct URL scheme (db-\(self.appKey)). Add this scheme to your project Info.plist file, under \"URL types\" > \"URL Schemes\"." - let title = "SwiftyDropbox Error" - - sharedApplication.presentErrorMessage(message, title:title) - - return - } - - if usePKCE { - authSession = OAuthPKCESession(scopeRequest: scopeRequest) - } else { - authSession = nil - } - self.sharedApplication = sharedApplication - - let url = self.authURL() - - if checkAndPresentPlatformSpecificAuth(sharedApplication) { - return - } - - let tryIntercept: ((URL) -> Bool) = { url in - if self.canHandleURL(url) { - sharedApplication.presentExternalApp(url) - return true - } else { - return false - } - } - sharedApplication.presentAuthChannel(url, tryIntercept: tryIntercept, cancelHandler: cancelHandler) - } - - fileprivate func conformsToAppScheme() -> Bool { - let appScheme = "db-\(self.appKey)" - - let urlTypes = Bundle.main.object(forInfoDictionaryKey: "CFBundleURLTypes") as? [ [String: AnyObject] ] ?? [] - - for urlType in urlTypes { - let schemes = urlType["CFBundleURLSchemes"] as? [String] ?? [] - for scheme in schemes { - if scheme == appScheme { - return true - } - } - } - return false - } - - func authURL() -> URL { - var components = URLComponents() - components.scheme = "https" - components.host = host - components.path = "/oauth2/authorize" - - var params = [ - URLQueryItem(name: "client_id", value: appKey), - URLQueryItem(name: "redirect_uri", value: redirectURL.absoluteString), - URLQueryItem(name: "disable_signup", value: "true"), - URLQueryItem(name: "locale", value: localeIdentifier), - ] - - if let authSession = authSession { - // Code flow. - params.append(contentsOf: OAuthUtils.createPkceCodeFlowParams(for: authSession)) - } else { - // Token flow. - params.append(URLQueryItem(name: OAuthConstants.responseTypeKey, value: "token")) - } - // used to prevent malicious impersonation of app from web browser - let state = ProcessInfo.processInfo.globallyUniqueString - UserDefaults.standard.setValue(state, forKey: Constants.kCSRFKey) - params.append(URLQueryItem(name: OAuthConstants.stateKey, value: state)) - - components.queryItems = params - guard let url = components.url else { fatalError("Failed to create auth url.") } - return url - } - - fileprivate func canHandleURL(_ url: URL) -> Bool { - for known in self.urls { - if url.scheme == known.scheme && url.host == known.host && url.path == known.path { - return true - } - } - return false - } - - /// Handles redirect URL from web. - /// Auth results are passed back in URL query parameters. - /// - Error result parameters looks like this: - /// ``` - /// [ - /// "error": "", - /// "error_description: "" - /// ] - /// ``` - /// - Success result looks like these: - /// 1. Code flow result - /// ``` - /// [ - /// "state": "", - /// "code": "" - /// ] - /// ``` - /// 2. Token flow result - /// ``` - /// [ - /// "state": "", - /// "access_token": "", - /// "uid": "" - /// ] - /// ``` - func extractFromRedirectURL(_ url: URL, completion: @escaping DropboxOAuthCompletion) { - let parametersMap: [String: String] - let isInOAuthCodeFlow = authSession != nil - if isInOAuthCodeFlow { - parametersMap = OAuthUtils.extractOAuthResponseFromCodeFlowUrl(url) - } else { - parametersMap = OAuthUtils.extractOAuthResponseFromTokenFlowUrl(url) - } - // Error case - if let error = parametersMap[OAuthConstants.errorKey] { - let result: DropboxOAuthResult - if error == OAuth2Error.accessDenied.rawValue { - // Treat as cancelled if user denied auth. - result = .cancel - } else { - let description = parametersMap[OAuthConstants.errorDescription] - result = .error(OAuth2Error(errorCode: error), description) - } - completion(result) - } else { - // Success case - let state = parametersMap[OAuthConstants.stateKey] - let storedState = UserDefaults.standard.string(forKey: Constants.kCSRFKey) - - // State from redirect URL should match stored state. - guard state != nil, storedState != nil, state == storedState else { - completion(.error( - OAuth2Error(errorCode: "inconsistent_state"), "Auth flow failed because of inconsistent state.") - ) - return - } - // Reset state upon success - UserDefaults.standard.setValue(nil, forKey: Constants.kCSRFKey) - - if let authSession = authSession, let authCode = parametersMap["code"] { - // Code flow. - finishPkceOAuth( - authCode: authCode, codeVerifier: authSession.pkceData.codeVerifier, completion: completion - ) - } else if let accessToken = parametersMap["access_token"], let uid = parametersMap[OAuthConstants.uidKey] { - // Token flow. - completion(.success(DropboxAccessToken(accessToken: accessToken, uid: uid))) - } else { - completion(.error(.unknown, "Invalid response.")) - } - } - } - - func extractFromUrl(_ url: URL, completion: @escaping DropboxOAuthCompletion) { - return extractFromRedirectURL(url, completion: completion) - } - - func finishPkceOAuth(authCode: String, codeVerifier: String, completion: @escaping DropboxOAuthCompletion) { - sharedApplication?.presentLoading() - let request = OAuthTokenExchangeRequest( - oauthCode: authCode, codeVerifier: codeVerifier, - appKey: appKey, locale: localeIdentifier, redirectUri: redirectURL.absoluteString - ) - request.start(queue: DispatchQueue.main) { [weak sharedApplication] in - sharedApplication?.dismissLoading() - completion($0) - } - } - - func checkAndPresentPlatformSpecificAuth(_ sharedApplication: SharedApplication) -> Bool { - return false - } - - /// - /// Retrieve all stored access tokens - /// - /// - returns: a dictionary mapping users to their access tokens - /// - open func getAllAccessTokens() -> [String : DropboxAccessToken] { - let users = Keychain.getAll() - var ret = [String : DropboxAccessToken]() - for user in users { - if let accessToken = Keychain.get(user) { - ret[user] = accessToken - } - } - return ret - } - - /// - /// Check if there are any stored access tokens - /// - /// - returns: Whether there are stored access tokens - /// - open func hasStoredAccessTokens() -> Bool { - return self.getAllAccessTokens().count != 0 - } - - /// - /// Retrieve the access token for a particular user - /// - /// - parameter user: The user whose token to retrieve - /// - /// - returns: An access token if present, otherwise `nil`. - /// - open func getAccessToken(_ user: String?) -> DropboxAccessToken? { - if let user = user { - return Keychain.get(user) - } - return nil - } - - /// - /// Delete a specific access token - /// - /// - parameter token: The access token to delete - /// - /// - returns: whether the operation succeeded - /// - open func clearStoredAccessToken(_ token: DropboxAccessToken) -> Bool { - return Keychain.delete(token.uid) - } - - /// - /// Delete all stored access tokens - /// - /// - returns: whether the operation succeeded - /// - open func clearStoredAccessTokens() -> Bool { - return Keychain.clear() - } - - /// - /// Save an access token - /// - /// - parameter token: The access token to save - /// - /// - returns: whether the operation succeeded - /// - @discardableResult - open func storeAccessToken(_ token: DropboxAccessToken) -> Bool { - do { - let jsonEncoder = JSONEncoder() - let data = try jsonEncoder.encode(token) - return Keychain.set(token.uid, value: data) - } catch { - return false - } - } - - /// - /// Utility function to return an arbitrary access token - /// - /// - returns: the "first" access token found, if any (otherwise `nil`) - /// - open func getFirstAccessToken() -> DropboxAccessToken? { - return self.getAllAccessTokens().values.first - } - - // MARK: Short-lived token support. - - /// Refreshes a (short-lived) access token for a given DropboxAccessToken. - /// - /// - Parameters: - /// - accessToken: A `DropboxAccessToken` object. - /// - scopes: An array of scopes to be granted for the refreshed access token. - /// The requested scope MUST NOT include any scope not originally granted. - /// Useful if users want to reduce the granted scopes for the new access token. - /// Pass in an empty array if you don't want to change scopes of the access token. - /// - queue: The queue where completion block will be called from. - /// - completion: A `DropboxOAuthCompletion` block to notify caller the result. - /// - /// - NOTE: Completion block will be called on main queue if a callback queue is not provided. - public func refreshAccessToken( - _ accessToken: DropboxAccessToken, - scopes: [String], - queue: DispatchQueue?, - completion: @escaping DropboxOAuthCompletion - ) { - guard let refreshToken = accessToken.refreshToken else { - completion(.error(.unknown, "Long-lived token can't be refreshed.")) - return - } - let uid = accessToken.uid - let refreshRequest = OAuthTokenRefreshRequest( - uid: uid, refreshToken: refreshToken, scopes: scopes, appKey: appKey, locale: localeIdentifier - ) - refreshRequest.start(queue: DispatchQueue.main) { [weak self] result in - if case let .success(token) = result { - self?.storeAccessToken(token) - } - (queue ?? DispatchQueue.main).async { completion(result) } - } - } - - /// Creates an `AccessTokenProvider` that wraps short-lived for token refresh - /// or a static provider for long-live token. - /// - Parameter token: The `DropboxAccessToken` object. - func accessTokenProviderForToken(_ token: DropboxAccessToken) -> AccessTokenProvider { - if token.isShortLivedToken { - return ShortLivedAccessTokenProvider(token: token, tokenRefresher: self) - } else { - return LongLivedAccessTokenProvider(accessToken: token.accessToken) - } - } -} - // MARK: - DropboxAccessToken /// A Dropbox access token -open class DropboxAccessToken: CustomStringConvertible, Codable { - +public class DropboxAccessToken: CustomStringConvertible, Codable { /// The access token string. public let accessToken: String @@ -498,8 +85,17 @@ open class DropboxAccessToken: CustomStringConvertible, Codable { self.tokenExpirationTimestamp = tokenExpirationTimestamp } - open var description: String { - return self.accessToken + public var description: String { + accessToken + } +} + +extension DropboxAccessToken: Equatable { + public static func == (lhs: DropboxAccessToken, rhs: DropboxAccessToken) -> Bool { + lhs.accessToken == rhs.accessToken + && lhs.uid == rhs.uid + && lhs.refreshToken == rhs.refreshToken + && lhs.tokenExpirationTimestamp == rhs.tokenExpirationTimestamp } } @@ -550,11 +146,11 @@ public enum OAuth2Error: String, Error { /// Initializes an error code from the string specced in RFC6749 init(errorCode: String) { - self = Self.init(rawValue: errorCode) ?? .unknown + self = Self(rawValue: errorCode) ?? .unknown } /// Indicates whether the error is invalid_grant error. - var isInvalidGrantError: Bool { + public var isInvalidGrantError: Bool { if case .invalidGrant = self { return true } else { @@ -566,7 +162,7 @@ public enum OAuth2Error: String, Error { internal let kDBLinkNonce = "dropbox.sync.nonce" /// The result of an authorization attempt. -public enum DropboxOAuthResult { +public enum DropboxOAuthResult: Equatable { /// The authorization succeeded. Includes a `DropboxAccessToken`. case success(DropboxAccessToken) @@ -576,150 +172,3 @@ public enum DropboxOAuthResult { /// The authorization was manually canceled by the user. case cancel } - -// MARK: - Keychain - -class Keychain { - static let checkAccessibilityMigrationOneTime: () = { - Keychain.checkAccessibilityMigration() - }() - - class func queryWithDict(_ query: [String : AnyObject]) -> CFDictionary { - let bundleId = Bundle.main.bundleIdentifier ?? "" - var queryDict = query - - queryDict[kSecClass as String] = kSecClassGenericPassword - queryDict[kSecAttrService as String] = "\(bundleId).dropbox.authv2" as AnyObject? - queryDict[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly - - return queryDict as CFDictionary - } - - class func set(_ key: String, value: String) -> Bool { - if let data = value.data(using: String.Encoding.utf8) { - return set(key, value: data) - } else { - return false - } - } - - class func set(_ key: String, value: Data) -> Bool { - let query = Keychain.queryWithDict([ - (kSecAttrAccount as String): key as AnyObject, - ( kSecValueData as String): value as AnyObject - ]) - - SecItemDelete(query) - - return SecItemAdd(query, nil) == noErr - } - - class func getAsData(_ key: String) -> Data? { - let query = Keychain.queryWithDict([ - (kSecAttrAccount as String): key as AnyObject, - ( kSecReturnData as String): kCFBooleanTrue, - ( kSecMatchLimit as String): kSecMatchLimitOne - ]) - - var dataResult: AnyObject? - let status = SecItemCopyMatching(query as CFDictionary, &dataResult) - - if status == noErr { - return dataResult as? Data - } - - return nil - } - - class func getAll() -> [String] { - let query = Keychain.queryWithDict([ - ( kSecReturnAttributes as String): kCFBooleanTrue, - ( kSecMatchLimit as String): kSecMatchLimitAll - ]) - - var dataResult: AnyObject? - let status = SecItemCopyMatching(query as CFDictionary, &dataResult) - - if status == noErr { - let results = dataResult as? [[String : AnyObject]] ?? [] - return results.map { d in d["acct"] as! String } - - } - return [] - } - - class func get(_ key: String) -> DropboxAccessToken? { - if let data = getAsData(key) { - do { - let jsonDecoder = JSONDecoder() - return try jsonDecoder.decode(DropboxAccessToken.self, from: data) - } catch { - // The token might be stored as a string by a previous version of SDK. - if let accessTokenString = String(data: data, encoding: .utf8) { - return DropboxAccessToken(accessToken: accessTokenString, uid: key) - } else { - return nil - } - } - } else { - return nil - } - } - - class func delete(_ key: String) -> Bool { - let query = Keychain.queryWithDict([ - (kSecAttrAccount as String): key as AnyObject - ]) - - return SecItemDelete(query) == noErr - } - - class func clear() -> Bool { - let query = Keychain.queryWithDict([:]) - return SecItemDelete(query) == noErr - } - - class func checkAccessibilityMigration() { - let kAccessibilityMigrationOccurredKey = "KeychainAccessibilityMigration" - let MigrationOccurred = UserDefaults.standard.string(forKey: kAccessibilityMigrationOccurredKey) - - if (MigrationOccurred != "true") { - let bundleId = Bundle.main.bundleIdentifier ?? "" - let queryDict = [kSecClass as String: kSecClassGenericPassword, kSecAttrService as String: "\(bundleId).dropbox.authv2" as AnyObject?] - let attributesToUpdateDict = [kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly] - SecItemUpdate(queryDict as CFDictionary, attributesToUpdateDict as CFDictionary) - UserDefaults.standard.set("true", forKey: kAccessibilityMigrationOccurredKey) - } - } -} - -class Reachability { - /// From http://stackoverflow.com/questions/25623272/how-to-use-scnetworkreachability-in-swift/25623647#25623647. - /// - /// This method uses `SCNetworkReachabilityCreateWithAddress` to create a reference to monitor the example host - /// defined by our zeroed `zeroAddress` struct. From this reference, we can extract status flags regarding the - /// reachability of this host, using `SCNetworkReachabilityGetFlags`. - - class func connectedToNetwork() -> Bool { - var zeroAddress = sockaddr_in() - zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress)) - zeroAddress.sin_family = sa_family_t(AF_INET) - - guard let defaultRouteReachability = withUnsafePointer(to: &zeroAddress, { - $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { - SCNetworkReachabilityCreateWithAddress(nil, $0) - } - }) else { - return false - } - - var flags: SCNetworkReachabilityFlags = [] - if !SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) { - return false - } - - let isReachable = flags.contains(.reachable) - let needsConnection = flags.contains(.connectionRequired) - return (isReachable && !needsConnection) - } -} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthImpl.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthImpl.swift new file mode 100644 index 000000000..7b84ab484 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthImpl.swift @@ -0,0 +1,459 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +/// Manages access token storage and authentication +/// +/// Use the `DropboxOAuthManager` to authenticate users through OAuth2, save access tokens, and retrieve access tokens. +/// +/// @note OAuth flow webviews localize to enviroment locale. +/// +public class DropboxOAuthManager: AccessTokenRefreshing { + public let locale: Locale? + let appKey: String + let redirectURL: URL + let host: String + var urls: [URL] + /// Session data for OAuth2 code flow with PKCE. + /// nil if we are in the legacy token flow. + var authSession: OAuthPKCESession? + weak var sharedApplication: SharedApplication? + + private var connectedToNetwork: () -> Bool = { Reachability.connectedToNetwork() } + private var bundleURLTypes: [[String: AnyObject]] + + private var localeIdentifier: String { + locale?.identifier ?? (Bundle.main.preferredLocalizations.first ?? "en") + } + + // MARK: Shared instance + + /// A shared instance of a `DropboxOAuthManager` for convenience + public static var sharedOAuthManager: DropboxOAuthManager! + + private let networkSession: NetworkSession + private let secureStorageAccess: SecureStorageAccess + + // MARK: Functions + + init( + appKey: String, + host: String, + secureStorageAccess: SecureStorageAccess, + networkSession: NetworkSession + ) { + self.appKey = appKey + self.redirectURL = URL(string: "db-\(self.appKey)://2/token")! + self.host = host + self.urls = [redirectURL] + self.locale = nil + self.secureStorageAccess = secureStorageAccess + self.networkSession = networkSession + self.bundleURLTypes = Bundle.main.object(forInfoDictionaryKey: "CFBundleURLTypes") as? [[String: AnyObject]] ?? [] + } + + public convenience init( + appKey: String, + host: String, + secureStorageAccess: SecureStorageAccess + ) { + self.init(appKey: appKey, host: host, secureStorageAccess: secureStorageAccess, networkSession: URLSession(configuration: .default)) + } + + /// + /// Create an instance + /// parameter appKey: The app key from the developer console that identifies this app. + /// + public convenience init(appKey: String, secureStorageAccess: SecureStorageAccess) { + self.init(appKey: appKey, host: "www.dropbox.com", secureStorageAccess: secureStorageAccess) + } + + /// + /// Try to handle a redirect back into the application + /// + /// - parameters: + /// - url: The URL to attempt to handle. + /// - completion: The callback closure to receive auth result. + /// - returns: Whether the redirect URL can be handled. + /// + public func handleRedirectURL(_ url: URL, completion: @escaping DropboxOAuthCompletion) -> Bool { + // check if url is a cancel url + if (url.host == "1" && url.path == "/cancel") || (url.host == "2" && url.path == "/cancel") { + completion(.cancel) + return true + } + if canHandleURL(url) { + extractFromUrl(url) { result in + if case let .success(token) = result { + self.storeAccessToken(token) + } + completion(result) + } + return true + } else { + completion(nil) + return false + } + } + + /// + /// Present the OAuth2 authorization request page by presenting a web view controller modally. + /// + /// - parameters: + /// - controller: The controller to present from. + /// - usePKCE: Whether to use OAuth2 code flow with PKCE. Default is false, i.e. use the legacy token flow. + /// - scopeRequest: The ScopeRequest, only used in code flow with PKCE. + public func authorizeFromSharedApplication( + _ sharedApplication: SharedApplication, usePKCE: Bool = false, scopeRequest: ScopeRequest? = nil + ) { + let cancelHandler: (() -> Void) = { + let cancelUrl = URL(string: "db-\(self.appKey)://2/cancel")! + sharedApplication.presentExternalApp(cancelUrl) + } + + if !connectedToNetwork() { + let message = "Try again once you have an internet connection" + let title = "No internet connection" + + let buttonHandlers: [String: () -> Void] = [ + "Cancel": { cancelHandler() }, + "Retry": { self.authorizeFromSharedApplication(sharedApplication, usePKCE: usePKCE, scopeRequest: scopeRequest) }, + ] + sharedApplication.presentErrorMessageWithHandlers(message, title: title, buttonHandlers: buttonHandlers) + + return + } + + if !conformsToAppScheme() { + let message = + "DropboxSDK: unable to link; app isn't registered for correct URL scheme (db-\(appKey)). Add this scheme to your project Info.plist file, under \"URL types\" > \"URL Schemes\"." + let title = "SwiftyDropbox Error" + + sharedApplication.presentErrorMessage(message, title: title) + + return + } + + if usePKCE { + authSession = OAuthPKCESession(scopeRequest: scopeRequest) + } else { + authSession = nil + } + self.sharedApplication = sharedApplication + + let url = authURL() + + if checkAndPresentPlatformSpecificAuth(sharedApplication) { + return + } + + let tryIntercept: ((URL) -> Bool) = { url in + if self.canHandleURL(url) { + sharedApplication.presentExternalApp(url) + return true + } else { + return false + } + } + sharedApplication.presentAuthChannel(url, tryIntercept: tryIntercept, cancelHandler: cancelHandler) + } + + fileprivate func conformsToAppScheme() -> Bool { + let appScheme = "db-\(appKey)" + + for urlType in bundleURLTypes { + let schemes = urlType["CFBundleURLSchemes"] as? [String] ?? [] + for scheme in schemes { + if scheme == appScheme { + return true + } + } + } + return false + } + + fileprivate func authURL() -> URL { + var components = URLComponents() + components.scheme = "https" + components.host = host + components.path = "/oauth2/authorize" + + var params = [ + URLQueryItem(name: "client_id", value: appKey), + URLQueryItem(name: "redirect_uri", value: redirectURL.absoluteString), + URLQueryItem(name: "disable_signup", value: "true"), + URLQueryItem(name: "locale", value: localeIdentifier), + ] + + if let authSession = authSession { + // Code flow. + params.append(contentsOf: OAuthUtils.createPkceCodeFlowParams(for: authSession)) + } else { + // Token flow. + params.append(URLQueryItem(name: OAuthConstants.responseTypeKey, value: "token")) + } + // used to prevent malicious impersonation of app from web browser + let state = ProcessInfo.processInfo.globallyUniqueString + UserDefaults.standard.setValue(state, forKey: Constants.kCSRFKey) + params.append(URLQueryItem(name: OAuthConstants.stateKey, value: state)) + + components.queryItems = params + guard let url = components.url else { fatalError("Failed to create auth url.") } + return url + } + + fileprivate func canHandleURL(_ url: URL) -> Bool { + for known in urls { + if url.scheme == known.scheme && url.host == known.host && url.path == known.path { + return true + } + } + return false + } + + /// Handles redirect URL from web. + /// Auth results are passed back in URL query parameters. + /// - Error result parameters looks like this: + /// ``` + /// [ + /// "error": "", + /// "error_description: "" + /// ] + /// ``` + /// - Success result looks like these: + /// 1. Code flow result + /// ``` + /// [ + /// "state": "", + /// "code": "" + /// ] + /// ``` + /// 2. Token flow result + /// ``` + /// [ + /// "state": "", + /// "access_token": "", + /// "uid": "" + /// ] + /// ``` + func extractFromRedirectURL(_ url: URL, completion: @escaping DropboxOAuthCompletion) { + let parametersMap: [String: String] + let isInOAuthCodeFlow = authSession != nil + if isInOAuthCodeFlow { + parametersMap = OAuthUtils.extractOAuthResponseFromCodeFlowUrl(url) + } else { + parametersMap = OAuthUtils.extractOAuthResponseFromTokenFlowUrl(url) + } + // Error case + if let error = parametersMap[OAuthConstants.errorKey] { + let result: DropboxOAuthResult + if error == OAuth2Error.accessDenied.rawValue { + // Treat as cancelled if user denied auth. + result = .cancel + } else { + let description = parametersMap[OAuthConstants.errorDescription] + result = .error(OAuth2Error(errorCode: error), description) + } + completion(result) + } else { + // Success case + let state = parametersMap[OAuthConstants.stateKey] + let storedState = UserDefaults.standard.string(forKey: Constants.kCSRFKey) + + // State from redirect URL should match stored state. + guard state != nil, storedState != nil, state == storedState else { + completion( + .error( + OAuth2Error(errorCode: "inconsistent_state"), "Auth flow failed because of inconsistent state." + ) + ) + return + } + // Reset state upon success + UserDefaults.standard.setValue(nil, forKey: Constants.kCSRFKey) + + if let authSession = authSession, let authCode = parametersMap["code"] { + // Code flow. + finishPkceOAuth( + authCode: authCode, codeVerifier: authSession.pkceData.codeVerifier, completion: completion + ) + } else if let accessToken = parametersMap["access_token"], let uid = parametersMap[OAuthConstants.uidKey] { + // Token flow. + completion(.success(DropboxAccessToken(accessToken: accessToken, uid: uid))) + } else { + completion(.error(.unknown, "Invalid response.")) + } + } + } + + func extractFromUrl(_ url: URL, completion: @escaping DropboxOAuthCompletion) { + extractFromRedirectURL(url, completion: completion) + } + + func finishPkceOAuth(authCode: String, codeVerifier: String, completion: @escaping DropboxOAuthCompletion) { + sharedApplication?.presentLoading() + let request = OAuthTokenExchangeRequest( + dataTaskCreation: networkSession.dataTask(request:networkTaskTag:completionHandler:), + oauthCode: authCode, codeVerifier: codeVerifier, + appKey: appKey, locale: localeIdentifier, redirectUri: redirectURL.absoluteString + ) + request.start(queue: DispatchQueue.main) { [weak sharedApplication] in + sharedApplication?.dismissLoading() + completion($0) + } + } + + func checkAndPresentPlatformSpecificAuth(_ sharedApplication: SharedApplication) -> Bool { + false + } + + /// + /// Retrieve all stored access tokens + /// + /// - returns: a dictionary mapping users to their access tokens + /// + public func getAllAccessTokens() -> [String: DropboxAccessToken] { + let users = secureStorageAccess.getAllUserIds() + var ret = [String: DropboxAccessToken]() + for user in users { + if let accessToken = secureStorageAccess.getDropboxAccessToken(for: user) { + ret[user] = accessToken + } + } + return ret + } + + /// + /// Check if there are any stored access tokens + /// + /// - returns: Whether there are stored access tokens + /// + public func hasStoredAccessTokens() -> Bool { + getAllAccessTokens().count != 0 + } + + /// + /// Retrieve the access token for a particular user + /// + /// - parameter user: The user whose token to retrieve + /// + /// - returns: An access token if present, otherwise `nil`. + /// + public func getAccessToken(_ user: String?) -> DropboxAccessToken? { + if let user = user { + return secureStorageAccess.getDropboxAccessToken(for: user) + } + return nil + } + + /// + /// Delete a specific access token + /// + /// - parameter token: The access token to delete + /// + /// - returns: whether the operation succeeded + /// + public func clearStoredAccessToken(_ token: DropboxAccessToken) -> Bool { + secureStorageAccess.deleteInfo(for: token.uid) + } + + /// + /// Delete all stored access tokens + /// + /// - returns: whether the operation succeeded + /// + public func clearStoredAccessTokens() -> Bool { + secureStorageAccess.deleteInfoForAllKeys() + } + + /// + /// Save an access token + /// + /// - parameter token: The access token to save + /// + /// - returns: whether the operation succeeded + /// + @discardableResult + public func storeAccessToken(_ token: DropboxAccessToken) -> Bool { + do { + let jsonEncoder = JSONEncoder() + let data = try jsonEncoder.encode(token) + return secureStorageAccess.setAccessTokenData(for: token.uid, data: data) + } catch { + return false + } + } + + /// + /// Utility function to return an arbitrary access token + /// + /// - returns: the "first" access token found, if any (otherwise `nil`) + /// + public func getFirstAccessToken() -> DropboxAccessToken? { + getAllAccessTokens().values.first + } + + // MARK: Short-lived token support. + + /// Refreshes a (short-lived) access token for a given DropboxAccessToken. + /// + /// - Parameters: + /// - accessToken: A `DropboxAccessToken` object. + /// - scopes: An array of scopes to be granted for the refreshed access token. + /// The requested scope MUST NOT include any scope not originally granted. + /// Useful if users want to reduce the granted scopes for the new access token. + /// Pass in an empty array if you don't want to change scopes of the access token. + /// - queue: The queue where completion block will be called from. + /// - completion: A `DropboxOAuthCompletion` block to notify caller the result. + /// + /// - NOTE: Completion block will be called on main queue if a callback queue is not provided. + public func refreshAccessToken( + _ accessToken: DropboxAccessToken, + scopes: [String], + queue: DispatchQueue?, + completion: @escaping DropboxOAuthCompletion + ) { + guard let refreshToken = accessToken.refreshToken else { + completion(.error(.unknown, "Long-lived token can't be refreshed.")) + return + } + let uid = accessToken.uid + let refreshRequest = OAuthTokenRefreshRequest( + dataTaskCreation: networkSession.dataTask(request:networkTaskTag:completionHandler:), + uid: uid, refreshToken: refreshToken, scopes: scopes, appKey: appKey, locale: localeIdentifier + ) + refreshRequest.start(queue: DispatchQueue.main) { [weak self] result in + if case let .success(token) = result { + self?.storeAccessToken(token) + } + (queue ?? DispatchQueue.main).async { completion(result) } + } + } + + /// Creates an `AccessTokenProvider` that wraps short-lived for token refresh + /// or a static provider for long-live token. + /// - Parameter token: The `DropboxAccessToken` object. + public func accessTokenProviderForToken(_ token: DropboxAccessToken) -> AccessTokenProvider { + if token.isShortLivedToken { + return ShortLivedAccessTokenProvider(token: token, tokenRefresher: self) + } else { + return LongLivedAccessTokenProvider(accessToken: token.accessToken) + } + } + + func checkAccessibilityMigrationOneTime() { + secureStorageAccess.checkAccessibilityMigrationOneTime() + } +} + +extension DropboxOAuthManager { + func __test_only_setConnectedToNetwork(value: Bool) { + connectedToNetwork = { value } + } + + func __test_only_setBundleURLTypes(value: [[String: AnyObject]]) { + bundleURLTypes = value + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthTokenRequest.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthTokenRequest.swift index 4aca39b21..dabf46c8d 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthTokenRequest.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthTokenRequest.swift @@ -3,36 +3,48 @@ /// import Foundation -import Alamofire // MARK: - Authorization Code +typealias NetworkDataTaskCreation = (URLRequest, NetworkTaskTag?, @escaping NetworkDataTaskCompletion) -> NetworkDataTask + /// Request to get an access token with an auth code. /// See [RFC6749 4.1.3](https://tools.ietf.org/html/rfc6749#section-4.1.3) class OAuthTokenExchangeRequest: OAuthTokenRequest { - init(oauthCode: String, codeVerifier: String, appKey: String, locale: String, redirectUri: String) { + private let date: Date + + init( + dataTaskCreation: @escaping NetworkDataTaskCreation, + oauthCode: String, + codeVerifier: String, + appKey: String, + locale: String, + redirectUri: String, + date: Date = Date() + ) { + self.date = date let params = [ "grant_type": "authorization_code", "code": oauthCode, "code_verifier": codeVerifier, "redirect_uri": redirectUri, ] - super.init(appKey: appKey, locale: locale, params: params) + super.init(dataTaskCreation: dataTaskCreation, appKey: appKey, locale: locale, params: params) } /// Handle access token result as per [RFC6749 4.1.4](https://tools.ietf.org/html/rfc6749#section-4.1.4) /// And an additional DBX uid parameter. override func handleResultDict(_ result: Any) -> DropboxAccessToken? { guard let resultDict = result as? [String: Any], - let tokenType = resultDict["token_type"] as? String, - tokenType.caseInsensitiveCompare("bearer") == .orderedSame, - let accessToken = resultDict["access_token"] as? String, - let refreshToken = resultDict["refresh_token"] as? String, - let userId = resultDict["uid"] as? String, - let expiresIn = resultDict["expires_in"] as? TimeInterval else { + let tokenType = resultDict["token_type"] as? String, + tokenType.caseInsensitiveCompare("bearer") == .orderedSame, + let accessToken = resultDict["access_token"] as? String, + let refreshToken = resultDict["refresh_token"] as? String, + let userId = resultDict["uid"] as? String, + let expiresIn = resultDict["expires_in"] as? TimeInterval else { return nil } - let expirationTimestamp = Date().addingTimeInterval(expiresIn).timeIntervalSince1970 + let expirationTimestamp = date.addingTimeInterval(expiresIn).timeIntervalSince1970 return DropboxAccessToken( accessToken: accessToken, uid: userId, refreshToken: refreshToken, tokenExpirationTimestamp: expirationTimestamp @@ -46,18 +58,28 @@ class OAuthTokenExchangeRequest: OAuthTokenRequest { class OAuthTokenRefreshRequest: OAuthTokenRequest { private let uid: String private let refreshToken: String + private let date: Date /// Designated Initializer. - /// + /// /// - Parameters: /// - uid: User id. /// - refreshToken: Refresh token. /// - scopes: An array of scopes to be granted for the refreshed access token. /// - appKey: The API app key. /// - locale: User's preferred locale. - init(uid: String, refreshToken: String, scopes: [String], appKey: String, locale: String) { + init( + dataTaskCreation: @escaping NetworkDataTaskCreation, + uid: String, + refreshToken: String, + scopes: [String], + appKey: String, + locale: String, + date: Date = Date() + ) { self.uid = uid self.refreshToken = refreshToken + self.date = date var params = [ "grant_type": "refresh_token", "refresh_token": refreshToken, @@ -65,19 +87,19 @@ class OAuthTokenRefreshRequest: OAuthTokenRequest { if !scopes.isEmpty { params["scope"] = scopes.joined(separator: " ") } - super.init(appKey: appKey, locale: locale, params: params) + super.init(dataTaskCreation: dataTaskCreation, appKey: appKey, locale: locale, params: params) } /// Handle refresh result as per [RFC6749 5.1](https://tools.ietf.org/html/rfc6749#section-5.1) override func handleResultDict(_ result: Any) -> DropboxAccessToken? { guard let resultDict = result as? [String: Any], - let tokenType = resultDict["token_type"] as? String, - tokenType.caseInsensitiveCompare("bearer") == .orderedSame, - let accessToken = resultDict["access_token"] as? String, - let expiresIn = resultDict["expires_in"] as? TimeInterval else { + let tokenType = resultDict["token_type"] as? String, + tokenType.caseInsensitiveCompare("bearer") == .orderedSame, + let accessToken = resultDict["access_token"] as? String, + let expiresIn = resultDict["expires_in"] as? TimeInterval else { return nil } - let expirationTimestamp = Date().addingTimeInterval(expiresIn).timeIntervalSince1970 + let expirationTimestamp = date.addingTimeInterval(expiresIn).timeIntervalSince1970 return DropboxAccessToken( accessToken: accessToken, uid: uid, refreshToken: refreshToken, tokenExpirationTimestamp: expirationTimestamp @@ -87,39 +109,34 @@ class OAuthTokenRefreshRequest: OAuthTokenRequest { // MARK: - Base Request -extension Dictionary where Key == String, Value == String { - func toHTTPHeaders() -> HTTPHeaders { - var headers: [HTTPHeader] = [] - for (key, value) in self { - let header = HTTPHeader(name: key, value: value) - headers.append(header) - } - return HTTPHeaders(headers) - } -} - /// Makes a network request to `oauth2/token` to get short-lived access token. class OAuthTokenRequest { - private static let sessionManager: Session = { - var sessionManager = Session(configuration: .default, startRequestsImmediately: false) - return sessionManager - }() + let request: URLRequest - private let request: DataRequest + private let dataTaskCreation: NetworkDataTaskCreation + private var task: NetworkDataTask? private var retainSelf: OAuthTokenRequest? - init(appKey: String, locale: String, params: Parameters) { + init(dataTaskCreation: @escaping NetworkDataTaskCreation, appKey: String, locale: String, params: RequestParameters) { + self.dataTaskCreation = dataTaskCreation let commonParams = [ "client_id": appKey, "locale": locale, ] - let allParams = params.merging(commonParams) { (_, commonParam) in commonParam } - let headers = ["User-Agent": ApiClientConstants.defaultUserAgent] - request = Self.sessionManager.request( - "\(ApiClientConstants.apiHost)/oauth2/token", - method: .post, - parameters: allParams, - headers: headers.toHTTPHeaders()) + let allParams = params.merging(commonParams) { _, commonParam in commonParam } + let headers = [ + "User-Agent": ApiClientConstants.defaultUserAgent, + "Content-Type": "application/x-www-form-urlencoded; charset=utf-8", + ] + + let url = URL(string: "\(ApiClientConstants.apiHost)/oauth2/token")! + + var urlRequest = URLRequest(url: url) + urlRequest.httpMethod = "POST" + urlRequest.allHTTPHeaderFields = headers + + urlRequest.httpBody = allParams.asUrlEncodedString()?.data(using: .utf8) + self.request = urlRequest } /// Start request and set the completion handler. @@ -128,31 +145,41 @@ class OAuthTokenRequest { /// - completion: The completion block. func start(queue: DispatchQueue = DispatchQueue.main, completion: @escaping DropboxOAuthCompletion) { retainSelf = self - request.validate().responseJSON { [weak self] response in - let oauthResult: DropboxOAuthResult - switch response.result { - case .success(let result): - if let token = self?.handleResultDict(result) { + var oauthResult: DropboxOAuthResult? + + let task = dataTaskCreation(request, "OAuthTokenRequest") { [weak self] result in + switch result { + case .success((let data, _)): + do { + let json = try JSONSerialization.jsonObject(with: data, options: []) + let token: DropboxAccessToken = try (self?.handleResultDict(json)).orThrow() oauthResult = .success(token) - } else { + } catch { oauthResult = .error(.unknown, "Invalid response.") } - case .failure: - oauthResult = Self.resultFromErrorData(response.data) + case .failure(let error): + switch error { + case .badStatusCode(let data, _, _): + oauthResult = Self.resultFromErrorData(data) + case .failedWithError(let error): + oauthResult = .error(.unknown, "Transport error: \(error.localizedDescription)") + } } + self?.retainSelf = nil queue.async { completion(oauthResult) } } - request.resume() + self.task = task + task.resume() } func cancel() { - request.cancel() + task?.cancel() retainSelf = nil } fileprivate func handleResultDict(_ result: Any) -> DropboxAccessToken? { - assert(false, "Subclasses must implement this method.") + assertionFailure("Subclasses must implement this method.") return nil } @@ -160,7 +187,7 @@ class OAuthTokenRequest { private static func resultFromErrorData(_ data: Data?) -> DropboxOAuthResult { guard let data = data, - let error = (try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves)) as? [String: String], + let error = (try? JSONSerialization.jsonObject(with: data)) as? [String: String], let code = error["error"], let message = error["error_description"] else { diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthUtils.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthUtils.swift index 3a35f0fa1..e51f80897 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthUtils.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthUtils.swift @@ -26,7 +26,6 @@ enum OAuthUtils { return params } - /// Extracts auth response parameters from URL and removes percent encoding. /// Response parameters from DAuth via the Dropbox app are in the query component. static func extractDAuthResponseFromUrl(_ url: URL) -> [String: String] { @@ -43,8 +42,8 @@ enum OAuthUtils { /// Response parameters from OAuth 2 token flow (RFC6749 4.2.2) are in the fragment component. static func extractOAuthResponseFromTokenFlowUrl(_ url: URL) -> [String: String] { guard let urlComponents = URLComponents(string: url.absoluteString), - let responseString = urlComponents.fragment else { - return [:] + let responseString = urlComponents.fragment else { + return [:] } // Create a query only URL string and extract its individual query parameters. return extractQueryParamsFromUrlString("?\(responseString)") @@ -53,7 +52,7 @@ enum OAuthUtils { /// Extracts query parameters from URL and removes percent encoding. private static func extractQueryParamsFromUrlString(_ urlString: String) -> [String: String] { guard let urlComponents = URLComponents(string: urlString), - let queryItems = urlComponents.queryItems else { + let queryItems = urlComponents.queryItems else { return [:] } return queryItems.reduce(into: [String: String]()) { result, queryItem in diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/Reachability.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/Reachability.swift new file mode 100644 index 000000000..cb9f8244a --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/Reachability.swift @@ -0,0 +1,37 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation +import SystemConfiguration + +class Reachability { + /// From http://stackoverflow.com/questions/25623272/how-to-use-scnetworkreachability-in-swift/25623647#25623647. + /// + /// This method uses `SCNetworkReachabilityCreateWithAddress` to create a reference to monitor the example host + /// defined by our zeroed `zeroAddress` struct. From this reference, we can extract status flags regarding the + /// reachability of this host, using `SCNetworkReachabilityGetFlags`. + + class func connectedToNetwork() -> Bool { + var zeroAddress = sockaddr_in() + zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress)) + zeroAddress.sin_family = sa_family_t(AF_INET) + + guard let defaultRouteReachability = withUnsafePointer(to: &zeroAddress, { + $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { + SCNetworkReachabilityCreateWithAddress(nil, $0) + } + }) else { + return false + } + + var flags: SCNetworkReachabilityFlags = [] + if !SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) { + return false + } + + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + return (isReachable && !needsConnection) + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/OAuth/SecureStorageAccess.swift b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/SecureStorageAccess.swift new file mode 100644 index 000000000..a205c87aa --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/OAuth/SecureStorageAccess.swift @@ -0,0 +1,146 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +public protocol SecureStorageAccess { + func checkAccessibilityMigrationOneTime() + func setAccessTokenData(for userId: String, data: Data) -> Bool + func getAllUserIds() -> [String] + func getDropboxAccessToken(for key: String) -> DropboxAccessToken? + func deleteInfo(for key: String) -> Bool + func deleteInfoForAllKeys() -> Bool +} + +public class SecureStorageAccessDefaultImpl: SecureStorageAccess { + private let _checkAccessibilityMigrationOneTime: () = { + checkAccessibilityMigration() + }() + + public init() {} + + public func checkAccessibilityMigrationOneTime() { + _checkAccessibilityMigrationOneTime + } + + public func setAccessTokenData(for userId: String, data: Data) -> Bool { + let query = queryWithDict([ + kSecAttrAccount as String: userId as AnyObject, + kSecValueData as String: data as AnyObject, + ]) + + SecItemDelete(query) + + return SecItemAdd(query, nil) == noErr + } + + public func getAllUserIds() -> [String] { + let query = queryWithDict([ + kSecReturnAttributes as String: kCFBooleanTrue, + kSecMatchLimit as String: kSecMatchLimitAll, + ]) + + var dataResult: AnyObject? + let status = SecItemCopyMatching(query as CFDictionary, &dataResult) + + if status == noErr { + let results = dataResult as? [[String: AnyObject]] ?? [] + return results.map { d in d["acct"] as! String } + } + return [] + } + + public func getDropboxAccessToken(for key: String) -> DropboxAccessToken? { + if let data = getData(for: key) { + do { + let jsonDecoder = JSONDecoder() + return try jsonDecoder.decode(DropboxAccessToken.self, from: data) + } catch { + // The token might be stored as a string by a previous version of SDK. + if let accessTokenString = String(data: data, encoding: .utf8) { + return DropboxAccessToken(accessToken: accessTokenString, uid: key) + } else { + return nil + } + } + } else { + return nil + } + } + + public func deleteInfo(for key: String) -> Bool { + let query = queryWithDict([ + kSecAttrAccount as String: key as AnyObject, + ]) + + return SecItemDelete(query) == noErr + } + + public func deleteInfoForAllKeys() -> Bool { + let query = queryWithDict([:]) + return SecItemDelete(query) == noErr + } + + private static func checkAccessibilityMigration() { + let kAccessibilityMigrationOccurredKey = "KeychainAccessibilityMigration" + let MigrationOccurred = UserDefaults.standard.string(forKey: kAccessibilityMigrationOccurredKey) + + if MigrationOccurred != "true" { + let queryDict = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: "\(appBundleId()).dropbox.authv2" as AnyObject?, + ] + let attributesToUpdateDict = [kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly] + SecItemUpdate(queryDict as CFDictionary, attributesToUpdateDict as CFDictionary) + UserDefaults.standard.set("true", forKey: kAccessibilityMigrationOccurredKey) + } + } + + private func getData(for key: String) -> Data? { + let query = queryWithDict([ + kSecAttrAccount as String: key as AnyObject, + kSecReturnData as String: kCFBooleanTrue, + kSecMatchLimit as String: kSecMatchLimitOne, + ]) + + var dataResult: AnyObject? + let status = SecItemCopyMatching(query as CFDictionary, &dataResult) + + if status == noErr { + return dataResult as? Data + } + + return nil + } + + private func queryWithDict(_ query: [String: AnyObject]) -> CFDictionary { + var queryDict = query + + queryDict[kSecClass as String] = kSecClassGenericPassword + queryDict[kSecAttrService as String] = "\(Self.appBundleId()).dropbox.authv2" as AnyObject? + queryDict[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly + + return queryDict as CFDictionary + } + + static func appBundleId() -> String { + let bundlePath = appBundlePath(from: Bundle.main.bundleURL.path) + let bundle = Bundle(path: bundlePath) + return bundle?.bundleIdentifier ?? "" + } + + /// kSecAttrService cannot differ between binaries using keychain sharing. + /// This finds the true owning bundle in the event that we're running in an app extension. + static func appBundlePath(from bundlePath: String) -> String { + var components = bundlePath.split(separator: "/") + + if let index = components.lastIndex(where: { $0.hasSuffix(".app") }) { + let componentCountAfterDotApp = (components.count - 1) - index + components.removeLast(componentCountAfterDotApp) + return components.joined(separator: "/") + } else { + return "" + } + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/ReconnectionHelpers+Handwritten.swift b/Source/SwiftyDropbox/Shared/Handwritten/ReconnectionHelpers+Handwritten.swift new file mode 100644 index 000000000..7bba2b08f --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/ReconnectionHelpers+Handwritten.swift @@ -0,0 +1,152 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +public enum ReconnectionErrorKind: String, Error { + case noPersistedInfo + case versionMismatch + case badPersistedStringFormat + case missingReconnectionCase + case unknown +} + +public struct ReconnectionError: Error { + public let reconnectionErrorKind: ReconnectionErrorKind + public let taskDescription: String? +} + +protocol PersistedRequestInfoBaseInfo { + var originalSDKVersion: String { get } + var routeName: String { get } + var routeNamespace: String { get } + var clientProvidedInfo: String? { get set } +} + +extension ReconnectionHelpers { + private static let Separator = "#?///?#" + + enum PersistedRequestInfo: Codable, Equatable { + case upload(StandardInfo) + case downloadFile(DownloadFileInfo) + + struct StandardInfo: PersistedRequestInfoBaseInfo, Codable, Equatable { + let originalSDKVersion: String + let routeName: String + let routeNamespace: String + var clientProvidedInfo: String? + } + + struct DownloadFileInfo: PersistedRequestInfoBaseInfo, Codable, Equatable { + let originalSDKVersion: String + let routeName: String + let routeNamespace: String + var clientProvidedInfo: String? + let destination: URL + let overwrite: Bool + } + + func asJsonString() throws -> String { + let jsonData = try JSONEncoder().encode(self) + let jsonString = String(data: jsonData, encoding: .utf8) + + // We encode the SDK Version outside of the JSON so we can condition JSON decoding on a version match + return DropboxClientsManager.sdkVersion + Separator + (try jsonString.orThrow()) + } + + static func from(jsonString: String) throws -> Self { + let components = jsonString.components(separatedBy: Separator) + guard components.count == 2 else { + throw ReconnectionErrorKind.badPersistedStringFormat + } + + let jsonComponent = components[1] + let jsonData = Data(jsonComponent.utf8) + return try JSONDecoder().decode(Self.self, from: jsonData) + } + + var routeName: String { + switch self { + case .upload(let info): + return info.routeName + case .downloadFile(let downloadInfo): + return downloadInfo.routeName + } + } + + var clientProvidedInfo: String? { + switch self { + case .upload(let info): + return info.clientProvidedInfo + case .downloadFile(let downloadInfo): + return downloadInfo.clientProvidedInfo + } + } + + mutating func settingClientInfo(string: String?) -> Self { + switch self { + case .upload(var info): + info.clientProvidedInfo = string + self = .upload(info) + case .downloadFile(var downloadInfo): + downloadInfo.clientProvidedInfo = string + self = .downloadFile(downloadInfo) + } + return self + } + } + + static func persistedRequestInfo(from apiRequest: ApiRequest) throws -> PersistedRequestInfo { + guard let taskDescription = apiRequest.taskDescription else { + throw ReconnectionErrorKind.noPersistedInfo + } + guard try originalSdkVersion(fromJsonString: taskDescription) == DropboxClientsManager.sdkVersion else { + throw ReconnectionErrorKind.versionMismatch + } + + return try PersistedRequestInfo.from(jsonString: taskDescription) + } + + static func originalSdkVersion(fromJsonString jsonString: String) throws -> String { + let components = jsonString.components(separatedBy: Separator) + guard components.count == 2 else { + throw ReconnectionErrorKind.badPersistedStringFormat + } + return components[0] + } + + static func rebuildRequest( + apiRequest: ApiRequest, + info: PersistedRequestInfo, + route: Route, + client: DropboxTransportClientInternal + ) -> UploadRequest { + if case .upload = info { + return client.reconnectRequest( + route, + apiRequest: apiRequest + ) + } else { + fatalError("codegen error, background request not an upload or download file request") + } + } + + static func rebuildRequest( + apiRequest: ApiRequest, + info: PersistedRequestInfo, + route: Route, + client: DropboxTransportClientInternal + ) -> DownloadRequestFile { + if case .downloadFile(let info) = info { + return client.reconnectRequest( + route, + apiRequest: apiRequest, + overwrite: info.overwrite, + destination: info.destination + ) + } else { + fatalError("codegen error, background request not an upload or download file request") + } + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Request+Async.swift b/Source/SwiftyDropbox/Shared/Handwritten/Request+Async.swift new file mode 100644 index 000000000..18e128927 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/Request+Async.swift @@ -0,0 +1,51 @@ +// +// Copyright (c) 2023 Dropbox Inc. All rights reserved. +// + +import Foundation + +public protocol HasRequestResponse { + associatedtype ValueType + associatedtype ESerial: JSONSerializer + + @discardableResult + func response( + queue: DispatchQueue?, + completionHandler: @escaping (ValueType?, CallError?) -> Void + ) -> Self +} + +@available(iOS 13.0, macOS 10.15, *) +extension HasRequestResponse { + /// Async wrapper for retrieving a request's response + /// + /// This could have a better name, but this avoids a collision with the other `response` methods + public func responseResult( + ) async -> Result> { + await withCheckedContinuation { continuation in + self.response(queue: nil) { result, error in + if let result { + continuation.resume(returning: .success(result)) + } else if let error { + continuation.resume(returning: .failure(error)) + } else { + // this should never happen + continuation.resume(returning: .failure(.clientError(.unexpectedState))) + } + } + } + } + + /// Async wrapper for retrieving a request's response + /// + /// Same thing as `responseResult` but using async throws instead of returing a Result + public func response( + ) async throws -> ValueType { + try await responseResult().get() + } +} + +extension RpcRequest: HasRequestResponse {} +extension UploadRequest: HasRequestResponse {} +extension DownloadRequestFile: HasRequestResponse {} +extension DownloadRequestMemory: HasRequestResponse {} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Request+TokenRefresh.swift b/Source/SwiftyDropbox/Shared/Handwritten/Request+TokenRefresh.swift index e29dea5b6..062c996af 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/Request+TokenRefresh.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/Request+TokenRefresh.swift @@ -1,30 +1,47 @@ /// /// Copyright (c) 2020 Dropbox, Inc. All rights reserved. /// - import Foundation -import Alamofire - -typealias DefaultDataResponse = AFDataResponse -typealias DefaultDownloadResponse = AFDownloadResponse /// Completion handler for ApiRequest. enum RequestCompletionHandler { /// Handler for data requests whose results are in memory. - case dataCompletionHandler((DefaultDataResponse) -> Void) + case dataCompletionHandler((NetworkDataTaskResult) -> Void) /// Handler for download request which stores download result into a file. - case downloadFileCompletionHandler((DefaultDownloadResponse) -> Void) + case downloadFileCompletionHandler((NetworkDownloadTaskResult) -> Void) +} + +/// Protocol specifying an entity that can recieve networking info from a NetworkSessionDelegate +protocol NetworkSessionDelegateInfoReceiving { + func handleCompletion(error: ClientError?) + func handleRecieve(data: Data) + func handleDownloadFinished(location: URL) + func handleSentBodyData(totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + func handleWroteDownloadData(totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) } /// Protocol defining an API request object. -protocol ApiRequest { +protocol ApiRequest: NetworkSessionDelegateInfoReceiving, RequestControlling, AnyObject {} + +/// Protocol defining an object that controls a network request +protocol RequestControlling { + /// A unique idenfier for the request + var identifier: Int { get } + + /// A string persisted on the underlying task across sessions + var taskDescription: String? { get set } + + /// The earliest date the underlying task will begin + @available(iOS 13.0, macOS 10.13, *) + var earliestBeginDate: Date? { get set } + /// Sets progress handler for the request. /// /// - Parameter handler: The progress handler. /// /// Progress handler should always be called back on the main queue. @discardableResult - func setProgressHandler(_ handler: @escaping Alamofire.Request.ProgressHandler) -> Self + func setProgressHandler(_ handler: @escaping (Progress) -> Void) -> Self /// Sets a completion handler for the request. /// @@ -39,163 +56,427 @@ protocol ApiRequest { /// Set a block that can be called when the request completes or cancels. func setCleanupHandler(_ handler: @escaping () -> Void) + + /// The underlying network task + var networkTask: NetworkTask? { get } } /// A class that wraps a network request that calls Dropbox API. /// This class will first attempt to refresh the access token and conditionally proceed to the actual API call. class RequestWithTokenRefresh: ApiRequest { - typealias RequestCreationBlock = () -> Alamofire.Request - private var request: Alamofire.Request? - private var cancelled = false - private var responseQueue: DispatchQueue? - private var completionHandler: RequestCompletionHandler? - private var progressHandler: Alamofire.Request.ProgressHandler? - private var cleanupHandler: (() -> Void)? - private let serialQueue = - DispatchQueue(label: "com.dropbox.SwiftyDropbox.RequestWithTokenRefresh.serial.queue", qos: .userInitiated) + class StateAccess { + private var mutableState: MutableState + private var lock = os_unfair_lock() + + init(mutableState: MutableState) { + self.mutableState = mutableState + } + + fileprivate func accessStateWithLock(block: (MutableState) throws -> T) rethrows -> T { + try lock.sync { + try block(mutableState) + } + } + } + + class MutableState { + init() {} + + // MARK: NetworkSessionDelegateInfoReceiving support + + var data: Data = .init() + var progress: Progress? + var temporaryDownloadURL: URL? + var moveDownloadError: Error? + + var response: HTTPURLResponse? { + request?.response as? HTTPURLResponse + } + + var taskIdentifier: Int { + request?.taskIdentifier ?? -1 + } + + var taskDescription: String? { + get { + if let request = request { + return request.taskDescription + } else { + return preRequestTaskDescription + } + } + set { + if let request = request { + request.taskDescription = newValue + } else { + preRequestTaskDescription = newValue + } + } + } + + var preRequestTaskDescription: String? + var preRequestEarliestBeginDate: Date? + + @available(iOS 13.0, macOS 10.13, *) + var earliestBeginDate: Date? { + get { + if let request = request { + return request.earliestBeginDate + } else { + return preRequestEarliestBeginDate + } + } + set { + if let request = request { + request.earliestBeginDate = newValue + } else { + preRequestEarliestBeginDate = newValue + } + } + } + + // MARK: RequestControlling support + + fileprivate var request: NetworkTask? + fileprivate var cancelled = false + fileprivate var isComplete = false + fileprivate var responseQueue: DispatchQueue? + fileprivate var completionHandler: RequestCompletionHandler? + fileprivate var progressHandler: ((Progress) -> Void)? + fileprivate var cleanupHandler: (() -> Void)? + + fileprivate var completionHandlerQueue: DispatchQueue { + responseQueue ?? DispatchQueue.main + } + + func handleRequestCreation() { + request?.taskDescription = preRequestTaskDescription + if #available(iOS 13.0, *) { + request?.earliestBeginDate = preRequestEarliestBeginDate + } + preRequestTaskDescription = nil + preRequestEarliestBeginDate = nil + + __test_only_onRequestCreation?() + } + + // MARK: test helpers + + func __test_only_setOnRequestCreation(block: @escaping () -> Void) { + if request != nil { + block() + } else { + __test_only_onRequestCreation = block + } + } + + var __test_only_onRequestCreation: (() -> Void)? + } - private var completionHandlerQueue: DispatchQueue { - responseQueue ?? DispatchQueue.main + private let stateAccess: StateAccess + private let filesAccess: FilesAccess + + var networkTask: NetworkTask? { + accessStateWithLock { mutableState in + mutableState.request + } + } + + var identifier: Int { + accessStateWithLock { mutableState in + mutableState.taskIdentifier + } + } + + var taskDescription: String? { + get { + accessStateWithLock { mutableState in + mutableState.taskDescription + } + } + set { + accessStateWithLock { mutableState in + mutableState.taskDescription = newValue + } + } + } + + @available(iOS 13.0, macOS 10.13, *) + var earliestBeginDate: Date? { + get { + accessStateWithLock { mutableState in + mutableState.earliestBeginDate + } + } + set { + accessStateWithLock { mutableState in + mutableState.earliestBeginDate = newValue + } + } } /// Designated Initializer. /// /// - Parameters: - /// - requestCreation: The block that creates the actual API request. + /// - request: The actual API request. + /// - onTaskCreation: A block to be executed after token refresh and network task creation. /// - tokenProvider: The `AccessTokenProvider` to perform token refresh. - init(requestCreation: @escaping RequestCreationBlock, tokenProvider: AccessTokenProvider) { - tokenProvider.refreshAccessTokenIfNecessary { result in - self.serialQueue.async { - self.handleTokenRefreshResult(result, requestCreation: requestCreation) + /// - filesAccess: The implementation that reads and moves files on disk. + init(requestCreation: @escaping NetworkTaskCreation, onTaskCreation: @escaping OnTaskCreation, authStrategy: AuthStrategy, filesAccess: FilesAccess) { + let mutableState = MutableState() + self.stateAccess = StateAccess(mutableState: mutableState) + self.filesAccess = filesAccess + + let setTask = { + self.accessStateWithLock { state in + let task = requestCreation() + state.request = task + state.handleRequestCreation() + } + onTaskCreation(self) + } + + switch authStrategy { + case .accessToken(let provider): + provider.refreshAccessTokenIfNecessary { result in + DispatchQueue.global(qos: .userInteractive).async { + setTask() + self.handleTokenRefreshResult(result) + } } + case .appKeyAndSecret: + DispatchQueue.global(qos: .userInteractive).async { + setTask() + self.handleTokenRefreshResult(nil) + } + } + } + + /// Initializer reconnecting background requests. + /// + /// - Parameters: + /// - backgroundRequest: The actual API request. + /// - filesAccess: The implementation that reads and moves files on disk. + init(backgroundRequest: NetworkTask, filesAccess: FilesAccess) { + let mutableState = MutableState() + self.stateAccess = StateAccess(mutableState: mutableState) + stateAccess.accessStateWithLock { state in + state.request = backgroundRequest } + self.filesAccess = filesAccess } func setCompletionHandler(queue: DispatchQueue?, completionHandler: RequestCompletionHandler) -> Self { - serialQueue.async { - self.responseQueue = queue - self.completionHandler = completionHandler + accessStateWithLock { mutableState in + mutableState.responseQueue = queue + if mutableState.isComplete { + call(completionHandler: completionHandler, error: mutableState.request?.clientError, mutableState: mutableState) + } else { + mutableState.completionHandler = completionHandler + } } return self } - func setProgressHandler(_ handler: @escaping Alamofire.Request.ProgressHandler) -> Self { - serialQueue.async { - self.progressHandler = handler - self.setProgressHandlerIfNecessary() + func setProgressHandler(_ handler: @escaping (Progress) -> Void) -> Self { + accessStateWithLock { mutableState in + mutableState.progressHandler = handler } return self } func cancel() { - serialQueue.async { - self.cancelled = true - self.request?.cancel() - self.cleanup() + accessStateWithLock { mutableState in + mutableState.cancelled = true + mutableState.request?.cancel() } + cleanup() } func setCleanupHandler(_ handler: @escaping () -> Void) { - serialQueue.async { - self.cleanupHandler = handler + accessStateWithLock { mutableState in + mutableState.cleanupHandler = handler } } - private func cleanup() { - cleanupHandler?() - cleanupHandler = nil + private func cleanup(mutableState: MutableState? = nil) { + let cleanup: (MutableState) -> Void = { mutableState in + mutableState.cleanupHandler?() + mutableState.cleanupHandler = nil + mutableState.progressHandler = nil + mutableState.completionHandler = nil + } + + if let mutableState = mutableState { + cleanup(mutableState) + } else { + accessStateWithLock { mutableState in + cleanup(mutableState) + } + } } - private func handleTokenRefreshResult(_ result: DropboxOAuthResult?, requestCreation: RequestCreationBlock) { + private func handleTokenRefreshResult(_ result: DropboxOAuthResult?) { if case let .error(oauthError, _) = result, !oauthError.isInvalidGrantError { // Refresh failed, due to an error that's not invalid grant, e.g. A refresh request timed out. // Complete request with error immediately, so developers could retry and get access token refreshed. // Otherwise, the API request may proceed with an expired access token which would lead to // a false positive auth error. - self.completeWithError(.sessionTaskFailed(error: oauthError)) + self.completeWithError(.oauthError(oauthError)) } else { // Refresh succeeded or a refresh is not required, i.e. access token is valid, continue request normally. // Or // Refresh failed due to invalid grant, e.g. refresh token revoked by user. // Continue, and the API call would failed with an auth error that developers can handle properly. // e.g. Sign out the user upon auth error. - self.setRequest(requestCreation()) + accessStateWithLock { mutableState in + if mutableState.cancelled { + mutableState.request?.cancel() + } else { + mutableState.request?.resume() + } + } } } - private func setRequest(_ request: Alamofire.Request) { - self.request = request - setupCompletionHandler() - setProgressHandlerIfNecessary() - if cancelled { - request.cancel() - } else { - request.resume() + private func completeWithError(_ error: ClientError) { + accessStateWithLock { mutableState in + switch mutableState.completionHandler { + case .dataCompletionHandler(let handler): + mutableState.completionHandlerQueue.async { + handler(NetworkDataTaskResult(data: nil, response: nil, error: error)) + } + case .downloadFileCompletionHandler(let handler): + mutableState.completionHandlerQueue.async { + handler(NetworkDownloadTaskResult( + url: nil, + response: nil, + error: error, + errorDataFromLocation: self.filesAccess.errorData(from:) + )) + } + case .none: + break + } } + + cleanup() } - private func setupCompletionHandler() { - if let dataRequest = request as? Alamofire.DataRequest { - let wrappedHandler: (DefaultDataResponse) -> Void = { dataResponse in - if case let .dataCompletionHandler(handler) = self.completionHandler { - self.completionHandlerQueue.async { - handler(dataResponse) - self.cleanup() - } - } else { - self.cleanup() - } + fileprivate func accessStateWithLock(block: (MutableState) throws -> T) rethrows -> T { + try stateAccess.accessStateWithLock { mutableState in + try block(mutableState) + } + } +} + +// MARK: NetworkSessionDelegateInfoReceiving + +extension RequestWithTokenRefresh { + func handleSentBodyData(totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { + accessStateWithLock { mutableState in + handleProgress(mutableState: mutableState, completed: totalBytesSent, total: totalBytesExpectedToSend) + } + } + + func handleWroteDownloadData(totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { + accessStateWithLock { mutableState in + handleProgress(mutableState: mutableState, completed: totalBytesWritten, total: totalBytesExpectedToWrite) + } + } + + private func handleProgress(mutableState: MutableState, completed: Int64, total: Int64) { + if mutableState.progress == nil { + mutableState.progress = Progress(totalUnitCount: total) + } + guard let progress = mutableState.progress else { + return + } + + progress.completedUnitCount = completed + + if let progressHandler = mutableState.progressHandler { + mutableState.completionHandlerQueue.async { + progressHandler(progress) } - dataRequest.validate().response(completionHandler: wrappedHandler) - } else if let downloadRequest = request as? Alamofire.DownloadRequest { - let wrappedHandler: (DefaultDownloadResponse) -> Void = { downloadResponse in - if case let .downloadFileCompletionHandler(handler) = self.completionHandler { - self.completionHandlerQueue.async { - handler(downloadResponse) - self.cleanup() - } - } else { - self.cleanup() - } + } + } + + func handleDownloadFinished(location: URL) { + accessStateWithLock { mutableState in + do { + mutableState.temporaryDownloadURL = try filesAccess.moveFileToTemporaryLocation(from: location) + let logInfo = "\(mutableState.taskIdentifier) \(mutableState.temporaryDownloadURL?.absoluteString ?? "none")" + DropboxClientsManager.logBackgroundSession("handleDownloadFinished successful move \(logInfo)") + } catch { + DropboxClientsManager.logBackgroundSession("handleDownloadFinished move error \(mutableState.taskIdentifier) \(error)") + mutableState.moveDownloadError = error } - downloadRequest.validate().response(completionHandler: wrappedHandler) } } - private func setProgressHandlerIfNecessary() { - guard let progressHandler = progressHandler else { return } - if let uploadRequest = request as? Alamofire.UploadRequest { - uploadRequest.uploadProgress(queue: .main, closure: progressHandler) - } else if let downloadRequest = request as? Alamofire.DownloadRequest { - downloadRequest.downloadProgress(queue: .main, closure: progressHandler) - } else if let dataRequest = request as? Alamofire.DataRequest { - dataRequest.downloadProgress(queue: .main, closure: progressHandler) + func handleCompletion(error: ClientError?) { + accessStateWithLock { mutableState in + mutableState.isComplete = true + + if let completionHandler = mutableState.completionHandler { + DropboxClientsManager.logBackgroundSession("handleCompletion called with handler \(mutableState.taskIdentifier)") + call(completionHandler: completionHandler, error: error, mutableState: mutableState) + } else { + // no-op: wait for completion handler to be set + DropboxClientsManager.logBackgroundSession("handleCompletion called pending handler \(mutableState.taskIdentifier)") + } } } - private func completeWithError(_ error: AFError) { - completionHandlerQueue.async { - switch self.completionHandler { - case .dataCompletionHandler(let handler): - let dataResponse = DefaultDataResponse(request: nil, - response: nil, - data: nil, - metrics: nil, - serializationDuration: 0, - result: .failure(error)) - handler(dataResponse) - case .downloadFileCompletionHandler(let handler): - let downloadResponse = DefaultDownloadResponse(request: nil, - response: nil, - fileURL: nil, - resumeData: nil, - metrics: nil, - serializationDuration: 0, result: .failure( error)) - handler(downloadResponse) - case .none: - break + private func call(completionHandler: RequestCompletionHandler, error: ClientError?, mutableState: MutableState) { + switch completionHandler { + case .dataCompletionHandler(let handler): + let data = mutableState.data + let response = mutableState.response?.copy() as? HTTPURLResponse + + mutableState.completionHandlerQueue.async { + handler(.init( + data: data, + response: response, + error: error + )) + self.cleanup() + } + case .downloadFileCompletionHandler(let handler): + let temporaryDownloadURL = mutableState.temporaryDownloadURL + let response = mutableState.response?.copy() as? HTTPURLResponse + let moveDownloadError: ClientError? = mutableState.moveDownloadError.map { .fileAccessError($0) } + + mutableState.completionHandlerQueue.async { + handler(.init( + url: temporaryDownloadURL, + response: response, + error: error ?? moveDownloadError, + errorDataFromLocation: self.filesAccess.errorData(from:) + )) + self.cleanup() } - self.cleanup() } } + + func handleRecieve(data: Data) { + accessStateWithLock { mutableState in + mutableState.data.append(data) + } + } +} + +// MARK: Test support + +extension RequestWithTokenRefresh { + var __test_only_mutableState: MutableState { + stateAccess.__test_only_mutableState + } +} + +extension RequestWithTokenRefresh.StateAccess { + var __test_only_mutableState: RequestWithTokenRefresh.MutableState { + mutableState + } } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Request.swift b/Source/SwiftyDropbox/Shared/Handwritten/Request.swift new file mode 100644 index 000000000..36db59803 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/Request.swift @@ -0,0 +1,258 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +public enum UploadBody { + case data(Data) + case file(URL) + case stream(InputStream) +} + +/// These objects are constructed by the SDK; users of the SDK do not need to create them manually. +/// +/// Pass in a closure to the `response` method to handle a response or error. +public class Request { + let responseSerializer: RSerial + let errorSerializer: ESerial + + public var clientPersistedString: String? { + persistedRequestInfo?.clientProvidedInfo + } + + @available(iOS 13.0, macOS 10.13, *) + public var earliestBeginDate: Date? { + request.earliestBeginDate + } + + private(set) var request: ApiRequest + fileprivate var persistedRequestInfo: ReconnectionHelpers.PersistedRequestInfo? { + get { + try? ReconnectionHelpers.persistedRequestInfo(from: request) + } + set { + request.taskDescription = try? newValue?.asJsonString() + } + } + + private var selfRetain: AnyObject? + + init(request: ApiRequest, responseSerializer: RSerial, errorSerializer: ESerial) { + self.errorSerializer = errorSerializer + self.responseSerializer = responseSerializer + + self.request = request + self.selfRetain = self + request.setCleanupHandler { [weak self] in + self?.cleanupSelfRetain() + } + } + + @discardableResult + public func persistingString( + string: String? + ) -> Self { + persistedRequestInfo = persistedRequestInfo?.settingClientInfo(string: string) + DropboxClientsManager.logBackgroundSession("persistingString full description: \(request.taskDescription ?? "None")") + return self + } + + @available(iOS 13.0, macOS 10.13, *) + @discardableResult + public func settingEarliestBeginDate( + date: Date? + ) -> Self { + request.earliestBeginDate = date + return self + } + + public func cancel() { + request.cancel() + } + + func handleResponseError(networkTaskFailure: NetworkTaskFailure) -> CallError { + switch networkTaskFailure { + case .badStatusCode(let data, _, let response): + return CallError(response, data: data, errorSerializer: errorSerializer) + + case .failedWithError(let error): + return CallError(clientError: .urlSessionError(error)) + } + } + + private func cleanupSelfRetain() { + selfRetain = nil + } +} + +/// An "rpc-style" request +public class RpcRequest: Request { + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping (RSerial.ValueType?, CallError?) -> Void + ) -> Self { + request.setCompletionHandler(queue: queue, completionHandler: .dataCompletionHandler({ [weak self] response in + guard let strongSelf = self else { + completionHandler(nil, .clientError(.requestObjectDeallocated)) + return + } + switch response { + case .success((let data, _)): + do { + try completionHandler(strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(data)), nil) + } catch { + completionHandler(nil, CallError.serializationError(error)) + } + case .failure(let failure): + completionHandler(nil, strongSelf.handleResponseError(networkTaskFailure: failure)) + } + })) + return self + } +} + +/// An "upload-style" request +public class UploadRequest: Request { + @discardableResult + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + request.setProgressHandler(progressHandler) + return self + } + + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping (RSerial.ValueType?, CallError?) -> Void + ) -> Self { + request.setCompletionHandler(queue: queue, completionHandler: .dataCompletionHandler({ [weak self] response in + guard let strongSelf = self else { + completionHandler(nil, .clientError(.requestObjectDeallocated)) + return + } + switch response { + case .success((let data, _)): + do { + try completionHandler(strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(data)), nil) + } catch { + completionHandler(nil, CallError.serializationError(error)) + } + case .failure(let failure): + completionHandler(nil, strongSelf.handleResponseError(networkTaskFailure: failure)) + } + })) + return self + } +} + +/// A "download-style" request to a file +public class DownloadRequestFile: Request { + let moveToDestination: (URL) throws -> URL + let errorDataFromLocation: (URL) throws -> Data? + + init( + request: ApiRequest, + responseSerializer: RSerial, + errorSerializer: ESerial, + moveToDestination: @escaping (URL) throws -> URL, + errorDataFromLocation: @escaping (URL) throws -> Data? + ) { + self.moveToDestination = moveToDestination + self.errorDataFromLocation = errorDataFromLocation + + super.init(request: request, responseSerializer: responseSerializer, errorSerializer: errorSerializer) + } + + @discardableResult + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + request.setProgressHandler(progressHandler) + return self + } + + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping ((RSerial.ValueType, URL)?, CallError?) -> Void + ) -> Self { + request.setCompletionHandler(queue: queue, completionHandler: .downloadFileCompletionHandler({ [weak self] response in + guard let strongSelf = self else { + completionHandler(nil, .clientError(.requestObjectDeallocated)) + return + } + + switch response { + case .success((let tempLocation, let response)): + var destination: URL + do { + try destination = strongSelf.moveToDestination(tempLocation) + } catch { + return completionHandler(nil, CallError(clientError: .fileAccessError(error))) + } + + do { + let headerFields: [AnyHashable: Any] = response.allHeaderFields + let result = try caseInsensitiveLookup("Dropbox-Api-Result", dictionary: headerFields).orThrow(SerializationError.missingResultHeader) + let resultData = try result.data(using: .utf8, allowLossyConversion: false).orThrow(SerializationError.missingResultData) + + let resultObject = try strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(resultData)) + completionHandler((resultObject, destination), nil) + } catch { + completionHandler(nil, CallError.serializationError(error)) + } + case .failure(let failure): + completionHandler(nil, strongSelf.handleResponseError(networkTaskFailure: failure)) + } + })) + return self + } +} + +/// A "download-style" request to memory +public class DownloadRequestMemory: Request { + @discardableResult + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + request.setProgressHandler(progressHandler) + return self + } + + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping ((RSerial.ValueType, Data)?, CallError?) -> Void + ) -> Self { + request.setCompletionHandler(queue: queue, completionHandler: .dataCompletionHandler({ [weak self] response in + guard let strongSelf = self else { + completionHandler(nil, .clientError(.requestObjectDeallocated)) + return + } + switch response { + case .success((let data, let response)): + do { + let headerFields: [AnyHashable: Any] = response.allHeaderFields + let result = try caseInsensitiveLookup("Dropbox-Api-Result", dictionary: headerFields).orThrow(SerializationError.missingResultHeader) + let resultData = try result.data(using: .utf8, allowLossyConversion: false).orThrow(SerializationError.missingResultData) + + let resultObject = try strongSelf.responseSerializer.deserialize(SerializeUtil.parseJSON(resultData)) + + completionHandler((resultObject, data), nil) + } catch { + completionHandler(nil, CallError.serializationError(error)) + } + case .failure(let failure): + completionHandler(nil, strongSelf.handleResponseError(networkTaskFailure: failure)) + } + })) + return self + } +} + +private func caseInsensitiveLookup(_ lookupKey: String, dictionary: [AnyHashable: Any]) -> String? { + for key in dictionary.keys { + let keyString = key as! String + if keyString.lowercased() == lookupKey.lowercased() { + return dictionary[key] as? String + } + } + return nil +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/RequestMap.swift b/Source/SwiftyDropbox/Shared/Handwritten/RequestMap.swift new file mode 100644 index 000000000..960cb51e3 --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/RequestMap.swift @@ -0,0 +1,105 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +protocol ApiRequestBox { + var value: ApiRequest? { get } + init(value: ApiRequest) +} + +class WeakApiRequestBox: ApiRequestBox { + weak var value: ApiRequest? + required init(value: ApiRequest) { + self.value = value + } +} + +class PendingReconnectionStrongApiRequestBox: ApiRequestBox { + var value: ApiRequest? { + strongValue + } + + var strongValue: ApiRequest + required init(value: ApiRequest) { + self.strongValue = value + } +} + +protocol RequestMap { + func set(request: ApiRequest, taskIdentifier: Int) + func setPendingReconnection(request: ApiRequest, taskIdentifier: Int) + func getRequest(taskIdentifier: Int) -> ApiRequest? + func getAllRequests() -> [ApiRequest] + func getAllPendingReconnectionRequests() -> [ApiRequest] + func weakifyReferencesToReconnectedRequests() + func removeRequest(taskIdentifier: Int) + func removeAllRequests() +} + +class RequestMapImpl: RequestMap { + private var map: [Int: ApiRequestBox] = [:] + private var cleanupThreshold: Int = 250 + + init() {} + + func setPendingReconnection(request: ApiRequest, taskIdentifier: Int) { + map[taskIdentifier] = PendingReconnectionStrongApiRequestBox(value: request) + } + + func set(request: ApiRequest, taskIdentifier: Int) { + map[taskIdentifier] = WeakApiRequestBox(value: request) + + if map.count >= cleanupThreshold { + cleanupEmptyBoxes() + } + } + + func getRequest(taskIdentifier: Int) -> ApiRequest? { + map[taskIdentifier]?.value + } + + func getAllRequests() -> [ApiRequest] { + Array(map.values.compactMap(\.value)) + } + + func getAllPendingReconnectionRequests() -> [ApiRequest] { + let isPending: (ApiRequestBox) -> Bool = { $0 is PendingReconnectionStrongApiRequestBox } + return Array(map.values.filter(isPending).compactMap(\.value)) + } + + func weakifyReferencesToReconnectedRequests() { + map = map.mapValues { box in + if let box = box as? PendingReconnectionStrongApiRequestBox { + return WeakApiRequestBox(value: box.strongValue) + } + return box + } + } + + func cleanupEmptyBoxes() { + map = map.filter { _, box in + if let box = box as? WeakApiRequestBox, box.value == nil { + return false + } + return true + } + } + + func removeRequest(taskIdentifier: Int) { + map[taskIdentifier] = nil + } + + func removeAllRequests() { + map = [:] + } + + func __test_only_setCleanupThreshold(value: Int) { + cleanupThreshold = value + } + + var __test_only_map: [Int: ApiRequestBox] { + map + } +} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/SDKConstants.swift b/Source/SwiftyDropbox/Shared/Handwritten/SDKConstants.swift index daae5f47d..e497d38c0 100644 --- a/Source/SwiftyDropbox/Shared/Handwritten/SDKConstants.swift +++ b/Source/SwiftyDropbox/Shared/Handwritten/SDKConstants.swift @@ -4,7 +4,7 @@ import Foundation -struct Constants { - static let versionSDK = "9.2.0" +public struct Constants { + public static let versionSDK = "10.0.0-beta.3" static let kCSRFKey = "kCSRFKeySwiftSDK" } diff --git a/Source/SwiftyDropbox/Shared/Handwritten/TransportConfig.swift b/Source/SwiftyDropbox/Shared/Handwritten/TransportConfig.swift deleted file mode 100644 index 80cd03432..000000000 --- a/Source/SwiftyDropbox/Shared/Handwritten/TransportConfig.swift +++ /dev/null @@ -1,27 +0,0 @@ -///// -///// Copyright (c) 2016 Dropbox, Inc. All rights reserved. -///// -///// Auto-generated by Stone, do not modify. -///// -// -//import Foundation -// -//class DBTransportBaseConfig { -// var delegateQueue: NSOperationQueue? -// -// var forceForegroundSession = false -// -// var sharedContainerIdentifier: String? -// -// public override init(appKey: String, appSecret: String, userAgent: String, asMemberId: String, delegateQueue: NSOperationQueue, forceForegroundSession: Bool, sharedContainerIdentifier: String) { -// super.init(appKey: appKey, appSecret: appSecret, userAgent: userAgent, asMemberId: asMemberId) -// -// self.userAgent = userAgent -// self.appKey = appKey -// self.appSecret = appSecret -// self.asMemberId = asMemberId -// self.delegateQueue = delegateQueue -// self.sharedContainerIdentifier = sharedContainerIdentifier -// -// } -//} diff --git a/Source/SwiftyDropbox/Shared/Handwritten/Utilities.swift b/Source/SwiftyDropbox/Shared/Handwritten/Utilities.swift new file mode 100644 index 000000000..b71d85eca --- /dev/null +++ b/Source/SwiftyDropbox/Shared/Handwritten/Utilities.swift @@ -0,0 +1,136 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +// MARK: Coding + +enum Utilities { + static func utf8Decode(_ data: Data) -> String { + NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String + } + + static func asciiEscape(_ s: String) -> String { + var out: String = "" + out.reserveCapacity(s.maximumLengthOfBytes(using: .utf16)) + + for char in s.utf16 { + var esc: String + if let unicodeScalar = Unicode.Scalar(char), unicodeScalar.isASCII { + esc = "\(unicodeScalar)" + } else { + esc = String(format: "\\u%04x", char) + } + out += esc + } + return out + } +} + +typealias RequestParameters = [String: String] +extension RequestParameters { + func asUrlEncodedString() -> String? { + var components = URLComponents() + components.queryItems = [] + + let urlString = map { URLQueryItem(name: $0, value: $1) } + .reduce(into: components) { partialResult, nextItem in + partialResult.queryItems?.append(nextItem) + } + .url?.query + + return urlString + } +} + +// MARK: Optionals + +extension Optional { + func orThrow(_ error: @autoclosure () -> Error) throws -> Wrapped { + if let wrapped = self { + return wrapped + } else { + throw error() + } + } + + func orThrow(file: String = #file, line: UInt = #line, function: String = #function) throws -> Wrapped { + try orThrow(DefaultMissingValueError(file: file, line: line, function: function)) + } +} + +class DefaultMissingValueError: Error { + public var description: String + init(file: String, line: UInt, function: String) { + self.description = "file: \(file) line: \(line) function: \(function) unexpectedly found nil" + } +} + +/// Extend `orThrow` to double-optionals +protocol SomeOptional { + associatedtype Wrapped + func orThrow(_ error: @autoclosure () -> Error) throws -> Wrapped + func orThrow(file: String, line: UInt, function: String) throws -> Wrapped +} + +extension Optional: SomeOptional {} + +extension Optional where Wrapped: SomeOptional { + func orThrow(_ error: @autoclosure () -> Error) throws -> Wrapped.Wrapped { + try orThrow(error()).orThrow(error()) + } + + func orThrow(file: String = #file, line: UInt = #line, function: String = #function) throws -> Wrapped.Wrapped { + try orThrow(DefaultMissingValueError(file: file, line: line, function: function)) + } +} + +// MARK: Concurrency + +public extension os_unfair_lock { + mutating func sync(execute: () throws -> T) rethrows -> T { + os_unfair_lock_lock(&self) + defer { os_unfair_lock_unlock(&self) } + return try execute() + } +} + +// MARK: Logging + +public enum LogLevel { + case error + case info + case debug +} + +public typealias LoggingClosure = (LogLevel, String) -> Void + +public enum LogHelper { + /// Adjust this upwards if needed while debugging background sessions. + public static let backgroundSessionLogLevel: LogLevel = .debug + + /// Prepended to all SwiftyDropbox log calls. + static let LogTag = "[SwiftyDropbox]" + + static func log( + _ level: LogLevel = .info, + _ message: String + ) { + DropboxClientsManager.loggingClosure?(level, "\(LogTag) \(message)") + } + + static func logBackgroundSession( + _ message: String + ) { + logBackgroundSession(backgroundSessionLogLevel, message) + } + + /// For logging something background-session related at a different level than backgroundSessionLogLevel, such as .error. + static func logBackgroundSession( + _ level: LogLevel, + _ message: String + ) { + log(backgroundSessionLogLevel, "bg session - \(message)") + } +} diff --git a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.pbxproj b/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.pbxproj deleted file mode 100644 index e4d33d87d..000000000 --- a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.pbxproj +++ /dev/null @@ -1,879 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 52; - objects = { - -/* Begin PBXBuildFile section */ - 8529B7C925FAC97F00F5F6E9 /* Alamofire.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8529B7C825FAC97F00F5F6E9 /* Alamofire.xcframework */; }; - 8529B7CA25FAC97F00F5F6E9 /* Alamofire.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8529B7C825FAC97F00F5F6E9 /* Alamofire.xcframework */; }; - BF082C242464B7C6000C8469 /* AuthSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF082C232464B7C6000C8469 /* AuthSession.swift */; }; - BF082C262464BE7A000C8469 /* OAuthUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF082C252464BE7A000C8469 /* OAuthUtils.swift */; }; - BF082C272464BE7A000C8469 /* OAuthUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF082C252464BE7A000C8469 /* OAuthUtils.swift */; }; - BF082C2A2464C4B7000C8469 /* LoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF082C292464C4B7000C8469 /* LoadingViewController.swift */; }; - BF082C2C246620D2000C8469 /* OAuthConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF082C2B246620D2000C8469 /* OAuthConstants.swift */; }; - BF082C2D246620D5000C8469 /* OAuthConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF082C2B246620D2000C8469 /* OAuthConstants.swift */; }; - BF3A927224DE2DF1000BA354 /* AuthSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF082C232464B7C6000C8469 /* AuthSession.swift */; }; - BF3A927424DE2EB7000BA354 /* OAuthTokenRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3A927324DE2EB7000BA354 /* OAuthTokenRequest.swift */; }; - BF3A927524DE2EB7000BA354 /* OAuthTokenRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3A927324DE2EB7000BA354 /* OAuthTokenRequest.swift */; }; - BF4CC99F247750E50005CADF /* AccessTokenProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF4CC99E247750E50005CADF /* AccessTokenProvider.swift */; }; - BF4CC9A0247750E50005CADF /* AccessTokenProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF4CC99E247750E50005CADF /* AccessTokenProvider.swift */; }; - BF4CC9A2247842250005CADF /* Request+TokenRefresh.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF4CC9A1247842250005CADF /* Request+TokenRefresh.swift */; }; - BF4CC9A3247842250005CADF /* Request+TokenRefresh.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF4CC9A1247842250005CADF /* Request+TokenRefresh.swift */; }; - BFDD66C9250310F7009D9B6D /* ChunkInputStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDD66C8250310F7009D9B6D /* ChunkInputStream.swift */; }; - BFDD66CA250310F7009D9B6D /* ChunkInputStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDD66C8250310F7009D9B6D /* ChunkInputStream.swift */; }; - F2478F201ECCD0B300BAF014 /* Custom.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE21ECCD0B300BAF014 /* Custom.swift */; }; - F2478F211ECCD0B300BAF014 /* Custom.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE21ECCD0B300BAF014 /* Custom.swift */; }; - F2478F221ECCD0B300BAF014 /* CustomRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE31ECCD0B300BAF014 /* CustomRoutes.swift */; }; - F2478F231ECCD0B300BAF014 /* CustomRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE31ECCD0B300BAF014 /* CustomRoutes.swift */; }; - F2478F241ECCD0B300BAF014 /* CustomTasks.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE41ECCD0B300BAF014 /* CustomTasks.swift */; }; - F2478F251ECCD0B300BAF014 /* CustomTasks.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE41ECCD0B300BAF014 /* CustomTasks.swift */; }; - F2478F2A1ECCD0B300BAF014 /* DropboxClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE71ECCD0B300BAF014 /* DropboxClient.swift */; }; - F2478F2B1ECCD0B300BAF014 /* DropboxClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE71ECCD0B300BAF014 /* DropboxClient.swift */; }; - F2478F2C1ECCD0B300BAF014 /* DropboxClientsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE81ECCD0B300BAF014 /* DropboxClientsManager.swift */; }; - F2478F2D1ECCD0B300BAF014 /* DropboxClientsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE81ECCD0B300BAF014 /* DropboxClientsManager.swift */; }; - F2478F2E1ECCD0B300BAF014 /* DropboxTeamClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE91ECCD0B300BAF014 /* DropboxTeamClient.swift */; }; - F2478F2F1ECCD0B300BAF014 /* DropboxTeamClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EE91ECCD0B300BAF014 /* DropboxTeamClient.swift */; }; - F2478F301ECCD0B300BAF014 /* DropboxTransportClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EEA1ECCD0B300BAF014 /* DropboxTransportClient.swift */; }; - F2478F311ECCD0B300BAF014 /* DropboxTransportClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EEA1ECCD0B300BAF014 /* DropboxTransportClient.swift */; }; - F2478F321ECCD0B300BAF014 /* OAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EEB1ECCD0B300BAF014 /* OAuth.swift */; }; - F2478F331ECCD0B300BAF014 /* OAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EEB1ECCD0B300BAF014 /* OAuth.swift */; }; - F2478F361ECCD0B300BAF014 /* TransportConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EED1ECCD0B300BAF014 /* TransportConfig.swift */; }; - F2478F371ECCD0B400BAF014 /* TransportConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478EED1ECCD0B300BAF014 /* TransportConfig.swift */; }; - F2478F391ECCD2FF00BAF014 /* SDKConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478F381ECCD2FF00BAF014 /* SDKConstants.swift */; }; - F2478F3A1ECCD2FF00BAF014 /* SDKConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2478F381ECCD2FF00BAF014 /* SDKConstants.swift */; }; - F265BD0B1E68072500CC38C8 /* OAuthMobile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F265BD091E68072500CC38C8 /* OAuthMobile.swift */; }; - F265BD101E68073A00CC38C8 /* OAuthDesktop.swift in Sources */ = {isa = PBXBuildFile; fileRef = F265BD0E1E68073A00CC38C8 /* OAuthDesktop.swift */; }; - F2C6FD371D89E37500E0DD9E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2C6FD361D89E37500E0DD9E /* Foundation.framework */; }; - F2C6FD391D89E37A00E0DD9E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2C6FD381D89E37A00E0DD9E /* UIKit.framework */; }; - F2C6FD3B1D89E38200E0DD9E /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2C6FD3A1D89E38200E0DD9E /* AppKit.framework */; }; - F2C6FD3D1D89E38800E0DD9E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2C6FD3C1D89E38800E0DD9E /* Foundation.framework */; }; - F925403229C0C4BA00AD93B7 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400C29C0C4BA00AD93B7 /* Base.swift */; }; - F925403329C0C4BA00AD93B7 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400C29C0C4BA00AD93B7 /* Base.swift */; }; - F925403429C0C4BA00AD93B7 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400D29C0C4BA00AD93B7 /* Async.swift */; }; - F925403529C0C4BA00AD93B7 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400D29C0C4BA00AD93B7 /* Async.swift */; }; - F925403629C0C4BA00AD93B7 /* CheckRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400E29C0C4BA00AD93B7 /* CheckRoutes.swift */; }; - F925403729C0C4BA00AD93B7 /* CheckRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400E29C0C4BA00AD93B7 /* CheckRoutes.swift */; }; - F925403829C0C4BA00AD93B7 /* ContactsRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400F29C0C4BA00AD93B7 /* ContactsRoutes.swift */; }; - F925403929C0C4BA00AD93B7 /* ContactsRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925400F29C0C4BA00AD93B7 /* ContactsRoutes.swift */; }; - F925403A29C0C4BA00AD93B7 /* FileProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401029C0C4BA00AD93B7 /* FileProperties.swift */; }; - F925403B29C0C4BA00AD93B7 /* FileProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401029C0C4BA00AD93B7 /* FileProperties.swift */; }; - F925403C29C0C4BA00AD93B7 /* OpenidRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401129C0C4BA00AD93B7 /* OpenidRoutes.swift */; }; - F925403D29C0C4BA00AD93B7 /* OpenidRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401129C0C4BA00AD93B7 /* OpenidRoutes.swift */; }; - F925403E29C0C4BA00AD93B7 /* Openid.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401229C0C4BA00AD93B7 /* Openid.swift */; }; - F925403F29C0C4BA00AD93B7 /* Openid.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401229C0C4BA00AD93B7 /* Openid.swift */; }; - F925404029C0C4BA00AD93B7 /* StoneBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401329C0C4BA00AD93B7 /* StoneBase.swift */; }; - F925404129C0C4BA00AD93B7 /* StoneBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401329C0C4BA00AD93B7 /* StoneBase.swift */; }; - F925404229C0C4BA00AD93B7 /* StoneSerializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401429C0C4BA00AD93B7 /* StoneSerializers.swift */; }; - F925404329C0C4BA00AD93B7 /* StoneSerializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401429C0C4BA00AD93B7 /* StoneSerializers.swift */; }; - F925404429C0C4BA00AD93B7 /* Files.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401529C0C4BA00AD93B7 /* Files.swift */; }; - F925404529C0C4BA00AD93B7 /* Files.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401529C0C4BA00AD93B7 /* Files.swift */; }; - F925404629C0C4BA00AD93B7 /* SecondaryEmails.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401629C0C4BA00AD93B7 /* SecondaryEmails.swift */; }; - F925404729C0C4BA00AD93B7 /* SecondaryEmails.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401629C0C4BA00AD93B7 /* SecondaryEmails.swift */; }; - F925404829C0C4BA00AD93B7 /* Sharing.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401729C0C4BA00AD93B7 /* Sharing.swift */; }; - F925404929C0C4BA00AD93B7 /* Sharing.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401729C0C4BA00AD93B7 /* Sharing.swift */; }; - F925404A29C0C4BA00AD93B7 /* PaperRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401829C0C4BA00AD93B7 /* PaperRoutes.swift */; }; - F925404B29C0C4BA00AD93B7 /* PaperRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401829C0C4BA00AD93B7 /* PaperRoutes.swift */; }; - F925404C29C0C4BA00AD93B7 /* AccountRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401929C0C4BA00AD93B7 /* AccountRoutes.swift */; }; - F925404D29C0C4BA00AD93B7 /* AccountRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401929C0C4BA00AD93B7 /* AccountRoutes.swift */; }; - F925404E29C0C4BA00AD93B7 /* Check.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401A29C0C4BA00AD93B7 /* Check.swift */; }; - F925404F29C0C4BA00AD93B7 /* Check.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401A29C0C4BA00AD93B7 /* Check.swift */; }; - F925405029C0C4BA00AD93B7 /* SharingRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401B29C0C4BA00AD93B7 /* SharingRoutes.swift */; }; - F925405129C0C4BA00AD93B7 /* SharingRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401B29C0C4BA00AD93B7 /* SharingRoutes.swift */; }; - F925405229C0C4BA00AD93B7 /* Users.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401C29C0C4BA00AD93B7 /* Users.swift */; }; - F925405329C0C4BA00AD93B7 /* Users.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401C29C0C4BA00AD93B7 /* Users.swift */; }; - F925405429C0C4BA00AD93B7 /* SeenState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401D29C0C4BA00AD93B7 /* SeenState.swift */; }; - F925405529C0C4BA00AD93B7 /* SeenState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401D29C0C4BA00AD93B7 /* SeenState.swift */; }; - F925405629C0C4BA00AD93B7 /* TeamLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401E29C0C4BA00AD93B7 /* TeamLog.swift */; }; - F925405729C0C4BA00AD93B7 /* TeamLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401E29C0C4BA00AD93B7 /* TeamLog.swift */; }; - F925405829C0C4BA00AD93B7 /* FileRequestsRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401F29C0C4BA00AD93B7 /* FileRequestsRoutes.swift */; }; - F925405929C0C4BA00AD93B7 /* FileRequestsRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925401F29C0C4BA00AD93B7 /* FileRequestsRoutes.swift */; }; - F925405A29C0C4BA00AD93B7 /* FilesRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402029C0C4BA00AD93B7 /* FilesRoutes.swift */; }; - F925405B29C0C4BA00AD93B7 /* FilesRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402029C0C4BA00AD93B7 /* FilesRoutes.swift */; }; - F925405C29C0C4BA00AD93B7 /* BaseTeam.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402129C0C4BA00AD93B7 /* BaseTeam.swift */; }; - F925405D29C0C4BA00AD93B7 /* BaseTeam.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402129C0C4BA00AD93B7 /* BaseTeam.swift */; }; - F925405E29C0C4BA00AD93B7 /* FileRequests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402229C0C4BA00AD93B7 /* FileRequests.swift */; }; - F925405F29C0C4BA00AD93B7 /* FileRequests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402229C0C4BA00AD93B7 /* FileRequests.swift */; }; - F925406029C0C4BA00AD93B7 /* UsersCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402329C0C4BA00AD93B7 /* UsersCommon.swift */; }; - F925406129C0C4BA00AD93B7 /* UsersCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402329C0C4BA00AD93B7 /* UsersCommon.swift */; }; - F925406229C0C4BA00AD93B7 /* TeamPolicies.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402429C0C4BA00AD93B7 /* TeamPolicies.swift */; }; - F925406329C0C4BA00AD93B7 /* TeamPolicies.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402429C0C4BA00AD93B7 /* TeamPolicies.swift */; }; - F925406429C0C4BA00AD93B7 /* TeamRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402529C0C4BA00AD93B7 /* TeamRoutes.swift */; }; - F925406529C0C4BA00AD93B7 /* TeamRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402529C0C4BA00AD93B7 /* TeamRoutes.swift */; }; - F925406629C0C4BA00AD93B7 /* Common.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402629C0C4BA00AD93B7 /* Common.swift */; }; - F925406729C0C4BA00AD93B7 /* Common.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402629C0C4BA00AD93B7 /* Common.swift */; }; - F925406829C0C4BB00AD93B7 /* Contacts.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402729C0C4BA00AD93B7 /* Contacts.swift */; }; - F925406929C0C4BB00AD93B7 /* Contacts.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402729C0C4BA00AD93B7 /* Contacts.swift */; }; - F925406A29C0C4BB00AD93B7 /* AuthRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402829C0C4BA00AD93B7 /* AuthRoutes.swift */; }; - F925406B29C0C4BB00AD93B7 /* AuthRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402829C0C4BA00AD93B7 /* AuthRoutes.swift */; }; - F925406C29C0C4BB00AD93B7 /* TeamCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402929C0C4BA00AD93B7 /* TeamCommon.swift */; }; - F925406D29C0C4BB00AD93B7 /* TeamCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402929C0C4BA00AD93B7 /* TeamCommon.swift */; }; - F925406E29C0C4BB00AD93B7 /* Auth.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402A29C0C4BA00AD93B7 /* Auth.swift */; }; - F925406F29C0C4BB00AD93B7 /* Auth.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402A29C0C4BA00AD93B7 /* Auth.swift */; }; - F925407029C0C4BB00AD93B7 /* TeamLogRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402B29C0C4BA00AD93B7 /* TeamLogRoutes.swift */; }; - F925407129C0C4BB00AD93B7 /* TeamLogRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402B29C0C4BA00AD93B7 /* TeamLogRoutes.swift */; }; - F925407229C0C4BB00AD93B7 /* FilePropertiesRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402C29C0C4BA00AD93B7 /* FilePropertiesRoutes.swift */; }; - F925407329C0C4BB00AD93B7 /* FilePropertiesRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402C29C0C4BA00AD93B7 /* FilePropertiesRoutes.swift */; }; - F925407429C0C4BB00AD93B7 /* UsersRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402D29C0C4BA00AD93B7 /* UsersRoutes.swift */; }; - F925407529C0C4BB00AD93B7 /* UsersRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402D29C0C4BA00AD93B7 /* UsersRoutes.swift */; }; - F925407629C0C4BB00AD93B7 /* Paper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402E29C0C4BA00AD93B7 /* Paper.swift */; }; - F925407729C0C4BB00AD93B7 /* Paper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402E29C0C4BA00AD93B7 /* Paper.swift */; }; - F925407829C0C4BB00AD93B7 /* StoneValidators.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402F29C0C4BA00AD93B7 /* StoneValidators.swift */; }; - F925407929C0C4BB00AD93B7 /* StoneValidators.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925402F29C0C4BA00AD93B7 /* StoneValidators.swift */; }; - F925407A29C0C4BB00AD93B7 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925403029C0C4BA00AD93B7 /* Account.swift */; }; - F925407B29C0C4BB00AD93B7 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925403029C0C4BA00AD93B7 /* Account.swift */; }; - F925407C29C0C4BB00AD93B7 /* Team.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925403129C0C4BA00AD93B7 /* Team.swift */; }; - F925407D29C0C4BB00AD93B7 /* Team.swift in Sources */ = {isa = PBXBuildFile; fileRef = F925403129C0C4BA00AD93B7 /* Team.swift */; }; - F9DAC28928F5C9FF00D10D08 /* UtilitiesMobile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DAC28828F5C9FF00D10D08 /* UtilitiesMobile.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 8529B7C825FAC97F00F5F6E9 /* Alamofire.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Alamofire.xcframework; path = ../../Carthage/Build/Alamofire.xcframework; sourceTree = ""; }; - BF082C232464B7C6000C8469 /* AuthSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthSession.swift; sourceTree = ""; }; - BF082C252464BE7A000C8469 /* OAuthUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OAuthUtils.swift; sourceTree = ""; }; - BF082C292464C4B7000C8469 /* LoadingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingViewController.swift; sourceTree = ""; }; - BF082C2B246620D2000C8469 /* OAuthConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OAuthConstants.swift; sourceTree = ""; }; - BF3A927324DE2EB7000BA354 /* OAuthTokenRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthTokenRequest.swift; sourceTree = ""; }; - BF4CC99E247750E50005CADF /* AccessTokenProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessTokenProvider.swift; sourceTree = ""; }; - BF4CC9A1247842250005CADF /* Request+TokenRefresh.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Request+TokenRefresh.swift"; sourceTree = ""; }; - BFDD66C8250310F7009D9B6D /* ChunkInputStream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChunkInputStream.swift; sourceTree = ""; }; - F2478EE21ECCD0B300BAF014 /* Custom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Custom.swift; sourceTree = ""; }; - F2478EE31ECCD0B300BAF014 /* CustomRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomRoutes.swift; sourceTree = ""; }; - F2478EE41ECCD0B300BAF014 /* CustomTasks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTasks.swift; sourceTree = ""; }; - F2478EE71ECCD0B300BAF014 /* DropboxClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DropboxClient.swift; sourceTree = ""; }; - F2478EE81ECCD0B300BAF014 /* DropboxClientsManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DropboxClientsManager.swift; sourceTree = ""; }; - F2478EE91ECCD0B300BAF014 /* DropboxTeamClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DropboxTeamClient.swift; sourceTree = ""; }; - F2478EEA1ECCD0B300BAF014 /* DropboxTransportClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DropboxTransportClient.swift; sourceTree = ""; }; - F2478EEB1ECCD0B300BAF014 /* OAuth.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuth.swift; sourceTree = ""; }; - F2478EED1ECCD0B300BAF014 /* TransportConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransportConfig.swift; sourceTree = ""; }; - F2478F381ECCD2FF00BAF014 /* SDKConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDKConstants.swift; sourceTree = ""; }; - F265BD081E68072500CC38C8 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F265BD091E68072500CC38C8 /* OAuthMobile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthMobile.swift; sourceTree = ""; }; - F265BD0D1E68073A00CC38C8 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F265BD0E1E68073A00CC38C8 /* OAuthDesktop.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthDesktop.swift; sourceTree = ""; }; - F2C6FCC51D89E16800E0DD9E /* SwiftyDropbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyDropbox.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F2C6FCD51D89E1A900E0DD9E /* SwiftyDropbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyDropbox.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F2C6FD361D89E37500E0DD9E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - F2C6FD381D89E37A00E0DD9E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - F2C6FD3A1D89E38200E0DD9E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = DEVELOPER_DIR; }; - F2C6FD3C1D89E38800E0DD9E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - F925400C29C0C4BA00AD93B7 /* Base.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Base.swift; sourceTree = ""; }; - F925400D29C0C4BA00AD93B7 /* Async.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Async.swift; sourceTree = ""; }; - F925400E29C0C4BA00AD93B7 /* CheckRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckRoutes.swift; sourceTree = ""; }; - F925400F29C0C4BA00AD93B7 /* ContactsRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactsRoutes.swift; sourceTree = ""; }; - F925401029C0C4BA00AD93B7 /* FileProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileProperties.swift; sourceTree = ""; }; - F925401129C0C4BA00AD93B7 /* OpenidRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenidRoutes.swift; sourceTree = ""; }; - F925401229C0C4BA00AD93B7 /* Openid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Openid.swift; sourceTree = ""; }; - F925401329C0C4BA00AD93B7 /* StoneBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoneBase.swift; sourceTree = ""; }; - F925401429C0C4BA00AD93B7 /* StoneSerializers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoneSerializers.swift; sourceTree = ""; }; - F925401529C0C4BA00AD93B7 /* Files.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Files.swift; sourceTree = ""; }; - F925401629C0C4BA00AD93B7 /* SecondaryEmails.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondaryEmails.swift; sourceTree = ""; }; - F925401729C0C4BA00AD93B7 /* Sharing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sharing.swift; sourceTree = ""; }; - F925401829C0C4BA00AD93B7 /* PaperRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaperRoutes.swift; sourceTree = ""; }; - F925401929C0C4BA00AD93B7 /* AccountRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountRoutes.swift; sourceTree = ""; }; - F925401A29C0C4BA00AD93B7 /* Check.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Check.swift; sourceTree = ""; }; - F925401B29C0C4BA00AD93B7 /* SharingRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingRoutes.swift; sourceTree = ""; }; - F925401C29C0C4BA00AD93B7 /* Users.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Users.swift; sourceTree = ""; }; - F925401D29C0C4BA00AD93B7 /* SeenState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SeenState.swift; sourceTree = ""; }; - F925401E29C0C4BA00AD93B7 /* TeamLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TeamLog.swift; sourceTree = ""; }; - F925401F29C0C4BA00AD93B7 /* FileRequestsRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileRequestsRoutes.swift; sourceTree = ""; }; - F925402029C0C4BA00AD93B7 /* FilesRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilesRoutes.swift; sourceTree = ""; }; - F925402129C0C4BA00AD93B7 /* BaseTeam.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTeam.swift; sourceTree = ""; }; - F925402229C0C4BA00AD93B7 /* FileRequests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileRequests.swift; sourceTree = ""; }; - F925402329C0C4BA00AD93B7 /* UsersCommon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UsersCommon.swift; sourceTree = ""; }; - F925402429C0C4BA00AD93B7 /* TeamPolicies.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TeamPolicies.swift; sourceTree = ""; }; - F925402529C0C4BA00AD93B7 /* TeamRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TeamRoutes.swift; sourceTree = ""; }; - F925402629C0C4BA00AD93B7 /* Common.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Common.swift; sourceTree = ""; }; - F925402729C0C4BA00AD93B7 /* Contacts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Contacts.swift; sourceTree = ""; }; - F925402829C0C4BA00AD93B7 /* AuthRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthRoutes.swift; sourceTree = ""; }; - F925402929C0C4BA00AD93B7 /* TeamCommon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TeamCommon.swift; sourceTree = ""; }; - F925402A29C0C4BA00AD93B7 /* Auth.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Auth.swift; sourceTree = ""; }; - F925402B29C0C4BA00AD93B7 /* TeamLogRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TeamLogRoutes.swift; sourceTree = ""; }; - F925402C29C0C4BA00AD93B7 /* FilePropertiesRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilePropertiesRoutes.swift; sourceTree = ""; }; - F925402D29C0C4BA00AD93B7 /* UsersRoutes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UsersRoutes.swift; sourceTree = ""; }; - F925402E29C0C4BA00AD93B7 /* Paper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Paper.swift; sourceTree = ""; }; - F925402F29C0C4BA00AD93B7 /* StoneValidators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoneValidators.swift; sourceTree = ""; }; - F925403029C0C4BA00AD93B7 /* Account.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = ""; }; - F925403129C0C4BA00AD93B7 /* Team.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Team.swift; sourceTree = ""; }; - F9DAC28828F5C9FF00D10D08 /* UtilitiesMobile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UtilitiesMobile.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F2C6FCC11D89E16800E0DD9E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8529B7C925FAC97F00F5F6E9 /* Alamofire.xcframework in Frameworks */, - F2C6FD371D89E37500E0DD9E /* Foundation.framework in Frameworks */, - F2C6FD391D89E37A00E0DD9E /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F2C6FCD11D89E1A900E0DD9E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8529B7CA25FAC97F00F5F6E9 /* Alamofire.xcframework in Frameworks */, - F2C6FD3D1D89E38800E0DD9E /* Foundation.framework in Frameworks */, - F2C6FD3B1D89E38200E0DD9E /* AppKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - BF082C1F24636F55000C8469 /* OAuth */ = { - isa = PBXGroup; - children = ( - BF3A927324DE2EB7000BA354 /* OAuthTokenRequest.swift */, - BF082C232464B7C6000C8469 /* AuthSession.swift */, - F2478EEB1ECCD0B300BAF014 /* OAuth.swift */, - BF082C252464BE7A000C8469 /* OAuthUtils.swift */, - BF082C2B246620D2000C8469 /* OAuthConstants.swift */, - BF4CC99E247750E50005CADF /* AccessTokenProvider.swift */, - ); - path = OAuth; - sourceTree = ""; - }; - BFFF31D424DE68950029FC0C /* Generated */ = { - isa = PBXGroup; - children = ( - F925403029C0C4BA00AD93B7 /* Account.swift */, - F925401929C0C4BA00AD93B7 /* AccountRoutes.swift */, - F925400D29C0C4BA00AD93B7 /* Async.swift */, - F925402A29C0C4BA00AD93B7 /* Auth.swift */, - F925402829C0C4BA00AD93B7 /* AuthRoutes.swift */, - F925400C29C0C4BA00AD93B7 /* Base.swift */, - F925402129C0C4BA00AD93B7 /* BaseTeam.swift */, - F925401A29C0C4BA00AD93B7 /* Check.swift */, - F925400E29C0C4BA00AD93B7 /* CheckRoutes.swift */, - F925402629C0C4BA00AD93B7 /* Common.swift */, - F925402729C0C4BA00AD93B7 /* Contacts.swift */, - F925400F29C0C4BA00AD93B7 /* ContactsRoutes.swift */, - F925401029C0C4BA00AD93B7 /* FileProperties.swift */, - F925402C29C0C4BA00AD93B7 /* FilePropertiesRoutes.swift */, - F925402229C0C4BA00AD93B7 /* FileRequests.swift */, - F925401F29C0C4BA00AD93B7 /* FileRequestsRoutes.swift */, - F925401529C0C4BA00AD93B7 /* Files.swift */, - F925402029C0C4BA00AD93B7 /* FilesRoutes.swift */, - F925401229C0C4BA00AD93B7 /* Openid.swift */, - F925401129C0C4BA00AD93B7 /* OpenidRoutes.swift */, - F925402E29C0C4BA00AD93B7 /* Paper.swift */, - F925401829C0C4BA00AD93B7 /* PaperRoutes.swift */, - F925401629C0C4BA00AD93B7 /* SecondaryEmails.swift */, - F925401D29C0C4BA00AD93B7 /* SeenState.swift */, - F925401729C0C4BA00AD93B7 /* Sharing.swift */, - F925401B29C0C4BA00AD93B7 /* SharingRoutes.swift */, - F925401329C0C4BA00AD93B7 /* StoneBase.swift */, - F925401429C0C4BA00AD93B7 /* StoneSerializers.swift */, - F925402F29C0C4BA00AD93B7 /* StoneValidators.swift */, - F925403129C0C4BA00AD93B7 /* Team.swift */, - F925402929C0C4BA00AD93B7 /* TeamCommon.swift */, - F925401E29C0C4BA00AD93B7 /* TeamLog.swift */, - F925402B29C0C4BA00AD93B7 /* TeamLogRoutes.swift */, - F925402429C0C4BA00AD93B7 /* TeamPolicies.swift */, - F925402529C0C4BA00AD93B7 /* TeamRoutes.swift */, - F925401C29C0C4BA00AD93B7 /* Users.swift */, - F925402329C0C4BA00AD93B7 /* UsersCommon.swift */, - F925402D29C0C4BA00AD93B7 /* UsersRoutes.swift */, - ); - path = Generated; - sourceTree = ""; - }; - F2478EC61ECCD0B300BAF014 /* Shared */ = { - isa = PBXGroup; - children = ( - BFFF31D424DE68950029FC0C /* Generated */, - F2478EE11ECCD0B300BAF014 /* Handwritten */, - ); - path = Shared; - sourceTree = ""; - }; - F2478EE11ECCD0B300BAF014 /* Handwritten */ = { - isa = PBXGroup; - children = ( - BF082C1F24636F55000C8469 /* OAuth */, - F2478EE21ECCD0B300BAF014 /* Custom.swift */, - F2478EE31ECCD0B300BAF014 /* CustomRoutes.swift */, - F2478EE41ECCD0B300BAF014 /* CustomTasks.swift */, - F2478EE71ECCD0B300BAF014 /* DropboxClient.swift */, - F2478EE81ECCD0B300BAF014 /* DropboxClientsManager.swift */, - F2478EE91ECCD0B300BAF014 /* DropboxTeamClient.swift */, - F2478EEA1ECCD0B300BAF014 /* DropboxTransportClient.swift */, - F2478EED1ECCD0B300BAF014 /* TransportConfig.swift */, - F2478F381ECCD2FF00BAF014 /* SDKConstants.swift */, - BF4CC9A1247842250005CADF /* Request+TokenRefresh.swift */, - BFDD66C8250310F7009D9B6D /* ChunkInputStream.swift */, - ); - path = Handwritten; - sourceTree = ""; - }; - F265BD061E68071400CC38C8 /* Platform */ = { - isa = PBXGroup; - children = ( - F265BD071E68072500CC38C8 /* SwiftyDropbox_iOS */, - F265BD0C1E68073A00CC38C8 /* SwiftyDropbox_macOS */, - ); - name = Platform; - sourceTree = ""; - }; - F265BD071E68072500CC38C8 /* SwiftyDropbox_iOS */ = { - isa = PBXGroup; - children = ( - F265BD081E68072500CC38C8 /* Info.plist */, - F265BD091E68072500CC38C8 /* OAuthMobile.swift */, - BF082C292464C4B7000C8469 /* LoadingViewController.swift */, - F9DAC28828F5C9FF00D10D08 /* UtilitiesMobile.swift */, - ); - name = SwiftyDropbox_iOS; - path = Platform/SwiftyDropbox_iOS; - sourceTree = ""; - }; - F265BD0C1E68073A00CC38C8 /* SwiftyDropbox_macOS */ = { - isa = PBXGroup; - children = ( - F265BD0D1E68073A00CC38C8 /* Info.plist */, - F265BD0E1E68073A00CC38C8 /* OAuthDesktop.swift */, - ); - name = SwiftyDropbox_macOS; - path = Platform/SwiftyDropbox_macOS; - sourceTree = ""; - }; - F2C6FCBB1D89E16800E0DD9E = { - isa = PBXGroup; - children = ( - F265BD061E68071400CC38C8 /* Platform */, - F2478EC61ECCD0B300BAF014 /* Shared */, - F2C6FCC61D89E16800E0DD9E /* Products */, - F2C6FD351D89E37500E0DD9E /* Frameworks */, - ); - sourceTree = ""; - }; - F2C6FCC61D89E16800E0DD9E /* Products */ = { - isa = PBXGroup; - children = ( - F2C6FCC51D89E16800E0DD9E /* SwiftyDropbox.framework */, - F2C6FCD51D89E1A900E0DD9E /* SwiftyDropbox.framework */, - ); - name = Products; - sourceTree = ""; - }; - F2C6FD351D89E37500E0DD9E /* Frameworks */ = { - isa = PBXGroup; - children = ( - F2C6FD3C1D89E38800E0DD9E /* Foundation.framework */, - 8529B7C825FAC97F00F5F6E9 /* Alamofire.xcframework */, - F2C6FD3A1D89E38200E0DD9E /* AppKit.framework */, - F2C6FD381D89E37A00E0DD9E /* UIKit.framework */, - F2C6FD361D89E37500E0DD9E /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - F2C6FCC21D89E16800E0DD9E /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F2C6FCD21D89E1A900E0DD9E /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - F2C6FCC41D89E16800E0DD9E /* SwiftyDropbox iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = F2C6FCCD1D89E16800E0DD9E /* Build configuration list for PBXNativeTarget "SwiftyDropbox iOS" */; - buildPhases = ( - F2C6FCC01D89E16800E0DD9E /* Sources */, - F2C6FCC11D89E16800E0DD9E /* Frameworks */, - F2C6FCC21D89E16800E0DD9E /* Headers */, - F2C6FCC31D89E16800E0DD9E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "SwiftyDropbox iOS"; - productName = SwiftyDropbox; - productReference = F2C6FCC51D89E16800E0DD9E /* SwiftyDropbox.framework */; - productType = "com.apple.product-type.framework"; - }; - F2C6FCD41D89E1A900E0DD9E /* SwiftyDropbox macOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = F2C6FCDA1D89E1A900E0DD9E /* Build configuration list for PBXNativeTarget "SwiftyDropbox macOS" */; - buildPhases = ( - F2C6FCD01D89E1A900E0DD9E /* Sources */, - F2C6FCD11D89E1A900E0DD9E /* Frameworks */, - F2C6FCD21D89E1A900E0DD9E /* Headers */, - F2C6FCD31D89E1A900E0DD9E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "SwiftyDropbox macOS"; - productName = SwiftyDropbox_macOS; - productReference = F2C6FCD51D89E1A900E0DD9E /* SwiftyDropbox.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F2C6FCBC1D89E16800E0DD9E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1000; - ORGANIZATIONNAME = Dropbox; - TargetAttributes = { - F2C6FCC41D89E16800E0DD9E = { - CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0900; - ProvisioningStyle = Automatic; - }; - F2C6FCD41D89E1A900E0DD9E = { - CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0820; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = F2C6FCBF1D89E16800E0DD9E /* Build configuration list for PBXProject "SwiftyDropbox" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = F2C6FCBB1D89E16800E0DD9E; - productRefGroup = F2C6FCC61D89E16800E0DD9E /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - F2C6FCC41D89E16800E0DD9E /* SwiftyDropbox iOS */, - F2C6FCD41D89E1A900E0DD9E /* SwiftyDropbox macOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - F2C6FCC31D89E16800E0DD9E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F2C6FCD31D89E1A900E0DD9E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - F2C6FCC01D89E16800E0DD9E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BF082C262464BE7A000C8469 /* OAuthUtils.swift in Sources */, - F925405C29C0C4BA00AD93B7 /* BaseTeam.swift in Sources */, - F925407C29C0C4BB00AD93B7 /* Team.swift in Sources */, - F925406429C0C4BA00AD93B7 /* TeamRoutes.swift in Sources */, - F2478F2C1ECCD0B300BAF014 /* DropboxClientsManager.swift in Sources */, - F925407429C0C4BB00AD93B7 /* UsersRoutes.swift in Sources */, - F925404629C0C4BA00AD93B7 /* SecondaryEmails.swift in Sources */, - F925403429C0C4BA00AD93B7 /* Async.swift in Sources */, - F925405A29C0C4BA00AD93B7 /* FilesRoutes.swift in Sources */, - BF4CC9A2247842250005CADF /* Request+TokenRefresh.swift in Sources */, - F925406829C0C4BB00AD93B7 /* Contacts.swift in Sources */, - F925407829C0C4BB00AD93B7 /* StoneValidators.swift in Sources */, - F925407029C0C4BB00AD93B7 /* TeamLogRoutes.swift in Sources */, - F2478F361ECCD0B300BAF014 /* TransportConfig.swift in Sources */, - F2478F301ECCD0B300BAF014 /* DropboxTransportClient.swift in Sources */, - F925404E29C0C4BA00AD93B7 /* Check.swift in Sources */, - F2478F241ECCD0B300BAF014 /* CustomTasks.swift in Sources */, - F925406229C0C4BA00AD93B7 /* TeamPolicies.swift in Sources */, - F925407A29C0C4BB00AD93B7 /* Account.swift in Sources */, - F925407629C0C4BB00AD93B7 /* Paper.swift in Sources */, - F925403E29C0C4BA00AD93B7 /* Openid.swift in Sources */, - F265BD0B1E68072500CC38C8 /* OAuthMobile.swift in Sources */, - F925403C29C0C4BA00AD93B7 /* OpenidRoutes.swift in Sources */, - F925404C29C0C4BA00AD93B7 /* AccountRoutes.swift in Sources */, - F925405629C0C4BA00AD93B7 /* TeamLog.swift in Sources */, - F925403829C0C4BA00AD93B7 /* ContactsRoutes.swift in Sources */, - F925405E29C0C4BA00AD93B7 /* FileRequests.swift in Sources */, - F925405429C0C4BA00AD93B7 /* SeenState.swift in Sources */, - F925404A29C0C4BA00AD93B7 /* PaperRoutes.swift in Sources */, - BF3A927424DE2EB7000BA354 /* OAuthTokenRequest.swift in Sources */, - F2478F2E1ECCD0B300BAF014 /* DropboxTeamClient.swift in Sources */, - BF082C2A2464C4B7000C8469 /* LoadingViewController.swift in Sources */, - BF4CC99F247750E50005CADF /* AccessTokenProvider.swift in Sources */, - BF082C2C246620D2000C8469 /* OAuthConstants.swift in Sources */, - F925403229C0C4BA00AD93B7 /* Base.swift in Sources */, - F925404429C0C4BA00AD93B7 /* Files.swift in Sources */, - F2478F391ECCD2FF00BAF014 /* SDKConstants.swift in Sources */, - F925405829C0C4BA00AD93B7 /* FileRequestsRoutes.swift in Sources */, - F925404829C0C4BA00AD93B7 /* Sharing.swift in Sources */, - F9DAC28928F5C9FF00D10D08 /* UtilitiesMobile.swift in Sources */, - F925405229C0C4BA00AD93B7 /* Users.swift in Sources */, - F925406C29C0C4BB00AD93B7 /* TeamCommon.swift in Sources */, - F925403A29C0C4BA00AD93B7 /* FileProperties.swift in Sources */, - F2478F201ECCD0B300BAF014 /* Custom.swift in Sources */, - F2478F321ECCD0B300BAF014 /* OAuth.swift in Sources */, - F925406029C0C4BA00AD93B7 /* UsersCommon.swift in Sources */, - F925406A29C0C4BB00AD93B7 /* AuthRoutes.swift in Sources */, - F925407229C0C4BB00AD93B7 /* FilePropertiesRoutes.swift in Sources */, - F925406E29C0C4BB00AD93B7 /* Auth.swift in Sources */, - F925406629C0C4BA00AD93B7 /* Common.swift in Sources */, - F925405029C0C4BA00AD93B7 /* SharingRoutes.swift in Sources */, - F925404029C0C4BA00AD93B7 /* StoneBase.swift in Sources */, - BFDD66C9250310F7009D9B6D /* ChunkInputStream.swift in Sources */, - F2478F2A1ECCD0B300BAF014 /* DropboxClient.swift in Sources */, - BF082C242464B7C6000C8469 /* AuthSession.swift in Sources */, - F925404229C0C4BA00AD93B7 /* StoneSerializers.swift in Sources */, - F925403629C0C4BA00AD93B7 /* CheckRoutes.swift in Sources */, - F2478F221ECCD0B300BAF014 /* CustomRoutes.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F2C6FCD01D89E1A900E0DD9E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F925404129C0C4BA00AD93B7 /* StoneBase.swift in Sources */, - F2478F2D1ECCD0B300BAF014 /* DropboxClientsManager.swift in Sources */, - F2478F371ECCD0B400BAF014 /* TransportConfig.swift in Sources */, - F925405D29C0C4BA00AD93B7 /* BaseTeam.swift in Sources */, - F2478F311ECCD0B300BAF014 /* DropboxTransportClient.swift in Sources */, - F925404929C0C4BA00AD93B7 /* Sharing.swift in Sources */, - BF4CC9A0247750E50005CADF /* AccessTokenProvider.swift in Sources */, - F2478F251ECCD0B300BAF014 /* CustomTasks.swift in Sources */, - BFDD66CA250310F7009D9B6D /* ChunkInputStream.swift in Sources */, - F925403D29C0C4BA00AD93B7 /* OpenidRoutes.swift in Sources */, - F925407929C0C4BB00AD93B7 /* StoneValidators.swift in Sources */, - F265BD101E68073A00CC38C8 /* OAuthDesktop.swift in Sources */, - F925406329C0C4BA00AD93B7 /* TeamPolicies.swift in Sources */, - F925405129C0C4BA00AD93B7 /* SharingRoutes.swift in Sources */, - F925406729C0C4BA00AD93B7 /* Common.swift in Sources */, - F925404529C0C4BA00AD93B7 /* Files.swift in Sources */, - F925404329C0C4BA00AD93B7 /* StoneSerializers.swift in Sources */, - F2478F2F1ECCD0B300BAF014 /* DropboxTeamClient.swift in Sources */, - F925406529C0C4BA00AD93B7 /* TeamRoutes.swift in Sources */, - F925405529C0C4BA00AD93B7 /* SeenState.swift in Sources */, - F925403929C0C4BA00AD93B7 /* ContactsRoutes.swift in Sources */, - F925406129C0C4BA00AD93B7 /* UsersCommon.swift in Sources */, - F925407729C0C4BB00AD93B7 /* Paper.swift in Sources */, - F925403529C0C4BA00AD93B7 /* Async.swift in Sources */, - BF082C2D246620D5000C8469 /* OAuthConstants.swift in Sources */, - F925403329C0C4BA00AD93B7 /* Base.swift in Sources */, - F925406B29C0C4BB00AD93B7 /* AuthRoutes.swift in Sources */, - F925405F29C0C4BA00AD93B7 /* FileRequests.swift in Sources */, - F925403729C0C4BA00AD93B7 /* CheckRoutes.swift in Sources */, - F925406D29C0C4BB00AD93B7 /* TeamCommon.swift in Sources */, - F925406929C0C4BB00AD93B7 /* Contacts.swift in Sources */, - F925404729C0C4BA00AD93B7 /* SecondaryEmails.swift in Sources */, - F2478F3A1ECCD2FF00BAF014 /* SDKConstants.swift in Sources */, - BF3A927224DE2DF1000BA354 /* AuthSession.swift in Sources */, - F925406F29C0C4BB00AD93B7 /* Auth.swift in Sources */, - F925405929C0C4BA00AD93B7 /* FileRequestsRoutes.swift in Sources */, - F2478F211ECCD0B300BAF014 /* Custom.swift in Sources */, - F2478F331ECCD0B300BAF014 /* OAuth.swift in Sources */, - F925407529C0C4BB00AD93B7 /* UsersRoutes.swift in Sources */, - F2478F2B1ECCD0B300BAF014 /* DropboxClient.swift in Sources */, - BF4CC9A3247842250005CADF /* Request+TokenRefresh.swift in Sources */, - F925405B29C0C4BA00AD93B7 /* FilesRoutes.swift in Sources */, - F925403B29C0C4BA00AD93B7 /* FileProperties.swift in Sources */, - F925407329C0C4BB00AD93B7 /* FilePropertiesRoutes.swift in Sources */, - F925407D29C0C4BB00AD93B7 /* Team.swift in Sources */, - F925405329C0C4BA00AD93B7 /* Users.swift in Sources */, - F925407B29C0C4BB00AD93B7 /* Account.swift in Sources */, - F925405729C0C4BA00AD93B7 /* TeamLog.swift in Sources */, - F925404F29C0C4BA00AD93B7 /* Check.swift in Sources */, - BF3A927524DE2EB7000BA354 /* OAuthTokenRequest.swift in Sources */, - F925404B29C0C4BA00AD93B7 /* PaperRoutes.swift in Sources */, - BF082C272464BE7A000C8469 /* OAuthUtils.swift in Sources */, - F925404D29C0C4BA00AD93B7 /* AccountRoutes.swift in Sources */, - F2478F231ECCD0B300BAF014 /* CustomRoutes.swift in Sources */, - F925403F29C0C4BA00AD93B7 /* Openid.swift in Sources */, - F925407129C0C4BB00AD93B7 /* TeamLogRoutes.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - F2C6FCCB1D89E16800E0DD9E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MACOSX_DEPLOYMENT_TARGET = 10.12; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - F2C6FCCC1D89E16800E0DD9E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MACOSX_DEPLOYMENT_TARGET = 10.12; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - F2C6FCCE1D89E16800E0DD9E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/Platform/SwiftyDropbox_iOS/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.dropbox.SwiftyDropbox; - PRODUCT_NAME = SwiftyDropbox; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - F2C6FCCF1D89E16800E0DD9E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/Platform/SwiftyDropbox_iOS/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.dropbox.SwiftyDropbox; - PRODUCT_NAME = SwiftyDropbox; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - F2C6FCDB1D89E1A900E0DD9E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "-"; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Platform/SwiftyDropbox_macOS/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 11.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.SwiftyDropbox-macOS"; - PRODUCT_NAME = SwiftyDropbox; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - F2C6FCDC1D89E1A900E0DD9E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "-"; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Platform/SwiftyDropbox_macOS/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 11.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.SwiftyDropbox-macOS"; - PRODUCT_NAME = SwiftyDropbox; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - F2C6FCBF1D89E16800E0DD9E /* Build configuration list for PBXProject "SwiftyDropbox" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F2C6FCCB1D89E16800E0DD9E /* Debug */, - F2C6FCCC1D89E16800E0DD9E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F2C6FCCD1D89E16800E0DD9E /* Build configuration list for PBXNativeTarget "SwiftyDropbox iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F2C6FCCE1D89E16800E0DD9E /* Debug */, - F2C6FCCF1D89E16800E0DD9E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F2C6FCDA1D89E1A900E0DD9E /* Build configuration list for PBXNativeTarget "SwiftyDropbox macOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F2C6FCDB1D89E1A900E0DD9E /* Debug */, - F2C6FCDC1D89E1A900E0DD9E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = F2C6FCBC1D89E16800E0DD9E /* Project object */; -} diff --git a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox iOS.xcscheme b/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox iOS.xcscheme deleted file mode 100644 index 24b4b9b22..000000000 --- a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox iOS.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox macOS.xcscheme b/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox macOS.xcscheme deleted file mode 100644 index f7a32a307..000000000 --- a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/xcshareddata/xcschemes/SwiftyDropbox macOS.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/DBXOAuthMobile.swift b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/DBXOAuthMobile.swift new file mode 100644 index 000000000..ee11bded0 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/DBXOAuthMobile.swift @@ -0,0 +1,365 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +#if os(iOS) +import UIKit + +extension DBXDropboxClientsManager { + /// Starts a "token" flow. + /// + /// This method should no longer be used. + /// Long-lived access tokens are deprecated. See https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens. + /// Please use `authorizeFromControllerV2` instead. + /// + /// - Parameters: + /// - sharedApplication: The shared UIApplication instance in your app. + /// - controller: A UIViewController to present the auth flow from. Reference is weakly held. + /// - openURL: Handler to open a URL. + @objc + @available( + *, + deprecated, + message: "This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerV2` instead." + ) + public static func authorizeFromController( + _ sharedApplication: UIApplication, + controller: UIViewController?, + openURL: @escaping ((URL) -> Void) + ) { + DropboxClientsManager.authorizeFromController(sharedApplication, controller: controller, openURL: openURL) + } + + /// Starts the OAuth 2 Authorization Code Flow with PKCE. + /// + /// PKCE allows "authorization code" flow without "client_secret" + /// It enables "native application", which is ensafe to hardcode client_secret in code, to use "authorization code". + /// PKCE is more secure than "token" flow. If authorization code is compromised during + /// transmission, it can't be used to exchange for access token without random generated + /// code_verifier, which is stored inside this SDK. + /// + /// - Parameters: + /// - sharedApplication: The shared UIApplication instance in your app. + /// - controller: A UIViewController to present the auth flow from. Reference is weakly held. + /// - loadingStatusDelegate: An optional delegate to handle loading experience during auth flow. + /// e.g. Show a loading spinner and block user interaction while loading/waiting. + /// If a delegate is not provided, the SDK will show a default loading spinner when necessary. + /// - openURL: Handler to open a URL. + /// - scopeRequest: Contains requested scopes to obtain. + /// - NOTE: + /// If auth completes successfully, A short-lived Access Token and a long-lived Refresh Token will be granted. + /// API calls with expired Access Token will fail with AuthError. An expired Access Token must be refreshed + /// in order to continue to access Dropbox APIs. + /// + /// API clients set up by `DropboxClientsManager` will get token refresh logic for free. + /// If you need to set up `DropboxClient`/`DropboxTeamClient` without `DropboxClientsManager`, + /// you will have to set up the clients with an appropriate `AccessTokenProvider`. + @objc + public static func authorizeFromControllerV2( + _ sharedApplication: UIApplication, + controller: UIViewController?, + loadingStatusDelegate: LoadingStatusDelegate?, + openURL: @escaping ((URL) -> Void), + scopeRequest: DBXScopeRequest? + ) { + DropboxClientsManager.authorizeFromControllerV2( + sharedApplication, + controller: controller, + loadingStatusDelegate: loadingStatusDelegate, + openURL: openURL, + scopeRequest: scopeRequest?.swift + ) + } + + @objc + public static func setupWithAppKey( + _ appKey: String + ) { + setupWithAppKey( + appKey, + transportClient: nil, + backgroundTransportClient: nil, + secureStorageAccess: DBXSecureStorageAccessDefaultImpl(), + includeBackgroundClient: false, + requestsToReconnect: nil + ) + } + + @objc + public static func setupWithAppKey( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + backgroundTransportClient: DBXDropboxTransportClient? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: (([DBXReconnectionResult]) -> Void)? = nil + ) { + DropboxClientsManager.setupWithAppKey( + appKey, + transportClient: transportClient?.swift, + backgroundTransportClient: backgroundTransportClient?.swift, + secureStorageAccess: secureStorageAccess.swift, + includeBackgroundClient: includeBackgroundClient, + requestsToReconnect: { swiftRequests in + requestsToReconnect?(objcRequests(from: swiftRequests)) + } + ) + } + + @objc + public static func setupWithAppKey( + _ appKey: String, + sessionConfiguration: DBXNetworkSessionConfiguration?, + backgroundSessionConfiguration: DBXNetworkSessionConfiguration?, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: (([DBXReconnectionResult]) -> Void)? = nil + ) { + DropboxClientsManager.setupWithAppKey( + appKey, + sessionConfiguration: sessionConfiguration?.swift, + backgroundSessionConfiguration: backgroundSessionConfiguration?.swift, + secureStorageAccess: secureStorageAccess.swift, + includeBackgroundClient: includeBackgroundClient, + requestsToReconnect: { swiftRequests in + requestsToReconnect?(objcRequests(from: swiftRequests)) + } + ) + } + + @objc + public static func setupWithAppKey( + _ appKey: String, backgroundSessionIdentifier: String, + sharedContainerIdentifier: String? = nil, + requestsToReconnect: @escaping ([DBXReconnectionResult]) -> Void + ) { + setupWithAppKey( + appKey, + backgroundSessionIdentifier: backgroundSessionIdentifier, + sharedContainerIdentifier: sharedContainerIdentifier, + secureStorageAccess: DBXSecureStorageAccessDefaultImpl(), + requestsToReconnect: requestsToReconnect + ) + } + + @objc + public static func setupWithAppKey( + _ appKey: String, backgroundSessionIdentifier: String, + sharedContainerIdentifier: String? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + requestsToReconnect: @escaping ([DBXReconnectionResult]) -> Void + ) { + let backgroundNetworkSessionConfiguration = NetworkSessionConfiguration.background( + withIdentifier: backgroundSessionIdentifier, + sharedContainerIdentifier: sharedContainerIdentifier + ).objc + setupWithAppKey( + appKey, + sessionConfiguration: nil, + backgroundSessionConfiguration: backgroundNetworkSessionConfiguration, + secureStorageAccess: secureStorageAccess, + includeBackgroundClient: true, + requestsToReconnect: requestsToReconnect + ) + } + + @objc + public static func setupWithAppKeyMultiUser( + _ appKey: String, + tokenUid: String? + ) { + setupWithAppKeyMultiUser( + appKey, + transportClient: nil, + backgroundTransportClient: nil, + tokenUid: tokenUid, + secureStorageAccess: DBXSecureStorageAccessDefaultImpl(), + includeBackgroundClient: false, + requestsToReconnect: nil + ) + } + + @objc + public static func setupWithAppKeyMultiUser( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + backgroundTransportClient: DBXDropboxTransportClient? = nil, + tokenUid: String?, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: (([DBXReconnectionResult]) -> Void)? = nil + ) { + DropboxClientsManager.setupWithAppKeyMultiUser( + appKey, + transportClient: transportClient?.swift, + backgroundTransportClient: backgroundTransportClient?.swift, + tokenUid: tokenUid, + secureStorageAccess: secureStorageAccess.swift, + includeBackgroundClient: includeBackgroundClient, + requestsToReconnect: { swiftRequests in + requestsToReconnect?(objcRequests(from: swiftRequests)) + } + ) + } + + @objc + public static func setupWithAppKeyMultiUser( + _ appKey: String, + sessionConfiguration: DBXNetworkSessionConfiguration?, + backgroundSessionConfiguration: DBXNetworkSessionConfiguration?, + tokenUid: String?, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + includeBackgroundClient: Bool = false, + requestsToReconnect: (([DBXReconnectionResult]) -> Void)? = nil + ) { + DropboxClientsManager.setupWithAppKeyMultiUser( + appKey, + sessionConfiguration: sessionConfiguration?.swift, + backgroundSessionConfiguration: backgroundSessionConfiguration?.swift, + tokenUid: tokenUid, + includeBackgroundClient: includeBackgroundClient, + requestsToReconnect: { swiftRequests in + requestsToReconnect?(objcRequests(from: swiftRequests)) + } + ) + } + + @objc + public static func setupWithAppKeyMultiUser( + _ appKey: String, + backgroundSessionIdentifier: String, + sharedContainerIdentifier: String? = nil, + tokenUid: String?, + requestsToReconnect: @escaping ([DBXReconnectionResult]) -> Void + ) { + setupWithAppKeyMultiUser( + appKey, + backgroundSessionIdentifier: backgroundSessionIdentifier, + sharedContainerIdentifier: sharedContainerIdentifier, + tokenUid: tokenUid, + secureStorageAccess: DBXSecureStorageAccessDefaultImpl(), + requestsToReconnect: requestsToReconnect + ) + } + + @objc + public static func setupWithAppKeyMultiUser( + _ appKey: String, + backgroundSessionIdentifier: String, + sharedContainerIdentifier: String? = nil, + tokenUid: String?, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + requestsToReconnect: @escaping ([DBXReconnectionResult]) -> Void + ) { + let backgroundNetworkSessionConfiguration = NetworkSessionConfiguration.background( + withIdentifier: backgroundSessionIdentifier, + sharedContainerIdentifier: sharedContainerIdentifier + ).objc + setupWithAppKeyMultiUser( + appKey, + sessionConfiguration: nil, + backgroundSessionConfiguration: backgroundNetworkSessionConfiguration, + tokenUid: tokenUid, + secureStorageAccess: secureStorageAccess, + includeBackgroundClient: true, + requestsToReconnect: requestsToReconnect + ) + } + + @objc + public static func setupWithTeamAppKey( + _ appKey: String + ) { + setupWithTeamAppKey(appKey, transportClient: nil, secureStorageAccess: DBXSecureStorageAccessDefaultImpl()) + } + + @objc + public static func setupWithTeamAppKey( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl() + ) { + DropboxClientsManager.setupWithTeamAppKey(appKey, transportClient: transportClient?.swift, secureStorageAccess: secureStorageAccess.swift) + } + + @objc + public static func setupWithTeamAppKey( + _ appKey: String, + sessionConfiguration: DBXNetworkSessionConfiguration?, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl() + ) { + DropboxClientsManager.setupWithTeamAppKey(appKey, sessionConfiguration: sessionConfiguration?.swift, secureStorageAccess: secureStorageAccess.swift) + } + + @objc + public static func setupWithTeamAppKeyMultiUser( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + DropboxClientsManager.setupWithTeamAppKeyMultiUser( + appKey, + transportClient: transportClient?.swift, + secureStorageAccess: secureStorageAccess.swift, + tokenUid: tokenUid + ) + } + + @objc + public static func setupWithTeamAppKeyMultiUser( + _ appKey: String, + tokenUid: String? + ) { + setupWithTeamAppKeyMultiUser( + appKey, + transportClient: nil, + secureStorageAccess: DBXSecureStorageAccessDefaultImpl(), + tokenUid: tokenUid + ) + } + + @objc + public static func setupWithTeamAppKeyMultiUser( + _ appKey: String, + sessionConfiguration: DBXNetworkSessionConfiguration?, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + DropboxClientsManager.setupWithTeamAppKeyMultiUser( + appKey, + sessionConfiguration: sessionConfiguration?.swift, + secureStorageAccess: secureStorageAccess.swift, + tokenUid: tokenUid + ) + } +} + +#endif + +public class DBXDropboxMobileOAuthManager: DBXDropboxOAuthManager { + let mobileSwift: DropboxMobileOAuthManager + + init(mobileSwift: DropboxMobileOAuthManager) { + self.mobileSwift = mobileSwift + super.init(swift: mobileSwift) + } + + @objc + public init( + appKey: String, + host: String = "www.dropbox.com", + secureStorageAccess: DBXSecureStorageAccess, + dismissSharedAppAuthController: @escaping () -> Void + ) { + self.mobileSwift = DropboxMobileOAuthManager( + appKey: appKey, + secureStorageAccess: secureStorageAccess.swift, + dismissSharedAppAuthController: dismissSharedAppAuthController + ) + super.init(swift: mobileSwift) + } +} diff --git a/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/Info.plist b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/Info.plist new file mode 100644 index 000000000..5cad0e331 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 7.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 10.0.0-beta.3 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/DBXOAuthDesktop.swift b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/DBXOAuthDesktop.swift new file mode 100644 index 000000000..c11cc2777 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/DBXOAuthDesktop.swift @@ -0,0 +1,165 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +#if os(macOS) + +import AppKit + +extension DBXDropboxClientsManager { + /// Starts a "token" flow. + /// + /// This method should no longer be used. + /// Long-lived access tokens are deprecated. See https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens. + /// Please use `authorizeFromControllerV2` instead. + /// - Parameters: + /// - sharedApplication: The shared NSApplication instance in your app. + /// - controller: An NSViewController to present the auth flow from. Reference is weakly held. + /// - openURL: Handler to open a URL. + @objc + @available( + *, + deprecated, + message: "This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerV2` instead." + ) + public static func authorizeFromController( + sharedApplication: NSApplication, + controller: NSViewController?, + openURL: @escaping ((URL) -> Void) + ) { + DropboxClientsManager.authorizeFromController(sharedApplication: sharedApplication, controller: controller, openURL: openURL) + } + + /// Starts the OAuth 2 Authorization Code Flow with PKCE. + /// + /// PKCE allows "authorization code" flow without "client_secret" + /// It enables "native application", which is ensafe to hardcode client_secret in code, to use "authorization code". + /// PKCE is more secure than "token" flow. If authorization code is compromised during + /// transmission, it can't be used to exchange for access token without random generated + /// code_verifier, which is stored inside this SDK. + /// + /// - Parameters: + /// - sharedApplication: The shared NSWorkspace instance in your app. + /// - controller: An NSViewController to present the auth flow from. Reference is weakly held. + /// - loadingStatusDelegate: An optional delegate to handle loading experience during auth flow. + /// e.g. Show a loading spinner and block user interaction while loading/waiting. + /// - openURL: Handler to open a URL. + /// - scopeRequest: Contains requested scopes to obtain. + /// - NOTE: + /// If auth completes successfully, A short-lived Access Token and a long-lived Refresh Token will be granted. + /// API calls with expired Access Token will fail with AuthError. An expired Access Token must be refreshed + /// in order to continue to access Dropbox APIs. + /// + /// API clients set up by `DropboxClientsManager` will get token refresh logic for free. + /// If you need to set up `DropboxClient`/`DropboxTeamClient` without `DropboxClientsManager`, + /// you will have to set up the clients with an appropriate `AccessTokenProvider`. + @objc + public static func authorizeFromControllerV2( + sharedApplication: NSApplication, + controller: NSViewController?, + loadingStatusDelegate: LoadingStatusDelegate?, + openURL: @escaping ((URL) -> Void), + scopeRequest: DBXScopeRequest? + ) { + DropboxClientsManager.authorizeFromControllerV2( + sharedApplication: sharedApplication, + controller: controller, + loadingStatusDelegate: loadingStatusDelegate, + openURL: openURL, + scopeRequest: scopeRequest?.swift + ) + } + + @objc + public static func setupWithAppKeyDesktop( + _ appKey: String + ) { + setupWithAppKeyDesktop(appKey, transportClient: nil, secureStorageAccess: DBXSecureStorageAccessDefaultImpl()) + } + + @objc + public static func setupWithAppKeyDesktop( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl() + ) { + DropboxClientsManager.setupWithAppKeyDesktop(appKey, transportClient: transportClient?.swift, secureStorageAccess: secureStorageAccess.swift) + } + + @objc + public static func setupWithAppKeyMultiUserDesktop( + _ appKey: String, + tokenUid: String? + ) { + setupWithAppKeyMultiUserDesktop( + appKey, + transportClient: nil, + secureStorageAccess: DBXSecureStorageAccessDefaultImpl(), + tokenUid: tokenUid + ) + } + + @objc + public static func setupWithAppKeyMultiUserDesktop( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + DropboxClientsManager.setupWithAppKeyMultiUserDesktop( + appKey, + transportClient: transportClient?.swift, + secureStorageAccess: secureStorageAccess.swift, + tokenUid: tokenUid + ) + } + + @objc + public static func setupWithTeamAppKeyDesktop( + _ appKey: String + ) { + setupWithTeamAppKeyDesktop(appKey, transportClient: nil, secureStorageAccess: DBXSecureStorageAccessDefaultImpl()) + } + + @objc + public static func setupWithTeamAppKeyDesktop( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl() + ) { + DropboxClientsManager.setupWithTeamAppKeyDesktop(appKey, transportClient: transportClient?.swift, secureStorageAccess: secureStorageAccess.swift) + } + + @objc + public static func setupWithTeamAppKeyMultiUserDesktop( + _ appKey: String, + tokenUid: String? + ) { + setupWithTeamAppKeyMultiUserDesktop( + appKey, + transportClient: nil, + secureStorageAccess: DBXSecureStorageAccessDefaultImpl(), + tokenUid: tokenUid + ) + } + + @objc + public static func setupWithTeamAppKeyMultiUserDesktop( + _ appKey: String, + transportClient: DBXDropboxTransportClient? = nil, + secureStorageAccess: DBXSecureStorageAccess = DBXSecureStorageAccessDefaultImpl(), + tokenUid: String? + ) { + DropboxClientsManager.setupWithTeamAppKeyMultiUserDesktop( + appKey, + transportClient: transportClient?.swift, + secureStorageAccess: secureStorageAccess.swift, + tokenUid: tokenUid + ) + } +} + +#endif diff --git a/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/Info.plist b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/Info.plist new file mode 100644 index 000000000..3e84d4ccf --- /dev/null +++ b/Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 7.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 10.0.0-beta.3 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2016 Dropbox. All rights reserved. + NSPrincipalClass + + + diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAccount.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAccount.swift new file mode 100644 index 000000000..b8da5cdec --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAccount.swift @@ -0,0 +1,232 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the account namespace +/// For Swift see account + +/// Objective-C compatible PhotoSourceArg union +@objc +public class DBXAccountPhotoSourceArg: NSObject { + let swift: Account.PhotoSourceArg + + public init(swift: Account.PhotoSourceArg) { + self.swift = swift + } + + public static func factory(swift: Account.PhotoSourceArg) -> DBXAccountPhotoSourceArg { + switch swift { + case .base64Data(let swiftArg): + let arg = swiftArg + return DBXAccountPhotoSourceArgBase64Data(arg) + case .other: + return DBXAccountPhotoSourceArgOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asBase64Data: DBXAccountPhotoSourceArgBase64Data? { + self as? DBXAccountPhotoSourceArgBase64Data + } + + @objc + public var asOther: DBXAccountPhotoSourceArgOther? { + self as? DBXAccountPhotoSourceArgOther + } +} + +/// Image data in base64-encoded bytes. +@objc +public class DBXAccountPhotoSourceArgBase64Data: DBXAccountPhotoSourceArg { + @objc + public var base64Data: String + + @objc + public init(_ arg: String) { + self.base64Data = arg + let swift = Account.PhotoSourceArg.base64Data(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAccountPhotoSourceArgOther: DBXAccountPhotoSourceArg { + @objc + public init() { + let swift = Account.PhotoSourceArg.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SetProfilePhotoArg struct +@objc +public class DBXAccountSetProfilePhotoArg: NSObject { + /// Image to set as the user's new profile photo. + @objc + public var photo: DBXAccountPhotoSourceArg { DBXAccountPhotoSourceArg(swift: swift.photo) } + + @objc + public init(photo: DBXAccountPhotoSourceArg) { + self.swift = Account.SetProfilePhotoArg(photo: photo.swift) + } + + let swift: Account.SetProfilePhotoArg + + public init(swift: Account.SetProfilePhotoArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SetProfilePhotoError union +@objc +public class DBXAccountSetProfilePhotoError: NSObject { + let swift: Account.SetProfilePhotoError + + public init(swift: Account.SetProfilePhotoError) { + self.swift = swift + } + + public static func factory(swift: Account.SetProfilePhotoError) -> DBXAccountSetProfilePhotoError { + switch swift { + case .fileTypeError: + return DBXAccountSetProfilePhotoErrorFileTypeError() + case .fileSizeError: + return DBXAccountSetProfilePhotoErrorFileSizeError() + case .dimensionError: + return DBXAccountSetProfilePhotoErrorDimensionError() + case .thumbnailError: + return DBXAccountSetProfilePhotoErrorThumbnailError() + case .transientError: + return DBXAccountSetProfilePhotoErrorTransientError() + case .other: + return DBXAccountSetProfilePhotoErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFileTypeError: DBXAccountSetProfilePhotoErrorFileTypeError? { + self as? DBXAccountSetProfilePhotoErrorFileTypeError + } + + @objc + public var asFileSizeError: DBXAccountSetProfilePhotoErrorFileSizeError? { + self as? DBXAccountSetProfilePhotoErrorFileSizeError + } + + @objc + public var asDimensionError: DBXAccountSetProfilePhotoErrorDimensionError? { + self as? DBXAccountSetProfilePhotoErrorDimensionError + } + + @objc + public var asThumbnailError: DBXAccountSetProfilePhotoErrorThumbnailError? { + self as? DBXAccountSetProfilePhotoErrorThumbnailError + } + + @objc + public var asTransientError: DBXAccountSetProfilePhotoErrorTransientError? { + self as? DBXAccountSetProfilePhotoErrorTransientError + } + + @objc + public var asOther: DBXAccountSetProfilePhotoErrorOther? { + self as? DBXAccountSetProfilePhotoErrorOther + } +} + +/// File cannot be set as profile photo. +@objc +public class DBXAccountSetProfilePhotoErrorFileTypeError: DBXAccountSetProfilePhotoError { + @objc + public init() { + let swift = Account.SetProfilePhotoError.fileTypeError + super.init(swift: swift) + } +} + +/// File cannot exceed 10 MB. +@objc +public class DBXAccountSetProfilePhotoErrorFileSizeError: DBXAccountSetProfilePhotoError { + @objc + public init() { + let swift = Account.SetProfilePhotoError.fileSizeError + super.init(swift: swift) + } +} + +/// Image must be larger than 128 x 128. +@objc +public class DBXAccountSetProfilePhotoErrorDimensionError: DBXAccountSetProfilePhotoError { + @objc + public init() { + let swift = Account.SetProfilePhotoError.dimensionError + super.init(swift: swift) + } +} + +/// Image could not be thumbnailed. +@objc +public class DBXAccountSetProfilePhotoErrorThumbnailError: DBXAccountSetProfilePhotoError { + @objc + public init() { + let swift = Account.SetProfilePhotoError.thumbnailError + super.init(swift: swift) + } +} + +/// Temporary infrastructure failure, please retry. +@objc +public class DBXAccountSetProfilePhotoErrorTransientError: DBXAccountSetProfilePhotoError { + @objc + public init() { + let swift = Account.SetProfilePhotoError.transientError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAccountSetProfilePhotoErrorOther: DBXAccountSetProfilePhotoError { + @objc + public init() { + let swift = Account.SetProfilePhotoError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SetProfilePhotoResult struct +@objc +public class DBXAccountSetProfilePhotoResult: NSObject { + /// URL for the photo representing the user, if one is set. + @objc + public var profilePhotoUrl: String { swift.profilePhotoUrl } + + @objc + public init(profilePhotoUrl: String) { + self.swift = Account.SetProfilePhotoResult(profilePhotoUrl: profilePhotoUrl) + } + + let swift: Account.SetProfilePhotoResult + + public init(swift: Account.SetProfilePhotoResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAccountRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAccountRoutes.swift new file mode 100644 index 000000000..9fcf92370 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAccountRoutes.swift @@ -0,0 +1,102 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the account namespace +/// For Swift routes see AccountRoutes +@objc +public class DBXAccountRoutes: NSObject { + private let swift: AccountRoutes + init(swift: AccountRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Sets a user's profile photo. + /// + /// - scope: account_info.write + /// + /// - parameter photo: Image to set as the user's new profile photo. + /// + /// - returns: Through the response callback, the caller will receive a `Account.SetProfilePhotoResult` object on + /// success or a `Account.SetProfilePhotoError` object on failure. + @objc + @discardableResult public func setProfilePhoto(photo: DBXAccountPhotoSourceArg) -> DBXAccountSetProfilePhotoRpcRequest { + let swift = swift.setProfilePhoto(photo: photo.swift) + return DBXAccountSetProfilePhotoRpcRequest(swift: swift) + } +} + +@objc +public class DBXAccountSetProfilePhotoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAccountSetProfilePhotoResult?, DBXAccountSetProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAccountSetProfilePhotoResult?, DBXAccountSetProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXAccountSetProfilePhotoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXAccountSetProfilePhotoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAccountSetProfilePhotoResult? + if let swift = result { + objc = DBXAccountSetProfilePhotoResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAsync.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAsync.swift new file mode 100644 index 000000000..023c9389c --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAsync.swift @@ -0,0 +1,295 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the async namespace +/// For Swift see async + +/// Result returned by methods that launch an asynchronous job. A method who may either launch an asynchronous job, +/// or complete the request synchronously, can use this union by extending it, and adding a 'complete' field with +/// the type of the synchronous response. See LaunchEmptyResult for an example. +@objc +public class DBXAsyncLaunchResultBase: NSObject { + let swift: Async.LaunchResultBase + + public init(swift: Async.LaunchResultBase) { + self.swift = swift + } + + public static func factory(swift: Async.LaunchResultBase) -> DBXAsyncLaunchResultBase { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXAsyncLaunchResultBaseAsyncJobId(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXAsyncLaunchResultBaseAsyncJobId? { + self as? DBXAsyncLaunchResultBaseAsyncJobId + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXAsyncLaunchResultBaseAsyncJobId: DBXAsyncLaunchResultBase { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Async.LaunchResultBase.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// Result returned by methods that may either launch an asynchronous job or complete synchronously. Upon +/// synchronous completion of the job, no additional information is returned. +@objc +public class DBXAsyncLaunchEmptyResult: NSObject { + let swift: Async.LaunchEmptyResult + + public init(swift: Async.LaunchEmptyResult) { + self.swift = swift + } + + public static func factory(swift: Async.LaunchEmptyResult) -> DBXAsyncLaunchEmptyResult { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXAsyncLaunchEmptyResultAsyncJobId(arg) + case .complete: + return DBXAsyncLaunchEmptyResultComplete() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXAsyncLaunchEmptyResultAsyncJobId? { + self as? DBXAsyncLaunchEmptyResultAsyncJobId + } + + @objc + public var asComplete: DBXAsyncLaunchEmptyResultComplete? { + self as? DBXAsyncLaunchEmptyResultComplete + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXAsyncLaunchEmptyResultAsyncJobId: DBXAsyncLaunchEmptyResult { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Async.LaunchEmptyResult.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// The job finished synchronously and successfully. +@objc +public class DBXAsyncLaunchEmptyResultComplete: DBXAsyncLaunchEmptyResult { + @objc + public init() { + let swift = Async.LaunchEmptyResult.complete + super.init(swift: swift) + } +} + +/// Arguments for methods that poll the status of an asynchronous job. +@objc +public class DBXAsyncPollArg: NSObject { + /// Id of the asynchronous job. This is the value of a response returned from the method that launched the job. + @objc + public var asyncJobId: String { swift.asyncJobId } + + @objc + public init(asyncJobId: String) { + self.swift = Async.PollArg(asyncJobId: asyncJobId) + } + + let swift: Async.PollArg + + public init(swift: Async.PollArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result returned by methods that poll for the status of an asynchronous job. Unions that extend this union should +/// add a 'complete' field with a type of the information returned upon job completion. See PollEmptyResult for an +/// example. +@objc +public class DBXAsyncPollResultBase: NSObject { + let swift: Async.PollResultBase + + public init(swift: Async.PollResultBase) { + self.swift = swift + } + + public static func factory(swift: Async.PollResultBase) -> DBXAsyncPollResultBase { + switch swift { + case .inProgress: + return DBXAsyncPollResultBaseInProgress() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXAsyncPollResultBaseInProgress? { + self as? DBXAsyncPollResultBaseInProgress + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXAsyncPollResultBaseInProgress: DBXAsyncPollResultBase { + @objc + public init() { + let swift = Async.PollResultBase.inProgress + super.init(swift: swift) + } +} + +/// Result returned by methods that poll for the status of an asynchronous job. Upon completion of the job, no +/// additional information is returned. +@objc +public class DBXAsyncPollEmptyResult: NSObject { + let swift: Async.PollEmptyResult + + public init(swift: Async.PollEmptyResult) { + self.swift = swift + } + + public static func factory(swift: Async.PollEmptyResult) -> DBXAsyncPollEmptyResult { + switch swift { + case .inProgress: + return DBXAsyncPollEmptyResultInProgress() + case .complete: + return DBXAsyncPollEmptyResultComplete() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXAsyncPollEmptyResultInProgress? { + self as? DBXAsyncPollEmptyResultInProgress + } + + @objc + public var asComplete: DBXAsyncPollEmptyResultComplete? { + self as? DBXAsyncPollEmptyResultComplete + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXAsyncPollEmptyResultInProgress: DBXAsyncPollEmptyResult { + @objc + public init() { + let swift = Async.PollEmptyResult.inProgress + super.init(swift: swift) + } +} + +/// The asynchronous job has completed successfully. +@objc +public class DBXAsyncPollEmptyResultComplete: DBXAsyncPollEmptyResult { + @objc + public init() { + let swift = Async.PollEmptyResult.complete + super.init(swift: swift) + } +} + +/// Error returned by methods for polling the status of asynchronous job. +@objc +public class DBXAsyncPollError: NSObject { + let swift: Async.PollError + + public init(swift: Async.PollError) { + self.swift = swift + } + + public static func factory(swift: Async.PollError) -> DBXAsyncPollError { + switch swift { + case .invalidAsyncJobId: + return DBXAsyncPollErrorInvalidAsyncJobId() + case .internalError: + return DBXAsyncPollErrorInternalError() + case .other: + return DBXAsyncPollErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidAsyncJobId: DBXAsyncPollErrorInvalidAsyncJobId? { + self as? DBXAsyncPollErrorInvalidAsyncJobId + } + + @objc + public var asInternalError: DBXAsyncPollErrorInternalError? { + self as? DBXAsyncPollErrorInternalError + } + + @objc + public var asOther: DBXAsyncPollErrorOther? { + self as? DBXAsyncPollErrorOther + } +} + +/// The job ID is invalid. +@objc +public class DBXAsyncPollErrorInvalidAsyncJobId: DBXAsyncPollError { + @objc + public init() { + let swift = Async.PollError.invalidAsyncJobId + super.init(swift: swift) + } +} + +/// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking +/// succeeded, and if not, try again. This should happen very rarely. +@objc +public class DBXAsyncPollErrorInternalError: DBXAsyncPollError { + @objc + public init() { + let swift = Async.PollError.internalError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAsyncPollErrorOther: DBXAsyncPollError { + @objc + public init() { + let swift = Async.PollError.other + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift new file mode 100644 index 000000000..49fb2277b --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift @@ -0,0 +1,619 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the auth namespace +/// For Swift see auth + +/// Error occurred because the account doesn't have permission to access the resource. +@objc +public class DBXAuthAccessError: NSObject { + let swift: Auth.AccessError + + public init(swift: Auth.AccessError) { + self.swift = swift + } + + public static func factory(swift: Auth.AccessError) -> DBXAuthAccessError { + switch swift { + case .invalidAccountType(let swiftArg): + let arg = DBXAuthInvalidAccountTypeError(swift: swiftArg) + return DBXAuthAccessErrorInvalidAccountType(arg) + case .paperAccessDenied(let swiftArg): + let arg = DBXAuthPaperAccessError(swift: swiftArg) + return DBXAuthAccessErrorPaperAccessDenied(arg) + case .other: + return DBXAuthAccessErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidAccountType: DBXAuthAccessErrorInvalidAccountType? { + self as? DBXAuthAccessErrorInvalidAccountType + } + + @objc + public var asPaperAccessDenied: DBXAuthAccessErrorPaperAccessDenied? { + self as? DBXAuthAccessErrorPaperAccessDenied + } + + @objc + public var asOther: DBXAuthAccessErrorOther? { + self as? DBXAuthAccessErrorOther + } +} + +/// Current account type cannot access the resource. +@objc +public class DBXAuthAccessErrorInvalidAccountType: DBXAuthAccessError { + @objc + public var invalidAccountType: DBXAuthInvalidAccountTypeError + + @objc + public init(_ arg: DBXAuthInvalidAccountTypeError) { + self.invalidAccountType = arg + let swift = Auth.AccessError.invalidAccountType(arg.swift) + super.init(swift: swift) + } +} + +/// Current account cannot access Paper. +@objc +public class DBXAuthAccessErrorPaperAccessDenied: DBXAuthAccessError { + @objc + public var paperAccessDenied: DBXAuthPaperAccessError + + @objc + public init(_ arg: DBXAuthPaperAccessError) { + self.paperAccessDenied = arg + let swift = Auth.AccessError.paperAccessDenied(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAuthAccessErrorOther: DBXAuthAccessError { + @objc + public init() { + let swift = Auth.AccessError.other + super.init(swift: swift) + } +} + +/// Errors occurred during authentication. +@objc +public class DBXAuthAuthError: NSObject { + let swift: Auth.AuthError + + public init(swift: Auth.AuthError) { + self.swift = swift + } + + public static func factory(swift: Auth.AuthError) -> DBXAuthAuthError { + switch swift { + case .invalidAccessToken: + return DBXAuthAuthErrorInvalidAccessToken() + case .invalidSelectUser: + return DBXAuthAuthErrorInvalidSelectUser() + case .invalidSelectAdmin: + return DBXAuthAuthErrorInvalidSelectAdmin() + case .userSuspended: + return DBXAuthAuthErrorUserSuspended() + case .expiredAccessToken: + return DBXAuthAuthErrorExpiredAccessToken() + case .missingScope(let swiftArg): + let arg = DBXAuthTokenScopeError(swift: swiftArg) + return DBXAuthAuthErrorMissingScope(arg) + case .routeAccessDenied: + return DBXAuthAuthErrorRouteAccessDenied() + case .other: + return DBXAuthAuthErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidAccessToken: DBXAuthAuthErrorInvalidAccessToken? { + self as? DBXAuthAuthErrorInvalidAccessToken + } + + @objc + public var asInvalidSelectUser: DBXAuthAuthErrorInvalidSelectUser? { + self as? DBXAuthAuthErrorInvalidSelectUser + } + + @objc + public var asInvalidSelectAdmin: DBXAuthAuthErrorInvalidSelectAdmin? { + self as? DBXAuthAuthErrorInvalidSelectAdmin + } + + @objc + public var asUserSuspended: DBXAuthAuthErrorUserSuspended? { + self as? DBXAuthAuthErrorUserSuspended + } + + @objc + public var asExpiredAccessToken: DBXAuthAuthErrorExpiredAccessToken? { + self as? DBXAuthAuthErrorExpiredAccessToken + } + + @objc + public var asMissingScope: DBXAuthAuthErrorMissingScope? { + self as? DBXAuthAuthErrorMissingScope + } + + @objc + public var asRouteAccessDenied: DBXAuthAuthErrorRouteAccessDenied? { + self as? DBXAuthAuthErrorRouteAccessDenied + } + + @objc + public var asOther: DBXAuthAuthErrorOther? { + self as? DBXAuthAuthErrorOther + } +} + +/// The access token is invalid. +@objc +public class DBXAuthAuthErrorInvalidAccessToken: DBXAuthAuthError { + @objc + public init() { + let swift = Auth.AuthError.invalidAccessToken + super.init(swift: swift) + } +} + +/// The user specified in 'Dropbox-API-Select-User' is no longer on the team. +@objc +public class DBXAuthAuthErrorInvalidSelectUser: DBXAuthAuthError { + @objc + public init() { + let swift = Auth.AuthError.invalidSelectUser + super.init(swift: swift) + } +} + +/// The user specified in 'Dropbox-API-Select-Admin' is not a Dropbox Business team admin. +@objc +public class DBXAuthAuthErrorInvalidSelectAdmin: DBXAuthAuthError { + @objc + public init() { + let swift = Auth.AuthError.invalidSelectAdmin + super.init(swift: swift) + } +} + +/// The user has been suspended. +@objc +public class DBXAuthAuthErrorUserSuspended: DBXAuthAuthError { + @objc + public init() { + let swift = Auth.AuthError.userSuspended + super.init(swift: swift) + } +} + +/// The access token has expired. +@objc +public class DBXAuthAuthErrorExpiredAccessToken: DBXAuthAuthError { + @objc + public init() { + let swift = Auth.AuthError.expiredAccessToken + super.init(swift: swift) + } +} + +/// The access token does not have the required scope to access the route. +@objc +public class DBXAuthAuthErrorMissingScope: DBXAuthAuthError { + @objc + public var missingScope: DBXAuthTokenScopeError + + @objc + public init(_ arg: DBXAuthTokenScopeError) { + self.missingScope = arg + let swift = Auth.AuthError.missingScope(arg.swift) + super.init(swift: swift) + } +} + +/// The route is not available to public. +@objc +public class DBXAuthAuthErrorRouteAccessDenied: DBXAuthAuthError { + @objc + public init() { + let swift = Auth.AuthError.routeAccessDenied + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAuthAuthErrorOther: DBXAuthAuthError { + @objc + public init() { + let swift = Auth.AuthError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible InvalidAccountTypeError union +@objc +public class DBXAuthInvalidAccountTypeError: NSObject { + let swift: Auth.InvalidAccountTypeError + + public init(swift: Auth.InvalidAccountTypeError) { + self.swift = swift + } + + public static func factory(swift: Auth.InvalidAccountTypeError) -> DBXAuthInvalidAccountTypeError { + switch swift { + case .endpoint: + return DBXAuthInvalidAccountTypeErrorEndpoint() + case .feature: + return DBXAuthInvalidAccountTypeErrorFeature() + case .other: + return DBXAuthInvalidAccountTypeErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEndpoint: DBXAuthInvalidAccountTypeErrorEndpoint? { + self as? DBXAuthInvalidAccountTypeErrorEndpoint + } + + @objc + public var asFeature: DBXAuthInvalidAccountTypeErrorFeature? { + self as? DBXAuthInvalidAccountTypeErrorFeature + } + + @objc + public var asOther: DBXAuthInvalidAccountTypeErrorOther? { + self as? DBXAuthInvalidAccountTypeErrorOther + } +} + +/// Current account type doesn't have permission to access this route endpoint. +@objc +public class DBXAuthInvalidAccountTypeErrorEndpoint: DBXAuthInvalidAccountTypeError { + @objc + public init() { + let swift = Auth.InvalidAccountTypeError.endpoint + super.init(swift: swift) + } +} + +/// Current account type doesn't have permission to access this feature. +@objc +public class DBXAuthInvalidAccountTypeErrorFeature: DBXAuthInvalidAccountTypeError { + @objc + public init() { + let swift = Auth.InvalidAccountTypeError.feature + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAuthInvalidAccountTypeErrorOther: DBXAuthInvalidAccountTypeError { + @objc + public init() { + let swift = Auth.InvalidAccountTypeError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperAccessError union +@objc +public class DBXAuthPaperAccessError: NSObject { + let swift: Auth.PaperAccessError + + public init(swift: Auth.PaperAccessError) { + self.swift = swift + } + + public static func factory(swift: Auth.PaperAccessError) -> DBXAuthPaperAccessError { + switch swift { + case .paperDisabled: + return DBXAuthPaperAccessErrorPaperDisabled() + case .notPaperUser: + return DBXAuthPaperAccessErrorNotPaperUser() + case .other: + return DBXAuthPaperAccessErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPaperDisabled: DBXAuthPaperAccessErrorPaperDisabled? { + self as? DBXAuthPaperAccessErrorPaperDisabled + } + + @objc + public var asNotPaperUser: DBXAuthPaperAccessErrorNotPaperUser? { + self as? DBXAuthPaperAccessErrorNotPaperUser + } + + @objc + public var asOther: DBXAuthPaperAccessErrorOther? { + self as? DBXAuthPaperAccessErrorOther + } +} + +/// Paper is disabled. +@objc +public class DBXAuthPaperAccessErrorPaperDisabled: DBXAuthPaperAccessError { + @objc + public init() { + let swift = Auth.PaperAccessError.paperDisabled + super.init(swift: swift) + } +} + +/// The provided user has not used Paper yet. +@objc +public class DBXAuthPaperAccessErrorNotPaperUser: DBXAuthPaperAccessError { + @objc + public init() { + let swift = Auth.PaperAccessError.notPaperUser + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAuthPaperAccessErrorOther: DBXAuthPaperAccessError { + @objc + public init() { + let swift = Auth.PaperAccessError.other + super.init(swift: swift) + } +} + +/// Error occurred because the app is being rate limited. +@objc +public class DBXAuthRateLimitError: NSObject { + /// The reason why the app is being rate limited. + @objc + public var reason: DBXAuthRateLimitReason { DBXAuthRateLimitReason(swift: swift.reason) } + /// The number of seconds that the app should wait before making another request. + @objc + public var retryAfter: NSNumber { swift.retryAfter as NSNumber } + + @objc + public init(reason: DBXAuthRateLimitReason, retryAfter: NSNumber) { + self.swift = Auth.RateLimitError(reason: reason.swift, retryAfter: retryAfter.uint64Value) + } + + let swift: Auth.RateLimitError + + public init(swift: Auth.RateLimitError) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RateLimitReason union +@objc +public class DBXAuthRateLimitReason: NSObject { + let swift: Auth.RateLimitReason + + public init(swift: Auth.RateLimitReason) { + self.swift = swift + } + + public static func factory(swift: Auth.RateLimitReason) -> DBXAuthRateLimitReason { + switch swift { + case .tooManyRequests: + return DBXAuthRateLimitReasonTooManyRequests() + case .tooManyWriteOperations: + return DBXAuthRateLimitReasonTooManyWriteOperations() + case .other: + return DBXAuthRateLimitReasonOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTooManyRequests: DBXAuthRateLimitReasonTooManyRequests? { + self as? DBXAuthRateLimitReasonTooManyRequests + } + + @objc + public var asTooManyWriteOperations: DBXAuthRateLimitReasonTooManyWriteOperations? { + self as? DBXAuthRateLimitReasonTooManyWriteOperations + } + + @objc + public var asOther: DBXAuthRateLimitReasonOther? { + self as? DBXAuthRateLimitReasonOther + } +} + +/// You are making too many requests in the past few minutes. +@objc +public class DBXAuthRateLimitReasonTooManyRequests: DBXAuthRateLimitReason { + @objc + public init() { + let swift = Auth.RateLimitReason.tooManyRequests + super.init(swift: swift) + } +} + +/// There are currently too many write operations happening in the user's Dropbox. +@objc +public class DBXAuthRateLimitReasonTooManyWriteOperations: DBXAuthRateLimitReason { + @objc + public init() { + let swift = Auth.RateLimitReason.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAuthRateLimitReasonOther: DBXAuthRateLimitReason { + @objc + public init() { + let swift = Auth.RateLimitReason.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TokenFromOAuth1Arg struct +@objc +public class DBXAuthTokenFromOAuth1Arg: NSObject { + /// The supplied OAuth 1.0 access token. + @objc + public var oauth1Token: String { swift.oauth1Token } + /// The token secret associated with the supplied access token. + @objc + public var oauth1TokenSecret: String { swift.oauth1TokenSecret } + + @objc + public init(oauth1Token: String, oauth1TokenSecret: String) { + self.swift = Auth.TokenFromOAuth1Arg(oauth1Token: oauth1Token, oauth1TokenSecret: oauth1TokenSecret) + } + + let swift: Auth.TokenFromOAuth1Arg + + public init(swift: Auth.TokenFromOAuth1Arg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TokenFromOAuth1Error union +@objc +public class DBXAuthTokenFromOAuth1Error: NSObject { + let swift: Auth.TokenFromOAuth1Error + + public init(swift: Auth.TokenFromOAuth1Error) { + self.swift = swift + } + + public static func factory(swift: Auth.TokenFromOAuth1Error) -> DBXAuthTokenFromOAuth1Error { + switch swift { + case .invalidOauth1TokenInfo: + return DBXAuthTokenFromOAuth1ErrorInvalidOauth1TokenInfo() + case .appIdMismatch: + return DBXAuthTokenFromOAuth1ErrorAppIdMismatch() + case .other: + return DBXAuthTokenFromOAuth1ErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidOauth1TokenInfo: DBXAuthTokenFromOAuth1ErrorInvalidOauth1TokenInfo? { + self as? DBXAuthTokenFromOAuth1ErrorInvalidOauth1TokenInfo + } + + @objc + public var asAppIdMismatch: DBXAuthTokenFromOAuth1ErrorAppIdMismatch? { + self as? DBXAuthTokenFromOAuth1ErrorAppIdMismatch + } + + @objc + public var asOther: DBXAuthTokenFromOAuth1ErrorOther? { + self as? DBXAuthTokenFromOAuth1ErrorOther + } +} + +/// Part or all of the OAuth 1.0 access token info is invalid. +@objc +public class DBXAuthTokenFromOAuth1ErrorInvalidOauth1TokenInfo: DBXAuthTokenFromOAuth1Error { + @objc + public init() { + let swift = Auth.TokenFromOAuth1Error.invalidOauth1TokenInfo + super.init(swift: swift) + } +} + +/// The authorized app does not match the app associated with the supplied access token. +@objc +public class DBXAuthTokenFromOAuth1ErrorAppIdMismatch: DBXAuthTokenFromOAuth1Error { + @objc + public init() { + let swift = Auth.TokenFromOAuth1Error.appIdMismatch + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXAuthTokenFromOAuth1ErrorOther: DBXAuthTokenFromOAuth1Error { + @objc + public init() { + let swift = Auth.TokenFromOAuth1Error.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TokenFromOAuth1Result struct +@objc +public class DBXAuthTokenFromOAuth1Result: NSObject { + /// The OAuth 2.0 token generated from the supplied OAuth 1.0 token. + @objc + public var oauth2Token: String { swift.oauth2Token } + + @objc + public init(oauth2Token: String) { + self.swift = Auth.TokenFromOAuth1Result(oauth2Token: oauth2Token) + } + + let swift: Auth.TokenFromOAuth1Result + + public init(swift: Auth.TokenFromOAuth1Result) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TokenScopeError struct +@objc +public class DBXAuthTokenScopeError: NSObject { + /// The required scope to access the route. + @objc + public var requiredScope: String { swift.requiredScope } + + @objc + public init(requiredScope: String) { + self.swift = Auth.TokenScopeError(requiredScope: requiredScope) + } + + let swift: Auth.TokenScopeError + + public init(swift: Auth.TokenScopeError) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthAppAuthRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthAppAuthRoutes.swift new file mode 100644 index 000000000..d0390e126 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthAppAuthRoutes.swift @@ -0,0 +1,88 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the auth namespace +/// For Swift routes see AuthAppAuthRoutes +@objc +public class DBXAuthAppAuthRoutes: NSObject { + private let swift: AuthAppAuthRoutes + init(swift: AuthAppAuthRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient +} + +@objc +public class DBXAuthTokenFromOauth1RpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAuthTokenFromOAuth1Result?, DBXAuthTokenFromOAuth1Error?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAuthTokenFromOAuth1Result?, DBXAuthTokenFromOAuth1Error?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXAuthTokenFromOAuth1Error? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXAuthTokenFromOAuth1Error(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAuthTokenFromOAuth1Result? + if let swift = result { + objc = DBXAuthTokenFromOAuth1Result(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthRoutes.swift new file mode 100644 index 000000000..a6002ba38 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuthRoutes.swift @@ -0,0 +1,85 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the auth namespace +/// For Swift routes see AuthRoutes +@objc +public class DBXAuthRoutes: NSObject { + private let swift: AuthRoutes + init(swift: AuthRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Disables the access token used to authenticate the call. If there is a corresponding refresh token for the + /// access token, this disables that refresh token, as well as any other access tokens for that refresh token. + /// + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a `Void` object + /// on failure. + @objc + @discardableResult public func tokenRevoke() -> DBXAuthTokenRevokeRpcRequest { + let swift = swift.tokenRevoke() + return DBXAuthTokenRevokeRpcRequest(swift: swift) + } +} + +@objc +public class DBXAuthTokenRevokeRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + completionHandler(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXBase.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXBase.swift new file mode 100644 index 000000000..f1368e347 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXBase.swift @@ -0,0 +1,74 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible DropboxBase. +/// For Swift see DropboxBase. +@objc +public class DBXDropboxBase: NSObject { + let swift: DropboxBase + + /// Routes within the account namespace. See DBAccountRoutes for details. + @objc + public var account: DBXAccountRoutes! + /// Routes within the auth namespace. See DBAuthRoutes for details. + @objc + public var auth: DBXAuthRoutes! + /// Routes within the check namespace. See DBCheckRoutes for details. + @objc + public var check: DBXCheckRoutes! + /// Routes within the contacts namespace. See DBContactsRoutes for details. + @objc + public var contacts: DBXContactsRoutes! + /// Routes within the fileProperties namespace. See DBFilePropertiesRoutes for details. + @objc + public var fileProperties: DBXFilePropertiesRoutes! + /// Routes within the fileRequests namespace. See DBFileRequestsRoutes for details. + @objc + public var fileRequests: DBXFileRequestsRoutes! + /// Routes within the files namespace. See DBFilesRoutes for details. + @objc + public var files: DBXFilesRoutes! + /// Routes within the openid namespace. See DBOpenidRoutes for details. + @objc + public var openid: DBXOpenidRoutes! + /// Routes within the paper namespace. See DBPaperRoutes for details. + @objc + public var paper: DBXPaperRoutes! + /// Routes within the sharing namespace. See DBSharingRoutes for details. + @objc + public var sharing: DBXSharingRoutes! + /// Routes within the teamLog namespace. See DBTeamLogRoutes for details. + @objc + public var teamLog: DBXTeamLogRoutes! + /// Routes within the users namespace. See DBUsersRoutes for details. + @objc + public var users: DBXUsersRoutes! + + @objc + public convenience init(client: DBXDropboxTransportClient) { + self.init(swiftClient: client.swift) + } + + public init(swiftClient: DropboxTransportClient) { + self.swift = DropboxBase(client: swiftClient) + + self.account = DBXAccountRoutes(swift: swift.account) + self.auth = DBXAuthRoutes(swift: swift.auth) + self.check = DBXCheckRoutes(swift: swift.check) + self.contacts = DBXContactsRoutes(swift: swift.contacts) + self.fileProperties = DBXFilePropertiesRoutes(swift: swift.fileProperties) + self.fileRequests = DBXFileRequestsRoutes(swift: swift.fileRequests) + self.files = DBXFilesRoutes(swift: swift.files) + self.openid = DBXOpenidRoutes(swift: swift.openid) + self.paper = DBXPaperRoutes(swift: swift.paper) + self.sharing = DBXSharingRoutes(swift: swift.sharing) + self.teamLog = DBXTeamLogRoutes(swift: swift.teamLog) + self.users = DBXUsersRoutes(swift: swift.users) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseApp.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseApp.swift new file mode 100644 index 000000000..b4d214fef --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseApp.swift @@ -0,0 +1,34 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible DropboxAppBase. +/// For Swift see DropboxAppBase. +@objc +public class DBXDropboxAppBase: NSObject { + let swift: DropboxAppBase + + /// Routes within the auth namespace. See DBAuthAppAuthRoutes for details. + @objc + public var auth: DBXAuthAppAuthRoutes! + /// Routes within the check namespace. See DBCheckAppAuthRoutes for details. + @objc + public var check: DBXCheckAppAuthRoutes! + + @objc + public convenience init(client: DBXDropboxTransportClient) { + self.init(swiftClient: client.swift) + } + + public init(swiftClient: DropboxTransportClient) { + self.swift = DropboxAppBase(client: swiftClient) + + self.auth = DBXAuthAppAuthRoutes(swift: swift.auth) + self.check = DBXCheckAppAuthRoutes(swift: swift.check) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseTeam.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseTeam.swift new file mode 100644 index 000000000..e1fd6b35e --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXBaseTeam.swift @@ -0,0 +1,30 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible DropboxTeamBase. +/// For Swift see DropboxTeamBase. +@objc +public class DBXDropboxTeamBase: NSObject { + let swift: DropboxTeamBase + + /// Routes within the team namespace. See DBTeamRoutes for details. + @objc + public var team: DBXTeamRoutes! + + @objc + public convenience init(client: DBXDropboxTransportClient) { + self.init(swiftClient: client.swift) + } + + public init(swiftClient: DropboxTransportClient) { + self.swift = DropboxTeamBase(client: swiftClient) + + self.team = DBXTeamRoutes(swift: swift.team) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheck.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheck.swift new file mode 100644 index 000000000..7a8deb7c0 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheck.swift @@ -0,0 +1,55 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the check namespace +/// For Swift see check + +/// Contains the arguments to be sent to the Dropbox servers. +@objc +public class DBXCheckEchoArg: NSObject { + /// The string that you'd like to be echoed back to you. + @objc + public var query: String { swift.query } + + @objc + public init(query: String) { + self.swift = Check.EchoArg(query: query) + } + + let swift: Check.EchoArg + + public init(swift: Check.EchoArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// EchoResult contains the result returned from the Dropbox servers. +@objc +public class DBXCheckEchoResult: NSObject { + /// If everything worked correctly, this would be the same as query. + @objc + public var result: String { swift.result } + + @objc + public init(result: String) { + self.swift = Check.EchoResult(result: result) + } + + let swift: Check.EchoResult + + public init(swift: Check.EchoResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckAppAuthRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckAppAuthRoutes.swift new file mode 100644 index 000000000..ee221591e --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckAppAuthRoutes.swift @@ -0,0 +1,105 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the check namespace +/// For Swift routes see CheckAppAuthRoutes +@objc +public class DBXCheckAppAuthRoutes: NSObject { + private let swift: CheckAppAuthRoutes + init(swift: CheckAppAuthRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// This endpoint performs App Authentication, validating the supplied app key and secret, and returns the supplied + /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you + /// receive an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API + /// infrastructure is working and that the app key and secret valid. + /// + /// - parameter query: The string that you'd like to be echoed back to you. + /// + /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a + /// `Void` object on failure. + @objc + @discardableResult public func app(query: String) -> DBXCheckAppRpcRequest { + let swift = swift.app(query: query) + return DBXCheckAppRpcRequest(swift: swift) + } + + /// This endpoint performs App Authentication, validating the supplied app key and secret, and returns the supplied + /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you + /// receive an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API + /// infrastructure is working and that the app key and secret valid. + /// + /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a + /// `Void` object on failure. + @objc + @discardableResult public func app() -> DBXCheckAppRpcRequest { + let swift = swift.app() + return DBXCheckAppRpcRequest(swift: swift) + } +} + +@objc +public class DBXCheckAppRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXCheckEchoResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXCheckEchoResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXCheckEchoResult? + if let swift = result { + objc = DBXCheckEchoResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckRoutes.swift new file mode 100644 index 000000000..4f7a16f19 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCheckRoutes.swift @@ -0,0 +1,109 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the check namespace +/// For Swift routes see CheckRoutes +@objc +public class DBXCheckRoutes: NSObject { + private let swift: CheckRoutes + init(swift: CheckRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// This endpoint performs User Authentication, validating the supplied access token, and returns the supplied + /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you + /// receive an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API + /// infrastructure is working and that the access token is valid. + /// + /// - scope: account_info.read + /// + /// - parameter query: The string that you'd like to be echoed back to you. + /// + /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a + /// `Void` object on failure. + @objc + @discardableResult public func user(query: String) -> DBXCheckUserRpcRequest { + let swift = swift.user(query: query) + return DBXCheckUserRpcRequest(swift: swift) + } + + /// This endpoint performs User Authentication, validating the supplied access token, and returns the supplied + /// string, to allow you to test your code and connection to the Dropbox API. It has no other effect. If you + /// receive an HTTP 200 response with the supplied query, it indicates at least part of the Dropbox API + /// infrastructure is working and that the access token is valid. + /// + /// - scope: account_info.read + /// + /// - returns: Through the response callback, the caller will receive a `Check.EchoResult` object on success or a + /// `Void` object on failure. + @objc + @discardableResult public func user() -> DBXCheckUserRpcRequest { + let swift = swift.user() + return DBXCheckUserRpcRequest(swift: swift) + } +} + +@objc +public class DBXCheckUserRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXCheckEchoResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXCheckEchoResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXCheckEchoResult? + if let swift = result { + objc = DBXCheckEchoResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXCommon.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCommon.swift new file mode 100644 index 000000000..4f2ee9fa9 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXCommon.swift @@ -0,0 +1,250 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the common namespace +/// For Swift see common + +/// Objective-C compatible PathRoot union +@objc +public class DBXCommonPathRoot: NSObject { + let swift: Common.PathRoot + + public init(swift: Common.PathRoot) { + self.swift = swift + } + + public static func factory(swift: Common.PathRoot) -> DBXCommonPathRoot { + switch swift { + case .home: + return DBXCommonPathRootHome() + case .root(let swiftArg): + let arg = swiftArg + return DBXCommonPathRootRoot(arg) + case .namespaceId(let swiftArg): + let arg = swiftArg + return DBXCommonPathRootNamespaceId(arg) + case .other: + return DBXCommonPathRootOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHome: DBXCommonPathRootHome? { + self as? DBXCommonPathRootHome + } + + @objc + public var asRoot: DBXCommonPathRootRoot? { + self as? DBXCommonPathRootRoot + } + + @objc + public var asNamespaceId: DBXCommonPathRootNamespaceId? { + self as? DBXCommonPathRootNamespaceId + } + + @objc + public var asOther: DBXCommonPathRootOther? { + self as? DBXCommonPathRootOther + } +} + +/// Paths are relative to the authenticating user's home namespace, whether or not that user belongs to a team. +@objc +public class DBXCommonPathRootHome: DBXCommonPathRoot { + @objc + public init() { + let swift = Common.PathRoot.home + super.init(swift: swift) + } +} + +/// Paths are relative to the authenticating user's root namespace (This results in invalidRoot in PathRootError +/// if the user's root namespace has changed.). +@objc +public class DBXCommonPathRootRoot: DBXCommonPathRoot { + @objc + public var root: String + + @objc + public init(_ arg: String) { + self.root = arg + let swift = Common.PathRoot.root(arg) + super.init(swift: swift) + } +} + +/// Paths are relative to given namespace id (This results in noPermission in PathRootError if you don't have +/// access to this namespace.). +@objc +public class DBXCommonPathRootNamespaceId: DBXCommonPathRoot { + @objc + public var namespaceId: String + + @objc + public init(_ arg: String) { + self.namespaceId = arg + let swift = Common.PathRoot.namespaceId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXCommonPathRootOther: DBXCommonPathRoot { + @objc + public init() { + let swift = Common.PathRoot.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PathRootError union +@objc +public class DBXCommonPathRootError: NSObject { + let swift: Common.PathRootError + + public init(swift: Common.PathRootError) { + self.swift = swift + } + + public static func factory(swift: Common.PathRootError) -> DBXCommonPathRootError { + switch swift { + case .invalidRoot(let swiftArg): + let arg = DBXCommonRootInfo(swift: swiftArg) + return DBXCommonPathRootErrorInvalidRoot(arg) + case .noPermission: + return DBXCommonPathRootErrorNoPermission() + case .other: + return DBXCommonPathRootErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidRoot: DBXCommonPathRootErrorInvalidRoot? { + self as? DBXCommonPathRootErrorInvalidRoot + } + + @objc + public var asNoPermission: DBXCommonPathRootErrorNoPermission? { + self as? DBXCommonPathRootErrorNoPermission + } + + @objc + public var asOther: DBXCommonPathRootErrorOther? { + self as? DBXCommonPathRootErrorOther + } +} + +/// The root namespace id in Dropbox-API-Path-Root header is not valid. The value of this error is the user's +/// latest root info. +@objc +public class DBXCommonPathRootErrorInvalidRoot: DBXCommonPathRootError { + @objc + public var invalidRoot: DBXCommonRootInfo + + @objc + public init(_ arg: DBXCommonRootInfo) { + self.invalidRoot = arg + let swift = Common.PathRootError.invalidRoot(arg.swift) + super.init(swift: swift) + } +} + +/// You don't have permission to access the namespace id in Dropbox-API-Path-Root header. +@objc +public class DBXCommonPathRootErrorNoPermission: DBXCommonPathRootError { + @objc + public init() { + let swift = Common.PathRootError.noPermission + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXCommonPathRootErrorOther: DBXCommonPathRootError { + @objc + public init() { + let swift = Common.PathRootError.other + super.init(swift: swift) + } +} + +/// Information about current user's root. +@objc +public class DBXCommonRootInfo: NSObject { + /// The namespace ID for user's root namespace. It will be the namespace ID of the shared team root if the user + /// is member of a team with a separate team root. Otherwise it will be same as homeNamespaceId in RootInfo. + @objc + public var rootNamespaceId: String { swift.rootNamespaceId } + /// The namespace ID for user's home namespace. + @objc + public var homeNamespaceId: String { swift.homeNamespaceId } + + @objc + public init(rootNamespaceId: String, homeNamespaceId: String) { + self.swift = Common.RootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId) + } + + let swift: Common.RootInfo + + public init(swift: Common.RootInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Root info when user is member of a team with a separate root namespace ID. +@objc +public class DBXCommonTeamRootInfo: DBXCommonRootInfo { + /// The path for user's home directory under the shared team root. + @objc + public var homePath: String { subSwift.homePath } + + @objc + public init(rootNamespaceId: String, homeNamespaceId: String, homePath: String) { + let swift = Common.TeamRootInfo(rootNamespaceId: rootNamespaceId, homeNamespaceId: homeNamespaceId, homePath: homePath) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Common.TeamRootInfo + + public init(swift: Common.TeamRootInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Root info when user is not member of a team or the user is a member of a team and the team does not have a +/// separate root namespace. +@objc +public class DBXCommonUserRootInfo: DBXCommonRootInfo { + let subSwift: Common.UserRootInfo + + public init(swift: Common.UserRootInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXContacts.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXContacts.swift new file mode 100644 index 000000000..7c1cb266b --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXContacts.swift @@ -0,0 +1,91 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the contacts namespace +/// For Swift see contacts + +/// Objective-C compatible DeleteManualContactsArg struct +@objc +public class DBXContactsDeleteManualContactsArg: NSObject { + /// List of manually added contacts to be deleted. + @objc + public var emailAddresses: [String] { swift.emailAddresses } + + @objc + public init(emailAddresses: [String]) { + self.swift = Contacts.DeleteManualContactsArg(emailAddresses: emailAddresses) + } + + let swift: Contacts.DeleteManualContactsArg + + public init(swift: Contacts.DeleteManualContactsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeleteManualContactsError union +@objc +public class DBXContactsDeleteManualContactsError: NSObject { + let swift: Contacts.DeleteManualContactsError + + public init(swift: Contacts.DeleteManualContactsError) { + self.swift = swift + } + + public static func factory(swift: Contacts.DeleteManualContactsError) -> DBXContactsDeleteManualContactsError { + switch swift { + case .contactsNotFound(let swiftArg): + let arg = swiftArg + return DBXContactsDeleteManualContactsErrorContactsNotFound(arg) + case .other: + return DBXContactsDeleteManualContactsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asContactsNotFound: DBXContactsDeleteManualContactsErrorContactsNotFound? { + self as? DBXContactsDeleteManualContactsErrorContactsNotFound + } + + @objc + public var asOther: DBXContactsDeleteManualContactsErrorOther? { + self as? DBXContactsDeleteManualContactsErrorOther + } +} + +/// Can't delete contacts from this list. Make sure the list only has manually added contacts. The deletion was +/// cancelled. +@objc +public class DBXContactsDeleteManualContactsErrorContactsNotFound: DBXContactsDeleteManualContactsError { + @objc + public var contactsNotFound: [String] + + @objc + public init(_ arg: [String]) { + self.contactsNotFound = arg + let swift = Contacts.DeleteManualContactsError.contactsNotFound(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXContactsDeleteManualContactsErrorOther: DBXContactsDeleteManualContactsError { + @objc + public init() { + let swift = Contacts.DeleteManualContactsError.other + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXContactsRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXContactsRoutes.swift new file mode 100644 index 000000000..25b160b46 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXContactsRoutes.swift @@ -0,0 +1,164 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the contacts namespace +/// For Swift routes see ContactsRoutes +@objc +public class DBXContactsRoutes: NSObject { + private let swift: ContactsRoutes + init(swift: ContactsRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Removes all manually added contacts. You'll still keep contacts who are on your team or who you imported. New + /// contacts will be added when you share. + /// + /// - scope: contacts.write + /// + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a `Void` object + /// on failure. + @objc + @discardableResult public func deleteManualContacts() -> DBXContactsDeleteManualContactsRpcRequest { + let swift = swift.deleteManualContacts() + return DBXContactsDeleteManualContactsRpcRequest(swift: swift) + } + + /// Removes manually added contacts from the given list. + /// + /// - scope: contacts.write + /// + /// - parameter emailAddresses: List of manually added contacts to be deleted. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Contacts.DeleteManualContactsError` object on failure. + @objc + @discardableResult public func deleteManualContactsBatch(emailAddresses: [String]) -> DBXContactsDeleteManualContactsBatchRpcRequest { + let swift = swift.deleteManualContactsBatch(emailAddresses: emailAddresses) + return DBXContactsDeleteManualContactsBatchRpcRequest(swift: swift) + } +} + +@objc +public class DBXContactsDeleteManualContactsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + completionHandler(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 DBXContactsDeleteManualContactsBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXContactsDeleteManualContactsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXContactsDeleteManualContactsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXContactsDeleteManualContactsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXContactsDeleteManualContactsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXDropboxBaseRequestBox.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXDropboxBaseRequestBox.swift new file mode 100644 index 000000000..2cfe4f105 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXDropboxBaseRequestBox.swift @@ -0,0 +1,53 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +extension DropboxBaseRequestBox { + var objc: DBXRequest { + switch self { + case .alphaUpload(let swift): + return DBXFilesAlphaUploadUploadRequest(swift: swift) + case .download(let swift): + return DBXFilesDownloadDownloadRequestFile(swift: swift) + case .downloadZip(let swift): + return DBXFilesDownloadZipDownloadRequestFile(swift: swift) + case .export(let swift): + return DBXFilesExportDownloadRequestFile(swift: swift) + case .getPreview(let swift): + return DBXFilesGetPreviewDownloadRequestFile(swift: swift) + case .getThumbnail(let swift): + return DBXFilesGetThumbnailDownloadRequestFile(swift: swift) + case .getThumbnailV2(let swift): + return DBXFilesGetThumbnailDownloadRequestFileV2(swift: swift) + case .paperCreate(let swift): + return DBXFilesPaperCreateUploadRequest(swift: swift) + case .paperUpdate(let swift): + return DBXFilesPaperUpdateUploadRequest(swift: swift) + case .upload(let swift): + return DBXFilesUploadUploadRequest(swift: swift) + case .uploadSessionAppendV2(let swift): + return DBXFilesUploadSessionAppendUploadRequestV2(swift: swift) + case .uploadSessionAppend(let swift): + return DBXFilesUploadSessionAppendUploadRequest(swift: swift) + case .uploadSessionFinish(let swift): + return DBXFilesUploadSessionFinishUploadRequest(swift: swift) + case .uploadSessionStart(let swift): + return DBXFilesUploadSessionStartUploadRequest(swift: swift) + case .docsCreate(let swift): + return DBXPaperDocsCreateUploadRequest(swift: swift) + case .docsDownload(let swift): + return DBXPaperDocsDownloadDownloadRequestFile(swift: swift) + case .docsUpdate(let swift): + return DBXPaperDocsUpdateUploadRequest(swift: swift) + case .getSharedLinkFile(let swift): + return DBXSharingGetSharedLinkFileDownloadRequestFile(swift: swift) + default: + fatalError("For Obj-C compatibility, add this route to the Objective-C compatibility module allow-list") + } + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileProperties.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileProperties.swift new file mode 100644 index 000000000..9e7964b32 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileProperties.swift @@ -0,0 +1,2200 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the file_properties namespace +/// For Swift see file_properties + +/// Objective-C compatible AddPropertiesArg struct +@objc +public class DBXFilePropertiesAddPropertiesArg: NSObject { + /// A unique identifier for the file or folder. + @objc + public var path: String { swift.path } + /// The property groups which are to be added to a Dropbox file. No two groups in the input should refer to the + /// same template. + @objc + public var propertyGroups: [DBXFilePropertiesPropertyGroup] { swift.propertyGroups.map { DBXFilePropertiesPropertyGroup(swift: $0) } } + + @objc + public init(path: String, propertyGroups: [DBXFilePropertiesPropertyGroup]) { + self.swift = FileProperties.AddPropertiesArg(path: path, propertyGroups: propertyGroups.map(\.swift)) + } + + let swift: FileProperties.AddPropertiesArg + + public init(swift: FileProperties.AddPropertiesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TemplateError union +@objc +public class DBXFilePropertiesTemplateError: NSObject { + let swift: FileProperties.TemplateError + + public init(swift: FileProperties.TemplateError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.TemplateError) -> DBXFilePropertiesTemplateError { + switch swift { + case .templateNotFound(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesTemplateErrorTemplateNotFound(arg) + case .restrictedContent: + return DBXFilePropertiesTemplateErrorRestrictedContent() + case .other: + return DBXFilePropertiesTemplateErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemplateNotFound: DBXFilePropertiesTemplateErrorTemplateNotFound? { + self as? DBXFilePropertiesTemplateErrorTemplateNotFound + } + + @objc + public var asRestrictedContent: DBXFilePropertiesTemplateErrorRestrictedContent? { + self as? DBXFilePropertiesTemplateErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesTemplateErrorOther? { + self as? DBXFilePropertiesTemplateErrorOther + } +} + +/// Template does not exist for the given identifier. +@objc +public class DBXFilePropertiesTemplateErrorTemplateNotFound: DBXFilePropertiesTemplateError { + @objc + public var templateNotFound: String + + @objc + public init(_ arg: String) { + self.templateNotFound = arg + let swift = FileProperties.TemplateError.templateNotFound(arg) + super.init(swift: swift) + } +} + +/// You do not have permission to modify this template. +@objc +public class DBXFilePropertiesTemplateErrorRestrictedContent: DBXFilePropertiesTemplateError { + @objc + public init() { + let swift = FileProperties.TemplateError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesTemplateErrorOther: DBXFilePropertiesTemplateError { + @objc + public init() { + let swift = FileProperties.TemplateError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PropertiesError union +@objc +public class DBXFilePropertiesPropertiesError: NSObject { + let swift: FileProperties.PropertiesError + + public init(swift: FileProperties.PropertiesError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.PropertiesError) -> DBXFilePropertiesPropertiesError { + switch swift { + case .templateNotFound(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesPropertiesErrorTemplateNotFound(arg) + case .restrictedContent: + return DBXFilePropertiesPropertiesErrorRestrictedContent() + case .other: + return DBXFilePropertiesPropertiesErrorOther() + case .path(let swiftArg): + let arg = DBXFilePropertiesLookupError(swift: swiftArg) + return DBXFilePropertiesPropertiesErrorPath(arg) + case .unsupportedFolder: + return DBXFilePropertiesPropertiesErrorUnsupportedFolder() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemplateNotFound: DBXFilePropertiesPropertiesErrorTemplateNotFound? { + self as? DBXFilePropertiesPropertiesErrorTemplateNotFound + } + + @objc + public var asRestrictedContent: DBXFilePropertiesPropertiesErrorRestrictedContent? { + self as? DBXFilePropertiesPropertiesErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesPropertiesErrorOther? { + self as? DBXFilePropertiesPropertiesErrorOther + } + + @objc + public var asPath: DBXFilePropertiesPropertiesErrorPath? { + self as? DBXFilePropertiesPropertiesErrorPath + } + + @objc + public var asUnsupportedFolder: DBXFilePropertiesPropertiesErrorUnsupportedFolder? { + self as? DBXFilePropertiesPropertiesErrorUnsupportedFolder + } +} + +/// Template does not exist for the given identifier. +@objc +public class DBXFilePropertiesPropertiesErrorTemplateNotFound: DBXFilePropertiesPropertiesError { + @objc + public var templateNotFound: String + + @objc + public init(_ arg: String) { + self.templateNotFound = arg + let swift = FileProperties.PropertiesError.templateNotFound(arg) + super.init(swift: swift) + } +} + +/// You do not have permission to modify this template. +@objc +public class DBXFilePropertiesPropertiesErrorRestrictedContent: DBXFilePropertiesPropertiesError { + @objc + public init() { + let swift = FileProperties.PropertiesError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesPropertiesErrorOther: DBXFilePropertiesPropertiesError { + @objc + public init() { + let swift = FileProperties.PropertiesError.other + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesPropertiesErrorPath: DBXFilePropertiesPropertiesError { + @objc + public var path: DBXFilePropertiesLookupError + + @objc + public init(_ arg: DBXFilePropertiesLookupError) { + self.path = arg + let swift = FileProperties.PropertiesError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This folder cannot be tagged. Tagging folders is not supported for team-owned templates. +@objc +public class DBXFilePropertiesPropertiesErrorUnsupportedFolder: DBXFilePropertiesPropertiesError { + @objc + public init() { + let swift = FileProperties.PropertiesError.unsupportedFolder + super.init(swift: swift) + } +} + +/// Objective-C compatible InvalidPropertyGroupError union +@objc +public class DBXFilePropertiesInvalidPropertyGroupError: NSObject { + let swift: FileProperties.InvalidPropertyGroupError + + public init(swift: FileProperties.InvalidPropertyGroupError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.InvalidPropertyGroupError) -> DBXFilePropertiesInvalidPropertyGroupError { + switch swift { + case .templateNotFound(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesInvalidPropertyGroupErrorTemplateNotFound(arg) + case .restrictedContent: + return DBXFilePropertiesInvalidPropertyGroupErrorRestrictedContent() + case .other: + return DBXFilePropertiesInvalidPropertyGroupErrorOther() + case .path(let swiftArg): + let arg = DBXFilePropertiesLookupError(swift: swiftArg) + return DBXFilePropertiesInvalidPropertyGroupErrorPath(arg) + case .unsupportedFolder: + return DBXFilePropertiesInvalidPropertyGroupErrorUnsupportedFolder() + case .propertyFieldTooLarge: + return DBXFilePropertiesInvalidPropertyGroupErrorPropertyFieldTooLarge() + case .doesNotFitTemplate: + return DBXFilePropertiesInvalidPropertyGroupErrorDoesNotFitTemplate() + case .duplicatePropertyGroups: + return DBXFilePropertiesInvalidPropertyGroupErrorDuplicatePropertyGroups() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemplateNotFound: DBXFilePropertiesInvalidPropertyGroupErrorTemplateNotFound? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorTemplateNotFound + } + + @objc + public var asRestrictedContent: DBXFilePropertiesInvalidPropertyGroupErrorRestrictedContent? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesInvalidPropertyGroupErrorOther? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorOther + } + + @objc + public var asPath: DBXFilePropertiesInvalidPropertyGroupErrorPath? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorPath + } + + @objc + public var asUnsupportedFolder: DBXFilePropertiesInvalidPropertyGroupErrorUnsupportedFolder? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorUnsupportedFolder + } + + @objc + public var asPropertyFieldTooLarge: DBXFilePropertiesInvalidPropertyGroupErrorPropertyFieldTooLarge? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorPropertyFieldTooLarge + } + + @objc + public var asDoesNotFitTemplate: DBXFilePropertiesInvalidPropertyGroupErrorDoesNotFitTemplate? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorDoesNotFitTemplate + } + + @objc + public var asDuplicatePropertyGroups: DBXFilePropertiesInvalidPropertyGroupErrorDuplicatePropertyGroups? { + self as? DBXFilePropertiesInvalidPropertyGroupErrorDuplicatePropertyGroups + } +} + +/// Template does not exist for the given identifier. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorTemplateNotFound: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public var templateNotFound: String + + @objc + public init(_ arg: String) { + self.templateNotFound = arg + let swift = FileProperties.InvalidPropertyGroupError.templateNotFound(arg) + super.init(swift: swift) + } +} + +/// You do not have permission to modify this template. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorRestrictedContent: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public init() { + let swift = FileProperties.InvalidPropertyGroupError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorOther: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public init() { + let swift = FileProperties.InvalidPropertyGroupError.other + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorPath: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public var path: DBXFilePropertiesLookupError + + @objc + public init(_ arg: DBXFilePropertiesLookupError) { + self.path = arg + let swift = FileProperties.InvalidPropertyGroupError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This folder cannot be tagged. Tagging folders is not supported for team-owned templates. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorUnsupportedFolder: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public init() { + let swift = FileProperties.InvalidPropertyGroupError.unsupportedFolder + super.init(swift: swift) + } +} + +/// One or more of the supplied property field values is too large. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorPropertyFieldTooLarge: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public init() { + let swift = FileProperties.InvalidPropertyGroupError.propertyFieldTooLarge + super.init(swift: swift) + } +} + +/// One or more of the supplied property fields does not conform to the template specifications. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorDoesNotFitTemplate: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public init() { + let swift = FileProperties.InvalidPropertyGroupError.doesNotFitTemplate + super.init(swift: swift) + } +} + +/// There are 2 or more property groups referring to the same templates in the input. +@objc +public class DBXFilePropertiesInvalidPropertyGroupErrorDuplicatePropertyGroups: DBXFilePropertiesInvalidPropertyGroupError { + @objc + public init() { + let swift = FileProperties.InvalidPropertyGroupError.duplicatePropertyGroups + super.init(swift: swift) + } +} + +/// Objective-C compatible AddPropertiesError union +@objc +public class DBXFilePropertiesAddPropertiesError: NSObject { + let swift: FileProperties.AddPropertiesError + + public init(swift: FileProperties.AddPropertiesError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.AddPropertiesError) -> DBXFilePropertiesAddPropertiesError { + switch swift { + case .templateNotFound(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesAddPropertiesErrorTemplateNotFound(arg) + case .restrictedContent: + return DBXFilePropertiesAddPropertiesErrorRestrictedContent() + case .other: + return DBXFilePropertiesAddPropertiesErrorOther() + case .path(let swiftArg): + let arg = DBXFilePropertiesLookupError(swift: swiftArg) + return DBXFilePropertiesAddPropertiesErrorPath(arg) + case .unsupportedFolder: + return DBXFilePropertiesAddPropertiesErrorUnsupportedFolder() + case .propertyFieldTooLarge: + return DBXFilePropertiesAddPropertiesErrorPropertyFieldTooLarge() + case .doesNotFitTemplate: + return DBXFilePropertiesAddPropertiesErrorDoesNotFitTemplate() + case .duplicatePropertyGroups: + return DBXFilePropertiesAddPropertiesErrorDuplicatePropertyGroups() + case .propertyGroupAlreadyExists: + return DBXFilePropertiesAddPropertiesErrorPropertyGroupAlreadyExists() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemplateNotFound: DBXFilePropertiesAddPropertiesErrorTemplateNotFound? { + self as? DBXFilePropertiesAddPropertiesErrorTemplateNotFound + } + + @objc + public var asRestrictedContent: DBXFilePropertiesAddPropertiesErrorRestrictedContent? { + self as? DBXFilePropertiesAddPropertiesErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesAddPropertiesErrorOther? { + self as? DBXFilePropertiesAddPropertiesErrorOther + } + + @objc + public var asPath: DBXFilePropertiesAddPropertiesErrorPath? { + self as? DBXFilePropertiesAddPropertiesErrorPath + } + + @objc + public var asUnsupportedFolder: DBXFilePropertiesAddPropertiesErrorUnsupportedFolder? { + self as? DBXFilePropertiesAddPropertiesErrorUnsupportedFolder + } + + @objc + public var asPropertyFieldTooLarge: DBXFilePropertiesAddPropertiesErrorPropertyFieldTooLarge? { + self as? DBXFilePropertiesAddPropertiesErrorPropertyFieldTooLarge + } + + @objc + public var asDoesNotFitTemplate: DBXFilePropertiesAddPropertiesErrorDoesNotFitTemplate? { + self as? DBXFilePropertiesAddPropertiesErrorDoesNotFitTemplate + } + + @objc + public var asDuplicatePropertyGroups: DBXFilePropertiesAddPropertiesErrorDuplicatePropertyGroups? { + self as? DBXFilePropertiesAddPropertiesErrorDuplicatePropertyGroups + } + + @objc + public var asPropertyGroupAlreadyExists: DBXFilePropertiesAddPropertiesErrorPropertyGroupAlreadyExists? { + self as? DBXFilePropertiesAddPropertiesErrorPropertyGroupAlreadyExists + } +} + +/// Template does not exist for the given identifier. +@objc +public class DBXFilePropertiesAddPropertiesErrorTemplateNotFound: DBXFilePropertiesAddPropertiesError { + @objc + public var templateNotFound: String + + @objc + public init(_ arg: String) { + self.templateNotFound = arg + let swift = FileProperties.AddPropertiesError.templateNotFound(arg) + super.init(swift: swift) + } +} + +/// You do not have permission to modify this template. +@objc +public class DBXFilePropertiesAddPropertiesErrorRestrictedContent: DBXFilePropertiesAddPropertiesError { + @objc + public init() { + let swift = FileProperties.AddPropertiesError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesAddPropertiesErrorOther: DBXFilePropertiesAddPropertiesError { + @objc + public init() { + let swift = FileProperties.AddPropertiesError.other + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesAddPropertiesErrorPath: DBXFilePropertiesAddPropertiesError { + @objc + public var path: DBXFilePropertiesLookupError + + @objc + public init(_ arg: DBXFilePropertiesLookupError) { + self.path = arg + let swift = FileProperties.AddPropertiesError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This folder cannot be tagged. Tagging folders is not supported for team-owned templates. +@objc +public class DBXFilePropertiesAddPropertiesErrorUnsupportedFolder: DBXFilePropertiesAddPropertiesError { + @objc + public init() { + let swift = FileProperties.AddPropertiesError.unsupportedFolder + super.init(swift: swift) + } +} + +/// One or more of the supplied property field values is too large. +@objc +public class DBXFilePropertiesAddPropertiesErrorPropertyFieldTooLarge: DBXFilePropertiesAddPropertiesError { + @objc + public init() { + let swift = FileProperties.AddPropertiesError.propertyFieldTooLarge + super.init(swift: swift) + } +} + +/// One or more of the supplied property fields does not conform to the template specifications. +@objc +public class DBXFilePropertiesAddPropertiesErrorDoesNotFitTemplate: DBXFilePropertiesAddPropertiesError { + @objc + public init() { + let swift = FileProperties.AddPropertiesError.doesNotFitTemplate + super.init(swift: swift) + } +} + +/// There are 2 or more property groups referring to the same templates in the input. +@objc +public class DBXFilePropertiesAddPropertiesErrorDuplicatePropertyGroups: DBXFilePropertiesAddPropertiesError { + @objc + public init() { + let swift = FileProperties.AddPropertiesError.duplicatePropertyGroups + super.init(swift: swift) + } +} + +/// A property group associated with this template and file already exists. +@objc +public class DBXFilePropertiesAddPropertiesErrorPropertyGroupAlreadyExists: DBXFilePropertiesAddPropertiesError { + @objc + public init() { + let swift = FileProperties.AddPropertiesError.propertyGroupAlreadyExists + super.init(swift: swift) + } +} + +/// Defines how a property group may be structured. +@objc +public class DBXFilePropertiesPropertyGroupTemplate: NSObject { + /// Display name for the template. Template names can be up to 256 bytes. + @objc + public var name: String { swift.name } + /// Description for the template. Template descriptions can be up to 1024 bytes. + @objc + public var description_: String { swift.description_ } + /// Definitions of the property fields associated with this template. There can be up to 32 properties in a + /// single template. + @objc + public var fields: [DBXFilePropertiesPropertyFieldTemplate] { swift.fields.map { DBXFilePropertiesPropertyFieldTemplate(swift: $0) } } + + @objc + public init(name: String, description_: String, fields: [DBXFilePropertiesPropertyFieldTemplate]) { + self.swift = FileProperties.PropertyGroupTemplate(name: name, description_: description_, fields: fields.map(\.swift)) + } + + let swift: FileProperties.PropertyGroupTemplate + + public init(swift: FileProperties.PropertyGroupTemplate) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AddTemplateArg struct +@objc +public class DBXFilePropertiesAddTemplateArg: DBXFilePropertiesPropertyGroupTemplate { + let subSwift: FileProperties.AddTemplateArg + + public init(swift: FileProperties.AddTemplateArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible AddTemplateResult struct +@objc +public class DBXFilePropertiesAddTemplateResult: NSObject { + /// An identifier for template added by See templatesAddForUser or templatesAddForTeam. + @objc + public var templateId: String { swift.templateId } + + @objc + public init(templateId: String) { + self.swift = FileProperties.AddTemplateResult(templateId: templateId) + } + + let swift: FileProperties.AddTemplateResult + + public init(swift: FileProperties.AddTemplateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTemplateArg struct +@objc +public class DBXFilePropertiesGetTemplateArg: NSObject { + /// An identifier for template added by route See templatesAddForUser or templatesAddForTeam. + @objc + public var templateId: String { swift.templateId } + + @objc + public init(templateId: String) { + self.swift = FileProperties.GetTemplateArg(templateId: templateId) + } + + let swift: FileProperties.GetTemplateArg + + public init(swift: FileProperties.GetTemplateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTemplateResult struct +@objc +public class DBXFilePropertiesGetTemplateResult: DBXFilePropertiesPropertyGroupTemplate { + let subSwift: FileProperties.GetTemplateResult + + public init(swift: FileProperties.GetTemplateResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible ListTemplateResult struct +@objc +public class DBXFilePropertiesListTemplateResult: NSObject { + /// List of identifiers for templates added by See templatesAddForUser or templatesAddForTeam. + @objc + public var templateIds: [String] { swift.templateIds } + + @objc + public init(templateIds: [String]) { + self.swift = FileProperties.ListTemplateResult(templateIds: templateIds) + } + + let swift: FileProperties.ListTemplateResult + + public init(swift: FileProperties.ListTemplateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Logical operator to join search queries together. +@objc +public class DBXFilePropertiesLogicalOperator: NSObject { + let swift: FileProperties.LogicalOperator + + public init(swift: FileProperties.LogicalOperator) { + self.swift = swift + } + + public static func factory(swift: FileProperties.LogicalOperator) -> DBXFilePropertiesLogicalOperator { + switch swift { + case .orOperator: + return DBXFilePropertiesLogicalOperatorOrOperator() + case .other: + return DBXFilePropertiesLogicalOperatorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOrOperator: DBXFilePropertiesLogicalOperatorOrOperator? { + self as? DBXFilePropertiesLogicalOperatorOrOperator + } + + @objc + public var asOther: DBXFilePropertiesLogicalOperatorOther? { + self as? DBXFilePropertiesLogicalOperatorOther + } +} + +/// Append a query with an "or" operator. +@objc +public class DBXFilePropertiesLogicalOperatorOrOperator: DBXFilePropertiesLogicalOperator { + @objc + public init() { + let swift = FileProperties.LogicalOperator.orOperator + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesLogicalOperatorOther: DBXFilePropertiesLogicalOperator { + @objc + public init() { + let swift = FileProperties.LogicalOperator.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LookUpPropertiesError union +@objc +public class DBXFilePropertiesLookUpPropertiesError: NSObject { + let swift: FileProperties.LookUpPropertiesError + + public init(swift: FileProperties.LookUpPropertiesError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.LookUpPropertiesError) -> DBXFilePropertiesLookUpPropertiesError { + switch swift { + case .propertyGroupNotFound: + return DBXFilePropertiesLookUpPropertiesErrorPropertyGroupNotFound() + case .other: + return DBXFilePropertiesLookUpPropertiesErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPropertyGroupNotFound: DBXFilePropertiesLookUpPropertiesErrorPropertyGroupNotFound? { + self as? DBXFilePropertiesLookUpPropertiesErrorPropertyGroupNotFound + } + + @objc + public var asOther: DBXFilePropertiesLookUpPropertiesErrorOther? { + self as? DBXFilePropertiesLookUpPropertiesErrorOther + } +} + +/// No property group was found. +@objc +public class DBXFilePropertiesLookUpPropertiesErrorPropertyGroupNotFound: DBXFilePropertiesLookUpPropertiesError { + @objc + public init() { + let swift = FileProperties.LookUpPropertiesError.propertyGroupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesLookUpPropertiesErrorOther: DBXFilePropertiesLookUpPropertiesError { + @objc + public init() { + let swift = FileProperties.LookUpPropertiesError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LookupError union +@objc +public class DBXFilePropertiesLookupError: NSObject { + let swift: FileProperties.LookupError + + public init(swift: FileProperties.LookupError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.LookupError) -> DBXFilePropertiesLookupError { + switch swift { + case .malformedPath(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesLookupErrorMalformedPath(arg) + case .notFound: + return DBXFilePropertiesLookupErrorNotFound() + case .notFile: + return DBXFilePropertiesLookupErrorNotFile() + case .notFolder: + return DBXFilePropertiesLookupErrorNotFolder() + case .restrictedContent: + return DBXFilePropertiesLookupErrorRestrictedContent() + case .other: + return DBXFilePropertiesLookupErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMalformedPath: DBXFilePropertiesLookupErrorMalformedPath? { + self as? DBXFilePropertiesLookupErrorMalformedPath + } + + @objc + public var asNotFound: DBXFilePropertiesLookupErrorNotFound? { + self as? DBXFilePropertiesLookupErrorNotFound + } + + @objc + public var asNotFile: DBXFilePropertiesLookupErrorNotFile? { + self as? DBXFilePropertiesLookupErrorNotFile + } + + @objc + public var asNotFolder: DBXFilePropertiesLookupErrorNotFolder? { + self as? DBXFilePropertiesLookupErrorNotFolder + } + + @objc + public var asRestrictedContent: DBXFilePropertiesLookupErrorRestrictedContent? { + self as? DBXFilePropertiesLookupErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesLookupErrorOther? { + self as? DBXFilePropertiesLookupErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesLookupErrorMalformedPath: DBXFilePropertiesLookupError { + @objc + public var malformedPath: String + + @objc + public init(_ arg: String) { + self.malformedPath = arg + let swift = FileProperties.LookupError.malformedPath(arg) + super.init(swift: swift) + } +} + +/// There is nothing at the given path. +@objc +public class DBXFilePropertiesLookupErrorNotFound: DBXFilePropertiesLookupError { + @objc + public init() { + let swift = FileProperties.LookupError.notFound + super.init(swift: swift) + } +} + +/// We were expecting a file, but the given path refers to something that isn't a file. +@objc +public class DBXFilePropertiesLookupErrorNotFile: DBXFilePropertiesLookupError { + @objc + public init() { + let swift = FileProperties.LookupError.notFile + super.init(swift: swift) + } +} + +/// We were expecting a folder, but the given path refers to something that isn't a folder. +@objc +public class DBXFilePropertiesLookupErrorNotFolder: DBXFilePropertiesLookupError { + @objc + public init() { + let swift = FileProperties.LookupError.notFolder + super.init(swift: swift) + } +} + +/// The file cannot be transferred because the content is restricted. For example, we might restrict a file due +/// to legal requirements. +@objc +public class DBXFilePropertiesLookupErrorRestrictedContent: DBXFilePropertiesLookupError { + @objc + public init() { + let swift = FileProperties.LookupError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesLookupErrorOther: DBXFilePropertiesLookupError { + @objc + public init() { + let swift = FileProperties.LookupError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ModifyTemplateError union +@objc +public class DBXFilePropertiesModifyTemplateError: NSObject { + let swift: FileProperties.ModifyTemplateError + + public init(swift: FileProperties.ModifyTemplateError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.ModifyTemplateError) -> DBXFilePropertiesModifyTemplateError { + switch swift { + case .templateNotFound(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesModifyTemplateErrorTemplateNotFound(arg) + case .restrictedContent: + return DBXFilePropertiesModifyTemplateErrorRestrictedContent() + case .other: + return DBXFilePropertiesModifyTemplateErrorOther() + case .conflictingPropertyNames: + return DBXFilePropertiesModifyTemplateErrorConflictingPropertyNames() + case .tooManyProperties: + return DBXFilePropertiesModifyTemplateErrorTooManyProperties() + case .tooManyTemplates: + return DBXFilePropertiesModifyTemplateErrorTooManyTemplates() + case .templateAttributeTooLarge: + return DBXFilePropertiesModifyTemplateErrorTemplateAttributeTooLarge() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemplateNotFound: DBXFilePropertiesModifyTemplateErrorTemplateNotFound? { + self as? DBXFilePropertiesModifyTemplateErrorTemplateNotFound + } + + @objc + public var asRestrictedContent: DBXFilePropertiesModifyTemplateErrorRestrictedContent? { + self as? DBXFilePropertiesModifyTemplateErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesModifyTemplateErrorOther? { + self as? DBXFilePropertiesModifyTemplateErrorOther + } + + @objc + public var asConflictingPropertyNames: DBXFilePropertiesModifyTemplateErrorConflictingPropertyNames? { + self as? DBXFilePropertiesModifyTemplateErrorConflictingPropertyNames + } + + @objc + public var asTooManyProperties: DBXFilePropertiesModifyTemplateErrorTooManyProperties? { + self as? DBXFilePropertiesModifyTemplateErrorTooManyProperties + } + + @objc + public var asTooManyTemplates: DBXFilePropertiesModifyTemplateErrorTooManyTemplates? { + self as? DBXFilePropertiesModifyTemplateErrorTooManyTemplates + } + + @objc + public var asTemplateAttributeTooLarge: DBXFilePropertiesModifyTemplateErrorTemplateAttributeTooLarge? { + self as? DBXFilePropertiesModifyTemplateErrorTemplateAttributeTooLarge + } +} + +/// Template does not exist for the given identifier. +@objc +public class DBXFilePropertiesModifyTemplateErrorTemplateNotFound: DBXFilePropertiesModifyTemplateError { + @objc + public var templateNotFound: String + + @objc + public init(_ arg: String) { + self.templateNotFound = arg + let swift = FileProperties.ModifyTemplateError.templateNotFound(arg) + super.init(swift: swift) + } +} + +/// You do not have permission to modify this template. +@objc +public class DBXFilePropertiesModifyTemplateErrorRestrictedContent: DBXFilePropertiesModifyTemplateError { + @objc + public init() { + let swift = FileProperties.ModifyTemplateError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesModifyTemplateErrorOther: DBXFilePropertiesModifyTemplateError { + @objc + public init() { + let swift = FileProperties.ModifyTemplateError.other + super.init(swift: swift) + } +} + +/// A property field key with that name already exists in the template. +@objc +public class DBXFilePropertiesModifyTemplateErrorConflictingPropertyNames: DBXFilePropertiesModifyTemplateError { + @objc + public init() { + let swift = FileProperties.ModifyTemplateError.conflictingPropertyNames + super.init(swift: swift) + } +} + +/// There are too many properties in the changed template. The maximum number of properties per template is 32. +@objc +public class DBXFilePropertiesModifyTemplateErrorTooManyProperties: DBXFilePropertiesModifyTemplateError { + @objc + public init() { + let swift = FileProperties.ModifyTemplateError.tooManyProperties + super.init(swift: swift) + } +} + +/// There are too many templates for the team. +@objc +public class DBXFilePropertiesModifyTemplateErrorTooManyTemplates: DBXFilePropertiesModifyTemplateError { + @objc + public init() { + let swift = FileProperties.ModifyTemplateError.tooManyTemplates + super.init(swift: swift) + } +} + +/// The template name, description or one or more of the property field keys is too large. +@objc +public class DBXFilePropertiesModifyTemplateErrorTemplateAttributeTooLarge: DBXFilePropertiesModifyTemplateError { + @objc + public init() { + let swift = FileProperties.ModifyTemplateError.templateAttributeTooLarge + super.init(swift: swift) + } +} + +/// Objective-C compatible OverwritePropertyGroupArg struct +@objc +public class DBXFilePropertiesOverwritePropertyGroupArg: NSObject { + /// A unique identifier for the file or folder. + @objc + public var path: String { swift.path } + /// The property groups "snapshot" updates to force apply. No two groups in the input should refer to the same + /// template. + @objc + public var propertyGroups: [DBXFilePropertiesPropertyGroup] { swift.propertyGroups.map { DBXFilePropertiesPropertyGroup(swift: $0) } } + + @objc + public init(path: String, propertyGroups: [DBXFilePropertiesPropertyGroup]) { + self.swift = FileProperties.OverwritePropertyGroupArg(path: path, propertyGroups: propertyGroups.map(\.swift)) + } + + let swift: FileProperties.OverwritePropertyGroupArg + + public init(swift: FileProperties.OverwritePropertyGroupArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PropertiesSearchArg struct +@objc +public class DBXFilePropertiesPropertiesSearchArg: NSObject { + /// Queries to search. + @objc + public var queries: [DBXFilePropertiesPropertiesSearchQuery] { swift.queries.map { DBXFilePropertiesPropertiesSearchQuery(swift: $0) } } + /// Filter results to contain only properties associated with these template IDs. + @objc + public var templateFilter: DBXFilePropertiesTemplateFilter { DBXFilePropertiesTemplateFilter(swift: swift.templateFilter) } + + @objc + public init(queries: [DBXFilePropertiesPropertiesSearchQuery], templateFilter: DBXFilePropertiesTemplateFilter) { + self.swift = FileProperties.PropertiesSearchArg(queries: queries.map(\.swift), templateFilter: templateFilter.swift) + } + + let swift: FileProperties.PropertiesSearchArg + + public init(swift: FileProperties.PropertiesSearchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PropertiesSearchContinueArg struct +@objc +public class DBXFilePropertiesPropertiesSearchContinueArg: NSObject { + /// The cursor returned by your last call to propertiesSearch or propertiesSearchContinue. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = FileProperties.PropertiesSearchContinueArg(cursor: cursor) + } + + let swift: FileProperties.PropertiesSearchContinueArg + + public init(swift: FileProperties.PropertiesSearchContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PropertiesSearchContinueError union +@objc +public class DBXFilePropertiesPropertiesSearchContinueError: NSObject { + let swift: FileProperties.PropertiesSearchContinueError + + public init(swift: FileProperties.PropertiesSearchContinueError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.PropertiesSearchContinueError) -> DBXFilePropertiesPropertiesSearchContinueError { + switch swift { + case .reset: + return DBXFilePropertiesPropertiesSearchContinueErrorReset() + case .other: + return DBXFilePropertiesPropertiesSearchContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asReset: DBXFilePropertiesPropertiesSearchContinueErrorReset? { + self as? DBXFilePropertiesPropertiesSearchContinueErrorReset + } + + @objc + public var asOther: DBXFilePropertiesPropertiesSearchContinueErrorOther? { + self as? DBXFilePropertiesPropertiesSearchContinueErrorOther + } +} + +/// Indicates that the cursor has been invalidated. Call propertiesSearch to obtain a new cursor. +@objc +public class DBXFilePropertiesPropertiesSearchContinueErrorReset: DBXFilePropertiesPropertiesSearchContinueError { + @objc + public init() { + let swift = FileProperties.PropertiesSearchContinueError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesPropertiesSearchContinueErrorOther: DBXFilePropertiesPropertiesSearchContinueError { + @objc + public init() { + let swift = FileProperties.PropertiesSearchContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PropertiesSearchError union +@objc +public class DBXFilePropertiesPropertiesSearchError: NSObject { + let swift: FileProperties.PropertiesSearchError + + public init(swift: FileProperties.PropertiesSearchError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.PropertiesSearchError) -> DBXFilePropertiesPropertiesSearchError { + switch swift { + case .propertyGroupLookup(let swiftArg): + let arg = DBXFilePropertiesLookUpPropertiesError(swift: swiftArg) + return DBXFilePropertiesPropertiesSearchErrorPropertyGroupLookup(arg) + case .other: + return DBXFilePropertiesPropertiesSearchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPropertyGroupLookup: DBXFilePropertiesPropertiesSearchErrorPropertyGroupLookup? { + self as? DBXFilePropertiesPropertiesSearchErrorPropertyGroupLookup + } + + @objc + public var asOther: DBXFilePropertiesPropertiesSearchErrorOther? { + self as? DBXFilePropertiesPropertiesSearchErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesPropertiesSearchErrorPropertyGroupLookup: DBXFilePropertiesPropertiesSearchError { + @objc + public var propertyGroupLookup: DBXFilePropertiesLookUpPropertiesError + + @objc + public init(_ arg: DBXFilePropertiesLookUpPropertiesError) { + self.propertyGroupLookup = arg + let swift = FileProperties.PropertiesSearchError.propertyGroupLookup(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesPropertiesSearchErrorOther: DBXFilePropertiesPropertiesSearchError { + @objc + public init() { + let swift = FileProperties.PropertiesSearchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PropertiesSearchMatch struct +@objc +public class DBXFilePropertiesPropertiesSearchMatch: NSObject { + /// The ID for the matched file or folder. + @objc + public var id: String { swift.id } + /// The path for the matched file or folder. + @objc + public var path: String { swift.path } + /// Whether the file or folder is deleted. + @objc + public var isDeleted: NSNumber { swift.isDeleted as NSNumber } + /// List of custom property groups associated with the file. + @objc + public var propertyGroups: [DBXFilePropertiesPropertyGroup] { swift.propertyGroups.map { DBXFilePropertiesPropertyGroup(swift: $0) } } + + @objc + public init(id: String, path: String, isDeleted: NSNumber, propertyGroups: [DBXFilePropertiesPropertyGroup]) { + self.swift = FileProperties.PropertiesSearchMatch(id: id, path: path, isDeleted: isDeleted.boolValue, propertyGroups: propertyGroups.map(\.swift)) + } + + let swift: FileProperties.PropertiesSearchMatch + + public init(swift: FileProperties.PropertiesSearchMatch) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PropertiesSearchMode union +@objc +public class DBXFilePropertiesPropertiesSearchMode: NSObject { + let swift: FileProperties.PropertiesSearchMode + + public init(swift: FileProperties.PropertiesSearchMode) { + self.swift = swift + } + + public static func factory(swift: FileProperties.PropertiesSearchMode) -> DBXFilePropertiesPropertiesSearchMode { + switch swift { + case .fieldName(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesPropertiesSearchModeFieldName(arg) + case .other: + return DBXFilePropertiesPropertiesSearchModeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFieldName: DBXFilePropertiesPropertiesSearchModeFieldName? { + self as? DBXFilePropertiesPropertiesSearchModeFieldName + } + + @objc + public var asOther: DBXFilePropertiesPropertiesSearchModeOther? { + self as? DBXFilePropertiesPropertiesSearchModeOther + } +} + +/// Search for a value associated with this field name. +@objc +public class DBXFilePropertiesPropertiesSearchModeFieldName: DBXFilePropertiesPropertiesSearchMode { + @objc + public var fieldName: String + + @objc + public init(_ arg: String) { + self.fieldName = arg + let swift = FileProperties.PropertiesSearchMode.fieldName(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesPropertiesSearchModeOther: DBXFilePropertiesPropertiesSearchMode { + @objc + public init() { + let swift = FileProperties.PropertiesSearchMode.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PropertiesSearchQuery struct +@objc +public class DBXFilePropertiesPropertiesSearchQuery: NSObject { + /// The property field value for which to search across templates. + @objc + public var query: String { swift.query } + /// The mode with which to perform the search. + @objc + public var mode: DBXFilePropertiesPropertiesSearchMode { DBXFilePropertiesPropertiesSearchMode(swift: swift.mode) } + /// The logical operator with which to append the query. + @objc + public var logicalOperator: DBXFilePropertiesLogicalOperator { DBXFilePropertiesLogicalOperator(swift: swift.logicalOperator) } + + @objc + public init(query: String, mode: DBXFilePropertiesPropertiesSearchMode, logicalOperator: DBXFilePropertiesLogicalOperator) { + self.swift = FileProperties.PropertiesSearchQuery(query: query, mode: mode.swift, logicalOperator: logicalOperator.swift) + } + + let swift: FileProperties.PropertiesSearchQuery + + public init(swift: FileProperties.PropertiesSearchQuery) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PropertiesSearchResult struct +@objc +public class DBXFilePropertiesPropertiesSearchResult: NSObject { + /// A list (possibly empty) of matches for the query. + @objc + public var matches: [DBXFilePropertiesPropertiesSearchMatch] { swift.matches.map { DBXFilePropertiesPropertiesSearchMatch(swift: $0) } } + /// Pass the cursor into propertiesSearchContinue to continue to receive search results. Cursor will be null + /// when there are no more results. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(matches: [DBXFilePropertiesPropertiesSearchMatch], cursor: String?) { + self.swift = FileProperties.PropertiesSearchResult(matches: matches.map(\.swift), cursor: cursor) + } + + let swift: FileProperties.PropertiesSearchResult + + public init(swift: FileProperties.PropertiesSearchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Raw key/value data to be associated with a Dropbox file. Property fields are added to Dropbox files as a +/// PropertyGroup. +@objc +public class DBXFilePropertiesPropertyField: NSObject { + /// Key of the property field associated with a file and template. Keys can be up to 256 bytes. + @objc + public var name: String { swift.name } + /// Value of the property field associated with a file and template. Values can be up to 1024 bytes. + @objc + public var value: String { swift.value } + + @objc + public init(name: String, value: String) { + self.swift = FileProperties.PropertyField(name: name, value: value) + } + + let swift: FileProperties.PropertyField + + public init(swift: FileProperties.PropertyField) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Defines how a single property field may be structured. Used exclusively by PropertyGroupTemplate. +@objc +public class DBXFilePropertiesPropertyFieldTemplate: NSObject { + /// Key of the property field being described. Property field keys can be up to 256 bytes. + @objc + public var name: String { swift.name } + /// Description of the property field. Property field descriptions can be up to 1024 bytes. + @objc + public var description_: String { swift.description_ } + /// Data type of the value of this property field. This type will be enforced upon property creation and + /// modifications. + @objc + public var type: DBXFilePropertiesPropertyType { DBXFilePropertiesPropertyType(swift: swift.type) } + + @objc + public init(name: String, description_: String, type: DBXFilePropertiesPropertyType) { + self.swift = FileProperties.PropertyFieldTemplate(name: name, description_: description_, type: type.swift) + } + + let swift: FileProperties.PropertyFieldTemplate + + public init(swift: FileProperties.PropertyFieldTemplate) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// A subset of the property fields described by the corresponding PropertyGroupTemplate. Properties are always +/// added to a Dropbox file as a PropertyGroup. The possible key names and value types in this group are defined by +/// the corresponding PropertyGroupTemplate. +@objc +public class DBXFilePropertiesPropertyGroup: NSObject { + /// A unique identifier for the associated template. + @objc + public var templateId: String { swift.templateId } + /// The actual properties associated with the template. There can be up to 32 property types per template. + @objc + public var fields: [DBXFilePropertiesPropertyField] { swift.fields.map { DBXFilePropertiesPropertyField(swift: $0) } } + + @objc + public init(templateId: String, fields: [DBXFilePropertiesPropertyField]) { + self.swift = FileProperties.PropertyGroup(templateId: templateId, fields: fields.map(\.swift)) + } + + let swift: FileProperties.PropertyGroup + + public init(swift: FileProperties.PropertyGroup) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PropertyGroupUpdate struct +@objc +public class DBXFilePropertiesPropertyGroupUpdate: NSObject { + /// A unique identifier for a property template. + @objc + public var templateId: String { swift.templateId } + /// Property fields to update. If the property field already exists, it is updated. If the property field + /// doesn't exist, the property group is added. + @objc + public var addOrUpdateFields: [DBXFilePropertiesPropertyField]? { swift.addOrUpdateFields?.map { DBXFilePropertiesPropertyField(swift: $0) } } + /// Property fields to remove (by name), provided they exist. + @objc + public var removeFields: [String]? { swift.removeFields } + + @objc + public init(templateId: String, addOrUpdateFields: [DBXFilePropertiesPropertyField]?, removeFields: [String]?) { + self.swift = FileProperties.PropertyGroupUpdate(templateId: templateId, addOrUpdateFields: addOrUpdateFields?.map(\.swift), removeFields: removeFields) + } + + let swift: FileProperties.PropertyGroupUpdate + + public init(swift: FileProperties.PropertyGroupUpdate) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Data type of the given property field added. +@objc +public class DBXFilePropertiesPropertyType: NSObject { + let swift: FileProperties.PropertyType + + public init(swift: FileProperties.PropertyType) { + self.swift = swift + } + + public static func factory(swift: FileProperties.PropertyType) -> DBXFilePropertiesPropertyType { + switch swift { + case .string_: + return DBXFilePropertiesPropertyTypeString_() + case .other: + return DBXFilePropertiesPropertyTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asString_: DBXFilePropertiesPropertyTypeString_? { + self as? DBXFilePropertiesPropertyTypeString_ + } + + @objc + public var asOther: DBXFilePropertiesPropertyTypeOther? { + self as? DBXFilePropertiesPropertyTypeOther + } +} + +/// The associated property field will be of type string. Unicode is supported. +@objc +public class DBXFilePropertiesPropertyTypeString_: DBXFilePropertiesPropertyType { + @objc + public init() { + let swift = FileProperties.PropertyType.string_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesPropertyTypeOther: DBXFilePropertiesPropertyType { + @objc + public init() { + let swift = FileProperties.PropertyType.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RemovePropertiesArg struct +@objc +public class DBXFilePropertiesRemovePropertiesArg: NSObject { + /// A unique identifier for the file or folder. + @objc + public var path: String { swift.path } + /// A list of identifiers for a template created by templatesAddForUser or templatesAddForTeam. + @objc + public var propertyTemplateIds: [String] { swift.propertyTemplateIds } + + @objc + public init(path: String, propertyTemplateIds: [String]) { + self.swift = FileProperties.RemovePropertiesArg(path: path, propertyTemplateIds: propertyTemplateIds) + } + + let swift: FileProperties.RemovePropertiesArg + + public init(swift: FileProperties.RemovePropertiesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RemovePropertiesError union +@objc +public class DBXFilePropertiesRemovePropertiesError: NSObject { + let swift: FileProperties.RemovePropertiesError + + public init(swift: FileProperties.RemovePropertiesError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.RemovePropertiesError) -> DBXFilePropertiesRemovePropertiesError { + switch swift { + case .templateNotFound(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesRemovePropertiesErrorTemplateNotFound(arg) + case .restrictedContent: + return DBXFilePropertiesRemovePropertiesErrorRestrictedContent() + case .other: + return DBXFilePropertiesRemovePropertiesErrorOther() + case .path(let swiftArg): + let arg = DBXFilePropertiesLookupError(swift: swiftArg) + return DBXFilePropertiesRemovePropertiesErrorPath(arg) + case .unsupportedFolder: + return DBXFilePropertiesRemovePropertiesErrorUnsupportedFolder() + case .propertyGroupLookup(let swiftArg): + let arg = DBXFilePropertiesLookUpPropertiesError(swift: swiftArg) + return DBXFilePropertiesRemovePropertiesErrorPropertyGroupLookup(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemplateNotFound: DBXFilePropertiesRemovePropertiesErrorTemplateNotFound? { + self as? DBXFilePropertiesRemovePropertiesErrorTemplateNotFound + } + + @objc + public var asRestrictedContent: DBXFilePropertiesRemovePropertiesErrorRestrictedContent? { + self as? DBXFilePropertiesRemovePropertiesErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesRemovePropertiesErrorOther? { + self as? DBXFilePropertiesRemovePropertiesErrorOther + } + + @objc + public var asPath: DBXFilePropertiesRemovePropertiesErrorPath? { + self as? DBXFilePropertiesRemovePropertiesErrorPath + } + + @objc + public var asUnsupportedFolder: DBXFilePropertiesRemovePropertiesErrorUnsupportedFolder? { + self as? DBXFilePropertiesRemovePropertiesErrorUnsupportedFolder + } + + @objc + public var asPropertyGroupLookup: DBXFilePropertiesRemovePropertiesErrorPropertyGroupLookup? { + self as? DBXFilePropertiesRemovePropertiesErrorPropertyGroupLookup + } +} + +/// Template does not exist for the given identifier. +@objc +public class DBXFilePropertiesRemovePropertiesErrorTemplateNotFound: DBXFilePropertiesRemovePropertiesError { + @objc + public var templateNotFound: String + + @objc + public init(_ arg: String) { + self.templateNotFound = arg + let swift = FileProperties.RemovePropertiesError.templateNotFound(arg) + super.init(swift: swift) + } +} + +/// You do not have permission to modify this template. +@objc +public class DBXFilePropertiesRemovePropertiesErrorRestrictedContent: DBXFilePropertiesRemovePropertiesError { + @objc + public init() { + let swift = FileProperties.RemovePropertiesError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesRemovePropertiesErrorOther: DBXFilePropertiesRemovePropertiesError { + @objc + public init() { + let swift = FileProperties.RemovePropertiesError.other + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesRemovePropertiesErrorPath: DBXFilePropertiesRemovePropertiesError { + @objc + public var path: DBXFilePropertiesLookupError + + @objc + public init(_ arg: DBXFilePropertiesLookupError) { + self.path = arg + let swift = FileProperties.RemovePropertiesError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This folder cannot be tagged. Tagging folders is not supported for team-owned templates. +@objc +public class DBXFilePropertiesRemovePropertiesErrorUnsupportedFolder: DBXFilePropertiesRemovePropertiesError { + @objc + public init() { + let swift = FileProperties.RemovePropertiesError.unsupportedFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesRemovePropertiesErrorPropertyGroupLookup: DBXFilePropertiesRemovePropertiesError { + @objc + public var propertyGroupLookup: DBXFilePropertiesLookUpPropertiesError + + @objc + public init(_ arg: DBXFilePropertiesLookUpPropertiesError) { + self.propertyGroupLookup = arg + let swift = FileProperties.RemovePropertiesError.propertyGroupLookup(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible RemoveTemplateArg struct +@objc +public class DBXFilePropertiesRemoveTemplateArg: NSObject { + /// An identifier for a template created by templatesAddForUser or templatesAddForTeam. + @objc + public var templateId: String { swift.templateId } + + @objc + public init(templateId: String) { + self.swift = FileProperties.RemoveTemplateArg(templateId: templateId) + } + + let swift: FileProperties.RemoveTemplateArg + + public init(swift: FileProperties.RemoveTemplateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TemplateFilterBase union +@objc +public class DBXFilePropertiesTemplateFilterBase: NSObject { + let swift: FileProperties.TemplateFilterBase + + public init(swift: FileProperties.TemplateFilterBase) { + self.swift = swift + } + + public static func factory(swift: FileProperties.TemplateFilterBase) -> DBXFilePropertiesTemplateFilterBase { + switch swift { + case .filterSome(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesTemplateFilterBaseFilterSome(arg) + case .other: + return DBXFilePropertiesTemplateFilterBaseOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFilterSome: DBXFilePropertiesTemplateFilterBaseFilterSome? { + self as? DBXFilePropertiesTemplateFilterBaseFilterSome + } + + @objc + public var asOther: DBXFilePropertiesTemplateFilterBaseOther? { + self as? DBXFilePropertiesTemplateFilterBaseOther + } +} + +/// Only templates with an ID in the supplied list will be returned (a subset of templates will be returned). +@objc +public class DBXFilePropertiesTemplateFilterBaseFilterSome: DBXFilePropertiesTemplateFilterBase { + @objc + public var filterSome: [String] + + @objc + public init(_ arg: [String]) { + self.filterSome = arg + let swift = FileProperties.TemplateFilterBase.filterSome(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesTemplateFilterBaseOther: DBXFilePropertiesTemplateFilterBase { + @objc + public init() { + let swift = FileProperties.TemplateFilterBase.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TemplateFilter union +@objc +public class DBXFilePropertiesTemplateFilter: NSObject { + let swift: FileProperties.TemplateFilter + + public init(swift: FileProperties.TemplateFilter) { + self.swift = swift + } + + public static func factory(swift: FileProperties.TemplateFilter) -> DBXFilePropertiesTemplateFilter { + switch swift { + case .filterSome(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesTemplateFilterFilterSome(arg) + case .other: + return DBXFilePropertiesTemplateFilterOther() + case .filterNone: + return DBXFilePropertiesTemplateFilterFilterNone() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFilterSome: DBXFilePropertiesTemplateFilterFilterSome? { + self as? DBXFilePropertiesTemplateFilterFilterSome + } + + @objc + public var asOther: DBXFilePropertiesTemplateFilterOther? { + self as? DBXFilePropertiesTemplateFilterOther + } + + @objc + public var asFilterNone: DBXFilePropertiesTemplateFilterFilterNone? { + self as? DBXFilePropertiesTemplateFilterFilterNone + } +} + +/// Only templates with an ID in the supplied list will be returned (a subset of templates will be returned). +@objc +public class DBXFilePropertiesTemplateFilterFilterSome: DBXFilePropertiesTemplateFilter { + @objc + public var filterSome: [String] + + @objc + public init(_ arg: [String]) { + self.filterSome = arg + let swift = FileProperties.TemplateFilter.filterSome(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesTemplateFilterOther: DBXFilePropertiesTemplateFilter { + @objc + public init() { + let swift = FileProperties.TemplateFilter.other + super.init(swift: swift) + } +} + +/// No templates will be filtered from the result (all templates will be returned). +@objc +public class DBXFilePropertiesTemplateFilterFilterNone: DBXFilePropertiesTemplateFilter { + @objc + public init() { + let swift = FileProperties.TemplateFilter.filterNone + super.init(swift: swift) + } +} + +/// Objective-C compatible TemplateOwnerType union +@objc +public class DBXFilePropertiesTemplateOwnerType: NSObject { + let swift: FileProperties.TemplateOwnerType + + public init(swift: FileProperties.TemplateOwnerType) { + self.swift = swift + } + + public static func factory(swift: FileProperties.TemplateOwnerType) -> DBXFilePropertiesTemplateOwnerType { + switch swift { + case .user: + return DBXFilePropertiesTemplateOwnerTypeUser() + case .team: + return DBXFilePropertiesTemplateOwnerTypeTeam() + case .other: + return DBXFilePropertiesTemplateOwnerTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUser: DBXFilePropertiesTemplateOwnerTypeUser? { + self as? DBXFilePropertiesTemplateOwnerTypeUser + } + + @objc + public var asTeam: DBXFilePropertiesTemplateOwnerTypeTeam? { + self as? DBXFilePropertiesTemplateOwnerTypeTeam + } + + @objc + public var asOther: DBXFilePropertiesTemplateOwnerTypeOther? { + self as? DBXFilePropertiesTemplateOwnerTypeOther + } +} + +/// Template will be associated with a user. +@objc +public class DBXFilePropertiesTemplateOwnerTypeUser: DBXFilePropertiesTemplateOwnerType { + @objc + public init() { + let swift = FileProperties.TemplateOwnerType.user + super.init(swift: swift) + } +} + +/// Template will be associated with a team. +@objc +public class DBXFilePropertiesTemplateOwnerTypeTeam: DBXFilePropertiesTemplateOwnerType { + @objc + public init() { + let swift = FileProperties.TemplateOwnerType.team + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesTemplateOwnerTypeOther: DBXFilePropertiesTemplateOwnerType { + @objc + public init() { + let swift = FileProperties.TemplateOwnerType.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UpdatePropertiesArg struct +@objc +public class DBXFilePropertiesUpdatePropertiesArg: NSObject { + /// A unique identifier for the file or folder. + @objc + public var path: String { swift.path } + /// The property groups "delta" updates to apply. + @objc + public var updatePropertyGroups: [DBXFilePropertiesPropertyGroupUpdate] { + swift.updatePropertyGroups.map { DBXFilePropertiesPropertyGroupUpdate(swift: $0) } + } + + @objc + public init(path: String, updatePropertyGroups: [DBXFilePropertiesPropertyGroupUpdate]) { + self.swift = FileProperties.UpdatePropertiesArg(path: path, updatePropertyGroups: updatePropertyGroups.map(\.swift)) + } + + let swift: FileProperties.UpdatePropertiesArg + + public init(swift: FileProperties.UpdatePropertiesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UpdatePropertiesError union +@objc +public class DBXFilePropertiesUpdatePropertiesError: NSObject { + let swift: FileProperties.UpdatePropertiesError + + public init(swift: FileProperties.UpdatePropertiesError) { + self.swift = swift + } + + public static func factory(swift: FileProperties.UpdatePropertiesError) -> DBXFilePropertiesUpdatePropertiesError { + switch swift { + case .templateNotFound(let swiftArg): + let arg = swiftArg + return DBXFilePropertiesUpdatePropertiesErrorTemplateNotFound(arg) + case .restrictedContent: + return DBXFilePropertiesUpdatePropertiesErrorRestrictedContent() + case .other: + return DBXFilePropertiesUpdatePropertiesErrorOther() + case .path(let swiftArg): + let arg = DBXFilePropertiesLookupError(swift: swiftArg) + return DBXFilePropertiesUpdatePropertiesErrorPath(arg) + case .unsupportedFolder: + return DBXFilePropertiesUpdatePropertiesErrorUnsupportedFolder() + case .propertyFieldTooLarge: + return DBXFilePropertiesUpdatePropertiesErrorPropertyFieldTooLarge() + case .doesNotFitTemplate: + return DBXFilePropertiesUpdatePropertiesErrorDoesNotFitTemplate() + case .duplicatePropertyGroups: + return DBXFilePropertiesUpdatePropertiesErrorDuplicatePropertyGroups() + case .propertyGroupLookup(let swiftArg): + let arg = DBXFilePropertiesLookUpPropertiesError(swift: swiftArg) + return DBXFilePropertiesUpdatePropertiesErrorPropertyGroupLookup(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemplateNotFound: DBXFilePropertiesUpdatePropertiesErrorTemplateNotFound? { + self as? DBXFilePropertiesUpdatePropertiesErrorTemplateNotFound + } + + @objc + public var asRestrictedContent: DBXFilePropertiesUpdatePropertiesErrorRestrictedContent? { + self as? DBXFilePropertiesUpdatePropertiesErrorRestrictedContent + } + + @objc + public var asOther: DBXFilePropertiesUpdatePropertiesErrorOther? { + self as? DBXFilePropertiesUpdatePropertiesErrorOther + } + + @objc + public var asPath: DBXFilePropertiesUpdatePropertiesErrorPath? { + self as? DBXFilePropertiesUpdatePropertiesErrorPath + } + + @objc + public var asUnsupportedFolder: DBXFilePropertiesUpdatePropertiesErrorUnsupportedFolder? { + self as? DBXFilePropertiesUpdatePropertiesErrorUnsupportedFolder + } + + @objc + public var asPropertyFieldTooLarge: DBXFilePropertiesUpdatePropertiesErrorPropertyFieldTooLarge? { + self as? DBXFilePropertiesUpdatePropertiesErrorPropertyFieldTooLarge + } + + @objc + public var asDoesNotFitTemplate: DBXFilePropertiesUpdatePropertiesErrorDoesNotFitTemplate? { + self as? DBXFilePropertiesUpdatePropertiesErrorDoesNotFitTemplate + } + + @objc + public var asDuplicatePropertyGroups: DBXFilePropertiesUpdatePropertiesErrorDuplicatePropertyGroups? { + self as? DBXFilePropertiesUpdatePropertiesErrorDuplicatePropertyGroups + } + + @objc + public var asPropertyGroupLookup: DBXFilePropertiesUpdatePropertiesErrorPropertyGroupLookup? { + self as? DBXFilePropertiesUpdatePropertiesErrorPropertyGroupLookup + } +} + +/// Template does not exist for the given identifier. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorTemplateNotFound: DBXFilePropertiesUpdatePropertiesError { + @objc + public var templateNotFound: String + + @objc + public init(_ arg: String) { + self.templateNotFound = arg + let swift = FileProperties.UpdatePropertiesError.templateNotFound(arg) + super.init(swift: swift) + } +} + +/// You do not have permission to modify this template. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorRestrictedContent: DBXFilePropertiesUpdatePropertiesError { + @objc + public init() { + let swift = FileProperties.UpdatePropertiesError.restrictedContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorOther: DBXFilePropertiesUpdatePropertiesError { + @objc + public init() { + let swift = FileProperties.UpdatePropertiesError.other + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorPath: DBXFilePropertiesUpdatePropertiesError { + @objc + public var path: DBXFilePropertiesLookupError + + @objc + public init(_ arg: DBXFilePropertiesLookupError) { + self.path = arg + let swift = FileProperties.UpdatePropertiesError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This folder cannot be tagged. Tagging folders is not supported for team-owned templates. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorUnsupportedFolder: DBXFilePropertiesUpdatePropertiesError { + @objc + public init() { + let swift = FileProperties.UpdatePropertiesError.unsupportedFolder + super.init(swift: swift) + } +} + +/// One or more of the supplied property field values is too large. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorPropertyFieldTooLarge: DBXFilePropertiesUpdatePropertiesError { + @objc + public init() { + let swift = FileProperties.UpdatePropertiesError.propertyFieldTooLarge + super.init(swift: swift) + } +} + +/// One or more of the supplied property fields does not conform to the template specifications. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorDoesNotFitTemplate: DBXFilePropertiesUpdatePropertiesError { + @objc + public init() { + let swift = FileProperties.UpdatePropertiesError.doesNotFitTemplate + super.init(swift: swift) + } +} + +/// There are 2 or more property groups referring to the same templates in the input. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorDuplicatePropertyGroups: DBXFilePropertiesUpdatePropertiesError { + @objc + public init() { + let swift = FileProperties.UpdatePropertiesError.duplicatePropertyGroups + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilePropertiesUpdatePropertiesErrorPropertyGroupLookup: DBXFilePropertiesUpdatePropertiesError { + @objc + public var propertyGroupLookup: DBXFilePropertiesLookUpPropertiesError + + @objc + public init(_ arg: DBXFilePropertiesLookUpPropertiesError) { + self.propertyGroupLookup = arg + let swift = FileProperties.UpdatePropertiesError.propertyGroupLookup(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible UpdateTemplateArg struct +@objc +public class DBXFilePropertiesUpdateTemplateArg: NSObject { + /// An identifier for template added by See templatesAddForUser or templatesAddForTeam. + @objc + public var templateId: String { swift.templateId } + /// A display name for the template. template names can be up to 256 bytes. + @objc + public var name: String? { swift.name } + /// Description for the new template. Template descriptions can be up to 1024 bytes. + @objc + public var description_: String? { swift.description_ } + /// Property field templates to be added to the group template. There can be up to 32 properties in a single + /// template. + @objc + public var addFields: [DBXFilePropertiesPropertyFieldTemplate]? { swift.addFields?.map { DBXFilePropertiesPropertyFieldTemplate(swift: $0) } } + + @objc + public init(templateId: String, name: String?, description_: String?, addFields: [DBXFilePropertiesPropertyFieldTemplate]?) { + self.swift = FileProperties.UpdateTemplateArg(templateId: templateId, name: name, description_: description_, addFields: addFields?.map(\.swift)) + } + + let swift: FileProperties.UpdateTemplateArg + + public init(swift: FileProperties.UpdateTemplateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UpdateTemplateResult struct +@objc +public class DBXFilePropertiesUpdateTemplateResult: NSObject { + /// An identifier for template added by route See templatesAddForUser or templatesAddForTeam. + @objc + public var templateId: String { swift.templateId } + + @objc + public init(templateId: String) { + self.swift = FileProperties.UpdateTemplateResult(templateId: templateId) + } + + let swift: FileProperties.UpdateTemplateResult + + public init(swift: FileProperties.UpdateTemplateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilePropertiesRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilePropertiesRoutes.swift new file mode 100644 index 000000000..706c7e370 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilePropertiesRoutes.swift @@ -0,0 +1,1387 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the file_properties namespace +/// For Swift routes see FilePropertiesRoutes +@objc +public class DBXFilePropertiesRoutes: NSObject { + private let swift: FilePropertiesRoutes + init(swift: FilePropertiesRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Add property groups to a Dropbox file. See templatesAddForUser or templatesAddForTeam to create new templates. + /// + /// - scope: files.metadata.write + /// + /// - parameter path: A unique identifier for the file or folder. + /// - parameter propertyGroups: The property groups which are to be added to a Dropbox file. No two groups in the + /// input should refer to the same template. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `FileProperties.AddPropertiesError` object on failure. + @objc + @discardableResult public func propertiesAdd(path: String, propertyGroups: [DBXFilePropertiesPropertyGroup]) -> DBXFilePropertiesPropertiesAddRpcRequest { + let swift = swift.propertiesAdd(path: path, propertyGroups: propertyGroups.map(\.swift)) + return DBXFilePropertiesPropertiesAddRpcRequest(swift: swift) + } + + /// Overwrite property groups associated with a file. This endpoint should be used instead of propertiesUpdate when + /// property groups are being updated via a "snapshot" instead of via a "delta". In other words, this endpoint + /// will delete all omitted fields from a property group, whereas propertiesUpdate will only delete fields that + /// are explicitly marked for deletion. + /// + /// - scope: files.metadata.write + /// + /// - parameter path: A unique identifier for the file or folder. + /// - parameter propertyGroups: The property groups "snapshot" updates to force apply. No two groups in the input + /// should refer to the same template. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `FileProperties.InvalidPropertyGroupError` object on failure. + @objc + @discardableResult public func propertiesOverwrite( + path: String, + propertyGroups: [DBXFilePropertiesPropertyGroup] + ) -> DBXFilePropertiesPropertiesOverwriteRpcRequest { + let swift = swift.propertiesOverwrite(path: path, propertyGroups: propertyGroups.map(\.swift)) + return DBXFilePropertiesPropertiesOverwriteRpcRequest(swift: swift) + } + + /// Permanently removes the specified property group from the file. To remove specific property field key value + /// pairs, see propertiesUpdate. To update a template, see templatesUpdateForUser or templatesUpdateForTeam. To + /// remove a template, see templatesRemoveForUser or templatesRemoveForTeam. + /// + /// - scope: files.metadata.write + /// + /// - parameter path: A unique identifier for the file or folder. + /// - parameter propertyTemplateIds: A list of identifiers for a template created by templatesAddForUser or + /// templatesAddForTeam. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `FileProperties.RemovePropertiesError` object on failure. + @objc + @discardableResult public func propertiesRemove(path: String, propertyTemplateIds: [String]) -> DBXFilePropertiesPropertiesRemoveRpcRequest { + let swift = swift.propertiesRemove(path: path, propertyTemplateIds: propertyTemplateIds) + return DBXFilePropertiesPropertiesRemoveRpcRequest(swift: swift) + } + + /// Search across property templates for particular property field values. + /// + /// - scope: files.metadata.read + /// + /// - parameter queries: Queries to search. + /// - parameter templateFilter: Filter results to contain only properties associated with these template IDs. + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.PropertiesSearchResult` + /// object on success or a `FileProperties.PropertiesSearchError` object on failure. + @objc + @discardableResult public func propertiesSearch( + queries: [DBXFilePropertiesPropertiesSearchQuery], + templateFilter: DBXFilePropertiesTemplateFilter + ) -> DBXFilePropertiesPropertiesSearchRpcRequest { + let swift = swift.propertiesSearch(queries: queries.map(\.swift), templateFilter: templateFilter.swift) + return DBXFilePropertiesPropertiesSearchRpcRequest(swift: swift) + } + + /// Search across property templates for particular property field values. + /// + /// - scope: files.metadata.read + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.PropertiesSearchResult` + /// object on success or a `FileProperties.PropertiesSearchError` object on failure. + @objc + @discardableResult public func propertiesSearch(queries: [DBXFilePropertiesPropertiesSearchQuery]) -> DBXFilePropertiesPropertiesSearchRpcRequest { + let swift = swift.propertiesSearch(queries: queries.map(\.swift)) + return DBXFilePropertiesPropertiesSearchRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from propertiesSearch, use this to paginate through all search results. + /// + /// - scope: files.metadata.read + /// + /// - parameter cursor: The cursor returned by your last call to propertiesSearch or propertiesSearchContinue. + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.PropertiesSearchResult` + /// object on success or a `FileProperties.PropertiesSearchContinueError` object on failure. + @objc + @discardableResult public func propertiesSearchContinue(cursor: String) -> DBXFilePropertiesPropertiesSearchContinueRpcRequest { + let swift = swift.propertiesSearchContinue(cursor: cursor) + return DBXFilePropertiesPropertiesSearchContinueRpcRequest(swift: swift) + } + + /// Add, update or remove properties associated with the supplied file and templates. This endpoint should be used + /// instead of propertiesOverwrite when property groups are being updated via a "delta" instead of via a + /// "snapshot" . In other words, this endpoint will not delete any omitted fields from a property group, whereas + /// propertiesOverwrite will delete any fields that are omitted from a property group. + /// + /// - scope: files.metadata.write + /// + /// - parameter path: A unique identifier for the file or folder. + /// - parameter updatePropertyGroups: The property groups "delta" updates to apply. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `FileProperties.UpdatePropertiesError` object on failure. + @objc + @discardableResult public func propertiesUpdate( + path: String, + updatePropertyGroups: [DBXFilePropertiesPropertyGroupUpdate] + ) -> DBXFilePropertiesPropertiesUpdateRpcRequest { + let swift = swift.propertiesUpdate(path: path, updatePropertyGroups: updatePropertyGroups.map(\.swift)) + return DBXFilePropertiesPropertiesUpdateRpcRequest(swift: swift) + } + + /// Add a template associated with a team. See propertiesAdd to add properties to a file or folder. Note: this + /// endpoint will create team-owned templates. + /// + /// - scope: files.team_metadata.write + /// + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object on + /// success or a `FileProperties.ModifyTemplateError` object on failure. + @objc + @discardableResult public func templatesAddForTeam( + name: String, + description_: String, + fields: [DBXFilePropertiesPropertyFieldTemplate] + ) -> DBXFilePropertiesTemplatesAddForTeamRpcRequest { + let swift = swift.templatesAddForTeam(name: name, description_: description_, fields: fields.map(\.swift)) + return DBXFilePropertiesTemplatesAddForTeamRpcRequest(swift: swift) + } + + /// Add a template associated with a user. See propertiesAdd to add properties to a file. This endpoint can't be + /// called on a team member or admin's behalf. + /// + /// - scope: files.metadata.write + /// + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.AddTemplateResult` object on + /// success or a `FileProperties.ModifyTemplateError` object on failure. + @objc + @discardableResult public func templatesAddForUser( + name: String, + description_: String, + fields: [DBXFilePropertiesPropertyFieldTemplate] + ) -> DBXFilePropertiesTemplatesAddForUserRpcRequest { + let swift = swift.templatesAddForUser(name: name, description_: description_, fields: fields.map(\.swift)) + return DBXFilePropertiesTemplatesAddForUserRpcRequest(swift: swift) + } + + /// Get the schema for a specified template. + /// + /// - scope: files.team_metadata.write + /// + /// - parameter templateId: An identifier for template added by route See templatesAddForUser or + /// templatesAddForTeam. + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object on + /// success or a `FileProperties.TemplateError` object on failure. + @objc + @discardableResult public func templatesGetForTeam(templateId: String) -> DBXFilePropertiesTemplatesGetForTeamRpcRequest { + let swift = swift.templatesGetForTeam(templateId: templateId) + return DBXFilePropertiesTemplatesGetForTeamRpcRequest(swift: swift) + } + + /// Get the schema for a specified template. This endpoint can't be called on a team member or admin's behalf. + /// + /// - scope: files.metadata.read + /// + /// - parameter templateId: An identifier for template added by route See templatesAddForUser or + /// templatesAddForTeam. + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.GetTemplateResult` object on + /// success or a `FileProperties.TemplateError` object on failure. + @objc + @discardableResult public func templatesGetForUser(templateId: String) -> DBXFilePropertiesTemplatesGetForUserRpcRequest { + let swift = swift.templatesGetForUser(templateId: templateId) + return DBXFilePropertiesTemplatesGetForUserRpcRequest(swift: swift) + } + + /// Get the template identifiers for a team. To get the schema of each template use templatesGetForTeam. + /// + /// - scope: files.team_metadata.write + /// + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object + /// on success or a `FileProperties.TemplateError` object on failure. + @objc + @discardableResult public func templatesListForTeam() -> DBXFilePropertiesTemplatesListForTeamRpcRequest { + let swift = swift.templatesListForTeam() + return DBXFilePropertiesTemplatesListForTeamRpcRequest(swift: swift) + } + + /// Get the template identifiers for a team. To get the schema of each template use templatesGetForUser. This + /// endpoint can't be called on a team member or admin's behalf. + /// + /// - scope: files.metadata.read + /// + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.ListTemplateResult` object + /// on success or a `FileProperties.TemplateError` object on failure. + @objc + @discardableResult public func templatesListForUser() -> DBXFilePropertiesTemplatesListForUserRpcRequest { + let swift = swift.templatesListForUser() + return DBXFilePropertiesTemplatesListForUserRpcRequest(swift: swift) + } + + /// Permanently removes the specified template created from templatesAddForUser. All properties associated with the + /// template will also be removed. This action cannot be undone. + /// + /// - scope: files.team_metadata.write + /// + /// - parameter templateId: An identifier for a template created by templatesAddForUser or templatesAddForTeam. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `FileProperties.TemplateError` object on failure. + @objc + @discardableResult public func templatesRemoveForTeam(templateId: String) -> DBXFilePropertiesTemplatesRemoveForTeamRpcRequest { + let swift = swift.templatesRemoveForTeam(templateId: templateId) + return DBXFilePropertiesTemplatesRemoveForTeamRpcRequest(swift: swift) + } + + /// Permanently removes the specified template created from templatesAddForUser. All properties associated with the + /// template will also be removed. This action cannot be undone. + /// + /// - scope: files.metadata.write + /// + /// - parameter templateId: An identifier for a template created by templatesAddForUser or templatesAddForTeam. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `FileProperties.TemplateError` object on failure. + @objc + @discardableResult public func templatesRemoveForUser(templateId: String) -> DBXFilePropertiesTemplatesRemoveForUserRpcRequest { + let swift = swift.templatesRemoveForUser(templateId: templateId) + return DBXFilePropertiesTemplatesRemoveForUserRpcRequest(swift: swift) + } + + /// Update a template associated with a team. This route can update the template name, the template description and + /// add optional properties to templates. + /// + /// - scope: files.team_metadata.write + /// + /// - parameter templateId: An identifier for template added by See templatesAddForUser or templatesAddForTeam. + /// - parameter name: A display name for the template. template names can be up to 256 bytes. + /// - parameter description_: Description for the new template. Template descriptions can be up to 1024 bytes. + /// - parameter addFields: Property field templates to be added to the group template. There can be up to 32 + /// properties in a single template. + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` object + /// on success or a `FileProperties.ModifyTemplateError` object on failure. + @objc + @discardableResult public func templatesUpdateForTeam( + templateId: String, + name: String?, + description_: String?, + addFields: [DBXFilePropertiesPropertyFieldTemplate]? + ) -> DBXFilePropertiesTemplatesUpdateForTeamRpcRequest { + let swift = swift.templatesUpdateForTeam(templateId: templateId, name: name, description_: description_, addFields: addFields?.map(\.swift)) + return DBXFilePropertiesTemplatesUpdateForTeamRpcRequest(swift: swift) + } + + /// Update a template associated with a team. This route can update the template name, the template description and + /// add optional properties to templates. + /// + /// - scope: files.team_metadata.write + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` object + /// on success or a `FileProperties.ModifyTemplateError` object on failure. + @objc + @discardableResult public func templatesUpdateForTeam(templateId: String) -> DBXFilePropertiesTemplatesUpdateForTeamRpcRequest { + let swift = swift.templatesUpdateForTeam(templateId: templateId) + return DBXFilePropertiesTemplatesUpdateForTeamRpcRequest(swift: swift) + } + + /// Update a template associated with a user. This route can update the template name, the template description and + /// add optional properties to templates. This endpoint can't be called on a team member or admin's behalf. + /// + /// - scope: files.metadata.write + /// + /// - parameter templateId: An identifier for template added by See templatesAddForUser or templatesAddForTeam. + /// - parameter name: A display name for the template. template names can be up to 256 bytes. + /// - parameter description_: Description for the new template. Template descriptions can be up to 1024 bytes. + /// - parameter addFields: Property field templates to be added to the group template. There can be up to 32 + /// properties in a single template. + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` object + /// on success or a `FileProperties.ModifyTemplateError` object on failure. + @objc + @discardableResult public func templatesUpdateForUser( + templateId: String, + name: String?, + description_: String?, + addFields: [DBXFilePropertiesPropertyFieldTemplate]? + ) -> DBXFilePropertiesTemplatesUpdateForUserRpcRequest { + let swift = swift.templatesUpdateForUser(templateId: templateId, name: name, description_: description_, addFields: addFields?.map(\.swift)) + return DBXFilePropertiesTemplatesUpdateForUserRpcRequest(swift: swift) + } + + /// Update a template associated with a user. This route can update the template name, the template description and + /// add optional properties to templates. This endpoint can't be called on a team member or admin's behalf. + /// + /// - scope: files.metadata.write + /// + /// - returns: Through the response callback, the caller will receive a `FileProperties.UpdateTemplateResult` object + /// on success or a `FileProperties.ModifyTemplateError` object on failure. + @objc + @discardableResult public func templatesUpdateForUser(templateId: String) -> DBXFilePropertiesTemplatesUpdateForUserRpcRequest { + let swift = swift.templatesUpdateForUser(templateId: templateId) + return DBXFilePropertiesTemplatesUpdateForUserRpcRequest(swift: swift) + } +} + +@objc +public class DBXFilePropertiesPropertiesAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesAddPropertiesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesAddPropertiesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesAddPropertiesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesAddPropertiesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilePropertiesPropertiesOverwriteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesInvalidPropertyGroupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesInvalidPropertyGroupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesInvalidPropertyGroupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesInvalidPropertyGroupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilePropertiesPropertiesRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesRemovePropertiesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesRemovePropertiesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesRemovePropertiesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesRemovePropertiesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilePropertiesPropertiesSearchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesPropertiesSearchResult?, DBXFilePropertiesPropertiesSearchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesPropertiesSearchResult?, DBXFilePropertiesPropertiesSearchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesPropertiesSearchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesPropertiesSearchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesPropertiesSearchResult? + if let swift = result { + objc = DBXFilePropertiesPropertiesSearchResult(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 DBXFilePropertiesPropertiesSearchContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesPropertiesSearchResult?, DBXFilePropertiesPropertiesSearchContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesPropertiesSearchResult?, DBXFilePropertiesPropertiesSearchContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesPropertiesSearchContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesPropertiesSearchContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesPropertiesSearchResult? + if let swift = result { + objc = DBXFilePropertiesPropertiesSearchResult(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 DBXFilePropertiesPropertiesUpdateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesUpdatePropertiesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesUpdatePropertiesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesUpdatePropertiesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesUpdatePropertiesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilePropertiesTemplatesAddForTeamRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesAddTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesAddTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesModifyTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesModifyTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesAddTemplateResult? + if let swift = result { + objc = DBXFilePropertiesAddTemplateResult(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 DBXFilePropertiesTemplatesAddForUserRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesAddTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesAddTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesModifyTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesModifyTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesAddTemplateResult? + if let swift = result { + objc = DBXFilePropertiesAddTemplateResult(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 DBXFilePropertiesTemplatesGetForTeamRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesGetTemplateResult? + if let swift = result { + objc = DBXFilePropertiesGetTemplateResult(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 DBXFilePropertiesTemplatesGetForUserRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesGetTemplateResult? + if let swift = result { + objc = DBXFilePropertiesGetTemplateResult(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 DBXFilePropertiesTemplatesListForTeamRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesListTemplateResult? + if let swift = result { + objc = DBXFilePropertiesListTemplateResult(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 DBXFilePropertiesTemplatesListForUserRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesListTemplateResult? + if let swift = result { + objc = DBXFilePropertiesListTemplateResult(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 DBXFilePropertiesTemplatesRemoveForTeamRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilePropertiesTemplatesRemoveForUserRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilePropertiesTemplatesUpdateForTeamRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesUpdateTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesUpdateTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesModifyTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesModifyTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesUpdateTemplateResult? + if let swift = result { + objc = DBXFilePropertiesUpdateTemplateResult(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 DBXFilePropertiesTemplatesUpdateForUserRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesUpdateTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesUpdateTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesModifyTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesModifyTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesUpdateTemplateResult? + if let swift = result { + objc = DBXFilePropertiesUpdateTemplateResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequests.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequests.swift new file mode 100644 index 000000000..b92ac3e1c --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequests.swift @@ -0,0 +1,1820 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the file_requests namespace +/// For Swift see file_requests + +/// There is an error accessing the file requests functionality. +@objc +public class DBXFileRequestsGeneralFileRequestsError: NSObject { + let swift: FileRequests.GeneralFileRequestsError + + public init(swift: FileRequests.GeneralFileRequestsError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.GeneralFileRequestsError) -> DBXFileRequestsGeneralFileRequestsError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsGeneralFileRequestsErrorDisabledForTeam() + case .other: + return DBXFileRequestsGeneralFileRequestsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsGeneralFileRequestsErrorDisabledForTeam? { + self as? DBXFileRequestsGeneralFileRequestsErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsGeneralFileRequestsErrorOther? { + self as? DBXFileRequestsGeneralFileRequestsErrorOther + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsGeneralFileRequestsErrorDisabledForTeam: DBXFileRequestsGeneralFileRequestsError { + @objc + public init() { + let swift = FileRequests.GeneralFileRequestsError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGeneralFileRequestsErrorOther: DBXFileRequestsGeneralFileRequestsError { + @objc + public init() { + let swift = FileRequests.GeneralFileRequestsError.other + super.init(swift: swift) + } +} + +/// There was an error counting the file requests. +@objc +public class DBXFileRequestsCountFileRequestsError: NSObject { + let swift: FileRequests.CountFileRequestsError + + public init(swift: FileRequests.CountFileRequestsError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.CountFileRequestsError) -> DBXFileRequestsCountFileRequestsError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsCountFileRequestsErrorDisabledForTeam() + case .other: + return DBXFileRequestsCountFileRequestsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsCountFileRequestsErrorDisabledForTeam? { + self as? DBXFileRequestsCountFileRequestsErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsCountFileRequestsErrorOther? { + self as? DBXFileRequestsCountFileRequestsErrorOther + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsCountFileRequestsErrorDisabledForTeam: DBXFileRequestsCountFileRequestsError { + @objc + public init() { + let swift = FileRequests.CountFileRequestsError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsCountFileRequestsErrorOther: DBXFileRequestsCountFileRequestsError { + @objc + public init() { + let swift = FileRequests.CountFileRequestsError.other + super.init(swift: swift) + } +} + +/// Result for count. +@objc +public class DBXFileRequestsCountFileRequestsResult: NSObject { + /// The number file requests owner by this user. + @objc + public var fileRequestCount: NSNumber { swift.fileRequestCount as NSNumber } + + @objc + public init(fileRequestCount: NSNumber) { + self.swift = FileRequests.CountFileRequestsResult(fileRequestCount: fileRequestCount.uint64Value) + } + + let swift: FileRequests.CountFileRequestsResult + + public init(swift: FileRequests.CountFileRequestsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for create. +@objc +public class DBXFileRequestsCreateFileRequestArgs: NSObject { + /// The title of the file request. Must not be empty. + @objc + public var title: String { swift.title } + /// The path of the folder in the Dropbox where uploaded files will be sent. For apps with the app folder + /// permission, this will be relative to the app folder. + @objc + public var destination: String { swift.destination } + /// The deadline for the file request. Deadlines can only be set by Professional and Business accounts. + @objc + public var deadline: DBXFileRequestsFileRequestDeadline? { guard let swift = swift.deadline else { return nil } + return DBXFileRequestsFileRequestDeadline(swift: swift) + } + + /// Whether or not the file request should be open. If the file request is closed, it will not accept any file + /// submissions, but it can be opened later. + @objc + public var open: NSNumber { swift.open as NSNumber } + /// A description of the file request. + @objc + public var description_: String? { swift.description_ } + + @objc + public init(title: String, destination: String, deadline: DBXFileRequestsFileRequestDeadline?, open: NSNumber, description_: String?) { + self.swift = FileRequests.CreateFileRequestArgs( + title: title, + destination: destination, + deadline: deadline?.swift, + open: open.boolValue, + description_: description_ + ) + } + + let swift: FileRequests.CreateFileRequestArgs + + public init(swift: FileRequests.CreateFileRequestArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// There is an error with the file request. +@objc +public class DBXFileRequestsFileRequestError: NSObject { + let swift: FileRequests.FileRequestError + + public init(swift: FileRequests.FileRequestError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.FileRequestError) -> DBXFileRequestsFileRequestError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsFileRequestErrorDisabledForTeam() + case .other: + return DBXFileRequestsFileRequestErrorOther() + case .notFound: + return DBXFileRequestsFileRequestErrorNotFound() + case .notAFolder: + return DBXFileRequestsFileRequestErrorNotAFolder() + case .appLacksAccess: + return DBXFileRequestsFileRequestErrorAppLacksAccess() + case .noPermission: + return DBXFileRequestsFileRequestErrorNoPermission() + case .emailUnverified: + return DBXFileRequestsFileRequestErrorEmailUnverified() + case .validationError: + return DBXFileRequestsFileRequestErrorValidationError() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsFileRequestErrorDisabledForTeam? { + self as? DBXFileRequestsFileRequestErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsFileRequestErrorOther? { + self as? DBXFileRequestsFileRequestErrorOther + } + + @objc + public var asNotFound: DBXFileRequestsFileRequestErrorNotFound? { + self as? DBXFileRequestsFileRequestErrorNotFound + } + + @objc + public var asNotAFolder: DBXFileRequestsFileRequestErrorNotAFolder? { + self as? DBXFileRequestsFileRequestErrorNotAFolder + } + + @objc + public var asAppLacksAccess: DBXFileRequestsFileRequestErrorAppLacksAccess? { + self as? DBXFileRequestsFileRequestErrorAppLacksAccess + } + + @objc + public var asNoPermission: DBXFileRequestsFileRequestErrorNoPermission? { + self as? DBXFileRequestsFileRequestErrorNoPermission + } + + @objc + public var asEmailUnverified: DBXFileRequestsFileRequestErrorEmailUnverified? { + self as? DBXFileRequestsFileRequestErrorEmailUnverified + } + + @objc + public var asValidationError: DBXFileRequestsFileRequestErrorValidationError? { + self as? DBXFileRequestsFileRequestErrorValidationError + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsFileRequestErrorDisabledForTeam: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsFileRequestErrorOther: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.other + super.init(swift: swift) + } +} + +/// This file request ID was not found. +@objc +public class DBXFileRequestsFileRequestErrorNotFound: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.notFound + super.init(swift: swift) + } +} + +/// The specified path is not a folder. +@objc +public class DBXFileRequestsFileRequestErrorNotAFolder: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.notAFolder + super.init(swift: swift) + } +} + +/// This file request is not accessible to this app. Apps with the app folder permission can only access file +/// requests in their app folder. +@objc +public class DBXFileRequestsFileRequestErrorAppLacksAccess: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.appLacksAccess + super.init(swift: swift) + } +} + +/// This user doesn't have permission to access or modify this file request. +@objc +public class DBXFileRequestsFileRequestErrorNoPermission: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.noPermission + super.init(swift: swift) + } +} + +/// This user's email address is not verified. File requests are only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXFileRequestsFileRequestErrorEmailUnverified: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.emailUnverified + super.init(swift: swift) + } +} + +/// There was an error validating the request. For example, the title was invalid, or there were disallowed +/// characters in the destination path. +@objc +public class DBXFileRequestsFileRequestErrorValidationError: DBXFileRequestsFileRequestError { + @objc + public init() { + let swift = FileRequests.FileRequestError.validationError + super.init(swift: swift) + } +} + +/// There was an error creating the file request. +@objc +public class DBXFileRequestsCreateFileRequestError: NSObject { + let swift: FileRequests.CreateFileRequestError + + public init(swift: FileRequests.CreateFileRequestError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.CreateFileRequestError) -> DBXFileRequestsCreateFileRequestError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsCreateFileRequestErrorDisabledForTeam() + case .other: + return DBXFileRequestsCreateFileRequestErrorOther() + case .notFound: + return DBXFileRequestsCreateFileRequestErrorNotFound() + case .notAFolder: + return DBXFileRequestsCreateFileRequestErrorNotAFolder() + case .appLacksAccess: + return DBXFileRequestsCreateFileRequestErrorAppLacksAccess() + case .noPermission: + return DBXFileRequestsCreateFileRequestErrorNoPermission() + case .emailUnverified: + return DBXFileRequestsCreateFileRequestErrorEmailUnverified() + case .validationError: + return DBXFileRequestsCreateFileRequestErrorValidationError() + case .invalidLocation: + return DBXFileRequestsCreateFileRequestErrorInvalidLocation() + case .rateLimit: + return DBXFileRequestsCreateFileRequestErrorRateLimit() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsCreateFileRequestErrorDisabledForTeam? { + self as? DBXFileRequestsCreateFileRequestErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsCreateFileRequestErrorOther? { + self as? DBXFileRequestsCreateFileRequestErrorOther + } + + @objc + public var asNotFound: DBXFileRequestsCreateFileRequestErrorNotFound? { + self as? DBXFileRequestsCreateFileRequestErrorNotFound + } + + @objc + public var asNotAFolder: DBXFileRequestsCreateFileRequestErrorNotAFolder? { + self as? DBXFileRequestsCreateFileRequestErrorNotAFolder + } + + @objc + public var asAppLacksAccess: DBXFileRequestsCreateFileRequestErrorAppLacksAccess? { + self as? DBXFileRequestsCreateFileRequestErrorAppLacksAccess + } + + @objc + public var asNoPermission: DBXFileRequestsCreateFileRequestErrorNoPermission? { + self as? DBXFileRequestsCreateFileRequestErrorNoPermission + } + + @objc + public var asEmailUnverified: DBXFileRequestsCreateFileRequestErrorEmailUnverified? { + self as? DBXFileRequestsCreateFileRequestErrorEmailUnverified + } + + @objc + public var asValidationError: DBXFileRequestsCreateFileRequestErrorValidationError? { + self as? DBXFileRequestsCreateFileRequestErrorValidationError + } + + @objc + public var asInvalidLocation: DBXFileRequestsCreateFileRequestErrorInvalidLocation? { + self as? DBXFileRequestsCreateFileRequestErrorInvalidLocation + } + + @objc + public var asRateLimit: DBXFileRequestsCreateFileRequestErrorRateLimit? { + self as? DBXFileRequestsCreateFileRequestErrorRateLimit + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsCreateFileRequestErrorDisabledForTeam: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsCreateFileRequestErrorOther: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.other + super.init(swift: swift) + } +} + +/// This file request ID was not found. +@objc +public class DBXFileRequestsCreateFileRequestErrorNotFound: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.notFound + super.init(swift: swift) + } +} + +/// The specified path is not a folder. +@objc +public class DBXFileRequestsCreateFileRequestErrorNotAFolder: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.notAFolder + super.init(swift: swift) + } +} + +/// This file request is not accessible to this app. Apps with the app folder permission can only access file +/// requests in their app folder. +@objc +public class DBXFileRequestsCreateFileRequestErrorAppLacksAccess: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.appLacksAccess + super.init(swift: swift) + } +} + +/// This user doesn't have permission to access or modify this file request. +@objc +public class DBXFileRequestsCreateFileRequestErrorNoPermission: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.noPermission + super.init(swift: swift) + } +} + +/// This user's email address is not verified. File requests are only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXFileRequestsCreateFileRequestErrorEmailUnverified: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.emailUnverified + super.init(swift: swift) + } +} + +/// There was an error validating the request. For example, the title was invalid, or there were disallowed +/// characters in the destination path. +@objc +public class DBXFileRequestsCreateFileRequestErrorValidationError: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.validationError + super.init(swift: swift) + } +} + +/// File requests are not available on the specified folder. +@objc +public class DBXFileRequestsCreateFileRequestErrorInvalidLocation: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.invalidLocation + super.init(swift: swift) + } +} + +/// The user has reached the rate limit for creating file requests. The limit is currently 4000 file requests +/// total. +@objc +public class DBXFileRequestsCreateFileRequestErrorRateLimit: DBXFileRequestsCreateFileRequestError { + @objc + public init() { + let swift = FileRequests.CreateFileRequestError.rateLimit + super.init(swift: swift) + } +} + +/// There was an error deleting all closed file requests. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsError: NSObject { + let swift: FileRequests.DeleteAllClosedFileRequestsError + + public init(swift: FileRequests.DeleteAllClosedFileRequestsError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.DeleteAllClosedFileRequestsError) -> DBXFileRequestsDeleteAllClosedFileRequestsError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorDisabledForTeam() + case .other: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorOther() + case .notFound: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorNotFound() + case .notAFolder: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorNotAFolder() + case .appLacksAccess: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorAppLacksAccess() + case .noPermission: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorNoPermission() + case .emailUnverified: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorEmailUnverified() + case .validationError: + return DBXFileRequestsDeleteAllClosedFileRequestsErrorValidationError() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsDeleteAllClosedFileRequestsErrorDisabledForTeam? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsDeleteAllClosedFileRequestsErrorOther? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorOther + } + + @objc + public var asNotFound: DBXFileRequestsDeleteAllClosedFileRequestsErrorNotFound? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorNotFound + } + + @objc + public var asNotAFolder: DBXFileRequestsDeleteAllClosedFileRequestsErrorNotAFolder? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorNotAFolder + } + + @objc + public var asAppLacksAccess: DBXFileRequestsDeleteAllClosedFileRequestsErrorAppLacksAccess? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorAppLacksAccess + } + + @objc + public var asNoPermission: DBXFileRequestsDeleteAllClosedFileRequestsErrorNoPermission? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorNoPermission + } + + @objc + public var asEmailUnverified: DBXFileRequestsDeleteAllClosedFileRequestsErrorEmailUnverified? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorEmailUnverified + } + + @objc + public var asValidationError: DBXFileRequestsDeleteAllClosedFileRequestsErrorValidationError? { + self as? DBXFileRequestsDeleteAllClosedFileRequestsErrorValidationError + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorDisabledForTeam: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorOther: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.other + super.init(swift: swift) + } +} + +/// This file request ID was not found. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorNotFound: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.notFound + super.init(swift: swift) + } +} + +/// The specified path is not a folder. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorNotAFolder: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.notAFolder + super.init(swift: swift) + } +} + +/// This file request is not accessible to this app. Apps with the app folder permission can only access file +/// requests in their app folder. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorAppLacksAccess: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.appLacksAccess + super.init(swift: swift) + } +} + +/// This user doesn't have permission to access or modify this file request. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorNoPermission: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.noPermission + super.init(swift: swift) + } +} + +/// This user's email address is not verified. File requests are only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorEmailUnverified: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.emailUnverified + super.init(swift: swift) + } +} + +/// There was an error validating the request. For example, the title was invalid, or there were disallowed +/// characters in the destination path. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsErrorValidationError: DBXFileRequestsDeleteAllClosedFileRequestsError { + @objc + public init() { + let swift = FileRequests.DeleteAllClosedFileRequestsError.validationError + super.init(swift: swift) + } +} + +/// Result for deleteAllClosed. +@objc +public class DBXFileRequestsDeleteAllClosedFileRequestsResult: NSObject { + /// The file requests deleted for this user. + @objc + public var fileRequests: [DBXFileRequestsFileRequest] { swift.fileRequests.map { DBXFileRequestsFileRequest(swift: $0) } } + + @objc + public init(fileRequests: [DBXFileRequestsFileRequest]) { + self.swift = FileRequests.DeleteAllClosedFileRequestsResult(fileRequests: fileRequests.map(\.swift)) + } + + let swift: FileRequests.DeleteAllClosedFileRequestsResult + + public init(swift: FileRequests.DeleteAllClosedFileRequestsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for delete. +@objc +public class DBXFileRequestsDeleteFileRequestArgs: NSObject { + /// List IDs of the file requests to delete. + @objc + public var ids: [String] { swift.ids } + + @objc + public init(ids: [String]) { + self.swift = FileRequests.DeleteFileRequestArgs(ids: ids) + } + + let swift: FileRequests.DeleteFileRequestArgs + + public init(swift: FileRequests.DeleteFileRequestArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// There was an error deleting these file requests. +@objc +public class DBXFileRequestsDeleteFileRequestError: NSObject { + let swift: FileRequests.DeleteFileRequestError + + public init(swift: FileRequests.DeleteFileRequestError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.DeleteFileRequestError) -> DBXFileRequestsDeleteFileRequestError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsDeleteFileRequestErrorDisabledForTeam() + case .other: + return DBXFileRequestsDeleteFileRequestErrorOther() + case .notFound: + return DBXFileRequestsDeleteFileRequestErrorNotFound() + case .notAFolder: + return DBXFileRequestsDeleteFileRequestErrorNotAFolder() + case .appLacksAccess: + return DBXFileRequestsDeleteFileRequestErrorAppLacksAccess() + case .noPermission: + return DBXFileRequestsDeleteFileRequestErrorNoPermission() + case .emailUnverified: + return DBXFileRequestsDeleteFileRequestErrorEmailUnverified() + case .validationError: + return DBXFileRequestsDeleteFileRequestErrorValidationError() + case .fileRequestOpen: + return DBXFileRequestsDeleteFileRequestErrorFileRequestOpen() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsDeleteFileRequestErrorDisabledForTeam? { + self as? DBXFileRequestsDeleteFileRequestErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsDeleteFileRequestErrorOther? { + self as? DBXFileRequestsDeleteFileRequestErrorOther + } + + @objc + public var asNotFound: DBXFileRequestsDeleteFileRequestErrorNotFound? { + self as? DBXFileRequestsDeleteFileRequestErrorNotFound + } + + @objc + public var asNotAFolder: DBXFileRequestsDeleteFileRequestErrorNotAFolder? { + self as? DBXFileRequestsDeleteFileRequestErrorNotAFolder + } + + @objc + public var asAppLacksAccess: DBXFileRequestsDeleteFileRequestErrorAppLacksAccess? { + self as? DBXFileRequestsDeleteFileRequestErrorAppLacksAccess + } + + @objc + public var asNoPermission: DBXFileRequestsDeleteFileRequestErrorNoPermission? { + self as? DBXFileRequestsDeleteFileRequestErrorNoPermission + } + + @objc + public var asEmailUnverified: DBXFileRequestsDeleteFileRequestErrorEmailUnverified? { + self as? DBXFileRequestsDeleteFileRequestErrorEmailUnverified + } + + @objc + public var asValidationError: DBXFileRequestsDeleteFileRequestErrorValidationError? { + self as? DBXFileRequestsDeleteFileRequestErrorValidationError + } + + @objc + public var asFileRequestOpen: DBXFileRequestsDeleteFileRequestErrorFileRequestOpen? { + self as? DBXFileRequestsDeleteFileRequestErrorFileRequestOpen + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsDeleteFileRequestErrorDisabledForTeam: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsDeleteFileRequestErrorOther: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.other + super.init(swift: swift) + } +} + +/// This file request ID was not found. +@objc +public class DBXFileRequestsDeleteFileRequestErrorNotFound: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.notFound + super.init(swift: swift) + } +} + +/// The specified path is not a folder. +@objc +public class DBXFileRequestsDeleteFileRequestErrorNotAFolder: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.notAFolder + super.init(swift: swift) + } +} + +/// This file request is not accessible to this app. Apps with the app folder permission can only access file +/// requests in their app folder. +@objc +public class DBXFileRequestsDeleteFileRequestErrorAppLacksAccess: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.appLacksAccess + super.init(swift: swift) + } +} + +/// This user doesn't have permission to access or modify this file request. +@objc +public class DBXFileRequestsDeleteFileRequestErrorNoPermission: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.noPermission + super.init(swift: swift) + } +} + +/// This user's email address is not verified. File requests are only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXFileRequestsDeleteFileRequestErrorEmailUnverified: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.emailUnverified + super.init(swift: swift) + } +} + +/// There was an error validating the request. For example, the title was invalid, or there were disallowed +/// characters in the destination path. +@objc +public class DBXFileRequestsDeleteFileRequestErrorValidationError: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.validationError + super.init(swift: swift) + } +} + +/// One or more file requests currently open. +@objc +public class DBXFileRequestsDeleteFileRequestErrorFileRequestOpen: DBXFileRequestsDeleteFileRequestError { + @objc + public init() { + let swift = FileRequests.DeleteFileRequestError.fileRequestOpen + super.init(swift: swift) + } +} + +/// Result for delete. +@objc +public class DBXFileRequestsDeleteFileRequestsResult: NSObject { + /// The file requests deleted by the request. + @objc + public var fileRequests: [DBXFileRequestsFileRequest] { swift.fileRequests.map { DBXFileRequestsFileRequest(swift: $0) } } + + @objc + public init(fileRequests: [DBXFileRequestsFileRequest]) { + self.swift = FileRequests.DeleteFileRequestsResult(fileRequests: fileRequests.map(\.swift)) + } + + let swift: FileRequests.DeleteFileRequestsResult + + public init(swift: FileRequests.DeleteFileRequestsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// A file request https://www.dropbox.com/help/9090 for receiving files into the user's Dropbox account. +@objc +public class DBXFileRequestsFileRequest: NSObject { + /// The ID of the file request. + @objc + public var id: String { swift.id } + /// The URL of the file request. + @objc + public var url: String { swift.url } + /// The title of the file request. + @objc + public var title: String { swift.title } + /// The path of the folder in the Dropbox where uploaded files will be sent. This can be null if the destination + /// was removed. For apps with the app folder permission, this will be relative to the app folder. + @objc + public var destination: String? { swift.destination } + /// When this file request was created. + @objc + public var created: Date { swift.created } + /// The deadline for this file request. Only set if the request has a deadline. + @objc + public var deadline: DBXFileRequestsFileRequestDeadline? { guard let swift = swift.deadline else { return nil } + return DBXFileRequestsFileRequestDeadline(swift: swift) + } + + /// Whether or not the file request is open. If the file request is closed, it will not accept any more file + /// submissions. + @objc + public var isOpen: NSNumber { swift.isOpen as NSNumber } + /// The number of files this file request has received. + @objc + public var fileCount: NSNumber { swift.fileCount as NSNumber } + /// A description of the file request. + @objc + public var description_: String? { swift.description_ } + + @objc + public init( + id: String, + url: String, + title: String, + created: Date, + isOpen: NSNumber, + fileCount: NSNumber, + destination: String?, + deadline: DBXFileRequestsFileRequestDeadline?, + description_: String? + ) { + self.swift = FileRequests.FileRequest( + id: id, + url: url, + title: title, + created: created, + isOpen: isOpen.boolValue, + fileCount: fileCount.int64Value, + destination: destination, + deadline: deadline?.swift, + description_: description_ + ) + } + + let swift: FileRequests.FileRequest + + public init(swift: FileRequests.FileRequest) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestDeadline struct +@objc +public class DBXFileRequestsFileRequestDeadline: NSObject { + /// The deadline for this file request. + @objc + public var deadline: Date { swift.deadline } + /// If set, allow uploads after the deadline has passed. These uploads will be marked overdue. + @objc + public var allowLateUploads: DBXFileRequestsGracePeriod? { guard let swift = swift.allowLateUploads else { return nil } + return DBXFileRequestsGracePeriod(swift: swift) + } + + @objc + public init(deadline: Date, allowLateUploads: DBXFileRequestsGracePeriod?) { + self.swift = FileRequests.FileRequestDeadline(deadline: deadline, allowLateUploads: allowLateUploads?.swift) + } + + let swift: FileRequests.FileRequestDeadline + + public init(swift: FileRequests.FileRequestDeadline) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for get. +@objc +public class DBXFileRequestsGetFileRequestArgs: NSObject { + /// The ID of the file request to retrieve. + @objc + public var id: String { swift.id } + + @objc + public init(id: String) { + self.swift = FileRequests.GetFileRequestArgs(id: id) + } + + let swift: FileRequests.GetFileRequestArgs + + public init(swift: FileRequests.GetFileRequestArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// There was an error retrieving the specified file request. +@objc +public class DBXFileRequestsGetFileRequestError: NSObject { + let swift: FileRequests.GetFileRequestError + + public init(swift: FileRequests.GetFileRequestError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.GetFileRequestError) -> DBXFileRequestsGetFileRequestError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsGetFileRequestErrorDisabledForTeam() + case .other: + return DBXFileRequestsGetFileRequestErrorOther() + case .notFound: + return DBXFileRequestsGetFileRequestErrorNotFound() + case .notAFolder: + return DBXFileRequestsGetFileRequestErrorNotAFolder() + case .appLacksAccess: + return DBXFileRequestsGetFileRequestErrorAppLacksAccess() + case .noPermission: + return DBXFileRequestsGetFileRequestErrorNoPermission() + case .emailUnverified: + return DBXFileRequestsGetFileRequestErrorEmailUnverified() + case .validationError: + return DBXFileRequestsGetFileRequestErrorValidationError() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsGetFileRequestErrorDisabledForTeam? { + self as? DBXFileRequestsGetFileRequestErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsGetFileRequestErrorOther? { + self as? DBXFileRequestsGetFileRequestErrorOther + } + + @objc + public var asNotFound: DBXFileRequestsGetFileRequestErrorNotFound? { + self as? DBXFileRequestsGetFileRequestErrorNotFound + } + + @objc + public var asNotAFolder: DBXFileRequestsGetFileRequestErrorNotAFolder? { + self as? DBXFileRequestsGetFileRequestErrorNotAFolder + } + + @objc + public var asAppLacksAccess: DBXFileRequestsGetFileRequestErrorAppLacksAccess? { + self as? DBXFileRequestsGetFileRequestErrorAppLacksAccess + } + + @objc + public var asNoPermission: DBXFileRequestsGetFileRequestErrorNoPermission? { + self as? DBXFileRequestsGetFileRequestErrorNoPermission + } + + @objc + public var asEmailUnverified: DBXFileRequestsGetFileRequestErrorEmailUnverified? { + self as? DBXFileRequestsGetFileRequestErrorEmailUnverified + } + + @objc + public var asValidationError: DBXFileRequestsGetFileRequestErrorValidationError? { + self as? DBXFileRequestsGetFileRequestErrorValidationError + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsGetFileRequestErrorDisabledForTeam: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGetFileRequestErrorOther: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.other + super.init(swift: swift) + } +} + +/// This file request ID was not found. +@objc +public class DBXFileRequestsGetFileRequestErrorNotFound: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.notFound + super.init(swift: swift) + } +} + +/// The specified path is not a folder. +@objc +public class DBXFileRequestsGetFileRequestErrorNotAFolder: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.notAFolder + super.init(swift: swift) + } +} + +/// This file request is not accessible to this app. Apps with the app folder permission can only access file +/// requests in their app folder. +@objc +public class DBXFileRequestsGetFileRequestErrorAppLacksAccess: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.appLacksAccess + super.init(swift: swift) + } +} + +/// This user doesn't have permission to access or modify this file request. +@objc +public class DBXFileRequestsGetFileRequestErrorNoPermission: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.noPermission + super.init(swift: swift) + } +} + +/// This user's email address is not verified. File requests are only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXFileRequestsGetFileRequestErrorEmailUnverified: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.emailUnverified + super.init(swift: swift) + } +} + +/// There was an error validating the request. For example, the title was invalid, or there were disallowed +/// characters in the destination path. +@objc +public class DBXFileRequestsGetFileRequestErrorValidationError: DBXFileRequestsGetFileRequestError { + @objc + public init() { + let swift = FileRequests.GetFileRequestError.validationError + super.init(swift: swift) + } +} + +/// Objective-C compatible GracePeriod union +@objc +public class DBXFileRequestsGracePeriod: NSObject { + let swift: FileRequests.GracePeriod + + public init(swift: FileRequests.GracePeriod) { + self.swift = swift + } + + public static func factory(swift: FileRequests.GracePeriod) -> DBXFileRequestsGracePeriod { + switch swift { + case .oneDay: + return DBXFileRequestsGracePeriodOneDay() + case .twoDays: + return DBXFileRequestsGracePeriodTwoDays() + case .sevenDays: + return DBXFileRequestsGracePeriodSevenDays() + case .thirtyDays: + return DBXFileRequestsGracePeriodThirtyDays() + case .always: + return DBXFileRequestsGracePeriodAlways() + case .other: + return DBXFileRequestsGracePeriodOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOneDay: DBXFileRequestsGracePeriodOneDay? { + self as? DBXFileRequestsGracePeriodOneDay + } + + @objc + public var asTwoDays: DBXFileRequestsGracePeriodTwoDays? { + self as? DBXFileRequestsGracePeriodTwoDays + } + + @objc + public var asSevenDays: DBXFileRequestsGracePeriodSevenDays? { + self as? DBXFileRequestsGracePeriodSevenDays + } + + @objc + public var asThirtyDays: DBXFileRequestsGracePeriodThirtyDays? { + self as? DBXFileRequestsGracePeriodThirtyDays + } + + @objc + public var asAlways: DBXFileRequestsGracePeriodAlways? { + self as? DBXFileRequestsGracePeriodAlways + } + + @objc + public var asOther: DBXFileRequestsGracePeriodOther? { + self as? DBXFileRequestsGracePeriodOther + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGracePeriodOneDay: DBXFileRequestsGracePeriod { + @objc + public init() { + let swift = FileRequests.GracePeriod.oneDay + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGracePeriodTwoDays: DBXFileRequestsGracePeriod { + @objc + public init() { + let swift = FileRequests.GracePeriod.twoDays + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGracePeriodSevenDays: DBXFileRequestsGracePeriod { + @objc + public init() { + let swift = FileRequests.GracePeriod.sevenDays + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGracePeriodThirtyDays: DBXFileRequestsGracePeriod { + @objc + public init() { + let swift = FileRequests.GracePeriod.thirtyDays + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGracePeriodAlways: DBXFileRequestsGracePeriod { + @objc + public init() { + let swift = FileRequests.GracePeriod.always + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsGracePeriodOther: DBXFileRequestsGracePeriod { + @objc + public init() { + let swift = FileRequests.GracePeriod.other + super.init(swift: swift) + } +} + +/// Arguments for listV2. +@objc +public class DBXFileRequestsListFileRequestsArg: NSObject { + /// The maximum number of file requests that should be returned per request. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(limit: NSNumber) { + self.swift = FileRequests.ListFileRequestsArg(limit: limit.uint64Value) + } + + let swift: FileRequests.ListFileRequestsArg + + public init(swift: FileRequests.ListFileRequestsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFileRequestsContinueArg struct +@objc +public class DBXFileRequestsListFileRequestsContinueArg: NSObject { + /// The cursor returned by the previous API call specified in the endpoint description. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = FileRequests.ListFileRequestsContinueArg(cursor: cursor) + } + + let swift: FileRequests.ListFileRequestsContinueArg + + public init(swift: FileRequests.ListFileRequestsContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// There was an error retrieving the file requests. +@objc +public class DBXFileRequestsListFileRequestsContinueError: NSObject { + let swift: FileRequests.ListFileRequestsContinueError + + public init(swift: FileRequests.ListFileRequestsContinueError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.ListFileRequestsContinueError) -> DBXFileRequestsListFileRequestsContinueError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsListFileRequestsContinueErrorDisabledForTeam() + case .other: + return DBXFileRequestsListFileRequestsContinueErrorOther() + case .invalidCursor: + return DBXFileRequestsListFileRequestsContinueErrorInvalidCursor() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsListFileRequestsContinueErrorDisabledForTeam? { + self as? DBXFileRequestsListFileRequestsContinueErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsListFileRequestsContinueErrorOther? { + self as? DBXFileRequestsListFileRequestsContinueErrorOther + } + + @objc + public var asInvalidCursor: DBXFileRequestsListFileRequestsContinueErrorInvalidCursor? { + self as? DBXFileRequestsListFileRequestsContinueErrorInvalidCursor + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsListFileRequestsContinueErrorDisabledForTeam: DBXFileRequestsListFileRequestsContinueError { + @objc + public init() { + let swift = FileRequests.ListFileRequestsContinueError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsListFileRequestsContinueErrorOther: DBXFileRequestsListFileRequestsContinueError { + @objc + public init() { + let swift = FileRequests.ListFileRequestsContinueError.other + super.init(swift: swift) + } +} + +/// The cursor is invalid. +@objc +public class DBXFileRequestsListFileRequestsContinueErrorInvalidCursor: DBXFileRequestsListFileRequestsContinueError { + @objc + public init() { + let swift = FileRequests.ListFileRequestsContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// There was an error retrieving the file requests. +@objc +public class DBXFileRequestsListFileRequestsError: NSObject { + let swift: FileRequests.ListFileRequestsError + + public init(swift: FileRequests.ListFileRequestsError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.ListFileRequestsError) -> DBXFileRequestsListFileRequestsError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsListFileRequestsErrorDisabledForTeam() + case .other: + return DBXFileRequestsListFileRequestsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsListFileRequestsErrorDisabledForTeam? { + self as? DBXFileRequestsListFileRequestsErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsListFileRequestsErrorOther? { + self as? DBXFileRequestsListFileRequestsErrorOther + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsListFileRequestsErrorDisabledForTeam: DBXFileRequestsListFileRequestsError { + @objc + public init() { + let swift = FileRequests.ListFileRequestsError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsListFileRequestsErrorOther: DBXFileRequestsListFileRequestsError { + @objc + public init() { + let swift = FileRequests.ListFileRequestsError.other + super.init(swift: swift) + } +} + +/// Result for list_. +@objc +public class DBXFileRequestsListFileRequestsResult: NSObject { + /// The file requests owned by this user. Apps with the app folder permission will only see file requests in + /// their app folder. + @objc + public var fileRequests: [DBXFileRequestsFileRequest] { swift.fileRequests.map { DBXFileRequestsFileRequest(swift: $0) } } + + @objc + public init(fileRequests: [DBXFileRequestsFileRequest]) { + self.swift = FileRequests.ListFileRequestsResult(fileRequests: fileRequests.map(\.swift)) + } + + let swift: FileRequests.ListFileRequestsResult + + public init(swift: FileRequests.ListFileRequestsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result for listV2 and listContinue. +@objc +public class DBXFileRequestsListFileRequestsV2Result: NSObject { + /// The file requests owned by this user. Apps with the app folder permission will only see file requests in + /// their app folder. + @objc + public var fileRequests: [DBXFileRequestsFileRequest] { swift.fileRequests.map { DBXFileRequestsFileRequest(swift: $0) } } + /// Pass the cursor into listContinue to obtain additional file requests. + @objc + public var cursor: String { swift.cursor } + /// Is true if there are additional file requests that have not been returned yet. An additional call to + /// :route:list/continue` can retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(fileRequests: [DBXFileRequestsFileRequest], cursor: String, hasMore: NSNumber) { + self.swift = FileRequests.ListFileRequestsV2Result(fileRequests: fileRequests.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: FileRequests.ListFileRequestsV2Result + + public init(swift: FileRequests.ListFileRequestsV2Result) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for update. +@objc +public class DBXFileRequestsUpdateFileRequestArgs: NSObject { + /// The ID of the file request to update. + @objc + public var id: String { swift.id } + /// The new title of the file request. Must not be empty. + @objc + public var title: String? { swift.title } + /// The new path of the folder in the Dropbox where uploaded files will be sent. For apps with the app folder + /// permission, this will be relative to the app folder. + @objc + public var destination: String? { swift.destination } + /// The new deadline for the file request. Deadlines can only be set by Professional and Business accounts. + @objc + public var deadline: DBXFileRequestsUpdateFileRequestDeadline { DBXFileRequestsUpdateFileRequestDeadline(swift: swift.deadline) } + /// Whether to set this file request as open or closed. + @objc + public var open: NSNumber? { swift.open as NSNumber? } + /// The description of the file request. + @objc + public var description_: String? { swift.description_ } + + @objc + public init(id: String, title: String?, destination: String?, deadline: DBXFileRequestsUpdateFileRequestDeadline, open: NSNumber?, description_: String?) { + self.swift = FileRequests.UpdateFileRequestArgs( + id: id, + title: title, + destination: destination, + deadline: deadline.swift, + open: open?.boolValue, + description_: description_ + ) + } + + let swift: FileRequests.UpdateFileRequestArgs + + public init(swift: FileRequests.UpdateFileRequestArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UpdateFileRequestDeadline union +@objc +public class DBXFileRequestsUpdateFileRequestDeadline: NSObject { + let swift: FileRequests.UpdateFileRequestDeadline + + public init(swift: FileRequests.UpdateFileRequestDeadline) { + self.swift = swift + } + + public static func factory(swift: FileRequests.UpdateFileRequestDeadline) -> DBXFileRequestsUpdateFileRequestDeadline { + switch swift { + case .noUpdate: + return DBXFileRequestsUpdateFileRequestDeadlineNoUpdate() + case .update(let swiftArg): + guard let swiftArg = swiftArg else { return DBXFileRequestsUpdateFileRequestDeadlineUpdate(nil) } + let arg = DBXFileRequestsFileRequestDeadline(swift: swiftArg) + return DBXFileRequestsUpdateFileRequestDeadlineUpdate(arg) + case .other: + return DBXFileRequestsUpdateFileRequestDeadlineOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNoUpdate: DBXFileRequestsUpdateFileRequestDeadlineNoUpdate? { + self as? DBXFileRequestsUpdateFileRequestDeadlineNoUpdate + } + + @objc + public var asUpdate: DBXFileRequestsUpdateFileRequestDeadlineUpdate? { + self as? DBXFileRequestsUpdateFileRequestDeadlineUpdate + } + + @objc + public var asOther: DBXFileRequestsUpdateFileRequestDeadlineOther? { + self as? DBXFileRequestsUpdateFileRequestDeadlineOther + } +} + +/// Do not change the file request's deadline. +@objc +public class DBXFileRequestsUpdateFileRequestDeadlineNoUpdate: DBXFileRequestsUpdateFileRequestDeadline { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestDeadline.noUpdate + super.init(swift: swift) + } +} + +/// If null, the file request's deadline is cleared. +@objc +public class DBXFileRequestsUpdateFileRequestDeadlineUpdate: DBXFileRequestsUpdateFileRequestDeadline { + @objc + public var update: DBXFileRequestsFileRequestDeadline? + + @objc + public init(_ arg: DBXFileRequestsFileRequestDeadline?) { + self.update = arg + let swift = FileRequests.UpdateFileRequestDeadline.update(arg?.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsUpdateFileRequestDeadlineOther: DBXFileRequestsUpdateFileRequestDeadline { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestDeadline.other + super.init(swift: swift) + } +} + +/// There is an error updating the file request. +@objc +public class DBXFileRequestsUpdateFileRequestError: NSObject { + let swift: FileRequests.UpdateFileRequestError + + public init(swift: FileRequests.UpdateFileRequestError) { + self.swift = swift + } + + public static func factory(swift: FileRequests.UpdateFileRequestError) -> DBXFileRequestsUpdateFileRequestError { + switch swift { + case .disabledForTeam: + return DBXFileRequestsUpdateFileRequestErrorDisabledForTeam() + case .other: + return DBXFileRequestsUpdateFileRequestErrorOther() + case .notFound: + return DBXFileRequestsUpdateFileRequestErrorNotFound() + case .notAFolder: + return DBXFileRequestsUpdateFileRequestErrorNotAFolder() + case .appLacksAccess: + return DBXFileRequestsUpdateFileRequestErrorAppLacksAccess() + case .noPermission: + return DBXFileRequestsUpdateFileRequestErrorNoPermission() + case .emailUnverified: + return DBXFileRequestsUpdateFileRequestErrorEmailUnverified() + case .validationError: + return DBXFileRequestsUpdateFileRequestErrorValidationError() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabledForTeam: DBXFileRequestsUpdateFileRequestErrorDisabledForTeam? { + self as? DBXFileRequestsUpdateFileRequestErrorDisabledForTeam + } + + @objc + public var asOther: DBXFileRequestsUpdateFileRequestErrorOther? { + self as? DBXFileRequestsUpdateFileRequestErrorOther + } + + @objc + public var asNotFound: DBXFileRequestsUpdateFileRequestErrorNotFound? { + self as? DBXFileRequestsUpdateFileRequestErrorNotFound + } + + @objc + public var asNotAFolder: DBXFileRequestsUpdateFileRequestErrorNotAFolder? { + self as? DBXFileRequestsUpdateFileRequestErrorNotAFolder + } + + @objc + public var asAppLacksAccess: DBXFileRequestsUpdateFileRequestErrorAppLacksAccess? { + self as? DBXFileRequestsUpdateFileRequestErrorAppLacksAccess + } + + @objc + public var asNoPermission: DBXFileRequestsUpdateFileRequestErrorNoPermission? { + self as? DBXFileRequestsUpdateFileRequestErrorNoPermission + } + + @objc + public var asEmailUnverified: DBXFileRequestsUpdateFileRequestErrorEmailUnverified? { + self as? DBXFileRequestsUpdateFileRequestErrorEmailUnverified + } + + @objc + public var asValidationError: DBXFileRequestsUpdateFileRequestErrorValidationError? { + self as? DBXFileRequestsUpdateFileRequestErrorValidationError + } +} + +/// This user's Dropbox Business team doesn't allow file requests. +@objc +public class DBXFileRequestsUpdateFileRequestErrorDisabledForTeam: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.disabledForTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFileRequestsUpdateFileRequestErrorOther: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.other + super.init(swift: swift) + } +} + +/// This file request ID was not found. +@objc +public class DBXFileRequestsUpdateFileRequestErrorNotFound: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.notFound + super.init(swift: swift) + } +} + +/// The specified path is not a folder. +@objc +public class DBXFileRequestsUpdateFileRequestErrorNotAFolder: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.notAFolder + super.init(swift: swift) + } +} + +/// This file request is not accessible to this app. Apps with the app folder permission can only access file +/// requests in their app folder. +@objc +public class DBXFileRequestsUpdateFileRequestErrorAppLacksAccess: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.appLacksAccess + super.init(swift: swift) + } +} + +/// This user doesn't have permission to access or modify this file request. +@objc +public class DBXFileRequestsUpdateFileRequestErrorNoPermission: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.noPermission + super.init(swift: swift) + } +} + +/// This user's email address is not verified. File requests are only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXFileRequestsUpdateFileRequestErrorEmailUnverified: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.emailUnverified + super.init(swift: swift) + } +} + +/// There was an error validating the request. For example, the title was invalid, or there were disallowed +/// characters in the destination path. +@objc +public class DBXFileRequestsUpdateFileRequestErrorValidationError: DBXFileRequestsUpdateFileRequestError { + @objc + public init() { + let swift = FileRequests.UpdateFileRequestError.validationError + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequestsRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequestsRoutes.swift new file mode 100644 index 000000000..a8746f3da --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFileRequestsRoutes.swift @@ -0,0 +1,817 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the file_requests namespace +/// For Swift routes see FileRequestsRoutes +@objc +public class DBXFileRequestsRoutes: NSObject { + private let swift: FileRequestsRoutes + init(swift: FileRequestsRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Returns the total number of file requests owned by this user. Includes both open and closed file requests. + /// + /// - scope: file_requests.read + /// + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.CountFileRequestsResult` + /// object on success or a `FileRequests.CountFileRequestsError` object on failure. + @objc + @discardableResult public func count() -> DBXFileRequestsCountRpcRequest { + let swift = swift.count() + return DBXFileRequestsCountRpcRequest(swift: swift) + } + + /// Creates a file request for this user. + /// + /// - scope: file_requests.write + /// + /// - parameter title: The title of the file request. Must not be empty. + /// - parameter destination: The path of the folder in the Dropbox where uploaded files will be sent. For apps with + /// the app folder permission, this will be relative to the app folder. + /// - parameter deadline: The deadline for the file request. Deadlines can only be set by Professional and Business + /// accounts. + /// - parameter open: Whether or not the file request should be open. If the file request is closed, it will not + /// accept any file submissions, but it can be opened later. + /// - parameter description_: A description of the file request. + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.CreateFileRequestError` object on failure. + @objc + @discardableResult public func create( + title: String, + destination: String, + deadline: DBXFileRequestsFileRequestDeadline?, + open: NSNumber, + description_: String? + ) -> DBXFileRequestsCreateRpcRequest { + let swift = swift.create(title: title, destination: destination, deadline: deadline?.swift, open: open.boolValue, description_: description_) + return DBXFileRequestsCreateRpcRequest(swift: swift) + } + + /// Creates a file request for this user. + /// + /// - scope: file_requests.write + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.CreateFileRequestError` object on failure. + @objc + @discardableResult public func create(title: String, destination: String) -> DBXFileRequestsCreateRpcRequest { + let swift = swift.create(title: title, destination: destination) + return DBXFileRequestsCreateRpcRequest(swift: swift) + } + + /// Delete a batch of closed file requests. + /// + /// - scope: file_requests.write + /// + /// - parameter ids: List IDs of the file requests to delete. + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.DeleteFileRequestsResult` + /// object on success or a `FileRequests.DeleteFileRequestError` object on failure. + @objc + @discardableResult public func delete(ids: [String]) -> DBXFileRequestsDeleteRpcRequest { + let swift = swift.delete(ids: ids) + return DBXFileRequestsDeleteRpcRequest(swift: swift) + } + + /// Delete all closed file requests owned by this user. + /// + /// - scope: file_requests.write + /// + /// + /// - returns: Through the response callback, the caller will receive a + /// `FileRequests.DeleteAllClosedFileRequestsResult` object on success or a + /// `FileRequests.DeleteAllClosedFileRequestsError` object on failure. + @objc + @discardableResult public func deleteAllClosed() -> DBXFileRequestsDeleteAllClosedRpcRequest { + let swift = swift.deleteAllClosed() + return DBXFileRequestsDeleteAllClosedRpcRequest(swift: swift) + } + + /// Returns the specified file request. + /// + /// - scope: file_requests.read + /// + /// - parameter id: The ID of the file request to retrieve. + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.GetFileRequestError` object on failure. + @objc + @discardableResult public func get(id: String) -> DBXFileRequestsGetRpcRequest { + let swift = swift.get(id: id) + return DBXFileRequestsGetRpcRequest(swift: swift) + } + + /// Returns a list of file requests owned by this user. For apps with the app folder permission, this will only + /// return file requests with destinations in the app folder. + /// + /// - scope: file_requests.read + /// + /// - parameter limit: The maximum number of file requests that should be returned per request. + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsV2Result` + /// object on success or a `FileRequests.ListFileRequestsError` object on failure. + @objc + @discardableResult public func listV2(limit: NSNumber) -> DBXFileRequestsList_RpcRequestV2 { + let swift = swift.listV2(limit: limit.uint64Value) + return DBXFileRequestsList_RpcRequestV2(swift: swift) + } + + /// Returns a list of file requests owned by this user. For apps with the app folder permission, this will only + /// return file requests with destinations in the app folder. + /// + /// - scope: file_requests.read + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsV2Result` + /// object on success or a `FileRequests.ListFileRequestsError` object on failure. + @objc + @discardableResult public func listV2() -> DBXFileRequestsList_RpcRequestV2 { + let swift = swift.listV2() + return DBXFileRequestsList_RpcRequestV2(swift: swift) + } + + /// Returns a list of file requests owned by this user. For apps with the app folder permission, this will only + /// return file requests with destinations in the app folder. + /// + /// - scope: file_requests.read + /// + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsResult` object + /// on success or a `FileRequests.ListFileRequestsError` object on failure. + @objc + @discardableResult public func list_() -> DBXFileRequestsList_RpcRequest { + let swift = swift.list_() + return DBXFileRequestsList_RpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from listV2, use this to paginate through all file requests. The cursor must + /// come from a previous call to listV2 or listContinue. + /// + /// - scope: file_requests.read + /// + /// - parameter cursor: The cursor returned by the previous API call specified in the endpoint description. + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.ListFileRequestsV2Result` + /// object on success or a `FileRequests.ListFileRequestsContinueError` object on failure. + @objc + @discardableResult public func listContinue(cursor: String) -> DBXFileRequestsListContinueRpcRequest { + let swift = swift.listContinue(cursor: cursor) + return DBXFileRequestsListContinueRpcRequest(swift: swift) + } + + /// Update a file request. + /// + /// - scope: file_requests.write + /// + /// - parameter id: The ID of the file request to update. + /// - parameter title: The new title of the file request. Must not be empty. + /// - parameter destination: The new path of the folder in the Dropbox where uploaded files will be sent. For apps + /// with the app folder permission, this will be relative to the app folder. + /// - parameter deadline: The new deadline for the file request. Deadlines can only be set by Professional and + /// Business accounts. + /// - parameter open: Whether to set this file request as open or closed. + /// - parameter description_: The description of the file request. + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.UpdateFileRequestError` object on failure. + @objc + @discardableResult public func update( + id: String, + title: String?, + destination: String?, + deadline: DBXFileRequestsUpdateFileRequestDeadline, + open: NSNumber?, + description_: String? + ) -> DBXFileRequestsUpdateRpcRequest { + let swift = swift.update(id: id, title: title, destination: destination, deadline: deadline.swift, open: open?.boolValue, description_: description_) + return DBXFileRequestsUpdateRpcRequest(swift: swift) + } + + /// Update a file request. + /// + /// - scope: file_requests.write + /// + /// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on success + /// or a `FileRequests.UpdateFileRequestError` object on failure. + @objc + @discardableResult public func update(id: String) -> DBXFileRequestsUpdateRpcRequest { + let swift = swift.update(id: id) + return DBXFileRequestsUpdateRpcRequest(swift: swift) + } +} + +@objc +public class DBXFileRequestsCountRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsCountFileRequestsResult?, DBXFileRequestsCountFileRequestsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsCountFileRequestsResult?, DBXFileRequestsCountFileRequestsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsCountFileRequestsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsCountFileRequestsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsCountFileRequestsResult? + if let swift = result { + objc = DBXFileRequestsCountFileRequestsResult(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 DBXFileRequestsCreateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsFileRequest?, DBXFileRequestsCreateFileRequestError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsFileRequest?, DBXFileRequestsCreateFileRequestError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsCreateFileRequestError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsCreateFileRequestError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsFileRequest? + if let swift = result { + objc = DBXFileRequestsFileRequest(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 DBXFileRequestsDeleteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsDeleteFileRequestsResult?, DBXFileRequestsDeleteFileRequestError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsDeleteFileRequestsResult?, DBXFileRequestsDeleteFileRequestError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsDeleteFileRequestError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsDeleteFileRequestError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsDeleteFileRequestsResult? + if let swift = result { + objc = DBXFileRequestsDeleteFileRequestsResult(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 DBXFileRequestsDeleteAllClosedRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsDeleteAllClosedFileRequestsResult?, DBXFileRequestsDeleteAllClosedFileRequestsError?, DBXCallError?) + -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsDeleteAllClosedFileRequestsResult?, DBXFileRequestsDeleteAllClosedFileRequestsError?, DBXCallError?) + -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsDeleteAllClosedFileRequestsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsDeleteAllClosedFileRequestsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsDeleteAllClosedFileRequestsResult? + if let swift = result { + objc = DBXFileRequestsDeleteAllClosedFileRequestsResult(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 DBXFileRequestsGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsFileRequest?, DBXFileRequestsGetFileRequestError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsFileRequest?, DBXFileRequestsGetFileRequestError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsGetFileRequestError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsGetFileRequestError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsFileRequest? + if let swift = result { + objc = DBXFileRequestsFileRequest(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 DBXFileRequestsList_RpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsListFileRequestsV2Result?, DBXFileRequestsListFileRequestsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsListFileRequestsV2Result?, DBXFileRequestsListFileRequestsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsListFileRequestsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsListFileRequestsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsListFileRequestsV2Result? + if let swift = result { + objc = DBXFileRequestsListFileRequestsV2Result(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 DBXFileRequestsList_RpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsListFileRequestsResult?, DBXFileRequestsListFileRequestsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsListFileRequestsResult?, DBXFileRequestsListFileRequestsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsListFileRequestsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsListFileRequestsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsListFileRequestsResult? + if let swift = result { + objc = DBXFileRequestsListFileRequestsResult(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 DBXFileRequestsListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsListFileRequestsV2Result?, DBXFileRequestsListFileRequestsContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsListFileRequestsV2Result?, DBXFileRequestsListFileRequestsContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsListFileRequestsContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsListFileRequestsContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsListFileRequestsV2Result? + if let swift = result { + objc = DBXFileRequestsListFileRequestsV2Result(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 DBXFileRequestsUpdateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFileRequestsFileRequest?, DBXFileRequestsUpdateFileRequestError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFileRequestsFileRequest?, DBXFileRequestsUpdateFileRequestError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFileRequestsUpdateFileRequestError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFileRequestsUpdateFileRequestError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFileRequestsFileRequest? + if let swift = result { + objc = DBXFileRequestsFileRequest(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift new file mode 100644 index 000000000..cf46b5ded --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift @@ -0,0 +1,11362 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the files namespace +/// For Swift see files + +/// Objective-C compatible AddTagArg struct +@objc +public class DBXFilesAddTagArg: NSObject { + /// Path to the item to be tagged. + @objc + public var path: String { swift.path } + /// The value of the tag to add. Will be automatically converted to lowercase letters. + @objc + public var tagText: String { swift.tagText } + + @objc + public init(path: String, tagText: String) { + self.swift = Files.AddTagArg(path: path, tagText: tagText) + } + + let swift: Files.AddTagArg + + public init(swift: Files.AddTagArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BaseTagError union +@objc +public class DBXFilesBaseTagError: NSObject { + let swift: Files.BaseTagError + + public init(swift: Files.BaseTagError) { + self.swift = swift + } + + public static func factory(swift: Files.BaseTagError) -> DBXFilesBaseTagError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesBaseTagErrorPath(arg) + case .other: + return DBXFilesBaseTagErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesBaseTagErrorPath? { + self as? DBXFilesBaseTagErrorPath + } + + @objc + public var asOther: DBXFilesBaseTagErrorOther? { + self as? DBXFilesBaseTagErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesBaseTagErrorPath: DBXFilesBaseTagError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.BaseTagError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesBaseTagErrorOther: DBXFilesBaseTagError { + @objc + public init() { + let swift = Files.BaseTagError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AddTagError union +@objc +public class DBXFilesAddTagError: NSObject { + let swift: Files.AddTagError + + public init(swift: Files.AddTagError) { + self.swift = swift + } + + public static func factory(swift: Files.AddTagError) -> DBXFilesAddTagError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesAddTagErrorPath(arg) + case .other: + return DBXFilesAddTagErrorOther() + case .tooManyTags: + return DBXFilesAddTagErrorTooManyTags() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesAddTagErrorPath? { + self as? DBXFilesAddTagErrorPath + } + + @objc + public var asOther: DBXFilesAddTagErrorOther? { + self as? DBXFilesAddTagErrorOther + } + + @objc + public var asTooManyTags: DBXFilesAddTagErrorTooManyTags? { + self as? DBXFilesAddTagErrorTooManyTags + } +} + +/// An unspecified error. +@objc +public class DBXFilesAddTagErrorPath: DBXFilesAddTagError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.AddTagError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesAddTagErrorOther: DBXFilesAddTagError { + @objc + public init() { + let swift = Files.AddTagError.other + super.init(swift: swift) + } +} + +/// The item already has the maximum supported number of tags. +@objc +public class DBXFilesAddTagErrorTooManyTags: DBXFilesAddTagError { + @objc + public init() { + let swift = Files.AddTagError.tooManyTags + super.init(swift: swift) + } +} + +/// Objective-C compatible GetMetadataArg struct +@objc +public class DBXFilesGetMetadataArg: NSObject { + /// The path of a file or folder on Dropbox. + @objc + public var path: String { swift.path } + /// If true, mediaInfo in FileMetadata is set for photo and video. + @objc + public var includeMediaInfo: NSNumber { swift.includeMediaInfo as NSNumber } + /// If true, DeletedMetadata will be returned for deleted file or folder, otherwise notFound in LookupError will + /// be returned. + @objc + public var includeDeleted: NSNumber { swift.includeDeleted as NSNumber } + /// If true, the results will include a flag for each file indicating whether or not that file has any explicit + /// members. + @objc + public var includeHasExplicitSharedMembers: NSNumber { swift.includeHasExplicitSharedMembers as NSNumber } + /// If set to a valid list of template IDs, propertyGroups in FileMetadata is set if there exists property data + /// associated with the file and each of the listed templates. + @objc + public var includePropertyGroups: DBXFilePropertiesTemplateFilterBase? { guard let swift = swift.includePropertyGroups else { return nil } + return DBXFilePropertiesTemplateFilterBase(swift: swift) + } + + @objc + public init( + path: String, + includeMediaInfo: NSNumber, + includeDeleted: NSNumber, + includeHasExplicitSharedMembers: NSNumber, + includePropertyGroups: DBXFilePropertiesTemplateFilterBase? + ) { + self.swift = Files.GetMetadataArg( + path: path, + includeMediaInfo: includeMediaInfo.boolValue, + includeDeleted: includeDeleted.boolValue, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers.boolValue, + includePropertyGroups: includePropertyGroups?.swift + ) + } + + let swift: Files.GetMetadataArg + + public init(swift: Files.GetMetadataArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AlphaGetMetadataArg struct +@objc +public class DBXFilesAlphaGetMetadataArg: DBXFilesGetMetadataArg { + /// If set to a valid list of template IDs, propertyGroups in FileMetadata is set for files with custom + /// properties. + @objc + public var includePropertyTemplates: [String]? { subSwift.includePropertyTemplates } + + @objc + public init( + path: String, + includeMediaInfo: NSNumber, + includeDeleted: NSNumber, + includeHasExplicitSharedMembers: NSNumber, + includePropertyGroups: DBXFilePropertiesTemplateFilterBase?, + includePropertyTemplates: [String]? + ) { + let swift = Files.AlphaGetMetadataArg( + path: path, + includeMediaInfo: includeMediaInfo.boolValue, + includeDeleted: includeDeleted.boolValue, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers.boolValue, + includePropertyGroups: includePropertyGroups?.swift, + includePropertyTemplates: includePropertyTemplates + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.AlphaGetMetadataArg + + public init(swift: Files.AlphaGetMetadataArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible GetMetadataError union +@objc +public class DBXFilesGetMetadataError: NSObject { + let swift: Files.GetMetadataError + + public init(swift: Files.GetMetadataError) { + self.swift = swift + } + + public static func factory(swift: Files.GetMetadataError) -> DBXFilesGetMetadataError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesGetMetadataErrorPath(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesGetMetadataErrorPath? { + self as? DBXFilesGetMetadataErrorPath + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetMetadataErrorPath: DBXFilesGetMetadataError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.GetMetadataError.path(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible AlphaGetMetadataError union +@objc +public class DBXFilesAlphaGetMetadataError: NSObject { + let swift: Files.AlphaGetMetadataError + + public init(swift: Files.AlphaGetMetadataError) { + self.swift = swift + } + + public static func factory(swift: Files.AlphaGetMetadataError) -> DBXFilesAlphaGetMetadataError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesAlphaGetMetadataErrorPath(arg) + case .propertiesError(let swiftArg): + let arg = DBXFilePropertiesLookUpPropertiesError(swift: swiftArg) + return DBXFilesAlphaGetMetadataErrorPropertiesError(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesAlphaGetMetadataErrorPath? { + self as? DBXFilesAlphaGetMetadataErrorPath + } + + @objc + public var asPropertiesError: DBXFilesAlphaGetMetadataErrorPropertiesError? { + self as? DBXFilesAlphaGetMetadataErrorPropertiesError + } +} + +/// An unspecified error. +@objc +public class DBXFilesAlphaGetMetadataErrorPath: DBXFilesAlphaGetMetadataError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.AlphaGetMetadataError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesAlphaGetMetadataErrorPropertiesError: DBXFilesAlphaGetMetadataError { + @objc + public var propertiesError: DBXFilePropertiesLookUpPropertiesError + + @objc + public init(_ arg: DBXFilePropertiesLookUpPropertiesError) { + self.propertiesError = arg + let swift = Files.AlphaGetMetadataError.propertiesError(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible CommitInfo struct +@objc +public class DBXFilesCommitInfo: NSObject { + /// Path in the user's Dropbox to save the file. + @objc + public var path: String { swift.path } + /// Selects what to do if the file already exists. + @objc + public var mode: DBXFilesWriteMode { DBXFilesWriteMode(swift: swift.mode) } + /// If there's a conflict, as determined by mode, have the Dropbox server try to autorename the file to avoid + /// conflict. + @objc + public var autorename: NSNumber { swift.autorename as NSNumber } + /// The value to store as the clientModified timestamp. Dropbox automatically records the time at which the file + /// was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox + /// desktop clients, mobile clients, and API apps of when the file was actually created or modified. + @objc + public var clientModified: Date? { swift.clientModified } + /// Normally, users are made aware of any file modifications in their Dropbox account via notifications in the + /// client software. If true, this tells the clients that this modification shouldn't result in a user + /// notification. + @objc + public var mute: NSNumber { swift.mute as NSNumber } + /// List of custom properties to add to file. + @objc + public var propertyGroups: [DBXFilePropertiesPropertyGroup]? { swift.propertyGroups?.map { DBXFilePropertiesPropertyGroup(swift: $0) } } + /// Be more strict about how each WriteMode detects conflict. For example, always return a conflict error when + /// mode = update in WriteMode and the given "rev" doesn't match the existing file's "rev", even if the + /// existing file has been deleted. This also forces a conflict even when the target path refers to a file + /// with identical contents. + @objc + public var strictConflict: NSNumber { swift.strictConflict as NSNumber } + + @objc + public init( + path: String, + mode: DBXFilesWriteMode, + autorename: NSNumber, + clientModified: Date?, + mute: NSNumber, + propertyGroups: [DBXFilePropertiesPropertyGroup]?, + strictConflict: NSNumber + ) { + self.swift = Files.CommitInfo( + path: path, + mode: mode.swift, + autorename: autorename.boolValue, + clientModified: clientModified, + mute: mute.boolValue, + propertyGroups: propertyGroups?.map(\.swift), + strictConflict: strictConflict.boolValue + ) + } + + let swift: Files.CommitInfo + + public init(swift: Files.CommitInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ContentSyncSetting struct +@objc +public class DBXFilesContentSyncSetting: NSObject { + /// Id of the item this setting is applied to. + @objc + public var id: String { swift.id } + /// Setting for this item. + @objc + public var syncSetting: DBXFilesSyncSetting { DBXFilesSyncSetting(swift: swift.syncSetting) } + + @objc + public init(id: String, syncSetting: DBXFilesSyncSetting) { + self.swift = Files.ContentSyncSetting(id: id, syncSetting: syncSetting.swift) + } + + let swift: Files.ContentSyncSetting + + public init(swift: Files.ContentSyncSetting) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ContentSyncSettingArg struct +@objc +public class DBXFilesContentSyncSettingArg: NSObject { + /// Id of the item this setting is applied to. + @objc + public var id: String { swift.id } + /// Setting for this item. + @objc + public var syncSetting: DBXFilesSyncSettingArg { DBXFilesSyncSettingArg(swift: swift.syncSetting) } + + @objc + public init(id: String, syncSetting: DBXFilesSyncSettingArg) { + self.swift = Files.ContentSyncSettingArg(id: id, syncSetting: syncSetting.swift) + } + + let swift: Files.ContentSyncSettingArg + + public init(swift: Files.ContentSyncSettingArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateFolderArg struct +@objc +public class DBXFilesCreateFolderArg: NSObject { + /// Path in the user's Dropbox to create. + @objc + public var path: String { swift.path } + /// If there's a conflict, have the Dropbox server try to autorename the folder to avoid the conflict. + @objc + public var autorename: NSNumber { swift.autorename as NSNumber } + + @objc + public init(path: String, autorename: NSNumber) { + self.swift = Files.CreateFolderArg(path: path, autorename: autorename.boolValue) + } + + let swift: Files.CreateFolderArg + + public init(swift: Files.CreateFolderArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateFolderBatchArg struct +@objc +public class DBXFilesCreateFolderBatchArg: NSObject { + /// List of paths to be created in the user's Dropbox. Duplicate path arguments in the batch are considered only + /// once. + @objc + public var paths: [String] { swift.paths } + /// If there's a conflict, have the Dropbox server try to autorename the folder to avoid the conflict. + @objc + public var autorename: NSNumber { swift.autorename as NSNumber } + /// Whether to force the create to happen asynchronously. + @objc + public var forceAsync: NSNumber { swift.forceAsync as NSNumber } + + @objc + public init(paths: [String], autorename: NSNumber, forceAsync: NSNumber) { + self.swift = Files.CreateFolderBatchArg(paths: paths, autorename: autorename.boolValue, forceAsync: forceAsync.boolValue) + } + + let swift: Files.CreateFolderBatchArg + + public init(swift: Files.CreateFolderBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateFolderBatchError union +@objc +public class DBXFilesCreateFolderBatchError: NSObject { + let swift: Files.CreateFolderBatchError + + public init(swift: Files.CreateFolderBatchError) { + self.swift = swift + } + + public static func factory(swift: Files.CreateFolderBatchError) -> DBXFilesCreateFolderBatchError { + switch swift { + case .tooManyFiles: + return DBXFilesCreateFolderBatchErrorTooManyFiles() + case .other: + return DBXFilesCreateFolderBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTooManyFiles: DBXFilesCreateFolderBatchErrorTooManyFiles? { + self as? DBXFilesCreateFolderBatchErrorTooManyFiles + } + + @objc + public var asOther: DBXFilesCreateFolderBatchErrorOther? { + self as? DBXFilesCreateFolderBatchErrorOther + } +} + +/// The operation would involve too many files or folders. +@objc +public class DBXFilesCreateFolderBatchErrorTooManyFiles: DBXFilesCreateFolderBatchError { + @objc + public init() { + let swift = Files.CreateFolderBatchError.tooManyFiles + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderBatchErrorOther: DBXFilesCreateFolderBatchError { + @objc + public init() { + let swift = Files.CreateFolderBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible CreateFolderBatchJobStatus union +@objc +public class DBXFilesCreateFolderBatchJobStatus: NSObject { + let swift: Files.CreateFolderBatchJobStatus + + public init(swift: Files.CreateFolderBatchJobStatus) { + self.swift = swift + } + + public static func factory(swift: Files.CreateFolderBatchJobStatus) -> DBXFilesCreateFolderBatchJobStatus { + switch swift { + case .inProgress: + return DBXFilesCreateFolderBatchJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXFilesCreateFolderBatchResult(swift: swiftArg) + return DBXFilesCreateFolderBatchJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = DBXFilesCreateFolderBatchError(swift: swiftArg) + return DBXFilesCreateFolderBatchJobStatusFailed(arg) + case .other: + return DBXFilesCreateFolderBatchJobStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXFilesCreateFolderBatchJobStatusInProgress? { + self as? DBXFilesCreateFolderBatchJobStatusInProgress + } + + @objc + public var asComplete: DBXFilesCreateFolderBatchJobStatusComplete? { + self as? DBXFilesCreateFolderBatchJobStatusComplete + } + + @objc + public var asFailed: DBXFilesCreateFolderBatchJobStatusFailed? { + self as? DBXFilesCreateFolderBatchJobStatusFailed + } + + @objc + public var asOther: DBXFilesCreateFolderBatchJobStatusOther? { + self as? DBXFilesCreateFolderBatchJobStatusOther + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXFilesCreateFolderBatchJobStatusInProgress: DBXFilesCreateFolderBatchJobStatus { + @objc + public init() { + let swift = Files.CreateFolderBatchJobStatus.inProgress + super.init(swift: swift) + } +} + +/// The batch create folder has finished. +@objc +public class DBXFilesCreateFolderBatchJobStatusComplete: DBXFilesCreateFolderBatchJobStatus { + @objc + public var complete: DBXFilesCreateFolderBatchResult + + @objc + public init(_ arg: DBXFilesCreateFolderBatchResult) { + self.complete = arg + let swift = Files.CreateFolderBatchJobStatus.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// The batch create folder has failed. +@objc +public class DBXFilesCreateFolderBatchJobStatusFailed: DBXFilesCreateFolderBatchJobStatus { + @objc + public var failed: DBXFilesCreateFolderBatchError + + @objc + public init(_ arg: DBXFilesCreateFolderBatchError) { + self.failed = arg + let swift = Files.CreateFolderBatchJobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderBatchJobStatusOther: DBXFilesCreateFolderBatchJobStatus { + @objc + public init() { + let swift = Files.CreateFolderBatchJobStatus.other + super.init(swift: swift) + } +} + +/// Result returned by createFolderBatch that may either launch an asynchronous job or complete synchronously. +@objc +public class DBXFilesCreateFolderBatchLaunch: NSObject { + let swift: Files.CreateFolderBatchLaunch + + public init(swift: Files.CreateFolderBatchLaunch) { + self.swift = swift + } + + public static func factory(swift: Files.CreateFolderBatchLaunch) -> DBXFilesCreateFolderBatchLaunch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXFilesCreateFolderBatchLaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXFilesCreateFolderBatchResult(swift: swiftArg) + return DBXFilesCreateFolderBatchLaunchComplete(arg) + case .other: + return DBXFilesCreateFolderBatchLaunchOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXFilesCreateFolderBatchLaunchAsyncJobId? { + self as? DBXFilesCreateFolderBatchLaunchAsyncJobId + } + + @objc + public var asComplete: DBXFilesCreateFolderBatchLaunchComplete? { + self as? DBXFilesCreateFolderBatchLaunchComplete + } + + @objc + public var asOther: DBXFilesCreateFolderBatchLaunchOther? { + self as? DBXFilesCreateFolderBatchLaunchOther + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXFilesCreateFolderBatchLaunchAsyncJobId: DBXFilesCreateFolderBatchLaunch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Files.CreateFolderBatchLaunch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderBatchLaunchComplete: DBXFilesCreateFolderBatchLaunch { + @objc + public var complete: DBXFilesCreateFolderBatchResult + + @objc + public init(_ arg: DBXFilesCreateFolderBatchResult) { + self.complete = arg + let swift = Files.CreateFolderBatchLaunch.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderBatchLaunchOther: DBXFilesCreateFolderBatchLaunch { + @objc + public init() { + let swift = Files.CreateFolderBatchLaunch.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FileOpsResult struct +@objc +public class DBXFilesFileOpsResult: NSObject { + let swift: Files.FileOpsResult + + public init(swift: Files.FileOpsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateFolderBatchResult struct +@objc +public class DBXFilesCreateFolderBatchResult: DBXFilesFileOpsResult { + /// Each entry in paths in CreateFolderBatchArg will appear at the same position inside entries in + /// CreateFolderBatchResult. + @objc + public var entries: [DBXFilesCreateFolderBatchResultEntry] { subSwift.entries.map { DBXFilesCreateFolderBatchResultEntry(swift: $0) } } + + @objc + public init(entries: [DBXFilesCreateFolderBatchResultEntry]) { + let swift = Files.CreateFolderBatchResult(entries: entries.map(\.swift)) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.CreateFolderBatchResult + + public init(swift: Files.CreateFolderBatchResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible CreateFolderBatchResultEntry union +@objc +public class DBXFilesCreateFolderBatchResultEntry: NSObject { + let swift: Files.CreateFolderBatchResultEntry + + public init(swift: Files.CreateFolderBatchResultEntry) { + self.swift = swift + } + + public static func factory(swift: Files.CreateFolderBatchResultEntry) -> DBXFilesCreateFolderBatchResultEntry { + switch swift { + case .success(let swiftArg): + let arg = DBXFilesCreateFolderEntryResult(swift: swiftArg) + return DBXFilesCreateFolderBatchResultEntrySuccess(arg) + case .failure(let swiftArg): + let arg = DBXFilesCreateFolderEntryError(swift: swiftArg) + return DBXFilesCreateFolderBatchResultEntryFailure(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXFilesCreateFolderBatchResultEntrySuccess? { + self as? DBXFilesCreateFolderBatchResultEntrySuccess + } + + @objc + public var asFailure: DBXFilesCreateFolderBatchResultEntryFailure? { + self as? DBXFilesCreateFolderBatchResultEntryFailure + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderBatchResultEntrySuccess: DBXFilesCreateFolderBatchResultEntry { + @objc + public var success: DBXFilesCreateFolderEntryResult + + @objc + public init(_ arg: DBXFilesCreateFolderEntryResult) { + self.success = arg + let swift = Files.CreateFolderBatchResultEntry.success(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderBatchResultEntryFailure: DBXFilesCreateFolderBatchResultEntry { + @objc + public var failure: DBXFilesCreateFolderEntryError + + @objc + public init(_ arg: DBXFilesCreateFolderEntryError) { + self.failure = arg + let swift = Files.CreateFolderBatchResultEntry.failure(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible CreateFolderEntryError union +@objc +public class DBXFilesCreateFolderEntryError: NSObject { + let swift: Files.CreateFolderEntryError + + public init(swift: Files.CreateFolderEntryError) { + self.swift = swift + } + + public static func factory(swift: Files.CreateFolderEntryError) -> DBXFilesCreateFolderEntryError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesCreateFolderEntryErrorPath(arg) + case .other: + return DBXFilesCreateFolderEntryErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesCreateFolderEntryErrorPath? { + self as? DBXFilesCreateFolderEntryErrorPath + } + + @objc + public var asOther: DBXFilesCreateFolderEntryErrorOther? { + self as? DBXFilesCreateFolderEntryErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderEntryErrorPath: DBXFilesCreateFolderEntryError { + @objc + public var path: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.path = arg + let swift = Files.CreateFolderEntryError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderEntryErrorOther: DBXFilesCreateFolderEntryError { + @objc + public init() { + let swift = Files.CreateFolderEntryError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible CreateFolderEntryResult struct +@objc +public class DBXFilesCreateFolderEntryResult: NSObject { + /// Metadata of the created folder. + @objc + public var metadata: DBXFilesFolderMetadata { DBXFilesFolderMetadata(swift: swift.metadata) } + + @objc + public init(metadata: DBXFilesFolderMetadata) { + self.swift = Files.CreateFolderEntryResult(metadata: metadata.subSwift) + } + + let swift: Files.CreateFolderEntryResult + + public init(swift: Files.CreateFolderEntryResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateFolderError union +@objc +public class DBXFilesCreateFolderError: NSObject { + let swift: Files.CreateFolderError + + public init(swift: Files.CreateFolderError) { + self.swift = swift + } + + public static func factory(swift: Files.CreateFolderError) -> DBXFilesCreateFolderError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesCreateFolderErrorPath(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesCreateFolderErrorPath? { + self as? DBXFilesCreateFolderErrorPath + } +} + +/// An unspecified error. +@objc +public class DBXFilesCreateFolderErrorPath: DBXFilesCreateFolderError { + @objc + public var path: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.path = arg + let swift = Files.CreateFolderError.path(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible CreateFolderResult struct +@objc +public class DBXFilesCreateFolderResult: DBXFilesFileOpsResult { + /// Metadata of the created folder. + @objc + public var metadata: DBXFilesFolderMetadata { DBXFilesFolderMetadata(swift: subSwift.metadata) } + + @objc + public init(metadata: DBXFilesFolderMetadata) { + let swift = Files.CreateFolderResult(metadata: metadata.subSwift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.CreateFolderResult + + public init(swift: Files.CreateFolderResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible DeleteArg struct +@objc +public class DBXFilesDeleteArg: NSObject { + /// Path in the user's Dropbox to delete. + @objc + public var path: String { swift.path } + /// Perform delete if given "rev" matches the existing file's latest "rev". This field does not support deleting + /// a folder. + @objc + public var parentRev: String? { swift.parentRev } + + @objc + public init(path: String, parentRev: String?) { + self.swift = Files.DeleteArg(path: path, parentRev: parentRev) + } + + let swift: Files.DeleteArg + + public init(swift: Files.DeleteArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeleteBatchArg struct +@objc +public class DBXFilesDeleteBatchArg: NSObject { + /// (no description) + @objc + public var entries: [DBXFilesDeleteArg] { swift.entries.map { DBXFilesDeleteArg(swift: $0) } } + + @objc + public init(entries: [DBXFilesDeleteArg]) { + self.swift = Files.DeleteBatchArg(entries: entries.map(\.swift)) + } + + let swift: Files.DeleteBatchArg + + public init(swift: Files.DeleteBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeleteBatchError union +@objc +public class DBXFilesDeleteBatchError: NSObject { + let swift: Files.DeleteBatchError + + public init(swift: Files.DeleteBatchError) { + self.swift = swift + } + + public static func factory(swift: Files.DeleteBatchError) -> DBXFilesDeleteBatchError { + switch swift { + case .tooManyWriteOperations: + return DBXFilesDeleteBatchErrorTooManyWriteOperations() + case .other: + return DBXFilesDeleteBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTooManyWriteOperations: DBXFilesDeleteBatchErrorTooManyWriteOperations? { + self as? DBXFilesDeleteBatchErrorTooManyWriteOperations + } + + @objc + public var asOther: DBXFilesDeleteBatchErrorOther? { + self as? DBXFilesDeleteBatchErrorOther + } +} + +/// Use tooManyWriteOperations in DeleteError. deleteBatch now provides smaller granularity about which entry +/// has failed because of this. +@objc +public class DBXFilesDeleteBatchErrorTooManyWriteOperations: DBXFilesDeleteBatchError { + @objc + public init() { + let swift = Files.DeleteBatchError.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteBatchErrorOther: DBXFilesDeleteBatchError { + @objc + public init() { + let swift = Files.DeleteBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DeleteBatchJobStatus union +@objc +public class DBXFilesDeleteBatchJobStatus: NSObject { + let swift: Files.DeleteBatchJobStatus + + public init(swift: Files.DeleteBatchJobStatus) { + self.swift = swift + } + + public static func factory(swift: Files.DeleteBatchJobStatus) -> DBXFilesDeleteBatchJobStatus { + switch swift { + case .inProgress: + return DBXFilesDeleteBatchJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXFilesDeleteBatchResult(swift: swiftArg) + return DBXFilesDeleteBatchJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = DBXFilesDeleteBatchError(swift: swiftArg) + return DBXFilesDeleteBatchJobStatusFailed(arg) + case .other: + return DBXFilesDeleteBatchJobStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXFilesDeleteBatchJobStatusInProgress? { + self as? DBXFilesDeleteBatchJobStatusInProgress + } + + @objc + public var asComplete: DBXFilesDeleteBatchJobStatusComplete? { + self as? DBXFilesDeleteBatchJobStatusComplete + } + + @objc + public var asFailed: DBXFilesDeleteBatchJobStatusFailed? { + self as? DBXFilesDeleteBatchJobStatusFailed + } + + @objc + public var asOther: DBXFilesDeleteBatchJobStatusOther? { + self as? DBXFilesDeleteBatchJobStatusOther + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXFilesDeleteBatchJobStatusInProgress: DBXFilesDeleteBatchJobStatus { + @objc + public init() { + let swift = Files.DeleteBatchJobStatus.inProgress + super.init(swift: swift) + } +} + +/// The batch delete has finished. +@objc +public class DBXFilesDeleteBatchJobStatusComplete: DBXFilesDeleteBatchJobStatus { + @objc + public var complete: DBXFilesDeleteBatchResult + + @objc + public init(_ arg: DBXFilesDeleteBatchResult) { + self.complete = arg + let swift = Files.DeleteBatchJobStatus.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// The batch delete has failed. +@objc +public class DBXFilesDeleteBatchJobStatusFailed: DBXFilesDeleteBatchJobStatus { + @objc + public var failed: DBXFilesDeleteBatchError + + @objc + public init(_ arg: DBXFilesDeleteBatchError) { + self.failed = arg + let swift = Files.DeleteBatchJobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteBatchJobStatusOther: DBXFilesDeleteBatchJobStatus { + @objc + public init() { + let swift = Files.DeleteBatchJobStatus.other + super.init(swift: swift) + } +} + +/// Result returned by deleteBatch that may either launch an asynchronous job or complete synchronously. +@objc +public class DBXFilesDeleteBatchLaunch: NSObject { + let swift: Files.DeleteBatchLaunch + + public init(swift: Files.DeleteBatchLaunch) { + self.swift = swift + } + + public static func factory(swift: Files.DeleteBatchLaunch) -> DBXFilesDeleteBatchLaunch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXFilesDeleteBatchLaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXFilesDeleteBatchResult(swift: swiftArg) + return DBXFilesDeleteBatchLaunchComplete(arg) + case .other: + return DBXFilesDeleteBatchLaunchOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXFilesDeleteBatchLaunchAsyncJobId? { + self as? DBXFilesDeleteBatchLaunchAsyncJobId + } + + @objc + public var asComplete: DBXFilesDeleteBatchLaunchComplete? { + self as? DBXFilesDeleteBatchLaunchComplete + } + + @objc + public var asOther: DBXFilesDeleteBatchLaunchOther? { + self as? DBXFilesDeleteBatchLaunchOther + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXFilesDeleteBatchLaunchAsyncJobId: DBXFilesDeleteBatchLaunch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Files.DeleteBatchLaunch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteBatchLaunchComplete: DBXFilesDeleteBatchLaunch { + @objc + public var complete: DBXFilesDeleteBatchResult + + @objc + public init(_ arg: DBXFilesDeleteBatchResult) { + self.complete = arg + let swift = Files.DeleteBatchLaunch.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteBatchLaunchOther: DBXFilesDeleteBatchLaunch { + @objc + public init() { + let swift = Files.DeleteBatchLaunch.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DeleteBatchResult struct +@objc +public class DBXFilesDeleteBatchResult: DBXFilesFileOpsResult { + /// Each entry in entries in DeleteBatchArg will appear at the same position inside entries in + /// DeleteBatchResult. + @objc + public var entries: [DBXFilesDeleteBatchResultEntry] { subSwift.entries.map { DBXFilesDeleteBatchResultEntry(swift: $0) } } + + @objc + public init(entries: [DBXFilesDeleteBatchResultEntry]) { + let swift = Files.DeleteBatchResult(entries: entries.map(\.swift)) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.DeleteBatchResult + + public init(swift: Files.DeleteBatchResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible DeleteBatchResultData struct +@objc +public class DBXFilesDeleteBatchResultData: NSObject { + /// Metadata of the deleted object. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) } + + @objc + public init(metadata: DBXFilesMetadata) { + self.swift = Files.DeleteBatchResultData(metadata: metadata.swift) + } + + let swift: Files.DeleteBatchResultData + + public init(swift: Files.DeleteBatchResultData) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeleteBatchResultEntry union +@objc +public class DBXFilesDeleteBatchResultEntry: NSObject { + let swift: Files.DeleteBatchResultEntry + + public init(swift: Files.DeleteBatchResultEntry) { + self.swift = swift + } + + public static func factory(swift: Files.DeleteBatchResultEntry) -> DBXFilesDeleteBatchResultEntry { + switch swift { + case .success(let swiftArg): + let arg = DBXFilesDeleteBatchResultData(swift: swiftArg) + return DBXFilesDeleteBatchResultEntrySuccess(arg) + case .failure(let swiftArg): + let arg = DBXFilesDeleteError(swift: swiftArg) + return DBXFilesDeleteBatchResultEntryFailure(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXFilesDeleteBatchResultEntrySuccess? { + self as? DBXFilesDeleteBatchResultEntrySuccess + } + + @objc + public var asFailure: DBXFilesDeleteBatchResultEntryFailure? { + self as? DBXFilesDeleteBatchResultEntryFailure + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteBatchResultEntrySuccess: DBXFilesDeleteBatchResultEntry { + @objc + public var success: DBXFilesDeleteBatchResultData + + @objc + public init(_ arg: DBXFilesDeleteBatchResultData) { + self.success = arg + let swift = Files.DeleteBatchResultEntry.success(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteBatchResultEntryFailure: DBXFilesDeleteBatchResultEntry { + @objc + public var failure: DBXFilesDeleteError + + @objc + public init(_ arg: DBXFilesDeleteError) { + self.failure = arg + let swift = Files.DeleteBatchResultEntry.failure(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible DeleteError union +@objc +public class DBXFilesDeleteError: NSObject { + let swift: Files.DeleteError + + public init(swift: Files.DeleteError) { + self.swift = swift + } + + public static func factory(swift: Files.DeleteError) -> DBXFilesDeleteError { + switch swift { + case .pathLookup(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesDeleteErrorPathLookup(arg) + case .pathWrite(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesDeleteErrorPathWrite(arg) + case .tooManyWriteOperations: + return DBXFilesDeleteErrorTooManyWriteOperations() + case .tooManyFiles: + return DBXFilesDeleteErrorTooManyFiles() + case .other: + return DBXFilesDeleteErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPathLookup: DBXFilesDeleteErrorPathLookup? { + self as? DBXFilesDeleteErrorPathLookup + } + + @objc + public var asPathWrite: DBXFilesDeleteErrorPathWrite? { + self as? DBXFilesDeleteErrorPathWrite + } + + @objc + public var asTooManyWriteOperations: DBXFilesDeleteErrorTooManyWriteOperations? { + self as? DBXFilesDeleteErrorTooManyWriteOperations + } + + @objc + public var asTooManyFiles: DBXFilesDeleteErrorTooManyFiles? { + self as? DBXFilesDeleteErrorTooManyFiles + } + + @objc + public var asOther: DBXFilesDeleteErrorOther? { + self as? DBXFilesDeleteErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteErrorPathLookup: DBXFilesDeleteError { + @objc + public var pathLookup: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.pathLookup = arg + let swift = Files.DeleteError.pathLookup(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteErrorPathWrite: DBXFilesDeleteError { + @objc + public var pathWrite: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.pathWrite = arg + let swift = Files.DeleteError.pathWrite(arg.swift) + super.init(swift: swift) + } +} + +/// There are too many write operations in user's Dropbox. Please retry this request. +@objc +public class DBXFilesDeleteErrorTooManyWriteOperations: DBXFilesDeleteError { + @objc + public init() { + let swift = Files.DeleteError.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// There are too many files in one request. Please retry with fewer files. +@objc +public class DBXFilesDeleteErrorTooManyFiles: DBXFilesDeleteError { + @objc + public init() { + let swift = Files.DeleteError.tooManyFiles + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDeleteErrorOther: DBXFilesDeleteError { + @objc + public init() { + let swift = Files.DeleteError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DeleteResult struct +@objc +public class DBXFilesDeleteResult: DBXFilesFileOpsResult { + /// Metadata of the deleted object. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: subSwift.metadata) } + + @objc + public init(metadata: DBXFilesMetadata) { + let swift = Files.DeleteResult(metadata: metadata.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.DeleteResult + + public init(swift: Files.DeleteResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Metadata for a file or folder. +@objc +public class DBXFilesMetadata: NSObject { + /// The last component of the path (including extension). This never contains a slash. + @objc + public var name: String { swift.name } + /// The lowercased full path in the user's Dropbox. This always starts with a slash. This field will be null if + /// the file or folder is not mounted. + @objc + public var pathLower: String? { swift.pathLower } + /// The cased path to be used for display purposes only. In rare instances the casing will not correctly match + /// the user's filesystem, but this behavior will match the path provided in the Core API v1, and at least + /// the last path component will have the correct casing. Changes to only the casing of paths won't be + /// returned by listFolderContinue. This field will be null if the file or folder is not mounted. + @objc + public var pathDisplay: String? { swift.pathDisplay } + /// Please use parentSharedFolderId in FileSharingInfo or parentSharedFolderId in FolderSharingInfo instead. + @objc + public var parentSharedFolderId: String? { swift.parentSharedFolderId } + /// The preview URL of the file. + @objc + public var previewUrl: String? { swift.previewUrl } + + @objc + public init(name: String, pathLower: String?, pathDisplay: String?, parentSharedFolderId: String?, previewUrl: String?) { + self.swift = Files.Metadata( + name: name, + pathLower: pathLower, + pathDisplay: pathDisplay, + parentSharedFolderId: parentSharedFolderId, + previewUrl: previewUrl + ) + } + + let swift: Files.Metadata + + public init(swift: Files.Metadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Indicates that there used to be a file or folder at this path, but it no longer exists. +@objc +public class DBXFilesDeletedMetadata: DBXFilesMetadata { + let subSwift: Files.DeletedMetadata + + public init(swift: Files.DeletedMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Dimensions for a photo or video. +@objc +public class DBXFilesDimensions: NSObject { + /// Height of the photo/video. + @objc + public var height: NSNumber { swift.height as NSNumber } + /// Width of the photo/video. + @objc + public var width: NSNumber { swift.width as NSNumber } + + @objc + public init(height: NSNumber, width: NSNumber) { + self.swift = Files.Dimensions(height: height.uint64Value, width: width.uint64Value) + } + + let swift: Files.Dimensions + + public init(swift: Files.Dimensions) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DownloadArg struct +@objc +public class DBXFilesDownloadArg: NSObject { + /// The path of the file to download. + @objc + public var path: String { swift.path } + /// Please specify revision in path instead. + @objc + public var rev: String? { swift.rev } + + @objc + public init(path: String, rev: String?) { + self.swift = Files.DownloadArg(path: path, rev: rev) + } + + let swift: Files.DownloadArg + + public init(swift: Files.DownloadArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DownloadError union +@objc +public class DBXFilesDownloadError: NSObject { + let swift: Files.DownloadError + + public init(swift: Files.DownloadError) { + self.swift = swift + } + + public static func factory(swift: Files.DownloadError) -> DBXFilesDownloadError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesDownloadErrorPath(arg) + case .unsupportedFile: + return DBXFilesDownloadErrorUnsupportedFile() + case .other: + return DBXFilesDownloadErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesDownloadErrorPath? { + self as? DBXFilesDownloadErrorPath + } + + @objc + public var asUnsupportedFile: DBXFilesDownloadErrorUnsupportedFile? { + self as? DBXFilesDownloadErrorUnsupportedFile + } + + @objc + public var asOther: DBXFilesDownloadErrorOther? { + self as? DBXFilesDownloadErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesDownloadErrorPath: DBXFilesDownloadError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.DownloadError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This file type cannot be downloaded directly; use export instead. +@objc +public class DBXFilesDownloadErrorUnsupportedFile: DBXFilesDownloadError { + @objc + public init() { + let swift = Files.DownloadError.unsupportedFile + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDownloadErrorOther: DBXFilesDownloadError { + @objc + public init() { + let swift = Files.DownloadError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DownloadZipArg struct +@objc +public class DBXFilesDownloadZipArg: NSObject { + /// The path of the folder to download. + @objc + public var path: String { swift.path } + + @objc + public init(path: String) { + self.swift = Files.DownloadZipArg(path: path) + } + + let swift: Files.DownloadZipArg + + public init(swift: Files.DownloadZipArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DownloadZipError union +@objc +public class DBXFilesDownloadZipError: NSObject { + let swift: Files.DownloadZipError + + public init(swift: Files.DownloadZipError) { + self.swift = swift + } + + public static func factory(swift: Files.DownloadZipError) -> DBXFilesDownloadZipError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesDownloadZipErrorPath(arg) + case .tooLarge: + return DBXFilesDownloadZipErrorTooLarge() + case .tooManyFiles: + return DBXFilesDownloadZipErrorTooManyFiles() + case .other: + return DBXFilesDownloadZipErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesDownloadZipErrorPath? { + self as? DBXFilesDownloadZipErrorPath + } + + @objc + public var asTooLarge: DBXFilesDownloadZipErrorTooLarge? { + self as? DBXFilesDownloadZipErrorTooLarge + } + + @objc + public var asTooManyFiles: DBXFilesDownloadZipErrorTooManyFiles? { + self as? DBXFilesDownloadZipErrorTooManyFiles + } + + @objc + public var asOther: DBXFilesDownloadZipErrorOther? { + self as? DBXFilesDownloadZipErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesDownloadZipErrorPath: DBXFilesDownloadZipError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.DownloadZipError.path(arg.swift) + super.init(swift: swift) + } +} + +/// The folder or a file is too large to download. +@objc +public class DBXFilesDownloadZipErrorTooLarge: DBXFilesDownloadZipError { + @objc + public init() { + let swift = Files.DownloadZipError.tooLarge + super.init(swift: swift) + } +} + +/// The folder has too many files to download. +@objc +public class DBXFilesDownloadZipErrorTooManyFiles: DBXFilesDownloadZipError { + @objc + public init() { + let swift = Files.DownloadZipError.tooManyFiles + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesDownloadZipErrorOther: DBXFilesDownloadZipError { + @objc + public init() { + let swift = Files.DownloadZipError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DownloadZipResult struct +@objc +public class DBXFilesDownloadZipResult: NSObject { + /// (no description) + @objc + public var metadata: DBXFilesFolderMetadata { DBXFilesFolderMetadata(swift: swift.metadata) } + + @objc + public init(metadata: DBXFilesFolderMetadata) { + self.swift = Files.DownloadZipResult(metadata: metadata.subSwift) + } + + let swift: Files.DownloadZipResult + + public init(swift: Files.DownloadZipResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExportArg struct +@objc +public class DBXFilesExportArg: NSObject { + /// The path of the file to be exported. + @objc + public var path: String { swift.path } + /// The file format to which the file should be exported. This must be one of the formats listed in the file's + /// export_options returned by getMetadata. If none is specified, the default format (specified in export_as + /// in file metadata) will be used. + @objc + public var exportFormat: String? { swift.exportFormat } + + @objc + public init(path: String, exportFormat: String?) { + self.swift = Files.ExportArg(path: path, exportFormat: exportFormat) + } + + let swift: Files.ExportArg + + public init(swift: Files.ExportArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExportError union +@objc +public class DBXFilesExportError: NSObject { + let swift: Files.ExportError + + public init(swift: Files.ExportError) { + self.swift = swift + } + + public static func factory(swift: Files.ExportError) -> DBXFilesExportError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesExportErrorPath(arg) + case .nonExportable: + return DBXFilesExportErrorNonExportable() + case .invalidExportFormat: + return DBXFilesExportErrorInvalidExportFormat() + case .retryError: + return DBXFilesExportErrorRetryError() + case .other: + return DBXFilesExportErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesExportErrorPath? { + self as? DBXFilesExportErrorPath + } + + @objc + public var asNonExportable: DBXFilesExportErrorNonExportable? { + self as? DBXFilesExportErrorNonExportable + } + + @objc + public var asInvalidExportFormat: DBXFilesExportErrorInvalidExportFormat? { + self as? DBXFilesExportErrorInvalidExportFormat + } + + @objc + public var asRetryError: DBXFilesExportErrorRetryError? { + self as? DBXFilesExportErrorRetryError + } + + @objc + public var asOther: DBXFilesExportErrorOther? { + self as? DBXFilesExportErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesExportErrorPath: DBXFilesExportError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.ExportError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This file type cannot be exported. Use download instead. +@objc +public class DBXFilesExportErrorNonExportable: DBXFilesExportError { + @objc + public init() { + let swift = Files.ExportError.nonExportable + super.init(swift: swift) + } +} + +/// The specified export format is not a valid option for this file type. +@objc +public class DBXFilesExportErrorInvalidExportFormat: DBXFilesExportError { + @objc + public init() { + let swift = Files.ExportError.invalidExportFormat + super.init(swift: swift) + } +} + +/// The exportable content is not yet available. Please retry later. +@objc +public class DBXFilesExportErrorRetryError: DBXFilesExportError { + @objc + public init() { + let swift = Files.ExportError.retryError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesExportErrorOther: DBXFilesExportError { + @objc + public init() { + let swift = Files.ExportError.other + super.init(swift: swift) + } +} + +/// Export information for a file. +@objc +public class DBXFilesExportInfo: NSObject { + /// Format to which the file can be exported to. + @objc + public var exportAs: String? { swift.exportAs } + /// Additional formats to which the file can be exported. These values can be specified as the export_format in + /// /files/export. + @objc + public var exportOptions: [String]? { swift.exportOptions } + + @objc + public init(exportAs: String?, exportOptions: [String]?) { + self.swift = Files.ExportInfo(exportAs: exportAs, exportOptions: exportOptions) + } + + let swift: Files.ExportInfo + + public init(swift: Files.ExportInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExportMetadata struct +@objc +public class DBXFilesExportMetadata: NSObject { + /// The last component of the path (including extension). This never contains a slash. + @objc + public var name: String { swift.name } + /// The file size in bytes. + @objc + public var size: NSNumber { swift.size as NSNumber } + /// A hash based on the exported file content. This field can be used to verify data integrity. Similar to + /// content hash. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + @objc + public var exportHash: String? { swift.exportHash } + /// If the file is a Paper doc, this gives the latest doc revision which can be used in paperUpdate. + @objc + public var paperRevision: NSNumber? { swift.paperRevision as NSNumber? } + + @objc + public init(name: String, size: NSNumber, exportHash: String?, paperRevision: NSNumber?) { + self.swift = Files.ExportMetadata(name: name, size: size.uint64Value, exportHash: exportHash, paperRevision: paperRevision?.int64Value) + } + + let swift: Files.ExportMetadata + + public init(swift: Files.ExportMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExportResult struct +@objc +public class DBXFilesExportResult: NSObject { + /// Metadata for the exported version of the file. + @objc + public var exportMetadata: DBXFilesExportMetadata { DBXFilesExportMetadata(swift: swift.exportMetadata) } + /// Metadata for the original file. + @objc + public var fileMetadata: DBXFilesFileMetadata { DBXFilesFileMetadata(swift: swift.fileMetadata) } + + @objc + public init(exportMetadata: DBXFilesExportMetadata, fileMetadata: DBXFilesFileMetadata) { + self.swift = Files.ExportResult(exportMetadata: exportMetadata.swift, fileMetadata: fileMetadata.subSwift) + } + + let swift: Files.ExportResult + + public init(swift: Files.ExportResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileCategory union +@objc +public class DBXFilesFileCategory: NSObject { + let swift: Files.FileCategory + + public init(swift: Files.FileCategory) { + self.swift = swift + } + + public static func factory(swift: Files.FileCategory) -> DBXFilesFileCategory { + switch swift { + case .image: + return DBXFilesFileCategoryImage() + case .document: + return DBXFilesFileCategoryDocument() + case .pdf: + return DBXFilesFileCategoryPdf() + case .spreadsheet: + return DBXFilesFileCategorySpreadsheet() + case .presentation: + return DBXFilesFileCategoryPresentation() + case .audio: + return DBXFilesFileCategoryAudio() + case .video: + return DBXFilesFileCategoryVideo() + case .folder: + return DBXFilesFileCategoryFolder() + case .paper: + return DBXFilesFileCategoryPaper() + case .others: + return DBXFilesFileCategoryOthers() + case .other: + return DBXFilesFileCategoryOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asImage: DBXFilesFileCategoryImage? { + self as? DBXFilesFileCategoryImage + } + + @objc + public var asDocument: DBXFilesFileCategoryDocument? { + self as? DBXFilesFileCategoryDocument + } + + @objc + public var asPdf: DBXFilesFileCategoryPdf? { + self as? DBXFilesFileCategoryPdf + } + + @objc + public var asSpreadsheet: DBXFilesFileCategorySpreadsheet? { + self as? DBXFilesFileCategorySpreadsheet + } + + @objc + public var asPresentation: DBXFilesFileCategoryPresentation? { + self as? DBXFilesFileCategoryPresentation + } + + @objc + public var asAudio: DBXFilesFileCategoryAudio? { + self as? DBXFilesFileCategoryAudio + } + + @objc + public var asVideo: DBXFilesFileCategoryVideo? { + self as? DBXFilesFileCategoryVideo + } + + @objc + public var asFolder: DBXFilesFileCategoryFolder? { + self as? DBXFilesFileCategoryFolder + } + + @objc + public var asPaper: DBXFilesFileCategoryPaper? { + self as? DBXFilesFileCategoryPaper + } + + @objc + public var asOthers: DBXFilesFileCategoryOthers? { + self as? DBXFilesFileCategoryOthers + } + + @objc + public var asOther: DBXFilesFileCategoryOther? { + self as? DBXFilesFileCategoryOther + } +} + +/// jpg, png, gif, and more. +@objc +public class DBXFilesFileCategoryImage: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.image + super.init(swift: swift) + } +} + +/// doc, docx, txt, and more. +@objc +public class DBXFilesFileCategoryDocument: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.document + super.init(swift: swift) + } +} + +/// pdf. +@objc +public class DBXFilesFileCategoryPdf: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.pdf + super.init(swift: swift) + } +} + +/// xlsx, xls, csv, and more. +@objc +public class DBXFilesFileCategorySpreadsheet: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.spreadsheet + super.init(swift: swift) + } +} + +/// ppt, pptx, key, and more. +@objc +public class DBXFilesFileCategoryPresentation: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.presentation + super.init(swift: swift) + } +} + +/// mp3, wav, mid, and more. +@objc +public class DBXFilesFileCategoryAudio: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.audio + super.init(swift: swift) + } +} + +/// mov, wmv, mp4, and more. +@objc +public class DBXFilesFileCategoryVideo: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.video + super.init(swift: swift) + } +} + +/// dropbox folder. +@objc +public class DBXFilesFileCategoryFolder: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.folder + super.init(swift: swift) + } +} + +/// dropbox paper doc. +@objc +public class DBXFilesFileCategoryPaper: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.paper + super.init(swift: swift) + } +} + +/// any file not in one of the categories above. +@objc +public class DBXFilesFileCategoryOthers: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.others + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesFileCategoryOther: DBXFilesFileCategory { + @objc + public init() { + let swift = Files.FileCategory.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FileLock struct +@objc +public class DBXFilesFileLock: NSObject { + /// The lock description. + @objc + public var content: DBXFilesFileLockContent { DBXFilesFileLockContent(swift: swift.content) } + + @objc + public init(content: DBXFilesFileLockContent) { + self.swift = Files.FileLock(content: content.swift) + } + + let swift: Files.FileLock + + public init(swift: Files.FileLock) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileLockContent union +@objc +public class DBXFilesFileLockContent: NSObject { + let swift: Files.FileLockContent + + public init(swift: Files.FileLockContent) { + self.swift = swift + } + + public static func factory(swift: Files.FileLockContent) -> DBXFilesFileLockContent { + switch swift { + case .unlocked: + return DBXFilesFileLockContentUnlocked() + case .singleUser(let swiftArg): + let arg = DBXFilesSingleUserLock(swift: swiftArg) + return DBXFilesFileLockContentSingleUser(arg) + case .other: + return DBXFilesFileLockContentOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnlocked: DBXFilesFileLockContentUnlocked? { + self as? DBXFilesFileLockContentUnlocked + } + + @objc + public var asSingleUser: DBXFilesFileLockContentSingleUser? { + self as? DBXFilesFileLockContentSingleUser + } + + @objc + public var asOther: DBXFilesFileLockContentOther? { + self as? DBXFilesFileLockContentOther + } +} + +/// Empty type to indicate no lock. +@objc +public class DBXFilesFileLockContentUnlocked: DBXFilesFileLockContent { + @objc + public init() { + let swift = Files.FileLockContent.unlocked + super.init(swift: swift) + } +} + +/// A lock held by a single user. +@objc +public class DBXFilesFileLockContentSingleUser: DBXFilesFileLockContent { + @objc + public var singleUser: DBXFilesSingleUserLock + + @objc + public init(_ arg: DBXFilesSingleUserLock) { + self.singleUser = arg + let swift = Files.FileLockContent.singleUser(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesFileLockContentOther: DBXFilesFileLockContent { + @objc + public init() { + let swift = Files.FileLockContent.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FileLockMetadata struct +@objc +public class DBXFilesFileLockMetadata: NSObject { + /// True if caller holds the file lock. + @objc + public var isLockholder: NSNumber? { swift.isLockholder as NSNumber? } + /// The display name of the lock holder. + @objc + public var lockholderName: String? { swift.lockholderName } + /// The account ID of the lock holder if known. + @objc + public var lockholderAccountId: String? { swift.lockholderAccountId } + /// The timestamp of the lock was created. + @objc + public var created: Date? { swift.created } + + @objc + public init(isLockholder: NSNumber?, lockholderName: String?, lockholderAccountId: String?, created: Date?) { + self.swift = Files.FileLockMetadata( + isLockholder: isLockholder?.boolValue, + lockholderName: lockholderName, + lockholderAccountId: lockholderAccountId, + created: created + ) + } + + let swift: Files.FileLockMetadata + + public init(swift: Files.FileLockMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileMetadata struct +@objc +public class DBXFilesFileMetadata: DBXFilesMetadata { + /// A unique identifier for the file. + @objc + public var id: String { subSwift.id } + /// For files, this is the modification time set by the desktop client when the file was added to Dropbox. Since + /// this time is not verified (the Dropbox server stores whatever the desktop client sends up), this should + /// only be used for display purposes (such as sorting) and not, for example, to determine if a file has + /// changed or not. + @objc + public var clientModified: Date { subSwift.clientModified } + /// The last time the file was modified on Dropbox. + @objc + public var serverModified: Date { subSwift.serverModified } + /// A unique identifier for the current revision of a file. This field is the same rev as elsewhere in the API + /// and can be used to detect changes and avoid conflicts. + @objc + public var rev: String { subSwift.rev } + /// The file size in bytes. + @objc + public var size: NSNumber { subSwift.size as NSNumber } + /// Additional information if the file is a photo or video. This field will not be set on entries returned by + /// listFolder, listFolderContinue, or getThumbnailBatch, starting December 2, 2019. + @objc + public var mediaInfo: DBXFilesMediaInfo? { guard let swift = subSwift.mediaInfo else { return nil } + return DBXFilesMediaInfo(swift: swift) + } + + /// Set if this file is a symlink. + @objc + public var symlinkInfo: DBXFilesSymlinkInfo? { guard let swift = subSwift.symlinkInfo else { return nil } + return DBXFilesSymlinkInfo(swift: swift) + } + + /// Set if this file is contained in a shared folder. + @objc + public var sharingInfo: DBXFilesFileSharingInfo? { guard let swift = subSwift.sharingInfo else { return nil } + return DBXFilesFileSharingInfo(swift: swift) + } + + /// If true, file can be downloaded directly; else the file must be exported. + @objc + public var isDownloadable: NSNumber { subSwift.isDownloadable as NSNumber } + /// Information about format this file can be exported to. This filed must be set if isDownloadable is set to + /// false. + @objc + public var exportInfo: DBXFilesExportInfo? { guard let swift = subSwift.exportInfo else { return nil } + return DBXFilesExportInfo(swift: swift) + } + + /// Additional information if the file has custom properties with the property template specified. + @objc + public var propertyGroups: [DBXFilePropertiesPropertyGroup]? { subSwift.propertyGroups?.map { DBXFilePropertiesPropertyGroup(swift: $0) } } + /// This flag will only be present if include_has_explicit_shared_members is true in listFolder or getMetadata. + /// If this flag is present, it will be true if this file has any explicit shared members. This is + /// different from sharing_info in that this could be true in the case where a file has explicit members + /// but is not contained within a shared folder. + @objc + public var hasExplicitSharedMembers: NSNumber? { subSwift.hasExplicitSharedMembers as NSNumber? } + /// A hash of the file content. This field can be used to verify data integrity. For more information see our + /// Content hash https://www.dropbox.com/developers/reference/content-hash page. + @objc + public var contentHash: String? { subSwift.contentHash } + /// If present, the metadata associated with the file's current lock. + @objc + public var fileLockInfo: DBXFilesFileLockMetadata? { guard let swift = subSwift.fileLockInfo else { return nil } + return DBXFilesFileLockMetadata(swift: swift) + } + + @objc + public init( + name: String, + id: String, + clientModified: Date, + serverModified: Date, + rev: String, + size: NSNumber, + pathLower: String?, + pathDisplay: String?, + parentSharedFolderId: String?, + previewUrl: String?, + mediaInfo: DBXFilesMediaInfo?, + symlinkInfo: DBXFilesSymlinkInfo?, + sharingInfo: DBXFilesFileSharingInfo?, + isDownloadable: NSNumber, + exportInfo: DBXFilesExportInfo?, + propertyGroups: [DBXFilePropertiesPropertyGroup]?, + hasExplicitSharedMembers: NSNumber?, + contentHash: String?, + fileLockInfo: DBXFilesFileLockMetadata? + ) { + let swift = Files.FileMetadata( + name: name, + id: id, + clientModified: clientModified, + serverModified: serverModified, + rev: rev, + size: size.uint64Value, + pathLower: pathLower, + pathDisplay: pathDisplay, + parentSharedFolderId: parentSharedFolderId, + previewUrl: previewUrl, + mediaInfo: mediaInfo?.swift, + symlinkInfo: symlinkInfo?.swift, + sharingInfo: sharingInfo?.subSwift, + isDownloadable: isDownloadable.boolValue, + exportInfo: exportInfo?.swift, + propertyGroups: propertyGroups?.map(\.swift), + hasExplicitSharedMembers: hasExplicitSharedMembers?.boolValue, + contentHash: contentHash, + fileLockInfo: fileLockInfo?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.FileMetadata + + public init(swift: Files.FileMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Sharing info for a file or folder. +@objc +public class DBXFilesSharingInfo: NSObject { + /// True if the file or folder is inside a read-only shared folder. + @objc + public var readOnly: NSNumber { swift.readOnly as NSNumber } + + @objc + public init(readOnly: NSNumber) { + self.swift = Files.SharingInfo(readOnly: readOnly.boolValue) + } + + let swift: Files.SharingInfo + + public init(swift: Files.SharingInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Sharing info for a file which is contained by a shared folder. +@objc +public class DBXFilesFileSharingInfo: DBXFilesSharingInfo { + /// ID of shared folder that holds this file. + @objc + public var parentSharedFolderId: String { subSwift.parentSharedFolderId } + /// The last user who modified the file. This field will be null if the user's account has been deleted. + @objc + public var modifiedBy: String? { subSwift.modifiedBy } + + @objc + public init(readOnly: NSNumber, parentSharedFolderId: String, modifiedBy: String?) { + let swift = Files.FileSharingInfo(readOnly: readOnly.boolValue, parentSharedFolderId: parentSharedFolderId, modifiedBy: modifiedBy) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.FileSharingInfo + + public init(swift: Files.FileSharingInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible FileStatus union +@objc +public class DBXFilesFileStatus: NSObject { + let swift: Files.FileStatus + + public init(swift: Files.FileStatus) { + self.swift = swift + } + + public static func factory(swift: Files.FileStatus) -> DBXFilesFileStatus { + switch swift { + case .active: + return DBXFilesFileStatusActive() + case .deleted: + return DBXFilesFileStatusDeleted() + case .other: + return DBXFilesFileStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXFilesFileStatusActive? { + self as? DBXFilesFileStatusActive + } + + @objc + public var asDeleted: DBXFilesFileStatusDeleted? { + self as? DBXFilesFileStatusDeleted + } + + @objc + public var asOther: DBXFilesFileStatusOther? { + self as? DBXFilesFileStatusOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesFileStatusActive: DBXFilesFileStatus { + @objc + public init() { + let swift = Files.FileStatus.active + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesFileStatusDeleted: DBXFilesFileStatus { + @objc + public init() { + let swift = Files.FileStatus.deleted + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesFileStatusOther: DBXFilesFileStatus { + @objc + public init() { + let swift = Files.FileStatus.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FolderMetadata struct +@objc +public class DBXFilesFolderMetadata: DBXFilesMetadata { + /// A unique identifier for the folder. + @objc + public var id: String { subSwift.id } + /// Please use sharingInfo instead. + @objc + public var sharedFolderId: String? { subSwift.sharedFolderId } + /// Set if the folder is contained in a shared folder or is a shared folder mount point. + @objc + public var sharingInfo: DBXFilesFolderSharingInfo? { guard let swift = subSwift.sharingInfo else { return nil } + return DBXFilesFolderSharingInfo(swift: swift) + } + + /// Additional information if the file has custom properties with the property template specified. Note that + /// only properties associated with user-owned templates, not team-owned templates, can be attached to + /// folders. + @objc + public var propertyGroups: [DBXFilePropertiesPropertyGroup]? { subSwift.propertyGroups?.map { DBXFilePropertiesPropertyGroup(swift: $0) } } + + @objc + public init( + name: String, + id: String, + pathLower: String?, + pathDisplay: String?, + parentSharedFolderId: String?, + previewUrl: String?, + sharedFolderId: String?, + sharingInfo: DBXFilesFolderSharingInfo?, + propertyGroups: [DBXFilePropertiesPropertyGroup]? + ) { + let swift = Files.FolderMetadata( + name: name, + id: id, + pathLower: pathLower, + pathDisplay: pathDisplay, + parentSharedFolderId: parentSharedFolderId, + previewUrl: previewUrl, + sharedFolderId: sharedFolderId, + sharingInfo: sharingInfo?.subSwift, + propertyGroups: propertyGroups?.map(\.swift) + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.FolderMetadata + + public init(swift: Files.FolderMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Sharing info for a folder which is contained in a shared folder or is a shared folder mount point. +@objc +public class DBXFilesFolderSharingInfo: DBXFilesSharingInfo { + /// Set if the folder is contained by a shared folder. + @objc + public var parentSharedFolderId: String? { subSwift.parentSharedFolderId } + /// If this folder is a shared folder mount point, the ID of the shared folder mounted at this location. + @objc + public var sharedFolderId: String? { subSwift.sharedFolderId } + /// Specifies that the folder can only be traversed and the user can only see a limited subset of the contents + /// of this folder because they don't have read access to this folder. They do, however, have access to some + /// sub folder. + @objc + public var traverseOnly: NSNumber { subSwift.traverseOnly as NSNumber } + /// Specifies that the folder cannot be accessed by the user. + @objc + public var noAccess: NSNumber { subSwift.noAccess as NSNumber } + + @objc + public init(readOnly: NSNumber, parentSharedFolderId: String?, sharedFolderId: String?, traverseOnly: NSNumber, noAccess: NSNumber) { + let swift = Files.FolderSharingInfo( + readOnly: readOnly.boolValue, + parentSharedFolderId: parentSharedFolderId, + sharedFolderId: sharedFolderId, + traverseOnly: traverseOnly.boolValue, + noAccess: noAccess.boolValue + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.FolderSharingInfo + + public init(swift: Files.FolderSharingInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible GetCopyReferenceArg struct +@objc +public class DBXFilesGetCopyReferenceArg: NSObject { + /// The path to the file or folder you want to get a copy reference to. + @objc + public var path: String { swift.path } + + @objc + public init(path: String) { + self.swift = Files.GetCopyReferenceArg(path: path) + } + + let swift: Files.GetCopyReferenceArg + + public init(swift: Files.GetCopyReferenceArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetCopyReferenceError union +@objc +public class DBXFilesGetCopyReferenceError: NSObject { + let swift: Files.GetCopyReferenceError + + public init(swift: Files.GetCopyReferenceError) { + self.swift = swift + } + + public static func factory(swift: Files.GetCopyReferenceError) -> DBXFilesGetCopyReferenceError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesGetCopyReferenceErrorPath(arg) + case .other: + return DBXFilesGetCopyReferenceErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesGetCopyReferenceErrorPath? { + self as? DBXFilesGetCopyReferenceErrorPath + } + + @objc + public var asOther: DBXFilesGetCopyReferenceErrorOther? { + self as? DBXFilesGetCopyReferenceErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetCopyReferenceErrorPath: DBXFilesGetCopyReferenceError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.GetCopyReferenceError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetCopyReferenceErrorOther: DBXFilesGetCopyReferenceError { + @objc + public init() { + let swift = Files.GetCopyReferenceError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetCopyReferenceResult struct +@objc +public class DBXFilesGetCopyReferenceResult: NSObject { + /// Metadata of the file or folder. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) } + /// A copy reference to the file or folder. + @objc + public var copyReference: String { swift.copyReference } + /// The expiration date of the copy reference. This value is currently set to be far enough in the future so + /// that expiration is effectively not an issue. + @objc + public var expires: Date { swift.expires } + + @objc + public init(metadata: DBXFilesMetadata, copyReference: String, expires: Date) { + self.swift = Files.GetCopyReferenceResult(metadata: metadata.swift, copyReference: copyReference, expires: expires) + } + + let swift: Files.GetCopyReferenceResult + + public init(swift: Files.GetCopyReferenceResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTagsArg struct +@objc +public class DBXFilesGetTagsArg: NSObject { + /// Path to the items. + @objc + public var paths: [String] { swift.paths } + + @objc + public init(paths: [String]) { + self.swift = Files.GetTagsArg(paths: paths) + } + + let swift: Files.GetTagsArg + + public init(swift: Files.GetTagsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTagsResult struct +@objc +public class DBXFilesGetTagsResult: NSObject { + /// List of paths and their corresponding tags. + @objc + public var pathsToTags: [DBXFilesPathToTags] { swift.pathsToTags.map { DBXFilesPathToTags(swift: $0) } } + + @objc + public init(pathsToTags: [DBXFilesPathToTags]) { + self.swift = Files.GetTagsResult(pathsToTags: pathsToTags.map(\.swift)) + } + + let swift: Files.GetTagsResult + + public init(swift: Files.GetTagsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTemporaryLinkArg struct +@objc +public class DBXFilesGetTemporaryLinkArg: NSObject { + /// The path to the file you want a temporary link to. + @objc + public var path: String { swift.path } + + @objc + public init(path: String) { + self.swift = Files.GetTemporaryLinkArg(path: path) + } + + let swift: Files.GetTemporaryLinkArg + + public init(swift: Files.GetTemporaryLinkArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTemporaryLinkError union +@objc +public class DBXFilesGetTemporaryLinkError: NSObject { + let swift: Files.GetTemporaryLinkError + + public init(swift: Files.GetTemporaryLinkError) { + self.swift = swift + } + + public static func factory(swift: Files.GetTemporaryLinkError) -> DBXFilesGetTemporaryLinkError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesGetTemporaryLinkErrorPath(arg) + case .emailNotVerified: + return DBXFilesGetTemporaryLinkErrorEmailNotVerified() + case .unsupportedFile: + return DBXFilesGetTemporaryLinkErrorUnsupportedFile() + case .notAllowed: + return DBXFilesGetTemporaryLinkErrorNotAllowed() + case .other: + return DBXFilesGetTemporaryLinkErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesGetTemporaryLinkErrorPath? { + self as? DBXFilesGetTemporaryLinkErrorPath + } + + @objc + public var asEmailNotVerified: DBXFilesGetTemporaryLinkErrorEmailNotVerified? { + self as? DBXFilesGetTemporaryLinkErrorEmailNotVerified + } + + @objc + public var asUnsupportedFile: DBXFilesGetTemporaryLinkErrorUnsupportedFile? { + self as? DBXFilesGetTemporaryLinkErrorUnsupportedFile + } + + @objc + public var asNotAllowed: DBXFilesGetTemporaryLinkErrorNotAllowed? { + self as? DBXFilesGetTemporaryLinkErrorNotAllowed + } + + @objc + public var asOther: DBXFilesGetTemporaryLinkErrorOther? { + self as? DBXFilesGetTemporaryLinkErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetTemporaryLinkErrorPath: DBXFilesGetTemporaryLinkError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.GetTemporaryLinkError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXFilesGetTemporaryLinkErrorEmailNotVerified: DBXFilesGetTemporaryLinkError { + @objc + public init() { + let swift = Files.GetTemporaryLinkError.emailNotVerified + super.init(swift: swift) + } +} + +/// Cannot get temporary link to this file type; use export instead. +@objc +public class DBXFilesGetTemporaryLinkErrorUnsupportedFile: DBXFilesGetTemporaryLinkError { + @objc + public init() { + let swift = Files.GetTemporaryLinkError.unsupportedFile + super.init(swift: swift) + } +} + +/// The user is not allowed to request a temporary link to the specified file. For example, this can occur if +/// the file is restricted or if the user's links are banned +/// https://help.dropbox.com/files-folders/share/banned-links. +@objc +public class DBXFilesGetTemporaryLinkErrorNotAllowed: DBXFilesGetTemporaryLinkError { + @objc + public init() { + let swift = Files.GetTemporaryLinkError.notAllowed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetTemporaryLinkErrorOther: DBXFilesGetTemporaryLinkError { + @objc + public init() { + let swift = Files.GetTemporaryLinkError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetTemporaryLinkResult struct +@objc +public class DBXFilesGetTemporaryLinkResult: NSObject { + /// Metadata of the file. + @objc + public var metadata: DBXFilesFileMetadata { DBXFilesFileMetadata(swift: swift.metadata) } + /// The temporary link which can be used to stream content the file. + @objc + public var link: String { swift.link } + + @objc + public init(metadata: DBXFilesFileMetadata, link: String) { + self.swift = Files.GetTemporaryLinkResult(metadata: metadata.subSwift, link: link) + } + + let swift: Files.GetTemporaryLinkResult + + public init(swift: Files.GetTemporaryLinkResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTemporaryUploadLinkArg struct +@objc +public class DBXFilesGetTemporaryUploadLinkArg: NSObject { + /// Contains the path and other optional modifiers for the future upload commit. Equivalent to the parameters + /// provided to upload. + @objc + public var commitInfo: DBXFilesCommitInfo { DBXFilesCommitInfo(swift: swift.commitInfo) } + /// How long before this link expires, in seconds. Attempting to start an upload with this link longer than + /// this period of time after link creation will result in an error. + @objc + public var duration: NSNumber { swift.duration as NSNumber } + + @objc + public init(commitInfo: DBXFilesCommitInfo, duration: NSNumber) { + self.swift = Files.GetTemporaryUploadLinkArg(commitInfo: commitInfo.swift, duration: duration.doubleValue) + } + + let swift: Files.GetTemporaryUploadLinkArg + + public init(swift: Files.GetTemporaryUploadLinkArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTemporaryUploadLinkResult struct +@objc +public class DBXFilesGetTemporaryUploadLinkResult: NSObject { + /// The temporary link which can be used to stream a file to a Dropbox location. + @objc + public var link: String { swift.link } + + @objc + public init(link: String) { + self.swift = Files.GetTemporaryUploadLinkResult(link: link) + } + + let swift: Files.GetTemporaryUploadLinkResult + + public init(swift: Files.GetTemporaryUploadLinkResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for getThumbnailBatch. +@objc +public class DBXFilesGetThumbnailBatchArg: NSObject { + /// List of files to get thumbnails. + @objc + public var entries: [DBXFilesThumbnailArg] { swift.entries.map { DBXFilesThumbnailArg(swift: $0) } } + + @objc + public init(entries: [DBXFilesThumbnailArg]) { + self.swift = Files.GetThumbnailBatchArg(entries: entries.map(\.swift)) + } + + let swift: Files.GetThumbnailBatchArg + + public init(swift: Files.GetThumbnailBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetThumbnailBatchError union +@objc +public class DBXFilesGetThumbnailBatchError: NSObject { + let swift: Files.GetThumbnailBatchError + + public init(swift: Files.GetThumbnailBatchError) { + self.swift = swift + } + + public static func factory(swift: Files.GetThumbnailBatchError) -> DBXFilesGetThumbnailBatchError { + switch swift { + case .tooManyFiles: + return DBXFilesGetThumbnailBatchErrorTooManyFiles() + case .other: + return DBXFilesGetThumbnailBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTooManyFiles: DBXFilesGetThumbnailBatchErrorTooManyFiles? { + self as? DBXFilesGetThumbnailBatchErrorTooManyFiles + } + + @objc + public var asOther: DBXFilesGetThumbnailBatchErrorOther? { + self as? DBXFilesGetThumbnailBatchErrorOther + } +} + +/// The operation involves more than 25 files. +@objc +public class DBXFilesGetThumbnailBatchErrorTooManyFiles: DBXFilesGetThumbnailBatchError { + @objc + public init() { + let swift = Files.GetThumbnailBatchError.tooManyFiles + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetThumbnailBatchErrorOther: DBXFilesGetThumbnailBatchError { + @objc + public init() { + let swift = Files.GetThumbnailBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetThumbnailBatchResult struct +@objc +public class DBXFilesGetThumbnailBatchResult: NSObject { + /// List of files and their thumbnails. + @objc + public var entries: [DBXFilesGetThumbnailBatchResultEntry] { swift.entries.map { DBXFilesGetThumbnailBatchResultEntry(swift: $0) } } + + @objc + public init(entries: [DBXFilesGetThumbnailBatchResultEntry]) { + self.swift = Files.GetThumbnailBatchResult(entries: entries.map(\.swift)) + } + + let swift: Files.GetThumbnailBatchResult + + public init(swift: Files.GetThumbnailBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetThumbnailBatchResultData struct +@objc +public class DBXFilesGetThumbnailBatchResultData: NSObject { + /// (no description) + @objc + public var metadata: DBXFilesFileMetadata { DBXFilesFileMetadata(swift: swift.metadata) } + /// A string containing the base64-encoded thumbnail data for this file. + @objc + public var thumbnail: String { swift.thumbnail } + + @objc + public init(metadata: DBXFilesFileMetadata, thumbnail: String) { + self.swift = Files.GetThumbnailBatchResultData(metadata: metadata.subSwift, thumbnail: thumbnail) + } + + let swift: Files.GetThumbnailBatchResultData + + public init(swift: Files.GetThumbnailBatchResultData) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetThumbnailBatchResultEntry union +@objc +public class DBXFilesGetThumbnailBatchResultEntry: NSObject { + let swift: Files.GetThumbnailBatchResultEntry + + public init(swift: Files.GetThumbnailBatchResultEntry) { + self.swift = swift + } + + public static func factory(swift: Files.GetThumbnailBatchResultEntry) -> DBXFilesGetThumbnailBatchResultEntry { + switch swift { + case .success(let swiftArg): + let arg = DBXFilesGetThumbnailBatchResultData(swift: swiftArg) + return DBXFilesGetThumbnailBatchResultEntrySuccess(arg) + case .failure(let swiftArg): + let arg = DBXFilesThumbnailError(swift: swiftArg) + return DBXFilesGetThumbnailBatchResultEntryFailure(arg) + case .other: + return DBXFilesGetThumbnailBatchResultEntryOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXFilesGetThumbnailBatchResultEntrySuccess? { + self as? DBXFilesGetThumbnailBatchResultEntrySuccess + } + + @objc + public var asFailure: DBXFilesGetThumbnailBatchResultEntryFailure? { + self as? DBXFilesGetThumbnailBatchResultEntryFailure + } + + @objc + public var asOther: DBXFilesGetThumbnailBatchResultEntryOther? { + self as? DBXFilesGetThumbnailBatchResultEntryOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetThumbnailBatchResultEntrySuccess: DBXFilesGetThumbnailBatchResultEntry { + @objc + public var success: DBXFilesGetThumbnailBatchResultData + + @objc + public init(_ arg: DBXFilesGetThumbnailBatchResultData) { + self.success = arg + let swift = Files.GetThumbnailBatchResultEntry.success(arg.swift) + super.init(swift: swift) + } +} + +/// The result for this file if it was an error. +@objc +public class DBXFilesGetThumbnailBatchResultEntryFailure: DBXFilesGetThumbnailBatchResultEntry { + @objc + public var failure: DBXFilesThumbnailError + + @objc + public init(_ arg: DBXFilesThumbnailError) { + self.failure = arg + let swift = Files.GetThumbnailBatchResultEntry.failure(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesGetThumbnailBatchResultEntryOther: DBXFilesGetThumbnailBatchResultEntry { + @objc + public init() { + let swift = Files.GetThumbnailBatchResultEntry.other + super.init(swift: swift) + } +} + +/// GPS coordinates for a photo or video. +@objc +public class DBXFilesGpsCoordinates: NSObject { + /// Latitude of the GPS coordinates. + @objc + public var latitude: NSNumber { swift.latitude as NSNumber } + /// Longitude of the GPS coordinates. + @objc + public var longitude: NSNumber { swift.longitude as NSNumber } + + @objc + public init(latitude: NSNumber, longitude: NSNumber) { + self.swift = Files.GpsCoordinates(latitude: latitude.doubleValue, longitude: longitude.doubleValue) + } + + let swift: Files.GpsCoordinates + + public init(swift: Files.GpsCoordinates) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible HighlightSpan struct +@objc +public class DBXFilesHighlightSpan: NSObject { + /// String to be determined whether it should be highlighted or not. + @objc + public var highlightStr: String { swift.highlightStr } + /// The string should be highlighted or not. + @objc + public var isHighlighted: NSNumber { swift.isHighlighted as NSNumber } + + @objc + public init(highlightStr: String, isHighlighted: NSNumber) { + self.swift = Files.HighlightSpan(highlightStr: highlightStr, isHighlighted: isHighlighted.boolValue) + } + + let swift: Files.HighlightSpan + + public init(swift: Files.HighlightSpan) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The import format of the incoming Paper doc content. +@objc +public class DBXFilesImportFormat: NSObject { + let swift: Files.ImportFormat + + public init(swift: Files.ImportFormat) { + self.swift = swift + } + + public static func factory(swift: Files.ImportFormat) -> DBXFilesImportFormat { + switch swift { + case .html: + return DBXFilesImportFormatHtml() + case .markdown: + return DBXFilesImportFormatMarkdown() + case .plainText: + return DBXFilesImportFormatPlainText() + case .other: + return DBXFilesImportFormatOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHtml: DBXFilesImportFormatHtml? { + self as? DBXFilesImportFormatHtml + } + + @objc + public var asMarkdown: DBXFilesImportFormatMarkdown? { + self as? DBXFilesImportFormatMarkdown + } + + @objc + public var asPlainText: DBXFilesImportFormatPlainText? { + self as? DBXFilesImportFormatPlainText + } + + @objc + public var asOther: DBXFilesImportFormatOther? { + self as? DBXFilesImportFormatOther + } +} + +/// The provided data is interpreted as standard HTML. +@objc +public class DBXFilesImportFormatHtml: DBXFilesImportFormat { + @objc + public init() { + let swift = Files.ImportFormat.html + super.init(swift: swift) + } +} + +/// The provided data is interpreted as markdown. +@objc +public class DBXFilesImportFormatMarkdown: DBXFilesImportFormat { + @objc + public init() { + let swift = Files.ImportFormat.markdown + super.init(swift: swift) + } +} + +/// The provided data is interpreted as plain text. +@objc +public class DBXFilesImportFormatPlainText: DBXFilesImportFormat { + @objc + public init() { + let swift = Files.ImportFormat.plainText + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesImportFormatOther: DBXFilesImportFormat { + @objc + public init() { + let swift = Files.ImportFormat.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListFolderArg struct +@objc +public class DBXFilesListFolderArg: NSObject { + /// A unique identifier for the file. + @objc + public var path: String { swift.path } + /// If true, the list folder operation will be applied recursively to all subfolders and the response will + /// contain contents of all subfolders. + @objc + public var recursive: NSNumber { swift.recursive as NSNumber } + /// If true, mediaInfo in FileMetadata is set for photo and video. This parameter will no longer have an effect + /// starting December 2, 2019. + @objc + public var includeMediaInfo: NSNumber { swift.includeMediaInfo as NSNumber } + /// If true, the results will include entries for files and folders that used to exist but were deleted. + @objc + public var includeDeleted: NSNumber { swift.includeDeleted as NSNumber } + /// If true, the results will include a flag for each file indicating whether or not that file has any explicit + /// members. + @objc + public var includeHasExplicitSharedMembers: NSNumber { swift.includeHasExplicitSharedMembers as NSNumber } + /// If true, the results will include entries under mounted folders which includes app folder, shared folder and + /// team folder. + @objc + public var includeMountedFolders: NSNumber { swift.includeMountedFolders as NSNumber } + /// The maximum number of results to return per request. Note: This is an approximate number and there can be + /// slightly more entries returned in some cases. + @objc + public var limit: NSNumber? { swift.limit as NSNumber? } + /// A shared link to list the contents of. If the link is password-protected, the password must be provided. If + /// this field is present, path in ListFolderArg will be relative to root of the shared link. Only + /// non-recursive mode is supported for shared link. + @objc + public var sharedLink: DBXFilesSharedLink? { guard let swift = swift.sharedLink else { return nil } + return DBXFilesSharedLink(swift: swift) + } + + /// If set to a valid list of template IDs, propertyGroups in FileMetadata is set if there exists property data + /// associated with the file and each of the listed templates. + @objc + public var includePropertyGroups: DBXFilePropertiesTemplateFilterBase? { guard let swift = swift.includePropertyGroups else { return nil } + return DBXFilePropertiesTemplateFilterBase(swift: swift) + } + + /// If true, include files that are not downloadable, i.e. Google Docs. + @objc + public var includeNonDownloadableFiles: NSNumber { swift.includeNonDownloadableFiles as NSNumber } + + @objc + public init( + path: String, + recursive: NSNumber, + includeMediaInfo: NSNumber, + includeDeleted: NSNumber, + includeHasExplicitSharedMembers: NSNumber, + includeMountedFolders: NSNumber, + limit: NSNumber?, + sharedLink: DBXFilesSharedLink?, + includePropertyGroups: DBXFilePropertiesTemplateFilterBase?, + includeNonDownloadableFiles: NSNumber + ) { + self.swift = Files.ListFolderArg( + path: path, + recursive: recursive.boolValue, + includeMediaInfo: includeMediaInfo.boolValue, + includeDeleted: includeDeleted.boolValue, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers.boolValue, + includeMountedFolders: includeMountedFolders.boolValue, + limit: limit?.uint32Value, + sharedLink: sharedLink?.swift, + includePropertyGroups: includePropertyGroups?.swift, + includeNonDownloadableFiles: includeNonDownloadableFiles.boolValue + ) + } + + let swift: Files.ListFolderArg + + public init(swift: Files.ListFolderArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderContinueArg struct +@objc +public class DBXFilesListFolderContinueArg: NSObject { + /// The cursor returned by your last call to listFolder or listFolderContinue. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Files.ListFolderContinueArg(cursor: cursor) + } + + let swift: Files.ListFolderContinueArg + + public init(swift: Files.ListFolderContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderContinueError union +@objc +public class DBXFilesListFolderContinueError: NSObject { + let swift: Files.ListFolderContinueError + + public init(swift: Files.ListFolderContinueError) { + self.swift = swift + } + + public static func factory(swift: Files.ListFolderContinueError) -> DBXFilesListFolderContinueError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesListFolderContinueErrorPath(arg) + case .reset: + return DBXFilesListFolderContinueErrorReset() + case .other: + return DBXFilesListFolderContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesListFolderContinueErrorPath? { + self as? DBXFilesListFolderContinueErrorPath + } + + @objc + public var asReset: DBXFilesListFolderContinueErrorReset? { + self as? DBXFilesListFolderContinueErrorReset + } + + @objc + public var asOther: DBXFilesListFolderContinueErrorOther? { + self as? DBXFilesListFolderContinueErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesListFolderContinueErrorPath: DBXFilesListFolderContinueError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.ListFolderContinueError.path(arg.swift) + super.init(swift: swift) + } +} + +/// Indicates that the cursor has been invalidated. Call listFolder to obtain a new cursor. +@objc +public class DBXFilesListFolderContinueErrorReset: DBXFilesListFolderContinueError { + @objc + public init() { + let swift = Files.ListFolderContinueError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesListFolderContinueErrorOther: DBXFilesListFolderContinueError { + @objc + public init() { + let swift = Files.ListFolderContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListFolderError union +@objc +public class DBXFilesListFolderError: NSObject { + let swift: Files.ListFolderError + + public init(swift: Files.ListFolderError) { + self.swift = swift + } + + public static func factory(swift: Files.ListFolderError) -> DBXFilesListFolderError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesListFolderErrorPath(arg) + case .templateError(let swiftArg): + let arg = DBXFilePropertiesTemplateError(swift: swiftArg) + return DBXFilesListFolderErrorTemplateError(arg) + case .other: + return DBXFilesListFolderErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesListFolderErrorPath? { + self as? DBXFilesListFolderErrorPath + } + + @objc + public var asTemplateError: DBXFilesListFolderErrorTemplateError? { + self as? DBXFilesListFolderErrorTemplateError + } + + @objc + public var asOther: DBXFilesListFolderErrorOther? { + self as? DBXFilesListFolderErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesListFolderErrorPath: DBXFilesListFolderError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.ListFolderError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesListFolderErrorTemplateError: DBXFilesListFolderError { + @objc + public var templateError: DBXFilePropertiesTemplateError + + @objc + public init(_ arg: DBXFilePropertiesTemplateError) { + self.templateError = arg + let swift = Files.ListFolderError.templateError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesListFolderErrorOther: DBXFilesListFolderError { + @objc + public init() { + let swift = Files.ListFolderError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListFolderGetLatestCursorResult struct +@objc +public class DBXFilesListFolderGetLatestCursorResult: NSObject { + /// Pass the cursor into listFolderContinue to see what's changed in the folder since your previous query. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Files.ListFolderGetLatestCursorResult(cursor: cursor) + } + + let swift: Files.ListFolderGetLatestCursorResult + + public init(swift: Files.ListFolderGetLatestCursorResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderLongpollArg struct +@objc +public class DBXFilesListFolderLongpollArg: NSObject { + /// A cursor as returned by listFolder or listFolderContinue. Cursors retrieved by setting includeMediaInfo in + /// ListFolderArg to true are not supported. + @objc + public var cursor: String { swift.cursor } + /// A timeout in seconds. The request will block for at most this length of time, plus up to 90 seconds of + /// random jitter added to avoid the thundering herd problem. Care should be taken when using this + /// parameter, as some network infrastructure does not support long timeouts. + @objc + public var timeout: NSNumber { swift.timeout as NSNumber } + + @objc + public init(cursor: String, timeout: NSNumber) { + self.swift = Files.ListFolderLongpollArg(cursor: cursor, timeout: timeout.uint64Value) + } + + let swift: Files.ListFolderLongpollArg + + public init(swift: Files.ListFolderLongpollArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderLongpollError union +@objc +public class DBXFilesListFolderLongpollError: NSObject { + let swift: Files.ListFolderLongpollError + + public init(swift: Files.ListFolderLongpollError) { + self.swift = swift + } + + public static func factory(swift: Files.ListFolderLongpollError) -> DBXFilesListFolderLongpollError { + switch swift { + case .reset: + return DBXFilesListFolderLongpollErrorReset() + case .other: + return DBXFilesListFolderLongpollErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asReset: DBXFilesListFolderLongpollErrorReset? { + self as? DBXFilesListFolderLongpollErrorReset + } + + @objc + public var asOther: DBXFilesListFolderLongpollErrorOther? { + self as? DBXFilesListFolderLongpollErrorOther + } +} + +/// Indicates that the cursor has been invalidated. Call listFolder to obtain a new cursor. +@objc +public class DBXFilesListFolderLongpollErrorReset: DBXFilesListFolderLongpollError { + @objc + public init() { + let swift = Files.ListFolderLongpollError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesListFolderLongpollErrorOther: DBXFilesListFolderLongpollError { + @objc + public init() { + let swift = Files.ListFolderLongpollError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListFolderLongpollResult struct +@objc +public class DBXFilesListFolderLongpollResult: NSObject { + /// Indicates whether new changes are available. If true, call listFolderContinue to retrieve the changes. + @objc + public var changes: NSNumber { swift.changes as NSNumber } + /// If present, backoff for at least this many seconds before calling listFolderLongpoll again. + @objc + public var backoff: NSNumber? { swift.backoff as NSNumber? } + + @objc + public init(changes: NSNumber, backoff: NSNumber?) { + self.swift = Files.ListFolderLongpollResult(changes: changes.boolValue, backoff: backoff?.uint64Value) + } + + let swift: Files.ListFolderLongpollResult + + public init(swift: Files.ListFolderLongpollResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderResult struct +@objc +public class DBXFilesListFolderResult: NSObject { + /// The files and (direct) subfolders in the folder. + @objc + public var entries: [DBXFilesMetadata] { swift.entries.map { DBXFilesMetadata(swift: $0) } } + /// Pass the cursor into listFolderContinue to see what's changed in the folder since your previous query. + @objc + public var cursor: String { swift.cursor } + /// If true, then there are more entries available. Pass the cursor to listFolderContinue to retrieve the rest. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(entries: [DBXFilesMetadata], cursor: String, hasMore: NSNumber) { + self.swift = Files.ListFolderResult(entries: entries.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Files.ListFolderResult + + public init(swift: Files.ListFolderResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListRevisionsArg struct +@objc +public class DBXFilesListRevisionsArg: NSObject { + /// The path to the file you want to see the revisions of. + @objc + public var path: String { swift.path } + /// Determines the behavior of the API in listing the revisions for a given file path or id. + @objc + public var mode: DBXFilesListRevisionsMode { DBXFilesListRevisionsMode(swift: swift.mode) } + /// The maximum number of revision entries returned. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(path: String, mode: DBXFilesListRevisionsMode, limit: NSNumber) { + self.swift = Files.ListRevisionsArg(path: path, mode: mode.swift, limit: limit.uint64Value) + } + + let swift: Files.ListRevisionsArg + + public init(swift: Files.ListRevisionsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListRevisionsError union +@objc +public class DBXFilesListRevisionsError: NSObject { + let swift: Files.ListRevisionsError + + public init(swift: Files.ListRevisionsError) { + self.swift = swift + } + + public static func factory(swift: Files.ListRevisionsError) -> DBXFilesListRevisionsError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesListRevisionsErrorPath(arg) + case .other: + return DBXFilesListRevisionsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesListRevisionsErrorPath? { + self as? DBXFilesListRevisionsErrorPath + } + + @objc + public var asOther: DBXFilesListRevisionsErrorOther? { + self as? DBXFilesListRevisionsErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesListRevisionsErrorPath: DBXFilesListRevisionsError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.ListRevisionsError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesListRevisionsErrorOther: DBXFilesListRevisionsError { + @objc + public init() { + let swift = Files.ListRevisionsError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListRevisionsMode union +@objc +public class DBXFilesListRevisionsMode: NSObject { + let swift: Files.ListRevisionsMode + + public init(swift: Files.ListRevisionsMode) { + self.swift = swift + } + + public static func factory(swift: Files.ListRevisionsMode) -> DBXFilesListRevisionsMode { + switch swift { + case .path: + return DBXFilesListRevisionsModePath() + case .id: + return DBXFilesListRevisionsModeId() + case .other: + return DBXFilesListRevisionsModeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesListRevisionsModePath? { + self as? DBXFilesListRevisionsModePath + } + + @objc + public var asId: DBXFilesListRevisionsModeId? { + self as? DBXFilesListRevisionsModeId + } + + @objc + public var asOther: DBXFilesListRevisionsModeOther? { + self as? DBXFilesListRevisionsModeOther + } +} + +/// Returns revisions with the same file path as identified by the latest file entry at the given file path or +/// id. +@objc +public class DBXFilesListRevisionsModePath: DBXFilesListRevisionsMode { + @objc + public init() { + let swift = Files.ListRevisionsMode.path + super.init(swift: swift) + } +} + +/// Returns revisions with the same file id as identified by the latest file entry at the given file path or id. +@objc +public class DBXFilesListRevisionsModeId: DBXFilesListRevisionsMode { + @objc + public init() { + let swift = Files.ListRevisionsMode.id + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesListRevisionsModeOther: DBXFilesListRevisionsMode { + @objc + public init() { + let swift = Files.ListRevisionsMode.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListRevisionsResult struct +@objc +public class DBXFilesListRevisionsResult: NSObject { + /// If the file identified by the latest revision in the response is either deleted or moved. + @objc + public var isDeleted: NSNumber { swift.isDeleted as NSNumber } + /// The time of deletion if the file was deleted. + @objc + public var serverDeleted: Date? { swift.serverDeleted } + /// The revisions for the file. Only revisions that are not deleted will show up here. + @objc + public var entries: [DBXFilesFileMetadata] { swift.entries.map { DBXFilesFileMetadata(swift: $0) } } + + @objc + public init(isDeleted: NSNumber, entries: [DBXFilesFileMetadata], serverDeleted: Date?) { + self.swift = Files.ListRevisionsResult(isDeleted: isDeleted.boolValue, entries: entries.map(\.subSwift), serverDeleted: serverDeleted) + } + + let swift: Files.ListRevisionsResult + + public init(swift: Files.ListRevisionsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LockConflictError struct +@objc +public class DBXFilesLockConflictError: NSObject { + /// The lock that caused the conflict. + @objc + public var lock: DBXFilesFileLock { DBXFilesFileLock(swift: swift.lock) } + + @objc + public init(lock: DBXFilesFileLock) { + self.swift = Files.LockConflictError(lock: lock.swift) + } + + let swift: Files.LockConflictError + + public init(swift: Files.LockConflictError) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LockFileArg struct +@objc +public class DBXFilesLockFileArg: NSObject { + /// Path in the user's Dropbox to a file. + @objc + public var path: String { swift.path } + + @objc + public init(path: String) { + self.swift = Files.LockFileArg(path: path) + } + + let swift: Files.LockFileArg + + public init(swift: Files.LockFileArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LockFileBatchArg struct +@objc +public class DBXFilesLockFileBatchArg: NSObject { + /// List of 'entries'. Each 'entry' contains a path of the file which will be locked or queried. Duplicate path + /// arguments in the batch are considered only once. + @objc + public var entries: [DBXFilesLockFileArg] { swift.entries.map { DBXFilesLockFileArg(swift: $0) } } + + @objc + public init(entries: [DBXFilesLockFileArg]) { + self.swift = Files.LockFileBatchArg(entries: entries.map(\.swift)) + } + + let swift: Files.LockFileBatchArg + + public init(swift: Files.LockFileBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LockFileBatchResult struct +@objc +public class DBXFilesLockFileBatchResult: DBXFilesFileOpsResult { + /// Each Entry in the 'entries' will have '.tag' with the operation status (e.g. success), the metadata for the + /// file and the lock state after the operation. + @objc + public var entries: [DBXFilesLockFileResultEntry] { subSwift.entries.map { DBXFilesLockFileResultEntry(swift: $0) } } + + @objc + public init(entries: [DBXFilesLockFileResultEntry]) { + let swift = Files.LockFileBatchResult(entries: entries.map(\.swift)) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.LockFileBatchResult + + public init(swift: Files.LockFileBatchResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible LockFileError union +@objc +public class DBXFilesLockFileError: NSObject { + let swift: Files.LockFileError + + public init(swift: Files.LockFileError) { + self.swift = swift + } + + public static func factory(swift: Files.LockFileError) -> DBXFilesLockFileError { + switch swift { + case .pathLookup(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesLockFileErrorPathLookup(arg) + case .tooManyWriteOperations: + return DBXFilesLockFileErrorTooManyWriteOperations() + case .tooManyFiles: + return DBXFilesLockFileErrorTooManyFiles() + case .noWritePermission: + return DBXFilesLockFileErrorNoWritePermission() + case .cannotBeLocked: + return DBXFilesLockFileErrorCannotBeLocked() + case .fileNotShared: + return DBXFilesLockFileErrorFileNotShared() + case .lockConflict(let swiftArg): + let arg = DBXFilesLockConflictError(swift: swiftArg) + return DBXFilesLockFileErrorLockConflict(arg) + case .internalError: + return DBXFilesLockFileErrorInternalError() + case .other: + return DBXFilesLockFileErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPathLookup: DBXFilesLockFileErrorPathLookup? { + self as? DBXFilesLockFileErrorPathLookup + } + + @objc + public var asTooManyWriteOperations: DBXFilesLockFileErrorTooManyWriteOperations? { + self as? DBXFilesLockFileErrorTooManyWriteOperations + } + + @objc + public var asTooManyFiles: DBXFilesLockFileErrorTooManyFiles? { + self as? DBXFilesLockFileErrorTooManyFiles + } + + @objc + public var asNoWritePermission: DBXFilesLockFileErrorNoWritePermission? { + self as? DBXFilesLockFileErrorNoWritePermission + } + + @objc + public var asCannotBeLocked: DBXFilesLockFileErrorCannotBeLocked? { + self as? DBXFilesLockFileErrorCannotBeLocked + } + + @objc + public var asFileNotShared: DBXFilesLockFileErrorFileNotShared? { + self as? DBXFilesLockFileErrorFileNotShared + } + + @objc + public var asLockConflict: DBXFilesLockFileErrorLockConflict? { + self as? DBXFilesLockFileErrorLockConflict + } + + @objc + public var asInternalError: DBXFilesLockFileErrorInternalError? { + self as? DBXFilesLockFileErrorInternalError + } + + @objc + public var asOther: DBXFilesLockFileErrorOther? { + self as? DBXFilesLockFileErrorOther + } +} + +/// Could not find the specified resource. +@objc +public class DBXFilesLockFileErrorPathLookup: DBXFilesLockFileError { + @objc + public var pathLookup: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.pathLookup = arg + let swift = Files.LockFileError.pathLookup(arg.swift) + super.init(swift: swift) + } +} + +/// There are too many write operations in user's Dropbox. Please retry this request. +@objc +public class DBXFilesLockFileErrorTooManyWriteOperations: DBXFilesLockFileError { + @objc + public init() { + let swift = Files.LockFileError.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// There are too many files in one request. Please retry with fewer files. +@objc +public class DBXFilesLockFileErrorTooManyFiles: DBXFilesLockFileError { + @objc + public init() { + let swift = Files.LockFileError.tooManyFiles + super.init(swift: swift) + } +} + +/// The user does not have permissions to change the lock state or access the file. +@objc +public class DBXFilesLockFileErrorNoWritePermission: DBXFilesLockFileError { + @objc + public init() { + let swift = Files.LockFileError.noWritePermission + super.init(swift: swift) + } +} + +/// Item is a type that cannot be locked. +@objc +public class DBXFilesLockFileErrorCannotBeLocked: DBXFilesLockFileError { + @objc + public init() { + let swift = Files.LockFileError.cannotBeLocked + super.init(swift: swift) + } +} + +/// Requested file is not currently shared. +@objc +public class DBXFilesLockFileErrorFileNotShared: DBXFilesLockFileError { + @objc + public init() { + let swift = Files.LockFileError.fileNotShared + super.init(swift: swift) + } +} + +/// The user action conflicts with an existing lock on the file. +@objc +public class DBXFilesLockFileErrorLockConflict: DBXFilesLockFileError { + @objc + public var lockConflict: DBXFilesLockConflictError + + @objc + public init(_ arg: DBXFilesLockConflictError) { + self.lockConflict = arg + let swift = Files.LockFileError.lockConflict(arg.swift) + super.init(swift: swift) + } +} + +/// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking +/// succeeded, and if not, try again. This should happen very rarely. +@objc +public class DBXFilesLockFileErrorInternalError: DBXFilesLockFileError { + @objc + public init() { + let swift = Files.LockFileError.internalError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesLockFileErrorOther: DBXFilesLockFileError { + @objc + public init() { + let swift = Files.LockFileError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LockFileResult struct +@objc +public class DBXFilesLockFileResult: NSObject { + /// Metadata of the file. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) } + /// The file lock state after the operation. + @objc + public var lock: DBXFilesFileLock { DBXFilesFileLock(swift: swift.lock) } + + @objc + public init(metadata: DBXFilesMetadata, lock: DBXFilesFileLock) { + self.swift = Files.LockFileResult(metadata: metadata.swift, lock: lock.swift) + } + + let swift: Files.LockFileResult + + public init(swift: Files.LockFileResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LockFileResultEntry union +@objc +public class DBXFilesLockFileResultEntry: NSObject { + let swift: Files.LockFileResultEntry + + public init(swift: Files.LockFileResultEntry) { + self.swift = swift + } + + public static func factory(swift: Files.LockFileResultEntry) -> DBXFilesLockFileResultEntry { + switch swift { + case .success(let swiftArg): + let arg = DBXFilesLockFileResult(swift: swiftArg) + return DBXFilesLockFileResultEntrySuccess(arg) + case .failure(let swiftArg): + let arg = DBXFilesLockFileError(swift: swiftArg) + return DBXFilesLockFileResultEntryFailure(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXFilesLockFileResultEntrySuccess? { + self as? DBXFilesLockFileResultEntrySuccess + } + + @objc + public var asFailure: DBXFilesLockFileResultEntryFailure? { + self as? DBXFilesLockFileResultEntryFailure + } +} + +/// An unspecified error. +@objc +public class DBXFilesLockFileResultEntrySuccess: DBXFilesLockFileResultEntry { + @objc + public var success: DBXFilesLockFileResult + + @objc + public init(_ arg: DBXFilesLockFileResult) { + self.success = arg + let swift = Files.LockFileResultEntry.success(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesLockFileResultEntryFailure: DBXFilesLockFileResultEntry { + @objc + public var failure: DBXFilesLockFileError + + @objc + public init(_ arg: DBXFilesLockFileError) { + self.failure = arg + let swift = Files.LockFileResultEntry.failure(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible LookupError union +@objc +public class DBXFilesLookupError: NSObject { + let swift: Files.LookupError + + public init(swift: Files.LookupError) { + self.swift = swift + } + + public static func factory(swift: Files.LookupError) -> DBXFilesLookupError { + switch swift { + case .malformedPath(let swiftArg): + let arg = swiftArg + return DBXFilesLookupErrorMalformedPath(arg) + case .notFound: + return DBXFilesLookupErrorNotFound() + case .notFile: + return DBXFilesLookupErrorNotFile() + case .notFolder: + return DBXFilesLookupErrorNotFolder() + case .restrictedContent: + return DBXFilesLookupErrorRestrictedContent() + case .unsupportedContentType: + return DBXFilesLookupErrorUnsupportedContentType() + case .locked: + return DBXFilesLookupErrorLocked() + case .other: + return DBXFilesLookupErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMalformedPath: DBXFilesLookupErrorMalformedPath? { + self as? DBXFilesLookupErrorMalformedPath + } + + @objc + public var asNotFound: DBXFilesLookupErrorNotFound? { + self as? DBXFilesLookupErrorNotFound + } + + @objc + public var asNotFile: DBXFilesLookupErrorNotFile? { + self as? DBXFilesLookupErrorNotFile + } + + @objc + public var asNotFolder: DBXFilesLookupErrorNotFolder? { + self as? DBXFilesLookupErrorNotFolder + } + + @objc + public var asRestrictedContent: DBXFilesLookupErrorRestrictedContent? { + self as? DBXFilesLookupErrorRestrictedContent + } + + @objc + public var asUnsupportedContentType: DBXFilesLookupErrorUnsupportedContentType? { + self as? DBXFilesLookupErrorUnsupportedContentType + } + + @objc + public var asLocked: DBXFilesLookupErrorLocked? { + self as? DBXFilesLookupErrorLocked + } + + @objc + public var asOther: DBXFilesLookupErrorOther? { + self as? DBXFilesLookupErrorOther + } +} + +/// The given path does not satisfy the required path format. Please refer to the Path formats documentation +/// https://www.dropbox.com/developers/documentation/http/documentation#path-formats for more +/// information. +@objc +public class DBXFilesLookupErrorMalformedPath: DBXFilesLookupError { + @objc + public var malformedPath: String? + + @objc + public init(_ arg: String?) { + self.malformedPath = arg + let swift = Files.LookupError.malformedPath(arg) + super.init(swift: swift) + } +} + +/// There is nothing at the given path. +@objc +public class DBXFilesLookupErrorNotFound: DBXFilesLookupError { + @objc + public init() { + let swift = Files.LookupError.notFound + super.init(swift: swift) + } +} + +/// We were expecting a file, but the given path refers to something that isn't a file. +@objc +public class DBXFilesLookupErrorNotFile: DBXFilesLookupError { + @objc + public init() { + let swift = Files.LookupError.notFile + super.init(swift: swift) + } +} + +/// We were expecting a folder, but the given path refers to something that isn't a folder. +@objc +public class DBXFilesLookupErrorNotFolder: DBXFilesLookupError { + @objc + public init() { + let swift = Files.LookupError.notFolder + super.init(swift: swift) + } +} + +/// The file cannot be transferred because the content is restricted. For example, we might restrict a file due +/// to legal requirements. +@objc +public class DBXFilesLookupErrorRestrictedContent: DBXFilesLookupError { + @objc + public init() { + let swift = Files.LookupError.restrictedContent + super.init(swift: swift) + } +} + +/// This operation is not supported for this content type. +@objc +public class DBXFilesLookupErrorUnsupportedContentType: DBXFilesLookupError { + @objc + public init() { + let swift = Files.LookupError.unsupportedContentType + super.init(swift: swift) + } +} + +/// The given path is locked. +@objc +public class DBXFilesLookupErrorLocked: DBXFilesLookupError { + @objc + public init() { + let swift = Files.LookupError.locked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesLookupErrorOther: DBXFilesLookupError { + @objc + public init() { + let swift = Files.LookupError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MediaInfo union +@objc +public class DBXFilesMediaInfo: NSObject { + let swift: Files.MediaInfo + + public init(swift: Files.MediaInfo) { + self.swift = swift + } + + public static func factory(swift: Files.MediaInfo) -> DBXFilesMediaInfo { + switch swift { + case .pending: + return DBXFilesMediaInfoPending() + case .metadata(let swiftArg): + let arg = DBXFilesMediaMetadata(swift: swiftArg) + return DBXFilesMediaInfoMetadata(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPending: DBXFilesMediaInfoPending? { + self as? DBXFilesMediaInfoPending + } + + @objc + public var asMetadata: DBXFilesMediaInfoMetadata? { + self as? DBXFilesMediaInfoMetadata + } +} + +/// Indicate the photo/video is still under processing and metadata is not available yet. +@objc +public class DBXFilesMediaInfoPending: DBXFilesMediaInfo { + @objc + public init() { + let swift = Files.MediaInfo.pending + super.init(swift: swift) + } +} + +/// The metadata for the photo/video. +@objc +public class DBXFilesMediaInfoMetadata: DBXFilesMediaInfo { + @objc + public var metadata: DBXFilesMediaMetadata + + @objc + public init(_ arg: DBXFilesMediaMetadata) { + self.metadata = arg + let swift = Files.MediaInfo.metadata(arg.swift) + super.init(swift: swift) + } +} + +/// Metadata for a photo or video. +@objc +public class DBXFilesMediaMetadata: NSObject { + /// Dimension of the photo/video. + @objc + public var dimensions: DBXFilesDimensions? { guard let swift = swift.dimensions else { return nil } + return DBXFilesDimensions(swift: swift) + } + + /// The GPS coordinate of the photo/video. + @objc + public var location: DBXFilesGpsCoordinates? { guard let swift = swift.location else { return nil } + return DBXFilesGpsCoordinates(swift: swift) + } + + /// The timestamp when the photo/video is taken. + @objc + public var timeTaken: Date? { swift.timeTaken } + + @objc + public init(dimensions: DBXFilesDimensions?, location: DBXFilesGpsCoordinates?, timeTaken: Date?) { + self.swift = Files.MediaMetadata(dimensions: dimensions?.swift, location: location?.swift, timeTaken: timeTaken) + } + + let swift: Files.MediaMetadata + + public init(swift: Files.MediaMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Metadata for a file, folder or other resource types. +@objc +public class DBXFilesMetadataV2: NSObject { + let swift: Files.MetadataV2 + + public init(swift: Files.MetadataV2) { + self.swift = swift + } + + public static func factory(swift: Files.MetadataV2) -> DBXFilesMetadataV2 { + switch swift { + case .metadata(let swiftArg): + let arg = DBXFilesMetadata(swift: swiftArg) + return DBXFilesMetadataV2Metadata(arg) + case .other: + return DBXFilesMetadataV2Other() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMetadata: DBXFilesMetadataV2Metadata? { + self as? DBXFilesMetadataV2Metadata + } + + @objc + public var asOther: DBXFilesMetadataV2Other? { + self as? DBXFilesMetadataV2Other + } +} + +/// An unspecified error. +@objc +public class DBXFilesMetadataV2Metadata: DBXFilesMetadataV2 { + @objc + public var metadata: DBXFilesMetadata + + @objc + public init(_ arg: DBXFilesMetadata) { + self.metadata = arg + let swift = Files.MetadataV2.metadata(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesMetadataV2Other: DBXFilesMetadataV2 { + @objc + public init() { + let swift = Files.MetadataV2.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MinimalFileLinkMetadata struct +@objc +public class DBXFilesMinimalFileLinkMetadata: NSObject { + /// URL of the shared link. + @objc + public var url: String { swift.url } + /// Unique identifier for the linked file. + @objc + public var id: String? { swift.id } + /// Full path in the user's Dropbox. This always starts with a slash. This field will only be present only if + /// the linked file is in the authenticated user's Dropbox. + @objc + public var path: String? { swift.path } + /// A unique identifier for the current revision of a file. This field is the same rev as elsewhere in the API + /// and can be used to detect changes and avoid conflicts. + @objc + public var rev: String { swift.rev } + + @objc + public init(url: String, rev: String, id: String?, path: String?) { + self.swift = Files.MinimalFileLinkMetadata(url: url, rev: rev, id: id, path: path) + } + + let swift: Files.MinimalFileLinkMetadata + + public init(swift: Files.MinimalFileLinkMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RelocationBatchArgBase struct +@objc +public class DBXFilesRelocationBatchArgBase: NSObject { + /// List of entries to be moved or copied. Each entry is RelocationPath. + @objc + public var entries: [DBXFilesRelocationPath] { swift.entries.map { DBXFilesRelocationPath(swift: $0) } } + /// If there's a conflict with any file, have the Dropbox server try to autorename that file to avoid the + /// conflict. + @objc + public var autorename: NSNumber { swift.autorename as NSNumber } + + @objc + public init(entries: [DBXFilesRelocationPath], autorename: NSNumber) { + self.swift = Files.RelocationBatchArgBase(entries: entries.map(\.swift), autorename: autorename.boolValue) + } + + let swift: Files.RelocationBatchArgBase + + public init(swift: Files.RelocationBatchArgBase) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MoveBatchArg struct +@objc +public class DBXFilesMoveBatchArg: DBXFilesRelocationBatchArgBase { + /// Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does + /// not apply to copies. + @objc + public var allowOwnershipTransfer: NSNumber { subSwift.allowOwnershipTransfer as NSNumber } + + @objc + public init(entries: [DBXFilesRelocationPath], autorename: NSNumber, allowOwnershipTransfer: NSNumber) { + let swift = Files.MoveBatchArg( + entries: entries.map(\.swift), + autorename: autorename.boolValue, + allowOwnershipTransfer: allowOwnershipTransfer.boolValue + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.MoveBatchArg + + public init(swift: Files.MoveBatchArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible MoveIntoFamilyError union +@objc +public class DBXFilesMoveIntoFamilyError: NSObject { + let swift: Files.MoveIntoFamilyError + + public init(swift: Files.MoveIntoFamilyError) { + self.swift = swift + } + + public static func factory(swift: Files.MoveIntoFamilyError) -> DBXFilesMoveIntoFamilyError { + switch swift { + case .isSharedFolder: + return DBXFilesMoveIntoFamilyErrorIsSharedFolder() + case .other: + return DBXFilesMoveIntoFamilyErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIsSharedFolder: DBXFilesMoveIntoFamilyErrorIsSharedFolder? { + self as? DBXFilesMoveIntoFamilyErrorIsSharedFolder + } + + @objc + public var asOther: DBXFilesMoveIntoFamilyErrorOther? { + self as? DBXFilesMoveIntoFamilyErrorOther + } +} + +/// Moving shared folder into Family Room folder is not allowed. +@objc +public class DBXFilesMoveIntoFamilyErrorIsSharedFolder: DBXFilesMoveIntoFamilyError { + @objc + public init() { + let swift = Files.MoveIntoFamilyError.isSharedFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesMoveIntoFamilyErrorOther: DBXFilesMoveIntoFamilyError { + @objc + public init() { + let swift = Files.MoveIntoFamilyError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MoveIntoVaultError union +@objc +public class DBXFilesMoveIntoVaultError: NSObject { + let swift: Files.MoveIntoVaultError + + public init(swift: Files.MoveIntoVaultError) { + self.swift = swift + } + + public static func factory(swift: Files.MoveIntoVaultError) -> DBXFilesMoveIntoVaultError { + switch swift { + case .isSharedFolder: + return DBXFilesMoveIntoVaultErrorIsSharedFolder() + case .other: + return DBXFilesMoveIntoVaultErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIsSharedFolder: DBXFilesMoveIntoVaultErrorIsSharedFolder? { + self as? DBXFilesMoveIntoVaultErrorIsSharedFolder + } + + @objc + public var asOther: DBXFilesMoveIntoVaultErrorOther? { + self as? DBXFilesMoveIntoVaultErrorOther + } +} + +/// Moving shared folder into Vault is not allowed. +@objc +public class DBXFilesMoveIntoVaultErrorIsSharedFolder: DBXFilesMoveIntoVaultError { + @objc + public init() { + let swift = Files.MoveIntoVaultError.isSharedFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesMoveIntoVaultErrorOther: DBXFilesMoveIntoVaultError { + @objc + public init() { + let swift = Files.MoveIntoVaultError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperContentError union +@objc +public class DBXFilesPaperContentError: NSObject { + let swift: Files.PaperContentError + + public init(swift: Files.PaperContentError) { + self.swift = swift + } + + public static func factory(swift: Files.PaperContentError) -> DBXFilesPaperContentError { + switch swift { + case .insufficientPermissions: + return DBXFilesPaperContentErrorInsufficientPermissions() + case .contentMalformed: + return DBXFilesPaperContentErrorContentMalformed() + case .docLengthExceeded: + return DBXFilesPaperContentErrorDocLengthExceeded() + case .imageSizeExceeded: + return DBXFilesPaperContentErrorImageSizeExceeded() + case .other: + return DBXFilesPaperContentErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXFilesPaperContentErrorInsufficientPermissions? { + self as? DBXFilesPaperContentErrorInsufficientPermissions + } + + @objc + public var asContentMalformed: DBXFilesPaperContentErrorContentMalformed? { + self as? DBXFilesPaperContentErrorContentMalformed + } + + @objc + public var asDocLengthExceeded: DBXFilesPaperContentErrorDocLengthExceeded? { + self as? DBXFilesPaperContentErrorDocLengthExceeded + } + + @objc + public var asImageSizeExceeded: DBXFilesPaperContentErrorImageSizeExceeded? { + self as? DBXFilesPaperContentErrorImageSizeExceeded + } + + @objc + public var asOther: DBXFilesPaperContentErrorOther? { + self as? DBXFilesPaperContentErrorOther + } +} + +/// Your account does not have permissions to edit Paper docs. +@objc +public class DBXFilesPaperContentErrorInsufficientPermissions: DBXFilesPaperContentError { + @objc + public init() { + let swift = Files.PaperContentError.insufficientPermissions + super.init(swift: swift) + } +} + +/// The provided content was malformed and cannot be imported to Paper. +@objc +public class DBXFilesPaperContentErrorContentMalformed: DBXFilesPaperContentError { + @objc + public init() { + let swift = Files.PaperContentError.contentMalformed + super.init(swift: swift) + } +} + +/// The Paper doc would be too large, split the content into multiple docs. +@objc +public class DBXFilesPaperContentErrorDocLengthExceeded: DBXFilesPaperContentError { + @objc + public init() { + let swift = Files.PaperContentError.docLengthExceeded + super.init(swift: swift) + } +} + +/// The imported document contains an image that is too large. The current limit is 1MB. This only applies to +/// HTML with data URI. +@objc +public class DBXFilesPaperContentErrorImageSizeExceeded: DBXFilesPaperContentError { + @objc + public init() { + let swift = Files.PaperContentError.imageSizeExceeded + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesPaperContentErrorOther: DBXFilesPaperContentError { + @objc + public init() { + let swift = Files.PaperContentError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperCreateArg struct +@objc +public class DBXFilesPaperCreateArg: NSObject { + /// The fully qualified path to the location in the user's Dropbox where the Paper Doc should be created. This + /// should include the document's title and end with .paper. + @objc + public var path: String { swift.path } + /// The format of the provided data. + @objc + public var importFormat: DBXFilesImportFormat { DBXFilesImportFormat(swift: swift.importFormat) } + + @objc + public init(path: String, importFormat: DBXFilesImportFormat) { + self.swift = Files.PaperCreateArg(path: path, importFormat: importFormat.swift) + } + + let swift: Files.PaperCreateArg + + public init(swift: Files.PaperCreateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperCreateError union +@objc +public class DBXFilesPaperCreateError: NSObject { + let swift: Files.PaperCreateError + + public init(swift: Files.PaperCreateError) { + self.swift = swift + } + + public static func factory(swift: Files.PaperCreateError) -> DBXFilesPaperCreateError { + switch swift { + case .insufficientPermissions: + return DBXFilesPaperCreateErrorInsufficientPermissions() + case .contentMalformed: + return DBXFilesPaperCreateErrorContentMalformed() + case .docLengthExceeded: + return DBXFilesPaperCreateErrorDocLengthExceeded() + case .imageSizeExceeded: + return DBXFilesPaperCreateErrorImageSizeExceeded() + case .other: + return DBXFilesPaperCreateErrorOther() + case .invalidPath: + return DBXFilesPaperCreateErrorInvalidPath() + case .emailUnverified: + return DBXFilesPaperCreateErrorEmailUnverified() + case .invalidFileExtension: + return DBXFilesPaperCreateErrorInvalidFileExtension() + case .paperDisabled: + return DBXFilesPaperCreateErrorPaperDisabled() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXFilesPaperCreateErrorInsufficientPermissions? { + self as? DBXFilesPaperCreateErrorInsufficientPermissions + } + + @objc + public var asContentMalformed: DBXFilesPaperCreateErrorContentMalformed? { + self as? DBXFilesPaperCreateErrorContentMalformed + } + + @objc + public var asDocLengthExceeded: DBXFilesPaperCreateErrorDocLengthExceeded? { + self as? DBXFilesPaperCreateErrorDocLengthExceeded + } + + @objc + public var asImageSizeExceeded: DBXFilesPaperCreateErrorImageSizeExceeded? { + self as? DBXFilesPaperCreateErrorImageSizeExceeded + } + + @objc + public var asOther: DBXFilesPaperCreateErrorOther? { + self as? DBXFilesPaperCreateErrorOther + } + + @objc + public var asInvalidPath: DBXFilesPaperCreateErrorInvalidPath? { + self as? DBXFilesPaperCreateErrorInvalidPath + } + + @objc + public var asEmailUnverified: DBXFilesPaperCreateErrorEmailUnverified? { + self as? DBXFilesPaperCreateErrorEmailUnverified + } + + @objc + public var asInvalidFileExtension: DBXFilesPaperCreateErrorInvalidFileExtension? { + self as? DBXFilesPaperCreateErrorInvalidFileExtension + } + + @objc + public var asPaperDisabled: DBXFilesPaperCreateErrorPaperDisabled? { + self as? DBXFilesPaperCreateErrorPaperDisabled + } +} + +/// Your account does not have permissions to edit Paper docs. +@objc +public class DBXFilesPaperCreateErrorInsufficientPermissions: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.insufficientPermissions + super.init(swift: swift) + } +} + +/// The provided content was malformed and cannot be imported to Paper. +@objc +public class DBXFilesPaperCreateErrorContentMalformed: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.contentMalformed + super.init(swift: swift) + } +} + +/// The Paper doc would be too large, split the content into multiple docs. +@objc +public class DBXFilesPaperCreateErrorDocLengthExceeded: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.docLengthExceeded + super.init(swift: swift) + } +} + +/// The imported document contains an image that is too large. The current limit is 1MB. This only applies to +/// HTML with data URI. +@objc +public class DBXFilesPaperCreateErrorImageSizeExceeded: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.imageSizeExceeded + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesPaperCreateErrorOther: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.other + super.init(swift: swift) + } +} + +/// The file could not be saved to the specified location. +@objc +public class DBXFilesPaperCreateErrorInvalidPath: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.invalidPath + super.init(swift: swift) + } +} + +/// The user's email must be verified to create Paper docs. +@objc +public class DBXFilesPaperCreateErrorEmailUnverified: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.emailUnverified + super.init(swift: swift) + } +} + +/// The file path must end in .paper. +@objc +public class DBXFilesPaperCreateErrorInvalidFileExtension: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.invalidFileExtension + super.init(swift: swift) + } +} + +/// Paper is disabled for your team. +@objc +public class DBXFilesPaperCreateErrorPaperDisabled: DBXFilesPaperCreateError { + @objc + public init() { + let swift = Files.PaperCreateError.paperDisabled + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperCreateResult struct +@objc +public class DBXFilesPaperCreateResult: NSObject { + /// URL to open the Paper Doc. + @objc + public var url: String { swift.url } + /// The fully qualified path the Paper Doc was actually created at. + @objc + public var resultPath: String { swift.resultPath } + /// The id to use in Dropbox APIs when referencing the Paper Doc. + @objc + public var fileId: String { swift.fileId } + /// The current doc revision. + @objc + public var paperRevision: NSNumber { swift.paperRevision as NSNumber } + + @objc + public init(url: String, resultPath: String, fileId: String, paperRevision: NSNumber) { + self.swift = Files.PaperCreateResult(url: url, resultPath: resultPath, fileId: fileId, paperRevision: paperRevision.int64Value) + } + + let swift: Files.PaperCreateResult + + public init(swift: Files.PaperCreateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocUpdatePolicy union +@objc +public class DBXFilesPaperDocUpdatePolicy: NSObject { + let swift: Files.PaperDocUpdatePolicy + + public init(swift: Files.PaperDocUpdatePolicy) { + self.swift = swift + } + + public static func factory(swift: Files.PaperDocUpdatePolicy) -> DBXFilesPaperDocUpdatePolicy { + switch swift { + case .update: + return DBXFilesPaperDocUpdatePolicyUpdate() + case .overwrite: + return DBXFilesPaperDocUpdatePolicyOverwrite() + case .prepend: + return DBXFilesPaperDocUpdatePolicyPrepend() + case .append: + return DBXFilesPaperDocUpdatePolicyAppend() + case .other: + return DBXFilesPaperDocUpdatePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUpdate: DBXFilesPaperDocUpdatePolicyUpdate? { + self as? DBXFilesPaperDocUpdatePolicyUpdate + } + + @objc + public var asOverwrite: DBXFilesPaperDocUpdatePolicyOverwrite? { + self as? DBXFilesPaperDocUpdatePolicyOverwrite + } + + @objc + public var asPrepend: DBXFilesPaperDocUpdatePolicyPrepend? { + self as? DBXFilesPaperDocUpdatePolicyPrepend + } + + @objc + public var asAppend: DBXFilesPaperDocUpdatePolicyAppend? { + self as? DBXFilesPaperDocUpdatePolicyAppend + } + + @objc + public var asOther: DBXFilesPaperDocUpdatePolicyOther? { + self as? DBXFilesPaperDocUpdatePolicyOther + } +} + +/// Sets the doc content to the provided content if the provided paper_revision matches the latest doc revision. +/// Otherwise, returns an error. +@objc +public class DBXFilesPaperDocUpdatePolicyUpdate: DBXFilesPaperDocUpdatePolicy { + @objc + public init() { + let swift = Files.PaperDocUpdatePolicy.update + super.init(swift: swift) + } +} + +/// Sets the doc content to the provided content without checking paper_revision. +@objc +public class DBXFilesPaperDocUpdatePolicyOverwrite: DBXFilesPaperDocUpdatePolicy { + @objc + public init() { + let swift = Files.PaperDocUpdatePolicy.overwrite + super.init(swift: swift) + } +} + +/// Adds the provided content to the beginning of the doc without checking paper_revision. +@objc +public class DBXFilesPaperDocUpdatePolicyPrepend: DBXFilesPaperDocUpdatePolicy { + @objc + public init() { + let swift = Files.PaperDocUpdatePolicy.prepend + super.init(swift: swift) + } +} + +/// Adds the provided content to the end of the doc without checking paper_revision. +@objc +public class DBXFilesPaperDocUpdatePolicyAppend: DBXFilesPaperDocUpdatePolicy { + @objc + public init() { + let swift = Files.PaperDocUpdatePolicy.append + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesPaperDocUpdatePolicyOther: DBXFilesPaperDocUpdatePolicy { + @objc + public init() { + let swift = Files.PaperDocUpdatePolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperUpdateArg struct +@objc +public class DBXFilesPaperUpdateArg: NSObject { + /// Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will be returned. + @objc + public var path: String { swift.path } + /// The format of the provided data. + @objc + public var importFormat: DBXFilesImportFormat { DBXFilesImportFormat(swift: swift.importFormat) } + /// How the provided content should be applied to the doc. + @objc + public var docUpdatePolicy: DBXFilesPaperDocUpdatePolicy { DBXFilesPaperDocUpdatePolicy(swift: swift.docUpdatePolicy) } + /// The latest doc revision. Required when doc_update_policy is update. This value must match the current + /// revision of the doc or error revision_mismatch will be returned. + @objc + public var paperRevision: NSNumber? { swift.paperRevision as NSNumber? } + + @objc + public init(path: String, importFormat: DBXFilesImportFormat, docUpdatePolicy: DBXFilesPaperDocUpdatePolicy, paperRevision: NSNumber?) { + self.swift = Files.PaperUpdateArg( + path: path, + importFormat: importFormat.swift, + docUpdatePolicy: docUpdatePolicy.swift, + paperRevision: paperRevision?.int64Value + ) + } + + let swift: Files.PaperUpdateArg + + public init(swift: Files.PaperUpdateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperUpdateError union +@objc +public class DBXFilesPaperUpdateError: NSObject { + let swift: Files.PaperUpdateError + + public init(swift: Files.PaperUpdateError) { + self.swift = swift + } + + public static func factory(swift: Files.PaperUpdateError) -> DBXFilesPaperUpdateError { + switch swift { + case .insufficientPermissions: + return DBXFilesPaperUpdateErrorInsufficientPermissions() + case .contentMalformed: + return DBXFilesPaperUpdateErrorContentMalformed() + case .docLengthExceeded: + return DBXFilesPaperUpdateErrorDocLengthExceeded() + case .imageSizeExceeded: + return DBXFilesPaperUpdateErrorImageSizeExceeded() + case .other: + return DBXFilesPaperUpdateErrorOther() + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesPaperUpdateErrorPath(arg) + case .revisionMismatch: + return DBXFilesPaperUpdateErrorRevisionMismatch() + case .docArchived: + return DBXFilesPaperUpdateErrorDocArchived() + case .docDeleted: + return DBXFilesPaperUpdateErrorDocDeleted() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXFilesPaperUpdateErrorInsufficientPermissions? { + self as? DBXFilesPaperUpdateErrorInsufficientPermissions + } + + @objc + public var asContentMalformed: DBXFilesPaperUpdateErrorContentMalformed? { + self as? DBXFilesPaperUpdateErrorContentMalformed + } + + @objc + public var asDocLengthExceeded: DBXFilesPaperUpdateErrorDocLengthExceeded? { + self as? DBXFilesPaperUpdateErrorDocLengthExceeded + } + + @objc + public var asImageSizeExceeded: DBXFilesPaperUpdateErrorImageSizeExceeded? { + self as? DBXFilesPaperUpdateErrorImageSizeExceeded + } + + @objc + public var asOther: DBXFilesPaperUpdateErrorOther? { + self as? DBXFilesPaperUpdateErrorOther + } + + @objc + public var asPath: DBXFilesPaperUpdateErrorPath? { + self as? DBXFilesPaperUpdateErrorPath + } + + @objc + public var asRevisionMismatch: DBXFilesPaperUpdateErrorRevisionMismatch? { + self as? DBXFilesPaperUpdateErrorRevisionMismatch + } + + @objc + public var asDocArchived: DBXFilesPaperUpdateErrorDocArchived? { + self as? DBXFilesPaperUpdateErrorDocArchived + } + + @objc + public var asDocDeleted: DBXFilesPaperUpdateErrorDocDeleted? { + self as? DBXFilesPaperUpdateErrorDocDeleted + } +} + +/// Your account does not have permissions to edit Paper docs. +@objc +public class DBXFilesPaperUpdateErrorInsufficientPermissions: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.insufficientPermissions + super.init(swift: swift) + } +} + +/// The provided content was malformed and cannot be imported to Paper. +@objc +public class DBXFilesPaperUpdateErrorContentMalformed: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.contentMalformed + super.init(swift: swift) + } +} + +/// The Paper doc would be too large, split the content into multiple docs. +@objc +public class DBXFilesPaperUpdateErrorDocLengthExceeded: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.docLengthExceeded + super.init(swift: swift) + } +} + +/// The imported document contains an image that is too large. The current limit is 1MB. This only applies to +/// HTML with data URI. +@objc +public class DBXFilesPaperUpdateErrorImageSizeExceeded: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.imageSizeExceeded + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesPaperUpdateErrorOther: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.other + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesPaperUpdateErrorPath: DBXFilesPaperUpdateError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.PaperUpdateError.path(arg.swift) + super.init(swift: swift) + } +} + +/// The provided revision does not match the document head. +@objc +public class DBXFilesPaperUpdateErrorRevisionMismatch: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.revisionMismatch + super.init(swift: swift) + } +} + +/// This operation is not allowed on archived Paper docs. +@objc +public class DBXFilesPaperUpdateErrorDocArchived: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.docArchived + super.init(swift: swift) + } +} + +/// This operation is not allowed on deleted Paper docs. +@objc +public class DBXFilesPaperUpdateErrorDocDeleted: DBXFilesPaperUpdateError { + @objc + public init() { + let swift = Files.PaperUpdateError.docDeleted + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperUpdateResult struct +@objc +public class DBXFilesPaperUpdateResult: NSObject { + /// The current doc revision. + @objc + public var paperRevision: NSNumber { swift.paperRevision as NSNumber } + + @objc + public init(paperRevision: NSNumber) { + self.swift = Files.PaperUpdateResult(paperRevision: paperRevision.int64Value) + } + + let swift: Files.PaperUpdateResult + + public init(swift: Files.PaperUpdateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PathOrLink union +@objc +public class DBXFilesPathOrLink: NSObject { + let swift: Files.PathOrLink + + public init(swift: Files.PathOrLink) { + self.swift = swift + } + + public static func factory(swift: Files.PathOrLink) -> DBXFilesPathOrLink { + switch swift { + case .path(let swiftArg): + let arg = swiftArg + return DBXFilesPathOrLinkPath(arg) + case .link(let swiftArg): + let arg = DBXFilesSharedLinkFileInfo(swift: swiftArg) + return DBXFilesPathOrLinkLink(arg) + case .other: + return DBXFilesPathOrLinkOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesPathOrLinkPath? { + self as? DBXFilesPathOrLinkPath + } + + @objc + public var asLink: DBXFilesPathOrLinkLink? { + self as? DBXFilesPathOrLinkLink + } + + @objc + public var asOther: DBXFilesPathOrLinkOther? { + self as? DBXFilesPathOrLinkOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesPathOrLinkPath: DBXFilesPathOrLink { + @objc + public var path: String + + @objc + public init(_ arg: String) { + self.path = arg + let swift = Files.PathOrLink.path(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesPathOrLinkLink: DBXFilesPathOrLink { + @objc + public var link: DBXFilesSharedLinkFileInfo + + @objc + public init(_ arg: DBXFilesSharedLinkFileInfo) { + self.link = arg + let swift = Files.PathOrLink.link(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesPathOrLinkOther: DBXFilesPathOrLink { + @objc + public init() { + let swift = Files.PathOrLink.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PathToTags struct +@objc +public class DBXFilesPathToTags: NSObject { + /// Path of the item. + @objc + public var path: String { swift.path } + /// Tags assigned to this item. + @objc + public var tags: [DBXFilesTag] { swift.tags.map { DBXFilesTag(swift: $0) } } + + @objc + public init(path: String, tags: [DBXFilesTag]) { + self.swift = Files.PathToTags(path: path, tags: tags.map(\.swift)) + } + + let swift: Files.PathToTags + + public init(swift: Files.PathToTags) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Metadata for a photo. +@objc +public class DBXFilesPhotoMetadata: DBXFilesMediaMetadata { + let subSwift: Files.PhotoMetadata + + public init(swift: Files.PhotoMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible PreviewArg struct +@objc +public class DBXFilesPreviewArg: NSObject { + /// The path of the file to preview. + @objc + public var path: String { swift.path } + /// Please specify revision in path instead. + @objc + public var rev: String? { swift.rev } + + @objc + public init(path: String, rev: String?) { + self.swift = Files.PreviewArg(path: path, rev: rev) + } + + let swift: Files.PreviewArg + + public init(swift: Files.PreviewArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PreviewError union +@objc +public class DBXFilesPreviewError: NSObject { + let swift: Files.PreviewError + + public init(swift: Files.PreviewError) { + self.swift = swift + } + + public static func factory(swift: Files.PreviewError) -> DBXFilesPreviewError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesPreviewErrorPath(arg) + case .inProgress: + return DBXFilesPreviewErrorInProgress() + case .unsupportedExtension: + return DBXFilesPreviewErrorUnsupportedExtension() + case .unsupportedContent: + return DBXFilesPreviewErrorUnsupportedContent() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesPreviewErrorPath? { + self as? DBXFilesPreviewErrorPath + } + + @objc + public var asInProgress: DBXFilesPreviewErrorInProgress? { + self as? DBXFilesPreviewErrorInProgress + } + + @objc + public var asUnsupportedExtension: DBXFilesPreviewErrorUnsupportedExtension? { + self as? DBXFilesPreviewErrorUnsupportedExtension + } + + @objc + public var asUnsupportedContent: DBXFilesPreviewErrorUnsupportedContent? { + self as? DBXFilesPreviewErrorUnsupportedContent + } +} + +/// An error occurs when downloading metadata for the file. +@objc +public class DBXFilesPreviewErrorPath: DBXFilesPreviewError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.PreviewError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This preview generation is still in progress and the file is not ready for preview yet. +@objc +public class DBXFilesPreviewErrorInProgress: DBXFilesPreviewError { + @objc + public init() { + let swift = Files.PreviewError.inProgress + super.init(swift: swift) + } +} + +/// The file extension is not supported preview generation. +@objc +public class DBXFilesPreviewErrorUnsupportedExtension: DBXFilesPreviewError { + @objc + public init() { + let swift = Files.PreviewError.unsupportedExtension + super.init(swift: swift) + } +} + +/// The file content is not supported for preview generation. +@objc +public class DBXFilesPreviewErrorUnsupportedContent: DBXFilesPreviewError { + @objc + public init() { + let swift = Files.PreviewError.unsupportedContent + super.init(swift: swift) + } +} + +/// Objective-C compatible PreviewResult struct +@objc +public class DBXFilesPreviewResult: NSObject { + /// Metadata corresponding to the file received as an argument. Will be populated if the endpoint is called with + /// a path (ReadPath). + @objc + public var fileMetadata: DBXFilesFileMetadata? { guard let swift = swift.fileMetadata else { return nil } + return DBXFilesFileMetadata(swift: swift) + } + + /// Minimal metadata corresponding to the file received as an argument. Will be populated if the endpoint is + /// called using a shared link (SharedLinkFileInfo). + @objc + public var linkMetadata: DBXFilesMinimalFileLinkMetadata? { guard let swift = swift.linkMetadata else { return nil } + return DBXFilesMinimalFileLinkMetadata(swift: swift) + } + + @objc + public init(fileMetadata: DBXFilesFileMetadata?, linkMetadata: DBXFilesMinimalFileLinkMetadata?) { + self.swift = Files.PreviewResult(fileMetadata: fileMetadata?.subSwift, linkMetadata: linkMetadata?.swift) + } + + let swift: Files.PreviewResult + + public init(swift: Files.PreviewResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RelocationPath struct +@objc +public class DBXFilesRelocationPath: NSObject { + /// Path in the user's Dropbox to be copied or moved. + @objc + public var fromPath: String { swift.fromPath } + /// Path in the user's Dropbox that is the destination. + @objc + public var toPath: String { swift.toPath } + + @objc + public init(fromPath: String, toPath: String) { + self.swift = Files.RelocationPath(fromPath: fromPath, toPath: toPath) + } + + let swift: Files.RelocationPath + + public init(swift: Files.RelocationPath) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RelocationArg struct +@objc +public class DBXFilesRelocationArg: DBXFilesRelocationPath { + /// This flag has no effect. + @objc + public var allowSharedFolder: NSNumber { subSwift.allowSharedFolder as NSNumber } + /// If there's a conflict, have the Dropbox server try to autorename the file to avoid the conflict. + @objc + public var autorename: NSNumber { subSwift.autorename as NSNumber } + /// Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does + /// not apply to copies. + @objc + public var allowOwnershipTransfer: NSNumber { subSwift.allowOwnershipTransfer as NSNumber } + + @objc + public init(fromPath: String, toPath: String, allowSharedFolder: NSNumber, autorename: NSNumber, allowOwnershipTransfer: NSNumber) { + let swift = Files.RelocationArg( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder.boolValue, + autorename: autorename.boolValue, + allowOwnershipTransfer: allowOwnershipTransfer.boolValue + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.RelocationArg + + public init(swift: Files.RelocationArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible RelocationBatchArg struct +@objc +public class DBXFilesRelocationBatchArg: DBXFilesRelocationBatchArgBase { + /// This flag has no effect. + @objc + public var allowSharedFolder: NSNumber { subSwift.allowSharedFolder as NSNumber } + /// Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does + /// not apply to copies. + @objc + public var allowOwnershipTransfer: NSNumber { subSwift.allowOwnershipTransfer as NSNumber } + + @objc + public init(entries: [DBXFilesRelocationPath], autorename: NSNumber, allowSharedFolder: NSNumber, allowOwnershipTransfer: NSNumber) { + let swift = Files.RelocationBatchArg( + entries: entries.map(\.swift), + autorename: autorename.boolValue, + allowSharedFolder: allowSharedFolder.boolValue, + allowOwnershipTransfer: allowOwnershipTransfer.boolValue + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.RelocationBatchArg + + public init(swift: Files.RelocationBatchArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible RelocationError union +@objc +public class DBXFilesRelocationError: NSObject { + let swift: Files.RelocationError + + public init(swift: Files.RelocationError) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationError) -> DBXFilesRelocationError { + switch swift { + case .fromLookup(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesRelocationErrorFromLookup(arg) + case .fromWrite(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesRelocationErrorFromWrite(arg) + case .to(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesRelocationErrorTo(arg) + case .cantCopySharedFolder: + return DBXFilesRelocationErrorCantCopySharedFolder() + case .cantNestSharedFolder: + return DBXFilesRelocationErrorCantNestSharedFolder() + case .cantMoveFolderIntoItself: + return DBXFilesRelocationErrorCantMoveFolderIntoItself() + case .tooManyFiles: + return DBXFilesRelocationErrorTooManyFiles() + case .duplicatedOrNestedPaths: + return DBXFilesRelocationErrorDuplicatedOrNestedPaths() + case .cantTransferOwnership: + return DBXFilesRelocationErrorCantTransferOwnership() + case .insufficientQuota: + return DBXFilesRelocationErrorInsufficientQuota() + case .internalError: + return DBXFilesRelocationErrorInternalError() + case .cantMoveSharedFolder: + return DBXFilesRelocationErrorCantMoveSharedFolder() + case .cantMoveIntoVault(let swiftArg): + let arg = DBXFilesMoveIntoVaultError(swift: swiftArg) + return DBXFilesRelocationErrorCantMoveIntoVault(arg) + case .cantMoveIntoFamily(let swiftArg): + let arg = DBXFilesMoveIntoFamilyError(swift: swiftArg) + return DBXFilesRelocationErrorCantMoveIntoFamily(arg) + case .other: + return DBXFilesRelocationErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFromLookup: DBXFilesRelocationErrorFromLookup? { + self as? DBXFilesRelocationErrorFromLookup + } + + @objc + public var asFromWrite: DBXFilesRelocationErrorFromWrite? { + self as? DBXFilesRelocationErrorFromWrite + } + + @objc + public var asTo: DBXFilesRelocationErrorTo? { + self as? DBXFilesRelocationErrorTo + } + + @objc + public var asCantCopySharedFolder: DBXFilesRelocationErrorCantCopySharedFolder? { + self as? DBXFilesRelocationErrorCantCopySharedFolder + } + + @objc + public var asCantNestSharedFolder: DBXFilesRelocationErrorCantNestSharedFolder? { + self as? DBXFilesRelocationErrorCantNestSharedFolder + } + + @objc + public var asCantMoveFolderIntoItself: DBXFilesRelocationErrorCantMoveFolderIntoItself? { + self as? DBXFilesRelocationErrorCantMoveFolderIntoItself + } + + @objc + public var asTooManyFiles: DBXFilesRelocationErrorTooManyFiles? { + self as? DBXFilesRelocationErrorTooManyFiles + } + + @objc + public var asDuplicatedOrNestedPaths: DBXFilesRelocationErrorDuplicatedOrNestedPaths? { + self as? DBXFilesRelocationErrorDuplicatedOrNestedPaths + } + + @objc + public var asCantTransferOwnership: DBXFilesRelocationErrorCantTransferOwnership? { + self as? DBXFilesRelocationErrorCantTransferOwnership + } + + @objc + public var asInsufficientQuota: DBXFilesRelocationErrorInsufficientQuota? { + self as? DBXFilesRelocationErrorInsufficientQuota + } + + @objc + public var asInternalError: DBXFilesRelocationErrorInternalError? { + self as? DBXFilesRelocationErrorInternalError + } + + @objc + public var asCantMoveSharedFolder: DBXFilesRelocationErrorCantMoveSharedFolder? { + self as? DBXFilesRelocationErrorCantMoveSharedFolder + } + + @objc + public var asCantMoveIntoVault: DBXFilesRelocationErrorCantMoveIntoVault? { + self as? DBXFilesRelocationErrorCantMoveIntoVault + } + + @objc + public var asCantMoveIntoFamily: DBXFilesRelocationErrorCantMoveIntoFamily? { + self as? DBXFilesRelocationErrorCantMoveIntoFamily + } + + @objc + public var asOther: DBXFilesRelocationErrorOther? { + self as? DBXFilesRelocationErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationErrorFromLookup: DBXFilesRelocationError { + @objc + public var fromLookup: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.fromLookup = arg + let swift = Files.RelocationError.fromLookup(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationErrorFromWrite: DBXFilesRelocationError { + @objc + public var fromWrite: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.fromWrite = arg + let swift = Files.RelocationError.fromWrite(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationErrorTo: DBXFilesRelocationError { + @objc + public var to: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.to = arg + let swift = Files.RelocationError.to(arg.swift) + super.init(swift: swift) + } +} + +/// Shared folders can't be copied. +@objc +public class DBXFilesRelocationErrorCantCopySharedFolder: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.cantCopySharedFolder + super.init(swift: swift) + } +} + +/// Your move operation would result in nested shared folders. This is not allowed. +@objc +public class DBXFilesRelocationErrorCantNestSharedFolder: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.cantNestSharedFolder + super.init(swift: swift) + } +} + +/// You cannot move a folder into itself. +@objc +public class DBXFilesRelocationErrorCantMoveFolderIntoItself: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.cantMoveFolderIntoItself + super.init(swift: swift) + } +} + +/// The operation would involve more than 10,000 files and folders. +@objc +public class DBXFilesRelocationErrorTooManyFiles: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.tooManyFiles + super.init(swift: swift) + } +} + +/// There are duplicated/nested paths among fromPath in RelocationArg and toPath in RelocationArg. +@objc +public class DBXFilesRelocationErrorDuplicatedOrNestedPaths: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.duplicatedOrNestedPaths + super.init(swift: swift) + } +} + +/// Your move operation would result in an ownership transfer. You may reissue the request with the field +/// allowOwnershipTransfer in RelocationArg to true. +@objc +public class DBXFilesRelocationErrorCantTransferOwnership: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.cantTransferOwnership + super.init(swift: swift) + } +} + +/// The current user does not have enough space to move or copy the files. +@objc +public class DBXFilesRelocationErrorInsufficientQuota: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.insufficientQuota + super.init(swift: swift) + } +} + +/// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking +/// succeeded, and if not, try again. This should happen very rarely. +@objc +public class DBXFilesRelocationErrorInternalError: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.internalError + super.init(swift: swift) + } +} + +/// Can't move the shared folder to the given destination. +@objc +public class DBXFilesRelocationErrorCantMoveSharedFolder: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.cantMoveSharedFolder + super.init(swift: swift) + } +} + +/// Some content cannot be moved into Vault under certain circumstances, see detailed error. +@objc +public class DBXFilesRelocationErrorCantMoveIntoVault: DBXFilesRelocationError { + @objc + public var cantMoveIntoVault: DBXFilesMoveIntoVaultError + + @objc + public init(_ arg: DBXFilesMoveIntoVaultError) { + self.cantMoveIntoVault = arg + let swift = Files.RelocationError.cantMoveIntoVault(arg.swift) + super.init(swift: swift) + } +} + +/// Some content cannot be moved into the Family Room folder under certain circumstances, see detailed error. +@objc +public class DBXFilesRelocationErrorCantMoveIntoFamily: DBXFilesRelocationError { + @objc + public var cantMoveIntoFamily: DBXFilesMoveIntoFamilyError + + @objc + public init(_ arg: DBXFilesMoveIntoFamilyError) { + self.cantMoveIntoFamily = arg + let swift = Files.RelocationError.cantMoveIntoFamily(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationErrorOther: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RelocationBatchError union +@objc +public class DBXFilesRelocationBatchError: NSObject { + let swift: Files.RelocationBatchError + + public init(swift: Files.RelocationBatchError) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationBatchError) -> DBXFilesRelocationBatchError { + switch swift { + case .fromLookup(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesRelocationBatchErrorFromLookup(arg) + case .fromWrite(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesRelocationBatchErrorFromWrite(arg) + case .to(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesRelocationBatchErrorTo(arg) + case .cantCopySharedFolder: + return DBXFilesRelocationBatchErrorCantCopySharedFolder() + case .cantNestSharedFolder: + return DBXFilesRelocationBatchErrorCantNestSharedFolder() + case .cantMoveFolderIntoItself: + return DBXFilesRelocationBatchErrorCantMoveFolderIntoItself() + case .tooManyFiles: + return DBXFilesRelocationBatchErrorTooManyFiles() + case .duplicatedOrNestedPaths: + return DBXFilesRelocationBatchErrorDuplicatedOrNestedPaths() + case .cantTransferOwnership: + return DBXFilesRelocationBatchErrorCantTransferOwnership() + case .insufficientQuota: + return DBXFilesRelocationBatchErrorInsufficientQuota() + case .internalError: + return DBXFilesRelocationBatchErrorInternalError() + case .cantMoveSharedFolder: + return DBXFilesRelocationBatchErrorCantMoveSharedFolder() + case .cantMoveIntoVault(let swiftArg): + let arg = DBXFilesMoveIntoVaultError(swift: swiftArg) + return DBXFilesRelocationBatchErrorCantMoveIntoVault(arg) + case .cantMoveIntoFamily(let swiftArg): + let arg = DBXFilesMoveIntoFamilyError(swift: swiftArg) + return DBXFilesRelocationBatchErrorCantMoveIntoFamily(arg) + case .other: + return DBXFilesRelocationBatchErrorOther() + case .tooManyWriteOperations: + return DBXFilesRelocationBatchErrorTooManyWriteOperations() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFromLookup: DBXFilesRelocationBatchErrorFromLookup? { + self as? DBXFilesRelocationBatchErrorFromLookup + } + + @objc + public var asFromWrite: DBXFilesRelocationBatchErrorFromWrite? { + self as? DBXFilesRelocationBatchErrorFromWrite + } + + @objc + public var asTo: DBXFilesRelocationBatchErrorTo? { + self as? DBXFilesRelocationBatchErrorTo + } + + @objc + public var asCantCopySharedFolder: DBXFilesRelocationBatchErrorCantCopySharedFolder? { + self as? DBXFilesRelocationBatchErrorCantCopySharedFolder + } + + @objc + public var asCantNestSharedFolder: DBXFilesRelocationBatchErrorCantNestSharedFolder? { + self as? DBXFilesRelocationBatchErrorCantNestSharedFolder + } + + @objc + public var asCantMoveFolderIntoItself: DBXFilesRelocationBatchErrorCantMoveFolderIntoItself? { + self as? DBXFilesRelocationBatchErrorCantMoveFolderIntoItself + } + + @objc + public var asTooManyFiles: DBXFilesRelocationBatchErrorTooManyFiles? { + self as? DBXFilesRelocationBatchErrorTooManyFiles + } + + @objc + public var asDuplicatedOrNestedPaths: DBXFilesRelocationBatchErrorDuplicatedOrNestedPaths? { + self as? DBXFilesRelocationBatchErrorDuplicatedOrNestedPaths + } + + @objc + public var asCantTransferOwnership: DBXFilesRelocationBatchErrorCantTransferOwnership? { + self as? DBXFilesRelocationBatchErrorCantTransferOwnership + } + + @objc + public var asInsufficientQuota: DBXFilesRelocationBatchErrorInsufficientQuota? { + self as? DBXFilesRelocationBatchErrorInsufficientQuota + } + + @objc + public var asInternalError: DBXFilesRelocationBatchErrorInternalError? { + self as? DBXFilesRelocationBatchErrorInternalError + } + + @objc + public var asCantMoveSharedFolder: DBXFilesRelocationBatchErrorCantMoveSharedFolder? { + self as? DBXFilesRelocationBatchErrorCantMoveSharedFolder + } + + @objc + public var asCantMoveIntoVault: DBXFilesRelocationBatchErrorCantMoveIntoVault? { + self as? DBXFilesRelocationBatchErrorCantMoveIntoVault + } + + @objc + public var asCantMoveIntoFamily: DBXFilesRelocationBatchErrorCantMoveIntoFamily? { + self as? DBXFilesRelocationBatchErrorCantMoveIntoFamily + } + + @objc + public var asOther: DBXFilesRelocationBatchErrorOther? { + self as? DBXFilesRelocationBatchErrorOther + } + + @objc + public var asTooManyWriteOperations: DBXFilesRelocationBatchErrorTooManyWriteOperations? { + self as? DBXFilesRelocationBatchErrorTooManyWriteOperations + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchErrorFromLookup: DBXFilesRelocationBatchError { + @objc + public var fromLookup: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.fromLookup = arg + let swift = Files.RelocationBatchError.fromLookup(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchErrorFromWrite: DBXFilesRelocationBatchError { + @objc + public var fromWrite: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.fromWrite = arg + let swift = Files.RelocationBatchError.fromWrite(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchErrorTo: DBXFilesRelocationBatchError { + @objc + public var to: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.to = arg + let swift = Files.RelocationBatchError.to(arg.swift) + super.init(swift: swift) + } +} + +/// Shared folders can't be copied. +@objc +public class DBXFilesRelocationBatchErrorCantCopySharedFolder: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.cantCopySharedFolder + super.init(swift: swift) + } +} + +/// Your move operation would result in nested shared folders. This is not allowed. +@objc +public class DBXFilesRelocationBatchErrorCantNestSharedFolder: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.cantNestSharedFolder + super.init(swift: swift) + } +} + +/// You cannot move a folder into itself. +@objc +public class DBXFilesRelocationBatchErrorCantMoveFolderIntoItself: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.cantMoveFolderIntoItself + super.init(swift: swift) + } +} + +/// The operation would involve more than 10,000 files and folders. +@objc +public class DBXFilesRelocationBatchErrorTooManyFiles: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.tooManyFiles + super.init(swift: swift) + } +} + +/// There are duplicated/nested paths among fromPath in RelocationArg and toPath in RelocationArg. +@objc +public class DBXFilesRelocationBatchErrorDuplicatedOrNestedPaths: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.duplicatedOrNestedPaths + super.init(swift: swift) + } +} + +/// Your move operation would result in an ownership transfer. You may reissue the request with the field +/// allowOwnershipTransfer in RelocationArg to true. +@objc +public class DBXFilesRelocationBatchErrorCantTransferOwnership: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.cantTransferOwnership + super.init(swift: swift) + } +} + +/// The current user does not have enough space to move or copy the files. +@objc +public class DBXFilesRelocationBatchErrorInsufficientQuota: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.insufficientQuota + super.init(swift: swift) + } +} + +/// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking +/// succeeded, and if not, try again. This should happen very rarely. +@objc +public class DBXFilesRelocationBatchErrorInternalError: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.internalError + super.init(swift: swift) + } +} + +/// Can't move the shared folder to the given destination. +@objc +public class DBXFilesRelocationBatchErrorCantMoveSharedFolder: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.cantMoveSharedFolder + super.init(swift: swift) + } +} + +/// Some content cannot be moved into Vault under certain circumstances, see detailed error. +@objc +public class DBXFilesRelocationBatchErrorCantMoveIntoVault: DBXFilesRelocationBatchError { + @objc + public var cantMoveIntoVault: DBXFilesMoveIntoVaultError + + @objc + public init(_ arg: DBXFilesMoveIntoVaultError) { + self.cantMoveIntoVault = arg + let swift = Files.RelocationBatchError.cantMoveIntoVault(arg.swift) + super.init(swift: swift) + } +} + +/// Some content cannot be moved into the Family Room folder under certain circumstances, see detailed error. +@objc +public class DBXFilesRelocationBatchErrorCantMoveIntoFamily: DBXFilesRelocationBatchError { + @objc + public var cantMoveIntoFamily: DBXFilesMoveIntoFamilyError + + @objc + public init(_ arg: DBXFilesMoveIntoFamilyError) { + self.cantMoveIntoFamily = arg + let swift = Files.RelocationBatchError.cantMoveIntoFamily(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchErrorOther: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.other + super.init(swift: swift) + } +} + +/// There are too many write operations in user's Dropbox. Please retry this request. +@objc +public class DBXFilesRelocationBatchErrorTooManyWriteOperations: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// Objective-C compatible RelocationBatchErrorEntry union +@objc +public class DBXFilesRelocationBatchErrorEntry: NSObject { + let swift: Files.RelocationBatchErrorEntry + + public init(swift: Files.RelocationBatchErrorEntry) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationBatchErrorEntry) -> DBXFilesRelocationBatchErrorEntry { + switch swift { + case .relocationError(let swiftArg): + let arg = DBXFilesRelocationError(swift: swiftArg) + return DBXFilesRelocationBatchErrorEntryRelocationError(arg) + case .internalError: + return DBXFilesRelocationBatchErrorEntryInternalError() + case .tooManyWriteOperations: + return DBXFilesRelocationBatchErrorEntryTooManyWriteOperations() + case .other: + return DBXFilesRelocationBatchErrorEntryOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asRelocationError: DBXFilesRelocationBatchErrorEntryRelocationError? { + self as? DBXFilesRelocationBatchErrorEntryRelocationError + } + + @objc + public var asInternalError: DBXFilesRelocationBatchErrorEntryInternalError? { + self as? DBXFilesRelocationBatchErrorEntryInternalError + } + + @objc + public var asTooManyWriteOperations: DBXFilesRelocationBatchErrorEntryTooManyWriteOperations? { + self as? DBXFilesRelocationBatchErrorEntryTooManyWriteOperations + } + + @objc + public var asOther: DBXFilesRelocationBatchErrorEntryOther? { + self as? DBXFilesRelocationBatchErrorEntryOther + } +} + +/// User errors that retry won't help. +@objc +public class DBXFilesRelocationBatchErrorEntryRelocationError: DBXFilesRelocationBatchErrorEntry { + @objc + public var relocationError: DBXFilesRelocationError + + @objc + public init(_ arg: DBXFilesRelocationError) { + self.relocationError = arg + let swift = Files.RelocationBatchErrorEntry.relocationError(arg.swift) + super.init(swift: swift) + } +} + +/// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking +/// succeeded, and if not, try again. This should happen very rarely. +@objc +public class DBXFilesRelocationBatchErrorEntryInternalError: DBXFilesRelocationBatchErrorEntry { + @objc + public init() { + let swift = Files.RelocationBatchErrorEntry.internalError + super.init(swift: swift) + } +} + +/// There are too many write operations in user's Dropbox. Please retry this request. +@objc +public class DBXFilesRelocationBatchErrorEntryTooManyWriteOperations: DBXFilesRelocationBatchErrorEntry { + @objc + public init() { + let swift = Files.RelocationBatchErrorEntry.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchErrorEntryOther: DBXFilesRelocationBatchErrorEntry { + @objc + public init() { + let swift = Files.RelocationBatchErrorEntry.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RelocationBatchJobStatus union +@objc +public class DBXFilesRelocationBatchJobStatus: NSObject { + let swift: Files.RelocationBatchJobStatus + + public init(swift: Files.RelocationBatchJobStatus) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationBatchJobStatus) -> DBXFilesRelocationBatchJobStatus { + switch swift { + case .inProgress: + return DBXFilesRelocationBatchJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXFilesRelocationBatchResult(swift: swiftArg) + return DBXFilesRelocationBatchJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = DBXFilesRelocationBatchError(swift: swiftArg) + return DBXFilesRelocationBatchJobStatusFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXFilesRelocationBatchJobStatusInProgress? { + self as? DBXFilesRelocationBatchJobStatusInProgress + } + + @objc + public var asComplete: DBXFilesRelocationBatchJobStatusComplete? { + self as? DBXFilesRelocationBatchJobStatusComplete + } + + @objc + public var asFailed: DBXFilesRelocationBatchJobStatusFailed? { + self as? DBXFilesRelocationBatchJobStatusFailed + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXFilesRelocationBatchJobStatusInProgress: DBXFilesRelocationBatchJobStatus { + @objc + public init() { + let swift = Files.RelocationBatchJobStatus.inProgress + super.init(swift: swift) + } +} + +/// The copy or move batch job has finished. +@objc +public class DBXFilesRelocationBatchJobStatusComplete: DBXFilesRelocationBatchJobStatus { + @objc + public var complete: DBXFilesRelocationBatchResult + + @objc + public init(_ arg: DBXFilesRelocationBatchResult) { + self.complete = arg + let swift = Files.RelocationBatchJobStatus.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// The copy or move batch job has failed with exception. +@objc +public class DBXFilesRelocationBatchJobStatusFailed: DBXFilesRelocationBatchJobStatus { + @objc + public var failed: DBXFilesRelocationBatchError + + @objc + public init(_ arg: DBXFilesRelocationBatchError) { + self.failed = arg + let swift = Files.RelocationBatchJobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// Result returned by copyBatch or moveBatch that may either launch an asynchronous job or complete synchronously. +@objc +public class DBXFilesRelocationBatchLaunch: NSObject { + let swift: Files.RelocationBatchLaunch + + public init(swift: Files.RelocationBatchLaunch) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationBatchLaunch) -> DBXFilesRelocationBatchLaunch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXFilesRelocationBatchLaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXFilesRelocationBatchResult(swift: swiftArg) + return DBXFilesRelocationBatchLaunchComplete(arg) + case .other: + return DBXFilesRelocationBatchLaunchOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXFilesRelocationBatchLaunchAsyncJobId? { + self as? DBXFilesRelocationBatchLaunchAsyncJobId + } + + @objc + public var asComplete: DBXFilesRelocationBatchLaunchComplete? { + self as? DBXFilesRelocationBatchLaunchComplete + } + + @objc + public var asOther: DBXFilesRelocationBatchLaunchOther? { + self as? DBXFilesRelocationBatchLaunchOther + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXFilesRelocationBatchLaunchAsyncJobId: DBXFilesRelocationBatchLaunch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Files.RelocationBatchLaunch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchLaunchComplete: DBXFilesRelocationBatchLaunch { + @objc + public var complete: DBXFilesRelocationBatchResult + + @objc + public init(_ arg: DBXFilesRelocationBatchResult) { + self.complete = arg + let swift = Files.RelocationBatchLaunch.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchLaunchOther: DBXFilesRelocationBatchLaunch { + @objc + public init() { + let swift = Files.RelocationBatchLaunch.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RelocationBatchResult struct +@objc +public class DBXFilesRelocationBatchResult: DBXFilesFileOpsResult { + /// (no description) + @objc + public var entries: [DBXFilesRelocationBatchResultData] { subSwift.entries.map { DBXFilesRelocationBatchResultData(swift: $0) } } + + @objc + public init(entries: [DBXFilesRelocationBatchResultData]) { + let swift = Files.RelocationBatchResult(entries: entries.map(\.swift)) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.RelocationBatchResult + + public init(swift: Files.RelocationBatchResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible RelocationBatchResultData struct +@objc +public class DBXFilesRelocationBatchResultData: NSObject { + /// Metadata of the relocated object. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) } + + @objc + public init(metadata: DBXFilesMetadata) { + self.swift = Files.RelocationBatchResultData(metadata: metadata.swift) + } + + let swift: Files.RelocationBatchResultData + + public init(swift: Files.RelocationBatchResultData) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RelocationBatchResultEntry union +@objc +public class DBXFilesRelocationBatchResultEntry: NSObject { + let swift: Files.RelocationBatchResultEntry + + public init(swift: Files.RelocationBatchResultEntry) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationBatchResultEntry) -> DBXFilesRelocationBatchResultEntry { + switch swift { + case .success(let swiftArg): + let arg = DBXFilesMetadata(swift: swiftArg) + return DBXFilesRelocationBatchResultEntrySuccess(arg) + case .failure(let swiftArg): + let arg = DBXFilesRelocationBatchErrorEntry(swift: swiftArg) + return DBXFilesRelocationBatchResultEntryFailure(arg) + case .other: + return DBXFilesRelocationBatchResultEntryOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXFilesRelocationBatchResultEntrySuccess? { + self as? DBXFilesRelocationBatchResultEntrySuccess + } + + @objc + public var asFailure: DBXFilesRelocationBatchResultEntryFailure? { + self as? DBXFilesRelocationBatchResultEntryFailure + } + + @objc + public var asOther: DBXFilesRelocationBatchResultEntryOther? { + self as? DBXFilesRelocationBatchResultEntryOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchResultEntrySuccess: DBXFilesRelocationBatchResultEntry { + @objc + public var success: DBXFilesMetadata + + @objc + public init(_ arg: DBXFilesMetadata) { + self.success = arg + let swift = Files.RelocationBatchResultEntry.success(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchResultEntryFailure: DBXFilesRelocationBatchResultEntry { + @objc + public var failure: DBXFilesRelocationBatchErrorEntry + + @objc + public init(_ arg: DBXFilesRelocationBatchErrorEntry) { + self.failure = arg + let swift = Files.RelocationBatchResultEntry.failure(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchResultEntryOther: DBXFilesRelocationBatchResultEntry { + @objc + public init() { + let swift = Files.RelocationBatchResultEntry.other + super.init(swift: swift) + } +} + +/// Result returned by copyBatchCheckV2 or moveBatchCheckV2 that may either be in progress or completed with result +/// for each entry. +@objc +public class DBXFilesRelocationBatchV2JobStatus: NSObject { + let swift: Files.RelocationBatchV2JobStatus + + public init(swift: Files.RelocationBatchV2JobStatus) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationBatchV2JobStatus) -> DBXFilesRelocationBatchV2JobStatus { + switch swift { + case .inProgress: + return DBXFilesRelocationBatchV2JobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXFilesRelocationBatchV2Result(swift: swiftArg) + return DBXFilesRelocationBatchV2JobStatusComplete(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXFilesRelocationBatchV2JobStatusInProgress? { + self as? DBXFilesRelocationBatchV2JobStatusInProgress + } + + @objc + public var asComplete: DBXFilesRelocationBatchV2JobStatusComplete? { + self as? DBXFilesRelocationBatchV2JobStatusComplete + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXFilesRelocationBatchV2JobStatusInProgress: DBXFilesRelocationBatchV2JobStatus { + @objc + public init() { + let swift = Files.RelocationBatchV2JobStatus.inProgress + super.init(swift: swift) + } +} + +/// The copy or move batch job has finished. +@objc +public class DBXFilesRelocationBatchV2JobStatusComplete: DBXFilesRelocationBatchV2JobStatus { + @objc + public var complete: DBXFilesRelocationBatchV2Result + + @objc + public init(_ arg: DBXFilesRelocationBatchV2Result) { + self.complete = arg + let swift = Files.RelocationBatchV2JobStatus.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// Result returned by copyBatchV2 or moveBatchV2 that may either launch an asynchronous job or complete +/// synchronously. +@objc +public class DBXFilesRelocationBatchV2Launch: NSObject { + let swift: Files.RelocationBatchV2Launch + + public init(swift: Files.RelocationBatchV2Launch) { + self.swift = swift + } + + public static func factory(swift: Files.RelocationBatchV2Launch) -> DBXFilesRelocationBatchV2Launch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXFilesRelocationBatchV2LaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXFilesRelocationBatchV2Result(swift: swiftArg) + return DBXFilesRelocationBatchV2LaunchComplete(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXFilesRelocationBatchV2LaunchAsyncJobId? { + self as? DBXFilesRelocationBatchV2LaunchAsyncJobId + } + + @objc + public var asComplete: DBXFilesRelocationBatchV2LaunchComplete? { + self as? DBXFilesRelocationBatchV2LaunchComplete + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXFilesRelocationBatchV2LaunchAsyncJobId: DBXFilesRelocationBatchV2Launch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Files.RelocationBatchV2Launch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRelocationBatchV2LaunchComplete: DBXFilesRelocationBatchV2Launch { + @objc + public var complete: DBXFilesRelocationBatchV2Result + + @objc + public init(_ arg: DBXFilesRelocationBatchV2Result) { + self.complete = arg + let swift = Files.RelocationBatchV2Launch.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// Objective-C compatible RelocationBatchV2Result struct +@objc +public class DBXFilesRelocationBatchV2Result: DBXFilesFileOpsResult { + /// Each entry in CopyBatchArg.entries or entries in MoveBatchArg will appear at the same position inside + /// entries in RelocationBatchV2Result. + @objc + public var entries: [DBXFilesRelocationBatchResultEntry] { subSwift.entries.map { DBXFilesRelocationBatchResultEntry(swift: $0) } } + + @objc + public init(entries: [DBXFilesRelocationBatchResultEntry]) { + let swift = Files.RelocationBatchV2Result(entries: entries.map(\.swift)) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.RelocationBatchV2Result + + public init(swift: Files.RelocationBatchV2Result) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible RelocationResult struct +@objc +public class DBXFilesRelocationResult: DBXFilesFileOpsResult { + /// Metadata of the relocated object. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: subSwift.metadata) } + + @objc + public init(metadata: DBXFilesMetadata) { + let swift = Files.RelocationResult(metadata: metadata.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.RelocationResult + + public init(swift: Files.RelocationResult) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible RemoveTagArg struct +@objc +public class DBXFilesRemoveTagArg: NSObject { + /// Path to the item to tag. + @objc + public var path: String { swift.path } + /// The tag to remove. Will be automatically converted to lowercase letters. + @objc + public var tagText: String { swift.tagText } + + @objc + public init(path: String, tagText: String) { + self.swift = Files.RemoveTagArg(path: path, tagText: tagText) + } + + let swift: Files.RemoveTagArg + + public init(swift: Files.RemoveTagArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RemoveTagError union +@objc +public class DBXFilesRemoveTagError: NSObject { + let swift: Files.RemoveTagError + + public init(swift: Files.RemoveTagError) { + self.swift = swift + } + + public static func factory(swift: Files.RemoveTagError) -> DBXFilesRemoveTagError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesRemoveTagErrorPath(arg) + case .other: + return DBXFilesRemoveTagErrorOther() + case .tagNotPresent: + return DBXFilesRemoveTagErrorTagNotPresent() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesRemoveTagErrorPath? { + self as? DBXFilesRemoveTagErrorPath + } + + @objc + public var asOther: DBXFilesRemoveTagErrorOther? { + self as? DBXFilesRemoveTagErrorOther + } + + @objc + public var asTagNotPresent: DBXFilesRemoveTagErrorTagNotPresent? { + self as? DBXFilesRemoveTagErrorTagNotPresent + } +} + +/// An unspecified error. +@objc +public class DBXFilesRemoveTagErrorPath: DBXFilesRemoveTagError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.RemoveTagError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRemoveTagErrorOther: DBXFilesRemoveTagError { + @objc + public init() { + let swift = Files.RemoveTagError.other + super.init(swift: swift) + } +} + +/// That tag doesn't exist at this path. +@objc +public class DBXFilesRemoveTagErrorTagNotPresent: DBXFilesRemoveTagError { + @objc + public init() { + let swift = Files.RemoveTagError.tagNotPresent + super.init(swift: swift) + } +} + +/// Objective-C compatible RestoreArg struct +@objc +public class DBXFilesRestoreArg: NSObject { + /// The path to save the restored file. + @objc + public var path: String { swift.path } + /// The revision to restore. + @objc + public var rev: String { swift.rev } + + @objc + public init(path: String, rev: String) { + self.swift = Files.RestoreArg(path: path, rev: rev) + } + + let swift: Files.RestoreArg + + public init(swift: Files.RestoreArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RestoreError union +@objc +public class DBXFilesRestoreError: NSObject { + let swift: Files.RestoreError + + public init(swift: Files.RestoreError) { + self.swift = swift + } + + public static func factory(swift: Files.RestoreError) -> DBXFilesRestoreError { + switch swift { + case .pathLookup(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesRestoreErrorPathLookup(arg) + case .pathWrite(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesRestoreErrorPathWrite(arg) + case .invalidRevision: + return DBXFilesRestoreErrorInvalidRevision() + case .inProgress: + return DBXFilesRestoreErrorInProgress() + case .other: + return DBXFilesRestoreErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPathLookup: DBXFilesRestoreErrorPathLookup? { + self as? DBXFilesRestoreErrorPathLookup + } + + @objc + public var asPathWrite: DBXFilesRestoreErrorPathWrite? { + self as? DBXFilesRestoreErrorPathWrite + } + + @objc + public var asInvalidRevision: DBXFilesRestoreErrorInvalidRevision? { + self as? DBXFilesRestoreErrorInvalidRevision + } + + @objc + public var asInProgress: DBXFilesRestoreErrorInProgress? { + self as? DBXFilesRestoreErrorInProgress + } + + @objc + public var asOther: DBXFilesRestoreErrorOther? { + self as? DBXFilesRestoreErrorOther + } +} + +/// An error occurs when downloading metadata for the file. +@objc +public class DBXFilesRestoreErrorPathLookup: DBXFilesRestoreError { + @objc + public var pathLookup: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.pathLookup = arg + let swift = Files.RestoreError.pathLookup(arg.swift) + super.init(swift: swift) + } +} + +/// An error occurs when trying to restore the file to that path. +@objc +public class DBXFilesRestoreErrorPathWrite: DBXFilesRestoreError { + @objc + public var pathWrite: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.pathWrite = arg + let swift = Files.RestoreError.pathWrite(arg.swift) + super.init(swift: swift) + } +} + +/// The revision is invalid. It may not exist or may point to a deleted file. +@objc +public class DBXFilesRestoreErrorInvalidRevision: DBXFilesRestoreError { + @objc + public init() { + let swift = Files.RestoreError.invalidRevision + super.init(swift: swift) + } +} + +/// The restore is currently executing, but has not yet completed. +@objc +public class DBXFilesRestoreErrorInProgress: DBXFilesRestoreError { + @objc + public init() { + let swift = Files.RestoreError.inProgress + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesRestoreErrorOther: DBXFilesRestoreError { + @objc + public init() { + let swift = Files.RestoreError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SaveCopyReferenceArg struct +@objc +public class DBXFilesSaveCopyReferenceArg: NSObject { + /// A copy reference returned by copyReferenceGet. + @objc + public var copyReference: String { swift.copyReference } + /// Path in the user's Dropbox that is the destination. + @objc + public var path: String { swift.path } + + @objc + public init(copyReference: String, path: String) { + self.swift = Files.SaveCopyReferenceArg(copyReference: copyReference, path: path) + } + + let swift: Files.SaveCopyReferenceArg + + public init(swift: Files.SaveCopyReferenceArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SaveCopyReferenceError union +@objc +public class DBXFilesSaveCopyReferenceError: NSObject { + let swift: Files.SaveCopyReferenceError + + public init(swift: Files.SaveCopyReferenceError) { + self.swift = swift + } + + public static func factory(swift: Files.SaveCopyReferenceError) -> DBXFilesSaveCopyReferenceError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesSaveCopyReferenceErrorPath(arg) + case .invalidCopyReference: + return DBXFilesSaveCopyReferenceErrorInvalidCopyReference() + case .noPermission: + return DBXFilesSaveCopyReferenceErrorNoPermission() + case .notFound: + return DBXFilesSaveCopyReferenceErrorNotFound() + case .tooManyFiles: + return DBXFilesSaveCopyReferenceErrorTooManyFiles() + case .other: + return DBXFilesSaveCopyReferenceErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesSaveCopyReferenceErrorPath? { + self as? DBXFilesSaveCopyReferenceErrorPath + } + + @objc + public var asInvalidCopyReference: DBXFilesSaveCopyReferenceErrorInvalidCopyReference? { + self as? DBXFilesSaveCopyReferenceErrorInvalidCopyReference + } + + @objc + public var asNoPermission: DBXFilesSaveCopyReferenceErrorNoPermission? { + self as? DBXFilesSaveCopyReferenceErrorNoPermission + } + + @objc + public var asNotFound: DBXFilesSaveCopyReferenceErrorNotFound? { + self as? DBXFilesSaveCopyReferenceErrorNotFound + } + + @objc + public var asTooManyFiles: DBXFilesSaveCopyReferenceErrorTooManyFiles? { + self as? DBXFilesSaveCopyReferenceErrorTooManyFiles + } + + @objc + public var asOther: DBXFilesSaveCopyReferenceErrorOther? { + self as? DBXFilesSaveCopyReferenceErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesSaveCopyReferenceErrorPath: DBXFilesSaveCopyReferenceError { + @objc + public var path: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.path = arg + let swift = Files.SaveCopyReferenceError.path(arg.swift) + super.init(swift: swift) + } +} + +/// The copy reference is invalid. +@objc +public class DBXFilesSaveCopyReferenceErrorInvalidCopyReference: DBXFilesSaveCopyReferenceError { + @objc + public init() { + let swift = Files.SaveCopyReferenceError.invalidCopyReference + super.init(swift: swift) + } +} + +/// You don't have permission to save the given copy reference. Please make sure this app is same app which +/// created the copy reference and the source user is still linked to the app. +@objc +public class DBXFilesSaveCopyReferenceErrorNoPermission: DBXFilesSaveCopyReferenceError { + @objc + public init() { + let swift = Files.SaveCopyReferenceError.noPermission + super.init(swift: swift) + } +} + +/// The file referenced by the copy reference cannot be found. +@objc +public class DBXFilesSaveCopyReferenceErrorNotFound: DBXFilesSaveCopyReferenceError { + @objc + public init() { + let swift = Files.SaveCopyReferenceError.notFound + super.init(swift: swift) + } +} + +/// The operation would involve more than 10,000 files and folders. +@objc +public class DBXFilesSaveCopyReferenceErrorTooManyFiles: DBXFilesSaveCopyReferenceError { + @objc + public init() { + let swift = Files.SaveCopyReferenceError.tooManyFiles + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSaveCopyReferenceErrorOther: DBXFilesSaveCopyReferenceError { + @objc + public init() { + let swift = Files.SaveCopyReferenceError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SaveCopyReferenceResult struct +@objc +public class DBXFilesSaveCopyReferenceResult: NSObject { + /// The metadata of the saved file or folder in the user's Dropbox. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) } + + @objc + public init(metadata: DBXFilesMetadata) { + self.swift = Files.SaveCopyReferenceResult(metadata: metadata.swift) + } + + let swift: Files.SaveCopyReferenceResult + + public init(swift: Files.SaveCopyReferenceResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SaveUrlArg struct +@objc +public class DBXFilesSaveUrlArg: NSObject { + /// The path in Dropbox where the URL will be saved to. + @objc + public var path: String { swift.path } + /// The URL to be saved. + @objc + public var url: String { swift.url } + + @objc + public init(path: String, url: String) { + self.swift = Files.SaveUrlArg(path: path, url: url) + } + + let swift: Files.SaveUrlArg + + public init(swift: Files.SaveUrlArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SaveUrlError union +@objc +public class DBXFilesSaveUrlError: NSObject { + let swift: Files.SaveUrlError + + public init(swift: Files.SaveUrlError) { + self.swift = swift + } + + public static func factory(swift: Files.SaveUrlError) -> DBXFilesSaveUrlError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesSaveUrlErrorPath(arg) + case .downloadFailed: + return DBXFilesSaveUrlErrorDownloadFailed() + case .invalidUrl: + return DBXFilesSaveUrlErrorInvalidUrl() + case .notFound: + return DBXFilesSaveUrlErrorNotFound() + case .other: + return DBXFilesSaveUrlErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesSaveUrlErrorPath? { + self as? DBXFilesSaveUrlErrorPath + } + + @objc + public var asDownloadFailed: DBXFilesSaveUrlErrorDownloadFailed? { + self as? DBXFilesSaveUrlErrorDownloadFailed + } + + @objc + public var asInvalidUrl: DBXFilesSaveUrlErrorInvalidUrl? { + self as? DBXFilesSaveUrlErrorInvalidUrl + } + + @objc + public var asNotFound: DBXFilesSaveUrlErrorNotFound? { + self as? DBXFilesSaveUrlErrorNotFound + } + + @objc + public var asOther: DBXFilesSaveUrlErrorOther? { + self as? DBXFilesSaveUrlErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesSaveUrlErrorPath: DBXFilesSaveUrlError { + @objc + public var path: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.path = arg + let swift = Files.SaveUrlError.path(arg.swift) + super.init(swift: swift) + } +} + +/// Failed downloading the given URL. The URL may be password-protected and the password provided was +/// incorrect, or the link may be disabled. +@objc +public class DBXFilesSaveUrlErrorDownloadFailed: DBXFilesSaveUrlError { + @objc + public init() { + let swift = Files.SaveUrlError.downloadFailed + super.init(swift: swift) + } +} + +/// The given URL is invalid. +@objc +public class DBXFilesSaveUrlErrorInvalidUrl: DBXFilesSaveUrlError { + @objc + public init() { + let swift = Files.SaveUrlError.invalidUrl + super.init(swift: swift) + } +} + +/// The file where the URL is saved to no longer exists. +@objc +public class DBXFilesSaveUrlErrorNotFound: DBXFilesSaveUrlError { + @objc + public init() { + let swift = Files.SaveUrlError.notFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSaveUrlErrorOther: DBXFilesSaveUrlError { + @objc + public init() { + let swift = Files.SaveUrlError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SaveUrlJobStatus union +@objc +public class DBXFilesSaveUrlJobStatus: NSObject { + let swift: Files.SaveUrlJobStatus + + public init(swift: Files.SaveUrlJobStatus) { + self.swift = swift + } + + public static func factory(swift: Files.SaveUrlJobStatus) -> DBXFilesSaveUrlJobStatus { + switch swift { + case .inProgress: + return DBXFilesSaveUrlJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXFilesFileMetadata(swift: swiftArg) + return DBXFilesSaveUrlJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = DBXFilesSaveUrlError(swift: swiftArg) + return DBXFilesSaveUrlJobStatusFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXFilesSaveUrlJobStatusInProgress? { + self as? DBXFilesSaveUrlJobStatusInProgress + } + + @objc + public var asComplete: DBXFilesSaveUrlJobStatusComplete? { + self as? DBXFilesSaveUrlJobStatusComplete + } + + @objc + public var asFailed: DBXFilesSaveUrlJobStatusFailed? { + self as? DBXFilesSaveUrlJobStatusFailed + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXFilesSaveUrlJobStatusInProgress: DBXFilesSaveUrlJobStatus { + @objc + public init() { + let swift = Files.SaveUrlJobStatus.inProgress + super.init(swift: swift) + } +} + +/// Metadata of the file where the URL is saved to. +@objc +public class DBXFilesSaveUrlJobStatusComplete: DBXFilesSaveUrlJobStatus { + @objc + public var complete: DBXFilesFileMetadata + + @objc + public init(_ arg: DBXFilesFileMetadata) { + self.complete = arg + let swift = Files.SaveUrlJobStatus.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSaveUrlJobStatusFailed: DBXFilesSaveUrlJobStatus { + @objc + public var failed: DBXFilesSaveUrlError + + @objc + public init(_ arg: DBXFilesSaveUrlError) { + self.failed = arg + let swift = Files.SaveUrlJobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible SaveUrlResult union +@objc +public class DBXFilesSaveUrlResult: NSObject { + let swift: Files.SaveUrlResult + + public init(swift: Files.SaveUrlResult) { + self.swift = swift + } + + public static func factory(swift: Files.SaveUrlResult) -> DBXFilesSaveUrlResult { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXFilesSaveUrlResultAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXFilesFileMetadata(swift: swiftArg) + return DBXFilesSaveUrlResultComplete(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXFilesSaveUrlResultAsyncJobId? { + self as? DBXFilesSaveUrlResultAsyncJobId + } + + @objc + public var asComplete: DBXFilesSaveUrlResultComplete? { + self as? DBXFilesSaveUrlResultComplete + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXFilesSaveUrlResultAsyncJobId: DBXFilesSaveUrlResult { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Files.SaveUrlResult.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// Metadata of the file where the URL is saved to. +@objc +public class DBXFilesSaveUrlResultComplete: DBXFilesSaveUrlResult { + @objc + public var complete: DBXFilesFileMetadata + + @objc + public init(_ arg: DBXFilesFileMetadata) { + self.complete = arg + let swift = Files.SaveUrlResult.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// Objective-C compatible SearchArg struct +@objc +public class DBXFilesSearchArg: NSObject { + /// The path in the user's Dropbox to search. Should probably be a folder. + @objc + public var path: String { swift.path } + /// The string to search for. Query string may be rewritten to improve relevance of results. The string is split + /// on spaces into multiple tokens. For file name searching, the last token is used for prefix matching + /// (i.e. "bat c" matches "bat cave" but not "batman car"). + @objc + public var query: String { swift.query } + /// The starting index within the search results (used for paging). + @objc + public var start: NSNumber { swift.start as NSNumber } + /// The maximum number of search results to return. + @objc + public var maxResults: NSNumber { swift.maxResults as NSNumber } + /// The search mode (filename, filename_and_content, or deleted_filename). Note that searching file content is + /// only available for Dropbox Business accounts. + @objc + public var mode: DBXFilesSearchMode { DBXFilesSearchMode(swift: swift.mode) } + + @objc + public init(path: String, query: String, start: NSNumber, maxResults: NSNumber, mode: DBXFilesSearchMode) { + self.swift = Files.SearchArg(path: path, query: query, start: start.uint64Value, maxResults: maxResults.uint64Value, mode: mode.swift) + } + + let swift: Files.SearchArg + + public init(swift: Files.SearchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SearchError union +@objc +public class DBXFilesSearchError: NSObject { + let swift: Files.SearchError + + public init(swift: Files.SearchError) { + self.swift = swift + } + + public static func factory(swift: Files.SearchError) -> DBXFilesSearchError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesSearchErrorPath(arg) + case .invalidArgument(let swiftArg): + let arg = swiftArg + return DBXFilesSearchErrorInvalidArgument(arg) + case .internalError: + return DBXFilesSearchErrorInternalError() + case .other: + return DBXFilesSearchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesSearchErrorPath? { + self as? DBXFilesSearchErrorPath + } + + @objc + public var asInvalidArgument: DBXFilesSearchErrorInvalidArgument? { + self as? DBXFilesSearchErrorInvalidArgument + } + + @objc + public var asInternalError: DBXFilesSearchErrorInternalError? { + self as? DBXFilesSearchErrorInternalError + } + + @objc + public var asOther: DBXFilesSearchErrorOther? { + self as? DBXFilesSearchErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesSearchErrorPath: DBXFilesSearchError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.SearchError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSearchErrorInvalidArgument: DBXFilesSearchError { + @objc + public var invalidArgument: String? + + @objc + public init(_ arg: String?) { + self.invalidArgument = arg + let swift = Files.SearchError.invalidArgument(arg) + super.init(swift: swift) + } +} + +/// Something went wrong, please try again. +@objc +public class DBXFilesSearchErrorInternalError: DBXFilesSearchError { + @objc + public init() { + let swift = Files.SearchError.internalError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSearchErrorOther: DBXFilesSearchError { + @objc + public init() { + let swift = Files.SearchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SearchMatch struct +@objc +public class DBXFilesSearchMatch: NSObject { + /// The type of the match. + @objc + public var matchType: DBXFilesSearchMatchType { DBXFilesSearchMatchType(swift: swift.matchType) } + /// The metadata for the matched file or folder. + @objc + public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) } + + @objc + public init(matchType: DBXFilesSearchMatchType, metadata: DBXFilesMetadata) { + self.swift = Files.SearchMatch(matchType: matchType.swift, metadata: metadata.swift) + } + + let swift: Files.SearchMatch + + public init(swift: Files.SearchMatch) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SearchMatchFieldOptions struct +@objc +public class DBXFilesSearchMatchFieldOptions: NSObject { + /// Whether to include highlight span from file title. + @objc + public var includeHighlights: NSNumber { swift.includeHighlights as NSNumber } + + @objc + public init(includeHighlights: NSNumber) { + self.swift = Files.SearchMatchFieldOptions(includeHighlights: includeHighlights.boolValue) + } + + let swift: Files.SearchMatchFieldOptions + + public init(swift: Files.SearchMatchFieldOptions) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Indicates what type of match was found for a given item. +@objc +public class DBXFilesSearchMatchType: NSObject { + let swift: Files.SearchMatchType + + public init(swift: Files.SearchMatchType) { + self.swift = swift + } + + public static func factory(swift: Files.SearchMatchType) -> DBXFilesSearchMatchType { + switch swift { + case .filename: + return DBXFilesSearchMatchTypeFilename() + case .content: + return DBXFilesSearchMatchTypeContent() + case .both: + return DBXFilesSearchMatchTypeBoth() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFilename: DBXFilesSearchMatchTypeFilename? { + self as? DBXFilesSearchMatchTypeFilename + } + + @objc + public var asContent: DBXFilesSearchMatchTypeContent? { + self as? DBXFilesSearchMatchTypeContent + } + + @objc + public var asBoth: DBXFilesSearchMatchTypeBoth? { + self as? DBXFilesSearchMatchTypeBoth + } +} + +/// This item was matched on its file or folder name. +@objc +public class DBXFilesSearchMatchTypeFilename: DBXFilesSearchMatchType { + @objc + public init() { + let swift = Files.SearchMatchType.filename + super.init(swift: swift) + } +} + +/// This item was matched based on its file contents. +@objc +public class DBXFilesSearchMatchTypeContent: DBXFilesSearchMatchType { + @objc + public init() { + let swift = Files.SearchMatchType.content + super.init(swift: swift) + } +} + +/// This item was matched based on both its contents and its file name. +@objc +public class DBXFilesSearchMatchTypeBoth: DBXFilesSearchMatchType { + @objc + public init() { + let swift = Files.SearchMatchType.both + super.init(swift: swift) + } +} + +/// Indicates what type of match was found for a given item. +@objc +public class DBXFilesSearchMatchTypeV2: NSObject { + let swift: Files.SearchMatchTypeV2 + + public init(swift: Files.SearchMatchTypeV2) { + self.swift = swift + } + + public static func factory(swift: Files.SearchMatchTypeV2) -> DBXFilesSearchMatchTypeV2 { + switch swift { + case .filename: + return DBXFilesSearchMatchTypeV2Filename() + case .fileContent: + return DBXFilesSearchMatchTypeV2FileContent() + case .filenameAndContent: + return DBXFilesSearchMatchTypeV2FilenameAndContent() + case .imageContent: + return DBXFilesSearchMatchTypeV2ImageContent() + case .other: + return DBXFilesSearchMatchTypeV2Other() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFilename: DBXFilesSearchMatchTypeV2Filename? { + self as? DBXFilesSearchMatchTypeV2Filename + } + + @objc + public var asFileContent: DBXFilesSearchMatchTypeV2FileContent? { + self as? DBXFilesSearchMatchTypeV2FileContent + } + + @objc + public var asFilenameAndContent: DBXFilesSearchMatchTypeV2FilenameAndContent? { + self as? DBXFilesSearchMatchTypeV2FilenameAndContent + } + + @objc + public var asImageContent: DBXFilesSearchMatchTypeV2ImageContent? { + self as? DBXFilesSearchMatchTypeV2ImageContent + } + + @objc + public var asOther: DBXFilesSearchMatchTypeV2Other? { + self as? DBXFilesSearchMatchTypeV2Other + } +} + +/// This item was matched on its file or folder name. +@objc +public class DBXFilesSearchMatchTypeV2Filename: DBXFilesSearchMatchTypeV2 { + @objc + public init() { + let swift = Files.SearchMatchTypeV2.filename + super.init(swift: swift) + } +} + +/// This item was matched based on its file contents. +@objc +public class DBXFilesSearchMatchTypeV2FileContent: DBXFilesSearchMatchTypeV2 { + @objc + public init() { + let swift = Files.SearchMatchTypeV2.fileContent + super.init(swift: swift) + } +} + +/// This item was matched based on both its contents and its file name. +@objc +public class DBXFilesSearchMatchTypeV2FilenameAndContent: DBXFilesSearchMatchTypeV2 { + @objc + public init() { + let swift = Files.SearchMatchTypeV2.filenameAndContent + super.init(swift: swift) + } +} + +/// This item was matched on image content. +@objc +public class DBXFilesSearchMatchTypeV2ImageContent: DBXFilesSearchMatchTypeV2 { + @objc + public init() { + let swift = Files.SearchMatchTypeV2.imageContent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSearchMatchTypeV2Other: DBXFilesSearchMatchTypeV2 { + @objc + public init() { + let swift = Files.SearchMatchTypeV2.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SearchMatchV2 struct +@objc +public class DBXFilesSearchMatchV2: NSObject { + /// The metadata for the matched file or folder. + @objc + public var metadata: DBXFilesMetadataV2 { DBXFilesMetadataV2(swift: swift.metadata) } + /// The type of the match. + @objc + public var matchType: DBXFilesSearchMatchTypeV2? { guard let swift = swift.matchType else { return nil } + return DBXFilesSearchMatchTypeV2(swift: swift) + } + + /// The list of HighlightSpan determines which parts of the file title should be highlighted. + @objc + public var highlightSpans: [DBXFilesHighlightSpan]? { swift.highlightSpans?.map { DBXFilesHighlightSpan(swift: $0) } } + + @objc + public init(metadata: DBXFilesMetadataV2, matchType: DBXFilesSearchMatchTypeV2?, highlightSpans: [DBXFilesHighlightSpan]?) { + self.swift = Files.SearchMatchV2(metadata: metadata.swift, matchType: matchType?.swift, highlightSpans: highlightSpans?.map(\.swift)) + } + + let swift: Files.SearchMatchV2 + + public init(swift: Files.SearchMatchV2) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SearchMode union +@objc +public class DBXFilesSearchMode: NSObject { + let swift: Files.SearchMode + + public init(swift: Files.SearchMode) { + self.swift = swift + } + + public static func factory(swift: Files.SearchMode) -> DBXFilesSearchMode { + switch swift { + case .filename: + return DBXFilesSearchModeFilename() + case .filenameAndContent: + return DBXFilesSearchModeFilenameAndContent() + case .deletedFilename: + return DBXFilesSearchModeDeletedFilename() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFilename: DBXFilesSearchModeFilename? { + self as? DBXFilesSearchModeFilename + } + + @objc + public var asFilenameAndContent: DBXFilesSearchModeFilenameAndContent? { + self as? DBXFilesSearchModeFilenameAndContent + } + + @objc + public var asDeletedFilename: DBXFilesSearchModeDeletedFilename? { + self as? DBXFilesSearchModeDeletedFilename + } +} + +/// Search file and folder names. +@objc +public class DBXFilesSearchModeFilename: DBXFilesSearchMode { + @objc + public init() { + let swift = Files.SearchMode.filename + super.init(swift: swift) + } +} + +/// Search file and folder names as well as file contents. +@objc +public class DBXFilesSearchModeFilenameAndContent: DBXFilesSearchMode { + @objc + public init() { + let swift = Files.SearchMode.filenameAndContent + super.init(swift: swift) + } +} + +/// Search for deleted file and folder names. +@objc +public class DBXFilesSearchModeDeletedFilename: DBXFilesSearchMode { + @objc + public init() { + let swift = Files.SearchMode.deletedFilename + super.init(swift: swift) + } +} + +/// Objective-C compatible SearchOptions struct +@objc +public class DBXFilesSearchOptions: NSObject { + /// Scopes the search to a path in the user's Dropbox. Searches the entire Dropbox if not specified. + @objc + public var path: String? { swift.path } + /// The maximum number of search results to return. + @objc + public var maxResults: NSNumber { swift.maxResults as NSNumber } + /// Specified property of the order of search results. By default, results are sorted by relevance. + @objc + public var orderBy: DBXFilesSearchOrderBy? { guard let swift = swift.orderBy else { return nil } + return DBXFilesSearchOrderBy(swift: swift) + } + + /// Restricts search to the given file status. + @objc + public var fileStatus: DBXFilesFileStatus { DBXFilesFileStatus(swift: swift.fileStatus) } + /// Restricts search to only match on filenames. + @objc + public var filenameOnly: NSNumber { swift.filenameOnly as NSNumber } + /// Restricts search to only the extensions specified. Only supported for active file search. + @objc + public var fileExtensions: [String]? { swift.fileExtensions } + /// Restricts search to only the file categories specified. Only supported for active file search. + @objc + public var fileCategories: [DBXFilesFileCategory]? { swift.fileCategories?.map { DBXFilesFileCategory(swift: $0) } } + /// Restricts results to the given account id. + @objc + public var accountId: String? { swift.accountId } + + @objc + public init( + path: String?, + maxResults: NSNumber, + orderBy: DBXFilesSearchOrderBy?, + fileStatus: DBXFilesFileStatus, + filenameOnly: NSNumber, + fileExtensions: [String]?, + fileCategories: [DBXFilesFileCategory]?, + accountId: String? + ) { + self.swift = Files.SearchOptions( + path: path, + maxResults: maxResults.uint64Value, + orderBy: orderBy?.swift, + fileStatus: fileStatus.swift, + filenameOnly: filenameOnly.boolValue, + fileExtensions: fileExtensions, + fileCategories: fileCategories?.map(\.swift), + accountId: accountId + ) + } + + let swift: Files.SearchOptions + + public init(swift: Files.SearchOptions) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SearchOrderBy union +@objc +public class DBXFilesSearchOrderBy: NSObject { + let swift: Files.SearchOrderBy + + public init(swift: Files.SearchOrderBy) { + self.swift = swift + } + + public static func factory(swift: Files.SearchOrderBy) -> DBXFilesSearchOrderBy { + switch swift { + case .relevance: + return DBXFilesSearchOrderByRelevance() + case .lastModifiedTime: + return DBXFilesSearchOrderByLastModifiedTime() + case .other: + return DBXFilesSearchOrderByOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asRelevance: DBXFilesSearchOrderByRelevance? { + self as? DBXFilesSearchOrderByRelevance + } + + @objc + public var asLastModifiedTime: DBXFilesSearchOrderByLastModifiedTime? { + self as? DBXFilesSearchOrderByLastModifiedTime + } + + @objc + public var asOther: DBXFilesSearchOrderByOther? { + self as? DBXFilesSearchOrderByOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesSearchOrderByRelevance: DBXFilesSearchOrderBy { + @objc + public init() { + let swift = Files.SearchOrderBy.relevance + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSearchOrderByLastModifiedTime: DBXFilesSearchOrderBy { + @objc + public init() { + let swift = Files.SearchOrderBy.lastModifiedTime + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSearchOrderByOther: DBXFilesSearchOrderBy { + @objc + public init() { + let swift = Files.SearchOrderBy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SearchResult struct +@objc +public class DBXFilesSearchResult: NSObject { + /// A list (possibly empty) of matches for the query. + @objc + public var matches: [DBXFilesSearchMatch] { swift.matches.map { DBXFilesSearchMatch(swift: $0) } } + /// Used for paging. If true, indicates there is another page of results available that can be fetched by + /// calling search again. + @objc + public var more: NSNumber { swift.more as NSNumber } + /// Used for paging. Value to set the start argument to when calling search to fetch the next page of results. + @objc + public var start: NSNumber { swift.start as NSNumber } + + @objc + public init(matches: [DBXFilesSearchMatch], more: NSNumber, start: NSNumber) { + self.swift = Files.SearchResult(matches: matches.map(\.swift), more: more.boolValue, start: start.uint64Value) + } + + let swift: Files.SearchResult + + public init(swift: Files.SearchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SearchV2Arg struct +@objc +public class DBXFilesSearchV2Arg: NSObject { + /// The string to search for. May match across multiple fields based on the request arguments. + @objc + public var query: String { swift.query } + /// Options for more targeted search results. + @objc + public var options: DBXFilesSearchOptions? { guard let swift = swift.options else { return nil } + return DBXFilesSearchOptions(swift: swift) + } + + /// Options for search results match fields. + @objc + public var matchFieldOptions: DBXFilesSearchMatchFieldOptions? { guard let swift = swift.matchFieldOptions else { return nil } + return DBXFilesSearchMatchFieldOptions(swift: swift) + } + + /// Deprecated and moved this option to SearchMatchFieldOptions. + @objc + public var includeHighlights: NSNumber? { swift.includeHighlights as NSNumber? } + + @objc + public init(query: String, options: DBXFilesSearchOptions?, matchFieldOptions: DBXFilesSearchMatchFieldOptions?, includeHighlights: NSNumber?) { + self.swift = Files.SearchV2Arg( + query: query, + options: options?.swift, + matchFieldOptions: matchFieldOptions?.swift, + includeHighlights: includeHighlights?.boolValue + ) + } + + let swift: Files.SearchV2Arg + + public init(swift: Files.SearchV2Arg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SearchV2ContinueArg struct +@objc +public class DBXFilesSearchV2ContinueArg: NSObject { + /// The cursor returned by your last call to searchV2. Used to fetch the next page of results. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Files.SearchV2ContinueArg(cursor: cursor) + } + + let swift: Files.SearchV2ContinueArg + + public init(swift: Files.SearchV2ContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SearchV2Result struct +@objc +public class DBXFilesSearchV2Result: NSObject { + /// A list (possibly empty) of matches for the query. + @objc + public var matches: [DBXFilesSearchMatchV2] { swift.matches.map { DBXFilesSearchMatchV2(swift: $0) } } + /// Used for paging. If true, indicates there is another page of results available that can be fetched by + /// calling searchContinueV2 with the cursor. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + /// Pass the cursor into searchContinueV2 to fetch the next page of results. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(matches: [DBXFilesSearchMatchV2], hasMore: NSNumber, cursor: String?) { + self.swift = Files.SearchV2Result(matches: matches.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Files.SearchV2Result + + public init(swift: Files.SearchV2Result) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLink struct +@objc +public class DBXFilesSharedLink: NSObject { + /// Shared link url. + @objc + public var url: String { swift.url } + /// Password for the shared link. + @objc + public var password: String? { swift.password } + + @objc + public init(url: String, password: String?) { + self.swift = Files.SharedLink(url: url, password: password) + } + + let swift: Files.SharedLink + + public init(swift: Files.SharedLink) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkFileInfo struct +@objc +public class DBXFilesSharedLinkFileInfo: NSObject { + /// The shared link corresponding to either a file or shared link to a folder. If it is for a folder shared + /// link, we use the path param to determine for which file in the folder the view is for. + @objc + public var url: String { swift.url } + /// The path corresponding to a file in a shared link to a folder. Required for shared links to folders. + @objc + public var path: String? { swift.path } + /// Password for the shared link. Required for password-protected shared links to files unless it can be read + /// from a cookie. + @objc + public var password: String? { swift.password } + + @objc + public init(url: String, path: String?, password: String?) { + self.swift = Files.SharedLinkFileInfo(url: url, path: path, password: password) + } + + let swift: Files.SharedLinkFileInfo + + public init(swift: Files.SharedLinkFileInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SingleUserLock struct +@objc +public class DBXFilesSingleUserLock: NSObject { + /// The time the lock was created. + @objc + public var created: Date { swift.created } + /// The account ID of the lock holder if known. + @objc + public var lockHolderAccountId: String { swift.lockHolderAccountId } + /// The id of the team of the account holder if it exists. + @objc + public var lockHolderTeamId: String? { swift.lockHolderTeamId } + + @objc + public init(created: Date, lockHolderAccountId: String, lockHolderTeamId: String?) { + self.swift = Files.SingleUserLock(created: created, lockHolderAccountId: lockHolderAccountId, lockHolderTeamId: lockHolderTeamId) + } + + let swift: Files.SingleUserLock + + public init(swift: Files.SingleUserLock) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SymlinkInfo struct +@objc +public class DBXFilesSymlinkInfo: NSObject { + /// The target this symlink points to. + @objc + public var target: String { swift.target } + + @objc + public init(target: String) { + self.swift = Files.SymlinkInfo(target: target) + } + + let swift: Files.SymlinkInfo + + public init(swift: Files.SymlinkInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SyncSetting union +@objc +public class DBXFilesSyncSetting: NSObject { + let swift: Files.SyncSetting + + public init(swift: Files.SyncSetting) { + self.swift = swift + } + + public static func factory(swift: Files.SyncSetting) -> DBXFilesSyncSetting { + switch swift { + case .default_: + return DBXFilesSyncSettingDefault_() + case .notSynced: + return DBXFilesSyncSettingNotSynced() + case .notSyncedInactive: + return DBXFilesSyncSettingNotSyncedInactive() + case .other: + return DBXFilesSyncSettingOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXFilesSyncSettingDefault_? { + self as? DBXFilesSyncSettingDefault_ + } + + @objc + public var asNotSynced: DBXFilesSyncSettingNotSynced? { + self as? DBXFilesSyncSettingNotSynced + } + + @objc + public var asNotSyncedInactive: DBXFilesSyncSettingNotSyncedInactive? { + self as? DBXFilesSyncSettingNotSyncedInactive + } + + @objc + public var asOther: DBXFilesSyncSettingOther? { + self as? DBXFilesSyncSettingOther + } +} + +/// On first sync to members' computers, the specified folder will follow its parent folder's setting or +/// otherwise follow default sync behavior. +@objc +public class DBXFilesSyncSettingDefault_: DBXFilesSyncSetting { + @objc + public init() { + let swift = Files.SyncSetting.default_ + super.init(swift: swift) + } +} + +/// On first sync to members' computers, the specified folder will be set to not sync with selective sync. +@objc +public class DBXFilesSyncSettingNotSynced: DBXFilesSyncSetting { + @objc + public init() { + let swift = Files.SyncSetting.notSynced + super.init(swift: swift) + } +} + +/// The specified folder's not_synced setting is inactive due to its location or other configuration changes. It +/// will follow its parent folder's setting. +@objc +public class DBXFilesSyncSettingNotSyncedInactive: DBXFilesSyncSetting { + @objc + public init() { + let swift = Files.SyncSetting.notSyncedInactive + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSyncSettingOther: DBXFilesSyncSetting { + @objc + public init() { + let swift = Files.SyncSetting.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SyncSettingArg union +@objc +public class DBXFilesSyncSettingArg: NSObject { + let swift: Files.SyncSettingArg + + public init(swift: Files.SyncSettingArg) { + self.swift = swift + } + + public static func factory(swift: Files.SyncSettingArg) -> DBXFilesSyncSettingArg { + switch swift { + case .default_: + return DBXFilesSyncSettingArgDefault_() + case .notSynced: + return DBXFilesSyncSettingArgNotSynced() + case .other: + return DBXFilesSyncSettingArgOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXFilesSyncSettingArgDefault_? { + self as? DBXFilesSyncSettingArgDefault_ + } + + @objc + public var asNotSynced: DBXFilesSyncSettingArgNotSynced? { + self as? DBXFilesSyncSettingArgNotSynced + } + + @objc + public var asOther: DBXFilesSyncSettingArgOther? { + self as? DBXFilesSyncSettingArgOther + } +} + +/// On first sync to members' computers, the specified folder will follow its parent folder's setting or +/// otherwise follow default sync behavior. +@objc +public class DBXFilesSyncSettingArgDefault_: DBXFilesSyncSettingArg { + @objc + public init() { + let swift = Files.SyncSettingArg.default_ + super.init(swift: swift) + } +} + +/// On first sync to members' computers, the specified folder will be set to not sync with selective sync. +@objc +public class DBXFilesSyncSettingArgNotSynced: DBXFilesSyncSettingArg { + @objc + public init() { + let swift = Files.SyncSettingArg.notSynced + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSyncSettingArgOther: DBXFilesSyncSettingArg { + @objc + public init() { + let swift = Files.SyncSettingArg.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SyncSettingsError union +@objc +public class DBXFilesSyncSettingsError: NSObject { + let swift: Files.SyncSettingsError + + public init(swift: Files.SyncSettingsError) { + self.swift = swift + } + + public static func factory(swift: Files.SyncSettingsError) -> DBXFilesSyncSettingsError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesSyncSettingsErrorPath(arg) + case .unsupportedCombination: + return DBXFilesSyncSettingsErrorUnsupportedCombination() + case .unsupportedConfiguration: + return DBXFilesSyncSettingsErrorUnsupportedConfiguration() + case .other: + return DBXFilesSyncSettingsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesSyncSettingsErrorPath? { + self as? DBXFilesSyncSettingsErrorPath + } + + @objc + public var asUnsupportedCombination: DBXFilesSyncSettingsErrorUnsupportedCombination? { + self as? DBXFilesSyncSettingsErrorUnsupportedCombination + } + + @objc + public var asUnsupportedConfiguration: DBXFilesSyncSettingsErrorUnsupportedConfiguration? { + self as? DBXFilesSyncSettingsErrorUnsupportedConfiguration + } + + @objc + public var asOther: DBXFilesSyncSettingsErrorOther? { + self as? DBXFilesSyncSettingsErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXFilesSyncSettingsErrorPath: DBXFilesSyncSettingsError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.SyncSettingsError.path(arg.swift) + super.init(swift: swift) + } +} + +/// Setting this combination of sync settings simultaneously is not supported. +@objc +public class DBXFilesSyncSettingsErrorUnsupportedCombination: DBXFilesSyncSettingsError { + @objc + public init() { + let swift = Files.SyncSettingsError.unsupportedCombination + super.init(swift: swift) + } +} + +/// The specified configuration is not supported. +@objc +public class DBXFilesSyncSettingsErrorUnsupportedConfiguration: DBXFilesSyncSettingsError { + @objc + public init() { + let swift = Files.SyncSettingsError.unsupportedConfiguration + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesSyncSettingsErrorOther: DBXFilesSyncSettingsError { + @objc + public init() { + let swift = Files.SyncSettingsError.other + super.init(swift: swift) + } +} + +/// Tag that can be added in multiple ways. +@objc +public class DBXFilesTag: NSObject { + let swift: Files.Tag + + public init(swift: Files.Tag) { + self.swift = swift + } + + public static func factory(swift: Files.Tag) -> DBXFilesTag { + switch swift { + case .userGeneratedTag(let swiftArg): + let arg = DBXFilesUserGeneratedTag(swift: swiftArg) + return DBXFilesTagUserGeneratedTag(arg) + case .other: + return DBXFilesTagOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserGeneratedTag: DBXFilesTagUserGeneratedTag? { + self as? DBXFilesTagUserGeneratedTag + } + + @objc + public var asOther: DBXFilesTagOther? { + self as? DBXFilesTagOther + } +} + +/// Tag generated by the user. +@objc +public class DBXFilesTagUserGeneratedTag: DBXFilesTag { + @objc + public var userGeneratedTag: DBXFilesUserGeneratedTag + + @objc + public init(_ arg: DBXFilesUserGeneratedTag) { + self.userGeneratedTag = arg + let swift = Files.Tag.userGeneratedTag(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesTagOther: DBXFilesTag { + @objc + public init() { + let swift = Files.Tag.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ThumbnailArg struct +@objc +public class DBXFilesThumbnailArg: NSObject { + /// The path to the image file you want to thumbnail. + @objc + public var path: String { swift.path } + /// The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg should be + /// preferred, while png is better for screenshots and digital arts. + @objc + public var format: DBXFilesThumbnailFormat { DBXFilesThumbnailFormat(swift: swift.format) } + /// The size for the thumbnail image. + @objc + public var size: DBXFilesThumbnailSize { DBXFilesThumbnailSize(swift: swift.size) } + /// How to resize and crop the image to achieve the desired size. + @objc + public var mode: DBXFilesThumbnailMode { DBXFilesThumbnailMode(swift: swift.mode) } + + @objc + public init(path: String, format: DBXFilesThumbnailFormat, size: DBXFilesThumbnailSize, mode: DBXFilesThumbnailMode) { + self.swift = Files.ThumbnailArg(path: path, format: format.swift, size: size.swift, mode: mode.swift) + } + + let swift: Files.ThumbnailArg + + public init(swift: Files.ThumbnailArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ThumbnailError union +@objc +public class DBXFilesThumbnailError: NSObject { + let swift: Files.ThumbnailError + + public init(swift: Files.ThumbnailError) { + self.swift = swift + } + + public static func factory(swift: Files.ThumbnailError) -> DBXFilesThumbnailError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesThumbnailErrorPath(arg) + case .unsupportedExtension: + return DBXFilesThumbnailErrorUnsupportedExtension() + case .unsupportedImage: + return DBXFilesThumbnailErrorUnsupportedImage() + case .conversionError: + return DBXFilesThumbnailErrorConversionError() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesThumbnailErrorPath? { + self as? DBXFilesThumbnailErrorPath + } + + @objc + public var asUnsupportedExtension: DBXFilesThumbnailErrorUnsupportedExtension? { + self as? DBXFilesThumbnailErrorUnsupportedExtension + } + + @objc + public var asUnsupportedImage: DBXFilesThumbnailErrorUnsupportedImage? { + self as? DBXFilesThumbnailErrorUnsupportedImage + } + + @objc + public var asConversionError: DBXFilesThumbnailErrorConversionError? { + self as? DBXFilesThumbnailErrorConversionError + } +} + +/// An error occurs when downloading metadata for the image. +@objc +public class DBXFilesThumbnailErrorPath: DBXFilesThumbnailError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.ThumbnailError.path(arg.swift) + super.init(swift: swift) + } +} + +/// The file extension doesn't allow conversion to a thumbnail. +@objc +public class DBXFilesThumbnailErrorUnsupportedExtension: DBXFilesThumbnailError { + @objc + public init() { + let swift = Files.ThumbnailError.unsupportedExtension + super.init(swift: swift) + } +} + +/// The image cannot be converted to a thumbnail. +@objc +public class DBXFilesThumbnailErrorUnsupportedImage: DBXFilesThumbnailError { + @objc + public init() { + let swift = Files.ThumbnailError.unsupportedImage + super.init(swift: swift) + } +} + +/// An error occurs during thumbnail conversion. +@objc +public class DBXFilesThumbnailErrorConversionError: DBXFilesThumbnailError { + @objc + public init() { + let swift = Files.ThumbnailError.conversionError + super.init(swift: swift) + } +} + +/// Objective-C compatible ThumbnailFormat union +@objc +public class DBXFilesThumbnailFormat: NSObject { + let swift: Files.ThumbnailFormat + + public init(swift: Files.ThumbnailFormat) { + self.swift = swift + } + + public static func factory(swift: Files.ThumbnailFormat) -> DBXFilesThumbnailFormat { + switch swift { + case .jpeg: + return DBXFilesThumbnailFormatJpeg() + case .png: + return DBXFilesThumbnailFormatPng() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asJpeg: DBXFilesThumbnailFormatJpeg? { + self as? DBXFilesThumbnailFormatJpeg + } + + @objc + public var asPng: DBXFilesThumbnailFormatPng? { + self as? DBXFilesThumbnailFormatPng + } +} + +/// An unspecified error. +@objc +public class DBXFilesThumbnailFormatJpeg: DBXFilesThumbnailFormat { + @objc + public init() { + let swift = Files.ThumbnailFormat.jpeg + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesThumbnailFormatPng: DBXFilesThumbnailFormat { + @objc + public init() { + let swift = Files.ThumbnailFormat.png + super.init(swift: swift) + } +} + +/// Objective-C compatible ThumbnailMode union +@objc +public class DBXFilesThumbnailMode: NSObject { + let swift: Files.ThumbnailMode + + public init(swift: Files.ThumbnailMode) { + self.swift = swift + } + + public static func factory(swift: Files.ThumbnailMode) -> DBXFilesThumbnailMode { + switch swift { + case .strict: + return DBXFilesThumbnailModeStrict() + case .bestfit: + return DBXFilesThumbnailModeBestfit() + case .fitoneBestfit: + return DBXFilesThumbnailModeFitoneBestfit() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asStrict: DBXFilesThumbnailModeStrict? { + self as? DBXFilesThumbnailModeStrict + } + + @objc + public var asBestfit: DBXFilesThumbnailModeBestfit? { + self as? DBXFilesThumbnailModeBestfit + } + + @objc + public var asFitoneBestfit: DBXFilesThumbnailModeFitoneBestfit? { + self as? DBXFilesThumbnailModeFitoneBestfit + } +} + +/// Scale down the image to fit within the given size. +@objc +public class DBXFilesThumbnailModeStrict: DBXFilesThumbnailMode { + @objc + public init() { + let swift = Files.ThumbnailMode.strict + super.init(swift: swift) + } +} + +/// Scale down the image to fit within the given size or its transpose. +@objc +public class DBXFilesThumbnailModeBestfit: DBXFilesThumbnailMode { + @objc + public init() { + let swift = Files.ThumbnailMode.bestfit + super.init(swift: swift) + } +} + +/// Scale down the image to completely cover the given size or its transpose. +@objc +public class DBXFilesThumbnailModeFitoneBestfit: DBXFilesThumbnailMode { + @objc + public init() { + let swift = Files.ThumbnailMode.fitoneBestfit + super.init(swift: swift) + } +} + +/// Objective-C compatible ThumbnailSize union +@objc +public class DBXFilesThumbnailSize: NSObject { + let swift: Files.ThumbnailSize + + public init(swift: Files.ThumbnailSize) { + self.swift = swift + } + + public static func factory(swift: Files.ThumbnailSize) -> DBXFilesThumbnailSize { + switch swift { + case .w32h32: + return DBXFilesThumbnailSizeW32h32() + case .w64h64: + return DBXFilesThumbnailSizeW64h64() + case .w128h128: + return DBXFilesThumbnailSizeW128h128() + case .w256h256: + return DBXFilesThumbnailSizeW256h256() + case .w480h320: + return DBXFilesThumbnailSizeW480h320() + case .w640h480: + return DBXFilesThumbnailSizeW640h480() + case .w960h640: + return DBXFilesThumbnailSizeW960h640() + case .w1024h768: + return DBXFilesThumbnailSizeW1024h768() + case .w2048h1536: + return DBXFilesThumbnailSizeW2048h1536() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asW32h32: DBXFilesThumbnailSizeW32h32? { + self as? DBXFilesThumbnailSizeW32h32 + } + + @objc + public var asW64h64: DBXFilesThumbnailSizeW64h64? { + self as? DBXFilesThumbnailSizeW64h64 + } + + @objc + public var asW128h128: DBXFilesThumbnailSizeW128h128? { + self as? DBXFilesThumbnailSizeW128h128 + } + + @objc + public var asW256h256: DBXFilesThumbnailSizeW256h256? { + self as? DBXFilesThumbnailSizeW256h256 + } + + @objc + public var asW480h320: DBXFilesThumbnailSizeW480h320? { + self as? DBXFilesThumbnailSizeW480h320 + } + + @objc + public var asW640h480: DBXFilesThumbnailSizeW640h480? { + self as? DBXFilesThumbnailSizeW640h480 + } + + @objc + public var asW960h640: DBXFilesThumbnailSizeW960h640? { + self as? DBXFilesThumbnailSizeW960h640 + } + + @objc + public var asW1024h768: DBXFilesThumbnailSizeW1024h768? { + self as? DBXFilesThumbnailSizeW1024h768 + } + + @objc + public var asW2048h1536: DBXFilesThumbnailSizeW2048h1536? { + self as? DBXFilesThumbnailSizeW2048h1536 + } +} + +/// 32 by 32 px. +@objc +public class DBXFilesThumbnailSizeW32h32: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w32h32 + super.init(swift: swift) + } +} + +/// 64 by 64 px. +@objc +public class DBXFilesThumbnailSizeW64h64: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w64h64 + super.init(swift: swift) + } +} + +/// 128 by 128 px. +@objc +public class DBXFilesThumbnailSizeW128h128: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w128h128 + super.init(swift: swift) + } +} + +/// 256 by 256 px. +@objc +public class DBXFilesThumbnailSizeW256h256: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w256h256 + super.init(swift: swift) + } +} + +/// 480 by 320 px. +@objc +public class DBXFilesThumbnailSizeW480h320: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w480h320 + super.init(swift: swift) + } +} + +/// 640 by 480 px. +@objc +public class DBXFilesThumbnailSizeW640h480: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w640h480 + super.init(swift: swift) + } +} + +/// 960 by 640 px. +@objc +public class DBXFilesThumbnailSizeW960h640: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w960h640 + super.init(swift: swift) + } +} + +/// 1024 by 768 px. +@objc +public class DBXFilesThumbnailSizeW1024h768: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w1024h768 + super.init(swift: swift) + } +} + +/// 2048 by 1536 px. +@objc +public class DBXFilesThumbnailSizeW2048h1536: DBXFilesThumbnailSize { + @objc + public init() { + let swift = Files.ThumbnailSize.w2048h1536 + super.init(swift: swift) + } +} + +/// Objective-C compatible ThumbnailV2Arg struct +@objc +public class DBXFilesThumbnailV2Arg: NSObject { + /// Information specifying which file to preview. This could be a path to a file, a shared link pointing to a + /// file, or a shared link pointing to a folder, with a relative path. + @objc + public var resource: DBXFilesPathOrLink { DBXFilesPathOrLink(swift: swift.resource) } + /// The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg should be + /// preferred, while png is better for screenshots and digital arts. + @objc + public var format: DBXFilesThumbnailFormat { DBXFilesThumbnailFormat(swift: swift.format) } + /// The size for the thumbnail image. + @objc + public var size: DBXFilesThumbnailSize { DBXFilesThumbnailSize(swift: swift.size) } + /// How to resize and crop the image to achieve the desired size. + @objc + public var mode: DBXFilesThumbnailMode { DBXFilesThumbnailMode(swift: swift.mode) } + + @objc + public init(resource: DBXFilesPathOrLink, format: DBXFilesThumbnailFormat, size: DBXFilesThumbnailSize, mode: DBXFilesThumbnailMode) { + self.swift = Files.ThumbnailV2Arg(resource: resource.swift, format: format.swift, size: size.swift, mode: mode.swift) + } + + let swift: Files.ThumbnailV2Arg + + public init(swift: Files.ThumbnailV2Arg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ThumbnailV2Error union +@objc +public class DBXFilesThumbnailV2Error: NSObject { + let swift: Files.ThumbnailV2Error + + public init(swift: Files.ThumbnailV2Error) { + self.swift = swift + } + + public static func factory(swift: Files.ThumbnailV2Error) -> DBXFilesThumbnailV2Error { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXFilesThumbnailV2ErrorPath(arg) + case .unsupportedExtension: + return DBXFilesThumbnailV2ErrorUnsupportedExtension() + case .unsupportedImage: + return DBXFilesThumbnailV2ErrorUnsupportedImage() + case .conversionError: + return DBXFilesThumbnailV2ErrorConversionError() + case .accessDenied: + return DBXFilesThumbnailV2ErrorAccessDenied() + case .notFound: + return DBXFilesThumbnailV2ErrorNotFound() + case .other: + return DBXFilesThumbnailV2ErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesThumbnailV2ErrorPath? { + self as? DBXFilesThumbnailV2ErrorPath + } + + @objc + public var asUnsupportedExtension: DBXFilesThumbnailV2ErrorUnsupportedExtension? { + self as? DBXFilesThumbnailV2ErrorUnsupportedExtension + } + + @objc + public var asUnsupportedImage: DBXFilesThumbnailV2ErrorUnsupportedImage? { + self as? DBXFilesThumbnailV2ErrorUnsupportedImage + } + + @objc + public var asConversionError: DBXFilesThumbnailV2ErrorConversionError? { + self as? DBXFilesThumbnailV2ErrorConversionError + } + + @objc + public var asAccessDenied: DBXFilesThumbnailV2ErrorAccessDenied? { + self as? DBXFilesThumbnailV2ErrorAccessDenied + } + + @objc + public var asNotFound: DBXFilesThumbnailV2ErrorNotFound? { + self as? DBXFilesThumbnailV2ErrorNotFound + } + + @objc + public var asOther: DBXFilesThumbnailV2ErrorOther? { + self as? DBXFilesThumbnailV2ErrorOther + } +} + +/// An error occurred when downloading metadata for the image. +@objc +public class DBXFilesThumbnailV2ErrorPath: DBXFilesThumbnailV2Error { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Files.ThumbnailV2Error.path(arg.swift) + super.init(swift: swift) + } +} + +/// The file extension doesn't allow conversion to a thumbnail. +@objc +public class DBXFilesThumbnailV2ErrorUnsupportedExtension: DBXFilesThumbnailV2Error { + @objc + public init() { + let swift = Files.ThumbnailV2Error.unsupportedExtension + super.init(swift: swift) + } +} + +/// The image cannot be converted to a thumbnail. +@objc +public class DBXFilesThumbnailV2ErrorUnsupportedImage: DBXFilesThumbnailV2Error { + @objc + public init() { + let swift = Files.ThumbnailV2Error.unsupportedImage + super.init(swift: swift) + } +} + +/// An error occurred during thumbnail conversion. +@objc +public class DBXFilesThumbnailV2ErrorConversionError: DBXFilesThumbnailV2Error { + @objc + public init() { + let swift = Files.ThumbnailV2Error.conversionError + super.init(swift: swift) + } +} + +/// Access to this shared link is forbidden. +@objc +public class DBXFilesThumbnailV2ErrorAccessDenied: DBXFilesThumbnailV2Error { + @objc + public init() { + let swift = Files.ThumbnailV2Error.accessDenied + super.init(swift: swift) + } +} + +/// The shared link does not exist. +@objc +public class DBXFilesThumbnailV2ErrorNotFound: DBXFilesThumbnailV2Error { + @objc + public init() { + let swift = Files.ThumbnailV2Error.notFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesThumbnailV2ErrorOther: DBXFilesThumbnailV2Error { + @objc + public init() { + let swift = Files.ThumbnailV2Error.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UnlockFileArg struct +@objc +public class DBXFilesUnlockFileArg: NSObject { + /// Path in the user's Dropbox to a file. + @objc + public var path: String { swift.path } + + @objc + public init(path: String) { + self.swift = Files.UnlockFileArg(path: path) + } + + let swift: Files.UnlockFileArg + + public init(swift: Files.UnlockFileArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UnlockFileBatchArg struct +@objc +public class DBXFilesUnlockFileBatchArg: NSObject { + /// List of 'entries'. Each 'entry' contains a path of the file which will be unlocked. Duplicate path arguments + /// in the batch are considered only once. + @objc + public var entries: [DBXFilesUnlockFileArg] { swift.entries.map { DBXFilesUnlockFileArg(swift: $0) } } + + @objc + public init(entries: [DBXFilesUnlockFileArg]) { + self.swift = Files.UnlockFileBatchArg(entries: entries.map(\.swift)) + } + + let swift: Files.UnlockFileBatchArg + + public init(swift: Files.UnlockFileBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadArg struct +@objc +public class DBXFilesUploadArg: DBXFilesCommitInfo { + /// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this + /// hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + @objc + public var contentHash: String? { subSwift.contentHash } + + @objc + public init( + path: String, + mode: DBXFilesWriteMode, + autorename: NSNumber, + clientModified: Date?, + mute: NSNumber, + propertyGroups: [DBXFilePropertiesPropertyGroup]?, + strictConflict: NSNumber, + contentHash: String? + ) { + let swift = Files.UploadArg( + path: path, + mode: mode.swift, + autorename: autorename.boolValue, + clientModified: clientModified, + mute: mute.boolValue, + propertyGroups: propertyGroups?.map(\.swift), + strictConflict: strictConflict.boolValue, + contentHash: contentHash + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.UploadArg + + public init(swift: Files.UploadArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible UploadError union +@objc +public class DBXFilesUploadError: NSObject { + let swift: Files.UploadError + + public init(swift: Files.UploadError) { + self.swift = swift + } + + public static func factory(swift: Files.UploadError) -> DBXFilesUploadError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesUploadWriteFailed(swift: swiftArg) + return DBXFilesUploadErrorPath(arg) + case .propertiesError(let swiftArg): + let arg = DBXFilePropertiesInvalidPropertyGroupError(swift: swiftArg) + return DBXFilesUploadErrorPropertiesError(arg) + case .payloadTooLarge: + return DBXFilesUploadErrorPayloadTooLarge() + case .contentHashMismatch: + return DBXFilesUploadErrorContentHashMismatch() + case .other: + return DBXFilesUploadErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXFilesUploadErrorPath? { + self as? DBXFilesUploadErrorPath + } + + @objc + public var asPropertiesError: DBXFilesUploadErrorPropertiesError? { + self as? DBXFilesUploadErrorPropertiesError + } + + @objc + public var asPayloadTooLarge: DBXFilesUploadErrorPayloadTooLarge? { + self as? DBXFilesUploadErrorPayloadTooLarge + } + + @objc + public var asContentHashMismatch: DBXFilesUploadErrorContentHashMismatch? { + self as? DBXFilesUploadErrorContentHashMismatch + } + + @objc + public var asOther: DBXFilesUploadErrorOther? { + self as? DBXFilesUploadErrorOther + } +} + +/// Unable to save the uploaded contents to a file. +@objc +public class DBXFilesUploadErrorPath: DBXFilesUploadError { + @objc + public var path: DBXFilesUploadWriteFailed + + @objc + public init(_ arg: DBXFilesUploadWriteFailed) { + self.path = arg + let swift = Files.UploadError.path(arg.swift) + super.init(swift: swift) + } +} + +/// The supplied property group is invalid. The file has uploaded without property groups. +@objc +public class DBXFilesUploadErrorPropertiesError: DBXFilesUploadError { + @objc + public var propertiesError: DBXFilePropertiesInvalidPropertyGroupError + + @objc + public init(_ arg: DBXFilePropertiesInvalidPropertyGroupError) { + self.propertiesError = arg + let swift = Files.UploadError.propertiesError(arg.swift) + super.init(swift: swift) + } +} + +/// The request payload must be at most 150 MB. +@objc +public class DBXFilesUploadErrorPayloadTooLarge: DBXFilesUploadError { + @objc + public init() { + let swift = Files.UploadError.payloadTooLarge + super.init(swift: swift) + } +} + +/// The content received by the Dropbox server in this call does not match the provided content hash. +@objc +public class DBXFilesUploadErrorContentHashMismatch: DBXFilesUploadError { + @objc + public init() { + let swift = Files.UploadError.contentHashMismatch + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadErrorOther: DBXFilesUploadError { + @objc + public init() { + let swift = Files.UploadError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadSessionAppendArg struct +@objc +public class DBXFilesUploadSessionAppendArg: NSObject { + /// Contains the upload session ID and the offset. + @objc + public var cursor: DBXFilesUploadSessionCursor { DBXFilesUploadSessionCursor(swift: swift.cursor) } + /// If true, the current session will be closed, at which point you won't be able to call uploadSessionAppendV2 + /// anymore with the current session. + @objc + public var close: NSNumber { swift.close as NSNumber } + /// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this + /// hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + @objc + public var contentHash: String? { swift.contentHash } + + @objc + public init(cursor: DBXFilesUploadSessionCursor, close: NSNumber, contentHash: String?) { + self.swift = Files.UploadSessionAppendArg(cursor: cursor.swift, close: close.boolValue, contentHash: contentHash) + } + + let swift: Files.UploadSessionAppendArg + + public init(swift: Files.UploadSessionAppendArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionLookupError union +@objc +public class DBXFilesUploadSessionLookupError: NSObject { + let swift: Files.UploadSessionLookupError + + public init(swift: Files.UploadSessionLookupError) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionLookupError) -> DBXFilesUploadSessionLookupError { + switch swift { + case .notFound: + return DBXFilesUploadSessionLookupErrorNotFound() + case .incorrectOffset(let swiftArg): + let arg = DBXFilesUploadSessionOffsetError(swift: swiftArg) + return DBXFilesUploadSessionLookupErrorIncorrectOffset(arg) + case .closed: + return DBXFilesUploadSessionLookupErrorClosed() + case .notClosed: + return DBXFilesUploadSessionLookupErrorNotClosed() + case .tooLarge: + return DBXFilesUploadSessionLookupErrorTooLarge() + case .concurrentSessionInvalidOffset: + return DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidOffset() + case .concurrentSessionInvalidDataSize: + return DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidDataSize() + case .payloadTooLarge: + return DBXFilesUploadSessionLookupErrorPayloadTooLarge() + case .other: + return DBXFilesUploadSessionLookupErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNotFound: DBXFilesUploadSessionLookupErrorNotFound? { + self as? DBXFilesUploadSessionLookupErrorNotFound + } + + @objc + public var asIncorrectOffset: DBXFilesUploadSessionLookupErrorIncorrectOffset? { + self as? DBXFilesUploadSessionLookupErrorIncorrectOffset + } + + @objc + public var asClosed: DBXFilesUploadSessionLookupErrorClosed? { + self as? DBXFilesUploadSessionLookupErrorClosed + } + + @objc + public var asNotClosed: DBXFilesUploadSessionLookupErrorNotClosed? { + self as? DBXFilesUploadSessionLookupErrorNotClosed + } + + @objc + public var asTooLarge: DBXFilesUploadSessionLookupErrorTooLarge? { + self as? DBXFilesUploadSessionLookupErrorTooLarge + } + + @objc + public var asConcurrentSessionInvalidOffset: DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidOffset? { + self as? DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidOffset + } + + @objc + public var asConcurrentSessionInvalidDataSize: DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidDataSize? { + self as? DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidDataSize + } + + @objc + public var asPayloadTooLarge: DBXFilesUploadSessionLookupErrorPayloadTooLarge? { + self as? DBXFilesUploadSessionLookupErrorPayloadTooLarge + } + + @objc + public var asOther: DBXFilesUploadSessionLookupErrorOther? { + self as? DBXFilesUploadSessionLookupErrorOther + } +} + +/// The upload session ID was not found or has expired. Upload sessions are valid for 7 days. +@objc +public class DBXFilesUploadSessionLookupErrorNotFound: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.notFound + super.init(swift: swift) + } +} + +/// The specified offset was incorrect. See the value for the correct offset. This error may occur when a +/// previous request was received and processed successfully but the client did not receive the +/// response, e.g. due to a network error. +@objc +public class DBXFilesUploadSessionLookupErrorIncorrectOffset: DBXFilesUploadSessionLookupError { + @objc + public var incorrectOffset: DBXFilesUploadSessionOffsetError + + @objc + public init(_ arg: DBXFilesUploadSessionOffsetError) { + self.incorrectOffset = arg + let swift = Files.UploadSessionLookupError.incorrectOffset(arg.swift) + super.init(swift: swift) + } +} + +/// You are attempting to append data to an upload session that has already been closed (i.e. committed). +@objc +public class DBXFilesUploadSessionLookupErrorClosed: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.closed + super.init(swift: swift) + } +} + +/// The session must be closed before calling upload_session/finish_batch. +@objc +public class DBXFilesUploadSessionLookupErrorNotClosed: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.notClosed + super.init(swift: swift) + } +} + +/// You can not append to the upload session because the size of a file should not reach the max file size limit +/// (i.e. 350GB). +@objc +public class DBXFilesUploadSessionLookupErrorTooLarge: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.tooLarge + super.init(swift: swift) + } +} + +/// For concurrent upload sessions, offset needs to be multiple of 4194304 bytes. +@objc +public class DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidOffset: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.concurrentSessionInvalidOffset + super.init(swift: swift) + } +} + +/// For concurrent upload sessions, only chunks with size multiple of 4194304 bytes can be uploaded. +@objc +public class DBXFilesUploadSessionLookupErrorConcurrentSessionInvalidDataSize: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.concurrentSessionInvalidDataSize + super.init(swift: swift) + } +} + +/// The request payload must be at most 150 MB. +@objc +public class DBXFilesUploadSessionLookupErrorPayloadTooLarge: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.payloadTooLarge + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionLookupErrorOther: DBXFilesUploadSessionLookupError { + @objc + public init() { + let swift = Files.UploadSessionLookupError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadSessionAppendError union +@objc +public class DBXFilesUploadSessionAppendError: NSObject { + let swift: Files.UploadSessionAppendError + + public init(swift: Files.UploadSessionAppendError) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionAppendError) -> DBXFilesUploadSessionAppendError { + switch swift { + case .notFound: + return DBXFilesUploadSessionAppendErrorNotFound() + case .incorrectOffset(let swiftArg): + let arg = DBXFilesUploadSessionOffsetError(swift: swiftArg) + return DBXFilesUploadSessionAppendErrorIncorrectOffset(arg) + case .closed: + return DBXFilesUploadSessionAppendErrorClosed() + case .notClosed: + return DBXFilesUploadSessionAppendErrorNotClosed() + case .tooLarge: + return DBXFilesUploadSessionAppendErrorTooLarge() + case .concurrentSessionInvalidOffset: + return DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidOffset() + case .concurrentSessionInvalidDataSize: + return DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidDataSize() + case .payloadTooLarge: + return DBXFilesUploadSessionAppendErrorPayloadTooLarge() + case .other: + return DBXFilesUploadSessionAppendErrorOther() + case .contentHashMismatch: + return DBXFilesUploadSessionAppendErrorContentHashMismatch() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNotFound: DBXFilesUploadSessionAppendErrorNotFound? { + self as? DBXFilesUploadSessionAppendErrorNotFound + } + + @objc + public var asIncorrectOffset: DBXFilesUploadSessionAppendErrorIncorrectOffset? { + self as? DBXFilesUploadSessionAppendErrorIncorrectOffset + } + + @objc + public var asClosed: DBXFilesUploadSessionAppendErrorClosed? { + self as? DBXFilesUploadSessionAppendErrorClosed + } + + @objc + public var asNotClosed: DBXFilesUploadSessionAppendErrorNotClosed? { + self as? DBXFilesUploadSessionAppendErrorNotClosed + } + + @objc + public var asTooLarge: DBXFilesUploadSessionAppendErrorTooLarge? { + self as? DBXFilesUploadSessionAppendErrorTooLarge + } + + @objc + public var asConcurrentSessionInvalidOffset: DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidOffset? { + self as? DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidOffset + } + + @objc + public var asConcurrentSessionInvalidDataSize: DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidDataSize? { + self as? DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidDataSize + } + + @objc + public var asPayloadTooLarge: DBXFilesUploadSessionAppendErrorPayloadTooLarge? { + self as? DBXFilesUploadSessionAppendErrorPayloadTooLarge + } + + @objc + public var asOther: DBXFilesUploadSessionAppendErrorOther? { + self as? DBXFilesUploadSessionAppendErrorOther + } + + @objc + public var asContentHashMismatch: DBXFilesUploadSessionAppendErrorContentHashMismatch? { + self as? DBXFilesUploadSessionAppendErrorContentHashMismatch + } +} + +/// The upload session ID was not found or has expired. Upload sessions are valid for 7 days. +@objc +public class DBXFilesUploadSessionAppendErrorNotFound: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.notFound + super.init(swift: swift) + } +} + +/// The specified offset was incorrect. See the value for the correct offset. This error may occur when a +/// previous request was received and processed successfully but the client did not receive the +/// response, e.g. due to a network error. +@objc +public class DBXFilesUploadSessionAppendErrorIncorrectOffset: DBXFilesUploadSessionAppendError { + @objc + public var incorrectOffset: DBXFilesUploadSessionOffsetError + + @objc + public init(_ arg: DBXFilesUploadSessionOffsetError) { + self.incorrectOffset = arg + let swift = Files.UploadSessionAppendError.incorrectOffset(arg.swift) + super.init(swift: swift) + } +} + +/// You are attempting to append data to an upload session that has already been closed (i.e. committed). +@objc +public class DBXFilesUploadSessionAppendErrorClosed: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.closed + super.init(swift: swift) + } +} + +/// The session must be closed before calling upload_session/finish_batch. +@objc +public class DBXFilesUploadSessionAppendErrorNotClosed: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.notClosed + super.init(swift: swift) + } +} + +/// You can not append to the upload session because the size of a file should not reach the max file size limit +/// (i.e. 350GB). +@objc +public class DBXFilesUploadSessionAppendErrorTooLarge: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.tooLarge + super.init(swift: swift) + } +} + +/// For concurrent upload sessions, offset needs to be multiple of 4194304 bytes. +@objc +public class DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidOffset: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.concurrentSessionInvalidOffset + super.init(swift: swift) + } +} + +/// For concurrent upload sessions, only chunks with size multiple of 4194304 bytes can be uploaded. +@objc +public class DBXFilesUploadSessionAppendErrorConcurrentSessionInvalidDataSize: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.concurrentSessionInvalidDataSize + super.init(swift: swift) + } +} + +/// The request payload must be at most 150 MB. +@objc +public class DBXFilesUploadSessionAppendErrorPayloadTooLarge: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.payloadTooLarge + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionAppendErrorOther: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.other + super.init(swift: swift) + } +} + +/// The content received by the Dropbox server in this call does not match the provided content hash. +@objc +public class DBXFilesUploadSessionAppendErrorContentHashMismatch: DBXFilesUploadSessionAppendError { + @objc + public init() { + let swift = Files.UploadSessionAppendError.contentHashMismatch + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadSessionCursor struct +@objc +public class DBXFilesUploadSessionCursor: NSObject { + /// The upload session ID (returned by uploadSessionStart). + @objc + public var sessionId: String { swift.sessionId } + /// Offset in bytes at which data should be appended. We use this to make sure upload data isn't lost or + /// duplicated in the event of a network error. + @objc + public var offset: NSNumber { swift.offset as NSNumber } + + @objc + public init(sessionId: String, offset: NSNumber) { + self.swift = Files.UploadSessionCursor(sessionId: sessionId, offset: offset.uint64Value) + } + + let swift: Files.UploadSessionCursor + + public init(swift: Files.UploadSessionCursor) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionFinishArg struct +@objc +public class DBXFilesUploadSessionFinishArg: NSObject { + /// Contains the upload session ID and the offset. + @objc + public var cursor: DBXFilesUploadSessionCursor { DBXFilesUploadSessionCursor(swift: swift.cursor) } + /// Contains the path and other optional modifiers for the commit. + @objc + public var commit: DBXFilesCommitInfo { DBXFilesCommitInfo(swift: swift.commit) } + /// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this + /// hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + @objc + public var contentHash: String? { swift.contentHash } + + @objc + public init(cursor: DBXFilesUploadSessionCursor, commit: DBXFilesCommitInfo, contentHash: String?) { + self.swift = Files.UploadSessionFinishArg(cursor: cursor.swift, commit: commit.swift, contentHash: contentHash) + } + + let swift: Files.UploadSessionFinishArg + + public init(swift: Files.UploadSessionFinishArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionFinishBatchArg struct +@objc +public class DBXFilesUploadSessionFinishBatchArg: NSObject { + /// Commit information for each file in the batch. + @objc + public var entries: [DBXFilesUploadSessionFinishArg] { swift.entries.map { DBXFilesUploadSessionFinishArg(swift: $0) } } + + @objc + public init(entries: [DBXFilesUploadSessionFinishArg]) { + self.swift = Files.UploadSessionFinishBatchArg(entries: entries.map(\.swift)) + } + + let swift: Files.UploadSessionFinishBatchArg + + public init(swift: Files.UploadSessionFinishBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionFinishBatchJobStatus union +@objc +public class DBXFilesUploadSessionFinishBatchJobStatus: NSObject { + let swift: Files.UploadSessionFinishBatchJobStatus + + public init(swift: Files.UploadSessionFinishBatchJobStatus) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionFinishBatchJobStatus) -> DBXFilesUploadSessionFinishBatchJobStatus { + switch swift { + case .inProgress: + return DBXFilesUploadSessionFinishBatchJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXFilesUploadSessionFinishBatchResult(swift: swiftArg) + return DBXFilesUploadSessionFinishBatchJobStatusComplete(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXFilesUploadSessionFinishBatchJobStatusInProgress? { + self as? DBXFilesUploadSessionFinishBatchJobStatusInProgress + } + + @objc + public var asComplete: DBXFilesUploadSessionFinishBatchJobStatusComplete? { + self as? DBXFilesUploadSessionFinishBatchJobStatusComplete + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXFilesUploadSessionFinishBatchJobStatusInProgress: DBXFilesUploadSessionFinishBatchJobStatus { + @objc + public init() { + let swift = Files.UploadSessionFinishBatchJobStatus.inProgress + super.init(swift: swift) + } +} + +/// The uploadSessionFinishBatch has finished. +@objc +public class DBXFilesUploadSessionFinishBatchJobStatusComplete: DBXFilesUploadSessionFinishBatchJobStatus { + @objc + public var complete: DBXFilesUploadSessionFinishBatchResult + + @objc + public init(_ arg: DBXFilesUploadSessionFinishBatchResult) { + self.complete = arg + let swift = Files.UploadSessionFinishBatchJobStatus.complete(arg.swift) + super.init(swift: swift) + } +} + +/// Result returned by uploadSessionFinishBatch that may either launch an asynchronous job or complete +/// synchronously. +@objc +public class DBXFilesUploadSessionFinishBatchLaunch: NSObject { + let swift: Files.UploadSessionFinishBatchLaunch + + public init(swift: Files.UploadSessionFinishBatchLaunch) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionFinishBatchLaunch) -> DBXFilesUploadSessionFinishBatchLaunch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXFilesUploadSessionFinishBatchLaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXFilesUploadSessionFinishBatchResult(swift: swiftArg) + return DBXFilesUploadSessionFinishBatchLaunchComplete(arg) + case .other: + return DBXFilesUploadSessionFinishBatchLaunchOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXFilesUploadSessionFinishBatchLaunchAsyncJobId? { + self as? DBXFilesUploadSessionFinishBatchLaunchAsyncJobId + } + + @objc + public var asComplete: DBXFilesUploadSessionFinishBatchLaunchComplete? { + self as? DBXFilesUploadSessionFinishBatchLaunchComplete + } + + @objc + public var asOther: DBXFilesUploadSessionFinishBatchLaunchOther? { + self as? DBXFilesUploadSessionFinishBatchLaunchOther + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXFilesUploadSessionFinishBatchLaunchAsyncJobId: DBXFilesUploadSessionFinishBatchLaunch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Files.UploadSessionFinishBatchLaunch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionFinishBatchLaunchComplete: DBXFilesUploadSessionFinishBatchLaunch { + @objc + public var complete: DBXFilesUploadSessionFinishBatchResult + + @objc + public init(_ arg: DBXFilesUploadSessionFinishBatchResult) { + self.complete = arg + let swift = Files.UploadSessionFinishBatchLaunch.complete(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionFinishBatchLaunchOther: DBXFilesUploadSessionFinishBatchLaunch { + @objc + public init() { + let swift = Files.UploadSessionFinishBatchLaunch.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadSessionFinishBatchResult struct +@objc +public class DBXFilesUploadSessionFinishBatchResult: NSObject { + /// Each entry in entries in UploadSessionFinishBatchArg will appear at the same position inside entries in + /// UploadSessionFinishBatchResult. + @objc + public var entries: [DBXFilesUploadSessionFinishBatchResultEntry] { swift.entries.map { DBXFilesUploadSessionFinishBatchResultEntry(swift: $0) } } + + @objc + public init(entries: [DBXFilesUploadSessionFinishBatchResultEntry]) { + self.swift = Files.UploadSessionFinishBatchResult(entries: entries.map(\.swift)) + } + + let swift: Files.UploadSessionFinishBatchResult + + public init(swift: Files.UploadSessionFinishBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionFinishBatchResultEntry union +@objc +public class DBXFilesUploadSessionFinishBatchResultEntry: NSObject { + let swift: Files.UploadSessionFinishBatchResultEntry + + public init(swift: Files.UploadSessionFinishBatchResultEntry) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionFinishBatchResultEntry) -> DBXFilesUploadSessionFinishBatchResultEntry { + switch swift { + case .success(let swiftArg): + let arg = DBXFilesFileMetadata(swift: swiftArg) + return DBXFilesUploadSessionFinishBatchResultEntrySuccess(arg) + case .failure(let swiftArg): + let arg = DBXFilesUploadSessionFinishError(swift: swiftArg) + return DBXFilesUploadSessionFinishBatchResultEntryFailure(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXFilesUploadSessionFinishBatchResultEntrySuccess? { + self as? DBXFilesUploadSessionFinishBatchResultEntrySuccess + } + + @objc + public var asFailure: DBXFilesUploadSessionFinishBatchResultEntryFailure? { + self as? DBXFilesUploadSessionFinishBatchResultEntryFailure + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionFinishBatchResultEntrySuccess: DBXFilesUploadSessionFinishBatchResultEntry { + @objc + public var success: DBXFilesFileMetadata + + @objc + public init(_ arg: DBXFilesFileMetadata) { + self.success = arg + let swift = Files.UploadSessionFinishBatchResultEntry.success(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionFinishBatchResultEntryFailure: DBXFilesUploadSessionFinishBatchResultEntry { + @objc + public var failure: DBXFilesUploadSessionFinishError + + @objc + public init(_ arg: DBXFilesUploadSessionFinishError) { + self.failure = arg + let swift = Files.UploadSessionFinishBatchResultEntry.failure(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadSessionFinishError union +@objc +public class DBXFilesUploadSessionFinishError: NSObject { + let swift: Files.UploadSessionFinishError + + public init(swift: Files.UploadSessionFinishError) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionFinishError) -> DBXFilesUploadSessionFinishError { + switch swift { + case .lookupFailed(let swiftArg): + let arg = DBXFilesUploadSessionLookupError(swift: swiftArg) + return DBXFilesUploadSessionFinishErrorLookupFailed(arg) + case .path(let swiftArg): + let arg = DBXFilesWriteError(swift: swiftArg) + return DBXFilesUploadSessionFinishErrorPath(arg) + case .propertiesError(let swiftArg): + let arg = DBXFilePropertiesInvalidPropertyGroupError(swift: swiftArg) + return DBXFilesUploadSessionFinishErrorPropertiesError(arg) + case .tooManySharedFolderTargets: + return DBXFilesUploadSessionFinishErrorTooManySharedFolderTargets() + case .tooManyWriteOperations: + return DBXFilesUploadSessionFinishErrorTooManyWriteOperations() + case .concurrentSessionDataNotAllowed: + return DBXFilesUploadSessionFinishErrorConcurrentSessionDataNotAllowed() + case .concurrentSessionNotClosed: + return DBXFilesUploadSessionFinishErrorConcurrentSessionNotClosed() + case .concurrentSessionMissingData: + return DBXFilesUploadSessionFinishErrorConcurrentSessionMissingData() + case .payloadTooLarge: + return DBXFilesUploadSessionFinishErrorPayloadTooLarge() + case .contentHashMismatch: + return DBXFilesUploadSessionFinishErrorContentHashMismatch() + case .other: + return DBXFilesUploadSessionFinishErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asLookupFailed: DBXFilesUploadSessionFinishErrorLookupFailed? { + self as? DBXFilesUploadSessionFinishErrorLookupFailed + } + + @objc + public var asPath: DBXFilesUploadSessionFinishErrorPath? { + self as? DBXFilesUploadSessionFinishErrorPath + } + + @objc + public var asPropertiesError: DBXFilesUploadSessionFinishErrorPropertiesError? { + self as? DBXFilesUploadSessionFinishErrorPropertiesError + } + + @objc + public var asTooManySharedFolderTargets: DBXFilesUploadSessionFinishErrorTooManySharedFolderTargets? { + self as? DBXFilesUploadSessionFinishErrorTooManySharedFolderTargets + } + + @objc + public var asTooManyWriteOperations: DBXFilesUploadSessionFinishErrorTooManyWriteOperations? { + self as? DBXFilesUploadSessionFinishErrorTooManyWriteOperations + } + + @objc + public var asConcurrentSessionDataNotAllowed: DBXFilesUploadSessionFinishErrorConcurrentSessionDataNotAllowed? { + self as? DBXFilesUploadSessionFinishErrorConcurrentSessionDataNotAllowed + } + + @objc + public var asConcurrentSessionNotClosed: DBXFilesUploadSessionFinishErrorConcurrentSessionNotClosed? { + self as? DBXFilesUploadSessionFinishErrorConcurrentSessionNotClosed + } + + @objc + public var asConcurrentSessionMissingData: DBXFilesUploadSessionFinishErrorConcurrentSessionMissingData? { + self as? DBXFilesUploadSessionFinishErrorConcurrentSessionMissingData + } + + @objc + public var asPayloadTooLarge: DBXFilesUploadSessionFinishErrorPayloadTooLarge? { + self as? DBXFilesUploadSessionFinishErrorPayloadTooLarge + } + + @objc + public var asContentHashMismatch: DBXFilesUploadSessionFinishErrorContentHashMismatch? { + self as? DBXFilesUploadSessionFinishErrorContentHashMismatch + } + + @objc + public var asOther: DBXFilesUploadSessionFinishErrorOther? { + self as? DBXFilesUploadSessionFinishErrorOther + } +} + +/// The session arguments are incorrect; the value explains the reason. +@objc +public class DBXFilesUploadSessionFinishErrorLookupFailed: DBXFilesUploadSessionFinishError { + @objc + public var lookupFailed: DBXFilesUploadSessionLookupError + + @objc + public init(_ arg: DBXFilesUploadSessionLookupError) { + self.lookupFailed = arg + let swift = Files.UploadSessionFinishError.lookupFailed(arg.swift) + super.init(swift: swift) + } +} + +/// Unable to save the uploaded contents to a file. Data has already been appended to the upload session. Please +/// retry with empty data body and updated offset. +@objc +public class DBXFilesUploadSessionFinishErrorPath: DBXFilesUploadSessionFinishError { + @objc + public var path: DBXFilesWriteError + + @objc + public init(_ arg: DBXFilesWriteError) { + self.path = arg + let swift = Files.UploadSessionFinishError.path(arg.swift) + super.init(swift: swift) + } +} + +/// The supplied property group is invalid. The file has uploaded without property groups. +@objc +public class DBXFilesUploadSessionFinishErrorPropertiesError: DBXFilesUploadSessionFinishError { + @objc + public var propertiesError: DBXFilePropertiesInvalidPropertyGroupError + + @objc + public init(_ arg: DBXFilePropertiesInvalidPropertyGroupError) { + self.propertiesError = arg + let swift = Files.UploadSessionFinishError.propertiesError(arg.swift) + super.init(swift: swift) + } +} + +/// The batch request commits files into too many different shared folders. Please limit your batch request to +/// files contained in a single shared folder. +@objc +public class DBXFilesUploadSessionFinishErrorTooManySharedFolderTargets: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.tooManySharedFolderTargets + super.init(swift: swift) + } +} + +/// There are too many write operations happening in the user's Dropbox. You should retry uploading this file. +@objc +public class DBXFilesUploadSessionFinishErrorTooManyWriteOperations: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// Uploading data not allowed when finishing concurrent upload session. +@objc +public class DBXFilesUploadSessionFinishErrorConcurrentSessionDataNotAllowed: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.concurrentSessionDataNotAllowed + super.init(swift: swift) + } +} + +/// Concurrent upload sessions need to be closed before finishing. +@objc +public class DBXFilesUploadSessionFinishErrorConcurrentSessionNotClosed: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.concurrentSessionNotClosed + super.init(swift: swift) + } +} + +/// Not all pieces of data were uploaded before trying to finish the session. +@objc +public class DBXFilesUploadSessionFinishErrorConcurrentSessionMissingData: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.concurrentSessionMissingData + super.init(swift: swift) + } +} + +/// The request payload must be at most 150 MB. +@objc +public class DBXFilesUploadSessionFinishErrorPayloadTooLarge: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.payloadTooLarge + super.init(swift: swift) + } +} + +/// The content received by the Dropbox server in this call does not match the provided content hash. +@objc +public class DBXFilesUploadSessionFinishErrorContentHashMismatch: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.contentHashMismatch + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionFinishErrorOther: DBXFilesUploadSessionFinishError { + @objc + public init() { + let swift = Files.UploadSessionFinishError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadSessionOffsetError struct +@objc +public class DBXFilesUploadSessionOffsetError: NSObject { + /// The offset up to which data has been collected. + @objc + public var correctOffset: NSNumber { swift.correctOffset as NSNumber } + + @objc + public init(correctOffset: NSNumber) { + self.swift = Files.UploadSessionOffsetError(correctOffset: correctOffset.uint64Value) + } + + let swift: Files.UploadSessionOffsetError + + public init(swift: Files.UploadSessionOffsetError) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionStartArg struct +@objc +public class DBXFilesUploadSessionStartArg: NSObject { + /// If true, the current session will be closed, at which point you won't be able to call uploadSessionAppendV2 + /// anymore with the current session. + @objc + public var close: NSNumber { swift.close as NSNumber } + /// Type of upload session you want to start. If not specified, default is sequential in UploadSessionType. + @objc + public var sessionType: DBXFilesUploadSessionType? { guard let swift = swift.sessionType else { return nil } + return DBXFilesUploadSessionType(swift: swift) + } + + /// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this + /// hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + @objc + public var contentHash: String? { swift.contentHash } + + @objc + public init(close: NSNumber, sessionType: DBXFilesUploadSessionType?, contentHash: String?) { + self.swift = Files.UploadSessionStartArg(close: close.boolValue, sessionType: sessionType?.swift, contentHash: contentHash) + } + + let swift: Files.UploadSessionStartArg + + public init(swift: Files.UploadSessionStartArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionStartBatchArg struct +@objc +public class DBXFilesUploadSessionStartBatchArg: NSObject { + /// Type of upload session you want to start. If not specified, default is sequential in UploadSessionType. + @objc + public var sessionType: DBXFilesUploadSessionType? { guard let swift = swift.sessionType else { return nil } + return DBXFilesUploadSessionType(swift: swift) + } + + /// The number of upload sessions to start. + @objc + public var numSessions: NSNumber { swift.numSessions as NSNumber } + + @objc + public init(numSessions: NSNumber, sessionType: DBXFilesUploadSessionType?) { + self.swift = Files.UploadSessionStartBatchArg(numSessions: numSessions.uint64Value, sessionType: sessionType?.swift) + } + + let swift: Files.UploadSessionStartBatchArg + + public init(swift: Files.UploadSessionStartBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionStartBatchResult struct +@objc +public class DBXFilesUploadSessionStartBatchResult: NSObject { + /// A List of unique identifiers for the upload session. Pass each session_id to uploadSessionAppendV2 and + /// uploadSessionFinish. + @objc + public var sessionIds: [String] { swift.sessionIds } + + @objc + public init(sessionIds: [String]) { + self.swift = Files.UploadSessionStartBatchResult(sessionIds: sessionIds) + } + + let swift: Files.UploadSessionStartBatchResult + + public init(swift: Files.UploadSessionStartBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionStartError union +@objc +public class DBXFilesUploadSessionStartError: NSObject { + let swift: Files.UploadSessionStartError + + public init(swift: Files.UploadSessionStartError) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionStartError) -> DBXFilesUploadSessionStartError { + switch swift { + case .concurrentSessionDataNotAllowed: + return DBXFilesUploadSessionStartErrorConcurrentSessionDataNotAllowed() + case .concurrentSessionCloseNotAllowed: + return DBXFilesUploadSessionStartErrorConcurrentSessionCloseNotAllowed() + case .payloadTooLarge: + return DBXFilesUploadSessionStartErrorPayloadTooLarge() + case .contentHashMismatch: + return DBXFilesUploadSessionStartErrorContentHashMismatch() + case .other: + return DBXFilesUploadSessionStartErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asConcurrentSessionDataNotAllowed: DBXFilesUploadSessionStartErrorConcurrentSessionDataNotAllowed? { + self as? DBXFilesUploadSessionStartErrorConcurrentSessionDataNotAllowed + } + + @objc + public var asConcurrentSessionCloseNotAllowed: DBXFilesUploadSessionStartErrorConcurrentSessionCloseNotAllowed? { + self as? DBXFilesUploadSessionStartErrorConcurrentSessionCloseNotAllowed + } + + @objc + public var asPayloadTooLarge: DBXFilesUploadSessionStartErrorPayloadTooLarge? { + self as? DBXFilesUploadSessionStartErrorPayloadTooLarge + } + + @objc + public var asContentHashMismatch: DBXFilesUploadSessionStartErrorContentHashMismatch? { + self as? DBXFilesUploadSessionStartErrorContentHashMismatch + } + + @objc + public var asOther: DBXFilesUploadSessionStartErrorOther? { + self as? DBXFilesUploadSessionStartErrorOther + } +} + +/// Uploading data not allowed when starting concurrent upload session. +@objc +public class DBXFilesUploadSessionStartErrorConcurrentSessionDataNotAllowed: DBXFilesUploadSessionStartError { + @objc + public init() { + let swift = Files.UploadSessionStartError.concurrentSessionDataNotAllowed + super.init(swift: swift) + } +} + +/// Can not start a closed concurrent upload session. +@objc +public class DBXFilesUploadSessionStartErrorConcurrentSessionCloseNotAllowed: DBXFilesUploadSessionStartError { + @objc + public init() { + let swift = Files.UploadSessionStartError.concurrentSessionCloseNotAllowed + super.init(swift: swift) + } +} + +/// The request payload must be at most 150 MB. +@objc +public class DBXFilesUploadSessionStartErrorPayloadTooLarge: DBXFilesUploadSessionStartError { + @objc + public init() { + let swift = Files.UploadSessionStartError.payloadTooLarge + super.init(swift: swift) + } +} + +/// The content received by the Dropbox server in this call does not match the provided content hash. +@objc +public class DBXFilesUploadSessionStartErrorContentHashMismatch: DBXFilesUploadSessionStartError { + @objc + public init() { + let swift = Files.UploadSessionStartError.contentHashMismatch + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionStartErrorOther: DBXFilesUploadSessionStartError { + @objc + public init() { + let swift = Files.UploadSessionStartError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadSessionStartResult struct +@objc +public class DBXFilesUploadSessionStartResult: NSObject { + /// A unique identifier for the upload session. Pass this to uploadSessionAppendV2 and uploadSessionFinish. + @objc + public var sessionId: String { swift.sessionId } + + @objc + public init(sessionId: String) { + self.swift = Files.UploadSessionStartResult(sessionId: sessionId) + } + + let swift: Files.UploadSessionStartResult + + public init(swift: Files.UploadSessionStartResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UploadSessionType union +@objc +public class DBXFilesUploadSessionType: NSObject { + let swift: Files.UploadSessionType + + public init(swift: Files.UploadSessionType) { + self.swift = swift + } + + public static func factory(swift: Files.UploadSessionType) -> DBXFilesUploadSessionType { + switch swift { + case .sequential: + return DBXFilesUploadSessionTypeSequential() + case .concurrent: + return DBXFilesUploadSessionTypeConcurrent() + case .other: + return DBXFilesUploadSessionTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSequential: DBXFilesUploadSessionTypeSequential? { + self as? DBXFilesUploadSessionTypeSequential + } + + @objc + public var asConcurrent: DBXFilesUploadSessionTypeConcurrent? { + self as? DBXFilesUploadSessionTypeConcurrent + } + + @objc + public var asOther: DBXFilesUploadSessionTypeOther? { + self as? DBXFilesUploadSessionTypeOther + } +} + +/// Pieces of data are uploaded sequentially one after another. This is the default behavior. +@objc +public class DBXFilesUploadSessionTypeSequential: DBXFilesUploadSessionType { + @objc + public init() { + let swift = Files.UploadSessionType.sequential + super.init(swift: swift) + } +} + +/// Pieces of data can be uploaded in concurrent RPCs in any order. +@objc +public class DBXFilesUploadSessionTypeConcurrent: DBXFilesUploadSessionType { + @objc + public init() { + let swift = Files.UploadSessionType.concurrent + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesUploadSessionTypeOther: DBXFilesUploadSessionType { + @objc + public init() { + let swift = Files.UploadSessionType.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UploadWriteFailed struct +@objc +public class DBXFilesUploadWriteFailed: NSObject { + /// The reason why the file couldn't be saved. + @objc + public var reason: DBXFilesWriteError { DBXFilesWriteError(swift: swift.reason) } + /// The upload session ID; data has already been uploaded to the corresponding upload session and this ID may be + /// used to retry the commit with uploadSessionFinish. + @objc + public var uploadSessionId: String { swift.uploadSessionId } + + @objc + public init(reason: DBXFilesWriteError, uploadSessionId: String) { + self.swift = Files.UploadWriteFailed(reason: reason.swift, uploadSessionId: uploadSessionId) + } + + let swift: Files.UploadWriteFailed + + public init(swift: Files.UploadWriteFailed) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserGeneratedTag struct +@objc +public class DBXFilesUserGeneratedTag: NSObject { + /// (no description) + @objc + public var tagText: String { swift.tagText } + + @objc + public init(tagText: String) { + self.swift = Files.UserGeneratedTag(tagText: tagText) + } + + let swift: Files.UserGeneratedTag + + public init(swift: Files.UserGeneratedTag) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Metadata for a video. +@objc +public class DBXFilesVideoMetadata: DBXFilesMediaMetadata { + /// The duration of the video in milliseconds. + @objc + public var duration: NSNumber? { subSwift.duration as NSNumber? } + + @objc + public init(dimensions: DBXFilesDimensions?, location: DBXFilesGpsCoordinates?, timeTaken: Date?, duration: NSNumber?) { + let swift = Files.VideoMetadata(dimensions: dimensions?.swift, location: location?.swift, timeTaken: timeTaken, duration: duration?.uint64Value) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Files.VideoMetadata + + public init(swift: Files.VideoMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible WriteConflictError union +@objc +public class DBXFilesWriteConflictError: NSObject { + let swift: Files.WriteConflictError + + public init(swift: Files.WriteConflictError) { + self.swift = swift + } + + public static func factory(swift: Files.WriteConflictError) -> DBXFilesWriteConflictError { + switch swift { + case .file: + return DBXFilesWriteConflictErrorFile() + case .folder: + return DBXFilesWriteConflictErrorFolder() + case .fileAncestor: + return DBXFilesWriteConflictErrorFileAncestor() + case .other: + return DBXFilesWriteConflictErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFile: DBXFilesWriteConflictErrorFile? { + self as? DBXFilesWriteConflictErrorFile + } + + @objc + public var asFolder: DBXFilesWriteConflictErrorFolder? { + self as? DBXFilesWriteConflictErrorFolder + } + + @objc + public var asFileAncestor: DBXFilesWriteConflictErrorFileAncestor? { + self as? DBXFilesWriteConflictErrorFileAncestor + } + + @objc + public var asOther: DBXFilesWriteConflictErrorOther? { + self as? DBXFilesWriteConflictErrorOther + } +} + +/// There's a file in the way. +@objc +public class DBXFilesWriteConflictErrorFile: DBXFilesWriteConflictError { + @objc + public init() { + let swift = Files.WriteConflictError.file + super.init(swift: swift) + } +} + +/// There's a folder in the way. +@objc +public class DBXFilesWriteConflictErrorFolder: DBXFilesWriteConflictError { + @objc + public init() { + let swift = Files.WriteConflictError.folder + super.init(swift: swift) + } +} + +/// There's a file at an ancestor path, so we couldn't create the required parent folders. +@objc +public class DBXFilesWriteConflictErrorFileAncestor: DBXFilesWriteConflictError { + @objc + public init() { + let swift = Files.WriteConflictError.fileAncestor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesWriteConflictErrorOther: DBXFilesWriteConflictError { + @objc + public init() { + let swift = Files.WriteConflictError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible WriteError union +@objc +public class DBXFilesWriteError: NSObject { + let swift: Files.WriteError + + public init(swift: Files.WriteError) { + self.swift = swift + } + + public static func factory(swift: Files.WriteError) -> DBXFilesWriteError { + switch swift { + case .malformedPath(let swiftArg): + let arg = swiftArg + return DBXFilesWriteErrorMalformedPath(arg) + case .conflict(let swiftArg): + let arg = DBXFilesWriteConflictError(swift: swiftArg) + return DBXFilesWriteErrorConflict(arg) + case .noWritePermission: + return DBXFilesWriteErrorNoWritePermission() + case .insufficientSpace: + return DBXFilesWriteErrorInsufficientSpace() + case .disallowedName: + return DBXFilesWriteErrorDisallowedName() + case .teamFolder: + return DBXFilesWriteErrorTeamFolder() + case .operationSuppressed: + return DBXFilesWriteErrorOperationSuppressed() + case .tooManyWriteOperations: + return DBXFilesWriteErrorTooManyWriteOperations() + case .other: + return DBXFilesWriteErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMalformedPath: DBXFilesWriteErrorMalformedPath? { + self as? DBXFilesWriteErrorMalformedPath + } + + @objc + public var asConflict: DBXFilesWriteErrorConflict? { + self as? DBXFilesWriteErrorConflict + } + + @objc + public var asNoWritePermission: DBXFilesWriteErrorNoWritePermission? { + self as? DBXFilesWriteErrorNoWritePermission + } + + @objc + public var asInsufficientSpace: DBXFilesWriteErrorInsufficientSpace? { + self as? DBXFilesWriteErrorInsufficientSpace + } + + @objc + public var asDisallowedName: DBXFilesWriteErrorDisallowedName? { + self as? DBXFilesWriteErrorDisallowedName + } + + @objc + public var asTeamFolder: DBXFilesWriteErrorTeamFolder? { + self as? DBXFilesWriteErrorTeamFolder + } + + @objc + public var asOperationSuppressed: DBXFilesWriteErrorOperationSuppressed? { + self as? DBXFilesWriteErrorOperationSuppressed + } + + @objc + public var asTooManyWriteOperations: DBXFilesWriteErrorTooManyWriteOperations? { + self as? DBXFilesWriteErrorTooManyWriteOperations + } + + @objc + public var asOther: DBXFilesWriteErrorOther? { + self as? DBXFilesWriteErrorOther + } +} + +/// The given path does not satisfy the required path format. Please refer to the Path formats documentation +/// https://www.dropbox.com/developers/documentation/http/documentation#path-formats for more +/// information. +@objc +public class DBXFilesWriteErrorMalformedPath: DBXFilesWriteError { + @objc + public var malformedPath: String? + + @objc + public init(_ arg: String?) { + self.malformedPath = arg + let swift = Files.WriteError.malformedPath(arg) + super.init(swift: swift) + } +} + +/// Couldn't write to the target path because there was something in the way. +@objc +public class DBXFilesWriteErrorConflict: DBXFilesWriteError { + @objc + public var conflict: DBXFilesWriteConflictError + + @objc + public init(_ arg: DBXFilesWriteConflictError) { + self.conflict = arg + let swift = Files.WriteError.conflict(arg.swift) + super.init(swift: swift) + } +} + +/// The user doesn't have permissions to write to the target location. +@objc +public class DBXFilesWriteErrorNoWritePermission: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.noWritePermission + super.init(swift: swift) + } +} + +/// The user doesn't have enough available space (bytes) to write more data. +@objc +public class DBXFilesWriteErrorInsufficientSpace: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.insufficientSpace + super.init(swift: swift) + } +} + +/// Dropbox will not save the file or folder because of its name. +@objc +public class DBXFilesWriteErrorDisallowedName: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.disallowedName + super.init(swift: swift) + } +} + +/// This endpoint cannot move or delete team folders. +@objc +public class DBXFilesWriteErrorTeamFolder: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.teamFolder + super.init(swift: swift) + } +} + +/// This file operation is not allowed at this path. +@objc +public class DBXFilesWriteErrorOperationSuppressed: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.operationSuppressed + super.init(swift: swift) + } +} + +/// There are too many write operations in user's Dropbox. Please retry this request. +@objc +public class DBXFilesWriteErrorTooManyWriteOperations: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.tooManyWriteOperations + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXFilesWriteErrorOther: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.other + super.init(swift: swift) + } +} + +/// Your intent when writing a file to some path. This is used to determine what constitutes a conflict and what the +/// autorename strategy is. In some situations, the conflict behavior is identical: (a) If the target path doesn't +/// refer to anything, the file is always written; no conflict. (b) If the target path refers to a folder, it's +/// always a conflict. (c) If the target path refers to a file with identical contents, nothing gets written; no +/// conflict. The conflict checking differs in the case where there's a file at the target path with contents +/// different from the contents you're trying to write. +@objc +public class DBXFilesWriteMode: NSObject { + let swift: Files.WriteMode + + public init(swift: Files.WriteMode) { + self.swift = swift + } + + public static func factory(swift: Files.WriteMode) -> DBXFilesWriteMode { + switch swift { + case .add: + return DBXFilesWriteModeAdd() + case .overwrite: + return DBXFilesWriteModeOverwrite() + case .update(let swiftArg): + let arg = swiftArg + return DBXFilesWriteModeUpdate(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdd: DBXFilesWriteModeAdd? { + self as? DBXFilesWriteModeAdd + } + + @objc + public var asOverwrite: DBXFilesWriteModeOverwrite? { + self as? DBXFilesWriteModeOverwrite + } + + @objc + public var asUpdate: DBXFilesWriteModeUpdate? { + self as? DBXFilesWriteModeUpdate + } +} + +/// Do not overwrite an existing file if there is a conflict. The autorename strategy is to append a number to +/// the file name. For example, "document.txt" might become "document (2).txt". +@objc +public class DBXFilesWriteModeAdd: DBXFilesWriteMode { + @objc + public init() { + let swift = Files.WriteMode.add + super.init(swift: swift) + } +} + +/// Always overwrite the existing file. The autorename strategy is the same as it is for add. +@objc +public class DBXFilesWriteModeOverwrite: DBXFilesWriteMode { + @objc + public init() { + let swift = Files.WriteMode.overwrite + super.init(swift: swift) + } +} + +/// Overwrite if the given "rev" matches the existing file's "rev". The supplied value should be the latest +/// known "rev" of the file, for example, from FileMetadata, from when the file was last downloaded by +/// the app. This will cause the file on the Dropbox servers to be overwritten if the given "rev" +/// matches the existing file's current "rev" on the Dropbox servers. The autorename strategy is to +/// append the string "conflicted copy" to the file name. For example, "document.txt" might become +/// "document (conflicted copy).txt" or "document (Panda's conflicted copy).txt". +@objc +public class DBXFilesWriteModeUpdate: DBXFilesWriteMode { + @objc + public var update: String + + @objc + public init(_ arg: String) { + self.update = arg + let swift = Files.WriteMode.update(arg) + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift new file mode 100644 index 000000000..1ba91c414 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift @@ -0,0 +1,7402 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the files namespace +/// For Swift routes see FilesRoutes +@objc +public class DBXFilesRoutes: NSObject { + private let swift: FilesRoutes + init(swift: FilesRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Copy a file or folder to a different location in the user's Dropbox. If the source path is a folder all its + /// contents will be copied. + /// + /// - scope: files.content.write + /// + /// - parameter allowSharedFolder: This flag has no effect. + /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the file to avoid the + /// conflict. + /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for + /// the content being moved. This does not apply to copies. + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success + /// or a `Files.RelocationError` object on failure. + @objc + @discardableResult public func copyV2( + fromPath: String, + toPath: String, + allowSharedFolder: NSNumber, + autorename: NSNumber, + allowOwnershipTransfer: NSNumber + ) -> DBXFilesCopyRpcRequestV2 { + let swift = swift.copyV2( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder.boolValue, + autorename: autorename.boolValue, + allowOwnershipTransfer: allowOwnershipTransfer.boolValue + ) + return DBXFilesCopyRpcRequestV2(swift: swift) + } + + /// Copy a file or folder to a different location in the user's Dropbox. If the source path is a folder all its + /// contents will be copied. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success + /// or a `Files.RelocationError` object on failure. + @objc + @discardableResult public func copyV2(fromPath: String, toPath: String) -> DBXFilesCopyRpcRequestV2 { + let swift = swift.copyV2(fromPath: fromPath, toPath: toPath) + return DBXFilesCopyRpcRequestV2(swift: swift) + } + + /// Copy multiple files or folders to different locations at once in the user's Dropbox. This route will replace + /// copyBatch. The main difference is this route will return status for each entry, while copyBatch raises + /// failure if any entry fails. This route will either finish synchronously, or return a job ID and do the async + /// copy job in background. Please use copyBatchCheckV2 to check the job status. + /// + /// - scope: files.content.write + /// + /// - parameter entries: List of entries to be moved or copied. Each entry is RelocationPath. + /// - parameter autorename: If there's a conflict with any file, have the Dropbox server try to autorename that file + /// to avoid the conflict. + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func copyBatchV2(entries: [DBXFilesRelocationPath], autorename: NSNumber) -> DBXFilesCopyBatchRpcRequestV2 { + let swift = swift.copyBatchV2(entries: entries.map(\.swift), autorename: autorename.boolValue) + return DBXFilesCopyBatchRpcRequestV2(swift: swift) + } + + /// Copy multiple files or folders to different locations at once in the user's Dropbox. This route will replace + /// copyBatch. The main difference is this route will return status for each entry, while copyBatch raises + /// failure if any entry fails. This route will either finish synchronously, or return a job ID and do the async + /// copy job in background. Please use copyBatchCheckV2 to check the job status. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func copyBatchV2(entries: [DBXFilesRelocationPath]) -> DBXFilesCopyBatchRpcRequestV2 { + let swift = swift.copyBatchV2(entries: entries.map(\.swift)) + return DBXFilesCopyBatchRpcRequestV2(swift: swift) + } + + /// Returns the status of an asynchronous job for copyBatchV2. It returns list of results for each entry. + /// + /// - scope: files.content.write + /// + /// - 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 `Files.RelocationBatchV2JobStatus` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func copyBatchCheckV2(asyncJobId: String) -> DBXFilesCopyBatchCheckRpcRequestV2 { + let swift = swift.copyBatchCheckV2(asyncJobId: asyncJobId) + return DBXFilesCopyBatchCheckRpcRequestV2(swift: swift) + } + + /// Get a copy reference to a file or folder. This reference string can be used to save that file or folder to + /// another user's Dropbox by passing it to copyReferenceSave. + /// + /// - scope: files.content.write + /// + /// - parameter path: The path to the file or folder you want to get a copy reference to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.GetCopyReferenceResult` object on + /// success or a `Files.GetCopyReferenceError` object on failure. + @objc + @discardableResult public func copyReferenceGet(path: String) -> DBXFilesCopyReferenceGetRpcRequest { + let swift = swift.copyReferenceGet(path: path) + return DBXFilesCopyReferenceGetRpcRequest(swift: swift) + } + + /// Save a copy reference returned by copyReferenceGet to the user's Dropbox. + /// + /// - scope: files.content.write + /// + /// - parameter copyReference: A copy reference returned by copyReferenceGet. + /// - parameter path: Path in the user's Dropbox that is the destination. + /// + /// - returns: Through the response callback, the caller will receive a `Files.SaveCopyReferenceResult` object on + /// success or a `Files.SaveCopyReferenceError` object on failure. + @objc + @discardableResult public func copyReferenceSave(copyReference: String, path: String) -> DBXFilesCopyReferenceSaveRpcRequest { + let swift = swift.copyReferenceSave(copyReference: copyReference, path: path) + return DBXFilesCopyReferenceSaveRpcRequest(swift: swift) + } + + /// Create a folder at a given path. + /// + /// - scope: files.content.write + /// + /// - parameter path: Path in the user's Dropbox to create. + /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the folder to avoid the + /// conflict. + /// + /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderResult` object on success + /// or a `Files.CreateFolderError` object on failure. + @objc + @discardableResult public func createFolderV2(path: String, autorename: NSNumber) -> DBXFilesCreateFolderRpcRequestV2 { + let swift = swift.createFolderV2(path: path, autorename: autorename.boolValue) + return DBXFilesCreateFolderRpcRequestV2(swift: swift) + } + + /// Create a folder at a given path. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderResult` object on success + /// or a `Files.CreateFolderError` object on failure. + @objc + @discardableResult public func createFolderV2(path: String) -> DBXFilesCreateFolderRpcRequestV2 { + let swift = swift.createFolderV2(path: path) + return DBXFilesCreateFolderRpcRequestV2(swift: swift) + } + + /// Create multiple folders at once. This route is asynchronous for large batches, which returns a job ID + /// immediately and runs the create folder batch asynchronously. Otherwise, creates the folders and returns the + /// result synchronously for smaller inputs. You can force asynchronous behaviour by using the forceAsync in + /// CreateFolderBatchArg flag. Use createFolderBatchCheck to check the job status. + /// + /// - scope: files.content.write + /// + /// - parameter paths: List of paths to be created in the user's Dropbox. Duplicate path arguments in the batch are + /// considered only once. + /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the folder to avoid the + /// conflict. + /// - parameter forceAsync: Whether to force the create to happen asynchronously. + /// + /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderBatchLaunch` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func createFolderBatch(paths: [String], autorename: NSNumber, forceAsync: NSNumber) -> DBXFilesCreateFolderBatchRpcRequest { + let swift = swift.createFolderBatch(paths: paths, autorename: autorename.boolValue, forceAsync: forceAsync.boolValue) + return DBXFilesCreateFolderBatchRpcRequest(swift: swift) + } + + /// Create multiple folders at once. This route is asynchronous for large batches, which returns a job ID + /// immediately and runs the create folder batch asynchronously. Otherwise, creates the folders and returns the + /// result synchronously for smaller inputs. You can force asynchronous behaviour by using the forceAsync in + /// CreateFolderBatchArg flag. Use createFolderBatchCheck to check the job status. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderBatchLaunch` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func createFolderBatch(paths: [String]) -> DBXFilesCreateFolderBatchRpcRequest { + let swift = swift.createFolderBatch(paths: paths) + return DBXFilesCreateFolderBatchRpcRequest(swift: swift) + } + + /// Returns the status of an asynchronous job for createFolderBatch. If success, it returns list of result for each + /// entry. + /// + /// - scope: files.content.write + /// + /// - 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 `Files.CreateFolderBatchJobStatus` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func createFolderBatchCheck(asyncJobId: String) -> DBXFilesCreateFolderBatchCheckRpcRequest { + let swift = swift.createFolderBatchCheck(asyncJobId: asyncJobId) + return DBXFilesCreateFolderBatchCheckRpcRequest(swift: swift) + } + + /// Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too. A + /// successful response indicates that the file or folder was deleted. The returned metadata will be the + /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata + /// object. + /// + /// - scope: files.content.write + /// + /// - parameter path: Path in the user's Dropbox to delete. + /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does + /// not support deleting a folder. + /// + /// - returns: Through the response callback, the caller will receive a `Files.DeleteResult` object on success or a + /// `Files.DeleteError` object on failure. + @objc + @discardableResult public func deleteV2(path: String, parentRev: String?) -> DBXFilesDeleteRpcRequestV2 { + let swift = swift.deleteV2(path: path, parentRev: parentRev) + return DBXFilesDeleteRpcRequestV2(swift: swift) + } + + /// Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too. A + /// successful response indicates that the file or folder was deleted. The returned metadata will be the + /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata + /// object. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.DeleteResult` object on success or a + /// `Files.DeleteError` object on failure. + @objc + @discardableResult public func deleteV2(path: String) -> DBXFilesDeleteRpcRequestV2 { + let swift = swift.deleteV2(path: path) + return DBXFilesDeleteRpcRequestV2(swift: swift) + } + + /// Delete multiple files/folders at once. This route is asynchronous, which returns a job ID immediately and runs + /// the delete batch asynchronously. Use deleteBatchCheck to check the job status. + /// + /// - scope: files.content.write + /// + /// + /// - returns: Through the response callback, the caller will receive a `Files.DeleteBatchLaunch` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func deleteBatch(entries: [DBXFilesDeleteArg]) -> DBXFilesDeleteBatchRpcRequest { + let swift = swift.deleteBatch(entries: entries.map(\.swift)) + return DBXFilesDeleteBatchRpcRequest(swift: swift) + } + + /// Returns the status of an asynchronous job for deleteBatch. If success, it returns list of result for each entry. + /// + /// - scope: files.content.write + /// + /// - 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 `Files.DeleteBatchJobStatus` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func deleteBatchCheck(asyncJobId: String) -> DBXFilesDeleteBatchCheckRpcRequest { + let swift = swift.deleteBatchCheck(asyncJobId: asyncJobId) + return DBXFilesDeleteBatchCheckRpcRequest(swift: swift) + } + + /// Download a file from a user's Dropbox. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the file to download. + /// - parameter rev: Please specify revision in path instead. + /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.DownloadError` object on failure. + @objc + @discardableResult public func downloadURL(path: String, rev: String?, overwrite: Bool, destination: URL) -> DBXFilesDownloadDownloadRequestFile { + let swift = swift.download(path: path, rev: rev, overwrite: overwrite, destination: destination) + return DBXFilesDownloadDownloadRequestFile(swift: swift) + } + + /// Download a file from a user's Dropbox. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.DownloadError` object on failure. + @objc + @discardableResult public func downloadURL(path: String, overwrite: Bool, destination: URL) -> DBXFilesDownloadDownloadRequestFile { + let swift = swift.download(path: path, overwrite: overwrite, destination: destination) + return DBXFilesDownloadDownloadRequestFile(swift: swift) + } + + /// Download a file from a user's Dropbox. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the file to download. + /// - parameter rev: Please specify revision in path instead. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.DownloadError` object on failure. + @objc + @discardableResult public func download(path: String, rev: String?) -> DBXFilesDownloadDownloadRequestMemory { + let swift = swift.download(path: path, rev: rev) + return DBXFilesDownloadDownloadRequestMemory(swift: swift) + } + + /// Download a file from a user's Dropbox. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.DownloadError` object on failure. + @objc + @discardableResult public func download(path: String) -> DBXFilesDownloadDownloadRequestMemory { + let swift = swift.download(path: path) + return DBXFilesDownloadDownloadRequestMemory(swift: swift) + } + + /// Download a folder from the user's Dropbox, as a zip file. The folder must be less than 20 GB in size and any + /// single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file + /// and folder entries, including the top level folder. The input cannot be a single file. Note: this endpoint + /// does not support HTTP range requests. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the folder to download. + /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.DownloadZipResult` object on success + /// or a `Files.DownloadZipError` object on failure. + @objc + @discardableResult public func downloadZipURL(path: String, overwrite: Bool, destination: URL) -> DBXFilesDownloadZipDownloadRequestFile { + let swift = swift.downloadZip(path: path, overwrite: overwrite, destination: destination) + return DBXFilesDownloadZipDownloadRequestFile(swift: swift) + } + + /// Download a folder from the user's Dropbox, as a zip file. The folder must be less than 20 GB in size and any + /// single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file + /// and folder entries, including the top level folder. The input cannot be a single file. Note: this endpoint + /// does not support HTTP range requests. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the folder to download. + /// + /// - returns: Through the response callback, the caller will receive a `Files.DownloadZipResult` object on success + /// or a `Files.DownloadZipError` object on failure. + @objc + @discardableResult public func downloadZip(path: String) -> DBXFilesDownloadZipDownloadRequestMemory { + let swift = swift.downloadZip(path: path) + return DBXFilesDownloadZipDownloadRequestMemory(swift: swift) + } + + /// Export a file from a user's Dropbox. This route only supports exporting files that cannot be downloaded directly + /// and whose fileMetadata in ExportResult has exportAs in ExportInfo populated. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the file to be exported. + /// - parameter exportFormat: The file format to which the file should be exported. This must be one of the formats + /// listed in the file's export_options returned by getMetadata. If none is specified, the default format + /// (specified in export_as in file metadata) will be used. + /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a + /// `Files.ExportError` object on failure. + @objc + @discardableResult public func exportURL(path: String, exportFormat: String?, overwrite: Bool, destination: URL) -> DBXFilesExportDownloadRequestFile { + let swift = swift.export(path: path, exportFormat: exportFormat, overwrite: overwrite, destination: destination) + return DBXFilesExportDownloadRequestFile(swift: swift) + } + + /// Export a file from a user's Dropbox. This route only supports exporting files that cannot be downloaded directly + /// and whose fileMetadata in ExportResult has exportAs in ExportInfo populated. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a + /// `Files.ExportError` object on failure. + @objc + @discardableResult public func exportURL(path: String, overwrite: Bool, destination: URL) -> DBXFilesExportDownloadRequestFile { + let swift = swift.export(path: path, overwrite: overwrite, destination: destination) + return DBXFilesExportDownloadRequestFile(swift: swift) + } + + /// Export a file from a user's Dropbox. This route only supports exporting files that cannot be downloaded directly + /// and whose fileMetadata in ExportResult has exportAs in ExportInfo populated. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the file to be exported. + /// - parameter exportFormat: The file format to which the file should be exported. This must be one of the formats + /// listed in the file's export_options returned by getMetadata. If none is specified, the default format + /// (specified in export_as in file metadata) will be used. + /// + /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a + /// `Files.ExportError` object on failure. + @objc + @discardableResult public func export(path: String, exportFormat: String?) -> DBXFilesExportDownloadRequestMemory { + let swift = swift.export(path: path, exportFormat: exportFormat) + return DBXFilesExportDownloadRequestMemory(swift: swift) + } + + /// Export a file from a user's Dropbox. This route only supports exporting files that cannot be downloaded directly + /// and whose fileMetadata in ExportResult has exportAs in ExportInfo populated. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.ExportResult` object on success or a + /// `Files.ExportError` object on failure. + @objc + @discardableResult public func export(path: String) -> DBXFilesExportDownloadRequestMemory { + let swift = swift.export(path: path) + return DBXFilesExportDownloadRequestMemory(swift: swift) + } + + /// Return the lock metadata for the given list of paths. + /// + /// - scope: files.content.read + /// + /// - parameter entries: List of 'entries'. Each 'entry' contains a path of the file which will be locked or + /// queried. Duplicate path arguments in the batch are considered only once. + /// + /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on + /// success or a `Files.LockFileError` object on failure. + @objc + @discardableResult public func getFileLockBatch(entries: [DBXFilesLockFileArg]) -> DBXFilesGetFileLockBatchRpcRequest { + let swift = swift.getFileLockBatch(entries: entries.map(\.swift)) + return DBXFilesGetFileLockBatchRpcRequest(swift: swift) + } + + /// Returns the metadata for a file or folder. Note: Metadata for the root folder is unsupported. + /// + /// - scope: files.metadata.read + /// + /// - parameter path: The path of a file or folder on Dropbox. + /// - parameter includeMediaInfo: If true, mediaInfo in FileMetadata is set for photo and video. + /// - parameter includeDeleted: If true, DeletedMetadata will be returned for deleted file or folder, otherwise + /// notFound in LookupError will be returned. + /// - parameter includeHasExplicitSharedMembers: If true, the results will include a flag for each file indicating + /// whether or not that file has any explicit members. + /// - parameter includePropertyGroups: If set to a valid list of template IDs, propertyGroups in FileMetadata is set + /// if there exists property data associated with the file and each of the listed templates. + /// + /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a + /// `Files.GetMetadataError` object on failure. + @objc + @discardableResult public func getMetadata( + path: String, + includeMediaInfo: NSNumber, + includeDeleted: NSNumber, + includeHasExplicitSharedMembers: NSNumber, + includePropertyGroups: DBXFilePropertiesTemplateFilterBase? + ) -> DBXFilesGetMetadataRpcRequest { + let swift = swift.getMetadata( + path: path, + includeMediaInfo: includeMediaInfo.boolValue, + includeDeleted: includeDeleted.boolValue, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers.boolValue, + includePropertyGroups: includePropertyGroups?.swift + ) + return DBXFilesGetMetadataRpcRequest(swift: swift) + } + + /// Returns the metadata for a file or folder. Note: Metadata for the root folder is unsupported. + /// + /// - scope: files.metadata.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a + /// `Files.GetMetadataError` object on failure. + @objc + @discardableResult public func getMetadata(path: String) -> DBXFilesGetMetadataRpcRequest { + let swift = swift.getMetadata(path: path) + return DBXFilesGetMetadataRpcRequest(swift: swift) + } + + /// Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, + /// .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML + /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. + /// Other formats will return an unsupported extension error. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the file to preview. + /// - parameter rev: Please specify revision in path instead. + /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.PreviewError` object on failure. + @objc + @discardableResult public func getPreviewURL(path: String, rev: String?, overwrite: Bool, destination: URL) -> DBXFilesGetPreviewDownloadRequestFile { + let swift = swift.getPreview(path: path, rev: rev, overwrite: overwrite, destination: destination) + return DBXFilesGetPreviewDownloadRequestFile(swift: swift) + } + + /// Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, + /// .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML + /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. + /// Other formats will return an unsupported extension error. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.PreviewError` object on failure. + @objc + @discardableResult public func getPreviewURL(path: String, overwrite: Bool, destination: URL) -> DBXFilesGetPreviewDownloadRequestFile { + let swift = swift.getPreview(path: path, overwrite: overwrite, destination: destination) + return DBXFilesGetPreviewDownloadRequestFile(swift: swift) + } + + /// Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, + /// .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML + /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. + /// Other formats will return an unsupported extension error. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path of the file to preview. + /// - parameter rev: Please specify revision in path instead. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.PreviewError` object on failure. + @objc + @discardableResult public func getPreview(path: String, rev: String?) -> DBXFilesGetPreviewDownloadRequestMemory { + let swift = swift.getPreview(path: path, rev: rev) + return DBXFilesGetPreviewDownloadRequestMemory(swift: swift) + } + + /// Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, + /// .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML + /// previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. + /// Other formats will return an unsupported extension error. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.PreviewError` object on failure. + @objc + @discardableResult public func getPreview(path: String) -> DBXFilesGetPreviewDownloadRequestMemory { + let swift = swift.getPreview(path: path) + return DBXFilesGetPreviewDownloadRequestMemory(swift: swift) + } + + /// Get a temporary link to stream content of a file. This link will expire in four hours and afterwards you will + /// get 410 Gone. This URL should not be used to display content directly in the browser. The Content-Type of + /// the link is determined automatically by the file's mime type. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path to the file you want a temporary link to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.GetTemporaryLinkResult` object on + /// success or a `Files.GetTemporaryLinkError` object on failure. + @objc + @discardableResult public func getTemporaryLink(path: String) -> DBXFilesGetTemporaryLinkRpcRequest { + let swift = swift.getTemporaryLink(path: path) + return DBXFilesGetTemporaryLinkRpcRequest(swift: swift) + } + + /// Get a one-time use temporary upload link to upload a file to a Dropbox location. This endpoint acts as a + /// delayed upload. The returned temporary upload link may be used to make a POST request with the data to be + /// uploaded. The upload will then be perfomed with the CommitInfo previously provided to getTemporaryUploadLink + /// but evaluated only upon consumption. Hence, errors stemming from invalid CommitInfo with respect to the + /// state of the user's Dropbox will only be communicated at consumption time. Additionally, these errors are + /// surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum temporary + /// upload link duration is 4 hours. Upon consumption or expiration, a new link will have to be generated. + /// Multiple links may exist for a specific upload path at any given time. The POST request on the temporary + /// upload link must have its Content-Type set to "application/octet-stream". Example temporary upload link + /// consumption request: curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND --header + /// "Content-Type: application/octet-stream" --data-binary @local_file.txt A successful temporary upload link + /// consumption request returns the content hash of the uploaded data in JSON format. Example successful + /// temporary upload link consumption response: {"content-hash": "599d71033d700ac892a0e48fa61b125d2f5994"} An + /// unsuccessful temporary upload link consumption request returns any of the following status codes: HTTP 400 + /// Bad Request: Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP + /// 409 Conflict: The temporary upload link does not exist or is currently unavailable, the upload failed, or + /// another error happened. HTTP 410 Gone: The temporary upload link is expired or consumed. Example + /// unsuccessful temporary upload link consumption response: Temporary upload link has been recently consumed. + /// + /// - scope: files.content.write + /// + /// - parameter commitInfo: Contains the path and other optional modifiers for the future upload commit. Equivalent + /// to the parameters provided to upload. + /// - parameter duration: How long before this link expires, in seconds. Attempting to start an upload with this + /// link longer than this period of time after link creation will result in an error. + /// + /// - returns: Through the response callback, the caller will receive a `Files.GetTemporaryUploadLinkResult` object + /// on success or a `Void` object on failure. + @objc + @discardableResult public func getTemporaryUploadLink(commitInfo: DBXFilesCommitInfo, duration: NSNumber) -> DBXFilesGetTemporaryUploadLinkRpcRequest { + let swift = swift.getTemporaryUploadLink(commitInfo: commitInfo.swift, duration: duration.doubleValue) + return DBXFilesGetTemporaryUploadLinkRpcRequest(swift: swift) + } + + /// Get a one-time use temporary upload link to upload a file to a Dropbox location. This endpoint acts as a + /// delayed upload. The returned temporary upload link may be used to make a POST request with the data to be + /// uploaded. The upload will then be perfomed with the CommitInfo previously provided to getTemporaryUploadLink + /// but evaluated only upon consumption. Hence, errors stemming from invalid CommitInfo with respect to the + /// state of the user's Dropbox will only be communicated at consumption time. Additionally, these errors are + /// surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum temporary + /// upload link duration is 4 hours. Upon consumption or expiration, a new link will have to be generated. + /// Multiple links may exist for a specific upload path at any given time. The POST request on the temporary + /// upload link must have its Content-Type set to "application/octet-stream". Example temporary upload link + /// consumption request: curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND --header + /// "Content-Type: application/octet-stream" --data-binary @local_file.txt A successful temporary upload link + /// consumption request returns the content hash of the uploaded data in JSON format. Example successful + /// temporary upload link consumption response: {"content-hash": "599d71033d700ac892a0e48fa61b125d2f5994"} An + /// unsuccessful temporary upload link consumption request returns any of the following status codes: HTTP 400 + /// Bad Request: Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP + /// 409 Conflict: The temporary upload link does not exist or is currently unavailable, the upload failed, or + /// another error happened. HTTP 410 Gone: The temporary upload link is expired or consumed. Example + /// unsuccessful temporary upload link consumption response: Temporary upload link has been recently consumed. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.GetTemporaryUploadLinkResult` object + /// on success or a `Void` object on failure. + @objc + @discardableResult public func getTemporaryUploadLink(commitInfo: DBXFilesCommitInfo) -> DBXFilesGetTemporaryUploadLinkRpcRequest { + let swift = swift.getTemporaryUploadLink(commitInfo: commitInfo.swift) + return DBXFilesGetTemporaryUploadLinkRpcRequest(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path to the image file you want to thumbnail. + /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg + /// should be preferred, while png is better for screenshots and digital arts. + /// - parameter size: The size for the thumbnail image. + /// - parameter mode: How to resize and crop the image to achieve the desired size. + /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.ThumbnailError` object on failure. + @objc + @discardableResult public func getThumbnailURL( + path: String, + format: DBXFilesThumbnailFormat, + size: DBXFilesThumbnailSize, + mode: DBXFilesThumbnailMode, + overwrite: Bool, + destination: URL + ) -> DBXFilesGetThumbnailDownloadRequestFile { + let swift = swift.getThumbnail(path: path, format: format.swift, size: size.swift, mode: mode.swift, overwrite: overwrite, destination: destination) + return DBXFilesGetThumbnailDownloadRequestFile(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.ThumbnailError` object on failure. + @objc + @discardableResult public func getThumbnailURL(path: String, overwrite: Bool, destination: URL) -> DBXFilesGetThumbnailDownloadRequestFile { + let swift = swift.getThumbnail(path: path, overwrite: overwrite, destination: destination) + return DBXFilesGetThumbnailDownloadRequestFile(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - parameter path: The path to the image file you want to thumbnail. + /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg + /// should be preferred, while png is better for screenshots and digital arts. + /// - parameter size: The size for the thumbnail image. + /// - parameter mode: How to resize and crop the image to achieve the desired size. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.ThumbnailError` object on failure. + @objc + @discardableResult public func getThumbnail( + path: String, + format: DBXFilesThumbnailFormat, + size: DBXFilesThumbnailSize, + mode: DBXFilesThumbnailMode + ) -> DBXFilesGetThumbnailDownloadRequestMemory { + let swift = swift.getThumbnail(path: path, format: format.swift, size: size.swift, mode: mode.swift) + return DBXFilesGetThumbnailDownloadRequestMemory(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.ThumbnailError` object on failure. + @objc + @discardableResult public func getThumbnail(path: String) -> DBXFilesGetThumbnailDownloadRequestMemory { + let swift = swift.getThumbnail(path: path) + return DBXFilesGetThumbnailDownloadRequestMemory(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - parameter resource: Information specifying which file to preview. This could be a path to a file, a shared + /// link pointing to a file, or a shared link pointing to a folder, with a relative path. + /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg + /// should be preferred, while png is better for screenshots and digital arts. + /// - parameter size: The size for the thumbnail image. + /// - parameter mode: How to resize and crop the image to achieve the desired size. + /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or a + /// `Files.ThumbnailV2Error` object on failure. + @objc + @discardableResult public func getThumbnailV2URL( + resource: DBXFilesPathOrLink, + format: DBXFilesThumbnailFormat, + size: DBXFilesThumbnailSize, + mode: DBXFilesThumbnailMode, + overwrite: Bool, + destination: URL + ) -> DBXFilesGetThumbnailDownloadRequestFileV2 { + let swift = swift.getThumbnailV2( + resource: resource.swift, + format: format.swift, + size: size.swift, + mode: mode.swift, + overwrite: overwrite, + destination: destination + ) + return DBXFilesGetThumbnailDownloadRequestFileV2(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or a + /// `Files.ThumbnailV2Error` object on failure. + @objc + @discardableResult public func getThumbnailV2URL( + resource: DBXFilesPathOrLink, + overwrite: Bool, + destination: URL + ) -> DBXFilesGetThumbnailDownloadRequestFileV2 { + let swift = swift.getThumbnailV2(resource: resource.swift, overwrite: overwrite, destination: destination) + return DBXFilesGetThumbnailDownloadRequestFileV2(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - parameter resource: Information specifying which file to preview. This could be a path to a file, a shared + /// link pointing to a file, or a shared link pointing to a folder, with a relative path. + /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg + /// should be preferred, while png is better for screenshots and digital arts. + /// - parameter size: The size for the thumbnail image. + /// - parameter mode: How to resize and crop the image to achieve the desired size. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or a + /// `Files.ThumbnailV2Error` object on failure. + @objc + @discardableResult public func getThumbnailV2( + resource: DBXFilesPathOrLink, + format: DBXFilesThumbnailFormat, + size: DBXFilesThumbnailSize, + mode: DBXFilesThumbnailMode + ) -> DBXFilesGetThumbnailDownloadRequestMemoryV2 { + let swift = swift.getThumbnailV2(resource: resource.swift, format: format.swift, size: size.swift, mode: mode.swift) + return DBXFilesGetThumbnailDownloadRequestMemoryV2(swift: swift) + } + + /// Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, + /// jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to + /// a thumbnail. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or a + /// `Files.ThumbnailV2Error` object on failure. + @objc + @discardableResult public func getThumbnailV2(resource: DBXFilesPathOrLink) -> DBXFilesGetThumbnailDownloadRequestMemoryV2 { + let swift = swift.getThumbnailV2(resource: resource.swift) + return DBXFilesGetThumbnailDownloadRequestMemoryV2(swift: swift) + } + + /// Get thumbnails for a list of images. We allow up to 25 thumbnails in a single batch. This method currently + /// supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos + /// that are larger than 20MB in size won't be converted to a thumbnail. + /// + /// - scope: files.content.read + /// + /// - parameter entries: List of files to get thumbnails. + /// + /// - returns: Through the response callback, the caller will receive a `Files.GetThumbnailBatchResult` object on + /// success or a `Files.GetThumbnailBatchError` object on failure. + @objc + @discardableResult public func getThumbnailBatch(entries: [DBXFilesThumbnailArg]) -> DBXFilesGetThumbnailBatchRpcRequest { + let swift = swift.getThumbnailBatch(entries: entries.map(\.swift)) + return DBXFilesGetThumbnailBatchRpcRequest(swift: swift) + } + + /// Starts returning the contents of a folder. If the result's hasMore in ListFolderResult field is true, call + /// listFolderContinue with the returned cursor in ListFolderResult to retrieve more entries. If you're using + /// recursive in ListFolderArg set to true to keep a local cache of the contents of a Dropbox account, iterate + /// through each entry in order and process them as follows to keep your local state in sync: For each + /// FileMetadata, store the new entry at the given path in your local state. If the required parent folders + /// don't exist yet, create them. If there's already something else at the given path, replace it and remove all + /// its children. For each FolderMetadata, store the new entry at the given path in your local state. If the + /// required parent folders don't exist yet, create them. If there's already something else at the given path, + /// replace it but leave the children as they are. Check the new entry's readOnly in FolderSharingInfo and set + /// all its children's read-only statuses to match. For each DeletedMetadata, if your local state has something + /// at the given path, remove it and all its children. If there's nothing at the given path, ignore this entry. + /// Note: auth.RateLimitError may be returned if multiple listFolder or listFolderContinue calls with same + /// parameters are made simultaneously by same API app for same user. If your app implements retry logic, please + /// hold off the retry until the previous request finishes. + /// + /// - scope: files.metadata.read + /// + /// - parameter path: A unique identifier for the file. + /// - parameter recursive: If true, the list folder operation will be applied recursively to all subfolders and the + /// response will contain contents of all subfolders. + /// - parameter includeMediaInfo: If true, mediaInfo in FileMetadata is set for photo and video. This parameter will + /// no longer have an effect starting December 2, 2019. + /// - parameter includeDeleted: If true, the results will include entries for files and folders that used to exist + /// but were deleted. + /// - parameter includeHasExplicitSharedMembers: If true, the results will include a flag for each file indicating + /// whether or not that file has any explicit members. + /// - parameter includeMountedFolders: If true, the results will include entries under mounted folders which + /// includes app folder, shared folder and team folder. + /// - parameter limit: The maximum number of results to return per request. Note: This is an approximate number and + /// there can be slightly more entries returned in some cases. + /// - parameter sharedLink: A shared link to list the contents of. If the link is password-protected, the password + /// must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared + /// link. Only non-recursive mode is supported for shared link. + /// - parameter includePropertyGroups: If set to a valid list of template IDs, propertyGroups in FileMetadata is set + /// if there exists property data associated with the file and each of the listed templates. + /// - parameter includeNonDownloadableFiles: If true, include files that are not downloadable, i.e. Google Docs. + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderResult` object on success + /// or a `Files.ListFolderError` object on failure. + @objc + @discardableResult public func listFolder( + path: String, + recursive: NSNumber, + includeMediaInfo: NSNumber, + includeDeleted: NSNumber, + includeHasExplicitSharedMembers: NSNumber, + includeMountedFolders: NSNumber, + limit: NSNumber?, + sharedLink: DBXFilesSharedLink?, + includePropertyGroups: DBXFilePropertiesTemplateFilterBase?, + includeNonDownloadableFiles: NSNumber + ) -> DBXFilesListFolderRpcRequest { + let swift = swift.listFolder( + path: path, + recursive: recursive.boolValue, + includeMediaInfo: includeMediaInfo.boolValue, + includeDeleted: includeDeleted.boolValue, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers.boolValue, + includeMountedFolders: includeMountedFolders.boolValue, + limit: limit?.uint32Value, + sharedLink: sharedLink?.swift, + includePropertyGroups: includePropertyGroups?.swift, + includeNonDownloadableFiles: includeNonDownloadableFiles.boolValue + ) + return DBXFilesListFolderRpcRequest(swift: swift) + } + + /// Starts returning the contents of a folder. If the result's hasMore in ListFolderResult field is true, call + /// listFolderContinue with the returned cursor in ListFolderResult to retrieve more entries. If you're using + /// recursive in ListFolderArg set to true to keep a local cache of the contents of a Dropbox account, iterate + /// through each entry in order and process them as follows to keep your local state in sync: For each + /// FileMetadata, store the new entry at the given path in your local state. If the required parent folders + /// don't exist yet, create them. If there's already something else at the given path, replace it and remove all + /// its children. For each FolderMetadata, store the new entry at the given path in your local state. If the + /// required parent folders don't exist yet, create them. If there's already something else at the given path, + /// replace it but leave the children as they are. Check the new entry's readOnly in FolderSharingInfo and set + /// all its children's read-only statuses to match. For each DeletedMetadata, if your local state has something + /// at the given path, remove it and all its children. If there's nothing at the given path, ignore this entry. + /// Note: auth.RateLimitError may be returned if multiple listFolder or listFolderContinue calls with same + /// parameters are made simultaneously by same API app for same user. If your app implements retry logic, please + /// hold off the retry until the previous request finishes. + /// + /// - scope: files.metadata.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderResult` object on success + /// or a `Files.ListFolderError` object on failure. + @objc + @discardableResult public func listFolder(path: String) -> DBXFilesListFolderRpcRequest { + let swift = swift.listFolder(path: path) + return DBXFilesListFolderRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from listFolder, use this to paginate through all files and retrieve updates to + /// the folder, following the same rules as documented for listFolder. + /// + /// - scope: files.metadata.read + /// + /// - parameter cursor: The cursor returned by your last call to listFolder or listFolderContinue. + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderResult` object on success + /// or a `Files.ListFolderContinueError` object on failure. + @objc + @discardableResult public func listFolderContinue(cursor: String) -> DBXFilesListFolderContinueRpcRequest { + let swift = swift.listFolderContinue(cursor: cursor) + return DBXFilesListFolderContinueRpcRequest(swift: swift) + } + + /// A way to quickly get a cursor for the folder's state. Unlike listFolder, listFolderGetLatestCursor doesn't + /// return any entries. This endpoint is for app which only needs to know about new files and modifications and + /// doesn't need to know about files that already exist in Dropbox. + /// + /// - scope: files.metadata.read + /// + /// - parameter path: A unique identifier for the file. + /// - parameter recursive: If true, the list folder operation will be applied recursively to all subfolders and the + /// response will contain contents of all subfolders. + /// - parameter includeMediaInfo: If true, mediaInfo in FileMetadata is set for photo and video. This parameter will + /// no longer have an effect starting December 2, 2019. + /// - parameter includeDeleted: If true, the results will include entries for files and folders that used to exist + /// but were deleted. + /// - parameter includeHasExplicitSharedMembers: If true, the results will include a flag for each file indicating + /// whether or not that file has any explicit members. + /// - parameter includeMountedFolders: If true, the results will include entries under mounted folders which + /// includes app folder, shared folder and team folder. + /// - parameter limit: The maximum number of results to return per request. Note: This is an approximate number and + /// there can be slightly more entries returned in some cases. + /// - parameter sharedLink: A shared link to list the contents of. If the link is password-protected, the password + /// must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared + /// link. Only non-recursive mode is supported for shared link. + /// - parameter includePropertyGroups: If set to a valid list of template IDs, propertyGroups in FileMetadata is set + /// if there exists property data associated with the file and each of the listed templates. + /// - parameter includeNonDownloadableFiles: If true, include files that are not downloadable, i.e. Google Docs. + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderGetLatestCursorResult` + /// object on success or a `Files.ListFolderError` object on failure. + @objc + @discardableResult public func listFolderGetLatestCursor( + path: String, + recursive: NSNumber, + includeMediaInfo: NSNumber, + includeDeleted: NSNumber, + includeHasExplicitSharedMembers: NSNumber, + includeMountedFolders: NSNumber, + limit: NSNumber?, + sharedLink: DBXFilesSharedLink?, + includePropertyGroups: DBXFilePropertiesTemplateFilterBase?, + includeNonDownloadableFiles: NSNumber + ) -> DBXFilesListFolderGetLatestCursorRpcRequest { + let swift = swift.listFolderGetLatestCursor( + path: path, + recursive: recursive.boolValue, + includeMediaInfo: includeMediaInfo.boolValue, + includeDeleted: includeDeleted.boolValue, + includeHasExplicitSharedMembers: includeHasExplicitSharedMembers.boolValue, + includeMountedFolders: includeMountedFolders.boolValue, + limit: limit?.uint32Value, + sharedLink: sharedLink?.swift, + includePropertyGroups: includePropertyGroups?.swift, + includeNonDownloadableFiles: includeNonDownloadableFiles.boolValue + ) + return DBXFilesListFolderGetLatestCursorRpcRequest(swift: swift) + } + + /// A way to quickly get a cursor for the folder's state. Unlike listFolder, listFolderGetLatestCursor doesn't + /// return any entries. This endpoint is for app which only needs to know about new files and modifications and + /// doesn't need to know about files that already exist in Dropbox. + /// + /// - scope: files.metadata.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderGetLatestCursorResult` + /// object on success or a `Files.ListFolderError` object on failure. + @objc + @discardableResult public func listFolderGetLatestCursor(path: String) -> DBXFilesListFolderGetLatestCursorRpcRequest { + let swift = swift.listFolderGetLatestCursor(path: path) + return DBXFilesListFolderGetLatestCursorRpcRequest(swift: swift) + } + + /// A longpoll endpoint to wait for changes on an account. In conjunction with listFolderContinue, this call gives + /// you a low-latency way to monitor an account for file changes. The connection will block until there are + /// changes available or a timeout occurs. This endpoint is useful mostly for client-side apps. If you're + /// looking for server-side notifications, check out our webhooks documentation + /// https://www.dropbox.com/developers/reference/webhooks. + /// + /// - scope: files.metadata.read + /// + /// - parameter cursor: A cursor as returned by listFolder or listFolderContinue. Cursors retrieved by setting + /// includeMediaInfo in ListFolderArg to true are not supported. + /// - parameter timeout: A timeout in seconds. The request will block for at most this length of time, plus up to 90 + /// seconds of random jitter added to avoid the thundering herd problem. Care should be taken when using this + /// parameter, as some network infrastructure does not support long timeouts. + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderLongpollResult` object on + /// success or a `Files.ListFolderLongpollError` object on failure. + @objc + @discardableResult public func listFolderLongpoll(cursor: String, timeout: NSNumber) -> DBXFilesListFolderLongpollRpcRequest { + let swift = swift.listFolderLongpoll(cursor: cursor, timeout: timeout.uint64Value) + return DBXFilesListFolderLongpollRpcRequest(swift: swift) + } + + /// A longpoll endpoint to wait for changes on an account. In conjunction with listFolderContinue, this call gives + /// you a low-latency way to monitor an account for file changes. The connection will block until there are + /// changes available or a timeout occurs. This endpoint is useful mostly for client-side apps. If you're + /// looking for server-side notifications, check out our webhooks documentation + /// https://www.dropbox.com/developers/reference/webhooks. + /// + /// - scope: files.metadata.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListFolderLongpollResult` object on + /// success or a `Files.ListFolderLongpollError` object on failure. + @objc + @discardableResult public func listFolderLongpoll(cursor: String) -> DBXFilesListFolderLongpollRpcRequest { + let swift = swift.listFolderLongpoll(cursor: cursor) + return DBXFilesListFolderLongpollRpcRequest(swift: swift) + } + + /// Returns revisions for files based on a file path or a file id. The file path or file id is identified from the + /// latest file entry at the given file path or id. This end point allows your app to query either by file path + /// or file id by setting the mode parameter appropriately. In the path in ListRevisionsMode (default) mode, all + /// revisions at the same file path as the latest file entry are returned. If revisions with the same file id + /// are desired, then mode must be set to id in ListRevisionsMode. The id in ListRevisionsMode mode is useful to + /// retrieve revisions for a given file across moves or renames. + /// + /// - scope: files.metadata.read + /// + /// - parameter path: The path to the file you want to see the revisions of. + /// - parameter mode: Determines the behavior of the API in listing the revisions for a given file path or id. + /// - parameter limit: The maximum number of revision entries returned. + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListRevisionsResult` object on + /// success or a `Files.ListRevisionsError` object on failure. + @objc + @discardableResult public func listRevisions(path: String, mode: DBXFilesListRevisionsMode, limit: NSNumber) -> DBXFilesListRevisionsRpcRequest { + let swift = swift.listRevisions(path: path, mode: mode.swift, limit: limit.uint64Value) + return DBXFilesListRevisionsRpcRequest(swift: swift) + } + + /// Returns revisions for files based on a file path or a file id. The file path or file id is identified from the + /// latest file entry at the given file path or id. This end point allows your app to query either by file path + /// or file id by setting the mode parameter appropriately. In the path in ListRevisionsMode (default) mode, all + /// revisions at the same file path as the latest file entry are returned. If revisions with the same file id + /// are desired, then mode must be set to id in ListRevisionsMode. The id in ListRevisionsMode mode is useful to + /// retrieve revisions for a given file across moves or renames. + /// + /// - scope: files.metadata.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.ListRevisionsResult` object on + /// success or a `Files.ListRevisionsError` object on failure. + @objc + @discardableResult public func listRevisions(path: String) -> DBXFilesListRevisionsRpcRequest { + let swift = swift.listRevisions(path: path) + return DBXFilesListRevisionsRpcRequest(swift: swift) + } + + /// Lock the files at the given paths. A locked file will be writable only by the lock holder. A successful response + /// indicates that the file has been locked. Returns a list of the locked file paths and their metadata after + /// this operation. + /// + /// - scope: files.content.write + /// + /// - parameter entries: List of 'entries'. Each 'entry' contains a path of the file which will be locked or + /// queried. Duplicate path arguments in the batch are considered only once. + /// + /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on + /// success or a `Files.LockFileError` object on failure. + @objc + @discardableResult public func lockFileBatch(entries: [DBXFilesLockFileArg]) -> DBXFilesLockFileBatchRpcRequest { + let swift = swift.lockFileBatch(entries: entries.map(\.swift)) + return DBXFilesLockFileBatchRpcRequest(swift: swift) + } + + /// Move a file or folder to a different location in the user's Dropbox. If the source path is a folder all its + /// contents will be moved. Note that we do not currently support case-only renaming. + /// + /// - scope: files.content.write + /// + /// - parameter allowSharedFolder: This flag has no effect. + /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the file to avoid the + /// conflict. + /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for + /// the content being moved. This does not apply to copies. + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success + /// or a `Files.RelocationError` object on failure. + @objc + @discardableResult public func moveV2( + fromPath: String, + toPath: String, + allowSharedFolder: NSNumber, + autorename: NSNumber, + allowOwnershipTransfer: NSNumber + ) -> DBXFilesMoveRpcRequestV2 { + let swift = swift.moveV2( + fromPath: fromPath, + toPath: toPath, + allowSharedFolder: allowSharedFolder.boolValue, + autorename: autorename.boolValue, + allowOwnershipTransfer: allowOwnershipTransfer.boolValue + ) + return DBXFilesMoveRpcRequestV2(swift: swift) + } + + /// Move a file or folder to a different location in the user's Dropbox. If the source path is a folder all its + /// contents will be moved. Note that we do not currently support case-only renaming. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationResult` object on success + /// or a `Files.RelocationError` object on failure. + @objc + @discardableResult public func moveV2(fromPath: String, toPath: String) -> DBXFilesMoveRpcRequestV2 { + let swift = swift.moveV2(fromPath: fromPath, toPath: toPath) + return DBXFilesMoveRpcRequestV2(swift: swift) + } + + /// Move multiple files or folders to different locations at once in the user's Dropbox. Note that we do not + /// currently support case-only renaming. This route will replace moveBatch. The main difference is this route + /// will return status for each entry, while moveBatch raises failure if any entry fails. This route will either + /// finish synchronously, or return a job ID and do the async move job in background. Please use + /// moveBatchCheckV2 to check the job status. + /// + /// - scope: files.content.write + /// + /// - parameter allowOwnershipTransfer: Allow moves by owner even if it would result in an ownership transfer for + /// the content being moved. This does not apply to copies. + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func moveBatchV2( + entries: [DBXFilesRelocationPath], + autorename: NSNumber, + allowOwnershipTransfer: NSNumber + ) -> DBXFilesMoveBatchRpcRequestV2 { + let swift = swift.moveBatchV2(entries: entries.map(\.swift), autorename: autorename.boolValue, allowOwnershipTransfer: allowOwnershipTransfer.boolValue) + return DBXFilesMoveBatchRpcRequestV2(swift: swift) + } + + /// Move multiple files or folders to different locations at once in the user's Dropbox. Note that we do not + /// currently support case-only renaming. This route will replace moveBatch. The main difference is this route + /// will return status for each entry, while moveBatch raises failure if any entry fails. This route will either + /// finish synchronously, or return a job ID and do the async move job in background. Please use + /// moveBatchCheckV2 to check the job status. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.RelocationBatchV2Launch` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func moveBatchV2(entries: [DBXFilesRelocationPath]) -> DBXFilesMoveBatchRpcRequestV2 { + let swift = swift.moveBatchV2(entries: entries.map(\.swift)) + return DBXFilesMoveBatchRpcRequestV2(swift: swift) + } + + /// Returns the status of an asynchronous job for moveBatchV2. It returns list of results for each entry. + /// + /// - scope: files.content.write + /// + /// - 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 `Files.RelocationBatchV2JobStatus` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func moveBatchCheckV2(asyncJobId: String) -> DBXFilesMoveBatchCheckRpcRequestV2 { + let swift = swift.moveBatchCheckV2(asyncJobId: asyncJobId) + return DBXFilesMoveBatchCheckRpcRequestV2(swift: swift) + } + + /// Creates a new Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - parameter path: The fully qualified path to the location in the user's Dropbox where the Paper Doc should be + /// created. This should include the document's title and end with .paper. + /// - parameter importFormat: The format of the provided data. + /// - parameter input: The file to upload, as an Data object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success + /// or a `Files.PaperCreateError` object on failure. + @objc + @discardableResult public func paperCreateData(path: String, importFormat: DBXFilesImportFormat, input: Data) -> DBXFilesPaperCreateUploadRequest { + let swift = swift.paperCreate(path: path, importFormat: importFormat.swift, input: input) + return DBXFilesPaperCreateUploadRequest(swift: swift) + } + + /// Creates a new Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - parameter path: The fully qualified path to the location in the user's Dropbox where the Paper Doc should be + /// created. This should include the document's title and end with .paper. + /// - parameter importFormat: The format of the provided data. + /// - parameter input: The file to upload, as an URL object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success + /// or a `Files.PaperCreateError` object on failure. + @objc + @discardableResult public func paperCreateURL(path: String, importFormat: DBXFilesImportFormat, input: URL) -> DBXFilesPaperCreateUploadRequest { + let swift = swift.paperCreate(path: path, importFormat: importFormat.swift, input: input) + return DBXFilesPaperCreateUploadRequest(swift: swift) + } + + /// Creates a new Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - parameter path: The fully qualified path to the location in the user's Dropbox where the Paper Doc should be + /// created. This should include the document's title and end with .paper. + /// - parameter importFormat: The format of the provided data. + /// - parameter input: The file to upload, as an InputStream object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperCreateResult` object on success + /// or a `Files.PaperCreateError` object on failure. + @objc + @discardableResult public func paperCreateInputStream( + path: String, + importFormat: DBXFilesImportFormat, + input: InputStream + ) -> DBXFilesPaperCreateUploadRequest { + let swift = swift.paperCreate(path: path, importFormat: importFormat.swift, input: input) + return DBXFilesPaperCreateUploadRequest(swift: swift) + } + + /// Updates an existing Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - parameter path: Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will + /// be returned. + /// - parameter importFormat: The format of the provided data. + /// - parameter docUpdatePolicy: How the provided content should be applied to the doc. + /// - parameter paperRevision: The latest doc revision. Required when doc_update_policy is update. This value must + /// match the current revision of the doc or error revision_mismatch will be returned. + /// - parameter input: The file to upload, as an Data object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// or a `Files.PaperUpdateError` object on failure. + @objc + @discardableResult public func paperUpdateData( + path: String, + importFormat: DBXFilesImportFormat, + docUpdatePolicy: DBXFilesPaperDocUpdatePolicy, + paperRevision: NSNumber?, + input: Data + ) -> DBXFilesPaperUpdateUploadRequest { + let swift = swift.paperUpdate( + path: path, + importFormat: importFormat.swift, + docUpdatePolicy: docUpdatePolicy.swift, + paperRevision: paperRevision?.int64Value, + input: input + ) + return DBXFilesPaperUpdateUploadRequest(swift: swift) + } + + /// Updates an existing Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// or a `Files.PaperUpdateError` object on failure. + @objc + @discardableResult public func paperUpdateData( + path: String, + importFormat: DBXFilesImportFormat, + docUpdatePolicy: DBXFilesPaperDocUpdatePolicy, + input: Data + ) -> DBXFilesPaperUpdateUploadRequest { + let swift = swift.paperUpdate(path: path, importFormat: importFormat.swift, docUpdatePolicy: docUpdatePolicy.swift, input: input) + return DBXFilesPaperUpdateUploadRequest(swift: swift) + } + + /// Updates an existing Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - parameter path: Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will + /// be returned. + /// - parameter importFormat: The format of the provided data. + /// - parameter docUpdatePolicy: How the provided content should be applied to the doc. + /// - parameter paperRevision: The latest doc revision. Required when doc_update_policy is update. This value must + /// match the current revision of the doc or error revision_mismatch will be returned. + /// - parameter input: The file to upload, as an URL object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// or a `Files.PaperUpdateError` object on failure. + @objc + @discardableResult public func paperUpdateURL( + path: String, + importFormat: DBXFilesImportFormat, + docUpdatePolicy: DBXFilesPaperDocUpdatePolicy, + paperRevision: NSNumber?, + input: URL + ) -> DBXFilesPaperUpdateUploadRequest { + let swift = swift.paperUpdate( + path: path, + importFormat: importFormat.swift, + docUpdatePolicy: docUpdatePolicy.swift, + paperRevision: paperRevision?.int64Value, + input: input + ) + return DBXFilesPaperUpdateUploadRequest(swift: swift) + } + + /// Updates an existing Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// or a `Files.PaperUpdateError` object on failure. + @objc + @discardableResult public func paperUpdateURL( + path: String, + importFormat: DBXFilesImportFormat, + docUpdatePolicy: DBXFilesPaperDocUpdatePolicy, + input: URL + ) -> DBXFilesPaperUpdateUploadRequest { + let swift = swift.paperUpdate(path: path, importFormat: importFormat.swift, docUpdatePolicy: docUpdatePolicy.swift, input: input) + return DBXFilesPaperUpdateUploadRequest(swift: swift) + } + + /// Updates an existing Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - parameter path: Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will + /// be returned. + /// - parameter importFormat: The format of the provided data. + /// - parameter docUpdatePolicy: How the provided content should be applied to the doc. + /// - parameter paperRevision: The latest doc revision. Required when doc_update_policy is update. This value must + /// match the current revision of the doc or error revision_mismatch will be returned. + /// - parameter input: The file to upload, as an InputStream object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// or a `Files.PaperUpdateError` object on failure. + @objc + @discardableResult public func paperUpdateInputStream( + path: String, + importFormat: DBXFilesImportFormat, + docUpdatePolicy: DBXFilesPaperDocUpdatePolicy, + paperRevision: NSNumber?, + input: InputStream + ) -> DBXFilesPaperUpdateUploadRequest { + let swift = swift.paperUpdate( + path: path, + importFormat: importFormat.swift, + docUpdatePolicy: docUpdatePolicy.swift, + paperRevision: paperRevision?.int64Value, + input: input + ) + return DBXFilesPaperUpdateUploadRequest(swift: swift) + } + + /// Updates an existing Paper doc with the provided content. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.PaperUpdateResult` object on success + /// or a `Files.PaperUpdateError` object on failure. + @objc + @discardableResult public func paperUpdateInputStream( + path: String, + importFormat: DBXFilesImportFormat, + docUpdatePolicy: DBXFilesPaperDocUpdatePolicy, + input: InputStream + ) -> DBXFilesPaperUpdateUploadRequest { + let swift = swift.paperUpdate(path: path, importFormat: importFormat.swift, docUpdatePolicy: docUpdatePolicy.swift, input: input) + return DBXFilesPaperUpdateUploadRequest(swift: swift) + } + + /// Permanently delete the file or folder at a given path (see https://www.dropbox.com/en/help/40). If the given + /// file or folder is not yet deleted, this route will first delete it. It is possible for this route to + /// successfully delete, then fail to permanently delete. Note: This endpoint is only available for Dropbox + /// Business apps. + /// + /// - scope: files.permanent_delete + /// + /// - parameter path: Path in the user's Dropbox to delete. + /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does + /// not support deleting a folder. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.DeleteError` object on failure. + @objc + @discardableResult public func permanentlyDelete(path: String, parentRev: String?) -> DBXFilesPermanentlyDeleteRpcRequest { + let swift = swift.permanentlyDelete(path: path, parentRev: parentRev) + return DBXFilesPermanentlyDeleteRpcRequest(swift: swift) + } + + /// Permanently delete the file or folder at a given path (see https://www.dropbox.com/en/help/40). If the given + /// file or folder is not yet deleted, this route will first delete it. It is possible for this route to + /// successfully delete, then fail to permanently delete. Note: This endpoint is only available for Dropbox + /// Business apps. + /// + /// - scope: files.permanent_delete + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.DeleteError` object on failure. + @objc + @discardableResult public func permanentlyDelete(path: String) -> DBXFilesPermanentlyDeleteRpcRequest { + let swift = swift.permanentlyDelete(path: path) + return DBXFilesPermanentlyDeleteRpcRequest(swift: swift) + } + + /// Restore a specific revision of a file to the given path. + /// + /// - scope: files.content.write + /// + /// - parameter path: The path to save the restored file. + /// - parameter rev: The revision to restore. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.RestoreError` object on failure. + @objc + @discardableResult public func restore(path: String, rev: String) -> DBXFilesRestoreRpcRequest { + let swift = swift.restore(path: path, rev: rev) + return DBXFilesRestoreRpcRequest(swift: swift) + } + + /// Save the data from a specified URL into a file in user's Dropbox. Note that the transfer from the URL must + /// complete within 15 minutes, or the operation will time out and the job will fail. If the given path already + /// exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt). + /// + /// - scope: files.content.write + /// + /// - parameter path: The path in Dropbox where the URL will be saved to. + /// - parameter url: The URL to be saved. + /// + /// - returns: Through the response callback, the caller will receive a `Files.SaveUrlResult` object on success or a + /// `Files.SaveUrlError` object on failure. + @objc + @discardableResult public func saveUrl(path: String, url: String) -> DBXFilesSaveUrlRpcRequest { + let swift = swift.saveUrl(path: path, url: url) + return DBXFilesSaveUrlRpcRequest(swift: swift) + } + + /// Check the status of a saveUrl job. + /// + /// - scope: files.content.write + /// + /// - 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 `Files.SaveUrlJobStatus` object on success + /// or a `Async.PollError` object on failure. + @objc + @discardableResult public func saveUrlCheckJobStatus(asyncJobId: String) -> DBXFilesSaveUrlCheckJobStatusRpcRequest { + let swift = swift.saveUrlCheckJobStatus(asyncJobId: asyncJobId) + return DBXFilesSaveUrlCheckJobStatusRpcRequest(swift: swift) + } + + /// Searches for files and folders. Note: searchV2 along with searchContinueV2 can only be used to retrieve a + /// maximum of 10,000 matches. Recent changes may not immediately be reflected in search results due to a short + /// delay in indexing. Duplicate results may be returned across pages. Some results may not be returned. + /// + /// - scope: files.metadata.read + /// + /// - parameter query: The string to search for. May match across multiple fields based on the request arguments. + /// - parameter options: Options for more targeted search results. + /// - parameter matchFieldOptions: Options for search results match fields. + /// - parameter includeHighlights: Deprecated and moved this option to SearchMatchFieldOptions. + /// + /// - returns: Through the response callback, the caller will receive a `Files.SearchV2Result` object on success or + /// a `Files.SearchError` object on failure. + @objc + @discardableResult public func searchV2( + query: String, + options: DBXFilesSearchOptions?, + matchFieldOptions: DBXFilesSearchMatchFieldOptions?, + includeHighlights: NSNumber? + ) -> DBXFilesSearchRpcRequestV2 { + let swift = swift.searchV2( + query: query, + options: options?.swift, + matchFieldOptions: matchFieldOptions?.swift, + includeHighlights: includeHighlights?.boolValue + ) + return DBXFilesSearchRpcRequestV2(swift: swift) + } + + /// Searches for files and folders. Note: searchV2 along with searchContinueV2 can only be used to retrieve a + /// maximum of 10,000 matches. Recent changes may not immediately be reflected in search results due to a short + /// delay in indexing. Duplicate results may be returned across pages. Some results may not be returned. + /// + /// - scope: files.metadata.read + /// + /// - returns: Through the response callback, the caller will receive a `Files.SearchV2Result` object on success or + /// a `Files.SearchError` object on failure. + @objc + @discardableResult public func searchV2(query: String) -> DBXFilesSearchRpcRequestV2 { + let swift = swift.searchV2(query: query) + return DBXFilesSearchRpcRequestV2(swift: swift) + } + + /// Fetches the next page of search results returned from searchV2. Note: searchV2 along with searchContinueV2 can + /// only be used to retrieve a maximum of 10,000 matches. Recent changes may not immediately be reflected in + /// search results due to a short delay in indexing. Duplicate results may be returned across pages. Some + /// results may not be returned. + /// + /// - scope: files.metadata.read + /// + /// - parameter cursor: The cursor returned by your last call to searchV2. Used to fetch the next page of results. + /// + /// - returns: Through the response callback, the caller will receive a `Files.SearchV2Result` object on success or + /// a `Files.SearchError` object on failure. + @objc + @discardableResult public func searchContinueV2(cursor: String) -> DBXFilesSearchContinueRpcRequestV2 { + let swift = swift.searchContinueV2(cursor: cursor) + return DBXFilesSearchContinueRpcRequestV2(swift: swift) + } + + /// Add a tag to an item. A tag is a string. The strings are automatically converted to lowercase letters. No more + /// than 20 tags can be added to a given item. + /// + /// - scope: files.metadata.write + /// + /// - parameter path: Path to the item to be tagged. + /// - parameter tagText: The value of the tag to add. Will be automatically converted to lowercase letters. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.AddTagError` object on failure. + @objc + @discardableResult public func tagsAdd(path: String, tagText: String) -> DBXFilesTagsAddRpcRequest { + let swift = swift.tagsAdd(path: path, tagText: tagText) + return DBXFilesTagsAddRpcRequest(swift: swift) + } + + /// Get list of tags assigned to items. + /// + /// - scope: files.metadata.read + /// + /// - parameter paths: Path to the items. + /// + /// - returns: Through the response callback, the caller will receive a `Files.GetTagsResult` object on success or a + /// `Files.BaseTagError` object on failure. + @objc + @discardableResult public func tagsGet(paths: [String]) -> DBXFilesTagsGetRpcRequest { + let swift = swift.tagsGet(paths: paths) + return DBXFilesTagsGetRpcRequest(swift: swift) + } + + /// Remove a tag from an item. + /// + /// - scope: files.metadata.write + /// + /// - parameter path: Path to the item to tag. + /// - parameter tagText: The tag to remove. Will be automatically converted to lowercase letters. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.RemoveTagError` object on failure. + @objc + @discardableResult public func tagsRemove(path: String, tagText: String) -> DBXFilesTagsRemoveRpcRequest { + let swift = swift.tagsRemove(path: path, tagText: tagText) + return DBXFilesTagsRemoveRpcRequest(swift: swift) + } + + /// Unlock the files at the given paths. A locked file can only be unlocked by the lock holder or, if a business + /// account, a team admin. A successful response indicates that the file has been unlocked. Returns a list of + /// the unlocked file paths and their metadata after this operation. + /// + /// - scope: files.content.write + /// + /// - parameter entries: List of 'entries'. Each 'entry' contains a path of the file which will be unlocked. + /// Duplicate path arguments in the batch are considered only once. + /// + /// - returns: Through the response callback, the caller will receive a `Files.LockFileBatchResult` object on + /// success or a `Files.LockFileError` object on failure. + @objc + @discardableResult public func unlockFileBatch(entries: [DBXFilesUnlockFileArg]) -> DBXFilesUnlockFileBatchRpcRequest { + let swift = swift.unlockFileBatch(entries: entries.map(\.swift)) + return DBXFilesUnlockFileBatchRpcRequest(swift: swift) + } + + /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 + /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an Data object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadError` object on failure. + @objc + @discardableResult public func uploadData( + path: String, + mode: DBXFilesWriteMode, + autorename: NSNumber, + clientModified: Date?, + mute: NSNumber, + propertyGroups: [DBXFilePropertiesPropertyGroup]?, + strictConflict: NSNumber, + contentHash: String?, + input: Data + ) -> DBXFilesUploadUploadRequest { + let swift = swift.upload( + path: path, + mode: mode.swift, + autorename: autorename.boolValue, + clientModified: clientModified, + mute: mute.boolValue, + propertyGroups: propertyGroups?.map(\.swift), + strictConflict: strictConflict.boolValue, + contentHash: contentHash, + input: input + ) + return DBXFilesUploadUploadRequest(swift: swift) + } + + /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 + /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadError` object on failure. + @objc + @discardableResult public func uploadData(path: String, input: Data) -> DBXFilesUploadUploadRequest { + let swift = swift.upload(path: path, input: input) + return DBXFilesUploadUploadRequest(swift: swift) + } + + /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 + /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an URL object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadError` object on failure. + @objc + @discardableResult public func uploadURL( + path: String, + mode: DBXFilesWriteMode, + autorename: NSNumber, + clientModified: Date?, + mute: NSNumber, + propertyGroups: [DBXFilePropertiesPropertyGroup]?, + strictConflict: NSNumber, + contentHash: String?, + input: URL + ) -> DBXFilesUploadUploadRequest { + let swift = swift.upload( + path: path, + mode: mode.swift, + autorename: autorename.boolValue, + clientModified: clientModified, + mute: mute.boolValue, + propertyGroups: propertyGroups?.map(\.swift), + strictConflict: strictConflict.boolValue, + contentHash: contentHash, + input: input + ) + return DBXFilesUploadUploadRequest(swift: swift) + } + + /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 + /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadError` object on failure. + @objc + @discardableResult public func uploadURL(path: String, input: URL) -> DBXFilesUploadUploadRequest { + let swift = swift.upload(path: path, input: input) + return DBXFilesUploadUploadRequest(swift: swift) + } + + /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 + /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an InputStream object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadError` object on failure. + @objc + @discardableResult public func uploadInputStream( + path: String, + mode: DBXFilesWriteMode, + autorename: NSNumber, + clientModified: Date?, + mute: NSNumber, + propertyGroups: [DBXFilePropertiesPropertyGroup]?, + strictConflict: NSNumber, + contentHash: String?, + input: InputStream + ) -> DBXFilesUploadUploadRequest { + let swift = swift.upload( + path: path, + mode: mode.swift, + autorename: autorename.boolValue, + clientModified: clientModified, + mute: mute.boolValue, + propertyGroups: propertyGroups?.map(\.swift), + strictConflict: strictConflict.boolValue, + contentHash: contentHash, + input: input + ) + return DBXFilesUploadUploadRequest(swift: swift) + } + + /// Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 + /// MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadError` object on failure. + @objc + @discardableResult public func uploadInputStream(path: String, input: InputStream) -> DBXFilesUploadUploadRequest { + let swift = swift.upload(path: path, input: input) + return DBXFilesUploadUploadRequest(swift: swift) + } + + /// Append more data to an upload session. When the parameter close is set, this call will close the session. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter cursor: Contains the upload session ID and the offset. + /// - parameter close: If true, the current session will be closed, at which point you won't be able to call + /// uploadSessionAppendV2 anymore with the current session. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an Data object. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.UploadSessionAppendError` object on failure. + @objc + @discardableResult public func uploadSessionAppendV2Data( + cursor: DBXFilesUploadSessionCursor, + close: NSNumber, + contentHash: String?, + input: Data + ) -> DBXFilesUploadSessionAppendUploadRequestV2 { + let swift = swift.uploadSessionAppendV2(cursor: cursor.swift, close: close.boolValue, contentHash: contentHash, input: input) + return DBXFilesUploadSessionAppendUploadRequestV2(swift: swift) + } + + /// Append more data to an upload session. When the parameter close is set, this call will close the session. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.UploadSessionAppendError` object on failure. + @objc + @discardableResult public func uploadSessionAppendV2Data(cursor: DBXFilesUploadSessionCursor, input: Data) -> DBXFilesUploadSessionAppendUploadRequestV2 { + let swift = swift.uploadSessionAppendV2(cursor: cursor.swift, input: input) + return DBXFilesUploadSessionAppendUploadRequestV2(swift: swift) + } + + /// Append more data to an upload session. When the parameter close is set, this call will close the session. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter cursor: Contains the upload session ID and the offset. + /// - parameter close: If true, the current session will be closed, at which point you won't be able to call + /// uploadSessionAppendV2 anymore with the current session. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an URL object. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.UploadSessionAppendError` object on failure. + @objc + @discardableResult public func uploadSessionAppendV2URL( + cursor: DBXFilesUploadSessionCursor, + close: NSNumber, + contentHash: String?, + input: URL + ) -> DBXFilesUploadSessionAppendUploadRequestV2 { + let swift = swift.uploadSessionAppendV2(cursor: cursor.swift, close: close.boolValue, contentHash: contentHash, input: input) + return DBXFilesUploadSessionAppendUploadRequestV2(swift: swift) + } + + /// Append more data to an upload session. When the parameter close is set, this call will close the session. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.UploadSessionAppendError` object on failure. + @objc + @discardableResult public func uploadSessionAppendV2URL(cursor: DBXFilesUploadSessionCursor, input: URL) -> DBXFilesUploadSessionAppendUploadRequestV2 { + let swift = swift.uploadSessionAppendV2(cursor: cursor.swift, input: input) + return DBXFilesUploadSessionAppendUploadRequestV2(swift: swift) + } + + /// Append more data to an upload session. When the parameter close is set, this call will close the session. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter cursor: Contains the upload session ID and the offset. + /// - parameter close: If true, the current session will be closed, at which point you won't be able to call + /// uploadSessionAppendV2 anymore with the current session. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an InputStream object. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.UploadSessionAppendError` object on failure. + @objc + @discardableResult public func uploadSessionAppendV2InputStream( + cursor: DBXFilesUploadSessionCursor, + close: NSNumber, + contentHash: String?, + input: InputStream + ) -> DBXFilesUploadSessionAppendUploadRequestV2 { + let swift = swift.uploadSessionAppendV2(cursor: cursor.swift, close: close.boolValue, contentHash: contentHash, input: input) + return DBXFilesUploadSessionAppendUploadRequestV2(swift: swift) + } + + /// Append more data to an upload session. When the parameter close is set, this call will close the session. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams + /// with a limit on the number of data transport calls allowed per month. For more information, see the Data + /// transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Files.UploadSessionAppendError` object on failure. + @objc + @discardableResult public func uploadSessionAppendV2InputStream( + cursor: DBXFilesUploadSessionCursor, + input: InputStream + ) -> DBXFilesUploadSessionAppendUploadRequestV2 { + let swift = swift.uploadSessionAppendV2(cursor: cursor.swift, input: input) + return DBXFilesUploadSessionAppendUploadRequestV2(swift: swift) + } + + /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload + /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter cursor: Contains the upload session ID and the offset. + /// - parameter commit: Contains the path and other optional modifiers for the commit. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an Data object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadSessionFinishError` object on failure. + @objc + @discardableResult public func uploadSessionFinishData( + cursor: DBXFilesUploadSessionCursor, + commit: DBXFilesCommitInfo, + contentHash: String?, + input: Data + ) -> DBXFilesUploadSessionFinishUploadRequest { + let swift = swift.uploadSessionFinish(cursor: cursor.swift, commit: commit.swift, contentHash: contentHash, input: input) + return DBXFilesUploadSessionFinishUploadRequest(swift: swift) + } + + /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload + /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadSessionFinishError` object on failure. + @objc + @discardableResult public func uploadSessionFinishData( + cursor: DBXFilesUploadSessionCursor, + commit: DBXFilesCommitInfo, + input: Data + ) -> DBXFilesUploadSessionFinishUploadRequest { + let swift = swift.uploadSessionFinish(cursor: cursor.swift, commit: commit.swift, input: input) + return DBXFilesUploadSessionFinishUploadRequest(swift: swift) + } + + /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload + /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter cursor: Contains the upload session ID and the offset. + /// - parameter commit: Contains the path and other optional modifiers for the commit. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an URL object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadSessionFinishError` object on failure. + @objc + @discardableResult public func uploadSessionFinishURL( + cursor: DBXFilesUploadSessionCursor, + commit: DBXFilesCommitInfo, + contentHash: String?, + input: URL + ) -> DBXFilesUploadSessionFinishUploadRequest { + let swift = swift.uploadSessionFinish(cursor: cursor.swift, commit: commit.swift, contentHash: contentHash, input: input) + return DBXFilesUploadSessionFinishUploadRequest(swift: swift) + } + + /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload + /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadSessionFinishError` object on failure. + @objc + @discardableResult public func uploadSessionFinishURL( + cursor: DBXFilesUploadSessionCursor, + commit: DBXFilesCommitInfo, + input: URL + ) -> DBXFilesUploadSessionFinishUploadRequest { + let swift = swift.uploadSessionFinish(cursor: cursor.swift, commit: commit.swift, input: input) + return DBXFilesUploadSessionFinishUploadRequest(swift: swift) + } + + /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload + /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter cursor: Contains the upload session ID and the offset. + /// - parameter commit: Contains the path and other optional modifiers for the commit. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an InputStream object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadSessionFinishError` object on failure. + @objc + @discardableResult public func uploadSessionFinishInputStream( + cursor: DBXFilesUploadSessionCursor, + commit: DBXFilesCommitInfo, + contentHash: String?, + input: InputStream + ) -> DBXFilesUploadSessionFinishUploadRequest { + let swift = swift.uploadSessionFinish(cursor: cursor.swift, commit: commit.swift, contentHash: contentHash, input: input) + return DBXFilesUploadSessionFinishUploadRequest(swift: swift) + } + + /// Finish an upload session and save the uploaded data to the given file path. A single request should not upload + /// more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this + /// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of + /// data transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a + /// `Files.UploadSessionFinishError` object on failure. + @objc + @discardableResult public func uploadSessionFinishInputStream( + cursor: DBXFilesUploadSessionCursor, + commit: DBXFilesCommitInfo, + input: InputStream + ) -> DBXFilesUploadSessionFinishUploadRequest { + let swift = swift.uploadSessionFinish(cursor: cursor.swift, commit: commit.swift, input: input) + return DBXFilesUploadSessionFinishUploadRequest(swift: swift) + } + + /// This route helps you commit many files at once into a user's Dropbox. Use uploadSessionStart and + /// uploadSessionAppendV2 to upload file contents. We recommend uploading many files in parallel to increase + /// throughput. Once the file contents have been uploaded, rather than calling uploadSessionFinish, use this + /// route to finish all your upload sessions in a single request. close in UploadSessionStartArg or close in + /// UploadSessionAppendArg needs to be true for the last uploadSessionStart or uploadSessionAppendV2 call of + /// each upload session. The maximum size of a file one can upload to an upload session is 350 GB. We allow up + /// to 1000 entries in a single request. Calls to this endpoint will count as data transport calls for any + /// Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more + /// information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter entries: Commit information for each file in the batch. + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionFinishBatchResult` + /// object on success or a `Void` object on failure. + @objc + @discardableResult public func uploadSessionFinishBatchV2(entries: [DBXFilesUploadSessionFinishArg]) -> DBXFilesUploadSessionFinishBatchRpcRequestV2 { + let swift = swift.uploadSessionFinishBatchV2(entries: entries.map(\.swift)) + return DBXFilesUploadSessionFinishBatchRpcRequestV2(swift: swift) + } + + /// Returns the status of an asynchronous job for uploadSessionFinishBatch. If success, it returns list of result + /// for each entry. + /// + /// - scope: files.content.write + /// + /// - 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 `Files.UploadSessionFinishBatchJobStatus` + /// object on success or a `Async.PollError` object on failure. + @objc + @discardableResult public func uploadSessionFinishBatchCheck(asyncJobId: String) -> DBXFilesUploadSessionFinishBatchCheckRpcRequest { + let swift = swift.uploadSessionFinishBatchCheck(asyncJobId: asyncJobId) + return DBXFilesUploadSessionFinishBatchCheckRpcRequest(swift: swift) + } + + /// Upload sessions allow you to upload a single file in one or more requests, for example where the size of the + /// file is greater than 150 MB. This call starts a new upload session with the given data. You can then use + /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write + /// + /// - parameter close: If true, the current session will be closed, at which point you won't be able to call + /// uploadSessionAppendV2 anymore with the current session. + /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in + /// UploadSessionType. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an Data object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// success or a `Files.UploadSessionStartError` object on failure. + @objc + @discardableResult public func uploadSessionStartData( + close: NSNumber, + sessionType: DBXFilesUploadSessionType?, + contentHash: String?, + input: Data + ) -> DBXFilesUploadSessionStartUploadRequest { + let swift = swift.uploadSessionStart(close: close.boolValue, sessionType: sessionType?.swift, contentHash: contentHash, input: input) + return DBXFilesUploadSessionStartUploadRequest(swift: swift) + } + + /// Upload sessions allow you to upload a single file in one or more requests, for example where the size of the + /// file is greater than 150 MB. This call starts a new upload session with the given data. You can then use + /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// success or a `Files.UploadSessionStartError` object on failure. + @objc + @discardableResult public func uploadSessionStartData(input: Data) -> DBXFilesUploadSessionStartUploadRequest { + let swift = swift.uploadSessionStart(input: input) + return DBXFilesUploadSessionStartUploadRequest(swift: swift) + } + + /// Upload sessions allow you to upload a single file in one or more requests, for example where the size of the + /// file is greater than 150 MB. This call starts a new upload session with the given data. You can then use + /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write + /// + /// - parameter close: If true, the current session will be closed, at which point you won't be able to call + /// uploadSessionAppendV2 anymore with the current session. + /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in + /// UploadSessionType. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an URL object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// success or a `Files.UploadSessionStartError` object on failure. + @objc + @discardableResult public func uploadSessionStartURL( + close: NSNumber, + sessionType: DBXFilesUploadSessionType?, + contentHash: String?, + input: URL + ) -> DBXFilesUploadSessionStartUploadRequest { + let swift = swift.uploadSessionStart(close: close.boolValue, sessionType: sessionType?.swift, contentHash: contentHash, input: input) + return DBXFilesUploadSessionStartUploadRequest(swift: swift) + } + + /// Upload sessions allow you to upload a single file in one or more requests, for example where the size of the + /// file is greater than 150 MB. This call starts a new upload session with the given data. You can then use + /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// success or a `Files.UploadSessionStartError` object on failure. + @objc + @discardableResult public func uploadSessionStartURL(input: URL) -> DBXFilesUploadSessionStartUploadRequest { + let swift = swift.uploadSessionStart(input: input) + return DBXFilesUploadSessionStartUploadRequest(swift: swift) + } + + /// Upload sessions allow you to upload a single file in one or more requests, for example where the size of the + /// file is greater than 150 MB. This call starts a new upload session with the given data. You can then use + /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write + /// + /// - parameter close: If true, the current session will be closed, at which point you won't be able to call + /// uploadSessionAppendV2 anymore with the current session. + /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in + /// UploadSessionType. + /// - parameter contentHash: A hash of the file content uploaded in this call. If provided and the uploaded content + /// does not match this hash, an error will be returned. For more information see our Content hash + /// https://www.dropbox.com/developers/reference/content-hash page. + /// - parameter input: The file to upload, as an InputStream object. + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// success or a `Files.UploadSessionStartError` object on failure. + @objc + @discardableResult public func uploadSessionStartInputStream( + close: NSNumber, + sessionType: DBXFilesUploadSessionType?, + contentHash: String?, + input: InputStream + ) -> DBXFilesUploadSessionStartUploadRequest { + let swift = swift.uploadSessionStart(close: close.boolValue, sessionType: sessionType?.swift, contentHash: contentHash, input: input) + return DBXFilesUploadSessionStartUploadRequest(swift: swift) + } + + /// Upload sessions allow you to upload a single file in one or more requests, for example where the size of the + /// file is greater than 150 MB. This call starts a new upload session with the given data. You can then use + /// uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A + /// single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload + /// session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in + /// UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its + /// creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data + /// transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed + /// per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you + /// to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, + /// uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in + /// UploadSessionType upload session. To start a new concurrent session, set sessionType in + /// UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent + /// uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of + /// constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or + /// uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 + /// call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in + /// UploadSessionStartArg to true, that may contain any remaining data). + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartResult` object on + /// success or a `Files.UploadSessionStartError` object on failure. + @objc + @discardableResult public func uploadSessionStartInputStream(input: InputStream) -> DBXFilesUploadSessionStartUploadRequest { + let swift = swift.uploadSessionStart(input: input) + return DBXFilesUploadSessionStartUploadRequest(swift: swift) + } + + /// This route starts batch of upload_sessions. Please refer to `upload_session/start` usage. Calls to this endpoint + /// will count as data transport calls for any Dropbox Business teams with a limit on the number of data + /// transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in + /// UploadSessionType. + /// - parameter numSessions: The number of upload sessions to start. + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartBatchResult` object + /// on success or a `Void` object on failure. + @objc + @discardableResult public func uploadSessionStartBatch( + numSessions: NSNumber, + sessionType: DBXFilesUploadSessionType? + ) -> DBXFilesUploadSessionStartBatchRpcRequest { + let swift = swift.uploadSessionStartBatch(numSessions: numSessions.uint64Value, sessionType: sessionType?.swift) + return DBXFilesUploadSessionStartBatchRpcRequest(swift: swift) + } + + /// This route starts batch of upload_sessions. Please refer to `upload_session/start` usage. Calls to this endpoint + /// will count as data transport calls for any Dropbox Business teams with a limit on the number of data + /// transport calls allowed per month. For more information, see the Data transport limit page + /// https://www.dropbox.com/developers/reference/data-transport-limit. + /// + /// - scope: files.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Files.UploadSessionStartBatchResult` object + /// on success or a `Void` object on failure. + @objc + @discardableResult public func uploadSessionStartBatch(numSessions: NSNumber) -> DBXFilesUploadSessionStartBatchRpcRequest { + let swift = swift.uploadSessionStartBatch(numSessions: numSessions.uint64Value) + return DBXFilesUploadSessionStartBatchRpcRequest(swift: swift) + } +} + +@objc +public class DBXFilesAlphaGetMetadataRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesAlphaGetMetadataError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesAlphaGetMetadataError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesAlphaGetMetadataError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesAlphaGetMetadataError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesMetadata? + if let swift = result { + objc = DBXFilesMetadata(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 DBXFilesAlphaUploadUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesUploadError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesUploadError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesUploadError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesUploadError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesCopyRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationResult?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationResult?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesRelocationError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesRelocationError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesRelocationResult? + if let swift = result { + objc = DBXFilesRelocationResult(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 DBXFilesCopyRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesRelocationError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesRelocationError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesMetadata? + if let swift = result { + objc = DBXFilesMetadata(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 DBXFilesCopyBatchRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchV2Launch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchV2Launch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesRelocationBatchV2Launch? + if let swift = result { + objc = DBXFilesRelocationBatchV2Launch.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 DBXFilesCopyBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesRelocationBatchLaunch? + if let swift = result { + objc = DBXFilesRelocationBatchLaunch.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 DBXFilesCopyBatchCheckRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchV2JobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchV2JobStatus?, 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: DBXFilesRelocationBatchV2JobStatus? + if let swift = result { + objc = DBXFilesRelocationBatchV2JobStatus.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 DBXFilesCopyBatchCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchJobStatus?, 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: DBXFilesRelocationBatchJobStatus? + if let swift = result { + objc = DBXFilesRelocationBatchJobStatus.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 DBXFilesCopyReferenceGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesGetCopyReferenceResult?, DBXFilesGetCopyReferenceError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesGetCopyReferenceResult?, DBXFilesGetCopyReferenceError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesGetCopyReferenceError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesGetCopyReferenceError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesGetCopyReferenceResult? + if let swift = result { + objc = DBXFilesGetCopyReferenceResult(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 DBXFilesCopyReferenceSaveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesSaveCopyReferenceResult?, DBXFilesSaveCopyReferenceError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesSaveCopyReferenceResult?, DBXFilesSaveCopyReferenceError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesSaveCopyReferenceError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesSaveCopyReferenceError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesSaveCopyReferenceResult? + if let swift = result { + objc = DBXFilesSaveCopyReferenceResult(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 DBXFilesCreateFolderRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesCreateFolderResult?, DBXFilesCreateFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesCreateFolderResult?, DBXFilesCreateFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesCreateFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesCreateFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesCreateFolderResult? + if let swift = result { + objc = DBXFilesCreateFolderResult(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 DBXFilesCreateFolderRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFolderMetadata?, DBXFilesCreateFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFolderMetadata?, DBXFilesCreateFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesCreateFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesCreateFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFolderMetadata? + if let swift = result { + objc = DBXFilesFolderMetadata(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 DBXFilesCreateFolderBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesCreateFolderBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesCreateFolderBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesCreateFolderBatchLaunch? + if let swift = result { + objc = DBXFilesCreateFolderBatchLaunch.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 DBXFilesCreateFolderBatchCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesCreateFolderBatchJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesCreateFolderBatchJobStatus?, 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: DBXFilesCreateFolderBatchJobStatus? + if let swift = result { + objc = DBXFilesCreateFolderBatchJobStatus.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 DBXFilesDeleteRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesDeleteResult?, DBXFilesDeleteError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesDeleteResult?, DBXFilesDeleteError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesDeleteError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesDeleteError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesDeleteResult? + if let swift = result { + objc = DBXFilesDeleteResult(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 DBXFilesDeleteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesDeleteError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesDeleteError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesDeleteError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesDeleteError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesMetadata? + if let swift = result { + objc = DBXFilesMetadata(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 DBXFilesDeleteBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesDeleteBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesDeleteBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesDeleteBatchLaunch? + if let swift = result { + objc = DBXFilesDeleteBatchLaunch.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 DBXFilesDeleteBatchCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesDeleteBatchJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesDeleteBatchJobStatus?, 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: DBXFilesDeleteBatchJobStatus? + if let swift = result { + objc = DBXFilesDeleteBatchJobStatus.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 DBXFilesDownloadDownloadRequestFile: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, URL?, DBXFilesDownloadError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, URL?, DBXFilesDownloadError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesDownloadError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesDownloadError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + var destination: URL? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesDownloadDownloadRequestMemory: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, Data?, DBXFilesDownloadError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, Data?, DBXFilesDownloadError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesDownloadError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesDownloadError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + var destination: Data? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesDownloadZipDownloadRequestFile: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesDownloadZipResult?, URL?, DBXFilesDownloadZipError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesDownloadZipResult?, URL?, DBXFilesDownloadZipError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesDownloadZipError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesDownloadZipError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesDownloadZipResult? + var destination: URL? + if let swift = result { + objc = DBXFilesDownloadZipResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesDownloadZipDownloadRequestMemory: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesDownloadZipResult?, Data?, DBXFilesDownloadZipError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesDownloadZipResult?, Data?, DBXFilesDownloadZipError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesDownloadZipError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesDownloadZipError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesDownloadZipResult? + var destination: Data? + if let swift = result { + objc = DBXFilesDownloadZipResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesExportDownloadRequestFile: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesExportResult?, URL?, DBXFilesExportError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesExportResult?, URL?, DBXFilesExportError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesExportError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesExportError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesExportResult? + var destination: URL? + if let swift = result { + objc = DBXFilesExportResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesExportDownloadRequestMemory: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesExportResult?, Data?, DBXFilesExportError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesExportResult?, Data?, DBXFilesExportError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesExportError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesExportError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesExportResult? + var destination: Data? + if let swift = result { + objc = DBXFilesExportResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesGetFileLockBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesLockFileBatchResult?, DBXFilesLockFileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesLockFileBatchResult?, DBXFilesLockFileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesLockFileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesLockFileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesLockFileBatchResult? + if let swift = result { + objc = DBXFilesLockFileBatchResult(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 DBXFilesGetMetadataRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesGetMetadataError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesGetMetadataError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesGetMetadataError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesGetMetadataError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesMetadata? + if let swift = result { + objc = DBXFilesMetadata(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 DBXFilesGetPreviewDownloadRequestFile: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, URL?, DBXFilesPreviewError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, URL?, DBXFilesPreviewError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesPreviewError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesPreviewError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + var destination: URL? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesGetPreviewDownloadRequestMemory: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, Data?, DBXFilesPreviewError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, Data?, DBXFilesPreviewError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesPreviewError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesPreviewError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + var destination: Data? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesGetTemporaryLinkRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesGetTemporaryLinkResult?, DBXFilesGetTemporaryLinkError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesGetTemporaryLinkResult?, DBXFilesGetTemporaryLinkError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesGetTemporaryLinkError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesGetTemporaryLinkError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesGetTemporaryLinkResult? + if let swift = result { + objc = DBXFilesGetTemporaryLinkResult(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 DBXFilesGetTemporaryUploadLinkRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesGetTemporaryUploadLinkResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesGetTemporaryUploadLinkResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesGetTemporaryUploadLinkResult? + if let swift = result { + objc = DBXFilesGetTemporaryUploadLinkResult(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 DBXFilesGetThumbnailDownloadRequestFile: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, URL?, DBXFilesThumbnailError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, URL?, DBXFilesThumbnailError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesThumbnailError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesThumbnailError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + var destination: URL? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesGetThumbnailDownloadRequestMemory: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, Data?, DBXFilesThumbnailError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, Data?, DBXFilesThumbnailError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesThumbnailError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesThumbnailError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + var destination: Data? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesGetThumbnailDownloadRequestFileV2: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesPreviewResult?, URL?, DBXFilesThumbnailV2Error?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesPreviewResult?, URL?, DBXFilesThumbnailV2Error?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesThumbnailV2Error? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesThumbnailV2Error(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesPreviewResult? + var destination: URL? + if let swift = result { + objc = DBXFilesPreviewResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesGetThumbnailDownloadRequestMemoryV2: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesPreviewResult?, Data?, DBXFilesThumbnailV2Error?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesPreviewResult?, Data?, DBXFilesThumbnailV2Error?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesThumbnailV2Error? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesThumbnailV2Error(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesPreviewResult? + var destination: Data? + if let swift = result { + objc = DBXFilesPreviewResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesGetThumbnailBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesGetThumbnailBatchResult?, DBXFilesGetThumbnailBatchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesGetThumbnailBatchResult?, DBXFilesGetThumbnailBatchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesGetThumbnailBatchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesGetThumbnailBatchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesGetThumbnailBatchResult? + if let swift = result { + objc = DBXFilesGetThumbnailBatchResult(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 DBXFilesListFolderRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesListFolderResult?, DBXFilesListFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesListFolderResult?, DBXFilesListFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesListFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesListFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesListFolderResult? + if let swift = result { + objc = DBXFilesListFolderResult(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 DBXFilesListFolderContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesListFolderResult?, DBXFilesListFolderContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesListFolderResult?, DBXFilesListFolderContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesListFolderContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesListFolderContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesListFolderResult? + if let swift = result { + objc = DBXFilesListFolderResult(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 DBXFilesListFolderGetLatestCursorRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesListFolderGetLatestCursorResult?, DBXFilesListFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesListFolderGetLatestCursorResult?, DBXFilesListFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesListFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesListFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesListFolderGetLatestCursorResult? + if let swift = result { + objc = DBXFilesListFolderGetLatestCursorResult(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 DBXFilesListFolderLongpollRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesListFolderLongpollResult?, DBXFilesListFolderLongpollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesListFolderLongpollResult?, DBXFilesListFolderLongpollError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesListFolderLongpollError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesListFolderLongpollError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesListFolderLongpollResult? + if let swift = result { + objc = DBXFilesListFolderLongpollResult(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 DBXFilesListRevisionsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesListRevisionsResult?, DBXFilesListRevisionsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesListRevisionsResult?, DBXFilesListRevisionsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesListRevisionsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesListRevisionsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesListRevisionsResult? + if let swift = result { + objc = DBXFilesListRevisionsResult(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 DBXFilesLockFileBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesLockFileBatchResult?, DBXFilesLockFileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesLockFileBatchResult?, DBXFilesLockFileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesLockFileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesLockFileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesLockFileBatchResult? + if let swift = result { + objc = DBXFilesLockFileBatchResult(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 DBXFilesMoveRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationResult?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationResult?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesRelocationError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesRelocationError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesRelocationResult? + if let swift = result { + objc = DBXFilesRelocationResult(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 DBXFilesMoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesMetadata?, DBXFilesRelocationError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesRelocationError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesRelocationError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesMetadata? + if let swift = result { + objc = DBXFilesMetadata(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 DBXFilesMoveBatchRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchV2Launch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchV2Launch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesRelocationBatchV2Launch? + if let swift = result { + objc = DBXFilesRelocationBatchV2Launch.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 DBXFilesMoveBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesRelocationBatchLaunch? + if let swift = result { + objc = DBXFilesRelocationBatchLaunch.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 DBXFilesMoveBatchCheckRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchV2JobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchV2JobStatus?, 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: DBXFilesRelocationBatchV2JobStatus? + if let swift = result { + objc = DBXFilesRelocationBatchV2JobStatus.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 DBXFilesMoveBatchCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRelocationBatchJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRelocationBatchJobStatus?, 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: DBXFilesRelocationBatchJobStatus? + if let swift = result { + objc = DBXFilesRelocationBatchJobStatus.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 DBXFilesPaperCreateUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesPaperCreateResult?, DBXFilesPaperCreateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesPaperCreateResult?, DBXFilesPaperCreateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesPaperCreateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesPaperCreateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesPaperCreateResult? + if let swift = result { + objc = DBXFilesPaperCreateResult(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesPaperUpdateUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesPaperUpdateResult?, DBXFilesPaperUpdateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesPaperUpdateResult?, DBXFilesPaperUpdateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesPaperUpdateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesPaperUpdateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesPaperUpdateResult? + if let swift = result { + objc = DBXFilesPaperUpdateResult(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesPermanentlyDeleteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesDeleteError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesDeleteError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilesDeleteError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesDeleteError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilesPropertiesAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesAddPropertiesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesAddPropertiesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesAddPropertiesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesAddPropertiesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilesPropertiesOverwriteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesInvalidPropertyGroupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesInvalidPropertyGroupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesInvalidPropertyGroupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesInvalidPropertyGroupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilesPropertiesRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesRemovePropertiesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesRemovePropertiesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesRemovePropertiesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesRemovePropertiesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilesPropertiesTemplateGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesGetTemplateResult? + if let swift = result { + objc = DBXFilePropertiesGetTemplateResult(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 DBXFilesPropertiesTemplateListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesListTemplateResult? + if let swift = result { + objc = DBXFilePropertiesListTemplateResult(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 DBXFilesPropertiesUpdateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesUpdatePropertiesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesUpdatePropertiesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilePropertiesUpdatePropertiesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesUpdatePropertiesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilesRestoreRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesRestoreError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesRestoreError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesRestoreError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesRestoreError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + if let swift = result { + objc = DBXFilesFileMetadata(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 DBXFilesSaveUrlRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesSaveUrlResult?, DBXFilesSaveUrlError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesSaveUrlResult?, DBXFilesSaveUrlError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesSaveUrlError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesSaveUrlError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesSaveUrlResult? + if let swift = result { + objc = DBXFilesSaveUrlResult.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 DBXFilesSaveUrlCheckJobStatusRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesSaveUrlJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesSaveUrlJobStatus?, 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: DBXFilesSaveUrlJobStatus? + if let swift = result { + objc = DBXFilesSaveUrlJobStatus.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 DBXFilesSearchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesSearchResult?, DBXFilesSearchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesSearchResult?, DBXFilesSearchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesSearchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesSearchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesSearchResult? + if let swift = result { + objc = DBXFilesSearchResult(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 DBXFilesSearchRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesSearchV2Result?, DBXFilesSearchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesSearchV2Result?, DBXFilesSearchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesSearchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesSearchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesSearchV2Result? + if let swift = result { + objc = DBXFilesSearchV2Result(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 DBXFilesSearchContinueRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesSearchV2Result?, DBXFilesSearchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesSearchV2Result?, DBXFilesSearchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesSearchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesSearchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesSearchV2Result? + if let swift = result { + objc = DBXFilesSearchV2Result(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 DBXFilesTagsAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesAddTagError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesAddTagError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilesAddTagError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesAddTagError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilesTagsGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesGetTagsResult?, DBXFilesBaseTagError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesGetTagsResult?, DBXFilesBaseTagError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesBaseTagError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesBaseTagError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesGetTagsResult? + if let swift = result { + objc = DBXFilesGetTagsResult(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 DBXFilesTagsRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesRemoveTagError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesRemoveTagError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilesRemoveTagError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesRemoveTagError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXFilesUnlockFileBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesLockFileBatchResult?, DBXFilesLockFileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesLockFileBatchResult?, DBXFilesLockFileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesLockFileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesLockFileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesLockFileBatchResult? + if let swift = result { + objc = DBXFilesLockFileBatchResult(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 DBXFilesUploadUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesUploadError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesUploadError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesUploadError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesUploadError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesUploadSessionAppendUploadRequestV2: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesUploadSessionAppendError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesUploadSessionAppendError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilesUploadSessionAppendError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesUploadSessionAppendError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesUploadSessionAppendUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesUploadSessionAppendError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesUploadSessionAppendError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXFilesUploadSessionAppendError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesUploadSessionAppendError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesUploadSessionFinishUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesUploadSessionFinishError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesFileMetadata?, DBXFilesUploadSessionFinishError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesUploadSessionFinishError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesUploadSessionFinishError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesFileMetadata? + if let swift = result { + objc = DBXFilesFileMetadata(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesUploadSessionFinishBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesUploadSessionFinishBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesUploadSessionFinishBatchLaunch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesUploadSessionFinishBatchLaunch? + if let swift = result { + objc = DBXFilesUploadSessionFinishBatchLaunch.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 DBXFilesUploadSessionFinishBatchRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesUploadSessionFinishBatchResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesUploadSessionFinishBatchResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesUploadSessionFinishBatchResult? + if let swift = result { + objc = DBXFilesUploadSessionFinishBatchResult(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 DBXFilesUploadSessionFinishBatchCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesUploadSessionFinishBatchJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesUploadSessionFinishBatchJobStatus?, 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: DBXFilesUploadSessionFinishBatchJobStatus? + if let swift = result { + objc = DBXFilesUploadSessionFinishBatchJobStatus.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 DBXFilesUploadSessionStartUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesUploadSessionStartResult?, DBXFilesUploadSessionStartError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesUploadSessionStartResult?, DBXFilesUploadSessionStartError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilesUploadSessionStartError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilesUploadSessionStartError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilesUploadSessionStartResult? + if let swift = result { + objc = DBXFilesUploadSessionStartResult(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXFilesUploadSessionStartBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilesUploadSessionStartBatchResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilesUploadSessionStartBatchResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXFilesUploadSessionStartBatchResult? + if let swift = result { + objc = DBXFilesUploadSessionStartBatchResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenid.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenid.swift new file mode 100644 index 000000000..a80cfa1d5 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenid.swift @@ -0,0 +1,178 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the openid namespace +/// For Swift see openid + +/// Objective-C compatible OpenIdError union +@objc +public class DBXOpenidOpenIdError: NSObject { + let swift: Openid.OpenIdError + + public init(swift: Openid.OpenIdError) { + self.swift = swift + } + + public static func factory(swift: Openid.OpenIdError) -> DBXOpenidOpenIdError { + switch swift { + case .incorrectOpenidScopes: + return DBXOpenidOpenIdErrorIncorrectOpenidScopes() + case .other: + return DBXOpenidOpenIdErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIncorrectOpenidScopes: DBXOpenidOpenIdErrorIncorrectOpenidScopes? { + self as? DBXOpenidOpenIdErrorIncorrectOpenidScopes + } + + @objc + public var asOther: DBXOpenidOpenIdErrorOther? { + self as? DBXOpenidOpenIdErrorOther + } +} + +/// Missing openid claims for the associated access token. +@objc +public class DBXOpenidOpenIdErrorIncorrectOpenidScopes: DBXOpenidOpenIdError { + @objc + public init() { + let swift = Openid.OpenIdError.incorrectOpenidScopes + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXOpenidOpenIdErrorOther: DBXOpenidOpenIdError { + @objc + public init() { + let swift = Openid.OpenIdError.other + super.init(swift: swift) + } +} + +/// No Parameters +@objc +public class DBXOpenidUserInfoArgs: NSObject { + let swift: Openid.UserInfoArgs + + public init(swift: Openid.UserInfoArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserInfoError union +@objc +public class DBXOpenidUserInfoError: NSObject { + let swift: Openid.UserInfoError + + public init(swift: Openid.UserInfoError) { + self.swift = swift + } + + public static func factory(swift: Openid.UserInfoError) -> DBXOpenidUserInfoError { + switch swift { + case .openidError(let swiftArg): + let arg = DBXOpenidOpenIdError(swift: swiftArg) + return DBXOpenidUserInfoErrorOpenidError(arg) + case .other: + return DBXOpenidUserInfoErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOpenidError: DBXOpenidUserInfoErrorOpenidError? { + self as? DBXOpenidUserInfoErrorOpenidError + } + + @objc + public var asOther: DBXOpenidUserInfoErrorOther? { + self as? DBXOpenidUserInfoErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXOpenidUserInfoErrorOpenidError: DBXOpenidUserInfoError { + @objc + public var openidError: DBXOpenidOpenIdError + + @objc + public init(_ arg: DBXOpenidOpenIdError) { + self.openidError = arg + let swift = Openid.UserInfoError.openidError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXOpenidUserInfoErrorOther: DBXOpenidUserInfoError { + @objc + public init() { + let swift = Openid.UserInfoError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UserInfoResult struct +@objc +public class DBXOpenidUserInfoResult: NSObject { + /// Last name of user. + @objc + public var familyName: String? { swift.familyName } + /// First name of user. + @objc + public var givenName: String? { swift.givenName } + /// Email address of user. + @objc + public var email: String? { swift.email } + /// If user is email verified. + @objc + public var emailVerified: NSNumber? { swift.emailVerified as NSNumber? } + /// Issuer of token (in this case Dropbox). + @objc + public var iss: String { swift.iss } + /// An identifier for the user. This is the Dropbox account_id, a string value such as + /// dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc. + @objc + public var sub: String { swift.sub } + + @objc + public init(familyName: String?, givenName: String?, email: String?, emailVerified: NSNumber?, iss: String, sub: String) { + self.swift = Openid.UserInfoResult( + familyName: familyName, + givenName: givenName, + email: email, + emailVerified: emailVerified?.boolValue, + iss: iss, + sub: sub + ) + } + + let swift: Openid.UserInfoResult + + public init(swift: Openid.UserInfoResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenidRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenidRoutes.swift new file mode 100644 index 000000000..87498be53 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXOpenidRoutes.swift @@ -0,0 +1,102 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the openid namespace +/// For Swift routes see OpenidRoutes +@objc +public class DBXOpenidRoutes: NSObject { + private let swift: OpenidRoutes + init(swift: OpenidRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// This route is used for refreshing the info that is found in the id_token during the OIDC flow. This route + /// doesn't require any arguments and will use the scopes approved for the given access token. + /// + /// - scope: openid + /// + /// + /// - returns: Through the response callback, the caller will receive a `Openid.UserInfoResult` object on success or + /// a `Openid.UserInfoError` object on failure. + @objc + @discardableResult public func userinfo() -> DBXOpenidUserinfoRpcRequest { + let swift = swift.userinfo() + return DBXOpenidUserinfoRpcRequest(swift: swift) + } +} + +@objc +public class DBXOpenidUserinfoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXOpenidUserInfoResult?, DBXOpenidUserInfoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXOpenidUserInfoResult?, DBXOpenidUserInfoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXOpenidUserInfoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXOpenidUserInfoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXOpenidUserInfoResult? + if let swift = result { + objc = DBXOpenidUserInfoResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXPaper.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXPaper.swift new file mode 100644 index 000000000..2ac008e2a --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXPaper.swift @@ -0,0 +1,2712 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the paper namespace +/// For Swift see paper + +/// Objective-C compatible AddMember struct +@objc +public class DBXPaperAddMember: NSObject { + /// Permission for the user. + @objc + public var permissionLevel: DBXPaperPaperDocPermissionLevel { DBXPaperPaperDocPermissionLevel(swift: swift.permissionLevel) } + /// User which should be added to the Paper doc. Specify only email address or Dropbox account ID. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + + @objc + public init(member: DBXSharingMemberSelector, permissionLevel: DBXPaperPaperDocPermissionLevel) { + self.swift = Paper.AddMember(member: member.swift, permissionLevel: permissionLevel.swift) + } + + let swift: Paper.AddMember + + public init(swift: Paper.AddMember) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RefPaperDoc struct +@objc +public class DBXPaperRefPaperDoc: NSObject { + /// The Paper doc ID. + @objc + public var docId: String { swift.docId } + + @objc + public init(docId: String) { + self.swift = Paper.RefPaperDoc(docId: docId) + } + + let swift: Paper.RefPaperDoc + + public init(swift: Paper.RefPaperDoc) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AddPaperDocUser struct +@objc +public class DBXPaperAddPaperDocUser: DBXPaperRefPaperDoc { + /// User which should be added to the Paper doc. Specify only email address or Dropbox account ID. + @objc + public var members: [DBXPaperAddMember] { subSwift.members.map { DBXPaperAddMember(swift: $0) } } + /// A personal message that will be emailed to each successfully added member. + @objc + public var customMessage: String? { subSwift.customMessage } + /// Clients should set this to true if no email message shall be sent to added users. + @objc + public var quiet: NSNumber { subSwift.quiet as NSNumber } + + @objc + public init(docId: String, members: [DBXPaperAddMember], customMessage: String?, quiet: NSNumber) { + let swift = Paper.AddPaperDocUser(docId: docId, members: members.map(\.swift), customMessage: customMessage, quiet: quiet.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.AddPaperDocUser + + public init(swift: Paper.AddPaperDocUser) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Per-member result for docsUsersAdd. +@objc +public class DBXPaperAddPaperDocUserMemberResult: NSObject { + /// One of specified input members. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + /// The outcome of the action on this member. + @objc + public var result: DBXPaperAddPaperDocUserResult { DBXPaperAddPaperDocUserResult(swift: swift.result) } + + @objc + public init(member: DBXSharingMemberSelector, result: DBXPaperAddPaperDocUserResult) { + self.swift = Paper.AddPaperDocUserMemberResult(member: member.swift, result: result.swift) + } + + let swift: Paper.AddPaperDocUserMemberResult + + public init(swift: Paper.AddPaperDocUserMemberResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AddPaperDocUserResult union +@objc +public class DBXPaperAddPaperDocUserResult: NSObject { + let swift: Paper.AddPaperDocUserResult + + public init(swift: Paper.AddPaperDocUserResult) { + self.swift = swift + } + + public static func factory(swift: Paper.AddPaperDocUserResult) -> DBXPaperAddPaperDocUserResult { + switch swift { + case .success: + return DBXPaperAddPaperDocUserResultSuccess() + case .unknownError: + return DBXPaperAddPaperDocUserResultUnknownError() + case .sharingOutsideTeamDisabled: + return DBXPaperAddPaperDocUserResultSharingOutsideTeamDisabled() + case .dailyLimitReached: + return DBXPaperAddPaperDocUserResultDailyLimitReached() + case .userIsOwner: + return DBXPaperAddPaperDocUserResultUserIsOwner() + case .failedUserDataRetrieval: + return DBXPaperAddPaperDocUserResultFailedUserDataRetrieval() + case .permissionAlreadyGranted: + return DBXPaperAddPaperDocUserResultPermissionAlreadyGranted() + case .other: + return DBXPaperAddPaperDocUserResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXPaperAddPaperDocUserResultSuccess? { + self as? DBXPaperAddPaperDocUserResultSuccess + } + + @objc + public var asUnknownError: DBXPaperAddPaperDocUserResultUnknownError? { + self as? DBXPaperAddPaperDocUserResultUnknownError + } + + @objc + public var asSharingOutsideTeamDisabled: DBXPaperAddPaperDocUserResultSharingOutsideTeamDisabled? { + self as? DBXPaperAddPaperDocUserResultSharingOutsideTeamDisabled + } + + @objc + public var asDailyLimitReached: DBXPaperAddPaperDocUserResultDailyLimitReached? { + self as? DBXPaperAddPaperDocUserResultDailyLimitReached + } + + @objc + public var asUserIsOwner: DBXPaperAddPaperDocUserResultUserIsOwner? { + self as? DBXPaperAddPaperDocUserResultUserIsOwner + } + + @objc + public var asFailedUserDataRetrieval: DBXPaperAddPaperDocUserResultFailedUserDataRetrieval? { + self as? DBXPaperAddPaperDocUserResultFailedUserDataRetrieval + } + + @objc + public var asPermissionAlreadyGranted: DBXPaperAddPaperDocUserResultPermissionAlreadyGranted? { + self as? DBXPaperAddPaperDocUserResultPermissionAlreadyGranted + } + + @objc + public var asOther: DBXPaperAddPaperDocUserResultOther? { + self as? DBXPaperAddPaperDocUserResultOther + } +} + +/// User was successfully added to the Paper doc. +@objc +public class DBXPaperAddPaperDocUserResultSuccess: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.success + super.init(swift: swift) + } +} + +/// Something unexpected happened when trying to add the user to the Paper doc. +@objc +public class DBXPaperAddPaperDocUserResultUnknownError: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.unknownError + super.init(swift: swift) + } +} + +/// The Paper doc can be shared only with team members. +@objc +public class DBXPaperAddPaperDocUserResultSharingOutsideTeamDisabled: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.sharingOutsideTeamDisabled + super.init(swift: swift) + } +} + +/// The daily limit of how many users can be added to the Paper doc was reached. +@objc +public class DBXPaperAddPaperDocUserResultDailyLimitReached: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.dailyLimitReached + super.init(swift: swift) + } +} + +/// Owner's permissions cannot be changed. +@objc +public class DBXPaperAddPaperDocUserResultUserIsOwner: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.userIsOwner + super.init(swift: swift) + } +} + +/// User data could not be retrieved. Clients should retry. +@objc +public class DBXPaperAddPaperDocUserResultFailedUserDataRetrieval: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.failedUserDataRetrieval + super.init(swift: swift) + } +} + +/// This user already has the correct permission to the Paper doc. +@objc +public class DBXPaperAddPaperDocUserResultPermissionAlreadyGranted: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.permissionAlreadyGranted + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperAddPaperDocUserResultOther: DBXPaperAddPaperDocUserResult { + @objc + public init() { + let swift = Paper.AddPaperDocUserResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible Cursor struct +@objc +public class DBXPaperCursor: NSObject { + /// The actual cursor value. + @objc + public var value: String { swift.value } + /// Expiration time of value. Some cursors might have expiration time assigned. This is a UTC value after which + /// the cursor is no longer valid and the API starts returning an error. If cursor expires a new one needs + /// to be obtained and pagination needs to be restarted. Some cursors might be short-lived some cursors + /// might be long-lived. This really depends on the sorting type and order, e.g.: 1. on one hand, listing + /// docs created by the user, sorted by the created time ascending will have undefinite expiration because + /// the results cannot change while the iteration is happening. This cursor would be suitable for long term + /// polling. 2. on the other hand, listing docs sorted by the last modified time will have a very short + /// expiration as docs do get modified very often and the modified time can be changed while the iteration + /// is happening thus altering the results. + @objc + public var expiration: Date? { swift.expiration } + + @objc + public init(value: String, expiration: Date?) { + self.swift = Paper.Cursor(value: value, expiration: expiration) + } + + let swift: Paper.Cursor + + public init(swift: Paper.Cursor) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperApiBaseError union +@objc +public class DBXPaperPaperApiBaseError: NSObject { + let swift: Paper.PaperApiBaseError + + public init(swift: Paper.PaperApiBaseError) { + self.swift = swift + } + + public static func factory(swift: Paper.PaperApiBaseError) -> DBXPaperPaperApiBaseError { + switch swift { + case .insufficientPermissions: + return DBXPaperPaperApiBaseErrorInsufficientPermissions() + case .other: + return DBXPaperPaperApiBaseErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXPaperPaperApiBaseErrorInsufficientPermissions? { + self as? DBXPaperPaperApiBaseErrorInsufficientPermissions + } + + @objc + public var asOther: DBXPaperPaperApiBaseErrorOther? { + self as? DBXPaperPaperApiBaseErrorOther + } +} + +/// Your account does not have permissions to perform this action. This may be due to it only having access to +/// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide +/// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. +@objc +public class DBXPaperPaperApiBaseErrorInsufficientPermissions: DBXPaperPaperApiBaseError { + @objc + public init() { + let swift = Paper.PaperApiBaseError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperPaperApiBaseErrorOther: DBXPaperPaperApiBaseError { + @objc + public init() { + let swift = Paper.PaperApiBaseError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DocLookupError union +@objc +public class DBXPaperDocLookupError: NSObject { + let swift: Paper.DocLookupError + + public init(swift: Paper.DocLookupError) { + self.swift = swift + } + + public static func factory(swift: Paper.DocLookupError) -> DBXPaperDocLookupError { + switch swift { + case .insufficientPermissions: + return DBXPaperDocLookupErrorInsufficientPermissions() + case .other: + return DBXPaperDocLookupErrorOther() + case .docNotFound: + return DBXPaperDocLookupErrorDocNotFound() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXPaperDocLookupErrorInsufficientPermissions? { + self as? DBXPaperDocLookupErrorInsufficientPermissions + } + + @objc + public var asOther: DBXPaperDocLookupErrorOther? { + self as? DBXPaperDocLookupErrorOther + } + + @objc + public var asDocNotFound: DBXPaperDocLookupErrorDocNotFound? { + self as? DBXPaperDocLookupErrorDocNotFound + } +} + +/// Your account does not have permissions to perform this action. This may be due to it only having access to +/// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide +/// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. +@objc +public class DBXPaperDocLookupErrorInsufficientPermissions: DBXPaperDocLookupError { + @objc + public init() { + let swift = Paper.DocLookupError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperDocLookupErrorOther: DBXPaperDocLookupError { + @objc + public init() { + let swift = Paper.DocLookupError.other + super.init(swift: swift) + } +} + +/// The required doc was not found. +@objc +public class DBXPaperDocLookupErrorDocNotFound: DBXPaperDocLookupError { + @objc + public init() { + let swift = Paper.DocLookupError.docNotFound + super.init(swift: swift) + } +} + +/// The subscription level of a Paper doc. +@objc +public class DBXPaperDocSubscriptionLevel: NSObject { + let swift: Paper.DocSubscriptionLevel + + public init(swift: Paper.DocSubscriptionLevel) { + self.swift = swift + } + + public static func factory(swift: Paper.DocSubscriptionLevel) -> DBXPaperDocSubscriptionLevel { + switch swift { + case .default_: + return DBXPaperDocSubscriptionLevelDefault_() + case .ignore: + return DBXPaperDocSubscriptionLevelIgnore() + case .every: + return DBXPaperDocSubscriptionLevelEvery() + case .noEmail: + return DBXPaperDocSubscriptionLevelNoEmail() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXPaperDocSubscriptionLevelDefault_? { + self as? DBXPaperDocSubscriptionLevelDefault_ + } + + @objc + public var asIgnore: DBXPaperDocSubscriptionLevelIgnore? { + self as? DBXPaperDocSubscriptionLevelIgnore + } + + @objc + public var asEvery: DBXPaperDocSubscriptionLevelEvery? { + self as? DBXPaperDocSubscriptionLevelEvery + } + + @objc + public var asNoEmail: DBXPaperDocSubscriptionLevelNoEmail? { + self as? DBXPaperDocSubscriptionLevelNoEmail + } +} + +/// No change email messages unless you're the creator. +@objc +public class DBXPaperDocSubscriptionLevelDefault_: DBXPaperDocSubscriptionLevel { + @objc + public init() { + let swift = Paper.DocSubscriptionLevel.default_ + super.init(swift: swift) + } +} + +/// Ignored: Not shown in pad lists or activity and no email message is sent. +@objc +public class DBXPaperDocSubscriptionLevelIgnore: DBXPaperDocSubscriptionLevel { + @objc + public init() { + let swift = Paper.DocSubscriptionLevel.ignore + super.init(swift: swift) + } +} + +/// Subscribed: Shown in pad lists and activity and change email messages are sent. +@objc +public class DBXPaperDocSubscriptionLevelEvery: DBXPaperDocSubscriptionLevel { + @objc + public init() { + let swift = Paper.DocSubscriptionLevel.every + super.init(swift: swift) + } +} + +/// Unsubscribed: Shown in pad lists, but not in activity and no change email messages are sent. +@objc +public class DBXPaperDocSubscriptionLevelNoEmail: DBXPaperDocSubscriptionLevel { + @objc + public init() { + let swift = Paper.DocSubscriptionLevel.noEmail + super.init(swift: swift) + } +} + +/// The desired export format of the Paper doc. +@objc +public class DBXPaperExportFormat: NSObject { + let swift: Paper.ExportFormat + + public init(swift: Paper.ExportFormat) { + self.swift = swift + } + + public static func factory(swift: Paper.ExportFormat) -> DBXPaperExportFormat { + switch swift { + case .html: + return DBXPaperExportFormatHtml() + case .markdown: + return DBXPaperExportFormatMarkdown() + case .other: + return DBXPaperExportFormatOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHtml: DBXPaperExportFormatHtml? { + self as? DBXPaperExportFormatHtml + } + + @objc + public var asMarkdown: DBXPaperExportFormatMarkdown? { + self as? DBXPaperExportFormatMarkdown + } + + @objc + public var asOther: DBXPaperExportFormatOther? { + self as? DBXPaperExportFormatOther + } +} + +/// The HTML export format. +@objc +public class DBXPaperExportFormatHtml: DBXPaperExportFormat { + @objc + public init() { + let swift = Paper.ExportFormat.html + super.init(swift: swift) + } +} + +/// The markdown export format. +@objc +public class DBXPaperExportFormatMarkdown: DBXPaperExportFormat { + @objc + public init() { + let swift = Paper.ExportFormat.markdown + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperExportFormatOther: DBXPaperExportFormat { + @objc + public init() { + let swift = Paper.ExportFormat.other + super.init(swift: swift) + } +} + +/// Data structure representing a Paper folder. +@objc +public class DBXPaperFolder: NSObject { + /// Paper folder ID. This ID uniquely identifies the folder. + @objc + public var id: String { swift.id } + /// Paper folder name. + @objc + public var name: String { swift.name } + + @objc + public init(id: String, name: String) { + self.swift = Paper.Folder(id: id, name: name) + } + + let swift: Paper.Folder + + public init(swift: Paper.Folder) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The sharing policy of a Paper folder. The sharing policy of subfolders is inherited from the root folder. +@objc +public class DBXPaperFolderSharingPolicyType: NSObject { + let swift: Paper.FolderSharingPolicyType + + public init(swift: Paper.FolderSharingPolicyType) { + self.swift = swift + } + + public static func factory(swift: Paper.FolderSharingPolicyType) -> DBXPaperFolderSharingPolicyType { + switch swift { + case .team: + return DBXPaperFolderSharingPolicyTypeTeam() + case .inviteOnly: + return DBXPaperFolderSharingPolicyTypeInviteOnly() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeam: DBXPaperFolderSharingPolicyTypeTeam? { + self as? DBXPaperFolderSharingPolicyTypeTeam + } + + @objc + public var asInviteOnly: DBXPaperFolderSharingPolicyTypeInviteOnly? { + self as? DBXPaperFolderSharingPolicyTypeInviteOnly + } +} + +/// Everyone in your team and anyone directly invited can access this folder. +@objc +public class DBXPaperFolderSharingPolicyTypeTeam: DBXPaperFolderSharingPolicyType { + @objc + public init() { + let swift = Paper.FolderSharingPolicyType.team + super.init(swift: swift) + } +} + +/// Only people directly invited can access this folder. +@objc +public class DBXPaperFolderSharingPolicyTypeInviteOnly: DBXPaperFolderSharingPolicyType { + @objc + public init() { + let swift = Paper.FolderSharingPolicyType.inviteOnly + super.init(swift: swift) + } +} + +/// The subscription level of a Paper folder. +@objc +public class DBXPaperFolderSubscriptionLevel: NSObject { + let swift: Paper.FolderSubscriptionLevel + + public init(swift: Paper.FolderSubscriptionLevel) { + self.swift = swift + } + + public static func factory(swift: Paper.FolderSubscriptionLevel) -> DBXPaperFolderSubscriptionLevel { + switch swift { + case .none: + return DBXPaperFolderSubscriptionLevelNone() + case .activityOnly: + return DBXPaperFolderSubscriptionLevelActivityOnly() + case .dailyEmails: + return DBXPaperFolderSubscriptionLevelDailyEmails() + case .weeklyEmails: + return DBXPaperFolderSubscriptionLevelWeeklyEmails() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNone: DBXPaperFolderSubscriptionLevelNone? { + self as? DBXPaperFolderSubscriptionLevelNone + } + + @objc + public var asActivityOnly: DBXPaperFolderSubscriptionLevelActivityOnly? { + self as? DBXPaperFolderSubscriptionLevelActivityOnly + } + + @objc + public var asDailyEmails: DBXPaperFolderSubscriptionLevelDailyEmails? { + self as? DBXPaperFolderSubscriptionLevelDailyEmails + } + + @objc + public var asWeeklyEmails: DBXPaperFolderSubscriptionLevelWeeklyEmails? { + self as? DBXPaperFolderSubscriptionLevelWeeklyEmails + } +} + +/// Not shown in activity, no email messages. +@objc +public class DBXPaperFolderSubscriptionLevelNone: DBXPaperFolderSubscriptionLevel { + @objc + public init() { + let swift = Paper.FolderSubscriptionLevel.none + super.init(swift: swift) + } +} + +/// Shown in activity, no email messages. +@objc +public class DBXPaperFolderSubscriptionLevelActivityOnly: DBXPaperFolderSubscriptionLevel { + @objc + public init() { + let swift = Paper.FolderSubscriptionLevel.activityOnly + super.init(swift: swift) + } +} + +/// Shown in activity, daily email messages. +@objc +public class DBXPaperFolderSubscriptionLevelDailyEmails: DBXPaperFolderSubscriptionLevel { + @objc + public init() { + let swift = Paper.FolderSubscriptionLevel.dailyEmails + super.init(swift: swift) + } +} + +/// Shown in activity, weekly email messages. +@objc +public class DBXPaperFolderSubscriptionLevelWeeklyEmails: DBXPaperFolderSubscriptionLevel { + @objc + public init() { + let swift = Paper.FolderSubscriptionLevel.weeklyEmails + super.init(swift: swift) + } +} + +/// Metadata about Paper folders containing the specififed Paper doc. +@objc +public class DBXPaperFoldersContainingPaperDoc: NSObject { + /// The sharing policy of the folder containing the Paper doc. + @objc + public var folderSharingPolicyType: DBXPaperFolderSharingPolicyType? { guard let swift = swift.folderSharingPolicyType else { return nil } + return DBXPaperFolderSharingPolicyType(swift: swift) + } + + /// The folder path. If present the first folder is the root folder. + @objc + public var folders: [DBXPaperFolder]? { swift.folders?.map { DBXPaperFolder(swift: $0) } } + + @objc + public init(folderSharingPolicyType: DBXPaperFolderSharingPolicyType?, folders: [DBXPaperFolder]?) { + self.swift = Paper.FoldersContainingPaperDoc(folderSharingPolicyType: folderSharingPolicyType?.swift, folders: folders?.map(\.swift)) + } + + let swift: Paper.FoldersContainingPaperDoc + + public init(swift: Paper.FoldersContainingPaperDoc) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The import format of the incoming data. +@objc +public class DBXPaperImportFormat: NSObject { + let swift: Paper.ImportFormat + + public init(swift: Paper.ImportFormat) { + self.swift = swift + } + + public static func factory(swift: Paper.ImportFormat) -> DBXPaperImportFormat { + switch swift { + case .html: + return DBXPaperImportFormatHtml() + case .markdown: + return DBXPaperImportFormatMarkdown() + case .plainText: + return DBXPaperImportFormatPlainText() + case .other: + return DBXPaperImportFormatOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHtml: DBXPaperImportFormatHtml? { + self as? DBXPaperImportFormatHtml + } + + @objc + public var asMarkdown: DBXPaperImportFormatMarkdown? { + self as? DBXPaperImportFormatMarkdown + } + + @objc + public var asPlainText: DBXPaperImportFormatPlainText? { + self as? DBXPaperImportFormatPlainText + } + + @objc + public var asOther: DBXPaperImportFormatOther? { + self as? DBXPaperImportFormatOther + } +} + +/// The provided data is interpreted as standard HTML. +@objc +public class DBXPaperImportFormatHtml: DBXPaperImportFormat { + @objc + public init() { + let swift = Paper.ImportFormat.html + super.init(swift: swift) + } +} + +/// The provided data is interpreted as markdown. The first line of the provided document will be used as the +/// doc title. +@objc +public class DBXPaperImportFormatMarkdown: DBXPaperImportFormat { + @objc + public init() { + let swift = Paper.ImportFormat.markdown + super.init(swift: swift) + } +} + +/// The provided data is interpreted as plain text. The first line of the provided document will be used as the +/// doc title. +@objc +public class DBXPaperImportFormatPlainText: DBXPaperImportFormat { + @objc + public init() { + let swift = Paper.ImportFormat.plainText + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperImportFormatOther: DBXPaperImportFormat { + @objc + public init() { + let swift = Paper.ImportFormat.other + super.init(swift: swift) + } +} + +/// Objective-C compatible InviteeInfoWithPermissionLevel struct +@objc +public class DBXPaperInviteeInfoWithPermissionLevel: NSObject { + /// Email address invited to the Paper doc. + @objc + public var invitee: DBXSharingInviteeInfo { DBXSharingInviteeInfo(swift: swift.invitee) } + /// Permission level for the invitee. + @objc + public var permissionLevel: DBXPaperPaperDocPermissionLevel { DBXPaperPaperDocPermissionLevel(swift: swift.permissionLevel) } + + @objc + public init(invitee: DBXSharingInviteeInfo, permissionLevel: DBXPaperPaperDocPermissionLevel) { + self.swift = Paper.InviteeInfoWithPermissionLevel(invitee: invitee.swift, permissionLevel: permissionLevel.swift) + } + + let swift: Paper.InviteeInfoWithPermissionLevel + + public init(swift: Paper.InviteeInfoWithPermissionLevel) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListDocsCursorError union +@objc +public class DBXPaperListDocsCursorError: NSObject { + let swift: Paper.ListDocsCursorError + + public init(swift: Paper.ListDocsCursorError) { + self.swift = swift + } + + public static func factory(swift: Paper.ListDocsCursorError) -> DBXPaperListDocsCursorError { + switch swift { + case .cursorError(let swiftArg): + let arg = DBXPaperPaperApiCursorError(swift: swiftArg) + return DBXPaperListDocsCursorErrorCursorError(arg) + case .other: + return DBXPaperListDocsCursorErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asCursorError: DBXPaperListDocsCursorErrorCursorError? { + self as? DBXPaperListDocsCursorErrorCursorError + } + + @objc + public var asOther: DBXPaperListDocsCursorErrorOther? { + self as? DBXPaperListDocsCursorErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXPaperListDocsCursorErrorCursorError: DBXPaperListDocsCursorError { + @objc + public var cursorError: DBXPaperPaperApiCursorError + + @objc + public init(_ arg: DBXPaperPaperApiCursorError) { + self.cursorError = arg + let swift = Paper.ListDocsCursorError.cursorError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperListDocsCursorErrorOther: DBXPaperListDocsCursorError { + @objc + public init() { + let swift = Paper.ListDocsCursorError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListPaperDocsArgs struct +@objc +public class DBXPaperListPaperDocsArgs: NSObject { + /// Allows user to specify how the Paper docs should be filtered. + @objc + public var filterBy: DBXPaperListPaperDocsFilterBy { DBXPaperListPaperDocsFilterBy(swift: swift.filterBy) } + /// Allows user to specify how the Paper docs should be sorted. + @objc + public var sortBy: DBXPaperListPaperDocsSortBy { DBXPaperListPaperDocsSortBy(swift: swift.sortBy) } + /// Allows user to specify the sort order of the result. + @objc + public var sortOrder: DBXPaperListPaperDocsSortOrder { DBXPaperListPaperDocsSortOrder(swift: swift.sortOrder) } + /// Size limit per batch. The maximum number of docs that can be retrieved per batch is 1000. Higher value + /// results in invalid arguments error. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(filterBy: DBXPaperListPaperDocsFilterBy, sortBy: DBXPaperListPaperDocsSortBy, sortOrder: DBXPaperListPaperDocsSortOrder, limit: NSNumber) { + self.swift = Paper.ListPaperDocsArgs(filterBy: filterBy.swift, sortBy: sortBy.swift, sortOrder: sortOrder.swift, limit: limit.int32Value) + } + + let swift: Paper.ListPaperDocsArgs + + public init(swift: Paper.ListPaperDocsArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListPaperDocsContinueArgs struct +@objc +public class DBXPaperListPaperDocsContinueArgs: NSObject { + /// The cursor obtained from docsList or docsListContinue. Allows for pagination. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Paper.ListPaperDocsContinueArgs(cursor: cursor) + } + + let swift: Paper.ListPaperDocsContinueArgs + + public init(swift: Paper.ListPaperDocsContinueArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListPaperDocsFilterBy union +@objc +public class DBXPaperListPaperDocsFilterBy: NSObject { + let swift: Paper.ListPaperDocsFilterBy + + public init(swift: Paper.ListPaperDocsFilterBy) { + self.swift = swift + } + + public static func factory(swift: Paper.ListPaperDocsFilterBy) -> DBXPaperListPaperDocsFilterBy { + switch swift { + case .docsAccessed: + return DBXPaperListPaperDocsFilterByDocsAccessed() + case .docsCreated: + return DBXPaperListPaperDocsFilterByDocsCreated() + case .other: + return DBXPaperListPaperDocsFilterByOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDocsAccessed: DBXPaperListPaperDocsFilterByDocsAccessed? { + self as? DBXPaperListPaperDocsFilterByDocsAccessed + } + + @objc + public var asDocsCreated: DBXPaperListPaperDocsFilterByDocsCreated? { + self as? DBXPaperListPaperDocsFilterByDocsCreated + } + + @objc + public var asOther: DBXPaperListPaperDocsFilterByOther? { + self as? DBXPaperListPaperDocsFilterByOther + } +} + +/// Fetches all Paper doc IDs that the user has ever accessed. +@objc +public class DBXPaperListPaperDocsFilterByDocsAccessed: DBXPaperListPaperDocsFilterBy { + @objc + public init() { + let swift = Paper.ListPaperDocsFilterBy.docsAccessed + super.init(swift: swift) + } +} + +/// Fetches only the Paper doc IDs that the user has created. +@objc +public class DBXPaperListPaperDocsFilterByDocsCreated: DBXPaperListPaperDocsFilterBy { + @objc + public init() { + let swift = Paper.ListPaperDocsFilterBy.docsCreated + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperListPaperDocsFilterByOther: DBXPaperListPaperDocsFilterBy { + @objc + public init() { + let swift = Paper.ListPaperDocsFilterBy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListPaperDocsResponse struct +@objc +public class DBXPaperListPaperDocsResponse: NSObject { + /// The list of Paper doc IDs that can be used to access the given Paper docs or supplied to other API methods. + /// The list is sorted in the order specified by the initial call to docsList. + @objc + public var docIds: [String] { swift.docIds } + /// Pass the cursor into docsListContinue to paginate through all files. The cursor preserves all properties as + /// specified in the original call to docsList. + @objc + public var cursor: DBXPaperCursor { DBXPaperCursor(swift: swift.cursor) } + /// Will be set to True if a subsequent call with the provided cursor to docsListContinue returns immediately + /// with some results. If set to False please allow some delay before making another call to + /// docsListContinue. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(docIds: [String], cursor: DBXPaperCursor, hasMore: NSNumber) { + self.swift = Paper.ListPaperDocsResponse(docIds: docIds, cursor: cursor.swift, hasMore: hasMore.boolValue) + } + + let swift: Paper.ListPaperDocsResponse + + public init(swift: Paper.ListPaperDocsResponse) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListPaperDocsSortBy union +@objc +public class DBXPaperListPaperDocsSortBy: NSObject { + let swift: Paper.ListPaperDocsSortBy + + public init(swift: Paper.ListPaperDocsSortBy) { + self.swift = swift + } + + public static func factory(swift: Paper.ListPaperDocsSortBy) -> DBXPaperListPaperDocsSortBy { + switch swift { + case .accessed: + return DBXPaperListPaperDocsSortByAccessed() + case .modified: + return DBXPaperListPaperDocsSortByModified() + case .created: + return DBXPaperListPaperDocsSortByCreated() + case .other: + return DBXPaperListPaperDocsSortByOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessed: DBXPaperListPaperDocsSortByAccessed? { + self as? DBXPaperListPaperDocsSortByAccessed + } + + @objc + public var asModified: DBXPaperListPaperDocsSortByModified? { + self as? DBXPaperListPaperDocsSortByModified + } + + @objc + public var asCreated: DBXPaperListPaperDocsSortByCreated? { + self as? DBXPaperListPaperDocsSortByCreated + } + + @objc + public var asOther: DBXPaperListPaperDocsSortByOther? { + self as? DBXPaperListPaperDocsSortByOther + } +} + +/// Sorts the Paper docs by the time they were last accessed. +@objc +public class DBXPaperListPaperDocsSortByAccessed: DBXPaperListPaperDocsSortBy { + @objc + public init() { + let swift = Paper.ListPaperDocsSortBy.accessed + super.init(swift: swift) + } +} + +/// Sorts the Paper docs by the time they were last modified. +@objc +public class DBXPaperListPaperDocsSortByModified: DBXPaperListPaperDocsSortBy { + @objc + public init() { + let swift = Paper.ListPaperDocsSortBy.modified + super.init(swift: swift) + } +} + +/// Sorts the Paper docs by the creation time. +@objc +public class DBXPaperListPaperDocsSortByCreated: DBXPaperListPaperDocsSortBy { + @objc + public init() { + let swift = Paper.ListPaperDocsSortBy.created + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperListPaperDocsSortByOther: DBXPaperListPaperDocsSortBy { + @objc + public init() { + let swift = Paper.ListPaperDocsSortBy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListPaperDocsSortOrder union +@objc +public class DBXPaperListPaperDocsSortOrder: NSObject { + let swift: Paper.ListPaperDocsSortOrder + + public init(swift: Paper.ListPaperDocsSortOrder) { + self.swift = swift + } + + public static func factory(swift: Paper.ListPaperDocsSortOrder) -> DBXPaperListPaperDocsSortOrder { + switch swift { + case .ascending: + return DBXPaperListPaperDocsSortOrderAscending() + case .descending: + return DBXPaperListPaperDocsSortOrderDescending() + case .other: + return DBXPaperListPaperDocsSortOrderOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAscending: DBXPaperListPaperDocsSortOrderAscending? { + self as? DBXPaperListPaperDocsSortOrderAscending + } + + @objc + public var asDescending: DBXPaperListPaperDocsSortOrderDescending? { + self as? DBXPaperListPaperDocsSortOrderDescending + } + + @objc + public var asOther: DBXPaperListPaperDocsSortOrderOther? { + self as? DBXPaperListPaperDocsSortOrderOther + } +} + +/// Sorts the search result in ascending order. +@objc +public class DBXPaperListPaperDocsSortOrderAscending: DBXPaperListPaperDocsSortOrder { + @objc + public init() { + let swift = Paper.ListPaperDocsSortOrder.ascending + super.init(swift: swift) + } +} + +/// Sorts the search result in descending order. +@objc +public class DBXPaperListPaperDocsSortOrderDescending: DBXPaperListPaperDocsSortOrder { + @objc + public init() { + let swift = Paper.ListPaperDocsSortOrder.descending + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperListPaperDocsSortOrderOther: DBXPaperListPaperDocsSortOrder { + @objc + public init() { + let swift = Paper.ListPaperDocsSortOrder.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListUsersCursorError union +@objc +public class DBXPaperListUsersCursorError: NSObject { + let swift: Paper.ListUsersCursorError + + public init(swift: Paper.ListUsersCursorError) { + self.swift = swift + } + + public static func factory(swift: Paper.ListUsersCursorError) -> DBXPaperListUsersCursorError { + switch swift { + case .insufficientPermissions: + return DBXPaperListUsersCursorErrorInsufficientPermissions() + case .other: + return DBXPaperListUsersCursorErrorOther() + case .docNotFound: + return DBXPaperListUsersCursorErrorDocNotFound() + case .cursorError(let swiftArg): + let arg = DBXPaperPaperApiCursorError(swift: swiftArg) + return DBXPaperListUsersCursorErrorCursorError(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXPaperListUsersCursorErrorInsufficientPermissions? { + self as? DBXPaperListUsersCursorErrorInsufficientPermissions + } + + @objc + public var asOther: DBXPaperListUsersCursorErrorOther? { + self as? DBXPaperListUsersCursorErrorOther + } + + @objc + public var asDocNotFound: DBXPaperListUsersCursorErrorDocNotFound? { + self as? DBXPaperListUsersCursorErrorDocNotFound + } + + @objc + public var asCursorError: DBXPaperListUsersCursorErrorCursorError? { + self as? DBXPaperListUsersCursorErrorCursorError + } +} + +/// Your account does not have permissions to perform this action. This may be due to it only having access to +/// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide +/// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. +@objc +public class DBXPaperListUsersCursorErrorInsufficientPermissions: DBXPaperListUsersCursorError { + @objc + public init() { + let swift = Paper.ListUsersCursorError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperListUsersCursorErrorOther: DBXPaperListUsersCursorError { + @objc + public init() { + let swift = Paper.ListUsersCursorError.other + super.init(swift: swift) + } +} + +/// The required doc was not found. +@objc +public class DBXPaperListUsersCursorErrorDocNotFound: DBXPaperListUsersCursorError { + @objc + public init() { + let swift = Paper.ListUsersCursorError.docNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperListUsersCursorErrorCursorError: DBXPaperListUsersCursorError { + @objc + public var cursorError: DBXPaperPaperApiCursorError + + @objc + public init(_ arg: DBXPaperPaperApiCursorError) { + self.cursorError = arg + let swift = Paper.ListUsersCursorError.cursorError(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible ListUsersOnFolderArgs struct +@objc +public class DBXPaperListUsersOnFolderArgs: DBXPaperRefPaperDoc { + /// Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. Higher value + /// results in invalid arguments error. + @objc + public var limit: NSNumber { subSwift.limit as NSNumber } + + @objc + public init(docId: String, limit: NSNumber) { + let swift = Paper.ListUsersOnFolderArgs(docId: docId, limit: limit.int32Value) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.ListUsersOnFolderArgs + + public init(swift: Paper.ListUsersOnFolderArgs) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible ListUsersOnFolderContinueArgs struct +@objc +public class DBXPaperListUsersOnFolderContinueArgs: DBXPaperRefPaperDoc { + /// The cursor obtained from docsFolderUsersList or docsFolderUsersListContinue. Allows for pagination. + @objc + public var cursor: String { subSwift.cursor } + + @objc + public init(docId: String, cursor: String) { + let swift = Paper.ListUsersOnFolderContinueArgs(docId: docId, cursor: cursor) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.ListUsersOnFolderContinueArgs + + public init(swift: Paper.ListUsersOnFolderContinueArgs) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible ListUsersOnFolderResponse struct +@objc +public class DBXPaperListUsersOnFolderResponse: NSObject { + /// List of email addresses that are invited on the Paper folder. + @objc + public var invitees: [DBXSharingInviteeInfo] { swift.invitees.map { DBXSharingInviteeInfo(swift: $0) } } + /// List of users that are invited on the Paper folder. + @objc + public var users: [DBXSharingUserInfo] { swift.users.map { DBXSharingUserInfo(swift: $0) } } + /// Pass the cursor into docsFolderUsersListContinue to paginate through all users. The cursor preserves all + /// properties as specified in the original call to docsFolderUsersList. + @objc + public var cursor: DBXPaperCursor { DBXPaperCursor(swift: swift.cursor) } + /// Will be set to True if a subsequent call with the provided cursor to docsFolderUsersListContinue returns + /// immediately with some results. If set to False please allow some delay before making another call to + /// docsFolderUsersListContinue. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(invitees: [DBXSharingInviteeInfo], users: [DBXSharingUserInfo], cursor: DBXPaperCursor, hasMore: NSNumber) { + self.swift = Paper.ListUsersOnFolderResponse( + invitees: invitees.map(\.swift), + users: users.map(\.swift), + cursor: cursor.swift, + hasMore: hasMore.boolValue + ) + } + + let swift: Paper.ListUsersOnFolderResponse + + public init(swift: Paper.ListUsersOnFolderResponse) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListUsersOnPaperDocArgs struct +@objc +public class DBXPaperListUsersOnPaperDocArgs: DBXPaperRefPaperDoc { + /// Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. Higher value + /// results in invalid arguments error. + @objc + public var limit: NSNumber { subSwift.limit as NSNumber } + /// Specify this attribute if you want to obtain users that have already accessed the Paper doc. + @objc + public var filterBy: DBXPaperUserOnPaperDocFilter { DBXPaperUserOnPaperDocFilter(swift: subSwift.filterBy) } + + @objc + public init(docId: String, limit: NSNumber, filterBy: DBXPaperUserOnPaperDocFilter) { + let swift = Paper.ListUsersOnPaperDocArgs(docId: docId, limit: limit.int32Value, filterBy: filterBy.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.ListUsersOnPaperDocArgs + + public init(swift: Paper.ListUsersOnPaperDocArgs) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible ListUsersOnPaperDocContinueArgs struct +@objc +public class DBXPaperListUsersOnPaperDocContinueArgs: DBXPaperRefPaperDoc { + /// The cursor obtained from docsUsersList or docsUsersListContinue. Allows for pagination. + @objc + public var cursor: String { subSwift.cursor } + + @objc + public init(docId: String, cursor: String) { + let swift = Paper.ListUsersOnPaperDocContinueArgs(docId: docId, cursor: cursor) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.ListUsersOnPaperDocContinueArgs + + public init(swift: Paper.ListUsersOnPaperDocContinueArgs) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible ListUsersOnPaperDocResponse struct +@objc +public class DBXPaperListUsersOnPaperDocResponse: NSObject { + /// List of email addresses with their respective permission levels that are invited on the Paper doc. + @objc + public var invitees: [DBXPaperInviteeInfoWithPermissionLevel] { swift.invitees.map { DBXPaperInviteeInfoWithPermissionLevel(swift: $0) } } + /// List of users with their respective permission levels that are invited on the Paper folder. + @objc + public var users: [DBXPaperUserInfoWithPermissionLevel] { swift.users.map { DBXPaperUserInfoWithPermissionLevel(swift: $0) } } + /// The Paper doc owner. This field is populated on every single response. + @objc + public var docOwner: DBXSharingUserInfo { DBXSharingUserInfo(swift: swift.docOwner) } + /// Pass the cursor into docsUsersListContinue to paginate through all users. The cursor preserves all + /// properties as specified in the original call to docsUsersList. + @objc + public var cursor: DBXPaperCursor { DBXPaperCursor(swift: swift.cursor) } + /// Will be set to True if a subsequent call with the provided cursor to docsUsersListContinue returns + /// immediately with some results. If set to False please allow some delay before making another call to + /// docsUsersListContinue. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init( + invitees: [DBXPaperInviteeInfoWithPermissionLevel], + users: [DBXPaperUserInfoWithPermissionLevel], + docOwner: DBXSharingUserInfo, + cursor: DBXPaperCursor, + hasMore: NSNumber + ) { + self.swift = Paper.ListUsersOnPaperDocResponse( + invitees: invitees.map(\.swift), + users: users.map(\.swift), + docOwner: docOwner.swift, + cursor: cursor.swift, + hasMore: hasMore.boolValue + ) + } + + let swift: Paper.ListUsersOnPaperDocResponse + + public init(swift: Paper.ListUsersOnPaperDocResponse) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperApiCursorError union +@objc +public class DBXPaperPaperApiCursorError: NSObject { + let swift: Paper.PaperApiCursorError + + public init(swift: Paper.PaperApiCursorError) { + self.swift = swift + } + + public static func factory(swift: Paper.PaperApiCursorError) -> DBXPaperPaperApiCursorError { + switch swift { + case .expiredCursor: + return DBXPaperPaperApiCursorErrorExpiredCursor() + case .invalidCursor: + return DBXPaperPaperApiCursorErrorInvalidCursor() + case .wrongUserInCursor: + return DBXPaperPaperApiCursorErrorWrongUserInCursor() + case .reset: + return DBXPaperPaperApiCursorErrorReset() + case .other: + return DBXPaperPaperApiCursorErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asExpiredCursor: DBXPaperPaperApiCursorErrorExpiredCursor? { + self as? DBXPaperPaperApiCursorErrorExpiredCursor + } + + @objc + public var asInvalidCursor: DBXPaperPaperApiCursorErrorInvalidCursor? { + self as? DBXPaperPaperApiCursorErrorInvalidCursor + } + + @objc + public var asWrongUserInCursor: DBXPaperPaperApiCursorErrorWrongUserInCursor? { + self as? DBXPaperPaperApiCursorErrorWrongUserInCursor + } + + @objc + public var asReset: DBXPaperPaperApiCursorErrorReset? { + self as? DBXPaperPaperApiCursorErrorReset + } + + @objc + public var asOther: DBXPaperPaperApiCursorErrorOther? { + self as? DBXPaperPaperApiCursorErrorOther + } +} + +/// The provided cursor is expired. +@objc +public class DBXPaperPaperApiCursorErrorExpiredCursor: DBXPaperPaperApiCursorError { + @objc + public init() { + let swift = Paper.PaperApiCursorError.expiredCursor + super.init(swift: swift) + } +} + +/// The provided cursor is invalid. +@objc +public class DBXPaperPaperApiCursorErrorInvalidCursor: DBXPaperPaperApiCursorError { + @objc + public init() { + let swift = Paper.PaperApiCursorError.invalidCursor + super.init(swift: swift) + } +} + +/// The provided cursor contains invalid user. +@objc +public class DBXPaperPaperApiCursorErrorWrongUserInCursor: DBXPaperPaperApiCursorError { + @objc + public init() { + let swift = Paper.PaperApiCursorError.wrongUserInCursor + super.init(swift: swift) + } +} + +/// Indicates that the cursor has been invalidated. Call the corresponding non-continue endpoint to obtain a new +/// cursor. +@objc +public class DBXPaperPaperApiCursorErrorReset: DBXPaperPaperApiCursorError { + @objc + public init() { + let swift = Paper.PaperApiCursorError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperPaperApiCursorErrorOther: DBXPaperPaperApiCursorError { + @objc + public init() { + let swift = Paper.PaperApiCursorError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperDocCreateArgs struct +@objc +public class DBXPaperPaperDocCreateArgs: NSObject { + /// The Paper folder ID where the Paper document should be created. The API user has to have write access to + /// this folder or error is thrown. + @objc + public var parentFolderId: String? { swift.parentFolderId } + /// The format of provided data. + @objc + public var importFormat: DBXPaperImportFormat { DBXPaperImportFormat(swift: swift.importFormat) } + + @objc + public init(importFormat: DBXPaperImportFormat, parentFolderId: String?) { + self.swift = Paper.PaperDocCreateArgs(importFormat: importFormat.swift, parentFolderId: parentFolderId) + } + + let swift: Paper.PaperDocCreateArgs + + public init(swift: Paper.PaperDocCreateArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocCreateError union +@objc +public class DBXPaperPaperDocCreateError: NSObject { + let swift: Paper.PaperDocCreateError + + public init(swift: Paper.PaperDocCreateError) { + self.swift = swift + } + + public static func factory(swift: Paper.PaperDocCreateError) -> DBXPaperPaperDocCreateError { + switch swift { + case .insufficientPermissions: + return DBXPaperPaperDocCreateErrorInsufficientPermissions() + case .other: + return DBXPaperPaperDocCreateErrorOther() + case .contentMalformed: + return DBXPaperPaperDocCreateErrorContentMalformed() + case .folderNotFound: + return DBXPaperPaperDocCreateErrorFolderNotFound() + case .docLengthExceeded: + return DBXPaperPaperDocCreateErrorDocLengthExceeded() + case .imageSizeExceeded: + return DBXPaperPaperDocCreateErrorImageSizeExceeded() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXPaperPaperDocCreateErrorInsufficientPermissions? { + self as? DBXPaperPaperDocCreateErrorInsufficientPermissions + } + + @objc + public var asOther: DBXPaperPaperDocCreateErrorOther? { + self as? DBXPaperPaperDocCreateErrorOther + } + + @objc + public var asContentMalformed: DBXPaperPaperDocCreateErrorContentMalformed? { + self as? DBXPaperPaperDocCreateErrorContentMalformed + } + + @objc + public var asFolderNotFound: DBXPaperPaperDocCreateErrorFolderNotFound? { + self as? DBXPaperPaperDocCreateErrorFolderNotFound + } + + @objc + public var asDocLengthExceeded: DBXPaperPaperDocCreateErrorDocLengthExceeded? { + self as? DBXPaperPaperDocCreateErrorDocLengthExceeded + } + + @objc + public var asImageSizeExceeded: DBXPaperPaperDocCreateErrorImageSizeExceeded? { + self as? DBXPaperPaperDocCreateErrorImageSizeExceeded + } +} + +/// Your account does not have permissions to perform this action. This may be due to it only having access to +/// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide +/// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. +@objc +public class DBXPaperPaperDocCreateErrorInsufficientPermissions: DBXPaperPaperDocCreateError { + @objc + public init() { + let swift = Paper.PaperDocCreateError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperPaperDocCreateErrorOther: DBXPaperPaperDocCreateError { + @objc + public init() { + let swift = Paper.PaperDocCreateError.other + super.init(swift: swift) + } +} + +/// The provided content was malformed and cannot be imported to Paper. +@objc +public class DBXPaperPaperDocCreateErrorContentMalformed: DBXPaperPaperDocCreateError { + @objc + public init() { + let swift = Paper.PaperDocCreateError.contentMalformed + super.init(swift: swift) + } +} + +/// The specified Paper folder is cannot be found. +@objc +public class DBXPaperPaperDocCreateErrorFolderNotFound: DBXPaperPaperDocCreateError { + @objc + public init() { + let swift = Paper.PaperDocCreateError.folderNotFound + super.init(swift: swift) + } +} + +/// The newly created Paper doc would be too large. Please split the content into multiple docs. +@objc +public class DBXPaperPaperDocCreateErrorDocLengthExceeded: DBXPaperPaperDocCreateError { + @objc + public init() { + let swift = Paper.PaperDocCreateError.docLengthExceeded + super.init(swift: swift) + } +} + +/// The imported document contains an image that is too large. The current limit is 1MB. This only applies to +/// HTML with data URI. +@objc +public class DBXPaperPaperDocCreateErrorImageSizeExceeded: DBXPaperPaperDocCreateError { + @objc + public init() { + let swift = Paper.PaperDocCreateError.imageSizeExceeded + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperDocCreateUpdateResult struct +@objc +public class DBXPaperPaperDocCreateUpdateResult: NSObject { + /// Doc ID of the newly created doc. + @objc + public var docId: String { swift.docId } + /// The Paper doc revision. Simply an ever increasing number. + @objc + public var revision: NSNumber { swift.revision as NSNumber } + /// The Paper doc title. + @objc + public var title: String { swift.title } + + @objc + public init(docId: String, revision: NSNumber, title: String) { + self.swift = Paper.PaperDocCreateUpdateResult(docId: docId, revision: revision.int64Value, title: title) + } + + let swift: Paper.PaperDocCreateUpdateResult + + public init(swift: Paper.PaperDocCreateUpdateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocExport struct +@objc +public class DBXPaperPaperDocExport: DBXPaperRefPaperDoc { + /// (no description) + @objc + public var exportFormat: DBXPaperExportFormat { DBXPaperExportFormat(swift: subSwift.exportFormat) } + + @objc + public init(docId: String, exportFormat: DBXPaperExportFormat) { + let swift = Paper.PaperDocExport(docId: docId, exportFormat: exportFormat.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.PaperDocExport + + public init(swift: Paper.PaperDocExport) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible PaperDocExportResult struct +@objc +public class DBXPaperPaperDocExportResult: NSObject { + /// The Paper doc owner's email address. + @objc + public var owner: String { swift.owner } + /// The Paper doc title. + @objc + public var title: String { swift.title } + /// The Paper doc revision. Simply an ever increasing number. + @objc + public var revision: NSNumber { swift.revision as NSNumber } + /// MIME type of the export. This corresponds to ExportFormat specified in the request. + @objc + public var mimeType: String { swift.mimeType } + + @objc + public init(owner: String, title: String, revision: NSNumber, mimeType: String) { + self.swift = Paper.PaperDocExportResult(owner: owner, title: title, revision: revision.int64Value, mimeType: mimeType) + } + + let swift: Paper.PaperDocExportResult + + public init(swift: Paper.PaperDocExportResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocPermissionLevel union +@objc +public class DBXPaperPaperDocPermissionLevel: NSObject { + let swift: Paper.PaperDocPermissionLevel + + public init(swift: Paper.PaperDocPermissionLevel) { + self.swift = swift + } + + public static func factory(swift: Paper.PaperDocPermissionLevel) -> DBXPaperPaperDocPermissionLevel { + switch swift { + case .edit: + return DBXPaperPaperDocPermissionLevelEdit() + case .viewAndComment: + return DBXPaperPaperDocPermissionLevelViewAndComment() + case .other: + return DBXPaperPaperDocPermissionLevelOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEdit: DBXPaperPaperDocPermissionLevelEdit? { + self as? DBXPaperPaperDocPermissionLevelEdit + } + + @objc + public var asViewAndComment: DBXPaperPaperDocPermissionLevelViewAndComment? { + self as? DBXPaperPaperDocPermissionLevelViewAndComment + } + + @objc + public var asOther: DBXPaperPaperDocPermissionLevelOther? { + self as? DBXPaperPaperDocPermissionLevelOther + } +} + +/// User will be granted edit permissions. +@objc +public class DBXPaperPaperDocPermissionLevelEdit: DBXPaperPaperDocPermissionLevel { + @objc + public init() { + let swift = Paper.PaperDocPermissionLevel.edit + super.init(swift: swift) + } +} + +/// User will be granted view and comment permissions. +@objc +public class DBXPaperPaperDocPermissionLevelViewAndComment: DBXPaperPaperDocPermissionLevel { + @objc + public init() { + let swift = Paper.PaperDocPermissionLevel.viewAndComment + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperPaperDocPermissionLevelOther: DBXPaperPaperDocPermissionLevel { + @objc + public init() { + let swift = Paper.PaperDocPermissionLevel.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperDocSharingPolicy struct +@objc +public class DBXPaperPaperDocSharingPolicy: DBXPaperRefPaperDoc { + /// The default sharing policy to be set for the Paper doc. + @objc + public var sharingPolicy: DBXPaperSharingPolicy { DBXPaperSharingPolicy(swift: subSwift.sharingPolicy) } + + @objc + public init(docId: String, sharingPolicy: DBXPaperSharingPolicy) { + let swift = Paper.PaperDocSharingPolicy(docId: docId, sharingPolicy: sharingPolicy.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.PaperDocSharingPolicy + + public init(swift: Paper.PaperDocSharingPolicy) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible PaperDocUpdateArgs struct +@objc +public class DBXPaperPaperDocUpdateArgs: DBXPaperRefPaperDoc { + /// The policy used for the current update call. + @objc + public var docUpdatePolicy: DBXPaperPaperDocUpdatePolicy { DBXPaperPaperDocUpdatePolicy(swift: subSwift.docUpdatePolicy) } + /// The latest doc revision. This value must match the head revision or an error code will be returned. This is + /// to prevent colliding writes. + @objc + public var revision: NSNumber { subSwift.revision as NSNumber } + /// The format of provided data. + @objc + public var importFormat: DBXPaperImportFormat { DBXPaperImportFormat(swift: subSwift.importFormat) } + + @objc + public init(docId: String, docUpdatePolicy: DBXPaperPaperDocUpdatePolicy, revision: NSNumber, importFormat: DBXPaperImportFormat) { + let swift = Paper.PaperDocUpdateArgs( + docId: docId, + docUpdatePolicy: docUpdatePolicy.swift, + revision: revision.int64Value, + importFormat: importFormat.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.PaperDocUpdateArgs + + public init(swift: Paper.PaperDocUpdateArgs) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible PaperDocUpdateError union +@objc +public class DBXPaperPaperDocUpdateError: NSObject { + let swift: Paper.PaperDocUpdateError + + public init(swift: Paper.PaperDocUpdateError) { + self.swift = swift + } + + public static func factory(swift: Paper.PaperDocUpdateError) -> DBXPaperPaperDocUpdateError { + switch swift { + case .insufficientPermissions: + return DBXPaperPaperDocUpdateErrorInsufficientPermissions() + case .other: + return DBXPaperPaperDocUpdateErrorOther() + case .docNotFound: + return DBXPaperPaperDocUpdateErrorDocNotFound() + case .contentMalformed: + return DBXPaperPaperDocUpdateErrorContentMalformed() + case .revisionMismatch: + return DBXPaperPaperDocUpdateErrorRevisionMismatch() + case .docLengthExceeded: + return DBXPaperPaperDocUpdateErrorDocLengthExceeded() + case .imageSizeExceeded: + return DBXPaperPaperDocUpdateErrorImageSizeExceeded() + case .docArchived: + return DBXPaperPaperDocUpdateErrorDocArchived() + case .docDeleted: + return DBXPaperPaperDocUpdateErrorDocDeleted() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXPaperPaperDocUpdateErrorInsufficientPermissions? { + self as? DBXPaperPaperDocUpdateErrorInsufficientPermissions + } + + @objc + public var asOther: DBXPaperPaperDocUpdateErrorOther? { + self as? DBXPaperPaperDocUpdateErrorOther + } + + @objc + public var asDocNotFound: DBXPaperPaperDocUpdateErrorDocNotFound? { + self as? DBXPaperPaperDocUpdateErrorDocNotFound + } + + @objc + public var asContentMalformed: DBXPaperPaperDocUpdateErrorContentMalformed? { + self as? DBXPaperPaperDocUpdateErrorContentMalformed + } + + @objc + public var asRevisionMismatch: DBXPaperPaperDocUpdateErrorRevisionMismatch? { + self as? DBXPaperPaperDocUpdateErrorRevisionMismatch + } + + @objc + public var asDocLengthExceeded: DBXPaperPaperDocUpdateErrorDocLengthExceeded? { + self as? DBXPaperPaperDocUpdateErrorDocLengthExceeded + } + + @objc + public var asImageSizeExceeded: DBXPaperPaperDocUpdateErrorImageSizeExceeded? { + self as? DBXPaperPaperDocUpdateErrorImageSizeExceeded + } + + @objc + public var asDocArchived: DBXPaperPaperDocUpdateErrorDocArchived? { + self as? DBXPaperPaperDocUpdateErrorDocArchived + } + + @objc + public var asDocDeleted: DBXPaperPaperDocUpdateErrorDocDeleted? { + self as? DBXPaperPaperDocUpdateErrorDocDeleted + } +} + +/// Your account does not have permissions to perform this action. This may be due to it only having access to +/// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide +/// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. +@objc +public class DBXPaperPaperDocUpdateErrorInsufficientPermissions: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperPaperDocUpdateErrorOther: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.other + super.init(swift: swift) + } +} + +/// The required doc was not found. +@objc +public class DBXPaperPaperDocUpdateErrorDocNotFound: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.docNotFound + super.init(swift: swift) + } +} + +/// The provided content was malformed and cannot be imported to Paper. +@objc +public class DBXPaperPaperDocUpdateErrorContentMalformed: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.contentMalformed + super.init(swift: swift) + } +} + +/// The provided revision does not match the document head. +@objc +public class DBXPaperPaperDocUpdateErrorRevisionMismatch: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.revisionMismatch + super.init(swift: swift) + } +} + +/// The newly created Paper doc would be too large, split the content into multiple docs. +@objc +public class DBXPaperPaperDocUpdateErrorDocLengthExceeded: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.docLengthExceeded + super.init(swift: swift) + } +} + +/// The imported document contains an image that is too large. The current limit is 1MB. This only applies to +/// HTML with data URI. +@objc +public class DBXPaperPaperDocUpdateErrorImageSizeExceeded: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.imageSizeExceeded + super.init(swift: swift) + } +} + +/// This operation is not allowed on archived Paper docs. +@objc +public class DBXPaperPaperDocUpdateErrorDocArchived: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.docArchived + super.init(swift: swift) + } +} + +/// This operation is not allowed on deleted Paper docs. +@objc +public class DBXPaperPaperDocUpdateErrorDocDeleted: DBXPaperPaperDocUpdateError { + @objc + public init() { + let swift = Paper.PaperDocUpdateError.docDeleted + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperDocUpdatePolicy union +@objc +public class DBXPaperPaperDocUpdatePolicy: NSObject { + let swift: Paper.PaperDocUpdatePolicy + + public init(swift: Paper.PaperDocUpdatePolicy) { + self.swift = swift + } + + public static func factory(swift: Paper.PaperDocUpdatePolicy) -> DBXPaperPaperDocUpdatePolicy { + switch swift { + case .append: + return DBXPaperPaperDocUpdatePolicyAppend() + case .prepend: + return DBXPaperPaperDocUpdatePolicyPrepend() + case .overwriteAll: + return DBXPaperPaperDocUpdatePolicyOverwriteAll() + case .other: + return DBXPaperPaperDocUpdatePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAppend: DBXPaperPaperDocUpdatePolicyAppend? { + self as? DBXPaperPaperDocUpdatePolicyAppend + } + + @objc + public var asPrepend: DBXPaperPaperDocUpdatePolicyPrepend? { + self as? DBXPaperPaperDocUpdatePolicyPrepend + } + + @objc + public var asOverwriteAll: DBXPaperPaperDocUpdatePolicyOverwriteAll? { + self as? DBXPaperPaperDocUpdatePolicyOverwriteAll + } + + @objc + public var asOther: DBXPaperPaperDocUpdatePolicyOther? { + self as? DBXPaperPaperDocUpdatePolicyOther + } +} + +/// The content will be appended to the doc. +@objc +public class DBXPaperPaperDocUpdatePolicyAppend: DBXPaperPaperDocUpdatePolicy { + @objc + public init() { + let swift = Paper.PaperDocUpdatePolicy.append + super.init(swift: swift) + } +} + +/// The content will be prepended to the doc. The doc title will not be affected. +@objc +public class DBXPaperPaperDocUpdatePolicyPrepend: DBXPaperPaperDocUpdatePolicy { + @objc + public init() { + let swift = Paper.PaperDocUpdatePolicy.prepend + super.init(swift: swift) + } +} + +/// The document will be overwitten at the head with the provided content. +@objc +public class DBXPaperPaperDocUpdatePolicyOverwriteAll: DBXPaperPaperDocUpdatePolicy { + @objc + public init() { + let swift = Paper.PaperDocUpdatePolicy.overwriteAll + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperPaperDocUpdatePolicyOther: DBXPaperPaperDocUpdatePolicy { + @objc + public init() { + let swift = Paper.PaperDocUpdatePolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperFolderCreateArg struct +@objc +public class DBXPaperPaperFolderCreateArg: NSObject { + /// The name of the new Paper folder. + @objc + public var name: String { swift.name } + /// The encrypted Paper folder Id where the new Paper folder should be created. The API user has to have write + /// access to this folder or error is thrown. If not supplied, the new folder will be created at top level. + @objc + public var parentFolderId: String? { swift.parentFolderId } + /// Whether the folder to be created should be a team folder. This value will be ignored if parent_folder_id is + /// supplied, as the new folder will inherit the type (private or team folder) from its parent. We will by + /// default create a top-level private folder if both parent_folder_id and is_team_folder are not supplied. + @objc + public var isTeamFolder: NSNumber? { swift.isTeamFolder as NSNumber? } + + @objc + public init(name: String, parentFolderId: String?, isTeamFolder: NSNumber?) { + self.swift = Paper.PaperFolderCreateArg(name: name, parentFolderId: parentFolderId, isTeamFolder: isTeamFolder?.boolValue) + } + + let swift: Paper.PaperFolderCreateArg + + public init(swift: Paper.PaperFolderCreateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperFolderCreateError union +@objc +public class DBXPaperPaperFolderCreateError: NSObject { + let swift: Paper.PaperFolderCreateError + + public init(swift: Paper.PaperFolderCreateError) { + self.swift = swift + } + + public static func factory(swift: Paper.PaperFolderCreateError) -> DBXPaperPaperFolderCreateError { + switch swift { + case .insufficientPermissions: + return DBXPaperPaperFolderCreateErrorInsufficientPermissions() + case .other: + return DBXPaperPaperFolderCreateErrorOther() + case .folderNotFound: + return DBXPaperPaperFolderCreateErrorFolderNotFound() + case .invalidFolderId: + return DBXPaperPaperFolderCreateErrorInvalidFolderId() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInsufficientPermissions: DBXPaperPaperFolderCreateErrorInsufficientPermissions? { + self as? DBXPaperPaperFolderCreateErrorInsufficientPermissions + } + + @objc + public var asOther: DBXPaperPaperFolderCreateErrorOther? { + self as? DBXPaperPaperFolderCreateErrorOther + } + + @objc + public var asFolderNotFound: DBXPaperPaperFolderCreateErrorFolderNotFound? { + self as? DBXPaperPaperFolderCreateErrorFolderNotFound + } + + @objc + public var asInvalidFolderId: DBXPaperPaperFolderCreateErrorInvalidFolderId? { + self as? DBXPaperPaperFolderCreateErrorInvalidFolderId + } +} + +/// Your account does not have permissions to perform this action. This may be due to it only having access to +/// Paper as files in the Dropbox filesystem. For more information, refer to the Paper Migration Guide +/// https://www.dropbox.com/lp/developers/reference/paper-migration-guide. +@objc +public class DBXPaperPaperFolderCreateErrorInsufficientPermissions: DBXPaperPaperFolderCreateError { + @objc + public init() { + let swift = Paper.PaperFolderCreateError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperPaperFolderCreateErrorOther: DBXPaperPaperFolderCreateError { + @objc + public init() { + let swift = Paper.PaperFolderCreateError.other + super.init(swift: swift) + } +} + +/// The specified parent Paper folder cannot be found. +@objc +public class DBXPaperPaperFolderCreateErrorFolderNotFound: DBXPaperPaperFolderCreateError { + @objc + public init() { + let swift = Paper.PaperFolderCreateError.folderNotFound + super.init(swift: swift) + } +} + +/// The folder id cannot be decrypted to valid folder id. +@objc +public class DBXPaperPaperFolderCreateErrorInvalidFolderId: DBXPaperPaperFolderCreateError { + @objc + public init() { + let swift = Paper.PaperFolderCreateError.invalidFolderId + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperFolderCreateResult struct +@objc +public class DBXPaperPaperFolderCreateResult: NSObject { + /// Folder ID of the newly created folder. + @objc + public var folderId: String { swift.folderId } + + @objc + public init(folderId: String) { + self.swift = Paper.PaperFolderCreateResult(folderId: folderId) + } + + let swift: Paper.PaperFolderCreateResult + + public init(swift: Paper.PaperFolderCreateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RemovePaperDocUser struct +@objc +public class DBXPaperRemovePaperDocUser: DBXPaperRefPaperDoc { + /// User which should be removed from the Paper doc. Specify only email address or Dropbox account ID. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: subSwift.member) } + + @objc + public init(docId: String, member: DBXSharingMemberSelector) { + let swift = Paper.RemovePaperDocUser(docId: docId, member: member.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Paper.RemovePaperDocUser + + public init(swift: Paper.RemovePaperDocUser) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Sharing policy of Paper doc. +@objc +public class DBXPaperSharingPolicy: NSObject { + /// This value applies to the non-team members. + @objc + public var publicSharingPolicy: DBXPaperSharingPublicPolicyType? { guard let swift = swift.publicSharingPolicy else { return nil } + return DBXPaperSharingPublicPolicyType(swift: swift) + } + + /// This value applies to the team members only. The value is null for all personal accounts. + @objc + public var teamSharingPolicy: DBXPaperSharingTeamPolicyType? { guard let swift = swift.teamSharingPolicy else { return nil } + return DBXPaperSharingTeamPolicyType(swift: swift) + } + + @objc + public init(publicSharingPolicy: DBXPaperSharingPublicPolicyType?, teamSharingPolicy: DBXPaperSharingTeamPolicyType?) { + self.swift = Paper.SharingPolicy(publicSharingPolicy: publicSharingPolicy?.swift, teamSharingPolicy: teamSharingPolicy?.swift) + } + + let swift: Paper.SharingPolicy + + public init(swift: Paper.SharingPolicy) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The sharing policy type of the Paper doc. +@objc +public class DBXPaperSharingTeamPolicyType: NSObject { + let swift: Paper.SharingTeamPolicyType + + public init(swift: Paper.SharingTeamPolicyType) { + self.swift = swift + } + + public static func factory(swift: Paper.SharingTeamPolicyType) -> DBXPaperSharingTeamPolicyType { + switch swift { + case .peopleWithLinkCanEdit: + return DBXPaperSharingTeamPolicyTypePeopleWithLinkCanEdit() + case .peopleWithLinkCanViewAndComment: + return DBXPaperSharingTeamPolicyTypePeopleWithLinkCanViewAndComment() + case .inviteOnly: + return DBXPaperSharingTeamPolicyTypeInviteOnly() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPeopleWithLinkCanEdit: DBXPaperSharingTeamPolicyTypePeopleWithLinkCanEdit? { + self as? DBXPaperSharingTeamPolicyTypePeopleWithLinkCanEdit + } + + @objc + public var asPeopleWithLinkCanViewAndComment: DBXPaperSharingTeamPolicyTypePeopleWithLinkCanViewAndComment? { + self as? DBXPaperSharingTeamPolicyTypePeopleWithLinkCanViewAndComment + } + + @objc + public var asInviteOnly: DBXPaperSharingTeamPolicyTypeInviteOnly? { + self as? DBXPaperSharingTeamPolicyTypeInviteOnly + } +} + +/// Users who have a link to this doc can edit it. +@objc +public class DBXPaperSharingTeamPolicyTypePeopleWithLinkCanEdit: DBXPaperSharingTeamPolicyType { + @objc + public init() { + let swift = Paper.SharingTeamPolicyType.peopleWithLinkCanEdit + super.init(swift: swift) + } +} + +/// Users who have a link to this doc can view and comment on it. +@objc +public class DBXPaperSharingTeamPolicyTypePeopleWithLinkCanViewAndComment: DBXPaperSharingTeamPolicyType { + @objc + public init() { + let swift = Paper.SharingTeamPolicyType.peopleWithLinkCanViewAndComment + super.init(swift: swift) + } +} + +/// Users must be explicitly invited to this doc. +@objc +public class DBXPaperSharingTeamPolicyTypeInviteOnly: DBXPaperSharingTeamPolicyType { + @objc + public init() { + let swift = Paper.SharingTeamPolicyType.inviteOnly + super.init(swift: swift) + } +} + +/// Objective-C compatible SharingPublicPolicyType union +@objc +public class DBXPaperSharingPublicPolicyType: NSObject { + let swift: Paper.SharingPublicPolicyType + + public init(swift: Paper.SharingPublicPolicyType) { + self.swift = swift + } + + public static func factory(swift: Paper.SharingPublicPolicyType) -> DBXPaperSharingPublicPolicyType { + switch swift { + case .peopleWithLinkCanEdit: + return DBXPaperSharingPublicPolicyTypePeopleWithLinkCanEdit() + case .peopleWithLinkCanViewAndComment: + return DBXPaperSharingPublicPolicyTypePeopleWithLinkCanViewAndComment() + case .inviteOnly: + return DBXPaperSharingPublicPolicyTypeInviteOnly() + case .disabled: + return DBXPaperSharingPublicPolicyTypeDisabled() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPeopleWithLinkCanEdit: DBXPaperSharingPublicPolicyTypePeopleWithLinkCanEdit? { + self as? DBXPaperSharingPublicPolicyTypePeopleWithLinkCanEdit + } + + @objc + public var asPeopleWithLinkCanViewAndComment: DBXPaperSharingPublicPolicyTypePeopleWithLinkCanViewAndComment? { + self as? DBXPaperSharingPublicPolicyTypePeopleWithLinkCanViewAndComment + } + + @objc + public var asInviteOnly: DBXPaperSharingPublicPolicyTypeInviteOnly? { + self as? DBXPaperSharingPublicPolicyTypeInviteOnly + } + + @objc + public var asDisabled: DBXPaperSharingPublicPolicyTypeDisabled? { + self as? DBXPaperSharingPublicPolicyTypeDisabled + } +} + +/// Users who have a link to this doc can edit it. +@objc +public class DBXPaperSharingPublicPolicyTypePeopleWithLinkCanEdit: DBXPaperSharingPublicPolicyType { + @objc + public init() { + let swift = Paper.SharingPublicPolicyType.peopleWithLinkCanEdit + super.init(swift: swift) + } +} + +/// Users who have a link to this doc can view and comment on it. +@objc +public class DBXPaperSharingPublicPolicyTypePeopleWithLinkCanViewAndComment: DBXPaperSharingPublicPolicyType { + @objc + public init() { + let swift = Paper.SharingPublicPolicyType.peopleWithLinkCanViewAndComment + super.init(swift: swift) + } +} + +/// Users must be explicitly invited to this doc. +@objc +public class DBXPaperSharingPublicPolicyTypeInviteOnly: DBXPaperSharingPublicPolicyType { + @objc + public init() { + let swift = Paper.SharingPublicPolicyType.inviteOnly + super.init(swift: swift) + } +} + +/// Value used to indicate that doc sharing is enabled only within team. +@objc +public class DBXPaperSharingPublicPolicyTypeDisabled: DBXPaperSharingPublicPolicyType { + @objc + public init() { + let swift = Paper.SharingPublicPolicyType.disabled + super.init(swift: swift) + } +} + +/// Objective-C compatible UserInfoWithPermissionLevel struct +@objc +public class DBXPaperUserInfoWithPermissionLevel: NSObject { + /// User shared on the Paper doc. + @objc + public var user: DBXSharingUserInfo { DBXSharingUserInfo(swift: swift.user) } + /// Permission level for the user. + @objc + public var permissionLevel: DBXPaperPaperDocPermissionLevel { DBXPaperPaperDocPermissionLevel(swift: swift.permissionLevel) } + + @objc + public init(user: DBXSharingUserInfo, permissionLevel: DBXPaperPaperDocPermissionLevel) { + self.swift = Paper.UserInfoWithPermissionLevel(user: user.swift, permissionLevel: permissionLevel.swift) + } + + let swift: Paper.UserInfoWithPermissionLevel + + public init(swift: Paper.UserInfoWithPermissionLevel) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserOnPaperDocFilter union +@objc +public class DBXPaperUserOnPaperDocFilter: NSObject { + let swift: Paper.UserOnPaperDocFilter + + public init(swift: Paper.UserOnPaperDocFilter) { + self.swift = swift + } + + public static func factory(swift: Paper.UserOnPaperDocFilter) -> DBXPaperUserOnPaperDocFilter { + switch swift { + case .visited: + return DBXPaperUserOnPaperDocFilterVisited() + case .shared: + return DBXPaperUserOnPaperDocFilterShared() + case .other: + return DBXPaperUserOnPaperDocFilterOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asVisited: DBXPaperUserOnPaperDocFilterVisited? { + self as? DBXPaperUserOnPaperDocFilterVisited + } + + @objc + public var asShared: DBXPaperUserOnPaperDocFilterShared? { + self as? DBXPaperUserOnPaperDocFilterShared + } + + @objc + public var asOther: DBXPaperUserOnPaperDocFilterOther? { + self as? DBXPaperUserOnPaperDocFilterOther + } +} + +/// all users who have visited the Paper doc. +@objc +public class DBXPaperUserOnPaperDocFilterVisited: DBXPaperUserOnPaperDocFilter { + @objc + public init() { + let swift = Paper.UserOnPaperDocFilter.visited + super.init(swift: swift) + } +} + +/// All uses who are shared on the Paper doc. This includes all users who have visited the Paper doc as well as +/// those who have not. +@objc +public class DBXPaperUserOnPaperDocFilterShared: DBXPaperUserOnPaperDocFilter { + @objc + public init() { + let swift = Paper.UserOnPaperDocFilter.shared + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXPaperUserOnPaperDocFilterOther: DBXPaperUserOnPaperDocFilter { + @objc + public init() { + let swift = Paper.UserOnPaperDocFilter.other + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXPaperRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXPaperRoutes.swift new file mode 100644 index 000000000..484d93767 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXPaperRoutes.swift @@ -0,0 +1,1228 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the paper namespace +/// For Swift routes see PaperRoutes +@objc +public class DBXPaperRoutes: NSObject { + private let swift: PaperRoutes + init(swift: PaperRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient +} + +@objc +public class DBXPaperDocsArchiveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXPaperDocsCreateUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperPaperDocCreateUpdateResult?, DBXPaperPaperDocCreateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperPaperDocCreateUpdateResult?, DBXPaperPaperDocCreateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperPaperDocCreateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperPaperDocCreateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperPaperDocCreateUpdateResult? + if let swift = result { + objc = DBXPaperPaperDocCreateUpdateResult(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXPaperDocsDownloadDownloadRequestFile: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperPaperDocExportResult?, URL?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperPaperDocExportResult?, URL?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperPaperDocExportResult? + var destination: URL? + if let swift = result { + objc = DBXPaperPaperDocExportResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXPaperDocsDownloadDownloadRequestMemory: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperPaperDocExportResult?, Data?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperPaperDocExportResult?, Data?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperPaperDocExportResult? + var destination: Data? + if let swift = result { + objc = DBXPaperPaperDocExportResult(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXPaperDocsFolderUsersListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperListUsersOnFolderResponse?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperListUsersOnFolderResponse?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperListUsersOnFolderResponse? + if let swift = result { + objc = DBXPaperListUsersOnFolderResponse(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 DBXPaperDocsFolderUsersListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperListUsersOnFolderResponse?, DBXPaperListUsersCursorError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperListUsersOnFolderResponse?, DBXPaperListUsersCursorError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperListUsersCursorError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperListUsersCursorError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperListUsersOnFolderResponse? + if let swift = result { + objc = DBXPaperListUsersOnFolderResponse(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 DBXPaperDocsGetFolderInfoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperFoldersContainingPaperDoc?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperFoldersContainingPaperDoc?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperFoldersContainingPaperDoc? + if let swift = result { + objc = DBXPaperFoldersContainingPaperDoc(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 DBXPaperDocsListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperListPaperDocsResponse?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperListPaperDocsResponse?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXPaperListPaperDocsResponse? + if let swift = result { + objc = DBXPaperListPaperDocsResponse(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 DBXPaperDocsListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperListPaperDocsResponse?, DBXPaperListDocsCursorError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperListPaperDocsResponse?, DBXPaperListDocsCursorError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperListDocsCursorError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperListDocsCursorError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperListPaperDocsResponse? + if let swift = result { + objc = DBXPaperListPaperDocsResponse(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 DBXPaperDocsPermanentlyDeleteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXPaperDocsSharingPolicyGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperSharingPolicy?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperSharingPolicy?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperSharingPolicy? + if let swift = result { + objc = DBXPaperSharingPolicy(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 DBXPaperDocsSharingPolicySetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXPaperDocsUpdateUploadRequest: NSObject, DBXRequest { + var swift: UploadRequest + + init(swift: UploadRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperPaperDocCreateUpdateResult?, DBXPaperPaperDocUpdateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperPaperDocCreateUpdateResult?, DBXPaperPaperDocUpdateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperPaperDocUpdateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperPaperDocUpdateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperPaperDocCreateUpdateResult? + if let swift = result { + objc = DBXPaperPaperDocCreateUpdateResult(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXPaperDocsUsersAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Paper.DocLookupErrorSerializer> + + init(swift: RpcRequest, Paper.DocLookupErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXPaperAddPaperDocUserMemberResult]?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXPaperAddPaperDocUserMemberResult]?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXPaperAddPaperDocUserMemberResult]? + if let swift = result { + objc = swift.map { DBXPaperAddPaperDocUserMemberResult(swift: $0) } + } + 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 DBXPaperDocsUsersListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperListUsersOnPaperDocResponse?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperListUsersOnPaperDocResponse?, DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperListUsersOnPaperDocResponse? + if let swift = result { + objc = DBXPaperListUsersOnPaperDocResponse(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 DBXPaperDocsUsersListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperListUsersOnPaperDocResponse?, DBXPaperListUsersCursorError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperListUsersOnPaperDocResponse?, DBXPaperListUsersCursorError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperListUsersCursorError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperListUsersCursorError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperListUsersOnPaperDocResponse? + if let swift = result { + objc = DBXPaperListUsersOnPaperDocResponse(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 DBXPaperDocsUsersRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperDocLookupError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXPaperDocLookupError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperDocLookupError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXPaperFoldersCreateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXPaperPaperFolderCreateResult?, DBXPaperPaperFolderCreateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXPaperPaperFolderCreateResult?, DBXPaperPaperFolderCreateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXPaperPaperFolderCreateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXPaperPaperFolderCreateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXPaperPaperFolderCreateResult? + if let swift = result { + objc = DBXPaperPaperFolderCreateResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXSecondaryEmails.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSecondaryEmails.swift new file mode 100644 index 000000000..d17bde612 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSecondaryEmails.swift @@ -0,0 +1,36 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the secondary_emails namespace +/// For Swift see secondary_emails + +/// Objective-C compatible SecondaryEmail struct +@objc +public class DBXSecondaryEmailsSecondaryEmail: NSObject { + /// Secondary email address. + @objc + public var email: String { swift.email } + /// Whether or not the secondary email address is verified to be owned by a user. + @objc + public var isVerified: NSNumber { swift.isVerified as NSNumber } + + @objc + public init(email: String, isVerified: NSNumber) { + self.swift = SecondaryEmails.SecondaryEmail(email: email, isVerified: isVerified.boolValue) + } + + let swift: SecondaryEmails.SecondaryEmail + + public init(swift: SecondaryEmails.SecondaryEmail) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXSeenState.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSeenState.swift new file mode 100644 index 000000000..bd3c0a8f9 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSeenState.swift @@ -0,0 +1,165 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the seen_state namespace +/// For Swift see seen_state + +/// Possible platforms on which a user may view content. +@objc +public class DBXSeenStatePlatformType: NSObject { + let swift: SeenState.PlatformType + + public init(swift: SeenState.PlatformType) { + self.swift = swift + } + + public static func factory(swift: SeenState.PlatformType) -> DBXSeenStatePlatformType { + switch swift { + case .web: + return DBXSeenStatePlatformTypeWeb() + case .desktop: + return DBXSeenStatePlatformTypeDesktop() + case .mobileIos: + return DBXSeenStatePlatformTypeMobileIos() + case .mobileAndroid: + return DBXSeenStatePlatformTypeMobileAndroid() + case .api: + return DBXSeenStatePlatformTypeApi() + case .unknown: + return DBXSeenStatePlatformTypeUnknown() + case .mobile: + return DBXSeenStatePlatformTypeMobile() + case .other: + return DBXSeenStatePlatformTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asWeb: DBXSeenStatePlatformTypeWeb? { + self as? DBXSeenStatePlatformTypeWeb + } + + @objc + public var asDesktop: DBXSeenStatePlatformTypeDesktop? { + self as? DBXSeenStatePlatformTypeDesktop + } + + @objc + public var asMobileIos: DBXSeenStatePlatformTypeMobileIos? { + self as? DBXSeenStatePlatformTypeMobileIos + } + + @objc + public var asMobileAndroid: DBXSeenStatePlatformTypeMobileAndroid? { + self as? DBXSeenStatePlatformTypeMobileAndroid + } + + @objc + public var asApi: DBXSeenStatePlatformTypeApi? { + self as? DBXSeenStatePlatformTypeApi + } + + @objc + public var asUnknown: DBXSeenStatePlatformTypeUnknown? { + self as? DBXSeenStatePlatformTypeUnknown + } + + @objc + public var asMobile: DBXSeenStatePlatformTypeMobile? { + self as? DBXSeenStatePlatformTypeMobile + } + + @objc + public var asOther: DBXSeenStatePlatformTypeOther? { + self as? DBXSeenStatePlatformTypeOther + } +} + +/// The content was viewed on the web. +@objc +public class DBXSeenStatePlatformTypeWeb: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.web + super.init(swift: swift) + } +} + +/// The content was viewed on a desktop client. +@objc +public class DBXSeenStatePlatformTypeDesktop: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.desktop + super.init(swift: swift) + } +} + +/// The content was viewed on a mobile iOS client. +@objc +public class DBXSeenStatePlatformTypeMobileIos: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.mobileIos + super.init(swift: swift) + } +} + +/// The content was viewed on a mobile android client. +@objc +public class DBXSeenStatePlatformTypeMobileAndroid: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.mobileAndroid + super.init(swift: swift) + } +} + +/// The content was viewed from an API client. +@objc +public class DBXSeenStatePlatformTypeApi: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.api + super.init(swift: swift) + } +} + +/// The content was viewed on an unknown platform. +@objc +public class DBXSeenStatePlatformTypeUnknown: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.unknown + super.init(swift: swift) + } +} + +/// The content was viewed on a mobile client. DEPRECATED: Use mobile_ios or mobile_android instead. +@objc +public class DBXSeenStatePlatformTypeMobile: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.mobile + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSeenStatePlatformTypeOther: DBXSeenStatePlatformType { + @objc + public init() { + let swift = SeenState.PlatformType.other + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXSharing.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSharing.swift new file mode 100644 index 000000000..2d0532e88 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSharing.swift @@ -0,0 +1,11347 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the sharing namespace +/// For Swift see sharing + +/// Information about the inheritance policy of a shared folder. +@objc +public class DBXSharingAccessInheritance: NSObject { + let swift: Sharing.AccessInheritance + + public init(swift: Sharing.AccessInheritance) { + self.swift = swift + } + + public static func factory(swift: Sharing.AccessInheritance) -> DBXSharingAccessInheritance { + switch swift { + case .inherit: + return DBXSharingAccessInheritanceInherit() + case .noInherit: + return DBXSharingAccessInheritanceNoInherit() + case .other: + return DBXSharingAccessInheritanceOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInherit: DBXSharingAccessInheritanceInherit? { + self as? DBXSharingAccessInheritanceInherit + } + + @objc + public var asNoInherit: DBXSharingAccessInheritanceNoInherit? { + self as? DBXSharingAccessInheritanceNoInherit + } + + @objc + public var asOther: DBXSharingAccessInheritanceOther? { + self as? DBXSharingAccessInheritanceOther + } +} + +/// The shared folder inherits its members from the parent folder. +@objc +public class DBXSharingAccessInheritanceInherit: DBXSharingAccessInheritance { + @objc + public init() { + let swift = Sharing.AccessInheritance.inherit + super.init(swift: swift) + } +} + +/// The shared folder does not inherit its members from the parent folder. +@objc +public class DBXSharingAccessInheritanceNoInherit: DBXSharingAccessInheritance { + @objc + public init() { + let swift = Sharing.AccessInheritance.noInherit + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAccessInheritanceOther: DBXSharingAccessInheritance { + @objc + public init() { + let swift = Sharing.AccessInheritance.other + super.init(swift: swift) + } +} + +/// Defines the access levels for collaborators. +@objc +public class DBXSharingAccessLevel: NSObject { + let swift: Sharing.AccessLevel + + public init(swift: Sharing.AccessLevel) { + self.swift = swift + } + + public static func factory(swift: Sharing.AccessLevel) -> DBXSharingAccessLevel { + switch swift { + case .owner: + return DBXSharingAccessLevelOwner() + case .editor: + return DBXSharingAccessLevelEditor() + case .viewer: + return DBXSharingAccessLevelViewer() + case .viewerNoComment: + return DBXSharingAccessLevelViewerNoComment() + case .traverse: + return DBXSharingAccessLevelTraverse() + case .noAccess: + return DBXSharingAccessLevelNoAccess() + case .other: + return DBXSharingAccessLevelOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOwner: DBXSharingAccessLevelOwner? { + self as? DBXSharingAccessLevelOwner + } + + @objc + public var asEditor: DBXSharingAccessLevelEditor? { + self as? DBXSharingAccessLevelEditor + } + + @objc + public var asViewer: DBXSharingAccessLevelViewer? { + self as? DBXSharingAccessLevelViewer + } + + @objc + public var asViewerNoComment: DBXSharingAccessLevelViewerNoComment? { + self as? DBXSharingAccessLevelViewerNoComment + } + + @objc + public var asTraverse: DBXSharingAccessLevelTraverse? { + self as? DBXSharingAccessLevelTraverse + } + + @objc + public var asNoAccess: DBXSharingAccessLevelNoAccess? { + self as? DBXSharingAccessLevelNoAccess + } + + @objc + public var asOther: DBXSharingAccessLevelOther? { + self as? DBXSharingAccessLevelOther + } +} + +/// The collaborator is the owner of the shared folder. Owners can view and edit the shared folder as well as +/// set the folder's policies using updateFolderPolicy. +@objc +public class DBXSharingAccessLevelOwner: DBXSharingAccessLevel { + @objc + public init() { + let swift = Sharing.AccessLevel.owner + super.init(swift: swift) + } +} + +/// The collaborator can both view and edit the shared folder. +@objc +public class DBXSharingAccessLevelEditor: DBXSharingAccessLevel { + @objc + public init() { + let swift = Sharing.AccessLevel.editor + super.init(swift: swift) + } +} + +/// The collaborator can only view the shared folder. +@objc +public class DBXSharingAccessLevelViewer: DBXSharingAccessLevel { + @objc + public init() { + let swift = Sharing.AccessLevel.viewer + super.init(swift: swift) + } +} + +/// The collaborator can only view the shared folder and does not have any access to comments. +@objc +public class DBXSharingAccessLevelViewerNoComment: DBXSharingAccessLevel { + @objc + public init() { + let swift = Sharing.AccessLevel.viewerNoComment + super.init(swift: swift) + } +} + +/// The collaborator can only view the shared folder that they have access to. +@objc +public class DBXSharingAccessLevelTraverse: DBXSharingAccessLevel { + @objc + public init() { + let swift = Sharing.AccessLevel.traverse + super.init(swift: swift) + } +} + +/// If there is a Righteous Link on the folder which grants access and the user has visited such link, they are +/// allowed to perform certain action (i.e. add themselves to the folder) via the link access even +/// though the user themselves are not a member on the shared folder yet. +@objc +public class DBXSharingAccessLevelNoAccess: DBXSharingAccessLevel { + @objc + public init() { + let swift = Sharing.AccessLevel.noAccess + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAccessLevelOther: DBXSharingAccessLevel { + @objc + public init() { + let swift = Sharing.AccessLevel.other + super.init(swift: swift) + } +} + +/// Who can change a shared folder's access control list (ACL). In other words, who can add, remove, or change the +/// privileges of members. +@objc +public class DBXSharingAclUpdatePolicy: NSObject { + let swift: Sharing.AclUpdatePolicy + + public init(swift: Sharing.AclUpdatePolicy) { + self.swift = swift + } + + public static func factory(swift: Sharing.AclUpdatePolicy) -> DBXSharingAclUpdatePolicy { + switch swift { + case .owner: + return DBXSharingAclUpdatePolicyOwner() + case .editors: + return DBXSharingAclUpdatePolicyEditors() + case .other: + return DBXSharingAclUpdatePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOwner: DBXSharingAclUpdatePolicyOwner? { + self as? DBXSharingAclUpdatePolicyOwner + } + + @objc + public var asEditors: DBXSharingAclUpdatePolicyEditors? { + self as? DBXSharingAclUpdatePolicyEditors + } + + @objc + public var asOther: DBXSharingAclUpdatePolicyOther? { + self as? DBXSharingAclUpdatePolicyOther + } +} + +/// Only the owner can update the ACL. +@objc +public class DBXSharingAclUpdatePolicyOwner: DBXSharingAclUpdatePolicy { + @objc + public init() { + let swift = Sharing.AclUpdatePolicy.owner + super.init(swift: swift) + } +} + +/// Any editor can update the ACL. This may be further restricted to editors on the same team. +@objc +public class DBXSharingAclUpdatePolicyEditors: DBXSharingAclUpdatePolicy { + @objc + public init() { + let swift = Sharing.AclUpdatePolicy.editors + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAclUpdatePolicyOther: DBXSharingAclUpdatePolicy { + @objc + public init() { + let swift = Sharing.AclUpdatePolicy.other + super.init(swift: swift) + } +} + +/// Arguments for addFileMember. +@objc +public class DBXSharingAddFileMemberArgs: NSObject { + /// File to which to add members. + @objc + public var file: String { swift.file } + /// Members to add. Note that even an email address is given, this may result in a user being directly added to + /// the membership if that email is the user's main account email. + @objc + public var members: [DBXSharingMemberSelector] { swift.members.map { DBXSharingMemberSelector(swift: $0) } } + /// Message to send to added members in their invitation. + @objc + public var customMessage: String? { swift.customMessage } + /// Whether added members should be notified via email and device notifications of their invitation. + @objc + public var quiet: NSNumber { swift.quiet as NSNumber } + /// AccessLevel union object, describing what access level we want to give new members. + @objc + public var accessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.accessLevel) } + /// If the custom message should be added as a comment on the file. + @objc + public var addMessageAsComment: NSNumber { swift.addMessageAsComment as NSNumber } + + @objc + public init( + file: String, + members: [DBXSharingMemberSelector], + customMessage: String?, + quiet: NSNumber, + accessLevel: DBXSharingAccessLevel, + addMessageAsComment: NSNumber + ) { + self.swift = Sharing.AddFileMemberArgs( + file: file, + members: members.map(\.swift), + customMessage: customMessage, + quiet: quiet.boolValue, + accessLevel: accessLevel.swift, + addMessageAsComment: addMessageAsComment.boolValue + ) + } + + let swift: Sharing.AddFileMemberArgs + + public init(swift: Sharing.AddFileMemberArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Errors for addFileMember. +@objc +public class DBXSharingAddFileMemberError: NSObject { + let swift: Sharing.AddFileMemberError + + public init(swift: Sharing.AddFileMemberError) { + self.swift = swift + } + + public static func factory(swift: Sharing.AddFileMemberError) -> DBXSharingAddFileMemberError { + switch swift { + case .userError(let swiftArg): + let arg = DBXSharingSharingUserError(swift: swiftArg) + return DBXSharingAddFileMemberErrorUserError(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingAddFileMemberErrorAccessError(arg) + case .rateLimit: + return DBXSharingAddFileMemberErrorRateLimit() + case .invalidComment: + return DBXSharingAddFileMemberErrorInvalidComment() + case .other: + return DBXSharingAddFileMemberErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserError: DBXSharingAddFileMemberErrorUserError? { + self as? DBXSharingAddFileMemberErrorUserError + } + + @objc + public var asAccessError: DBXSharingAddFileMemberErrorAccessError? { + self as? DBXSharingAddFileMemberErrorAccessError + } + + @objc + public var asRateLimit: DBXSharingAddFileMemberErrorRateLimit? { + self as? DBXSharingAddFileMemberErrorRateLimit + } + + @objc + public var asInvalidComment: DBXSharingAddFileMemberErrorInvalidComment? { + self as? DBXSharingAddFileMemberErrorInvalidComment + } + + @objc + public var asOther: DBXSharingAddFileMemberErrorOther? { + self as? DBXSharingAddFileMemberErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingAddFileMemberErrorUserError: DBXSharingAddFileMemberError { + @objc + public var userError: DBXSharingSharingUserError + + @objc + public init(_ arg: DBXSharingSharingUserError) { + self.userError = arg + let swift = Sharing.AddFileMemberError.userError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAddFileMemberErrorAccessError: DBXSharingAddFileMemberError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.AddFileMemberError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// The user has reached the rate limit for invitations. +@objc +public class DBXSharingAddFileMemberErrorRateLimit: DBXSharingAddFileMemberError { + @objc + public init() { + let swift = Sharing.AddFileMemberError.rateLimit + super.init(swift: swift) + } +} + +/// The custom message did not pass comment permissions checks. +@objc +public class DBXSharingAddFileMemberErrorInvalidComment: DBXSharingAddFileMemberError { + @objc + public init() { + let swift = Sharing.AddFileMemberError.invalidComment + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAddFileMemberErrorOther: DBXSharingAddFileMemberError { + @objc + public init() { + let swift = Sharing.AddFileMemberError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AddFolderMemberArg struct +@objc +public class DBXSharingAddFolderMemberArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// The intended list of members to add. Added members will receive invites to join the shared folder. + @objc + public var members: [DBXSharingAddMember] { swift.members.map { DBXSharingAddMember(swift: $0) } } + /// Whether added members should be notified via email and device notifications of their invite. + @objc + public var quiet: NSNumber { swift.quiet as NSNumber } + /// Optional message to display to added members in their invitation. + @objc + public var customMessage: String? { swift.customMessage } + + @objc + public init(sharedFolderId: String, members: [DBXSharingAddMember], quiet: NSNumber, customMessage: String?) { + self.swift = Sharing.AddFolderMemberArg( + sharedFolderId: sharedFolderId, + members: members.map(\.swift), + quiet: quiet.boolValue, + customMessage: customMessage + ) + } + + let swift: Sharing.AddFolderMemberArg + + public init(swift: Sharing.AddFolderMemberArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AddFolderMemberError union +@objc +public class DBXSharingAddFolderMemberError: NSObject { + let swift: Sharing.AddFolderMemberError + + public init(swift: Sharing.AddFolderMemberError) { + self.swift = swift + } + + public static func factory(swift: Sharing.AddFolderMemberError) -> DBXSharingAddFolderMemberError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingAddFolderMemberErrorAccessError(arg) + case .emailUnverified: + return DBXSharingAddFolderMemberErrorEmailUnverified() + case .bannedMember: + return DBXSharingAddFolderMemberErrorBannedMember() + case .badMember(let swiftArg): + let arg = DBXSharingAddMemberSelectorError(swift: swiftArg) + return DBXSharingAddFolderMemberErrorBadMember(arg) + case .cantShareOutsideTeam: + return DBXSharingAddFolderMemberErrorCantShareOutsideTeam() + case .tooManyMembers(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXSharingAddFolderMemberErrorTooManyMembers(arg) + case .tooManyPendingInvites(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXSharingAddFolderMemberErrorTooManyPendingInvites(arg) + case .rateLimit: + return DBXSharingAddFolderMemberErrorRateLimit() + case .tooManyInvitees: + return DBXSharingAddFolderMemberErrorTooManyInvitees() + case .insufficientPlan: + return DBXSharingAddFolderMemberErrorInsufficientPlan() + case .teamFolder: + return DBXSharingAddFolderMemberErrorTeamFolder() + case .noPermission: + return DBXSharingAddFolderMemberErrorNoPermission() + case .invalidSharedFolder: + return DBXSharingAddFolderMemberErrorInvalidSharedFolder() + case .other: + return DBXSharingAddFolderMemberErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingAddFolderMemberErrorAccessError? { + self as? DBXSharingAddFolderMemberErrorAccessError + } + + @objc + public var asEmailUnverified: DBXSharingAddFolderMemberErrorEmailUnverified? { + self as? DBXSharingAddFolderMemberErrorEmailUnverified + } + + @objc + public var asBannedMember: DBXSharingAddFolderMemberErrorBannedMember? { + self as? DBXSharingAddFolderMemberErrorBannedMember + } + + @objc + public var asBadMember: DBXSharingAddFolderMemberErrorBadMember? { + self as? DBXSharingAddFolderMemberErrorBadMember + } + + @objc + public var asCantShareOutsideTeam: DBXSharingAddFolderMemberErrorCantShareOutsideTeam? { + self as? DBXSharingAddFolderMemberErrorCantShareOutsideTeam + } + + @objc + public var asTooManyMembers: DBXSharingAddFolderMemberErrorTooManyMembers? { + self as? DBXSharingAddFolderMemberErrorTooManyMembers + } + + @objc + public var asTooManyPendingInvites: DBXSharingAddFolderMemberErrorTooManyPendingInvites? { + self as? DBXSharingAddFolderMemberErrorTooManyPendingInvites + } + + @objc + public var asRateLimit: DBXSharingAddFolderMemberErrorRateLimit? { + self as? DBXSharingAddFolderMemberErrorRateLimit + } + + @objc + public var asTooManyInvitees: DBXSharingAddFolderMemberErrorTooManyInvitees? { + self as? DBXSharingAddFolderMemberErrorTooManyInvitees + } + + @objc + public var asInsufficientPlan: DBXSharingAddFolderMemberErrorInsufficientPlan? { + self as? DBXSharingAddFolderMemberErrorInsufficientPlan + } + + @objc + public var asTeamFolder: DBXSharingAddFolderMemberErrorTeamFolder? { + self as? DBXSharingAddFolderMemberErrorTeamFolder + } + + @objc + public var asNoPermission: DBXSharingAddFolderMemberErrorNoPermission? { + self as? DBXSharingAddFolderMemberErrorNoPermission + } + + @objc + public var asInvalidSharedFolder: DBXSharingAddFolderMemberErrorInvalidSharedFolder? { + self as? DBXSharingAddFolderMemberErrorInvalidSharedFolder + } + + @objc + public var asOther: DBXSharingAddFolderMemberErrorOther? { + self as? DBXSharingAddFolderMemberErrorOther + } +} + +/// Unable to access shared folder. +@objc +public class DBXSharingAddFolderMemberErrorAccessError: DBXSharingAddFolderMemberError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.AddFolderMemberError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXSharingAddFolderMemberErrorEmailUnverified: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.emailUnverified + super.init(swift: swift) + } +} + +/// The current user has been banned. +@objc +public class DBXSharingAddFolderMemberErrorBannedMember: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.bannedMember + super.init(swift: swift) + } +} + +/// members in AddFolderMemberArg contains a bad invitation recipient. +@objc +public class DBXSharingAddFolderMemberErrorBadMember: DBXSharingAddFolderMemberError { + @objc + public var badMember: DBXSharingAddMemberSelectorError + + @objc + public init(_ arg: DBXSharingAddMemberSelectorError) { + self.badMember = arg + let swift = Sharing.AddFolderMemberError.badMember(arg.swift) + super.init(swift: swift) + } +} + +/// Your team policy does not allow sharing outside of the team. +@objc +public class DBXSharingAddFolderMemberErrorCantShareOutsideTeam: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.cantShareOutsideTeam + super.init(swift: swift) + } +} + +/// The value is the member limit that was reached. +@objc +public class DBXSharingAddFolderMemberErrorTooManyMembers: DBXSharingAddFolderMemberError { + @objc + public var tooManyMembers: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.tooManyMembers = arg + let swift = Sharing.AddFolderMemberError.tooManyMembers(arg.uint64Value) + super.init(swift: swift) + } +} + +/// The value is the pending invite limit that was reached. +@objc +public class DBXSharingAddFolderMemberErrorTooManyPendingInvites: DBXSharingAddFolderMemberError { + @objc + public var tooManyPendingInvites: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.tooManyPendingInvites = arg + let swift = Sharing.AddFolderMemberError.tooManyPendingInvites(arg.uint64Value) + super.init(swift: swift) + } +} + +/// The current user has hit the limit of invites they can send per day. Try again in 24 hours. +@objc +public class DBXSharingAddFolderMemberErrorRateLimit: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.rateLimit + super.init(swift: swift) + } +} + +/// The current user is trying to share with too many people at once. +@objc +public class DBXSharingAddFolderMemberErrorTooManyInvitees: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.tooManyInvitees + super.init(swift: swift) + } +} + +/// The current user's account doesn't support this action. An example of this is when adding a read-only +/// member. This action can only be performed by users that have upgraded to a Pro or Business plan. +@objc +public class DBXSharingAddFolderMemberErrorInsufficientPlan: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.insufficientPlan + super.init(swift: swift) + } +} + +/// This action cannot be performed on a team shared folder. +@objc +public class DBXSharingAddFolderMemberErrorTeamFolder: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.teamFolder + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingAddFolderMemberErrorNoPermission: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.noPermission + super.init(swift: swift) + } +} + +/// Invalid shared folder error will be returned as an access_error. +@objc +public class DBXSharingAddFolderMemberErrorInvalidSharedFolder: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.invalidSharedFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAddFolderMemberErrorOther: DBXSharingAddFolderMemberError { + @objc + public init() { + let swift = Sharing.AddFolderMemberError.other + super.init(swift: swift) + } +} + +/// The member and type of access the member should have when added to a shared folder. +@objc +public class DBXSharingAddMember: NSObject { + /// The member to add to the shared folder. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + /// The access level to grant member to the shared folder. owner in AccessLevel is disallowed. + @objc + public var accessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.accessLevel) } + + @objc + public init(member: DBXSharingMemberSelector, accessLevel: DBXSharingAccessLevel) { + self.swift = Sharing.AddMember(member: member.swift, accessLevel: accessLevel.swift) + } + + let swift: Sharing.AddMember + + public init(swift: Sharing.AddMember) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AddMemberSelectorError union +@objc +public class DBXSharingAddMemberSelectorError: NSObject { + let swift: Sharing.AddMemberSelectorError + + public init(swift: Sharing.AddMemberSelectorError) { + self.swift = swift + } + + public static func factory(swift: Sharing.AddMemberSelectorError) -> DBXSharingAddMemberSelectorError { + switch swift { + case .automaticGroup: + return DBXSharingAddMemberSelectorErrorAutomaticGroup() + case .invalidDropboxId(let swiftArg): + let arg = swiftArg + return DBXSharingAddMemberSelectorErrorInvalidDropboxId(arg) + case .invalidEmail(let swiftArg): + let arg = swiftArg + return DBXSharingAddMemberSelectorErrorInvalidEmail(arg) + case .unverifiedDropboxId(let swiftArg): + let arg = swiftArg + return DBXSharingAddMemberSelectorErrorUnverifiedDropboxId(arg) + case .groupDeleted: + return DBXSharingAddMemberSelectorErrorGroupDeleted() + case .groupNotOnTeam: + return DBXSharingAddMemberSelectorErrorGroupNotOnTeam() + case .other: + return DBXSharingAddMemberSelectorErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAutomaticGroup: DBXSharingAddMemberSelectorErrorAutomaticGroup? { + self as? DBXSharingAddMemberSelectorErrorAutomaticGroup + } + + @objc + public var asInvalidDropboxId: DBXSharingAddMemberSelectorErrorInvalidDropboxId? { + self as? DBXSharingAddMemberSelectorErrorInvalidDropboxId + } + + @objc + public var asInvalidEmail: DBXSharingAddMemberSelectorErrorInvalidEmail? { + self as? DBXSharingAddMemberSelectorErrorInvalidEmail + } + + @objc + public var asUnverifiedDropboxId: DBXSharingAddMemberSelectorErrorUnverifiedDropboxId? { + self as? DBXSharingAddMemberSelectorErrorUnverifiedDropboxId + } + + @objc + public var asGroupDeleted: DBXSharingAddMemberSelectorErrorGroupDeleted? { + self as? DBXSharingAddMemberSelectorErrorGroupDeleted + } + + @objc + public var asGroupNotOnTeam: DBXSharingAddMemberSelectorErrorGroupNotOnTeam? { + self as? DBXSharingAddMemberSelectorErrorGroupNotOnTeam + } + + @objc + public var asOther: DBXSharingAddMemberSelectorErrorOther? { + self as? DBXSharingAddMemberSelectorErrorOther + } +} + +/// Automatically created groups can only be added to team folders. +@objc +public class DBXSharingAddMemberSelectorErrorAutomaticGroup: DBXSharingAddMemberSelectorError { + @objc + public init() { + let swift = Sharing.AddMemberSelectorError.automaticGroup + super.init(swift: swift) + } +} + +/// The value is the ID that could not be identified. +@objc +public class DBXSharingAddMemberSelectorErrorInvalidDropboxId: DBXSharingAddMemberSelectorError { + @objc + public var invalidDropboxId: String + + @objc + public init(_ arg: String) { + self.invalidDropboxId = arg + let swift = Sharing.AddMemberSelectorError.invalidDropboxId(arg) + super.init(swift: swift) + } +} + +/// The value is the e-email address that is malformed. +@objc +public class DBXSharingAddMemberSelectorErrorInvalidEmail: DBXSharingAddMemberSelectorError { + @objc + public var invalidEmail: String + + @objc + public init(_ arg: String) { + self.invalidEmail = arg + let swift = Sharing.AddMemberSelectorError.invalidEmail(arg) + super.init(swift: swift) + } +} + +/// The value is the ID of the Dropbox user with an unverified email address. Invite unverified users by email +/// address instead of by their Dropbox ID. +@objc +public class DBXSharingAddMemberSelectorErrorUnverifiedDropboxId: DBXSharingAddMemberSelectorError { + @objc + public var unverifiedDropboxId: String + + @objc + public init(_ arg: String) { + self.unverifiedDropboxId = arg + let swift = Sharing.AddMemberSelectorError.unverifiedDropboxId(arg) + super.init(swift: swift) + } +} + +/// At least one of the specified groups in members in AddFolderMemberArg is deleted. +@objc +public class DBXSharingAddMemberSelectorErrorGroupDeleted: DBXSharingAddMemberSelectorError { + @objc + public init() { + let swift = Sharing.AddMemberSelectorError.groupDeleted + super.init(swift: swift) + } +} + +/// Sharing to a group that is not on the current user's team. +@objc +public class DBXSharingAddMemberSelectorErrorGroupNotOnTeam: DBXSharingAddMemberSelectorError { + @objc + public init() { + let swift = Sharing.AddMemberSelectorError.groupNotOnTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAddMemberSelectorErrorOther: DBXSharingAddMemberSelectorError { + @objc + public init() { + let swift = Sharing.AddMemberSelectorError.other + super.init(swift: swift) + } +} + +/// The access permission that can be requested by the caller for the shared link. Note that the final resolved +/// visibility of the shared link takes into account other aspects, such as team and shared folder settings. Check +/// the ResolvedVisibility for more info on the possible resolved visibility values of shared links. +@objc +public class DBXSharingRequestedVisibility: NSObject { + let swift: Sharing.RequestedVisibility + + public init(swift: Sharing.RequestedVisibility) { + self.swift = swift + } + + public static func factory(swift: Sharing.RequestedVisibility) -> DBXSharingRequestedVisibility { + switch swift { + case .public_: + return DBXSharingRequestedVisibilityPublic_() + case .teamOnly: + return DBXSharingRequestedVisibilityTeamOnly() + case .password: + return DBXSharingRequestedVisibilityPassword() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPublic_: DBXSharingRequestedVisibilityPublic_? { + self as? DBXSharingRequestedVisibilityPublic_ + } + + @objc + public var asTeamOnly: DBXSharingRequestedVisibilityTeamOnly? { + self as? DBXSharingRequestedVisibilityTeamOnly + } + + @objc + public var asPassword: DBXSharingRequestedVisibilityPassword? { + self as? DBXSharingRequestedVisibilityPassword + } +} + +/// Anyone who has received the link can access it. No login required. +@objc +public class DBXSharingRequestedVisibilityPublic_: DBXSharingRequestedVisibility { + @objc + public init() { + let swift = Sharing.RequestedVisibility.public_ + super.init(swift: swift) + } +} + +/// Only members of the same team can access the link. Login is required. +@objc +public class DBXSharingRequestedVisibilityTeamOnly: DBXSharingRequestedVisibility { + @objc + public init() { + let swift = Sharing.RequestedVisibility.teamOnly + super.init(swift: swift) + } +} + +/// A link-specific password is required to access the link. Login is not required. +@objc +public class DBXSharingRequestedVisibilityPassword: DBXSharingRequestedVisibility { + @objc + public init() { + let swift = Sharing.RequestedVisibility.password + super.init(swift: swift) + } +} + +/// The actual access permissions values of shared links after taking into account user preferences and the team and +/// shared folder settings. Check the RequestedVisibility for more info on the possible visibility values that can +/// be set by the shared link's owner. +@objc +public class DBXSharingResolvedVisibility: NSObject { + let swift: Sharing.ResolvedVisibility + + public init(swift: Sharing.ResolvedVisibility) { + self.swift = swift + } + + public static func factory(swift: Sharing.ResolvedVisibility) -> DBXSharingResolvedVisibility { + switch swift { + case .public_: + return DBXSharingResolvedVisibilityPublic_() + case .teamOnly: + return DBXSharingResolvedVisibilityTeamOnly() + case .password: + return DBXSharingResolvedVisibilityPassword() + case .teamAndPassword: + return DBXSharingResolvedVisibilityTeamAndPassword() + case .sharedFolderOnly: + return DBXSharingResolvedVisibilitySharedFolderOnly() + case .noOne: + return DBXSharingResolvedVisibilityNoOne() + case .onlyYou: + return DBXSharingResolvedVisibilityOnlyYou() + case .other: + return DBXSharingResolvedVisibilityOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPublic_: DBXSharingResolvedVisibilityPublic_? { + self as? DBXSharingResolvedVisibilityPublic_ + } + + @objc + public var asTeamOnly: DBXSharingResolvedVisibilityTeamOnly? { + self as? DBXSharingResolvedVisibilityTeamOnly + } + + @objc + public var asPassword: DBXSharingResolvedVisibilityPassword? { + self as? DBXSharingResolvedVisibilityPassword + } + + @objc + public var asTeamAndPassword: DBXSharingResolvedVisibilityTeamAndPassword? { + self as? DBXSharingResolvedVisibilityTeamAndPassword + } + + @objc + public var asSharedFolderOnly: DBXSharingResolvedVisibilitySharedFolderOnly? { + self as? DBXSharingResolvedVisibilitySharedFolderOnly + } + + @objc + public var asNoOne: DBXSharingResolvedVisibilityNoOne? { + self as? DBXSharingResolvedVisibilityNoOne + } + + @objc + public var asOnlyYou: DBXSharingResolvedVisibilityOnlyYou? { + self as? DBXSharingResolvedVisibilityOnlyYou + } + + @objc + public var asOther: DBXSharingResolvedVisibilityOther? { + self as? DBXSharingResolvedVisibilityOther + } +} + +/// Anyone who has received the link can access it. No login required. +@objc +public class DBXSharingResolvedVisibilityPublic_: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.public_ + super.init(swift: swift) + } +} + +/// Only members of the same team can access the link. Login is required. +@objc +public class DBXSharingResolvedVisibilityTeamOnly: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.teamOnly + super.init(swift: swift) + } +} + +/// A link-specific password is required to access the link. Login is not required. +@objc +public class DBXSharingResolvedVisibilityPassword: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.password + super.init(swift: swift) + } +} + +/// Only members of the same team who have the link-specific password can access the link. Login is required. +@objc +public class DBXSharingResolvedVisibilityTeamAndPassword: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.teamAndPassword + super.init(swift: swift) + } +} + +/// Only members of the shared folder containing the linked file can access the link. Login is required. +@objc +public class DBXSharingResolvedVisibilitySharedFolderOnly: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.sharedFolderOnly + super.init(swift: swift) + } +} + +/// The link merely points the user to the content, and does not grant any additional rights. Existing members +/// of the content who use this link can only access the content with their pre-existing access rights. +/// Either on the file directly, or inherited from a parent folder. +@objc +public class DBXSharingResolvedVisibilityNoOne: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.noOne + super.init(swift: swift) + } +} + +/// Only the current user can view this link. +@objc +public class DBXSharingResolvedVisibilityOnlyYou: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.onlyYou + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingResolvedVisibilityOther: DBXSharingResolvedVisibility { + @objc + public init() { + let swift = Sharing.ResolvedVisibility.other + super.init(swift: swift) + } +} + +/// check documentation for ResolvedVisibility. +@objc +public class DBXSharingAlphaResolvedVisibility: NSObject { + let swift: Sharing.AlphaResolvedVisibility + + public init(swift: Sharing.AlphaResolvedVisibility) { + self.swift = swift + } + + public static func factory(swift: Sharing.AlphaResolvedVisibility) -> DBXSharingAlphaResolvedVisibility { + switch swift { + case .public_: + return DBXSharingAlphaResolvedVisibilityPublic_() + case .teamOnly: + return DBXSharingAlphaResolvedVisibilityTeamOnly() + case .password: + return DBXSharingAlphaResolvedVisibilityPassword() + case .teamAndPassword: + return DBXSharingAlphaResolvedVisibilityTeamAndPassword() + case .sharedFolderOnly: + return DBXSharingAlphaResolvedVisibilitySharedFolderOnly() + case .noOne: + return DBXSharingAlphaResolvedVisibilityNoOne() + case .onlyYou: + return DBXSharingAlphaResolvedVisibilityOnlyYou() + case .other: + return DBXSharingAlphaResolvedVisibilityOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPublic_: DBXSharingAlphaResolvedVisibilityPublic_? { + self as? DBXSharingAlphaResolvedVisibilityPublic_ + } + + @objc + public var asTeamOnly: DBXSharingAlphaResolvedVisibilityTeamOnly? { + self as? DBXSharingAlphaResolvedVisibilityTeamOnly + } + + @objc + public var asPassword: DBXSharingAlphaResolvedVisibilityPassword? { + self as? DBXSharingAlphaResolvedVisibilityPassword + } + + @objc + public var asTeamAndPassword: DBXSharingAlphaResolvedVisibilityTeamAndPassword? { + self as? DBXSharingAlphaResolvedVisibilityTeamAndPassword + } + + @objc + public var asSharedFolderOnly: DBXSharingAlphaResolvedVisibilitySharedFolderOnly? { + self as? DBXSharingAlphaResolvedVisibilitySharedFolderOnly + } + + @objc + public var asNoOne: DBXSharingAlphaResolvedVisibilityNoOne? { + self as? DBXSharingAlphaResolvedVisibilityNoOne + } + + @objc + public var asOnlyYou: DBXSharingAlphaResolvedVisibilityOnlyYou? { + self as? DBXSharingAlphaResolvedVisibilityOnlyYou + } + + @objc + public var asOther: DBXSharingAlphaResolvedVisibilityOther? { + self as? DBXSharingAlphaResolvedVisibilityOther + } +} + +/// Anyone who has received the link can access it. No login required. +@objc +public class DBXSharingAlphaResolvedVisibilityPublic_: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.public_ + super.init(swift: swift) + } +} + +/// Only members of the same team can access the link. Login is required. +@objc +public class DBXSharingAlphaResolvedVisibilityTeamOnly: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.teamOnly + super.init(swift: swift) + } +} + +/// A link-specific password is required to access the link. Login is not required. +@objc +public class DBXSharingAlphaResolvedVisibilityPassword: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.password + super.init(swift: swift) + } +} + +/// Only members of the same team who have the link-specific password can access the link. Login is required. +@objc +public class DBXSharingAlphaResolvedVisibilityTeamAndPassword: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.teamAndPassword + super.init(swift: swift) + } +} + +/// Only members of the shared folder containing the linked file can access the link. Login is required. +@objc +public class DBXSharingAlphaResolvedVisibilitySharedFolderOnly: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.sharedFolderOnly + super.init(swift: swift) + } +} + +/// The link merely points the user to the content, and does not grant any additional rights. Existing members +/// of the content who use this link can only access the content with their pre-existing access rights. +/// Either on the file directly, or inherited from a parent folder. +@objc +public class DBXSharingAlphaResolvedVisibilityNoOne: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.noOne + super.init(swift: swift) + } +} + +/// Only the current user can view this link. +@objc +public class DBXSharingAlphaResolvedVisibilityOnlyYou: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.onlyYou + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingAlphaResolvedVisibilityOther: DBXSharingAlphaResolvedVisibility { + @objc + public init() { + let swift = Sharing.AlphaResolvedVisibility.other + super.init(swift: swift) + } +} + +/// Information about the content that has a link audience different than that of this folder. +@objc +public class DBXSharingAudienceExceptionContentInfo: NSObject { + /// The name of the content, which is either a file or a folder. + @objc + public var name: String { swift.name } + + @objc + public init(name: String) { + self.swift = Sharing.AudienceExceptionContentInfo(name: name) + } + + let swift: Sharing.AudienceExceptionContentInfo + + public init(swift: Sharing.AudienceExceptionContentInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The total count and truncated list of information of content inside this folder that has a different audience +/// than the link on this folder. This is only returned for folders. +@objc +public class DBXSharingAudienceExceptions: NSObject { + /// (no description) + @objc + public var count: NSNumber { swift.count as NSNumber } + /// A truncated list of some of the content that is an exception. The length of this list could be smaller than + /// the count since it is only a sample but will not be empty as long as count is not 0. + @objc + public var exceptions: [DBXSharingAudienceExceptionContentInfo] { swift.exceptions.map { DBXSharingAudienceExceptionContentInfo(swift: $0) } } + + @objc + public init(count: NSNumber, exceptions: [DBXSharingAudienceExceptionContentInfo]) { + self.swift = Sharing.AudienceExceptions(count: count.uint32Value, exceptions: exceptions.map(\.swift)) + } + + let swift: Sharing.AudienceExceptions + + public init(swift: Sharing.AudienceExceptions) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about the shared folder that prevents the link audience for this link from being more restrictive. +@objc +public class DBXSharingAudienceRestrictingSharedFolder: NSObject { + /// The ID of the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// The name of the shared folder. + @objc + public var name: String { swift.name } + /// The link audience of the shared folder. + @objc + public var audience: DBXSharingLinkAudience { DBXSharingLinkAudience(swift: swift.audience) } + + @objc + public init(sharedFolderId: String, name: String, audience: DBXSharingLinkAudience) { + self.swift = Sharing.AudienceRestrictingSharedFolder(sharedFolderId: sharedFolderId, name: name, audience: audience.swift) + } + + let swift: Sharing.AudienceRestrictingSharedFolder + + public init(swift: Sharing.AudienceRestrictingSharedFolder) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Metadata for a shared link. This can be either a PathLinkMetadata or CollectionLinkMetadata. +@objc +public class DBXSharingLinkMetadata: NSObject { + /// URL of the shared link. + @objc + public var url: String { swift.url } + /// Who can access the link. + @objc + public var visibility: DBXSharingVisibility { DBXSharingVisibility(swift: swift.visibility) } + /// Expiration time, if set. By default the link won't expire. + @objc + public var expires: Date? { swift.expires } + + @objc + public init(url: String, visibility: DBXSharingVisibility, expires: Date?) { + self.swift = Sharing.LinkMetadata(url: url, visibility: visibility.swift, expires: expires) + } + + let swift: Sharing.LinkMetadata + + public init(swift: Sharing.LinkMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Metadata for a collection-based shared link. +@objc +public class DBXSharingCollectionLinkMetadata: DBXSharingLinkMetadata { + let subSwift: Sharing.CollectionLinkMetadata + + public init(swift: Sharing.CollectionLinkMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible CreateSharedLinkArg struct +@objc +public class DBXSharingCreateSharedLinkArg: NSObject { + /// The path to share. + @objc + public var path: String { swift.path } + /// (no description) + @objc + public var shortUrl: NSNumber { swift.shortUrl as NSNumber } + /// If it's okay to share a path that does not yet exist, set this to either file in PendingUploadMode or folder + /// in PendingUploadMode to indicate whether to assume it's a file or folder. + @objc + public var pendingUpload: DBXSharingPendingUploadMode? { guard let swift = swift.pendingUpload else { return nil } + return DBXSharingPendingUploadMode(swift: swift) + } + + @objc + public init(path: String, shortUrl: NSNumber, pendingUpload: DBXSharingPendingUploadMode?) { + self.swift = Sharing.CreateSharedLinkArg(path: path, shortUrl: shortUrl.boolValue, pendingUpload: pendingUpload?.swift) + } + + let swift: Sharing.CreateSharedLinkArg + + public init(swift: Sharing.CreateSharedLinkArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateSharedLinkError union +@objc +public class DBXSharingCreateSharedLinkError: NSObject { + let swift: Sharing.CreateSharedLinkError + + public init(swift: Sharing.CreateSharedLinkError) { + self.swift = swift + } + + public static func factory(swift: Sharing.CreateSharedLinkError) -> DBXSharingCreateSharedLinkError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXSharingCreateSharedLinkErrorPath(arg) + case .other: + return DBXSharingCreateSharedLinkErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXSharingCreateSharedLinkErrorPath? { + self as? DBXSharingCreateSharedLinkErrorPath + } + + @objc + public var asOther: DBXSharingCreateSharedLinkErrorOther? { + self as? DBXSharingCreateSharedLinkErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingCreateSharedLinkErrorPath: DBXSharingCreateSharedLinkError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Sharing.CreateSharedLinkError.path(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingCreateSharedLinkErrorOther: DBXSharingCreateSharedLinkError { + @objc + public init() { + let swift = Sharing.CreateSharedLinkError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible CreateSharedLinkWithSettingsArg struct +@objc +public class DBXSharingCreateSharedLinkWithSettingsArg: NSObject { + /// The path to be shared by the shared link. + @objc + public var path: String { swift.path } + /// The requested settings for the newly created shared link. + @objc + public var settings: DBXSharingSharedLinkSettings? { guard let swift = swift.settings else { return nil } + return DBXSharingSharedLinkSettings(swift: swift) + } + + @objc + public init(path: String, settings: DBXSharingSharedLinkSettings?) { + self.swift = Sharing.CreateSharedLinkWithSettingsArg(path: path, settings: settings?.swift) + } + + let swift: Sharing.CreateSharedLinkWithSettingsArg + + public init(swift: Sharing.CreateSharedLinkWithSettingsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateSharedLinkWithSettingsError union +@objc +public class DBXSharingCreateSharedLinkWithSettingsError: NSObject { + let swift: Sharing.CreateSharedLinkWithSettingsError + + public init(swift: Sharing.CreateSharedLinkWithSettingsError) { + self.swift = swift + } + + public static func factory(swift: Sharing.CreateSharedLinkWithSettingsError) -> DBXSharingCreateSharedLinkWithSettingsError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXSharingCreateSharedLinkWithSettingsErrorPath(arg) + case .emailNotVerified: + return DBXSharingCreateSharedLinkWithSettingsErrorEmailNotVerified() + case .sharedLinkAlreadyExists(let swiftArg): + guard let swiftArg = swiftArg else { return DBXSharingCreateSharedLinkWithSettingsErrorSharedLinkAlreadyExists(nil) } + let arg = DBXSharingSharedLinkAlreadyExistsMetadata(swift: swiftArg) + return DBXSharingCreateSharedLinkWithSettingsErrorSharedLinkAlreadyExists(arg) + case .settingsError(let swiftArg): + let arg = DBXSharingSharedLinkSettingsError(swift: swiftArg) + return DBXSharingCreateSharedLinkWithSettingsErrorSettingsError(arg) + case .accessDenied: + return DBXSharingCreateSharedLinkWithSettingsErrorAccessDenied() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXSharingCreateSharedLinkWithSettingsErrorPath? { + self as? DBXSharingCreateSharedLinkWithSettingsErrorPath + } + + @objc + public var asEmailNotVerified: DBXSharingCreateSharedLinkWithSettingsErrorEmailNotVerified? { + self as? DBXSharingCreateSharedLinkWithSettingsErrorEmailNotVerified + } + + @objc + public var asSharedLinkAlreadyExists: DBXSharingCreateSharedLinkWithSettingsErrorSharedLinkAlreadyExists? { + self as? DBXSharingCreateSharedLinkWithSettingsErrorSharedLinkAlreadyExists + } + + @objc + public var asSettingsError: DBXSharingCreateSharedLinkWithSettingsErrorSettingsError? { + self as? DBXSharingCreateSharedLinkWithSettingsErrorSettingsError + } + + @objc + public var asAccessDenied: DBXSharingCreateSharedLinkWithSettingsErrorAccessDenied? { + self as? DBXSharingCreateSharedLinkWithSettingsErrorAccessDenied + } +} + +/// An unspecified error. +@objc +public class DBXSharingCreateSharedLinkWithSettingsErrorPath: DBXSharingCreateSharedLinkWithSettingsError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Sharing.CreateSharedLinkWithSettingsError.path(arg.swift) + super.init(swift: swift) + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXSharingCreateSharedLinkWithSettingsErrorEmailNotVerified: DBXSharingCreateSharedLinkWithSettingsError { + @objc + public init() { + let swift = Sharing.CreateSharedLinkWithSettingsError.emailNotVerified + super.init(swift: swift) + } +} + +/// The shared link already exists. You can call listSharedLinks to get the existing link, or use the provided +/// metadata if it is returned. +@objc +public class DBXSharingCreateSharedLinkWithSettingsErrorSharedLinkAlreadyExists: DBXSharingCreateSharedLinkWithSettingsError { + @objc + public var sharedLinkAlreadyExists: DBXSharingSharedLinkAlreadyExistsMetadata? + + @objc + public init(_ arg: DBXSharingSharedLinkAlreadyExistsMetadata?) { + self.sharedLinkAlreadyExists = arg + let swift = Sharing.CreateSharedLinkWithSettingsError.sharedLinkAlreadyExists(arg?.swift) + super.init(swift: swift) + } +} + +/// There is an error with the given settings. +@objc +public class DBXSharingCreateSharedLinkWithSettingsErrorSettingsError: DBXSharingCreateSharedLinkWithSettingsError { + @objc + public var settingsError: DBXSharingSharedLinkSettingsError + + @objc + public init(_ arg: DBXSharingSharedLinkSettingsError) { + self.settingsError = arg + let swift = Sharing.CreateSharedLinkWithSettingsError.settingsError(arg.swift) + super.init(swift: swift) + } +} + +/// The user is not allowed to create a shared link to the specified file. For example, this can occur if the +/// file is restricted or if the user's links are banned +/// https://help.dropbox.com/files-folders/share/banned-links. +@objc +public class DBXSharingCreateSharedLinkWithSettingsErrorAccessDenied: DBXSharingCreateSharedLinkWithSettingsError { + @objc + public init() { + let swift = Sharing.CreateSharedLinkWithSettingsError.accessDenied + super.init(swift: swift) + } +} + +/// Objective-C compatible SharedContentLinkMetadataBase struct +@objc +public class DBXSharingSharedContentLinkMetadataBase: NSObject { + /// The access level on the link for this file. + @objc + public var accessLevel: DBXSharingAccessLevel? { guard let swift = swift.accessLevel else { return nil } + return DBXSharingAccessLevel(swift: swift) + } + + /// The audience options that are available for the content. Some audience options may be unavailable. For + /// example, team_only may be unavailable if the content is not owned by a user on a team. The 'default' + /// audience option is always available if the user can modify link settings. + @objc + public var audienceOptions: [DBXSharingLinkAudience] { swift.audienceOptions.map { DBXSharingLinkAudience(swift: $0) } } + /// The shared folder that prevents the link audience for this link from being more restrictive. + @objc + public var audienceRestrictingSharedFolder: DBXSharingAudienceRestrictingSharedFolder? { + guard let swift = swift.audienceRestrictingSharedFolder else { return nil } + return DBXSharingAudienceRestrictingSharedFolder(swift: swift) + } + + /// The current audience of the link. + @objc + public var currentAudience: DBXSharingLinkAudience { DBXSharingLinkAudience(swift: swift.currentAudience) } + /// Whether the link has an expiry set on it. A link with an expiry will have its audience changed to members + /// when the expiry is reached. + @objc + public var expiry: Date? { swift.expiry } + /// A list of permissions for actions you can perform on the link. + @objc + public var linkPermissions: [DBXSharingLinkPermission] { swift.linkPermissions.map { DBXSharingLinkPermission(swift: $0) } } + /// Whether the link is protected by a password. + @objc + public var passwordProtected: NSNumber { swift.passwordProtected as NSNumber } + + @objc + public init( + audienceOptions: [DBXSharingLinkAudience], + currentAudience: DBXSharingLinkAudience, + linkPermissions: [DBXSharingLinkPermission], + passwordProtected: NSNumber, + accessLevel: DBXSharingAccessLevel?, + audienceRestrictingSharedFolder: DBXSharingAudienceRestrictingSharedFolder?, + expiry: Date? + ) { + self.swift = Sharing.SharedContentLinkMetadataBase( + audienceOptions: audienceOptions.map(\.swift), + currentAudience: currentAudience.swift, + linkPermissions: linkPermissions.map(\.swift), + passwordProtected: passwordProtected.boolValue, + accessLevel: accessLevel?.swift, + audienceRestrictingSharedFolder: audienceRestrictingSharedFolder?.swift, + expiry: expiry + ) + } + + let swift: Sharing.SharedContentLinkMetadataBase + + public init(swift: Sharing.SharedContentLinkMetadataBase) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The expected metadata of a shared link for a file or folder when a link is first created for the content. Absent +/// if the link already exists. +@objc +public class DBXSharingExpectedSharedContentLinkMetadata: DBXSharingSharedContentLinkMetadataBase { + let subSwift: Sharing.ExpectedSharedContentLinkMetadata + + public init(swift: Sharing.ExpectedSharedContentLinkMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Sharing actions that may be taken on files. +@objc +public class DBXSharingFileAction: NSObject { + let swift: Sharing.FileAction + + public init(swift: Sharing.FileAction) { + self.swift = swift + } + + public static func factory(swift: Sharing.FileAction) -> DBXSharingFileAction { + switch swift { + case .disableViewerInfo: + return DBXSharingFileActionDisableViewerInfo() + case .editContents: + return DBXSharingFileActionEditContents() + case .enableViewerInfo: + return DBXSharingFileActionEnableViewerInfo() + case .inviteViewer: + return DBXSharingFileActionInviteViewer() + case .inviteViewerNoComment: + return DBXSharingFileActionInviteViewerNoComment() + case .inviteEditor: + return DBXSharingFileActionInviteEditor() + case .unshare: + return DBXSharingFileActionUnshare() + case .relinquishMembership: + return DBXSharingFileActionRelinquishMembership() + case .shareLink: + return DBXSharingFileActionShareLink() + case .createLink: + return DBXSharingFileActionCreateLink() + case .createViewLink: + return DBXSharingFileActionCreateViewLink() + case .createEditLink: + return DBXSharingFileActionCreateEditLink() + case .other: + return DBXSharingFileActionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisableViewerInfo: DBXSharingFileActionDisableViewerInfo? { + self as? DBXSharingFileActionDisableViewerInfo + } + + @objc + public var asEditContents: DBXSharingFileActionEditContents? { + self as? DBXSharingFileActionEditContents + } + + @objc + public var asEnableViewerInfo: DBXSharingFileActionEnableViewerInfo? { + self as? DBXSharingFileActionEnableViewerInfo + } + + @objc + public var asInviteViewer: DBXSharingFileActionInviteViewer? { + self as? DBXSharingFileActionInviteViewer + } + + @objc + public var asInviteViewerNoComment: DBXSharingFileActionInviteViewerNoComment? { + self as? DBXSharingFileActionInviteViewerNoComment + } + + @objc + public var asInviteEditor: DBXSharingFileActionInviteEditor? { + self as? DBXSharingFileActionInviteEditor + } + + @objc + public var asUnshare: DBXSharingFileActionUnshare? { + self as? DBXSharingFileActionUnshare + } + + @objc + public var asRelinquishMembership: DBXSharingFileActionRelinquishMembership? { + self as? DBXSharingFileActionRelinquishMembership + } + + @objc + public var asShareLink: DBXSharingFileActionShareLink? { + self as? DBXSharingFileActionShareLink + } + + @objc + public var asCreateLink: DBXSharingFileActionCreateLink? { + self as? DBXSharingFileActionCreateLink + } + + @objc + public var asCreateViewLink: DBXSharingFileActionCreateViewLink? { + self as? DBXSharingFileActionCreateViewLink + } + + @objc + public var asCreateEditLink: DBXSharingFileActionCreateEditLink? { + self as? DBXSharingFileActionCreateEditLink + } + + @objc + public var asOther: DBXSharingFileActionOther? { + self as? DBXSharingFileActionOther + } +} + +/// Disable viewer information on the file. +@objc +public class DBXSharingFileActionDisableViewerInfo: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.disableViewerInfo + super.init(swift: swift) + } +} + +/// Change or edit contents of the file. +@objc +public class DBXSharingFileActionEditContents: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.editContents + super.init(swift: swift) + } +} + +/// Enable viewer information on the file. +@objc +public class DBXSharingFileActionEnableViewerInfo: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.enableViewerInfo + super.init(swift: swift) + } +} + +/// Add a member with view permissions. +@objc +public class DBXSharingFileActionInviteViewer: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.inviteViewer + super.init(swift: swift) + } +} + +/// Add a member with view permissions but no comment permissions. +@objc +public class DBXSharingFileActionInviteViewerNoComment: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.inviteViewerNoComment + super.init(swift: swift) + } +} + +/// Add a member with edit permissions. +@objc +public class DBXSharingFileActionInviteEditor: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.inviteEditor + super.init(swift: swift) + } +} + +/// Stop sharing this file. +@objc +public class DBXSharingFileActionUnshare: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.unshare + super.init(swift: swift) + } +} + +/// Relinquish one's own membership to the file. +@objc +public class DBXSharingFileActionRelinquishMembership: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.relinquishMembership + super.init(swift: swift) + } +} + +/// Use create_view_link and create_edit_link instead. +@objc +public class DBXSharingFileActionShareLink: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.shareLink + super.init(swift: swift) + } +} + +/// Use create_view_link and create_edit_link instead. +@objc +public class DBXSharingFileActionCreateLink: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.createLink + super.init(swift: swift) + } +} + +/// Create a shared link to a file that only allows users to view the content. +@objc +public class DBXSharingFileActionCreateViewLink: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.createViewLink + super.init(swift: swift) + } +} + +/// Create a shared link to a file that allows users to edit the content. +@objc +public class DBXSharingFileActionCreateEditLink: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.createEditLink + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingFileActionOther: DBXSharingFileAction { + @objc + public init() { + let swift = Sharing.FileAction.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FileErrorResult union +@objc +public class DBXSharingFileErrorResult: NSObject { + let swift: Sharing.FileErrorResult + + public init(swift: Sharing.FileErrorResult) { + self.swift = swift + } + + public static func factory(swift: Sharing.FileErrorResult) -> DBXSharingFileErrorResult { + switch swift { + case .fileNotFoundError(let swiftArg): + let arg = swiftArg + return DBXSharingFileErrorResultFileNotFoundError(arg) + case .invalidFileActionError(let swiftArg): + let arg = swiftArg + return DBXSharingFileErrorResultInvalidFileActionError(arg) + case .permissionDeniedError(let swiftArg): + let arg = swiftArg + return DBXSharingFileErrorResultPermissionDeniedError(arg) + case .other: + return DBXSharingFileErrorResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFileNotFoundError: DBXSharingFileErrorResultFileNotFoundError? { + self as? DBXSharingFileErrorResultFileNotFoundError + } + + @objc + public var asInvalidFileActionError: DBXSharingFileErrorResultInvalidFileActionError? { + self as? DBXSharingFileErrorResultInvalidFileActionError + } + + @objc + public var asPermissionDeniedError: DBXSharingFileErrorResultPermissionDeniedError? { + self as? DBXSharingFileErrorResultPermissionDeniedError + } + + @objc + public var asOther: DBXSharingFileErrorResultOther? { + self as? DBXSharingFileErrorResultOther + } +} + +/// File specified by id was not found. +@objc +public class DBXSharingFileErrorResultFileNotFoundError: DBXSharingFileErrorResult { + @objc + public var fileNotFoundError: String + + @objc + public init(_ arg: String) { + self.fileNotFoundError = arg + let swift = Sharing.FileErrorResult.fileNotFoundError(arg) + super.init(swift: swift) + } +} + +/// User does not have permission to take the specified action on the file. +@objc +public class DBXSharingFileErrorResultInvalidFileActionError: DBXSharingFileErrorResult { + @objc + public var invalidFileActionError: String + + @objc + public init(_ arg: String) { + self.invalidFileActionError = arg + let swift = Sharing.FileErrorResult.invalidFileActionError(arg) + super.init(swift: swift) + } +} + +/// User does not have permission to access file specified by file.Id. +@objc +public class DBXSharingFileErrorResultPermissionDeniedError: DBXSharingFileErrorResult { + @objc + public var permissionDeniedError: String + + @objc + public init(_ arg: String) { + self.permissionDeniedError = arg + let swift = Sharing.FileErrorResult.permissionDeniedError(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingFileErrorResultOther: DBXSharingFileErrorResult { + @objc + public init() { + let swift = Sharing.FileErrorResult.other + super.init(swift: swift) + } +} + +/// The metadata of a shared link. +@objc +public class DBXSharingSharedLinkMetadata: NSObject { + /// URL of the shared link. + @objc + public var url: String { swift.url } + /// A unique identifier for the linked file. + @objc + public var id: String? { swift.id } + /// The linked file name (including extension). This never contains a slash. + @objc + public var name: String { swift.name } + /// Expiration time, if set. By default the link won't expire. + @objc + public var expires: Date? { swift.expires } + /// The lowercased full path in the user's Dropbox. This always starts with a slash. This field will only be + /// present only if the linked file is in the authenticated user's dropbox. + @objc + public var pathLower: String? { swift.pathLower } + /// The link's access permissions. + @objc + public var linkPermissions: DBXSharingLinkPermissions { DBXSharingLinkPermissions(swift: swift.linkPermissions) } + /// The team membership information of the link's owner. This field will only be present if the link's owner + /// is a team member. + @objc + public var teamMemberInfo: DBXSharingTeamMemberInfo? { guard let swift = swift.teamMemberInfo else { return nil } + return DBXSharingTeamMemberInfo(swift: swift) + } + + /// The team information of the content's owner. This field will only be present if the content's owner is a + /// team member and the content's owner team is different from the link's owner team. + @objc + public var contentOwnerTeamInfo: DBXUsersTeam? { guard let swift = swift.contentOwnerTeamInfo else { return nil } + return DBXUsersTeam(swift: swift) + } + + @objc + public init( + url: String, + name: String, + linkPermissions: DBXSharingLinkPermissions, + id: String?, + expires: Date?, + pathLower: String?, + teamMemberInfo: DBXSharingTeamMemberInfo?, + contentOwnerTeamInfo: DBXUsersTeam? + ) { + self.swift = Sharing.SharedLinkMetadata( + url: url, + name: name, + linkPermissions: linkPermissions.swift, + id: id, + expires: expires, + pathLower: pathLower, + teamMemberInfo: teamMemberInfo?.swift, + contentOwnerTeamInfo: contentOwnerTeamInfo?.swift + ) + } + + let swift: Sharing.SharedLinkMetadata + + public init(swift: Sharing.SharedLinkMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The metadata of a file shared link. +@objc +public class DBXSharingFileLinkMetadata: DBXSharingSharedLinkMetadata { + /// The modification time set by the desktop client when the file was added to Dropbox. Since this time is not + /// verified (the Dropbox server stores whatever the desktop client sends up), this should only be used for + /// display purposes (such as sorting) and not, for example, to determine if a file has changed or not. + @objc + public var clientModified: Date { subSwift.clientModified } + /// The last time the file was modified on Dropbox. + @objc + public var serverModified: Date { subSwift.serverModified } + /// A unique identifier for the current revision of a file. This field is the same rev as elsewhere in the API + /// and can be used to detect changes and avoid conflicts. + @objc + public var rev: String { subSwift.rev } + /// The file size in bytes. + @objc + public var size: NSNumber { subSwift.size as NSNumber } + + @objc + public init( + url: String, + name: String, + linkPermissions: DBXSharingLinkPermissions, + clientModified: Date, + serverModified: Date, + rev: String, + size: NSNumber, + id: String?, + expires: Date?, + pathLower: String?, + teamMemberInfo: DBXSharingTeamMemberInfo?, + contentOwnerTeamInfo: DBXUsersTeam? + ) { + let swift = Sharing.FileLinkMetadata( + url: url, + name: name, + linkPermissions: linkPermissions.swift, + clientModified: clientModified, + serverModified: serverModified, + rev: rev, + size: size.uint64Value, + id: id, + expires: expires, + pathLower: pathLower, + teamMemberInfo: teamMemberInfo?.swift, + contentOwnerTeamInfo: contentOwnerTeamInfo?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.FileLinkMetadata + + public init(swift: Sharing.FileLinkMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible FileMemberActionError union +@objc +public class DBXSharingFileMemberActionError: NSObject { + let swift: Sharing.FileMemberActionError + + public init(swift: Sharing.FileMemberActionError) { + self.swift = swift + } + + public static func factory(swift: Sharing.FileMemberActionError) -> DBXSharingFileMemberActionError { + switch swift { + case .invalidMember: + return DBXSharingFileMemberActionErrorInvalidMember() + case .noPermission: + return DBXSharingFileMemberActionErrorNoPermission() + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingFileMemberActionErrorAccessError(arg) + case .noExplicitAccess(let swiftArg): + let arg = DBXSharingMemberAccessLevelResult(swift: swiftArg) + return DBXSharingFileMemberActionErrorNoExplicitAccess(arg) + case .other: + return DBXSharingFileMemberActionErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidMember: DBXSharingFileMemberActionErrorInvalidMember? { + self as? DBXSharingFileMemberActionErrorInvalidMember + } + + @objc + public var asNoPermission: DBXSharingFileMemberActionErrorNoPermission? { + self as? DBXSharingFileMemberActionErrorNoPermission + } + + @objc + public var asAccessError: DBXSharingFileMemberActionErrorAccessError? { + self as? DBXSharingFileMemberActionErrorAccessError + } + + @objc + public var asNoExplicitAccess: DBXSharingFileMemberActionErrorNoExplicitAccess? { + self as? DBXSharingFileMemberActionErrorNoExplicitAccess + } + + @objc + public var asOther: DBXSharingFileMemberActionErrorOther? { + self as? DBXSharingFileMemberActionErrorOther + } +} + +/// Specified member was not found. +@objc +public class DBXSharingFileMemberActionErrorInvalidMember: DBXSharingFileMemberActionError { + @objc + public init() { + let swift = Sharing.FileMemberActionError.invalidMember + super.init(swift: swift) + } +} + +/// User does not have permission to perform this action on this member. +@objc +public class DBXSharingFileMemberActionErrorNoPermission: DBXSharingFileMemberActionError { + @objc + public init() { + let swift = Sharing.FileMemberActionError.noPermission + super.init(swift: swift) + } +} + +/// Specified file was invalid or user does not have access. +@objc +public class DBXSharingFileMemberActionErrorAccessError: DBXSharingFileMemberActionError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.FileMemberActionError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// The action cannot be completed because the target member does not have explicit access to the file. The +/// return value is the access that the member has to the file from a parent folder. +@objc +public class DBXSharingFileMemberActionErrorNoExplicitAccess: DBXSharingFileMemberActionError { + @objc + public var noExplicitAccess: DBXSharingMemberAccessLevelResult + + @objc + public init(_ arg: DBXSharingMemberAccessLevelResult) { + self.noExplicitAccess = arg + let swift = Sharing.FileMemberActionError.noExplicitAccess(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingFileMemberActionErrorOther: DBXSharingFileMemberActionError { + @objc + public init() { + let swift = Sharing.FileMemberActionError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FileMemberActionIndividualResult union +@objc +public class DBXSharingFileMemberActionIndividualResult: NSObject { + let swift: Sharing.FileMemberActionIndividualResult + + public init(swift: Sharing.FileMemberActionIndividualResult) { + self.swift = swift + } + + public static func factory(swift: Sharing.FileMemberActionIndividualResult) -> DBXSharingFileMemberActionIndividualResult { + switch swift { + case .success(let swiftArg): + guard let swiftArg = swiftArg else { return DBXSharingFileMemberActionIndividualResultSuccess(nil) } + let arg = DBXSharingAccessLevel(swift: swiftArg) + return DBXSharingFileMemberActionIndividualResultSuccess(arg) + case .memberError(let swiftArg): + let arg = DBXSharingFileMemberActionError(swift: swiftArg) + return DBXSharingFileMemberActionIndividualResultMemberError(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXSharingFileMemberActionIndividualResultSuccess? { + self as? DBXSharingFileMemberActionIndividualResultSuccess + } + + @objc + public var asMemberError: DBXSharingFileMemberActionIndividualResultMemberError? { + self as? DBXSharingFileMemberActionIndividualResultMemberError + } +} + +/// Part of the response for both add_file_member and remove_file_member_v1 (deprecated). For add_file_member, +/// indicates giving access was successful and at what AccessLevel. For remove_file_member_v1, indicates +/// member was successfully removed from the file. If AccessLevel is given, the member still has access +/// via a parent shared folder. +@objc +public class DBXSharingFileMemberActionIndividualResultSuccess: DBXSharingFileMemberActionIndividualResult { + @objc + public var success: DBXSharingAccessLevel? + + @objc + public init(_ arg: DBXSharingAccessLevel?) { + self.success = arg + let swift = Sharing.FileMemberActionIndividualResult.success(arg?.swift) + super.init(swift: swift) + } +} + +/// User was not able to perform this action. +@objc +public class DBXSharingFileMemberActionIndividualResultMemberError: DBXSharingFileMemberActionIndividualResult { + @objc + public var memberError: DBXSharingFileMemberActionError + + @objc + public init(_ arg: DBXSharingFileMemberActionError) { + self.memberError = arg + let swift = Sharing.FileMemberActionIndividualResult.memberError(arg.swift) + super.init(swift: swift) + } +} + +/// Per-member result for addFileMember. +@objc +public class DBXSharingFileMemberActionResult: NSObject { + /// One of specified input members. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + /// The outcome of the action on this member. + @objc + public var result: DBXSharingFileMemberActionIndividualResult { DBXSharingFileMemberActionIndividualResult(swift: swift.result) } + /// The SHA-1 encrypted shared content key. + @objc + public var sckeySha1: String? { swift.sckeySha1 } + /// The sharing sender-recipient invitation signatures for the input member_id. A member_id can be a group and + /// thus have multiple users and multiple invitation signatures. + @objc + public var invitationSignature: [String]? { swift.invitationSignature } + + @objc + public init(member: DBXSharingMemberSelector, result: DBXSharingFileMemberActionIndividualResult, sckeySha1: String?, invitationSignature: [String]?) { + self.swift = Sharing.FileMemberActionResult(member: member.swift, result: result.swift, sckeySha1: sckeySha1, invitationSignature: invitationSignature) + } + + let swift: Sharing.FileMemberActionResult + + public init(swift: Sharing.FileMemberActionResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileMemberRemoveActionResult union +@objc +public class DBXSharingFileMemberRemoveActionResult: NSObject { + let swift: Sharing.FileMemberRemoveActionResult + + public init(swift: Sharing.FileMemberRemoveActionResult) { + self.swift = swift + } + + public static func factory(swift: Sharing.FileMemberRemoveActionResult) -> DBXSharingFileMemberRemoveActionResult { + switch swift { + case .success(let swiftArg): + let arg = DBXSharingMemberAccessLevelResult(swift: swiftArg) + return DBXSharingFileMemberRemoveActionResultSuccess(arg) + case .memberError(let swiftArg): + let arg = DBXSharingFileMemberActionError(swift: swiftArg) + return DBXSharingFileMemberRemoveActionResultMemberError(arg) + case .other: + return DBXSharingFileMemberRemoveActionResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXSharingFileMemberRemoveActionResultSuccess? { + self as? DBXSharingFileMemberRemoveActionResultSuccess + } + + @objc + public var asMemberError: DBXSharingFileMemberRemoveActionResultMemberError? { + self as? DBXSharingFileMemberRemoveActionResultMemberError + } + + @objc + public var asOther: DBXSharingFileMemberRemoveActionResultOther? { + self as? DBXSharingFileMemberRemoveActionResultOther + } +} + +/// Member was successfully removed from this file. +@objc +public class DBXSharingFileMemberRemoveActionResultSuccess: DBXSharingFileMemberRemoveActionResult { + @objc + public var success: DBXSharingMemberAccessLevelResult + + @objc + public init(_ arg: DBXSharingMemberAccessLevelResult) { + self.success = arg + let swift = Sharing.FileMemberRemoveActionResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// User was not able to remove this member. +@objc +public class DBXSharingFileMemberRemoveActionResultMemberError: DBXSharingFileMemberRemoveActionResult { + @objc + public var memberError: DBXSharingFileMemberActionError + + @objc + public init(_ arg: DBXSharingFileMemberActionError) { + self.memberError = arg + let swift = Sharing.FileMemberRemoveActionResult.memberError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingFileMemberRemoveActionResultOther: DBXSharingFileMemberRemoveActionResult { + @objc + public init() { + let swift = Sharing.FileMemberRemoveActionResult.other + super.init(swift: swift) + } +} + +/// Whether the user is allowed to take the sharing action on the file. +@objc +public class DBXSharingFilePermission: NSObject { + /// The action that the user may wish to take on the file. + @objc + public var action: DBXSharingFileAction { DBXSharingFileAction(swift: swift.action) } + /// True if the user is allowed to take the action. + @objc + public var allow: NSNumber { swift.allow as NSNumber } + /// The reason why the user is denied the permission. Not present if the action is allowed. + @objc + public var reason: DBXSharingPermissionDeniedReason? { guard let swift = swift.reason else { return nil } + return DBXSharingPermissionDeniedReason(swift: swift) + } + + @objc + public init(action: DBXSharingFileAction, allow: NSNumber, reason: DBXSharingPermissionDeniedReason?) { + self.swift = Sharing.FilePermission(action: action.swift, allow: allow.boolValue, reason: reason?.swift) + } + + let swift: Sharing.FilePermission + + public init(swift: Sharing.FilePermission) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Actions that may be taken on shared folders. +@objc +public class DBXSharingFolderAction: NSObject { + let swift: Sharing.FolderAction + + public init(swift: Sharing.FolderAction) { + self.swift = swift + } + + public static func factory(swift: Sharing.FolderAction) -> DBXSharingFolderAction { + switch swift { + case .changeOptions: + return DBXSharingFolderActionChangeOptions() + case .disableViewerInfo: + return DBXSharingFolderActionDisableViewerInfo() + case .editContents: + return DBXSharingFolderActionEditContents() + case .enableViewerInfo: + return DBXSharingFolderActionEnableViewerInfo() + case .inviteEditor: + return DBXSharingFolderActionInviteEditor() + case .inviteViewer: + return DBXSharingFolderActionInviteViewer() + case .inviteViewerNoComment: + return DBXSharingFolderActionInviteViewerNoComment() + case .relinquishMembership: + return DBXSharingFolderActionRelinquishMembership() + case .unmount: + return DBXSharingFolderActionUnmount() + case .unshare: + return DBXSharingFolderActionUnshare() + case .leaveACopy: + return DBXSharingFolderActionLeaveACopy() + case .shareLink: + return DBXSharingFolderActionShareLink() + case .createLink: + return DBXSharingFolderActionCreateLink() + case .setAccessInheritance: + return DBXSharingFolderActionSetAccessInheritance() + case .other: + return DBXSharingFolderActionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asChangeOptions: DBXSharingFolderActionChangeOptions? { + self as? DBXSharingFolderActionChangeOptions + } + + @objc + public var asDisableViewerInfo: DBXSharingFolderActionDisableViewerInfo? { + self as? DBXSharingFolderActionDisableViewerInfo + } + + @objc + public var asEditContents: DBXSharingFolderActionEditContents? { + self as? DBXSharingFolderActionEditContents + } + + @objc + public var asEnableViewerInfo: DBXSharingFolderActionEnableViewerInfo? { + self as? DBXSharingFolderActionEnableViewerInfo + } + + @objc + public var asInviteEditor: DBXSharingFolderActionInviteEditor? { + self as? DBXSharingFolderActionInviteEditor + } + + @objc + public var asInviteViewer: DBXSharingFolderActionInviteViewer? { + self as? DBXSharingFolderActionInviteViewer + } + + @objc + public var asInviteViewerNoComment: DBXSharingFolderActionInviteViewerNoComment? { + self as? DBXSharingFolderActionInviteViewerNoComment + } + + @objc + public var asRelinquishMembership: DBXSharingFolderActionRelinquishMembership? { + self as? DBXSharingFolderActionRelinquishMembership + } + + @objc + public var asUnmount: DBXSharingFolderActionUnmount? { + self as? DBXSharingFolderActionUnmount + } + + @objc + public var asUnshare: DBXSharingFolderActionUnshare? { + self as? DBXSharingFolderActionUnshare + } + + @objc + public var asLeaveACopy: DBXSharingFolderActionLeaveACopy? { + self as? DBXSharingFolderActionLeaveACopy + } + + @objc + public var asShareLink: DBXSharingFolderActionShareLink? { + self as? DBXSharingFolderActionShareLink + } + + @objc + public var asCreateLink: DBXSharingFolderActionCreateLink? { + self as? DBXSharingFolderActionCreateLink + } + + @objc + public var asSetAccessInheritance: DBXSharingFolderActionSetAccessInheritance? { + self as? DBXSharingFolderActionSetAccessInheritance + } + + @objc + public var asOther: DBXSharingFolderActionOther? { + self as? DBXSharingFolderActionOther + } +} + +/// Change folder options, such as who can be invited to join the folder. +@objc +public class DBXSharingFolderActionChangeOptions: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.changeOptions + super.init(swift: swift) + } +} + +/// Disable viewer information for this folder. +@objc +public class DBXSharingFolderActionDisableViewerInfo: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.disableViewerInfo + super.init(swift: swift) + } +} + +/// Change or edit contents of the folder. +@objc +public class DBXSharingFolderActionEditContents: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.editContents + super.init(swift: swift) + } +} + +/// Enable viewer information on the folder. +@objc +public class DBXSharingFolderActionEnableViewerInfo: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.enableViewerInfo + super.init(swift: swift) + } +} + +/// Invite a user or group to join the folder with read and write permission. +@objc +public class DBXSharingFolderActionInviteEditor: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.inviteEditor + super.init(swift: swift) + } +} + +/// Invite a user or group to join the folder with read permission. +@objc +public class DBXSharingFolderActionInviteViewer: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.inviteViewer + super.init(swift: swift) + } +} + +/// Invite a user or group to join the folder with read permission but no comment permissions. +@objc +public class DBXSharingFolderActionInviteViewerNoComment: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.inviteViewerNoComment + super.init(swift: swift) + } +} + +/// Relinquish one's own membership in the folder. +@objc +public class DBXSharingFolderActionRelinquishMembership: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.relinquishMembership + super.init(swift: swift) + } +} + +/// Unmount the folder. +@objc +public class DBXSharingFolderActionUnmount: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.unmount + super.init(swift: swift) + } +} + +/// Stop sharing this folder. +@objc +public class DBXSharingFolderActionUnshare: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.unshare + super.init(swift: swift) + } +} + +/// Keep a copy of the contents upon leaving or being kicked from the folder. +@objc +public class DBXSharingFolderActionLeaveACopy: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.leaveACopy + super.init(swift: swift) + } +} + +/// Use create_link instead. +@objc +public class DBXSharingFolderActionShareLink: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.shareLink + super.init(swift: swift) + } +} + +/// Create a shared link for folder. +@objc +public class DBXSharingFolderActionCreateLink: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.createLink + super.init(swift: swift) + } +} + +/// Set whether the folder inherits permissions from its parent. +@objc +public class DBXSharingFolderActionSetAccessInheritance: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.setAccessInheritance + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingFolderActionOther: DBXSharingFolderAction { + @objc + public init() { + let swift = Sharing.FolderAction.other + super.init(swift: swift) + } +} + +/// The metadata of a folder shared link. +@objc +public class DBXSharingFolderLinkMetadata: DBXSharingSharedLinkMetadata { + let subSwift: Sharing.FolderLinkMetadata + + public init(swift: Sharing.FolderLinkMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Whether the user is allowed to take the action on the shared folder. +@objc +public class DBXSharingFolderPermission: NSObject { + /// The action that the user may wish to take on the folder. + @objc + public var action: DBXSharingFolderAction { DBXSharingFolderAction(swift: swift.action) } + /// True if the user is allowed to take the action. + @objc + public var allow: NSNumber { swift.allow as NSNumber } + /// The reason why the user is denied the permission. Not present if the action is allowed, or if no reason is + /// available. + @objc + public var reason: DBXSharingPermissionDeniedReason? { guard let swift = swift.reason else { return nil } + return DBXSharingPermissionDeniedReason(swift: swift) + } + + @objc + public init(action: DBXSharingFolderAction, allow: NSNumber, reason: DBXSharingPermissionDeniedReason?) { + self.swift = Sharing.FolderPermission(action: action.swift, allow: allow.boolValue, reason: reason?.swift) + } + + let swift: Sharing.FolderPermission + + public init(swift: Sharing.FolderPermission) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// A set of policies governing membership and privileges for a shared folder. +@objc +public class DBXSharingFolderPolicy: NSObject { + /// Who can be a member of this shared folder, as set on the folder itself. The effective policy may differ from + /// this value if the team-wide policy is more restrictive. Present only if the folder is owned by a team. + @objc + public var memberPolicy: DBXSharingMemberPolicy? { guard let swift = swift.memberPolicy else { return nil } + return DBXSharingMemberPolicy(swift: swift) + } + + /// Who can be a member of this shared folder, taking into account both the folder and the team-wide policy. + /// This value may differ from that of member_policy if the team-wide policy is more restrictive than the + /// folder policy. Present only if the folder is owned by a team. + @objc + public var resolvedMemberPolicy: DBXSharingMemberPolicy? { guard let swift = swift.resolvedMemberPolicy else { return nil } + return DBXSharingMemberPolicy(swift: swift) + } + + /// Who can add and remove members from this shared folder. + @objc + public var aclUpdatePolicy: DBXSharingAclUpdatePolicy { DBXSharingAclUpdatePolicy(swift: swift.aclUpdatePolicy) } + /// Who links can be shared with. + @objc + public var sharedLinkPolicy: DBXSharingSharedLinkPolicy { DBXSharingSharedLinkPolicy(swift: swift.sharedLinkPolicy) } + /// Who can enable/disable viewer info for this shared folder. + @objc + public var viewerInfoPolicy: DBXSharingViewerInfoPolicy? { guard let swift = swift.viewerInfoPolicy else { return nil } + return DBXSharingViewerInfoPolicy(swift: swift) + } + + @objc + public init( + aclUpdatePolicy: DBXSharingAclUpdatePolicy, + sharedLinkPolicy: DBXSharingSharedLinkPolicy, + memberPolicy: DBXSharingMemberPolicy?, + resolvedMemberPolicy: DBXSharingMemberPolicy?, + viewerInfoPolicy: DBXSharingViewerInfoPolicy? + ) { + self.swift = Sharing.FolderPolicy( + aclUpdatePolicy: aclUpdatePolicy.swift, + sharedLinkPolicy: sharedLinkPolicy.swift, + memberPolicy: memberPolicy?.swift, + resolvedMemberPolicy: resolvedMemberPolicy?.swift, + viewerInfoPolicy: viewerInfoPolicy?.swift + ) + } + + let swift: Sharing.FolderPolicy + + public init(swift: Sharing.FolderPolicy) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments of getFileMetadata. +@objc +public class DBXSharingGetFileMetadataArg: NSObject { + /// The file to query. + @objc + public var file: String { swift.file } + /// A list of `FileAction`s corresponding to `FilePermission`s that should appear in the response's permissions + /// in SharedFileMetadata field describing the actions the authenticated user can perform on the file. + @objc + public var actions: [DBXSharingFileAction]? { swift.actions?.map { DBXSharingFileAction(swift: $0) } } + + @objc + public init(file: String, actions: [DBXSharingFileAction]?) { + self.swift = Sharing.GetFileMetadataArg(file: file, actions: actions?.map(\.swift)) + } + + let swift: Sharing.GetFileMetadataArg + + public init(swift: Sharing.GetFileMetadataArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments of getFileMetadataBatch. +@objc +public class DBXSharingGetFileMetadataBatchArg: NSObject { + /// The files to query. + @objc + public var files: [String] { swift.files } + /// A list of `FileAction`s corresponding to `FilePermission`s that should appear in the response's permissions + /// in SharedFileMetadata field describing the actions the authenticated user can perform on the file. + @objc + public var actions: [DBXSharingFileAction]? { swift.actions?.map { DBXSharingFileAction(swift: $0) } } + + @objc + public init(files: [String], actions: [DBXSharingFileAction]?) { + self.swift = Sharing.GetFileMetadataBatchArg(files: files, actions: actions?.map(\.swift)) + } + + let swift: Sharing.GetFileMetadataBatchArg + + public init(swift: Sharing.GetFileMetadataBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Per file results of getFileMetadataBatch. +@objc +public class DBXSharingGetFileMetadataBatchResult: NSObject { + /// This is the input file identifier corresponding to one of files in GetFileMetadataBatchArg. + @objc + public var file: String { swift.file } + /// The result for this particular file. + @objc + public var result: DBXSharingGetFileMetadataIndividualResult { DBXSharingGetFileMetadataIndividualResult(swift: swift.result) } + + @objc + public init(file: String, result: DBXSharingGetFileMetadataIndividualResult) { + self.swift = Sharing.GetFileMetadataBatchResult(file: file, result: result.swift) + } + + let swift: Sharing.GetFileMetadataBatchResult + + public init(swift: Sharing.GetFileMetadataBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error result for getFileMetadata. +@objc +public class DBXSharingGetFileMetadataError: NSObject { + let swift: Sharing.GetFileMetadataError + + public init(swift: Sharing.GetFileMetadataError) { + self.swift = swift + } + + public static func factory(swift: Sharing.GetFileMetadataError) -> DBXSharingGetFileMetadataError { + switch swift { + case .userError(let swiftArg): + let arg = DBXSharingSharingUserError(swift: swiftArg) + return DBXSharingGetFileMetadataErrorUserError(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingGetFileMetadataErrorAccessError(arg) + case .other: + return DBXSharingGetFileMetadataErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserError: DBXSharingGetFileMetadataErrorUserError? { + self as? DBXSharingGetFileMetadataErrorUserError + } + + @objc + public var asAccessError: DBXSharingGetFileMetadataErrorAccessError? { + self as? DBXSharingGetFileMetadataErrorAccessError + } + + @objc + public var asOther: DBXSharingGetFileMetadataErrorOther? { + self as? DBXSharingGetFileMetadataErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingGetFileMetadataErrorUserError: DBXSharingGetFileMetadataError { + @objc + public var userError: DBXSharingSharingUserError + + @objc + public init(_ arg: DBXSharingSharingUserError) { + self.userError = arg + let swift = Sharing.GetFileMetadataError.userError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingGetFileMetadataErrorAccessError: DBXSharingGetFileMetadataError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.GetFileMetadataError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingGetFileMetadataErrorOther: DBXSharingGetFileMetadataError { + @objc + public init() { + let swift = Sharing.GetFileMetadataError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetFileMetadataIndividualResult union +@objc +public class DBXSharingGetFileMetadataIndividualResult: NSObject { + let swift: Sharing.GetFileMetadataIndividualResult + + public init(swift: Sharing.GetFileMetadataIndividualResult) { + self.swift = swift + } + + public static func factory(swift: Sharing.GetFileMetadataIndividualResult) -> DBXSharingGetFileMetadataIndividualResult { + switch swift { + case .metadata(let swiftArg): + let arg = DBXSharingSharedFileMetadata(swift: swiftArg) + return DBXSharingGetFileMetadataIndividualResultMetadata(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingGetFileMetadataIndividualResultAccessError(arg) + case .other: + return DBXSharingGetFileMetadataIndividualResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMetadata: DBXSharingGetFileMetadataIndividualResultMetadata? { + self as? DBXSharingGetFileMetadataIndividualResultMetadata + } + + @objc + public var asAccessError: DBXSharingGetFileMetadataIndividualResultAccessError? { + self as? DBXSharingGetFileMetadataIndividualResultAccessError + } + + @objc + public var asOther: DBXSharingGetFileMetadataIndividualResultOther? { + self as? DBXSharingGetFileMetadataIndividualResultOther + } +} + +/// The result for this file if it was successful. +@objc +public class DBXSharingGetFileMetadataIndividualResultMetadata: DBXSharingGetFileMetadataIndividualResult { + @objc + public var metadata: DBXSharingSharedFileMetadata + + @objc + public init(_ arg: DBXSharingSharedFileMetadata) { + self.metadata = arg + let swift = Sharing.GetFileMetadataIndividualResult.metadata(arg.swift) + super.init(swift: swift) + } +} + +/// The result for this file if it was an error. +@objc +public class DBXSharingGetFileMetadataIndividualResultAccessError: DBXSharingGetFileMetadataIndividualResult { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.GetFileMetadataIndividualResult.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingGetFileMetadataIndividualResultOther: DBXSharingGetFileMetadataIndividualResult { + @objc + public init() { + let swift = Sharing.GetFileMetadataIndividualResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetMetadataArgs struct +@objc +public class DBXSharingGetMetadataArgs: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on + /// the folder. + @objc + public var actions: [DBXSharingFolderAction]? { swift.actions?.map { DBXSharingFolderAction(swift: $0) } } + + @objc + public init(sharedFolderId: String, actions: [DBXSharingFolderAction]?) { + self.swift = Sharing.GetMetadataArgs(sharedFolderId: sharedFolderId, actions: actions?.map(\.swift)) + } + + let swift: Sharing.GetMetadataArgs + + public init(swift: Sharing.GetMetadataArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkError union +@objc +public class DBXSharingSharedLinkError: NSObject { + let swift: Sharing.SharedLinkError + + public init(swift: Sharing.SharedLinkError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharedLinkError) -> DBXSharingSharedLinkError { + switch swift { + case .sharedLinkNotFound: + return DBXSharingSharedLinkErrorSharedLinkNotFound() + case .sharedLinkAccessDenied: + return DBXSharingSharedLinkErrorSharedLinkAccessDenied() + case .unsupportedLinkType: + return DBXSharingSharedLinkErrorUnsupportedLinkType() + case .other: + return DBXSharingSharedLinkErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSharedLinkNotFound: DBXSharingSharedLinkErrorSharedLinkNotFound? { + self as? DBXSharingSharedLinkErrorSharedLinkNotFound + } + + @objc + public var asSharedLinkAccessDenied: DBXSharingSharedLinkErrorSharedLinkAccessDenied? { + self as? DBXSharingSharedLinkErrorSharedLinkAccessDenied + } + + @objc + public var asUnsupportedLinkType: DBXSharingSharedLinkErrorUnsupportedLinkType? { + self as? DBXSharingSharedLinkErrorUnsupportedLinkType + } + + @objc + public var asOther: DBXSharingSharedLinkErrorOther? { + self as? DBXSharingSharedLinkErrorOther + } +} + +/// The shared link wasn't found. +@objc +public class DBXSharingSharedLinkErrorSharedLinkNotFound: DBXSharingSharedLinkError { + @objc + public init() { + let swift = Sharing.SharedLinkError.sharedLinkNotFound + super.init(swift: swift) + } +} + +/// The caller is not allowed to access this shared link. +@objc +public class DBXSharingSharedLinkErrorSharedLinkAccessDenied: DBXSharingSharedLinkError { + @objc + public init() { + let swift = Sharing.SharedLinkError.sharedLinkAccessDenied + super.init(swift: swift) + } +} + +/// This type of link is not supported; use files instead. +@objc +public class DBXSharingSharedLinkErrorUnsupportedLinkType: DBXSharingSharedLinkError { + @objc + public init() { + let swift = Sharing.SharedLinkError.unsupportedLinkType + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharedLinkErrorOther: DBXSharingSharedLinkError { + @objc + public init() { + let swift = Sharing.SharedLinkError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetSharedLinkFileError union +@objc +public class DBXSharingGetSharedLinkFileError: NSObject { + let swift: Sharing.GetSharedLinkFileError + + public init(swift: Sharing.GetSharedLinkFileError) { + self.swift = swift + } + + public static func factory(swift: Sharing.GetSharedLinkFileError) -> DBXSharingGetSharedLinkFileError { + switch swift { + case .sharedLinkNotFound: + return DBXSharingGetSharedLinkFileErrorSharedLinkNotFound() + case .sharedLinkAccessDenied: + return DBXSharingGetSharedLinkFileErrorSharedLinkAccessDenied() + case .unsupportedLinkType: + return DBXSharingGetSharedLinkFileErrorUnsupportedLinkType() + case .other: + return DBXSharingGetSharedLinkFileErrorOther() + case .sharedLinkIsDirectory: + return DBXSharingGetSharedLinkFileErrorSharedLinkIsDirectory() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSharedLinkNotFound: DBXSharingGetSharedLinkFileErrorSharedLinkNotFound? { + self as? DBXSharingGetSharedLinkFileErrorSharedLinkNotFound + } + + @objc + public var asSharedLinkAccessDenied: DBXSharingGetSharedLinkFileErrorSharedLinkAccessDenied? { + self as? DBXSharingGetSharedLinkFileErrorSharedLinkAccessDenied + } + + @objc + public var asUnsupportedLinkType: DBXSharingGetSharedLinkFileErrorUnsupportedLinkType? { + self as? DBXSharingGetSharedLinkFileErrorUnsupportedLinkType + } + + @objc + public var asOther: DBXSharingGetSharedLinkFileErrorOther? { + self as? DBXSharingGetSharedLinkFileErrorOther + } + + @objc + public var asSharedLinkIsDirectory: DBXSharingGetSharedLinkFileErrorSharedLinkIsDirectory? { + self as? DBXSharingGetSharedLinkFileErrorSharedLinkIsDirectory + } +} + +/// The shared link wasn't found. +@objc +public class DBXSharingGetSharedLinkFileErrorSharedLinkNotFound: DBXSharingGetSharedLinkFileError { + @objc + public init() { + let swift = Sharing.GetSharedLinkFileError.sharedLinkNotFound + super.init(swift: swift) + } +} + +/// The caller is not allowed to access this shared link. +@objc +public class DBXSharingGetSharedLinkFileErrorSharedLinkAccessDenied: DBXSharingGetSharedLinkFileError { + @objc + public init() { + let swift = Sharing.GetSharedLinkFileError.sharedLinkAccessDenied + super.init(swift: swift) + } +} + +/// This type of link is not supported; use files instead. +@objc +public class DBXSharingGetSharedLinkFileErrorUnsupportedLinkType: DBXSharingGetSharedLinkFileError { + @objc + public init() { + let swift = Sharing.GetSharedLinkFileError.unsupportedLinkType + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingGetSharedLinkFileErrorOther: DBXSharingGetSharedLinkFileError { + @objc + public init() { + let swift = Sharing.GetSharedLinkFileError.other + super.init(swift: swift) + } +} + +/// Directories cannot be retrieved by this endpoint. +@objc +public class DBXSharingGetSharedLinkFileErrorSharedLinkIsDirectory: DBXSharingGetSharedLinkFileError { + @objc + public init() { + let swift = Sharing.GetSharedLinkFileError.sharedLinkIsDirectory + super.init(swift: swift) + } +} + +/// Objective-C compatible GetSharedLinkMetadataArg struct +@objc +public class DBXSharingGetSharedLinkMetadataArg: NSObject { + /// URL of the shared link. + @objc + public var url: String { swift.url } + /// If the shared link is to a folder, this parameter can be used to retrieve the metadata for a specific file + /// or sub-folder in this folder. A relative path should be used. + @objc + public var path: String? { swift.path } + /// If the shared link has a password, this parameter can be used. + @objc + public var linkPassword: String? { swift.linkPassword } + + @objc + public init(url: String, path: String?, linkPassword: String?) { + self.swift = Sharing.GetSharedLinkMetadataArg(url: url, path: path, linkPassword: linkPassword) + } + + let swift: Sharing.GetSharedLinkMetadataArg + + public init(swift: Sharing.GetSharedLinkMetadataArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetSharedLinksArg struct +@objc +public class DBXSharingGetSharedLinksArg: NSObject { + /// See getSharedLinks description. + @objc + public var path: String? { swift.path } + + @objc + public init(path: String?) { + self.swift = Sharing.GetSharedLinksArg(path: path) + } + + let swift: Sharing.GetSharedLinksArg + + public init(swift: Sharing.GetSharedLinksArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetSharedLinksError union +@objc +public class DBXSharingGetSharedLinksError: NSObject { + let swift: Sharing.GetSharedLinksError + + public init(swift: Sharing.GetSharedLinksError) { + self.swift = swift + } + + public static func factory(swift: Sharing.GetSharedLinksError) -> DBXSharingGetSharedLinksError { + switch swift { + case .path(let swiftArg): + let arg = swiftArg + return DBXSharingGetSharedLinksErrorPath(arg) + case .other: + return DBXSharingGetSharedLinksErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXSharingGetSharedLinksErrorPath? { + self as? DBXSharingGetSharedLinksErrorPath + } + + @objc + public var asOther: DBXSharingGetSharedLinksErrorOther? { + self as? DBXSharingGetSharedLinksErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingGetSharedLinksErrorPath: DBXSharingGetSharedLinksError { + @objc + public var path: String? + + @objc + public init(_ arg: String?) { + self.path = arg + let swift = Sharing.GetSharedLinksError.path(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingGetSharedLinksErrorOther: DBXSharingGetSharedLinksError { + @objc + public init() { + let swift = Sharing.GetSharedLinksError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetSharedLinksResult struct +@objc +public class DBXSharingGetSharedLinksResult: NSObject { + /// Shared links applicable to the path argument. + @objc + public var links: [DBXSharingLinkMetadata] { swift.links.map { DBXSharingLinkMetadata(swift: $0) } } + + @objc + public init(links: [DBXSharingLinkMetadata]) { + self.swift = Sharing.GetSharedLinksResult(links: links.map(\.swift)) + } + + let swift: Sharing.GetSharedLinksResult + + public init(swift: Sharing.GetSharedLinksResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The information about a group. Groups is a way to manage a list of users who need same access permission to the +/// shared folder. +@objc +public class DBXSharingGroupInfo: DBXTeamCommonGroupSummary { + /// The type of group. + @objc + public var groupType: DBXTeamCommonGroupType { DBXTeamCommonGroupType(swift: subSwift.groupType) } + /// If the current user is a member of the group. + @objc + public var isMember: NSNumber { subSwift.isMember as NSNumber } + /// If the current user is an owner of the group. + @objc + public var isOwner: NSNumber { subSwift.isOwner as NSNumber } + /// If the group is owned by the current user's team. + @objc + public var sameTeam: NSNumber { subSwift.sameTeam as NSNumber } + + @objc + public init( + groupName: String, + groupId: String, + groupManagementType: DBXTeamCommonGroupManagementType, + groupType: DBXTeamCommonGroupType, + isMember: NSNumber, + isOwner: NSNumber, + sameTeam: NSNumber, + groupExternalId: String?, + memberCount: NSNumber? + ) { + let swift = Sharing.GroupInfo( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType.swift, + groupType: groupType.swift, + isMember: isMember.boolValue, + isOwner: isOwner.boolValue, + sameTeam: sameTeam.boolValue, + groupExternalId: groupExternalId, + memberCount: memberCount?.uint32Value + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.GroupInfo + + public init(swift: Sharing.GroupInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// The information about a member of the shared content. +@objc +public class DBXSharingMembershipInfo: NSObject { + /// The access type for this member. It contains inherited access type from parent folder, and acquired access + /// type from this folder. + @objc + public var accessType: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.accessType) } + /// The permissions that requesting user has on this member. The set of permissions corresponds to the + /// MemberActions in the request. + @objc + public var permissions: [DBXSharingMemberPermission]? { swift.permissions?.map { DBXSharingMemberPermission(swift: $0) } } + /// Never set. + @objc + public var initials: String? { swift.initials } + /// True if the member has access from a parent folder. + @objc + public var isInherited: NSNumber { swift.isInherited as NSNumber } + + @objc + public init(accessType: DBXSharingAccessLevel, permissions: [DBXSharingMemberPermission]?, initials: String?, isInherited: NSNumber) { + self.swift = Sharing.MembershipInfo( + accessType: accessType.swift, + permissions: permissions?.map(\.swift), + initials: initials, + isInherited: isInherited.boolValue + ) + } + + let swift: Sharing.MembershipInfo + + public init(swift: Sharing.MembershipInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The information about a group member of the shared content. +@objc +public class DBXSharingGroupMembershipInfo: DBXSharingMembershipInfo { + /// The information about the membership group. + @objc + public var group: DBXSharingGroupInfo { DBXSharingGroupInfo(swift: subSwift.group) } + + @objc + public init( + accessType: DBXSharingAccessLevel, + group: DBXSharingGroupInfo, + permissions: [DBXSharingMemberPermission]?, + initials: String?, + isInherited: NSNumber + ) { + let swift = Sharing.GroupMembershipInfo( + accessType: accessType.swift, + group: group.subSwift, + permissions: permissions?.map(\.swift), + initials: initials, + isInherited: isInherited.boolValue + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.GroupMembershipInfo + + public init(swift: Sharing.GroupMembershipInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible InsufficientPlan struct +@objc +public class DBXSharingInsufficientPlan: NSObject { + /// A message to tell the user to upgrade in order to support expected action. + @objc + public var message: String { swift.message } + /// A URL to send the user to in order to obtain the account type they need, e.g. upgrading. Absent if there is + /// no action the user can take to upgrade. + @objc + public var upsellUrl: String? { swift.upsellUrl } + + @objc + public init(message: String, upsellUrl: String?) { + self.swift = Sharing.InsufficientPlan(message: message, upsellUrl: upsellUrl) + } + + let swift: Sharing.InsufficientPlan + + public init(swift: Sharing.InsufficientPlan) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible InsufficientQuotaAmounts struct +@objc +public class DBXSharingInsufficientQuotaAmounts: NSObject { + /// The amount of space needed to add the item (the size of the item). + @objc + public var spaceNeeded: NSNumber { swift.spaceNeeded as NSNumber } + /// The amount of extra space needed to add the item. + @objc + public var spaceShortage: NSNumber { swift.spaceShortage as NSNumber } + /// The amount of space left in the user's Dropbox, less than space_needed. + @objc + public var spaceLeft: NSNumber { swift.spaceLeft as NSNumber } + + @objc + public init(spaceNeeded: NSNumber, spaceShortage: NSNumber, spaceLeft: NSNumber) { + self.swift = Sharing.InsufficientQuotaAmounts( + spaceNeeded: spaceNeeded.uint64Value, + spaceShortage: spaceShortage.uint64Value, + spaceLeft: spaceLeft.uint64Value + ) + } + + let swift: Sharing.InsufficientQuotaAmounts + + public init(swift: Sharing.InsufficientQuotaAmounts) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about the recipient of a shared content invitation. +@objc +public class DBXSharingInviteeInfo: NSObject { + let swift: Sharing.InviteeInfo + + public init(swift: Sharing.InviteeInfo) { + self.swift = swift + } + + public static func factory(swift: Sharing.InviteeInfo) -> DBXSharingInviteeInfo { + switch swift { + case .email(let swiftArg): + let arg = swiftArg + return DBXSharingInviteeInfoEmail(arg) + case .other: + return DBXSharingInviteeInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEmail: DBXSharingInviteeInfoEmail? { + self as? DBXSharingInviteeInfoEmail + } + + @objc + public var asOther: DBXSharingInviteeInfoOther? { + self as? DBXSharingInviteeInfoOther + } +} + +/// Email address of invited user. +@objc +public class DBXSharingInviteeInfoEmail: DBXSharingInviteeInfo { + @objc + public var email: String + + @objc + public init(_ arg: String) { + self.email = arg + let swift = Sharing.InviteeInfo.email(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingInviteeInfoOther: DBXSharingInviteeInfo { + @objc + public init() { + let swift = Sharing.InviteeInfo.other + super.init(swift: swift) + } +} + +/// Information about an invited member of a shared content. +@objc +public class DBXSharingInviteeMembershipInfo: DBXSharingMembershipInfo { + /// Recipient of the invitation. + @objc + public var invitee: DBXSharingInviteeInfo { DBXSharingInviteeInfo(swift: subSwift.invitee) } + /// The user this invitation is tied to, if available. + @objc + public var user: DBXSharingUserInfo? { guard let swift = subSwift.user else { return nil } + return DBXSharingUserInfo(swift: swift) + } + + @objc + public init( + accessType: DBXSharingAccessLevel, + invitee: DBXSharingInviteeInfo, + permissions: [DBXSharingMemberPermission]?, + initials: String?, + isInherited: NSNumber, + user: DBXSharingUserInfo? + ) { + let swift = Sharing.InviteeMembershipInfo( + accessType: accessType.swift, + invitee: invitee.swift, + permissions: permissions?.map(\.swift), + initials: initials, + isInherited: isInherited.boolValue, + user: user?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.InviteeMembershipInfo + + public init(swift: Sharing.InviteeMembershipInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Error occurred while performing an asynchronous job from unshareFolder or removeFolderMember. +@objc +public class DBXSharingJobError: NSObject { + let swift: Sharing.JobError + + public init(swift: Sharing.JobError) { + self.swift = swift + } + + public static func factory(swift: Sharing.JobError) -> DBXSharingJobError { + switch swift { + case .unshareFolderError(let swiftArg): + let arg = DBXSharingUnshareFolderError(swift: swiftArg) + return DBXSharingJobErrorUnshareFolderError(arg) + case .removeFolderMemberError(let swiftArg): + let arg = DBXSharingRemoveFolderMemberError(swift: swiftArg) + return DBXSharingJobErrorRemoveFolderMemberError(arg) + case .relinquishFolderMembershipError(let swiftArg): + let arg = DBXSharingRelinquishFolderMembershipError(swift: swiftArg) + return DBXSharingJobErrorRelinquishFolderMembershipError(arg) + case .other: + return DBXSharingJobErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnshareFolderError: DBXSharingJobErrorUnshareFolderError? { + self as? DBXSharingJobErrorUnshareFolderError + } + + @objc + public var asRemoveFolderMemberError: DBXSharingJobErrorRemoveFolderMemberError? { + self as? DBXSharingJobErrorRemoveFolderMemberError + } + + @objc + public var asRelinquishFolderMembershipError: DBXSharingJobErrorRelinquishFolderMembershipError? { + self as? DBXSharingJobErrorRelinquishFolderMembershipError + } + + @objc + public var asOther: DBXSharingJobErrorOther? { + self as? DBXSharingJobErrorOther + } +} + +/// Error occurred while performing unshareFolder action. +@objc +public class DBXSharingJobErrorUnshareFolderError: DBXSharingJobError { + @objc + public var unshareFolderError: DBXSharingUnshareFolderError + + @objc + public init(_ arg: DBXSharingUnshareFolderError) { + self.unshareFolderError = arg + let swift = Sharing.JobError.unshareFolderError(arg.swift) + super.init(swift: swift) + } +} + +/// Error occurred while performing removeFolderMember action. +@objc +public class DBXSharingJobErrorRemoveFolderMemberError: DBXSharingJobError { + @objc + public var removeFolderMemberError: DBXSharingRemoveFolderMemberError + + @objc + public init(_ arg: DBXSharingRemoveFolderMemberError) { + self.removeFolderMemberError = arg + let swift = Sharing.JobError.removeFolderMemberError(arg.swift) + super.init(swift: swift) + } +} + +/// Error occurred while performing relinquishFolderMembership action. +@objc +public class DBXSharingJobErrorRelinquishFolderMembershipError: DBXSharingJobError { + @objc + public var relinquishFolderMembershipError: DBXSharingRelinquishFolderMembershipError + + @objc + public init(_ arg: DBXSharingRelinquishFolderMembershipError) { + self.relinquishFolderMembershipError = arg + let swift = Sharing.JobError.relinquishFolderMembershipError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingJobErrorOther: DBXSharingJobError { + @objc + public init() { + let swift = Sharing.JobError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible JobStatus union +@objc +public class DBXSharingJobStatus: NSObject { + let swift: Sharing.JobStatus + + public init(swift: Sharing.JobStatus) { + self.swift = swift + } + + public static func factory(swift: Sharing.JobStatus) -> DBXSharingJobStatus { + switch swift { + case .inProgress: + return DBXSharingJobStatusInProgress() + case .complete: + return DBXSharingJobStatusComplete() + case .failed(let swiftArg): + let arg = DBXSharingJobError(swift: swiftArg) + return DBXSharingJobStatusFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXSharingJobStatusInProgress? { + self as? DBXSharingJobStatusInProgress + } + + @objc + public var asComplete: DBXSharingJobStatusComplete? { + self as? DBXSharingJobStatusComplete + } + + @objc + public var asFailed: DBXSharingJobStatusFailed? { + self as? DBXSharingJobStatusFailed + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXSharingJobStatusInProgress: DBXSharingJobStatus { + @objc + public init() { + let swift = Sharing.JobStatus.inProgress + super.init(swift: swift) + } +} + +/// The asynchronous job has finished. +@objc +public class DBXSharingJobStatusComplete: DBXSharingJobStatus { + @objc + public init() { + let swift = Sharing.JobStatus.complete + super.init(swift: swift) + } +} + +/// The asynchronous job returned an error. +@objc +public class DBXSharingJobStatusFailed: DBXSharingJobStatus { + @objc + public var failed: DBXSharingJobError + + @objc + public init(_ arg: DBXSharingJobError) { + self.failed = arg + let swift = Sharing.JobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible LinkAccessLevel union +@objc +public class DBXSharingLinkAccessLevel: NSObject { + let swift: Sharing.LinkAccessLevel + + public init(swift: Sharing.LinkAccessLevel) { + self.swift = swift + } + + public static func factory(swift: Sharing.LinkAccessLevel) -> DBXSharingLinkAccessLevel { + switch swift { + case .viewer: + return DBXSharingLinkAccessLevelViewer() + case .editor: + return DBXSharingLinkAccessLevelEditor() + case .other: + return DBXSharingLinkAccessLevelOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asViewer: DBXSharingLinkAccessLevelViewer? { + self as? DBXSharingLinkAccessLevelViewer + } + + @objc + public var asEditor: DBXSharingLinkAccessLevelEditor? { + self as? DBXSharingLinkAccessLevelEditor + } + + @objc + public var asOther: DBXSharingLinkAccessLevelOther? { + self as? DBXSharingLinkAccessLevelOther + } +} + +/// Users who use the link can view and comment on the content. +@objc +public class DBXSharingLinkAccessLevelViewer: DBXSharingLinkAccessLevel { + @objc + public init() { + let swift = Sharing.LinkAccessLevel.viewer + super.init(swift: swift) + } +} + +/// Users who use the link can edit, view and comment on the content. +@objc +public class DBXSharingLinkAccessLevelEditor: DBXSharingLinkAccessLevel { + @objc + public init() { + let swift = Sharing.LinkAccessLevel.editor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingLinkAccessLevelOther: DBXSharingLinkAccessLevel { + @objc + public init() { + let swift = Sharing.LinkAccessLevel.other + super.init(swift: swift) + } +} + +/// Actions that can be performed on a link. +@objc +public class DBXSharingLinkAction: NSObject { + let swift: Sharing.LinkAction + + public init(swift: Sharing.LinkAction) { + self.swift = swift + } + + public static func factory(swift: Sharing.LinkAction) -> DBXSharingLinkAction { + switch swift { + case .changeAccessLevel: + return DBXSharingLinkActionChangeAccessLevel() + case .changeAudience: + return DBXSharingLinkActionChangeAudience() + case .removeExpiry: + return DBXSharingLinkActionRemoveExpiry() + case .removePassword: + return DBXSharingLinkActionRemovePassword() + case .setExpiry: + return DBXSharingLinkActionSetExpiry() + case .setPassword: + return DBXSharingLinkActionSetPassword() + case .other: + return DBXSharingLinkActionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asChangeAccessLevel: DBXSharingLinkActionChangeAccessLevel? { + self as? DBXSharingLinkActionChangeAccessLevel + } + + @objc + public var asChangeAudience: DBXSharingLinkActionChangeAudience? { + self as? DBXSharingLinkActionChangeAudience + } + + @objc + public var asRemoveExpiry: DBXSharingLinkActionRemoveExpiry? { + self as? DBXSharingLinkActionRemoveExpiry + } + + @objc + public var asRemovePassword: DBXSharingLinkActionRemovePassword? { + self as? DBXSharingLinkActionRemovePassword + } + + @objc + public var asSetExpiry: DBXSharingLinkActionSetExpiry? { + self as? DBXSharingLinkActionSetExpiry + } + + @objc + public var asSetPassword: DBXSharingLinkActionSetPassword? { + self as? DBXSharingLinkActionSetPassword + } + + @objc + public var asOther: DBXSharingLinkActionOther? { + self as? DBXSharingLinkActionOther + } +} + +/// Change the access level of the link. +@objc +public class DBXSharingLinkActionChangeAccessLevel: DBXSharingLinkAction { + @objc + public init() { + let swift = Sharing.LinkAction.changeAccessLevel + super.init(swift: swift) + } +} + +/// Change the audience of the link. +@objc +public class DBXSharingLinkActionChangeAudience: DBXSharingLinkAction { + @objc + public init() { + let swift = Sharing.LinkAction.changeAudience + super.init(swift: swift) + } +} + +/// Remove the expiry date of the link. +@objc +public class DBXSharingLinkActionRemoveExpiry: DBXSharingLinkAction { + @objc + public init() { + let swift = Sharing.LinkAction.removeExpiry + super.init(swift: swift) + } +} + +/// Remove the password of the link. +@objc +public class DBXSharingLinkActionRemovePassword: DBXSharingLinkAction { + @objc + public init() { + let swift = Sharing.LinkAction.removePassword + super.init(swift: swift) + } +} + +/// Create or modify the expiry date of the link. +@objc +public class DBXSharingLinkActionSetExpiry: DBXSharingLinkAction { + @objc + public init() { + let swift = Sharing.LinkAction.setExpiry + super.init(swift: swift) + } +} + +/// Create or modify the password of the link. +@objc +public class DBXSharingLinkActionSetPassword: DBXSharingLinkAction { + @objc + public init() { + let swift = Sharing.LinkAction.setPassword + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingLinkActionOther: DBXSharingLinkAction { + @objc + public init() { + let swift = Sharing.LinkAction.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LinkAudience union +@objc +public class DBXSharingLinkAudience: NSObject { + let swift: Sharing.LinkAudience + + public init(swift: Sharing.LinkAudience) { + self.swift = swift + } + + public static func factory(swift: Sharing.LinkAudience) -> DBXSharingLinkAudience { + switch swift { + case .public_: + return DBXSharingLinkAudiencePublic_() + case .team: + return DBXSharingLinkAudienceTeam() + case .noOne: + return DBXSharingLinkAudienceNoOne() + case .password: + return DBXSharingLinkAudiencePassword() + case .members: + return DBXSharingLinkAudienceMembers() + case .other: + return DBXSharingLinkAudienceOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPublic_: DBXSharingLinkAudiencePublic_? { + self as? DBXSharingLinkAudiencePublic_ + } + + @objc + public var asTeam: DBXSharingLinkAudienceTeam? { + self as? DBXSharingLinkAudienceTeam + } + + @objc + public var asNoOne: DBXSharingLinkAudienceNoOne? { + self as? DBXSharingLinkAudienceNoOne + } + + @objc + public var asPassword: DBXSharingLinkAudiencePassword? { + self as? DBXSharingLinkAudiencePassword + } + + @objc + public var asMembers: DBXSharingLinkAudienceMembers? { + self as? DBXSharingLinkAudienceMembers + } + + @objc + public var asOther: DBXSharingLinkAudienceOther? { + self as? DBXSharingLinkAudienceOther + } +} + +/// Link is accessible by anyone. +@objc +public class DBXSharingLinkAudiencePublic_: DBXSharingLinkAudience { + @objc + public init() { + let swift = Sharing.LinkAudience.public_ + super.init(swift: swift) + } +} + +/// Link is accessible only by team members. +@objc +public class DBXSharingLinkAudienceTeam: DBXSharingLinkAudience { + @objc + public init() { + let swift = Sharing.LinkAudience.team + super.init(swift: swift) + } +} + +/// The link can be used by no one. The link merely points the user to the content, and does not grant +/// additional rights to the user. Members of the content who use this link can only access the content +/// with their pre-existing access rights. +@objc +public class DBXSharingLinkAudienceNoOne: DBXSharingLinkAudience { + @objc + public init() { + let swift = Sharing.LinkAudience.noOne + super.init(swift: swift) + } +} + +/// Use `require_password` instead. A link-specific password is required to access the link. Login is not +/// required. +@objc +public class DBXSharingLinkAudiencePassword: DBXSharingLinkAudience { + @objc + public init() { + let swift = Sharing.LinkAudience.password + super.init(swift: swift) + } +} + +/// Link is accessible only by members of the content. +@objc +public class DBXSharingLinkAudienceMembers: DBXSharingLinkAudience { + @objc + public init() { + let swift = Sharing.LinkAudience.members + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingLinkAudienceOther: DBXSharingLinkAudience { + @objc + public init() { + let swift = Sharing.LinkAudience.other + super.init(swift: swift) + } +} + +/// Objective-C compatible VisibilityPolicyDisallowedReason union +@objc +public class DBXSharingVisibilityPolicyDisallowedReason: NSObject { + let swift: Sharing.VisibilityPolicyDisallowedReason + + public init(swift: Sharing.VisibilityPolicyDisallowedReason) { + self.swift = swift + } + + public static func factory(swift: Sharing.VisibilityPolicyDisallowedReason) -> DBXSharingVisibilityPolicyDisallowedReason { + switch swift { + case .deleteAndRecreate: + return DBXSharingVisibilityPolicyDisallowedReasonDeleteAndRecreate() + case .restrictedBySharedFolder: + return DBXSharingVisibilityPolicyDisallowedReasonRestrictedBySharedFolder() + case .restrictedByTeam: + return DBXSharingVisibilityPolicyDisallowedReasonRestrictedByTeam() + case .userNotOnTeam: + return DBXSharingVisibilityPolicyDisallowedReasonUserNotOnTeam() + case .userAccountType: + return DBXSharingVisibilityPolicyDisallowedReasonUserAccountType() + case .permissionDenied: + return DBXSharingVisibilityPolicyDisallowedReasonPermissionDenied() + case .other: + return DBXSharingVisibilityPolicyDisallowedReasonOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDeleteAndRecreate: DBXSharingVisibilityPolicyDisallowedReasonDeleteAndRecreate? { + self as? DBXSharingVisibilityPolicyDisallowedReasonDeleteAndRecreate + } + + @objc + public var asRestrictedBySharedFolder: DBXSharingVisibilityPolicyDisallowedReasonRestrictedBySharedFolder? { + self as? DBXSharingVisibilityPolicyDisallowedReasonRestrictedBySharedFolder + } + + @objc + public var asRestrictedByTeam: DBXSharingVisibilityPolicyDisallowedReasonRestrictedByTeam? { + self as? DBXSharingVisibilityPolicyDisallowedReasonRestrictedByTeam + } + + @objc + public var asUserNotOnTeam: DBXSharingVisibilityPolicyDisallowedReasonUserNotOnTeam? { + self as? DBXSharingVisibilityPolicyDisallowedReasonUserNotOnTeam + } + + @objc + public var asUserAccountType: DBXSharingVisibilityPolicyDisallowedReasonUserAccountType? { + self as? DBXSharingVisibilityPolicyDisallowedReasonUserAccountType + } + + @objc + public var asPermissionDenied: DBXSharingVisibilityPolicyDisallowedReasonPermissionDenied? { + self as? DBXSharingVisibilityPolicyDisallowedReasonPermissionDenied + } + + @objc + public var asOther: DBXSharingVisibilityPolicyDisallowedReasonOther? { + self as? DBXSharingVisibilityPolicyDisallowedReasonOther + } +} + +/// The user needs to delete and recreate the link to change the visibility policy. +@objc +public class DBXSharingVisibilityPolicyDisallowedReasonDeleteAndRecreate: DBXSharingVisibilityPolicyDisallowedReason { + @objc + public init() { + let swift = Sharing.VisibilityPolicyDisallowedReason.deleteAndRecreate + super.init(swift: swift) + } +} + +/// The parent shared folder restricts sharing of links outside the shared folder. To change the visibility +/// policy, remove the restriction from the parent shared folder. +@objc +public class DBXSharingVisibilityPolicyDisallowedReasonRestrictedBySharedFolder: DBXSharingVisibilityPolicyDisallowedReason { + @objc + public init() { + let swift = Sharing.VisibilityPolicyDisallowedReason.restrictedBySharedFolder + super.init(swift: swift) + } +} + +/// The team policy prevents links being shared outside the team. +@objc +public class DBXSharingVisibilityPolicyDisallowedReasonRestrictedByTeam: DBXSharingVisibilityPolicyDisallowedReason { + @objc + public init() { + let swift = Sharing.VisibilityPolicyDisallowedReason.restrictedByTeam + super.init(swift: swift) + } +} + +/// The user needs to be on a team to set this policy. +@objc +public class DBXSharingVisibilityPolicyDisallowedReasonUserNotOnTeam: DBXSharingVisibilityPolicyDisallowedReason { + @objc + public init() { + let swift = Sharing.VisibilityPolicyDisallowedReason.userNotOnTeam + super.init(swift: swift) + } +} + +/// The user is a basic user or is on a limited team. +@objc +public class DBXSharingVisibilityPolicyDisallowedReasonUserAccountType: DBXSharingVisibilityPolicyDisallowedReason { + @objc + public init() { + let swift = Sharing.VisibilityPolicyDisallowedReason.userAccountType + super.init(swift: swift) + } +} + +/// The user does not have permission. +@objc +public class DBXSharingVisibilityPolicyDisallowedReasonPermissionDenied: DBXSharingVisibilityPolicyDisallowedReason { + @objc + public init() { + let swift = Sharing.VisibilityPolicyDisallowedReason.permissionDenied + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingVisibilityPolicyDisallowedReasonOther: DBXSharingVisibilityPolicyDisallowedReason { + @objc + public init() { + let swift = Sharing.VisibilityPolicyDisallowedReason.other + super.init(swift: swift) + } +} + +/// check documentation for VisibilityPolicyDisallowedReason. +@objc +public class DBXSharingLinkAudienceDisallowedReason: NSObject { + let swift: Sharing.LinkAudienceDisallowedReason + + public init(swift: Sharing.LinkAudienceDisallowedReason) { + self.swift = swift + } + + public static func factory(swift: Sharing.LinkAudienceDisallowedReason) -> DBXSharingLinkAudienceDisallowedReason { + switch swift { + case .deleteAndRecreate: + return DBXSharingLinkAudienceDisallowedReasonDeleteAndRecreate() + case .restrictedBySharedFolder: + return DBXSharingLinkAudienceDisallowedReasonRestrictedBySharedFolder() + case .restrictedByTeam: + return DBXSharingLinkAudienceDisallowedReasonRestrictedByTeam() + case .userNotOnTeam: + return DBXSharingLinkAudienceDisallowedReasonUserNotOnTeam() + case .userAccountType: + return DBXSharingLinkAudienceDisallowedReasonUserAccountType() + case .permissionDenied: + return DBXSharingLinkAudienceDisallowedReasonPermissionDenied() + case .other: + return DBXSharingLinkAudienceDisallowedReasonOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDeleteAndRecreate: DBXSharingLinkAudienceDisallowedReasonDeleteAndRecreate? { + self as? DBXSharingLinkAudienceDisallowedReasonDeleteAndRecreate + } + + @objc + public var asRestrictedBySharedFolder: DBXSharingLinkAudienceDisallowedReasonRestrictedBySharedFolder? { + self as? DBXSharingLinkAudienceDisallowedReasonRestrictedBySharedFolder + } + + @objc + public var asRestrictedByTeam: DBXSharingLinkAudienceDisallowedReasonRestrictedByTeam? { + self as? DBXSharingLinkAudienceDisallowedReasonRestrictedByTeam + } + + @objc + public var asUserNotOnTeam: DBXSharingLinkAudienceDisallowedReasonUserNotOnTeam? { + self as? DBXSharingLinkAudienceDisallowedReasonUserNotOnTeam + } + + @objc + public var asUserAccountType: DBXSharingLinkAudienceDisallowedReasonUserAccountType? { + self as? DBXSharingLinkAudienceDisallowedReasonUserAccountType + } + + @objc + public var asPermissionDenied: DBXSharingLinkAudienceDisallowedReasonPermissionDenied? { + self as? DBXSharingLinkAudienceDisallowedReasonPermissionDenied + } + + @objc + public var asOther: DBXSharingLinkAudienceDisallowedReasonOther? { + self as? DBXSharingLinkAudienceDisallowedReasonOther + } +} + +/// The user needs to delete and recreate the link to change the visibility policy. +@objc +public class DBXSharingLinkAudienceDisallowedReasonDeleteAndRecreate: DBXSharingLinkAudienceDisallowedReason { + @objc + public init() { + let swift = Sharing.LinkAudienceDisallowedReason.deleteAndRecreate + super.init(swift: swift) + } +} + +/// The parent shared folder restricts sharing of links outside the shared folder. To change the visibility +/// policy, remove the restriction from the parent shared folder. +@objc +public class DBXSharingLinkAudienceDisallowedReasonRestrictedBySharedFolder: DBXSharingLinkAudienceDisallowedReason { + @objc + public init() { + let swift = Sharing.LinkAudienceDisallowedReason.restrictedBySharedFolder + super.init(swift: swift) + } +} + +/// The team policy prevents links being shared outside the team. +@objc +public class DBXSharingLinkAudienceDisallowedReasonRestrictedByTeam: DBXSharingLinkAudienceDisallowedReason { + @objc + public init() { + let swift = Sharing.LinkAudienceDisallowedReason.restrictedByTeam + super.init(swift: swift) + } +} + +/// The user needs to be on a team to set this policy. +@objc +public class DBXSharingLinkAudienceDisallowedReasonUserNotOnTeam: DBXSharingLinkAudienceDisallowedReason { + @objc + public init() { + let swift = Sharing.LinkAudienceDisallowedReason.userNotOnTeam + super.init(swift: swift) + } +} + +/// The user is a basic user or is on a limited team. +@objc +public class DBXSharingLinkAudienceDisallowedReasonUserAccountType: DBXSharingLinkAudienceDisallowedReason { + @objc + public init() { + let swift = Sharing.LinkAudienceDisallowedReason.userAccountType + super.init(swift: swift) + } +} + +/// The user does not have permission. +@objc +public class DBXSharingLinkAudienceDisallowedReasonPermissionDenied: DBXSharingLinkAudienceDisallowedReason { + @objc + public init() { + let swift = Sharing.LinkAudienceDisallowedReason.permissionDenied + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingLinkAudienceDisallowedReasonOther: DBXSharingLinkAudienceDisallowedReason { + @objc + public init() { + let swift = Sharing.LinkAudienceDisallowedReason.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LinkAudienceOption struct +@objc +public class DBXSharingLinkAudienceOption: NSObject { + /// Specifies who can access the link. + @objc + public var audience: DBXSharingLinkAudience { DBXSharingLinkAudience(swift: swift.audience) } + /// Whether the user calling this API can select this audience option. + @objc + public var allowed: NSNumber { swift.allowed as NSNumber } + /// If allowed is false, this will provide the reason that the user is not permitted to set the visibility to + /// this policy. + @objc + public var disallowedReason: DBXSharingLinkAudienceDisallowedReason? { guard let swift = swift.disallowedReason else { return nil } + return DBXSharingLinkAudienceDisallowedReason(swift: swift) + } + + @objc + public init(audience: DBXSharingLinkAudience, allowed: NSNumber, disallowedReason: DBXSharingLinkAudienceDisallowedReason?) { + self.swift = Sharing.LinkAudienceOption(audience: audience.swift, allowed: allowed.boolValue, disallowedReason: disallowedReason?.swift) + } + + let swift: Sharing.LinkAudienceOption + + public init(swift: Sharing.LinkAudienceOption) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LinkExpiry union +@objc +public class DBXSharingLinkExpiry: NSObject { + let swift: Sharing.LinkExpiry + + public init(swift: Sharing.LinkExpiry) { + self.swift = swift + } + + public static func factory(swift: Sharing.LinkExpiry) -> DBXSharingLinkExpiry { + switch swift { + case .removeExpiry: + return DBXSharingLinkExpiryRemoveExpiry() + case .setExpiry(let swiftArg): + let arg = swiftArg + return DBXSharingLinkExpirySetExpiry(arg) + case .other: + return DBXSharingLinkExpiryOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asRemoveExpiry: DBXSharingLinkExpiryRemoveExpiry? { + self as? DBXSharingLinkExpiryRemoveExpiry + } + + @objc + public var asSetExpiry: DBXSharingLinkExpirySetExpiry? { + self as? DBXSharingLinkExpirySetExpiry + } + + @objc + public var asOther: DBXSharingLinkExpiryOther? { + self as? DBXSharingLinkExpiryOther + } +} + +/// Remove the currently set expiry for the link. +@objc +public class DBXSharingLinkExpiryRemoveExpiry: DBXSharingLinkExpiry { + @objc + public init() { + let swift = Sharing.LinkExpiry.removeExpiry + super.init(swift: swift) + } +} + +/// Set a new expiry or change an existing expiry. +@objc +public class DBXSharingLinkExpirySetExpiry: DBXSharingLinkExpiry { + @objc + public var setExpiry: Date + + @objc + public init(_ arg: Date) { + self.setExpiry = arg + let swift = Sharing.LinkExpiry.setExpiry(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingLinkExpiryOther: DBXSharingLinkExpiry { + @objc + public init() { + let swift = Sharing.LinkExpiry.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LinkPassword union +@objc +public class DBXSharingLinkPassword: NSObject { + let swift: Sharing.LinkPassword + + public init(swift: Sharing.LinkPassword) { + self.swift = swift + } + + public static func factory(swift: Sharing.LinkPassword) -> DBXSharingLinkPassword { + switch swift { + case .removePassword: + return DBXSharingLinkPasswordRemovePassword() + case .setPassword(let swiftArg): + let arg = swiftArg + return DBXSharingLinkPasswordSetPassword(arg) + case .other: + return DBXSharingLinkPasswordOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asRemovePassword: DBXSharingLinkPasswordRemovePassword? { + self as? DBXSharingLinkPasswordRemovePassword + } + + @objc + public var asSetPassword: DBXSharingLinkPasswordSetPassword? { + self as? DBXSharingLinkPasswordSetPassword + } + + @objc + public var asOther: DBXSharingLinkPasswordOther? { + self as? DBXSharingLinkPasswordOther + } +} + +/// Remove the currently set password for the link. +@objc +public class DBXSharingLinkPasswordRemovePassword: DBXSharingLinkPassword { + @objc + public init() { + let swift = Sharing.LinkPassword.removePassword + super.init(swift: swift) + } +} + +/// Set a new password or change an existing password. +@objc +public class DBXSharingLinkPasswordSetPassword: DBXSharingLinkPassword { + @objc + public var setPassword: String + + @objc + public init(_ arg: String) { + self.setPassword = arg + let swift = Sharing.LinkPassword.setPassword(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingLinkPasswordOther: DBXSharingLinkPassword { + @objc + public init() { + let swift = Sharing.LinkPassword.other + super.init(swift: swift) + } +} + +/// Permissions for actions that can be performed on a link. +@objc +public class DBXSharingLinkPermission: NSObject { + /// (no description) + @objc + public var action: DBXSharingLinkAction { DBXSharingLinkAction(swift: swift.action) } + /// (no description) + @objc + public var allow: NSNumber { swift.allow as NSNumber } + /// (no description) + @objc + public var reason: DBXSharingPermissionDeniedReason? { guard let swift = swift.reason else { return nil } + return DBXSharingPermissionDeniedReason(swift: swift) + } + + @objc + public init(action: DBXSharingLinkAction, allow: NSNumber, reason: DBXSharingPermissionDeniedReason?) { + self.swift = Sharing.LinkPermission(action: action.swift, allow: allow.boolValue, reason: reason?.swift) + } + + let swift: Sharing.LinkPermission + + public init(swift: Sharing.LinkPermission) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LinkPermissions struct +@objc +public class DBXSharingLinkPermissions: NSObject { + /// The current visibility of the link after considering the shared links policies of the the team (in case the + /// link's owner is part of a team) and the shared folder (in case the linked file is part of a shared + /// folder). This field is shown only if the caller has access to this info (the link's owner always has + /// access to this data). For some links, an effective_audience value is returned instead. + @objc + public var resolvedVisibility: DBXSharingResolvedVisibility? { guard let swift = swift.resolvedVisibility else { return nil } + return DBXSharingResolvedVisibility(swift: swift) + } + + /// The shared link's requested visibility. This can be overridden by the team and shared folder policies. The + /// final visibility, after considering these policies, can be found in resolvedVisibility. This is shown + /// only if the caller is the link's owner and resolved_visibility is returned instead of + /// effective_audience. + @objc + public var requestedVisibility: DBXSharingRequestedVisibility? { guard let swift = swift.requestedVisibility else { return nil } + return DBXSharingRequestedVisibility(swift: swift) + } + + /// Whether the caller can revoke the shared link. + @objc + public var canRevoke: NSNumber { swift.canRevoke as NSNumber } + /// The failure reason for revoking the link. This field will only be present if the canRevoke is false. + @objc + public var revokeFailureReason: DBXSharingSharedLinkAccessFailureReason? { guard let swift = swift.revokeFailureReason else { return nil } + return DBXSharingSharedLinkAccessFailureReason(swift: swift) + } + + /// The type of audience who can benefit from the access level specified by the `link_access_level` field. + @objc + public var effectiveAudience: DBXSharingLinkAudience? { guard let swift = swift.effectiveAudience else { return nil } + return DBXSharingLinkAudience(swift: swift) + } + + /// The access level that the link will grant to its users. A link can grant additional rights to a user beyond + /// their current access level. For example, if a user was invited as a viewer to a file, and then opens a + /// link with `link_access_level` set to `editor`, then they will gain editor privileges. The + /// `link_access_level` is a property of the link, and does not depend on who is calling this API. In + /// particular, `link_access_level` does not take into account the API caller's current permissions to the + /// content. + @objc + public var linkAccessLevel: DBXSharingLinkAccessLevel? { guard let swift = swift.linkAccessLevel else { return nil } + return DBXSharingLinkAccessLevel(swift: swift) + } + + /// A list of policies that the user might be able to set for the visibility. + @objc + public var visibilityPolicies: [DBXSharingVisibilityPolicy] { swift.visibilityPolicies.map { DBXSharingVisibilityPolicy(swift: $0) } } + /// Whether the user can set the expiry settings of the link. This refers to the ability to create a new expiry + /// and modify an existing expiry. + @objc + public var canSetExpiry: NSNumber { swift.canSetExpiry as NSNumber } + /// Whether the user can remove the expiry of the link. + @objc + public var canRemoveExpiry: NSNumber { swift.canRemoveExpiry as NSNumber } + /// Whether the link can be downloaded or not. + @objc + public var allowDownload: NSNumber { swift.allowDownload as NSNumber } + /// Whether the user can allow downloads via the link. This refers to the ability to remove a no-download + /// restriction on the link. + @objc + public var canAllowDownload: NSNumber { swift.canAllowDownload as NSNumber } + /// Whether the user can disallow downloads via the link. This refers to the ability to impose a no-download + /// restriction on the link. + @objc + public var canDisallowDownload: NSNumber { swift.canDisallowDownload as NSNumber } + /// Whether comments are enabled for the linked file. This takes the team commenting policy into account. + @objc + public var allowComments: NSNumber { swift.allowComments as NSNumber } + /// Whether the team has disabled commenting globally. + @objc + public var teamRestrictsComments: NSNumber { swift.teamRestrictsComments as NSNumber } + /// A list of link audience options the user might be able to set as the new audience. + @objc + public var audienceOptions: [DBXSharingLinkAudienceOption]? { swift.audienceOptions?.map { DBXSharingLinkAudienceOption(swift: $0) } } + /// Whether the user can set a password for the link. + @objc + public var canSetPassword: NSNumber? { swift.canSetPassword as NSNumber? } + /// Whether the user can remove the password of the link. + @objc + public var canRemovePassword: NSNumber? { swift.canRemovePassword as NSNumber? } + /// Whether the user is required to provide a password to view the link. + @objc + public var requirePassword: NSNumber? { swift.requirePassword as NSNumber? } + /// Whether the user can use extended sharing controls, based on their account type. + @objc + public var canUseExtendedSharingControls: NSNumber? { swift.canUseExtendedSharingControls as NSNumber? } + + @objc + public init( + canRevoke: NSNumber, + visibilityPolicies: [DBXSharingVisibilityPolicy], + canSetExpiry: NSNumber, + canRemoveExpiry: NSNumber, + allowDownload: NSNumber, + canAllowDownload: NSNumber, + canDisallowDownload: NSNumber, + allowComments: NSNumber, + teamRestrictsComments: NSNumber, + resolvedVisibility: DBXSharingResolvedVisibility?, + requestedVisibility: DBXSharingRequestedVisibility?, + revokeFailureReason: DBXSharingSharedLinkAccessFailureReason?, + effectiveAudience: DBXSharingLinkAudience?, + linkAccessLevel: DBXSharingLinkAccessLevel?, + audienceOptions: [DBXSharingLinkAudienceOption]?, + canSetPassword: NSNumber?, + canRemovePassword: NSNumber?, + requirePassword: NSNumber?, + canUseExtendedSharingControls: NSNumber? + ) { + self.swift = Sharing.LinkPermissions( + canRevoke: canRevoke.boolValue, + visibilityPolicies: visibilityPolicies.map(\.swift), + canSetExpiry: canSetExpiry.boolValue, + canRemoveExpiry: canRemoveExpiry.boolValue, + allowDownload: allowDownload.boolValue, + canAllowDownload: canAllowDownload.boolValue, + canDisallowDownload: canDisallowDownload.boolValue, + allowComments: allowComments.boolValue, + teamRestrictsComments: teamRestrictsComments.boolValue, + resolvedVisibility: resolvedVisibility?.swift, + requestedVisibility: requestedVisibility?.swift, + revokeFailureReason: revokeFailureReason?.swift, + effectiveAudience: effectiveAudience?.swift, + linkAccessLevel: linkAccessLevel?.swift, + audienceOptions: audienceOptions?.map(\.swift), + canSetPassword: canSetPassword?.boolValue, + canRemovePassword: canRemovePassword?.boolValue, + requirePassword: requirePassword?.boolValue, + canUseExtendedSharingControls: canUseExtendedSharingControls?.boolValue + ) + } + + let swift: Sharing.LinkPermissions + + public init(swift: Sharing.LinkPermissions) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Settings that apply to a link. +@objc +public class DBXSharingLinkSettings: NSObject { + /// The access level on the link for this file. Currently, it only accepts 'viewer' and 'viewer_no_comment'. + @objc + public var accessLevel: DBXSharingAccessLevel? { guard let swift = swift.accessLevel else { return nil } + return DBXSharingAccessLevel(swift: swift) + } + + /// The type of audience on the link for this file. + @objc + public var audience: DBXSharingLinkAudience? { guard let swift = swift.audience else { return nil } + return DBXSharingLinkAudience(swift: swift) + } + + /// An expiry timestamp to set on a link. + @objc + public var expiry: DBXSharingLinkExpiry? { guard let swift = swift.expiry else { return nil } + return DBXSharingLinkExpiry(swift: swift) + } + + /// The password for the link. + @objc + public var password: DBXSharingLinkPassword? { guard let swift = swift.password else { return nil } + return DBXSharingLinkPassword(swift: swift) + } + + @objc + public init(accessLevel: DBXSharingAccessLevel?, audience: DBXSharingLinkAudience?, expiry: DBXSharingLinkExpiry?, password: DBXSharingLinkPassword?) { + self.swift = Sharing.LinkSettings(accessLevel: accessLevel?.swift, audience: audience?.swift, expiry: expiry?.swift, password: password?.swift) + } + + let swift: Sharing.LinkSettings + + public init(swift: Sharing.LinkSettings) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for listFileMembers. +@objc +public class DBXSharingListFileMembersArg: NSObject { + /// The file for which you want to see members. + @objc + public var file: String { swift.file } + /// The actions for which to return permissions on a member. + @objc + public var actions: [DBXSharingMemberAction]? { swift.actions?.map { DBXSharingMemberAction(swift: $0) } } + /// Whether to include members who only have access from a parent shared folder. + @objc + public var includeInherited: NSNumber { swift.includeInherited as NSNumber } + /// Number of members to return max per query. Defaults to 100 if no limit is specified. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(file: String, actions: [DBXSharingMemberAction]?, includeInherited: NSNumber, limit: NSNumber) { + self.swift = Sharing.ListFileMembersArg( + file: file, + actions: actions?.map(\.swift), + includeInherited: includeInherited.boolValue, + limit: limit.uint32Value + ) + } + + let swift: Sharing.ListFileMembersArg + + public init(swift: Sharing.ListFileMembersArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for listFileMembersBatch. +@objc +public class DBXSharingListFileMembersBatchArg: NSObject { + /// Files for which to return members. + @objc + public var files: [String] { swift.files } + /// Number of members to return max per query. Defaults to 10 if no limit is specified. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(files: [String], limit: NSNumber) { + self.swift = Sharing.ListFileMembersBatchArg(files: files, limit: limit.uint32Value) + } + + let swift: Sharing.ListFileMembersBatchArg + + public init(swift: Sharing.ListFileMembersBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Per-file result for listFileMembersBatch. +@objc +public class DBXSharingListFileMembersBatchResult: NSObject { + /// This is the input file identifier, whether an ID or a path. + @objc + public var file: String { swift.file } + /// The result for this particular file. + @objc + public var result: DBXSharingListFileMembersIndividualResult { DBXSharingListFileMembersIndividualResult(swift: swift.result) } + + @objc + public init(file: String, result: DBXSharingListFileMembersIndividualResult) { + self.swift = Sharing.ListFileMembersBatchResult(file: file, result: result.swift) + } + + let swift: Sharing.ListFileMembersBatchResult + + public init(swift: Sharing.ListFileMembersBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for listFileMembersContinue. +@objc +public class DBXSharingListFileMembersContinueArg: NSObject { + /// The cursor returned by your last call to listFileMembers, listFileMembersContinue, or listFileMembersBatch. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Sharing.ListFileMembersContinueArg(cursor: cursor) + } + + let swift: Sharing.ListFileMembersContinueArg + + public init(swift: Sharing.ListFileMembersContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error for listFileMembersContinue. +@objc +public class DBXSharingListFileMembersContinueError: NSObject { + let swift: Sharing.ListFileMembersContinueError + + public init(swift: Sharing.ListFileMembersContinueError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ListFileMembersContinueError) -> DBXSharingListFileMembersContinueError { + switch swift { + case .userError(let swiftArg): + let arg = DBXSharingSharingUserError(swift: swiftArg) + return DBXSharingListFileMembersContinueErrorUserError(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingListFileMembersContinueErrorAccessError(arg) + case .invalidCursor: + return DBXSharingListFileMembersContinueErrorInvalidCursor() + case .other: + return DBXSharingListFileMembersContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserError: DBXSharingListFileMembersContinueErrorUserError? { + self as? DBXSharingListFileMembersContinueErrorUserError + } + + @objc + public var asAccessError: DBXSharingListFileMembersContinueErrorAccessError? { + self as? DBXSharingListFileMembersContinueErrorAccessError + } + + @objc + public var asInvalidCursor: DBXSharingListFileMembersContinueErrorInvalidCursor? { + self as? DBXSharingListFileMembersContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXSharingListFileMembersContinueErrorOther? { + self as? DBXSharingListFileMembersContinueErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFileMembersContinueErrorUserError: DBXSharingListFileMembersContinueError { + @objc + public var userError: DBXSharingSharingUserError + + @objc + public init(_ arg: DBXSharingSharingUserError) { + self.userError = arg + let swift = Sharing.ListFileMembersContinueError.userError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFileMembersContinueErrorAccessError: DBXSharingListFileMembersContinueError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.ListFileMembersContinueError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// cursor in ListFileMembersContinueArg is invalid. +@objc +public class DBXSharingListFileMembersContinueErrorInvalidCursor: DBXSharingListFileMembersContinueError { + @objc + public init() { + let swift = Sharing.ListFileMembersContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFileMembersContinueErrorOther: DBXSharingListFileMembersContinueError { + @objc + public init() { + let swift = Sharing.ListFileMembersContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListFileMembersCountResult struct +@objc +public class DBXSharingListFileMembersCountResult: NSObject { + /// A list of members on this file. + @objc + public var members: DBXSharingSharedFileMembers { DBXSharingSharedFileMembers(swift: swift.members) } + /// The number of members on this file. This does not include inherited members. + @objc + public var memberCount: NSNumber { swift.memberCount as NSNumber } + + @objc + public init(members: DBXSharingSharedFileMembers, memberCount: NSNumber) { + self.swift = Sharing.ListFileMembersCountResult(members: members.swift, memberCount: memberCount.uint32Value) + } + + let swift: Sharing.ListFileMembersCountResult + + public init(swift: Sharing.ListFileMembersCountResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error for listFileMembers. +@objc +public class DBXSharingListFileMembersError: NSObject { + let swift: Sharing.ListFileMembersError + + public init(swift: Sharing.ListFileMembersError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ListFileMembersError) -> DBXSharingListFileMembersError { + switch swift { + case .userError(let swiftArg): + let arg = DBXSharingSharingUserError(swift: swiftArg) + return DBXSharingListFileMembersErrorUserError(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingListFileMembersErrorAccessError(arg) + case .other: + return DBXSharingListFileMembersErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserError: DBXSharingListFileMembersErrorUserError? { + self as? DBXSharingListFileMembersErrorUserError + } + + @objc + public var asAccessError: DBXSharingListFileMembersErrorAccessError? { + self as? DBXSharingListFileMembersErrorAccessError + } + + @objc + public var asOther: DBXSharingListFileMembersErrorOther? { + self as? DBXSharingListFileMembersErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFileMembersErrorUserError: DBXSharingListFileMembersError { + @objc + public var userError: DBXSharingSharingUserError + + @objc + public init(_ arg: DBXSharingSharingUserError) { + self.userError = arg + let swift = Sharing.ListFileMembersError.userError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFileMembersErrorAccessError: DBXSharingListFileMembersError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.ListFileMembersError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFileMembersErrorOther: DBXSharingListFileMembersError { + @objc + public init() { + let swift = Sharing.ListFileMembersError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListFileMembersIndividualResult union +@objc +public class DBXSharingListFileMembersIndividualResult: NSObject { + let swift: Sharing.ListFileMembersIndividualResult + + public init(swift: Sharing.ListFileMembersIndividualResult) { + self.swift = swift + } + + public static func factory(swift: Sharing.ListFileMembersIndividualResult) -> DBXSharingListFileMembersIndividualResult { + switch swift { + case .result(let swiftArg): + let arg = DBXSharingListFileMembersCountResult(swift: swiftArg) + return DBXSharingListFileMembersIndividualResultResult(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingListFileMembersIndividualResultAccessError(arg) + case .other: + return DBXSharingListFileMembersIndividualResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asResult: DBXSharingListFileMembersIndividualResultResult? { + self as? DBXSharingListFileMembersIndividualResultResult + } + + @objc + public var asAccessError: DBXSharingListFileMembersIndividualResultAccessError? { + self as? DBXSharingListFileMembersIndividualResultAccessError + } + + @objc + public var asOther: DBXSharingListFileMembersIndividualResultOther? { + self as? DBXSharingListFileMembersIndividualResultOther + } +} + +/// The results of the query for this file if it was successful. +@objc +public class DBXSharingListFileMembersIndividualResultResult: DBXSharingListFileMembersIndividualResult { + @objc + public var result: DBXSharingListFileMembersCountResult + + @objc + public init(_ arg: DBXSharingListFileMembersCountResult) { + self.result = arg + let swift = Sharing.ListFileMembersIndividualResult.result(arg.swift) + super.init(swift: swift) + } +} + +/// The result of the query for this file if it was an error. +@objc +public class DBXSharingListFileMembersIndividualResultAccessError: DBXSharingListFileMembersIndividualResult { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.ListFileMembersIndividualResult.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFileMembersIndividualResultOther: DBXSharingListFileMembersIndividualResult { + @objc + public init() { + let swift = Sharing.ListFileMembersIndividualResult.other + super.init(swift: swift) + } +} + +/// Arguments for listReceivedFiles. +@objc +public class DBXSharingListFilesArg: NSObject { + /// Number of files to return max per query. Defaults to 100 if no limit is specified. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + /// A list of `FileAction`s corresponding to `FilePermission`s that should appear in the response's permissions + /// in SharedFileMetadata field describing the actions the authenticated user can perform on the file. + @objc + public var actions: [DBXSharingFileAction]? { swift.actions?.map { DBXSharingFileAction(swift: $0) } } + + @objc + public init(limit: NSNumber, actions: [DBXSharingFileAction]?) { + self.swift = Sharing.ListFilesArg(limit: limit.uint32Value, actions: actions?.map(\.swift)) + } + + let swift: Sharing.ListFilesArg + + public init(swift: Sharing.ListFilesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for listReceivedFilesContinue. +@objc +public class DBXSharingListFilesContinueArg: NSObject { + /// Cursor in cursor in ListFilesResult. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Sharing.ListFilesContinueArg(cursor: cursor) + } + + let swift: Sharing.ListFilesContinueArg + + public init(swift: Sharing.ListFilesContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error results for listReceivedFilesContinue. +@objc +public class DBXSharingListFilesContinueError: NSObject { + let swift: Sharing.ListFilesContinueError + + public init(swift: Sharing.ListFilesContinueError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ListFilesContinueError) -> DBXSharingListFilesContinueError { + switch swift { + case .userError(let swiftArg): + let arg = DBXSharingSharingUserError(swift: swiftArg) + return DBXSharingListFilesContinueErrorUserError(arg) + case .invalidCursor: + return DBXSharingListFilesContinueErrorInvalidCursor() + case .other: + return DBXSharingListFilesContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserError: DBXSharingListFilesContinueErrorUserError? { + self as? DBXSharingListFilesContinueErrorUserError + } + + @objc + public var asInvalidCursor: DBXSharingListFilesContinueErrorInvalidCursor? { + self as? DBXSharingListFilesContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXSharingListFilesContinueErrorOther? { + self as? DBXSharingListFilesContinueErrorOther + } +} + +/// User account had a problem. +@objc +public class DBXSharingListFilesContinueErrorUserError: DBXSharingListFilesContinueError { + @objc + public var userError: DBXSharingSharingUserError + + @objc + public init(_ arg: DBXSharingSharingUserError) { + self.userError = arg + let swift = Sharing.ListFilesContinueError.userError(arg.swift) + super.init(swift: swift) + } +} + +/// cursor in ListFilesContinueArg is invalid. +@objc +public class DBXSharingListFilesContinueErrorInvalidCursor: DBXSharingListFilesContinueError { + @objc + public init() { + let swift = Sharing.ListFilesContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFilesContinueErrorOther: DBXSharingListFilesContinueError { + @objc + public init() { + let swift = Sharing.ListFilesContinueError.other + super.init(swift: swift) + } +} + +/// Success results for listReceivedFiles. +@objc +public class DBXSharingListFilesResult: NSObject { + /// Information about the files shared with current user. + @objc + public var entries: [DBXSharingSharedFileMetadata] { swift.entries.map { DBXSharingSharedFileMetadata(swift: $0) } } + /// Cursor used to obtain additional shared files. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(entries: [DBXSharingSharedFileMetadata], cursor: String?) { + self.swift = Sharing.ListFilesResult(entries: entries.map(\.swift), cursor: cursor) + } + + let swift: Sharing.ListFilesResult + + public init(swift: Sharing.ListFilesResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderMembersCursorArg struct +@objc +public class DBXSharingListFolderMembersCursorArg: NSObject { + /// This is a list indicating whether each returned member will include a boolean value allow in + /// MemberPermission that describes whether the current user can perform the MemberAction on the member. + @objc + public var actions: [DBXSharingMemberAction]? { swift.actions?.map { DBXSharingMemberAction(swift: $0) } } + /// The maximum number of results that include members, groups and invitees to return per request. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(actions: [DBXSharingMemberAction]?, limit: NSNumber) { + self.swift = Sharing.ListFolderMembersCursorArg(actions: actions?.map(\.swift), limit: limit.uint32Value) + } + + let swift: Sharing.ListFolderMembersCursorArg + + public init(swift: Sharing.ListFolderMembersCursorArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderMembersArgs struct +@objc +public class DBXSharingListFolderMembersArgs: DBXSharingListFolderMembersCursorArg { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { subSwift.sharedFolderId } + + @objc + public init(sharedFolderId: String, actions: [DBXSharingMemberAction]?, limit: NSNumber) { + let swift = Sharing.ListFolderMembersArgs(sharedFolderId: sharedFolderId, actions: actions?.map(\.swift), limit: limit.uint32Value) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.ListFolderMembersArgs + + public init(swift: Sharing.ListFolderMembersArgs) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible ListFolderMembersContinueArg struct +@objc +public class DBXSharingListFolderMembersContinueArg: NSObject { + /// The cursor returned by your last call to listFolderMembers or listFolderMembersContinue. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Sharing.ListFolderMembersContinueArg(cursor: cursor) + } + + let swift: Sharing.ListFolderMembersContinueArg + + public init(swift: Sharing.ListFolderMembersContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFolderMembersContinueError union +@objc +public class DBXSharingListFolderMembersContinueError: NSObject { + let swift: Sharing.ListFolderMembersContinueError + + public init(swift: Sharing.ListFolderMembersContinueError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ListFolderMembersContinueError) -> DBXSharingListFolderMembersContinueError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingListFolderMembersContinueErrorAccessError(arg) + case .invalidCursor: + return DBXSharingListFolderMembersContinueErrorInvalidCursor() + case .other: + return DBXSharingListFolderMembersContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingListFolderMembersContinueErrorAccessError? { + self as? DBXSharingListFolderMembersContinueErrorAccessError + } + + @objc + public var asInvalidCursor: DBXSharingListFolderMembersContinueErrorInvalidCursor? { + self as? DBXSharingListFolderMembersContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXSharingListFolderMembersContinueErrorOther? { + self as? DBXSharingListFolderMembersContinueErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFolderMembersContinueErrorAccessError: DBXSharingListFolderMembersContinueError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.ListFolderMembersContinueError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// cursor in ListFolderMembersContinueArg is invalid. +@objc +public class DBXSharingListFolderMembersContinueErrorInvalidCursor: DBXSharingListFolderMembersContinueError { + @objc + public init() { + let swift = Sharing.ListFolderMembersContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFolderMembersContinueErrorOther: DBXSharingListFolderMembersContinueError { + @objc + public init() { + let swift = Sharing.ListFolderMembersContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListFoldersArgs struct +@objc +public class DBXSharingListFoldersArgs: NSObject { + /// The maximum number of results to return per request. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on + /// the folder. + @objc + public var actions: [DBXSharingFolderAction]? { swift.actions?.map { DBXSharingFolderAction(swift: $0) } } + + @objc + public init(limit: NSNumber, actions: [DBXSharingFolderAction]?) { + self.swift = Sharing.ListFoldersArgs(limit: limit.uint32Value, actions: actions?.map(\.swift)) + } + + let swift: Sharing.ListFoldersArgs + + public init(swift: Sharing.ListFoldersArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFoldersContinueArg struct +@objc +public class DBXSharingListFoldersContinueArg: NSObject { + /// The cursor returned by the previous API call specified in the endpoint description. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Sharing.ListFoldersContinueArg(cursor: cursor) + } + + let swift: Sharing.ListFoldersContinueArg + + public init(swift: Sharing.ListFoldersContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListFoldersContinueError union +@objc +public class DBXSharingListFoldersContinueError: NSObject { + let swift: Sharing.ListFoldersContinueError + + public init(swift: Sharing.ListFoldersContinueError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ListFoldersContinueError) -> DBXSharingListFoldersContinueError { + switch swift { + case .invalidCursor: + return DBXSharingListFoldersContinueErrorInvalidCursor() + case .other: + return DBXSharingListFoldersContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidCursor: DBXSharingListFoldersContinueErrorInvalidCursor? { + self as? DBXSharingListFoldersContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXSharingListFoldersContinueErrorOther? { + self as? DBXSharingListFoldersContinueErrorOther + } +} + +/// cursor in ListFoldersContinueArg is invalid. +@objc +public class DBXSharingListFoldersContinueErrorInvalidCursor: DBXSharingListFoldersContinueError { + @objc + public init() { + let swift = Sharing.ListFoldersContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListFoldersContinueErrorOther: DBXSharingListFoldersContinueError { + @objc + public init() { + let swift = Sharing.ListFoldersContinueError.other + super.init(swift: swift) + } +} + +/// Result for listFolders or listMountableFolders, depending on which endpoint was requested. Unmounted shared +/// folders can be identified by the absence of pathLower in SharedFolderMetadata. +@objc +public class DBXSharingListFoldersResult: NSObject { + /// List of all shared folders the authenticated user has access to. + @objc + public var entries: [DBXSharingSharedFolderMetadata] { swift.entries.map { DBXSharingSharedFolderMetadata(swift: $0) } } + /// Present if there are additional shared folders that have not been returned yet. Pass the cursor into the + /// corresponding continue endpoint (either listFoldersContinue or listMountableFoldersContinue) to list + /// additional folders. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(entries: [DBXSharingSharedFolderMetadata], cursor: String?) { + self.swift = Sharing.ListFoldersResult(entries: entries.map(\.subSwift), cursor: cursor) + } + + let swift: Sharing.ListFoldersResult + + public init(swift: Sharing.ListFoldersResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListSharedLinksArg struct +@objc +public class DBXSharingListSharedLinksArg: NSObject { + /// See listSharedLinks description. + @objc + public var path: String? { swift.path } + /// The cursor returned by your last call to listSharedLinks. + @objc + public var cursor: String? { swift.cursor } + /// See listSharedLinks description. + @objc + public var directOnly: NSNumber? { swift.directOnly as NSNumber? } + + @objc + public init(path: String?, cursor: String?, directOnly: NSNumber?) { + self.swift = Sharing.ListSharedLinksArg(path: path, cursor: cursor, directOnly: directOnly?.boolValue) + } + + let swift: Sharing.ListSharedLinksArg + + public init(swift: Sharing.ListSharedLinksArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListSharedLinksError union +@objc +public class DBXSharingListSharedLinksError: NSObject { + let swift: Sharing.ListSharedLinksError + + public init(swift: Sharing.ListSharedLinksError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ListSharedLinksError) -> DBXSharingListSharedLinksError { + switch swift { + case .path(let swiftArg): + let arg = DBXFilesLookupError(swift: swiftArg) + return DBXSharingListSharedLinksErrorPath(arg) + case .reset: + return DBXSharingListSharedLinksErrorReset() + case .other: + return DBXSharingListSharedLinksErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPath: DBXSharingListSharedLinksErrorPath? { + self as? DBXSharingListSharedLinksErrorPath + } + + @objc + public var asReset: DBXSharingListSharedLinksErrorReset? { + self as? DBXSharingListSharedLinksErrorReset + } + + @objc + public var asOther: DBXSharingListSharedLinksErrorOther? { + self as? DBXSharingListSharedLinksErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingListSharedLinksErrorPath: DBXSharingListSharedLinksError { + @objc + public var path: DBXFilesLookupError + + @objc + public init(_ arg: DBXFilesLookupError) { + self.path = arg + let swift = Sharing.ListSharedLinksError.path(arg.swift) + super.init(swift: swift) + } +} + +/// Indicates that the cursor has been invalidated. Call listSharedLinks to obtain a new cursor. +@objc +public class DBXSharingListSharedLinksErrorReset: DBXSharingListSharedLinksError { + @objc + public init() { + let swift = Sharing.ListSharedLinksError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingListSharedLinksErrorOther: DBXSharingListSharedLinksError { + @objc + public init() { + let swift = Sharing.ListSharedLinksError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListSharedLinksResult struct +@objc +public class DBXSharingListSharedLinksResult: NSObject { + /// Shared links applicable to the path argument. + @objc + public var links: [DBXSharingSharedLinkMetadata] { swift.links.map { DBXSharingSharedLinkMetadata(swift: $0) } } + /// Is true if there are additional shared links that have not been returned yet. Pass the cursor into + /// listSharedLinks to retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + /// Pass the cursor into listSharedLinks to obtain the additional links. Cursor is returned only if no path is + /// given. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(links: [DBXSharingSharedLinkMetadata], hasMore: NSNumber, cursor: String?) { + self.swift = Sharing.ListSharedLinksResult(links: links.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Sharing.ListSharedLinksResult + + public init(swift: Sharing.ListSharedLinksResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Contains information about a member's access level to content after an operation. +@objc +public class DBXSharingMemberAccessLevelResult: NSObject { + /// The member still has this level of access to the content through a parent folder. + @objc + public var accessLevel: DBXSharingAccessLevel? { guard let swift = swift.accessLevel else { return nil } + return DBXSharingAccessLevel(swift: swift) + } + + /// A localized string with additional information about why the user has this access level to the content. + @objc + public var warning: String? { swift.warning } + /// The parent folders that a member has access to. The field is present if the user has access to the first + /// parent folder where the member gains access. + @objc + public var accessDetails: [DBXSharingParentFolderAccessInfo]? { swift.accessDetails?.map { DBXSharingParentFolderAccessInfo(swift: $0) } } + + @objc + public init(accessLevel: DBXSharingAccessLevel?, warning: String?, accessDetails: [DBXSharingParentFolderAccessInfo]?) { + self.swift = Sharing.MemberAccessLevelResult(accessLevel: accessLevel?.swift, warning: warning, accessDetails: accessDetails?.map(\.swift)) + } + + let swift: Sharing.MemberAccessLevelResult + + public init(swift: Sharing.MemberAccessLevelResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Actions that may be taken on members of a shared folder. +@objc +public class DBXSharingMemberAction: NSObject { + let swift: Sharing.MemberAction + + public init(swift: Sharing.MemberAction) { + self.swift = swift + } + + public static func factory(swift: Sharing.MemberAction) -> DBXSharingMemberAction { + switch swift { + case .leaveACopy: + return DBXSharingMemberActionLeaveACopy() + case .makeEditor: + return DBXSharingMemberActionMakeEditor() + case .makeOwner: + return DBXSharingMemberActionMakeOwner() + case .makeViewer: + return DBXSharingMemberActionMakeViewer() + case .makeViewerNoComment: + return DBXSharingMemberActionMakeViewerNoComment() + case .remove: + return DBXSharingMemberActionRemove() + case .other: + return DBXSharingMemberActionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asLeaveACopy: DBXSharingMemberActionLeaveACopy? { + self as? DBXSharingMemberActionLeaveACopy + } + + @objc + public var asMakeEditor: DBXSharingMemberActionMakeEditor? { + self as? DBXSharingMemberActionMakeEditor + } + + @objc + public var asMakeOwner: DBXSharingMemberActionMakeOwner? { + self as? DBXSharingMemberActionMakeOwner + } + + @objc + public var asMakeViewer: DBXSharingMemberActionMakeViewer? { + self as? DBXSharingMemberActionMakeViewer + } + + @objc + public var asMakeViewerNoComment: DBXSharingMemberActionMakeViewerNoComment? { + self as? DBXSharingMemberActionMakeViewerNoComment + } + + @objc + public var asRemove: DBXSharingMemberActionRemove? { + self as? DBXSharingMemberActionRemove + } + + @objc + public var asOther: DBXSharingMemberActionOther? { + self as? DBXSharingMemberActionOther + } +} + +/// Allow the member to keep a copy of the folder when removing. +@objc +public class DBXSharingMemberActionLeaveACopy: DBXSharingMemberAction { + @objc + public init() { + let swift = Sharing.MemberAction.leaveACopy + super.init(swift: swift) + } +} + +/// Make the member an editor of the folder. +@objc +public class DBXSharingMemberActionMakeEditor: DBXSharingMemberAction { + @objc + public init() { + let swift = Sharing.MemberAction.makeEditor + super.init(swift: swift) + } +} + +/// Make the member an owner of the folder. +@objc +public class DBXSharingMemberActionMakeOwner: DBXSharingMemberAction { + @objc + public init() { + let swift = Sharing.MemberAction.makeOwner + super.init(swift: swift) + } +} + +/// Make the member a viewer of the folder. +@objc +public class DBXSharingMemberActionMakeViewer: DBXSharingMemberAction { + @objc + public init() { + let swift = Sharing.MemberAction.makeViewer + super.init(swift: swift) + } +} + +/// Make the member a viewer of the folder without commenting permissions. +@objc +public class DBXSharingMemberActionMakeViewerNoComment: DBXSharingMemberAction { + @objc + public init() { + let swift = Sharing.MemberAction.makeViewerNoComment + super.init(swift: swift) + } +} + +/// Remove the member from the folder. +@objc +public class DBXSharingMemberActionRemove: DBXSharingMemberAction { + @objc + public init() { + let swift = Sharing.MemberAction.remove + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingMemberActionOther: DBXSharingMemberAction { + @objc + public init() { + let swift = Sharing.MemberAction.other + super.init(swift: swift) + } +} + +/// Whether the user is allowed to take the action on the associated member. +@objc +public class DBXSharingMemberPermission: NSObject { + /// The action that the user may wish to take on the member. + @objc + public var action: DBXSharingMemberAction { DBXSharingMemberAction(swift: swift.action) } + /// True if the user is allowed to take the action. + @objc + public var allow: NSNumber { swift.allow as NSNumber } + /// The reason why the user is denied the permission. Not present if the action is allowed. + @objc + public var reason: DBXSharingPermissionDeniedReason? { guard let swift = swift.reason else { return nil } + return DBXSharingPermissionDeniedReason(swift: swift) + } + + @objc + public init(action: DBXSharingMemberAction, allow: NSNumber, reason: DBXSharingPermissionDeniedReason?) { + self.swift = Sharing.MemberPermission(action: action.swift, allow: allow.boolValue, reason: reason?.swift) + } + + let swift: Sharing.MemberPermission + + public init(swift: Sharing.MemberPermission) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy governing who can be a member of a shared folder. Only applicable to folders owned by a user on a team. +@objc +public class DBXSharingMemberPolicy: NSObject { + let swift: Sharing.MemberPolicy + + public init(swift: Sharing.MemberPolicy) { + self.swift = swift + } + + public static func factory(swift: Sharing.MemberPolicy) -> DBXSharingMemberPolicy { + switch swift { + case .team: + return DBXSharingMemberPolicyTeam() + case .anyone: + return DBXSharingMemberPolicyAnyone() + case .other: + return DBXSharingMemberPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeam: DBXSharingMemberPolicyTeam? { + self as? DBXSharingMemberPolicyTeam + } + + @objc + public var asAnyone: DBXSharingMemberPolicyAnyone? { + self as? DBXSharingMemberPolicyAnyone + } + + @objc + public var asOther: DBXSharingMemberPolicyOther? { + self as? DBXSharingMemberPolicyOther + } +} + +/// Only a teammate can become a member. +@objc +public class DBXSharingMemberPolicyTeam: DBXSharingMemberPolicy { + @objc + public init() { + let swift = Sharing.MemberPolicy.team + super.init(swift: swift) + } +} + +/// Anyone can become a member. +@objc +public class DBXSharingMemberPolicyAnyone: DBXSharingMemberPolicy { + @objc + public init() { + let swift = Sharing.MemberPolicy.anyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingMemberPolicyOther: DBXSharingMemberPolicy { + @objc + public init() { + let swift = Sharing.MemberPolicy.other + super.init(swift: swift) + } +} + +/// Includes different ways to identify a member of a shared folder. +@objc +public class DBXSharingMemberSelector: NSObject { + let swift: Sharing.MemberSelector + + public init(swift: Sharing.MemberSelector) { + self.swift = swift + } + + public static func factory(swift: Sharing.MemberSelector) -> DBXSharingMemberSelector { + switch swift { + case .dropboxId(let swiftArg): + let arg = swiftArg + return DBXSharingMemberSelectorDropboxId(arg) + case .email(let swiftArg): + let arg = swiftArg + return DBXSharingMemberSelectorEmail(arg) + case .other: + return DBXSharingMemberSelectorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDropboxId: DBXSharingMemberSelectorDropboxId? { + self as? DBXSharingMemberSelectorDropboxId + } + + @objc + public var asEmail: DBXSharingMemberSelectorEmail? { + self as? DBXSharingMemberSelectorEmail + } + + @objc + public var asOther: DBXSharingMemberSelectorOther? { + self as? DBXSharingMemberSelectorOther + } +} + +/// Dropbox account, team member, or group ID of member. +@objc +public class DBXSharingMemberSelectorDropboxId: DBXSharingMemberSelector { + @objc + public var dropboxId: String + + @objc + public init(_ arg: String) { + self.dropboxId = arg + let swift = Sharing.MemberSelector.dropboxId(arg) + super.init(swift: swift) + } +} + +/// Email address of member. +@objc +public class DBXSharingMemberSelectorEmail: DBXSharingMemberSelector { + @objc + public var email: String + + @objc + public init(_ arg: String) { + self.email = arg + let swift = Sharing.MemberSelector.email(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingMemberSelectorOther: DBXSharingMemberSelector { + @objc + public init() { + let swift = Sharing.MemberSelector.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ModifySharedLinkSettingsArgs struct +@objc +public class DBXSharingModifySharedLinkSettingsArgs: NSObject { + /// URL of the shared link to change its settings. + @objc + public var url: String { swift.url } + /// Set of settings for the shared link. + @objc + public var settings: DBXSharingSharedLinkSettings { DBXSharingSharedLinkSettings(swift: swift.settings) } + /// If set to true, removes the expiration of the shared link. + @objc + public var removeExpiration: NSNumber { swift.removeExpiration as NSNumber } + + @objc + public init(url: String, settings: DBXSharingSharedLinkSettings, removeExpiration: NSNumber) { + self.swift = Sharing.ModifySharedLinkSettingsArgs(url: url, settings: settings.swift, removeExpiration: removeExpiration.boolValue) + } + + let swift: Sharing.ModifySharedLinkSettingsArgs + + public init(swift: Sharing.ModifySharedLinkSettingsArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ModifySharedLinkSettingsError union +@objc +public class DBXSharingModifySharedLinkSettingsError: NSObject { + let swift: Sharing.ModifySharedLinkSettingsError + + public init(swift: Sharing.ModifySharedLinkSettingsError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ModifySharedLinkSettingsError) -> DBXSharingModifySharedLinkSettingsError { + switch swift { + case .sharedLinkNotFound: + return DBXSharingModifySharedLinkSettingsErrorSharedLinkNotFound() + case .sharedLinkAccessDenied: + return DBXSharingModifySharedLinkSettingsErrorSharedLinkAccessDenied() + case .unsupportedLinkType: + return DBXSharingModifySharedLinkSettingsErrorUnsupportedLinkType() + case .other: + return DBXSharingModifySharedLinkSettingsErrorOther() + case .settingsError(let swiftArg): + let arg = DBXSharingSharedLinkSettingsError(swift: swiftArg) + return DBXSharingModifySharedLinkSettingsErrorSettingsError(arg) + case .emailNotVerified: + return DBXSharingModifySharedLinkSettingsErrorEmailNotVerified() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSharedLinkNotFound: DBXSharingModifySharedLinkSettingsErrorSharedLinkNotFound? { + self as? DBXSharingModifySharedLinkSettingsErrorSharedLinkNotFound + } + + @objc + public var asSharedLinkAccessDenied: DBXSharingModifySharedLinkSettingsErrorSharedLinkAccessDenied? { + self as? DBXSharingModifySharedLinkSettingsErrorSharedLinkAccessDenied + } + + @objc + public var asUnsupportedLinkType: DBXSharingModifySharedLinkSettingsErrorUnsupportedLinkType? { + self as? DBXSharingModifySharedLinkSettingsErrorUnsupportedLinkType + } + + @objc + public var asOther: DBXSharingModifySharedLinkSettingsErrorOther? { + self as? DBXSharingModifySharedLinkSettingsErrorOther + } + + @objc + public var asSettingsError: DBXSharingModifySharedLinkSettingsErrorSettingsError? { + self as? DBXSharingModifySharedLinkSettingsErrorSettingsError + } + + @objc + public var asEmailNotVerified: DBXSharingModifySharedLinkSettingsErrorEmailNotVerified? { + self as? DBXSharingModifySharedLinkSettingsErrorEmailNotVerified + } +} + +/// The shared link wasn't found. +@objc +public class DBXSharingModifySharedLinkSettingsErrorSharedLinkNotFound: DBXSharingModifySharedLinkSettingsError { + @objc + public init() { + let swift = Sharing.ModifySharedLinkSettingsError.sharedLinkNotFound + super.init(swift: swift) + } +} + +/// The caller is not allowed to access this shared link. +@objc +public class DBXSharingModifySharedLinkSettingsErrorSharedLinkAccessDenied: DBXSharingModifySharedLinkSettingsError { + @objc + public init() { + let swift = Sharing.ModifySharedLinkSettingsError.sharedLinkAccessDenied + super.init(swift: swift) + } +} + +/// This type of link is not supported; use files instead. +@objc +public class DBXSharingModifySharedLinkSettingsErrorUnsupportedLinkType: DBXSharingModifySharedLinkSettingsError { + @objc + public init() { + let swift = Sharing.ModifySharedLinkSettingsError.unsupportedLinkType + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingModifySharedLinkSettingsErrorOther: DBXSharingModifySharedLinkSettingsError { + @objc + public init() { + let swift = Sharing.ModifySharedLinkSettingsError.other + super.init(swift: swift) + } +} + +/// There is an error with the given settings. +@objc +public class DBXSharingModifySharedLinkSettingsErrorSettingsError: DBXSharingModifySharedLinkSettingsError { + @objc + public var settingsError: DBXSharingSharedLinkSettingsError + + @objc + public init(_ arg: DBXSharingSharedLinkSettingsError) { + self.settingsError = arg + let swift = Sharing.ModifySharedLinkSettingsError.settingsError(arg.swift) + super.init(swift: swift) + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXSharingModifySharedLinkSettingsErrorEmailNotVerified: DBXSharingModifySharedLinkSettingsError { + @objc + public init() { + let swift = Sharing.ModifySharedLinkSettingsError.emailNotVerified + super.init(swift: swift) + } +} + +/// Objective-C compatible MountFolderArg struct +@objc +public class DBXSharingMountFolderArg: NSObject { + /// The ID of the shared folder to mount. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + + @objc + public init(sharedFolderId: String) { + self.swift = Sharing.MountFolderArg(sharedFolderId: sharedFolderId) + } + + let swift: Sharing.MountFolderArg + + public init(swift: Sharing.MountFolderArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MountFolderError union +@objc +public class DBXSharingMountFolderError: NSObject { + let swift: Sharing.MountFolderError + + public init(swift: Sharing.MountFolderError) { + self.swift = swift + } + + public static func factory(swift: Sharing.MountFolderError) -> DBXSharingMountFolderError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingMountFolderErrorAccessError(arg) + case .insideSharedFolder: + return DBXSharingMountFolderErrorInsideSharedFolder() + case .insufficientQuota(let swiftArg): + let arg = DBXSharingInsufficientQuotaAmounts(swift: swiftArg) + return DBXSharingMountFolderErrorInsufficientQuota(arg) + case .alreadyMounted: + return DBXSharingMountFolderErrorAlreadyMounted() + case .noPermission: + return DBXSharingMountFolderErrorNoPermission() + case .notMountable: + return DBXSharingMountFolderErrorNotMountable() + case .other: + return DBXSharingMountFolderErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingMountFolderErrorAccessError? { + self as? DBXSharingMountFolderErrorAccessError + } + + @objc + public var asInsideSharedFolder: DBXSharingMountFolderErrorInsideSharedFolder? { + self as? DBXSharingMountFolderErrorInsideSharedFolder + } + + @objc + public var asInsufficientQuota: DBXSharingMountFolderErrorInsufficientQuota? { + self as? DBXSharingMountFolderErrorInsufficientQuota + } + + @objc + public var asAlreadyMounted: DBXSharingMountFolderErrorAlreadyMounted? { + self as? DBXSharingMountFolderErrorAlreadyMounted + } + + @objc + public var asNoPermission: DBXSharingMountFolderErrorNoPermission? { + self as? DBXSharingMountFolderErrorNoPermission + } + + @objc + public var asNotMountable: DBXSharingMountFolderErrorNotMountable? { + self as? DBXSharingMountFolderErrorNotMountable + } + + @objc + public var asOther: DBXSharingMountFolderErrorOther? { + self as? DBXSharingMountFolderErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingMountFolderErrorAccessError: DBXSharingMountFolderError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.MountFolderError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// Mounting would cause a shared folder to be inside another, which is disallowed. +@objc +public class DBXSharingMountFolderErrorInsideSharedFolder: DBXSharingMountFolderError { + @objc + public init() { + let swift = Sharing.MountFolderError.insideSharedFolder + super.init(swift: swift) + } +} + +/// The current user does not have enough space to mount the shared folder. +@objc +public class DBXSharingMountFolderErrorInsufficientQuota: DBXSharingMountFolderError { + @objc + public var insufficientQuota: DBXSharingInsufficientQuotaAmounts + + @objc + public init(_ arg: DBXSharingInsufficientQuotaAmounts) { + self.insufficientQuota = arg + let swift = Sharing.MountFolderError.insufficientQuota(arg.swift) + super.init(swift: swift) + } +} + +/// The shared folder is already mounted. +@objc +public class DBXSharingMountFolderErrorAlreadyMounted: DBXSharingMountFolderError { + @objc + public init() { + let swift = Sharing.MountFolderError.alreadyMounted + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingMountFolderErrorNoPermission: DBXSharingMountFolderError { + @objc + public init() { + let swift = Sharing.MountFolderError.noPermission + super.init(swift: swift) + } +} + +/// The shared folder is not mountable. One example where this can occur is when the shared folder belongs +/// within a team folder in the user's Dropbox. +@objc +public class DBXSharingMountFolderErrorNotMountable: DBXSharingMountFolderError { + @objc + public init() { + let swift = Sharing.MountFolderError.notMountable + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingMountFolderErrorOther: DBXSharingMountFolderError { + @objc + public init() { + let swift = Sharing.MountFolderError.other + super.init(swift: swift) + } +} + +/// Contains information about a parent folder that a member has access to. +@objc +public class DBXSharingParentFolderAccessInfo: NSObject { + /// Display name for the folder. + @objc + public var folderName: String { swift.folderName } + /// The identifier of the parent shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// The user's permissions for the parent shared folder. + @objc + public var permissions: [DBXSharingMemberPermission] { swift.permissions.map { DBXSharingMemberPermission(swift: $0) } } + /// The full path to the parent shared folder relative to the acting user's root. + @objc + public var path: String { swift.path } + + @objc + public init(folderName: String, sharedFolderId: String, permissions: [DBXSharingMemberPermission], path: String) { + self.swift = Sharing.ParentFolderAccessInfo(folderName: folderName, sharedFolderId: sharedFolderId, permissions: permissions.map(\.swift), path: path) + } + + let swift: Sharing.ParentFolderAccessInfo + + public init(swift: Sharing.ParentFolderAccessInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Metadata for a path-based shared link. +@objc +public class DBXSharingPathLinkMetadata: DBXSharingLinkMetadata { + /// Path in user's Dropbox. + @objc + public var path: String { subSwift.path } + + @objc + public init(url: String, visibility: DBXSharingVisibility, path: String, expires: Date?) { + let swift = Sharing.PathLinkMetadata(url: url, visibility: visibility.swift, path: path, expires: expires) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.PathLinkMetadata + + public init(swift: Sharing.PathLinkMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Flag to indicate pending upload default (for linking to not-yet-existing paths). +@objc +public class DBXSharingPendingUploadMode: NSObject { + let swift: Sharing.PendingUploadMode + + public init(swift: Sharing.PendingUploadMode) { + self.swift = swift + } + + public static func factory(swift: Sharing.PendingUploadMode) -> DBXSharingPendingUploadMode { + switch swift { + case .file: + return DBXSharingPendingUploadModeFile() + case .folder: + return DBXSharingPendingUploadModeFolder() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFile: DBXSharingPendingUploadModeFile? { + self as? DBXSharingPendingUploadModeFile + } + + @objc + public var asFolder: DBXSharingPendingUploadModeFolder? { + self as? DBXSharingPendingUploadModeFolder + } +} + +/// Assume pending uploads are files. +@objc +public class DBXSharingPendingUploadModeFile: DBXSharingPendingUploadMode { + @objc + public init() { + let swift = Sharing.PendingUploadMode.file + super.init(swift: swift) + } +} + +/// Assume pending uploads are folders. +@objc +public class DBXSharingPendingUploadModeFolder: DBXSharingPendingUploadMode { + @objc + public init() { + let swift = Sharing.PendingUploadMode.folder + super.init(swift: swift) + } +} + +/// Possible reasons the user is denied a permission. +@objc +public class DBXSharingPermissionDeniedReason: NSObject { + let swift: Sharing.PermissionDeniedReason + + public init(swift: Sharing.PermissionDeniedReason) { + self.swift = swift + } + + public static func factory(swift: Sharing.PermissionDeniedReason) -> DBXSharingPermissionDeniedReason { + switch swift { + case .userNotSameTeamAsOwner: + return DBXSharingPermissionDeniedReasonUserNotSameTeamAsOwner() + case .userNotAllowedByOwner: + return DBXSharingPermissionDeniedReasonUserNotAllowedByOwner() + case .targetIsIndirectMember: + return DBXSharingPermissionDeniedReasonTargetIsIndirectMember() + case .targetIsOwner: + return DBXSharingPermissionDeniedReasonTargetIsOwner() + case .targetIsSelf: + return DBXSharingPermissionDeniedReasonTargetIsSelf() + case .targetNotActive: + return DBXSharingPermissionDeniedReasonTargetNotActive() + case .folderIsLimitedTeamFolder: + return DBXSharingPermissionDeniedReasonFolderIsLimitedTeamFolder() + case .ownerNotOnTeam: + return DBXSharingPermissionDeniedReasonOwnerNotOnTeam() + case .permissionDenied: + return DBXSharingPermissionDeniedReasonPermissionDenied() + case .restrictedByTeam: + return DBXSharingPermissionDeniedReasonRestrictedByTeam() + case .userAccountType: + return DBXSharingPermissionDeniedReasonUserAccountType() + case .userNotOnTeam: + return DBXSharingPermissionDeniedReasonUserNotOnTeam() + case .folderIsInsideSharedFolder: + return DBXSharingPermissionDeniedReasonFolderIsInsideSharedFolder() + case .restrictedByParentFolder: + return DBXSharingPermissionDeniedReasonRestrictedByParentFolder() + case .insufficientPlan(let swiftArg): + let arg = DBXSharingInsufficientPlan(swift: swiftArg) + return DBXSharingPermissionDeniedReasonInsufficientPlan(arg) + case .other: + return DBXSharingPermissionDeniedReasonOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotSameTeamAsOwner: DBXSharingPermissionDeniedReasonUserNotSameTeamAsOwner? { + self as? DBXSharingPermissionDeniedReasonUserNotSameTeamAsOwner + } + + @objc + public var asUserNotAllowedByOwner: DBXSharingPermissionDeniedReasonUserNotAllowedByOwner? { + self as? DBXSharingPermissionDeniedReasonUserNotAllowedByOwner + } + + @objc + public var asTargetIsIndirectMember: DBXSharingPermissionDeniedReasonTargetIsIndirectMember? { + self as? DBXSharingPermissionDeniedReasonTargetIsIndirectMember + } + + @objc + public var asTargetIsOwner: DBXSharingPermissionDeniedReasonTargetIsOwner? { + self as? DBXSharingPermissionDeniedReasonTargetIsOwner + } + + @objc + public var asTargetIsSelf: DBXSharingPermissionDeniedReasonTargetIsSelf? { + self as? DBXSharingPermissionDeniedReasonTargetIsSelf + } + + @objc + public var asTargetNotActive: DBXSharingPermissionDeniedReasonTargetNotActive? { + self as? DBXSharingPermissionDeniedReasonTargetNotActive + } + + @objc + public var asFolderIsLimitedTeamFolder: DBXSharingPermissionDeniedReasonFolderIsLimitedTeamFolder? { + self as? DBXSharingPermissionDeniedReasonFolderIsLimitedTeamFolder + } + + @objc + public var asOwnerNotOnTeam: DBXSharingPermissionDeniedReasonOwnerNotOnTeam? { + self as? DBXSharingPermissionDeniedReasonOwnerNotOnTeam + } + + @objc + public var asPermissionDenied: DBXSharingPermissionDeniedReasonPermissionDenied? { + self as? DBXSharingPermissionDeniedReasonPermissionDenied + } + + @objc + public var asRestrictedByTeam: DBXSharingPermissionDeniedReasonRestrictedByTeam? { + self as? DBXSharingPermissionDeniedReasonRestrictedByTeam + } + + @objc + public var asUserAccountType: DBXSharingPermissionDeniedReasonUserAccountType? { + self as? DBXSharingPermissionDeniedReasonUserAccountType + } + + @objc + public var asUserNotOnTeam: DBXSharingPermissionDeniedReasonUserNotOnTeam? { + self as? DBXSharingPermissionDeniedReasonUserNotOnTeam + } + + @objc + public var asFolderIsInsideSharedFolder: DBXSharingPermissionDeniedReasonFolderIsInsideSharedFolder? { + self as? DBXSharingPermissionDeniedReasonFolderIsInsideSharedFolder + } + + @objc + public var asRestrictedByParentFolder: DBXSharingPermissionDeniedReasonRestrictedByParentFolder? { + self as? DBXSharingPermissionDeniedReasonRestrictedByParentFolder + } + + @objc + public var asInsufficientPlan: DBXSharingPermissionDeniedReasonInsufficientPlan? { + self as? DBXSharingPermissionDeniedReasonInsufficientPlan + } + + @objc + public var asOther: DBXSharingPermissionDeniedReasonOther? { + self as? DBXSharingPermissionDeniedReasonOther + } +} + +/// User is not on the same team as the folder owner. +@objc +public class DBXSharingPermissionDeniedReasonUserNotSameTeamAsOwner: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.userNotSameTeamAsOwner + super.init(swift: swift) + } +} + +/// User is prohibited by the owner from taking the action. +@objc +public class DBXSharingPermissionDeniedReasonUserNotAllowedByOwner: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.userNotAllowedByOwner + super.init(swift: swift) + } +} + +/// Target is indirectly a member of the folder, for example by being part of a group. +@objc +public class DBXSharingPermissionDeniedReasonTargetIsIndirectMember: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.targetIsIndirectMember + super.init(swift: swift) + } +} + +/// Target is the owner of the folder. +@objc +public class DBXSharingPermissionDeniedReasonTargetIsOwner: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.targetIsOwner + super.init(swift: swift) + } +} + +/// Target is the user itself. +@objc +public class DBXSharingPermissionDeniedReasonTargetIsSelf: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.targetIsSelf + super.init(swift: swift) + } +} + +/// Target is not an active member of the team. +@objc +public class DBXSharingPermissionDeniedReasonTargetNotActive: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.targetNotActive + super.init(swift: swift) + } +} + +/// Folder is team folder for a limited team. +@objc +public class DBXSharingPermissionDeniedReasonFolderIsLimitedTeamFolder: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.folderIsLimitedTeamFolder + super.init(swift: swift) + } +} + +/// The content owner needs to be on a Dropbox team to perform this action. +@objc +public class DBXSharingPermissionDeniedReasonOwnerNotOnTeam: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.ownerNotOnTeam + super.init(swift: swift) + } +} + +/// The user does not have permission to perform this action on the link. +@objc +public class DBXSharingPermissionDeniedReasonPermissionDenied: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.permissionDenied + super.init(swift: swift) + } +} + +/// The user's team policy prevents performing this action on the link. +@objc +public class DBXSharingPermissionDeniedReasonRestrictedByTeam: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.restrictedByTeam + super.init(swift: swift) + } +} + +/// The user's account type does not support this action. +@objc +public class DBXSharingPermissionDeniedReasonUserAccountType: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.userAccountType + super.init(swift: swift) + } +} + +/// The user needs to be on a Dropbox team to perform this action. +@objc +public class DBXSharingPermissionDeniedReasonUserNotOnTeam: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.userNotOnTeam + super.init(swift: swift) + } +} + +/// Folder is inside of another shared folder. +@objc +public class DBXSharingPermissionDeniedReasonFolderIsInsideSharedFolder: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.folderIsInsideSharedFolder + super.init(swift: swift) + } +} + +/// Policy cannot be changed due to restrictions from parent folder. +@objc +public class DBXSharingPermissionDeniedReasonRestrictedByParentFolder: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.restrictedByParentFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingPermissionDeniedReasonInsufficientPlan: DBXSharingPermissionDeniedReason { + @objc + public var insufficientPlan: DBXSharingInsufficientPlan + + @objc + public init(_ arg: DBXSharingInsufficientPlan) { + self.insufficientPlan = arg + let swift = Sharing.PermissionDeniedReason.insufficientPlan(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingPermissionDeniedReasonOther: DBXSharingPermissionDeniedReason { + @objc + public init() { + let swift = Sharing.PermissionDeniedReason.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RelinquishFileMembershipArg struct +@objc +public class DBXSharingRelinquishFileMembershipArg: NSObject { + /// The path or id for the file. + @objc + public var file: String { swift.file } + + @objc + public init(file: String) { + self.swift = Sharing.RelinquishFileMembershipArg(file: file) + } + + let swift: Sharing.RelinquishFileMembershipArg + + public init(swift: Sharing.RelinquishFileMembershipArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RelinquishFileMembershipError union +@objc +public class DBXSharingRelinquishFileMembershipError: NSObject { + let swift: Sharing.RelinquishFileMembershipError + + public init(swift: Sharing.RelinquishFileMembershipError) { + self.swift = swift + } + + public static func factory(swift: Sharing.RelinquishFileMembershipError) -> DBXSharingRelinquishFileMembershipError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingRelinquishFileMembershipErrorAccessError(arg) + case .groupAccess: + return DBXSharingRelinquishFileMembershipErrorGroupAccess() + case .noPermission: + return DBXSharingRelinquishFileMembershipErrorNoPermission() + case .other: + return DBXSharingRelinquishFileMembershipErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingRelinquishFileMembershipErrorAccessError? { + self as? DBXSharingRelinquishFileMembershipErrorAccessError + } + + @objc + public var asGroupAccess: DBXSharingRelinquishFileMembershipErrorGroupAccess? { + self as? DBXSharingRelinquishFileMembershipErrorGroupAccess + } + + @objc + public var asNoPermission: DBXSharingRelinquishFileMembershipErrorNoPermission? { + self as? DBXSharingRelinquishFileMembershipErrorNoPermission + } + + @objc + public var asOther: DBXSharingRelinquishFileMembershipErrorOther? { + self as? DBXSharingRelinquishFileMembershipErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingRelinquishFileMembershipErrorAccessError: DBXSharingRelinquishFileMembershipError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.RelinquishFileMembershipError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// The current user has access to the shared file via a group. You can't relinquish membership to a file +/// shared via groups. +@objc +public class DBXSharingRelinquishFileMembershipErrorGroupAccess: DBXSharingRelinquishFileMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFileMembershipError.groupAccess + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingRelinquishFileMembershipErrorNoPermission: DBXSharingRelinquishFileMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFileMembershipError.noPermission + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRelinquishFileMembershipErrorOther: DBXSharingRelinquishFileMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFileMembershipError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RelinquishFolderMembershipArg struct +@objc +public class DBXSharingRelinquishFolderMembershipArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// Keep a copy of the folder's contents upon relinquishing membership. This must be set to false when the + /// folder is within a team folder or another shared folder. + @objc + public var leaveACopy: NSNumber { swift.leaveACopy as NSNumber } + + @objc + public init(sharedFolderId: String, leaveACopy: NSNumber) { + self.swift = Sharing.RelinquishFolderMembershipArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy.boolValue) + } + + let swift: Sharing.RelinquishFolderMembershipArg + + public init(swift: Sharing.RelinquishFolderMembershipArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RelinquishFolderMembershipError union +@objc +public class DBXSharingRelinquishFolderMembershipError: NSObject { + let swift: Sharing.RelinquishFolderMembershipError + + public init(swift: Sharing.RelinquishFolderMembershipError) { + self.swift = swift + } + + public static func factory(swift: Sharing.RelinquishFolderMembershipError) -> DBXSharingRelinquishFolderMembershipError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingRelinquishFolderMembershipErrorAccessError(arg) + case .folderOwner: + return DBXSharingRelinquishFolderMembershipErrorFolderOwner() + case .mounted: + return DBXSharingRelinquishFolderMembershipErrorMounted() + case .groupAccess: + return DBXSharingRelinquishFolderMembershipErrorGroupAccess() + case .teamFolder: + return DBXSharingRelinquishFolderMembershipErrorTeamFolder() + case .noPermission: + return DBXSharingRelinquishFolderMembershipErrorNoPermission() + case .noExplicitAccess: + return DBXSharingRelinquishFolderMembershipErrorNoExplicitAccess() + case .other: + return DBXSharingRelinquishFolderMembershipErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingRelinquishFolderMembershipErrorAccessError? { + self as? DBXSharingRelinquishFolderMembershipErrorAccessError + } + + @objc + public var asFolderOwner: DBXSharingRelinquishFolderMembershipErrorFolderOwner? { + self as? DBXSharingRelinquishFolderMembershipErrorFolderOwner + } + + @objc + public var asMounted: DBXSharingRelinquishFolderMembershipErrorMounted? { + self as? DBXSharingRelinquishFolderMembershipErrorMounted + } + + @objc + public var asGroupAccess: DBXSharingRelinquishFolderMembershipErrorGroupAccess? { + self as? DBXSharingRelinquishFolderMembershipErrorGroupAccess + } + + @objc + public var asTeamFolder: DBXSharingRelinquishFolderMembershipErrorTeamFolder? { + self as? DBXSharingRelinquishFolderMembershipErrorTeamFolder + } + + @objc + public var asNoPermission: DBXSharingRelinquishFolderMembershipErrorNoPermission? { + self as? DBXSharingRelinquishFolderMembershipErrorNoPermission + } + + @objc + public var asNoExplicitAccess: DBXSharingRelinquishFolderMembershipErrorNoExplicitAccess? { + self as? DBXSharingRelinquishFolderMembershipErrorNoExplicitAccess + } + + @objc + public var asOther: DBXSharingRelinquishFolderMembershipErrorOther? { + self as? DBXSharingRelinquishFolderMembershipErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingRelinquishFolderMembershipErrorAccessError: DBXSharingRelinquishFolderMembershipError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.RelinquishFolderMembershipError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// The current user is the owner of the shared folder. Owners cannot relinquish membership to their own +/// folders. Try unsharing or transferring ownership first. +@objc +public class DBXSharingRelinquishFolderMembershipErrorFolderOwner: DBXSharingRelinquishFolderMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFolderMembershipError.folderOwner + super.init(swift: swift) + } +} + +/// The shared folder is currently mounted. Unmount the shared folder before relinquishing membership. +@objc +public class DBXSharingRelinquishFolderMembershipErrorMounted: DBXSharingRelinquishFolderMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFolderMembershipError.mounted + super.init(swift: swift) + } +} + +/// The current user has access to the shared folder via a group. You can't relinquish membership to folders +/// shared via groups. +@objc +public class DBXSharingRelinquishFolderMembershipErrorGroupAccess: DBXSharingRelinquishFolderMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFolderMembershipError.groupAccess + super.init(swift: swift) + } +} + +/// This action cannot be performed on a team shared folder. +@objc +public class DBXSharingRelinquishFolderMembershipErrorTeamFolder: DBXSharingRelinquishFolderMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFolderMembershipError.teamFolder + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingRelinquishFolderMembershipErrorNoPermission: DBXSharingRelinquishFolderMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFolderMembershipError.noPermission + super.init(swift: swift) + } +} + +/// The current user only has inherited access to the shared folder. You can't relinquish inherited membership +/// to folders. +@objc +public class DBXSharingRelinquishFolderMembershipErrorNoExplicitAccess: DBXSharingRelinquishFolderMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFolderMembershipError.noExplicitAccess + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRelinquishFolderMembershipErrorOther: DBXSharingRelinquishFolderMembershipError { + @objc + public init() { + let swift = Sharing.RelinquishFolderMembershipError.other + super.init(swift: swift) + } +} + +/// Arguments for removeFileMember2. +@objc +public class DBXSharingRemoveFileMemberArg: NSObject { + /// File from which to remove members. + @objc + public var file: String { swift.file } + /// Member to remove from this file. Note that even if an email is specified, it may result in the removal of a + /// user (not an invitee) if the user's main account corresponds to that email address. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + + @objc + public init(file: String, member: DBXSharingMemberSelector) { + self.swift = Sharing.RemoveFileMemberArg(file: file, member: member.swift) + } + + let swift: Sharing.RemoveFileMemberArg + + public init(swift: Sharing.RemoveFileMemberArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Errors for removeFileMember2. +@objc +public class DBXSharingRemoveFileMemberError: NSObject { + let swift: Sharing.RemoveFileMemberError + + public init(swift: Sharing.RemoveFileMemberError) { + self.swift = swift + } + + public static func factory(swift: Sharing.RemoveFileMemberError) -> DBXSharingRemoveFileMemberError { + switch swift { + case .userError(let swiftArg): + let arg = DBXSharingSharingUserError(swift: swiftArg) + return DBXSharingRemoveFileMemberErrorUserError(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingRemoveFileMemberErrorAccessError(arg) + case .noExplicitAccess(let swiftArg): + let arg = DBXSharingMemberAccessLevelResult(swift: swiftArg) + return DBXSharingRemoveFileMemberErrorNoExplicitAccess(arg) + case .other: + return DBXSharingRemoveFileMemberErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserError: DBXSharingRemoveFileMemberErrorUserError? { + self as? DBXSharingRemoveFileMemberErrorUserError + } + + @objc + public var asAccessError: DBXSharingRemoveFileMemberErrorAccessError? { + self as? DBXSharingRemoveFileMemberErrorAccessError + } + + @objc + public var asNoExplicitAccess: DBXSharingRemoveFileMemberErrorNoExplicitAccess? { + self as? DBXSharingRemoveFileMemberErrorNoExplicitAccess + } + + @objc + public var asOther: DBXSharingRemoveFileMemberErrorOther? { + self as? DBXSharingRemoveFileMemberErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingRemoveFileMemberErrorUserError: DBXSharingRemoveFileMemberError { + @objc + public var userError: DBXSharingSharingUserError + + @objc + public init(_ arg: DBXSharingSharingUserError) { + self.userError = arg + let swift = Sharing.RemoveFileMemberError.userError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRemoveFileMemberErrorAccessError: DBXSharingRemoveFileMemberError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.RemoveFileMemberError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// This member does not have explicit access to the file and therefore cannot be removed. The return value is +/// the access that a user might have to the file from a parent folder. +@objc +public class DBXSharingRemoveFileMemberErrorNoExplicitAccess: DBXSharingRemoveFileMemberError { + @objc + public var noExplicitAccess: DBXSharingMemberAccessLevelResult + + @objc + public init(_ arg: DBXSharingMemberAccessLevelResult) { + self.noExplicitAccess = arg + let swift = Sharing.RemoveFileMemberError.noExplicitAccess(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRemoveFileMemberErrorOther: DBXSharingRemoveFileMemberError { + @objc + public init() { + let swift = Sharing.RemoveFileMemberError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RemoveFolderMemberArg struct +@objc +public class DBXSharingRemoveFolderMemberArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// The member to remove from the folder. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + /// If true, the removed user will keep their copy of the folder after it's unshared, assuming it was mounted. + /// Otherwise, it will be removed from their Dropbox. This must be set to false when removing a group, or + /// when the folder is within a team folder or another shared folder. + @objc + public var leaveACopy: NSNumber { swift.leaveACopy as NSNumber } + + @objc + public init(sharedFolderId: String, member: DBXSharingMemberSelector, leaveACopy: NSNumber) { + self.swift = Sharing.RemoveFolderMemberArg(sharedFolderId: sharedFolderId, member: member.swift, leaveACopy: leaveACopy.boolValue) + } + + let swift: Sharing.RemoveFolderMemberArg + + public init(swift: Sharing.RemoveFolderMemberArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RemoveFolderMemberError union +@objc +public class DBXSharingRemoveFolderMemberError: NSObject { + let swift: Sharing.RemoveFolderMemberError + + public init(swift: Sharing.RemoveFolderMemberError) { + self.swift = swift + } + + public static func factory(swift: Sharing.RemoveFolderMemberError) -> DBXSharingRemoveFolderMemberError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingRemoveFolderMemberErrorAccessError(arg) + case .memberError(let swiftArg): + let arg = DBXSharingSharedFolderMemberError(swift: swiftArg) + return DBXSharingRemoveFolderMemberErrorMemberError(arg) + case .folderOwner: + return DBXSharingRemoveFolderMemberErrorFolderOwner() + case .groupAccess: + return DBXSharingRemoveFolderMemberErrorGroupAccess() + case .teamFolder: + return DBXSharingRemoveFolderMemberErrorTeamFolder() + case .noPermission: + return DBXSharingRemoveFolderMemberErrorNoPermission() + case .tooManyFiles: + return DBXSharingRemoveFolderMemberErrorTooManyFiles() + case .other: + return DBXSharingRemoveFolderMemberErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingRemoveFolderMemberErrorAccessError? { + self as? DBXSharingRemoveFolderMemberErrorAccessError + } + + @objc + public var asMemberError: DBXSharingRemoveFolderMemberErrorMemberError? { + self as? DBXSharingRemoveFolderMemberErrorMemberError + } + + @objc + public var asFolderOwner: DBXSharingRemoveFolderMemberErrorFolderOwner? { + self as? DBXSharingRemoveFolderMemberErrorFolderOwner + } + + @objc + public var asGroupAccess: DBXSharingRemoveFolderMemberErrorGroupAccess? { + self as? DBXSharingRemoveFolderMemberErrorGroupAccess + } + + @objc + public var asTeamFolder: DBXSharingRemoveFolderMemberErrorTeamFolder? { + self as? DBXSharingRemoveFolderMemberErrorTeamFolder + } + + @objc + public var asNoPermission: DBXSharingRemoveFolderMemberErrorNoPermission? { + self as? DBXSharingRemoveFolderMemberErrorNoPermission + } + + @objc + public var asTooManyFiles: DBXSharingRemoveFolderMemberErrorTooManyFiles? { + self as? DBXSharingRemoveFolderMemberErrorTooManyFiles + } + + @objc + public var asOther: DBXSharingRemoveFolderMemberErrorOther? { + self as? DBXSharingRemoveFolderMemberErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingRemoveFolderMemberErrorAccessError: DBXSharingRemoveFolderMemberError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.RemoveFolderMemberError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRemoveFolderMemberErrorMemberError: DBXSharingRemoveFolderMemberError { + @objc + public var memberError: DBXSharingSharedFolderMemberError + + @objc + public init(_ arg: DBXSharingSharedFolderMemberError) { + self.memberError = arg + let swift = Sharing.RemoveFolderMemberError.memberError(arg.swift) + super.init(swift: swift) + } +} + +/// The target user is the owner of the shared folder. You can't remove this user until ownership has been +/// transferred to another member. +@objc +public class DBXSharingRemoveFolderMemberErrorFolderOwner: DBXSharingRemoveFolderMemberError { + @objc + public init() { + let swift = Sharing.RemoveFolderMemberError.folderOwner + super.init(swift: swift) + } +} + +/// The target user has access to the shared folder via a group. +@objc +public class DBXSharingRemoveFolderMemberErrorGroupAccess: DBXSharingRemoveFolderMemberError { + @objc + public init() { + let swift = Sharing.RemoveFolderMemberError.groupAccess + super.init(swift: swift) + } +} + +/// This action cannot be performed on a team shared folder. +@objc +public class DBXSharingRemoveFolderMemberErrorTeamFolder: DBXSharingRemoveFolderMemberError { + @objc + public init() { + let swift = Sharing.RemoveFolderMemberError.teamFolder + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingRemoveFolderMemberErrorNoPermission: DBXSharingRemoveFolderMemberError { + @objc + public init() { + let swift = Sharing.RemoveFolderMemberError.noPermission + super.init(swift: swift) + } +} + +/// This shared folder has too many files for leaving a copy. You can still remove this user without leaving a +/// copy. +@objc +public class DBXSharingRemoveFolderMemberErrorTooManyFiles: DBXSharingRemoveFolderMemberError { + @objc + public init() { + let swift = Sharing.RemoveFolderMemberError.tooManyFiles + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRemoveFolderMemberErrorOther: DBXSharingRemoveFolderMemberError { + @objc + public init() { + let swift = Sharing.RemoveFolderMemberError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RemoveMemberJobStatus union +@objc +public class DBXSharingRemoveMemberJobStatus: NSObject { + let swift: Sharing.RemoveMemberJobStatus + + public init(swift: Sharing.RemoveMemberJobStatus) { + self.swift = swift + } + + public static func factory(swift: Sharing.RemoveMemberJobStatus) -> DBXSharingRemoveMemberJobStatus { + switch swift { + case .inProgress: + return DBXSharingRemoveMemberJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXSharingMemberAccessLevelResult(swift: swiftArg) + return DBXSharingRemoveMemberJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = DBXSharingRemoveFolderMemberError(swift: swiftArg) + return DBXSharingRemoveMemberJobStatusFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXSharingRemoveMemberJobStatusInProgress? { + self as? DBXSharingRemoveMemberJobStatusInProgress + } + + @objc + public var asComplete: DBXSharingRemoveMemberJobStatusComplete? { + self as? DBXSharingRemoveMemberJobStatusComplete + } + + @objc + public var asFailed: DBXSharingRemoveMemberJobStatusFailed? { + self as? DBXSharingRemoveMemberJobStatusFailed + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXSharingRemoveMemberJobStatusInProgress: DBXSharingRemoveMemberJobStatus { + @objc + public init() { + let swift = Sharing.RemoveMemberJobStatus.inProgress + super.init(swift: swift) + } +} + +/// Removing the folder member has finished. The value is information about whether the member has another form +/// of access. +@objc +public class DBXSharingRemoveMemberJobStatusComplete: DBXSharingRemoveMemberJobStatus { + @objc + public var complete: DBXSharingMemberAccessLevelResult + + @objc + public init(_ arg: DBXSharingMemberAccessLevelResult) { + self.complete = arg + let swift = Sharing.RemoveMemberJobStatus.complete(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRemoveMemberJobStatusFailed: DBXSharingRemoveMemberJobStatus { + @objc + public var failed: DBXSharingRemoveFolderMemberError + + @objc + public init(_ arg: DBXSharingRemoveFolderMemberError) { + self.failed = arg + let swift = Sharing.RemoveMemberJobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible RequestedLinkAccessLevel union +@objc +public class DBXSharingRequestedLinkAccessLevel: NSObject { + let swift: Sharing.RequestedLinkAccessLevel + + public init(swift: Sharing.RequestedLinkAccessLevel) { + self.swift = swift + } + + public static func factory(swift: Sharing.RequestedLinkAccessLevel) -> DBXSharingRequestedLinkAccessLevel { + switch swift { + case .viewer: + return DBXSharingRequestedLinkAccessLevelViewer() + case .editor: + return DBXSharingRequestedLinkAccessLevelEditor() + case .max: + return DBXSharingRequestedLinkAccessLevelMax() + case .default_: + return DBXSharingRequestedLinkAccessLevelDefault_() + case .other: + return DBXSharingRequestedLinkAccessLevelOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asViewer: DBXSharingRequestedLinkAccessLevelViewer? { + self as? DBXSharingRequestedLinkAccessLevelViewer + } + + @objc + public var asEditor: DBXSharingRequestedLinkAccessLevelEditor? { + self as? DBXSharingRequestedLinkAccessLevelEditor + } + + @objc + public var asMax: DBXSharingRequestedLinkAccessLevelMax? { + self as? DBXSharingRequestedLinkAccessLevelMax + } + + @objc + public var asDefault_: DBXSharingRequestedLinkAccessLevelDefault_? { + self as? DBXSharingRequestedLinkAccessLevelDefault_ + } + + @objc + public var asOther: DBXSharingRequestedLinkAccessLevelOther? { + self as? DBXSharingRequestedLinkAccessLevelOther + } +} + +/// Users who use the link can view and comment on the content. +@objc +public class DBXSharingRequestedLinkAccessLevelViewer: DBXSharingRequestedLinkAccessLevel { + @objc + public init() { + let swift = Sharing.RequestedLinkAccessLevel.viewer + super.init(swift: swift) + } +} + +/// Users who use the link can edit, view and comment on the content. Note not all file types support edit links +/// yet. +@objc +public class DBXSharingRequestedLinkAccessLevelEditor: DBXSharingRequestedLinkAccessLevel { + @objc + public init() { + let swift = Sharing.RequestedLinkAccessLevel.editor + super.init(swift: swift) + } +} + +/// Request for the maximum access level you can set the link to. +@objc +public class DBXSharingRequestedLinkAccessLevelMax: DBXSharingRequestedLinkAccessLevel { + @objc + public init() { + let swift = Sharing.RequestedLinkAccessLevel.max + super.init(swift: swift) + } +} + +/// Request for the default access level the user has set. +@objc +public class DBXSharingRequestedLinkAccessLevelDefault_: DBXSharingRequestedLinkAccessLevel { + @objc + public init() { + let swift = Sharing.RequestedLinkAccessLevel.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRequestedLinkAccessLevelOther: DBXSharingRequestedLinkAccessLevel { + @objc + public init() { + let swift = Sharing.RequestedLinkAccessLevel.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RevokeSharedLinkArg struct +@objc +public class DBXSharingRevokeSharedLinkArg: NSObject { + /// URL of the shared link. + @objc + public var url: String { swift.url } + + @objc + public init(url: String) { + self.swift = Sharing.RevokeSharedLinkArg(url: url) + } + + let swift: Sharing.RevokeSharedLinkArg + + public init(swift: Sharing.RevokeSharedLinkArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RevokeSharedLinkError union +@objc +public class DBXSharingRevokeSharedLinkError: NSObject { + let swift: Sharing.RevokeSharedLinkError + + public init(swift: Sharing.RevokeSharedLinkError) { + self.swift = swift + } + + public static func factory(swift: Sharing.RevokeSharedLinkError) -> DBXSharingRevokeSharedLinkError { + switch swift { + case .sharedLinkNotFound: + return DBXSharingRevokeSharedLinkErrorSharedLinkNotFound() + case .sharedLinkAccessDenied: + return DBXSharingRevokeSharedLinkErrorSharedLinkAccessDenied() + case .unsupportedLinkType: + return DBXSharingRevokeSharedLinkErrorUnsupportedLinkType() + case .other: + return DBXSharingRevokeSharedLinkErrorOther() + case .sharedLinkMalformed: + return DBXSharingRevokeSharedLinkErrorSharedLinkMalformed() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSharedLinkNotFound: DBXSharingRevokeSharedLinkErrorSharedLinkNotFound? { + self as? DBXSharingRevokeSharedLinkErrorSharedLinkNotFound + } + + @objc + public var asSharedLinkAccessDenied: DBXSharingRevokeSharedLinkErrorSharedLinkAccessDenied? { + self as? DBXSharingRevokeSharedLinkErrorSharedLinkAccessDenied + } + + @objc + public var asUnsupportedLinkType: DBXSharingRevokeSharedLinkErrorUnsupportedLinkType? { + self as? DBXSharingRevokeSharedLinkErrorUnsupportedLinkType + } + + @objc + public var asOther: DBXSharingRevokeSharedLinkErrorOther? { + self as? DBXSharingRevokeSharedLinkErrorOther + } + + @objc + public var asSharedLinkMalformed: DBXSharingRevokeSharedLinkErrorSharedLinkMalformed? { + self as? DBXSharingRevokeSharedLinkErrorSharedLinkMalformed + } +} + +/// The shared link wasn't found. +@objc +public class DBXSharingRevokeSharedLinkErrorSharedLinkNotFound: DBXSharingRevokeSharedLinkError { + @objc + public init() { + let swift = Sharing.RevokeSharedLinkError.sharedLinkNotFound + super.init(swift: swift) + } +} + +/// The caller is not allowed to access this shared link. +@objc +public class DBXSharingRevokeSharedLinkErrorSharedLinkAccessDenied: DBXSharingRevokeSharedLinkError { + @objc + public init() { + let swift = Sharing.RevokeSharedLinkError.sharedLinkAccessDenied + super.init(swift: swift) + } +} + +/// This type of link is not supported; use files instead. +@objc +public class DBXSharingRevokeSharedLinkErrorUnsupportedLinkType: DBXSharingRevokeSharedLinkError { + @objc + public init() { + let swift = Sharing.RevokeSharedLinkError.unsupportedLinkType + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingRevokeSharedLinkErrorOther: DBXSharingRevokeSharedLinkError { + @objc + public init() { + let swift = Sharing.RevokeSharedLinkError.other + super.init(swift: swift) + } +} + +/// Shared link is malformed. +@objc +public class DBXSharingRevokeSharedLinkErrorSharedLinkMalformed: DBXSharingRevokeSharedLinkError { + @objc + public init() { + let swift = Sharing.RevokeSharedLinkError.sharedLinkMalformed + super.init(swift: swift) + } +} + +/// Objective-C compatible SetAccessInheritanceArg struct +@objc +public class DBXSharingSetAccessInheritanceArg: NSObject { + /// The access inheritance settings for the folder. + @objc + public var accessInheritance: DBXSharingAccessInheritance { DBXSharingAccessInheritance(swift: swift.accessInheritance) } + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + + @objc + public init(sharedFolderId: String, accessInheritance: DBXSharingAccessInheritance) { + self.swift = Sharing.SetAccessInheritanceArg(sharedFolderId: sharedFolderId, accessInheritance: accessInheritance.swift) + } + + let swift: Sharing.SetAccessInheritanceArg + + public init(swift: Sharing.SetAccessInheritanceArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SetAccessInheritanceError union +@objc +public class DBXSharingSetAccessInheritanceError: NSObject { + let swift: Sharing.SetAccessInheritanceError + + public init(swift: Sharing.SetAccessInheritanceError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SetAccessInheritanceError) -> DBXSharingSetAccessInheritanceError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingSetAccessInheritanceErrorAccessError(arg) + case .noPermission: + return DBXSharingSetAccessInheritanceErrorNoPermission() + case .other: + return DBXSharingSetAccessInheritanceErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingSetAccessInheritanceErrorAccessError? { + self as? DBXSharingSetAccessInheritanceErrorAccessError + } + + @objc + public var asNoPermission: DBXSharingSetAccessInheritanceErrorNoPermission? { + self as? DBXSharingSetAccessInheritanceErrorNoPermission + } + + @objc + public var asOther: DBXSharingSetAccessInheritanceErrorOther? { + self as? DBXSharingSetAccessInheritanceErrorOther + } +} + +/// Unable to access shared folder. +@objc +public class DBXSharingSetAccessInheritanceErrorAccessError: DBXSharingSetAccessInheritanceError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.SetAccessInheritanceError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingSetAccessInheritanceErrorNoPermission: DBXSharingSetAccessInheritanceError { + @objc + public init() { + let swift = Sharing.SetAccessInheritanceError.noPermission + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSetAccessInheritanceErrorOther: DBXSharingSetAccessInheritanceError { + @objc + public init() { + let swift = Sharing.SetAccessInheritanceError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ShareFolderArgBase struct +@objc +public class DBXSharingShareFolderArgBase: NSObject { + /// Who can add and remove members of this shared folder. + @objc + public var aclUpdatePolicy: DBXSharingAclUpdatePolicy? { guard let swift = swift.aclUpdatePolicy else { return nil } + return DBXSharingAclUpdatePolicy(swift: swift) + } + + /// Whether to force the share to happen asynchronously. + @objc + public var forceAsync: NSNumber { swift.forceAsync as NSNumber } + /// Who can be a member of this shared folder. Only applicable if the current user is on a team. + @objc + public var memberPolicy: DBXSharingMemberPolicy? { guard let swift = swift.memberPolicy else { return nil } + return DBXSharingMemberPolicy(swift: swift) + } + + /// The path or the file id to the folder to share. If it does not exist, then a new one is created. + @objc + public var path: String { swift.path } + /// The policy to apply to shared links created for content inside this shared folder. The current user must be + /// on a team to set this policy to members in SharedLinkPolicy. + @objc + public var sharedLinkPolicy: DBXSharingSharedLinkPolicy? { guard let swift = swift.sharedLinkPolicy else { return nil } + return DBXSharingSharedLinkPolicy(swift: swift) + } + + /// Who can enable/disable viewer info for this shared folder. + @objc + public var viewerInfoPolicy: DBXSharingViewerInfoPolicy? { guard let swift = swift.viewerInfoPolicy else { return nil } + return DBXSharingViewerInfoPolicy(swift: swift) + } + + /// The access inheritance settings for the folder. + @objc + public var accessInheritance: DBXSharingAccessInheritance { DBXSharingAccessInheritance(swift: swift.accessInheritance) } + + @objc + public init( + path: String, + aclUpdatePolicy: DBXSharingAclUpdatePolicy?, + forceAsync: NSNumber, + memberPolicy: DBXSharingMemberPolicy?, + sharedLinkPolicy: DBXSharingSharedLinkPolicy?, + viewerInfoPolicy: DBXSharingViewerInfoPolicy?, + accessInheritance: DBXSharingAccessInheritance + ) { + self.swift = Sharing.ShareFolderArgBase( + path: path, + aclUpdatePolicy: aclUpdatePolicy?.swift, + forceAsync: forceAsync.boolValue, + memberPolicy: memberPolicy?.swift, + sharedLinkPolicy: sharedLinkPolicy?.swift, + viewerInfoPolicy: viewerInfoPolicy?.swift, + accessInheritance: accessInheritance.swift + ) + } + + let swift: Sharing.ShareFolderArgBase + + public init(swift: Sharing.ShareFolderArgBase) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShareFolderArg struct +@objc +public class DBXSharingShareFolderArg: DBXSharingShareFolderArgBase { + /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on + /// the folder. + @objc + public var actions: [DBXSharingFolderAction]? { subSwift.actions?.map { DBXSharingFolderAction(swift: $0) } } + /// Settings on the link for this folder. + @objc + public var linkSettings: DBXSharingLinkSettings? { guard let swift = subSwift.linkSettings else { return nil } + return DBXSharingLinkSettings(swift: swift) + } + + @objc + public init( + path: String, + aclUpdatePolicy: DBXSharingAclUpdatePolicy?, + forceAsync: NSNumber, + memberPolicy: DBXSharingMemberPolicy?, + sharedLinkPolicy: DBXSharingSharedLinkPolicy?, + viewerInfoPolicy: DBXSharingViewerInfoPolicy?, + accessInheritance: DBXSharingAccessInheritance, + actions: [DBXSharingFolderAction]?, + linkSettings: DBXSharingLinkSettings? + ) { + let swift = Sharing.ShareFolderArg( + path: path, + aclUpdatePolicy: aclUpdatePolicy?.swift, + forceAsync: forceAsync.boolValue, + memberPolicy: memberPolicy?.swift, + sharedLinkPolicy: sharedLinkPolicy?.swift, + viewerInfoPolicy: viewerInfoPolicy?.swift, + accessInheritance: accessInheritance.swift, + actions: actions?.map(\.swift), + linkSettings: linkSettings?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.ShareFolderArg + + public init(swift: Sharing.ShareFolderArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible ShareFolderErrorBase union +@objc +public class DBXSharingShareFolderErrorBase: NSObject { + let swift: Sharing.ShareFolderErrorBase + + public init(swift: Sharing.ShareFolderErrorBase) { + self.swift = swift + } + + public static func factory(swift: Sharing.ShareFolderErrorBase) -> DBXSharingShareFolderErrorBase { + switch swift { + case .emailUnverified: + return DBXSharingShareFolderErrorBaseEmailUnverified() + case .badPath(let swiftArg): + let arg = DBXSharingSharePathError(swift: swiftArg) + return DBXSharingShareFolderErrorBaseBadPath(arg) + case .teamPolicyDisallowsMemberPolicy: + return DBXSharingShareFolderErrorBaseTeamPolicyDisallowsMemberPolicy() + case .disallowedSharedLinkPolicy: + return DBXSharingShareFolderErrorBaseDisallowedSharedLinkPolicy() + case .other: + return DBXSharingShareFolderErrorBaseOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEmailUnverified: DBXSharingShareFolderErrorBaseEmailUnverified? { + self as? DBXSharingShareFolderErrorBaseEmailUnverified + } + + @objc + public var asBadPath: DBXSharingShareFolderErrorBaseBadPath? { + self as? DBXSharingShareFolderErrorBaseBadPath + } + + @objc + public var asTeamPolicyDisallowsMemberPolicy: DBXSharingShareFolderErrorBaseTeamPolicyDisallowsMemberPolicy? { + self as? DBXSharingShareFolderErrorBaseTeamPolicyDisallowsMemberPolicy + } + + @objc + public var asDisallowedSharedLinkPolicy: DBXSharingShareFolderErrorBaseDisallowedSharedLinkPolicy? { + self as? DBXSharingShareFolderErrorBaseDisallowedSharedLinkPolicy + } + + @objc + public var asOther: DBXSharingShareFolderErrorBaseOther? { + self as? DBXSharingShareFolderErrorBaseOther + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXSharingShareFolderErrorBaseEmailUnverified: DBXSharingShareFolderErrorBase { + @objc + public init() { + let swift = Sharing.ShareFolderErrorBase.emailUnverified + super.init(swift: swift) + } +} + +/// path in ShareFolderArg is invalid. +@objc +public class DBXSharingShareFolderErrorBaseBadPath: DBXSharingShareFolderErrorBase { + @objc + public var badPath: DBXSharingSharePathError + + @objc + public init(_ arg: DBXSharingSharePathError) { + self.badPath = arg + let swift = Sharing.ShareFolderErrorBase.badPath(arg.swift) + super.init(swift: swift) + } +} + +/// Team policy is more restrictive than memberPolicy in ShareFolderArg. +@objc +public class DBXSharingShareFolderErrorBaseTeamPolicyDisallowsMemberPolicy: DBXSharingShareFolderErrorBase { + @objc + public init() { + let swift = Sharing.ShareFolderErrorBase.teamPolicyDisallowsMemberPolicy + super.init(swift: swift) + } +} + +/// The current user's account is not allowed to select the specified sharedLinkPolicy in ShareFolderArg. +@objc +public class DBXSharingShareFolderErrorBaseDisallowedSharedLinkPolicy: DBXSharingShareFolderErrorBase { + @objc + public init() { + let swift = Sharing.ShareFolderErrorBase.disallowedSharedLinkPolicy + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingShareFolderErrorBaseOther: DBXSharingShareFolderErrorBase { + @objc + public init() { + let swift = Sharing.ShareFolderErrorBase.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ShareFolderError union +@objc +public class DBXSharingShareFolderError: NSObject { + let swift: Sharing.ShareFolderError + + public init(swift: Sharing.ShareFolderError) { + self.swift = swift + } + + public static func factory(swift: Sharing.ShareFolderError) -> DBXSharingShareFolderError { + switch swift { + case .emailUnverified: + return DBXSharingShareFolderErrorEmailUnverified() + case .badPath(let swiftArg): + let arg = DBXSharingSharePathError(swift: swiftArg) + return DBXSharingShareFolderErrorBadPath(arg) + case .teamPolicyDisallowsMemberPolicy: + return DBXSharingShareFolderErrorTeamPolicyDisallowsMemberPolicy() + case .disallowedSharedLinkPolicy: + return DBXSharingShareFolderErrorDisallowedSharedLinkPolicy() + case .other: + return DBXSharingShareFolderErrorOther() + case .noPermission: + return DBXSharingShareFolderErrorNoPermission() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEmailUnverified: DBXSharingShareFolderErrorEmailUnverified? { + self as? DBXSharingShareFolderErrorEmailUnverified + } + + @objc + public var asBadPath: DBXSharingShareFolderErrorBadPath? { + self as? DBXSharingShareFolderErrorBadPath + } + + @objc + public var asTeamPolicyDisallowsMemberPolicy: DBXSharingShareFolderErrorTeamPolicyDisallowsMemberPolicy? { + self as? DBXSharingShareFolderErrorTeamPolicyDisallowsMemberPolicy + } + + @objc + public var asDisallowedSharedLinkPolicy: DBXSharingShareFolderErrorDisallowedSharedLinkPolicy? { + self as? DBXSharingShareFolderErrorDisallowedSharedLinkPolicy + } + + @objc + public var asOther: DBXSharingShareFolderErrorOther? { + self as? DBXSharingShareFolderErrorOther + } + + @objc + public var asNoPermission: DBXSharingShareFolderErrorNoPermission? { + self as? DBXSharingShareFolderErrorNoPermission + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXSharingShareFolderErrorEmailUnverified: DBXSharingShareFolderError { + @objc + public init() { + let swift = Sharing.ShareFolderError.emailUnverified + super.init(swift: swift) + } +} + +/// path in ShareFolderArg is invalid. +@objc +public class DBXSharingShareFolderErrorBadPath: DBXSharingShareFolderError { + @objc + public var badPath: DBXSharingSharePathError + + @objc + public init(_ arg: DBXSharingSharePathError) { + self.badPath = arg + let swift = Sharing.ShareFolderError.badPath(arg.swift) + super.init(swift: swift) + } +} + +/// Team policy is more restrictive than memberPolicy in ShareFolderArg. +@objc +public class DBXSharingShareFolderErrorTeamPolicyDisallowsMemberPolicy: DBXSharingShareFolderError { + @objc + public init() { + let swift = Sharing.ShareFolderError.teamPolicyDisallowsMemberPolicy + super.init(swift: swift) + } +} + +/// The current user's account is not allowed to select the specified sharedLinkPolicy in ShareFolderArg. +@objc +public class DBXSharingShareFolderErrorDisallowedSharedLinkPolicy: DBXSharingShareFolderError { + @objc + public init() { + let swift = Sharing.ShareFolderError.disallowedSharedLinkPolicy + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingShareFolderErrorOther: DBXSharingShareFolderError { + @objc + public init() { + let swift = Sharing.ShareFolderError.other + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingShareFolderErrorNoPermission: DBXSharingShareFolderError { + @objc + public init() { + let swift = Sharing.ShareFolderError.noPermission + super.init(swift: swift) + } +} + +/// Objective-C compatible ShareFolderJobStatus union +@objc +public class DBXSharingShareFolderJobStatus: NSObject { + let swift: Sharing.ShareFolderJobStatus + + public init(swift: Sharing.ShareFolderJobStatus) { + self.swift = swift + } + + public static func factory(swift: Sharing.ShareFolderJobStatus) -> DBXSharingShareFolderJobStatus { + switch swift { + case .inProgress: + return DBXSharingShareFolderJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXSharingSharedFolderMetadata(swift: swiftArg) + return DBXSharingShareFolderJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = DBXSharingShareFolderError(swift: swiftArg) + return DBXSharingShareFolderJobStatusFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXSharingShareFolderJobStatusInProgress? { + self as? DBXSharingShareFolderJobStatusInProgress + } + + @objc + public var asComplete: DBXSharingShareFolderJobStatusComplete? { + self as? DBXSharingShareFolderJobStatusComplete + } + + @objc + public var asFailed: DBXSharingShareFolderJobStatusFailed? { + self as? DBXSharingShareFolderJobStatusFailed + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXSharingShareFolderJobStatusInProgress: DBXSharingShareFolderJobStatus { + @objc + public init() { + let swift = Sharing.ShareFolderJobStatus.inProgress + super.init(swift: swift) + } +} + +/// The share job has finished. The value is the metadata for the folder. +@objc +public class DBXSharingShareFolderJobStatusComplete: DBXSharingShareFolderJobStatus { + @objc + public var complete: DBXSharingSharedFolderMetadata + + @objc + public init(_ arg: DBXSharingSharedFolderMetadata) { + self.complete = arg + let swift = Sharing.ShareFolderJobStatus.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingShareFolderJobStatusFailed: DBXSharingShareFolderJobStatus { + @objc + public var failed: DBXSharingShareFolderError + + @objc + public init(_ arg: DBXSharingShareFolderError) { + self.failed = arg + let swift = Sharing.ShareFolderJobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible ShareFolderLaunch union +@objc +public class DBXSharingShareFolderLaunch: NSObject { + let swift: Sharing.ShareFolderLaunch + + public init(swift: Sharing.ShareFolderLaunch) { + self.swift = swift + } + + public static func factory(swift: Sharing.ShareFolderLaunch) -> DBXSharingShareFolderLaunch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXSharingShareFolderLaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXSharingSharedFolderMetadata(swift: swiftArg) + return DBXSharingShareFolderLaunchComplete(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXSharingShareFolderLaunchAsyncJobId? { + self as? DBXSharingShareFolderLaunchAsyncJobId + } + + @objc + public var asComplete: DBXSharingShareFolderLaunchComplete? { + self as? DBXSharingShareFolderLaunchComplete + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXSharingShareFolderLaunchAsyncJobId: DBXSharingShareFolderLaunch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Sharing.ShareFolderLaunch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingShareFolderLaunchComplete: DBXSharingShareFolderLaunch { + @objc + public var complete: DBXSharingSharedFolderMetadata + + @objc + public init(_ arg: DBXSharingSharedFolderMetadata) { + self.complete = arg + let swift = Sharing.ShareFolderLaunch.complete(arg.subSwift) + super.init(swift: swift) + } +} + +/// Objective-C compatible SharePathError union +@objc +public class DBXSharingSharePathError: NSObject { + let swift: Sharing.SharePathError + + public init(swift: Sharing.SharePathError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharePathError) -> DBXSharingSharePathError { + switch swift { + case .isFile: + return DBXSharingSharePathErrorIsFile() + case .insideSharedFolder: + return DBXSharingSharePathErrorInsideSharedFolder() + case .containsSharedFolder: + return DBXSharingSharePathErrorContainsSharedFolder() + case .containsAppFolder: + return DBXSharingSharePathErrorContainsAppFolder() + case .containsTeamFolder: + return DBXSharingSharePathErrorContainsTeamFolder() + case .isAppFolder: + return DBXSharingSharePathErrorIsAppFolder() + case .insideAppFolder: + return DBXSharingSharePathErrorInsideAppFolder() + case .isPublicFolder: + return DBXSharingSharePathErrorIsPublicFolder() + case .insidePublicFolder: + return DBXSharingSharePathErrorInsidePublicFolder() + case .alreadyShared(let swiftArg): + let arg = DBXSharingSharedFolderMetadata(swift: swiftArg) + return DBXSharingSharePathErrorAlreadyShared(arg) + case .invalidPath: + return DBXSharingSharePathErrorInvalidPath() + case .isOsxPackage: + return DBXSharingSharePathErrorIsOsxPackage() + case .insideOsxPackage: + return DBXSharingSharePathErrorInsideOsxPackage() + case .isVault: + return DBXSharingSharePathErrorIsVault() + case .isVaultLocked: + return DBXSharingSharePathErrorIsVaultLocked() + case .isFamily: + return DBXSharingSharePathErrorIsFamily() + case .other: + return DBXSharingSharePathErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIsFile: DBXSharingSharePathErrorIsFile? { + self as? DBXSharingSharePathErrorIsFile + } + + @objc + public var asInsideSharedFolder: DBXSharingSharePathErrorInsideSharedFolder? { + self as? DBXSharingSharePathErrorInsideSharedFolder + } + + @objc + public var asContainsSharedFolder: DBXSharingSharePathErrorContainsSharedFolder? { + self as? DBXSharingSharePathErrorContainsSharedFolder + } + + @objc + public var asContainsAppFolder: DBXSharingSharePathErrorContainsAppFolder? { + self as? DBXSharingSharePathErrorContainsAppFolder + } + + @objc + public var asContainsTeamFolder: DBXSharingSharePathErrorContainsTeamFolder? { + self as? DBXSharingSharePathErrorContainsTeamFolder + } + + @objc + public var asIsAppFolder: DBXSharingSharePathErrorIsAppFolder? { + self as? DBXSharingSharePathErrorIsAppFolder + } + + @objc + public var asInsideAppFolder: DBXSharingSharePathErrorInsideAppFolder? { + self as? DBXSharingSharePathErrorInsideAppFolder + } + + @objc + public var asIsPublicFolder: DBXSharingSharePathErrorIsPublicFolder? { + self as? DBXSharingSharePathErrorIsPublicFolder + } + + @objc + public var asInsidePublicFolder: DBXSharingSharePathErrorInsidePublicFolder? { + self as? DBXSharingSharePathErrorInsidePublicFolder + } + + @objc + public var asAlreadyShared: DBXSharingSharePathErrorAlreadyShared? { + self as? DBXSharingSharePathErrorAlreadyShared + } + + @objc + public var asInvalidPath: DBXSharingSharePathErrorInvalidPath? { + self as? DBXSharingSharePathErrorInvalidPath + } + + @objc + public var asIsOsxPackage: DBXSharingSharePathErrorIsOsxPackage? { + self as? DBXSharingSharePathErrorIsOsxPackage + } + + @objc + public var asInsideOsxPackage: DBXSharingSharePathErrorInsideOsxPackage? { + self as? DBXSharingSharePathErrorInsideOsxPackage + } + + @objc + public var asIsVault: DBXSharingSharePathErrorIsVault? { + self as? DBXSharingSharePathErrorIsVault + } + + @objc + public var asIsVaultLocked: DBXSharingSharePathErrorIsVaultLocked? { + self as? DBXSharingSharePathErrorIsVaultLocked + } + + @objc + public var asIsFamily: DBXSharingSharePathErrorIsFamily? { + self as? DBXSharingSharePathErrorIsFamily + } + + @objc + public var asOther: DBXSharingSharePathErrorOther? { + self as? DBXSharingSharePathErrorOther + } +} + +/// A file is at the specified path. +@objc +public class DBXSharingSharePathErrorIsFile: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.isFile + super.init(swift: swift) + } +} + +/// We do not support sharing a folder inside a shared folder. +@objc +public class DBXSharingSharePathErrorInsideSharedFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.insideSharedFolder + super.init(swift: swift) + } +} + +/// We do not support shared folders that contain shared folders. +@objc +public class DBXSharingSharePathErrorContainsSharedFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.containsSharedFolder + super.init(swift: swift) + } +} + +/// We do not support shared folders that contain app folders. +@objc +public class DBXSharingSharePathErrorContainsAppFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.containsAppFolder + super.init(swift: swift) + } +} + +/// We do not support shared folders that contain team folders. +@objc +public class DBXSharingSharePathErrorContainsTeamFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.containsTeamFolder + super.init(swift: swift) + } +} + +/// We do not support sharing an app folder. +@objc +public class DBXSharingSharePathErrorIsAppFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.isAppFolder + super.init(swift: swift) + } +} + +/// We do not support sharing a folder inside an app folder. +@objc +public class DBXSharingSharePathErrorInsideAppFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.insideAppFolder + super.init(swift: swift) + } +} + +/// A public folder can't be shared this way. Use a public link instead. +@objc +public class DBXSharingSharePathErrorIsPublicFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.isPublicFolder + super.init(swift: swift) + } +} + +/// A folder inside a public folder can't be shared this way. Use a public link instead. +@objc +public class DBXSharingSharePathErrorInsidePublicFolder: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.insidePublicFolder + super.init(swift: swift) + } +} + +/// Folder is already shared. Contains metadata about the existing shared folder. +@objc +public class DBXSharingSharePathErrorAlreadyShared: DBXSharingSharePathError { + @objc + public var alreadyShared: DBXSharingSharedFolderMetadata + + @objc + public init(_ arg: DBXSharingSharedFolderMetadata) { + self.alreadyShared = arg + let swift = Sharing.SharePathError.alreadyShared(arg.subSwift) + super.init(swift: swift) + } +} + +/// Path is not valid. +@objc +public class DBXSharingSharePathErrorInvalidPath: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.invalidPath + super.init(swift: swift) + } +} + +/// We do not support sharing a Mac OS X package. +@objc +public class DBXSharingSharePathErrorIsOsxPackage: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.isOsxPackage + super.init(swift: swift) + } +} + +/// We do not support sharing a folder inside a Mac OS X package. +@objc +public class DBXSharingSharePathErrorInsideOsxPackage: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.insideOsxPackage + super.init(swift: swift) + } +} + +/// We do not support sharing the Vault folder. +@objc +public class DBXSharingSharePathErrorIsVault: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.isVault + super.init(swift: swift) + } +} + +/// We do not support sharing a folder inside a locked Vault. +@objc +public class DBXSharingSharePathErrorIsVaultLocked: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.isVaultLocked + super.init(swift: swift) + } +} + +/// We do not support sharing the Family folder. +@objc +public class DBXSharingSharePathErrorIsFamily: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.isFamily + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharePathErrorOther: DBXSharingSharePathError { + @objc + public init() { + let swift = Sharing.SharePathError.other + super.init(swift: swift) + } +} + +/// Metadata of a shared link for a file or folder. +@objc +public class DBXSharingSharedContentLinkMetadata: DBXSharingSharedContentLinkMetadataBase { + /// The content inside this folder with link audience different than this folder's. This is only returned when + /// an endpoint that returns metadata for a single shared folder is called, e.g. /get_folder_metadata. + @objc + public var audienceExceptions: DBXSharingAudienceExceptions? { guard let swift = subSwift.audienceExceptions else { return nil } + return DBXSharingAudienceExceptions(swift: swift) + } + + /// The URL of the link. + @objc + public var url: String { subSwift.url } + + @objc + public init( + audienceOptions: [DBXSharingLinkAudience], + currentAudience: DBXSharingLinkAudience, + linkPermissions: [DBXSharingLinkPermission], + passwordProtected: NSNumber, + url: String, + accessLevel: DBXSharingAccessLevel?, + audienceRestrictingSharedFolder: DBXSharingAudienceRestrictingSharedFolder?, + expiry: Date?, + audienceExceptions: DBXSharingAudienceExceptions? + ) { + let swift = Sharing.SharedContentLinkMetadata( + audienceOptions: audienceOptions.map(\.swift), + currentAudience: currentAudience.swift, + linkPermissions: linkPermissions.map(\.swift), + passwordProtected: passwordProtected.boolValue, + url: url, + accessLevel: accessLevel?.swift, + audienceRestrictingSharedFolder: audienceRestrictingSharedFolder?.swift, + expiry: expiry, + audienceExceptions: audienceExceptions?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.SharedContentLinkMetadata + + public init(swift: Sharing.SharedContentLinkMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Shared file user, group, and invitee membership. Used for the results of listFileMembers and +/// listFileMembersContinue, and used as part of the results for listFileMembersBatch. +@objc +public class DBXSharingSharedFileMembers: NSObject { + /// The list of user members of the shared file. + @objc + public var users: [DBXSharingUserFileMembershipInfo] { swift.users.map { DBXSharingUserFileMembershipInfo(swift: $0) } } + /// The list of group members of the shared file. + @objc + public var groups: [DBXSharingGroupMembershipInfo] { swift.groups.map { DBXSharingGroupMembershipInfo(swift: $0) } } + /// The list of invited members of a file, but have not logged in and claimed this. + @objc + public var invitees: [DBXSharingInviteeMembershipInfo] { swift.invitees.map { DBXSharingInviteeMembershipInfo(swift: $0) } } + /// Present if there are additional shared file members that have not been returned yet. Pass the cursor into + /// listFileMembersContinue to list additional members. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init( + users: [DBXSharingUserFileMembershipInfo], + groups: [DBXSharingGroupMembershipInfo], + invitees: [DBXSharingInviteeMembershipInfo], + cursor: String? + ) { + self.swift = Sharing.SharedFileMembers( + users: users.map(\.subSubSwift), + groups: groups.map(\.subSwift), + invitees: invitees.map(\.subSwift), + cursor: cursor + ) + } + + let swift: Sharing.SharedFileMembers + + public init(swift: Sharing.SharedFileMembers) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Properties of the shared file. +@objc +public class DBXSharingSharedFileMetadata: NSObject { + /// The current user's access level for this shared file. + @objc + public var accessType: DBXSharingAccessLevel? { guard let swift = swift.accessType else { return nil } + return DBXSharingAccessLevel(swift: swift) + } + + /// The ID of the file. + @objc + public var id: String { swift.id } + /// The expected metadata of the link associated for the file when it is first shared. Absent if the link + /// already exists. This is for an unreleased feature so it may not be returned yet. + @objc + public var expectedLinkMetadata: DBXSharingExpectedSharedContentLinkMetadata? { guard let swift = swift.expectedLinkMetadata else { return nil } + return DBXSharingExpectedSharedContentLinkMetadata(swift: swift) + } + + /// The metadata of the link associated for the file. This is for an unreleased feature so it may not be + /// returned yet. + @objc + public var linkMetadata: DBXSharingSharedContentLinkMetadata? { guard let swift = swift.linkMetadata else { return nil } + return DBXSharingSharedContentLinkMetadata(swift: swift) + } + + /// The name of this file. + @objc + public var name: String { swift.name } + /// The display names of the users that own the file. If the file is part of a team folder, the display names of + /// the team admins are also included. Absent if the owner display names cannot be fetched. + @objc + public var ownerDisplayNames: [String]? { swift.ownerDisplayNames } + /// The team that owns the file. This field is not present if the file is not owned by a team. + @objc + public var ownerTeam: DBXUsersTeam? { guard let swift = swift.ownerTeam else { return nil } + return DBXUsersTeam(swift: swift) + } + + /// The ID of the parent shared folder. This field is present only if the file is contained within a shared + /// folder. + @objc + public var parentSharedFolderId: String? { swift.parentSharedFolderId } + /// The cased path to be used for display purposes only. In rare instances the casing will not correctly match + /// the user's filesystem, but this behavior will match the path provided in the Core API v1. Absent for + /// unmounted files. + @objc + public var pathDisplay: String? { swift.pathDisplay } + /// The lower-case full path of this file. Absent for unmounted files. + @objc + public var pathLower: String? { swift.pathLower } + /// The sharing permissions that requesting user has on this file. This corresponds to the entries given in + /// actions in GetFileMetadataBatchArg or actions in GetFileMetadataArg. + @objc + public var permissions: [DBXSharingFilePermission]? { swift.permissions?.map { DBXSharingFilePermission(swift: $0) } } + /// Policies governing this shared file. + @objc + public var policy: DBXSharingFolderPolicy { DBXSharingFolderPolicy(swift: swift.policy) } + /// URL for displaying a web preview of the shared file. + @objc + public var previewUrl: String { swift.previewUrl } + /// Timestamp indicating when the current user was invited to this shared file. If the user was not invited to + /// the shared file, the timestamp will indicate when the user was invited to the parent shared folder. This + /// value may be absent. + @objc + public var timeInvited: Date? { swift.timeInvited } + + @objc + public init( + id: String, + name: String, + policy: DBXSharingFolderPolicy, + previewUrl: String, + accessType: DBXSharingAccessLevel?, + expectedLinkMetadata: DBXSharingExpectedSharedContentLinkMetadata?, + linkMetadata: DBXSharingSharedContentLinkMetadata?, + ownerDisplayNames: [String]?, + ownerTeam: DBXUsersTeam?, + parentSharedFolderId: String?, + pathDisplay: String?, + pathLower: String?, + permissions: [DBXSharingFilePermission]?, + timeInvited: Date? + ) { + self.swift = Sharing.SharedFileMetadata( + id: id, + name: name, + policy: policy.swift, + previewUrl: previewUrl, + accessType: accessType?.swift, + expectedLinkMetadata: expectedLinkMetadata?.subSwift, + linkMetadata: linkMetadata?.subSwift, + ownerDisplayNames: ownerDisplayNames, + ownerTeam: ownerTeam?.swift, + parentSharedFolderId: parentSharedFolderId, + pathDisplay: pathDisplay, + pathLower: pathLower, + permissions: permissions?.map(\.swift), + timeInvited: timeInvited + ) + } + + let swift: Sharing.SharedFileMetadata + + public init(swift: Sharing.SharedFileMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// There is an error accessing the shared folder. +@objc +public class DBXSharingSharedFolderAccessError: NSObject { + let swift: Sharing.SharedFolderAccessError + + public init(swift: Sharing.SharedFolderAccessError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharedFolderAccessError) -> DBXSharingSharedFolderAccessError { + switch swift { + case .invalidId: + return DBXSharingSharedFolderAccessErrorInvalidId() + case .notAMember: + return DBXSharingSharedFolderAccessErrorNotAMember() + case .invalidMember: + return DBXSharingSharedFolderAccessErrorInvalidMember() + case .emailUnverified: + return DBXSharingSharedFolderAccessErrorEmailUnverified() + case .unmounted: + return DBXSharingSharedFolderAccessErrorUnmounted() + case .other: + return DBXSharingSharedFolderAccessErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidId: DBXSharingSharedFolderAccessErrorInvalidId? { + self as? DBXSharingSharedFolderAccessErrorInvalidId + } + + @objc + public var asNotAMember: DBXSharingSharedFolderAccessErrorNotAMember? { + self as? DBXSharingSharedFolderAccessErrorNotAMember + } + + @objc + public var asInvalidMember: DBXSharingSharedFolderAccessErrorInvalidMember? { + self as? DBXSharingSharedFolderAccessErrorInvalidMember + } + + @objc + public var asEmailUnverified: DBXSharingSharedFolderAccessErrorEmailUnverified? { + self as? DBXSharingSharedFolderAccessErrorEmailUnverified + } + + @objc + public var asUnmounted: DBXSharingSharedFolderAccessErrorUnmounted? { + self as? DBXSharingSharedFolderAccessErrorUnmounted + } + + @objc + public var asOther: DBXSharingSharedFolderAccessErrorOther? { + self as? DBXSharingSharedFolderAccessErrorOther + } +} + +/// This shared folder ID is invalid. +@objc +public class DBXSharingSharedFolderAccessErrorInvalidId: DBXSharingSharedFolderAccessError { + @objc + public init() { + let swift = Sharing.SharedFolderAccessError.invalidId + super.init(swift: swift) + } +} + +/// The user is not a member of the shared folder thus cannot access it. +@objc +public class DBXSharingSharedFolderAccessErrorNotAMember: DBXSharingSharedFolderAccessError { + @objc + public init() { + let swift = Sharing.SharedFolderAccessError.notAMember + super.init(swift: swift) + } +} + +/// The user does not exist or their account is disabled. +@objc +public class DBXSharingSharedFolderAccessErrorInvalidMember: DBXSharingSharedFolderAccessError { + @objc + public init() { + let swift = Sharing.SharedFolderAccessError.invalidMember + super.init(swift: swift) + } +} + +/// Never set. +@objc +public class DBXSharingSharedFolderAccessErrorEmailUnverified: DBXSharingSharedFolderAccessError { + @objc + public init() { + let swift = Sharing.SharedFolderAccessError.emailUnverified + super.init(swift: swift) + } +} + +/// The shared folder is unmounted. +@objc +public class DBXSharingSharedFolderAccessErrorUnmounted: DBXSharingSharedFolderAccessError { + @objc + public init() { + let swift = Sharing.SharedFolderAccessError.unmounted + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharedFolderAccessErrorOther: DBXSharingSharedFolderAccessError { + @objc + public init() { + let swift = Sharing.SharedFolderAccessError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SharedFolderMemberError union +@objc +public class DBXSharingSharedFolderMemberError: NSObject { + let swift: Sharing.SharedFolderMemberError + + public init(swift: Sharing.SharedFolderMemberError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharedFolderMemberError) -> DBXSharingSharedFolderMemberError { + switch swift { + case .invalidDropboxId: + return DBXSharingSharedFolderMemberErrorInvalidDropboxId() + case .notAMember: + return DBXSharingSharedFolderMemberErrorNotAMember() + case .noExplicitAccess(let swiftArg): + let arg = DBXSharingMemberAccessLevelResult(swift: swiftArg) + return DBXSharingSharedFolderMemberErrorNoExplicitAccess(arg) + case .other: + return DBXSharingSharedFolderMemberErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidDropboxId: DBXSharingSharedFolderMemberErrorInvalidDropboxId? { + self as? DBXSharingSharedFolderMemberErrorInvalidDropboxId + } + + @objc + public var asNotAMember: DBXSharingSharedFolderMemberErrorNotAMember? { + self as? DBXSharingSharedFolderMemberErrorNotAMember + } + + @objc + public var asNoExplicitAccess: DBXSharingSharedFolderMemberErrorNoExplicitAccess? { + self as? DBXSharingSharedFolderMemberErrorNoExplicitAccess + } + + @objc + public var asOther: DBXSharingSharedFolderMemberErrorOther? { + self as? DBXSharingSharedFolderMemberErrorOther + } +} + +/// The target dropbox_id is invalid. +@objc +public class DBXSharingSharedFolderMemberErrorInvalidDropboxId: DBXSharingSharedFolderMemberError { + @objc + public init() { + let swift = Sharing.SharedFolderMemberError.invalidDropboxId + super.init(swift: swift) + } +} + +/// The target dropbox_id is not a member of the shared folder. +@objc +public class DBXSharingSharedFolderMemberErrorNotAMember: DBXSharingSharedFolderMemberError { + @objc + public init() { + let swift = Sharing.SharedFolderMemberError.notAMember + super.init(swift: swift) + } +} + +/// The target member only has inherited access to the shared folder. +@objc +public class DBXSharingSharedFolderMemberErrorNoExplicitAccess: DBXSharingSharedFolderMemberError { + @objc + public var noExplicitAccess: DBXSharingMemberAccessLevelResult + + @objc + public init(_ arg: DBXSharingMemberAccessLevelResult) { + self.noExplicitAccess = arg + let swift = Sharing.SharedFolderMemberError.noExplicitAccess(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharedFolderMemberErrorOther: DBXSharingSharedFolderMemberError { + @objc + public init() { + let swift = Sharing.SharedFolderMemberError.other + super.init(swift: swift) + } +} + +/// Shared folder user and group membership. +@objc +public class DBXSharingSharedFolderMembers: NSObject { + /// The list of user members of the shared folder. + @objc + public var users: [DBXSharingUserMembershipInfo] { swift.users.map { DBXSharingUserMembershipInfo(swift: $0) } } + /// The list of group members of the shared folder. + @objc + public var groups: [DBXSharingGroupMembershipInfo] { swift.groups.map { DBXSharingGroupMembershipInfo(swift: $0) } } + /// The list of invitees to the shared folder. + @objc + public var invitees: [DBXSharingInviteeMembershipInfo] { swift.invitees.map { DBXSharingInviteeMembershipInfo(swift: $0) } } + /// Present if there are additional shared folder members that have not been returned yet. Pass the cursor into + /// listFolderMembersContinue to list additional members. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(users: [DBXSharingUserMembershipInfo], groups: [DBXSharingGroupMembershipInfo], invitees: [DBXSharingInviteeMembershipInfo], cursor: String?) { + self.swift = Sharing.SharedFolderMembers( + users: users.map(\.subSwift), + groups: groups.map(\.subSwift), + invitees: invitees.map(\.subSwift), + cursor: cursor + ) + } + + let swift: Sharing.SharedFolderMembers + + public init(swift: Sharing.SharedFolderMembers) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Properties of the shared folder. +@objc +public class DBXSharingSharedFolderMetadataBase: NSObject { + /// The current user's access level for this shared folder. + @objc + public var accessType: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.accessType) } + /// Whether this folder is inside of a team folder. + @objc + public var isInsideTeamFolder: NSNumber { swift.isInsideTeamFolder as NSNumber } + /// Whether this folder is a team folder https://www.dropbox.com/en/help/986. + @objc + public var isTeamFolder: NSNumber { swift.isTeamFolder as NSNumber } + /// The display names of the users that own the folder. If the folder is part of a team folder, the display + /// names of the team admins are also included. Absent if the owner display names cannot be fetched. + @objc + public var ownerDisplayNames: [String]? { swift.ownerDisplayNames } + /// The team that owns the folder. This field is not present if the folder is not owned by a team. + @objc + public var ownerTeam: DBXUsersTeam? { guard let swift = swift.ownerTeam else { return nil } + return DBXUsersTeam(swift: swift) + } + + /// The ID of the parent shared folder. This field is present only if the folder is contained within another + /// shared folder. + @objc + public var parentSharedFolderId: String? { swift.parentSharedFolderId } + /// The full path of this shared folder. Absent for unmounted folders. + @objc + public var pathDisplay: String? { swift.pathDisplay } + /// The lower-cased full path of this shared folder. Absent for unmounted folders. + @objc + public var pathLower: String? { swift.pathLower } + /// Display name for the parent folder. + @objc + public var parentFolderName: String? { swift.parentFolderName } + + @objc + public init( + accessType: DBXSharingAccessLevel, + isInsideTeamFolder: NSNumber, + isTeamFolder: NSNumber, + ownerDisplayNames: [String]?, + ownerTeam: DBXUsersTeam?, + parentSharedFolderId: String?, + pathDisplay: String?, + pathLower: String?, + parentFolderName: String? + ) { + self.swift = Sharing.SharedFolderMetadataBase( + accessType: accessType.swift, + isInsideTeamFolder: isInsideTeamFolder.boolValue, + isTeamFolder: isTeamFolder.boolValue, + ownerDisplayNames: ownerDisplayNames, + ownerTeam: ownerTeam?.swift, + parentSharedFolderId: parentSharedFolderId, + pathDisplay: pathDisplay, + pathLower: pathLower, + parentFolderName: parentFolderName + ) + } + + let swift: Sharing.SharedFolderMetadataBase + + public init(swift: Sharing.SharedFolderMetadataBase) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The metadata which includes basic information about the shared folder. +@objc +public class DBXSharingSharedFolderMetadata: DBXSharingSharedFolderMetadataBase { + /// The metadata of the shared content link to this shared folder. Absent if there is no link on the folder. + /// This is for an unreleased feature so it may not be returned yet. + @objc + public var linkMetadata: DBXSharingSharedContentLinkMetadata? { guard let swift = subSwift.linkMetadata else { return nil } + return DBXSharingSharedContentLinkMetadata(swift: swift) + } + + /// The name of the this shared folder. + @objc + public var name: String { subSwift.name } + /// Actions the current user may perform on the folder and its contents. The set of permissions corresponds to + /// the FolderActions in the request. + @objc + public var permissions: [DBXSharingFolderPermission]? { subSwift.permissions?.map { DBXSharingFolderPermission(swift: $0) } } + /// Policies governing this shared folder. + @objc + public var policy: DBXSharingFolderPolicy { DBXSharingFolderPolicy(swift: subSwift.policy) } + /// URL for displaying a web preview of the shared folder. + @objc + public var previewUrl: String { subSwift.previewUrl } + /// The ID of the shared folder. + @objc + public var sharedFolderId: String { subSwift.sharedFolderId } + /// Timestamp indicating when the current user was invited to this shared folder. + @objc + public var timeInvited: Date { subSwift.timeInvited } + /// Whether the folder inherits its members from its parent. + @objc + public var accessInheritance: DBXSharingAccessInheritance { DBXSharingAccessInheritance(swift: subSwift.accessInheritance) } + + @objc + public init( + accessType: DBXSharingAccessLevel, + isInsideTeamFolder: NSNumber, + isTeamFolder: NSNumber, + name: String, + policy: DBXSharingFolderPolicy, + previewUrl: String, + sharedFolderId: String, + timeInvited: Date, + ownerDisplayNames: [String]?, + ownerTeam: DBXUsersTeam?, + parentSharedFolderId: String?, + pathDisplay: String?, + pathLower: String?, + parentFolderName: String?, + linkMetadata: DBXSharingSharedContentLinkMetadata?, + permissions: [DBXSharingFolderPermission]?, + accessInheritance: DBXSharingAccessInheritance + ) { + let swift = Sharing.SharedFolderMetadata( + accessType: accessType.swift, + isInsideTeamFolder: isInsideTeamFolder.boolValue, + isTeamFolder: isTeamFolder.boolValue, + name: name, + policy: policy.swift, + previewUrl: previewUrl, + sharedFolderId: sharedFolderId, + timeInvited: timeInvited, + ownerDisplayNames: ownerDisplayNames, + ownerTeam: ownerTeam?.swift, + parentSharedFolderId: parentSharedFolderId, + pathDisplay: pathDisplay, + pathLower: pathLower, + parentFolderName: parentFolderName, + linkMetadata: linkMetadata?.subSwift, + permissions: permissions?.map(\.swift), + accessInheritance: accessInheritance.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.SharedFolderMetadata + + public init(swift: Sharing.SharedFolderMetadata) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible SharedLinkAccessFailureReason union +@objc +public class DBXSharingSharedLinkAccessFailureReason: NSObject { + let swift: Sharing.SharedLinkAccessFailureReason + + public init(swift: Sharing.SharedLinkAccessFailureReason) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharedLinkAccessFailureReason) -> DBXSharingSharedLinkAccessFailureReason { + switch swift { + case .loginRequired: + return DBXSharingSharedLinkAccessFailureReasonLoginRequired() + case .emailVerifyRequired: + return DBXSharingSharedLinkAccessFailureReasonEmailVerifyRequired() + case .passwordRequired: + return DBXSharingSharedLinkAccessFailureReasonPasswordRequired() + case .teamOnly: + return DBXSharingSharedLinkAccessFailureReasonTeamOnly() + case .ownerOnly: + return DBXSharingSharedLinkAccessFailureReasonOwnerOnly() + case .other: + return DBXSharingSharedLinkAccessFailureReasonOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asLoginRequired: DBXSharingSharedLinkAccessFailureReasonLoginRequired? { + self as? DBXSharingSharedLinkAccessFailureReasonLoginRequired + } + + @objc + public var asEmailVerifyRequired: DBXSharingSharedLinkAccessFailureReasonEmailVerifyRequired? { + self as? DBXSharingSharedLinkAccessFailureReasonEmailVerifyRequired + } + + @objc + public var asPasswordRequired: DBXSharingSharedLinkAccessFailureReasonPasswordRequired? { + self as? DBXSharingSharedLinkAccessFailureReasonPasswordRequired + } + + @objc + public var asTeamOnly: DBXSharingSharedLinkAccessFailureReasonTeamOnly? { + self as? DBXSharingSharedLinkAccessFailureReasonTeamOnly + } + + @objc + public var asOwnerOnly: DBXSharingSharedLinkAccessFailureReasonOwnerOnly? { + self as? DBXSharingSharedLinkAccessFailureReasonOwnerOnly + } + + @objc + public var asOther: DBXSharingSharedLinkAccessFailureReasonOther? { + self as? DBXSharingSharedLinkAccessFailureReasonOther + } +} + +/// User is not logged in. +@objc +public class DBXSharingSharedLinkAccessFailureReasonLoginRequired: DBXSharingSharedLinkAccessFailureReason { + @objc + public init() { + let swift = Sharing.SharedLinkAccessFailureReason.loginRequired + super.init(swift: swift) + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXSharingSharedLinkAccessFailureReasonEmailVerifyRequired: DBXSharingSharedLinkAccessFailureReason { + @objc + public init() { + let swift = Sharing.SharedLinkAccessFailureReason.emailVerifyRequired + super.init(swift: swift) + } +} + +/// The link is password protected. +@objc +public class DBXSharingSharedLinkAccessFailureReasonPasswordRequired: DBXSharingSharedLinkAccessFailureReason { + @objc + public init() { + let swift = Sharing.SharedLinkAccessFailureReason.passwordRequired + super.init(swift: swift) + } +} + +/// Access is allowed for team members only. +@objc +public class DBXSharingSharedLinkAccessFailureReasonTeamOnly: DBXSharingSharedLinkAccessFailureReason { + @objc + public init() { + let swift = Sharing.SharedLinkAccessFailureReason.teamOnly + super.init(swift: swift) + } +} + +/// Access is allowed for the shared link's owner only. +@objc +public class DBXSharingSharedLinkAccessFailureReasonOwnerOnly: DBXSharingSharedLinkAccessFailureReason { + @objc + public init() { + let swift = Sharing.SharedLinkAccessFailureReason.ownerOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharedLinkAccessFailureReasonOther: DBXSharingSharedLinkAccessFailureReason { + @objc + public init() { + let swift = Sharing.SharedLinkAccessFailureReason.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SharedLinkAlreadyExistsMetadata union +@objc +public class DBXSharingSharedLinkAlreadyExistsMetadata: NSObject { + let swift: Sharing.SharedLinkAlreadyExistsMetadata + + public init(swift: Sharing.SharedLinkAlreadyExistsMetadata) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharedLinkAlreadyExistsMetadata) -> DBXSharingSharedLinkAlreadyExistsMetadata { + switch swift { + case .metadata(let swiftArg): + let arg = DBXSharingSharedLinkMetadata(swift: swiftArg) + return DBXSharingSharedLinkAlreadyExistsMetadataMetadata(arg) + case .other: + return DBXSharingSharedLinkAlreadyExistsMetadataOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMetadata: DBXSharingSharedLinkAlreadyExistsMetadataMetadata? { + self as? DBXSharingSharedLinkAlreadyExistsMetadataMetadata + } + + @objc + public var asOther: DBXSharingSharedLinkAlreadyExistsMetadataOther? { + self as? DBXSharingSharedLinkAlreadyExistsMetadataOther + } +} + +/// Metadata of the shared link that already exists. +@objc +public class DBXSharingSharedLinkAlreadyExistsMetadataMetadata: DBXSharingSharedLinkAlreadyExistsMetadata { + @objc + public var metadata: DBXSharingSharedLinkMetadata + + @objc + public init(_ arg: DBXSharingSharedLinkMetadata) { + self.metadata = arg + let swift = Sharing.SharedLinkAlreadyExistsMetadata.metadata(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharedLinkAlreadyExistsMetadataOther: DBXSharingSharedLinkAlreadyExistsMetadata { + @objc + public init() { + let swift = Sharing.SharedLinkAlreadyExistsMetadata.other + super.init(swift: swift) + } +} + +/// Who can view shared links in this folder. +@objc +public class DBXSharingSharedLinkPolicy: NSObject { + let swift: Sharing.SharedLinkPolicy + + public init(swift: Sharing.SharedLinkPolicy) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharedLinkPolicy) -> DBXSharingSharedLinkPolicy { + switch swift { + case .anyone: + return DBXSharingSharedLinkPolicyAnyone() + case .team: + return DBXSharingSharedLinkPolicyTeam() + case .members: + return DBXSharingSharedLinkPolicyMembers() + case .other: + return DBXSharingSharedLinkPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAnyone: DBXSharingSharedLinkPolicyAnyone? { + self as? DBXSharingSharedLinkPolicyAnyone + } + + @objc + public var asTeam: DBXSharingSharedLinkPolicyTeam? { + self as? DBXSharingSharedLinkPolicyTeam + } + + @objc + public var asMembers: DBXSharingSharedLinkPolicyMembers? { + self as? DBXSharingSharedLinkPolicyMembers + } + + @objc + public var asOther: DBXSharingSharedLinkPolicyOther? { + self as? DBXSharingSharedLinkPolicyOther + } +} + +/// Links can be shared with anyone. +@objc +public class DBXSharingSharedLinkPolicyAnyone: DBXSharingSharedLinkPolicy { + @objc + public init() { + let swift = Sharing.SharedLinkPolicy.anyone + super.init(swift: swift) + } +} + +/// Links can be shared with anyone on the same team as the owner. +@objc +public class DBXSharingSharedLinkPolicyTeam: DBXSharingSharedLinkPolicy { + @objc + public init() { + let swift = Sharing.SharedLinkPolicy.team + super.init(swift: swift) + } +} + +/// Links can only be shared among members of the shared folder. +@objc +public class DBXSharingSharedLinkPolicyMembers: DBXSharingSharedLinkPolicy { + @objc + public init() { + let swift = Sharing.SharedLinkPolicy.members + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharedLinkPolicyOther: DBXSharingSharedLinkPolicy { + @objc + public init() { + let swift = Sharing.SharedLinkPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SharedLinkSettings struct +@objc +public class DBXSharingSharedLinkSettings: NSObject { + /// Boolean flag to enable or disable password protection. + @objc + public var requirePassword: NSNumber? { swift.requirePassword as NSNumber? } + /// If requirePassword is true, this is needed to specify the password to access the link. + @objc + public var linkPassword: String? { swift.linkPassword } + /// Expiration time of the shared link. By default the link won't expire. + @objc + public var expires: Date? { swift.expires } + /// The new audience who can benefit from the access level specified by the link's access level specified in the + /// `link_access_level` field of `LinkPermissions`. This is used in conjunction with team policies and + /// shared folder policies to determine the final effective audience type in the `effective_audience` field + /// of `LinkPermissions. + @objc + public var audience: DBXSharingLinkAudience? { guard let swift = swift.audience else { return nil } + return DBXSharingLinkAudience(swift: swift) + } + + /// Requested access level you want the audience to gain from this link. Note, modifying access level for an + /// existing link is not supported. + @objc + public var access: DBXSharingRequestedLinkAccessLevel? { guard let swift = swift.access else { return nil } + return DBXSharingRequestedLinkAccessLevel(swift: swift) + } + + /// Use audience instead. The requested access for this shared link. + @objc + public var requestedVisibility: DBXSharingRequestedVisibility? { guard let swift = swift.requestedVisibility else { return nil } + return DBXSharingRequestedVisibility(swift: swift) + } + + /// Boolean flag to allow or not download capabilities for shared links. + @objc + public var allowDownload: NSNumber? { swift.allowDownload as NSNumber? } + + @objc + public init( + requirePassword: NSNumber?, + linkPassword: String?, + expires: Date?, + audience: DBXSharingLinkAudience?, + access: DBXSharingRequestedLinkAccessLevel?, + requestedVisibility: DBXSharingRequestedVisibility?, + allowDownload: NSNumber? + ) { + self.swift = Sharing.SharedLinkSettings( + requirePassword: requirePassword?.boolValue, + linkPassword: linkPassword, + expires: expires, + audience: audience?.swift, + access: access?.swift, + requestedVisibility: requestedVisibility?.swift, + allowDownload: allowDownload?.boolValue + ) + } + + let swift: Sharing.SharedLinkSettings + + public init(swift: Sharing.SharedLinkSettings) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsError union +@objc +public class DBXSharingSharedLinkSettingsError: NSObject { + let swift: Sharing.SharedLinkSettingsError + + public init(swift: Sharing.SharedLinkSettingsError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharedLinkSettingsError) -> DBXSharingSharedLinkSettingsError { + switch swift { + case .invalidSettings: + return DBXSharingSharedLinkSettingsErrorInvalidSettings() + case .notAuthorized: + return DBXSharingSharedLinkSettingsErrorNotAuthorized() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidSettings: DBXSharingSharedLinkSettingsErrorInvalidSettings? { + self as? DBXSharingSharedLinkSettingsErrorInvalidSettings + } + + @objc + public var asNotAuthorized: DBXSharingSharedLinkSettingsErrorNotAuthorized? { + self as? DBXSharingSharedLinkSettingsErrorNotAuthorized + } +} + +/// The given settings are invalid (for example, all attributes of the SharedLinkSettings are empty, the +/// requested visibility is password in RequestedVisibility but the linkPassword in SharedLinkSettings +/// is missing, expires in SharedLinkSettings is set to the past, etc.). +@objc +public class DBXSharingSharedLinkSettingsErrorInvalidSettings: DBXSharingSharedLinkSettingsError { + @objc + public init() { + let swift = Sharing.SharedLinkSettingsError.invalidSettings + super.init(swift: swift) + } +} + +/// User is not allowed to modify the settings of this link. Note that basic users can only set public_ in +/// RequestedVisibility as the requestedVisibility in SharedLinkSettings and cannot set expires in +/// SharedLinkSettings. +@objc +public class DBXSharingSharedLinkSettingsErrorNotAuthorized: DBXSharingSharedLinkSettingsError { + @objc + public init() { + let swift = Sharing.SharedLinkSettingsError.notAuthorized + super.init(swift: swift) + } +} + +/// User could not access this file. +@objc +public class DBXSharingSharingFileAccessError: NSObject { + let swift: Sharing.SharingFileAccessError + + public init(swift: Sharing.SharingFileAccessError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharingFileAccessError) -> DBXSharingSharingFileAccessError { + switch swift { + case .noPermission: + return DBXSharingSharingFileAccessErrorNoPermission() + case .invalidFile: + return DBXSharingSharingFileAccessErrorInvalidFile() + case .isFolder: + return DBXSharingSharingFileAccessErrorIsFolder() + case .insidePublicFolder: + return DBXSharingSharingFileAccessErrorInsidePublicFolder() + case .insideOsxPackage: + return DBXSharingSharingFileAccessErrorInsideOsxPackage() + case .other: + return DBXSharingSharingFileAccessErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNoPermission: DBXSharingSharingFileAccessErrorNoPermission? { + self as? DBXSharingSharingFileAccessErrorNoPermission + } + + @objc + public var asInvalidFile: DBXSharingSharingFileAccessErrorInvalidFile? { + self as? DBXSharingSharingFileAccessErrorInvalidFile + } + + @objc + public var asIsFolder: DBXSharingSharingFileAccessErrorIsFolder? { + self as? DBXSharingSharingFileAccessErrorIsFolder + } + + @objc + public var asInsidePublicFolder: DBXSharingSharingFileAccessErrorInsidePublicFolder? { + self as? DBXSharingSharingFileAccessErrorInsidePublicFolder + } + + @objc + public var asInsideOsxPackage: DBXSharingSharingFileAccessErrorInsideOsxPackage? { + self as? DBXSharingSharingFileAccessErrorInsideOsxPackage + } + + @objc + public var asOther: DBXSharingSharingFileAccessErrorOther? { + self as? DBXSharingSharingFileAccessErrorOther + } +} + +/// Current user does not have sufficient privileges to perform the desired action. +@objc +public class DBXSharingSharingFileAccessErrorNoPermission: DBXSharingSharingFileAccessError { + @objc + public init() { + let swift = Sharing.SharingFileAccessError.noPermission + super.init(swift: swift) + } +} + +/// File specified was not found. +@objc +public class DBXSharingSharingFileAccessErrorInvalidFile: DBXSharingSharingFileAccessError { + @objc + public init() { + let swift = Sharing.SharingFileAccessError.invalidFile + super.init(swift: swift) + } +} + +/// A folder can't be shared this way. Use folder sharing or a shared link instead. +@objc +public class DBXSharingSharingFileAccessErrorIsFolder: DBXSharingSharingFileAccessError { + @objc + public init() { + let swift = Sharing.SharingFileAccessError.isFolder + super.init(swift: swift) + } +} + +/// A file inside a public folder can't be shared this way. Use a public link instead. +@objc +public class DBXSharingSharingFileAccessErrorInsidePublicFolder: DBXSharingSharingFileAccessError { + @objc + public init() { + let swift = Sharing.SharingFileAccessError.insidePublicFolder + super.init(swift: swift) + } +} + +/// A Mac OS X package can't be shared this way. Use a shared link instead. +@objc +public class DBXSharingSharingFileAccessErrorInsideOsxPackage: DBXSharingSharingFileAccessError { + @objc + public init() { + let swift = Sharing.SharingFileAccessError.insideOsxPackage + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharingFileAccessErrorOther: DBXSharingSharingFileAccessError { + @objc + public init() { + let swift = Sharing.SharingFileAccessError.other + super.init(swift: swift) + } +} + +/// User account had a problem preventing this action. +@objc +public class DBXSharingSharingUserError: NSObject { + let swift: Sharing.SharingUserError + + public init(swift: Sharing.SharingUserError) { + self.swift = swift + } + + public static func factory(swift: Sharing.SharingUserError) -> DBXSharingSharingUserError { + switch swift { + case .emailUnverified: + return DBXSharingSharingUserErrorEmailUnverified() + case .other: + return DBXSharingSharingUserErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEmailUnverified: DBXSharingSharingUserErrorEmailUnverified? { + self as? DBXSharingSharingUserErrorEmailUnverified + } + + @objc + public var asOther: DBXSharingSharingUserErrorOther? { + self as? DBXSharingSharingUserErrorOther + } +} + +/// This user's email address is not verified. This functionality is only available on accounts with a verified +/// email address. Users can verify their email address here https://www.dropbox.com/help/317. +@objc +public class DBXSharingSharingUserErrorEmailUnverified: DBXSharingSharingUserError { + @objc + public init() { + let swift = Sharing.SharingUserError.emailUnverified + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingSharingUserErrorOther: DBXSharingSharingUserError { + @objc + public init() { + let swift = Sharing.SharingUserError.other + super.init(swift: swift) + } +} + +/// Information about a team member. +@objc +public class DBXSharingTeamMemberInfo: NSObject { + /// Information about the member's team. + @objc + public var teamInfo: DBXUsersTeam { DBXUsersTeam(swift: swift.teamInfo) } + /// The display name of the user. + @objc + public var displayName: String { swift.displayName } + /// ID of user as a member of a team. This field will only be present if the member is in the same team as + /// current user. + @objc + public var memberId: String? { swift.memberId } + + @objc + public init(teamInfo: DBXUsersTeam, displayName: String, memberId: String?) { + self.swift = Sharing.TeamMemberInfo(teamInfo: teamInfo.swift, displayName: displayName, memberId: memberId) + } + + let swift: Sharing.TeamMemberInfo + + public init(swift: Sharing.TeamMemberInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TransferFolderArg struct +@objc +public class DBXSharingTransferFolderArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// A account or team member ID to transfer ownership to. + @objc + public var toDropboxId: String { swift.toDropboxId } + + @objc + public init(sharedFolderId: String, toDropboxId: String) { + self.swift = Sharing.TransferFolderArg(sharedFolderId: sharedFolderId, toDropboxId: toDropboxId) + } + + let swift: Sharing.TransferFolderArg + + public init(swift: Sharing.TransferFolderArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TransferFolderError union +@objc +public class DBXSharingTransferFolderError: NSObject { + let swift: Sharing.TransferFolderError + + public init(swift: Sharing.TransferFolderError) { + self.swift = swift + } + + public static func factory(swift: Sharing.TransferFolderError) -> DBXSharingTransferFolderError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingTransferFolderErrorAccessError(arg) + case .invalidDropboxId: + return DBXSharingTransferFolderErrorInvalidDropboxId() + case .newOwnerNotAMember: + return DBXSharingTransferFolderErrorNewOwnerNotAMember() + case .newOwnerUnmounted: + return DBXSharingTransferFolderErrorNewOwnerUnmounted() + case .newOwnerEmailUnverified: + return DBXSharingTransferFolderErrorNewOwnerEmailUnverified() + case .teamFolder: + return DBXSharingTransferFolderErrorTeamFolder() + case .noPermission: + return DBXSharingTransferFolderErrorNoPermission() + case .other: + return DBXSharingTransferFolderErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingTransferFolderErrorAccessError? { + self as? DBXSharingTransferFolderErrorAccessError + } + + @objc + public var asInvalidDropboxId: DBXSharingTransferFolderErrorInvalidDropboxId? { + self as? DBXSharingTransferFolderErrorInvalidDropboxId + } + + @objc + public var asNewOwnerNotAMember: DBXSharingTransferFolderErrorNewOwnerNotAMember? { + self as? DBXSharingTransferFolderErrorNewOwnerNotAMember + } + + @objc + public var asNewOwnerUnmounted: DBXSharingTransferFolderErrorNewOwnerUnmounted? { + self as? DBXSharingTransferFolderErrorNewOwnerUnmounted + } + + @objc + public var asNewOwnerEmailUnverified: DBXSharingTransferFolderErrorNewOwnerEmailUnverified? { + self as? DBXSharingTransferFolderErrorNewOwnerEmailUnverified + } + + @objc + public var asTeamFolder: DBXSharingTransferFolderErrorTeamFolder? { + self as? DBXSharingTransferFolderErrorTeamFolder + } + + @objc + public var asNoPermission: DBXSharingTransferFolderErrorNoPermission? { + self as? DBXSharingTransferFolderErrorNoPermission + } + + @objc + public var asOther: DBXSharingTransferFolderErrorOther? { + self as? DBXSharingTransferFolderErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingTransferFolderErrorAccessError: DBXSharingTransferFolderError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.TransferFolderError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// toDropboxId in TransferFolderArg is invalid. +@objc +public class DBXSharingTransferFolderErrorInvalidDropboxId: DBXSharingTransferFolderError { + @objc + public init() { + let swift = Sharing.TransferFolderError.invalidDropboxId + super.init(swift: swift) + } +} + +/// The new designated owner is not currently a member of the shared folder. +@objc +public class DBXSharingTransferFolderErrorNewOwnerNotAMember: DBXSharingTransferFolderError { + @objc + public init() { + let swift = Sharing.TransferFolderError.newOwnerNotAMember + super.init(swift: swift) + } +} + +/// The new designated owner has not added the folder to their Dropbox. +@objc +public class DBXSharingTransferFolderErrorNewOwnerUnmounted: DBXSharingTransferFolderError { + @objc + public init() { + let swift = Sharing.TransferFolderError.newOwnerUnmounted + super.init(swift: swift) + } +} + +/// The new designated owner's email address is not verified. This functionality is only available on accounts +/// with a verified email address. Users can verify their email address here +/// https://www.dropbox.com/help/317. +@objc +public class DBXSharingTransferFolderErrorNewOwnerEmailUnverified: DBXSharingTransferFolderError { + @objc + public init() { + let swift = Sharing.TransferFolderError.newOwnerEmailUnverified + super.init(swift: swift) + } +} + +/// This action cannot be performed on a team shared folder. +@objc +public class DBXSharingTransferFolderErrorTeamFolder: DBXSharingTransferFolderError { + @objc + public init() { + let swift = Sharing.TransferFolderError.teamFolder + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingTransferFolderErrorNoPermission: DBXSharingTransferFolderError { + @objc + public init() { + let swift = Sharing.TransferFolderError.noPermission + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingTransferFolderErrorOther: DBXSharingTransferFolderError { + @objc + public init() { + let swift = Sharing.TransferFolderError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UnmountFolderArg struct +@objc +public class DBXSharingUnmountFolderArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + + @objc + public init(sharedFolderId: String) { + self.swift = Sharing.UnmountFolderArg(sharedFolderId: sharedFolderId) + } + + let swift: Sharing.UnmountFolderArg + + public init(swift: Sharing.UnmountFolderArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UnmountFolderError union +@objc +public class DBXSharingUnmountFolderError: NSObject { + let swift: Sharing.UnmountFolderError + + public init(swift: Sharing.UnmountFolderError) { + self.swift = swift + } + + public static func factory(swift: Sharing.UnmountFolderError) -> DBXSharingUnmountFolderError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingUnmountFolderErrorAccessError(arg) + case .noPermission: + return DBXSharingUnmountFolderErrorNoPermission() + case .notUnmountable: + return DBXSharingUnmountFolderErrorNotUnmountable() + case .other: + return DBXSharingUnmountFolderErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingUnmountFolderErrorAccessError? { + self as? DBXSharingUnmountFolderErrorAccessError + } + + @objc + public var asNoPermission: DBXSharingUnmountFolderErrorNoPermission? { + self as? DBXSharingUnmountFolderErrorNoPermission + } + + @objc + public var asNotUnmountable: DBXSharingUnmountFolderErrorNotUnmountable? { + self as? DBXSharingUnmountFolderErrorNotUnmountable + } + + @objc + public var asOther: DBXSharingUnmountFolderErrorOther? { + self as? DBXSharingUnmountFolderErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingUnmountFolderErrorAccessError: DBXSharingUnmountFolderError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.UnmountFolderError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingUnmountFolderErrorNoPermission: DBXSharingUnmountFolderError { + @objc + public init() { + let swift = Sharing.UnmountFolderError.noPermission + super.init(swift: swift) + } +} + +/// The shared folder can't be unmounted. One example where this can occur is when the shared folder's parent +/// folder is also a shared folder that resides in the current user's Dropbox. +@objc +public class DBXSharingUnmountFolderErrorNotUnmountable: DBXSharingUnmountFolderError { + @objc + public init() { + let swift = Sharing.UnmountFolderError.notUnmountable + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingUnmountFolderErrorOther: DBXSharingUnmountFolderError { + @objc + public init() { + let swift = Sharing.UnmountFolderError.other + super.init(swift: swift) + } +} + +/// Arguments for unshareFile. +@objc +public class DBXSharingUnshareFileArg: NSObject { + /// The file to unshare. + @objc + public var file: String { swift.file } + + @objc + public init(file: String) { + self.swift = Sharing.UnshareFileArg(file: file) + } + + let swift: Sharing.UnshareFileArg + + public init(swift: Sharing.UnshareFileArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error result for unshareFile. +@objc +public class DBXSharingUnshareFileError: NSObject { + let swift: Sharing.UnshareFileError + + public init(swift: Sharing.UnshareFileError) { + self.swift = swift + } + + public static func factory(swift: Sharing.UnshareFileError) -> DBXSharingUnshareFileError { + switch swift { + case .userError(let swiftArg): + let arg = DBXSharingSharingUserError(swift: swiftArg) + return DBXSharingUnshareFileErrorUserError(arg) + case .accessError(let swiftArg): + let arg = DBXSharingSharingFileAccessError(swift: swiftArg) + return DBXSharingUnshareFileErrorAccessError(arg) + case .other: + return DBXSharingUnshareFileErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserError: DBXSharingUnshareFileErrorUserError? { + self as? DBXSharingUnshareFileErrorUserError + } + + @objc + public var asAccessError: DBXSharingUnshareFileErrorAccessError? { + self as? DBXSharingUnshareFileErrorAccessError + } + + @objc + public var asOther: DBXSharingUnshareFileErrorOther? { + self as? DBXSharingUnshareFileErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingUnshareFileErrorUserError: DBXSharingUnshareFileError { + @objc + public var userError: DBXSharingSharingUserError + + @objc + public init(_ arg: DBXSharingSharingUserError) { + self.userError = arg + let swift = Sharing.UnshareFileError.userError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingUnshareFileErrorAccessError: DBXSharingUnshareFileError { + @objc + public var accessError: DBXSharingSharingFileAccessError + + @objc + public init(_ arg: DBXSharingSharingFileAccessError) { + self.accessError = arg + let swift = Sharing.UnshareFileError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingUnshareFileErrorOther: DBXSharingUnshareFileError { + @objc + public init() { + let swift = Sharing.UnshareFileError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UnshareFolderArg struct +@objc +public class DBXSharingUnshareFolderArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// If true, members of this shared folder will get a copy of this folder after it's unshared. Otherwise, it + /// will be removed from their Dropbox. The current user, who is an owner, will always retain their copy. + @objc + public var leaveACopy: NSNumber { swift.leaveACopy as NSNumber } + + @objc + public init(sharedFolderId: String, leaveACopy: NSNumber) { + self.swift = Sharing.UnshareFolderArg(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy.boolValue) + } + + let swift: Sharing.UnshareFolderArg + + public init(swift: Sharing.UnshareFolderArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UnshareFolderError union +@objc +public class DBXSharingUnshareFolderError: NSObject { + let swift: Sharing.UnshareFolderError + + public init(swift: Sharing.UnshareFolderError) { + self.swift = swift + } + + public static func factory(swift: Sharing.UnshareFolderError) -> DBXSharingUnshareFolderError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingUnshareFolderErrorAccessError(arg) + case .teamFolder: + return DBXSharingUnshareFolderErrorTeamFolder() + case .noPermission: + return DBXSharingUnshareFolderErrorNoPermission() + case .tooManyFiles: + return DBXSharingUnshareFolderErrorTooManyFiles() + case .other: + return DBXSharingUnshareFolderErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingUnshareFolderErrorAccessError? { + self as? DBXSharingUnshareFolderErrorAccessError + } + + @objc + public var asTeamFolder: DBXSharingUnshareFolderErrorTeamFolder? { + self as? DBXSharingUnshareFolderErrorTeamFolder + } + + @objc + public var asNoPermission: DBXSharingUnshareFolderErrorNoPermission? { + self as? DBXSharingUnshareFolderErrorNoPermission + } + + @objc + public var asTooManyFiles: DBXSharingUnshareFolderErrorTooManyFiles? { + self as? DBXSharingUnshareFolderErrorTooManyFiles + } + + @objc + public var asOther: DBXSharingUnshareFolderErrorOther? { + self as? DBXSharingUnshareFolderErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingUnshareFolderErrorAccessError: DBXSharingUnshareFolderError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.UnshareFolderError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// This action cannot be performed on a team shared folder. +@objc +public class DBXSharingUnshareFolderErrorTeamFolder: DBXSharingUnshareFolderError { + @objc + public init() { + let swift = Sharing.UnshareFolderError.teamFolder + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingUnshareFolderErrorNoPermission: DBXSharingUnshareFolderError { + @objc + public init() { + let swift = Sharing.UnshareFolderError.noPermission + super.init(swift: swift) + } +} + +/// This shared folder has too many files to be unshared. +@objc +public class DBXSharingUnshareFolderErrorTooManyFiles: DBXSharingUnshareFolderError { + @objc + public init() { + let swift = Sharing.UnshareFolderError.tooManyFiles + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingUnshareFolderErrorOther: DBXSharingUnshareFolderError { + @objc + public init() { + let swift = Sharing.UnshareFolderError.other + super.init(swift: swift) + } +} + +/// Arguments for updateFileMember. +@objc +public class DBXSharingUpdateFileMemberArgs: NSObject { + /// File for which we are changing a member's access. + @objc + public var file: String { swift.file } + /// The member whose access we are changing. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + /// The new access level for the member. + @objc + public var accessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.accessLevel) } + + @objc + public init(file: String, member: DBXSharingMemberSelector, accessLevel: DBXSharingAccessLevel) { + self.swift = Sharing.UpdateFileMemberArgs(file: file, member: member.swift, accessLevel: accessLevel.swift) + } + + let swift: Sharing.UpdateFileMemberArgs + + public init(swift: Sharing.UpdateFileMemberArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UpdateFolderMemberArg struct +@objc +public class DBXSharingUpdateFolderMemberArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// The member of the shared folder to update. Only the dropboxId in MemberSelector may be set at this time. + @objc + public var member: DBXSharingMemberSelector { DBXSharingMemberSelector(swift: swift.member) } + /// The new access level for member. owner in AccessLevel is disallowed. + @objc + public var accessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.accessLevel) } + + @objc + public init(sharedFolderId: String, member: DBXSharingMemberSelector, accessLevel: DBXSharingAccessLevel) { + self.swift = Sharing.UpdateFolderMemberArg(sharedFolderId: sharedFolderId, member: member.swift, accessLevel: accessLevel.swift) + } + + let swift: Sharing.UpdateFolderMemberArg + + public init(swift: Sharing.UpdateFolderMemberArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UpdateFolderMemberError union +@objc +public class DBXSharingUpdateFolderMemberError: NSObject { + let swift: Sharing.UpdateFolderMemberError + + public init(swift: Sharing.UpdateFolderMemberError) { + self.swift = swift + } + + public static func factory(swift: Sharing.UpdateFolderMemberError) -> DBXSharingUpdateFolderMemberError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingUpdateFolderMemberErrorAccessError(arg) + case .memberError(let swiftArg): + let arg = DBXSharingSharedFolderMemberError(swift: swiftArg) + return DBXSharingUpdateFolderMemberErrorMemberError(arg) + case .noExplicitAccess(let swiftArg): + let arg = DBXSharingAddFolderMemberError(swift: swiftArg) + return DBXSharingUpdateFolderMemberErrorNoExplicitAccess(arg) + case .insufficientPlan: + return DBXSharingUpdateFolderMemberErrorInsufficientPlan() + case .noPermission: + return DBXSharingUpdateFolderMemberErrorNoPermission() + case .other: + return DBXSharingUpdateFolderMemberErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingUpdateFolderMemberErrorAccessError? { + self as? DBXSharingUpdateFolderMemberErrorAccessError + } + + @objc + public var asMemberError: DBXSharingUpdateFolderMemberErrorMemberError? { + self as? DBXSharingUpdateFolderMemberErrorMemberError + } + + @objc + public var asNoExplicitAccess: DBXSharingUpdateFolderMemberErrorNoExplicitAccess? { + self as? DBXSharingUpdateFolderMemberErrorNoExplicitAccess + } + + @objc + public var asInsufficientPlan: DBXSharingUpdateFolderMemberErrorInsufficientPlan? { + self as? DBXSharingUpdateFolderMemberErrorInsufficientPlan + } + + @objc + public var asNoPermission: DBXSharingUpdateFolderMemberErrorNoPermission? { + self as? DBXSharingUpdateFolderMemberErrorNoPermission + } + + @objc + public var asOther: DBXSharingUpdateFolderMemberErrorOther? { + self as? DBXSharingUpdateFolderMemberErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingUpdateFolderMemberErrorAccessError: DBXSharingUpdateFolderMemberError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.UpdateFolderMemberError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingUpdateFolderMemberErrorMemberError: DBXSharingUpdateFolderMemberError { + @objc + public var memberError: DBXSharingSharedFolderMemberError + + @objc + public init(_ arg: DBXSharingSharedFolderMemberError) { + self.memberError = arg + let swift = Sharing.UpdateFolderMemberError.memberError(arg.swift) + super.init(swift: swift) + } +} + +/// If updating the access type required the member to be added to the shared folder and there was an error when +/// adding the member. +@objc +public class DBXSharingUpdateFolderMemberErrorNoExplicitAccess: DBXSharingUpdateFolderMemberError { + @objc + public var noExplicitAccess: DBXSharingAddFolderMemberError + + @objc + public init(_ arg: DBXSharingAddFolderMemberError) { + self.noExplicitAccess = arg + let swift = Sharing.UpdateFolderMemberError.noExplicitAccess(arg.swift) + super.init(swift: swift) + } +} + +/// The current user's account doesn't support this action. An example of this is when downgrading a member from +/// editor to viewer. This action can only be performed by users that have upgraded to a Pro or Business +/// plan. +@objc +public class DBXSharingUpdateFolderMemberErrorInsufficientPlan: DBXSharingUpdateFolderMemberError { + @objc + public init() { + let swift = Sharing.UpdateFolderMemberError.insufficientPlan + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingUpdateFolderMemberErrorNoPermission: DBXSharingUpdateFolderMemberError { + @objc + public init() { + let swift = Sharing.UpdateFolderMemberError.noPermission + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingUpdateFolderMemberErrorOther: DBXSharingUpdateFolderMemberError { + @objc + public init() { + let swift = Sharing.UpdateFolderMemberError.other + super.init(swift: swift) + } +} + +/// If any of the policies are unset, then they retain their current setting. +@objc +public class DBXSharingUpdateFolderPolicyArg: NSObject { + /// The ID for the shared folder. + @objc + public var sharedFolderId: String { swift.sharedFolderId } + /// Who can be a member of this shared folder. Only applicable if the current user is on a team. + @objc + public var memberPolicy: DBXSharingMemberPolicy? { guard let swift = swift.memberPolicy else { return nil } + return DBXSharingMemberPolicy(swift: swift) + } + + /// Who can add and remove members of this shared folder. + @objc + public var aclUpdatePolicy: DBXSharingAclUpdatePolicy? { guard let swift = swift.aclUpdatePolicy else { return nil } + return DBXSharingAclUpdatePolicy(swift: swift) + } + + /// Who can enable/disable viewer info for this shared folder. + @objc + public var viewerInfoPolicy: DBXSharingViewerInfoPolicy? { guard let swift = swift.viewerInfoPolicy else { return nil } + return DBXSharingViewerInfoPolicy(swift: swift) + } + + /// The policy to apply to shared links created for content inside this shared folder. The current user must be + /// on a team to set this policy to members in SharedLinkPolicy. + @objc + public var sharedLinkPolicy: DBXSharingSharedLinkPolicy? { guard let swift = swift.sharedLinkPolicy else { return nil } + return DBXSharingSharedLinkPolicy(swift: swift) + } + + /// Settings on the link for this folder. + @objc + public var linkSettings: DBXSharingLinkSettings? { guard let swift = swift.linkSettings else { return nil } + return DBXSharingLinkSettings(swift: swift) + } + + /// A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's + /// permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on + /// the folder. + @objc + public var actions: [DBXSharingFolderAction]? { swift.actions?.map { DBXSharingFolderAction(swift: $0) } } + + @objc + public init( + sharedFolderId: String, + memberPolicy: DBXSharingMemberPolicy?, + aclUpdatePolicy: DBXSharingAclUpdatePolicy?, + viewerInfoPolicy: DBXSharingViewerInfoPolicy?, + sharedLinkPolicy: DBXSharingSharedLinkPolicy?, + linkSettings: DBXSharingLinkSettings?, + actions: [DBXSharingFolderAction]? + ) { + self.swift = Sharing.UpdateFolderPolicyArg( + sharedFolderId: sharedFolderId, + memberPolicy: memberPolicy?.swift, + aclUpdatePolicy: aclUpdatePolicy?.swift, + viewerInfoPolicy: viewerInfoPolicy?.swift, + sharedLinkPolicy: sharedLinkPolicy?.swift, + linkSettings: linkSettings?.swift, + actions: actions?.map(\.swift) + ) + } + + let swift: Sharing.UpdateFolderPolicyArg + + public init(swift: Sharing.UpdateFolderPolicyArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UpdateFolderPolicyError union +@objc +public class DBXSharingUpdateFolderPolicyError: NSObject { + let swift: Sharing.UpdateFolderPolicyError + + public init(swift: Sharing.UpdateFolderPolicyError) { + self.swift = swift + } + + public static func factory(swift: Sharing.UpdateFolderPolicyError) -> DBXSharingUpdateFolderPolicyError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXSharingSharedFolderAccessError(swift: swiftArg) + return DBXSharingUpdateFolderPolicyErrorAccessError(arg) + case .notOnTeam: + return DBXSharingUpdateFolderPolicyErrorNotOnTeam() + case .teamPolicyDisallowsMemberPolicy: + return DBXSharingUpdateFolderPolicyErrorTeamPolicyDisallowsMemberPolicy() + case .disallowedSharedLinkPolicy: + return DBXSharingUpdateFolderPolicyErrorDisallowedSharedLinkPolicy() + case .noPermission: + return DBXSharingUpdateFolderPolicyErrorNoPermission() + case .teamFolder: + return DBXSharingUpdateFolderPolicyErrorTeamFolder() + case .other: + return DBXSharingUpdateFolderPolicyErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXSharingUpdateFolderPolicyErrorAccessError? { + self as? DBXSharingUpdateFolderPolicyErrorAccessError + } + + @objc + public var asNotOnTeam: DBXSharingUpdateFolderPolicyErrorNotOnTeam? { + self as? DBXSharingUpdateFolderPolicyErrorNotOnTeam + } + + @objc + public var asTeamPolicyDisallowsMemberPolicy: DBXSharingUpdateFolderPolicyErrorTeamPolicyDisallowsMemberPolicy? { + self as? DBXSharingUpdateFolderPolicyErrorTeamPolicyDisallowsMemberPolicy + } + + @objc + public var asDisallowedSharedLinkPolicy: DBXSharingUpdateFolderPolicyErrorDisallowedSharedLinkPolicy? { + self as? DBXSharingUpdateFolderPolicyErrorDisallowedSharedLinkPolicy + } + + @objc + public var asNoPermission: DBXSharingUpdateFolderPolicyErrorNoPermission? { + self as? DBXSharingUpdateFolderPolicyErrorNoPermission + } + + @objc + public var asTeamFolder: DBXSharingUpdateFolderPolicyErrorTeamFolder? { + self as? DBXSharingUpdateFolderPolicyErrorTeamFolder + } + + @objc + public var asOther: DBXSharingUpdateFolderPolicyErrorOther? { + self as? DBXSharingUpdateFolderPolicyErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXSharingUpdateFolderPolicyErrorAccessError: DBXSharingUpdateFolderPolicyError { + @objc + public var accessError: DBXSharingSharedFolderAccessError + + @objc + public init(_ arg: DBXSharingSharedFolderAccessError) { + self.accessError = arg + let swift = Sharing.UpdateFolderPolicyError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// memberPolicy in UpdateFolderPolicyArg was set even though user is not on a team. +@objc +public class DBXSharingUpdateFolderPolicyErrorNotOnTeam: DBXSharingUpdateFolderPolicyError { + @objc + public init() { + let swift = Sharing.UpdateFolderPolicyError.notOnTeam + super.init(swift: swift) + } +} + +/// Team policy is more restrictive than memberPolicy in ShareFolderArg. +@objc +public class DBXSharingUpdateFolderPolicyErrorTeamPolicyDisallowsMemberPolicy: DBXSharingUpdateFolderPolicyError { + @objc + public init() { + let swift = Sharing.UpdateFolderPolicyError.teamPolicyDisallowsMemberPolicy + super.init(swift: swift) + } +} + +/// The current account is not allowed to select the specified sharedLinkPolicy in ShareFolderArg. +@objc +public class DBXSharingUpdateFolderPolicyErrorDisallowedSharedLinkPolicy: DBXSharingUpdateFolderPolicyError { + @objc + public init() { + let swift = Sharing.UpdateFolderPolicyError.disallowedSharedLinkPolicy + super.init(swift: swift) + } +} + +/// The current user does not have permission to perform this action. +@objc +public class DBXSharingUpdateFolderPolicyErrorNoPermission: DBXSharingUpdateFolderPolicyError { + @objc + public init() { + let swift = Sharing.UpdateFolderPolicyError.noPermission + super.init(swift: swift) + } +} + +/// This action cannot be performed on a team shared folder. +@objc +public class DBXSharingUpdateFolderPolicyErrorTeamFolder: DBXSharingUpdateFolderPolicyError { + @objc + public init() { + let swift = Sharing.UpdateFolderPolicyError.teamFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingUpdateFolderPolicyErrorOther: DBXSharingUpdateFolderPolicyError { + @objc + public init() { + let swift = Sharing.UpdateFolderPolicyError.other + super.init(swift: swift) + } +} + +/// The information about a user member of the shared content. +@objc +public class DBXSharingUserMembershipInfo: DBXSharingMembershipInfo { + /// The account information for the membership user. + @objc + public var user: DBXSharingUserInfo { DBXSharingUserInfo(swift: subSwift.user) } + + @objc + public init( + accessType: DBXSharingAccessLevel, + user: DBXSharingUserInfo, + permissions: [DBXSharingMemberPermission]?, + initials: String?, + isInherited: NSNumber + ) { + let swift = Sharing.UserMembershipInfo( + accessType: accessType.swift, + user: user.swift, + permissions: permissions?.map(\.swift), + initials: initials, + isInherited: isInherited.boolValue + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Sharing.UserMembershipInfo + + public init(swift: Sharing.UserMembershipInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// The information about a user member of the shared content with an appended last seen timestamp. +@objc +public class DBXSharingUserFileMembershipInfo: DBXSharingUserMembershipInfo { + /// The UTC timestamp of when the user has last seen the content. Only populated if the user has seen the + /// content and the caller has a plan that includes viewer history. + @objc + public var timeLastSeen: Date? { subSubSwift.timeLastSeen } + /// The platform on which the user has last seen the content, or unknown. + @objc + public var platformType: DBXSeenStatePlatformType? { guard let swift = subSubSwift.platformType else { return nil } + return DBXSeenStatePlatformType(swift: swift) + } + + @objc + public init( + accessType: DBXSharingAccessLevel, + user: DBXSharingUserInfo, + permissions: [DBXSharingMemberPermission]?, + initials: String?, + isInherited: NSNumber, + timeLastSeen: Date?, + platformType: DBXSeenStatePlatformType? + ) { + let swift = Sharing.UserFileMembershipInfo( + accessType: accessType.swift, + user: user.swift, + permissions: permissions?.map(\.swift), + initials: initials, + isInherited: isInherited.boolValue, + timeLastSeen: timeLastSeen, + platformType: platformType?.swift + ) + self.subSubSwift = swift + super.init(swift: swift) + } + + let subSubSwift: Sharing.UserFileMembershipInfo + + public init(swift: Sharing.UserFileMembershipInfo) { + self.subSubSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Basic information about a user. Use usersAccount and usersAccountBatch to obtain more detailed information. +@objc +public class DBXSharingUserInfo: NSObject { + /// The account ID of the user. + @objc + public var accountId: String { swift.accountId } + /// Email address of user. + @objc + public var email: String { swift.email } + /// The display name of the user. + @objc + public var displayName: String { swift.displayName } + /// If the user is in the same team as current user. + @objc + public var sameTeam: NSNumber { swift.sameTeam as NSNumber } + /// The team member ID of the shared folder member. Only present if sameTeam is true. + @objc + public var teamMemberId: String? { swift.teamMemberId } + + @objc + public init(accountId: String, email: String, displayName: String, sameTeam: NSNumber, teamMemberId: String?) { + self.swift = Sharing.UserInfo(accountId: accountId, email: email, displayName: displayName, sameTeam: sameTeam.boolValue, teamMemberId: teamMemberId) + } + + let swift: Sharing.UserInfo + + public init(swift: Sharing.UserInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ViewerInfoPolicy union +@objc +public class DBXSharingViewerInfoPolicy: NSObject { + let swift: Sharing.ViewerInfoPolicy + + public init(swift: Sharing.ViewerInfoPolicy) { + self.swift = swift + } + + public static func factory(swift: Sharing.ViewerInfoPolicy) -> DBXSharingViewerInfoPolicy { + switch swift { + case .enabled: + return DBXSharingViewerInfoPolicyEnabled() + case .disabled: + return DBXSharingViewerInfoPolicyDisabled() + case .other: + return DBXSharingViewerInfoPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEnabled: DBXSharingViewerInfoPolicyEnabled? { + self as? DBXSharingViewerInfoPolicyEnabled + } + + @objc + public var asDisabled: DBXSharingViewerInfoPolicyDisabled? { + self as? DBXSharingViewerInfoPolicyDisabled + } + + @objc + public var asOther: DBXSharingViewerInfoPolicyOther? { + self as? DBXSharingViewerInfoPolicyOther + } +} + +/// Viewer information is available on this file. +@objc +public class DBXSharingViewerInfoPolicyEnabled: DBXSharingViewerInfoPolicy { + @objc + public init() { + let swift = Sharing.ViewerInfoPolicy.enabled + super.init(swift: swift) + } +} + +/// Viewer information is disabled on this file. +@objc +public class DBXSharingViewerInfoPolicyDisabled: DBXSharingViewerInfoPolicy { + @objc + public init() { + let swift = Sharing.ViewerInfoPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingViewerInfoPolicyOther: DBXSharingViewerInfoPolicy { + @objc + public init() { + let swift = Sharing.ViewerInfoPolicy.other + super.init(swift: swift) + } +} + +/// Who can access a shared link. The most open visibility is public_. The default depends on many aspects, such as +/// team and user preferences and shared folder settings. +@objc +public class DBXSharingVisibility: NSObject { + let swift: Sharing.Visibility + + public init(swift: Sharing.Visibility) { + self.swift = swift + } + + public static func factory(swift: Sharing.Visibility) -> DBXSharingVisibility { + switch swift { + case .public_: + return DBXSharingVisibilityPublic_() + case .teamOnly: + return DBXSharingVisibilityTeamOnly() + case .password: + return DBXSharingVisibilityPassword() + case .teamAndPassword: + return DBXSharingVisibilityTeamAndPassword() + case .sharedFolderOnly: + return DBXSharingVisibilitySharedFolderOnly() + case .other: + return DBXSharingVisibilityOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPublic_: DBXSharingVisibilityPublic_? { + self as? DBXSharingVisibilityPublic_ + } + + @objc + public var asTeamOnly: DBXSharingVisibilityTeamOnly? { + self as? DBXSharingVisibilityTeamOnly + } + + @objc + public var asPassword: DBXSharingVisibilityPassword? { + self as? DBXSharingVisibilityPassword + } + + @objc + public var asTeamAndPassword: DBXSharingVisibilityTeamAndPassword? { + self as? DBXSharingVisibilityTeamAndPassword + } + + @objc + public var asSharedFolderOnly: DBXSharingVisibilitySharedFolderOnly? { + self as? DBXSharingVisibilitySharedFolderOnly + } + + @objc + public var asOther: DBXSharingVisibilityOther? { + self as? DBXSharingVisibilityOther + } +} + +/// Anyone who has received the link can access it. No login required. +@objc +public class DBXSharingVisibilityPublic_: DBXSharingVisibility { + @objc + public init() { + let swift = Sharing.Visibility.public_ + super.init(swift: swift) + } +} + +/// Only members of the same team can access the link. Login is required. +@objc +public class DBXSharingVisibilityTeamOnly: DBXSharingVisibility { + @objc + public init() { + let swift = Sharing.Visibility.teamOnly + super.init(swift: swift) + } +} + +/// A link-specific password is required to access the link. Login is not required. +@objc +public class DBXSharingVisibilityPassword: DBXSharingVisibility { + @objc + public init() { + let swift = Sharing.Visibility.password + super.init(swift: swift) + } +} + +/// Only members of the same team who have the link-specific password can access the link. +@objc +public class DBXSharingVisibilityTeamAndPassword: DBXSharingVisibility { + @objc + public init() { + let swift = Sharing.Visibility.teamAndPassword + super.init(swift: swift) + } +} + +/// Only members of the shared folder containing the linked file can access the link. Login is required. +@objc +public class DBXSharingVisibilitySharedFolderOnly: DBXSharingVisibility { + @objc + public init() { + let swift = Sharing.Visibility.sharedFolderOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXSharingVisibilityOther: DBXSharingVisibility { + @objc + public init() { + let swift = Sharing.Visibility.other + super.init(swift: swift) + } +} + +/// Objective-C compatible VisibilityPolicy struct +@objc +public class DBXSharingVisibilityPolicy: NSObject { + /// This is the value to submit when saving the visibility setting. + @objc + public var policy: DBXSharingRequestedVisibility { DBXSharingRequestedVisibility(swift: swift.policy) } + /// This is what the effective policy would be, if you selected this option. The resolved policy is obtained + /// after considering external effects such as shared folder settings and team policy. This value is + /// guaranteed to be provided. + @objc + public var resolvedPolicy: DBXSharingAlphaResolvedVisibility { DBXSharingAlphaResolvedVisibility(swift: swift.resolvedPolicy) } + /// Whether the user is permitted to set the visibility to this policy. + @objc + public var allowed: NSNumber { swift.allowed as NSNumber } + /// If allowed is false, this will provide the reason that the user is not permitted to set the visibility to + /// this policy. + @objc + public var disallowedReason: DBXSharingVisibilityPolicyDisallowedReason? { guard let swift = swift.disallowedReason else { return nil } + return DBXSharingVisibilityPolicyDisallowedReason(swift: swift) + } + + @objc + public init( + policy: DBXSharingRequestedVisibility, + resolvedPolicy: DBXSharingAlphaResolvedVisibility, + allowed: NSNumber, + disallowedReason: DBXSharingVisibilityPolicyDisallowedReason? + ) { + self.swift = Sharing.VisibilityPolicy( + policy: policy.swift, + resolvedPolicy: resolvedPolicy.swift, + allowed: allowed.boolValue, + disallowedReason: disallowedReason?.swift + ) + } + + let swift: Sharing.VisibilityPolicy + + public init(swift: Sharing.VisibilityPolicy) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXSharingRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSharingRoutes.swift new file mode 100644 index 000000000..3099c5bbf --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXSharingRoutes.swift @@ -0,0 +1,3937 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the sharing namespace +/// For Swift routes see SharingRoutes +@objc +public class DBXSharingRoutes: NSObject { + private let swift: SharingRoutes + init(swift: SharingRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Adds specified members to a file. + /// + /// - scope: sharing.write + /// + /// - parameter file: File to which to add members. + /// - parameter members: Members to add. Note that even an email address is given, this may result in a user being + /// directly added to the membership if that email is the user's main account email. + /// - parameter customMessage: Message to send to added members in their invitation. + /// - parameter quiet: Whether added members should be notified via email and device notifications of their + /// invitation. + /// - parameter accessLevel: AccessLevel union object, describing what access level we want to give new members. + /// - parameter addMessageAsComment: If the custom message should be added as a comment on the file. + /// + /// - returns: Through the response callback, the caller will receive a `Array` + /// object on success or a `Sharing.AddFileMemberError` object on failure. + @objc + @discardableResult public func addFileMember( + file: String, + members: [DBXSharingMemberSelector], + customMessage: String?, + quiet: NSNumber, + accessLevel: DBXSharingAccessLevel, + addMessageAsComment: NSNumber + ) -> DBXSharingAddFileMemberRpcRequest { + let swift = swift.addFileMember( + file: file, + members: members.map(\.swift), + customMessage: customMessage, + quiet: quiet.boolValue, + accessLevel: accessLevel.swift, + addMessageAsComment: addMessageAsComment.boolValue + ) + return DBXSharingAddFileMemberRpcRequest(swift: swift) + } + + /// Adds specified members to a file. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Array` + /// object on success or a `Sharing.AddFileMemberError` object on failure. + @objc + @discardableResult public func addFileMember(file: String, members: [DBXSharingMemberSelector]) -> DBXSharingAddFileMemberRpcRequest { + let swift = swift.addFileMember(file: file, members: members.map(\.swift)) + return DBXSharingAddFileMemberRpcRequest(swift: swift) + } + + /// Allows an owner or editor (if the ACL update policy allows) of a shared folder to add another member. For the + /// new member to get access to all the functionality for this folder, you will need to call mountFolder on + /// their behalf. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter members: The intended list of members to add. Added members will receive invites to join the shared + /// folder. + /// - parameter quiet: Whether added members should be notified via email and device notifications of their invite. + /// - parameter customMessage: Optional message to display to added members in their invitation. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Sharing.AddFolderMemberError` object on failure. + @objc + @discardableResult public func addFolderMember( + sharedFolderId: String, + members: [DBXSharingAddMember], + quiet: NSNumber, + customMessage: String? + ) -> DBXSharingAddFolderMemberRpcRequest { + let swift = swift.addFolderMember(sharedFolderId: sharedFolderId, members: members.map(\.swift), quiet: quiet.boolValue, customMessage: customMessage) + return DBXSharingAddFolderMemberRpcRequest(swift: swift) + } + + /// Allows an owner or editor (if the ACL update policy allows) of a shared folder to add another member. For the + /// new member to get access to all the functionality for this folder, you will need to call mountFolder on + /// their behalf. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Sharing.AddFolderMemberError` object on failure. + @objc + @discardableResult public func addFolderMember(sharedFolderId: String, members: [DBXSharingAddMember]) -> DBXSharingAddFolderMemberRpcRequest { + let swift = swift.addFolderMember(sharedFolderId: sharedFolderId, members: members.map(\.swift)) + return DBXSharingAddFolderMemberRpcRequest(swift: swift) + } + + /// Returns the status of an asynchronous job. + /// + /// - scope: sharing.write + /// + /// - 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 `Sharing.JobStatus` object on success or a + /// `Async.PollError` object on failure. + @objc + @discardableResult public func checkJobStatus(asyncJobId: String) -> DBXSharingCheckJobStatusRpcRequest { + let swift = swift.checkJobStatus(asyncJobId: asyncJobId) + return DBXSharingCheckJobStatusRpcRequest(swift: swift) + } + + /// Returns the status of an asynchronous job for sharing a folder. + /// + /// - scope: sharing.write + /// + /// - 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 `Sharing.RemoveMemberJobStatus` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func checkRemoveMemberJobStatus(asyncJobId: String) -> DBXSharingCheckRemoveMemberJobStatusRpcRequest { + let swift = swift.checkRemoveMemberJobStatus(asyncJobId: asyncJobId) + return DBXSharingCheckRemoveMemberJobStatusRpcRequest(swift: swift) + } + + /// Returns the status of an asynchronous job for sharing a folder. + /// + /// - scope: sharing.write + /// + /// - 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 `Sharing.ShareFolderJobStatus` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func checkShareJobStatus(asyncJobId: String) -> DBXSharingCheckShareJobStatusRpcRequest { + let swift = swift.checkShareJobStatus(asyncJobId: asyncJobId) + return DBXSharingCheckShareJobStatusRpcRequest(swift: swift) + } + + /// Create a shared link with custom settings. If no settings are given then the default visibility is public_ in + /// RequestedVisibility (The resolved visibility, though, may depend on other aspects such as team and shared + /// folder settings). + /// + /// - scope: sharing.write + /// + /// - parameter path: The path to be shared by the shared link. + /// - parameter settings: The requested settings for the newly created shared link. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.CreateSharedLinkWithSettingsError` object on failure. + @objc + @discardableResult public func createSharedLinkWithSettings( + path: String, + settings: DBXSharingSharedLinkSettings? + ) -> DBXSharingCreateSharedLinkWithSettingsRpcRequest { + let swift = swift.createSharedLinkWithSettings(path: path, settings: settings?.swift) + return DBXSharingCreateSharedLinkWithSettingsRpcRequest(swift: swift) + } + + /// Create a shared link with custom settings. If no settings are given then the default visibility is public_ in + /// RequestedVisibility (The resolved visibility, though, may depend on other aspects such as team and shared + /// folder settings). + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.CreateSharedLinkWithSettingsError` object on failure. + @objc + @discardableResult public func createSharedLinkWithSettings(path: String) -> DBXSharingCreateSharedLinkWithSettingsRpcRequest { + let swift = swift.createSharedLinkWithSettings(path: path) + return DBXSharingCreateSharedLinkWithSettingsRpcRequest(swift: swift) + } + + /// Returns shared file metadata. + /// + /// - scope: sharing.read + /// + /// - parameter file: The file to query. + /// - parameter actions: A list of `FileAction`s corresponding to `FilePermission`s that should appear in the + /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can + /// perform on the file. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMetadata` object on + /// success or a `Sharing.GetFileMetadataError` object on failure. + @objc + @discardableResult public func getFileMetadata(file: String, actions: [DBXSharingFileAction]?) -> DBXSharingGetFileMetadataRpcRequest { + let swift = swift.getFileMetadata(file: file, actions: actions?.map(\.swift)) + return DBXSharingGetFileMetadataRpcRequest(swift: swift) + } + + /// Returns shared file metadata. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMetadata` object on + /// success or a `Sharing.GetFileMetadataError` object on failure. + @objc + @discardableResult public func getFileMetadata(file: String) -> DBXSharingGetFileMetadataRpcRequest { + let swift = swift.getFileMetadata(file: file) + return DBXSharingGetFileMetadataRpcRequest(swift: swift) + } + + /// Returns shared file metadata. + /// + /// - scope: sharing.read + /// + /// - parameter files: The files to query. + /// - parameter actions: A list of `FileAction`s corresponding to `FilePermission`s that should appear in the + /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can + /// perform on the file. + /// + /// - returns: Through the response callback, the caller will receive a `Array` + /// object on success or a `Sharing.SharingUserError` object on failure. + @objc + @discardableResult public func getFileMetadataBatch(files: [String], actions: [DBXSharingFileAction]?) -> DBXSharingGetFileMetadataBatchRpcRequest { + let swift = swift.getFileMetadataBatch(files: files, actions: actions?.map(\.swift)) + return DBXSharingGetFileMetadataBatchRpcRequest(swift: swift) + } + + /// Returns shared file metadata. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Array` + /// object on success or a `Sharing.SharingUserError` object on failure. + @objc + @discardableResult public func getFileMetadataBatch(files: [String]) -> DBXSharingGetFileMetadataBatchRpcRequest { + let swift = swift.getFileMetadataBatch(files: files) + return DBXSharingGetFileMetadataBatchRpcRequest(swift: swift) + } + + /// Returns shared folder metadata by its folder ID. + /// + /// - scope: sharing.read + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// success or a `Sharing.SharedFolderAccessError` object on failure. + @objc + @discardableResult public func getFolderMetadata(sharedFolderId: String, actions: [DBXSharingFolderAction]?) -> DBXSharingGetFolderMetadataRpcRequest { + let swift = swift.getFolderMetadata(sharedFolderId: sharedFolderId, actions: actions?.map(\.swift)) + return DBXSharingGetFolderMetadataRpcRequest(swift: swift) + } + + /// Returns shared folder metadata by its folder ID. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// success or a `Sharing.SharedFolderAccessError` object on failure. + @objc + @discardableResult public func getFolderMetadata(sharedFolderId: String) -> DBXSharingGetFolderMetadataRpcRequest { + let swift = swift.getFolderMetadata(sharedFolderId: sharedFolderId) + return DBXSharingGetFolderMetadataRpcRequest(swift: swift) + } + + /// Download the shared link's file from a user's Dropbox. + /// + /// - scope: sharing.read + /// + /// - parameter url: URL of the shared link. + /// - parameter path: If the shared link is to a folder, this parameter can be used to retrieve the metadata for a + /// specific file or sub-folder in this folder. A relative path should be used. + /// - parameter linkPassword: If the shared link has a password, this parameter can be used. + /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite + /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, + /// an NSError will be thrown). + /// - parameter destination: The location to write the download to. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.GetSharedLinkFileError` object on failure. + @objc + @discardableResult public func getSharedLinkFileURL( + url: String, + path: String?, + linkPassword: String?, + overwrite: Bool, + destination: URL + ) -> DBXSharingGetSharedLinkFileDownloadRequestFile { + let swift = swift.getSharedLinkFile(url: url, path: path, linkPassword: linkPassword, overwrite: overwrite, destination: destination) + return DBXSharingGetSharedLinkFileDownloadRequestFile(swift: swift) + } + + /// Download the shared link's file from a user's Dropbox. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.GetSharedLinkFileError` object on failure. + @objc + @discardableResult public func getSharedLinkFileURL(url: String, overwrite: Bool, destination: URL) -> DBXSharingGetSharedLinkFileDownloadRequestFile { + let swift = swift.getSharedLinkFile(url: url, overwrite: overwrite, destination: destination) + return DBXSharingGetSharedLinkFileDownloadRequestFile(swift: swift) + } + + /// Download the shared link's file from a user's Dropbox. + /// + /// - scope: sharing.read + /// + /// - parameter url: URL of the shared link. + /// - parameter path: If the shared link is to a folder, this parameter can be used to retrieve the metadata for a + /// specific file or sub-folder in this folder. A relative path should be used. + /// - parameter linkPassword: If the shared link has a password, this parameter can be used. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.GetSharedLinkFileError` object on failure. + @objc + @discardableResult public func getSharedLinkFile(url: String, path: String?, linkPassword: String?) -> DBXSharingGetSharedLinkFileDownloadRequestMemory { + let swift = swift.getSharedLinkFile(url: url, path: path, linkPassword: linkPassword) + return DBXSharingGetSharedLinkFileDownloadRequestMemory(swift: swift) + } + + /// Download the shared link's file from a user's Dropbox. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.GetSharedLinkFileError` object on failure. + @objc + @discardableResult public func getSharedLinkFile(url: String) -> DBXSharingGetSharedLinkFileDownloadRequestMemory { + let swift = swift.getSharedLinkFile(url: url) + return DBXSharingGetSharedLinkFileDownloadRequestMemory(swift: swift) + } + + /// Get the shared link's metadata. + /// + /// - scope: sharing.read + /// + /// - parameter url: URL of the shared link. + /// - parameter path: If the shared link is to a folder, this parameter can be used to retrieve the metadata for a + /// specific file or sub-folder in this folder. A relative path should be used. + /// - parameter linkPassword: If the shared link has a password, this parameter can be used. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.SharedLinkError` object on failure. + @objc + @discardableResult public func getSharedLinkMetadata(url: String, path: String?, linkPassword: String?) -> DBXSharingGetSharedLinkMetadataRpcRequest { + let swift = swift.getSharedLinkMetadata(url: url, path: path, linkPassword: linkPassword) + return DBXSharingGetSharedLinkMetadataRpcRequest(swift: swift) + } + + /// Get the shared link's metadata. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.SharedLinkError` object on failure. + @objc + @discardableResult public func getSharedLinkMetadata(url: String) -> DBXSharingGetSharedLinkMetadataRpcRequest { + let swift = swift.getSharedLinkMetadata(url: url) + return DBXSharingGetSharedLinkMetadataRpcRequest(swift: swift) + } + + /// Use to obtain the members who have been invited to a file, both inherited and uninherited members. + /// + /// - scope: sharing.read + /// + /// - parameter file: The file for which you want to see members. + /// - parameter actions: The actions for which to return permissions on a member. + /// - parameter includeInherited: Whether to include members who only have access from a parent shared folder. + /// - parameter limit: Number of members to return max per query. Defaults to 100 if no limit is specified. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMembers` object on + /// success or a `Sharing.ListFileMembersError` object on failure. + @objc + @discardableResult public func listFileMembers( + file: String, + actions: [DBXSharingMemberAction]?, + includeInherited: NSNumber, + limit: NSNumber + ) -> DBXSharingListFileMembersRpcRequest { + let swift = swift.listFileMembers(file: file, actions: actions?.map(\.swift), includeInherited: includeInherited.boolValue, limit: limit.uint32Value) + return DBXSharingListFileMembersRpcRequest(swift: swift) + } + + /// Use to obtain the members who have been invited to a file, both inherited and uninherited members. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMembers` object on + /// success or a `Sharing.ListFileMembersError` object on failure. + @objc + @discardableResult public func listFileMembers(file: String) -> DBXSharingListFileMembersRpcRequest { + let swift = swift.listFileMembers(file: file) + return DBXSharingListFileMembersRpcRequest(swift: swift) + } + + /// Get members of multiple files at once. The arguments to this route are more limited, and the limit on query + /// result size per file is more strict. To customize the results more, use the individual file endpoint. + /// Inherited users and groups are not included in the result, and permissions are not returned for this + /// endpoint. + /// + /// - scope: sharing.read + /// + /// - parameter files: Files for which to return members. + /// - parameter limit: Number of members to return max per query. Defaults to 10 if no limit is specified. + /// + /// - returns: Through the response callback, the caller will receive a `Array` + /// object on success or a `Sharing.SharingUserError` object on failure. + @objc + @discardableResult public func listFileMembersBatch(files: [String], limit: NSNumber) -> DBXSharingListFileMembersBatchRpcRequest { + let swift = swift.listFileMembersBatch(files: files, limit: limit.uint32Value) + return DBXSharingListFileMembersBatchRpcRequest(swift: swift) + } + + /// Get members of multiple files at once. The arguments to this route are more limited, and the limit on query + /// result size per file is more strict. To customize the results more, use the individual file endpoint. + /// Inherited users and groups are not included in the result, and permissions are not returned for this + /// endpoint. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Array` + /// object on success or a `Sharing.SharingUserError` object on failure. + @objc + @discardableResult public func listFileMembersBatch(files: [String]) -> DBXSharingListFileMembersBatchRpcRequest { + let swift = swift.listFileMembersBatch(files: files) + return DBXSharingListFileMembersBatchRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from listFileMembers or listFileMembersBatch, use this to paginate through all + /// shared file members. + /// + /// - scope: sharing.read + /// + /// - parameter cursor: The cursor returned by your last call to listFileMembers, listFileMembersContinue, or + /// listFileMembersBatch. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFileMembers` object on + /// success or a `Sharing.ListFileMembersContinueError` object on failure. + @objc + @discardableResult public func listFileMembersContinue(cursor: String) -> DBXSharingListFileMembersContinueRpcRequest { + let swift = swift.listFileMembersContinue(cursor: cursor) + return DBXSharingListFileMembersContinueRpcRequest(swift: swift) + } + + /// Returns shared folder membership by its folder ID. + /// + /// - scope: sharing.read + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMembers` object on + /// success or a `Sharing.SharedFolderAccessError` object on failure. + @objc + @discardableResult public func listFolderMembers( + sharedFolderId: String, + actions: [DBXSharingMemberAction]?, + limit: NSNumber + ) -> DBXSharingListFolderMembersRpcRequest { + let swift = swift.listFolderMembers(sharedFolderId: sharedFolderId, actions: actions?.map(\.swift), limit: limit.uint32Value) + return DBXSharingListFolderMembersRpcRequest(swift: swift) + } + + /// Returns shared folder membership by its folder ID. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMembers` object on + /// success or a `Sharing.SharedFolderAccessError` object on failure. + @objc + @discardableResult public func listFolderMembers(sharedFolderId: String) -> DBXSharingListFolderMembersRpcRequest { + let swift = swift.listFolderMembers(sharedFolderId: sharedFolderId) + return DBXSharingListFolderMembersRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from listFolderMembers, use this to paginate through all shared folder members. + /// + /// - scope: sharing.read + /// + /// - parameter cursor: The cursor returned by your last call to listFolderMembers or listFolderMembersContinue. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMembers` object on + /// success or a `Sharing.ListFolderMembersContinueError` object on failure. + @objc + @discardableResult public func listFolderMembersContinue(cursor: String) -> DBXSharingListFolderMembersContinueRpcRequest { + let swift = swift.listFolderMembersContinue(cursor: cursor) + return DBXSharingListFolderMembersContinueRpcRequest(swift: swift) + } + + /// Return the list of all shared folders the current user has access to. + /// + /// - scope: sharing.read + /// + /// - parameter limit: The maximum number of results to return per request. + /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func listFolders(limit: NSNumber, actions: [DBXSharingFolderAction]?) -> DBXSharingListFoldersRpcRequest { + let swift = swift.listFolders(limit: limit.uint32Value, actions: actions?.map(\.swift)) + return DBXSharingListFoldersRpcRequest(swift: swift) + } + + /// Return the list of all shared folders the current user has access to. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func listFolders() -> DBXSharingListFoldersRpcRequest { + let swift = swift.listFolders() + return DBXSharingListFoldersRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from listFolders, use this to paginate through all shared folders. The cursor + /// must come from a previous call to listFolders or listFoldersContinue. + /// + /// - scope: sharing.read + /// + /// - parameter cursor: The cursor returned by the previous API call specified in the endpoint description. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// success or a `Sharing.ListFoldersContinueError` object on failure. + @objc + @discardableResult public func listFoldersContinue(cursor: String) -> DBXSharingListFoldersContinueRpcRequest { + let swift = swift.listFoldersContinue(cursor: cursor) + return DBXSharingListFoldersContinueRpcRequest(swift: swift) + } + + /// Return the list of all shared folders the current user can mount or unmount. + /// + /// - scope: sharing.read + /// + /// - parameter limit: The maximum number of results to return per request. + /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func listMountableFolders(limit: NSNumber, actions: [DBXSharingFolderAction]?) -> DBXSharingListMountableFoldersRpcRequest { + let swift = swift.listMountableFolders(limit: limit.uint32Value, actions: actions?.map(\.swift)) + return DBXSharingListMountableFoldersRpcRequest(swift: swift) + } + + /// Return the list of all shared folders the current user can mount or unmount. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func listMountableFolders() -> DBXSharingListMountableFoldersRpcRequest { + let swift = swift.listMountableFolders() + return DBXSharingListMountableFoldersRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from listMountableFolders, use this to paginate through all mountable shared + /// folders. The cursor must come from a previous call to listMountableFolders or listMountableFoldersContinue. + /// + /// - scope: sharing.read + /// + /// - parameter cursor: The cursor returned by the previous API call specified in the endpoint description. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFoldersResult` object on + /// success or a `Sharing.ListFoldersContinueError` object on failure. + @objc + @discardableResult public func listMountableFoldersContinue(cursor: String) -> DBXSharingListMountableFoldersContinueRpcRequest { + let swift = swift.listMountableFoldersContinue(cursor: cursor) + return DBXSharingListMountableFoldersContinueRpcRequest(swift: swift) + } + + /// Returns a list of all files shared with current user. Does not include files the user has received via shared + /// folders, and does not include unclaimed invitations. + /// + /// - scope: sharing.read + /// + /// - parameter limit: Number of files to return max per query. Defaults to 100 if no limit is specified. + /// - parameter actions: A list of `FileAction`s corresponding to `FilePermission`s that should appear in the + /// response's permissions in SharedFileMetadata field describing the actions the authenticated user can + /// perform on the file. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFilesResult` object on success + /// or a `Sharing.SharingUserError` object on failure. + @objc + @discardableResult public func listReceivedFiles(limit: NSNumber, actions: [DBXSharingFileAction]?) -> DBXSharingListReceivedFilesRpcRequest { + let swift = swift.listReceivedFiles(limit: limit.uint32Value, actions: actions?.map(\.swift)) + return DBXSharingListReceivedFilesRpcRequest(swift: swift) + } + + /// Returns a list of all files shared with current user. Does not include files the user has received via shared + /// folders, and does not include unclaimed invitations. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFilesResult` object on success + /// or a `Sharing.SharingUserError` object on failure. + @objc + @discardableResult public func listReceivedFiles() -> DBXSharingListReceivedFilesRpcRequest { + let swift = swift.listReceivedFiles() + return DBXSharingListReceivedFilesRpcRequest(swift: swift) + } + + /// Get more results with a cursor from listReceivedFiles. + /// + /// - scope: sharing.read + /// + /// - parameter cursor: Cursor in cursor in ListFilesResult. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListFilesResult` object on success + /// or a `Sharing.ListFilesContinueError` object on failure. + @objc + @discardableResult public func listReceivedFilesContinue(cursor: String) -> DBXSharingListReceivedFilesContinueRpcRequest { + let swift = swift.listReceivedFilesContinue(cursor: cursor) + return DBXSharingListReceivedFilesContinueRpcRequest(swift: swift) + } + + /// List shared links of this user. If no path is given, returns a list of all shared links for the current user. + /// For members of business teams using team space and member folders, returns all shared links in the team + /// member's home folder unless the team space ID is specified in the request header. For more information, + /// refer to the Namespace Guide https://www.dropbox.com/developers/reference/namespace-guide. If a non-empty + /// path is given, returns a list of all shared links that allow access to the given path - direct links to the + /// given path and links to parent folders of the given path. Links to parent folders can be suppressed by + /// setting direct_only to true. + /// + /// - scope: sharing.read + /// + /// - parameter path: See listSharedLinks description. + /// - parameter cursor: The cursor returned by your last call to listSharedLinks. + /// - parameter directOnly: See listSharedLinks description. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListSharedLinksResult` object on + /// success or a `Sharing.ListSharedLinksError` object on failure. + @objc + @discardableResult public func listSharedLinks(path: String?, cursor: String?, directOnly: NSNumber?) -> DBXSharingListSharedLinksRpcRequest { + let swift = swift.listSharedLinks(path: path, cursor: cursor, directOnly: directOnly?.boolValue) + return DBXSharingListSharedLinksRpcRequest(swift: swift) + } + + /// List shared links of this user. If no path is given, returns a list of all shared links for the current user. + /// For members of business teams using team space and member folders, returns all shared links in the team + /// member's home folder unless the team space ID is specified in the request header. For more information, + /// refer to the Namespace Guide https://www.dropbox.com/developers/reference/namespace-guide. If a non-empty + /// path is given, returns a list of all shared links that allow access to the given path - direct links to the + /// given path and links to parent folders of the given path. Links to parent folders can be suppressed by + /// setting direct_only to true. + /// + /// - scope: sharing.read + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ListSharedLinksResult` object on + /// success or a `Sharing.ListSharedLinksError` object on failure. + @objc + @discardableResult public func listSharedLinks() -> DBXSharingListSharedLinksRpcRequest { + let swift = swift.listSharedLinks() + return DBXSharingListSharedLinksRpcRequest(swift: swift) + } + + /// Modify the shared link's settings. If the requested visibility conflict with the shared links policy of the team + /// or the shared folder (in case the linked file is part of a shared folder) then the resolvedVisibility in + /// LinkPermissions of the returned SharedLinkMetadata will reflect the actual visibility of the shared link and + /// the requestedVisibility in LinkPermissions will reflect the requested visibility. + /// + /// - scope: sharing.write + /// + /// - parameter url: URL of the shared link to change its settings. + /// - parameter settings: Set of settings for the shared link. + /// - parameter removeExpiration: If set to true, removes the expiration of the shared link. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.ModifySharedLinkSettingsError` object on failure. + @objc + @discardableResult public func modifySharedLinkSettings( + url: String, + settings: DBXSharingSharedLinkSettings, + removeExpiration: NSNumber + ) -> DBXSharingModifySharedLinkSettingsRpcRequest { + let swift = swift.modifySharedLinkSettings(url: url, settings: settings.swift, removeExpiration: removeExpiration.boolValue) + return DBXSharingModifySharedLinkSettingsRpcRequest(swift: swift) + } + + /// Modify the shared link's settings. If the requested visibility conflict with the shared links policy of the team + /// or the shared folder (in case the linked file is part of a shared folder) then the resolvedVisibility in + /// LinkPermissions of the returned SharedLinkMetadata will reflect the actual visibility of the shared link and + /// the requestedVisibility in LinkPermissions will reflect the requested visibility. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedLinkMetadata` object on + /// success or a `Sharing.ModifySharedLinkSettingsError` object on failure. + @objc + @discardableResult public func modifySharedLinkSettings( + url: String, + settings: DBXSharingSharedLinkSettings + ) -> DBXSharingModifySharedLinkSettingsRpcRequest { + let swift = swift.modifySharedLinkSettings(url: url, settings: settings.swift) + return DBXSharingModifySharedLinkSettingsRpcRequest(swift: swift) + } + + /// The current user mounts the designated folder. Mount a shared folder for a user after they have been added as a + /// member. Once mounted, the shared folder will appear in their Dropbox. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID of the shared folder to mount. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// success or a `Sharing.MountFolderError` object on failure. + @objc + @discardableResult public func mountFolder(sharedFolderId: String) -> DBXSharingMountFolderRpcRequest { + let swift = swift.mountFolder(sharedFolderId: sharedFolderId) + return DBXSharingMountFolderRpcRequest(swift: swift) + } + + /// The current user relinquishes their membership in the designated file. Note that the current user may still have + /// inherited access to this file through the parent folder. + /// + /// - scope: sharing.write + /// + /// - parameter file: The path or id for the file. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Sharing.RelinquishFileMembershipError` object on failure. + @objc + @discardableResult public func relinquishFileMembership(file: String) -> DBXSharingRelinquishFileMembershipRpcRequest { + let swift = swift.relinquishFileMembership(file: file) + return DBXSharingRelinquishFileMembershipRpcRequest(swift: swift) + } + + /// The current user relinquishes their membership in the designated shared folder and will no longer have access to + /// the folder. A folder owner cannot relinquish membership in their own folder. This will run synchronously if + /// leave_a_copy is false, and asynchronously if leave_a_copy is true. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter leaveACopy: Keep a copy of the folder's contents upon relinquishing membership. This must be set to + /// false when the folder is within a team folder or another shared folder. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Sharing.RelinquishFolderMembershipError` object on failure. + @objc + @discardableResult public func relinquishFolderMembership(sharedFolderId: String, leaveACopy: NSNumber) -> DBXSharingRelinquishFolderMembershipRpcRequest { + let swift = swift.relinquishFolderMembership(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy.boolValue) + return DBXSharingRelinquishFolderMembershipRpcRequest(swift: swift) + } + + /// The current user relinquishes their membership in the designated shared folder and will no longer have access to + /// the folder. A folder owner cannot relinquish membership in their own folder. This will run synchronously if + /// leave_a_copy is false, and asynchronously if leave_a_copy is true. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Sharing.RelinquishFolderMembershipError` object on failure. + @objc + @discardableResult public func relinquishFolderMembership(sharedFolderId: String) -> DBXSharingRelinquishFolderMembershipRpcRequest { + let swift = swift.relinquishFolderMembership(sharedFolderId: sharedFolderId) + return DBXSharingRelinquishFolderMembershipRpcRequest(swift: swift) + } + + /// Removes a specified member from the file. + /// + /// - scope: sharing.write + /// + /// - parameter file: File from which to remove members. + /// - parameter member: Member to remove from this file. Note that even if an email is specified, it may result in + /// the removal of a user (not an invitee) if the user's main account corresponds to that email address. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.FileMemberRemoveActionResult` + /// object on success or a `Sharing.RemoveFileMemberError` object on failure. + @objc + @discardableResult public func removeFileMember2(file: String, member: DBXSharingMemberSelector) -> DBXSharingRemoveFileMember2RpcRequest { + let swift = swift.removeFileMember2(file: file, member: member.swift) + return DBXSharingRemoveFileMember2RpcRequest(swift: swift) + } + + /// Allows an owner or editor (if the ACL update policy allows) of a shared folder to remove another member. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter member: The member to remove from the folder. + /// - parameter leaveACopy: If true, the removed user will keep their copy of the folder after it's unshared, + /// assuming it was mounted. Otherwise, it will be removed from their Dropbox. This must be set to false when + /// removing a group, or when the folder is within a team folder or another shared folder. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Sharing.RemoveFolderMemberError` object on failure. + @objc + @discardableResult public func removeFolderMember( + sharedFolderId: String, + member: DBXSharingMemberSelector, + leaveACopy: NSNumber + ) -> DBXSharingRemoveFolderMemberRpcRequest { + let swift = swift.removeFolderMember(sharedFolderId: sharedFolderId, member: member.swift, leaveACopy: leaveACopy.boolValue) + return DBXSharingRemoveFolderMemberRpcRequest(swift: swift) + } + + /// Revoke a shared link. Note that even after revoking a shared link to a file, the file may be accessible if there + /// are shared links leading to any of the file parent folders. To list all shared links that enable access to a + /// specific file, you can use the listSharedLinks with the file as the path in ListSharedLinksArg argument. + /// + /// - scope: sharing.write + /// + /// - parameter url: URL of the shared link. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Sharing.RevokeSharedLinkError` object on failure. + @objc + @discardableResult public func revokeSharedLink(url: String) -> DBXSharingRevokeSharedLinkRpcRequest { + let swift = swift.revokeSharedLink(url: url) + return DBXSharingRevokeSharedLinkRpcRequest(swift: swift) + } + + /// Change the inheritance policy of an existing Shared Folder. Only permitted for shared folders in a shared team + /// root. If a asyncJobId in ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the + /// action completes to get the metadata for the folder. + /// + /// - scope: sharing.write + /// + /// - parameter accessInheritance: The access inheritance settings for the folder. + /// - parameter sharedFolderId: The ID for the shared folder. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on + /// success or a `Sharing.SetAccessInheritanceError` object on failure. + @objc + @discardableResult public func setAccessInheritance( + sharedFolderId: String, + accessInheritance: DBXSharingAccessInheritance + ) -> DBXSharingSetAccessInheritanceRpcRequest { + let swift = swift.setAccessInheritance(sharedFolderId: sharedFolderId, accessInheritance: accessInheritance.swift) + return DBXSharingSetAccessInheritanceRpcRequest(swift: swift) + } + + /// Change the inheritance policy of an existing Shared Folder. Only permitted for shared folders in a shared team + /// root. If a asyncJobId in ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the + /// action completes to get the metadata for the folder. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on + /// success or a `Sharing.SetAccessInheritanceError` object on failure. + @objc + @discardableResult public func setAccessInheritance(sharedFolderId: String) -> DBXSharingSetAccessInheritanceRpcRequest { + let swift = swift.setAccessInheritance(sharedFolderId: sharedFolderId) + return DBXSharingSetAccessInheritanceRpcRequest(swift: swift) + } + + /// Share a folder with collaborators. Most sharing will be completed synchronously. Large folders will be completed + /// asynchronously. To make testing the async case repeatable, set `ShareFolderArg.force_async`. If a asyncJobId + /// in ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the action completes to get + /// the metadata for the folder. + /// + /// - scope: sharing.write + /// + /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. + /// - parameter linkSettings: Settings on the link for this folder. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on + /// success or a `Sharing.ShareFolderError` object on failure. + @objc + @discardableResult public func shareFolder( + path: String, + aclUpdatePolicy: DBXSharingAclUpdatePolicy?, + forceAsync: NSNumber, + memberPolicy: DBXSharingMemberPolicy?, + sharedLinkPolicy: DBXSharingSharedLinkPolicy?, + viewerInfoPolicy: DBXSharingViewerInfoPolicy?, + accessInheritance: DBXSharingAccessInheritance, + actions: [DBXSharingFolderAction]?, + linkSettings: DBXSharingLinkSettings? + ) -> DBXSharingShareFolderRpcRequest { + let swift = swift.shareFolder( + path: path, + aclUpdatePolicy: aclUpdatePolicy?.swift, + forceAsync: forceAsync.boolValue, + memberPolicy: memberPolicy?.swift, + sharedLinkPolicy: sharedLinkPolicy?.swift, + viewerInfoPolicy: viewerInfoPolicy?.swift, + accessInheritance: accessInheritance.swift, + actions: actions?.map(\.swift), + linkSettings: linkSettings?.swift + ) + return DBXSharingShareFolderRpcRequest(swift: swift) + } + + /// Share a folder with collaborators. Most sharing will be completed synchronously. Large folders will be completed + /// asynchronously. To make testing the async case repeatable, set `ShareFolderArg.force_async`. If a asyncJobId + /// in ShareFolderLaunch is returned, you'll need to call checkShareJobStatus until the action completes to get + /// the metadata for the folder. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.ShareFolderLaunch` object on + /// success or a `Sharing.ShareFolderError` object on failure. + @objc + @discardableResult public func shareFolder(path: String) -> DBXSharingShareFolderRpcRequest { + let swift = swift.shareFolder(path: path) + return DBXSharingShareFolderRpcRequest(swift: swift) + } + + /// Transfer ownership of a shared folder to a member of the shared folder. User must have owner in AccessLevel + /// access to the shared folder to perform a transfer. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter toDropboxId: A account or team member ID to transfer ownership to. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Sharing.TransferFolderError` object on failure. + @objc + @discardableResult public func transferFolder(sharedFolderId: String, toDropboxId: String) -> DBXSharingTransferFolderRpcRequest { + let swift = swift.transferFolder(sharedFolderId: sharedFolderId, toDropboxId: toDropboxId) + return DBXSharingTransferFolderRpcRequest(swift: swift) + } + + /// The current user unmounts the designated folder. They can re-mount the folder at a later time using mountFolder. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Sharing.UnmountFolderError` object on failure. + @objc + @discardableResult public func unmountFolder(sharedFolderId: String) -> DBXSharingUnmountFolderRpcRequest { + let swift = swift.unmountFolder(sharedFolderId: sharedFolderId) + return DBXSharingUnmountFolderRpcRequest(swift: swift) + } + + /// Remove all members from this file. Does not remove inherited members. + /// + /// - scope: sharing.write + /// + /// - parameter file: The file to unshare. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Sharing.UnshareFileError` object on failure. + @objc + @discardableResult public func unshareFile(file: String) -> DBXSharingUnshareFileRpcRequest { + let swift = swift.unshareFile(file: file) + return DBXSharingUnshareFileRpcRequest(swift: swift) + } + + /// Allows a shared folder owner to unshare the folder. You'll need to call checkJobStatus to determine if the + /// action has completed successfully. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter leaveACopy: If true, members of this shared folder will get a copy of this folder after it's + /// unshared. Otherwise, it will be removed from their Dropbox. The current user, who is an owner, will always + /// retain their copy. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Sharing.UnshareFolderError` object on failure. + @objc + @discardableResult public func unshareFolder(sharedFolderId: String, leaveACopy: NSNumber) -> DBXSharingUnshareFolderRpcRequest { + let swift = swift.unshareFolder(sharedFolderId: sharedFolderId, leaveACopy: leaveACopy.boolValue) + return DBXSharingUnshareFolderRpcRequest(swift: swift) + } + + /// Allows a shared folder owner to unshare the folder. You'll need to call checkJobStatus to determine if the + /// action has completed successfully. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Sharing.UnshareFolderError` object on failure. + @objc + @discardableResult public func unshareFolder(sharedFolderId: String) -> DBXSharingUnshareFolderRpcRequest { + let swift = swift.unshareFolder(sharedFolderId: sharedFolderId) + return DBXSharingUnshareFolderRpcRequest(swift: swift) + } + + /// Changes a member's access on a shared file. + /// + /// - scope: sharing.write + /// + /// - parameter file: File for which we are changing a member's access. + /// - parameter member: The member whose access we are changing. + /// - parameter accessLevel: The new access level for the member. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.MemberAccessLevelResult` object on + /// success or a `Sharing.FileMemberActionError` object on failure. + @objc + @discardableResult public func updateFileMember( + file: String, + member: DBXSharingMemberSelector, + accessLevel: DBXSharingAccessLevel + ) -> DBXSharingUpdateFileMemberRpcRequest { + let swift = swift.updateFileMember(file: file, member: member.swift, accessLevel: accessLevel.swift) + return DBXSharingUpdateFileMemberRpcRequest(swift: swift) + } + + /// Allows an owner or editor of a shared folder to update another member's permissions. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter member: The member of the shared folder to update. Only the dropboxId in MemberSelector may be set + /// at this time. + /// - parameter accessLevel: The new access level for member. owner in AccessLevel is disallowed. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.MemberAccessLevelResult` object on + /// success or a `Sharing.UpdateFolderMemberError` object on failure. + @objc + @discardableResult public func updateFolderMember( + sharedFolderId: String, + member: DBXSharingMemberSelector, + accessLevel: DBXSharingAccessLevel + ) -> DBXSharingUpdateFolderMemberRpcRequest { + let swift = swift.updateFolderMember(sharedFolderId: sharedFolderId, member: member.swift, accessLevel: accessLevel.swift) + return DBXSharingUpdateFolderMemberRpcRequest(swift: swift) + } + + /// Update the sharing policies for a shared folder. User must have owner in AccessLevel access to the shared folder + /// to update its policies. + /// + /// - scope: sharing.write + /// + /// - parameter sharedFolderId: The ID for the shared folder. + /// - parameter memberPolicy: Who can be a member of this shared folder. Only applicable if the current user is on a + /// team. + /// - parameter aclUpdatePolicy: Who can add and remove members of this shared folder. + /// - parameter viewerInfoPolicy: Who can enable/disable viewer info for this shared folder. + /// - parameter sharedLinkPolicy: The policy to apply to shared links created for content inside this shared folder. + /// The current user must be on a team to set this policy to members in SharedLinkPolicy. + /// - parameter linkSettings: Settings on the link for this folder. + /// - parameter actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the + /// response's permissions in SharedFolderMetadata field describing the actions the authenticated user can + /// perform on the folder. + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// success or a `Sharing.UpdateFolderPolicyError` object on failure. + @objc + @discardableResult public func updateFolderPolicy( + sharedFolderId: String, + memberPolicy: DBXSharingMemberPolicy?, + aclUpdatePolicy: DBXSharingAclUpdatePolicy?, + viewerInfoPolicy: DBXSharingViewerInfoPolicy?, + sharedLinkPolicy: DBXSharingSharedLinkPolicy?, + linkSettings: DBXSharingLinkSettings?, + actions: [DBXSharingFolderAction]? + ) -> DBXSharingUpdateFolderPolicyRpcRequest { + let swift = swift.updateFolderPolicy( + sharedFolderId: sharedFolderId, + memberPolicy: memberPolicy?.swift, + aclUpdatePolicy: aclUpdatePolicy?.swift, + viewerInfoPolicy: viewerInfoPolicy?.swift, + sharedLinkPolicy: sharedLinkPolicy?.swift, + linkSettings: linkSettings?.swift, + actions: actions?.map(\.swift) + ) + return DBXSharingUpdateFolderPolicyRpcRequest(swift: swift) + } + + /// Update the sharing policies for a shared folder. User must have owner in AccessLevel access to the shared folder + /// to update its policies. + /// + /// - scope: sharing.write + /// + /// - returns: Through the response callback, the caller will receive a `Sharing.SharedFolderMetadata` object on + /// success or a `Sharing.UpdateFolderPolicyError` object on failure. + @objc + @discardableResult public func updateFolderPolicy(sharedFolderId: String) -> DBXSharingUpdateFolderPolicyRpcRequest { + let swift = swift.updateFolderPolicy(sharedFolderId: sharedFolderId) + return DBXSharingUpdateFolderPolicyRpcRequest(swift: swift) + } +} + +@objc +public class DBXSharingAddFileMemberRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Sharing.AddFileMemberErrorSerializer> + + init(swift: RpcRequest, Sharing.AddFileMemberErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXSharingFileMemberActionResult]?, DBXSharingAddFileMemberError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXSharingFileMemberActionResult]?, DBXSharingAddFileMemberError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingAddFileMemberError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingAddFileMemberError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXSharingFileMemberActionResult]? + if let swift = result { + objc = swift.map { DBXSharingFileMemberActionResult(swift: $0) } + } + 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 DBXSharingAddFolderMemberRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingAddFolderMemberError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingAddFolderMemberError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXSharingAddFolderMemberError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingAddFolderMemberError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXSharingCheckJobStatusRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingJobStatus?, 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: DBXSharingJobStatus? + if let swift = result { + objc = DBXSharingJobStatus.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 DBXSharingCheckRemoveMemberJobStatusRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingRemoveMemberJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingRemoveMemberJobStatus?, 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: DBXSharingRemoveMemberJobStatus? + if let swift = result { + objc = DBXSharingRemoveMemberJobStatus.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 DBXSharingCheckShareJobStatusRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingShareFolderJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingShareFolderJobStatus?, 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: DBXSharingShareFolderJobStatus? + if let swift = result { + objc = DBXSharingShareFolderJobStatus.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 DBXSharingCreateSharedLinkRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingPathLinkMetadata?, DBXSharingCreateSharedLinkError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingPathLinkMetadata?, DBXSharingCreateSharedLinkError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingCreateSharedLinkError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingCreateSharedLinkError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingPathLinkMetadata? + if let swift = result { + objc = DBXSharingPathLinkMetadata(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 DBXSharingCreateSharedLinkWithSettingsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, DBXSharingCreateSharedLinkWithSettingsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, DBXSharingCreateSharedLinkWithSettingsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingCreateSharedLinkWithSettingsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingCreateSharedLinkWithSettingsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedLinkMetadata? + if let swift = result { + objc = DBXSharingSharedLinkMetadata(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 DBXSharingGetFileMetadataRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFileMetadata?, DBXSharingGetFileMetadataError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFileMetadata?, DBXSharingGetFileMetadataError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingGetFileMetadataError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingGetFileMetadataError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFileMetadata? + if let swift = result { + objc = DBXSharingSharedFileMetadata(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 DBXSharingGetFileMetadataBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Sharing.SharingUserErrorSerializer> + + init(swift: RpcRequest, Sharing.SharingUserErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXSharingGetFileMetadataBatchResult]?, DBXSharingSharingUserError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXSharingGetFileMetadataBatchResult]?, DBXSharingSharingUserError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingSharingUserError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingSharingUserError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXSharingGetFileMetadataBatchResult]? + if let swift = result { + objc = swift.map { DBXSharingGetFileMetadataBatchResult(swift: $0) } + } + 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 DBXSharingGetFolderMetadataRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFolderMetadata?, DBXSharingSharedFolderAccessError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFolderMetadata?, DBXSharingSharedFolderAccessError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingSharedFolderAccessError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingSharedFolderAccessError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFolderMetadata? + if let swift = result { + objc = DBXSharingSharedFolderMetadata(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 DBXSharingGetSharedLinkFileDownloadRequestFile: NSObject, DBXRequest { + var swift: DownloadRequestFile + + init(swift: DownloadRequestFile) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, URL?, DBXSharingGetSharedLinkFileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, URL?, DBXSharingGetSharedLinkFileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingGetSharedLinkFileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingGetSharedLinkFileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedLinkMetadata? + var destination: URL? + if let swift = result { + objc = DBXSharingSharedLinkMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXSharingGetSharedLinkFileDownloadRequestMemory: NSObject, DBXRequest { + var swift: DownloadRequestMemory + + init(swift: DownloadRequestMemory) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, Data?, DBXSharingGetSharedLinkFileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, Data?, DBXSharingGetSharedLinkFileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingGetSharedLinkFileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingGetSharedLinkFileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedLinkMetadata? + var destination: Data? + if let swift = result { + objc = DBXSharingSharedLinkMetadata(swift: swift.0) + destination = swift.1 + } + completionHandler(objc, destination, routeError, callError) + } + return self + } + + @objc + public func progress(_ progressHandler: @escaping ((Progress) -> Void)) -> Self { + swift.progress(progressHandler) + 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 DBXSharingGetSharedLinkMetadataRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, DBXSharingSharedLinkError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, DBXSharingSharedLinkError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingSharedLinkError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingSharedLinkError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedLinkMetadata? + if let swift = result { + objc = DBXSharingSharedLinkMetadata(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 DBXSharingGetSharedLinksRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingGetSharedLinksResult?, DBXSharingGetSharedLinksError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingGetSharedLinksResult?, DBXSharingGetSharedLinksError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingGetSharedLinksError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingGetSharedLinksError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingGetSharedLinksResult? + if let swift = result { + objc = DBXSharingGetSharedLinksResult(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 DBXSharingListFileMembersRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFileMembers?, DBXSharingListFileMembersError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFileMembers?, DBXSharingListFileMembersError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingListFileMembersError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingListFileMembersError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFileMembers? + if let swift = result { + objc = DBXSharingSharedFileMembers(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 DBXSharingListFileMembersBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Sharing.SharingUserErrorSerializer> + + init(swift: RpcRequest, Sharing.SharingUserErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXSharingListFileMembersBatchResult]?, DBXSharingSharingUserError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXSharingListFileMembersBatchResult]?, DBXSharingSharingUserError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingSharingUserError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingSharingUserError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXSharingListFileMembersBatchResult]? + if let swift = result { + objc = swift.map { DBXSharingListFileMembersBatchResult(swift: $0) } + } + 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 DBXSharingListFileMembersContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFileMembers?, DBXSharingListFileMembersContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFileMembers?, DBXSharingListFileMembersContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingListFileMembersContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingListFileMembersContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFileMembers? + if let swift = result { + objc = DBXSharingSharedFileMembers(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 DBXSharingListFolderMembersRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFolderMembers?, DBXSharingSharedFolderAccessError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFolderMembers?, DBXSharingSharedFolderAccessError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingSharedFolderAccessError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingSharedFolderAccessError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFolderMembers? + if let swift = result { + objc = DBXSharingSharedFolderMembers(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 DBXSharingListFolderMembersContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFolderMembers?, DBXSharingListFolderMembersContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFolderMembers?, DBXSharingListFolderMembersContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingListFolderMembersContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingListFolderMembersContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFolderMembers? + if let swift = result { + objc = DBXSharingSharedFolderMembers(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 DBXSharingListFoldersRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXSharingListFoldersResult? + if let swift = result { + objc = DBXSharingListFoldersResult(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 DBXSharingListFoldersContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXSharingListFoldersContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXSharingListFoldersContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingListFoldersContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingListFoldersContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingListFoldersResult? + if let swift = result { + objc = DBXSharingListFoldersResult(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 DBXSharingListMountableFoldersRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXSharingListFoldersResult? + if let swift = result { + objc = DBXSharingListFoldersResult(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 DBXSharingListMountableFoldersContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXSharingListFoldersContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingListFoldersResult?, DBXSharingListFoldersContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingListFoldersContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingListFoldersContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingListFoldersResult? + if let swift = result { + objc = DBXSharingListFoldersResult(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 DBXSharingListReceivedFilesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingListFilesResult?, DBXSharingSharingUserError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingListFilesResult?, DBXSharingSharingUserError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingSharingUserError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingSharingUserError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingListFilesResult? + if let swift = result { + objc = DBXSharingListFilesResult(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 DBXSharingListReceivedFilesContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingListFilesResult?, DBXSharingListFilesContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingListFilesResult?, DBXSharingListFilesContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingListFilesContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingListFilesContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingListFilesResult? + if let swift = result { + objc = DBXSharingListFilesResult(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 DBXSharingListSharedLinksRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingListSharedLinksResult?, DBXSharingListSharedLinksError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingListSharedLinksResult?, DBXSharingListSharedLinksError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingListSharedLinksError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingListSharedLinksError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingListSharedLinksResult? + if let swift = result { + objc = DBXSharingListSharedLinksResult(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 DBXSharingModifySharedLinkSettingsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, DBXSharingModifySharedLinkSettingsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedLinkMetadata?, DBXSharingModifySharedLinkSettingsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingModifySharedLinkSettingsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingModifySharedLinkSettingsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedLinkMetadata? + if let swift = result { + objc = DBXSharingSharedLinkMetadata(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 DBXSharingMountFolderRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFolderMetadata?, DBXSharingMountFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFolderMetadata?, DBXSharingMountFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingMountFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingMountFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFolderMetadata? + if let swift = result { + objc = DBXSharingSharedFolderMetadata(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 DBXSharingRelinquishFileMembershipRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingRelinquishFileMembershipError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingRelinquishFileMembershipError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXSharingRelinquishFileMembershipError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingRelinquishFileMembershipError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXSharingRelinquishFolderMembershipRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXSharingRelinquishFolderMembershipError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXSharingRelinquishFolderMembershipError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingRelinquishFolderMembershipError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingRelinquishFolderMembershipError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAsyncLaunchEmptyResult? + if let swift = result { + objc = DBXAsyncLaunchEmptyResult.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 DBXSharingRemoveFileMemberRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingFileMemberActionIndividualResult?, DBXSharingRemoveFileMemberError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingFileMemberActionIndividualResult?, DBXSharingRemoveFileMemberError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingRemoveFileMemberError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingRemoveFileMemberError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingFileMemberActionIndividualResult? + if let swift = result { + objc = DBXSharingFileMemberActionIndividualResult.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 DBXSharingRemoveFileMember2RpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingFileMemberRemoveActionResult?, DBXSharingRemoveFileMemberError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingFileMemberRemoveActionResult?, DBXSharingRemoveFileMemberError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingRemoveFileMemberError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingRemoveFileMemberError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingFileMemberRemoveActionResult? + if let swift = result { + objc = DBXSharingFileMemberRemoveActionResult.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 DBXSharingRemoveFolderMemberRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXSharingRemoveFolderMemberError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXSharingRemoveFolderMemberError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingRemoveFolderMemberError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingRemoveFolderMemberError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAsyncLaunchResultBase? + if let swift = result { + objc = DBXAsyncLaunchResultBase.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 DBXSharingRevokeSharedLinkRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingRevokeSharedLinkError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingRevokeSharedLinkError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXSharingRevokeSharedLinkError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingRevokeSharedLinkError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXSharingSetAccessInheritanceRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingShareFolderLaunch?, DBXSharingSetAccessInheritanceError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingShareFolderLaunch?, DBXSharingSetAccessInheritanceError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingSetAccessInheritanceError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingSetAccessInheritanceError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingShareFolderLaunch? + if let swift = result { + objc = DBXSharingShareFolderLaunch.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 DBXSharingShareFolderRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingShareFolderLaunch?, DBXSharingShareFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingShareFolderLaunch?, DBXSharingShareFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingShareFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingShareFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingShareFolderLaunch? + if let swift = result { + objc = DBXSharingShareFolderLaunch.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 DBXSharingTransferFolderRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingTransferFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingTransferFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXSharingTransferFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingTransferFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXSharingUnmountFolderRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingUnmountFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingUnmountFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXSharingUnmountFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingUnmountFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXSharingUnshareFileRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingUnshareFileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingUnshareFileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXSharingUnshareFileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingUnshareFileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXSharingUnshareFolderRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXSharingUnshareFolderError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXSharingUnshareFolderError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingUnshareFolderError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingUnshareFolderError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAsyncLaunchEmptyResult? + if let swift = result { + objc = DBXAsyncLaunchEmptyResult.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 DBXSharingUpdateFileMemberRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingMemberAccessLevelResult?, DBXSharingFileMemberActionError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingMemberAccessLevelResult?, DBXSharingFileMemberActionError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingFileMemberActionError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingFileMemberActionError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingMemberAccessLevelResult? + if let swift = result { + objc = DBXSharingMemberAccessLevelResult(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 DBXSharingUpdateFolderMemberRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingMemberAccessLevelResult?, DBXSharingUpdateFolderMemberError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingMemberAccessLevelResult?, DBXSharingUpdateFolderMemberError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingUpdateFolderMemberError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingUpdateFolderMemberError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingMemberAccessLevelResult? + if let swift = result { + objc = DBXSharingMemberAccessLevelResult(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 DBXSharingUpdateFolderPolicyRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXSharingSharedFolderMetadata?, DBXSharingUpdateFolderPolicyError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXSharingSharedFolderMetadata?, DBXSharingUpdateFolderPolicyError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXSharingUpdateFolderPolicyError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXSharingUpdateFolderPolicyError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXSharingSharedFolderMetadata? + if let swift = result { + objc = DBXSharingSharedFolderMetadata(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeam.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeam.swift new file mode 100644 index 000000000..53ed37472 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeam.swift @@ -0,0 +1,15723 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the team namespace +/// For Swift see team + +/// Objective-C compatible DeviceSession struct +@objc +public class DBXTeamDeviceSession: NSObject { + /// The session id. + @objc + public var sessionId: String { swift.sessionId } + /// The IP address of the last activity from this session. + @objc + public var ipAddress: String? { swift.ipAddress } + /// The country from which the last activity from this session was made. + @objc + public var country: String? { swift.country } + /// The time this session was created. + @objc + public var created: Date? { swift.created } + /// The time of the last activity from this session. + @objc + public var updated: Date? { swift.updated } + + @objc + public init(sessionId: String, ipAddress: String?, country: String?, created: Date?, updated: Date?) { + self.swift = Team.DeviceSession(sessionId: sessionId, ipAddress: ipAddress, country: country, created: created, updated: updated) + } + + let swift: Team.DeviceSession + + public init(swift: Team.DeviceSession) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information on active web sessions. +@objc +public class DBXTeamActiveWebSession: DBXTeamDeviceSession { + /// Information on the hosting device. + @objc + public var userAgent: String { subSwift.userAgent } + /// Information on the hosting operating system. + @objc + public var os: String { subSwift.os } + /// Information on the browser used for this web session. + @objc + public var browser: String { subSwift.browser } + /// The time this session expires. + @objc + public var expires: Date? { subSwift.expires } + + @objc + public init( + sessionId: String, + userAgent: String, + os: String, + browser: String, + ipAddress: String?, + country: String?, + created: Date?, + updated: Date?, + expires: Date? + ) { + let swift = Team.ActiveWebSession( + sessionId: sessionId, + userAgent: userAgent, + os: os, + browser: browser, + ipAddress: ipAddress, + country: country, + created: created, + updated: updated, + expires: expires + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.ActiveWebSession + + public init(swift: Team.ActiveWebSession) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Result of trying to add a secondary email to a user. 'success' is the only value indicating that a secondary +/// email was successfully added to a user. The other values explain the type of error that occurred, and include +/// the email for which the error occurred. +@objc +public class DBXTeamAddSecondaryEmailResult: NSObject { + let swift: Team.AddSecondaryEmailResult + + public init(swift: Team.AddSecondaryEmailResult) { + self.swift = swift + } + + public static func factory(swift: Team.AddSecondaryEmailResult) -> DBXTeamAddSecondaryEmailResult { + switch swift { + case .success(let swiftArg): + let arg = DBXSecondaryEmailsSecondaryEmail(swift: swiftArg) + return DBXTeamAddSecondaryEmailResultSuccess(arg) + case .unavailable(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultUnavailable(arg) + case .alreadyPending(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultAlreadyPending(arg) + case .alreadyOwnedByUser(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultAlreadyOwnedByUser(arg) + case .reachedLimit(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultReachedLimit(arg) + case .transientError(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultTransientError(arg) + case .tooManyUpdates(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultTooManyUpdates(arg) + case .unknownError(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultUnknownError(arg) + case .rateLimited(let swiftArg): + let arg = swiftArg + return DBXTeamAddSecondaryEmailResultRateLimited(arg) + case .other: + return DBXTeamAddSecondaryEmailResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamAddSecondaryEmailResultSuccess? { + self as? DBXTeamAddSecondaryEmailResultSuccess + } + + @objc + public var asUnavailable: DBXTeamAddSecondaryEmailResultUnavailable? { + self as? DBXTeamAddSecondaryEmailResultUnavailable + } + + @objc + public var asAlreadyPending: DBXTeamAddSecondaryEmailResultAlreadyPending? { + self as? DBXTeamAddSecondaryEmailResultAlreadyPending + } + + @objc + public var asAlreadyOwnedByUser: DBXTeamAddSecondaryEmailResultAlreadyOwnedByUser? { + self as? DBXTeamAddSecondaryEmailResultAlreadyOwnedByUser + } + + @objc + public var asReachedLimit: DBXTeamAddSecondaryEmailResultReachedLimit? { + self as? DBXTeamAddSecondaryEmailResultReachedLimit + } + + @objc + public var asTransientError: DBXTeamAddSecondaryEmailResultTransientError? { + self as? DBXTeamAddSecondaryEmailResultTransientError + } + + @objc + public var asTooManyUpdates: DBXTeamAddSecondaryEmailResultTooManyUpdates? { + self as? DBXTeamAddSecondaryEmailResultTooManyUpdates + } + + @objc + public var asUnknownError: DBXTeamAddSecondaryEmailResultUnknownError? { + self as? DBXTeamAddSecondaryEmailResultUnknownError + } + + @objc + public var asRateLimited: DBXTeamAddSecondaryEmailResultRateLimited? { + self as? DBXTeamAddSecondaryEmailResultRateLimited + } + + @objc + public var asOther: DBXTeamAddSecondaryEmailResultOther? { + self as? DBXTeamAddSecondaryEmailResultOther + } +} + +/// Describes a secondary email that was successfully added to a user. +@objc +public class DBXTeamAddSecondaryEmailResultSuccess: DBXTeamAddSecondaryEmailResult { + @objc + public var success: DBXSecondaryEmailsSecondaryEmail + + @objc + public init(_ arg: DBXSecondaryEmailsSecondaryEmail) { + self.success = arg + let swift = Team.AddSecondaryEmailResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// Secondary email is not available to be claimed by the user. +@objc +public class DBXTeamAddSecondaryEmailResultUnavailable: DBXTeamAddSecondaryEmailResult { + @objc + public var unavailable: String + + @objc + public init(_ arg: String) { + self.unavailable = arg + let swift = Team.AddSecondaryEmailResult.unavailable(arg) + super.init(swift: swift) + } +} + +/// Secondary email is already a pending email for the user. +@objc +public class DBXTeamAddSecondaryEmailResultAlreadyPending: DBXTeamAddSecondaryEmailResult { + @objc + public var alreadyPending: String + + @objc + public init(_ arg: String) { + self.alreadyPending = arg + let swift = Team.AddSecondaryEmailResult.alreadyPending(arg) + super.init(swift: swift) + } +} + +/// Secondary email is already a verified email for the user. +@objc +public class DBXTeamAddSecondaryEmailResultAlreadyOwnedByUser: DBXTeamAddSecondaryEmailResult { + @objc + public var alreadyOwnedByUser: String + + @objc + public init(_ arg: String) { + self.alreadyOwnedByUser = arg + let swift = Team.AddSecondaryEmailResult.alreadyOwnedByUser(arg) + super.init(swift: swift) + } +} + +/// User already has the maximum number of secondary emails allowed. +@objc +public class DBXTeamAddSecondaryEmailResultReachedLimit: DBXTeamAddSecondaryEmailResult { + @objc + public var reachedLimit: String + + @objc + public init(_ arg: String) { + self.reachedLimit = arg + let swift = Team.AddSecondaryEmailResult.reachedLimit(arg) + super.init(swift: swift) + } +} + +/// A transient error occurred. Please try again later. +@objc +public class DBXTeamAddSecondaryEmailResultTransientError: DBXTeamAddSecondaryEmailResult { + @objc + public var transientError: String + + @objc + public init(_ arg: String) { + self.transientError = arg + let swift = Team.AddSecondaryEmailResult.transientError(arg) + super.init(swift: swift) + } +} + +/// An error occurred due to conflicting updates. Please try again later. +@objc +public class DBXTeamAddSecondaryEmailResultTooManyUpdates: DBXTeamAddSecondaryEmailResult { + @objc + public var tooManyUpdates: String + + @objc + public init(_ arg: String) { + self.tooManyUpdates = arg + let swift = Team.AddSecondaryEmailResult.tooManyUpdates(arg) + super.init(swift: swift) + } +} + +/// An unknown error occurred. +@objc +public class DBXTeamAddSecondaryEmailResultUnknownError: DBXTeamAddSecondaryEmailResult { + @objc + public var unknownError: String + + @objc + public init(_ arg: String) { + self.unknownError = arg + let swift = Team.AddSecondaryEmailResult.unknownError(arg) + super.init(swift: swift) + } +} + +/// Too many emails are being sent to this email address. Please try again later. +@objc +public class DBXTeamAddSecondaryEmailResultRateLimited: DBXTeamAddSecondaryEmailResult { + @objc + public var rateLimited: String + + @objc + public init(_ arg: String) { + self.rateLimited = arg + let swift = Team.AddSecondaryEmailResult.rateLimited(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamAddSecondaryEmailResultOther: DBXTeamAddSecondaryEmailResult { + @objc + public init() { + let swift = Team.AddSecondaryEmailResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AddSecondaryEmailsArg struct +@objc +public class DBXTeamAddSecondaryEmailsArg: NSObject { + /// List of users and secondary emails to add. + @objc + public var newSecondaryEmails: [DBXTeamUserSecondaryEmailsArg] { swift.newSecondaryEmails.map { DBXTeamUserSecondaryEmailsArg(swift: $0) } } + + @objc + public init(newSecondaryEmails: [DBXTeamUserSecondaryEmailsArg]) { + self.swift = Team.AddSecondaryEmailsArg(newSecondaryEmails: newSecondaryEmails.map(\.swift)) + } + + let swift: Team.AddSecondaryEmailsArg + + public init(swift: Team.AddSecondaryEmailsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error returned when adding secondary emails fails. +@objc +public class DBXTeamAddSecondaryEmailsError: NSObject { + let swift: Team.AddSecondaryEmailsError + + public init(swift: Team.AddSecondaryEmailsError) { + self.swift = swift + } + + public static func factory(swift: Team.AddSecondaryEmailsError) -> DBXTeamAddSecondaryEmailsError { + switch swift { + case .secondaryEmailsDisabled: + return DBXTeamAddSecondaryEmailsErrorSecondaryEmailsDisabled() + case .tooManyEmails: + return DBXTeamAddSecondaryEmailsErrorTooManyEmails() + case .other: + return DBXTeamAddSecondaryEmailsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSecondaryEmailsDisabled: DBXTeamAddSecondaryEmailsErrorSecondaryEmailsDisabled? { + self as? DBXTeamAddSecondaryEmailsErrorSecondaryEmailsDisabled + } + + @objc + public var asTooManyEmails: DBXTeamAddSecondaryEmailsErrorTooManyEmails? { + self as? DBXTeamAddSecondaryEmailsErrorTooManyEmails + } + + @objc + public var asOther: DBXTeamAddSecondaryEmailsErrorOther? { + self as? DBXTeamAddSecondaryEmailsErrorOther + } +} + +/// Secondary emails are disabled for the team. +@objc +public class DBXTeamAddSecondaryEmailsErrorSecondaryEmailsDisabled: DBXTeamAddSecondaryEmailsError { + @objc + public init() { + let swift = Team.AddSecondaryEmailsError.secondaryEmailsDisabled + super.init(swift: swift) + } +} + +/// A maximum of 20 secondary emails can be added in a single call. +@objc +public class DBXTeamAddSecondaryEmailsErrorTooManyEmails: DBXTeamAddSecondaryEmailsError { + @objc + public init() { + let swift = Team.AddSecondaryEmailsError.tooManyEmails + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamAddSecondaryEmailsErrorOther: DBXTeamAddSecondaryEmailsError { + @objc + public init() { + let swift = Team.AddSecondaryEmailsError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AddSecondaryEmailsResult struct +@objc +public class DBXTeamAddSecondaryEmailsResult: NSObject { + /// List of users and secondary email results. + @objc + public var results: [DBXTeamUserAddResult] { swift.results.map { DBXTeamUserAddResult(swift: $0) } } + + @objc + public init(results: [DBXTeamUserAddResult]) { + self.swift = Team.AddSecondaryEmailsResult(results: results.map(\.swift)) + } + + let swift: Team.AddSecondaryEmailsResult + + public init(swift: Team.AddSecondaryEmailsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Describes which team-related admin permissions a user has. +@objc +public class DBXTeamAdminTier: NSObject { + let swift: Team.AdminTier + + public init(swift: Team.AdminTier) { + self.swift = swift + } + + public static func factory(swift: Team.AdminTier) -> DBXTeamAdminTier { + switch swift { + case .teamAdmin: + return DBXTeamAdminTierTeamAdmin() + case .userManagementAdmin: + return DBXTeamAdminTierUserManagementAdmin() + case .supportAdmin: + return DBXTeamAdminTierSupportAdmin() + case .memberOnly: + return DBXTeamAdminTierMemberOnly() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeamAdmin: DBXTeamAdminTierTeamAdmin? { + self as? DBXTeamAdminTierTeamAdmin + } + + @objc + public var asUserManagementAdmin: DBXTeamAdminTierUserManagementAdmin? { + self as? DBXTeamAdminTierUserManagementAdmin + } + + @objc + public var asSupportAdmin: DBXTeamAdminTierSupportAdmin? { + self as? DBXTeamAdminTierSupportAdmin + } + + @objc + public var asMemberOnly: DBXTeamAdminTierMemberOnly? { + self as? DBXTeamAdminTierMemberOnly + } +} + +/// User is an administrator of the team - has all permissions. +@objc +public class DBXTeamAdminTierTeamAdmin: DBXTeamAdminTier { + @objc + public init() { + let swift = Team.AdminTier.teamAdmin + super.init(swift: swift) + } +} + +/// User can do most user provisioning, de-provisioning and management. +@objc +public class DBXTeamAdminTierUserManagementAdmin: DBXTeamAdminTier { + @objc + public init() { + let swift = Team.AdminTier.userManagementAdmin + super.init(swift: swift) + } +} + +/// User can do a limited set of common support tasks for existing users. Note: Dropbox is adding new types of +/// admin roles; these may display as support_admin. +@objc +public class DBXTeamAdminTierSupportAdmin: DBXTeamAdminTier { + @objc + public init() { + let swift = Team.AdminTier.supportAdmin + super.init(swift: swift) + } +} + +/// User is not an admin of the team. +@objc +public class DBXTeamAdminTierMemberOnly: DBXTeamAdminTier { + @objc + public init() { + let swift = Team.AdminTier.memberOnly + super.init(swift: swift) + } +} + +/// Information on linked third party applications. +@objc +public class DBXTeamApiApp: NSObject { + /// The application unique id. + @objc + public var appId: String { swift.appId } + /// The application name. + @objc + public var appName: String { swift.appName } + /// The application publisher name. + @objc + public var publisher: String? { swift.publisher } + /// The publisher's URL. + @objc + public var publisherUrl: String? { swift.publisherUrl } + /// The time this application was linked. + @objc + public var linked: Date? { swift.linked } + /// Whether the linked application uses a dedicated folder. + @objc + public var isAppFolder: NSNumber { swift.isAppFolder as NSNumber } + + @objc + public init(appId: String, appName: String, isAppFolder: NSNumber, publisher: String?, publisherUrl: String?, linked: Date?) { + self.swift = Team.ApiApp( + appId: appId, + appName: appName, + isAppFolder: isAppFolder.boolValue, + publisher: publisher, + publisherUrl: publisherUrl, + linked: linked + ) + } + + let swift: Team.ApiApp + + public init(swift: Team.ApiApp) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Base report structure. +@objc +public class DBXTeamBaseDfbReport: NSObject { + /// First date present in the results as 'YYYY-MM-DD' or None. + @objc + public var startDate: String { swift.startDate } + + @objc + public init(startDate: String) { + self.swift = Team.BaseDfbReport(startDate: startDate) + } + + let swift: Team.BaseDfbReport + + public init(swift: Team.BaseDfbReport) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Base error that all errors for existing team folders should extend. +@objc +public class DBXTeamBaseTeamFolderError: NSObject { + let swift: Team.BaseTeamFolderError + + public init(swift: Team.BaseTeamFolderError) { + self.swift = swift + } + + public static func factory(swift: Team.BaseTeamFolderError) -> DBXTeamBaseTeamFolderError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXTeamTeamFolderAccessError(swift: swiftArg) + return DBXTeamBaseTeamFolderErrorAccessError(arg) + case .statusError(let swiftArg): + let arg = DBXTeamTeamFolderInvalidStatusError(swift: swiftArg) + return DBXTeamBaseTeamFolderErrorStatusError(arg) + case .teamSharedDropboxError(let swiftArg): + let arg = DBXTeamTeamFolderTeamSharedDropboxError(swift: swiftArg) + return DBXTeamBaseTeamFolderErrorTeamSharedDropboxError(arg) + case .other: + return DBXTeamBaseTeamFolderErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXTeamBaseTeamFolderErrorAccessError? { + self as? DBXTeamBaseTeamFolderErrorAccessError + } + + @objc + public var asStatusError: DBXTeamBaseTeamFolderErrorStatusError? { + self as? DBXTeamBaseTeamFolderErrorStatusError + } + + @objc + public var asTeamSharedDropboxError: DBXTeamBaseTeamFolderErrorTeamSharedDropboxError? { + self as? DBXTeamBaseTeamFolderErrorTeamSharedDropboxError + } + + @objc + public var asOther: DBXTeamBaseTeamFolderErrorOther? { + self as? DBXTeamBaseTeamFolderErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamBaseTeamFolderErrorAccessError: DBXTeamBaseTeamFolderError { + @objc + public var accessError: DBXTeamTeamFolderAccessError + + @objc + public init(_ arg: DBXTeamTeamFolderAccessError) { + self.accessError = arg + let swift = Team.BaseTeamFolderError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamBaseTeamFolderErrorStatusError: DBXTeamBaseTeamFolderError { + @objc + public var statusError: DBXTeamTeamFolderInvalidStatusError + + @objc + public init(_ arg: DBXTeamTeamFolderInvalidStatusError) { + self.statusError = arg + let swift = Team.BaseTeamFolderError.statusError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamBaseTeamFolderErrorTeamSharedDropboxError: DBXTeamBaseTeamFolderError { + @objc + public var teamSharedDropboxError: DBXTeamTeamFolderTeamSharedDropboxError + + @objc + public init(_ arg: DBXTeamTeamFolderTeamSharedDropboxError) { + self.teamSharedDropboxError = arg + let swift = Team.BaseTeamFolderError.teamSharedDropboxError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamBaseTeamFolderErrorOther: DBXTeamBaseTeamFolderError { + @objc + public init() { + let swift = Team.BaseTeamFolderError.other + super.init(swift: swift) + } +} + +/// Error returned when getting member custom quota. +@objc +public class DBXTeamCustomQuotaError: NSObject { + let swift: Team.CustomQuotaError + + public init(swift: Team.CustomQuotaError) { + self.swift = swift + } + + public static func factory(swift: Team.CustomQuotaError) -> DBXTeamCustomQuotaError { + switch swift { + case .tooManyUsers: + return DBXTeamCustomQuotaErrorTooManyUsers() + case .other: + return DBXTeamCustomQuotaErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTooManyUsers: DBXTeamCustomQuotaErrorTooManyUsers? { + self as? DBXTeamCustomQuotaErrorTooManyUsers + } + + @objc + public var asOther: DBXTeamCustomQuotaErrorOther? { + self as? DBXTeamCustomQuotaErrorOther + } +} + +/// A maximum of 1000 users can be set for a single call. +@objc +public class DBXTeamCustomQuotaErrorTooManyUsers: DBXTeamCustomQuotaError { + @objc + public init() { + let swift = Team.CustomQuotaError.tooManyUsers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamCustomQuotaErrorOther: DBXTeamCustomQuotaError { + @objc + public init() { + let swift = Team.CustomQuotaError.other + super.init(swift: swift) + } +} + +/// User custom quota. +@objc +public class DBXTeamCustomQuotaResult: NSObject { + let swift: Team.CustomQuotaResult + + public init(swift: Team.CustomQuotaResult) { + self.swift = swift + } + + public static func factory(swift: Team.CustomQuotaResult) -> DBXTeamCustomQuotaResult { + switch swift { + case .success(let swiftArg): + let arg = DBXTeamUserCustomQuotaResult(swift: swiftArg) + return DBXTeamCustomQuotaResultSuccess(arg) + case .invalidUser(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamCustomQuotaResultInvalidUser(arg) + case .other: + return DBXTeamCustomQuotaResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamCustomQuotaResultSuccess? { + self as? DBXTeamCustomQuotaResultSuccess + } + + @objc + public var asInvalidUser: DBXTeamCustomQuotaResultInvalidUser? { + self as? DBXTeamCustomQuotaResultInvalidUser + } + + @objc + public var asOther: DBXTeamCustomQuotaResultOther? { + self as? DBXTeamCustomQuotaResultOther + } +} + +/// User's custom quota. +@objc +public class DBXTeamCustomQuotaResultSuccess: DBXTeamCustomQuotaResult { + @objc + public var success: DBXTeamUserCustomQuotaResult + + @objc + public init(_ arg: DBXTeamUserCustomQuotaResult) { + self.success = arg + let swift = Team.CustomQuotaResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// Invalid user (not in team). +@objc +public class DBXTeamCustomQuotaResultInvalidUser: DBXTeamCustomQuotaResult { + @objc + public var invalidUser: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.invalidUser = arg + let swift = Team.CustomQuotaResult.invalidUser(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamCustomQuotaResultOther: DBXTeamCustomQuotaResult { + @objc + public init() { + let swift = Team.CustomQuotaResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible CustomQuotaUsersArg struct +@objc +public class DBXTeamCustomQuotaUsersArg: NSObject { + /// List of users. + @objc + public var users: [DBXTeamUserSelectorArg] { swift.users.map { DBXTeamUserSelectorArg(swift: $0) } } + + @objc + public init(users: [DBXTeamUserSelectorArg]) { + self.swift = Team.CustomQuotaUsersArg(users: users.map(\.swift)) + } + + let swift: Team.CustomQuotaUsersArg + + public init(swift: Team.CustomQuotaUsersArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Input arguments that can be provided for most reports. +@objc +public class DBXTeamDateRange: NSObject { + /// Optional starting date (inclusive). If start_date is None or too long ago, this field will be set to 6 + /// months ago. + @objc + public var startDate: Date? { swift.startDate } + /// Optional ending date (exclusive). + @objc + public var endDate: Date? { swift.endDate } + + @objc + public init(startDate: Date?, endDate: Date?) { + self.swift = Team.DateRange(startDate: startDate, endDate: endDate) + } + + let swift: Team.DateRange + + public init(swift: Team.DateRange) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Errors that can originate from problems in input arguments to reports. +@objc +public class DBXTeamDateRangeError: NSObject { + let swift: Team.DateRangeError + + public init(swift: Team.DateRangeError) { + self.swift = swift + } + + public static func factory(swift: Team.DateRangeError) -> DBXTeamDateRangeError { + switch swift { + case .other: + return DBXTeamDateRangeErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOther: DBXTeamDateRangeErrorOther? { + self as? DBXTeamDateRangeErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamDateRangeErrorOther: DBXTeamDateRangeError { + @objc + public init() { + let swift = Team.DateRangeError.other + super.init(swift: swift) + } +} + +/// Result of trying to delete a secondary email address. 'success' is the only value indicating that a secondary +/// email was successfully deleted. The other values explain the type of error that occurred, and include the email +/// for which the error occurred. +@objc +public class DBXTeamDeleteSecondaryEmailResult: NSObject { + let swift: Team.DeleteSecondaryEmailResult + + public init(swift: Team.DeleteSecondaryEmailResult) { + self.swift = swift + } + + public static func factory(swift: Team.DeleteSecondaryEmailResult) -> DBXTeamDeleteSecondaryEmailResult { + switch swift { + case .success(let swiftArg): + let arg = swiftArg + return DBXTeamDeleteSecondaryEmailResultSuccess(arg) + case .notFound(let swiftArg): + let arg = swiftArg + return DBXTeamDeleteSecondaryEmailResultNotFound(arg) + case .cannotRemovePrimary(let swiftArg): + let arg = swiftArg + return DBXTeamDeleteSecondaryEmailResultCannotRemovePrimary(arg) + case .other: + return DBXTeamDeleteSecondaryEmailResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamDeleteSecondaryEmailResultSuccess? { + self as? DBXTeamDeleteSecondaryEmailResultSuccess + } + + @objc + public var asNotFound: DBXTeamDeleteSecondaryEmailResultNotFound? { + self as? DBXTeamDeleteSecondaryEmailResultNotFound + } + + @objc + public var asCannotRemovePrimary: DBXTeamDeleteSecondaryEmailResultCannotRemovePrimary? { + self as? DBXTeamDeleteSecondaryEmailResultCannotRemovePrimary + } + + @objc + public var asOther: DBXTeamDeleteSecondaryEmailResultOther? { + self as? DBXTeamDeleteSecondaryEmailResultOther + } +} + +/// The secondary email was successfully deleted. +@objc +public class DBXTeamDeleteSecondaryEmailResultSuccess: DBXTeamDeleteSecondaryEmailResult { + @objc + public var success: String + + @objc + public init(_ arg: String) { + self.success = arg + let swift = Team.DeleteSecondaryEmailResult.success(arg) + super.init(swift: swift) + } +} + +/// The email address was not found for the user. +@objc +public class DBXTeamDeleteSecondaryEmailResultNotFound: DBXTeamDeleteSecondaryEmailResult { + @objc + public var notFound: String + + @objc + public init(_ arg: String) { + self.notFound = arg + let swift = Team.DeleteSecondaryEmailResult.notFound(arg) + super.init(swift: swift) + } +} + +/// The email address is the primary email address of the user, and cannot be removed. +@objc +public class DBXTeamDeleteSecondaryEmailResultCannotRemovePrimary: DBXTeamDeleteSecondaryEmailResult { + @objc + public var cannotRemovePrimary: String + + @objc + public init(_ arg: String) { + self.cannotRemovePrimary = arg + let swift = Team.DeleteSecondaryEmailResult.cannotRemovePrimary(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamDeleteSecondaryEmailResultOther: DBXTeamDeleteSecondaryEmailResult { + @objc + public init() { + let swift = Team.DeleteSecondaryEmailResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DeleteSecondaryEmailsArg struct +@objc +public class DBXTeamDeleteSecondaryEmailsArg: NSObject { + /// List of users and their secondary emails to delete. + @objc + public var emailsToDelete: [DBXTeamUserSecondaryEmailsArg] { swift.emailsToDelete.map { DBXTeamUserSecondaryEmailsArg(swift: $0) } } + + @objc + public init(emailsToDelete: [DBXTeamUserSecondaryEmailsArg]) { + self.swift = Team.DeleteSecondaryEmailsArg(emailsToDelete: emailsToDelete.map(\.swift)) + } + + let swift: Team.DeleteSecondaryEmailsArg + + public init(swift: Team.DeleteSecondaryEmailsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeleteSecondaryEmailsResult struct +@objc +public class DBXTeamDeleteSecondaryEmailsResult: NSObject { + /// (no description) + @objc + public var results: [DBXTeamUserDeleteResult] { swift.results.map { DBXTeamUserDeleteResult(swift: $0) } } + + @objc + public init(results: [DBXTeamUserDeleteResult]) { + self.swift = Team.DeleteSecondaryEmailsResult(results: results.map(\.swift)) + } + + let swift: Team.DeleteSecondaryEmailsResult + + public init(swift: Team.DeleteSecondaryEmailsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about linked Dropbox desktop client sessions. +@objc +public class DBXTeamDesktopClientSession: DBXTeamDeviceSession { + /// Name of the hosting desktop. + @objc + public var hostName: String { subSwift.hostName } + /// The Dropbox desktop client type. + @objc + public var clientType: DBXTeamDesktopPlatform { DBXTeamDesktopPlatform(swift: subSwift.clientType) } + /// The Dropbox client version. + @objc + public var clientVersion: String { subSwift.clientVersion } + /// Information on the hosting platform. + @objc + public var platform: String { subSwift.platform } + /// Whether it's possible to delete all of the account files upon unlinking. + @objc + public var isDeleteOnUnlinkSupported: NSNumber { subSwift.isDeleteOnUnlinkSupported as NSNumber } + + @objc + public init( + sessionId: String, + hostName: String, + clientType: DBXTeamDesktopPlatform, + clientVersion: String, + platform: String, + isDeleteOnUnlinkSupported: NSNumber, + ipAddress: String?, + country: String?, + created: Date?, + updated: Date? + ) { + let swift = Team.DesktopClientSession( + sessionId: sessionId, + hostName: hostName, + clientType: clientType.swift, + clientVersion: clientVersion, + platform: platform, + isDeleteOnUnlinkSupported: isDeleteOnUnlinkSupported.boolValue, + ipAddress: ipAddress, + country: country, + created: created, + updated: updated + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.DesktopClientSession + + public init(swift: Team.DesktopClientSession) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible DesktopPlatform union +@objc +public class DBXTeamDesktopPlatform: NSObject { + let swift: Team.DesktopPlatform + + public init(swift: Team.DesktopPlatform) { + self.swift = swift + } + + public static func factory(swift: Team.DesktopPlatform) -> DBXTeamDesktopPlatform { + switch swift { + case .windows: + return DBXTeamDesktopPlatformWindows() + case .mac: + return DBXTeamDesktopPlatformMac() + case .linux: + return DBXTeamDesktopPlatformLinux() + case .other: + return DBXTeamDesktopPlatformOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asWindows: DBXTeamDesktopPlatformWindows? { + self as? DBXTeamDesktopPlatformWindows + } + + @objc + public var asMac: DBXTeamDesktopPlatformMac? { + self as? DBXTeamDesktopPlatformMac + } + + @objc + public var asLinux: DBXTeamDesktopPlatformLinux? { + self as? DBXTeamDesktopPlatformLinux + } + + @objc + public var asOther: DBXTeamDesktopPlatformOther? { + self as? DBXTeamDesktopPlatformOther + } +} + +/// Official Windows Dropbox desktop client. +@objc +public class DBXTeamDesktopPlatformWindows: DBXTeamDesktopPlatform { + @objc + public init() { + let swift = Team.DesktopPlatform.windows + super.init(swift: swift) + } +} + +/// Official Mac Dropbox desktop client. +@objc +public class DBXTeamDesktopPlatformMac: DBXTeamDesktopPlatform { + @objc + public init() { + let swift = Team.DesktopPlatform.mac + super.init(swift: swift) + } +} + +/// Official Linux Dropbox desktop client. +@objc +public class DBXTeamDesktopPlatformLinux: DBXTeamDesktopPlatform { + @objc + public init() { + let swift = Team.DesktopPlatform.linux + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamDesktopPlatformOther: DBXTeamDesktopPlatform { + @objc + public init() { + let swift = Team.DesktopPlatform.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DeviceSessionArg struct +@objc +public class DBXTeamDeviceSessionArg: NSObject { + /// The session id. + @objc + public var sessionId: String { swift.sessionId } + /// The unique id of the member owning the device. + @objc + public var teamMemberId: String { swift.teamMemberId } + + @objc + public init(sessionId: String, teamMemberId: String) { + self.swift = Team.DeviceSessionArg(sessionId: sessionId, teamMemberId: teamMemberId) + } + + let swift: Team.DeviceSessionArg + + public init(swift: Team.DeviceSessionArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Each of the items is an array of values, one value per day. The value is the number of devices active within a +/// time window, ending with that day. If there is no data for a day, then the value will be None. +@objc +public class DBXTeamDevicesActive: NSObject { + /// Array of number of linked windows (desktop) clients with activity. + @objc + public var windows: [NSNumber] { swift.windows.compactMap { $0 as NSNumber? } } + /// Array of number of linked mac (desktop) clients with activity. + @objc + public var macos: [NSNumber] { swift.macos.compactMap { $0 as NSNumber? } } + /// Array of number of linked linus (desktop) clients with activity. + @objc + public var linux: [NSNumber] { swift.linux.compactMap { $0 as NSNumber? } } + /// Array of number of linked ios devices with activity. + @objc + public var ios: [NSNumber] { swift.ios.compactMap { $0 as NSNumber? } } + /// Array of number of linked android devices with activity. + @objc + public var android: [NSNumber] { swift.android.compactMap { $0 as NSNumber? } } + /// Array of number of other linked devices (blackberry, windows phone, etc) with activity. + @objc + public var other: [NSNumber] { swift.other.compactMap { $0 as NSNumber? } } + /// Array of total number of linked clients with activity. + @objc + public var total: [NSNumber] { swift.total.compactMap { $0 as NSNumber? } } + + @objc + public init(windows: [NSNumber], macos: [NSNumber], linux: [NSNumber], ios: [NSNumber], android: [NSNumber], other: [NSNumber], total: [NSNumber]) { + self.swift = Team.DevicesActive( + windows: windows.map(\.uint64Value), + macos: macos.map(\.uint64Value), + linux: linux.map(\.uint64Value), + ios: ios.map(\.uint64Value), + android: android.map(\.uint64Value), + other: other.map(\.uint64Value), + total: total.map(\.uint64Value) + ) + } + + let swift: Team.DevicesActive + + public init(swift: Team.DevicesActive) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Excluded users list argument. +@objc +public class DBXTeamExcludedUsersListArg: NSObject { + /// Number of results to return per call. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(limit: NSNumber) { + self.swift = Team.ExcludedUsersListArg(limit: limit.uint32Value) + } + + let swift: Team.ExcludedUsersListArg + + public init(swift: Team.ExcludedUsersListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Excluded users list continue argument. +@objc +public class DBXTeamExcludedUsersListContinueArg: NSObject { + /// Indicates from what point to get the next set of users. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Team.ExcludedUsersListContinueArg(cursor: cursor) + } + + let swift: Team.ExcludedUsersListContinueArg + + public init(swift: Team.ExcludedUsersListContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Excluded users list continue error. +@objc +public class DBXTeamExcludedUsersListContinueError: NSObject { + let swift: Team.ExcludedUsersListContinueError + + public init(swift: Team.ExcludedUsersListContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.ExcludedUsersListContinueError) -> DBXTeamExcludedUsersListContinueError { + switch swift { + case .invalidCursor: + return DBXTeamExcludedUsersListContinueErrorInvalidCursor() + case .other: + return DBXTeamExcludedUsersListContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidCursor: DBXTeamExcludedUsersListContinueErrorInvalidCursor? { + self as? DBXTeamExcludedUsersListContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXTeamExcludedUsersListContinueErrorOther? { + self as? DBXTeamExcludedUsersListContinueErrorOther + } +} + +/// The cursor is invalid. +@objc +public class DBXTeamExcludedUsersListContinueErrorInvalidCursor: DBXTeamExcludedUsersListContinueError { + @objc + public init() { + let swift = Team.ExcludedUsersListContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamExcludedUsersListContinueErrorOther: DBXTeamExcludedUsersListContinueError { + @objc + public init() { + let swift = Team.ExcludedUsersListContinueError.other + super.init(swift: swift) + } +} + +/// Excluded users list error. +@objc +public class DBXTeamExcludedUsersListError: NSObject { + let swift: Team.ExcludedUsersListError + + public init(swift: Team.ExcludedUsersListError) { + self.swift = swift + } + + public static func factory(swift: Team.ExcludedUsersListError) -> DBXTeamExcludedUsersListError { + switch swift { + case .listError: + return DBXTeamExcludedUsersListErrorListError() + case .other: + return DBXTeamExcludedUsersListErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asListError: DBXTeamExcludedUsersListErrorListError? { + self as? DBXTeamExcludedUsersListErrorListError + } + + @objc + public var asOther: DBXTeamExcludedUsersListErrorOther? { + self as? DBXTeamExcludedUsersListErrorOther + } +} + +/// An error occurred. +@objc +public class DBXTeamExcludedUsersListErrorListError: DBXTeamExcludedUsersListError { + @objc + public init() { + let swift = Team.ExcludedUsersListError.listError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamExcludedUsersListErrorOther: DBXTeamExcludedUsersListError { + @objc + public init() { + let swift = Team.ExcludedUsersListError.other + super.init(swift: swift) + } +} + +/// Excluded users list result. +@objc +public class DBXTeamExcludedUsersListResult: NSObject { + /// (no description) + @objc + public var users: [DBXTeamMemberProfile] { swift.users.map { DBXTeamMemberProfile(swift: $0) } } + /// Pass the cursor into memberSpaceLimitsExcludedUsersListContinue to obtain additional excluded users. + @objc + public var cursor: String? { swift.cursor } + /// Is true if there are additional excluded users that have not been returned yet. An additional call to + /// memberSpaceLimitsExcludedUsersListContinue can retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(users: [DBXTeamMemberProfile], hasMore: NSNumber, cursor: String?) { + self.swift = Team.ExcludedUsersListResult(users: users.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Team.ExcludedUsersListResult + + public init(swift: Team.ExcludedUsersListResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Argument of excluded users update operation. Should include a list of users to add/remove (according to +/// endpoint), Maximum size of the list is 1000 users. +@objc +public class DBXTeamExcludedUsersUpdateArg: NSObject { + /// List of users to be added/removed. + @objc + public var users: [DBXTeamUserSelectorArg]? { swift.users?.map { DBXTeamUserSelectorArg(swift: $0) } } + + @objc + public init(users: [DBXTeamUserSelectorArg]?) { + self.swift = Team.ExcludedUsersUpdateArg(users: users?.map(\.swift)) + } + + let swift: Team.ExcludedUsersUpdateArg + + public init(swift: Team.ExcludedUsersUpdateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Excluded users update error. +@objc +public class DBXTeamExcludedUsersUpdateError: NSObject { + let swift: Team.ExcludedUsersUpdateError + + public init(swift: Team.ExcludedUsersUpdateError) { + self.swift = swift + } + + public static func factory(swift: Team.ExcludedUsersUpdateError) -> DBXTeamExcludedUsersUpdateError { + switch swift { + case .usersNotInTeam: + return DBXTeamExcludedUsersUpdateErrorUsersNotInTeam() + case .tooManyUsers: + return DBXTeamExcludedUsersUpdateErrorTooManyUsers() + case .other: + return DBXTeamExcludedUsersUpdateErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUsersNotInTeam: DBXTeamExcludedUsersUpdateErrorUsersNotInTeam? { + self as? DBXTeamExcludedUsersUpdateErrorUsersNotInTeam + } + + @objc + public var asTooManyUsers: DBXTeamExcludedUsersUpdateErrorTooManyUsers? { + self as? DBXTeamExcludedUsersUpdateErrorTooManyUsers + } + + @objc + public var asOther: DBXTeamExcludedUsersUpdateErrorOther? { + self as? DBXTeamExcludedUsersUpdateErrorOther + } +} + +/// At least one of the users is not part of your team. +@objc +public class DBXTeamExcludedUsersUpdateErrorUsersNotInTeam: DBXTeamExcludedUsersUpdateError { + @objc + public init() { + let swift = Team.ExcludedUsersUpdateError.usersNotInTeam + super.init(swift: swift) + } +} + +/// A maximum of 1000 users for each of addition/removal can be supplied. +@objc +public class DBXTeamExcludedUsersUpdateErrorTooManyUsers: DBXTeamExcludedUsersUpdateError { + @objc + public init() { + let swift = Team.ExcludedUsersUpdateError.tooManyUsers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamExcludedUsersUpdateErrorOther: DBXTeamExcludedUsersUpdateError { + @objc + public init() { + let swift = Team.ExcludedUsersUpdateError.other + super.init(swift: swift) + } +} + +/// Excluded users update result. +@objc +public class DBXTeamExcludedUsersUpdateResult: NSObject { + /// Update status. + @objc + public var status: DBXTeamExcludedUsersUpdateStatus { DBXTeamExcludedUsersUpdateStatus(swift: swift.status) } + + @objc + public init(status: DBXTeamExcludedUsersUpdateStatus) { + self.swift = Team.ExcludedUsersUpdateResult(status: status.swift) + } + + let swift: Team.ExcludedUsersUpdateResult + + public init(swift: Team.ExcludedUsersUpdateResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Excluded users update operation status. +@objc +public class DBXTeamExcludedUsersUpdateStatus: NSObject { + let swift: Team.ExcludedUsersUpdateStatus + + public init(swift: Team.ExcludedUsersUpdateStatus) { + self.swift = swift + } + + public static func factory(swift: Team.ExcludedUsersUpdateStatus) -> DBXTeamExcludedUsersUpdateStatus { + switch swift { + case .success: + return DBXTeamExcludedUsersUpdateStatusSuccess() + case .other: + return DBXTeamExcludedUsersUpdateStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamExcludedUsersUpdateStatusSuccess? { + self as? DBXTeamExcludedUsersUpdateStatusSuccess + } + + @objc + public var asOther: DBXTeamExcludedUsersUpdateStatusOther? { + self as? DBXTeamExcludedUsersUpdateStatusOther + } +} + +/// Update successful. +@objc +public class DBXTeamExcludedUsersUpdateStatusSuccess: DBXTeamExcludedUsersUpdateStatus { + @objc + public init() { + let swift = Team.ExcludedUsersUpdateStatus.success + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamExcludedUsersUpdateStatusOther: DBXTeamExcludedUsersUpdateStatus { + @objc + public init() { + let swift = Team.ExcludedUsersUpdateStatus.other + super.init(swift: swift) + } +} + +/// A set of features that a Dropbox Business account may support. +@objc +public class DBXTeamFeature: NSObject { + let swift: Team.Feature + + public init(swift: Team.Feature) { + self.swift = swift + } + + public static func factory(swift: Team.Feature) -> DBXTeamFeature { + switch swift { + case .uploadApiRateLimit: + return DBXTeamFeatureUploadApiRateLimit() + case .hasTeamSharedDropbox: + return DBXTeamFeatureHasTeamSharedDropbox() + case .hasTeamFileEvents: + return DBXTeamFeatureHasTeamFileEvents() + case .hasTeamSelectiveSync: + return DBXTeamFeatureHasTeamSelectiveSync() + case .other: + return DBXTeamFeatureOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUploadApiRateLimit: DBXTeamFeatureUploadApiRateLimit? { + self as? DBXTeamFeatureUploadApiRateLimit + } + + @objc + public var asHasTeamSharedDropbox: DBXTeamFeatureHasTeamSharedDropbox? { + self as? DBXTeamFeatureHasTeamSharedDropbox + } + + @objc + public var asHasTeamFileEvents: DBXTeamFeatureHasTeamFileEvents? { + self as? DBXTeamFeatureHasTeamFileEvents + } + + @objc + public var asHasTeamSelectiveSync: DBXTeamFeatureHasTeamSelectiveSync? { + self as? DBXTeamFeatureHasTeamSelectiveSync + } + + @objc + public var asOther: DBXTeamFeatureOther? { + self as? DBXTeamFeatureOther + } +} + +/// The number of upload API calls allowed per month. +@objc +public class DBXTeamFeatureUploadApiRateLimit: DBXTeamFeature { + @objc + public init() { + let swift = Team.Feature.uploadApiRateLimit + super.init(swift: swift) + } +} + +/// Does this team have a shared team root. +@objc +public class DBXTeamFeatureHasTeamSharedDropbox: DBXTeamFeature { + @objc + public init() { + let swift = Team.Feature.hasTeamSharedDropbox + super.init(swift: swift) + } +} + +/// Does this team have file events. +@objc +public class DBXTeamFeatureHasTeamFileEvents: DBXTeamFeature { + @objc + public init() { + let swift = Team.Feature.hasTeamFileEvents + super.init(swift: swift) + } +} + +/// Does this team have team selective sync enabled. +@objc +public class DBXTeamFeatureHasTeamSelectiveSync: DBXTeamFeature { + @objc + public init() { + let swift = Team.Feature.hasTeamSelectiveSync + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamFeatureOther: DBXTeamFeature { + @objc + public init() { + let swift = Team.Feature.other + super.init(swift: swift) + } +} + +/// The values correspond to entries in Feature. You may get different value according to your Dropbox Business +/// plan. +@objc +public class DBXTeamFeatureValue: NSObject { + let swift: Team.FeatureValue + + public init(swift: Team.FeatureValue) { + self.swift = swift + } + + public static func factory(swift: Team.FeatureValue) -> DBXTeamFeatureValue { + switch swift { + case .uploadApiRateLimit(let swiftArg): + let arg = DBXTeamUploadApiRateLimitValue(swift: swiftArg) + return DBXTeamFeatureValueUploadApiRateLimit(arg) + case .hasTeamSharedDropbox(let swiftArg): + let arg = DBXTeamHasTeamSharedDropboxValue(swift: swiftArg) + return DBXTeamFeatureValueHasTeamSharedDropbox(arg) + case .hasTeamFileEvents(let swiftArg): + let arg = DBXTeamHasTeamFileEventsValue(swift: swiftArg) + return DBXTeamFeatureValueHasTeamFileEvents(arg) + case .hasTeamSelectiveSync(let swiftArg): + let arg = DBXTeamHasTeamSelectiveSyncValue(swift: swiftArg) + return DBXTeamFeatureValueHasTeamSelectiveSync(arg) + case .other: + return DBXTeamFeatureValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUploadApiRateLimit: DBXTeamFeatureValueUploadApiRateLimit? { + self as? DBXTeamFeatureValueUploadApiRateLimit + } + + @objc + public var asHasTeamSharedDropbox: DBXTeamFeatureValueHasTeamSharedDropbox? { + self as? DBXTeamFeatureValueHasTeamSharedDropbox + } + + @objc + public var asHasTeamFileEvents: DBXTeamFeatureValueHasTeamFileEvents? { + self as? DBXTeamFeatureValueHasTeamFileEvents + } + + @objc + public var asHasTeamSelectiveSync: DBXTeamFeatureValueHasTeamSelectiveSync? { + self as? DBXTeamFeatureValueHasTeamSelectiveSync + } + + @objc + public var asOther: DBXTeamFeatureValueOther? { + self as? DBXTeamFeatureValueOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamFeatureValueUploadApiRateLimit: DBXTeamFeatureValue { + @objc + public var uploadApiRateLimit: DBXTeamUploadApiRateLimitValue + + @objc + public init(_ arg: DBXTeamUploadApiRateLimitValue) { + self.uploadApiRateLimit = arg + let swift = Team.FeatureValue.uploadApiRateLimit(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamFeatureValueHasTeamSharedDropbox: DBXTeamFeatureValue { + @objc + public var hasTeamSharedDropbox: DBXTeamHasTeamSharedDropboxValue + + @objc + public init(_ arg: DBXTeamHasTeamSharedDropboxValue) { + self.hasTeamSharedDropbox = arg + let swift = Team.FeatureValue.hasTeamSharedDropbox(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamFeatureValueHasTeamFileEvents: DBXTeamFeatureValue { + @objc + public var hasTeamFileEvents: DBXTeamHasTeamFileEventsValue + + @objc + public init(_ arg: DBXTeamHasTeamFileEventsValue) { + self.hasTeamFileEvents = arg + let swift = Team.FeatureValue.hasTeamFileEvents(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamFeatureValueHasTeamSelectiveSync: DBXTeamFeatureValue { + @objc + public var hasTeamSelectiveSync: DBXTeamHasTeamSelectiveSyncValue + + @objc + public init(_ arg: DBXTeamHasTeamSelectiveSyncValue) { + self.hasTeamSelectiveSync = arg + let swift = Team.FeatureValue.hasTeamSelectiveSync(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamFeatureValueOther: DBXTeamFeatureValue { + @objc + public init() { + let swift = Team.FeatureValue.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FeaturesGetValuesBatchArg struct +@objc +public class DBXTeamFeaturesGetValuesBatchArg: NSObject { + /// A list of features in Feature. If the list is empty, this route will return FeaturesGetValuesBatchError. + @objc + public var features: [DBXTeamFeature] { swift.features.map { DBXTeamFeature(swift: $0) } } + + @objc + public init(features: [DBXTeamFeature]) { + self.swift = Team.FeaturesGetValuesBatchArg(features: features.map(\.swift)) + } + + let swift: Team.FeaturesGetValuesBatchArg + + public init(swift: Team.FeaturesGetValuesBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FeaturesGetValuesBatchError union +@objc +public class DBXTeamFeaturesGetValuesBatchError: NSObject { + let swift: Team.FeaturesGetValuesBatchError + + public init(swift: Team.FeaturesGetValuesBatchError) { + self.swift = swift + } + + public static func factory(swift: Team.FeaturesGetValuesBatchError) -> DBXTeamFeaturesGetValuesBatchError { + switch swift { + case .emptyFeaturesList: + return DBXTeamFeaturesGetValuesBatchErrorEmptyFeaturesList() + case .other: + return DBXTeamFeaturesGetValuesBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEmptyFeaturesList: DBXTeamFeaturesGetValuesBatchErrorEmptyFeaturesList? { + self as? DBXTeamFeaturesGetValuesBatchErrorEmptyFeaturesList + } + + @objc + public var asOther: DBXTeamFeaturesGetValuesBatchErrorOther? { + self as? DBXTeamFeaturesGetValuesBatchErrorOther + } +} + +/// At least one Feature must be included in the FeaturesGetValuesBatchArg.features list. +@objc +public class DBXTeamFeaturesGetValuesBatchErrorEmptyFeaturesList: DBXTeamFeaturesGetValuesBatchError { + @objc + public init() { + let swift = Team.FeaturesGetValuesBatchError.emptyFeaturesList + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamFeaturesGetValuesBatchErrorOther: DBXTeamFeaturesGetValuesBatchError { + @objc + public init() { + let swift = Team.FeaturesGetValuesBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FeaturesGetValuesBatchResult struct +@objc +public class DBXTeamFeaturesGetValuesBatchResult: NSObject { + /// (no description) + @objc + public var values: [DBXTeamFeatureValue] { swift.values.map { DBXTeamFeatureValue(swift: $0) } } + + @objc + public init(values: [DBXTeamFeatureValue]) { + self.swift = Team.FeaturesGetValuesBatchResult(values: values.map(\.swift)) + } + + let swift: Team.FeaturesGetValuesBatchResult + + public init(swift: Team.FeaturesGetValuesBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Activity Report Result. Each of the items in the storage report is an array of values, one value per day. If +/// there is no data for a day, then the value will be None. +@objc +public class DBXTeamGetActivityReport: DBXTeamBaseDfbReport { + /// Array of total number of adds by team members. + @objc + public var adds: [NSNumber] { subSwift.adds.compactMap { $0 as NSNumber? } } + /// Array of number of edits by team members. If the same user edits the same file multiple times this is + /// counted as a single edit. + @objc + public var edits: [NSNumber] { subSwift.edits.compactMap { $0 as NSNumber? } } + /// Array of total number of deletes by team members. + @objc + public var deletes: [NSNumber] { subSwift.deletes.compactMap { $0 as NSNumber? } } + /// Array of the number of users who have been active in the last 28 days. + @objc + public var activeUsers28Day: [NSNumber] { subSwift.activeUsers28Day.compactMap { $0 as NSNumber? } } + /// Array of the number of users who have been active in the last week. + @objc + public var activeUsers7Day: [NSNumber] { subSwift.activeUsers7Day.compactMap { $0 as NSNumber? } } + /// Array of the number of users who have been active in the last day. + @objc + public var activeUsers1Day: [NSNumber] { subSwift.activeUsers1Day.compactMap { $0 as NSNumber? } } + /// Array of the number of shared folders with some activity in the last 28 days. + @objc + public var activeSharedFolders28Day: [NSNumber] { subSwift.activeSharedFolders28Day.compactMap { $0 as NSNumber? } } + /// Array of the number of shared folders with some activity in the last week. + @objc + public var activeSharedFolders7Day: [NSNumber] { subSwift.activeSharedFolders7Day.compactMap { $0 as NSNumber? } } + /// Array of the number of shared folders with some activity in the last day. + @objc + public var activeSharedFolders1Day: [NSNumber] { subSwift.activeSharedFolders1Day.compactMap { $0 as NSNumber? } } + /// Array of the number of shared links created. + @objc + public var sharedLinksCreated: [NSNumber] { subSwift.sharedLinksCreated.compactMap { $0 as NSNumber? } } + /// Array of the number of views by team users to shared links created by the team. + @objc + public var sharedLinksViewedByTeam: [NSNumber] { subSwift.sharedLinksViewedByTeam.compactMap { $0 as NSNumber? } } + /// Array of the number of views by users outside of the team to shared links created by the team. + @objc + public var sharedLinksViewedByOutsideUser: [NSNumber] { subSwift.sharedLinksViewedByOutsideUser.compactMap { $0 as NSNumber? } } + /// Array of the number of views by non-logged-in users to shared links created by the team. + @objc + public var sharedLinksViewedByNotLoggedIn: [NSNumber] { subSwift.sharedLinksViewedByNotLoggedIn.compactMap { $0 as NSNumber? } } + /// Array of the total number of views to shared links created by the team. + @objc + public var sharedLinksViewedTotal: [NSNumber] { subSwift.sharedLinksViewedTotal.compactMap { $0 as NSNumber? } } + + @objc + public init( + startDate: String, + adds: [NSNumber], + edits: [NSNumber], + deletes: [NSNumber], + activeUsers28Day: [NSNumber], + activeUsers7Day: [NSNumber], + activeUsers1Day: [NSNumber], + activeSharedFolders28Day: [NSNumber], + activeSharedFolders7Day: [NSNumber], + activeSharedFolders1Day: [NSNumber], + sharedLinksCreated: [NSNumber], + sharedLinksViewedByTeam: [NSNumber], + sharedLinksViewedByOutsideUser: [NSNumber], + sharedLinksViewedByNotLoggedIn: [NSNumber], + sharedLinksViewedTotal: [NSNumber] + ) { + let swift = Team.GetActivityReport( + startDate: startDate, + adds: adds.map(\.uint64Value), + edits: edits.map(\.uint64Value), + deletes: deletes.map(\.uint64Value), + activeUsers28Day: activeUsers28Day.map(\.uint64Value), + activeUsers7Day: activeUsers7Day.map(\.uint64Value), + activeUsers1Day: activeUsers1Day.map(\.uint64Value), + activeSharedFolders28Day: activeSharedFolders28Day.map(\.uint64Value), + activeSharedFolders7Day: activeSharedFolders7Day.map(\.uint64Value), + activeSharedFolders1Day: activeSharedFolders1Day.map(\.uint64Value), + sharedLinksCreated: sharedLinksCreated.map(\.uint64Value), + sharedLinksViewedByTeam: sharedLinksViewedByTeam.map(\.uint64Value), + sharedLinksViewedByOutsideUser: sharedLinksViewedByOutsideUser.map(\.uint64Value), + sharedLinksViewedByNotLoggedIn: sharedLinksViewedByNotLoggedIn.map(\.uint64Value), + sharedLinksViewedTotal: sharedLinksViewedTotal.map(\.uint64Value) + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GetActivityReport + + public init(swift: Team.GetActivityReport) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Devices Report Result. Contains subsections for different time ranges of activity. Each of the items in each +/// subsection of the storage report is an array of values, one value per day. If there is no data for a day, then +/// the value will be None. +@objc +public class DBXTeamGetDevicesReport: DBXTeamBaseDfbReport { + /// Report of the number of devices active in the last day. + @objc + public var active1Day: DBXTeamDevicesActive { DBXTeamDevicesActive(swift: subSwift.active1Day) } + /// Report of the number of devices active in the last 7 days. + @objc + public var active7Day: DBXTeamDevicesActive { DBXTeamDevicesActive(swift: subSwift.active7Day) } + /// Report of the number of devices active in the last 28 days. + @objc + public var active28Day: DBXTeamDevicesActive { DBXTeamDevicesActive(swift: subSwift.active28Day) } + + @objc + public init(startDate: String, active1Day: DBXTeamDevicesActive, active7Day: DBXTeamDevicesActive, active28Day: DBXTeamDevicesActive) { + let swift = Team.GetDevicesReport(startDate: startDate, active1Day: active1Day.swift, active7Day: active7Day.swift, active28Day: active28Day.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GetDevicesReport + + public init(swift: Team.GetDevicesReport) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Membership Report Result. Each of the items in the storage report is an array of values, one value per day. If +/// there is no data for a day, then the value will be None. +@objc +public class DBXTeamGetMembershipReport: DBXTeamBaseDfbReport { + /// Team size, for each day. + @objc + public var teamSize: [NSNumber] { subSwift.teamSize.compactMap { $0 as NSNumber? } } + /// The number of pending invites to the team, for each day. + @objc + public var pendingInvites: [NSNumber] { subSwift.pendingInvites.compactMap { $0 as NSNumber? } } + /// The number of members that joined the team, for each day. + @objc + public var membersJoined: [NSNumber] { subSwift.membersJoined.compactMap { $0 as NSNumber? } } + /// The number of suspended team members, for each day. + @objc + public var suspendedMembers: [NSNumber] { subSwift.suspendedMembers.compactMap { $0 as NSNumber? } } + /// The total number of licenses the team has, for each day. + @objc + public var licenses: [NSNumber] { subSwift.licenses.compactMap { $0 as NSNumber? } } + + @objc + public init( + startDate: String, + teamSize: [NSNumber], + pendingInvites: [NSNumber], + membersJoined: [NSNumber], + suspendedMembers: [NSNumber], + licenses: [NSNumber] + ) { + let swift = Team.GetMembershipReport( + startDate: startDate, + teamSize: teamSize.map(\.uint64Value), + pendingInvites: pendingInvites.map(\.uint64Value), + membersJoined: membersJoined.map(\.uint64Value), + suspendedMembers: suspendedMembers.map(\.uint64Value), + licenses: licenses.map(\.uint64Value) + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GetMembershipReport + + public init(swift: Team.GetMembershipReport) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Storage Report Result. Each of the items in the storage report is an array of values, one value per day. If +/// there is no data for a day, then the value will be None. +@objc +public class DBXTeamGetStorageReport: DBXTeamBaseDfbReport { + /// Sum of the shared, unshared, and datastore usages, for each day. + @objc + public var totalUsage: [NSNumber] { subSwift.totalUsage.compactMap { $0 as NSNumber? } } + /// Array of the combined size (bytes) of team members' shared folders, for each day. + @objc + public var sharedUsage: [NSNumber] { subSwift.sharedUsage.compactMap { $0 as NSNumber? } } + /// Array of the combined size (bytes) of team members' root namespaces, for each day. + @objc + public var unsharedUsage: [NSNumber] { subSwift.unsharedUsage.compactMap { $0 as NSNumber? } } + /// Array of the number of shared folders owned by team members, for each day. + @objc + public var sharedFolders: [NSNumber] { subSwift.sharedFolders.compactMap { $0 as NSNumber? } } + /// Array of storage summaries of team members' account sizes. Each storage summary is an array of key, value + /// pairs, where each pair describes a storage bucket. The key indicates the upper bound of the bucket and + /// the value is the number of users in that bucket. There is one such summary per day. If there is no data + /// for a day, the storage summary will be empty. + @objc + public var memberStorageMap: [[DBXTeamStorageBucket]] { subSwift.memberStorageMap.map { $0.map { DBXTeamStorageBucket(swift: $0) } } } + + @objc + public init( + startDate: String, + totalUsage: [NSNumber], + sharedUsage: [NSNumber], + unsharedUsage: [NSNumber], + sharedFolders: [NSNumber], + memberStorageMap: [[DBXTeamStorageBucket]] + ) { + let swift = Team.GetStorageReport( + startDate: startDate, + totalUsage: totalUsage.map(\.uint64Value), + sharedUsage: sharedUsage.map(\.uint64Value), + unsharedUsage: unsharedUsage.map(\.uint64Value), + sharedFolders: sharedFolders.map(\.uint64Value), + memberStorageMap: memberStorageMap.map { $0.map(\.swift) } + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GetStorageReport + + public init(swift: Team.GetStorageReport) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Role of a user in group. +@objc +public class DBXTeamGroupAccessType: NSObject { + let swift: Team.GroupAccessType + + public init(swift: Team.GroupAccessType) { + self.swift = swift + } + + public static func factory(swift: Team.GroupAccessType) -> DBXTeamGroupAccessType { + switch swift { + case .member: + return DBXTeamGroupAccessTypeMember() + case .owner: + return DBXTeamGroupAccessTypeOwner() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMember: DBXTeamGroupAccessTypeMember? { + self as? DBXTeamGroupAccessTypeMember + } + + @objc + public var asOwner: DBXTeamGroupAccessTypeOwner? { + self as? DBXTeamGroupAccessTypeOwner + } +} + +/// User is a member of the group, but has no special permissions. +@objc +public class DBXTeamGroupAccessTypeMember: DBXTeamGroupAccessType { + @objc + public init() { + let swift = Team.GroupAccessType.member + super.init(swift: swift) + } +} + +/// User can rename the group, and add/remove members. +@objc +public class DBXTeamGroupAccessTypeOwner: DBXTeamGroupAccessType { + @objc + public init() { + let swift = Team.GroupAccessType.owner + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupCreateArg struct +@objc +public class DBXTeamGroupCreateArg: NSObject { + /// Group name. + @objc + public var groupName: String { swift.groupName } + /// Automatically add the creator of the group. + @objc + public var addCreatorAsOwner: NSNumber { swift.addCreatorAsOwner as NSNumber } + /// The creator of a team can associate an arbitrary external ID to the group. + @objc + public var groupExternalId: String? { swift.groupExternalId } + /// Whether the team can be managed by selected users, or only by team admins. + @objc + public var groupManagementType: DBXTeamCommonGroupManagementType? { guard let swift = swift.groupManagementType else { return nil } + return DBXTeamCommonGroupManagementType(swift: swift) + } + + @objc + public init(groupName: String, addCreatorAsOwner: NSNumber, groupExternalId: String?, groupManagementType: DBXTeamCommonGroupManagementType?) { + self.swift = Team.GroupCreateArg( + groupName: groupName, + addCreatorAsOwner: addCreatorAsOwner.boolValue, + groupExternalId: groupExternalId, + groupManagementType: groupManagementType?.swift + ) + } + + let swift: Team.GroupCreateArg + + public init(swift: Team.GroupCreateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupCreateError union +@objc +public class DBXTeamGroupCreateError: NSObject { + let swift: Team.GroupCreateError + + public init(swift: Team.GroupCreateError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupCreateError) -> DBXTeamGroupCreateError { + switch swift { + case .groupNameAlreadyUsed: + return DBXTeamGroupCreateErrorGroupNameAlreadyUsed() + case .groupNameInvalid: + return DBXTeamGroupCreateErrorGroupNameInvalid() + case .externalIdAlreadyInUse: + return DBXTeamGroupCreateErrorExternalIdAlreadyInUse() + case .systemManagedGroupDisallowed: + return DBXTeamGroupCreateErrorSystemManagedGroupDisallowed() + case .other: + return DBXTeamGroupCreateErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNameAlreadyUsed: DBXTeamGroupCreateErrorGroupNameAlreadyUsed? { + self as? DBXTeamGroupCreateErrorGroupNameAlreadyUsed + } + + @objc + public var asGroupNameInvalid: DBXTeamGroupCreateErrorGroupNameInvalid? { + self as? DBXTeamGroupCreateErrorGroupNameInvalid + } + + @objc + public var asExternalIdAlreadyInUse: DBXTeamGroupCreateErrorExternalIdAlreadyInUse? { + self as? DBXTeamGroupCreateErrorExternalIdAlreadyInUse + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupCreateErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupCreateErrorSystemManagedGroupDisallowed + } + + @objc + public var asOther: DBXTeamGroupCreateErrorOther? { + self as? DBXTeamGroupCreateErrorOther + } +} + +/// The requested group name is already being used by another group. +@objc +public class DBXTeamGroupCreateErrorGroupNameAlreadyUsed: DBXTeamGroupCreateError { + @objc + public init() { + let swift = Team.GroupCreateError.groupNameAlreadyUsed + super.init(swift: swift) + } +} + +/// Group name is empty or has invalid characters. +@objc +public class DBXTeamGroupCreateErrorGroupNameInvalid: DBXTeamGroupCreateError { + @objc + public init() { + let swift = Team.GroupCreateError.groupNameInvalid + super.init(swift: swift) + } +} + +/// The requested external ID is already being used by another group. +@objc +public class DBXTeamGroupCreateErrorExternalIdAlreadyInUse: DBXTeamGroupCreateError { + @objc + public init() { + let swift = Team.GroupCreateError.externalIdAlreadyInUse + super.init(swift: swift) + } +} + +/// System-managed group cannot be manually created. +@objc +public class DBXTeamGroupCreateErrorSystemManagedGroupDisallowed: DBXTeamGroupCreateError { + @objc + public init() { + let swift = Team.GroupCreateError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupCreateErrorOther: DBXTeamGroupCreateError { + @objc + public init() { + let swift = Team.GroupCreateError.other + super.init(swift: swift) + } +} + +/// Error that can be raised when GroupSelector is used. +@objc +public class DBXTeamGroupSelectorError: NSObject { + let swift: Team.GroupSelectorError + + public init(swift: Team.GroupSelectorError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupSelectorError) -> DBXTeamGroupSelectorError { + switch swift { + case .groupNotFound: + return DBXTeamGroupSelectorErrorGroupNotFound() + case .other: + return DBXTeamGroupSelectorErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupSelectorErrorGroupNotFound? { + self as? DBXTeamGroupSelectorErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupSelectorErrorOther? { + self as? DBXTeamGroupSelectorErrorOther + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupSelectorErrorGroupNotFound: DBXTeamGroupSelectorError { + @objc + public init() { + let swift = Team.GroupSelectorError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupSelectorErrorOther: DBXTeamGroupSelectorError { + @objc + public init() { + let swift = Team.GroupSelectorError.other + super.init(swift: swift) + } +} + +/// Error that can be raised when GroupSelector is used and team groups are disallowed from being used. +@objc +public class DBXTeamGroupSelectorWithTeamGroupError: NSObject { + let swift: Team.GroupSelectorWithTeamGroupError + + public init(swift: Team.GroupSelectorWithTeamGroupError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupSelectorWithTeamGroupError) -> DBXTeamGroupSelectorWithTeamGroupError { + switch swift { + case .groupNotFound: + return DBXTeamGroupSelectorWithTeamGroupErrorGroupNotFound() + case .other: + return DBXTeamGroupSelectorWithTeamGroupErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupSelectorWithTeamGroupErrorSystemManagedGroupDisallowed() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupSelectorWithTeamGroupErrorGroupNotFound? { + self as? DBXTeamGroupSelectorWithTeamGroupErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupSelectorWithTeamGroupErrorOther? { + self as? DBXTeamGroupSelectorWithTeamGroupErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupSelectorWithTeamGroupErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupSelectorWithTeamGroupErrorSystemManagedGroupDisallowed + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupSelectorWithTeamGroupErrorGroupNotFound: DBXTeamGroupSelectorWithTeamGroupError { + @objc + public init() { + let swift = Team.GroupSelectorWithTeamGroupError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupSelectorWithTeamGroupErrorOther: DBXTeamGroupSelectorWithTeamGroupError { + @objc + public init() { + let swift = Team.GroupSelectorWithTeamGroupError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupSelectorWithTeamGroupErrorSystemManagedGroupDisallowed: DBXTeamGroupSelectorWithTeamGroupError { + @objc + public init() { + let swift = Team.GroupSelectorWithTeamGroupError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupDeleteError union +@objc +public class DBXTeamGroupDeleteError: NSObject { + let swift: Team.GroupDeleteError + + public init(swift: Team.GroupDeleteError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupDeleteError) -> DBXTeamGroupDeleteError { + switch swift { + case .groupNotFound: + return DBXTeamGroupDeleteErrorGroupNotFound() + case .other: + return DBXTeamGroupDeleteErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupDeleteErrorSystemManagedGroupDisallowed() + case .groupAlreadyDeleted: + return DBXTeamGroupDeleteErrorGroupAlreadyDeleted() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupDeleteErrorGroupNotFound? { + self as? DBXTeamGroupDeleteErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupDeleteErrorOther? { + self as? DBXTeamGroupDeleteErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupDeleteErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupDeleteErrorSystemManagedGroupDisallowed + } + + @objc + public var asGroupAlreadyDeleted: DBXTeamGroupDeleteErrorGroupAlreadyDeleted? { + self as? DBXTeamGroupDeleteErrorGroupAlreadyDeleted + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupDeleteErrorGroupNotFound: DBXTeamGroupDeleteError { + @objc + public init() { + let swift = Team.GroupDeleteError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupDeleteErrorOther: DBXTeamGroupDeleteError { + @objc + public init() { + let swift = Team.GroupDeleteError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupDeleteErrorSystemManagedGroupDisallowed: DBXTeamGroupDeleteError { + @objc + public init() { + let swift = Team.GroupDeleteError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// This group has already been deleted. +@objc +public class DBXTeamGroupDeleteErrorGroupAlreadyDeleted: DBXTeamGroupDeleteError { + @objc + public init() { + let swift = Team.GroupDeleteError.groupAlreadyDeleted + super.init(swift: swift) + } +} + +/// Full description of a group. +@objc +public class DBXTeamGroupFullInfo: DBXTeamCommonGroupSummary { + /// List of group members. + @objc + public var members: [DBXTeamGroupMemberInfo]? { subSwift.members?.map { DBXTeamGroupMemberInfo(swift: $0) } } + /// The group creation time as a UTC timestamp in milliseconds since the Unix epoch. + @objc + public var created: NSNumber { subSwift.created as NSNumber } + + @objc + public init( + groupName: String, + groupId: String, + groupManagementType: DBXTeamCommonGroupManagementType, + created: NSNumber, + groupExternalId: String?, + memberCount: NSNumber?, + members: [DBXTeamGroupMemberInfo]? + ) { + let swift = Team.GroupFullInfo( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType.swift, + created: created.uint64Value, + groupExternalId: groupExternalId, + memberCount: memberCount?.uint32Value, + members: members?.map(\.swift) + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GroupFullInfo + + public init(swift: Team.GroupFullInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Profile of group member, and role in group. +@objc +public class DBXTeamGroupMemberInfo: NSObject { + /// Profile of group member. + @objc + public var profile: DBXTeamMemberProfile { DBXTeamMemberProfile(swift: swift.profile) } + /// The role that the user has in the group. + @objc + public var accessType: DBXTeamGroupAccessType { DBXTeamGroupAccessType(swift: swift.accessType) } + + @objc + public init(profile: DBXTeamMemberProfile, accessType: DBXTeamGroupAccessType) { + self.swift = Team.GroupMemberInfo(profile: profile.swift, accessType: accessType.swift) + } + + let swift: Team.GroupMemberInfo + + public init(swift: Team.GroupMemberInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Argument for selecting a group and a single user. +@objc +public class DBXTeamGroupMemberSelector: NSObject { + /// Specify a group. + @objc + public var group: DBXTeamGroupSelector { DBXTeamGroupSelector(swift: swift.group) } + /// Identity of a user that is a member of group. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + + @objc + public init(group: DBXTeamGroupSelector, user: DBXTeamUserSelectorArg) { + self.swift = Team.GroupMemberSelector(group: group.swift, user: user.swift) + } + + let swift: Team.GroupMemberSelector + + public init(swift: Team.GroupMemberSelector) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error that can be raised when GroupMemberSelector is used, and the user is required to be a member of the +/// specified group. +@objc +public class DBXTeamGroupMemberSelectorError: NSObject { + let swift: Team.GroupMemberSelectorError + + public init(swift: Team.GroupMemberSelectorError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupMemberSelectorError) -> DBXTeamGroupMemberSelectorError { + switch swift { + case .groupNotFound: + return DBXTeamGroupMemberSelectorErrorGroupNotFound() + case .other: + return DBXTeamGroupMemberSelectorErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupMemberSelectorErrorSystemManagedGroupDisallowed() + case .memberNotInGroup: + return DBXTeamGroupMemberSelectorErrorMemberNotInGroup() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupMemberSelectorErrorGroupNotFound? { + self as? DBXTeamGroupMemberSelectorErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupMemberSelectorErrorOther? { + self as? DBXTeamGroupMemberSelectorErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupMemberSelectorErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupMemberSelectorErrorSystemManagedGroupDisallowed + } + + @objc + public var asMemberNotInGroup: DBXTeamGroupMemberSelectorErrorMemberNotInGroup? { + self as? DBXTeamGroupMemberSelectorErrorMemberNotInGroup + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupMemberSelectorErrorGroupNotFound: DBXTeamGroupMemberSelectorError { + @objc + public init() { + let swift = Team.GroupMemberSelectorError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupMemberSelectorErrorOther: DBXTeamGroupMemberSelectorError { + @objc + public init() { + let swift = Team.GroupMemberSelectorError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupMemberSelectorErrorSystemManagedGroupDisallowed: DBXTeamGroupMemberSelectorError { + @objc + public init() { + let swift = Team.GroupMemberSelectorError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// The specified user is not a member of this group. +@objc +public class DBXTeamGroupMemberSelectorErrorMemberNotInGroup: DBXTeamGroupMemberSelectorError { + @objc + public init() { + let swift = Team.GroupMemberSelectorError.memberNotInGroup + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupMemberSetAccessTypeError union +@objc +public class DBXTeamGroupMemberSetAccessTypeError: NSObject { + let swift: Team.GroupMemberSetAccessTypeError + + public init(swift: Team.GroupMemberSetAccessTypeError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupMemberSetAccessTypeError) -> DBXTeamGroupMemberSetAccessTypeError { + switch swift { + case .groupNotFound: + return DBXTeamGroupMemberSetAccessTypeErrorGroupNotFound() + case .other: + return DBXTeamGroupMemberSetAccessTypeErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupMemberSetAccessTypeErrorSystemManagedGroupDisallowed() + case .memberNotInGroup: + return DBXTeamGroupMemberSetAccessTypeErrorMemberNotInGroup() + case .userCannotBeManagerOfCompanyManagedGroup: + return DBXTeamGroupMemberSetAccessTypeErrorUserCannotBeManagerOfCompanyManagedGroup() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupMemberSetAccessTypeErrorGroupNotFound? { + self as? DBXTeamGroupMemberSetAccessTypeErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupMemberSetAccessTypeErrorOther? { + self as? DBXTeamGroupMemberSetAccessTypeErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupMemberSetAccessTypeErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupMemberSetAccessTypeErrorSystemManagedGroupDisallowed + } + + @objc + public var asMemberNotInGroup: DBXTeamGroupMemberSetAccessTypeErrorMemberNotInGroup? { + self as? DBXTeamGroupMemberSetAccessTypeErrorMemberNotInGroup + } + + @objc + public var asUserCannotBeManagerOfCompanyManagedGroup: DBXTeamGroupMemberSetAccessTypeErrorUserCannotBeManagerOfCompanyManagedGroup? { + self as? DBXTeamGroupMemberSetAccessTypeErrorUserCannotBeManagerOfCompanyManagedGroup + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupMemberSetAccessTypeErrorGroupNotFound: DBXTeamGroupMemberSetAccessTypeError { + @objc + public init() { + let swift = Team.GroupMemberSetAccessTypeError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupMemberSetAccessTypeErrorOther: DBXTeamGroupMemberSetAccessTypeError { + @objc + public init() { + let swift = Team.GroupMemberSetAccessTypeError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupMemberSetAccessTypeErrorSystemManagedGroupDisallowed: DBXTeamGroupMemberSetAccessTypeError { + @objc + public init() { + let swift = Team.GroupMemberSetAccessTypeError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// The specified user is not a member of this group. +@objc +public class DBXTeamGroupMemberSetAccessTypeErrorMemberNotInGroup: DBXTeamGroupMemberSetAccessTypeError { + @objc + public init() { + let swift = Team.GroupMemberSetAccessTypeError.memberNotInGroup + super.init(swift: swift) + } +} + +/// A company managed group cannot be managed by a user. +@objc +public class DBXTeamGroupMemberSetAccessTypeErrorUserCannotBeManagerOfCompanyManagedGroup: DBXTeamGroupMemberSetAccessTypeError { + @objc + public init() { + let swift = Team.GroupMemberSetAccessTypeError.userCannotBeManagerOfCompanyManagedGroup + super.init(swift: swift) + } +} + +/// Objective-C compatible IncludeMembersArg struct +@objc +public class DBXTeamIncludeMembersArg: NSObject { + /// Whether to return the list of members in the group. Note that the default value will cause all the group + /// members to be returned in the response. This may take a long time for large groups. + @objc + public var returnMembers: NSNumber { swift.returnMembers as NSNumber } + + @objc + public init(returnMembers: NSNumber) { + self.swift = Team.IncludeMembersArg(returnMembers: returnMembers.boolValue) + } + + let swift: Team.IncludeMembersArg + + public init(swift: Team.IncludeMembersArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupMembersAddArg struct +@objc +public class DBXTeamGroupMembersAddArg: DBXTeamIncludeMembersArg { + /// Group to which users will be added. + @objc + public var group: DBXTeamGroupSelector { DBXTeamGroupSelector(swift: subSwift.group) } + /// List of users to be added to the group. + @objc + public var members: [DBXTeamMemberAccess] { subSwift.members.map { DBXTeamMemberAccess(swift: $0) } } + + @objc + public init(group: DBXTeamGroupSelector, members: [DBXTeamMemberAccess], returnMembers: NSNumber) { + let swift = Team.GroupMembersAddArg(group: group.swift, members: members.map(\.swift), returnMembers: returnMembers.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GroupMembersAddArg + + public init(swift: Team.GroupMembersAddArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible GroupMembersAddError union +@objc +public class DBXTeamGroupMembersAddError: NSObject { + let swift: Team.GroupMembersAddError + + public init(swift: Team.GroupMembersAddError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupMembersAddError) -> DBXTeamGroupMembersAddError { + switch swift { + case .groupNotFound: + return DBXTeamGroupMembersAddErrorGroupNotFound() + case .other: + return DBXTeamGroupMembersAddErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupMembersAddErrorSystemManagedGroupDisallowed() + case .duplicateUser: + return DBXTeamGroupMembersAddErrorDuplicateUser() + case .groupNotInTeam: + return DBXTeamGroupMembersAddErrorGroupNotInTeam() + case .membersNotInTeam(let swiftArg): + let arg = swiftArg + return DBXTeamGroupMembersAddErrorMembersNotInTeam(arg) + case .usersNotFound(let swiftArg): + let arg = swiftArg + return DBXTeamGroupMembersAddErrorUsersNotFound(arg) + case .userMustBeActiveToBeOwner: + return DBXTeamGroupMembersAddErrorUserMustBeActiveToBeOwner() + case .userCannotBeManagerOfCompanyManagedGroup(let swiftArg): + let arg = swiftArg + return DBXTeamGroupMembersAddErrorUserCannotBeManagerOfCompanyManagedGroup(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupMembersAddErrorGroupNotFound? { + self as? DBXTeamGroupMembersAddErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupMembersAddErrorOther? { + self as? DBXTeamGroupMembersAddErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupMembersAddErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupMembersAddErrorSystemManagedGroupDisallowed + } + + @objc + public var asDuplicateUser: DBXTeamGroupMembersAddErrorDuplicateUser? { + self as? DBXTeamGroupMembersAddErrorDuplicateUser + } + + @objc + public var asGroupNotInTeam: DBXTeamGroupMembersAddErrorGroupNotInTeam? { + self as? DBXTeamGroupMembersAddErrorGroupNotInTeam + } + + @objc + public var asMembersNotInTeam: DBXTeamGroupMembersAddErrorMembersNotInTeam? { + self as? DBXTeamGroupMembersAddErrorMembersNotInTeam + } + + @objc + public var asUsersNotFound: DBXTeamGroupMembersAddErrorUsersNotFound? { + self as? DBXTeamGroupMembersAddErrorUsersNotFound + } + + @objc + public var asUserMustBeActiveToBeOwner: DBXTeamGroupMembersAddErrorUserMustBeActiveToBeOwner? { + self as? DBXTeamGroupMembersAddErrorUserMustBeActiveToBeOwner + } + + @objc + public var asUserCannotBeManagerOfCompanyManagedGroup: DBXTeamGroupMembersAddErrorUserCannotBeManagerOfCompanyManagedGroup? { + self as? DBXTeamGroupMembersAddErrorUserCannotBeManagerOfCompanyManagedGroup + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupMembersAddErrorGroupNotFound: DBXTeamGroupMembersAddError { + @objc + public init() { + let swift = Team.GroupMembersAddError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupMembersAddErrorOther: DBXTeamGroupMembersAddError { + @objc + public init() { + let swift = Team.GroupMembersAddError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupMembersAddErrorSystemManagedGroupDisallowed: DBXTeamGroupMembersAddError { + @objc + public init() { + let swift = Team.GroupMembersAddError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// You cannot add duplicate users. One or more of the members you are trying to add is already a member of the +/// group. +@objc +public class DBXTeamGroupMembersAddErrorDuplicateUser: DBXTeamGroupMembersAddError { + @objc + public init() { + let swift = Team.GroupMembersAddError.duplicateUser + super.init(swift: swift) + } +} + +/// Group is not in this team. You cannot add members to a group that is outside of your team. +@objc +public class DBXTeamGroupMembersAddErrorGroupNotInTeam: DBXTeamGroupMembersAddError { + @objc + public init() { + let swift = Team.GroupMembersAddError.groupNotInTeam + super.init(swift: swift) + } +} + +/// These members are not part of your team. Currently, you cannot add members to a group if they are not part +/// of your team, though this may change in a subsequent version. To add new members to your Dropbox +/// Business team, use the membersAdd endpoint. +@objc +public class DBXTeamGroupMembersAddErrorMembersNotInTeam: DBXTeamGroupMembersAddError { + @objc + public var membersNotInTeam: [String] + + @objc + public init(_ arg: [String]) { + self.membersNotInTeam = arg + let swift = Team.GroupMembersAddError.membersNotInTeam(arg) + super.init(swift: swift) + } +} + +/// These users were not found in Dropbox. +@objc +public class DBXTeamGroupMembersAddErrorUsersNotFound: DBXTeamGroupMembersAddError { + @objc + public var usersNotFound: [String] + + @objc + public init(_ arg: [String]) { + self.usersNotFound = arg + let swift = Team.GroupMembersAddError.usersNotFound(arg) + super.init(swift: swift) + } +} + +/// A suspended user cannot be added to a group as owner in GroupAccessType. +@objc +public class DBXTeamGroupMembersAddErrorUserMustBeActiveToBeOwner: DBXTeamGroupMembersAddError { + @objc + public init() { + let swift = Team.GroupMembersAddError.userMustBeActiveToBeOwner + super.init(swift: swift) + } +} + +/// A company-managed group cannot be managed by a user. +@objc +public class DBXTeamGroupMembersAddErrorUserCannotBeManagerOfCompanyManagedGroup: DBXTeamGroupMembersAddError { + @objc + public var userCannotBeManagerOfCompanyManagedGroup: [String] + + @objc + public init(_ arg: [String]) { + self.userCannotBeManagerOfCompanyManagedGroup = arg + let swift = Team.GroupMembersAddError.userCannotBeManagerOfCompanyManagedGroup(arg) + super.init(swift: swift) + } +} + +/// Result returned by groupsMembersAdd and groupsMembersRemove. +@objc +public class DBXTeamGroupMembersChangeResult: NSObject { + /// The group info after member change operation has been performed. + @objc + public var groupInfo: DBXTeamGroupFullInfo { DBXTeamGroupFullInfo(swift: swift.groupInfo) } + /// For legacy purposes async_job_id will always return one space ' '. Formerly, it was an ID that was used to + /// obtain the status of granting/revoking group-owned resources. It's no longer necessary because the async + /// processing now happens automatically. + @objc + public var asyncJobId: String { swift.asyncJobId } + + @objc + public init(groupInfo: DBXTeamGroupFullInfo, asyncJobId: String) { + self.swift = Team.GroupMembersChangeResult(groupInfo: groupInfo.subSwift, asyncJobId: asyncJobId) + } + + let swift: Team.GroupMembersChangeResult + + public init(swift: Team.GroupMembersChangeResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupMembersRemoveArg struct +@objc +public class DBXTeamGroupMembersRemoveArg: DBXTeamIncludeMembersArg { + /// Group from which users will be removed. + @objc + public var group: DBXTeamGroupSelector { DBXTeamGroupSelector(swift: subSwift.group) } + /// List of users to be removed from the group. + @objc + public var users: [DBXTeamUserSelectorArg] { subSwift.users.map { DBXTeamUserSelectorArg(swift: $0) } } + + @objc + public init(group: DBXTeamGroupSelector, users: [DBXTeamUserSelectorArg], returnMembers: NSNumber) { + let swift = Team.GroupMembersRemoveArg(group: group.swift, users: users.map(\.swift), returnMembers: returnMembers.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GroupMembersRemoveArg + + public init(swift: Team.GroupMembersRemoveArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Error that can be raised when GroupMembersSelector is used, and the users are required to be members of the +/// specified group. +@objc +public class DBXTeamGroupMembersSelectorError: NSObject { + let swift: Team.GroupMembersSelectorError + + public init(swift: Team.GroupMembersSelectorError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupMembersSelectorError) -> DBXTeamGroupMembersSelectorError { + switch swift { + case .groupNotFound: + return DBXTeamGroupMembersSelectorErrorGroupNotFound() + case .other: + return DBXTeamGroupMembersSelectorErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupMembersSelectorErrorSystemManagedGroupDisallowed() + case .memberNotInGroup: + return DBXTeamGroupMembersSelectorErrorMemberNotInGroup() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupMembersSelectorErrorGroupNotFound? { + self as? DBXTeamGroupMembersSelectorErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupMembersSelectorErrorOther? { + self as? DBXTeamGroupMembersSelectorErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupMembersSelectorErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupMembersSelectorErrorSystemManagedGroupDisallowed + } + + @objc + public var asMemberNotInGroup: DBXTeamGroupMembersSelectorErrorMemberNotInGroup? { + self as? DBXTeamGroupMembersSelectorErrorMemberNotInGroup + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupMembersSelectorErrorGroupNotFound: DBXTeamGroupMembersSelectorError { + @objc + public init() { + let swift = Team.GroupMembersSelectorError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupMembersSelectorErrorOther: DBXTeamGroupMembersSelectorError { + @objc + public init() { + let swift = Team.GroupMembersSelectorError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupMembersSelectorErrorSystemManagedGroupDisallowed: DBXTeamGroupMembersSelectorError { + @objc + public init() { + let swift = Team.GroupMembersSelectorError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// At least one of the specified users is not a member of the group. +@objc +public class DBXTeamGroupMembersSelectorErrorMemberNotInGroup: DBXTeamGroupMembersSelectorError { + @objc + public init() { + let swift = Team.GroupMembersSelectorError.memberNotInGroup + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupMembersRemoveError union +@objc +public class DBXTeamGroupMembersRemoveError: NSObject { + let swift: Team.GroupMembersRemoveError + + public init(swift: Team.GroupMembersRemoveError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupMembersRemoveError) -> DBXTeamGroupMembersRemoveError { + switch swift { + case .groupNotFound: + return DBXTeamGroupMembersRemoveErrorGroupNotFound() + case .other: + return DBXTeamGroupMembersRemoveErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupMembersRemoveErrorSystemManagedGroupDisallowed() + case .memberNotInGroup: + return DBXTeamGroupMembersRemoveErrorMemberNotInGroup() + case .groupNotInTeam: + return DBXTeamGroupMembersRemoveErrorGroupNotInTeam() + case .membersNotInTeam(let swiftArg): + let arg = swiftArg + return DBXTeamGroupMembersRemoveErrorMembersNotInTeam(arg) + case .usersNotFound(let swiftArg): + let arg = swiftArg + return DBXTeamGroupMembersRemoveErrorUsersNotFound(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupMembersRemoveErrorGroupNotFound? { + self as? DBXTeamGroupMembersRemoveErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupMembersRemoveErrorOther? { + self as? DBXTeamGroupMembersRemoveErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupMembersRemoveErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupMembersRemoveErrorSystemManagedGroupDisallowed + } + + @objc + public var asMemberNotInGroup: DBXTeamGroupMembersRemoveErrorMemberNotInGroup? { + self as? DBXTeamGroupMembersRemoveErrorMemberNotInGroup + } + + @objc + public var asGroupNotInTeam: DBXTeamGroupMembersRemoveErrorGroupNotInTeam? { + self as? DBXTeamGroupMembersRemoveErrorGroupNotInTeam + } + + @objc + public var asMembersNotInTeam: DBXTeamGroupMembersRemoveErrorMembersNotInTeam? { + self as? DBXTeamGroupMembersRemoveErrorMembersNotInTeam + } + + @objc + public var asUsersNotFound: DBXTeamGroupMembersRemoveErrorUsersNotFound? { + self as? DBXTeamGroupMembersRemoveErrorUsersNotFound + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupMembersRemoveErrorGroupNotFound: DBXTeamGroupMembersRemoveError { + @objc + public init() { + let swift = Team.GroupMembersRemoveError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupMembersRemoveErrorOther: DBXTeamGroupMembersRemoveError { + @objc + public init() { + let swift = Team.GroupMembersRemoveError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupMembersRemoveErrorSystemManagedGroupDisallowed: DBXTeamGroupMembersRemoveError { + @objc + public init() { + let swift = Team.GroupMembersRemoveError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// At least one of the specified users is not a member of the group. +@objc +public class DBXTeamGroupMembersRemoveErrorMemberNotInGroup: DBXTeamGroupMembersRemoveError { + @objc + public init() { + let swift = Team.GroupMembersRemoveError.memberNotInGroup + super.init(swift: swift) + } +} + +/// Group is not in this team. You cannot remove members from a group that is outside of your team. +@objc +public class DBXTeamGroupMembersRemoveErrorGroupNotInTeam: DBXTeamGroupMembersRemoveError { + @objc + public init() { + let swift = Team.GroupMembersRemoveError.groupNotInTeam + super.init(swift: swift) + } +} + +/// These members are not part of your team. +@objc +public class DBXTeamGroupMembersRemoveErrorMembersNotInTeam: DBXTeamGroupMembersRemoveError { + @objc + public var membersNotInTeam: [String] + + @objc + public init(_ arg: [String]) { + self.membersNotInTeam = arg + let swift = Team.GroupMembersRemoveError.membersNotInTeam(arg) + super.init(swift: swift) + } +} + +/// These users were not found in Dropbox. +@objc +public class DBXTeamGroupMembersRemoveErrorUsersNotFound: DBXTeamGroupMembersRemoveError { + @objc + public var usersNotFound: [String] + + @objc + public init(_ arg: [String]) { + self.usersNotFound = arg + let swift = Team.GroupMembersRemoveError.usersNotFound(arg) + super.init(swift: swift) + } +} + +/// Argument for selecting a group and a list of users. +@objc +public class DBXTeamGroupMembersSelector: NSObject { + /// Specify a group. + @objc + public var group: DBXTeamGroupSelector { DBXTeamGroupSelector(swift: swift.group) } + /// A list of users that are members of group. + @objc + public var users: DBXTeamUsersSelectorArg { DBXTeamUsersSelectorArg(swift: swift.users) } + + @objc + public init(group: DBXTeamGroupSelector, users: DBXTeamUsersSelectorArg) { + self.swift = Team.GroupMembersSelector(group: group.swift, users: users.swift) + } + + let swift: Team.GroupMembersSelector + + public init(swift: Team.GroupMembersSelector) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupMembersSetAccessTypeArg struct +@objc +public class DBXTeamGroupMembersSetAccessTypeArg: DBXTeamGroupMemberSelector { + /// New group access type the user will have. + @objc + public var accessType: DBXTeamGroupAccessType { DBXTeamGroupAccessType(swift: subSwift.accessType) } + /// Whether to return the list of members in the group. Note that the default value will cause all the group + /// members to be returned in the response. This may take a long time for large groups. + @objc + public var returnMembers: NSNumber { subSwift.returnMembers as NSNumber } + + @objc + public init(group: DBXTeamGroupSelector, user: DBXTeamUserSelectorArg, accessType: DBXTeamGroupAccessType, returnMembers: NSNumber) { + let swift = Team.GroupMembersSetAccessTypeArg( + group: group.swift, + user: user.swift, + accessType: accessType.swift, + returnMembers: returnMembers.boolValue + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GroupMembersSetAccessTypeArg + + public init(swift: Team.GroupMembersSetAccessTypeArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Argument for selecting a single group, either by group_id or by external group ID. +@objc +public class DBXTeamGroupSelector: NSObject { + let swift: Team.GroupSelector + + public init(swift: Team.GroupSelector) { + self.swift = swift + } + + public static func factory(swift: Team.GroupSelector) -> DBXTeamGroupSelector { + switch swift { + case .groupId(let swiftArg): + let arg = swiftArg + return DBXTeamGroupSelectorGroupId(arg) + case .groupExternalId(let swiftArg): + let arg = swiftArg + return DBXTeamGroupSelectorGroupExternalId(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupId: DBXTeamGroupSelectorGroupId? { + self as? DBXTeamGroupSelectorGroupId + } + + @objc + public var asGroupExternalId: DBXTeamGroupSelectorGroupExternalId? { + self as? DBXTeamGroupSelectorGroupExternalId + } +} + +/// Group ID. +@objc +public class DBXTeamGroupSelectorGroupId: DBXTeamGroupSelector { + @objc + public var groupId: String + + @objc + public init(_ arg: String) { + self.groupId = arg + let swift = Team.GroupSelector.groupId(arg) + super.init(swift: swift) + } +} + +/// External ID of the group. +@objc +public class DBXTeamGroupSelectorGroupExternalId: DBXTeamGroupSelector { + @objc + public var groupExternalId: String + + @objc + public init(_ arg: String) { + self.groupExternalId = arg + let swift = Team.GroupSelector.groupExternalId(arg) + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupUpdateArgs struct +@objc +public class DBXTeamGroupUpdateArgs: DBXTeamIncludeMembersArg { + /// Specify a group. + @objc + public var group: DBXTeamGroupSelector { DBXTeamGroupSelector(swift: subSwift.group) } + /// Optional argument. Set group name to this if provided. + @objc + public var newGroupName: String? { subSwift.newGroupName } + /// Optional argument. New group external ID. If the argument is None, the group's external_id won't be updated. + /// If the argument is empty string, the group's external id will be cleared. + @objc + public var newGroupExternalId: String? { subSwift.newGroupExternalId } + /// Set new group management type, if provided. + @objc + public var newGroupManagementType: DBXTeamCommonGroupManagementType? { guard let swift = subSwift.newGroupManagementType else { return nil } + return DBXTeamCommonGroupManagementType(swift: swift) + } + + @objc + public init( + group: DBXTeamGroupSelector, + returnMembers: NSNumber, + newGroupName: String?, + newGroupExternalId: String?, + newGroupManagementType: DBXTeamCommonGroupManagementType? + ) { + let swift = Team.GroupUpdateArgs( + group: group.swift, + returnMembers: returnMembers.boolValue, + newGroupName: newGroupName, + newGroupExternalId: newGroupExternalId, + newGroupManagementType: newGroupManagementType?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.GroupUpdateArgs + + public init(swift: Team.GroupUpdateArgs) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible GroupUpdateError union +@objc +public class DBXTeamGroupUpdateError: NSObject { + let swift: Team.GroupUpdateError + + public init(swift: Team.GroupUpdateError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupUpdateError) -> DBXTeamGroupUpdateError { + switch swift { + case .groupNotFound: + return DBXTeamGroupUpdateErrorGroupNotFound() + case .other: + return DBXTeamGroupUpdateErrorOther() + case .systemManagedGroupDisallowed: + return DBXTeamGroupUpdateErrorSystemManagedGroupDisallowed() + case .groupNameAlreadyUsed: + return DBXTeamGroupUpdateErrorGroupNameAlreadyUsed() + case .groupNameInvalid: + return DBXTeamGroupUpdateErrorGroupNameInvalid() + case .externalIdAlreadyInUse: + return DBXTeamGroupUpdateErrorExternalIdAlreadyInUse() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotFound: DBXTeamGroupUpdateErrorGroupNotFound? { + self as? DBXTeamGroupUpdateErrorGroupNotFound + } + + @objc + public var asOther: DBXTeamGroupUpdateErrorOther? { + self as? DBXTeamGroupUpdateErrorOther + } + + @objc + public var asSystemManagedGroupDisallowed: DBXTeamGroupUpdateErrorSystemManagedGroupDisallowed? { + self as? DBXTeamGroupUpdateErrorSystemManagedGroupDisallowed + } + + @objc + public var asGroupNameAlreadyUsed: DBXTeamGroupUpdateErrorGroupNameAlreadyUsed? { + self as? DBXTeamGroupUpdateErrorGroupNameAlreadyUsed + } + + @objc + public var asGroupNameInvalid: DBXTeamGroupUpdateErrorGroupNameInvalid? { + self as? DBXTeamGroupUpdateErrorGroupNameInvalid + } + + @objc + public var asExternalIdAlreadyInUse: DBXTeamGroupUpdateErrorExternalIdAlreadyInUse? { + self as? DBXTeamGroupUpdateErrorExternalIdAlreadyInUse + } +} + +/// No matching group found. No groups match the specified group ID. +@objc +public class DBXTeamGroupUpdateErrorGroupNotFound: DBXTeamGroupUpdateError { + @objc + public init() { + let swift = Team.GroupUpdateError.groupNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupUpdateErrorOther: DBXTeamGroupUpdateError { + @objc + public init() { + let swift = Team.GroupUpdateError.other + super.init(swift: swift) + } +} + +/// This operation is not supported on system-managed groups. +@objc +public class DBXTeamGroupUpdateErrorSystemManagedGroupDisallowed: DBXTeamGroupUpdateError { + @objc + public init() { + let swift = Team.GroupUpdateError.systemManagedGroupDisallowed + super.init(swift: swift) + } +} + +/// The requested group name is already being used by another group. +@objc +public class DBXTeamGroupUpdateErrorGroupNameAlreadyUsed: DBXTeamGroupUpdateError { + @objc + public init() { + let swift = Team.GroupUpdateError.groupNameAlreadyUsed + super.init(swift: swift) + } +} + +/// Group name is empty or has invalid characters. +@objc +public class DBXTeamGroupUpdateErrorGroupNameInvalid: DBXTeamGroupUpdateError { + @objc + public init() { + let swift = Team.GroupUpdateError.groupNameInvalid + super.init(swift: swift) + } +} + +/// The requested external ID is already being used by another group. +@objc +public class DBXTeamGroupUpdateErrorExternalIdAlreadyInUse: DBXTeamGroupUpdateError { + @objc + public init() { + let swift = Team.GroupUpdateError.externalIdAlreadyInUse + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupsGetInfoError union +@objc +public class DBXTeamGroupsGetInfoError: NSObject { + let swift: Team.GroupsGetInfoError + + public init(swift: Team.GroupsGetInfoError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupsGetInfoError) -> DBXTeamGroupsGetInfoError { + switch swift { + case .groupNotOnTeam: + return DBXTeamGroupsGetInfoErrorGroupNotOnTeam() + case .other: + return DBXTeamGroupsGetInfoErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupNotOnTeam: DBXTeamGroupsGetInfoErrorGroupNotOnTeam? { + self as? DBXTeamGroupsGetInfoErrorGroupNotOnTeam + } + + @objc + public var asOther: DBXTeamGroupsGetInfoErrorOther? { + self as? DBXTeamGroupsGetInfoErrorOther + } +} + +/// The group is not on your team. +@objc +public class DBXTeamGroupsGetInfoErrorGroupNotOnTeam: DBXTeamGroupsGetInfoError { + @objc + public init() { + let swift = Team.GroupsGetInfoError.groupNotOnTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupsGetInfoErrorOther: DBXTeamGroupsGetInfoError { + @objc + public init() { + let swift = Team.GroupsGetInfoError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupsGetInfoItem union +@objc +public class DBXTeamGroupsGetInfoItem: NSObject { + let swift: Team.GroupsGetInfoItem + + public init(swift: Team.GroupsGetInfoItem) { + self.swift = swift + } + + public static func factory(swift: Team.GroupsGetInfoItem) -> DBXTeamGroupsGetInfoItem { + switch swift { + case .idNotFound(let swiftArg): + let arg = swiftArg + return DBXTeamGroupsGetInfoItemIdNotFound(arg) + case .groupInfo(let swiftArg): + let arg = DBXTeamGroupFullInfo(swift: swiftArg) + return DBXTeamGroupsGetInfoItemGroupInfo(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIdNotFound: DBXTeamGroupsGetInfoItemIdNotFound? { + self as? DBXTeamGroupsGetInfoItemIdNotFound + } + + @objc + public var asGroupInfo: DBXTeamGroupsGetInfoItemGroupInfo? { + self as? DBXTeamGroupsGetInfoItemGroupInfo + } +} + +/// An ID that was provided as a parameter to groupsGetInfo, and did not match a corresponding group. The ID can +/// be a group ID, or an external ID, depending on how the method was called. +@objc +public class DBXTeamGroupsGetInfoItemIdNotFound: DBXTeamGroupsGetInfoItem { + @objc + public var idNotFound: String + + @objc + public init(_ arg: String) { + self.idNotFound = arg + let swift = Team.GroupsGetInfoItem.idNotFound(arg) + super.init(swift: swift) + } +} + +/// Info about a group. +@objc +public class DBXTeamGroupsGetInfoItemGroupInfo: DBXTeamGroupsGetInfoItem { + @objc + public var groupInfo: DBXTeamGroupFullInfo + + @objc + public init(_ arg: DBXTeamGroupFullInfo) { + self.groupInfo = arg + let swift = Team.GroupsGetInfoItem.groupInfo(arg.subSwift) + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupsListArg struct +@objc +public class DBXTeamGroupsListArg: NSObject { + /// Number of results to return per call. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(limit: NSNumber) { + self.swift = Team.GroupsListArg(limit: limit.uint32Value) + } + + let swift: Team.GroupsListArg + + public init(swift: Team.GroupsListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupsListContinueArg struct +@objc +public class DBXTeamGroupsListContinueArg: NSObject { + /// Indicates from what point to get the next set of groups. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Team.GroupsListContinueArg(cursor: cursor) + } + + let swift: Team.GroupsListContinueArg + + public init(swift: Team.GroupsListContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupsListContinueError union +@objc +public class DBXTeamGroupsListContinueError: NSObject { + let swift: Team.GroupsListContinueError + + public init(swift: Team.GroupsListContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupsListContinueError) -> DBXTeamGroupsListContinueError { + switch swift { + case .invalidCursor: + return DBXTeamGroupsListContinueErrorInvalidCursor() + case .other: + return DBXTeamGroupsListContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidCursor: DBXTeamGroupsListContinueErrorInvalidCursor? { + self as? DBXTeamGroupsListContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXTeamGroupsListContinueErrorOther? { + self as? DBXTeamGroupsListContinueErrorOther + } +} + +/// The cursor is invalid. +@objc +public class DBXTeamGroupsListContinueErrorInvalidCursor: DBXTeamGroupsListContinueError { + @objc + public init() { + let swift = Team.GroupsListContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupsListContinueErrorOther: DBXTeamGroupsListContinueError { + @objc + public init() { + let swift = Team.GroupsListContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupsListResult struct +@objc +public class DBXTeamGroupsListResult: NSObject { + /// (no description) + @objc + public var groups: [DBXTeamCommonGroupSummary] { swift.groups.map { DBXTeamCommonGroupSummary(swift: $0) } } + /// Pass the cursor into groupsListContinue to obtain the additional groups. + @objc + public var cursor: String { swift.cursor } + /// Is true if there are additional groups that have not been returned yet. An additional call to + /// groupsListContinue can retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(groups: [DBXTeamCommonGroupSummary], cursor: String, hasMore: NSNumber) { + self.swift = Team.GroupsListResult(groups: groups.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Team.GroupsListResult + + public init(swift: Team.GroupsListResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupsMembersListArg struct +@objc +public class DBXTeamGroupsMembersListArg: NSObject { + /// The group whose members are to be listed. + @objc + public var group: DBXTeamGroupSelector { DBXTeamGroupSelector(swift: swift.group) } + /// Number of results to return per call. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(group: DBXTeamGroupSelector, limit: NSNumber) { + self.swift = Team.GroupsMembersListArg(group: group.swift, limit: limit.uint32Value) + } + + let swift: Team.GroupsMembersListArg + + public init(swift: Team.GroupsMembersListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupsMembersListContinueArg struct +@objc +public class DBXTeamGroupsMembersListContinueArg: NSObject { + /// Indicates from what point to get the next set of groups. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Team.GroupsMembersListContinueArg(cursor: cursor) + } + + let swift: Team.GroupsMembersListContinueArg + + public init(swift: Team.GroupsMembersListContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupsMembersListContinueError union +@objc +public class DBXTeamGroupsMembersListContinueError: NSObject { + let swift: Team.GroupsMembersListContinueError + + public init(swift: Team.GroupsMembersListContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupsMembersListContinueError) -> DBXTeamGroupsMembersListContinueError { + switch swift { + case .invalidCursor: + return DBXTeamGroupsMembersListContinueErrorInvalidCursor() + case .other: + return DBXTeamGroupsMembersListContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidCursor: DBXTeamGroupsMembersListContinueErrorInvalidCursor? { + self as? DBXTeamGroupsMembersListContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXTeamGroupsMembersListContinueErrorOther? { + self as? DBXTeamGroupsMembersListContinueErrorOther + } +} + +/// The cursor is invalid. +@objc +public class DBXTeamGroupsMembersListContinueErrorInvalidCursor: DBXTeamGroupsMembersListContinueError { + @objc + public init() { + let swift = Team.GroupsMembersListContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupsMembersListContinueErrorOther: DBXTeamGroupsMembersListContinueError { + @objc + public init() { + let swift = Team.GroupsMembersListContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupsMembersListResult struct +@objc +public class DBXTeamGroupsMembersListResult: NSObject { + /// (no description) + @objc + public var members: [DBXTeamGroupMemberInfo] { swift.members.map { DBXTeamGroupMemberInfo(swift: $0) } } + /// Pass the cursor into groupsMembersListContinue to obtain additional group members. + @objc + public var cursor: String { swift.cursor } + /// Is true if there are additional group members that have not been returned yet. An additional call to + /// groupsMembersListContinue can retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(members: [DBXTeamGroupMemberInfo], cursor: String, hasMore: NSNumber) { + self.swift = Team.GroupsMembersListResult(members: members.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Team.GroupsMembersListResult + + public init(swift: Team.GroupsMembersListResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupsPollError union +@objc +public class DBXTeamGroupsPollError: NSObject { + let swift: Team.GroupsPollError + + public init(swift: Team.GroupsPollError) { + self.swift = swift + } + + public static func factory(swift: Team.GroupsPollError) -> DBXTeamGroupsPollError { + switch swift { + case .invalidAsyncJobId: + return DBXTeamGroupsPollErrorInvalidAsyncJobId() + case .internalError: + return DBXTeamGroupsPollErrorInternalError() + case .other: + return DBXTeamGroupsPollErrorOther() + case .accessDenied: + return DBXTeamGroupsPollErrorAccessDenied() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidAsyncJobId: DBXTeamGroupsPollErrorInvalidAsyncJobId? { + self as? DBXTeamGroupsPollErrorInvalidAsyncJobId + } + + @objc + public var asInternalError: DBXTeamGroupsPollErrorInternalError? { + self as? DBXTeamGroupsPollErrorInternalError + } + + @objc + public var asOther: DBXTeamGroupsPollErrorOther? { + self as? DBXTeamGroupsPollErrorOther + } + + @objc + public var asAccessDenied: DBXTeamGroupsPollErrorAccessDenied? { + self as? DBXTeamGroupsPollErrorAccessDenied + } +} + +/// The job ID is invalid. +@objc +public class DBXTeamGroupsPollErrorInvalidAsyncJobId: DBXTeamGroupsPollError { + @objc + public init() { + let swift = Team.GroupsPollError.invalidAsyncJobId + super.init(swift: swift) + } +} + +/// Something went wrong with the job on Dropbox's end. You'll need to verify that the action you were taking +/// succeeded, and if not, try again. This should happen very rarely. +@objc +public class DBXTeamGroupsPollErrorInternalError: DBXTeamGroupsPollError { + @objc + public init() { + let swift = Team.GroupsPollError.internalError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamGroupsPollErrorOther: DBXTeamGroupsPollError { + @objc + public init() { + let swift = Team.GroupsPollError.other + super.init(swift: swift) + } +} + +/// You are not allowed to poll this job. +@objc +public class DBXTeamGroupsPollErrorAccessDenied: DBXTeamGroupsPollError { + @objc + public init() { + let swift = Team.GroupsPollError.accessDenied + super.init(swift: swift) + } +} + +/// Argument for selecting a list of groups, either by group_ids, or external group IDs. +@objc +public class DBXTeamGroupsSelector: NSObject { + let swift: Team.GroupsSelector + + public init(swift: Team.GroupsSelector) { + self.swift = swift + } + + public static func factory(swift: Team.GroupsSelector) -> DBXTeamGroupsSelector { + switch swift { + case .groupIds(let swiftArg): + let arg = swiftArg + return DBXTeamGroupsSelectorGroupIds(arg) + case .groupExternalIds(let swiftArg): + let arg = swiftArg + return DBXTeamGroupsSelectorGroupExternalIds(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroupIds: DBXTeamGroupsSelectorGroupIds? { + self as? DBXTeamGroupsSelectorGroupIds + } + + @objc + public var asGroupExternalIds: DBXTeamGroupsSelectorGroupExternalIds? { + self as? DBXTeamGroupsSelectorGroupExternalIds + } +} + +/// List of group IDs. +@objc +public class DBXTeamGroupsSelectorGroupIds: DBXTeamGroupsSelector { + @objc + public var groupIds: [String] + + @objc + public init(_ arg: [String]) { + self.groupIds = arg + let swift = Team.GroupsSelector.groupIds(arg) + super.init(swift: swift) + } +} + +/// List of external IDs of groups. +@objc +public class DBXTeamGroupsSelectorGroupExternalIds: DBXTeamGroupsSelector { + @objc + public var groupExternalIds: [String] + + @objc + public init(_ arg: [String]) { + self.groupExternalIds = arg + let swift = Team.GroupsSelector.groupExternalIds(arg) + super.init(swift: swift) + } +} + +/// The value for hasTeamFileEvents in Feature. +@objc +public class DBXTeamHasTeamFileEventsValue: NSObject { + let swift: Team.HasTeamFileEventsValue + + public init(swift: Team.HasTeamFileEventsValue) { + self.swift = swift + } + + public static func factory(swift: Team.HasTeamFileEventsValue) -> DBXTeamHasTeamFileEventsValue { + switch swift { + case .enabled(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXTeamHasTeamFileEventsValueEnabled(arg) + case .other: + return DBXTeamHasTeamFileEventsValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEnabled: DBXTeamHasTeamFileEventsValueEnabled? { + self as? DBXTeamHasTeamFileEventsValueEnabled + } + + @objc + public var asOther: DBXTeamHasTeamFileEventsValueOther? { + self as? DBXTeamHasTeamFileEventsValueOther + } +} + +/// Does this team have file events. +@objc +public class DBXTeamHasTeamFileEventsValueEnabled: DBXTeamHasTeamFileEventsValue { + @objc + public var enabled: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.enabled = arg + let swift = Team.HasTeamFileEventsValue.enabled(arg.boolValue) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamHasTeamFileEventsValueOther: DBXTeamHasTeamFileEventsValue { + @objc + public init() { + let swift = Team.HasTeamFileEventsValue.other + super.init(swift: swift) + } +} + +/// The value for hasTeamSelectiveSync in Feature. +@objc +public class DBXTeamHasTeamSelectiveSyncValue: NSObject { + let swift: Team.HasTeamSelectiveSyncValue + + public init(swift: Team.HasTeamSelectiveSyncValue) { + self.swift = swift + } + + public static func factory(swift: Team.HasTeamSelectiveSyncValue) -> DBXTeamHasTeamSelectiveSyncValue { + switch swift { + case .hasTeamSelectiveSync(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXTeamHasTeamSelectiveSyncValueHasTeamSelectiveSync(arg) + case .other: + return DBXTeamHasTeamSelectiveSyncValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHasTeamSelectiveSync: DBXTeamHasTeamSelectiveSyncValueHasTeamSelectiveSync? { + self as? DBXTeamHasTeamSelectiveSyncValueHasTeamSelectiveSync + } + + @objc + public var asOther: DBXTeamHasTeamSelectiveSyncValueOther? { + self as? DBXTeamHasTeamSelectiveSyncValueOther + } +} + +/// Does this team have team selective sync enabled. +@objc +public class DBXTeamHasTeamSelectiveSyncValueHasTeamSelectiveSync: DBXTeamHasTeamSelectiveSyncValue { + @objc + public var hasTeamSelectiveSync: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.hasTeamSelectiveSync = arg + let swift = Team.HasTeamSelectiveSyncValue.hasTeamSelectiveSync(arg.boolValue) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamHasTeamSelectiveSyncValueOther: DBXTeamHasTeamSelectiveSyncValue { + @objc + public init() { + let swift = Team.HasTeamSelectiveSyncValue.other + super.init(swift: swift) + } +} + +/// The value for hasTeamSharedDropbox in Feature. +@objc +public class DBXTeamHasTeamSharedDropboxValue: NSObject { + let swift: Team.HasTeamSharedDropboxValue + + public init(swift: Team.HasTeamSharedDropboxValue) { + self.swift = swift + } + + public static func factory(swift: Team.HasTeamSharedDropboxValue) -> DBXTeamHasTeamSharedDropboxValue { + switch swift { + case .hasTeamSharedDropbox(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXTeamHasTeamSharedDropboxValueHasTeamSharedDropbox(arg) + case .other: + return DBXTeamHasTeamSharedDropboxValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHasTeamSharedDropbox: DBXTeamHasTeamSharedDropboxValueHasTeamSharedDropbox? { + self as? DBXTeamHasTeamSharedDropboxValueHasTeamSharedDropbox + } + + @objc + public var asOther: DBXTeamHasTeamSharedDropboxValueOther? { + self as? DBXTeamHasTeamSharedDropboxValueOther + } +} + +/// Does this team have a shared team root. +@objc +public class DBXTeamHasTeamSharedDropboxValueHasTeamSharedDropbox: DBXTeamHasTeamSharedDropboxValue { + @objc + public var hasTeamSharedDropbox: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.hasTeamSharedDropbox = arg + let swift = Team.HasTeamSharedDropboxValue.hasTeamSharedDropbox(arg.boolValue) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamHasTeamSharedDropboxValueOther: DBXTeamHasTeamSharedDropboxValue { + @objc + public init() { + let swift = Team.HasTeamSharedDropboxValue.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldHeldRevisionMetadata struct +@objc +public class DBXTeamLegalHoldHeldRevisionMetadata: NSObject { + /// The held revision filename. + @objc + public var newFilename: String { swift.newFilename } + /// The id of the held revision. + @objc + public var originalRevisionId: String { swift.originalRevisionId } + /// The original path of the held revision. + @objc + public var originalFilePath: String { swift.originalFilePath } + /// The last time the file was modified on Dropbox. + @objc + public var serverModified: Date { swift.serverModified } + /// The member id of the revision's author. + @objc + public var authorMemberId: String { swift.authorMemberId } + /// The member status of the revision's author. + @objc + public var authorMemberStatus: DBXTeamTeamMemberStatus { DBXTeamTeamMemberStatus(swift: swift.authorMemberStatus) } + /// The email address of the held revision author. + @objc + public var authorEmail: String { swift.authorEmail } + /// The type of the held revision's file. + @objc + public var fileType: String { swift.fileType } + /// The file size in bytes. + @objc + public var size: NSNumber { swift.size as NSNumber } + /// A hash of the file content. This field can be used to verify data integrity. For more information see our + /// Content hash https://www.dropbox.com/developers/reference/content-hash page. + @objc + public var contentHash: String { swift.contentHash } + + @objc + public init( + newFilename: String, + originalRevisionId: String, + originalFilePath: String, + serverModified: Date, + authorMemberId: String, + authorMemberStatus: DBXTeamTeamMemberStatus, + authorEmail: String, + fileType: String, + size: NSNumber, + contentHash: String + ) { + self.swift = Team.LegalHoldHeldRevisionMetadata( + newFilename: newFilename, + originalRevisionId: originalRevisionId, + originalFilePath: originalFilePath, + serverModified: serverModified, + authorMemberId: authorMemberId, + authorMemberStatus: authorMemberStatus.swift, + authorEmail: authorEmail, + fileType: fileType, + size: size.uint64Value, + contentHash: contentHash + ) + } + + let swift: Team.LegalHoldHeldRevisionMetadata + + public init(swift: Team.LegalHoldHeldRevisionMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldPolicy struct +@objc +public class DBXTeamLegalHoldPolicy: NSObject { + /// The legal hold id. + @objc + public var id: String { swift.id } + /// Policy name. + @objc + public var name: String { swift.name } + /// A description of the legal hold policy. + @objc + public var description_: String? { swift.description_ } + /// The time at which the legal hold was activated. + @objc + public var activationTime: Date? { swift.activationTime } + /// Team members IDs and number of permanently deleted members under hold. + @objc + public var members: DBXTeamMembersInfo { DBXTeamMembersInfo(swift: swift.members) } + /// The current state of the hold. + @objc + public var status: DBXTeamLegalHoldStatus { DBXTeamLegalHoldStatus(swift: swift.status) } + /// Start date of the legal hold policy. + @objc + public var startDate: Date { swift.startDate } + /// End date of the legal hold policy. + @objc + public var endDate: Date? { swift.endDate } + + @objc + public init( + id: String, + name: String, + members: DBXTeamMembersInfo, + status: DBXTeamLegalHoldStatus, + startDate: Date, + description_: String?, + activationTime: Date?, + endDate: Date? + ) { + self.swift = Team.LegalHoldPolicy( + id: id, + name: name, + members: members.swift, + status: status.swift, + startDate: startDate, + description_: description_, + activationTime: activationTime, + endDate: endDate + ) + } + + let swift: Team.LegalHoldPolicy + + public init(swift: Team.LegalHoldPolicy) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldStatus union +@objc +public class DBXTeamLegalHoldStatus: NSObject { + let swift: Team.LegalHoldStatus + + public init(swift: Team.LegalHoldStatus) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldStatus) -> DBXTeamLegalHoldStatus { + switch swift { + case .active: + return DBXTeamLegalHoldStatusActive() + case .released: + return DBXTeamLegalHoldStatusReleased() + case .activating: + return DBXTeamLegalHoldStatusActivating() + case .updating: + return DBXTeamLegalHoldStatusUpdating() + case .exporting: + return DBXTeamLegalHoldStatusExporting() + case .releasing: + return DBXTeamLegalHoldStatusReleasing() + case .other: + return DBXTeamLegalHoldStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXTeamLegalHoldStatusActive? { + self as? DBXTeamLegalHoldStatusActive + } + + @objc + public var asReleased: DBXTeamLegalHoldStatusReleased? { + self as? DBXTeamLegalHoldStatusReleased + } + + @objc + public var asActivating: DBXTeamLegalHoldStatusActivating? { + self as? DBXTeamLegalHoldStatusActivating + } + + @objc + public var asUpdating: DBXTeamLegalHoldStatusUpdating? { + self as? DBXTeamLegalHoldStatusUpdating + } + + @objc + public var asExporting: DBXTeamLegalHoldStatusExporting? { + self as? DBXTeamLegalHoldStatusExporting + } + + @objc + public var asReleasing: DBXTeamLegalHoldStatusReleasing? { + self as? DBXTeamLegalHoldStatusReleasing + } + + @objc + public var asOther: DBXTeamLegalHoldStatusOther? { + self as? DBXTeamLegalHoldStatusOther + } +} + +/// The legal hold policy is active. +@objc +public class DBXTeamLegalHoldStatusActive: DBXTeamLegalHoldStatus { + @objc + public init() { + let swift = Team.LegalHoldStatus.active + super.init(swift: swift) + } +} + +/// The legal hold policy was released. +@objc +public class DBXTeamLegalHoldStatusReleased: DBXTeamLegalHoldStatus { + @objc + public init() { + let swift = Team.LegalHoldStatus.released + super.init(swift: swift) + } +} + +/// The legal hold policy is activating. +@objc +public class DBXTeamLegalHoldStatusActivating: DBXTeamLegalHoldStatus { + @objc + public init() { + let swift = Team.LegalHoldStatus.activating + super.init(swift: swift) + } +} + +/// The legal hold policy is updating. +@objc +public class DBXTeamLegalHoldStatusUpdating: DBXTeamLegalHoldStatus { + @objc + public init() { + let swift = Team.LegalHoldStatus.updating + super.init(swift: swift) + } +} + +/// The legal hold policy is exporting. +@objc +public class DBXTeamLegalHoldStatusExporting: DBXTeamLegalHoldStatus { + @objc + public init() { + let swift = Team.LegalHoldStatus.exporting + super.init(swift: swift) + } +} + +/// The legal hold policy is releasing. +@objc +public class DBXTeamLegalHoldStatusReleasing: DBXTeamLegalHoldStatus { + @objc + public init() { + let swift = Team.LegalHoldStatus.releasing + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldStatusOther: DBXTeamLegalHoldStatus { + @objc + public init() { + let swift = Team.LegalHoldStatus.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsError union +@objc +public class DBXTeamLegalHoldsError: NSObject { + let swift: Team.LegalHoldsError + + public init(swift: Team.LegalHoldsError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsError) -> DBXTeamLegalHoldsError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsErrorUnknownLegalHoldError() + case .insufficientPermissions: + return DBXTeamLegalHoldsErrorInsufficientPermissions() + case .other: + return DBXTeamLegalHoldsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsErrorUnknownLegalHoldError + } + + @objc + public var asInsufficientPermissions: DBXTeamLegalHoldsErrorInsufficientPermissions? { + self as? DBXTeamLegalHoldsErrorInsufficientPermissions + } + + @objc + public var asOther: DBXTeamLegalHoldsErrorOther? { + self as? DBXTeamLegalHoldsErrorOther + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsErrorUnknownLegalHoldError: DBXTeamLegalHoldsError { + @objc + public init() { + let swift = Team.LegalHoldsError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// You don't have permissions to perform this action. +@objc +public class DBXTeamLegalHoldsErrorInsufficientPermissions: DBXTeamLegalHoldsError { + @objc + public init() { + let swift = Team.LegalHoldsError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsErrorOther: DBXTeamLegalHoldsError { + @objc + public init() { + let swift = Team.LegalHoldsError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsGetPolicyArg struct +@objc +public class DBXTeamLegalHoldsGetPolicyArg: NSObject { + /// The legal hold Id. + @objc + public var id: String { swift.id } + + @objc + public init(id: String) { + self.swift = Team.LegalHoldsGetPolicyArg(id: id) + } + + let swift: Team.LegalHoldsGetPolicyArg + + public init(swift: Team.LegalHoldsGetPolicyArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsGetPolicyError union +@objc +public class DBXTeamLegalHoldsGetPolicyError: NSObject { + let swift: Team.LegalHoldsGetPolicyError + + public init(swift: Team.LegalHoldsGetPolicyError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsGetPolicyError) -> DBXTeamLegalHoldsGetPolicyError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsGetPolicyErrorUnknownLegalHoldError() + case .insufficientPermissions: + return DBXTeamLegalHoldsGetPolicyErrorInsufficientPermissions() + case .other: + return DBXTeamLegalHoldsGetPolicyErrorOther() + case .legalHoldPolicyNotFound: + return DBXTeamLegalHoldsGetPolicyErrorLegalHoldPolicyNotFound() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsGetPolicyErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsGetPolicyErrorUnknownLegalHoldError + } + + @objc + public var asInsufficientPermissions: DBXTeamLegalHoldsGetPolicyErrorInsufficientPermissions? { + self as? DBXTeamLegalHoldsGetPolicyErrorInsufficientPermissions + } + + @objc + public var asOther: DBXTeamLegalHoldsGetPolicyErrorOther? { + self as? DBXTeamLegalHoldsGetPolicyErrorOther + } + + @objc + public var asLegalHoldPolicyNotFound: DBXTeamLegalHoldsGetPolicyErrorLegalHoldPolicyNotFound? { + self as? DBXTeamLegalHoldsGetPolicyErrorLegalHoldPolicyNotFound + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsGetPolicyErrorUnknownLegalHoldError: DBXTeamLegalHoldsGetPolicyError { + @objc + public init() { + let swift = Team.LegalHoldsGetPolicyError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// You don't have permissions to perform this action. +@objc +public class DBXTeamLegalHoldsGetPolicyErrorInsufficientPermissions: DBXTeamLegalHoldsGetPolicyError { + @objc + public init() { + let swift = Team.LegalHoldsGetPolicyError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsGetPolicyErrorOther: DBXTeamLegalHoldsGetPolicyError { + @objc + public init() { + let swift = Team.LegalHoldsGetPolicyError.other + super.init(swift: swift) + } +} + +/// Legal hold policy does not exist for id in LegalHoldsGetPolicyArg. +@objc +public class DBXTeamLegalHoldsGetPolicyErrorLegalHoldPolicyNotFound: DBXTeamLegalHoldsGetPolicyError { + @objc + public init() { + let swift = Team.LegalHoldsGetPolicyError.legalHoldPolicyNotFound + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsListHeldRevisionResult struct +@objc +public class DBXTeamLegalHoldsListHeldRevisionResult: NSObject { + /// List of file entries that under the hold. + @objc + public var entries: [DBXTeamLegalHoldHeldRevisionMetadata] { swift.entries.map { DBXTeamLegalHoldHeldRevisionMetadata(swift: $0) } } + /// The cursor idicates where to continue reading file metadata entries for the next API call. When there are no + /// more entries, the cursor will return none. Pass the cursor into + /// /2/team/legal_holds/list_held_revisions/continue. + @objc + public var cursor: String? { swift.cursor } + /// True if there are more file entries that haven't been returned. You can retrieve them with a call to + /// /legal_holds/list_held_revisions_continue. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(entries: [DBXTeamLegalHoldHeldRevisionMetadata], hasMore: NSNumber, cursor: String?) { + self.swift = Team.LegalHoldsListHeldRevisionResult(entries: entries.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Team.LegalHoldsListHeldRevisionResult + + public init(swift: Team.LegalHoldsListHeldRevisionResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsListHeldRevisionsArg struct +@objc +public class DBXTeamLegalHoldsListHeldRevisionsArg: NSObject { + /// The legal hold Id. + @objc + public var id: String { swift.id } + + @objc + public init(id: String) { + self.swift = Team.LegalHoldsListHeldRevisionsArg(id: id) + } + + let swift: Team.LegalHoldsListHeldRevisionsArg + + public init(swift: Team.LegalHoldsListHeldRevisionsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsListHeldRevisionsContinueArg struct +@objc +public class DBXTeamLegalHoldsListHeldRevisionsContinueArg: NSObject { + /// The legal hold Id. + @objc + public var id: String { swift.id } + /// The cursor idicates where to continue reading file metadata entries for the next API call. When there are no + /// more entries, the cursor will return none. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(id: String, cursor: String?) { + self.swift = Team.LegalHoldsListHeldRevisionsContinueArg(id: id, cursor: cursor) + } + + let swift: Team.LegalHoldsListHeldRevisionsContinueArg + + public init(swift: Team.LegalHoldsListHeldRevisionsContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsListHeldRevisionsContinueError union +@objc +public class DBXTeamLegalHoldsListHeldRevisionsContinueError: NSObject { + let swift: Team.LegalHoldsListHeldRevisionsContinueError + + public init(swift: Team.LegalHoldsListHeldRevisionsContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsListHeldRevisionsContinueError) -> DBXTeamLegalHoldsListHeldRevisionsContinueError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsListHeldRevisionsContinueErrorUnknownLegalHoldError() + case .transientError: + return DBXTeamLegalHoldsListHeldRevisionsContinueErrorTransientError() + case .reset: + return DBXTeamLegalHoldsListHeldRevisionsContinueErrorReset() + case .other: + return DBXTeamLegalHoldsListHeldRevisionsContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsListHeldRevisionsContinueErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsListHeldRevisionsContinueErrorUnknownLegalHoldError + } + + @objc + public var asTransientError: DBXTeamLegalHoldsListHeldRevisionsContinueErrorTransientError? { + self as? DBXTeamLegalHoldsListHeldRevisionsContinueErrorTransientError + } + + @objc + public var asReset: DBXTeamLegalHoldsListHeldRevisionsContinueErrorReset? { + self as? DBXTeamLegalHoldsListHeldRevisionsContinueErrorReset + } + + @objc + public var asOther: DBXTeamLegalHoldsListHeldRevisionsContinueErrorOther? { + self as? DBXTeamLegalHoldsListHeldRevisionsContinueErrorOther + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsContinueErrorUnknownLegalHoldError: DBXTeamLegalHoldsListHeldRevisionsContinueError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsContinueError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// Temporary infrastructure failure, please retry. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsContinueErrorTransientError: DBXTeamLegalHoldsListHeldRevisionsContinueError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsContinueError.transientError + super.init(swift: swift) + } +} + +/// Indicates that the cursor has been invalidated. Call legalHoldsListHeldRevisionsContinue again with an empty +/// cursor to obtain a new cursor. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsContinueErrorReset: DBXTeamLegalHoldsListHeldRevisionsContinueError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsContinueError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsContinueErrorOther: DBXTeamLegalHoldsListHeldRevisionsContinueError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsListHeldRevisionsError union +@objc +public class DBXTeamLegalHoldsListHeldRevisionsError: NSObject { + let swift: Team.LegalHoldsListHeldRevisionsError + + public init(swift: Team.LegalHoldsListHeldRevisionsError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsListHeldRevisionsError) -> DBXTeamLegalHoldsListHeldRevisionsError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsListHeldRevisionsErrorUnknownLegalHoldError() + case .insufficientPermissions: + return DBXTeamLegalHoldsListHeldRevisionsErrorInsufficientPermissions() + case .other: + return DBXTeamLegalHoldsListHeldRevisionsErrorOther() + case .transientError: + return DBXTeamLegalHoldsListHeldRevisionsErrorTransientError() + case .legalHoldStillEmpty: + return DBXTeamLegalHoldsListHeldRevisionsErrorLegalHoldStillEmpty() + case .inactiveLegalHold: + return DBXTeamLegalHoldsListHeldRevisionsErrorInactiveLegalHold() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsListHeldRevisionsErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsListHeldRevisionsErrorUnknownLegalHoldError + } + + @objc + public var asInsufficientPermissions: DBXTeamLegalHoldsListHeldRevisionsErrorInsufficientPermissions? { + self as? DBXTeamLegalHoldsListHeldRevisionsErrorInsufficientPermissions + } + + @objc + public var asOther: DBXTeamLegalHoldsListHeldRevisionsErrorOther? { + self as? DBXTeamLegalHoldsListHeldRevisionsErrorOther + } + + @objc + public var asTransientError: DBXTeamLegalHoldsListHeldRevisionsErrorTransientError? { + self as? DBXTeamLegalHoldsListHeldRevisionsErrorTransientError + } + + @objc + public var asLegalHoldStillEmpty: DBXTeamLegalHoldsListHeldRevisionsErrorLegalHoldStillEmpty? { + self as? DBXTeamLegalHoldsListHeldRevisionsErrorLegalHoldStillEmpty + } + + @objc + public var asInactiveLegalHold: DBXTeamLegalHoldsListHeldRevisionsErrorInactiveLegalHold? { + self as? DBXTeamLegalHoldsListHeldRevisionsErrorInactiveLegalHold + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsErrorUnknownLegalHoldError: DBXTeamLegalHoldsListHeldRevisionsError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// You don't have permissions to perform this action. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsErrorInsufficientPermissions: DBXTeamLegalHoldsListHeldRevisionsError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsErrorOther: DBXTeamLegalHoldsListHeldRevisionsError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsError.other + super.init(swift: swift) + } +} + +/// Temporary infrastructure failure, please retry. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsErrorTransientError: DBXTeamLegalHoldsListHeldRevisionsError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsError.transientError + super.init(swift: swift) + } +} + +/// The legal hold is not holding any revisions yet. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsErrorLegalHoldStillEmpty: DBXTeamLegalHoldsListHeldRevisionsError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsError.legalHoldStillEmpty + super.init(swift: swift) + } +} + +/// Trying to list revisions for an inactive legal hold. +@objc +public class DBXTeamLegalHoldsListHeldRevisionsErrorInactiveLegalHold: DBXTeamLegalHoldsListHeldRevisionsError { + @objc + public init() { + let swift = Team.LegalHoldsListHeldRevisionsError.inactiveLegalHold + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsListPoliciesArg struct +@objc +public class DBXTeamLegalHoldsListPoliciesArg: NSObject { + /// Whether to return holds that were released. + @objc + public var includeReleased: NSNumber { swift.includeReleased as NSNumber } + + @objc + public init(includeReleased: NSNumber) { + self.swift = Team.LegalHoldsListPoliciesArg(includeReleased: includeReleased.boolValue) + } + + let swift: Team.LegalHoldsListPoliciesArg + + public init(swift: Team.LegalHoldsListPoliciesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsListPoliciesError union +@objc +public class DBXTeamLegalHoldsListPoliciesError: NSObject { + let swift: Team.LegalHoldsListPoliciesError + + public init(swift: Team.LegalHoldsListPoliciesError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsListPoliciesError) -> DBXTeamLegalHoldsListPoliciesError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsListPoliciesErrorUnknownLegalHoldError() + case .insufficientPermissions: + return DBXTeamLegalHoldsListPoliciesErrorInsufficientPermissions() + case .other: + return DBXTeamLegalHoldsListPoliciesErrorOther() + case .transientError: + return DBXTeamLegalHoldsListPoliciesErrorTransientError() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsListPoliciesErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsListPoliciesErrorUnknownLegalHoldError + } + + @objc + public var asInsufficientPermissions: DBXTeamLegalHoldsListPoliciesErrorInsufficientPermissions? { + self as? DBXTeamLegalHoldsListPoliciesErrorInsufficientPermissions + } + + @objc + public var asOther: DBXTeamLegalHoldsListPoliciesErrorOther? { + self as? DBXTeamLegalHoldsListPoliciesErrorOther + } + + @objc + public var asTransientError: DBXTeamLegalHoldsListPoliciesErrorTransientError? { + self as? DBXTeamLegalHoldsListPoliciesErrorTransientError + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsListPoliciesErrorUnknownLegalHoldError: DBXTeamLegalHoldsListPoliciesError { + @objc + public init() { + let swift = Team.LegalHoldsListPoliciesError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// You don't have permissions to perform this action. +@objc +public class DBXTeamLegalHoldsListPoliciesErrorInsufficientPermissions: DBXTeamLegalHoldsListPoliciesError { + @objc + public init() { + let swift = Team.LegalHoldsListPoliciesError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsListPoliciesErrorOther: DBXTeamLegalHoldsListPoliciesError { + @objc + public init() { + let swift = Team.LegalHoldsListPoliciesError.other + super.init(swift: swift) + } +} + +/// Temporary infrastructure failure, please retry. +@objc +public class DBXTeamLegalHoldsListPoliciesErrorTransientError: DBXTeamLegalHoldsListPoliciesError { + @objc + public init() { + let swift = Team.LegalHoldsListPoliciesError.transientError + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsListPoliciesResult struct +@objc +public class DBXTeamLegalHoldsListPoliciesResult: NSObject { + /// (no description) + @objc + public var policies: [DBXTeamLegalHoldPolicy] { swift.policies.map { DBXTeamLegalHoldPolicy(swift: $0) } } + + @objc + public init(policies: [DBXTeamLegalHoldPolicy]) { + self.swift = Team.LegalHoldsListPoliciesResult(policies: policies.map(\.swift)) + } + + let swift: Team.LegalHoldsListPoliciesResult + + public init(swift: Team.LegalHoldsListPoliciesResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsPolicyCreateArg struct +@objc +public class DBXTeamLegalHoldsPolicyCreateArg: NSObject { + /// Policy name. + @objc + public var name: String { swift.name } + /// A description of the legal hold policy. + @objc + public var description_: String? { swift.description_ } + /// List of team member IDs added to the hold. + @objc + public var members: [String] { swift.members } + /// start date of the legal hold policy. + @objc + public var startDate: Date? { swift.startDate } + /// end date of the legal hold policy. + @objc + public var endDate: Date? { swift.endDate } + + @objc + public init(name: String, members: [String], description_: String?, startDate: Date?, endDate: Date?) { + self.swift = Team.LegalHoldsPolicyCreateArg(name: name, members: members, description_: description_, startDate: startDate, endDate: endDate) + } + + let swift: Team.LegalHoldsPolicyCreateArg + + public init(swift: Team.LegalHoldsPolicyCreateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsPolicyCreateError union +@objc +public class DBXTeamLegalHoldsPolicyCreateError: NSObject { + let swift: Team.LegalHoldsPolicyCreateError + + public init(swift: Team.LegalHoldsPolicyCreateError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsPolicyCreateError) -> DBXTeamLegalHoldsPolicyCreateError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsPolicyCreateErrorUnknownLegalHoldError() + case .insufficientPermissions: + return DBXTeamLegalHoldsPolicyCreateErrorInsufficientPermissions() + case .other: + return DBXTeamLegalHoldsPolicyCreateErrorOther() + case .startDateIsLaterThanEndDate: + return DBXTeamLegalHoldsPolicyCreateErrorStartDateIsLaterThanEndDate() + case .emptyMembersList: + return DBXTeamLegalHoldsPolicyCreateErrorEmptyMembersList() + case .invalidMembers: + return DBXTeamLegalHoldsPolicyCreateErrorInvalidMembers() + case .numberOfUsersOnHoldIsGreaterThanHoldLimitation: + return DBXTeamLegalHoldsPolicyCreateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation() + case .transientError: + return DBXTeamLegalHoldsPolicyCreateErrorTransientError() + case .nameMustBeUnique: + return DBXTeamLegalHoldsPolicyCreateErrorNameMustBeUnique() + case .teamExceededLegalHoldQuota: + return DBXTeamLegalHoldsPolicyCreateErrorTeamExceededLegalHoldQuota() + case .invalidDate: + return DBXTeamLegalHoldsPolicyCreateErrorInvalidDate() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsPolicyCreateErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsPolicyCreateErrorUnknownLegalHoldError + } + + @objc + public var asInsufficientPermissions: DBXTeamLegalHoldsPolicyCreateErrorInsufficientPermissions? { + self as? DBXTeamLegalHoldsPolicyCreateErrorInsufficientPermissions + } + + @objc + public var asOther: DBXTeamLegalHoldsPolicyCreateErrorOther? { + self as? DBXTeamLegalHoldsPolicyCreateErrorOther + } + + @objc + public var asStartDateIsLaterThanEndDate: DBXTeamLegalHoldsPolicyCreateErrorStartDateIsLaterThanEndDate? { + self as? DBXTeamLegalHoldsPolicyCreateErrorStartDateIsLaterThanEndDate + } + + @objc + public var asEmptyMembersList: DBXTeamLegalHoldsPolicyCreateErrorEmptyMembersList? { + self as? DBXTeamLegalHoldsPolicyCreateErrorEmptyMembersList + } + + @objc + public var asInvalidMembers: DBXTeamLegalHoldsPolicyCreateErrorInvalidMembers? { + self as? DBXTeamLegalHoldsPolicyCreateErrorInvalidMembers + } + + @objc + public var asNumberOfUsersOnHoldIsGreaterThanHoldLimitation: DBXTeamLegalHoldsPolicyCreateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation? { + self as? DBXTeamLegalHoldsPolicyCreateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation + } + + @objc + public var asTransientError: DBXTeamLegalHoldsPolicyCreateErrorTransientError? { + self as? DBXTeamLegalHoldsPolicyCreateErrorTransientError + } + + @objc + public var asNameMustBeUnique: DBXTeamLegalHoldsPolicyCreateErrorNameMustBeUnique? { + self as? DBXTeamLegalHoldsPolicyCreateErrorNameMustBeUnique + } + + @objc + public var asTeamExceededLegalHoldQuota: DBXTeamLegalHoldsPolicyCreateErrorTeamExceededLegalHoldQuota? { + self as? DBXTeamLegalHoldsPolicyCreateErrorTeamExceededLegalHoldQuota + } + + @objc + public var asInvalidDate: DBXTeamLegalHoldsPolicyCreateErrorInvalidDate? { + self as? DBXTeamLegalHoldsPolicyCreateErrorInvalidDate + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorUnknownLegalHoldError: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// You don't have permissions to perform this action. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorInsufficientPermissions: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorOther: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.other + super.init(swift: swift) + } +} + +/// Start date must be earlier than end date. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorStartDateIsLaterThanEndDate: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.startDateIsLaterThanEndDate + super.init(swift: swift) + } +} + +/// The users list must have at least one user. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorEmptyMembersList: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.emptyMembersList + super.init(swift: swift) + } +} + +/// Some members in the members list are not valid to be placed under legal hold. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorInvalidMembers: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.invalidMembers + super.init(swift: swift) + } +} + +/// You cannot add more than 5 users in a legal hold. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.numberOfUsersOnHoldIsGreaterThanHoldLimitation + super.init(swift: swift) + } +} + +/// Temporary infrastructure failure, please retry. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorTransientError: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.transientError + super.init(swift: swift) + } +} + +/// The name provided is already in use by another legal hold. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorNameMustBeUnique: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.nameMustBeUnique + super.init(swift: swift) + } +} + +/// Team exceeded legal hold quota. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorTeamExceededLegalHoldQuota: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.teamExceededLegalHoldQuota + super.init(swift: swift) + } +} + +/// The provided date is invalid. +@objc +public class DBXTeamLegalHoldsPolicyCreateErrorInvalidDate: DBXTeamLegalHoldsPolicyCreateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyCreateError.invalidDate + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsPolicyReleaseArg struct +@objc +public class DBXTeamLegalHoldsPolicyReleaseArg: NSObject { + /// The legal hold Id. + @objc + public var id: String { swift.id } + + @objc + public init(id: String) { + self.swift = Team.LegalHoldsPolicyReleaseArg(id: id) + } + + let swift: Team.LegalHoldsPolicyReleaseArg + + public init(swift: Team.LegalHoldsPolicyReleaseArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsPolicyReleaseError union +@objc +public class DBXTeamLegalHoldsPolicyReleaseError: NSObject { + let swift: Team.LegalHoldsPolicyReleaseError + + public init(swift: Team.LegalHoldsPolicyReleaseError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsPolicyReleaseError) -> DBXTeamLegalHoldsPolicyReleaseError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsPolicyReleaseErrorUnknownLegalHoldError() + case .insufficientPermissions: + return DBXTeamLegalHoldsPolicyReleaseErrorInsufficientPermissions() + case .other: + return DBXTeamLegalHoldsPolicyReleaseErrorOther() + case .legalHoldPerformingAnotherOperation: + return DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPerformingAnotherOperation() + case .legalHoldAlreadyReleasing: + return DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldAlreadyReleasing() + case .legalHoldPolicyNotFound: + return DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPolicyNotFound() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsPolicyReleaseErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsPolicyReleaseErrorUnknownLegalHoldError + } + + @objc + public var asInsufficientPermissions: DBXTeamLegalHoldsPolicyReleaseErrorInsufficientPermissions? { + self as? DBXTeamLegalHoldsPolicyReleaseErrorInsufficientPermissions + } + + @objc + public var asOther: DBXTeamLegalHoldsPolicyReleaseErrorOther? { + self as? DBXTeamLegalHoldsPolicyReleaseErrorOther + } + + @objc + public var asLegalHoldPerformingAnotherOperation: DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPerformingAnotherOperation? { + self as? DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPerformingAnotherOperation + } + + @objc + public var asLegalHoldAlreadyReleasing: DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldAlreadyReleasing? { + self as? DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldAlreadyReleasing + } + + @objc + public var asLegalHoldPolicyNotFound: DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPolicyNotFound? { + self as? DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPolicyNotFound + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsPolicyReleaseErrorUnknownLegalHoldError: DBXTeamLegalHoldsPolicyReleaseError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyReleaseError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// You don't have permissions to perform this action. +@objc +public class DBXTeamLegalHoldsPolicyReleaseErrorInsufficientPermissions: DBXTeamLegalHoldsPolicyReleaseError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyReleaseError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsPolicyReleaseErrorOther: DBXTeamLegalHoldsPolicyReleaseError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyReleaseError.other + super.init(swift: swift) + } +} + +/// Legal hold is currently performing another operation. +@objc +public class DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPerformingAnotherOperation: DBXTeamLegalHoldsPolicyReleaseError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyReleaseError.legalHoldPerformingAnotherOperation + super.init(swift: swift) + } +} + +/// Legal hold is currently performing a release or is already released. +@objc +public class DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldAlreadyReleasing: DBXTeamLegalHoldsPolicyReleaseError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyReleaseError.legalHoldAlreadyReleasing + super.init(swift: swift) + } +} + +/// Legal hold policy does not exist for id in LegalHoldsPolicyReleaseArg. +@objc +public class DBXTeamLegalHoldsPolicyReleaseErrorLegalHoldPolicyNotFound: DBXTeamLegalHoldsPolicyReleaseError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyReleaseError.legalHoldPolicyNotFound + super.init(swift: swift) + } +} + +/// Objective-C compatible LegalHoldsPolicyUpdateArg struct +@objc +public class DBXTeamLegalHoldsPolicyUpdateArg: NSObject { + /// The legal hold Id. + @objc + public var id: String { swift.id } + /// Policy new name. + @objc + public var name: String? { swift.name } + /// Policy new description. + @objc + public var description_: String? { swift.description_ } + /// List of team member IDs to apply the policy on. + @objc + public var members: [String]? { swift.members } + + @objc + public init(id: String, name: String?, description_: String?, members: [String]?) { + self.swift = Team.LegalHoldsPolicyUpdateArg(id: id, name: name, description_: description_, members: members) + } + + let swift: Team.LegalHoldsPolicyUpdateArg + + public init(swift: Team.LegalHoldsPolicyUpdateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsPolicyUpdateError union +@objc +public class DBXTeamLegalHoldsPolicyUpdateError: NSObject { + let swift: Team.LegalHoldsPolicyUpdateError + + public init(swift: Team.LegalHoldsPolicyUpdateError) { + self.swift = swift + } + + public static func factory(swift: Team.LegalHoldsPolicyUpdateError) -> DBXTeamLegalHoldsPolicyUpdateError { + switch swift { + case .unknownLegalHoldError: + return DBXTeamLegalHoldsPolicyUpdateErrorUnknownLegalHoldError() + case .insufficientPermissions: + return DBXTeamLegalHoldsPolicyUpdateErrorInsufficientPermissions() + case .other: + return DBXTeamLegalHoldsPolicyUpdateErrorOther() + case .transientError: + return DBXTeamLegalHoldsPolicyUpdateErrorTransientError() + case .inactiveLegalHold: + return DBXTeamLegalHoldsPolicyUpdateErrorInactiveLegalHold() + case .legalHoldPerformingAnotherOperation: + return DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPerformingAnotherOperation() + case .invalidMembers: + return DBXTeamLegalHoldsPolicyUpdateErrorInvalidMembers() + case .numberOfUsersOnHoldIsGreaterThanHoldLimitation: + return DBXTeamLegalHoldsPolicyUpdateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation() + case .emptyMembersList: + return DBXTeamLegalHoldsPolicyUpdateErrorEmptyMembersList() + case .nameMustBeUnique: + return DBXTeamLegalHoldsPolicyUpdateErrorNameMustBeUnique() + case .legalHoldPolicyNotFound: + return DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPolicyNotFound() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnknownLegalHoldError: DBXTeamLegalHoldsPolicyUpdateErrorUnknownLegalHoldError? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorUnknownLegalHoldError + } + + @objc + public var asInsufficientPermissions: DBXTeamLegalHoldsPolicyUpdateErrorInsufficientPermissions? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorInsufficientPermissions + } + + @objc + public var asOther: DBXTeamLegalHoldsPolicyUpdateErrorOther? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorOther + } + + @objc + public var asTransientError: DBXTeamLegalHoldsPolicyUpdateErrorTransientError? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorTransientError + } + + @objc + public var asInactiveLegalHold: DBXTeamLegalHoldsPolicyUpdateErrorInactiveLegalHold? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorInactiveLegalHold + } + + @objc + public var asLegalHoldPerformingAnotherOperation: DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPerformingAnotherOperation? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPerformingAnotherOperation + } + + @objc + public var asInvalidMembers: DBXTeamLegalHoldsPolicyUpdateErrorInvalidMembers? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorInvalidMembers + } + + @objc + public var asNumberOfUsersOnHoldIsGreaterThanHoldLimitation: DBXTeamLegalHoldsPolicyUpdateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation + } + + @objc + public var asEmptyMembersList: DBXTeamLegalHoldsPolicyUpdateErrorEmptyMembersList? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorEmptyMembersList + } + + @objc + public var asNameMustBeUnique: DBXTeamLegalHoldsPolicyUpdateErrorNameMustBeUnique? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorNameMustBeUnique + } + + @objc + public var asLegalHoldPolicyNotFound: DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPolicyNotFound? { + self as? DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPolicyNotFound + } +} + +/// There has been an unknown legal hold error. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorUnknownLegalHoldError: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.unknownLegalHoldError + super.init(swift: swift) + } +} + +/// You don't have permissions to perform this action. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorInsufficientPermissions: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.insufficientPermissions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorOther: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.other + super.init(swift: swift) + } +} + +/// Temporary infrastructure failure, please retry. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorTransientError: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.transientError + super.init(swift: swift) + } +} + +/// Trying to release an inactive legal hold. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorInactiveLegalHold: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.inactiveLegalHold + super.init(swift: swift) + } +} + +/// Legal hold is currently performing another operation. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPerformingAnotherOperation: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.legalHoldPerformingAnotherOperation + super.init(swift: swift) + } +} + +/// Some members in the members list are not valid to be placed under legal hold. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorInvalidMembers: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.invalidMembers + super.init(swift: swift) + } +} + +/// You cannot add more than 5 users in a legal hold. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorNumberOfUsersOnHoldIsGreaterThanHoldLimitation: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.numberOfUsersOnHoldIsGreaterThanHoldLimitation + super.init(swift: swift) + } +} + +/// The users list must have at least one user. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorEmptyMembersList: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.emptyMembersList + super.init(swift: swift) + } +} + +/// The name provided is already in use by another legal hold. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorNameMustBeUnique: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.nameMustBeUnique + super.init(swift: swift) + } +} + +/// Legal hold policy does not exist for id in LegalHoldsPolicyUpdateArg. +@objc +public class DBXTeamLegalHoldsPolicyUpdateErrorLegalHoldPolicyNotFound: DBXTeamLegalHoldsPolicyUpdateError { + @objc + public init() { + let swift = Team.LegalHoldsPolicyUpdateError.legalHoldPolicyNotFound + super.init(swift: swift) + } +} + +/// Objective-C compatible ListMemberAppsArg struct +@objc +public class DBXTeamListMemberAppsArg: NSObject { + /// The team member id. + @objc + public var teamMemberId: String { swift.teamMemberId } + + @objc + public init(teamMemberId: String) { + self.swift = Team.ListMemberAppsArg(teamMemberId: teamMemberId) + } + + let swift: Team.ListMemberAppsArg + + public init(swift: Team.ListMemberAppsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error returned by linkedAppsListMemberLinkedApps. +@objc +public class DBXTeamListMemberAppsError: NSObject { + let swift: Team.ListMemberAppsError + + public init(swift: Team.ListMemberAppsError) { + self.swift = swift + } + + public static func factory(swift: Team.ListMemberAppsError) -> DBXTeamListMemberAppsError { + switch swift { + case .memberNotFound: + return DBXTeamListMemberAppsErrorMemberNotFound() + case .other: + return DBXTeamListMemberAppsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMemberNotFound: DBXTeamListMemberAppsErrorMemberNotFound? { + self as? DBXTeamListMemberAppsErrorMemberNotFound + } + + @objc + public var asOther: DBXTeamListMemberAppsErrorOther? { + self as? DBXTeamListMemberAppsErrorOther + } +} + +/// Member not found. +@objc +public class DBXTeamListMemberAppsErrorMemberNotFound: DBXTeamListMemberAppsError { + @objc + public init() { + let swift = Team.ListMemberAppsError.memberNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamListMemberAppsErrorOther: DBXTeamListMemberAppsError { + @objc + public init() { + let swift = Team.ListMemberAppsError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListMemberAppsResult struct +@objc +public class DBXTeamListMemberAppsResult: NSObject { + /// List of third party applications linked by this team member. + @objc + public var linkedApiApps: [DBXTeamApiApp] { swift.linkedApiApps.map { DBXTeamApiApp(swift: $0) } } + + @objc + public init(linkedApiApps: [DBXTeamApiApp]) { + self.swift = Team.ListMemberAppsResult(linkedApiApps: linkedApiApps.map(\.swift)) + } + + let swift: Team.ListMemberAppsResult + + public init(swift: Team.ListMemberAppsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListMemberDevicesArg struct +@objc +public class DBXTeamListMemberDevicesArg: NSObject { + /// The team's member id. + @objc + public var teamMemberId: String { swift.teamMemberId } + /// Whether to list web sessions of the team's member. + @objc + public var includeWebSessions: NSNumber { swift.includeWebSessions as NSNumber } + /// Whether to list linked desktop devices of the team's member. + @objc + public var includeDesktopClients: NSNumber { swift.includeDesktopClients as NSNumber } + /// Whether to list linked mobile devices of the team's member. + @objc + public var includeMobileClients: NSNumber { swift.includeMobileClients as NSNumber } + + @objc + public init(teamMemberId: String, includeWebSessions: NSNumber, includeDesktopClients: NSNumber, includeMobileClients: NSNumber) { + self.swift = Team.ListMemberDevicesArg( + teamMemberId: teamMemberId, + includeWebSessions: includeWebSessions.boolValue, + includeDesktopClients: includeDesktopClients.boolValue, + includeMobileClients: includeMobileClients.boolValue + ) + } + + let swift: Team.ListMemberDevicesArg + + public init(swift: Team.ListMemberDevicesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListMemberDevicesError union +@objc +public class DBXTeamListMemberDevicesError: NSObject { + let swift: Team.ListMemberDevicesError + + public init(swift: Team.ListMemberDevicesError) { + self.swift = swift + } + + public static func factory(swift: Team.ListMemberDevicesError) -> DBXTeamListMemberDevicesError { + switch swift { + case .memberNotFound: + return DBXTeamListMemberDevicesErrorMemberNotFound() + case .other: + return DBXTeamListMemberDevicesErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMemberNotFound: DBXTeamListMemberDevicesErrorMemberNotFound? { + self as? DBXTeamListMemberDevicesErrorMemberNotFound + } + + @objc + public var asOther: DBXTeamListMemberDevicesErrorOther? { + self as? DBXTeamListMemberDevicesErrorOther + } +} + +/// Member not found. +@objc +public class DBXTeamListMemberDevicesErrorMemberNotFound: DBXTeamListMemberDevicesError { + @objc + public init() { + let swift = Team.ListMemberDevicesError.memberNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamListMemberDevicesErrorOther: DBXTeamListMemberDevicesError { + @objc + public init() { + let swift = Team.ListMemberDevicesError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListMemberDevicesResult struct +@objc +public class DBXTeamListMemberDevicesResult: NSObject { + /// List of web sessions made by this team member. + @objc + public var activeWebSessions: [DBXTeamActiveWebSession]? { swift.activeWebSessions?.map { DBXTeamActiveWebSession(swift: $0) } } + /// List of desktop clients used by this team member. + @objc + public var desktopClientSessions: [DBXTeamDesktopClientSession]? { swift.desktopClientSessions?.map { DBXTeamDesktopClientSession(swift: $0) } } + /// List of mobile client used by this team member. + @objc + public var mobileClientSessions: [DBXTeamMobileClientSession]? { swift.mobileClientSessions?.map { DBXTeamMobileClientSession(swift: $0) } } + + @objc + public init( + activeWebSessions: [DBXTeamActiveWebSession]?, + desktopClientSessions: [DBXTeamDesktopClientSession]?, + mobileClientSessions: [DBXTeamMobileClientSession]? + ) { + self.swift = Team.ListMemberDevicesResult( + activeWebSessions: activeWebSessions?.map(\.subSwift), + desktopClientSessions: desktopClientSessions?.map(\.subSwift), + mobileClientSessions: mobileClientSessions?.map(\.subSwift) + ) + } + + let swift: Team.ListMemberDevicesResult + + public init(swift: Team.ListMemberDevicesResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for linkedAppsListMembersLinkedApps. +@objc +public class DBXTeamListMembersAppsArg: NSObject { + /// At the first call to the linkedAppsListMembersLinkedApps the cursor shouldn't be passed. Then, if the result + /// of the call includes a cursor, the following requests should include the received cursors in order to + /// receive the next sub list of the team applications. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(cursor: String?) { + self.swift = Team.ListMembersAppsArg(cursor: cursor) + } + + let swift: Team.ListMembersAppsArg + + public init(swift: Team.ListMembersAppsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error returned by linkedAppsListMembersLinkedApps. +@objc +public class DBXTeamListMembersAppsError: NSObject { + let swift: Team.ListMembersAppsError + + public init(swift: Team.ListMembersAppsError) { + self.swift = swift + } + + public static func factory(swift: Team.ListMembersAppsError) -> DBXTeamListMembersAppsError { + switch swift { + case .reset: + return DBXTeamListMembersAppsErrorReset() + case .other: + return DBXTeamListMembersAppsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asReset: DBXTeamListMembersAppsErrorReset? { + self as? DBXTeamListMembersAppsErrorReset + } + + @objc + public var asOther: DBXTeamListMembersAppsErrorOther? { + self as? DBXTeamListMembersAppsErrorOther + } +} + +/// Indicates that the cursor has been invalidated. Call linkedAppsListMembersLinkedApps again with an empty +/// cursor to obtain a new cursor. +@objc +public class DBXTeamListMembersAppsErrorReset: DBXTeamListMembersAppsError { + @objc + public init() { + let swift = Team.ListMembersAppsError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamListMembersAppsErrorOther: DBXTeamListMembersAppsError { + @objc + public init() { + let swift = Team.ListMembersAppsError.other + super.init(swift: swift) + } +} + +/// Information returned by linkedAppsListMembersLinkedApps. +@objc +public class DBXTeamListMembersAppsResult: NSObject { + /// The linked applications of each member of the team. + @objc + public var apps: [DBXTeamMemberLinkedApps] { swift.apps.map { DBXTeamMemberLinkedApps(swift: $0) } } + /// If true, then there are more apps available. Pass the cursor to linkedAppsListMembersLinkedApps to retrieve + /// the rest. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + /// Pass the cursor into linkedAppsListMembersLinkedApps to receive the next sub list of team's applications. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(apps: [DBXTeamMemberLinkedApps], hasMore: NSNumber, cursor: String?) { + self.swift = Team.ListMembersAppsResult(apps: apps.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Team.ListMembersAppsResult + + public init(swift: Team.ListMembersAppsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListMembersDevicesArg struct +@objc +public class DBXTeamListMembersDevicesArg: NSObject { + /// At the first call to the devicesListMembersDevices the cursor shouldn't be passed. Then, if the result of + /// the call includes a cursor, the following requests should include the received cursors in order to + /// receive the next sub list of team devices. + @objc + public var cursor: String? { swift.cursor } + /// Whether to list web sessions of the team members. + @objc + public var includeWebSessions: NSNumber { swift.includeWebSessions as NSNumber } + /// Whether to list desktop clients of the team members. + @objc + public var includeDesktopClients: NSNumber { swift.includeDesktopClients as NSNumber } + /// Whether to list mobile clients of the team members. + @objc + public var includeMobileClients: NSNumber { swift.includeMobileClients as NSNumber } + + @objc + public init(cursor: String?, includeWebSessions: NSNumber, includeDesktopClients: NSNumber, includeMobileClients: NSNumber) { + self.swift = Team.ListMembersDevicesArg( + cursor: cursor, + includeWebSessions: includeWebSessions.boolValue, + includeDesktopClients: includeDesktopClients.boolValue, + includeMobileClients: includeMobileClients.boolValue + ) + } + + let swift: Team.ListMembersDevicesArg + + public init(swift: Team.ListMembersDevicesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListMembersDevicesError union +@objc +public class DBXTeamListMembersDevicesError: NSObject { + let swift: Team.ListMembersDevicesError + + public init(swift: Team.ListMembersDevicesError) { + self.swift = swift + } + + public static func factory(swift: Team.ListMembersDevicesError) -> DBXTeamListMembersDevicesError { + switch swift { + case .reset: + return DBXTeamListMembersDevicesErrorReset() + case .other: + return DBXTeamListMembersDevicesErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asReset: DBXTeamListMembersDevicesErrorReset? { + self as? DBXTeamListMembersDevicesErrorReset + } + + @objc + public var asOther: DBXTeamListMembersDevicesErrorOther? { + self as? DBXTeamListMembersDevicesErrorOther + } +} + +/// Indicates that the cursor has been invalidated. Call devicesListMembersDevices again with an empty cursor to +/// obtain a new cursor. +@objc +public class DBXTeamListMembersDevicesErrorReset: DBXTeamListMembersDevicesError { + @objc + public init() { + let swift = Team.ListMembersDevicesError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamListMembersDevicesErrorOther: DBXTeamListMembersDevicesError { + @objc + public init() { + let swift = Team.ListMembersDevicesError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListMembersDevicesResult struct +@objc +public class DBXTeamListMembersDevicesResult: NSObject { + /// The devices of each member of the team. + @objc + public var devices: [DBXTeamMemberDevices] { swift.devices.map { DBXTeamMemberDevices(swift: $0) } } + /// If true, then there are more devices available. Pass the cursor to devicesListMembersDevices to retrieve the + /// rest. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + /// Pass the cursor into devicesListMembersDevices to receive the next sub list of team's devices. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(devices: [DBXTeamMemberDevices], hasMore: NSNumber, cursor: String?) { + self.swift = Team.ListMembersDevicesResult(devices: devices.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Team.ListMembersDevicesResult + + public init(swift: Team.ListMembersDevicesResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for linkedAppsListTeamLinkedApps. +@objc +public class DBXTeamListTeamAppsArg: NSObject { + /// At the first call to the linkedAppsListTeamLinkedApps the cursor shouldn't be passed. Then, if the result of + /// the call includes a cursor, the following requests should include the received cursors in order to + /// receive the next sub list of the team applications. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(cursor: String?) { + self.swift = Team.ListTeamAppsArg(cursor: cursor) + } + + let swift: Team.ListTeamAppsArg + + public init(swift: Team.ListTeamAppsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error returned by linkedAppsListTeamLinkedApps. +@objc +public class DBXTeamListTeamAppsError: NSObject { + let swift: Team.ListTeamAppsError + + public init(swift: Team.ListTeamAppsError) { + self.swift = swift + } + + public static func factory(swift: Team.ListTeamAppsError) -> DBXTeamListTeamAppsError { + switch swift { + case .reset: + return DBXTeamListTeamAppsErrorReset() + case .other: + return DBXTeamListTeamAppsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asReset: DBXTeamListTeamAppsErrorReset? { + self as? DBXTeamListTeamAppsErrorReset + } + + @objc + public var asOther: DBXTeamListTeamAppsErrorOther? { + self as? DBXTeamListTeamAppsErrorOther + } +} + +/// Indicates that the cursor has been invalidated. Call linkedAppsListTeamLinkedApps again with an empty cursor +/// to obtain a new cursor. +@objc +public class DBXTeamListTeamAppsErrorReset: DBXTeamListTeamAppsError { + @objc + public init() { + let swift = Team.ListTeamAppsError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamListTeamAppsErrorOther: DBXTeamListTeamAppsError { + @objc + public init() { + let swift = Team.ListTeamAppsError.other + super.init(swift: swift) + } +} + +/// Information returned by linkedAppsListTeamLinkedApps. +@objc +public class DBXTeamListTeamAppsResult: NSObject { + /// The linked applications of each member of the team. + @objc + public var apps: [DBXTeamMemberLinkedApps] { swift.apps.map { DBXTeamMemberLinkedApps(swift: $0) } } + /// If true, then there are more apps available. Pass the cursor to linkedAppsListTeamLinkedApps to retrieve the + /// rest. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + /// Pass the cursor into linkedAppsListTeamLinkedApps to receive the next sub list of team's applications. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(apps: [DBXTeamMemberLinkedApps], hasMore: NSNumber, cursor: String?) { + self.swift = Team.ListTeamAppsResult(apps: apps.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Team.ListTeamAppsResult + + public init(swift: Team.ListTeamAppsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListTeamDevicesArg struct +@objc +public class DBXTeamListTeamDevicesArg: NSObject { + /// At the first call to the devicesListTeamDevices the cursor shouldn't be passed. Then, if the result of the + /// call includes a cursor, the following requests should include the received cursors in order to receive + /// the next sub list of team devices. + @objc + public var cursor: String? { swift.cursor } + /// Whether to list web sessions of the team members. + @objc + public var includeWebSessions: NSNumber { swift.includeWebSessions as NSNumber } + /// Whether to list desktop clients of the team members. + @objc + public var includeDesktopClients: NSNumber { swift.includeDesktopClients as NSNumber } + /// Whether to list mobile clients of the team members. + @objc + public var includeMobileClients: NSNumber { swift.includeMobileClients as NSNumber } + + @objc + public init(cursor: String?, includeWebSessions: NSNumber, includeDesktopClients: NSNumber, includeMobileClients: NSNumber) { + self.swift = Team.ListTeamDevicesArg( + cursor: cursor, + includeWebSessions: includeWebSessions.boolValue, + includeDesktopClients: includeDesktopClients.boolValue, + includeMobileClients: includeMobileClients.boolValue + ) + } + + let swift: Team.ListTeamDevicesArg + + public init(swift: Team.ListTeamDevicesArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ListTeamDevicesError union +@objc +public class DBXTeamListTeamDevicesError: NSObject { + let swift: Team.ListTeamDevicesError + + public init(swift: Team.ListTeamDevicesError) { + self.swift = swift + } + + public static func factory(swift: Team.ListTeamDevicesError) -> DBXTeamListTeamDevicesError { + switch swift { + case .reset: + return DBXTeamListTeamDevicesErrorReset() + case .other: + return DBXTeamListTeamDevicesErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asReset: DBXTeamListTeamDevicesErrorReset? { + self as? DBXTeamListTeamDevicesErrorReset + } + + @objc + public var asOther: DBXTeamListTeamDevicesErrorOther? { + self as? DBXTeamListTeamDevicesErrorOther + } +} + +/// Indicates that the cursor has been invalidated. Call devicesListTeamDevices again with an empty cursor to +/// obtain a new cursor. +@objc +public class DBXTeamListTeamDevicesErrorReset: DBXTeamListTeamDevicesError { + @objc + public init() { + let swift = Team.ListTeamDevicesError.reset + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamListTeamDevicesErrorOther: DBXTeamListTeamDevicesError { + @objc + public init() { + let swift = Team.ListTeamDevicesError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ListTeamDevicesResult struct +@objc +public class DBXTeamListTeamDevicesResult: NSObject { + /// The devices of each member of the team. + @objc + public var devices: [DBXTeamMemberDevices] { swift.devices.map { DBXTeamMemberDevices(swift: $0) } } + /// If true, then there are more devices available. Pass the cursor to devicesListTeamDevices to retrieve the + /// rest. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + /// Pass the cursor into devicesListTeamDevices to receive the next sub list of team's devices. + @objc + public var cursor: String? { swift.cursor } + + @objc + public init(devices: [DBXTeamMemberDevices], hasMore: NSNumber, cursor: String?) { + self.swift = Team.ListTeamDevicesResult(devices: devices.map(\.swift), hasMore: hasMore.boolValue, cursor: cursor) + } + + let swift: Team.ListTeamDevicesResult + + public init(swift: Team.ListTeamDevicesResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Specify access type a member should have when joined to a group. +@objc +public class DBXTeamMemberAccess: NSObject { + /// Identity of a user. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// Access type. + @objc + public var accessType: DBXTeamGroupAccessType { DBXTeamGroupAccessType(swift: swift.accessType) } + + @objc + public init(user: DBXTeamUserSelectorArg, accessType: DBXTeamGroupAccessType) { + self.swift = Team.MemberAccess(user: user.swift, accessType: accessType.swift) + } + + let swift: Team.MemberAccess + + public init(swift: Team.MemberAccess) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberAddArgBase struct +@objc +public class DBXTeamMemberAddArgBase: NSObject { + /// (no description) + @objc + public var memberEmail: String { swift.memberEmail } + /// Member's first name. + @objc + public var memberGivenName: String? { swift.memberGivenName } + /// Member's last name. + @objc + public var memberSurname: String? { swift.memberSurname } + /// External ID for member. + @objc + public var memberExternalId: String? { swift.memberExternalId } + /// Persistent ID for member. This field is only available to teams using persistent ID SAML configuration. + @objc + public var memberPersistentId: String? { swift.memberPersistentId } + /// Whether to send a welcome email to the member. If send_welcome_email is false, no email invitation will be + /// sent to the user. This may be useful for apps using single sign-on (SSO) flows for onboarding that want + /// to handle announcements themselves. + @objc + public var sendWelcomeEmail: NSNumber { swift.sendWelcomeEmail as NSNumber } + /// Whether a user is directory restricted. + @objc + public var isDirectoryRestricted: NSNumber? { swift.isDirectoryRestricted as NSNumber? } + + @objc + public init( + memberEmail: String, + memberGivenName: String?, + memberSurname: String?, + memberExternalId: String?, + memberPersistentId: String?, + sendWelcomeEmail: NSNumber, + isDirectoryRestricted: NSNumber? + ) { + self.swift = Team.MemberAddArgBase( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail.boolValue, + isDirectoryRestricted: isDirectoryRestricted?.boolValue + ) + } + + let swift: Team.MemberAddArgBase + + public init(swift: Team.MemberAddArgBase) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberAddArg struct +@objc +public class DBXTeamMemberAddArg: DBXTeamMemberAddArgBase { + /// (no description) + @objc + public var role: DBXTeamAdminTier { DBXTeamAdminTier(swift: subSwift.role) } + + @objc + public init( + memberEmail: String, + memberGivenName: String?, + memberSurname: String?, + memberExternalId: String?, + memberPersistentId: String?, + sendWelcomeEmail: NSNumber, + isDirectoryRestricted: NSNumber?, + role: DBXTeamAdminTier + ) { + let swift = Team.MemberAddArg( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail.boolValue, + isDirectoryRestricted: isDirectoryRestricted?.boolValue, + role: role.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.MemberAddArg + + public init(swift: Team.MemberAddArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible MemberAddResultBase union +@objc +public class DBXTeamMemberAddResultBase: NSObject { + let swift: Team.MemberAddResultBase + + public init(swift: Team.MemberAddResultBase) { + self.swift = swift + } + + public static func factory(swift: Team.MemberAddResultBase) -> DBXTeamMemberAddResultBase { + switch swift { + case .teamLicenseLimit(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseTeamLicenseLimit(arg) + case .freeTeamMemberLimitReached(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseFreeTeamMemberLimitReached(arg) + case .userAlreadyOnTeam(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseUserAlreadyOnTeam(arg) + case .userOnAnotherTeam(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseUserOnAnotherTeam(arg) + case .userAlreadyPaired(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseUserAlreadyPaired(arg) + case .userMigrationFailed(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseUserMigrationFailed(arg) + case .duplicateExternalMemberId(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseDuplicateExternalMemberId(arg) + case .duplicateMemberPersistentId(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseDuplicateMemberPersistentId(arg) + case .persistentIdDisabled(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBasePersistentIdDisabled(arg) + case .userCreationFailed(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultBaseUserCreationFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeamLicenseLimit: DBXTeamMemberAddResultBaseTeamLicenseLimit? { + self as? DBXTeamMemberAddResultBaseTeamLicenseLimit + } + + @objc + public var asFreeTeamMemberLimitReached: DBXTeamMemberAddResultBaseFreeTeamMemberLimitReached? { + self as? DBXTeamMemberAddResultBaseFreeTeamMemberLimitReached + } + + @objc + public var asUserAlreadyOnTeam: DBXTeamMemberAddResultBaseUserAlreadyOnTeam? { + self as? DBXTeamMemberAddResultBaseUserAlreadyOnTeam + } + + @objc + public var asUserOnAnotherTeam: DBXTeamMemberAddResultBaseUserOnAnotherTeam? { + self as? DBXTeamMemberAddResultBaseUserOnAnotherTeam + } + + @objc + public var asUserAlreadyPaired: DBXTeamMemberAddResultBaseUserAlreadyPaired? { + self as? DBXTeamMemberAddResultBaseUserAlreadyPaired + } + + @objc + public var asUserMigrationFailed: DBXTeamMemberAddResultBaseUserMigrationFailed? { + self as? DBXTeamMemberAddResultBaseUserMigrationFailed + } + + @objc + public var asDuplicateExternalMemberId: DBXTeamMemberAddResultBaseDuplicateExternalMemberId? { + self as? DBXTeamMemberAddResultBaseDuplicateExternalMemberId + } + + @objc + public var asDuplicateMemberPersistentId: DBXTeamMemberAddResultBaseDuplicateMemberPersistentId? { + self as? DBXTeamMemberAddResultBaseDuplicateMemberPersistentId + } + + @objc + public var asPersistentIdDisabled: DBXTeamMemberAddResultBasePersistentIdDisabled? { + self as? DBXTeamMemberAddResultBasePersistentIdDisabled + } + + @objc + public var asUserCreationFailed: DBXTeamMemberAddResultBaseUserCreationFailed? { + self as? DBXTeamMemberAddResultBaseUserCreationFailed + } +} + +/// Team is already full. The organization has no available licenses. +@objc +public class DBXTeamMemberAddResultBaseTeamLicenseLimit: DBXTeamMemberAddResultBase { + @objc + public var teamLicenseLimit: String + + @objc + public init(_ arg: String) { + self.teamLicenseLimit = arg + let swift = Team.MemberAddResultBase.teamLicenseLimit(arg) + super.init(swift: swift) + } +} + +/// Team is already full. The free team member limit has been reached. +@objc +public class DBXTeamMemberAddResultBaseFreeTeamMemberLimitReached: DBXTeamMemberAddResultBase { + @objc + public var freeTeamMemberLimitReached: String + + @objc + public init(_ arg: String) { + self.freeTeamMemberLimitReached = arg + let swift = Team.MemberAddResultBase.freeTeamMemberLimitReached(arg) + super.init(swift: swift) + } +} + +/// User is already on this team. The provided email address is associated with a user who is already a member +/// of (including in recoverable state) or invited to the team. +@objc +public class DBXTeamMemberAddResultBaseUserAlreadyOnTeam: DBXTeamMemberAddResultBase { + @objc + public var userAlreadyOnTeam: String + + @objc + public init(_ arg: String) { + self.userAlreadyOnTeam = arg + let swift = Team.MemberAddResultBase.userAlreadyOnTeam(arg) + super.init(swift: swift) + } +} + +/// User is already on another team. The provided email address is associated with a user that is already a +/// member or invited to another team. +@objc +public class DBXTeamMemberAddResultBaseUserOnAnotherTeam: DBXTeamMemberAddResultBase { + @objc + public var userOnAnotherTeam: String + + @objc + public init(_ arg: String) { + self.userOnAnotherTeam = arg + let swift = Team.MemberAddResultBase.userOnAnotherTeam(arg) + super.init(swift: swift) + } +} + +/// User is already paired. +@objc +public class DBXTeamMemberAddResultBaseUserAlreadyPaired: DBXTeamMemberAddResultBase { + @objc + public var userAlreadyPaired: String + + @objc + public init(_ arg: String) { + self.userAlreadyPaired = arg + let swift = Team.MemberAddResultBase.userAlreadyPaired(arg) + super.init(swift: swift) + } +} + +/// User migration has failed. +@objc +public class DBXTeamMemberAddResultBaseUserMigrationFailed: DBXTeamMemberAddResultBase { + @objc + public var userMigrationFailed: String + + @objc + public init(_ arg: String) { + self.userMigrationFailed = arg + let swift = Team.MemberAddResultBase.userMigrationFailed(arg) + super.init(swift: swift) + } +} + +/// A user with the given external member ID already exists on the team (including in recoverable state). +@objc +public class DBXTeamMemberAddResultBaseDuplicateExternalMemberId: DBXTeamMemberAddResultBase { + @objc + public var duplicateExternalMemberId: String + + @objc + public init(_ arg: String) { + self.duplicateExternalMemberId = arg + let swift = Team.MemberAddResultBase.duplicateExternalMemberId(arg) + super.init(swift: swift) + } +} + +/// A user with the given persistent ID already exists on the team (including in recoverable state). +@objc +public class DBXTeamMemberAddResultBaseDuplicateMemberPersistentId: DBXTeamMemberAddResultBase { + @objc + public var duplicateMemberPersistentId: String + + @objc + public init(_ arg: String) { + self.duplicateMemberPersistentId = arg + let swift = Team.MemberAddResultBase.duplicateMemberPersistentId(arg) + super.init(swift: swift) + } +} + +/// Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for +/// more information. +@objc +public class DBXTeamMemberAddResultBasePersistentIdDisabled: DBXTeamMemberAddResultBase { + @objc + public var persistentIdDisabled: String + + @objc + public init(_ arg: String) { + self.persistentIdDisabled = arg + let swift = Team.MemberAddResultBase.persistentIdDisabled(arg) + super.init(swift: swift) + } +} + +/// User creation has failed. +@objc +public class DBXTeamMemberAddResultBaseUserCreationFailed: DBXTeamMemberAddResultBase { + @objc + public var userCreationFailed: String + + @objc + public init(_ arg: String) { + self.userCreationFailed = arg + let swift = Team.MemberAddResultBase.userCreationFailed(arg) + super.init(swift: swift) + } +} + +/// Describes the result of attempting to add a single user to the team. 'success' is the only value indicating that +/// a user was indeed added to the team - the other values explain the type of failure that occurred, and include +/// the email of the user for which the operation has failed. +@objc +public class DBXTeamMemberAddResult: NSObject { + let swift: Team.MemberAddResult + + public init(swift: Team.MemberAddResult) { + self.swift = swift + } + + public static func factory(swift: Team.MemberAddResult) -> DBXTeamMemberAddResult { + switch swift { + case .teamLicenseLimit(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultTeamLicenseLimit(arg) + case .freeTeamMemberLimitReached(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultFreeTeamMemberLimitReached(arg) + case .userAlreadyOnTeam(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultUserAlreadyOnTeam(arg) + case .userOnAnotherTeam(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultUserOnAnotherTeam(arg) + case .userAlreadyPaired(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultUserAlreadyPaired(arg) + case .userMigrationFailed(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultUserMigrationFailed(arg) + case .duplicateExternalMemberId(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultDuplicateExternalMemberId(arg) + case .duplicateMemberPersistentId(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultDuplicateMemberPersistentId(arg) + case .persistentIdDisabled(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultPersistentIdDisabled(arg) + case .userCreationFailed(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddResultUserCreationFailed(arg) + case .success(let swiftArg): + let arg = DBXTeamTeamMemberInfo(swift: swiftArg) + return DBXTeamMemberAddResultSuccess(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeamLicenseLimit: DBXTeamMemberAddResultTeamLicenseLimit? { + self as? DBXTeamMemberAddResultTeamLicenseLimit + } + + @objc + public var asFreeTeamMemberLimitReached: DBXTeamMemberAddResultFreeTeamMemberLimitReached? { + self as? DBXTeamMemberAddResultFreeTeamMemberLimitReached + } + + @objc + public var asUserAlreadyOnTeam: DBXTeamMemberAddResultUserAlreadyOnTeam? { + self as? DBXTeamMemberAddResultUserAlreadyOnTeam + } + + @objc + public var asUserOnAnotherTeam: DBXTeamMemberAddResultUserOnAnotherTeam? { + self as? DBXTeamMemberAddResultUserOnAnotherTeam + } + + @objc + public var asUserAlreadyPaired: DBXTeamMemberAddResultUserAlreadyPaired? { + self as? DBXTeamMemberAddResultUserAlreadyPaired + } + + @objc + public var asUserMigrationFailed: DBXTeamMemberAddResultUserMigrationFailed? { + self as? DBXTeamMemberAddResultUserMigrationFailed + } + + @objc + public var asDuplicateExternalMemberId: DBXTeamMemberAddResultDuplicateExternalMemberId? { + self as? DBXTeamMemberAddResultDuplicateExternalMemberId + } + + @objc + public var asDuplicateMemberPersistentId: DBXTeamMemberAddResultDuplicateMemberPersistentId? { + self as? DBXTeamMemberAddResultDuplicateMemberPersistentId + } + + @objc + public var asPersistentIdDisabled: DBXTeamMemberAddResultPersistentIdDisabled? { + self as? DBXTeamMemberAddResultPersistentIdDisabled + } + + @objc + public var asUserCreationFailed: DBXTeamMemberAddResultUserCreationFailed? { + self as? DBXTeamMemberAddResultUserCreationFailed + } + + @objc + public var asSuccess: DBXTeamMemberAddResultSuccess? { + self as? DBXTeamMemberAddResultSuccess + } +} + +/// Team is already full. The organization has no available licenses. +@objc +public class DBXTeamMemberAddResultTeamLicenseLimit: DBXTeamMemberAddResult { + @objc + public var teamLicenseLimit: String + + @objc + public init(_ arg: String) { + self.teamLicenseLimit = arg + let swift = Team.MemberAddResult.teamLicenseLimit(arg) + super.init(swift: swift) + } +} + +/// Team is already full. The free team member limit has been reached. +@objc +public class DBXTeamMemberAddResultFreeTeamMemberLimitReached: DBXTeamMemberAddResult { + @objc + public var freeTeamMemberLimitReached: String + + @objc + public init(_ arg: String) { + self.freeTeamMemberLimitReached = arg + let swift = Team.MemberAddResult.freeTeamMemberLimitReached(arg) + super.init(swift: swift) + } +} + +/// User is already on this team. The provided email address is associated with a user who is already a member +/// of (including in recoverable state) or invited to the team. +@objc +public class DBXTeamMemberAddResultUserAlreadyOnTeam: DBXTeamMemberAddResult { + @objc + public var userAlreadyOnTeam: String + + @objc + public init(_ arg: String) { + self.userAlreadyOnTeam = arg + let swift = Team.MemberAddResult.userAlreadyOnTeam(arg) + super.init(swift: swift) + } +} + +/// User is already on another team. The provided email address is associated with a user that is already a +/// member or invited to another team. +@objc +public class DBXTeamMemberAddResultUserOnAnotherTeam: DBXTeamMemberAddResult { + @objc + public var userOnAnotherTeam: String + + @objc + public init(_ arg: String) { + self.userOnAnotherTeam = arg + let swift = Team.MemberAddResult.userOnAnotherTeam(arg) + super.init(swift: swift) + } +} + +/// User is already paired. +@objc +public class DBXTeamMemberAddResultUserAlreadyPaired: DBXTeamMemberAddResult { + @objc + public var userAlreadyPaired: String + + @objc + public init(_ arg: String) { + self.userAlreadyPaired = arg + let swift = Team.MemberAddResult.userAlreadyPaired(arg) + super.init(swift: swift) + } +} + +/// User migration has failed. +@objc +public class DBXTeamMemberAddResultUserMigrationFailed: DBXTeamMemberAddResult { + @objc + public var userMigrationFailed: String + + @objc + public init(_ arg: String) { + self.userMigrationFailed = arg + let swift = Team.MemberAddResult.userMigrationFailed(arg) + super.init(swift: swift) + } +} + +/// A user with the given external member ID already exists on the team (including in recoverable state). +@objc +public class DBXTeamMemberAddResultDuplicateExternalMemberId: DBXTeamMemberAddResult { + @objc + public var duplicateExternalMemberId: String + + @objc + public init(_ arg: String) { + self.duplicateExternalMemberId = arg + let swift = Team.MemberAddResult.duplicateExternalMemberId(arg) + super.init(swift: swift) + } +} + +/// A user with the given persistent ID already exists on the team (including in recoverable state). +@objc +public class DBXTeamMemberAddResultDuplicateMemberPersistentId: DBXTeamMemberAddResult { + @objc + public var duplicateMemberPersistentId: String + + @objc + public init(_ arg: String) { + self.duplicateMemberPersistentId = arg + let swift = Team.MemberAddResult.duplicateMemberPersistentId(arg) + super.init(swift: swift) + } +} + +/// Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for +/// more information. +@objc +public class DBXTeamMemberAddResultPersistentIdDisabled: DBXTeamMemberAddResult { + @objc + public var persistentIdDisabled: String + + @objc + public init(_ arg: String) { + self.persistentIdDisabled = arg + let swift = Team.MemberAddResult.persistentIdDisabled(arg) + super.init(swift: swift) + } +} + +/// User creation has failed. +@objc +public class DBXTeamMemberAddResultUserCreationFailed: DBXTeamMemberAddResult { + @objc + public var userCreationFailed: String + + @objc + public init(_ arg: String) { + self.userCreationFailed = arg + let swift = Team.MemberAddResult.userCreationFailed(arg) + super.init(swift: swift) + } +} + +/// Describes a user that was successfully added to the team. +@objc +public class DBXTeamMemberAddResultSuccess: DBXTeamMemberAddResult { + @objc + public var success: DBXTeamTeamMemberInfo + + @objc + public init(_ arg: DBXTeamTeamMemberInfo) { + self.success = arg + let swift = Team.MemberAddResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible MemberAddV2Arg struct +@objc +public class DBXTeamMemberAddV2Arg: DBXTeamMemberAddArgBase { + /// (no description) + @objc + public var roleIds: [String]? { subSwift.roleIds } + + @objc + public init( + memberEmail: String, + memberGivenName: String?, + memberSurname: String?, + memberExternalId: String?, + memberPersistentId: String?, + sendWelcomeEmail: NSNumber, + isDirectoryRestricted: NSNumber?, + roleIds: [String]? + ) { + let swift = Team.MemberAddV2Arg( + memberEmail: memberEmail, + memberGivenName: memberGivenName, + memberSurname: memberSurname, + memberExternalId: memberExternalId, + memberPersistentId: memberPersistentId, + sendWelcomeEmail: sendWelcomeEmail.boolValue, + isDirectoryRestricted: isDirectoryRestricted?.boolValue, + roleIds: roleIds + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.MemberAddV2Arg + + public init(swift: Team.MemberAddV2Arg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Describes the result of attempting to add a single user to the team. 'success' is the only value indicating that +/// a user was indeed added to the team - the other values explain the type of failure that occurred, and include +/// the email of the user for which the operation has failed. +@objc +public class DBXTeamMemberAddV2Result: NSObject { + let swift: Team.MemberAddV2Result + + public init(swift: Team.MemberAddV2Result) { + self.swift = swift + } + + public static func factory(swift: Team.MemberAddV2Result) -> DBXTeamMemberAddV2Result { + switch swift { + case .teamLicenseLimit(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultTeamLicenseLimit(arg) + case .freeTeamMemberLimitReached(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultFreeTeamMemberLimitReached(arg) + case .userAlreadyOnTeam(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultUserAlreadyOnTeam(arg) + case .userOnAnotherTeam(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultUserOnAnotherTeam(arg) + case .userAlreadyPaired(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultUserAlreadyPaired(arg) + case .userMigrationFailed(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultUserMigrationFailed(arg) + case .duplicateExternalMemberId(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultDuplicateExternalMemberId(arg) + case .duplicateMemberPersistentId(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultDuplicateMemberPersistentId(arg) + case .persistentIdDisabled(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultPersistentIdDisabled(arg) + case .userCreationFailed(let swiftArg): + let arg = swiftArg + return DBXTeamMemberAddV2ResultUserCreationFailed(arg) + case .success(let swiftArg): + let arg = DBXTeamTeamMemberInfoV2(swift: swiftArg) + return DBXTeamMemberAddV2ResultSuccess(arg) + case .other: + return DBXTeamMemberAddV2ResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeamLicenseLimit: DBXTeamMemberAddV2ResultTeamLicenseLimit? { + self as? DBXTeamMemberAddV2ResultTeamLicenseLimit + } + + @objc + public var asFreeTeamMemberLimitReached: DBXTeamMemberAddV2ResultFreeTeamMemberLimitReached? { + self as? DBXTeamMemberAddV2ResultFreeTeamMemberLimitReached + } + + @objc + public var asUserAlreadyOnTeam: DBXTeamMemberAddV2ResultUserAlreadyOnTeam? { + self as? DBXTeamMemberAddV2ResultUserAlreadyOnTeam + } + + @objc + public var asUserOnAnotherTeam: DBXTeamMemberAddV2ResultUserOnAnotherTeam? { + self as? DBXTeamMemberAddV2ResultUserOnAnotherTeam + } + + @objc + public var asUserAlreadyPaired: DBXTeamMemberAddV2ResultUserAlreadyPaired? { + self as? DBXTeamMemberAddV2ResultUserAlreadyPaired + } + + @objc + public var asUserMigrationFailed: DBXTeamMemberAddV2ResultUserMigrationFailed? { + self as? DBXTeamMemberAddV2ResultUserMigrationFailed + } + + @objc + public var asDuplicateExternalMemberId: DBXTeamMemberAddV2ResultDuplicateExternalMemberId? { + self as? DBXTeamMemberAddV2ResultDuplicateExternalMemberId + } + + @objc + public var asDuplicateMemberPersistentId: DBXTeamMemberAddV2ResultDuplicateMemberPersistentId? { + self as? DBXTeamMemberAddV2ResultDuplicateMemberPersistentId + } + + @objc + public var asPersistentIdDisabled: DBXTeamMemberAddV2ResultPersistentIdDisabled? { + self as? DBXTeamMemberAddV2ResultPersistentIdDisabled + } + + @objc + public var asUserCreationFailed: DBXTeamMemberAddV2ResultUserCreationFailed? { + self as? DBXTeamMemberAddV2ResultUserCreationFailed + } + + @objc + public var asSuccess: DBXTeamMemberAddV2ResultSuccess? { + self as? DBXTeamMemberAddV2ResultSuccess + } + + @objc + public var asOther: DBXTeamMemberAddV2ResultOther? { + self as? DBXTeamMemberAddV2ResultOther + } +} + +/// Team is already full. The organization has no available licenses. +@objc +public class DBXTeamMemberAddV2ResultTeamLicenseLimit: DBXTeamMemberAddV2Result { + @objc + public var teamLicenseLimit: String + + @objc + public init(_ arg: String) { + self.teamLicenseLimit = arg + let swift = Team.MemberAddV2Result.teamLicenseLimit(arg) + super.init(swift: swift) + } +} + +/// Team is already full. The free team member limit has been reached. +@objc +public class DBXTeamMemberAddV2ResultFreeTeamMemberLimitReached: DBXTeamMemberAddV2Result { + @objc + public var freeTeamMemberLimitReached: String + + @objc + public init(_ arg: String) { + self.freeTeamMemberLimitReached = arg + let swift = Team.MemberAddV2Result.freeTeamMemberLimitReached(arg) + super.init(swift: swift) + } +} + +/// User is already on this team. The provided email address is associated with a user who is already a member +/// of (including in recoverable state) or invited to the team. +@objc +public class DBXTeamMemberAddV2ResultUserAlreadyOnTeam: DBXTeamMemberAddV2Result { + @objc + public var userAlreadyOnTeam: String + + @objc + public init(_ arg: String) { + self.userAlreadyOnTeam = arg + let swift = Team.MemberAddV2Result.userAlreadyOnTeam(arg) + super.init(swift: swift) + } +} + +/// User is already on another team. The provided email address is associated with a user that is already a +/// member or invited to another team. +@objc +public class DBXTeamMemberAddV2ResultUserOnAnotherTeam: DBXTeamMemberAddV2Result { + @objc + public var userOnAnotherTeam: String + + @objc + public init(_ arg: String) { + self.userOnAnotherTeam = arg + let swift = Team.MemberAddV2Result.userOnAnotherTeam(arg) + super.init(swift: swift) + } +} + +/// User is already paired. +@objc +public class DBXTeamMemberAddV2ResultUserAlreadyPaired: DBXTeamMemberAddV2Result { + @objc + public var userAlreadyPaired: String + + @objc + public init(_ arg: String) { + self.userAlreadyPaired = arg + let swift = Team.MemberAddV2Result.userAlreadyPaired(arg) + super.init(swift: swift) + } +} + +/// User migration has failed. +@objc +public class DBXTeamMemberAddV2ResultUserMigrationFailed: DBXTeamMemberAddV2Result { + @objc + public var userMigrationFailed: String + + @objc + public init(_ arg: String) { + self.userMigrationFailed = arg + let swift = Team.MemberAddV2Result.userMigrationFailed(arg) + super.init(swift: swift) + } +} + +/// A user with the given external member ID already exists on the team (including in recoverable state). +@objc +public class DBXTeamMemberAddV2ResultDuplicateExternalMemberId: DBXTeamMemberAddV2Result { + @objc + public var duplicateExternalMemberId: String + + @objc + public init(_ arg: String) { + self.duplicateExternalMemberId = arg + let swift = Team.MemberAddV2Result.duplicateExternalMemberId(arg) + super.init(swift: swift) + } +} + +/// A user with the given persistent ID already exists on the team (including in recoverable state). +@objc +public class DBXTeamMemberAddV2ResultDuplicateMemberPersistentId: DBXTeamMemberAddV2Result { + @objc + public var duplicateMemberPersistentId: String + + @objc + public init(_ arg: String) { + self.duplicateMemberPersistentId = arg + let swift = Team.MemberAddV2Result.duplicateMemberPersistentId(arg) + super.init(swift: swift) + } +} + +/// Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for +/// more information. +@objc +public class DBXTeamMemberAddV2ResultPersistentIdDisabled: DBXTeamMemberAddV2Result { + @objc + public var persistentIdDisabled: String + + @objc + public init(_ arg: String) { + self.persistentIdDisabled = arg + let swift = Team.MemberAddV2Result.persistentIdDisabled(arg) + super.init(swift: swift) + } +} + +/// User creation has failed. +@objc +public class DBXTeamMemberAddV2ResultUserCreationFailed: DBXTeamMemberAddV2Result { + @objc + public var userCreationFailed: String + + @objc + public init(_ arg: String) { + self.userCreationFailed = arg + let swift = Team.MemberAddV2Result.userCreationFailed(arg) + super.init(swift: swift) + } +} + +/// Describes a user that was successfully added to the team. +@objc +public class DBXTeamMemberAddV2ResultSuccess: DBXTeamMemberAddV2Result { + @objc + public var success: DBXTeamTeamMemberInfoV2 + + @objc + public init(_ arg: DBXTeamTeamMemberInfoV2) { + self.success = arg + let swift = Team.MemberAddV2Result.success(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMemberAddV2ResultOther: DBXTeamMemberAddV2Result { + @objc + public init() { + let swift = Team.MemberAddV2Result.other + super.init(swift: swift) + } +} + +/// Information on devices of a team's member. +@objc +public class DBXTeamMemberDevices: NSObject { + /// The member unique Id. + @objc + public var teamMemberId: String { swift.teamMemberId } + /// List of web sessions made by this team member. + @objc + public var webSessions: [DBXTeamActiveWebSession]? { swift.webSessions?.map { DBXTeamActiveWebSession(swift: $0) } } + /// List of desktop clients by this team member. + @objc + public var desktopClients: [DBXTeamDesktopClientSession]? { swift.desktopClients?.map { DBXTeamDesktopClientSession(swift: $0) } } + /// List of mobile clients by this team member. + @objc + public var mobileClients: [DBXTeamMobileClientSession]? { swift.mobileClients?.map { DBXTeamMobileClientSession(swift: $0) } } + + @objc + public init( + teamMemberId: String, + webSessions: [DBXTeamActiveWebSession]?, + desktopClients: [DBXTeamDesktopClientSession]?, + mobileClients: [DBXTeamMobileClientSession]? + ) { + self.swift = Team.MemberDevices( + teamMemberId: teamMemberId, + webSessions: webSessions?.map(\.subSwift), + desktopClients: desktopClients?.map(\.subSwift), + mobileClients: mobileClients?.map(\.subSwift) + ) + } + + let swift: Team.MemberDevices + + public init(swift: Team.MemberDevices) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information on linked applications of a team member. +@objc +public class DBXTeamMemberLinkedApps: NSObject { + /// The member unique Id. + @objc + public var teamMemberId: String { swift.teamMemberId } + /// List of third party applications linked by this team member. + @objc + public var linkedApiApps: [DBXTeamApiApp] { swift.linkedApiApps.map { DBXTeamApiApp(swift: $0) } } + + @objc + public init(teamMemberId: String, linkedApiApps: [DBXTeamApiApp]) { + self.swift = Team.MemberLinkedApps(teamMemberId: teamMemberId, linkedApiApps: linkedApiApps.map(\.swift)) + } + + let swift: Team.MemberLinkedApps + + public init(swift: Team.MemberLinkedApps) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Basic member profile. +@objc +public class DBXTeamMemberProfile: NSObject { + /// ID of user as a member of a team. + @objc + public var teamMemberId: String { swift.teamMemberId } + /// External ID that a team can attach to the user. An application using the API may find it easier to use their + /// own IDs instead of Dropbox IDs like account_id or team_member_id. + @objc + public var externalId: String? { swift.externalId } + /// A user's account identifier. + @objc + public var accountId: String? { swift.accountId } + /// Email address of user. + @objc + public var email: String { swift.email } + /// Is true if the user's email is verified to be owned by the user. + @objc + public var emailVerified: NSNumber { swift.emailVerified as NSNumber } + /// Secondary emails of a user. + @objc + public var secondaryEmails: [DBXSecondaryEmailsSecondaryEmail]? { swift.secondaryEmails?.map { DBXSecondaryEmailsSecondaryEmail(swift: $0) } } + /// The user's status as a member of a specific team. + @objc + public var status: DBXTeamTeamMemberStatus { DBXTeamTeamMemberStatus(swift: swift.status) } + /// Representations for a person's name. + @objc + public var name: DBXUsersName { DBXUsersName(swift: swift.name) } + /// The user's membership type: full (normal team member) vs limited (does not use a license; no access to the + /// team's shared quota). + @objc + public var membershipType: DBXTeamTeamMembershipType { DBXTeamTeamMembershipType(swift: swift.membershipType) } + /// The date and time the user was invited to the team (contains value only when the member's status matches + /// invited in TeamMemberStatus). + @objc + public var invitedOn: Date? { swift.invitedOn } + /// The date and time the user joined as a member of a specific team. + @objc + public var joinedOn: Date? { swift.joinedOn } + /// The date and time the user was suspended from the team (contains value only when the member's status matches + /// suspended in TeamMemberStatus). + @objc + public var suspendedOn: Date? { swift.suspendedOn } + /// Persistent ID that a team can attach to the user. The persistent ID is unique ID to be used for SAML + /// authentication. + @objc + public var persistentId: String? { swift.persistentId } + /// Whether the user is a directory restricted user. + @objc + public var isDirectoryRestricted: NSNumber? { swift.isDirectoryRestricted as NSNumber? } + /// URL for the photo representing the user, if one is set. + @objc + public var profilePhotoUrl: String? { swift.profilePhotoUrl } + + @objc + public init( + teamMemberId: String, + email: String, + emailVerified: NSNumber, + status: DBXTeamTeamMemberStatus, + name: DBXUsersName, + membershipType: DBXTeamTeamMembershipType, + externalId: String?, + accountId: String?, + secondaryEmails: [DBXSecondaryEmailsSecondaryEmail]?, + invitedOn: Date?, + joinedOn: Date?, + suspendedOn: Date?, + persistentId: String?, + isDirectoryRestricted: NSNumber?, + profilePhotoUrl: String? + ) { + self.swift = Team.MemberProfile( + teamMemberId: teamMemberId, + email: email, + emailVerified: emailVerified.boolValue, + status: status.swift, + name: name.swift, + membershipType: membershipType.swift, + externalId: externalId, + accountId: accountId, + secondaryEmails: secondaryEmails?.map(\.swift), + invitedOn: invitedOn, + joinedOn: joinedOn, + suspendedOn: suspendedOn, + persistentId: persistentId, + isDirectoryRestricted: isDirectoryRestricted?.boolValue, + profilePhotoUrl: profilePhotoUrl + ) + } + + let swift: Team.MemberProfile + + public init(swift: Team.MemberProfile) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error that can be returned whenever a struct derived from UserSelectorArg is used. +@objc +public class DBXTeamUserSelectorError: NSObject { + let swift: Team.UserSelectorError + + public init(swift: Team.UserSelectorError) { + self.swift = swift + } + + public static func factory(swift: Team.UserSelectorError) -> DBXTeamUserSelectorError { + switch swift { + case .userNotFound: + return DBXTeamUserSelectorErrorUserNotFound() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamUserSelectorErrorUserNotFound? { + self as? DBXTeamUserSelectorErrorUserNotFound + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamUserSelectorErrorUserNotFound: DBXTeamUserSelectorError { + @objc + public init() { + let swift = Team.UserSelectorError.userNotFound + super.init(swift: swift) + } +} + +/// Objective-C compatible MemberSelectorError union +@objc +public class DBXTeamMemberSelectorError: NSObject { + let swift: Team.MemberSelectorError + + public init(swift: Team.MemberSelectorError) { + self.swift = swift + } + + public static func factory(swift: Team.MemberSelectorError) -> DBXTeamMemberSelectorError { + switch swift { + case .userNotFound: + return DBXTeamMemberSelectorErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMemberSelectorErrorUserNotInTeam() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMemberSelectorErrorUserNotFound? { + self as? DBXTeamMemberSelectorErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMemberSelectorErrorUserNotInTeam? { + self as? DBXTeamMemberSelectorErrorUserNotInTeam + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMemberSelectorErrorUserNotFound: DBXTeamMemberSelectorError { + @objc + public init() { + let swift = Team.MemberSelectorError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMemberSelectorErrorUserNotInTeam: DBXTeamMemberSelectorError { + @objc + public init() { + let swift = Team.MemberSelectorError.userNotInTeam + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersAddArgBase struct +@objc +public class DBXTeamMembersAddArgBase: NSObject { + /// Whether to force the add to happen asynchronously. + @objc + public var forceAsync: NSNumber { swift.forceAsync as NSNumber } + + @objc + public init(forceAsync: NSNumber) { + self.swift = Team.MembersAddArgBase(forceAsync: forceAsync.boolValue) + } + + let swift: Team.MembersAddArgBase + + public init(swift: Team.MembersAddArgBase) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersAddArg struct +@objc +public class DBXTeamMembersAddArg: DBXTeamMembersAddArgBase { + /// Details of new members to be added to the team. + @objc + public var newMembers: [DBXTeamMemberAddArg] { subSwift.newMembers.map { DBXTeamMemberAddArg(swift: $0) } } + + @objc + public init(newMembers: [DBXTeamMemberAddArg], forceAsync: NSNumber) { + let swift = Team.MembersAddArg(newMembers: newMembers.map(\.subSwift), forceAsync: forceAsync.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.MembersAddArg + + public init(swift: Team.MembersAddArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible MembersAddJobStatus union +@objc +public class DBXTeamMembersAddJobStatus: NSObject { + let swift: Team.MembersAddJobStatus + + public init(swift: Team.MembersAddJobStatus) { + self.swift = swift + } + + public static func factory(swift: Team.MembersAddJobStatus) -> DBXTeamMembersAddJobStatus { + switch swift { + case .inProgress: + return DBXTeamMembersAddJobStatusInProgress() + case .complete(let swiftArg): + let arg = swiftArg.map { DBXTeamMemberAddResult.factory(swift: $0) } + return DBXTeamMembersAddJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = swiftArg + return DBXTeamMembersAddJobStatusFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXTeamMembersAddJobStatusInProgress? { + self as? DBXTeamMembersAddJobStatusInProgress + } + + @objc + public var asComplete: DBXTeamMembersAddJobStatusComplete? { + self as? DBXTeamMembersAddJobStatusComplete + } + + @objc + public var asFailed: DBXTeamMembersAddJobStatusFailed? { + self as? DBXTeamMembersAddJobStatusFailed + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXTeamMembersAddJobStatusInProgress: DBXTeamMembersAddJobStatus { + @objc + public init() { + let swift = Team.MembersAddJobStatus.inProgress + super.init(swift: swift) + } +} + +/// The asynchronous job has finished. For each member that was specified in the parameter MembersAddArg that +/// was provided to membersAdd, a corresponding item is returned in this list. +@objc +public class DBXTeamMembersAddJobStatusComplete: DBXTeamMembersAddJobStatus { + @objc + public var complete: [DBXTeamMemberAddResult] + + @objc + public init(_ arg: [DBXTeamMemberAddResult]) { + self.complete = arg + let swift = Team.MembersAddJobStatus.complete(arg.map(\.swift)) + super.init(swift: swift) + } +} + +/// The asynchronous job returned an error. The string contains an error message. +@objc +public class DBXTeamMembersAddJobStatusFailed: DBXTeamMembersAddJobStatus { + @objc + public var failed: String + + @objc + public init(_ arg: String) { + self.failed = arg + let swift = Team.MembersAddJobStatus.failed(arg) + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersAddJobStatusV2Result union +@objc +public class DBXTeamMembersAddJobStatusV2Result: NSObject { + let swift: Team.MembersAddJobStatusV2Result + + public init(swift: Team.MembersAddJobStatusV2Result) { + self.swift = swift + } + + public static func factory(swift: Team.MembersAddJobStatusV2Result) -> DBXTeamMembersAddJobStatusV2Result { + switch swift { + case .inProgress: + return DBXTeamMembersAddJobStatusV2ResultInProgress() + case .complete(let swiftArg): + let arg = swiftArg.map { DBXTeamMemberAddV2Result.factory(swift: $0) } + return DBXTeamMembersAddJobStatusV2ResultComplete(arg) + case .failed(let swiftArg): + let arg = swiftArg + return DBXTeamMembersAddJobStatusV2ResultFailed(arg) + case .other: + return DBXTeamMembersAddJobStatusV2ResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXTeamMembersAddJobStatusV2ResultInProgress? { + self as? DBXTeamMembersAddJobStatusV2ResultInProgress + } + + @objc + public var asComplete: DBXTeamMembersAddJobStatusV2ResultComplete? { + self as? DBXTeamMembersAddJobStatusV2ResultComplete + } + + @objc + public var asFailed: DBXTeamMembersAddJobStatusV2ResultFailed? { + self as? DBXTeamMembersAddJobStatusV2ResultFailed + } + + @objc + public var asOther: DBXTeamMembersAddJobStatusV2ResultOther? { + self as? DBXTeamMembersAddJobStatusV2ResultOther + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXTeamMembersAddJobStatusV2ResultInProgress: DBXTeamMembersAddJobStatusV2Result { + @objc + public init() { + let swift = Team.MembersAddJobStatusV2Result.inProgress + super.init(swift: swift) + } +} + +/// The asynchronous job has finished. For each member that was specified in the parameter MembersAddArg that +/// was provided to membersAddV2, a corresponding item is returned in this list. +@objc +public class DBXTeamMembersAddJobStatusV2ResultComplete: DBXTeamMembersAddJobStatusV2Result { + @objc + public var complete: [DBXTeamMemberAddV2Result] + + @objc + public init(_ arg: [DBXTeamMemberAddV2Result]) { + self.complete = arg + let swift = Team.MembersAddJobStatusV2Result.complete(arg.map(\.swift)) + super.init(swift: swift) + } +} + +/// The asynchronous job returned an error. The string contains an error message. +@objc +public class DBXTeamMembersAddJobStatusV2ResultFailed: DBXTeamMembersAddJobStatusV2Result { + @objc + public var failed: String + + @objc + public init(_ arg: String) { + self.failed = arg + let swift = Team.MembersAddJobStatusV2Result.failed(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersAddJobStatusV2ResultOther: DBXTeamMembersAddJobStatusV2Result { + @objc + public init() { + let swift = Team.MembersAddJobStatusV2Result.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersAddLaunch union +@objc +public class DBXTeamMembersAddLaunch: NSObject { + let swift: Team.MembersAddLaunch + + public init(swift: Team.MembersAddLaunch) { + self.swift = swift + } + + public static func factory(swift: Team.MembersAddLaunch) -> DBXTeamMembersAddLaunch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXTeamMembersAddLaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = swiftArg.map { DBXTeamMemberAddResult.factory(swift: $0) } + return DBXTeamMembersAddLaunchComplete(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXTeamMembersAddLaunchAsyncJobId? { + self as? DBXTeamMembersAddLaunchAsyncJobId + } + + @objc + public var asComplete: DBXTeamMembersAddLaunchComplete? { + self as? DBXTeamMembersAddLaunchComplete + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXTeamMembersAddLaunchAsyncJobId: DBXTeamMembersAddLaunch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Team.MembersAddLaunch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersAddLaunchComplete: DBXTeamMembersAddLaunch { + @objc + public var complete: [DBXTeamMemberAddResult] + + @objc + public init(_ arg: [DBXTeamMemberAddResult]) { + self.complete = arg + let swift = Team.MembersAddLaunch.complete(arg.map(\.swift)) + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersAddLaunchV2Result union +@objc +public class DBXTeamMembersAddLaunchV2Result: NSObject { + let swift: Team.MembersAddLaunchV2Result + + public init(swift: Team.MembersAddLaunchV2Result) { + self.swift = swift + } + + public static func factory(swift: Team.MembersAddLaunchV2Result) -> DBXTeamMembersAddLaunchV2Result { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXTeamMembersAddLaunchV2ResultAsyncJobId(arg) + case .complete(let swiftArg): + let arg = swiftArg.map { DBXTeamMemberAddV2Result.factory(swift: $0) } + return DBXTeamMembersAddLaunchV2ResultComplete(arg) + case .other: + return DBXTeamMembersAddLaunchV2ResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXTeamMembersAddLaunchV2ResultAsyncJobId? { + self as? DBXTeamMembersAddLaunchV2ResultAsyncJobId + } + + @objc + public var asComplete: DBXTeamMembersAddLaunchV2ResultComplete? { + self as? DBXTeamMembersAddLaunchV2ResultComplete + } + + @objc + public var asOther: DBXTeamMembersAddLaunchV2ResultOther? { + self as? DBXTeamMembersAddLaunchV2ResultOther + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXTeamMembersAddLaunchV2ResultAsyncJobId: DBXTeamMembersAddLaunchV2Result { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Team.MembersAddLaunchV2Result.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersAddLaunchV2ResultComplete: DBXTeamMembersAddLaunchV2Result { + @objc + public var complete: [DBXTeamMemberAddV2Result] + + @objc + public init(_ arg: [DBXTeamMemberAddV2Result]) { + self.complete = arg + let swift = Team.MembersAddLaunchV2Result.complete(arg.map(\.swift)) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersAddLaunchV2ResultOther: DBXTeamMembersAddLaunchV2Result { + @objc + public init() { + let swift = Team.MembersAddLaunchV2Result.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersAddV2Arg struct +@objc +public class DBXTeamMembersAddV2Arg: DBXTeamMembersAddArgBase { + /// Details of new members to be added to the team. + @objc + public var newMembers: [DBXTeamMemberAddV2Arg] { subSwift.newMembers.map { DBXTeamMemberAddV2Arg(swift: $0) } } + + @objc + public init(newMembers: [DBXTeamMemberAddV2Arg], forceAsync: NSNumber) { + let swift = Team.MembersAddV2Arg(newMembers: newMembers.map(\.subSwift), forceAsync: forceAsync.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.MembersAddV2Arg + + public init(swift: Team.MembersAddV2Arg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. +@objc +public class DBXTeamMembersDeactivateBaseArg: NSObject { + /// Identity of user to remove/suspend/have their files moved. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + + @objc + public init(user: DBXTeamUserSelectorArg) { + self.swift = Team.MembersDeactivateBaseArg(user: user.swift) + } + + let swift: Team.MembersDeactivateBaseArg + + public init(swift: Team.MembersDeactivateBaseArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersDataTransferArg struct +@objc +public class DBXTeamMembersDataTransferArg: DBXTeamMembersDeactivateBaseArg { + /// Files from the deleted member account will be transferred to this user. + @objc + public var transferDestId: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: subSwift.transferDestId) } + /// Errors during the transfer process will be sent via email to this user. + @objc + public var transferAdminId: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: subSwift.transferAdminId) } + + @objc + public init(user: DBXTeamUserSelectorArg, transferDestId: DBXTeamUserSelectorArg, transferAdminId: DBXTeamUserSelectorArg) { + let swift = Team.MembersDataTransferArg(user: user.swift, transferDestId: transferDestId.swift, transferAdminId: transferAdminId.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.MembersDataTransferArg + + public init(swift: Team.MembersDataTransferArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible MembersDeactivateArg struct +@objc +public class DBXTeamMembersDeactivateArg: DBXTeamMembersDeactivateBaseArg { + /// If provided, controls if the user's data will be deleted on their linked devices. + @objc + public var wipeData: NSNumber { subSwift.wipeData as NSNumber } + + @objc + public init(user: DBXTeamUserSelectorArg, wipeData: NSNumber) { + let swift = Team.MembersDeactivateArg(user: user.swift, wipeData: wipeData.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.MembersDeactivateArg + + public init(swift: Team.MembersDeactivateArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible MembersDeactivateError union +@objc +public class DBXTeamMembersDeactivateError: NSObject { + let swift: Team.MembersDeactivateError + + public init(swift: Team.MembersDeactivateError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersDeactivateError) -> DBXTeamMembersDeactivateError { + switch swift { + case .userNotFound: + return DBXTeamMembersDeactivateErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersDeactivateErrorUserNotInTeam() + case .other: + return DBXTeamMembersDeactivateErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersDeactivateErrorUserNotFound? { + self as? DBXTeamMembersDeactivateErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersDeactivateErrorUserNotInTeam? { + self as? DBXTeamMembersDeactivateErrorUserNotInTeam + } + + @objc + public var asOther: DBXTeamMembersDeactivateErrorOther? { + self as? DBXTeamMembersDeactivateErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersDeactivateErrorUserNotFound: DBXTeamMembersDeactivateError { + @objc + public init() { + let swift = Team.MembersDeactivateError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersDeactivateErrorUserNotInTeam: DBXTeamMembersDeactivateError { + @objc + public init() { + let swift = Team.MembersDeactivateError.userNotInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersDeactivateErrorOther: DBXTeamMembersDeactivateError { + @objc + public init() { + let swift = Team.MembersDeactivateError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersDeleteProfilePhotoArg struct +@objc +public class DBXTeamMembersDeleteProfilePhotoArg: NSObject { + /// Identity of the user whose profile photo will be deleted. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + + @objc + public init(user: DBXTeamUserSelectorArg) { + self.swift = Team.MembersDeleteProfilePhotoArg(user: user.swift) + } + + let swift: Team.MembersDeleteProfilePhotoArg + + public init(swift: Team.MembersDeleteProfilePhotoArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersDeleteProfilePhotoError union +@objc +public class DBXTeamMembersDeleteProfilePhotoError: NSObject { + let swift: Team.MembersDeleteProfilePhotoError + + public init(swift: Team.MembersDeleteProfilePhotoError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersDeleteProfilePhotoError) -> DBXTeamMembersDeleteProfilePhotoError { + switch swift { + case .userNotFound: + return DBXTeamMembersDeleteProfilePhotoErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersDeleteProfilePhotoErrorUserNotInTeam() + case .setProfileDisallowed: + return DBXTeamMembersDeleteProfilePhotoErrorSetProfileDisallowed() + case .other: + return DBXTeamMembersDeleteProfilePhotoErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersDeleteProfilePhotoErrorUserNotFound? { + self as? DBXTeamMembersDeleteProfilePhotoErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersDeleteProfilePhotoErrorUserNotInTeam? { + self as? DBXTeamMembersDeleteProfilePhotoErrorUserNotInTeam + } + + @objc + public var asSetProfileDisallowed: DBXTeamMembersDeleteProfilePhotoErrorSetProfileDisallowed? { + self as? DBXTeamMembersDeleteProfilePhotoErrorSetProfileDisallowed + } + + @objc + public var asOther: DBXTeamMembersDeleteProfilePhotoErrorOther? { + self as? DBXTeamMembersDeleteProfilePhotoErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersDeleteProfilePhotoErrorUserNotFound: DBXTeamMembersDeleteProfilePhotoError { + @objc + public init() { + let swift = Team.MembersDeleteProfilePhotoError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersDeleteProfilePhotoErrorUserNotInTeam: DBXTeamMembersDeleteProfilePhotoError { + @objc + public init() { + let swift = Team.MembersDeleteProfilePhotoError.userNotInTeam + super.init(swift: swift) + } +} + +/// Modifying deleted users is not allowed. +@objc +public class DBXTeamMembersDeleteProfilePhotoErrorSetProfileDisallowed: DBXTeamMembersDeleteProfilePhotoError { + @objc + public init() { + let swift = Team.MembersDeleteProfilePhotoError.setProfileDisallowed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersDeleteProfilePhotoErrorOther: DBXTeamMembersDeleteProfilePhotoError { + @objc + public init() { + let swift = Team.MembersDeleteProfilePhotoError.other + super.init(swift: swift) + } +} + +/// Available TeamMemberRole for the connected team. To be used with membersSetAdminPermissionsV2. +@objc +public class DBXTeamMembersGetAvailableTeamMemberRolesResult: NSObject { + /// Available roles. + @objc + public var roles: [DBXTeamTeamMemberRole] { swift.roles.map { DBXTeamTeamMemberRole(swift: $0) } } + + @objc + public init(roles: [DBXTeamTeamMemberRole]) { + self.swift = Team.MembersGetAvailableTeamMemberRolesResult(roles: roles.map(\.swift)) + } + + let swift: Team.MembersGetAvailableTeamMemberRolesResult + + public init(swift: Team.MembersGetAvailableTeamMemberRolesResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersGetInfoArgs struct +@objc +public class DBXTeamMembersGetInfoArgs: NSObject { + /// List of team members. + @objc + public var members: [DBXTeamUserSelectorArg] { swift.members.map { DBXTeamUserSelectorArg(swift: $0) } } + + @objc + public init(members: [DBXTeamUserSelectorArg]) { + self.swift = Team.MembersGetInfoArgs(members: members.map(\.swift)) + } + + let swift: Team.MembersGetInfoArgs + + public init(swift: Team.MembersGetInfoArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersGetInfoError union +@objc +public class DBXTeamMembersGetInfoError: NSObject { + let swift: Team.MembersGetInfoError + + public init(swift: Team.MembersGetInfoError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersGetInfoError) -> DBXTeamMembersGetInfoError { + switch swift { + case .other: + return DBXTeamMembersGetInfoErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOther: DBXTeamMembersGetInfoErrorOther? { + self as? DBXTeamMembersGetInfoErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersGetInfoErrorOther: DBXTeamMembersGetInfoError { + @objc + public init() { + let swift = Team.MembersGetInfoError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersGetInfoItemBase union +@objc +public class DBXTeamMembersGetInfoItemBase: NSObject { + let swift: Team.MembersGetInfoItemBase + + public init(swift: Team.MembersGetInfoItemBase) { + self.swift = swift + } + + public static func factory(swift: Team.MembersGetInfoItemBase) -> DBXTeamMembersGetInfoItemBase { + switch swift { + case .idNotFound(let swiftArg): + let arg = swiftArg + return DBXTeamMembersGetInfoItemBaseIdNotFound(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIdNotFound: DBXTeamMembersGetInfoItemBaseIdNotFound? { + self as? DBXTeamMembersGetInfoItemBaseIdNotFound + } +} + +/// An ID that was provided as a parameter to membersGetInfo or membersGetInfoV2, and did not match a +/// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how +/// the method was called. +@objc +public class DBXTeamMembersGetInfoItemBaseIdNotFound: DBXTeamMembersGetInfoItemBase { + @objc + public var idNotFound: String + + @objc + public init(_ arg: String) { + self.idNotFound = arg + let swift = Team.MembersGetInfoItemBase.idNotFound(arg) + super.init(swift: swift) + } +} + +/// Describes a result obtained for a single user whose id was specified in the parameter of membersGetInfo. +@objc +public class DBXTeamMembersGetInfoItem: NSObject { + let swift: Team.MembersGetInfoItem + + public init(swift: Team.MembersGetInfoItem) { + self.swift = swift + } + + public static func factory(swift: Team.MembersGetInfoItem) -> DBXTeamMembersGetInfoItem { + switch swift { + case .idNotFound(let swiftArg): + let arg = swiftArg + return DBXTeamMembersGetInfoItemIdNotFound(arg) + case .memberInfo(let swiftArg): + let arg = DBXTeamTeamMemberInfo(swift: swiftArg) + return DBXTeamMembersGetInfoItemMemberInfo(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIdNotFound: DBXTeamMembersGetInfoItemIdNotFound? { + self as? DBXTeamMembersGetInfoItemIdNotFound + } + + @objc + public var asMemberInfo: DBXTeamMembersGetInfoItemMemberInfo? { + self as? DBXTeamMembersGetInfoItemMemberInfo + } +} + +/// An ID that was provided as a parameter to membersGetInfo or membersGetInfoV2, and did not match a +/// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how +/// the method was called. +@objc +public class DBXTeamMembersGetInfoItemIdNotFound: DBXTeamMembersGetInfoItem { + @objc + public var idNotFound: String + + @objc + public init(_ arg: String) { + self.idNotFound = arg + let swift = Team.MembersGetInfoItem.idNotFound(arg) + super.init(swift: swift) + } +} + +/// Info about a team member. +@objc +public class DBXTeamMembersGetInfoItemMemberInfo: DBXTeamMembersGetInfoItem { + @objc + public var memberInfo: DBXTeamTeamMemberInfo + + @objc + public init(_ arg: DBXTeamTeamMemberInfo) { + self.memberInfo = arg + let swift = Team.MembersGetInfoItem.memberInfo(arg.swift) + super.init(swift: swift) + } +} + +/// Describes a result obtained for a single user whose id was specified in the parameter of membersGetInfoV2. +@objc +public class DBXTeamMembersGetInfoItemV2: NSObject { + let swift: Team.MembersGetInfoItemV2 + + public init(swift: Team.MembersGetInfoItemV2) { + self.swift = swift + } + + public static func factory(swift: Team.MembersGetInfoItemV2) -> DBXTeamMembersGetInfoItemV2 { + switch swift { + case .idNotFound(let swiftArg): + let arg = swiftArg + return DBXTeamMembersGetInfoItemV2IdNotFound(arg) + case .memberInfo(let swiftArg): + let arg = DBXTeamTeamMemberInfoV2(swift: swiftArg) + return DBXTeamMembersGetInfoItemV2MemberInfo(arg) + case .other: + return DBXTeamMembersGetInfoItemV2Other() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIdNotFound: DBXTeamMembersGetInfoItemV2IdNotFound? { + self as? DBXTeamMembersGetInfoItemV2IdNotFound + } + + @objc + public var asMemberInfo: DBXTeamMembersGetInfoItemV2MemberInfo? { + self as? DBXTeamMembersGetInfoItemV2MemberInfo + } + + @objc + public var asOther: DBXTeamMembersGetInfoItemV2Other? { + self as? DBXTeamMembersGetInfoItemV2Other + } +} + +/// An ID that was provided as a parameter to membersGetInfo or membersGetInfoV2, and did not match a +/// corresponding user. This might be a team_member_id, an email, or an external ID, depending on how +/// the method was called. +@objc +public class DBXTeamMembersGetInfoItemV2IdNotFound: DBXTeamMembersGetInfoItemV2 { + @objc + public var idNotFound: String + + @objc + public init(_ arg: String) { + self.idNotFound = arg + let swift = Team.MembersGetInfoItemV2.idNotFound(arg) + super.init(swift: swift) + } +} + +/// Info about a team member. +@objc +public class DBXTeamMembersGetInfoItemV2MemberInfo: DBXTeamMembersGetInfoItemV2 { + @objc + public var memberInfo: DBXTeamTeamMemberInfoV2 + + @objc + public init(_ arg: DBXTeamTeamMemberInfoV2) { + self.memberInfo = arg + let swift = Team.MembersGetInfoItemV2.memberInfo(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersGetInfoItemV2Other: DBXTeamMembersGetInfoItemV2 { + @objc + public init() { + let swift = Team.MembersGetInfoItemV2.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersGetInfoV2Arg struct +@objc +public class DBXTeamMembersGetInfoV2Arg: NSObject { + /// List of team members. + @objc + public var members: [DBXTeamUserSelectorArg] { swift.members.map { DBXTeamUserSelectorArg(swift: $0) } } + + @objc + public init(members: [DBXTeamUserSelectorArg]) { + self.swift = Team.MembersGetInfoV2Arg(members: members.map(\.swift)) + } + + let swift: Team.MembersGetInfoV2Arg + + public init(swift: Team.MembersGetInfoV2Arg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersGetInfoV2Result struct +@objc +public class DBXTeamMembersGetInfoV2Result: NSObject { + /// List of team members info. + @objc + public var membersInfo: [DBXTeamMembersGetInfoItemV2] { swift.membersInfo.map { DBXTeamMembersGetInfoItemV2(swift: $0) } } + + @objc + public init(membersInfo: [DBXTeamMembersGetInfoItemV2]) { + self.swift = Team.MembersGetInfoV2Result(membersInfo: membersInfo.map(\.swift)) + } + + let swift: Team.MembersGetInfoV2Result + + public init(swift: Team.MembersGetInfoV2Result) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersInfo struct +@objc +public class DBXTeamMembersInfo: NSObject { + /// Team member IDs of the users under this hold. + @objc + public var teamMemberIds: [String] { swift.teamMemberIds } + /// The number of permanently deleted users that were under this hold. + @objc + public var permanentlyDeletedUsers: NSNumber { swift.permanentlyDeletedUsers as NSNumber } + + @objc + public init(teamMemberIds: [String], permanentlyDeletedUsers: NSNumber) { + self.swift = Team.MembersInfo(teamMemberIds: teamMemberIds, permanentlyDeletedUsers: permanentlyDeletedUsers.uint64Value) + } + + let swift: Team.MembersInfo + + public init(swift: Team.MembersInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersListArg struct +@objc +public class DBXTeamMembersListArg: NSObject { + /// Number of results to return per call. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + /// Whether to return removed members. + @objc + public var includeRemoved: NSNumber { swift.includeRemoved as NSNumber } + + @objc + public init(limit: NSNumber, includeRemoved: NSNumber) { + self.swift = Team.MembersListArg(limit: limit.uint32Value, includeRemoved: includeRemoved.boolValue) + } + + let swift: Team.MembersListArg + + public init(swift: Team.MembersListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersListContinueArg struct +@objc +public class DBXTeamMembersListContinueArg: NSObject { + /// Indicates from what point to get the next set of members. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Team.MembersListContinueArg(cursor: cursor) + } + + let swift: Team.MembersListContinueArg + + public init(swift: Team.MembersListContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersListContinueError union +@objc +public class DBXTeamMembersListContinueError: NSObject { + let swift: Team.MembersListContinueError + + public init(swift: Team.MembersListContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersListContinueError) -> DBXTeamMembersListContinueError { + switch swift { + case .invalidCursor: + return DBXTeamMembersListContinueErrorInvalidCursor() + case .other: + return DBXTeamMembersListContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidCursor: DBXTeamMembersListContinueErrorInvalidCursor? { + self as? DBXTeamMembersListContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXTeamMembersListContinueErrorOther? { + self as? DBXTeamMembersListContinueErrorOther + } +} + +/// The cursor is invalid. +@objc +public class DBXTeamMembersListContinueErrorInvalidCursor: DBXTeamMembersListContinueError { + @objc + public init() { + let swift = Team.MembersListContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersListContinueErrorOther: DBXTeamMembersListContinueError { + @objc + public init() { + let swift = Team.MembersListContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersListError union +@objc +public class DBXTeamMembersListError: NSObject { + let swift: Team.MembersListError + + public init(swift: Team.MembersListError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersListError) -> DBXTeamMembersListError { + switch swift { + case .other: + return DBXTeamMembersListErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOther: DBXTeamMembersListErrorOther? { + self as? DBXTeamMembersListErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersListErrorOther: DBXTeamMembersListError { + @objc + public init() { + let swift = Team.MembersListError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersListResult struct +@objc +public class DBXTeamMembersListResult: NSObject { + /// List of team members. + @objc + public var members: [DBXTeamTeamMemberInfo] { swift.members.map { DBXTeamTeamMemberInfo(swift: $0) } } + /// Pass the cursor into membersListContinue to obtain the additional members. + @objc + public var cursor: String { swift.cursor } + /// Is true if there are additional team members that have not been returned yet. An additional call to + /// membersListContinue can retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(members: [DBXTeamTeamMemberInfo], cursor: String, hasMore: NSNumber) { + self.swift = Team.MembersListResult(members: members.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Team.MembersListResult + + public init(swift: Team.MembersListResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersListV2Result struct +@objc +public class DBXTeamMembersListV2Result: NSObject { + /// List of team members. + @objc + public var members: [DBXTeamTeamMemberInfoV2] { swift.members.map { DBXTeamTeamMemberInfoV2(swift: $0) } } + /// Pass the cursor into membersListContinueV2 to obtain the additional members. + @objc + public var cursor: String { swift.cursor } + /// Is true if there are additional team members that have not been returned yet. An additional call to + /// membersListContinueV2 can retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(members: [DBXTeamTeamMemberInfoV2], cursor: String, hasMore: NSNumber) { + self.swift = Team.MembersListV2Result(members: members.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Team.MembersListV2Result + + public init(swift: Team.MembersListV2Result) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. +@objc +public class DBXTeamMembersRecoverArg: NSObject { + /// Identity of user to recover. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + + @objc + public init(user: DBXTeamUserSelectorArg) { + self.swift = Team.MembersRecoverArg(user: user.swift) + } + + let swift: Team.MembersRecoverArg + + public init(swift: Team.MembersRecoverArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersRecoverError union +@objc +public class DBXTeamMembersRecoverError: NSObject { + let swift: Team.MembersRecoverError + + public init(swift: Team.MembersRecoverError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersRecoverError) -> DBXTeamMembersRecoverError { + switch swift { + case .userNotFound: + return DBXTeamMembersRecoverErrorUserNotFound() + case .userUnrecoverable: + return DBXTeamMembersRecoverErrorUserUnrecoverable() + case .userNotInTeam: + return DBXTeamMembersRecoverErrorUserNotInTeam() + case .teamLicenseLimit: + return DBXTeamMembersRecoverErrorTeamLicenseLimit() + case .other: + return DBXTeamMembersRecoverErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersRecoverErrorUserNotFound? { + self as? DBXTeamMembersRecoverErrorUserNotFound + } + + @objc + public var asUserUnrecoverable: DBXTeamMembersRecoverErrorUserUnrecoverable? { + self as? DBXTeamMembersRecoverErrorUserUnrecoverable + } + + @objc + public var asUserNotInTeam: DBXTeamMembersRecoverErrorUserNotInTeam? { + self as? DBXTeamMembersRecoverErrorUserNotInTeam + } + + @objc + public var asTeamLicenseLimit: DBXTeamMembersRecoverErrorTeamLicenseLimit? { + self as? DBXTeamMembersRecoverErrorTeamLicenseLimit + } + + @objc + public var asOther: DBXTeamMembersRecoverErrorOther? { + self as? DBXTeamMembersRecoverErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersRecoverErrorUserNotFound: DBXTeamMembersRecoverError { + @objc + public init() { + let swift = Team.MembersRecoverError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not recoverable. +@objc +public class DBXTeamMembersRecoverErrorUserUnrecoverable: DBXTeamMembersRecoverError { + @objc + public init() { + let swift = Team.MembersRecoverError.userUnrecoverable + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersRecoverErrorUserNotInTeam: DBXTeamMembersRecoverError { + @objc + public init() { + let swift = Team.MembersRecoverError.userNotInTeam + super.init(swift: swift) + } +} + +/// Team is full. The organization has no available licenses. +@objc +public class DBXTeamMembersRecoverErrorTeamLicenseLimit: DBXTeamMembersRecoverError { + @objc + public init() { + let swift = Team.MembersRecoverError.teamLicenseLimit + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersRecoverErrorOther: DBXTeamMembersRecoverError { + @objc + public init() { + let swift = Team.MembersRecoverError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersRemoveArg struct +@objc +public class DBXTeamMembersRemoveArg: DBXTeamMembersDeactivateArg { + /// If provided, files from the deleted member account will be transferred to this user. + @objc + public var transferDestId: DBXTeamUserSelectorArg? { guard let swift = subSubSwift.transferDestId else { return nil } + return DBXTeamUserSelectorArg(swift: swift) + } + + /// If provided, errors during the transfer process will be sent via email to this user. If the transfer_dest_id + /// argument was provided, then this argument must be provided as well. + @objc + public var transferAdminId: DBXTeamUserSelectorArg? { guard let swift = subSubSwift.transferAdminId else { return nil } + return DBXTeamUserSelectorArg(swift: swift) + } + + /// Downgrade the member to a Basic account. The user will retain the email address associated with their + /// Dropbox account and data in their account that is not restricted to team members. In order to keep the + /// account the argument wipeData should be set to false. + @objc + public var keepAccount: NSNumber { subSubSwift.keepAccount as NSNumber } + /// If provided, allows removed users to keep access to Dropbox folders (not Dropbox Paper folders) already + /// explicitly shared with them (not via a group) when they are downgraded to a Basic account. Users will + /// not retain access to folders that do not allow external sharing. In order to keep the sharing + /// relationships, the arguments wipeData should be set to false and keepAccount should be set to true. + @objc + public var retainTeamShares: NSNumber { subSubSwift.retainTeamShares as NSNumber } + + @objc + public init( + user: DBXTeamUserSelectorArg, + wipeData: NSNumber, + transferDestId: DBXTeamUserSelectorArg?, + transferAdminId: DBXTeamUserSelectorArg?, + keepAccount: NSNumber, + retainTeamShares: NSNumber + ) { + let swift = Team.MembersRemoveArg( + user: user.swift, + wipeData: wipeData.boolValue, + transferDestId: transferDestId?.swift, + transferAdminId: transferAdminId?.swift, + keepAccount: keepAccount.boolValue, + retainTeamShares: retainTeamShares.boolValue + ) + self.subSubSwift = swift + super.init(swift: swift) + } + + let subSubSwift: Team.MembersRemoveArg + + public init(swift: Team.MembersRemoveArg) { + self.subSubSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible MembersTransferFilesError union +@objc +public class DBXTeamMembersTransferFilesError: NSObject { + let swift: Team.MembersTransferFilesError + + public init(swift: Team.MembersTransferFilesError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersTransferFilesError) -> DBXTeamMembersTransferFilesError { + switch swift { + case .userNotFound: + return DBXTeamMembersTransferFilesErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersTransferFilesErrorUserNotInTeam() + case .other: + return DBXTeamMembersTransferFilesErrorOther() + case .removedAndTransferDestShouldDiffer: + return DBXTeamMembersTransferFilesErrorRemovedAndTransferDestShouldDiffer() + case .removedAndTransferAdminShouldDiffer: + return DBXTeamMembersTransferFilesErrorRemovedAndTransferAdminShouldDiffer() + case .transferDestUserNotFound: + return DBXTeamMembersTransferFilesErrorTransferDestUserNotFound() + case .transferDestUserNotInTeam: + return DBXTeamMembersTransferFilesErrorTransferDestUserNotInTeam() + case .transferAdminUserNotInTeam: + return DBXTeamMembersTransferFilesErrorTransferAdminUserNotInTeam() + case .transferAdminUserNotFound: + return DBXTeamMembersTransferFilesErrorTransferAdminUserNotFound() + case .unspecifiedTransferAdminId: + return DBXTeamMembersTransferFilesErrorUnspecifiedTransferAdminId() + case .transferAdminIsNotAdmin: + return DBXTeamMembersTransferFilesErrorTransferAdminIsNotAdmin() + case .recipientNotVerified: + return DBXTeamMembersTransferFilesErrorRecipientNotVerified() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersTransferFilesErrorUserNotFound? { + self as? DBXTeamMembersTransferFilesErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersTransferFilesErrorUserNotInTeam? { + self as? DBXTeamMembersTransferFilesErrorUserNotInTeam + } + + @objc + public var asOther: DBXTeamMembersTransferFilesErrorOther? { + self as? DBXTeamMembersTransferFilesErrorOther + } + + @objc + public var asRemovedAndTransferDestShouldDiffer: DBXTeamMembersTransferFilesErrorRemovedAndTransferDestShouldDiffer? { + self as? DBXTeamMembersTransferFilesErrorRemovedAndTransferDestShouldDiffer + } + + @objc + public var asRemovedAndTransferAdminShouldDiffer: DBXTeamMembersTransferFilesErrorRemovedAndTransferAdminShouldDiffer? { + self as? DBXTeamMembersTransferFilesErrorRemovedAndTransferAdminShouldDiffer + } + + @objc + public var asTransferDestUserNotFound: DBXTeamMembersTransferFilesErrorTransferDestUserNotFound? { + self as? DBXTeamMembersTransferFilesErrorTransferDestUserNotFound + } + + @objc + public var asTransferDestUserNotInTeam: DBXTeamMembersTransferFilesErrorTransferDestUserNotInTeam? { + self as? DBXTeamMembersTransferFilesErrorTransferDestUserNotInTeam + } + + @objc + public var asTransferAdminUserNotInTeam: DBXTeamMembersTransferFilesErrorTransferAdminUserNotInTeam? { + self as? DBXTeamMembersTransferFilesErrorTransferAdminUserNotInTeam + } + + @objc + public var asTransferAdminUserNotFound: DBXTeamMembersTransferFilesErrorTransferAdminUserNotFound? { + self as? DBXTeamMembersTransferFilesErrorTransferAdminUserNotFound + } + + @objc + public var asUnspecifiedTransferAdminId: DBXTeamMembersTransferFilesErrorUnspecifiedTransferAdminId? { + self as? DBXTeamMembersTransferFilesErrorUnspecifiedTransferAdminId + } + + @objc + public var asTransferAdminIsNotAdmin: DBXTeamMembersTransferFilesErrorTransferAdminIsNotAdmin? { + self as? DBXTeamMembersTransferFilesErrorTransferAdminIsNotAdmin + } + + @objc + public var asRecipientNotVerified: DBXTeamMembersTransferFilesErrorRecipientNotVerified? { + self as? DBXTeamMembersTransferFilesErrorRecipientNotVerified + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersTransferFilesErrorUserNotFound: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersTransferFilesErrorUserNotInTeam: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.userNotInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersTransferFilesErrorOther: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.other + super.init(swift: swift) + } +} + +/// Expected removed user and transfer_dest user to be different. +@objc +public class DBXTeamMembersTransferFilesErrorRemovedAndTransferDestShouldDiffer: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.removedAndTransferDestShouldDiffer + super.init(swift: swift) + } +} + +/// Expected removed user and transfer_admin user to be different. +@objc +public class DBXTeamMembersTransferFilesErrorRemovedAndTransferAdminShouldDiffer: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.removedAndTransferAdminShouldDiffer + super.init(swift: swift) + } +} + +/// No matching user found for the argument transfer_dest_id. +@objc +public class DBXTeamMembersTransferFilesErrorTransferDestUserNotFound: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.transferDestUserNotFound + super.init(swift: swift) + } +} + +/// The provided transfer_dest_id does not exist on this team. +@objc +public class DBXTeamMembersTransferFilesErrorTransferDestUserNotInTeam: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.transferDestUserNotInTeam + super.init(swift: swift) + } +} + +/// The provided transfer_admin_id does not exist on this team. +@objc +public class DBXTeamMembersTransferFilesErrorTransferAdminUserNotInTeam: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.transferAdminUserNotInTeam + super.init(swift: swift) + } +} + +/// No matching user found for the argument transfer_admin_id. +@objc +public class DBXTeamMembersTransferFilesErrorTransferAdminUserNotFound: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.transferAdminUserNotFound + super.init(swift: swift) + } +} + +/// The transfer_admin_id argument must be provided when file transfer is requested. +@objc +public class DBXTeamMembersTransferFilesErrorUnspecifiedTransferAdminId: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.unspecifiedTransferAdminId + super.init(swift: swift) + } +} + +/// Specified transfer_admin user is not a team admin. +@objc +public class DBXTeamMembersTransferFilesErrorTransferAdminIsNotAdmin: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.transferAdminIsNotAdmin + super.init(swift: swift) + } +} + +/// The recipient user's email is not verified. +@objc +public class DBXTeamMembersTransferFilesErrorRecipientNotVerified: DBXTeamMembersTransferFilesError { + @objc + public init() { + let swift = Team.MembersTransferFilesError.recipientNotVerified + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersRemoveError union +@objc +public class DBXTeamMembersRemoveError: NSObject { + let swift: Team.MembersRemoveError + + public init(swift: Team.MembersRemoveError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersRemoveError) -> DBXTeamMembersRemoveError { + switch swift { + case .userNotFound: + return DBXTeamMembersRemoveErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersRemoveErrorUserNotInTeam() + case .other: + return DBXTeamMembersRemoveErrorOther() + case .removedAndTransferDestShouldDiffer: + return DBXTeamMembersRemoveErrorRemovedAndTransferDestShouldDiffer() + case .removedAndTransferAdminShouldDiffer: + return DBXTeamMembersRemoveErrorRemovedAndTransferAdminShouldDiffer() + case .transferDestUserNotFound: + return DBXTeamMembersRemoveErrorTransferDestUserNotFound() + case .transferDestUserNotInTeam: + return DBXTeamMembersRemoveErrorTransferDestUserNotInTeam() + case .transferAdminUserNotInTeam: + return DBXTeamMembersRemoveErrorTransferAdminUserNotInTeam() + case .transferAdminUserNotFound: + return DBXTeamMembersRemoveErrorTransferAdminUserNotFound() + case .unspecifiedTransferAdminId: + return DBXTeamMembersRemoveErrorUnspecifiedTransferAdminId() + case .transferAdminIsNotAdmin: + return DBXTeamMembersRemoveErrorTransferAdminIsNotAdmin() + case .recipientNotVerified: + return DBXTeamMembersRemoveErrorRecipientNotVerified() + case .removeLastAdmin: + return DBXTeamMembersRemoveErrorRemoveLastAdmin() + case .cannotKeepAccountAndTransfer: + return DBXTeamMembersRemoveErrorCannotKeepAccountAndTransfer() + case .cannotKeepAccountAndDeleteData: + return DBXTeamMembersRemoveErrorCannotKeepAccountAndDeleteData() + case .emailAddressTooLongToBeDisabled: + return DBXTeamMembersRemoveErrorEmailAddressTooLongToBeDisabled() + case .cannotKeepInvitedUserAccount: + return DBXTeamMembersRemoveErrorCannotKeepInvitedUserAccount() + case .cannotRetainSharesWhenDataWiped: + return DBXTeamMembersRemoveErrorCannotRetainSharesWhenDataWiped() + case .cannotRetainSharesWhenNoAccountKept: + return DBXTeamMembersRemoveErrorCannotRetainSharesWhenNoAccountKept() + case .cannotRetainSharesWhenTeamExternalSharingOff: + return DBXTeamMembersRemoveErrorCannotRetainSharesWhenTeamExternalSharingOff() + case .cannotKeepAccount: + return DBXTeamMembersRemoveErrorCannotKeepAccount() + case .cannotKeepAccountUnderLegalHold: + return DBXTeamMembersRemoveErrorCannotKeepAccountUnderLegalHold() + case .cannotKeepAccountRequiredToSignTos: + return DBXTeamMembersRemoveErrorCannotKeepAccountRequiredToSignTos() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersRemoveErrorUserNotFound? { + self as? DBXTeamMembersRemoveErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersRemoveErrorUserNotInTeam? { + self as? DBXTeamMembersRemoveErrorUserNotInTeam + } + + @objc + public var asOther: DBXTeamMembersRemoveErrorOther? { + self as? DBXTeamMembersRemoveErrorOther + } + + @objc + public var asRemovedAndTransferDestShouldDiffer: DBXTeamMembersRemoveErrorRemovedAndTransferDestShouldDiffer? { + self as? DBXTeamMembersRemoveErrorRemovedAndTransferDestShouldDiffer + } + + @objc + public var asRemovedAndTransferAdminShouldDiffer: DBXTeamMembersRemoveErrorRemovedAndTransferAdminShouldDiffer? { + self as? DBXTeamMembersRemoveErrorRemovedAndTransferAdminShouldDiffer + } + + @objc + public var asTransferDestUserNotFound: DBXTeamMembersRemoveErrorTransferDestUserNotFound? { + self as? DBXTeamMembersRemoveErrorTransferDestUserNotFound + } + + @objc + public var asTransferDestUserNotInTeam: DBXTeamMembersRemoveErrorTransferDestUserNotInTeam? { + self as? DBXTeamMembersRemoveErrorTransferDestUserNotInTeam + } + + @objc + public var asTransferAdminUserNotInTeam: DBXTeamMembersRemoveErrorTransferAdminUserNotInTeam? { + self as? DBXTeamMembersRemoveErrorTransferAdminUserNotInTeam + } + + @objc + public var asTransferAdminUserNotFound: DBXTeamMembersRemoveErrorTransferAdminUserNotFound? { + self as? DBXTeamMembersRemoveErrorTransferAdminUserNotFound + } + + @objc + public var asUnspecifiedTransferAdminId: DBXTeamMembersRemoveErrorUnspecifiedTransferAdminId? { + self as? DBXTeamMembersRemoveErrorUnspecifiedTransferAdminId + } + + @objc + public var asTransferAdminIsNotAdmin: DBXTeamMembersRemoveErrorTransferAdminIsNotAdmin? { + self as? DBXTeamMembersRemoveErrorTransferAdminIsNotAdmin + } + + @objc + public var asRecipientNotVerified: DBXTeamMembersRemoveErrorRecipientNotVerified? { + self as? DBXTeamMembersRemoveErrorRecipientNotVerified + } + + @objc + public var asRemoveLastAdmin: DBXTeamMembersRemoveErrorRemoveLastAdmin? { + self as? DBXTeamMembersRemoveErrorRemoveLastAdmin + } + + @objc + public var asCannotKeepAccountAndTransfer: DBXTeamMembersRemoveErrorCannotKeepAccountAndTransfer? { + self as? DBXTeamMembersRemoveErrorCannotKeepAccountAndTransfer + } + + @objc + public var asCannotKeepAccountAndDeleteData: DBXTeamMembersRemoveErrorCannotKeepAccountAndDeleteData? { + self as? DBXTeamMembersRemoveErrorCannotKeepAccountAndDeleteData + } + + @objc + public var asEmailAddressTooLongToBeDisabled: DBXTeamMembersRemoveErrorEmailAddressTooLongToBeDisabled? { + self as? DBXTeamMembersRemoveErrorEmailAddressTooLongToBeDisabled + } + + @objc + public var asCannotKeepInvitedUserAccount: DBXTeamMembersRemoveErrorCannotKeepInvitedUserAccount? { + self as? DBXTeamMembersRemoveErrorCannotKeepInvitedUserAccount + } + + @objc + public var asCannotRetainSharesWhenDataWiped: DBXTeamMembersRemoveErrorCannotRetainSharesWhenDataWiped? { + self as? DBXTeamMembersRemoveErrorCannotRetainSharesWhenDataWiped + } + + @objc + public var asCannotRetainSharesWhenNoAccountKept: DBXTeamMembersRemoveErrorCannotRetainSharesWhenNoAccountKept? { + self as? DBXTeamMembersRemoveErrorCannotRetainSharesWhenNoAccountKept + } + + @objc + public var asCannotRetainSharesWhenTeamExternalSharingOff: DBXTeamMembersRemoveErrorCannotRetainSharesWhenTeamExternalSharingOff? { + self as? DBXTeamMembersRemoveErrorCannotRetainSharesWhenTeamExternalSharingOff + } + + @objc + public var asCannotKeepAccount: DBXTeamMembersRemoveErrorCannotKeepAccount? { + self as? DBXTeamMembersRemoveErrorCannotKeepAccount + } + + @objc + public var asCannotKeepAccountUnderLegalHold: DBXTeamMembersRemoveErrorCannotKeepAccountUnderLegalHold? { + self as? DBXTeamMembersRemoveErrorCannotKeepAccountUnderLegalHold + } + + @objc + public var asCannotKeepAccountRequiredToSignTos: DBXTeamMembersRemoveErrorCannotKeepAccountRequiredToSignTos? { + self as? DBXTeamMembersRemoveErrorCannotKeepAccountRequiredToSignTos + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersRemoveErrorUserNotFound: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersRemoveErrorUserNotInTeam: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.userNotInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersRemoveErrorOther: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.other + super.init(swift: swift) + } +} + +/// Expected removed user and transfer_dest user to be different. +@objc +public class DBXTeamMembersRemoveErrorRemovedAndTransferDestShouldDiffer: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.removedAndTransferDestShouldDiffer + super.init(swift: swift) + } +} + +/// Expected removed user and transfer_admin user to be different. +@objc +public class DBXTeamMembersRemoveErrorRemovedAndTransferAdminShouldDiffer: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.removedAndTransferAdminShouldDiffer + super.init(swift: swift) + } +} + +/// No matching user found for the argument transfer_dest_id. +@objc +public class DBXTeamMembersRemoveErrorTransferDestUserNotFound: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.transferDestUserNotFound + super.init(swift: swift) + } +} + +/// The provided transfer_dest_id does not exist on this team. +@objc +public class DBXTeamMembersRemoveErrorTransferDestUserNotInTeam: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.transferDestUserNotInTeam + super.init(swift: swift) + } +} + +/// The provided transfer_admin_id does not exist on this team. +@objc +public class DBXTeamMembersRemoveErrorTransferAdminUserNotInTeam: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.transferAdminUserNotInTeam + super.init(swift: swift) + } +} + +/// No matching user found for the argument transfer_admin_id. +@objc +public class DBXTeamMembersRemoveErrorTransferAdminUserNotFound: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.transferAdminUserNotFound + super.init(swift: swift) + } +} + +/// The transfer_admin_id argument must be provided when file transfer is requested. +@objc +public class DBXTeamMembersRemoveErrorUnspecifiedTransferAdminId: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.unspecifiedTransferAdminId + super.init(swift: swift) + } +} + +/// Specified transfer_admin user is not a team admin. +@objc +public class DBXTeamMembersRemoveErrorTransferAdminIsNotAdmin: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.transferAdminIsNotAdmin + super.init(swift: swift) + } +} + +/// The recipient user's email is not verified. +@objc +public class DBXTeamMembersRemoveErrorRecipientNotVerified: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.recipientNotVerified + super.init(swift: swift) + } +} + +/// The user is the last admin of the team, so it cannot be removed from it. +@objc +public class DBXTeamMembersRemoveErrorRemoveLastAdmin: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.removeLastAdmin + super.init(swift: swift) + } +} + +/// Cannot keep account and transfer the data to another user at the same time. +@objc +public class DBXTeamMembersRemoveErrorCannotKeepAccountAndTransfer: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotKeepAccountAndTransfer + super.init(swift: swift) + } +} + +/// Cannot keep account and delete the data at the same time. To keep the account the argument wipe_data should +/// be set to false. +@objc +public class DBXTeamMembersRemoveErrorCannotKeepAccountAndDeleteData: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotKeepAccountAndDeleteData + super.init(swift: swift) + } +} + +/// The email address of the user is too long to be disabled. +@objc +public class DBXTeamMembersRemoveErrorEmailAddressTooLongToBeDisabled: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.emailAddressTooLongToBeDisabled + super.init(swift: swift) + } +} + +/// Cannot keep account of an invited user. +@objc +public class DBXTeamMembersRemoveErrorCannotKeepInvitedUserAccount: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotKeepInvitedUserAccount + super.init(swift: swift) + } +} + +/// Cannot retain team shares when the user's data is marked for deletion on their linked devices. The argument +/// wipe_data should be set to false. +@objc +public class DBXTeamMembersRemoveErrorCannotRetainSharesWhenDataWiped: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotRetainSharesWhenDataWiped + super.init(swift: swift) + } +} + +/// The user's account must be kept in order to retain team shares. The argument keep_account should be set to +/// true. +@objc +public class DBXTeamMembersRemoveErrorCannotRetainSharesWhenNoAccountKept: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotRetainSharesWhenNoAccountKept + super.init(swift: swift) + } +} + +/// Externally sharing files, folders, and links must be enabled in team settings in order to retain team shares +/// for the user. +@objc +public class DBXTeamMembersRemoveErrorCannotRetainSharesWhenTeamExternalSharingOff: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotRetainSharesWhenTeamExternalSharingOff + super.init(swift: swift) + } +} + +/// Only a team admin, can convert this account to a Basic account. +@objc +public class DBXTeamMembersRemoveErrorCannotKeepAccount: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotKeepAccount + super.init(swift: swift) + } +} + +/// This user content is currently being held. To convert this member's account to a Basic account, you'll first +/// need to remove them from the hold. +@objc +public class DBXTeamMembersRemoveErrorCannotKeepAccountUnderLegalHold: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotKeepAccountUnderLegalHold + super.init(swift: swift) + } +} + +/// To convert this member to a Basic account, they'll first need to sign in to Dropbox and agree to the terms +/// of service. +@objc +public class DBXTeamMembersRemoveErrorCannotKeepAccountRequiredToSignTos: DBXTeamMembersRemoveError { + @objc + public init() { + let swift = Team.MembersRemoveError.cannotKeepAccountRequiredToSignTos + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersSendWelcomeError union +@objc +public class DBXTeamMembersSendWelcomeError: NSObject { + let swift: Team.MembersSendWelcomeError + + public init(swift: Team.MembersSendWelcomeError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersSendWelcomeError) -> DBXTeamMembersSendWelcomeError { + switch swift { + case .userNotFound: + return DBXTeamMembersSendWelcomeErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersSendWelcomeErrorUserNotInTeam() + case .other: + return DBXTeamMembersSendWelcomeErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersSendWelcomeErrorUserNotFound? { + self as? DBXTeamMembersSendWelcomeErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersSendWelcomeErrorUserNotInTeam? { + self as? DBXTeamMembersSendWelcomeErrorUserNotInTeam + } + + @objc + public var asOther: DBXTeamMembersSendWelcomeErrorOther? { + self as? DBXTeamMembersSendWelcomeErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersSendWelcomeErrorUserNotFound: DBXTeamMembersSendWelcomeError { + @objc + public init() { + let swift = Team.MembersSendWelcomeError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersSendWelcomeErrorUserNotInTeam: DBXTeamMembersSendWelcomeError { + @objc + public init() { + let swift = Team.MembersSendWelcomeError.userNotInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersSendWelcomeErrorOther: DBXTeamMembersSendWelcomeError { + @objc + public init() { + let swift = Team.MembersSendWelcomeError.other + super.init(swift: swift) + } +} + +/// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. +@objc +public class DBXTeamMembersSetPermissions2Arg: NSObject { + /// Identity of user whose role will be set. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// The new roles for the member. Send empty list to make user member only. For now, only up to one role is + /// allowed. + @objc + public var newRoles: [String]? { swift.newRoles } + + @objc + public init(user: DBXTeamUserSelectorArg, newRoles: [String]?) { + self.swift = Team.MembersSetPermissions2Arg(user: user.swift, newRoles: newRoles) + } + + let swift: Team.MembersSetPermissions2Arg + + public init(swift: Team.MembersSetPermissions2Arg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersSetPermissions2Error union +@objc +public class DBXTeamMembersSetPermissions2Error: NSObject { + let swift: Team.MembersSetPermissions2Error + + public init(swift: Team.MembersSetPermissions2Error) { + self.swift = swift + } + + public static func factory(swift: Team.MembersSetPermissions2Error) -> DBXTeamMembersSetPermissions2Error { + switch swift { + case .userNotFound: + return DBXTeamMembersSetPermissions2ErrorUserNotFound() + case .lastAdmin: + return DBXTeamMembersSetPermissions2ErrorLastAdmin() + case .userNotInTeam: + return DBXTeamMembersSetPermissions2ErrorUserNotInTeam() + case .cannotSetPermissions: + return DBXTeamMembersSetPermissions2ErrorCannotSetPermissions() + case .roleNotFound: + return DBXTeamMembersSetPermissions2ErrorRoleNotFound() + case .other: + return DBXTeamMembersSetPermissions2ErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersSetPermissions2ErrorUserNotFound? { + self as? DBXTeamMembersSetPermissions2ErrorUserNotFound + } + + @objc + public var asLastAdmin: DBXTeamMembersSetPermissions2ErrorLastAdmin? { + self as? DBXTeamMembersSetPermissions2ErrorLastAdmin + } + + @objc + public var asUserNotInTeam: DBXTeamMembersSetPermissions2ErrorUserNotInTeam? { + self as? DBXTeamMembersSetPermissions2ErrorUserNotInTeam + } + + @objc + public var asCannotSetPermissions: DBXTeamMembersSetPermissions2ErrorCannotSetPermissions? { + self as? DBXTeamMembersSetPermissions2ErrorCannotSetPermissions + } + + @objc + public var asRoleNotFound: DBXTeamMembersSetPermissions2ErrorRoleNotFound? { + self as? DBXTeamMembersSetPermissions2ErrorRoleNotFound + } + + @objc + public var asOther: DBXTeamMembersSetPermissions2ErrorOther? { + self as? DBXTeamMembersSetPermissions2ErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersSetPermissions2ErrorUserNotFound: DBXTeamMembersSetPermissions2Error { + @objc + public init() { + let swift = Team.MembersSetPermissions2Error.userNotFound + super.init(swift: swift) + } +} + +/// Cannot remove the admin setting of the last admin. +@objc +public class DBXTeamMembersSetPermissions2ErrorLastAdmin: DBXTeamMembersSetPermissions2Error { + @objc + public init() { + let swift = Team.MembersSetPermissions2Error.lastAdmin + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersSetPermissions2ErrorUserNotInTeam: DBXTeamMembersSetPermissions2Error { + @objc + public init() { + let swift = Team.MembersSetPermissions2Error.userNotInTeam + super.init(swift: swift) + } +} + +/// Cannot remove/grant permissions. This can happen if the team member is suspended. +@objc +public class DBXTeamMembersSetPermissions2ErrorCannotSetPermissions: DBXTeamMembersSetPermissions2Error { + @objc + public init() { + let swift = Team.MembersSetPermissions2Error.cannotSetPermissions + super.init(swift: swift) + } +} + +/// No matching role found. At least one of the provided new_roles does not exist on this team. +@objc +public class DBXTeamMembersSetPermissions2ErrorRoleNotFound: DBXTeamMembersSetPermissions2Error { + @objc + public init() { + let swift = Team.MembersSetPermissions2Error.roleNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersSetPermissions2ErrorOther: DBXTeamMembersSetPermissions2Error { + @objc + public init() { + let swift = Team.MembersSetPermissions2Error.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersSetPermissions2Result struct +@objc +public class DBXTeamMembersSetPermissions2Result: NSObject { + /// The member ID of the user to which the change was applied. + @objc + public var teamMemberId: String { swift.teamMemberId } + /// The roles after the change. Empty in case the user become a non-admin. + @objc + public var roles: [DBXTeamTeamMemberRole]? { swift.roles?.map { DBXTeamTeamMemberRole(swift: $0) } } + + @objc + public init(teamMemberId: String, roles: [DBXTeamTeamMemberRole]?) { + self.swift = Team.MembersSetPermissions2Result(teamMemberId: teamMemberId, roles: roles?.map(\.swift)) + } + + let swift: Team.MembersSetPermissions2Result + + public init(swift: Team.MembersSetPermissions2Result) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. +@objc +public class DBXTeamMembersSetPermissionsArg: NSObject { + /// Identity of user whose role will be set. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// The new role of the member. + @objc + public var newRole: DBXTeamAdminTier { DBXTeamAdminTier(swift: swift.newRole) } + + @objc + public init(user: DBXTeamUserSelectorArg, newRole: DBXTeamAdminTier) { + self.swift = Team.MembersSetPermissionsArg(user: user.swift, newRole: newRole.swift) + } + + let swift: Team.MembersSetPermissionsArg + + public init(swift: Team.MembersSetPermissionsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersSetPermissionsError union +@objc +public class DBXTeamMembersSetPermissionsError: NSObject { + let swift: Team.MembersSetPermissionsError + + public init(swift: Team.MembersSetPermissionsError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersSetPermissionsError) -> DBXTeamMembersSetPermissionsError { + switch swift { + case .userNotFound: + return DBXTeamMembersSetPermissionsErrorUserNotFound() + case .lastAdmin: + return DBXTeamMembersSetPermissionsErrorLastAdmin() + case .userNotInTeam: + return DBXTeamMembersSetPermissionsErrorUserNotInTeam() + case .cannotSetPermissions: + return DBXTeamMembersSetPermissionsErrorCannotSetPermissions() + case .teamLicenseLimit: + return DBXTeamMembersSetPermissionsErrorTeamLicenseLimit() + case .other: + return DBXTeamMembersSetPermissionsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersSetPermissionsErrorUserNotFound? { + self as? DBXTeamMembersSetPermissionsErrorUserNotFound + } + + @objc + public var asLastAdmin: DBXTeamMembersSetPermissionsErrorLastAdmin? { + self as? DBXTeamMembersSetPermissionsErrorLastAdmin + } + + @objc + public var asUserNotInTeam: DBXTeamMembersSetPermissionsErrorUserNotInTeam? { + self as? DBXTeamMembersSetPermissionsErrorUserNotInTeam + } + + @objc + public var asCannotSetPermissions: DBXTeamMembersSetPermissionsErrorCannotSetPermissions? { + self as? DBXTeamMembersSetPermissionsErrorCannotSetPermissions + } + + @objc + public var asTeamLicenseLimit: DBXTeamMembersSetPermissionsErrorTeamLicenseLimit? { + self as? DBXTeamMembersSetPermissionsErrorTeamLicenseLimit + } + + @objc + public var asOther: DBXTeamMembersSetPermissionsErrorOther? { + self as? DBXTeamMembersSetPermissionsErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersSetPermissionsErrorUserNotFound: DBXTeamMembersSetPermissionsError { + @objc + public init() { + let swift = Team.MembersSetPermissionsError.userNotFound + super.init(swift: swift) + } +} + +/// Cannot remove the admin setting of the last admin. +@objc +public class DBXTeamMembersSetPermissionsErrorLastAdmin: DBXTeamMembersSetPermissionsError { + @objc + public init() { + let swift = Team.MembersSetPermissionsError.lastAdmin + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersSetPermissionsErrorUserNotInTeam: DBXTeamMembersSetPermissionsError { + @objc + public init() { + let swift = Team.MembersSetPermissionsError.userNotInTeam + super.init(swift: swift) + } +} + +/// Cannot remove/grant permissions. +@objc +public class DBXTeamMembersSetPermissionsErrorCannotSetPermissions: DBXTeamMembersSetPermissionsError { + @objc + public init() { + let swift = Team.MembersSetPermissionsError.cannotSetPermissions + super.init(swift: swift) + } +} + +/// Team is full. The organization has no available licenses. +@objc +public class DBXTeamMembersSetPermissionsErrorTeamLicenseLimit: DBXTeamMembersSetPermissionsError { + @objc + public init() { + let swift = Team.MembersSetPermissionsError.teamLicenseLimit + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersSetPermissionsErrorOther: DBXTeamMembersSetPermissionsError { + @objc + public init() { + let swift = Team.MembersSetPermissionsError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersSetPermissionsResult struct +@objc +public class DBXTeamMembersSetPermissionsResult: NSObject { + /// The member ID of the user to which the change was applied. + @objc + public var teamMemberId: String { swift.teamMemberId } + /// The role after the change. + @objc + public var role: DBXTeamAdminTier { DBXTeamAdminTier(swift: swift.role) } + + @objc + public init(teamMemberId: String, role: DBXTeamAdminTier) { + self.swift = Team.MembersSetPermissionsResult(teamMemberId: teamMemberId, role: role.swift) + } + + let swift: Team.MembersSetPermissionsResult + + public init(swift: Team.MembersSetPermissionsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. At least one +/// of new_email, new_external_id, new_given_name, and/or new_surname must be provided. +@objc +public class DBXTeamMembersSetProfileArg: NSObject { + /// Identity of user whose profile will be set. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// New email for member. + @objc + public var newEmail: String? { swift.newEmail } + /// New external ID for member. + @objc + public var newExternalId: String? { swift.newExternalId } + /// New given name for member. + @objc + public var newGivenName: String? { swift.newGivenName } + /// New surname for member. + @objc + public var newSurname: String? { swift.newSurname } + /// New persistent ID. This field only available to teams using persistent ID SAML configuration. + @objc + public var newPersistentId: String? { swift.newPersistentId } + /// New value for whether the user is a directory restricted user. + @objc + public var newIsDirectoryRestricted: NSNumber? { swift.newIsDirectoryRestricted as NSNumber? } + + @objc + public init( + user: DBXTeamUserSelectorArg, + newEmail: String?, + newExternalId: String?, + newGivenName: String?, + newSurname: String?, + newPersistentId: String?, + newIsDirectoryRestricted: NSNumber? + ) { + self.swift = Team.MembersSetProfileArg( + user: user.swift, + newEmail: newEmail, + newExternalId: newExternalId, + newGivenName: newGivenName, + newSurname: newSurname, + newPersistentId: newPersistentId, + newIsDirectoryRestricted: newIsDirectoryRestricted?.boolValue + ) + } + + let swift: Team.MembersSetProfileArg + + public init(swift: Team.MembersSetProfileArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersSetProfileError union +@objc +public class DBXTeamMembersSetProfileError: NSObject { + let swift: Team.MembersSetProfileError + + public init(swift: Team.MembersSetProfileError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersSetProfileError) -> DBXTeamMembersSetProfileError { + switch swift { + case .userNotFound: + return DBXTeamMembersSetProfileErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersSetProfileErrorUserNotInTeam() + case .externalIdAndNewExternalIdUnsafe: + return DBXTeamMembersSetProfileErrorExternalIdAndNewExternalIdUnsafe() + case .noNewDataSpecified: + return DBXTeamMembersSetProfileErrorNoNewDataSpecified() + case .emailReservedForOtherUser: + return DBXTeamMembersSetProfileErrorEmailReservedForOtherUser() + case .externalIdUsedByOtherUser: + return DBXTeamMembersSetProfileErrorExternalIdUsedByOtherUser() + case .setProfileDisallowed: + return DBXTeamMembersSetProfileErrorSetProfileDisallowed() + case .paramCannotBeEmpty: + return DBXTeamMembersSetProfileErrorParamCannotBeEmpty() + case .persistentIdDisabled: + return DBXTeamMembersSetProfileErrorPersistentIdDisabled() + case .persistentIdUsedByOtherUser: + return DBXTeamMembersSetProfileErrorPersistentIdUsedByOtherUser() + case .directoryRestrictedOff: + return DBXTeamMembersSetProfileErrorDirectoryRestrictedOff() + case .other: + return DBXTeamMembersSetProfileErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersSetProfileErrorUserNotFound? { + self as? DBXTeamMembersSetProfileErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersSetProfileErrorUserNotInTeam? { + self as? DBXTeamMembersSetProfileErrorUserNotInTeam + } + + @objc + public var asExternalIdAndNewExternalIdUnsafe: DBXTeamMembersSetProfileErrorExternalIdAndNewExternalIdUnsafe? { + self as? DBXTeamMembersSetProfileErrorExternalIdAndNewExternalIdUnsafe + } + + @objc + public var asNoNewDataSpecified: DBXTeamMembersSetProfileErrorNoNewDataSpecified? { + self as? DBXTeamMembersSetProfileErrorNoNewDataSpecified + } + + @objc + public var asEmailReservedForOtherUser: DBXTeamMembersSetProfileErrorEmailReservedForOtherUser? { + self as? DBXTeamMembersSetProfileErrorEmailReservedForOtherUser + } + + @objc + public var asExternalIdUsedByOtherUser: DBXTeamMembersSetProfileErrorExternalIdUsedByOtherUser? { + self as? DBXTeamMembersSetProfileErrorExternalIdUsedByOtherUser + } + + @objc + public var asSetProfileDisallowed: DBXTeamMembersSetProfileErrorSetProfileDisallowed? { + self as? DBXTeamMembersSetProfileErrorSetProfileDisallowed + } + + @objc + public var asParamCannotBeEmpty: DBXTeamMembersSetProfileErrorParamCannotBeEmpty? { + self as? DBXTeamMembersSetProfileErrorParamCannotBeEmpty + } + + @objc + public var asPersistentIdDisabled: DBXTeamMembersSetProfileErrorPersistentIdDisabled? { + self as? DBXTeamMembersSetProfileErrorPersistentIdDisabled + } + + @objc + public var asPersistentIdUsedByOtherUser: DBXTeamMembersSetProfileErrorPersistentIdUsedByOtherUser? { + self as? DBXTeamMembersSetProfileErrorPersistentIdUsedByOtherUser + } + + @objc + public var asDirectoryRestrictedOff: DBXTeamMembersSetProfileErrorDirectoryRestrictedOff? { + self as? DBXTeamMembersSetProfileErrorDirectoryRestrictedOff + } + + @objc + public var asOther: DBXTeamMembersSetProfileErrorOther? { + self as? DBXTeamMembersSetProfileErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersSetProfileErrorUserNotFound: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersSetProfileErrorUserNotInTeam: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.userNotInTeam + super.init(swift: swift) + } +} + +/// It is unsafe to use both external_id and new_external_id. +@objc +public class DBXTeamMembersSetProfileErrorExternalIdAndNewExternalIdUnsafe: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.externalIdAndNewExternalIdUnsafe + super.init(swift: swift) + } +} + +/// None of new_email, new_given_name, new_surname, or new_external_id are specified. +@objc +public class DBXTeamMembersSetProfileErrorNoNewDataSpecified: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.noNewDataSpecified + super.init(swift: swift) + } +} + +/// Email is already reserved for another user. +@objc +public class DBXTeamMembersSetProfileErrorEmailReservedForOtherUser: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.emailReservedForOtherUser + super.init(swift: swift) + } +} + +/// The external ID is already in use by another team member. +@objc +public class DBXTeamMembersSetProfileErrorExternalIdUsedByOtherUser: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.externalIdUsedByOtherUser + super.init(swift: swift) + } +} + +/// Modifying deleted users is not allowed. +@objc +public class DBXTeamMembersSetProfileErrorSetProfileDisallowed: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.setProfileDisallowed + super.init(swift: swift) + } +} + +/// Parameter new_email cannot be empty. +@objc +public class DBXTeamMembersSetProfileErrorParamCannotBeEmpty: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.paramCannotBeEmpty + super.init(swift: swift) + } +} + +/// Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for +/// more information. +@objc +public class DBXTeamMembersSetProfileErrorPersistentIdDisabled: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.persistentIdDisabled + super.init(swift: swift) + } +} + +/// The persistent ID is already in use by another team member. +@objc +public class DBXTeamMembersSetProfileErrorPersistentIdUsedByOtherUser: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.persistentIdUsedByOtherUser + super.init(swift: swift) + } +} + +/// Directory Restrictions option is not available. +@objc +public class DBXTeamMembersSetProfileErrorDirectoryRestrictedOff: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.directoryRestrictedOff + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersSetProfileErrorOther: DBXTeamMembersSetProfileError { + @objc + public init() { + let swift = Team.MembersSetProfileError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersSetProfilePhotoArg struct +@objc +public class DBXTeamMembersSetProfilePhotoArg: NSObject { + /// Identity of the user whose profile photo will be set. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// Image to set as the member's new profile photo. + @objc + public var photo: DBXAccountPhotoSourceArg { DBXAccountPhotoSourceArg(swift: swift.photo) } + + @objc + public init(user: DBXTeamUserSelectorArg, photo: DBXAccountPhotoSourceArg) { + self.swift = Team.MembersSetProfilePhotoArg(user: user.swift, photo: photo.swift) + } + + let swift: Team.MembersSetProfilePhotoArg + + public init(swift: Team.MembersSetProfilePhotoArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersSetProfilePhotoError union +@objc +public class DBXTeamMembersSetProfilePhotoError: NSObject { + let swift: Team.MembersSetProfilePhotoError + + public init(swift: Team.MembersSetProfilePhotoError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersSetProfilePhotoError) -> DBXTeamMembersSetProfilePhotoError { + switch swift { + case .userNotFound: + return DBXTeamMembersSetProfilePhotoErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersSetProfilePhotoErrorUserNotInTeam() + case .setProfileDisallowed: + return DBXTeamMembersSetProfilePhotoErrorSetProfileDisallowed() + case .photoError(let swiftArg): + let arg = DBXAccountSetProfilePhotoError(swift: swiftArg) + return DBXTeamMembersSetProfilePhotoErrorPhotoError(arg) + case .other: + return DBXTeamMembersSetProfilePhotoErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersSetProfilePhotoErrorUserNotFound? { + self as? DBXTeamMembersSetProfilePhotoErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersSetProfilePhotoErrorUserNotInTeam? { + self as? DBXTeamMembersSetProfilePhotoErrorUserNotInTeam + } + + @objc + public var asSetProfileDisallowed: DBXTeamMembersSetProfilePhotoErrorSetProfileDisallowed? { + self as? DBXTeamMembersSetProfilePhotoErrorSetProfileDisallowed + } + + @objc + public var asPhotoError: DBXTeamMembersSetProfilePhotoErrorPhotoError? { + self as? DBXTeamMembersSetProfilePhotoErrorPhotoError + } + + @objc + public var asOther: DBXTeamMembersSetProfilePhotoErrorOther? { + self as? DBXTeamMembersSetProfilePhotoErrorOther + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersSetProfilePhotoErrorUserNotFound: DBXTeamMembersSetProfilePhotoError { + @objc + public init() { + let swift = Team.MembersSetProfilePhotoError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersSetProfilePhotoErrorUserNotInTeam: DBXTeamMembersSetProfilePhotoError { + @objc + public init() { + let swift = Team.MembersSetProfilePhotoError.userNotInTeam + super.init(swift: swift) + } +} + +/// Modifying deleted users is not allowed. +@objc +public class DBXTeamMembersSetProfilePhotoErrorSetProfileDisallowed: DBXTeamMembersSetProfilePhotoError { + @objc + public init() { + let swift = Team.MembersSetProfilePhotoError.setProfileDisallowed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersSetProfilePhotoErrorPhotoError: DBXTeamMembersSetProfilePhotoError { + @objc + public var photoError: DBXAccountSetProfilePhotoError + + @objc + public init(_ arg: DBXAccountSetProfilePhotoError) { + self.photoError = arg + let swift = Team.MembersSetProfilePhotoError.photoError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersSetProfilePhotoErrorOther: DBXTeamMembersSetProfilePhotoError { + @objc + public init() { + let swift = Team.MembersSetProfilePhotoError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersSuspendError union +@objc +public class DBXTeamMembersSuspendError: NSObject { + let swift: Team.MembersSuspendError + + public init(swift: Team.MembersSuspendError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersSuspendError) -> DBXTeamMembersSuspendError { + switch swift { + case .userNotFound: + return DBXTeamMembersSuspendErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersSuspendErrorUserNotInTeam() + case .other: + return DBXTeamMembersSuspendErrorOther() + case .suspendInactiveUser: + return DBXTeamMembersSuspendErrorSuspendInactiveUser() + case .suspendLastAdmin: + return DBXTeamMembersSuspendErrorSuspendLastAdmin() + case .teamLicenseLimit: + return DBXTeamMembersSuspendErrorTeamLicenseLimit() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersSuspendErrorUserNotFound? { + self as? DBXTeamMembersSuspendErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersSuspendErrorUserNotInTeam? { + self as? DBXTeamMembersSuspendErrorUserNotInTeam + } + + @objc + public var asOther: DBXTeamMembersSuspendErrorOther? { + self as? DBXTeamMembersSuspendErrorOther + } + + @objc + public var asSuspendInactiveUser: DBXTeamMembersSuspendErrorSuspendInactiveUser? { + self as? DBXTeamMembersSuspendErrorSuspendInactiveUser + } + + @objc + public var asSuspendLastAdmin: DBXTeamMembersSuspendErrorSuspendLastAdmin? { + self as? DBXTeamMembersSuspendErrorSuspendLastAdmin + } + + @objc + public var asTeamLicenseLimit: DBXTeamMembersSuspendErrorTeamLicenseLimit? { + self as? DBXTeamMembersSuspendErrorTeamLicenseLimit + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersSuspendErrorUserNotFound: DBXTeamMembersSuspendError { + @objc + public init() { + let swift = Team.MembersSuspendError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersSuspendErrorUserNotInTeam: DBXTeamMembersSuspendError { + @objc + public init() { + let swift = Team.MembersSuspendError.userNotInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersSuspendErrorOther: DBXTeamMembersSuspendError { + @objc + public init() { + let swift = Team.MembersSuspendError.other + super.init(swift: swift) + } +} + +/// The user is not active, so it cannot be suspended. +@objc +public class DBXTeamMembersSuspendErrorSuspendInactiveUser: DBXTeamMembersSuspendError { + @objc + public init() { + let swift = Team.MembersSuspendError.suspendInactiveUser + super.init(swift: swift) + } +} + +/// The user is the last admin of the team, so it cannot be suspended. +@objc +public class DBXTeamMembersSuspendErrorSuspendLastAdmin: DBXTeamMembersSuspendError { + @objc + public init() { + let swift = Team.MembersSuspendError.suspendLastAdmin + super.init(swift: swift) + } +} + +/// Team is full. The organization has no available licenses. +@objc +public class DBXTeamMembersSuspendErrorTeamLicenseLimit: DBXTeamMembersSuspendError { + @objc + public init() { + let swift = Team.MembersSuspendError.teamLicenseLimit + super.init(swift: swift) + } +} + +/// Objective-C compatible MembersTransferFormerMembersFilesError union +@objc +public class DBXTeamMembersTransferFormerMembersFilesError: NSObject { + let swift: Team.MembersTransferFormerMembersFilesError + + public init(swift: Team.MembersTransferFormerMembersFilesError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersTransferFormerMembersFilesError) -> DBXTeamMembersTransferFormerMembersFilesError { + switch swift { + case .userNotFound: + return DBXTeamMembersTransferFormerMembersFilesErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersTransferFormerMembersFilesErrorUserNotInTeam() + case .other: + return DBXTeamMembersTransferFormerMembersFilesErrorOther() + case .removedAndTransferDestShouldDiffer: + return DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferDestShouldDiffer() + case .removedAndTransferAdminShouldDiffer: + return DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferAdminShouldDiffer() + case .transferDestUserNotFound: + return DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotFound() + case .transferDestUserNotInTeam: + return DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotInTeam() + case .transferAdminUserNotInTeam: + return DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotInTeam() + case .transferAdminUserNotFound: + return DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotFound() + case .unspecifiedTransferAdminId: + return DBXTeamMembersTransferFormerMembersFilesErrorUnspecifiedTransferAdminId() + case .transferAdminIsNotAdmin: + return DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminIsNotAdmin() + case .recipientNotVerified: + return DBXTeamMembersTransferFormerMembersFilesErrorRecipientNotVerified() + case .userDataIsBeingTransferred: + return DBXTeamMembersTransferFormerMembersFilesErrorUserDataIsBeingTransferred() + case .userNotRemoved: + return DBXTeamMembersTransferFormerMembersFilesErrorUserNotRemoved() + case .userDataCannotBeTransferred: + return DBXTeamMembersTransferFormerMembersFilesErrorUserDataCannotBeTransferred() + case .userDataAlreadyTransferred: + return DBXTeamMembersTransferFormerMembersFilesErrorUserDataAlreadyTransferred() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersTransferFormerMembersFilesErrorUserNotFound? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersTransferFormerMembersFilesErrorUserNotInTeam? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorUserNotInTeam + } + + @objc + public var asOther: DBXTeamMembersTransferFormerMembersFilesErrorOther? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorOther + } + + @objc + public var asRemovedAndTransferDestShouldDiffer: DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferDestShouldDiffer? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferDestShouldDiffer + } + + @objc + public var asRemovedAndTransferAdminShouldDiffer: DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferAdminShouldDiffer? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferAdminShouldDiffer + } + + @objc + public var asTransferDestUserNotFound: DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotFound? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotFound + } + + @objc + public var asTransferDestUserNotInTeam: DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotInTeam? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotInTeam + } + + @objc + public var asTransferAdminUserNotInTeam: DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotInTeam? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotInTeam + } + + @objc + public var asTransferAdminUserNotFound: DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotFound? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotFound + } + + @objc + public var asUnspecifiedTransferAdminId: DBXTeamMembersTransferFormerMembersFilesErrorUnspecifiedTransferAdminId? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorUnspecifiedTransferAdminId + } + + @objc + public var asTransferAdminIsNotAdmin: DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminIsNotAdmin? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminIsNotAdmin + } + + @objc + public var asRecipientNotVerified: DBXTeamMembersTransferFormerMembersFilesErrorRecipientNotVerified? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorRecipientNotVerified + } + + @objc + public var asUserDataIsBeingTransferred: DBXTeamMembersTransferFormerMembersFilesErrorUserDataIsBeingTransferred? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorUserDataIsBeingTransferred + } + + @objc + public var asUserNotRemoved: DBXTeamMembersTransferFormerMembersFilesErrorUserNotRemoved? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorUserNotRemoved + } + + @objc + public var asUserDataCannotBeTransferred: DBXTeamMembersTransferFormerMembersFilesErrorUserDataCannotBeTransferred? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorUserDataCannotBeTransferred + } + + @objc + public var asUserDataAlreadyTransferred: DBXTeamMembersTransferFormerMembersFilesErrorUserDataAlreadyTransferred? { + self as? DBXTeamMembersTransferFormerMembersFilesErrorUserDataAlreadyTransferred + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorUserNotFound: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorUserNotInTeam: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.userNotInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorOther: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.other + super.init(swift: swift) + } +} + +/// Expected removed user and transfer_dest user to be different. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferDestShouldDiffer: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.removedAndTransferDestShouldDiffer + super.init(swift: swift) + } +} + +/// Expected removed user and transfer_admin user to be different. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorRemovedAndTransferAdminShouldDiffer: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.removedAndTransferAdminShouldDiffer + super.init(swift: swift) + } +} + +/// No matching user found for the argument transfer_dest_id. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotFound: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.transferDestUserNotFound + super.init(swift: swift) + } +} + +/// The provided transfer_dest_id does not exist on this team. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorTransferDestUserNotInTeam: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.transferDestUserNotInTeam + super.init(swift: swift) + } +} + +/// The provided transfer_admin_id does not exist on this team. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotInTeam: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.transferAdminUserNotInTeam + super.init(swift: swift) + } +} + +/// No matching user found for the argument transfer_admin_id. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminUserNotFound: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.transferAdminUserNotFound + super.init(swift: swift) + } +} + +/// The transfer_admin_id argument must be provided when file transfer is requested. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorUnspecifiedTransferAdminId: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.unspecifiedTransferAdminId + super.init(swift: swift) + } +} + +/// Specified transfer_admin user is not a team admin. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorTransferAdminIsNotAdmin: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.transferAdminIsNotAdmin + super.init(swift: swift) + } +} + +/// The recipient user's email is not verified. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorRecipientNotVerified: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.recipientNotVerified + super.init(swift: swift) + } +} + +/// The user's data is being transferred. Please wait some time before retrying. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorUserDataIsBeingTransferred: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.userDataIsBeingTransferred + super.init(swift: swift) + } +} + +/// No matching removed user found for the argument user. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorUserNotRemoved: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.userNotRemoved + super.init(swift: swift) + } +} + +/// User files aren't transferable anymore. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorUserDataCannotBeTransferred: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.userDataCannotBeTransferred + super.init(swift: swift) + } +} + +/// User's data has already been transferred to another user. +@objc +public class DBXTeamMembersTransferFormerMembersFilesErrorUserDataAlreadyTransferred: DBXTeamMembersTransferFormerMembersFilesError { + @objc + public init() { + let swift = Team.MembersTransferFormerMembersFilesError.userDataAlreadyTransferred + super.init(swift: swift) + } +} + +/// Exactly one of team_member_id, email, or external_id must be provided to identify the user account. +@objc +public class DBXTeamMembersUnsuspendArg: NSObject { + /// Identity of user to unsuspend. + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + + @objc + public init(user: DBXTeamUserSelectorArg) { + self.swift = Team.MembersUnsuspendArg(user: user.swift) + } + + let swift: Team.MembersUnsuspendArg + + public init(swift: Team.MembersUnsuspendArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MembersUnsuspendError union +@objc +public class DBXTeamMembersUnsuspendError: NSObject { + let swift: Team.MembersUnsuspendError + + public init(swift: Team.MembersUnsuspendError) { + self.swift = swift + } + + public static func factory(swift: Team.MembersUnsuspendError) -> DBXTeamMembersUnsuspendError { + switch swift { + case .userNotFound: + return DBXTeamMembersUnsuspendErrorUserNotFound() + case .userNotInTeam: + return DBXTeamMembersUnsuspendErrorUserNotInTeam() + case .other: + return DBXTeamMembersUnsuspendErrorOther() + case .unsuspendNonSuspendedMember: + return DBXTeamMembersUnsuspendErrorUnsuspendNonSuspendedMember() + case .teamLicenseLimit: + return DBXTeamMembersUnsuspendErrorTeamLicenseLimit() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserNotFound: DBXTeamMembersUnsuspendErrorUserNotFound? { + self as? DBXTeamMembersUnsuspendErrorUserNotFound + } + + @objc + public var asUserNotInTeam: DBXTeamMembersUnsuspendErrorUserNotInTeam? { + self as? DBXTeamMembersUnsuspendErrorUserNotInTeam + } + + @objc + public var asOther: DBXTeamMembersUnsuspendErrorOther? { + self as? DBXTeamMembersUnsuspendErrorOther + } + + @objc + public var asUnsuspendNonSuspendedMember: DBXTeamMembersUnsuspendErrorUnsuspendNonSuspendedMember? { + self as? DBXTeamMembersUnsuspendErrorUnsuspendNonSuspendedMember + } + + @objc + public var asTeamLicenseLimit: DBXTeamMembersUnsuspendErrorTeamLicenseLimit? { + self as? DBXTeamMembersUnsuspendErrorTeamLicenseLimit + } +} + +/// No matching user found. The provided team_member_id, email, or external_id does not exist on this team. +@objc +public class DBXTeamMembersUnsuspendErrorUserNotFound: DBXTeamMembersUnsuspendError { + @objc + public init() { + let swift = Team.MembersUnsuspendError.userNotFound + super.init(swift: swift) + } +} + +/// The user is not a member of the team. +@objc +public class DBXTeamMembersUnsuspendErrorUserNotInTeam: DBXTeamMembersUnsuspendError { + @objc + public init() { + let swift = Team.MembersUnsuspendError.userNotInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMembersUnsuspendErrorOther: DBXTeamMembersUnsuspendError { + @objc + public init() { + let swift = Team.MembersUnsuspendError.other + super.init(swift: swift) + } +} + +/// The user is unsuspended, so it cannot be unsuspended again. +@objc +public class DBXTeamMembersUnsuspendErrorUnsuspendNonSuspendedMember: DBXTeamMembersUnsuspendError { + @objc + public init() { + let swift = Team.MembersUnsuspendError.unsuspendNonSuspendedMember + super.init(swift: swift) + } +} + +/// Team is full. The organization has no available licenses. +@objc +public class DBXTeamMembersUnsuspendErrorTeamLicenseLimit: DBXTeamMembersUnsuspendError { + @objc + public init() { + let swift = Team.MembersUnsuspendError.teamLicenseLimit + super.init(swift: swift) + } +} + +/// Objective-C compatible MobileClientPlatform union +@objc +public class DBXTeamMobileClientPlatform: NSObject { + let swift: Team.MobileClientPlatform + + public init(swift: Team.MobileClientPlatform) { + self.swift = swift + } + + public static func factory(swift: Team.MobileClientPlatform) -> DBXTeamMobileClientPlatform { + switch swift { + case .iphone: + return DBXTeamMobileClientPlatformIphone() + case .ipad: + return DBXTeamMobileClientPlatformIpad() + case .android: + return DBXTeamMobileClientPlatformAndroid() + case .windowsPhone: + return DBXTeamMobileClientPlatformWindowsPhone() + case .blackberry: + return DBXTeamMobileClientPlatformBlackberry() + case .other: + return DBXTeamMobileClientPlatformOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIphone: DBXTeamMobileClientPlatformIphone? { + self as? DBXTeamMobileClientPlatformIphone + } + + @objc + public var asIpad: DBXTeamMobileClientPlatformIpad? { + self as? DBXTeamMobileClientPlatformIpad + } + + @objc + public var asAndroid: DBXTeamMobileClientPlatformAndroid? { + self as? DBXTeamMobileClientPlatformAndroid + } + + @objc + public var asWindowsPhone: DBXTeamMobileClientPlatformWindowsPhone? { + self as? DBXTeamMobileClientPlatformWindowsPhone + } + + @objc + public var asBlackberry: DBXTeamMobileClientPlatformBlackberry? { + self as? DBXTeamMobileClientPlatformBlackberry + } + + @objc + public var asOther: DBXTeamMobileClientPlatformOther? { + self as? DBXTeamMobileClientPlatformOther + } +} + +/// Official Dropbox iPhone client. +@objc +public class DBXTeamMobileClientPlatformIphone: DBXTeamMobileClientPlatform { + @objc + public init() { + let swift = Team.MobileClientPlatform.iphone + super.init(swift: swift) + } +} + +/// Official Dropbox iPad client. +@objc +public class DBXTeamMobileClientPlatformIpad: DBXTeamMobileClientPlatform { + @objc + public init() { + let swift = Team.MobileClientPlatform.ipad + super.init(swift: swift) + } +} + +/// Official Dropbox Android client. +@objc +public class DBXTeamMobileClientPlatformAndroid: DBXTeamMobileClientPlatform { + @objc + public init() { + let swift = Team.MobileClientPlatform.android + super.init(swift: swift) + } +} + +/// Official Dropbox Windows phone client. +@objc +public class DBXTeamMobileClientPlatformWindowsPhone: DBXTeamMobileClientPlatform { + @objc + public init() { + let swift = Team.MobileClientPlatform.windowsPhone + super.init(swift: swift) + } +} + +/// Official Dropbox Blackberry client. +@objc +public class DBXTeamMobileClientPlatformBlackberry: DBXTeamMobileClientPlatform { + @objc + public init() { + let swift = Team.MobileClientPlatform.blackberry + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamMobileClientPlatformOther: DBXTeamMobileClientPlatform { + @objc + public init() { + let swift = Team.MobileClientPlatform.other + super.init(swift: swift) + } +} + +/// Information about linked Dropbox mobile client sessions. +@objc +public class DBXTeamMobileClientSession: DBXTeamDeviceSession { + /// The device name. + @objc + public var deviceName: String { subSwift.deviceName } + /// The mobile application type. + @objc + public var clientType: DBXTeamMobileClientPlatform { DBXTeamMobileClientPlatform(swift: subSwift.clientType) } + /// The dropbox client version. + @objc + public var clientVersion: String? { subSwift.clientVersion } + /// The hosting OS version. + @objc + public var osVersion: String? { subSwift.osVersion } + /// last carrier used by the device. + @objc + public var lastCarrier: String? { subSwift.lastCarrier } + + @objc + public init( + sessionId: String, + deviceName: String, + clientType: DBXTeamMobileClientPlatform, + ipAddress: String?, + country: String?, + created: Date?, + updated: Date?, + clientVersion: String?, + osVersion: String?, + lastCarrier: String? + ) { + let swift = Team.MobileClientSession( + sessionId: sessionId, + deviceName: deviceName, + clientType: clientType.swift, + ipAddress: ipAddress, + country: country, + created: created, + updated: updated, + clientVersion: clientVersion, + osVersion: osVersion, + lastCarrier: lastCarrier + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.MobileClientSession + + public init(swift: Team.MobileClientSession) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Properties of a namespace. +@objc +public class DBXTeamNamespaceMetadata: NSObject { + /// The name of this namespace. + @objc + public var name: String { swift.name } + /// The ID of this namespace. + @objc + public var namespaceId: String { swift.namespaceId } + /// The type of this namespace. + @objc + public var namespaceType: DBXTeamNamespaceType { DBXTeamNamespaceType(swift: swift.namespaceType) } + /// If this is a team member or app folder, the ID of the owning team member. Otherwise, this field is not + /// present. + @objc + public var teamMemberId: String? { swift.teamMemberId } + + @objc + public init(name: String, namespaceId: String, namespaceType: DBXTeamNamespaceType, teamMemberId: String?) { + self.swift = Team.NamespaceMetadata(name: name, namespaceId: namespaceId, namespaceType: namespaceType.swift, teamMemberId: teamMemberId) + } + + let swift: Team.NamespaceMetadata + + public init(swift: Team.NamespaceMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NamespaceType union +@objc +public class DBXTeamNamespaceType: NSObject { + let swift: Team.NamespaceType + + public init(swift: Team.NamespaceType) { + self.swift = swift + } + + public static func factory(swift: Team.NamespaceType) -> DBXTeamNamespaceType { + switch swift { + case .appFolder: + return DBXTeamNamespaceTypeAppFolder() + case .sharedFolder: + return DBXTeamNamespaceTypeSharedFolder() + case .teamFolder: + return DBXTeamNamespaceTypeTeamFolder() + case .teamMemberFolder: + return DBXTeamNamespaceTypeTeamMemberFolder() + case .other: + return DBXTeamNamespaceTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAppFolder: DBXTeamNamespaceTypeAppFolder? { + self as? DBXTeamNamespaceTypeAppFolder + } + + @objc + public var asSharedFolder: DBXTeamNamespaceTypeSharedFolder? { + self as? DBXTeamNamespaceTypeSharedFolder + } + + @objc + public var asTeamFolder: DBXTeamNamespaceTypeTeamFolder? { + self as? DBXTeamNamespaceTypeTeamFolder + } + + @objc + public var asTeamMemberFolder: DBXTeamNamespaceTypeTeamMemberFolder? { + self as? DBXTeamNamespaceTypeTeamMemberFolder + } + + @objc + public var asOther: DBXTeamNamespaceTypeOther? { + self as? DBXTeamNamespaceTypeOther + } +} + +/// App sandbox folder. +@objc +public class DBXTeamNamespaceTypeAppFolder: DBXTeamNamespaceType { + @objc + public init() { + let swift = Team.NamespaceType.appFolder + super.init(swift: swift) + } +} + +/// Shared folder. +@objc +public class DBXTeamNamespaceTypeSharedFolder: DBXTeamNamespaceType { + @objc + public init() { + let swift = Team.NamespaceType.sharedFolder + super.init(swift: swift) + } +} + +/// Top-level team-owned folder. +@objc +public class DBXTeamNamespaceTypeTeamFolder: DBXTeamNamespaceType { + @objc + public init() { + let swift = Team.NamespaceType.teamFolder + super.init(swift: swift) + } +} + +/// Team member's home folder. +@objc +public class DBXTeamNamespaceTypeTeamMemberFolder: DBXTeamNamespaceType { + @objc + public init() { + let swift = Team.NamespaceType.teamMemberFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamNamespaceTypeOther: DBXTeamNamespaceType { + @objc + public init() { + let swift = Team.NamespaceType.other + super.init(swift: swift) + } +} + +/// User result for setting member custom quota. +@objc +public class DBXTeamRemoveCustomQuotaResult: NSObject { + let swift: Team.RemoveCustomQuotaResult + + public init(swift: Team.RemoveCustomQuotaResult) { + self.swift = swift + } + + public static func factory(swift: Team.RemoveCustomQuotaResult) -> DBXTeamRemoveCustomQuotaResult { + switch swift { + case .success(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamRemoveCustomQuotaResultSuccess(arg) + case .invalidUser(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamRemoveCustomQuotaResultInvalidUser(arg) + case .other: + return DBXTeamRemoveCustomQuotaResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamRemoveCustomQuotaResultSuccess? { + self as? DBXTeamRemoveCustomQuotaResultSuccess + } + + @objc + public var asInvalidUser: DBXTeamRemoveCustomQuotaResultInvalidUser? { + self as? DBXTeamRemoveCustomQuotaResultInvalidUser + } + + @objc + public var asOther: DBXTeamRemoveCustomQuotaResultOther? { + self as? DBXTeamRemoveCustomQuotaResultOther + } +} + +/// Successfully removed user. +@objc +public class DBXTeamRemoveCustomQuotaResultSuccess: DBXTeamRemoveCustomQuotaResult { + @objc + public var success: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.success = arg + let swift = Team.RemoveCustomQuotaResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// Invalid user (not in team). +@objc +public class DBXTeamRemoveCustomQuotaResultInvalidUser: DBXTeamRemoveCustomQuotaResult { + @objc + public var invalidUser: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.invalidUser = arg + let swift = Team.RemoveCustomQuotaResult.invalidUser(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamRemoveCustomQuotaResultOther: DBXTeamRemoveCustomQuotaResult { + @objc + public init() { + let swift = Team.RemoveCustomQuotaResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RemovedStatus struct +@objc +public class DBXTeamRemovedStatus: NSObject { + /// True if the removed team member is recoverable. + @objc + public var isRecoverable: NSNumber { swift.isRecoverable as NSNumber } + /// True if the team member's account was converted to individual account. + @objc + public var isDisconnected: NSNumber { swift.isDisconnected as NSNumber } + + @objc + public init(isRecoverable: NSNumber, isDisconnected: NSNumber) { + self.swift = Team.RemovedStatus(isRecoverable: isRecoverable.boolValue, isDisconnected: isDisconnected.boolValue) + } + + let swift: Team.RemovedStatus + + public init(swift: Team.RemovedStatus) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result of trying to resend verification email to a secondary email address. 'success' is the only value +/// indicating that a verification email was successfully sent. The other values explain the type of error that +/// occurred, and include the email for which the error occurred. +@objc +public class DBXTeamResendSecondaryEmailResult: NSObject { + let swift: Team.ResendSecondaryEmailResult + + public init(swift: Team.ResendSecondaryEmailResult) { + self.swift = swift + } + + public static func factory(swift: Team.ResendSecondaryEmailResult) -> DBXTeamResendSecondaryEmailResult { + switch swift { + case .success(let swiftArg): + let arg = swiftArg + return DBXTeamResendSecondaryEmailResultSuccess(arg) + case .notPending(let swiftArg): + let arg = swiftArg + return DBXTeamResendSecondaryEmailResultNotPending(arg) + case .rateLimited(let swiftArg): + let arg = swiftArg + return DBXTeamResendSecondaryEmailResultRateLimited(arg) + case .other: + return DBXTeamResendSecondaryEmailResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamResendSecondaryEmailResultSuccess? { + self as? DBXTeamResendSecondaryEmailResultSuccess + } + + @objc + public var asNotPending: DBXTeamResendSecondaryEmailResultNotPending? { + self as? DBXTeamResendSecondaryEmailResultNotPending + } + + @objc + public var asRateLimited: DBXTeamResendSecondaryEmailResultRateLimited? { + self as? DBXTeamResendSecondaryEmailResultRateLimited + } + + @objc + public var asOther: DBXTeamResendSecondaryEmailResultOther? { + self as? DBXTeamResendSecondaryEmailResultOther + } +} + +/// A verification email was successfully sent to the secondary email address. +@objc +public class DBXTeamResendSecondaryEmailResultSuccess: DBXTeamResendSecondaryEmailResult { + @objc + public var success: String + + @objc + public init(_ arg: String) { + self.success = arg + let swift = Team.ResendSecondaryEmailResult.success(arg) + super.init(swift: swift) + } +} + +/// This secondary email address is not pending for the user. +@objc +public class DBXTeamResendSecondaryEmailResultNotPending: DBXTeamResendSecondaryEmailResult { + @objc + public var notPending: String + + @objc + public init(_ arg: String) { + self.notPending = arg + let swift = Team.ResendSecondaryEmailResult.notPending(arg) + super.init(swift: swift) + } +} + +/// Too many emails are being sent to this email address. Please try again later. +@objc +public class DBXTeamResendSecondaryEmailResultRateLimited: DBXTeamResendSecondaryEmailResult { + @objc + public var rateLimited: String + + @objc + public init(_ arg: String) { + self.rateLimited = arg + let swift = Team.ResendSecondaryEmailResult.rateLimited(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamResendSecondaryEmailResultOther: DBXTeamResendSecondaryEmailResult { + @objc + public init() { + let swift = Team.ResendSecondaryEmailResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ResendVerificationEmailArg struct +@objc +public class DBXTeamResendVerificationEmailArg: NSObject { + /// List of users and secondary emails to resend verification emails to. + @objc + public var emailsToResend: [DBXTeamUserSecondaryEmailsArg] { swift.emailsToResend.map { DBXTeamUserSecondaryEmailsArg(swift: $0) } } + + @objc + public init(emailsToResend: [DBXTeamUserSecondaryEmailsArg]) { + self.swift = Team.ResendVerificationEmailArg(emailsToResend: emailsToResend.map(\.swift)) + } + + let swift: Team.ResendVerificationEmailArg + + public init(swift: Team.ResendVerificationEmailArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// List of users and resend results. +@objc +public class DBXTeamResendVerificationEmailResult: NSObject { + /// (no description) + @objc + public var results: [DBXTeamUserResendResult] { swift.results.map { DBXTeamUserResendResult(swift: $0) } } + + @objc + public init(results: [DBXTeamUserResendResult]) { + self.swift = Team.ResendVerificationEmailResult(results: results.map(\.swift)) + } + + let swift: Team.ResendVerificationEmailResult + + public init(swift: Team.ResendVerificationEmailResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RevokeDesktopClientArg struct +@objc +public class DBXTeamRevokeDesktopClientArg: DBXTeamDeviceSessionArg { + /// Whether to delete all files of the account (this is possible only if supported by the desktop client and + /// will be made the next time the client access the account). + @objc + public var deleteOnUnlink: NSNumber { subSwift.deleteOnUnlink as NSNumber } + + @objc + public init(sessionId: String, teamMemberId: String, deleteOnUnlink: NSNumber) { + let swift = Team.RevokeDesktopClientArg(sessionId: sessionId, teamMemberId: teamMemberId, deleteOnUnlink: deleteOnUnlink.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.RevokeDesktopClientArg + + public init(swift: Team.RevokeDesktopClientArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible RevokeDeviceSessionArg union +@objc +public class DBXTeamRevokeDeviceSessionArg: NSObject { + let swift: Team.RevokeDeviceSessionArg + + public init(swift: Team.RevokeDeviceSessionArg) { + self.swift = swift + } + + public static func factory(swift: Team.RevokeDeviceSessionArg) -> DBXTeamRevokeDeviceSessionArg { + switch swift { + case .webSession(let swiftArg): + let arg = DBXTeamDeviceSessionArg(swift: swiftArg) + return DBXTeamRevokeDeviceSessionArgWebSession(arg) + case .desktopClient(let swiftArg): + let arg = DBXTeamRevokeDesktopClientArg(swift: swiftArg) + return DBXTeamRevokeDeviceSessionArgDesktopClient(arg) + case .mobileClient(let swiftArg): + let arg = DBXTeamDeviceSessionArg(swift: swiftArg) + return DBXTeamRevokeDeviceSessionArgMobileClient(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asWebSession: DBXTeamRevokeDeviceSessionArgWebSession? { + self as? DBXTeamRevokeDeviceSessionArgWebSession + } + + @objc + public var asDesktopClient: DBXTeamRevokeDeviceSessionArgDesktopClient? { + self as? DBXTeamRevokeDeviceSessionArgDesktopClient + } + + @objc + public var asMobileClient: DBXTeamRevokeDeviceSessionArgMobileClient? { + self as? DBXTeamRevokeDeviceSessionArgMobileClient + } +} + +/// End an active session. +@objc +public class DBXTeamRevokeDeviceSessionArgWebSession: DBXTeamRevokeDeviceSessionArg { + @objc + public var webSession: DBXTeamDeviceSessionArg + + @objc + public init(_ arg: DBXTeamDeviceSessionArg) { + self.webSession = arg + let swift = Team.RevokeDeviceSessionArg.webSession(arg.swift) + super.init(swift: swift) + } +} + +/// Unlink a linked desktop device. +@objc +public class DBXTeamRevokeDeviceSessionArgDesktopClient: DBXTeamRevokeDeviceSessionArg { + @objc + public var desktopClient: DBXTeamRevokeDesktopClientArg + + @objc + public init(_ arg: DBXTeamRevokeDesktopClientArg) { + self.desktopClient = arg + let swift = Team.RevokeDeviceSessionArg.desktopClient(arg.subSwift) + super.init(swift: swift) + } +} + +/// Unlink a linked mobile device. +@objc +public class DBXTeamRevokeDeviceSessionArgMobileClient: DBXTeamRevokeDeviceSessionArg { + @objc + public var mobileClient: DBXTeamDeviceSessionArg + + @objc + public init(_ arg: DBXTeamDeviceSessionArg) { + self.mobileClient = arg + let swift = Team.RevokeDeviceSessionArg.mobileClient(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible RevokeDeviceSessionBatchArg struct +@objc +public class DBXTeamRevokeDeviceSessionBatchArg: NSObject { + /// (no description) + @objc + public var revokeDevices: [DBXTeamRevokeDeviceSessionArg] { swift.revokeDevices.map { DBXTeamRevokeDeviceSessionArg(swift: $0) } } + + @objc + public init(revokeDevices: [DBXTeamRevokeDeviceSessionArg]) { + self.swift = Team.RevokeDeviceSessionBatchArg(revokeDevices: revokeDevices.map(\.swift)) + } + + let swift: Team.RevokeDeviceSessionBatchArg + + public init(swift: Team.RevokeDeviceSessionBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RevokeDeviceSessionBatchError union +@objc +public class DBXTeamRevokeDeviceSessionBatchError: NSObject { + let swift: Team.RevokeDeviceSessionBatchError + + public init(swift: Team.RevokeDeviceSessionBatchError) { + self.swift = swift + } + + public static func factory(swift: Team.RevokeDeviceSessionBatchError) -> DBXTeamRevokeDeviceSessionBatchError { + switch swift { + case .other: + return DBXTeamRevokeDeviceSessionBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOther: DBXTeamRevokeDeviceSessionBatchErrorOther? { + self as? DBXTeamRevokeDeviceSessionBatchErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamRevokeDeviceSessionBatchErrorOther: DBXTeamRevokeDeviceSessionBatchError { + @objc + public init() { + let swift = Team.RevokeDeviceSessionBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RevokeDeviceSessionBatchResult struct +@objc +public class DBXTeamRevokeDeviceSessionBatchResult: NSObject { + /// (no description) + @objc + public var revokeDevicesStatus: [DBXTeamRevokeDeviceSessionStatus] { swift.revokeDevicesStatus.map { DBXTeamRevokeDeviceSessionStatus(swift: $0) } } + + @objc + public init(revokeDevicesStatus: [DBXTeamRevokeDeviceSessionStatus]) { + self.swift = Team.RevokeDeviceSessionBatchResult(revokeDevicesStatus: revokeDevicesStatus.map(\.swift)) + } + + let swift: Team.RevokeDeviceSessionBatchResult + + public init(swift: Team.RevokeDeviceSessionBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RevokeDeviceSessionError union +@objc +public class DBXTeamRevokeDeviceSessionError: NSObject { + let swift: Team.RevokeDeviceSessionError + + public init(swift: Team.RevokeDeviceSessionError) { + self.swift = swift + } + + public static func factory(swift: Team.RevokeDeviceSessionError) -> DBXTeamRevokeDeviceSessionError { + switch swift { + case .deviceSessionNotFound: + return DBXTeamRevokeDeviceSessionErrorDeviceSessionNotFound() + case .memberNotFound: + return DBXTeamRevokeDeviceSessionErrorMemberNotFound() + case .other: + return DBXTeamRevokeDeviceSessionErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDeviceSessionNotFound: DBXTeamRevokeDeviceSessionErrorDeviceSessionNotFound? { + self as? DBXTeamRevokeDeviceSessionErrorDeviceSessionNotFound + } + + @objc + public var asMemberNotFound: DBXTeamRevokeDeviceSessionErrorMemberNotFound? { + self as? DBXTeamRevokeDeviceSessionErrorMemberNotFound + } + + @objc + public var asOther: DBXTeamRevokeDeviceSessionErrorOther? { + self as? DBXTeamRevokeDeviceSessionErrorOther + } +} + +/// Device session not found. +@objc +public class DBXTeamRevokeDeviceSessionErrorDeviceSessionNotFound: DBXTeamRevokeDeviceSessionError { + @objc + public init() { + let swift = Team.RevokeDeviceSessionError.deviceSessionNotFound + super.init(swift: swift) + } +} + +/// Member not found. +@objc +public class DBXTeamRevokeDeviceSessionErrorMemberNotFound: DBXTeamRevokeDeviceSessionError { + @objc + public init() { + let swift = Team.RevokeDeviceSessionError.memberNotFound + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamRevokeDeviceSessionErrorOther: DBXTeamRevokeDeviceSessionError { + @objc + public init() { + let swift = Team.RevokeDeviceSessionError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RevokeDeviceSessionStatus struct +@objc +public class DBXTeamRevokeDeviceSessionStatus: NSObject { + /// Result of the revoking request. + @objc + public var success: NSNumber { swift.success as NSNumber } + /// The error cause in case of a failure. + @objc + public var errorType: DBXTeamRevokeDeviceSessionError? { guard let swift = swift.errorType else { return nil } + return DBXTeamRevokeDeviceSessionError(swift: swift) + } + + @objc + public init(success: NSNumber, errorType: DBXTeamRevokeDeviceSessionError?) { + self.swift = Team.RevokeDeviceSessionStatus(success: success.boolValue, errorType: errorType?.swift) + } + + let swift: Team.RevokeDeviceSessionStatus + + public init(swift: Team.RevokeDeviceSessionStatus) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RevokeLinkedApiAppArg struct +@objc +public class DBXTeamRevokeLinkedApiAppArg: NSObject { + /// The application's unique id. + @objc + public var appId: String { swift.appId } + /// The unique id of the member owning the device. + @objc + public var teamMemberId: String { swift.teamMemberId } + /// This flag is not longer supported, the application dedicated folder (in case the application uses one) will + /// be kept. + @objc + public var keepAppFolder: NSNumber { swift.keepAppFolder as NSNumber } + + @objc + public init(appId: String, teamMemberId: String, keepAppFolder: NSNumber) { + self.swift = Team.RevokeLinkedApiAppArg(appId: appId, teamMemberId: teamMemberId, keepAppFolder: keepAppFolder.boolValue) + } + + let swift: Team.RevokeLinkedApiAppArg + + public init(swift: Team.RevokeLinkedApiAppArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RevokeLinkedApiAppBatchArg struct +@objc +public class DBXTeamRevokeLinkedApiAppBatchArg: NSObject { + /// (no description) + @objc + public var revokeLinkedApp: [DBXTeamRevokeLinkedApiAppArg] { swift.revokeLinkedApp.map { DBXTeamRevokeLinkedApiAppArg(swift: $0) } } + + @objc + public init(revokeLinkedApp: [DBXTeamRevokeLinkedApiAppArg]) { + self.swift = Team.RevokeLinkedApiAppBatchArg(revokeLinkedApp: revokeLinkedApp.map(\.swift)) + } + + let swift: Team.RevokeLinkedApiAppBatchArg + + public init(swift: Team.RevokeLinkedApiAppBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error returned by linkedAppsRevokeLinkedAppBatch. +@objc +public class DBXTeamRevokeLinkedAppBatchError: NSObject { + let swift: Team.RevokeLinkedAppBatchError + + public init(swift: Team.RevokeLinkedAppBatchError) { + self.swift = swift + } + + public static func factory(swift: Team.RevokeLinkedAppBatchError) -> DBXTeamRevokeLinkedAppBatchError { + switch swift { + case .other: + return DBXTeamRevokeLinkedAppBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOther: DBXTeamRevokeLinkedAppBatchErrorOther? { + self as? DBXTeamRevokeLinkedAppBatchErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamRevokeLinkedAppBatchErrorOther: DBXTeamRevokeLinkedAppBatchError { + @objc + public init() { + let swift = Team.RevokeLinkedAppBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RevokeLinkedAppBatchResult struct +@objc +public class DBXTeamRevokeLinkedAppBatchResult: NSObject { + /// (no description) + @objc + public var revokeLinkedAppStatus: [DBXTeamRevokeLinkedAppStatus] { swift.revokeLinkedAppStatus.map { DBXTeamRevokeLinkedAppStatus(swift: $0) } } + + @objc + public init(revokeLinkedAppStatus: [DBXTeamRevokeLinkedAppStatus]) { + self.swift = Team.RevokeLinkedAppBatchResult(revokeLinkedAppStatus: revokeLinkedAppStatus.map(\.swift)) + } + + let swift: Team.RevokeLinkedAppBatchResult + + public init(swift: Team.RevokeLinkedAppBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error returned by linkedAppsRevokeLinkedApp. +@objc +public class DBXTeamRevokeLinkedAppError: NSObject { + let swift: Team.RevokeLinkedAppError + + public init(swift: Team.RevokeLinkedAppError) { + self.swift = swift + } + + public static func factory(swift: Team.RevokeLinkedAppError) -> DBXTeamRevokeLinkedAppError { + switch swift { + case .appNotFound: + return DBXTeamRevokeLinkedAppErrorAppNotFound() + case .memberNotFound: + return DBXTeamRevokeLinkedAppErrorMemberNotFound() + case .appFolderRemovalNotSupported: + return DBXTeamRevokeLinkedAppErrorAppFolderRemovalNotSupported() + case .other: + return DBXTeamRevokeLinkedAppErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAppNotFound: DBXTeamRevokeLinkedAppErrorAppNotFound? { + self as? DBXTeamRevokeLinkedAppErrorAppNotFound + } + + @objc + public var asMemberNotFound: DBXTeamRevokeLinkedAppErrorMemberNotFound? { + self as? DBXTeamRevokeLinkedAppErrorMemberNotFound + } + + @objc + public var asAppFolderRemovalNotSupported: DBXTeamRevokeLinkedAppErrorAppFolderRemovalNotSupported? { + self as? DBXTeamRevokeLinkedAppErrorAppFolderRemovalNotSupported + } + + @objc + public var asOther: DBXTeamRevokeLinkedAppErrorOther? { + self as? DBXTeamRevokeLinkedAppErrorOther + } +} + +/// Application not found. +@objc +public class DBXTeamRevokeLinkedAppErrorAppNotFound: DBXTeamRevokeLinkedAppError { + @objc + public init() { + let swift = Team.RevokeLinkedAppError.appNotFound + super.init(swift: swift) + } +} + +/// Member not found. +@objc +public class DBXTeamRevokeLinkedAppErrorMemberNotFound: DBXTeamRevokeLinkedAppError { + @objc + public init() { + let swift = Team.RevokeLinkedAppError.memberNotFound + super.init(swift: swift) + } +} + +/// App folder removal is not supported. +@objc +public class DBXTeamRevokeLinkedAppErrorAppFolderRemovalNotSupported: DBXTeamRevokeLinkedAppError { + @objc + public init() { + let swift = Team.RevokeLinkedAppError.appFolderRemovalNotSupported + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamRevokeLinkedAppErrorOther: DBXTeamRevokeLinkedAppError { + @objc + public init() { + let swift = Team.RevokeLinkedAppError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RevokeLinkedAppStatus struct +@objc +public class DBXTeamRevokeLinkedAppStatus: NSObject { + /// Result of the revoking request. + @objc + public var success: NSNumber { swift.success as NSNumber } + /// The error cause in case of a failure. + @objc + public var errorType: DBXTeamRevokeLinkedAppError? { guard let swift = swift.errorType else { return nil } + return DBXTeamRevokeLinkedAppError(swift: swift) + } + + @objc + public init(success: NSNumber, errorType: DBXTeamRevokeLinkedAppError?) { + self.swift = Team.RevokeLinkedAppStatus(success: success.boolValue, errorType: errorType?.swift) + } + + let swift: Team.RevokeLinkedAppStatus + + public init(swift: Team.RevokeLinkedAppStatus) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SetCustomQuotaArg struct +@objc +public class DBXTeamSetCustomQuotaArg: NSObject { + /// List of users and their custom quotas. + @objc + public var usersAndQuotas: [DBXTeamUserCustomQuotaArg] { swift.usersAndQuotas.map { DBXTeamUserCustomQuotaArg(swift: $0) } } + + @objc + public init(usersAndQuotas: [DBXTeamUserCustomQuotaArg]) { + self.swift = Team.SetCustomQuotaArg(usersAndQuotas: usersAndQuotas.map(\.swift)) + } + + let swift: Team.SetCustomQuotaArg + + public init(swift: Team.SetCustomQuotaArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Error returned when setting member custom quota. +@objc +public class DBXTeamSetCustomQuotaError: NSObject { + let swift: Team.SetCustomQuotaError + + public init(swift: Team.SetCustomQuotaError) { + self.swift = swift + } + + public static func factory(swift: Team.SetCustomQuotaError) -> DBXTeamSetCustomQuotaError { + switch swift { + case .tooManyUsers: + return DBXTeamSetCustomQuotaErrorTooManyUsers() + case .other: + return DBXTeamSetCustomQuotaErrorOther() + case .someUsersAreExcluded: + return DBXTeamSetCustomQuotaErrorSomeUsersAreExcluded() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTooManyUsers: DBXTeamSetCustomQuotaErrorTooManyUsers? { + self as? DBXTeamSetCustomQuotaErrorTooManyUsers + } + + @objc + public var asOther: DBXTeamSetCustomQuotaErrorOther? { + self as? DBXTeamSetCustomQuotaErrorOther + } + + @objc + public var asSomeUsersAreExcluded: DBXTeamSetCustomQuotaErrorSomeUsersAreExcluded? { + self as? DBXTeamSetCustomQuotaErrorSomeUsersAreExcluded + } +} + +/// A maximum of 1000 users can be set for a single call. +@objc +public class DBXTeamSetCustomQuotaErrorTooManyUsers: DBXTeamSetCustomQuotaError { + @objc + public init() { + let swift = Team.SetCustomQuotaError.tooManyUsers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamSetCustomQuotaErrorOther: DBXTeamSetCustomQuotaError { + @objc + public init() { + let swift = Team.SetCustomQuotaError.other + super.init(swift: swift) + } +} + +/// Some of the users are on the excluded users list and can't have custom quota set. +@objc +public class DBXTeamSetCustomQuotaErrorSomeUsersAreExcluded: DBXTeamSetCustomQuotaError { + @objc + public init() { + let swift = Team.SetCustomQuotaError.someUsersAreExcluded + super.init(swift: swift) + } +} + +/// Structure representing Approve List entries. Domain and emails are supported. At least one entry of any +/// supported type is required. +@objc +public class DBXTeamSharingAllowlistAddArgs: NSObject { + /// List of domains represented by valid string representation (RFC-1034/5). + @objc + public var domains: [String]? { swift.domains } + /// List of emails represented by valid string representation (RFC-5322/822). + @objc + public var emails: [String]? { swift.emails } + + @objc + public init(domains: [String]?, emails: [String]?) { + self.swift = Team.SharingAllowlistAddArgs(domains: domains, emails: emails) + } + + let swift: Team.SharingAllowlistAddArgs + + public init(swift: Team.SharingAllowlistAddArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingAllowlistAddError union +@objc +public class DBXTeamSharingAllowlistAddError: NSObject { + let swift: Team.SharingAllowlistAddError + + public init(swift: Team.SharingAllowlistAddError) { + self.swift = swift + } + + public static func factory(swift: Team.SharingAllowlistAddError) -> DBXTeamSharingAllowlistAddError { + switch swift { + case .malformedEntry(let swiftArg): + let arg = swiftArg + return DBXTeamSharingAllowlistAddErrorMalformedEntry(arg) + case .noEntriesProvided: + return DBXTeamSharingAllowlistAddErrorNoEntriesProvided() + case .tooManyEntriesProvided: + return DBXTeamSharingAllowlistAddErrorTooManyEntriesProvided() + case .teamLimitReached: + return DBXTeamSharingAllowlistAddErrorTeamLimitReached() + case .unknownError: + return DBXTeamSharingAllowlistAddErrorUnknownError() + case .entriesAlreadyExist(let swiftArg): + let arg = swiftArg + return DBXTeamSharingAllowlistAddErrorEntriesAlreadyExist(arg) + case .other: + return DBXTeamSharingAllowlistAddErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMalformedEntry: DBXTeamSharingAllowlistAddErrorMalformedEntry? { + self as? DBXTeamSharingAllowlistAddErrorMalformedEntry + } + + @objc + public var asNoEntriesProvided: DBXTeamSharingAllowlistAddErrorNoEntriesProvided? { + self as? DBXTeamSharingAllowlistAddErrorNoEntriesProvided + } + + @objc + public var asTooManyEntriesProvided: DBXTeamSharingAllowlistAddErrorTooManyEntriesProvided? { + self as? DBXTeamSharingAllowlistAddErrorTooManyEntriesProvided + } + + @objc + public var asTeamLimitReached: DBXTeamSharingAllowlistAddErrorTeamLimitReached? { + self as? DBXTeamSharingAllowlistAddErrorTeamLimitReached + } + + @objc + public var asUnknownError: DBXTeamSharingAllowlistAddErrorUnknownError? { + self as? DBXTeamSharingAllowlistAddErrorUnknownError + } + + @objc + public var asEntriesAlreadyExist: DBXTeamSharingAllowlistAddErrorEntriesAlreadyExist? { + self as? DBXTeamSharingAllowlistAddErrorEntriesAlreadyExist + } + + @objc + public var asOther: DBXTeamSharingAllowlistAddErrorOther? { + self as? DBXTeamSharingAllowlistAddErrorOther + } +} + +/// One of provided values is not valid. +@objc +public class DBXTeamSharingAllowlistAddErrorMalformedEntry: DBXTeamSharingAllowlistAddError { + @objc + public var malformedEntry: String + + @objc + public init(_ arg: String) { + self.malformedEntry = arg + let swift = Team.SharingAllowlistAddError.malformedEntry(arg) + super.init(swift: swift) + } +} + +/// Neither single domain nor email provided. +@objc +public class DBXTeamSharingAllowlistAddErrorNoEntriesProvided: DBXTeamSharingAllowlistAddError { + @objc + public init() { + let swift = Team.SharingAllowlistAddError.noEntriesProvided + super.init(swift: swift) + } +} + +/// Too many entries provided within one call. +@objc +public class DBXTeamSharingAllowlistAddErrorTooManyEntriesProvided: DBXTeamSharingAllowlistAddError { + @objc + public init() { + let swift = Team.SharingAllowlistAddError.tooManyEntriesProvided + super.init(swift: swift) + } +} + +/// Team entries limit reached. +@objc +public class DBXTeamSharingAllowlistAddErrorTeamLimitReached: DBXTeamSharingAllowlistAddError { + @objc + public init() { + let swift = Team.SharingAllowlistAddError.teamLimitReached + super.init(swift: swift) + } +} + +/// Unknown error. +@objc +public class DBXTeamSharingAllowlistAddErrorUnknownError: DBXTeamSharingAllowlistAddError { + @objc + public init() { + let swift = Team.SharingAllowlistAddError.unknownError + super.init(swift: swift) + } +} + +/// Entries already exists. +@objc +public class DBXTeamSharingAllowlistAddErrorEntriesAlreadyExist: DBXTeamSharingAllowlistAddError { + @objc + public var entriesAlreadyExist: String + + @objc + public init(_ arg: String) { + self.entriesAlreadyExist = arg + let swift = Team.SharingAllowlistAddError.entriesAlreadyExist(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamSharingAllowlistAddErrorOther: DBXTeamSharingAllowlistAddError { + @objc + public init() { + let swift = Team.SharingAllowlistAddError.other + super.init(swift: swift) + } +} + +/// This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone. +@objc +public class DBXTeamSharingAllowlistAddResponse: NSObject { + let swift: Team.SharingAllowlistAddResponse + + public init(swift: Team.SharingAllowlistAddResponse) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingAllowlistListArg struct +@objc +public class DBXTeamSharingAllowlistListArg: NSObject { + /// The number of entries to fetch at one time. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(limit: NSNumber) { + self.swift = Team.SharingAllowlistListArg(limit: limit.uint32Value) + } + + let swift: Team.SharingAllowlistListArg + + public init(swift: Team.SharingAllowlistListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingAllowlistListContinueArg struct +@objc +public class DBXTeamSharingAllowlistListContinueArg: NSObject { + /// The cursor returned from a previous call to sharingAllowlistList or sharingAllowlistListContinue. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Team.SharingAllowlistListContinueArg(cursor: cursor) + } + + let swift: Team.SharingAllowlistListContinueArg + + public init(swift: Team.SharingAllowlistListContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingAllowlistListContinueError union +@objc +public class DBXTeamSharingAllowlistListContinueError: NSObject { + let swift: Team.SharingAllowlistListContinueError + + public init(swift: Team.SharingAllowlistListContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.SharingAllowlistListContinueError) -> DBXTeamSharingAllowlistListContinueError { + switch swift { + case .invalidCursor: + return DBXTeamSharingAllowlistListContinueErrorInvalidCursor() + case .other: + return DBXTeamSharingAllowlistListContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidCursor: DBXTeamSharingAllowlistListContinueErrorInvalidCursor? { + self as? DBXTeamSharingAllowlistListContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXTeamSharingAllowlistListContinueErrorOther? { + self as? DBXTeamSharingAllowlistListContinueErrorOther + } +} + +/// Provided cursor is not valid. +@objc +public class DBXTeamSharingAllowlistListContinueErrorInvalidCursor: DBXTeamSharingAllowlistListContinueError { + @objc + public init() { + let swift = Team.SharingAllowlistListContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamSharingAllowlistListContinueErrorOther: DBXTeamSharingAllowlistListContinueError { + @objc + public init() { + let swift = Team.SharingAllowlistListContinueError.other + super.init(swift: swift) + } +} + +/// This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone. +@objc +public class DBXTeamSharingAllowlistListError: NSObject { + let swift: Team.SharingAllowlistListError + + public init(swift: Team.SharingAllowlistListError) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingAllowlistListResponse struct +@objc +public class DBXTeamSharingAllowlistListResponse: NSObject { + /// List of domains represented by valid string representation (RFC-1034/5). + @objc + public var domains: [String] { swift.domains } + /// List of emails represented by valid string representation (RFC-5322/822). + @objc + public var emails: [String] { swift.emails } + /// If this is nonempty, there are more entries that can be fetched with sharingAllowlistListContinue. + @objc + public var cursor: String { swift.cursor } + /// if true indicates that more entries can be fetched with sharingAllowlistListContinue. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(domains: [String], emails: [String], cursor: String, hasMore: NSNumber) { + self.swift = Team.SharingAllowlistListResponse(domains: domains, emails: emails, cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Team.SharingAllowlistListResponse + + public init(swift: Team.SharingAllowlistListResponse) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingAllowlistRemoveArgs struct +@objc +public class DBXTeamSharingAllowlistRemoveArgs: NSObject { + /// List of domains represented by valid string representation (RFC-1034/5). + @objc + public var domains: [String]? { swift.domains } + /// List of emails represented by valid string representation (RFC-5322/822). + @objc + public var emails: [String]? { swift.emails } + + @objc + public init(domains: [String]?, emails: [String]?) { + self.swift = Team.SharingAllowlistRemoveArgs(domains: domains, emails: emails) + } + + let swift: Team.SharingAllowlistRemoveArgs + + public init(swift: Team.SharingAllowlistRemoveArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingAllowlistRemoveError union +@objc +public class DBXTeamSharingAllowlistRemoveError: NSObject { + let swift: Team.SharingAllowlistRemoveError + + public init(swift: Team.SharingAllowlistRemoveError) { + self.swift = swift + } + + public static func factory(swift: Team.SharingAllowlistRemoveError) -> DBXTeamSharingAllowlistRemoveError { + switch swift { + case .malformedEntry(let swiftArg): + let arg = swiftArg + return DBXTeamSharingAllowlistRemoveErrorMalformedEntry(arg) + case .entriesDoNotExist(let swiftArg): + let arg = swiftArg + return DBXTeamSharingAllowlistRemoveErrorEntriesDoNotExist(arg) + case .noEntriesProvided: + return DBXTeamSharingAllowlistRemoveErrorNoEntriesProvided() + case .tooManyEntriesProvided: + return DBXTeamSharingAllowlistRemoveErrorTooManyEntriesProvided() + case .unknownError: + return DBXTeamSharingAllowlistRemoveErrorUnknownError() + case .other: + return DBXTeamSharingAllowlistRemoveErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMalformedEntry: DBXTeamSharingAllowlistRemoveErrorMalformedEntry? { + self as? DBXTeamSharingAllowlistRemoveErrorMalformedEntry + } + + @objc + public var asEntriesDoNotExist: DBXTeamSharingAllowlistRemoveErrorEntriesDoNotExist? { + self as? DBXTeamSharingAllowlistRemoveErrorEntriesDoNotExist + } + + @objc + public var asNoEntriesProvided: DBXTeamSharingAllowlistRemoveErrorNoEntriesProvided? { + self as? DBXTeamSharingAllowlistRemoveErrorNoEntriesProvided + } + + @objc + public var asTooManyEntriesProvided: DBXTeamSharingAllowlistRemoveErrorTooManyEntriesProvided? { + self as? DBXTeamSharingAllowlistRemoveErrorTooManyEntriesProvided + } + + @objc + public var asUnknownError: DBXTeamSharingAllowlistRemoveErrorUnknownError? { + self as? DBXTeamSharingAllowlistRemoveErrorUnknownError + } + + @objc + public var asOther: DBXTeamSharingAllowlistRemoveErrorOther? { + self as? DBXTeamSharingAllowlistRemoveErrorOther + } +} + +/// One of provided values is not valid. +@objc +public class DBXTeamSharingAllowlistRemoveErrorMalformedEntry: DBXTeamSharingAllowlistRemoveError { + @objc + public var malformedEntry: String + + @objc + public init(_ arg: String) { + self.malformedEntry = arg + let swift = Team.SharingAllowlistRemoveError.malformedEntry(arg) + super.init(swift: swift) + } +} + +/// One or more provided values do not exist. +@objc +public class DBXTeamSharingAllowlistRemoveErrorEntriesDoNotExist: DBXTeamSharingAllowlistRemoveError { + @objc + public var entriesDoNotExist: String + + @objc + public init(_ arg: String) { + self.entriesDoNotExist = arg + let swift = Team.SharingAllowlistRemoveError.entriesDoNotExist(arg) + super.init(swift: swift) + } +} + +/// Neither single domain nor email provided. +@objc +public class DBXTeamSharingAllowlistRemoveErrorNoEntriesProvided: DBXTeamSharingAllowlistRemoveError { + @objc + public init() { + let swift = Team.SharingAllowlistRemoveError.noEntriesProvided + super.init(swift: swift) + } +} + +/// Too many entries provided within one call. +@objc +public class DBXTeamSharingAllowlistRemoveErrorTooManyEntriesProvided: DBXTeamSharingAllowlistRemoveError { + @objc + public init() { + let swift = Team.SharingAllowlistRemoveError.tooManyEntriesProvided + super.init(swift: swift) + } +} + +/// Unknown error. +@objc +public class DBXTeamSharingAllowlistRemoveErrorUnknownError: DBXTeamSharingAllowlistRemoveError { + @objc + public init() { + let swift = Team.SharingAllowlistRemoveError.unknownError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamSharingAllowlistRemoveErrorOther: DBXTeamSharingAllowlistRemoveError { + @objc + public init() { + let swift = Team.SharingAllowlistRemoveError.other + super.init(swift: swift) + } +} + +/// This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone. +@objc +public class DBXTeamSharingAllowlistRemoveResponse: NSObject { + let swift: Team.SharingAllowlistRemoveResponse + + public init(swift: Team.SharingAllowlistRemoveResponse) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Describes the number of users in a specific storage bucket. +@objc +public class DBXTeamStorageBucket: NSObject { + /// The name of the storage bucket. For example, '1G' is a bucket of users with storage size up to 1 Giga. + @objc + public var bucket: String { swift.bucket } + /// The number of people whose storage is in the range of this storage bucket. + @objc + public var users: NSNumber { swift.users as NSNumber } + + @objc + public init(bucket: String, users: NSNumber) { + self.swift = Team.StorageBucket(bucket: bucket, users: users.uint64Value) + } + + let swift: Team.StorageBucket + + public init(swift: Team.StorageBucket) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderAccessError union +@objc +public class DBXTeamTeamFolderAccessError: NSObject { + let swift: Team.TeamFolderAccessError + + public init(swift: Team.TeamFolderAccessError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderAccessError) -> DBXTeamTeamFolderAccessError { + switch swift { + case .invalidTeamFolderId: + return DBXTeamTeamFolderAccessErrorInvalidTeamFolderId() + case .noAccess: + return DBXTeamTeamFolderAccessErrorNoAccess() + case .other: + return DBXTeamTeamFolderAccessErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidTeamFolderId: DBXTeamTeamFolderAccessErrorInvalidTeamFolderId? { + self as? DBXTeamTeamFolderAccessErrorInvalidTeamFolderId + } + + @objc + public var asNoAccess: DBXTeamTeamFolderAccessErrorNoAccess? { + self as? DBXTeamTeamFolderAccessErrorNoAccess + } + + @objc + public var asOther: DBXTeamTeamFolderAccessErrorOther? { + self as? DBXTeamTeamFolderAccessErrorOther + } +} + +/// The team folder ID is invalid. +@objc +public class DBXTeamTeamFolderAccessErrorInvalidTeamFolderId: DBXTeamTeamFolderAccessError { + @objc + public init() { + let swift = Team.TeamFolderAccessError.invalidTeamFolderId + super.init(swift: swift) + } +} + +/// The authenticated app does not have permission to manage that team folder. +@objc +public class DBXTeamTeamFolderAccessErrorNoAccess: DBXTeamTeamFolderAccessError { + @objc + public init() { + let swift = Team.TeamFolderAccessError.noAccess + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderAccessErrorOther: DBXTeamTeamFolderAccessError { + @objc + public init() { + let swift = Team.TeamFolderAccessError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderActivateError union +@objc +public class DBXTeamTeamFolderActivateError: NSObject { + let swift: Team.TeamFolderActivateError + + public init(swift: Team.TeamFolderActivateError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderActivateError) -> DBXTeamTeamFolderActivateError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXTeamTeamFolderAccessError(swift: swiftArg) + return DBXTeamTeamFolderActivateErrorAccessError(arg) + case .statusError(let swiftArg): + let arg = DBXTeamTeamFolderInvalidStatusError(swift: swiftArg) + return DBXTeamTeamFolderActivateErrorStatusError(arg) + case .teamSharedDropboxError(let swiftArg): + let arg = DBXTeamTeamFolderTeamSharedDropboxError(swift: swiftArg) + return DBXTeamTeamFolderActivateErrorTeamSharedDropboxError(arg) + case .other: + return DBXTeamTeamFolderActivateErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXTeamTeamFolderActivateErrorAccessError? { + self as? DBXTeamTeamFolderActivateErrorAccessError + } + + @objc + public var asStatusError: DBXTeamTeamFolderActivateErrorStatusError? { + self as? DBXTeamTeamFolderActivateErrorStatusError + } + + @objc + public var asTeamSharedDropboxError: DBXTeamTeamFolderActivateErrorTeamSharedDropboxError? { + self as? DBXTeamTeamFolderActivateErrorTeamSharedDropboxError + } + + @objc + public var asOther: DBXTeamTeamFolderActivateErrorOther? { + self as? DBXTeamTeamFolderActivateErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderActivateErrorAccessError: DBXTeamTeamFolderActivateError { + @objc + public var accessError: DBXTeamTeamFolderAccessError + + @objc + public init(_ arg: DBXTeamTeamFolderAccessError) { + self.accessError = arg + let swift = Team.TeamFolderActivateError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderActivateErrorStatusError: DBXTeamTeamFolderActivateError { + @objc + public var statusError: DBXTeamTeamFolderInvalidStatusError + + @objc + public init(_ arg: DBXTeamTeamFolderInvalidStatusError) { + self.statusError = arg + let swift = Team.TeamFolderActivateError.statusError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderActivateErrorTeamSharedDropboxError: DBXTeamTeamFolderActivateError { + @objc + public var teamSharedDropboxError: DBXTeamTeamFolderTeamSharedDropboxError + + @objc + public init(_ arg: DBXTeamTeamFolderTeamSharedDropboxError) { + self.teamSharedDropboxError = arg + let swift = Team.TeamFolderActivateError.teamSharedDropboxError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderActivateErrorOther: DBXTeamTeamFolderActivateError { + @objc + public init() { + let swift = Team.TeamFolderActivateError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderIdArg struct +@objc +public class DBXTeamTeamFolderIdArg: NSObject { + /// The ID of the team folder. + @objc + public var teamFolderId: String { swift.teamFolderId } + + @objc + public init(teamFolderId: String) { + self.swift = Team.TeamFolderIdArg(teamFolderId: teamFolderId) + } + + let swift: Team.TeamFolderIdArg + + public init(swift: Team.TeamFolderIdArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderArchiveArg struct +@objc +public class DBXTeamTeamFolderArchiveArg: DBXTeamTeamFolderIdArg { + /// Whether to force the archive to happen synchronously. + @objc + public var forceAsyncOff: NSNumber { subSwift.forceAsyncOff as NSNumber } + + @objc + public init(teamFolderId: String, forceAsyncOff: NSNumber) { + let swift = Team.TeamFolderArchiveArg(teamFolderId: teamFolderId, forceAsyncOff: forceAsyncOff.boolValue) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.TeamFolderArchiveArg + + public init(swift: Team.TeamFolderArchiveArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible TeamFolderArchiveError union +@objc +public class DBXTeamTeamFolderArchiveError: NSObject { + let swift: Team.TeamFolderArchiveError + + public init(swift: Team.TeamFolderArchiveError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderArchiveError) -> DBXTeamTeamFolderArchiveError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXTeamTeamFolderAccessError(swift: swiftArg) + return DBXTeamTeamFolderArchiveErrorAccessError(arg) + case .statusError(let swiftArg): + let arg = DBXTeamTeamFolderInvalidStatusError(swift: swiftArg) + return DBXTeamTeamFolderArchiveErrorStatusError(arg) + case .teamSharedDropboxError(let swiftArg): + let arg = DBXTeamTeamFolderTeamSharedDropboxError(swift: swiftArg) + return DBXTeamTeamFolderArchiveErrorTeamSharedDropboxError(arg) + case .other: + return DBXTeamTeamFolderArchiveErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXTeamTeamFolderArchiveErrorAccessError? { + self as? DBXTeamTeamFolderArchiveErrorAccessError + } + + @objc + public var asStatusError: DBXTeamTeamFolderArchiveErrorStatusError? { + self as? DBXTeamTeamFolderArchiveErrorStatusError + } + + @objc + public var asTeamSharedDropboxError: DBXTeamTeamFolderArchiveErrorTeamSharedDropboxError? { + self as? DBXTeamTeamFolderArchiveErrorTeamSharedDropboxError + } + + @objc + public var asOther: DBXTeamTeamFolderArchiveErrorOther? { + self as? DBXTeamTeamFolderArchiveErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderArchiveErrorAccessError: DBXTeamTeamFolderArchiveError { + @objc + public var accessError: DBXTeamTeamFolderAccessError + + @objc + public init(_ arg: DBXTeamTeamFolderAccessError) { + self.accessError = arg + let swift = Team.TeamFolderArchiveError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderArchiveErrorStatusError: DBXTeamTeamFolderArchiveError { + @objc + public var statusError: DBXTeamTeamFolderInvalidStatusError + + @objc + public init(_ arg: DBXTeamTeamFolderInvalidStatusError) { + self.statusError = arg + let swift = Team.TeamFolderArchiveError.statusError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderArchiveErrorTeamSharedDropboxError: DBXTeamTeamFolderArchiveError { + @objc + public var teamSharedDropboxError: DBXTeamTeamFolderTeamSharedDropboxError + + @objc + public init(_ arg: DBXTeamTeamFolderTeamSharedDropboxError) { + self.teamSharedDropboxError = arg + let swift = Team.TeamFolderArchiveError.teamSharedDropboxError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderArchiveErrorOther: DBXTeamTeamFolderArchiveError { + @objc + public init() { + let swift = Team.TeamFolderArchiveError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderArchiveJobStatus union +@objc +public class DBXTeamTeamFolderArchiveJobStatus: NSObject { + let swift: Team.TeamFolderArchiveJobStatus + + public init(swift: Team.TeamFolderArchiveJobStatus) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderArchiveJobStatus) -> DBXTeamTeamFolderArchiveJobStatus { + switch swift { + case .inProgress: + return DBXTeamTeamFolderArchiveJobStatusInProgress() + case .complete(let swiftArg): + let arg = DBXTeamTeamFolderMetadata(swift: swiftArg) + return DBXTeamTeamFolderArchiveJobStatusComplete(arg) + case .failed(let swiftArg): + let arg = DBXTeamTeamFolderArchiveError(swift: swiftArg) + return DBXTeamTeamFolderArchiveJobStatusFailed(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXTeamTeamFolderArchiveJobStatusInProgress? { + self as? DBXTeamTeamFolderArchiveJobStatusInProgress + } + + @objc + public var asComplete: DBXTeamTeamFolderArchiveJobStatusComplete? { + self as? DBXTeamTeamFolderArchiveJobStatusComplete + } + + @objc + public var asFailed: DBXTeamTeamFolderArchiveJobStatusFailed? { + self as? DBXTeamTeamFolderArchiveJobStatusFailed + } +} + +/// The asynchronous job is still in progress. +@objc +public class DBXTeamTeamFolderArchiveJobStatusInProgress: DBXTeamTeamFolderArchiveJobStatus { + @objc + public init() { + let swift = Team.TeamFolderArchiveJobStatus.inProgress + super.init(swift: swift) + } +} + +/// The archive job has finished. The value is the metadata for the resulting team folder. +@objc +public class DBXTeamTeamFolderArchiveJobStatusComplete: DBXTeamTeamFolderArchiveJobStatus { + @objc + public var complete: DBXTeamTeamFolderMetadata + + @objc + public init(_ arg: DBXTeamTeamFolderMetadata) { + self.complete = arg + let swift = Team.TeamFolderArchiveJobStatus.complete(arg.swift) + super.init(swift: swift) + } +} + +/// Error occurred while performing an asynchronous job from teamFolderArchive. +@objc +public class DBXTeamTeamFolderArchiveJobStatusFailed: DBXTeamTeamFolderArchiveJobStatus { + @objc + public var failed: DBXTeamTeamFolderArchiveError + + @objc + public init(_ arg: DBXTeamTeamFolderArchiveError) { + self.failed = arg + let swift = Team.TeamFolderArchiveJobStatus.failed(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderArchiveLaunch union +@objc +public class DBXTeamTeamFolderArchiveLaunch: NSObject { + let swift: Team.TeamFolderArchiveLaunch + + public init(swift: Team.TeamFolderArchiveLaunch) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderArchiveLaunch) -> DBXTeamTeamFolderArchiveLaunch { + switch swift { + case .asyncJobId(let swiftArg): + let arg = swiftArg + return DBXTeamTeamFolderArchiveLaunchAsyncJobId(arg) + case .complete(let swiftArg): + let arg = DBXTeamTeamFolderMetadata(swift: swiftArg) + return DBXTeamTeamFolderArchiveLaunchComplete(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAsyncJobId: DBXTeamTeamFolderArchiveLaunchAsyncJobId? { + self as? DBXTeamTeamFolderArchiveLaunchAsyncJobId + } + + @objc + public var asComplete: DBXTeamTeamFolderArchiveLaunchComplete? { + self as? DBXTeamTeamFolderArchiveLaunchComplete + } +} + +/// This response indicates that the processing is asynchronous. The string is an id that can be used to obtain +/// the status of the asynchronous job. +@objc +public class DBXTeamTeamFolderArchiveLaunchAsyncJobId: DBXTeamTeamFolderArchiveLaunch { + @objc + public var asyncJobId: String + + @objc + public init(_ arg: String) { + self.asyncJobId = arg + let swift = Team.TeamFolderArchiveLaunch.asyncJobId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderArchiveLaunchComplete: DBXTeamTeamFolderArchiveLaunch { + @objc + public var complete: DBXTeamTeamFolderMetadata + + @objc + public init(_ arg: DBXTeamTeamFolderMetadata) { + self.complete = arg + let swift = Team.TeamFolderArchiveLaunch.complete(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderCreateArg struct +@objc +public class DBXTeamTeamFolderCreateArg: NSObject { + /// Name for the new team folder. + @objc + public var name: String { swift.name } + /// The sync setting to apply to this team folder. Only permitted if the team has team selective sync enabled. + @objc + public var syncSetting: DBXFilesSyncSettingArg? { guard let swift = swift.syncSetting else { return nil } + return DBXFilesSyncSettingArg(swift: swift) + } + + @objc + public init(name: String, syncSetting: DBXFilesSyncSettingArg?) { + self.swift = Team.TeamFolderCreateArg(name: name, syncSetting: syncSetting?.swift) + } + + let swift: Team.TeamFolderCreateArg + + public init(swift: Team.TeamFolderCreateArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderCreateError union +@objc +public class DBXTeamTeamFolderCreateError: NSObject { + let swift: Team.TeamFolderCreateError + + public init(swift: Team.TeamFolderCreateError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderCreateError) -> DBXTeamTeamFolderCreateError { + switch swift { + case .invalidFolderName: + return DBXTeamTeamFolderCreateErrorInvalidFolderName() + case .folderNameAlreadyUsed: + return DBXTeamTeamFolderCreateErrorFolderNameAlreadyUsed() + case .folderNameReserved: + return DBXTeamTeamFolderCreateErrorFolderNameReserved() + case .syncSettingsError(let swiftArg): + let arg = DBXFilesSyncSettingsError(swift: swiftArg) + return DBXTeamTeamFolderCreateErrorSyncSettingsError(arg) + case .other: + return DBXTeamTeamFolderCreateErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidFolderName: DBXTeamTeamFolderCreateErrorInvalidFolderName? { + self as? DBXTeamTeamFolderCreateErrorInvalidFolderName + } + + @objc + public var asFolderNameAlreadyUsed: DBXTeamTeamFolderCreateErrorFolderNameAlreadyUsed? { + self as? DBXTeamTeamFolderCreateErrorFolderNameAlreadyUsed + } + + @objc + public var asFolderNameReserved: DBXTeamTeamFolderCreateErrorFolderNameReserved? { + self as? DBXTeamTeamFolderCreateErrorFolderNameReserved + } + + @objc + public var asSyncSettingsError: DBXTeamTeamFolderCreateErrorSyncSettingsError? { + self as? DBXTeamTeamFolderCreateErrorSyncSettingsError + } + + @objc + public var asOther: DBXTeamTeamFolderCreateErrorOther? { + self as? DBXTeamTeamFolderCreateErrorOther + } +} + +/// The provided name cannot be used. +@objc +public class DBXTeamTeamFolderCreateErrorInvalidFolderName: DBXTeamTeamFolderCreateError { + @objc + public init() { + let swift = Team.TeamFolderCreateError.invalidFolderName + super.init(swift: swift) + } +} + +/// There is already a team folder with the provided name. +@objc +public class DBXTeamTeamFolderCreateErrorFolderNameAlreadyUsed: DBXTeamTeamFolderCreateError { + @objc + public init() { + let swift = Team.TeamFolderCreateError.folderNameAlreadyUsed + super.init(swift: swift) + } +} + +/// The provided name cannot be used because it is reserved. +@objc +public class DBXTeamTeamFolderCreateErrorFolderNameReserved: DBXTeamTeamFolderCreateError { + @objc + public init() { + let swift = Team.TeamFolderCreateError.folderNameReserved + super.init(swift: swift) + } +} + +/// An error occurred setting the sync settings. +@objc +public class DBXTeamTeamFolderCreateErrorSyncSettingsError: DBXTeamTeamFolderCreateError { + @objc + public var syncSettingsError: DBXFilesSyncSettingsError + + @objc + public init(_ arg: DBXFilesSyncSettingsError) { + self.syncSettingsError = arg + let swift = Team.TeamFolderCreateError.syncSettingsError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderCreateErrorOther: DBXTeamTeamFolderCreateError { + @objc + public init() { + let swift = Team.TeamFolderCreateError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderGetInfoItem union +@objc +public class DBXTeamTeamFolderGetInfoItem: NSObject { + let swift: Team.TeamFolderGetInfoItem + + public init(swift: Team.TeamFolderGetInfoItem) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderGetInfoItem) -> DBXTeamTeamFolderGetInfoItem { + switch swift { + case .idNotFound(let swiftArg): + let arg = swiftArg + return DBXTeamTeamFolderGetInfoItemIdNotFound(arg) + case .teamFolderMetadata(let swiftArg): + let arg = DBXTeamTeamFolderMetadata(swift: swiftArg) + return DBXTeamTeamFolderGetInfoItemTeamFolderMetadata(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIdNotFound: DBXTeamTeamFolderGetInfoItemIdNotFound? { + self as? DBXTeamTeamFolderGetInfoItemIdNotFound + } + + @objc + public var asTeamFolderMetadata: DBXTeamTeamFolderGetInfoItemTeamFolderMetadata? { + self as? DBXTeamTeamFolderGetInfoItemTeamFolderMetadata + } +} + +/// An ID that was provided as a parameter to teamFolderGetInfo did not match any of the team's team folders. +@objc +public class DBXTeamTeamFolderGetInfoItemIdNotFound: DBXTeamTeamFolderGetInfoItem { + @objc + public var idNotFound: String + + @objc + public init(_ arg: String) { + self.idNotFound = arg + let swift = Team.TeamFolderGetInfoItem.idNotFound(arg) + super.init(swift: swift) + } +} + +/// Properties of a team folder. +@objc +public class DBXTeamTeamFolderGetInfoItemTeamFolderMetadata: DBXTeamTeamFolderGetInfoItem { + @objc + public var teamFolderMetadata: DBXTeamTeamFolderMetadata + + @objc + public init(_ arg: DBXTeamTeamFolderMetadata) { + self.teamFolderMetadata = arg + let swift = Team.TeamFolderGetInfoItem.teamFolderMetadata(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderIdListArg struct +@objc +public class DBXTeamTeamFolderIdListArg: NSObject { + /// The list of team folder IDs. + @objc + public var teamFolderIds: [String] { swift.teamFolderIds } + + @objc + public init(teamFolderIds: [String]) { + self.swift = Team.TeamFolderIdListArg(teamFolderIds: teamFolderIds) + } + + let swift: Team.TeamFolderIdListArg + + public init(swift: Team.TeamFolderIdListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderInvalidStatusError union +@objc +public class DBXTeamTeamFolderInvalidStatusError: NSObject { + let swift: Team.TeamFolderInvalidStatusError + + public init(swift: Team.TeamFolderInvalidStatusError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderInvalidStatusError) -> DBXTeamTeamFolderInvalidStatusError { + switch swift { + case .active: + return DBXTeamTeamFolderInvalidStatusErrorActive() + case .archived: + return DBXTeamTeamFolderInvalidStatusErrorArchived() + case .archiveInProgress: + return DBXTeamTeamFolderInvalidStatusErrorArchiveInProgress() + case .other: + return DBXTeamTeamFolderInvalidStatusErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXTeamTeamFolderInvalidStatusErrorActive? { + self as? DBXTeamTeamFolderInvalidStatusErrorActive + } + + @objc + public var asArchived: DBXTeamTeamFolderInvalidStatusErrorArchived? { + self as? DBXTeamTeamFolderInvalidStatusErrorArchived + } + + @objc + public var asArchiveInProgress: DBXTeamTeamFolderInvalidStatusErrorArchiveInProgress? { + self as? DBXTeamTeamFolderInvalidStatusErrorArchiveInProgress + } + + @objc + public var asOther: DBXTeamTeamFolderInvalidStatusErrorOther? { + self as? DBXTeamTeamFolderInvalidStatusErrorOther + } +} + +/// The folder is active and the operation did not succeed. +@objc +public class DBXTeamTeamFolderInvalidStatusErrorActive: DBXTeamTeamFolderInvalidStatusError { + @objc + public init() { + let swift = Team.TeamFolderInvalidStatusError.active + super.init(swift: swift) + } +} + +/// The folder is archived and the operation did not succeed. +@objc +public class DBXTeamTeamFolderInvalidStatusErrorArchived: DBXTeamTeamFolderInvalidStatusError { + @objc + public init() { + let swift = Team.TeamFolderInvalidStatusError.archived + super.init(swift: swift) + } +} + +/// The folder is being archived and the operation did not succeed. +@objc +public class DBXTeamTeamFolderInvalidStatusErrorArchiveInProgress: DBXTeamTeamFolderInvalidStatusError { + @objc + public init() { + let swift = Team.TeamFolderInvalidStatusError.archiveInProgress + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderInvalidStatusErrorOther: DBXTeamTeamFolderInvalidStatusError { + @objc + public init() { + let swift = Team.TeamFolderInvalidStatusError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderListArg struct +@objc +public class DBXTeamTeamFolderListArg: NSObject { + /// The maximum number of results to return per request. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(limit: NSNumber) { + self.swift = Team.TeamFolderListArg(limit: limit.uint32Value) + } + + let swift: Team.TeamFolderListArg + + public init(swift: Team.TeamFolderListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderListContinueArg struct +@objc +public class DBXTeamTeamFolderListContinueArg: NSObject { + /// Indicates from what point to get the next set of team folders. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Team.TeamFolderListContinueArg(cursor: cursor) + } + + let swift: Team.TeamFolderListContinueArg + + public init(swift: Team.TeamFolderListContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderListContinueError union +@objc +public class DBXTeamTeamFolderListContinueError: NSObject { + let swift: Team.TeamFolderListContinueError + + public init(swift: Team.TeamFolderListContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderListContinueError) -> DBXTeamTeamFolderListContinueError { + switch swift { + case .invalidCursor: + return DBXTeamTeamFolderListContinueErrorInvalidCursor() + case .other: + return DBXTeamTeamFolderListContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidCursor: DBXTeamTeamFolderListContinueErrorInvalidCursor? { + self as? DBXTeamTeamFolderListContinueErrorInvalidCursor + } + + @objc + public var asOther: DBXTeamTeamFolderListContinueErrorOther? { + self as? DBXTeamTeamFolderListContinueErrorOther + } +} + +/// The cursor is invalid. +@objc +public class DBXTeamTeamFolderListContinueErrorInvalidCursor: DBXTeamTeamFolderListContinueError { + @objc + public init() { + let swift = Team.TeamFolderListContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderListContinueErrorOther: DBXTeamTeamFolderListContinueError { + @objc + public init() { + let swift = Team.TeamFolderListContinueError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderListError struct +@objc +public class DBXTeamTeamFolderListError: NSObject { + /// (no description) + @objc + public var accessError: DBXTeamTeamFolderAccessError { DBXTeamTeamFolderAccessError(swift: swift.accessError) } + + @objc + public init(accessError: DBXTeamTeamFolderAccessError) { + self.swift = Team.TeamFolderListError(accessError: accessError.swift) + } + + let swift: Team.TeamFolderListError + + public init(swift: Team.TeamFolderListError) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result for teamFolderList and teamFolderListContinue. +@objc +public class DBXTeamTeamFolderListResult: NSObject { + /// List of all team folders in the authenticated team. + @objc + public var teamFolders: [DBXTeamTeamFolderMetadata] { swift.teamFolders.map { DBXTeamTeamFolderMetadata(swift: $0) } } + /// Pass the cursor into teamFolderListContinue to obtain additional team folders. + @objc + public var cursor: String { swift.cursor } + /// Is true if there are additional team folders that have not been returned yet. An additional call to + /// teamFolderListContinue can retrieve them. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(teamFolders: [DBXTeamTeamFolderMetadata], cursor: String, hasMore: NSNumber) { + self.swift = Team.TeamFolderListResult(teamFolders: teamFolders.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Team.TeamFolderListResult + + public init(swift: Team.TeamFolderListResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Properties of a team folder. +@objc +public class DBXTeamTeamFolderMetadata: NSObject { + /// The ID of the team folder. + @objc + public var teamFolderId: String { swift.teamFolderId } + /// The name of the team folder. + @objc + public var name: String { swift.name } + /// The status of the team folder. + @objc + public var status: DBXTeamTeamFolderStatus { DBXTeamTeamFolderStatus(swift: swift.status) } + /// True if this team folder is a shared team root. + @objc + public var isTeamSharedDropbox: NSNumber { swift.isTeamSharedDropbox as NSNumber } + /// The sync setting applied to this team folder. + @objc + public var syncSetting: DBXFilesSyncSetting { DBXFilesSyncSetting(swift: swift.syncSetting) } + /// Sync settings applied to contents of this team folder. + @objc + public var contentSyncSettings: [DBXFilesContentSyncSetting] { swift.contentSyncSettings.map { DBXFilesContentSyncSetting(swift: $0) } } + + @objc + public init( + teamFolderId: String, + name: String, + status: DBXTeamTeamFolderStatus, + isTeamSharedDropbox: NSNumber, + syncSetting: DBXFilesSyncSetting, + contentSyncSettings: [DBXFilesContentSyncSetting] + ) { + self.swift = Team.TeamFolderMetadata( + teamFolderId: teamFolderId, + name: name, + status: status.swift, + isTeamSharedDropbox: isTeamSharedDropbox.boolValue, + syncSetting: syncSetting.swift, + contentSyncSettings: contentSyncSettings.map(\.swift) + ) + } + + let swift: Team.TeamFolderMetadata + + public init(swift: Team.TeamFolderMetadata) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderPermanentlyDeleteError union +@objc +public class DBXTeamTeamFolderPermanentlyDeleteError: NSObject { + let swift: Team.TeamFolderPermanentlyDeleteError + + public init(swift: Team.TeamFolderPermanentlyDeleteError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderPermanentlyDeleteError) -> DBXTeamTeamFolderPermanentlyDeleteError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXTeamTeamFolderAccessError(swift: swiftArg) + return DBXTeamTeamFolderPermanentlyDeleteErrorAccessError(arg) + case .statusError(let swiftArg): + let arg = DBXTeamTeamFolderInvalidStatusError(swift: swiftArg) + return DBXTeamTeamFolderPermanentlyDeleteErrorStatusError(arg) + case .teamSharedDropboxError(let swiftArg): + let arg = DBXTeamTeamFolderTeamSharedDropboxError(swift: swiftArg) + return DBXTeamTeamFolderPermanentlyDeleteErrorTeamSharedDropboxError(arg) + case .other: + return DBXTeamTeamFolderPermanentlyDeleteErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXTeamTeamFolderPermanentlyDeleteErrorAccessError? { + self as? DBXTeamTeamFolderPermanentlyDeleteErrorAccessError + } + + @objc + public var asStatusError: DBXTeamTeamFolderPermanentlyDeleteErrorStatusError? { + self as? DBXTeamTeamFolderPermanentlyDeleteErrorStatusError + } + + @objc + public var asTeamSharedDropboxError: DBXTeamTeamFolderPermanentlyDeleteErrorTeamSharedDropboxError? { + self as? DBXTeamTeamFolderPermanentlyDeleteErrorTeamSharedDropboxError + } + + @objc + public var asOther: DBXTeamTeamFolderPermanentlyDeleteErrorOther? { + self as? DBXTeamTeamFolderPermanentlyDeleteErrorOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderPermanentlyDeleteErrorAccessError: DBXTeamTeamFolderPermanentlyDeleteError { + @objc + public var accessError: DBXTeamTeamFolderAccessError + + @objc + public init(_ arg: DBXTeamTeamFolderAccessError) { + self.accessError = arg + let swift = Team.TeamFolderPermanentlyDeleteError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderPermanentlyDeleteErrorStatusError: DBXTeamTeamFolderPermanentlyDeleteError { + @objc + public var statusError: DBXTeamTeamFolderInvalidStatusError + + @objc + public init(_ arg: DBXTeamTeamFolderInvalidStatusError) { + self.statusError = arg + let swift = Team.TeamFolderPermanentlyDeleteError.statusError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderPermanentlyDeleteErrorTeamSharedDropboxError: DBXTeamTeamFolderPermanentlyDeleteError { + @objc + public var teamSharedDropboxError: DBXTeamTeamFolderTeamSharedDropboxError + + @objc + public init(_ arg: DBXTeamTeamFolderTeamSharedDropboxError) { + self.teamSharedDropboxError = arg + let swift = Team.TeamFolderPermanentlyDeleteError.teamSharedDropboxError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderPermanentlyDeleteErrorOther: DBXTeamTeamFolderPermanentlyDeleteError { + @objc + public init() { + let swift = Team.TeamFolderPermanentlyDeleteError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderRenameArg struct +@objc +public class DBXTeamTeamFolderRenameArg: DBXTeamTeamFolderIdArg { + /// New team folder name. + @objc + public var name: String { subSwift.name } + + @objc + public init(teamFolderId: String, name: String) { + let swift = Team.TeamFolderRenameArg(teamFolderId: teamFolderId, name: name) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.TeamFolderRenameArg + + public init(swift: Team.TeamFolderRenameArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible TeamFolderRenameError union +@objc +public class DBXTeamTeamFolderRenameError: NSObject { + let swift: Team.TeamFolderRenameError + + public init(swift: Team.TeamFolderRenameError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderRenameError) -> DBXTeamTeamFolderRenameError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXTeamTeamFolderAccessError(swift: swiftArg) + return DBXTeamTeamFolderRenameErrorAccessError(arg) + case .statusError(let swiftArg): + let arg = DBXTeamTeamFolderInvalidStatusError(swift: swiftArg) + return DBXTeamTeamFolderRenameErrorStatusError(arg) + case .teamSharedDropboxError(let swiftArg): + let arg = DBXTeamTeamFolderTeamSharedDropboxError(swift: swiftArg) + return DBXTeamTeamFolderRenameErrorTeamSharedDropboxError(arg) + case .other: + return DBXTeamTeamFolderRenameErrorOther() + case .invalidFolderName: + return DBXTeamTeamFolderRenameErrorInvalidFolderName() + case .folderNameAlreadyUsed: + return DBXTeamTeamFolderRenameErrorFolderNameAlreadyUsed() + case .folderNameReserved: + return DBXTeamTeamFolderRenameErrorFolderNameReserved() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXTeamTeamFolderRenameErrorAccessError? { + self as? DBXTeamTeamFolderRenameErrorAccessError + } + + @objc + public var asStatusError: DBXTeamTeamFolderRenameErrorStatusError? { + self as? DBXTeamTeamFolderRenameErrorStatusError + } + + @objc + public var asTeamSharedDropboxError: DBXTeamTeamFolderRenameErrorTeamSharedDropboxError? { + self as? DBXTeamTeamFolderRenameErrorTeamSharedDropboxError + } + + @objc + public var asOther: DBXTeamTeamFolderRenameErrorOther? { + self as? DBXTeamTeamFolderRenameErrorOther + } + + @objc + public var asInvalidFolderName: DBXTeamTeamFolderRenameErrorInvalidFolderName? { + self as? DBXTeamTeamFolderRenameErrorInvalidFolderName + } + + @objc + public var asFolderNameAlreadyUsed: DBXTeamTeamFolderRenameErrorFolderNameAlreadyUsed? { + self as? DBXTeamTeamFolderRenameErrorFolderNameAlreadyUsed + } + + @objc + public var asFolderNameReserved: DBXTeamTeamFolderRenameErrorFolderNameReserved? { + self as? DBXTeamTeamFolderRenameErrorFolderNameReserved + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderRenameErrorAccessError: DBXTeamTeamFolderRenameError { + @objc + public var accessError: DBXTeamTeamFolderAccessError + + @objc + public init(_ arg: DBXTeamTeamFolderAccessError) { + self.accessError = arg + let swift = Team.TeamFolderRenameError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderRenameErrorStatusError: DBXTeamTeamFolderRenameError { + @objc + public var statusError: DBXTeamTeamFolderInvalidStatusError + + @objc + public init(_ arg: DBXTeamTeamFolderInvalidStatusError) { + self.statusError = arg + let swift = Team.TeamFolderRenameError.statusError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderRenameErrorTeamSharedDropboxError: DBXTeamTeamFolderRenameError { + @objc + public var teamSharedDropboxError: DBXTeamTeamFolderTeamSharedDropboxError + + @objc + public init(_ arg: DBXTeamTeamFolderTeamSharedDropboxError) { + self.teamSharedDropboxError = arg + let swift = Team.TeamFolderRenameError.teamSharedDropboxError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderRenameErrorOther: DBXTeamTeamFolderRenameError { + @objc + public init() { + let swift = Team.TeamFolderRenameError.other + super.init(swift: swift) + } +} + +/// The provided folder name cannot be used. +@objc +public class DBXTeamTeamFolderRenameErrorInvalidFolderName: DBXTeamTeamFolderRenameError { + @objc + public init() { + let swift = Team.TeamFolderRenameError.invalidFolderName + super.init(swift: swift) + } +} + +/// There is already a team folder with the same name. +@objc +public class DBXTeamTeamFolderRenameErrorFolderNameAlreadyUsed: DBXTeamTeamFolderRenameError { + @objc + public init() { + let swift = Team.TeamFolderRenameError.folderNameAlreadyUsed + super.init(swift: swift) + } +} + +/// The provided name cannot be used because it is reserved. +@objc +public class DBXTeamTeamFolderRenameErrorFolderNameReserved: DBXTeamTeamFolderRenameError { + @objc + public init() { + let swift = Team.TeamFolderRenameError.folderNameReserved + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderStatus union +@objc +public class DBXTeamTeamFolderStatus: NSObject { + let swift: Team.TeamFolderStatus + + public init(swift: Team.TeamFolderStatus) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderStatus) -> DBXTeamTeamFolderStatus { + switch swift { + case .active: + return DBXTeamTeamFolderStatusActive() + case .archived: + return DBXTeamTeamFolderStatusArchived() + case .archiveInProgress: + return DBXTeamTeamFolderStatusArchiveInProgress() + case .other: + return DBXTeamTeamFolderStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXTeamTeamFolderStatusActive? { + self as? DBXTeamTeamFolderStatusActive + } + + @objc + public var asArchived: DBXTeamTeamFolderStatusArchived? { + self as? DBXTeamTeamFolderStatusArchived + } + + @objc + public var asArchiveInProgress: DBXTeamTeamFolderStatusArchiveInProgress? { + self as? DBXTeamTeamFolderStatusArchiveInProgress + } + + @objc + public var asOther: DBXTeamTeamFolderStatusOther? { + self as? DBXTeamTeamFolderStatusOther + } +} + +/// The team folder and sub-folders are available to all members. +@objc +public class DBXTeamTeamFolderStatusActive: DBXTeamTeamFolderStatus { + @objc + public init() { + let swift = Team.TeamFolderStatus.active + super.init(swift: swift) + } +} + +/// The team folder is not accessible outside of the team folder manager. +@objc +public class DBXTeamTeamFolderStatusArchived: DBXTeamTeamFolderStatus { + @objc + public init() { + let swift = Team.TeamFolderStatus.archived + super.init(swift: swift) + } +} + +/// The team folder is not accessible outside of the team folder manager. +@objc +public class DBXTeamTeamFolderStatusArchiveInProgress: DBXTeamTeamFolderStatus { + @objc + public init() { + let swift = Team.TeamFolderStatus.archiveInProgress + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderStatusOther: DBXTeamTeamFolderStatus { + @objc + public init() { + let swift = Team.TeamFolderStatus.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderTeamSharedDropboxError union +@objc +public class DBXTeamTeamFolderTeamSharedDropboxError: NSObject { + let swift: Team.TeamFolderTeamSharedDropboxError + + public init(swift: Team.TeamFolderTeamSharedDropboxError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderTeamSharedDropboxError) -> DBXTeamTeamFolderTeamSharedDropboxError { + switch swift { + case .disallowed: + return DBXTeamTeamFolderTeamSharedDropboxErrorDisallowed() + case .other: + return DBXTeamTeamFolderTeamSharedDropboxErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisallowed: DBXTeamTeamFolderTeamSharedDropboxErrorDisallowed? { + self as? DBXTeamTeamFolderTeamSharedDropboxErrorDisallowed + } + + @objc + public var asOther: DBXTeamTeamFolderTeamSharedDropboxErrorOther? { + self as? DBXTeamTeamFolderTeamSharedDropboxErrorOther + } +} + +/// This action is not allowed for a shared team root. +@objc +public class DBXTeamTeamFolderTeamSharedDropboxErrorDisallowed: DBXTeamTeamFolderTeamSharedDropboxError { + @objc + public init() { + let swift = Team.TeamFolderTeamSharedDropboxError.disallowed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderTeamSharedDropboxErrorOther: DBXTeamTeamFolderTeamSharedDropboxError { + @objc + public init() { + let swift = Team.TeamFolderTeamSharedDropboxError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamFolderUpdateSyncSettingsArg struct +@objc +public class DBXTeamTeamFolderUpdateSyncSettingsArg: DBXTeamTeamFolderIdArg { + /// Sync setting to apply to the team folder itself. Only meaningful if the team folder is not a shared team + /// root. + @objc + public var syncSetting: DBXFilesSyncSettingArg? { guard let swift = subSwift.syncSetting else { return nil } + return DBXFilesSyncSettingArg(swift: swift) + } + + /// Sync settings to apply to contents of this team folder. + @objc + public var contentSyncSettings: [DBXFilesContentSyncSettingArg]? { subSwift.contentSyncSettings?.map { DBXFilesContentSyncSettingArg(swift: $0) } } + + @objc + public init(teamFolderId: String, syncSetting: DBXFilesSyncSettingArg?, contentSyncSettings: [DBXFilesContentSyncSettingArg]?) { + let swift = Team.TeamFolderUpdateSyncSettingsArg( + teamFolderId: teamFolderId, + syncSetting: syncSetting?.swift, + contentSyncSettings: contentSyncSettings?.map(\.swift) + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.TeamFolderUpdateSyncSettingsArg + + public init(swift: Team.TeamFolderUpdateSyncSettingsArg) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible TeamFolderUpdateSyncSettingsError union +@objc +public class DBXTeamTeamFolderUpdateSyncSettingsError: NSObject { + let swift: Team.TeamFolderUpdateSyncSettingsError + + public init(swift: Team.TeamFolderUpdateSyncSettingsError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamFolderUpdateSyncSettingsError) -> DBXTeamTeamFolderUpdateSyncSettingsError { + switch swift { + case .accessError(let swiftArg): + let arg = DBXTeamTeamFolderAccessError(swift: swiftArg) + return DBXTeamTeamFolderUpdateSyncSettingsErrorAccessError(arg) + case .statusError(let swiftArg): + let arg = DBXTeamTeamFolderInvalidStatusError(swift: swiftArg) + return DBXTeamTeamFolderUpdateSyncSettingsErrorStatusError(arg) + case .teamSharedDropboxError(let swiftArg): + let arg = DBXTeamTeamFolderTeamSharedDropboxError(swift: swiftArg) + return DBXTeamTeamFolderUpdateSyncSettingsErrorTeamSharedDropboxError(arg) + case .other: + return DBXTeamTeamFolderUpdateSyncSettingsErrorOther() + case .syncSettingsError(let swiftArg): + let arg = DBXFilesSyncSettingsError(swift: swiftArg) + return DBXTeamTeamFolderUpdateSyncSettingsErrorSyncSettingsError(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccessError: DBXTeamTeamFolderUpdateSyncSettingsErrorAccessError? { + self as? DBXTeamTeamFolderUpdateSyncSettingsErrorAccessError + } + + @objc + public var asStatusError: DBXTeamTeamFolderUpdateSyncSettingsErrorStatusError? { + self as? DBXTeamTeamFolderUpdateSyncSettingsErrorStatusError + } + + @objc + public var asTeamSharedDropboxError: DBXTeamTeamFolderUpdateSyncSettingsErrorTeamSharedDropboxError? { + self as? DBXTeamTeamFolderUpdateSyncSettingsErrorTeamSharedDropboxError + } + + @objc + public var asOther: DBXTeamTeamFolderUpdateSyncSettingsErrorOther? { + self as? DBXTeamTeamFolderUpdateSyncSettingsErrorOther + } + + @objc + public var asSyncSettingsError: DBXTeamTeamFolderUpdateSyncSettingsErrorSyncSettingsError? { + self as? DBXTeamTeamFolderUpdateSyncSettingsErrorSyncSettingsError + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderUpdateSyncSettingsErrorAccessError: DBXTeamTeamFolderUpdateSyncSettingsError { + @objc + public var accessError: DBXTeamTeamFolderAccessError + + @objc + public init(_ arg: DBXTeamTeamFolderAccessError) { + self.accessError = arg + let swift = Team.TeamFolderUpdateSyncSettingsError.accessError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderUpdateSyncSettingsErrorStatusError: DBXTeamTeamFolderUpdateSyncSettingsError { + @objc + public var statusError: DBXTeamTeamFolderInvalidStatusError + + @objc + public init(_ arg: DBXTeamTeamFolderInvalidStatusError) { + self.statusError = arg + let swift = Team.TeamFolderUpdateSyncSettingsError.statusError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderUpdateSyncSettingsErrorTeamSharedDropboxError: DBXTeamTeamFolderUpdateSyncSettingsError { + @objc + public var teamSharedDropboxError: DBXTeamTeamFolderTeamSharedDropboxError + + @objc + public init(_ arg: DBXTeamTeamFolderTeamSharedDropboxError) { + self.teamSharedDropboxError = arg + let swift = Team.TeamFolderUpdateSyncSettingsError.teamSharedDropboxError(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamFolderUpdateSyncSettingsErrorOther: DBXTeamTeamFolderUpdateSyncSettingsError { + @objc + public init() { + let swift = Team.TeamFolderUpdateSyncSettingsError.other + super.init(swift: swift) + } +} + +/// An error occurred setting the sync settings. +@objc +public class DBXTeamTeamFolderUpdateSyncSettingsErrorSyncSettingsError: DBXTeamTeamFolderUpdateSyncSettingsError { + @objc + public var syncSettingsError: DBXFilesSyncSettingsError + + @objc + public init(_ arg: DBXFilesSyncSettingsError) { + self.syncSettingsError = arg + let swift = Team.TeamFolderUpdateSyncSettingsError.syncSettingsError(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamGetInfoResult struct +@objc +public class DBXTeamTeamGetInfoResult: NSObject { + /// The name of the team. + @objc + public var name: String { swift.name } + /// The ID of the team. + @objc + public var teamId: String { swift.teamId } + /// The number of licenses available to the team. + @objc + public var numLicensedUsers: NSNumber { swift.numLicensedUsers as NSNumber } + /// The number of accounts that have been invited or are already active members of the team. + @objc + public var numProvisionedUsers: NSNumber { swift.numProvisionedUsers as NSNumber } + /// The number of licenses used on the team. + @objc + public var numUsedLicenses: NSNumber { swift.numUsedLicenses as NSNumber } + /// (no description) + @objc + public var policies: DBXTeamPoliciesTeamMemberPolicies { DBXTeamPoliciesTeamMemberPolicies(swift: swift.policies) } + + @objc + public init( + name: String, + teamId: String, + numLicensedUsers: NSNumber, + numProvisionedUsers: NSNumber, + policies: DBXTeamPoliciesTeamMemberPolicies, + numUsedLicenses: NSNumber + ) { + self.swift = Team.TeamGetInfoResult( + name: name, + teamId: teamId, + numLicensedUsers: numLicensedUsers.uint32Value, + numProvisionedUsers: numProvisionedUsers.uint32Value, + policies: policies.swift, + numUsedLicenses: numUsedLicenses.uint32Value + ) + } + + let swift: Team.TeamGetInfoResult + + public init(swift: Team.TeamGetInfoResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about a team member. +@objc +public class DBXTeamTeamMemberInfo: NSObject { + /// Profile of a user as a member of a team. + @objc + public var profile: DBXTeamTeamMemberProfile { DBXTeamTeamMemberProfile(swift: swift.profile) } + /// The user's role in the team. + @objc + public var role: DBXTeamAdminTier { DBXTeamAdminTier(swift: swift.role) } + + @objc + public init(profile: DBXTeamTeamMemberProfile, role: DBXTeamAdminTier) { + self.swift = Team.TeamMemberInfo(profile: profile.subSwift, role: role.swift) + } + + let swift: Team.TeamMemberInfo + + public init(swift: Team.TeamMemberInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about a team member. +@objc +public class DBXTeamTeamMemberInfoV2: NSObject { + /// Profile of a user as a member of a team. + @objc + public var profile: DBXTeamTeamMemberProfile { DBXTeamTeamMemberProfile(swift: swift.profile) } + /// The user's roles in the team. + @objc + public var roles: [DBXTeamTeamMemberRole]? { swift.roles?.map { DBXTeamTeamMemberRole(swift: $0) } } + + @objc + public init(profile: DBXTeamTeamMemberProfile, roles: [DBXTeamTeamMemberRole]?) { + self.swift = Team.TeamMemberInfoV2(profile: profile.subSwift, roles: roles?.map(\.swift)) + } + + let swift: Team.TeamMemberInfoV2 + + public init(swift: Team.TeamMemberInfoV2) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about a team member, after the change, like at membersSetProfileV2. +@objc +public class DBXTeamTeamMemberInfoV2Result: NSObject { + /// Member info, after the change. + @objc + public var memberInfo: DBXTeamTeamMemberInfoV2 { DBXTeamTeamMemberInfoV2(swift: swift.memberInfo) } + + @objc + public init(memberInfo: DBXTeamTeamMemberInfoV2) { + self.swift = Team.TeamMemberInfoV2Result(memberInfo: memberInfo.swift) + } + + let swift: Team.TeamMemberInfoV2Result + + public init(swift: Team.TeamMemberInfoV2Result) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Profile of a user as a member of a team. +@objc +public class DBXTeamTeamMemberProfile: DBXTeamMemberProfile { + /// List of group IDs of groups that the user belongs to. + @objc + public var groups: [String] { subSwift.groups } + /// The namespace id of the user's root folder. + @objc + public var memberFolderId: String { subSwift.memberFolderId } + + @objc + public init( + teamMemberId: String, + email: String, + emailVerified: NSNumber, + status: DBXTeamTeamMemberStatus, + name: DBXUsersName, + membershipType: DBXTeamTeamMembershipType, + groups: [String], + memberFolderId: String, + externalId: String?, + accountId: String?, + secondaryEmails: [DBXSecondaryEmailsSecondaryEmail]?, + invitedOn: Date?, + joinedOn: Date?, + suspendedOn: Date?, + persistentId: String?, + isDirectoryRestricted: NSNumber?, + profilePhotoUrl: String? + ) { + let swift = Team.TeamMemberProfile( + teamMemberId: teamMemberId, + email: email, + emailVerified: emailVerified.boolValue, + status: status.swift, + name: name.swift, + membershipType: membershipType.swift, + groups: groups, + memberFolderId: memberFolderId, + externalId: externalId, + accountId: accountId, + secondaryEmails: secondaryEmails?.map(\.swift), + invitedOn: invitedOn, + joinedOn: joinedOn, + suspendedOn: suspendedOn, + persistentId: persistentId, + isDirectoryRestricted: isDirectoryRestricted?.boolValue, + profilePhotoUrl: profilePhotoUrl + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Team.TeamMemberProfile + + public init(swift: Team.TeamMemberProfile) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// A role which can be attached to a team member. This replaces AdminTier; each AdminTier corresponds to a new +/// TeamMemberRole with a matching name. +@objc +public class DBXTeamTeamMemberRole: NSObject { + /// A string containing encoded role ID. For roles defined by Dropbox, this is the same across all teams. + @objc + public var roleId: String { swift.roleId } + /// The role display name. + @objc + public var name: String { swift.name } + /// Role description. Describes which permissions come with this role. + @objc + public var description_: String { swift.description_ } + + @objc + public init(roleId: String, name: String, description_: String) { + self.swift = Team.TeamMemberRole(roleId: roleId, name: name, description_: description_) + } + + let swift: Team.TeamMemberRole + + public init(swift: Team.TeamMemberRole) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The user's status as a member of a specific team. +@objc +public class DBXTeamTeamMemberStatus: NSObject { + let swift: Team.TeamMemberStatus + + public init(swift: Team.TeamMemberStatus) { + self.swift = swift + } + + public static func factory(swift: Team.TeamMemberStatus) -> DBXTeamTeamMemberStatus { + switch swift { + case .active: + return DBXTeamTeamMemberStatusActive() + case .invited: + return DBXTeamTeamMemberStatusInvited() + case .suspended: + return DBXTeamTeamMemberStatusSuspended() + case .removed(let swiftArg): + let arg = DBXTeamRemovedStatus(swift: swiftArg) + return DBXTeamTeamMemberStatusRemoved(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXTeamTeamMemberStatusActive? { + self as? DBXTeamTeamMemberStatusActive + } + + @objc + public var asInvited: DBXTeamTeamMemberStatusInvited? { + self as? DBXTeamTeamMemberStatusInvited + } + + @objc + public var asSuspended: DBXTeamTeamMemberStatusSuspended? { + self as? DBXTeamTeamMemberStatusSuspended + } + + @objc + public var asRemoved: DBXTeamTeamMemberStatusRemoved? { + self as? DBXTeamTeamMemberStatusRemoved + } +} + +/// User has successfully joined the team. +@objc +public class DBXTeamTeamMemberStatusActive: DBXTeamTeamMemberStatus { + @objc + public init() { + let swift = Team.TeamMemberStatus.active + super.init(swift: swift) + } +} + +/// User has been invited to a team, but has not joined the team yet. +@objc +public class DBXTeamTeamMemberStatusInvited: DBXTeamTeamMemberStatus { + @objc + public init() { + let swift = Team.TeamMemberStatus.invited + super.init(swift: swift) + } +} + +/// User is no longer a member of the team, but the account can be un-suspended, re-establishing the user as a +/// team member. +@objc +public class DBXTeamTeamMemberStatusSuspended: DBXTeamTeamMemberStatus { + @objc + public init() { + let swift = Team.TeamMemberStatus.suspended + super.init(swift: swift) + } +} + +/// User is no longer a member of the team. Removed users are only listed when include_removed is true in +/// members/list. +@objc +public class DBXTeamTeamMemberStatusRemoved: DBXTeamTeamMemberStatus { + @objc + public var removed: DBXTeamRemovedStatus + + @objc + public init(_ arg: DBXTeamRemovedStatus) { + self.removed = arg + let swift = Team.TeamMemberStatus.removed(arg.swift) + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamMembershipType union +@objc +public class DBXTeamTeamMembershipType: NSObject { + let swift: Team.TeamMembershipType + + public init(swift: Team.TeamMembershipType) { + self.swift = swift + } + + public static func factory(swift: Team.TeamMembershipType) -> DBXTeamTeamMembershipType { + switch swift { + case .full: + return DBXTeamTeamMembershipTypeFull() + case .limited: + return DBXTeamTeamMembershipTypeLimited() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFull: DBXTeamTeamMembershipTypeFull? { + self as? DBXTeamTeamMembershipTypeFull + } + + @objc + public var asLimited: DBXTeamTeamMembershipTypeLimited? { + self as? DBXTeamTeamMembershipTypeLimited + } +} + +/// User uses a license and has full access to team resources like the shared quota. +@objc +public class DBXTeamTeamMembershipTypeFull: DBXTeamTeamMembershipType { + @objc + public init() { + let swift = Team.TeamMembershipType.full + super.init(swift: swift) + } +} + +/// User does not have access to the shared quota and team admins have restricted administrative control. +@objc +public class DBXTeamTeamMembershipTypeLimited: DBXTeamTeamMembershipType { + @objc + public init() { + let swift = Team.TeamMembershipType.limited + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamNamespacesListArg struct +@objc +public class DBXTeamTeamNamespacesListArg: NSObject { + /// Specifying a value here has no effect. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(limit: NSNumber) { + self.swift = Team.TeamNamespacesListArg(limit: limit.uint32Value) + } + + let swift: Team.TeamNamespacesListArg + + public init(swift: Team.TeamNamespacesListArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamNamespacesListContinueArg struct +@objc +public class DBXTeamTeamNamespacesListContinueArg: NSObject { + /// Indicates from what point to get the next set of team-accessible namespaces. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = Team.TeamNamespacesListContinueArg(cursor: cursor) + } + + let swift: Team.TeamNamespacesListContinueArg + + public init(swift: Team.TeamNamespacesListContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamNamespacesListError union +@objc +public class DBXTeamTeamNamespacesListError: NSObject { + let swift: Team.TeamNamespacesListError + + public init(swift: Team.TeamNamespacesListError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamNamespacesListError) -> DBXTeamTeamNamespacesListError { + switch swift { + case .invalidArg: + return DBXTeamTeamNamespacesListErrorInvalidArg() + case .other: + return DBXTeamTeamNamespacesListErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidArg: DBXTeamTeamNamespacesListErrorInvalidArg? { + self as? DBXTeamTeamNamespacesListErrorInvalidArg + } + + @objc + public var asOther: DBXTeamTeamNamespacesListErrorOther? { + self as? DBXTeamTeamNamespacesListErrorOther + } +} + +/// Argument passed in is invalid. +@objc +public class DBXTeamTeamNamespacesListErrorInvalidArg: DBXTeamTeamNamespacesListError { + @objc + public init() { + let swift = Team.TeamNamespacesListError.invalidArg + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamNamespacesListErrorOther: DBXTeamTeamNamespacesListError { + @objc + public init() { + let swift = Team.TeamNamespacesListError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TeamNamespacesListContinueError union +@objc +public class DBXTeamTeamNamespacesListContinueError: NSObject { + let swift: Team.TeamNamespacesListContinueError + + public init(swift: Team.TeamNamespacesListContinueError) { + self.swift = swift + } + + public static func factory(swift: Team.TeamNamespacesListContinueError) -> DBXTeamTeamNamespacesListContinueError { + switch swift { + case .invalidArg: + return DBXTeamTeamNamespacesListContinueErrorInvalidArg() + case .other: + return DBXTeamTeamNamespacesListContinueErrorOther() + case .invalidCursor: + return DBXTeamTeamNamespacesListContinueErrorInvalidCursor() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvalidArg: DBXTeamTeamNamespacesListContinueErrorInvalidArg? { + self as? DBXTeamTeamNamespacesListContinueErrorInvalidArg + } + + @objc + public var asOther: DBXTeamTeamNamespacesListContinueErrorOther? { + self as? DBXTeamTeamNamespacesListContinueErrorOther + } + + @objc + public var asInvalidCursor: DBXTeamTeamNamespacesListContinueErrorInvalidCursor? { + self as? DBXTeamTeamNamespacesListContinueErrorInvalidCursor + } +} + +/// Argument passed in is invalid. +@objc +public class DBXTeamTeamNamespacesListContinueErrorInvalidArg: DBXTeamTeamNamespacesListContinueError { + @objc + public init() { + let swift = Team.TeamNamespacesListContinueError.invalidArg + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamNamespacesListContinueErrorOther: DBXTeamTeamNamespacesListContinueError { + @objc + public init() { + let swift = Team.TeamNamespacesListContinueError.other + super.init(swift: swift) + } +} + +/// The cursor is invalid. +@objc +public class DBXTeamTeamNamespacesListContinueErrorInvalidCursor: DBXTeamTeamNamespacesListContinueError { + @objc + public init() { + let swift = Team.TeamNamespacesListContinueError.invalidCursor + super.init(swift: swift) + } +} + +/// Result for namespacesList. +@objc +public class DBXTeamTeamNamespacesListResult: NSObject { + /// List of all namespaces the team can access. + @objc + public var namespaces: [DBXTeamNamespaceMetadata] { swift.namespaces.map { DBXTeamNamespaceMetadata(swift: $0) } } + /// Pass the cursor into namespacesListContinue to obtain additional namespaces. Note that duplicate namespaces + /// may be returned. + @objc + public var cursor: String { swift.cursor } + /// Is true if there are additional namespaces that have not been returned yet. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(namespaces: [DBXTeamNamespaceMetadata], cursor: String, hasMore: NSNumber) { + self.swift = Team.TeamNamespacesListResult(namespaces: namespaces.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: Team.TeamNamespacesListResult + + public init(swift: Team.TeamNamespacesListResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamReportFailureReason union +@objc +public class DBXTeamTeamReportFailureReason: NSObject { + let swift: Team.TeamReportFailureReason + + public init(swift: Team.TeamReportFailureReason) { + self.swift = swift + } + + public static func factory(swift: Team.TeamReportFailureReason) -> DBXTeamTeamReportFailureReason { + switch swift { + case .temporaryError: + return DBXTeamTeamReportFailureReasonTemporaryError() + case .manyReportsAtOnce: + return DBXTeamTeamReportFailureReasonManyReportsAtOnce() + case .tooMuchData: + return DBXTeamTeamReportFailureReasonTooMuchData() + case .other: + return DBXTeamTeamReportFailureReasonOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTemporaryError: DBXTeamTeamReportFailureReasonTemporaryError? { + self as? DBXTeamTeamReportFailureReasonTemporaryError + } + + @objc + public var asManyReportsAtOnce: DBXTeamTeamReportFailureReasonManyReportsAtOnce? { + self as? DBXTeamTeamReportFailureReasonManyReportsAtOnce + } + + @objc + public var asTooMuchData: DBXTeamTeamReportFailureReasonTooMuchData? { + self as? DBXTeamTeamReportFailureReasonTooMuchData + } + + @objc + public var asOther: DBXTeamTeamReportFailureReasonOther? { + self as? DBXTeamTeamReportFailureReasonOther + } +} + +/// We couldn't create the report, but we think this was a fluke. Everything should work if you try it again. +@objc +public class DBXTeamTeamReportFailureReasonTemporaryError: DBXTeamTeamReportFailureReason { + @objc + public init() { + let swift = Team.TeamReportFailureReason.temporaryError + super.init(swift: swift) + } +} + +/// Too many other reports are being created right now. Try creating this report again once the others finish. +@objc +public class DBXTeamTeamReportFailureReasonManyReportsAtOnce: DBXTeamTeamReportFailureReason { + @objc + public init() { + let swift = Team.TeamReportFailureReason.manyReportsAtOnce + super.init(swift: swift) + } +} + +/// We couldn't create the report. Try creating the report again with less data. +@objc +public class DBXTeamTeamReportFailureReasonTooMuchData: DBXTeamTeamReportFailureReason { + @objc + public init() { + let swift = Team.TeamReportFailureReason.tooMuchData + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTeamReportFailureReasonOther: DBXTeamTeamReportFailureReason { + @objc + public init() { + let swift = Team.TeamReportFailureReason.other + super.init(swift: swift) + } +} + +/// Error returned by tokenGetAuthenticatedAdmin. +@objc +public class DBXTeamTokenGetAuthenticatedAdminError: NSObject { + let swift: Team.TokenGetAuthenticatedAdminError + + public init(swift: Team.TokenGetAuthenticatedAdminError) { + self.swift = swift + } + + public static func factory(swift: Team.TokenGetAuthenticatedAdminError) -> DBXTeamTokenGetAuthenticatedAdminError { + switch swift { + case .mappingNotFound: + return DBXTeamTokenGetAuthenticatedAdminErrorMappingNotFound() + case .adminNotActive: + return DBXTeamTokenGetAuthenticatedAdminErrorAdminNotActive() + case .other: + return DBXTeamTokenGetAuthenticatedAdminErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMappingNotFound: DBXTeamTokenGetAuthenticatedAdminErrorMappingNotFound? { + self as? DBXTeamTokenGetAuthenticatedAdminErrorMappingNotFound + } + + @objc + public var asAdminNotActive: DBXTeamTokenGetAuthenticatedAdminErrorAdminNotActive? { + self as? DBXTeamTokenGetAuthenticatedAdminErrorAdminNotActive + } + + @objc + public var asOther: DBXTeamTokenGetAuthenticatedAdminErrorOther? { + self as? DBXTeamTokenGetAuthenticatedAdminErrorOther + } +} + +/// The current token is not associated with a team admin, because mappings were not recorded when the token was +/// created. Consider re-authorizing a new access token to record its authenticating admin. +@objc +public class DBXTeamTokenGetAuthenticatedAdminErrorMappingNotFound: DBXTeamTokenGetAuthenticatedAdminError { + @objc + public init() { + let swift = Team.TokenGetAuthenticatedAdminError.mappingNotFound + super.init(swift: swift) + } +} + +/// Either the team admin that authorized this token is no longer an active member of the team or no longer a +/// team admin. +@objc +public class DBXTeamTokenGetAuthenticatedAdminErrorAdminNotActive: DBXTeamTokenGetAuthenticatedAdminError { + @objc + public init() { + let swift = Team.TokenGetAuthenticatedAdminError.adminNotActive + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamTokenGetAuthenticatedAdminErrorOther: DBXTeamTokenGetAuthenticatedAdminError { + @objc + public init() { + let swift = Team.TokenGetAuthenticatedAdminError.other + super.init(swift: swift) + } +} + +/// Results for tokenGetAuthenticatedAdmin. +@objc +public class DBXTeamTokenGetAuthenticatedAdminResult: NSObject { + /// The admin who authorized the token. + @objc + public var adminProfile: DBXTeamTeamMemberProfile { DBXTeamTeamMemberProfile(swift: swift.adminProfile) } + + @objc + public init(adminProfile: DBXTeamTeamMemberProfile) { + self.swift = Team.TokenGetAuthenticatedAdminResult(adminProfile: adminProfile.subSwift) + } + + let swift: Team.TokenGetAuthenticatedAdminResult + + public init(swift: Team.TokenGetAuthenticatedAdminResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The value for uploadApiRateLimit in Feature. +@objc +public class DBXTeamUploadApiRateLimitValue: NSObject { + let swift: Team.UploadApiRateLimitValue + + public init(swift: Team.UploadApiRateLimitValue) { + self.swift = swift + } + + public static func factory(swift: Team.UploadApiRateLimitValue) -> DBXTeamUploadApiRateLimitValue { + switch swift { + case .unlimited: + return DBXTeamUploadApiRateLimitValueUnlimited() + case .limit(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXTeamUploadApiRateLimitValueLimit(arg) + case .other: + return DBXTeamUploadApiRateLimitValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnlimited: DBXTeamUploadApiRateLimitValueUnlimited? { + self as? DBXTeamUploadApiRateLimitValueUnlimited + } + + @objc + public var asLimit: DBXTeamUploadApiRateLimitValueLimit? { + self as? DBXTeamUploadApiRateLimitValueLimit + } + + @objc + public var asOther: DBXTeamUploadApiRateLimitValueOther? { + self as? DBXTeamUploadApiRateLimitValueOther + } +} + +/// This team has unlimited upload API quota. So far both server version account and legacy account type have +/// unlimited monthly upload api quota. +@objc +public class DBXTeamUploadApiRateLimitValueUnlimited: DBXTeamUploadApiRateLimitValue { + @objc + public init() { + let swift = Team.UploadApiRateLimitValue.unlimited + super.init(swift: swift) + } +} + +/// The number of upload API calls allowed per month. +@objc +public class DBXTeamUploadApiRateLimitValueLimit: DBXTeamUploadApiRateLimitValue { + @objc + public var limit: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.limit = arg + let swift = Team.UploadApiRateLimitValue.limit(arg.uint32Value) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamUploadApiRateLimitValueOther: DBXTeamUploadApiRateLimitValue { + @objc + public init() { + let swift = Team.UploadApiRateLimitValue.other + super.init(swift: swift) + } +} + +/// Result of trying to add secondary emails to a user. 'success' is the only value indicating that a user was +/// successfully retrieved for adding secondary emails. The other values explain the type of error that occurred, +/// and include the user for which the error occurred. +@objc +public class DBXTeamUserAddResult: NSObject { + let swift: Team.UserAddResult + + public init(swift: Team.UserAddResult) { + self.swift = swift + } + + public static func factory(swift: Team.UserAddResult) -> DBXTeamUserAddResult { + switch swift { + case .success(let swiftArg): + let arg = DBXTeamUserSecondaryEmailsResult(swift: swiftArg) + return DBXTeamUserAddResultSuccess(arg) + case .invalidUser(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamUserAddResultInvalidUser(arg) + case .unverified(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamUserAddResultUnverified(arg) + case .placeholderUser(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamUserAddResultPlaceholderUser(arg) + case .other: + return DBXTeamUserAddResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamUserAddResultSuccess? { + self as? DBXTeamUserAddResultSuccess + } + + @objc + public var asInvalidUser: DBXTeamUserAddResultInvalidUser? { + self as? DBXTeamUserAddResultInvalidUser + } + + @objc + public var asUnverified: DBXTeamUserAddResultUnverified? { + self as? DBXTeamUserAddResultUnverified + } + + @objc + public var asPlaceholderUser: DBXTeamUserAddResultPlaceholderUser? { + self as? DBXTeamUserAddResultPlaceholderUser + } + + @objc + public var asOther: DBXTeamUserAddResultOther? { + self as? DBXTeamUserAddResultOther + } +} + +/// Describes a user and the results for each attempt to add a secondary email. +@objc +public class DBXTeamUserAddResultSuccess: DBXTeamUserAddResult { + @objc + public var success: DBXTeamUserSecondaryEmailsResult + + @objc + public init(_ arg: DBXTeamUserSecondaryEmailsResult) { + self.success = arg + let swift = Team.UserAddResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// Specified user is not a valid target for adding secondary emails. +@objc +public class DBXTeamUserAddResultInvalidUser: DBXTeamUserAddResult { + @objc + public var invalidUser: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.invalidUser = arg + let swift = Team.UserAddResult.invalidUser(arg.swift) + super.init(swift: swift) + } +} + +/// Secondary emails can only be added to verified users. +@objc +public class DBXTeamUserAddResultUnverified: DBXTeamUserAddResult { + @objc + public var unverified: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.unverified = arg + let swift = Team.UserAddResult.unverified(arg.swift) + super.init(swift: swift) + } +} + +/// Secondary emails cannot be added to placeholder users. +@objc +public class DBXTeamUserAddResultPlaceholderUser: DBXTeamUserAddResult { + @objc + public var placeholderUser: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.placeholderUser = arg + let swift = Team.UserAddResult.placeholderUser(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamUserAddResultOther: DBXTeamUserAddResult { + @objc + public init() { + let swift = Team.UserAddResult.other + super.init(swift: swift) + } +} + +/// User and their required custom quota in GB (1 TB = 1024 GB). +@objc +public class DBXTeamUserCustomQuotaArg: NSObject { + /// (no description) + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// (no description) + @objc + public var quotaGb: NSNumber { swift.quotaGb as NSNumber } + + @objc + public init(user: DBXTeamUserSelectorArg, quotaGb: NSNumber) { + self.swift = Team.UserCustomQuotaArg(user: user.swift, quotaGb: quotaGb.uint32Value) + } + + let swift: Team.UserCustomQuotaArg + + public init(swift: Team.UserCustomQuotaArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// User and their custom quota in GB (1 TB = 1024 GB). No quota returns if the user has no custom quota set. +@objc +public class DBXTeamUserCustomQuotaResult: NSObject { + /// (no description) + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// (no description) + @objc + public var quotaGb: NSNumber? { swift.quotaGb as NSNumber? } + + @objc + public init(user: DBXTeamUserSelectorArg, quotaGb: NSNumber?) { + self.swift = Team.UserCustomQuotaResult(user: user.swift, quotaGb: quotaGb?.uint32Value) + } + + let swift: Team.UserCustomQuotaResult + + public init(swift: Team.UserCustomQuotaResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserDeleteEmailsResult struct +@objc +public class DBXTeamUserDeleteEmailsResult: NSObject { + /// (no description) + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// (no description) + @objc + public var results: [DBXTeamDeleteSecondaryEmailResult] { swift.results.map { DBXTeamDeleteSecondaryEmailResult(swift: $0) } } + + @objc + public init(user: DBXTeamUserSelectorArg, results: [DBXTeamDeleteSecondaryEmailResult]) { + self.swift = Team.UserDeleteEmailsResult(user: user.swift, results: results.map(\.swift)) + } + + let swift: Team.UserDeleteEmailsResult + + public init(swift: Team.UserDeleteEmailsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result of trying to delete a user's secondary emails. 'success' is the only value indicating that a user was +/// successfully retrieved for deleting secondary emails. The other values explain the type of error that occurred, +/// and include the user for which the error occurred. +@objc +public class DBXTeamUserDeleteResult: NSObject { + let swift: Team.UserDeleteResult + + public init(swift: Team.UserDeleteResult) { + self.swift = swift + } + + public static func factory(swift: Team.UserDeleteResult) -> DBXTeamUserDeleteResult { + switch swift { + case .success(let swiftArg): + let arg = DBXTeamUserDeleteEmailsResult(swift: swiftArg) + return DBXTeamUserDeleteResultSuccess(arg) + case .invalidUser(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamUserDeleteResultInvalidUser(arg) + case .other: + return DBXTeamUserDeleteResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamUserDeleteResultSuccess? { + self as? DBXTeamUserDeleteResultSuccess + } + + @objc + public var asInvalidUser: DBXTeamUserDeleteResultInvalidUser? { + self as? DBXTeamUserDeleteResultInvalidUser + } + + @objc + public var asOther: DBXTeamUserDeleteResultOther? { + self as? DBXTeamUserDeleteResultOther + } +} + +/// Describes a user and the results for each attempt to delete a secondary email. +@objc +public class DBXTeamUserDeleteResultSuccess: DBXTeamUserDeleteResult { + @objc + public var success: DBXTeamUserDeleteEmailsResult + + @objc + public init(_ arg: DBXTeamUserDeleteEmailsResult) { + self.success = arg + let swift = Team.UserDeleteResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// Specified user is not a valid target for deleting secondary emails. +@objc +public class DBXTeamUserDeleteResultInvalidUser: DBXTeamUserDeleteResult { + @objc + public var invalidUser: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.invalidUser = arg + let swift = Team.UserDeleteResult.invalidUser(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamUserDeleteResultOther: DBXTeamUserDeleteResult { + @objc + public init() { + let swift = Team.UserDeleteResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UserResendEmailsResult struct +@objc +public class DBXTeamUserResendEmailsResult: NSObject { + /// (no description) + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// (no description) + @objc + public var results: [DBXTeamResendSecondaryEmailResult] { swift.results.map { DBXTeamResendSecondaryEmailResult(swift: $0) } } + + @objc + public init(user: DBXTeamUserSelectorArg, results: [DBXTeamResendSecondaryEmailResult]) { + self.swift = Team.UserResendEmailsResult(user: user.swift, results: results.map(\.swift)) + } + + let swift: Team.UserResendEmailsResult + + public init(swift: Team.UserResendEmailsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result of trying to resend verification emails to a user. 'success' is the only value indicating that a user was +/// successfully retrieved for sending verification emails. The other values explain the type of error that +/// occurred, and include the user for which the error occurred. +@objc +public class DBXTeamUserResendResult: NSObject { + let swift: Team.UserResendResult + + public init(swift: Team.UserResendResult) { + self.swift = swift + } + + public static func factory(swift: Team.UserResendResult) -> DBXTeamUserResendResult { + switch swift { + case .success(let swiftArg): + let arg = DBXTeamUserResendEmailsResult(swift: swiftArg) + return DBXTeamUserResendResultSuccess(arg) + case .invalidUser(let swiftArg): + let arg = DBXTeamUserSelectorArg(swift: swiftArg) + return DBXTeamUserResendResultInvalidUser(arg) + case .other: + return DBXTeamUserResendResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asSuccess: DBXTeamUserResendResultSuccess? { + self as? DBXTeamUserResendResultSuccess + } + + @objc + public var asInvalidUser: DBXTeamUserResendResultInvalidUser? { + self as? DBXTeamUserResendResultInvalidUser + } + + @objc + public var asOther: DBXTeamUserResendResultOther? { + self as? DBXTeamUserResendResultOther + } +} + +/// Describes a user and the results for each attempt to resend verification emails. +@objc +public class DBXTeamUserResendResultSuccess: DBXTeamUserResendResult { + @objc + public var success: DBXTeamUserResendEmailsResult + + @objc + public init(_ arg: DBXTeamUserResendEmailsResult) { + self.success = arg + let swift = Team.UserResendResult.success(arg.swift) + super.init(swift: swift) + } +} + +/// Specified user is not a valid target for resending verification emails. +@objc +public class DBXTeamUserResendResultInvalidUser: DBXTeamUserResendResult { + @objc + public var invalidUser: DBXTeamUserSelectorArg + + @objc + public init(_ arg: DBXTeamUserSelectorArg) { + self.invalidUser = arg + let swift = Team.UserResendResult.invalidUser(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamUserResendResultOther: DBXTeamUserResendResult { + @objc + public init() { + let swift = Team.UserResendResult.other + super.init(swift: swift) + } +} + +/// User and a list of secondary emails. +@objc +public class DBXTeamUserSecondaryEmailsArg: NSObject { + /// (no description) + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// (no description) + @objc + public var secondaryEmails: [String] { swift.secondaryEmails } + + @objc + public init(user: DBXTeamUserSelectorArg, secondaryEmails: [String]) { + self.swift = Team.UserSecondaryEmailsArg(user: user.swift, secondaryEmails: secondaryEmails) + } + + let swift: Team.UserSecondaryEmailsArg + + public init(swift: Team.UserSecondaryEmailsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserSecondaryEmailsResult struct +@objc +public class DBXTeamUserSecondaryEmailsResult: NSObject { + /// (no description) + @objc + public var user: DBXTeamUserSelectorArg { DBXTeamUserSelectorArg(swift: swift.user) } + /// (no description) + @objc + public var results: [DBXTeamAddSecondaryEmailResult] { swift.results.map { DBXTeamAddSecondaryEmailResult(swift: $0) } } + + @objc + public init(user: DBXTeamUserSelectorArg, results: [DBXTeamAddSecondaryEmailResult]) { + self.swift = Team.UserSecondaryEmailsResult(user: user.swift, results: results.map(\.swift)) + } + + let swift: Team.UserSecondaryEmailsResult + + public init(swift: Team.UserSecondaryEmailsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Argument for selecting a single user, either by team_member_id, external_id or email. +@objc +public class DBXTeamUserSelectorArg: NSObject { + let swift: Team.UserSelectorArg + + public init(swift: Team.UserSelectorArg) { + self.swift = swift + } + + public static func factory(swift: Team.UserSelectorArg) -> DBXTeamUserSelectorArg { + switch swift { + case .teamMemberId(let swiftArg): + let arg = swiftArg + return DBXTeamUserSelectorArgTeamMemberId(arg) + case .externalId(let swiftArg): + let arg = swiftArg + return DBXTeamUserSelectorArgExternalId(arg) + case .email(let swiftArg): + let arg = swiftArg + return DBXTeamUserSelectorArgEmail(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeamMemberId: DBXTeamUserSelectorArgTeamMemberId? { + self as? DBXTeamUserSelectorArgTeamMemberId + } + + @objc + public var asExternalId: DBXTeamUserSelectorArgExternalId? { + self as? DBXTeamUserSelectorArgExternalId + } + + @objc + public var asEmail: DBXTeamUserSelectorArgEmail? { + self as? DBXTeamUserSelectorArgEmail + } +} + +/// An unspecified error. +@objc +public class DBXTeamUserSelectorArgTeamMemberId: DBXTeamUserSelectorArg { + @objc + public var teamMemberId: String + + @objc + public init(_ arg: String) { + self.teamMemberId = arg + let swift = Team.UserSelectorArg.teamMemberId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamUserSelectorArgExternalId: DBXTeamUserSelectorArg { + @objc + public var externalId: String + + @objc + public init(_ arg: String) { + self.externalId = arg + let swift = Team.UserSelectorArg.externalId(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamUserSelectorArgEmail: DBXTeamUserSelectorArg { + @objc + public var email: String + + @objc + public init(_ arg: String) { + self.email = arg + let swift = Team.UserSelectorArg.email(arg) + super.init(swift: swift) + } +} + +/// Argument for selecting a list of users, either by team_member_ids, external_ids or emails. +@objc +public class DBXTeamUsersSelectorArg: NSObject { + let swift: Team.UsersSelectorArg + + public init(swift: Team.UsersSelectorArg) { + self.swift = swift + } + + public static func factory(swift: Team.UsersSelectorArg) -> DBXTeamUsersSelectorArg { + switch swift { + case .teamMemberIds(let swiftArg): + let arg = swiftArg + return DBXTeamUsersSelectorArgTeamMemberIds(arg) + case .externalIds(let swiftArg): + let arg = swiftArg + return DBXTeamUsersSelectorArgExternalIds(arg) + case .emails(let swiftArg): + let arg = swiftArg + return DBXTeamUsersSelectorArgEmails(arg) + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeamMemberIds: DBXTeamUsersSelectorArgTeamMemberIds? { + self as? DBXTeamUsersSelectorArgTeamMemberIds + } + + @objc + public var asExternalIds: DBXTeamUsersSelectorArgExternalIds? { + self as? DBXTeamUsersSelectorArgExternalIds + } + + @objc + public var asEmails: DBXTeamUsersSelectorArgEmails? { + self as? DBXTeamUsersSelectorArgEmails + } +} + +/// List of member IDs. +@objc +public class DBXTeamUsersSelectorArgTeamMemberIds: DBXTeamUsersSelectorArg { + @objc + public var teamMemberIds: [String] + + @objc + public init(_ arg: [String]) { + self.teamMemberIds = arg + let swift = Team.UsersSelectorArg.teamMemberIds(arg) + super.init(swift: swift) + } +} + +/// List of external user IDs. +@objc +public class DBXTeamUsersSelectorArgExternalIds: DBXTeamUsersSelectorArg { + @objc + public var externalIds: [String] + + @objc + public init(_ arg: [String]) { + self.externalIds = arg + let swift = Team.UsersSelectorArg.externalIds(arg) + super.init(swift: swift) + } +} + +/// List of email addresses. +@objc +public class DBXTeamUsersSelectorArgEmails: DBXTeamUsersSelectorArg { + @objc + public var emails: [String] + + @objc + public init(_ arg: [String]) { + self.emails = arg + let swift = Team.UsersSelectorArg.emails(arg) + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamCommon.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamCommon.swift new file mode 100644 index 000000000..3938752c4 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamCommon.swift @@ -0,0 +1,318 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the team_common namespace +/// For Swift see team_common + +/// The group type determines how a group is managed. +@objc +public class DBXTeamCommonGroupManagementType: NSObject { + let swift: TeamCommon.GroupManagementType + + public init(swift: TeamCommon.GroupManagementType) { + self.swift = swift + } + + public static func factory(swift: TeamCommon.GroupManagementType) -> DBXTeamCommonGroupManagementType { + switch swift { + case .userManaged: + return DBXTeamCommonGroupManagementTypeUserManaged() + case .companyManaged: + return DBXTeamCommonGroupManagementTypeCompanyManaged() + case .systemManaged: + return DBXTeamCommonGroupManagementTypeSystemManaged() + case .other: + return DBXTeamCommonGroupManagementTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUserManaged: DBXTeamCommonGroupManagementTypeUserManaged? { + self as? DBXTeamCommonGroupManagementTypeUserManaged + } + + @objc + public var asCompanyManaged: DBXTeamCommonGroupManagementTypeCompanyManaged? { + self as? DBXTeamCommonGroupManagementTypeCompanyManaged + } + + @objc + public var asSystemManaged: DBXTeamCommonGroupManagementTypeSystemManaged? { + self as? DBXTeamCommonGroupManagementTypeSystemManaged + } + + @objc + public var asOther: DBXTeamCommonGroupManagementTypeOther? { + self as? DBXTeamCommonGroupManagementTypeOther + } +} + +/// A group which is managed by selected users. +@objc +public class DBXTeamCommonGroupManagementTypeUserManaged: DBXTeamCommonGroupManagementType { + @objc + public init() { + let swift = TeamCommon.GroupManagementType.userManaged + super.init(swift: swift) + } +} + +/// A group which is managed by team admins only. +@objc +public class DBXTeamCommonGroupManagementTypeCompanyManaged: DBXTeamCommonGroupManagementType { + @objc + public init() { + let swift = TeamCommon.GroupManagementType.companyManaged + super.init(swift: swift) + } +} + +/// A group which is managed automatically by Dropbox. +@objc +public class DBXTeamCommonGroupManagementTypeSystemManaged: DBXTeamCommonGroupManagementType { + @objc + public init() { + let swift = TeamCommon.GroupManagementType.systemManaged + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamCommonGroupManagementTypeOther: DBXTeamCommonGroupManagementType { + @objc + public init() { + let swift = TeamCommon.GroupManagementType.other + super.init(swift: swift) + } +} + +/// Information about a group. +@objc +public class DBXTeamCommonGroupSummary: NSObject { + /// (no description) + @objc + public var groupName: String { swift.groupName } + /// (no description) + @objc + public var groupId: String { swift.groupId } + /// External ID of group. This is an arbitrary ID that an admin can attach to a group. + @objc + public var groupExternalId: String? { swift.groupExternalId } + /// The number of members in the group. + @objc + public var memberCount: NSNumber? { swift.memberCount as NSNumber? } + /// Who is allowed to manage the group. + @objc + public var groupManagementType: DBXTeamCommonGroupManagementType { DBXTeamCommonGroupManagementType(swift: swift.groupManagementType) } + + @objc + public init(groupName: String, groupId: String, groupManagementType: DBXTeamCommonGroupManagementType, groupExternalId: String?, memberCount: NSNumber?) { + self.swift = TeamCommon.GroupSummary( + groupName: groupName, + groupId: groupId, + groupManagementType: groupManagementType.swift, + groupExternalId: groupExternalId, + memberCount: memberCount?.uint32Value + ) + } + + let swift: TeamCommon.GroupSummary + + public init(swift: TeamCommon.GroupSummary) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The group type determines how a group is created and managed. +@objc +public class DBXTeamCommonGroupType: NSObject { + let swift: TeamCommon.GroupType + + public init(swift: TeamCommon.GroupType) { + self.swift = swift + } + + public static func factory(swift: TeamCommon.GroupType) -> DBXTeamCommonGroupType { + switch swift { + case .team: + return DBXTeamCommonGroupTypeTeam() + case .userManaged: + return DBXTeamCommonGroupTypeUserManaged() + case .other: + return DBXTeamCommonGroupTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeam: DBXTeamCommonGroupTypeTeam? { + self as? DBXTeamCommonGroupTypeTeam + } + + @objc + public var asUserManaged: DBXTeamCommonGroupTypeUserManaged? { + self as? DBXTeamCommonGroupTypeUserManaged + } + + @objc + public var asOther: DBXTeamCommonGroupTypeOther? { + self as? DBXTeamCommonGroupTypeOther + } +} + +/// A group to which team members are automatically added. Applicable to team folders +/// https://www.dropbox.com/help/986 only. +@objc +public class DBXTeamCommonGroupTypeTeam: DBXTeamCommonGroupType { + @objc + public init() { + let swift = TeamCommon.GroupType.team + super.init(swift: swift) + } +} + +/// A group is created and managed by a user. +@objc +public class DBXTeamCommonGroupTypeUserManaged: DBXTeamCommonGroupType { + @objc + public init() { + let swift = TeamCommon.GroupType.userManaged + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamCommonGroupTypeOther: DBXTeamCommonGroupType { + @objc + public init() { + let swift = TeamCommon.GroupType.other + super.init(swift: swift) + } +} + +/// The type of the space limit imposed on a team member. +@objc +public class DBXTeamCommonMemberSpaceLimitType: NSObject { + let swift: TeamCommon.MemberSpaceLimitType + + public init(swift: TeamCommon.MemberSpaceLimitType) { + self.swift = swift + } + + public static func factory(swift: TeamCommon.MemberSpaceLimitType) -> DBXTeamCommonMemberSpaceLimitType { + switch swift { + case .off: + return DBXTeamCommonMemberSpaceLimitTypeOff() + case .alertOnly: + return DBXTeamCommonMemberSpaceLimitTypeAlertOnly() + case .stopSync: + return DBXTeamCommonMemberSpaceLimitTypeStopSync() + case .other: + return DBXTeamCommonMemberSpaceLimitTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOff: DBXTeamCommonMemberSpaceLimitTypeOff? { + self as? DBXTeamCommonMemberSpaceLimitTypeOff + } + + @objc + public var asAlertOnly: DBXTeamCommonMemberSpaceLimitTypeAlertOnly? { + self as? DBXTeamCommonMemberSpaceLimitTypeAlertOnly + } + + @objc + public var asStopSync: DBXTeamCommonMemberSpaceLimitTypeStopSync? { + self as? DBXTeamCommonMemberSpaceLimitTypeStopSync + } + + @objc + public var asOther: DBXTeamCommonMemberSpaceLimitTypeOther? { + self as? DBXTeamCommonMemberSpaceLimitTypeOther + } +} + +/// The team member does not have imposed space limit. +@objc +public class DBXTeamCommonMemberSpaceLimitTypeOff: DBXTeamCommonMemberSpaceLimitType { + @objc + public init() { + let swift = TeamCommon.MemberSpaceLimitType.off + super.init(swift: swift) + } +} + +/// The team member has soft imposed space limit - the limit is used for display and for notifications. +@objc +public class DBXTeamCommonMemberSpaceLimitTypeAlertOnly: DBXTeamCommonMemberSpaceLimitType { + @objc + public init() { + let swift = TeamCommon.MemberSpaceLimitType.alertOnly + super.init(swift: swift) + } +} + +/// The team member has hard imposed space limit - Dropbox file sync will stop after the limit is reached. +@objc +public class DBXTeamCommonMemberSpaceLimitTypeStopSync: DBXTeamCommonMemberSpaceLimitType { + @objc + public init() { + let swift = TeamCommon.MemberSpaceLimitType.stopSync + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamCommonMemberSpaceLimitTypeOther: DBXTeamCommonMemberSpaceLimitType { + @objc + public init() { + let swift = TeamCommon.MemberSpaceLimitType.other + super.init(swift: swift) + } +} + +/// Time range. +@objc +public class DBXTeamCommonTimeRange: NSObject { + /// Optional starting time (inclusive). + @objc + public var startTime: Date? { swift.startTime } + /// Optional ending time (exclusive). + @objc + public var endTime: Date? { swift.endTime } + + @objc + public init(startTime: Date?, endTime: Date?) { + self.swift = TeamCommon.TimeRange(startTime: startTime, endTime: endTime) + } + + let swift: TeamCommon.TimeRange + + public init(swift: TeamCommon.TimeRange) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift new file mode 100644 index 000000000..b02463ea4 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift @@ -0,0 +1,65961 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the team_log namespace +/// For Swift see team_log + +/// Indicates the method in which the action was performed. +@objc +public class DBXTeamLogAccessMethodLogInfo: NSObject { + let swift: TeamLog.AccessMethodLogInfo + + public init(swift: TeamLog.AccessMethodLogInfo) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AccessMethodLogInfo) -> DBXTeamLogAccessMethodLogInfo { + switch swift { + case .adminConsole(let swiftArg): + let arg = DBXTeamLogWebSessionLogInfo(swift: swiftArg) + return DBXTeamLogAccessMethodLogInfoAdminConsole(arg) + case .api(let swiftArg): + let arg = DBXTeamLogApiSessionLogInfo(swift: swiftArg) + return DBXTeamLogAccessMethodLogInfoApi(arg) + case .contentManager(let swiftArg): + let arg = DBXTeamLogWebSessionLogInfo(swift: swiftArg) + return DBXTeamLogAccessMethodLogInfoContentManager(arg) + case .endUser(let swiftArg): + let arg = DBXTeamLogSessionLogInfo(swift: swiftArg) + return DBXTeamLogAccessMethodLogInfoEndUser(arg) + case .enterpriseConsole(let swiftArg): + let arg = DBXTeamLogWebSessionLogInfo(swift: swiftArg) + return DBXTeamLogAccessMethodLogInfoEnterpriseConsole(arg) + case .signInAs(let swiftArg): + let arg = DBXTeamLogWebSessionLogInfo(swift: swiftArg) + return DBXTeamLogAccessMethodLogInfoSignInAs(arg) + case .other: + return DBXTeamLogAccessMethodLogInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdminConsole: DBXTeamLogAccessMethodLogInfoAdminConsole? { + self as? DBXTeamLogAccessMethodLogInfoAdminConsole + } + + @objc + public var asApi: DBXTeamLogAccessMethodLogInfoApi? { + self as? DBXTeamLogAccessMethodLogInfoApi + } + + @objc + public var asContentManager: DBXTeamLogAccessMethodLogInfoContentManager? { + self as? DBXTeamLogAccessMethodLogInfoContentManager + } + + @objc + public var asEndUser: DBXTeamLogAccessMethodLogInfoEndUser? { + self as? DBXTeamLogAccessMethodLogInfoEndUser + } + + @objc + public var asEnterpriseConsole: DBXTeamLogAccessMethodLogInfoEnterpriseConsole? { + self as? DBXTeamLogAccessMethodLogInfoEnterpriseConsole + } + + @objc + public var asSignInAs: DBXTeamLogAccessMethodLogInfoSignInAs? { + self as? DBXTeamLogAccessMethodLogInfoSignInAs + } + + @objc + public var asOther: DBXTeamLogAccessMethodLogInfoOther? { + self as? DBXTeamLogAccessMethodLogInfoOther + } +} + +/// Admin console session details. +@objc +public class DBXTeamLogAccessMethodLogInfoAdminConsole: DBXTeamLogAccessMethodLogInfo { + @objc + public var adminConsole: DBXTeamLogWebSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogWebSessionLogInfo) { + self.adminConsole = arg + let swift = TeamLog.AccessMethodLogInfo.adminConsole(arg.subSwift) + super.init(swift: swift) + } +} + +/// Api session details. +@objc +public class DBXTeamLogAccessMethodLogInfoApi: DBXTeamLogAccessMethodLogInfo { + @objc + public var api: DBXTeamLogApiSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogApiSessionLogInfo) { + self.api = arg + let swift = TeamLog.AccessMethodLogInfo.api(arg.swift) + super.init(swift: swift) + } +} + +/// Content manager session details. +@objc +public class DBXTeamLogAccessMethodLogInfoContentManager: DBXTeamLogAccessMethodLogInfo { + @objc + public var contentManager: DBXTeamLogWebSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogWebSessionLogInfo) { + self.contentManager = arg + let swift = TeamLog.AccessMethodLogInfo.contentManager(arg.subSwift) + super.init(swift: swift) + } +} + +/// End user session details. +@objc +public class DBXTeamLogAccessMethodLogInfoEndUser: DBXTeamLogAccessMethodLogInfo { + @objc + public var endUser: DBXTeamLogSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogSessionLogInfo) { + self.endUser = arg + let swift = TeamLog.AccessMethodLogInfo.endUser(arg.swift) + super.init(swift: swift) + } +} + +/// Enterprise console session details. +@objc +public class DBXTeamLogAccessMethodLogInfoEnterpriseConsole: DBXTeamLogAccessMethodLogInfo { + @objc + public var enterpriseConsole: DBXTeamLogWebSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogWebSessionLogInfo) { + self.enterpriseConsole = arg + let swift = TeamLog.AccessMethodLogInfo.enterpriseConsole(arg.subSwift) + super.init(swift: swift) + } +} + +/// Sign in as session details. +@objc +public class DBXTeamLogAccessMethodLogInfoSignInAs: DBXTeamLogAccessMethodLogInfo { + @objc + public var signInAs: DBXTeamLogWebSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogWebSessionLogInfo) { + self.signInAs = arg + let swift = TeamLog.AccessMethodLogInfo.signInAs(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccessMethodLogInfoOther: DBXTeamLogAccessMethodLogInfo { + @objc + public init() { + let swift = TeamLog.AccessMethodLogInfo.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AccountCaptureAvailability union +@objc +public class DBXTeamLogAccountCaptureAvailability: NSObject { + let swift: TeamLog.AccountCaptureAvailability + + public init(swift: TeamLog.AccountCaptureAvailability) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AccountCaptureAvailability) -> DBXTeamLogAccountCaptureAvailability { + switch swift { + case .available: + return DBXTeamLogAccountCaptureAvailabilityAvailable() + case .unavailable: + return DBXTeamLogAccountCaptureAvailabilityUnavailable() + case .other: + return DBXTeamLogAccountCaptureAvailabilityOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAvailable: DBXTeamLogAccountCaptureAvailabilityAvailable? { + self as? DBXTeamLogAccountCaptureAvailabilityAvailable + } + + @objc + public var asUnavailable: DBXTeamLogAccountCaptureAvailabilityUnavailable? { + self as? DBXTeamLogAccountCaptureAvailabilityUnavailable + } + + @objc + public var asOther: DBXTeamLogAccountCaptureAvailabilityOther? { + self as? DBXTeamLogAccountCaptureAvailabilityOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCaptureAvailabilityAvailable: DBXTeamLogAccountCaptureAvailability { + @objc + public init() { + let swift = TeamLog.AccountCaptureAvailability.available + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCaptureAvailabilityUnavailable: DBXTeamLogAccountCaptureAvailability { + @objc + public init() { + let swift = TeamLog.AccountCaptureAvailability.unavailable + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCaptureAvailabilityOther: DBXTeamLogAccountCaptureAvailability { + @objc + public init() { + let swift = TeamLog.AccountCaptureAvailability.other + super.init(swift: swift) + } +} + +/// Granted/revoked option to enable account capture on team domains. +@objc +public class DBXTeamLogAccountCaptureChangeAvailabilityDetails: NSObject { + /// New account capture availabilty value. + @objc + public var newValue: DBXTeamLogAccountCaptureAvailability { DBXTeamLogAccountCaptureAvailability(swift: swift.newValue) } + /// Previous account capture availabilty value. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogAccountCaptureAvailability? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogAccountCaptureAvailability(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogAccountCaptureAvailability, previousValue: DBXTeamLogAccountCaptureAvailability?) { + self.swift = TeamLog.AccountCaptureChangeAvailabilityDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.AccountCaptureChangeAvailabilityDetails + + public init(swift: TeamLog.AccountCaptureChangeAvailabilityDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountCaptureChangeAvailabilityType struct +@objc +public class DBXTeamLogAccountCaptureChangeAvailabilityType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AccountCaptureChangeAvailabilityType(description_: description_) + } + + let swift: TeamLog.AccountCaptureChangeAvailabilityType + + public init(swift: TeamLog.AccountCaptureChangeAvailabilityType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed account capture setting on team domain. +@objc +public class DBXTeamLogAccountCaptureChangePolicyDetails: NSObject { + /// New account capture policy. + @objc + public var newValue: DBXTeamLogAccountCapturePolicy { DBXTeamLogAccountCapturePolicy(swift: swift.newValue) } + /// Previous account capture policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogAccountCapturePolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogAccountCapturePolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogAccountCapturePolicy, previousValue: DBXTeamLogAccountCapturePolicy?) { + self.swift = TeamLog.AccountCaptureChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.AccountCaptureChangePolicyDetails + + public init(swift: TeamLog.AccountCaptureChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountCaptureChangePolicyType struct +@objc +public class DBXTeamLogAccountCaptureChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AccountCaptureChangePolicyType(description_: description_) + } + + let swift: TeamLog.AccountCaptureChangePolicyType + + public init(swift: TeamLog.AccountCaptureChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Account-captured user migrated account to team. +@objc +public class DBXTeamLogAccountCaptureMigrateAccountDetails: NSObject { + /// Domain name. + @objc + public var domainName: String { swift.domainName } + + @objc + public init(domainName: String) { + self.swift = TeamLog.AccountCaptureMigrateAccountDetails(domainName: domainName) + } + + let swift: TeamLog.AccountCaptureMigrateAccountDetails + + public init(swift: TeamLog.AccountCaptureMigrateAccountDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountCaptureMigrateAccountType struct +@objc +public class DBXTeamLogAccountCaptureMigrateAccountType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AccountCaptureMigrateAccountType(description_: description_) + } + + let swift: TeamLog.AccountCaptureMigrateAccountType + + public init(swift: TeamLog.AccountCaptureMigrateAccountType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Sent account capture email to all unmanaged members. +@objc +public class DBXTeamLogAccountCaptureNotificationEmailsSentDetails: NSObject { + /// Domain name. + @objc + public var domainName: String { swift.domainName } + /// Account-capture email notification type. + @objc + public var notificationType: DBXTeamLogAccountCaptureNotificationType? { guard let swift = swift.notificationType else { return nil } + return DBXTeamLogAccountCaptureNotificationType(swift: swift) + } + + @objc + public init(domainName: String, notificationType: DBXTeamLogAccountCaptureNotificationType?) { + self.swift = TeamLog.AccountCaptureNotificationEmailsSentDetails(domainName: domainName, notificationType: notificationType?.swift) + } + + let swift: TeamLog.AccountCaptureNotificationEmailsSentDetails + + public init(swift: TeamLog.AccountCaptureNotificationEmailsSentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountCaptureNotificationEmailsSentType struct +@objc +public class DBXTeamLogAccountCaptureNotificationEmailsSentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AccountCaptureNotificationEmailsSentType(description_: description_) + } + + let swift: TeamLog.AccountCaptureNotificationEmailsSentType + + public init(swift: TeamLog.AccountCaptureNotificationEmailsSentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountCaptureNotificationType union +@objc +public class DBXTeamLogAccountCaptureNotificationType: NSObject { + let swift: TeamLog.AccountCaptureNotificationType + + public init(swift: TeamLog.AccountCaptureNotificationType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AccountCaptureNotificationType) -> DBXTeamLogAccountCaptureNotificationType { + switch swift { + case .actionableNotification: + return DBXTeamLogAccountCaptureNotificationTypeActionableNotification() + case .proactiveWarningNotification: + return DBXTeamLogAccountCaptureNotificationTypeProactiveWarningNotification() + case .other: + return DBXTeamLogAccountCaptureNotificationTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActionableNotification: DBXTeamLogAccountCaptureNotificationTypeActionableNotification? { + self as? DBXTeamLogAccountCaptureNotificationTypeActionableNotification + } + + @objc + public var asProactiveWarningNotification: DBXTeamLogAccountCaptureNotificationTypeProactiveWarningNotification? { + self as? DBXTeamLogAccountCaptureNotificationTypeProactiveWarningNotification + } + + @objc + public var asOther: DBXTeamLogAccountCaptureNotificationTypeOther? { + self as? DBXTeamLogAccountCaptureNotificationTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCaptureNotificationTypeActionableNotification: DBXTeamLogAccountCaptureNotificationType { + @objc + public init() { + let swift = TeamLog.AccountCaptureNotificationType.actionableNotification + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCaptureNotificationTypeProactiveWarningNotification: DBXTeamLogAccountCaptureNotificationType { + @objc + public init() { + let swift = TeamLog.AccountCaptureNotificationType.proactiveWarningNotification + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCaptureNotificationTypeOther: DBXTeamLogAccountCaptureNotificationType { + @objc + public init() { + let swift = TeamLog.AccountCaptureNotificationType.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AccountCapturePolicy union +@objc +public class DBXTeamLogAccountCapturePolicy: NSObject { + let swift: TeamLog.AccountCapturePolicy + + public init(swift: TeamLog.AccountCapturePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AccountCapturePolicy) -> DBXTeamLogAccountCapturePolicy { + switch swift { + case .allUsers: + return DBXTeamLogAccountCapturePolicyAllUsers() + case .disabled: + return DBXTeamLogAccountCapturePolicyDisabled() + case .invitedUsers: + return DBXTeamLogAccountCapturePolicyInvitedUsers() + case .preventPersonalCreation: + return DBXTeamLogAccountCapturePolicyPreventPersonalCreation() + case .other: + return DBXTeamLogAccountCapturePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAllUsers: DBXTeamLogAccountCapturePolicyAllUsers? { + self as? DBXTeamLogAccountCapturePolicyAllUsers + } + + @objc + public var asDisabled: DBXTeamLogAccountCapturePolicyDisabled? { + self as? DBXTeamLogAccountCapturePolicyDisabled + } + + @objc + public var asInvitedUsers: DBXTeamLogAccountCapturePolicyInvitedUsers? { + self as? DBXTeamLogAccountCapturePolicyInvitedUsers + } + + @objc + public var asPreventPersonalCreation: DBXTeamLogAccountCapturePolicyPreventPersonalCreation? { + self as? DBXTeamLogAccountCapturePolicyPreventPersonalCreation + } + + @objc + public var asOther: DBXTeamLogAccountCapturePolicyOther? { + self as? DBXTeamLogAccountCapturePolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCapturePolicyAllUsers: DBXTeamLogAccountCapturePolicy { + @objc + public init() { + let swift = TeamLog.AccountCapturePolicy.allUsers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCapturePolicyDisabled: DBXTeamLogAccountCapturePolicy { + @objc + public init() { + let swift = TeamLog.AccountCapturePolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCapturePolicyInvitedUsers: DBXTeamLogAccountCapturePolicy { + @objc + public init() { + let swift = TeamLog.AccountCapturePolicy.invitedUsers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCapturePolicyPreventPersonalCreation: DBXTeamLogAccountCapturePolicy { + @objc + public init() { + let swift = TeamLog.AccountCapturePolicy.preventPersonalCreation + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountCapturePolicyOther: DBXTeamLogAccountCapturePolicy { + @objc + public init() { + let swift = TeamLog.AccountCapturePolicy.other + super.init(swift: swift) + } +} + +/// Account-captured user changed account email to personal email. +@objc +public class DBXTeamLogAccountCaptureRelinquishAccountDetails: NSObject { + /// Domain name. + @objc + public var domainName: String { swift.domainName } + + @objc + public init(domainName: String) { + self.swift = TeamLog.AccountCaptureRelinquishAccountDetails(domainName: domainName) + } + + let swift: TeamLog.AccountCaptureRelinquishAccountDetails + + public init(swift: TeamLog.AccountCaptureRelinquishAccountDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountCaptureRelinquishAccountType struct +@objc +public class DBXTeamLogAccountCaptureRelinquishAccountType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AccountCaptureRelinquishAccountType(description_: description_) + } + + let swift: TeamLog.AccountCaptureRelinquishAccountType + + public init(swift: TeamLog.AccountCaptureRelinquishAccountType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unlocked/locked account after failed sign in attempts. +@objc +public class DBXTeamLogAccountLockOrUnlockedDetails: NSObject { + /// The previous account status. + @objc + public var previousValue: DBXTeamLogAccountState { DBXTeamLogAccountState(swift: swift.previousValue) } + /// The new account status. + @objc + public var newValue: DBXTeamLogAccountState { DBXTeamLogAccountState(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogAccountState, newValue: DBXTeamLogAccountState) { + self.swift = TeamLog.AccountLockOrUnlockedDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.AccountLockOrUnlockedDetails + + public init(swift: TeamLog.AccountLockOrUnlockedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountLockOrUnlockedType struct +@objc +public class DBXTeamLogAccountLockOrUnlockedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AccountLockOrUnlockedType(description_: description_) + } + + let swift: TeamLog.AccountLockOrUnlockedType + + public init(swift: TeamLog.AccountLockOrUnlockedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AccountState union +@objc +public class DBXTeamLogAccountState: NSObject { + let swift: TeamLog.AccountState + + public init(swift: TeamLog.AccountState) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AccountState) -> DBXTeamLogAccountState { + switch swift { + case .locked: + return DBXTeamLogAccountStateLocked() + case .unlocked: + return DBXTeamLogAccountStateUnlocked() + case .other: + return DBXTeamLogAccountStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asLocked: DBXTeamLogAccountStateLocked? { + self as? DBXTeamLogAccountStateLocked + } + + @objc + public var asUnlocked: DBXTeamLogAccountStateUnlocked? { + self as? DBXTeamLogAccountStateUnlocked + } + + @objc + public var asOther: DBXTeamLogAccountStateOther? { + self as? DBXTeamLogAccountStateOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountStateLocked: DBXTeamLogAccountState { + @objc + public init() { + let swift = TeamLog.AccountState.locked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountStateUnlocked: DBXTeamLogAccountState { + @objc + public init() { + let swift = TeamLog.AccountState.unlocked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAccountStateOther: DBXTeamLogAccountState { + @objc + public init() { + let swift = TeamLog.AccountState.other + super.init(swift: swift) + } +} + +/// Additional information indicating the action taken that caused status change. +@objc +public class DBXTeamLogActionDetails: NSObject { + let swift: TeamLog.ActionDetails + + public init(swift: TeamLog.ActionDetails) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ActionDetails) -> DBXTeamLogActionDetails { + switch swift { + case .removeAction(let swiftArg): + let arg = DBXTeamLogMemberRemoveActionType(swift: swiftArg) + return DBXTeamLogActionDetailsRemoveAction(arg) + case .teamInviteDetails(let swiftArg): + let arg = DBXTeamLogTeamInviteDetails(swift: swiftArg) + return DBXTeamLogActionDetailsTeamInviteDetails(arg) + case .teamJoinDetails(let swiftArg): + let arg = DBXTeamLogJoinTeamDetails(swift: swiftArg) + return DBXTeamLogActionDetailsTeamJoinDetails(arg) + case .other: + return DBXTeamLogActionDetailsOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asRemoveAction: DBXTeamLogActionDetailsRemoveAction? { + self as? DBXTeamLogActionDetailsRemoveAction + } + + @objc + public var asTeamInviteDetails: DBXTeamLogActionDetailsTeamInviteDetails? { + self as? DBXTeamLogActionDetailsTeamInviteDetails + } + + @objc + public var asTeamJoinDetails: DBXTeamLogActionDetailsTeamJoinDetails? { + self as? DBXTeamLogActionDetailsTeamJoinDetails + } + + @objc + public var asOther: DBXTeamLogActionDetailsOther? { + self as? DBXTeamLogActionDetailsOther + } +} + +/// Define how the user was removed from the team. +@objc +public class DBXTeamLogActionDetailsRemoveAction: DBXTeamLogActionDetails { + @objc + public var removeAction: DBXTeamLogMemberRemoveActionType + + @objc + public init(_ arg: DBXTeamLogMemberRemoveActionType) { + self.removeAction = arg + let swift = TeamLog.ActionDetails.removeAction(arg.swift) + super.init(swift: swift) + } +} + +/// Additional information relevant when someone is invited to the team. +@objc +public class DBXTeamLogActionDetailsTeamInviteDetails: DBXTeamLogActionDetails { + @objc + public var teamInviteDetails: DBXTeamLogTeamInviteDetails + + @objc + public init(_ arg: DBXTeamLogTeamInviteDetails) { + self.teamInviteDetails = arg + let swift = TeamLog.ActionDetails.teamInviteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// Additional information relevant when a new member joins the team. +@objc +public class DBXTeamLogActionDetailsTeamJoinDetails: DBXTeamLogActionDetails { + @objc + public var teamJoinDetails: DBXTeamLogJoinTeamDetails + + @objc + public init(_ arg: DBXTeamLogJoinTeamDetails) { + self.teamJoinDetails = arg + let swift = TeamLog.ActionDetails.teamJoinDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogActionDetailsOther: DBXTeamLogActionDetails { + @objc + public init() { + let swift = TeamLog.ActionDetails.other + super.init(swift: swift) + } +} + +/// The entity who performed the action. +@objc +public class DBXTeamLogActorLogInfo: NSObject { + let swift: TeamLog.ActorLogInfo + + public init(swift: TeamLog.ActorLogInfo) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ActorLogInfo) -> DBXTeamLogActorLogInfo { + switch swift { + case .admin(let swiftArg): + let arg = DBXTeamLogUserLogInfo(swift: swiftArg) + return DBXTeamLogActorLogInfoAdmin(arg) + case .anonymous: + return DBXTeamLogActorLogInfoAnonymous() + case .app(let swiftArg): + let arg = DBXTeamLogAppLogInfo(swift: swiftArg) + return DBXTeamLogActorLogInfoApp(arg) + case .dropbox: + return DBXTeamLogActorLogInfoDropbox() + case .reseller(let swiftArg): + let arg = DBXTeamLogResellerLogInfo(swift: swiftArg) + return DBXTeamLogActorLogInfoReseller(arg) + case .user(let swiftArg): + let arg = DBXTeamLogUserLogInfo(swift: swiftArg) + return DBXTeamLogActorLogInfoUser(arg) + case .other: + return DBXTeamLogActorLogInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdmin: DBXTeamLogActorLogInfoAdmin? { + self as? DBXTeamLogActorLogInfoAdmin + } + + @objc + public var asAnonymous: DBXTeamLogActorLogInfoAnonymous? { + self as? DBXTeamLogActorLogInfoAnonymous + } + + @objc + public var asApp: DBXTeamLogActorLogInfoApp? { + self as? DBXTeamLogActorLogInfoApp + } + + @objc + public var asDropbox: DBXTeamLogActorLogInfoDropbox? { + self as? DBXTeamLogActorLogInfoDropbox + } + + @objc + public var asReseller: DBXTeamLogActorLogInfoReseller? { + self as? DBXTeamLogActorLogInfoReseller + } + + @objc + public var asUser: DBXTeamLogActorLogInfoUser? { + self as? DBXTeamLogActorLogInfoUser + } + + @objc + public var asOther: DBXTeamLogActorLogInfoOther? { + self as? DBXTeamLogActorLogInfoOther + } +} + +/// The admin who did the action. +@objc +public class DBXTeamLogActorLogInfoAdmin: DBXTeamLogActorLogInfo { + @objc + public var admin: DBXTeamLogUserLogInfo + + @objc + public init(_ arg: DBXTeamLogUserLogInfo) { + self.admin = arg + let swift = TeamLog.ActorLogInfo.admin(arg.swift) + super.init(swift: swift) + } +} + +/// Anonymous actor. +@objc +public class DBXTeamLogActorLogInfoAnonymous: DBXTeamLogActorLogInfo { + @objc + public init() { + let swift = TeamLog.ActorLogInfo.anonymous + super.init(swift: swift) + } +} + +/// The application who did the action. +@objc +public class DBXTeamLogActorLogInfoApp: DBXTeamLogActorLogInfo { + @objc + public var app: DBXTeamLogAppLogInfo + + @objc + public init(_ arg: DBXTeamLogAppLogInfo) { + self.app = arg + let swift = TeamLog.ActorLogInfo.app(arg.swift) + super.init(swift: swift) + } +} + +/// Action done by Dropbox. +@objc +public class DBXTeamLogActorLogInfoDropbox: DBXTeamLogActorLogInfo { + @objc + public init() { + let swift = TeamLog.ActorLogInfo.dropbox + super.init(swift: swift) + } +} + +/// Action done by reseller. +@objc +public class DBXTeamLogActorLogInfoReseller: DBXTeamLogActorLogInfo { + @objc + public var reseller: DBXTeamLogResellerLogInfo + + @objc + public init(_ arg: DBXTeamLogResellerLogInfo) { + self.reseller = arg + let swift = TeamLog.ActorLogInfo.reseller(arg.swift) + super.init(swift: swift) + } +} + +/// The user who did the action. +@objc +public class DBXTeamLogActorLogInfoUser: DBXTeamLogActorLogInfo { + @objc + public var user: DBXTeamLogUserLogInfo + + @objc + public init(_ arg: DBXTeamLogUserLogInfo) { + self.user = arg + let swift = TeamLog.ActorLogInfo.user(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogActorLogInfoOther: DBXTeamLogActorLogInfo { + @objc + public init() { + let swift = TeamLog.ActorLogInfo.other + super.init(swift: swift) + } +} + +/// Alert category +@objc +public class DBXTeamLogAdminAlertCategoryEnum: NSObject { + let swift: TeamLog.AdminAlertCategoryEnum + + public init(swift: TeamLog.AdminAlertCategoryEnum) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminAlertCategoryEnum) -> DBXTeamLogAdminAlertCategoryEnum { + switch swift { + case .accountTakeover: + return DBXTeamLogAdminAlertCategoryEnumAccountTakeover() + case .dataLossProtection: + return DBXTeamLogAdminAlertCategoryEnumDataLossProtection() + case .informationGovernance: + return DBXTeamLogAdminAlertCategoryEnumInformationGovernance() + case .malwareSharing: + return DBXTeamLogAdminAlertCategoryEnumMalwareSharing() + case .massiveFileOperation: + return DBXTeamLogAdminAlertCategoryEnumMassiveFileOperation() + case .na: + return DBXTeamLogAdminAlertCategoryEnumNa() + case .threatManagement: + return DBXTeamLogAdminAlertCategoryEnumThreatManagement() + case .other: + return DBXTeamLogAdminAlertCategoryEnumOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccountTakeover: DBXTeamLogAdminAlertCategoryEnumAccountTakeover? { + self as? DBXTeamLogAdminAlertCategoryEnumAccountTakeover + } + + @objc + public var asDataLossProtection: DBXTeamLogAdminAlertCategoryEnumDataLossProtection? { + self as? DBXTeamLogAdminAlertCategoryEnumDataLossProtection + } + + @objc + public var asInformationGovernance: DBXTeamLogAdminAlertCategoryEnumInformationGovernance? { + self as? DBXTeamLogAdminAlertCategoryEnumInformationGovernance + } + + @objc + public var asMalwareSharing: DBXTeamLogAdminAlertCategoryEnumMalwareSharing? { + self as? DBXTeamLogAdminAlertCategoryEnumMalwareSharing + } + + @objc + public var asMassiveFileOperation: DBXTeamLogAdminAlertCategoryEnumMassiveFileOperation? { + self as? DBXTeamLogAdminAlertCategoryEnumMassiveFileOperation + } + + @objc + public var asNa: DBXTeamLogAdminAlertCategoryEnumNa? { + self as? DBXTeamLogAdminAlertCategoryEnumNa + } + + @objc + public var asThreatManagement: DBXTeamLogAdminAlertCategoryEnumThreatManagement? { + self as? DBXTeamLogAdminAlertCategoryEnumThreatManagement + } + + @objc + public var asOther: DBXTeamLogAdminAlertCategoryEnumOther? { + self as? DBXTeamLogAdminAlertCategoryEnumOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumAccountTakeover: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.accountTakeover + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumDataLossProtection: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.dataLossProtection + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumInformationGovernance: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.informationGovernance + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumMalwareSharing: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.malwareSharing + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumMassiveFileOperation: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.massiveFileOperation + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumNa: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.na + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumThreatManagement: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.threatManagement + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertCategoryEnumOther: DBXTeamLogAdminAlertCategoryEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertCategoryEnum.other + super.init(swift: swift) + } +} + +/// Alert state +@objc +public class DBXTeamLogAdminAlertGeneralStateEnum: NSObject { + let swift: TeamLog.AdminAlertGeneralStateEnum + + public init(swift: TeamLog.AdminAlertGeneralStateEnum) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminAlertGeneralStateEnum) -> DBXTeamLogAdminAlertGeneralStateEnum { + switch swift { + case .active: + return DBXTeamLogAdminAlertGeneralStateEnumActive() + case .dismissed: + return DBXTeamLogAdminAlertGeneralStateEnumDismissed() + case .inProgress: + return DBXTeamLogAdminAlertGeneralStateEnumInProgress() + case .na: + return DBXTeamLogAdminAlertGeneralStateEnumNa() + case .resolved: + return DBXTeamLogAdminAlertGeneralStateEnumResolved() + case .other: + return DBXTeamLogAdminAlertGeneralStateEnumOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXTeamLogAdminAlertGeneralStateEnumActive? { + self as? DBXTeamLogAdminAlertGeneralStateEnumActive + } + + @objc + public var asDismissed: DBXTeamLogAdminAlertGeneralStateEnumDismissed? { + self as? DBXTeamLogAdminAlertGeneralStateEnumDismissed + } + + @objc + public var asInProgress: DBXTeamLogAdminAlertGeneralStateEnumInProgress? { + self as? DBXTeamLogAdminAlertGeneralStateEnumInProgress + } + + @objc + public var asNa: DBXTeamLogAdminAlertGeneralStateEnumNa? { + self as? DBXTeamLogAdminAlertGeneralStateEnumNa + } + + @objc + public var asResolved: DBXTeamLogAdminAlertGeneralStateEnumResolved? { + self as? DBXTeamLogAdminAlertGeneralStateEnumResolved + } + + @objc + public var asOther: DBXTeamLogAdminAlertGeneralStateEnumOther? { + self as? DBXTeamLogAdminAlertGeneralStateEnumOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertGeneralStateEnumActive: DBXTeamLogAdminAlertGeneralStateEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertGeneralStateEnum.active + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertGeneralStateEnumDismissed: DBXTeamLogAdminAlertGeneralStateEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertGeneralStateEnum.dismissed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertGeneralStateEnumInProgress: DBXTeamLogAdminAlertGeneralStateEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertGeneralStateEnum.inProgress + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertGeneralStateEnumNa: DBXTeamLogAdminAlertGeneralStateEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertGeneralStateEnum.na + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertGeneralStateEnumResolved: DBXTeamLogAdminAlertGeneralStateEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertGeneralStateEnum.resolved + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertGeneralStateEnumOther: DBXTeamLogAdminAlertGeneralStateEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertGeneralStateEnum.other + super.init(swift: swift) + } +} + +/// Alert severity +@objc +public class DBXTeamLogAdminAlertSeverityEnum: NSObject { + let swift: TeamLog.AdminAlertSeverityEnum + + public init(swift: TeamLog.AdminAlertSeverityEnum) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminAlertSeverityEnum) -> DBXTeamLogAdminAlertSeverityEnum { + switch swift { + case .high: + return DBXTeamLogAdminAlertSeverityEnumHigh() + case .info: + return DBXTeamLogAdminAlertSeverityEnumInfo() + case .low: + return DBXTeamLogAdminAlertSeverityEnumLow() + case .medium: + return DBXTeamLogAdminAlertSeverityEnumMedium() + case .na: + return DBXTeamLogAdminAlertSeverityEnumNa() + case .other: + return DBXTeamLogAdminAlertSeverityEnumOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHigh: DBXTeamLogAdminAlertSeverityEnumHigh? { + self as? DBXTeamLogAdminAlertSeverityEnumHigh + } + + @objc + public var asInfo: DBXTeamLogAdminAlertSeverityEnumInfo? { + self as? DBXTeamLogAdminAlertSeverityEnumInfo + } + + @objc + public var asLow: DBXTeamLogAdminAlertSeverityEnumLow? { + self as? DBXTeamLogAdminAlertSeverityEnumLow + } + + @objc + public var asMedium: DBXTeamLogAdminAlertSeverityEnumMedium? { + self as? DBXTeamLogAdminAlertSeverityEnumMedium + } + + @objc + public var asNa: DBXTeamLogAdminAlertSeverityEnumNa? { + self as? DBXTeamLogAdminAlertSeverityEnumNa + } + + @objc + public var asOther: DBXTeamLogAdminAlertSeverityEnumOther? { + self as? DBXTeamLogAdminAlertSeverityEnumOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertSeverityEnumHigh: DBXTeamLogAdminAlertSeverityEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertSeverityEnum.high + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertSeverityEnumInfo: DBXTeamLogAdminAlertSeverityEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertSeverityEnum.info + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertSeverityEnumLow: DBXTeamLogAdminAlertSeverityEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertSeverityEnum.low + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertSeverityEnumMedium: DBXTeamLogAdminAlertSeverityEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertSeverityEnum.medium + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertSeverityEnumNa: DBXTeamLogAdminAlertSeverityEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertSeverityEnum.na + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertSeverityEnumOther: DBXTeamLogAdminAlertSeverityEnum { + @objc + public init() { + let swift = TeamLog.AdminAlertSeverityEnum.other + super.init(swift: swift) + } +} + +/// Alert configurations +@objc +public class DBXTeamLogAdminAlertingAlertConfiguration: NSObject { + /// Alert state. + @objc + public var alertState: DBXTeamLogAdminAlertingAlertStatePolicy? { guard let swift = swift.alertState else { return nil } + return DBXTeamLogAdminAlertingAlertStatePolicy(swift: swift) + } + + /// Sensitivity level. + @objc + public var sensitivityLevel: DBXTeamLogAdminAlertingAlertSensitivity? { guard let swift = swift.sensitivityLevel else { return nil } + return DBXTeamLogAdminAlertingAlertSensitivity(swift: swift) + } + + /// Recipient settings. + @objc + public var recipientsSettings: DBXTeamLogRecipientsConfiguration? { guard let swift = swift.recipientsSettings else { return nil } + return DBXTeamLogRecipientsConfiguration(swift: swift) + } + + /// Text. + @objc + public var text: String? { swift.text } + /// Excluded file extensions. + @objc + public var excludedFileExtensions: String? { swift.excludedFileExtensions } + + @objc + public init( + alertState: DBXTeamLogAdminAlertingAlertStatePolicy?, + sensitivityLevel: DBXTeamLogAdminAlertingAlertSensitivity?, + recipientsSettings: DBXTeamLogRecipientsConfiguration?, + text: String?, + excludedFileExtensions: String? + ) { + self.swift = TeamLog.AdminAlertingAlertConfiguration( + alertState: alertState?.swift, + sensitivityLevel: sensitivityLevel?.swift, + recipientsSettings: recipientsSettings?.swift, + text: text, + excludedFileExtensions: excludedFileExtensions + ) + } + + let swift: TeamLog.AdminAlertingAlertConfiguration + + public init(swift: TeamLog.AdminAlertingAlertConfiguration) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Alert sensitivity +@objc +public class DBXTeamLogAdminAlertingAlertSensitivity: NSObject { + let swift: TeamLog.AdminAlertingAlertSensitivity + + public init(swift: TeamLog.AdminAlertingAlertSensitivity) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminAlertingAlertSensitivity) -> DBXTeamLogAdminAlertingAlertSensitivity { + switch swift { + case .high: + return DBXTeamLogAdminAlertingAlertSensitivityHigh() + case .highest: + return DBXTeamLogAdminAlertingAlertSensitivityHighest() + case .invalid: + return DBXTeamLogAdminAlertingAlertSensitivityInvalid() + case .low: + return DBXTeamLogAdminAlertingAlertSensitivityLow() + case .lowest: + return DBXTeamLogAdminAlertingAlertSensitivityLowest() + case .medium: + return DBXTeamLogAdminAlertingAlertSensitivityMedium() + case .other: + return DBXTeamLogAdminAlertingAlertSensitivityOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHigh: DBXTeamLogAdminAlertingAlertSensitivityHigh? { + self as? DBXTeamLogAdminAlertingAlertSensitivityHigh + } + + @objc + public var asHighest: DBXTeamLogAdminAlertingAlertSensitivityHighest? { + self as? DBXTeamLogAdminAlertingAlertSensitivityHighest + } + + @objc + public var asInvalid: DBXTeamLogAdminAlertingAlertSensitivityInvalid? { + self as? DBXTeamLogAdminAlertingAlertSensitivityInvalid + } + + @objc + public var asLow: DBXTeamLogAdminAlertingAlertSensitivityLow? { + self as? DBXTeamLogAdminAlertingAlertSensitivityLow + } + + @objc + public var asLowest: DBXTeamLogAdminAlertingAlertSensitivityLowest? { + self as? DBXTeamLogAdminAlertingAlertSensitivityLowest + } + + @objc + public var asMedium: DBXTeamLogAdminAlertingAlertSensitivityMedium? { + self as? DBXTeamLogAdminAlertingAlertSensitivityMedium + } + + @objc + public var asOther: DBXTeamLogAdminAlertingAlertSensitivityOther? { + self as? DBXTeamLogAdminAlertingAlertSensitivityOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertSensitivityHigh: DBXTeamLogAdminAlertingAlertSensitivity { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertSensitivity.high + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertSensitivityHighest: DBXTeamLogAdminAlertingAlertSensitivity { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertSensitivity.highest + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertSensitivityInvalid: DBXTeamLogAdminAlertingAlertSensitivity { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertSensitivity.invalid + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertSensitivityLow: DBXTeamLogAdminAlertingAlertSensitivity { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertSensitivity.low + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertSensitivityLowest: DBXTeamLogAdminAlertingAlertSensitivity { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertSensitivity.lowest + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertSensitivityMedium: DBXTeamLogAdminAlertingAlertSensitivity { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertSensitivity.medium + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertSensitivityOther: DBXTeamLogAdminAlertingAlertSensitivity { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertSensitivity.other + super.init(swift: swift) + } +} + +/// Changed an alert state. +@objc +public class DBXTeamLogAdminAlertingAlertStateChangedDetails: NSObject { + /// Alert name. + @objc + public var alertName: String { swift.alertName } + /// Alert severity. + @objc + public var alertSeverity: DBXTeamLogAdminAlertSeverityEnum { DBXTeamLogAdminAlertSeverityEnum(swift: swift.alertSeverity) } + /// Alert category. + @objc + public var alertCategory: DBXTeamLogAdminAlertCategoryEnum { DBXTeamLogAdminAlertCategoryEnum(swift: swift.alertCategory) } + /// Alert ID. + @objc + public var alertInstanceId: String { swift.alertInstanceId } + /// Alert state before the change. + @objc + public var previousValue: DBXTeamLogAdminAlertGeneralStateEnum { DBXTeamLogAdminAlertGeneralStateEnum(swift: swift.previousValue) } + /// Alert state after the change. + @objc + public var newValue: DBXTeamLogAdminAlertGeneralStateEnum { DBXTeamLogAdminAlertGeneralStateEnum(swift: swift.newValue) } + + @objc + public init( + alertName: String, + alertSeverity: DBXTeamLogAdminAlertSeverityEnum, + alertCategory: DBXTeamLogAdminAlertCategoryEnum, + alertInstanceId: String, + previousValue: DBXTeamLogAdminAlertGeneralStateEnum, + newValue: DBXTeamLogAdminAlertGeneralStateEnum + ) { + self.swift = TeamLog.AdminAlertingAlertStateChangedDetails( + alertName: alertName, + alertSeverity: alertSeverity.swift, + alertCategory: alertCategory.swift, + alertInstanceId: alertInstanceId, + previousValue: previousValue.swift, + newValue: newValue.swift + ) + } + + let swift: TeamLog.AdminAlertingAlertStateChangedDetails + + public init(swift: TeamLog.AdminAlertingAlertStateChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AdminAlertingAlertStateChangedType struct +@objc +public class DBXTeamLogAdminAlertingAlertStateChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AdminAlertingAlertStateChangedType(description_: description_) + } + + let swift: TeamLog.AdminAlertingAlertStateChangedType + + public init(swift: TeamLog.AdminAlertingAlertStateChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling whether an alert can be triggered or not +@objc +public class DBXTeamLogAdminAlertingAlertStatePolicy: NSObject { + let swift: TeamLog.AdminAlertingAlertStatePolicy + + public init(swift: TeamLog.AdminAlertingAlertStatePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminAlertingAlertStatePolicy) -> DBXTeamLogAdminAlertingAlertStatePolicy { + switch swift { + case .off: + return DBXTeamLogAdminAlertingAlertStatePolicyOff() + case .on: + return DBXTeamLogAdminAlertingAlertStatePolicyOn() + case .other: + return DBXTeamLogAdminAlertingAlertStatePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOff: DBXTeamLogAdminAlertingAlertStatePolicyOff? { + self as? DBXTeamLogAdminAlertingAlertStatePolicyOff + } + + @objc + public var asOn: DBXTeamLogAdminAlertingAlertStatePolicyOn? { + self as? DBXTeamLogAdminAlertingAlertStatePolicyOn + } + + @objc + public var asOther: DBXTeamLogAdminAlertingAlertStatePolicyOther? { + self as? DBXTeamLogAdminAlertingAlertStatePolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertStatePolicyOff: DBXTeamLogAdminAlertingAlertStatePolicy { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertStatePolicy.off + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertStatePolicyOn: DBXTeamLogAdminAlertingAlertStatePolicy { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertStatePolicy.on + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminAlertingAlertStatePolicyOther: DBXTeamLogAdminAlertingAlertStatePolicy { + @objc + public init() { + let swift = TeamLog.AdminAlertingAlertStatePolicy.other + super.init(swift: swift) + } +} + +/// Changed an alert setting. +@objc +public class DBXTeamLogAdminAlertingChangedAlertConfigDetails: NSObject { + /// Alert Name. + @objc + public var alertName: String { swift.alertName } + /// Previous alert configuration. + @objc + public var previousAlertConfig: DBXTeamLogAdminAlertingAlertConfiguration { DBXTeamLogAdminAlertingAlertConfiguration(swift: swift.previousAlertConfig) } + /// New alert configuration. + @objc + public var newAlertConfig: DBXTeamLogAdminAlertingAlertConfiguration { DBXTeamLogAdminAlertingAlertConfiguration(swift: swift.newAlertConfig) } + + @objc + public init(alertName: String, previousAlertConfig: DBXTeamLogAdminAlertingAlertConfiguration, newAlertConfig: DBXTeamLogAdminAlertingAlertConfiguration) { + self.swift = TeamLog.AdminAlertingChangedAlertConfigDetails( + alertName: alertName, + previousAlertConfig: previousAlertConfig.swift, + newAlertConfig: newAlertConfig.swift + ) + } + + let swift: TeamLog.AdminAlertingChangedAlertConfigDetails + + public init(swift: TeamLog.AdminAlertingChangedAlertConfigDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AdminAlertingChangedAlertConfigType struct +@objc +public class DBXTeamLogAdminAlertingChangedAlertConfigType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AdminAlertingChangedAlertConfigType(description_: description_) + } + + let swift: TeamLog.AdminAlertingChangedAlertConfigType + + public init(swift: TeamLog.AdminAlertingChangedAlertConfigType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Triggered security alert. +@objc +public class DBXTeamLogAdminAlertingTriggeredAlertDetails: NSObject { + /// Alert name. + @objc + public var alertName: String { swift.alertName } + /// Alert severity. + @objc + public var alertSeverity: DBXTeamLogAdminAlertSeverityEnum { DBXTeamLogAdminAlertSeverityEnum(swift: swift.alertSeverity) } + /// Alert category. + @objc + public var alertCategory: DBXTeamLogAdminAlertCategoryEnum { DBXTeamLogAdminAlertCategoryEnum(swift: swift.alertCategory) } + /// Alert ID. + @objc + public var alertInstanceId: String { swift.alertInstanceId } + + @objc + public init(alertName: String, alertSeverity: DBXTeamLogAdminAlertSeverityEnum, alertCategory: DBXTeamLogAdminAlertCategoryEnum, alertInstanceId: String) { + self.swift = TeamLog.AdminAlertingTriggeredAlertDetails( + alertName: alertName, + alertSeverity: alertSeverity.swift, + alertCategory: alertCategory.swift, + alertInstanceId: alertInstanceId + ) + } + + let swift: TeamLog.AdminAlertingTriggeredAlertDetails + + public init(swift: TeamLog.AdminAlertingTriggeredAlertDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AdminAlertingTriggeredAlertType struct +@objc +public class DBXTeamLogAdminAlertingTriggeredAlertType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AdminAlertingTriggeredAlertType(description_: description_) + } + + let swift: TeamLog.AdminAlertingTriggeredAlertType + + public init(swift: TeamLog.AdminAlertingTriggeredAlertType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AdminConsoleAppPermission union +@objc +public class DBXTeamLogAdminConsoleAppPermission: NSObject { + let swift: TeamLog.AdminConsoleAppPermission + + public init(swift: TeamLog.AdminConsoleAppPermission) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminConsoleAppPermission) -> DBXTeamLogAdminConsoleAppPermission { + switch swift { + case .defaultForListedApps: + return DBXTeamLogAdminConsoleAppPermissionDefaultForListedApps() + case .defaultForUnlistedApps: + return DBXTeamLogAdminConsoleAppPermissionDefaultForUnlistedApps() + case .other: + return DBXTeamLogAdminConsoleAppPermissionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefaultForListedApps: DBXTeamLogAdminConsoleAppPermissionDefaultForListedApps? { + self as? DBXTeamLogAdminConsoleAppPermissionDefaultForListedApps + } + + @objc + public var asDefaultForUnlistedApps: DBXTeamLogAdminConsoleAppPermissionDefaultForUnlistedApps? { + self as? DBXTeamLogAdminConsoleAppPermissionDefaultForUnlistedApps + } + + @objc + public var asOther: DBXTeamLogAdminConsoleAppPermissionOther? { + self as? DBXTeamLogAdminConsoleAppPermissionOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminConsoleAppPermissionDefaultForListedApps: DBXTeamLogAdminConsoleAppPermission { + @objc + public init() { + let swift = TeamLog.AdminConsoleAppPermission.defaultForListedApps + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminConsoleAppPermissionDefaultForUnlistedApps: DBXTeamLogAdminConsoleAppPermission { + @objc + public init() { + let swift = TeamLog.AdminConsoleAppPermission.defaultForUnlistedApps + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminConsoleAppPermissionOther: DBXTeamLogAdminConsoleAppPermission { + @objc + public init() { + let swift = TeamLog.AdminConsoleAppPermission.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AdminConsoleAppPolicy union +@objc +public class DBXTeamLogAdminConsoleAppPolicy: NSObject { + let swift: TeamLog.AdminConsoleAppPolicy + + public init(swift: TeamLog.AdminConsoleAppPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminConsoleAppPolicy) -> DBXTeamLogAdminConsoleAppPolicy { + switch swift { + case .allow: + return DBXTeamLogAdminConsoleAppPolicyAllow() + case .block: + return DBXTeamLogAdminConsoleAppPolicyBlock() + case .default_: + return DBXTeamLogAdminConsoleAppPolicyDefault_() + case .other: + return DBXTeamLogAdminConsoleAppPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAllow: DBXTeamLogAdminConsoleAppPolicyAllow? { + self as? DBXTeamLogAdminConsoleAppPolicyAllow + } + + @objc + public var asBlock: DBXTeamLogAdminConsoleAppPolicyBlock? { + self as? DBXTeamLogAdminConsoleAppPolicyBlock + } + + @objc + public var asDefault_: DBXTeamLogAdminConsoleAppPolicyDefault_? { + self as? DBXTeamLogAdminConsoleAppPolicyDefault_ + } + + @objc + public var asOther: DBXTeamLogAdminConsoleAppPolicyOther? { + self as? DBXTeamLogAdminConsoleAppPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminConsoleAppPolicyAllow: DBXTeamLogAdminConsoleAppPolicy { + @objc + public init() { + let swift = TeamLog.AdminConsoleAppPolicy.allow + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminConsoleAppPolicyBlock: DBXTeamLogAdminConsoleAppPolicy { + @objc + public init() { + let swift = TeamLog.AdminConsoleAppPolicy.block + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminConsoleAppPolicyDefault_: DBXTeamLogAdminConsoleAppPolicy { + @objc + public init() { + let swift = TeamLog.AdminConsoleAppPolicy.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminConsoleAppPolicyOther: DBXTeamLogAdminConsoleAppPolicy { + @objc + public init() { + let swift = TeamLog.AdminConsoleAppPolicy.other + super.init(swift: swift) + } +} + +/// Changed admin reminder settings for requests to join the team. +@objc +public class DBXTeamLogAdminEmailRemindersChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogAdminEmailRemindersPolicy { DBXTeamLogAdminEmailRemindersPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogAdminEmailRemindersPolicy { DBXTeamLogAdminEmailRemindersPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogAdminEmailRemindersPolicy, previousValue: DBXTeamLogAdminEmailRemindersPolicy) { + self.swift = TeamLog.AdminEmailRemindersChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.AdminEmailRemindersChangedDetails + + public init(swift: TeamLog.AdminEmailRemindersChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AdminEmailRemindersChangedType struct +@objc +public class DBXTeamLogAdminEmailRemindersChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AdminEmailRemindersChangedType(description_: description_) + } + + let swift: TeamLog.AdminEmailRemindersChangedType + + public init(swift: TeamLog.AdminEmailRemindersChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether team admins receive reminder emails for requests to join the team +@objc +public class DBXTeamLogAdminEmailRemindersPolicy: NSObject { + let swift: TeamLog.AdminEmailRemindersPolicy + + public init(swift: TeamLog.AdminEmailRemindersPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminEmailRemindersPolicy) -> DBXTeamLogAdminEmailRemindersPolicy { + switch swift { + case .default_: + return DBXTeamLogAdminEmailRemindersPolicyDefault_() + case .disabled: + return DBXTeamLogAdminEmailRemindersPolicyDisabled() + case .enabled: + return DBXTeamLogAdminEmailRemindersPolicyEnabled() + case .other: + return DBXTeamLogAdminEmailRemindersPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXTeamLogAdminEmailRemindersPolicyDefault_? { + self as? DBXTeamLogAdminEmailRemindersPolicyDefault_ + } + + @objc + public var asDisabled: DBXTeamLogAdminEmailRemindersPolicyDisabled? { + self as? DBXTeamLogAdminEmailRemindersPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogAdminEmailRemindersPolicyEnabled? { + self as? DBXTeamLogAdminEmailRemindersPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogAdminEmailRemindersPolicyOther? { + self as? DBXTeamLogAdminEmailRemindersPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminEmailRemindersPolicyDefault_: DBXTeamLogAdminEmailRemindersPolicy { + @objc + public init() { + let swift = TeamLog.AdminEmailRemindersPolicy.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminEmailRemindersPolicyDisabled: DBXTeamLogAdminEmailRemindersPolicy { + @objc + public init() { + let swift = TeamLog.AdminEmailRemindersPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminEmailRemindersPolicyEnabled: DBXTeamLogAdminEmailRemindersPolicy { + @objc + public init() { + let swift = TeamLog.AdminEmailRemindersPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminEmailRemindersPolicyOther: DBXTeamLogAdminEmailRemindersPolicy { + @objc + public init() { + let swift = TeamLog.AdminEmailRemindersPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible AdminRole union +@objc +public class DBXTeamLogAdminRole: NSObject { + let swift: TeamLog.AdminRole + + public init(swift: TeamLog.AdminRole) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AdminRole) -> DBXTeamLogAdminRole { + switch swift { + case .billingAdmin: + return DBXTeamLogAdminRoleBillingAdmin() + case .complianceAdmin: + return DBXTeamLogAdminRoleComplianceAdmin() + case .contentAdmin: + return DBXTeamLogAdminRoleContentAdmin() + case .limitedAdmin: + return DBXTeamLogAdminRoleLimitedAdmin() + case .memberOnly: + return DBXTeamLogAdminRoleMemberOnly() + case .reportingAdmin: + return DBXTeamLogAdminRoleReportingAdmin() + case .securityAdmin: + return DBXTeamLogAdminRoleSecurityAdmin() + case .supportAdmin: + return DBXTeamLogAdminRoleSupportAdmin() + case .teamAdmin: + return DBXTeamLogAdminRoleTeamAdmin() + case .userManagementAdmin: + return DBXTeamLogAdminRoleUserManagementAdmin() + case .other: + return DBXTeamLogAdminRoleOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asBillingAdmin: DBXTeamLogAdminRoleBillingAdmin? { + self as? DBXTeamLogAdminRoleBillingAdmin + } + + @objc + public var asComplianceAdmin: DBXTeamLogAdminRoleComplianceAdmin? { + self as? DBXTeamLogAdminRoleComplianceAdmin + } + + @objc + public var asContentAdmin: DBXTeamLogAdminRoleContentAdmin? { + self as? DBXTeamLogAdminRoleContentAdmin + } + + @objc + public var asLimitedAdmin: DBXTeamLogAdminRoleLimitedAdmin? { + self as? DBXTeamLogAdminRoleLimitedAdmin + } + + @objc + public var asMemberOnly: DBXTeamLogAdminRoleMemberOnly? { + self as? DBXTeamLogAdminRoleMemberOnly + } + + @objc + public var asReportingAdmin: DBXTeamLogAdminRoleReportingAdmin? { + self as? DBXTeamLogAdminRoleReportingAdmin + } + + @objc + public var asSecurityAdmin: DBXTeamLogAdminRoleSecurityAdmin? { + self as? DBXTeamLogAdminRoleSecurityAdmin + } + + @objc + public var asSupportAdmin: DBXTeamLogAdminRoleSupportAdmin? { + self as? DBXTeamLogAdminRoleSupportAdmin + } + + @objc + public var asTeamAdmin: DBXTeamLogAdminRoleTeamAdmin? { + self as? DBXTeamLogAdminRoleTeamAdmin + } + + @objc + public var asUserManagementAdmin: DBXTeamLogAdminRoleUserManagementAdmin? { + self as? DBXTeamLogAdminRoleUserManagementAdmin + } + + @objc + public var asOther: DBXTeamLogAdminRoleOther? { + self as? DBXTeamLogAdminRoleOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleBillingAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.billingAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleComplianceAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.complianceAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleContentAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.contentAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleLimitedAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.limitedAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleMemberOnly: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.memberOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleReportingAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.reportingAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleSecurityAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.securityAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleSupportAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.supportAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleTeamAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.teamAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleUserManagementAdmin: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.userManagementAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAdminRoleOther: DBXTeamLogAdminRole { + @objc + public init() { + let swift = TeamLog.AdminRole.other + super.init(swift: swift) + } +} + +/// Alert recipients setting type +@objc +public class DBXTeamLogAlertRecipientsSettingType: NSObject { + let swift: TeamLog.AlertRecipientsSettingType + + public init(swift: TeamLog.AlertRecipientsSettingType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AlertRecipientsSettingType) -> DBXTeamLogAlertRecipientsSettingType { + switch swift { + case .customList: + return DBXTeamLogAlertRecipientsSettingTypeCustomList() + case .invalid: + return DBXTeamLogAlertRecipientsSettingTypeInvalid() + case .none: + return DBXTeamLogAlertRecipientsSettingTypeNone() + case .teamAdmins: + return DBXTeamLogAlertRecipientsSettingTypeTeamAdmins() + case .other: + return DBXTeamLogAlertRecipientsSettingTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asCustomList: DBXTeamLogAlertRecipientsSettingTypeCustomList? { + self as? DBXTeamLogAlertRecipientsSettingTypeCustomList + } + + @objc + public var asInvalid: DBXTeamLogAlertRecipientsSettingTypeInvalid? { + self as? DBXTeamLogAlertRecipientsSettingTypeInvalid + } + + @objc + public var asNone: DBXTeamLogAlertRecipientsSettingTypeNone? { + self as? DBXTeamLogAlertRecipientsSettingTypeNone + } + + @objc + public var asTeamAdmins: DBXTeamLogAlertRecipientsSettingTypeTeamAdmins? { + self as? DBXTeamLogAlertRecipientsSettingTypeTeamAdmins + } + + @objc + public var asOther: DBXTeamLogAlertRecipientsSettingTypeOther? { + self as? DBXTeamLogAlertRecipientsSettingTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAlertRecipientsSettingTypeCustomList: DBXTeamLogAlertRecipientsSettingType { + @objc + public init() { + let swift = TeamLog.AlertRecipientsSettingType.customList + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAlertRecipientsSettingTypeInvalid: DBXTeamLogAlertRecipientsSettingType { + @objc + public init() { + let swift = TeamLog.AlertRecipientsSettingType.invalid + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAlertRecipientsSettingTypeNone: DBXTeamLogAlertRecipientsSettingType { + @objc + public init() { + let swift = TeamLog.AlertRecipientsSettingType.none + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAlertRecipientsSettingTypeTeamAdmins: DBXTeamLogAlertRecipientsSettingType { + @objc + public init() { + let swift = TeamLog.AlertRecipientsSettingType.teamAdmins + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAlertRecipientsSettingTypeOther: DBXTeamLogAlertRecipientsSettingType { + @objc + public init() { + let swift = TeamLog.AlertRecipientsSettingType.other + super.init(swift: swift) + } +} + +/// Disabled downloads. +@objc +public class DBXTeamLogAllowDownloadDisabledDetails: NSObject { + let swift: TeamLog.AllowDownloadDisabledDetails + + public init(swift: TeamLog.AllowDownloadDisabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AllowDownloadDisabledType struct +@objc +public class DBXTeamLogAllowDownloadDisabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AllowDownloadDisabledType(description_: description_) + } + + let swift: TeamLog.AllowDownloadDisabledType + + public init(swift: TeamLog.AllowDownloadDisabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled downloads. +@objc +public class DBXTeamLogAllowDownloadEnabledDetails: NSObject { + let swift: TeamLog.AllowDownloadEnabledDetails + + public init(swift: TeamLog.AllowDownloadEnabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AllowDownloadEnabledType struct +@objc +public class DBXTeamLogAllowDownloadEnabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AllowDownloadEnabledType(description_: description_) + } + + let swift: TeamLog.AllowDownloadEnabledType + + public init(swift: TeamLog.AllowDownloadEnabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Api session. +@objc +public class DBXTeamLogApiSessionLogInfo: NSObject { + /// Api request ID. + @objc + public var requestId: String { swift.requestId } + + @objc + public init(requestId: String) { + self.swift = TeamLog.ApiSessionLogInfo(requestId: requestId) + } + + let swift: TeamLog.ApiSessionLogInfo + + public init(swift: TeamLog.ApiSessionLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Failed to connect app for member. +@objc +public class DBXTeamLogAppBlockedByPermissionsDetails: NSObject { + /// Relevant application details. + @objc + public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) } + + @objc + public init(appInfo: DBXTeamLogAppLogInfo) { + self.swift = TeamLog.AppBlockedByPermissionsDetails(appInfo: appInfo.swift) + } + + let swift: TeamLog.AppBlockedByPermissionsDetails + + public init(swift: TeamLog.AppBlockedByPermissionsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AppBlockedByPermissionsType struct +@objc +public class DBXTeamLogAppBlockedByPermissionsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AppBlockedByPermissionsType(description_: description_) + } + + let swift: TeamLog.AppBlockedByPermissionsType + + public init(swift: TeamLog.AppBlockedByPermissionsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Linked app for team. +@objc +public class DBXTeamLogAppLinkTeamDetails: NSObject { + /// Relevant application details. + @objc + public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) } + + @objc + public init(appInfo: DBXTeamLogAppLogInfo) { + self.swift = TeamLog.AppLinkTeamDetails(appInfo: appInfo.swift) + } + + let swift: TeamLog.AppLinkTeamDetails + + public init(swift: TeamLog.AppLinkTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AppLinkTeamType struct +@objc +public class DBXTeamLogAppLinkTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AppLinkTeamType(description_: description_) + } + + let swift: TeamLog.AppLinkTeamType + + public init(swift: TeamLog.AppLinkTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Linked app for member. +@objc +public class DBXTeamLogAppLinkUserDetails: NSObject { + /// Relevant application details. + @objc + public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) } + + @objc + public init(appInfo: DBXTeamLogAppLogInfo) { + self.swift = TeamLog.AppLinkUserDetails(appInfo: appInfo.swift) + } + + let swift: TeamLog.AppLinkUserDetails + + public init(swift: TeamLog.AppLinkUserDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AppLinkUserType struct +@objc +public class DBXTeamLogAppLinkUserType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AppLinkUserType(description_: description_) + } + + let swift: TeamLog.AppLinkUserType + + public init(swift: TeamLog.AppLinkUserType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// App's logged information. +@objc +public class DBXTeamLogAppLogInfo: NSObject { + /// App unique ID. + @objc + public var appId: String? { swift.appId } + /// App display name. + @objc + public var displayName: String? { swift.displayName } + + @objc + public init(appId: String?, displayName: String?) { + self.swift = TeamLog.AppLogInfo(appId: appId, displayName: displayName) + } + + let swift: TeamLog.AppLogInfo + + public init(swift: TeamLog.AppLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed app permissions. +@objc +public class DBXTeamLogAppPermissionsChangedDetails: NSObject { + /// Name of the app. + @objc + public var appName: String? { swift.appName } + /// Permission that was changed. + @objc + public var permission: DBXTeamLogAdminConsoleAppPermission? { guard let swift = swift.permission else { return nil } + return DBXTeamLogAdminConsoleAppPermission(swift: swift) + } + + /// Previous policy. + @objc + public var previousValue: DBXTeamLogAdminConsoleAppPolicy { DBXTeamLogAdminConsoleAppPolicy(swift: swift.previousValue) } + /// New policy. + @objc + public var newValue: DBXTeamLogAdminConsoleAppPolicy { DBXTeamLogAdminConsoleAppPolicy(swift: swift.newValue) } + + @objc + public init( + previousValue: DBXTeamLogAdminConsoleAppPolicy, + newValue: DBXTeamLogAdminConsoleAppPolicy, + appName: String?, + permission: DBXTeamLogAdminConsoleAppPermission? + ) { + self.swift = TeamLog.AppPermissionsChangedDetails( + previousValue: previousValue.swift, + newValue: newValue.swift, + appName: appName, + permission: permission?.swift + ) + } + + let swift: TeamLog.AppPermissionsChangedDetails + + public init(swift: TeamLog.AppPermissionsChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AppPermissionsChangedType struct +@objc +public class DBXTeamLogAppPermissionsChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AppPermissionsChangedType(description_: description_) + } + + let swift: TeamLog.AppPermissionsChangedType + + public init(swift: TeamLog.AppPermissionsChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unlinked app for team. +@objc +public class DBXTeamLogAppUnlinkTeamDetails: NSObject { + /// Relevant application details. + @objc + public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) } + + @objc + public init(appInfo: DBXTeamLogAppLogInfo) { + self.swift = TeamLog.AppUnlinkTeamDetails(appInfo: appInfo.swift) + } + + let swift: TeamLog.AppUnlinkTeamDetails + + public init(swift: TeamLog.AppUnlinkTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AppUnlinkTeamType struct +@objc +public class DBXTeamLogAppUnlinkTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AppUnlinkTeamType(description_: description_) + } + + let swift: TeamLog.AppUnlinkTeamType + + public init(swift: TeamLog.AppUnlinkTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unlinked app for member. +@objc +public class DBXTeamLogAppUnlinkUserDetails: NSObject { + /// Relevant application details. + @objc + public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) } + + @objc + public init(appInfo: DBXTeamLogAppLogInfo) { + self.swift = TeamLog.AppUnlinkUserDetails(appInfo: appInfo.swift) + } + + let swift: TeamLog.AppUnlinkUserDetails + + public init(swift: TeamLog.AppUnlinkUserDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible AppUnlinkUserType struct +@objc +public class DBXTeamLogAppUnlinkUserType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.AppUnlinkUserType(description_: description_) + } + + let swift: TeamLog.AppUnlinkUserType + + public init(swift: TeamLog.AppUnlinkUserType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Applied naming convention. +@objc +public class DBXTeamLogApplyNamingConventionDetails: NSObject { + let swift: TeamLog.ApplyNamingConventionDetails + + public init(swift: TeamLog.ApplyNamingConventionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ApplyNamingConventionType struct +@objc +public class DBXTeamLogApplyNamingConventionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ApplyNamingConventionType(description_: description_) + } + + let swift: TeamLog.ApplyNamingConventionType + + public init(swift: TeamLog.ApplyNamingConventionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Asset details. +@objc +public class DBXTeamLogAssetLogInfo: NSObject { + let swift: TeamLog.AssetLogInfo + + public init(swift: TeamLog.AssetLogInfo) { + self.swift = swift + } + + public static func factory(swift: TeamLog.AssetLogInfo) -> DBXTeamLogAssetLogInfo { + switch swift { + case .file(let swiftArg): + let arg = DBXTeamLogFileLogInfo(swift: swiftArg) + return DBXTeamLogAssetLogInfoFile(arg) + case .folder(let swiftArg): + let arg = DBXTeamLogFolderLogInfo(swift: swiftArg) + return DBXTeamLogAssetLogInfoFolder(arg) + case .paperDocument(let swiftArg): + let arg = DBXTeamLogPaperDocumentLogInfo(swift: swiftArg) + return DBXTeamLogAssetLogInfoPaperDocument(arg) + case .paperFolder(let swiftArg): + let arg = DBXTeamLogPaperFolderLogInfo(swift: swiftArg) + return DBXTeamLogAssetLogInfoPaperFolder(arg) + case .showcaseDocument(let swiftArg): + let arg = DBXTeamLogShowcaseDocumentLogInfo(swift: swiftArg) + return DBXTeamLogAssetLogInfoShowcaseDocument(arg) + case .other: + return DBXTeamLogAssetLogInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFile: DBXTeamLogAssetLogInfoFile? { + self as? DBXTeamLogAssetLogInfoFile + } + + @objc + public var asFolder: DBXTeamLogAssetLogInfoFolder? { + self as? DBXTeamLogAssetLogInfoFolder + } + + @objc + public var asPaperDocument: DBXTeamLogAssetLogInfoPaperDocument? { + self as? DBXTeamLogAssetLogInfoPaperDocument + } + + @objc + public var asPaperFolder: DBXTeamLogAssetLogInfoPaperFolder? { + self as? DBXTeamLogAssetLogInfoPaperFolder + } + + @objc + public var asShowcaseDocument: DBXTeamLogAssetLogInfoShowcaseDocument? { + self as? DBXTeamLogAssetLogInfoShowcaseDocument + } + + @objc + public var asOther: DBXTeamLogAssetLogInfoOther? { + self as? DBXTeamLogAssetLogInfoOther + } +} + +/// File's details. +@objc +public class DBXTeamLogAssetLogInfoFile: DBXTeamLogAssetLogInfo { + @objc + public var file: DBXTeamLogFileLogInfo + + @objc + public init(_ arg: DBXTeamLogFileLogInfo) { + self.file = arg + let swift = TeamLog.AssetLogInfo.file(arg.subSwift) + super.init(swift: swift) + } +} + +/// Folder's details. +@objc +public class DBXTeamLogAssetLogInfoFolder: DBXTeamLogAssetLogInfo { + @objc + public var folder: DBXTeamLogFolderLogInfo + + @objc + public init(_ arg: DBXTeamLogFolderLogInfo) { + self.folder = arg + let swift = TeamLog.AssetLogInfo.folder(arg.subSwift) + super.init(swift: swift) + } +} + +/// Paper document's details. +@objc +public class DBXTeamLogAssetLogInfoPaperDocument: DBXTeamLogAssetLogInfo { + @objc + public var paperDocument: DBXTeamLogPaperDocumentLogInfo + + @objc + public init(_ arg: DBXTeamLogPaperDocumentLogInfo) { + self.paperDocument = arg + let swift = TeamLog.AssetLogInfo.paperDocument(arg.swift) + super.init(swift: swift) + } +} + +/// Paper folder's details. +@objc +public class DBXTeamLogAssetLogInfoPaperFolder: DBXTeamLogAssetLogInfo { + @objc + public var paperFolder: DBXTeamLogPaperFolderLogInfo + + @objc + public init(_ arg: DBXTeamLogPaperFolderLogInfo) { + self.paperFolder = arg + let swift = TeamLog.AssetLogInfo.paperFolder(arg.swift) + super.init(swift: swift) + } +} + +/// Showcase document's details. +@objc +public class DBXTeamLogAssetLogInfoShowcaseDocument: DBXTeamLogAssetLogInfo { + @objc + public var showcaseDocument: DBXTeamLogShowcaseDocumentLogInfo + + @objc + public init(_ arg: DBXTeamLogShowcaseDocumentLogInfo) { + self.showcaseDocument = arg + let swift = TeamLog.AssetLogInfo.showcaseDocument(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogAssetLogInfoOther: DBXTeamLogAssetLogInfo { + @objc + public init() { + let swift = TeamLog.AssetLogInfo.other + super.init(swift: swift) + } +} + +/// Invited members to activate Backup. +@objc +public class DBXTeamLogBackupAdminInvitationSentDetails: NSObject { + let swift: TeamLog.BackupAdminInvitationSentDetails + + public init(swift: TeamLog.BackupAdminInvitationSentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BackupAdminInvitationSentType struct +@objc +public class DBXTeamLogBackupAdminInvitationSentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BackupAdminInvitationSentType(description_: description_) + } + + let swift: TeamLog.BackupAdminInvitationSentType + + public init(swift: TeamLog.BackupAdminInvitationSentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Opened Backup invite. +@objc +public class DBXTeamLogBackupInvitationOpenedDetails: NSObject { + let swift: TeamLog.BackupInvitationOpenedDetails + + public init(swift: TeamLog.BackupInvitationOpenedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BackupInvitationOpenedType struct +@objc +public class DBXTeamLogBackupInvitationOpenedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BackupInvitationOpenedType(description_: description_) + } + + let swift: TeamLog.BackupInvitationOpenedType + + public init(swift: TeamLog.BackupInvitationOpenedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Backup status +@objc +public class DBXTeamLogBackupStatus: NSObject { + let swift: TeamLog.BackupStatus + + public init(swift: TeamLog.BackupStatus) { + self.swift = swift + } + + public static func factory(swift: TeamLog.BackupStatus) -> DBXTeamLogBackupStatus { + switch swift { + case .disabled: + return DBXTeamLogBackupStatusDisabled() + case .enabled: + return DBXTeamLogBackupStatusEnabled() + case .other: + return DBXTeamLogBackupStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogBackupStatusDisabled? { + self as? DBXTeamLogBackupStatusDisabled + } + + @objc + public var asEnabled: DBXTeamLogBackupStatusEnabled? { + self as? DBXTeamLogBackupStatusEnabled + } + + @objc + public var asOther: DBXTeamLogBackupStatusOther? { + self as? DBXTeamLogBackupStatusOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogBackupStatusDisabled: DBXTeamLogBackupStatus { + @objc + public init() { + let swift = TeamLog.BackupStatus.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogBackupStatusEnabled: DBXTeamLogBackupStatus { + @objc + public init() { + let swift = TeamLog.BackupStatus.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogBackupStatusOther: DBXTeamLogBackupStatus { + @objc + public init() { + let swift = TeamLog.BackupStatus.other + super.init(swift: swift) + } +} + +/// Added Binder page. +@objc +public class DBXTeamLogBinderAddPageDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String) { + self.swift = TeamLog.BinderAddPageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + } + + let swift: TeamLog.BinderAddPageDetails + + public init(swift: TeamLog.BinderAddPageDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderAddPageType struct +@objc +public class DBXTeamLogBinderAddPageType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderAddPageType(description_: description_) + } + + let swift: TeamLog.BinderAddPageType + + public init(swift: TeamLog.BinderAddPageType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added Binder section. +@objc +public class DBXTeamLogBinderAddSectionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String) { + self.swift = TeamLog.BinderAddSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + } + + let swift: TeamLog.BinderAddSectionDetails + + public init(swift: TeamLog.BinderAddSectionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderAddSectionType struct +@objc +public class DBXTeamLogBinderAddSectionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderAddSectionType(description_: description_) + } + + let swift: TeamLog.BinderAddSectionType + + public init(swift: TeamLog.BinderAddSectionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed Binder page. +@objc +public class DBXTeamLogBinderRemovePageDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String) { + self.swift = TeamLog.BinderRemovePageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + } + + let swift: TeamLog.BinderRemovePageDetails + + public init(swift: TeamLog.BinderRemovePageDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderRemovePageType struct +@objc +public class DBXTeamLogBinderRemovePageType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderRemovePageType(description_: description_) + } + + let swift: TeamLog.BinderRemovePageType + + public init(swift: TeamLog.BinderRemovePageType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed Binder section. +@objc +public class DBXTeamLogBinderRemoveSectionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String) { + self.swift = TeamLog.BinderRemoveSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + } + + let swift: TeamLog.BinderRemoveSectionDetails + + public init(swift: TeamLog.BinderRemoveSectionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderRemoveSectionType struct +@objc +public class DBXTeamLogBinderRemoveSectionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderRemoveSectionType(description_: description_) + } + + let swift: TeamLog.BinderRemoveSectionType + + public init(swift: TeamLog.BinderRemoveSectionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed Binder page. +@objc +public class DBXTeamLogBinderRenamePageDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + /// Previous name of the Binder page/section. + @objc + public var previousBinderItemName: String? { swift.previousBinderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String, previousBinderItemName: String?) { + self.swift = TeamLog.BinderRenamePageDetails( + eventUuid: eventUuid, + docTitle: docTitle, + binderItemName: binderItemName, + previousBinderItemName: previousBinderItemName + ) + } + + let swift: TeamLog.BinderRenamePageDetails + + public init(swift: TeamLog.BinderRenamePageDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderRenamePageType struct +@objc +public class DBXTeamLogBinderRenamePageType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderRenamePageType(description_: description_) + } + + let swift: TeamLog.BinderRenamePageType + + public init(swift: TeamLog.BinderRenamePageType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed Binder section. +@objc +public class DBXTeamLogBinderRenameSectionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + /// Previous name of the Binder page/section. + @objc + public var previousBinderItemName: String? { swift.previousBinderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String, previousBinderItemName: String?) { + self.swift = TeamLog.BinderRenameSectionDetails( + eventUuid: eventUuid, + docTitle: docTitle, + binderItemName: binderItemName, + previousBinderItemName: previousBinderItemName + ) + } + + let swift: TeamLog.BinderRenameSectionDetails + + public init(swift: TeamLog.BinderRenameSectionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderRenameSectionType struct +@objc +public class DBXTeamLogBinderRenameSectionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderRenameSectionType(description_: description_) + } + + let swift: TeamLog.BinderRenameSectionType + + public init(swift: TeamLog.BinderRenameSectionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reordered Binder page. +@objc +public class DBXTeamLogBinderReorderPageDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String) { + self.swift = TeamLog.BinderReorderPageDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + } + + let swift: TeamLog.BinderReorderPageDetails + + public init(swift: TeamLog.BinderReorderPageDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderReorderPageType struct +@objc +public class DBXTeamLogBinderReorderPageType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderReorderPageType(description_: description_) + } + + let swift: TeamLog.BinderReorderPageType + + public init(swift: TeamLog.BinderReorderPageType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reordered Binder section. +@objc +public class DBXTeamLogBinderReorderSectionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Title of the Binder doc. + @objc + public var docTitle: String { swift.docTitle } + /// Name of the Binder page/section. + @objc + public var binderItemName: String { swift.binderItemName } + + @objc + public init(eventUuid: String, docTitle: String, binderItemName: String) { + self.swift = TeamLog.BinderReorderSectionDetails(eventUuid: eventUuid, docTitle: docTitle, binderItemName: binderItemName) + } + + let swift: TeamLog.BinderReorderSectionDetails + + public init(swift: TeamLog.BinderReorderSectionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible BinderReorderSectionType struct +@objc +public class DBXTeamLogBinderReorderSectionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.BinderReorderSectionType(description_: description_) + } + + let swift: TeamLog.BinderReorderSectionType + + public init(swift: TeamLog.BinderReorderSectionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling if team members can activate camera uploads +@objc +public class DBXTeamLogCameraUploadsPolicy: NSObject { + let swift: TeamLog.CameraUploadsPolicy + + public init(swift: TeamLog.CameraUploadsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.CameraUploadsPolicy) -> DBXTeamLogCameraUploadsPolicy { + switch swift { + case .disabled: + return DBXTeamLogCameraUploadsPolicyDisabled() + case .enabled: + return DBXTeamLogCameraUploadsPolicyEnabled() + case .other: + return DBXTeamLogCameraUploadsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogCameraUploadsPolicyDisabled? { + self as? DBXTeamLogCameraUploadsPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogCameraUploadsPolicyEnabled? { + self as? DBXTeamLogCameraUploadsPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogCameraUploadsPolicyOther? { + self as? DBXTeamLogCameraUploadsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogCameraUploadsPolicyDisabled: DBXTeamLogCameraUploadsPolicy { + @objc + public init() { + let swift = TeamLog.CameraUploadsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogCameraUploadsPolicyEnabled: DBXTeamLogCameraUploadsPolicy { + @objc + public init() { + let swift = TeamLog.CameraUploadsPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogCameraUploadsPolicyOther: DBXTeamLogCameraUploadsPolicy { + @objc + public init() { + let swift = TeamLog.CameraUploadsPolicy.other + super.init(swift: swift) + } +} + +/// Changed camera uploads setting for team. +@objc +public class DBXTeamLogCameraUploadsPolicyChangedDetails: NSObject { + /// New camera uploads setting. + @objc + public var newValue: DBXTeamLogCameraUploadsPolicy { DBXTeamLogCameraUploadsPolicy(swift: swift.newValue) } + /// Previous camera uploads setting. + @objc + public var previousValue: DBXTeamLogCameraUploadsPolicy { DBXTeamLogCameraUploadsPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogCameraUploadsPolicy, previousValue: DBXTeamLogCameraUploadsPolicy) { + self.swift = TeamLog.CameraUploadsPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.CameraUploadsPolicyChangedDetails + + public init(swift: TeamLog.CameraUploadsPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CameraUploadsPolicyChangedType struct +@objc +public class DBXTeamLogCameraUploadsPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.CameraUploadsPolicyChangedType(description_: description_) + } + + let swift: TeamLog.CameraUploadsPolicyChangedType + + public init(swift: TeamLog.CameraUploadsPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether team users can transcription in Capture +@objc +public class DBXTeamLogCaptureTranscriptPolicy: NSObject { + let swift: TeamLog.CaptureTranscriptPolicy + + public init(swift: TeamLog.CaptureTranscriptPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.CaptureTranscriptPolicy) -> DBXTeamLogCaptureTranscriptPolicy { + switch swift { + case .default_: + return DBXTeamLogCaptureTranscriptPolicyDefault_() + case .disabled: + return DBXTeamLogCaptureTranscriptPolicyDisabled() + case .enabled: + return DBXTeamLogCaptureTranscriptPolicyEnabled() + case .other: + return DBXTeamLogCaptureTranscriptPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXTeamLogCaptureTranscriptPolicyDefault_? { + self as? DBXTeamLogCaptureTranscriptPolicyDefault_ + } + + @objc + public var asDisabled: DBXTeamLogCaptureTranscriptPolicyDisabled? { + self as? DBXTeamLogCaptureTranscriptPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogCaptureTranscriptPolicyEnabled? { + self as? DBXTeamLogCaptureTranscriptPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogCaptureTranscriptPolicyOther? { + self as? DBXTeamLogCaptureTranscriptPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogCaptureTranscriptPolicyDefault_: DBXTeamLogCaptureTranscriptPolicy { + @objc + public init() { + let swift = TeamLog.CaptureTranscriptPolicy.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogCaptureTranscriptPolicyDisabled: DBXTeamLogCaptureTranscriptPolicy { + @objc + public init() { + let swift = TeamLog.CaptureTranscriptPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogCaptureTranscriptPolicyEnabled: DBXTeamLogCaptureTranscriptPolicy { + @objc + public init() { + let swift = TeamLog.CaptureTranscriptPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogCaptureTranscriptPolicyOther: DBXTeamLogCaptureTranscriptPolicy { + @objc + public init() { + let swift = TeamLog.CaptureTranscriptPolicy.other + super.init(swift: swift) + } +} + +/// Changed Capture transcription policy for team. +@objc +public class DBXTeamLogCaptureTranscriptPolicyChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogCaptureTranscriptPolicy { DBXTeamLogCaptureTranscriptPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogCaptureTranscriptPolicy { DBXTeamLogCaptureTranscriptPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogCaptureTranscriptPolicy, previousValue: DBXTeamLogCaptureTranscriptPolicy) { + self.swift = TeamLog.CaptureTranscriptPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.CaptureTranscriptPolicyChangedDetails + + public init(swift: TeamLog.CaptureTranscriptPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CaptureTranscriptPolicyChangedType struct +@objc +public class DBXTeamLogCaptureTranscriptPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.CaptureTranscriptPolicyChangedType(description_: description_) + } + + let swift: TeamLog.CaptureTranscriptPolicyChangedType + + public init(swift: TeamLog.CaptureTranscriptPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Certificate details. +@objc +public class DBXTeamLogCertificate: NSObject { + /// Certificate subject. + @objc + public var subject: String { swift.subject } + /// Certificate issuer. + @objc + public var issuer: String { swift.issuer } + /// Certificate issue date. + @objc + public var issueDate: String { swift.issueDate } + /// Certificate expiration date. + @objc + public var expirationDate: String { swift.expirationDate } + /// Certificate serial number. + @objc + public var serialNumber: String { swift.serialNumber } + /// Certificate sha1 fingerprint. + @objc + public var sha1Fingerprint: String { swift.sha1Fingerprint } + /// Certificate common name. + @objc + public var commonName: String? { swift.commonName } + + @objc + public init( + subject: String, + issuer: String, + issueDate: String, + expirationDate: String, + serialNumber: String, + sha1Fingerprint: String, + commonName: String? + ) { + self.swift = TeamLog.Certificate( + subject: subject, + issuer: issuer, + issueDate: issueDate, + expirationDate: expirationDate, + serialNumber: serialNumber, + sha1Fingerprint: sha1Fingerprint, + commonName: commonName + ) + } + + let swift: TeamLog.Certificate + + public init(swift: TeamLog.Certificate) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether the team's default expiration days policy must be enforced when an externally shared +/// link is updated +@objc +public class DBXTeamLogChangeLinkExpirationPolicy: NSObject { + let swift: TeamLog.ChangeLinkExpirationPolicy + + public init(swift: TeamLog.ChangeLinkExpirationPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ChangeLinkExpirationPolicy) -> DBXTeamLogChangeLinkExpirationPolicy { + switch swift { + case .allowed: + return DBXTeamLogChangeLinkExpirationPolicyAllowed() + case .notAllowed: + return DBXTeamLogChangeLinkExpirationPolicyNotAllowed() + case .other: + return DBXTeamLogChangeLinkExpirationPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAllowed: DBXTeamLogChangeLinkExpirationPolicyAllowed? { + self as? DBXTeamLogChangeLinkExpirationPolicyAllowed + } + + @objc + public var asNotAllowed: DBXTeamLogChangeLinkExpirationPolicyNotAllowed? { + self as? DBXTeamLogChangeLinkExpirationPolicyNotAllowed + } + + @objc + public var asOther: DBXTeamLogChangeLinkExpirationPolicyOther? { + self as? DBXTeamLogChangeLinkExpirationPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogChangeLinkExpirationPolicyAllowed: DBXTeamLogChangeLinkExpirationPolicy { + @objc + public init() { + let swift = TeamLog.ChangeLinkExpirationPolicy.allowed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogChangeLinkExpirationPolicyNotAllowed: DBXTeamLogChangeLinkExpirationPolicy { + @objc + public init() { + let swift = TeamLog.ChangeLinkExpirationPolicy.notAllowed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogChangeLinkExpirationPolicyOther: DBXTeamLogChangeLinkExpirationPolicy { + @objc + public init() { + let swift = TeamLog.ChangeLinkExpirationPolicy.other + super.init(swift: swift) + } +} + +/// Changed enterprise admin role. +@objc +public class DBXTeamLogChangedEnterpriseAdminRoleDetails: NSObject { + /// The member’s previous enterprise admin role. + @objc + public var previousValue: DBXTeamLogFedAdminRole { DBXTeamLogFedAdminRole(swift: swift.previousValue) } + /// The member’s new enterprise admin role. + @objc + public var newValue: DBXTeamLogFedAdminRole { DBXTeamLogFedAdminRole(swift: swift.newValue) } + /// The name of the member’s team. + @objc + public var teamName: String { swift.teamName } + + @objc + public init(previousValue: DBXTeamLogFedAdminRole, newValue: DBXTeamLogFedAdminRole, teamName: String) { + self.swift = TeamLog.ChangedEnterpriseAdminRoleDetails(previousValue: previousValue.swift, newValue: newValue.swift, teamName: teamName) + } + + let swift: TeamLog.ChangedEnterpriseAdminRoleDetails + + public init(swift: TeamLog.ChangedEnterpriseAdminRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ChangedEnterpriseAdminRoleType struct +@objc +public class DBXTeamLogChangedEnterpriseAdminRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ChangedEnterpriseAdminRoleType(description_: description_) + } + + let swift: TeamLog.ChangedEnterpriseAdminRoleType + + public init(swift: TeamLog.ChangedEnterpriseAdminRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed enterprise-connected team status. +@objc +public class DBXTeamLogChangedEnterpriseConnectedTeamStatusDetails: NSObject { + /// The preformed change in the team’s connection status. + @objc + public var action: DBXTeamLogFedHandshakeAction { DBXTeamLogFedHandshakeAction(swift: swift.action) } + /// Additional information about the organization or team. + @objc + public var additionalInfo: DBXTeamLogFederationStatusChangeAdditionalInfo { DBXTeamLogFederationStatusChangeAdditionalInfo(swift: swift.additionalInfo) } + /// Previous request state. + @objc + public var previousValue: DBXTeamLogTrustedTeamsRequestState { DBXTeamLogTrustedTeamsRequestState(swift: swift.previousValue) } + /// New request state. + @objc + public var newValue: DBXTeamLogTrustedTeamsRequestState { DBXTeamLogTrustedTeamsRequestState(swift: swift.newValue) } + + @objc + public init( + action: DBXTeamLogFedHandshakeAction, + additionalInfo: DBXTeamLogFederationStatusChangeAdditionalInfo, + previousValue: DBXTeamLogTrustedTeamsRequestState, + newValue: DBXTeamLogTrustedTeamsRequestState + ) { + self.swift = TeamLog.ChangedEnterpriseConnectedTeamStatusDetails( + action: action.swift, + additionalInfo: additionalInfo.swift, + previousValue: previousValue.swift, + newValue: newValue.swift + ) + } + + let swift: TeamLog.ChangedEnterpriseConnectedTeamStatusDetails + + public init(swift: TeamLog.ChangedEnterpriseConnectedTeamStatusDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ChangedEnterpriseConnectedTeamStatusType struct +@objc +public class DBXTeamLogChangedEnterpriseConnectedTeamStatusType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ChangedEnterpriseConnectedTeamStatusType(description_: description_) + } + + let swift: TeamLog.ChangedEnterpriseConnectedTeamStatusType + + public init(swift: TeamLog.ChangedEnterpriseConnectedTeamStatusType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed classification policy for team. +@objc +public class DBXTeamLogClassificationChangePolicyDetails: NSObject { + /// Previous classification policy. + @objc + public var previousValue: DBXTeamLogClassificationPolicyEnumWrapper { DBXTeamLogClassificationPolicyEnumWrapper(swift: swift.previousValue) } + /// New classification policy. + @objc + public var newValue: DBXTeamLogClassificationPolicyEnumWrapper { DBXTeamLogClassificationPolicyEnumWrapper(swift: swift.newValue) } + /// Policy type. + @objc + public var classificationType: DBXTeamLogClassificationType { DBXTeamLogClassificationType(swift: swift.classificationType) } + + @objc + public init( + previousValue: DBXTeamLogClassificationPolicyEnumWrapper, + newValue: DBXTeamLogClassificationPolicyEnumWrapper, + classificationType: DBXTeamLogClassificationType + ) { + self.swift = TeamLog.ClassificationChangePolicyDetails( + previousValue: previousValue.swift, + newValue: newValue.swift, + classificationType: classificationType.swift + ) + } + + let swift: TeamLog.ClassificationChangePolicyDetails + + public init(swift: TeamLog.ClassificationChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ClassificationChangePolicyType struct +@objc +public class DBXTeamLogClassificationChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ClassificationChangePolicyType(description_: description_) + } + + let swift: TeamLog.ClassificationChangePolicyType + + public init(swift: TeamLog.ClassificationChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created Classification report. +@objc +public class DBXTeamLogClassificationCreateReportDetails: NSObject { + let swift: TeamLog.ClassificationCreateReportDetails + + public init(swift: TeamLog.ClassificationCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't create Classification report. +@objc +public class DBXTeamLogClassificationCreateReportFailDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.ClassificationCreateReportFailDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.ClassificationCreateReportFailDetails + + public init(swift: TeamLog.ClassificationCreateReportFailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ClassificationCreateReportFailType struct +@objc +public class DBXTeamLogClassificationCreateReportFailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ClassificationCreateReportFailType(description_: description_) + } + + let swift: TeamLog.ClassificationCreateReportFailType + + public init(swift: TeamLog.ClassificationCreateReportFailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ClassificationCreateReportType struct +@objc +public class DBXTeamLogClassificationCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ClassificationCreateReportType(description_: description_) + } + + let swift: TeamLog.ClassificationCreateReportType + + public init(swift: TeamLog.ClassificationCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling team access to the classification feature +@objc +public class DBXTeamLogClassificationPolicyEnumWrapper: NSObject { + let swift: TeamLog.ClassificationPolicyEnumWrapper + + public init(swift: TeamLog.ClassificationPolicyEnumWrapper) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ClassificationPolicyEnumWrapper) -> DBXTeamLogClassificationPolicyEnumWrapper { + switch swift { + case .disabled: + return DBXTeamLogClassificationPolicyEnumWrapperDisabled() + case .enabled: + return DBXTeamLogClassificationPolicyEnumWrapperEnabled() + case .memberAndTeamFolders: + return DBXTeamLogClassificationPolicyEnumWrapperMemberAndTeamFolders() + case .teamFolders: + return DBXTeamLogClassificationPolicyEnumWrapperTeamFolders() + case .other: + return DBXTeamLogClassificationPolicyEnumWrapperOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogClassificationPolicyEnumWrapperDisabled? { + self as? DBXTeamLogClassificationPolicyEnumWrapperDisabled + } + + @objc + public var asEnabled: DBXTeamLogClassificationPolicyEnumWrapperEnabled? { + self as? DBXTeamLogClassificationPolicyEnumWrapperEnabled + } + + @objc + public var asMemberAndTeamFolders: DBXTeamLogClassificationPolicyEnumWrapperMemberAndTeamFolders? { + self as? DBXTeamLogClassificationPolicyEnumWrapperMemberAndTeamFolders + } + + @objc + public var asTeamFolders: DBXTeamLogClassificationPolicyEnumWrapperTeamFolders? { + self as? DBXTeamLogClassificationPolicyEnumWrapperTeamFolders + } + + @objc + public var asOther: DBXTeamLogClassificationPolicyEnumWrapperOther? { + self as? DBXTeamLogClassificationPolicyEnumWrapperOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationPolicyEnumWrapperDisabled: DBXTeamLogClassificationPolicyEnumWrapper { + @objc + public init() { + let swift = TeamLog.ClassificationPolicyEnumWrapper.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationPolicyEnumWrapperEnabled: DBXTeamLogClassificationPolicyEnumWrapper { + @objc + public init() { + let swift = TeamLog.ClassificationPolicyEnumWrapper.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationPolicyEnumWrapperMemberAndTeamFolders: DBXTeamLogClassificationPolicyEnumWrapper { + @objc + public init() { + let swift = TeamLog.ClassificationPolicyEnumWrapper.memberAndTeamFolders + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationPolicyEnumWrapperTeamFolders: DBXTeamLogClassificationPolicyEnumWrapper { + @objc + public init() { + let swift = TeamLog.ClassificationPolicyEnumWrapper.teamFolders + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationPolicyEnumWrapperOther: DBXTeamLogClassificationPolicyEnumWrapper { + @objc + public init() { + let swift = TeamLog.ClassificationPolicyEnumWrapper.other + super.init(swift: swift) + } +} + +/// The type of classification (currently only personal information) +@objc +public class DBXTeamLogClassificationType: NSObject { + let swift: TeamLog.ClassificationType + + public init(swift: TeamLog.ClassificationType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ClassificationType) -> DBXTeamLogClassificationType { + switch swift { + case .personalInformation: + return DBXTeamLogClassificationTypePersonalInformation() + case .pii: + return DBXTeamLogClassificationTypePii() + case .other: + return DBXTeamLogClassificationTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPersonalInformation: DBXTeamLogClassificationTypePersonalInformation? { + self as? DBXTeamLogClassificationTypePersonalInformation + } + + @objc + public var asPii: DBXTeamLogClassificationTypePii? { + self as? DBXTeamLogClassificationTypePii + } + + @objc + public var asOther: DBXTeamLogClassificationTypeOther? { + self as? DBXTeamLogClassificationTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationTypePersonalInformation: DBXTeamLogClassificationType { + @objc + public init() { + let swift = TeamLog.ClassificationType.personalInformation + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationTypePii: DBXTeamLogClassificationType { + @objc + public init() { + let swift = TeamLog.ClassificationType.pii + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogClassificationTypeOther: DBXTeamLogClassificationType { + @objc + public init() { + let swift = TeamLog.ClassificationType.other + super.init(swift: swift) + } +} + +/// Shared album. +@objc +public class DBXTeamLogCollectionShareDetails: NSObject { + /// Album name. + @objc + public var albumName: String { swift.albumName } + + @objc + public init(albumName: String) { + self.swift = TeamLog.CollectionShareDetails(albumName: albumName) + } + + let swift: TeamLog.CollectionShareDetails + + public init(swift: TeamLog.CollectionShareDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CollectionShareType struct +@objc +public class DBXTeamLogCollectionShareType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.CollectionShareType(description_: description_) + } + + let swift: TeamLog.CollectionShareType + + public init(swift: TeamLog.CollectionShareType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling team access to computer backup feature +@objc +public class DBXTeamLogComputerBackupPolicy: NSObject { + let swift: TeamLog.ComputerBackupPolicy + + public init(swift: TeamLog.ComputerBackupPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ComputerBackupPolicy) -> DBXTeamLogComputerBackupPolicy { + switch swift { + case .default_: + return DBXTeamLogComputerBackupPolicyDefault_() + case .disabled: + return DBXTeamLogComputerBackupPolicyDisabled() + case .enabled: + return DBXTeamLogComputerBackupPolicyEnabled() + case .other: + return DBXTeamLogComputerBackupPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXTeamLogComputerBackupPolicyDefault_? { + self as? DBXTeamLogComputerBackupPolicyDefault_ + } + + @objc + public var asDisabled: DBXTeamLogComputerBackupPolicyDisabled? { + self as? DBXTeamLogComputerBackupPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogComputerBackupPolicyEnabled? { + self as? DBXTeamLogComputerBackupPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogComputerBackupPolicyOther? { + self as? DBXTeamLogComputerBackupPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogComputerBackupPolicyDefault_: DBXTeamLogComputerBackupPolicy { + @objc + public init() { + let swift = TeamLog.ComputerBackupPolicy.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogComputerBackupPolicyDisabled: DBXTeamLogComputerBackupPolicy { + @objc + public init() { + let swift = TeamLog.ComputerBackupPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogComputerBackupPolicyEnabled: DBXTeamLogComputerBackupPolicy { + @objc + public init() { + let swift = TeamLog.ComputerBackupPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogComputerBackupPolicyOther: DBXTeamLogComputerBackupPolicy { + @objc + public init() { + let swift = TeamLog.ComputerBackupPolicy.other + super.init(swift: swift) + } +} + +/// Changed computer backup policy for team. +@objc +public class DBXTeamLogComputerBackupPolicyChangedDetails: NSObject { + /// New computer backup policy. + @objc + public var newValue: DBXTeamLogComputerBackupPolicy { DBXTeamLogComputerBackupPolicy(swift: swift.newValue) } + /// Previous computer backup policy. + @objc + public var previousValue: DBXTeamLogComputerBackupPolicy { DBXTeamLogComputerBackupPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogComputerBackupPolicy, previousValue: DBXTeamLogComputerBackupPolicy) { + self.swift = TeamLog.ComputerBackupPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.ComputerBackupPolicyChangedDetails + + public init(swift: TeamLog.ComputerBackupPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ComputerBackupPolicyChangedType struct +@objc +public class DBXTeamLogComputerBackupPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ComputerBackupPolicyChangedType(description_: description_) + } + + let swift: TeamLog.ComputerBackupPolicyChangedType + + public init(swift: TeamLog.ComputerBackupPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The name of the team +@objc +public class DBXTeamLogConnectedTeamName: NSObject { + /// The name of the team. + @objc + public var team: String { swift.team } + + @objc + public init(team: String) { + self.swift = TeamLog.ConnectedTeamName(team: team) + } + + let swift: TeamLog.ConnectedTeamName + + public init(swift: TeamLog.ConnectedTeamName) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed content management setting. +@objc +public class DBXTeamLogContentAdministrationPolicyChangedDetails: NSObject { + /// New content administration policy. + @objc + public var newValue: String { swift.newValue } + /// Previous content administration policy. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(newValue: String, previousValue: String) { + self.swift = TeamLog.ContentAdministrationPolicyChangedDetails(newValue: newValue, previousValue: previousValue) + } + + let swift: TeamLog.ContentAdministrationPolicyChangedDetails + + public init(swift: TeamLog.ContentAdministrationPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ContentAdministrationPolicyChangedType struct +@objc +public class DBXTeamLogContentAdministrationPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ContentAdministrationPolicyChangedType(description_: description_) + } + + let swift: TeamLog.ContentAdministrationPolicyChangedType + + public init(swift: TeamLog.ContentAdministrationPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for pemanent content deletion +@objc +public class DBXTeamLogContentPermanentDeletePolicy: NSObject { + let swift: TeamLog.ContentPermanentDeletePolicy + + public init(swift: TeamLog.ContentPermanentDeletePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ContentPermanentDeletePolicy) -> DBXTeamLogContentPermanentDeletePolicy { + switch swift { + case .disabled: + return DBXTeamLogContentPermanentDeletePolicyDisabled() + case .enabled: + return DBXTeamLogContentPermanentDeletePolicyEnabled() + case .other: + return DBXTeamLogContentPermanentDeletePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogContentPermanentDeletePolicyDisabled? { + self as? DBXTeamLogContentPermanentDeletePolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogContentPermanentDeletePolicyEnabled? { + self as? DBXTeamLogContentPermanentDeletePolicyEnabled + } + + @objc + public var asOther: DBXTeamLogContentPermanentDeletePolicyOther? { + self as? DBXTeamLogContentPermanentDeletePolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogContentPermanentDeletePolicyDisabled: DBXTeamLogContentPermanentDeletePolicy { + @objc + public init() { + let swift = TeamLog.ContentPermanentDeletePolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogContentPermanentDeletePolicyEnabled: DBXTeamLogContentPermanentDeletePolicy { + @objc + public init() { + let swift = TeamLog.ContentPermanentDeletePolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogContentPermanentDeletePolicyOther: DBXTeamLogContentPermanentDeletePolicy { + @objc + public init() { + let swift = TeamLog.ContentPermanentDeletePolicy.other + super.init(swift: swift) + } +} + +/// The primary entity on which the action was done. +@objc +public class DBXTeamLogContextLogInfo: NSObject { + let swift: TeamLog.ContextLogInfo + + public init(swift: TeamLog.ContextLogInfo) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ContextLogInfo) -> DBXTeamLogContextLogInfo { + switch swift { + case .anonymous: + return DBXTeamLogContextLogInfoAnonymous() + case .nonTeamMember(let swiftArg): + let arg = DBXTeamLogNonTeamMemberLogInfo(swift: swiftArg) + return DBXTeamLogContextLogInfoNonTeamMember(arg) + case .organizationTeam(let swiftArg): + let arg = DBXTeamLogTeamLogInfo(swift: swiftArg) + return DBXTeamLogContextLogInfoOrganizationTeam(arg) + case .team: + return DBXTeamLogContextLogInfoTeam() + case .teamMember(let swiftArg): + let arg = DBXTeamLogTeamMemberLogInfo(swift: swiftArg) + return DBXTeamLogContextLogInfoTeamMember(arg) + case .trustedNonTeamMember(let swiftArg): + let arg = DBXTeamLogTrustedNonTeamMemberLogInfo(swift: swiftArg) + return DBXTeamLogContextLogInfoTrustedNonTeamMember(arg) + case .other: + return DBXTeamLogContextLogInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAnonymous: DBXTeamLogContextLogInfoAnonymous? { + self as? DBXTeamLogContextLogInfoAnonymous + } + + @objc + public var asNonTeamMember: DBXTeamLogContextLogInfoNonTeamMember? { + self as? DBXTeamLogContextLogInfoNonTeamMember + } + + @objc + public var asOrganizationTeam: DBXTeamLogContextLogInfoOrganizationTeam? { + self as? DBXTeamLogContextLogInfoOrganizationTeam + } + + @objc + public var asTeam: DBXTeamLogContextLogInfoTeam? { + self as? DBXTeamLogContextLogInfoTeam + } + + @objc + public var asTeamMember: DBXTeamLogContextLogInfoTeamMember? { + self as? DBXTeamLogContextLogInfoTeamMember + } + + @objc + public var asTrustedNonTeamMember: DBXTeamLogContextLogInfoTrustedNonTeamMember? { + self as? DBXTeamLogContextLogInfoTrustedNonTeamMember + } + + @objc + public var asOther: DBXTeamLogContextLogInfoOther? { + self as? DBXTeamLogContextLogInfoOther + } +} + +/// Anonymous context. +@objc +public class DBXTeamLogContextLogInfoAnonymous: DBXTeamLogContextLogInfo { + @objc + public init() { + let swift = TeamLog.ContextLogInfo.anonymous + super.init(swift: swift) + } +} + +/// Action was done on behalf of a non team member. +@objc +public class DBXTeamLogContextLogInfoNonTeamMember: DBXTeamLogContextLogInfo { + @objc + public var nonTeamMember: DBXTeamLogNonTeamMemberLogInfo + + @objc + public init(_ arg: DBXTeamLogNonTeamMemberLogInfo) { + self.nonTeamMember = arg + let swift = TeamLog.ContextLogInfo.nonTeamMember(arg.subSwift) + super.init(swift: swift) + } +} + +/// Action was done on behalf of a team that's part of an organization. +@objc +public class DBXTeamLogContextLogInfoOrganizationTeam: DBXTeamLogContextLogInfo { + @objc + public var organizationTeam: DBXTeamLogTeamLogInfo + + @objc + public init(_ arg: DBXTeamLogTeamLogInfo) { + self.organizationTeam = arg + let swift = TeamLog.ContextLogInfo.organizationTeam(arg.swift) + super.init(swift: swift) + } +} + +/// Action was done on behalf of the team. +@objc +public class DBXTeamLogContextLogInfoTeam: DBXTeamLogContextLogInfo { + @objc + public init() { + let swift = TeamLog.ContextLogInfo.team + super.init(swift: swift) + } +} + +/// Action was done on behalf of a team member. +@objc +public class DBXTeamLogContextLogInfoTeamMember: DBXTeamLogContextLogInfo { + @objc + public var teamMember: DBXTeamLogTeamMemberLogInfo + + @objc + public init(_ arg: DBXTeamLogTeamMemberLogInfo) { + self.teamMember = arg + let swift = TeamLog.ContextLogInfo.teamMember(arg.subSwift) + super.init(swift: swift) + } +} + +/// Action was done on behalf of a trusted non team member. +@objc +public class DBXTeamLogContextLogInfoTrustedNonTeamMember: DBXTeamLogContextLogInfo { + @objc + public var trustedNonTeamMember: DBXTeamLogTrustedNonTeamMemberLogInfo + + @objc + public init(_ arg: DBXTeamLogTrustedNonTeamMemberLogInfo) { + self.trustedNonTeamMember = arg + let swift = TeamLog.ContextLogInfo.trustedNonTeamMember(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogContextLogInfoOther: DBXTeamLogContextLogInfo { + @objc + public init() { + let swift = TeamLog.ContextLogInfo.other + super.init(swift: swift) + } +} + +/// Created folders. +@objc +public class DBXTeamLogCreateFolderDetails: NSObject { + let swift: TeamLog.CreateFolderDetails + + public init(swift: TeamLog.CreateFolderDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateFolderType struct +@objc +public class DBXTeamLogCreateFolderType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.CreateFolderType(description_: description_) + } + + let swift: TeamLog.CreateFolderType + + public init(swift: TeamLog.CreateFolderType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created team invite link. +@objc +public class DBXTeamLogCreateTeamInviteLinkDetails: NSObject { + /// The invite link url that was created. + @objc + public var linkUrl: String { swift.linkUrl } + /// The expiration date of the invite link. + @objc + public var expiryDate: String { swift.expiryDate } + + @objc + public init(linkUrl: String, expiryDate: String) { + self.swift = TeamLog.CreateTeamInviteLinkDetails(linkUrl: linkUrl, expiryDate: expiryDate) + } + + let swift: TeamLog.CreateTeamInviteLinkDetails + + public init(swift: TeamLog.CreateTeamInviteLinkDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible CreateTeamInviteLinkType struct +@objc +public class DBXTeamLogCreateTeamInviteLinkType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.CreateTeamInviteLinkType(description_: description_) + } + + let swift: TeamLog.CreateTeamInviteLinkType + + public init(swift: TeamLog.CreateTeamInviteLinkType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Set restrictions on data center locations where team data resides. +@objc +public class DBXTeamLogDataPlacementRestrictionChangePolicyDetails: NSObject { + /// Previous placement restriction. + @objc + public var previousValue: DBXTeamLogPlacementRestriction { DBXTeamLogPlacementRestriction(swift: swift.previousValue) } + /// New placement restriction. + @objc + public var newValue: DBXTeamLogPlacementRestriction { DBXTeamLogPlacementRestriction(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogPlacementRestriction, newValue: DBXTeamLogPlacementRestriction) { + self.swift = TeamLog.DataPlacementRestrictionChangePolicyDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.DataPlacementRestrictionChangePolicyDetails + + public init(swift: TeamLog.DataPlacementRestrictionChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DataPlacementRestrictionChangePolicyType struct +@objc +public class DBXTeamLogDataPlacementRestrictionChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DataPlacementRestrictionChangePolicyType(description_: description_) + } + + let swift: TeamLog.DataPlacementRestrictionChangePolicyType + + public init(swift: TeamLog.DataPlacementRestrictionChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Completed restrictions on data center locations where team data resides. +@objc +public class DBXTeamLogDataPlacementRestrictionSatisfyPolicyDetails: NSObject { + /// Placement restriction. + @objc + public var placementRestriction: DBXTeamLogPlacementRestriction { DBXTeamLogPlacementRestriction(swift: swift.placementRestriction) } + + @objc + public init(placementRestriction: DBXTeamLogPlacementRestriction) { + self.swift = TeamLog.DataPlacementRestrictionSatisfyPolicyDetails(placementRestriction: placementRestriction.swift) + } + + let swift: TeamLog.DataPlacementRestrictionSatisfyPolicyDetails + + public init(swift: TeamLog.DataPlacementRestrictionSatisfyPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DataPlacementRestrictionSatisfyPolicyType struct +@objc +public class DBXTeamLogDataPlacementRestrictionSatisfyPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DataPlacementRestrictionSatisfyPolicyType(description_: description_) + } + + let swift: TeamLog.DataPlacementRestrictionSatisfyPolicyType + + public init(swift: TeamLog.DataPlacementRestrictionSatisfyPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Requested data residency migration for team data. +@objc +public class DBXTeamLogDataResidencyMigrationRequestSuccessfulDetails: NSObject { + let swift: TeamLog.DataResidencyMigrationRequestSuccessfulDetails + + public init(swift: TeamLog.DataResidencyMigrationRequestSuccessfulDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DataResidencyMigrationRequestSuccessfulType struct +@objc +public class DBXTeamLogDataResidencyMigrationRequestSuccessfulType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DataResidencyMigrationRequestSuccessfulType(description_: description_) + } + + let swift: TeamLog.DataResidencyMigrationRequestSuccessfulType + + public init(swift: TeamLog.DataResidencyMigrationRequestSuccessfulType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Request for data residency migration for team data has failed. +@objc +public class DBXTeamLogDataResidencyMigrationRequestUnsuccessfulDetails: NSObject { + let swift: TeamLog.DataResidencyMigrationRequestUnsuccessfulDetails + + public init(swift: TeamLog.DataResidencyMigrationRequestUnsuccessfulDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DataResidencyMigrationRequestUnsuccessfulType struct +@objc +public class DBXTeamLogDataResidencyMigrationRequestUnsuccessfulType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DataResidencyMigrationRequestUnsuccessfulType(description_: description_) + } + + let swift: TeamLog.DataResidencyMigrationRequestUnsuccessfulType + + public init(swift: TeamLog.DataResidencyMigrationRequestUnsuccessfulType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for the default number of days until an externally shared link expires +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicy: NSObject { + let swift: TeamLog.DefaultLinkExpirationDaysPolicy + + public init(swift: TeamLog.DefaultLinkExpirationDaysPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.DefaultLinkExpirationDaysPolicy) -> DBXTeamLogDefaultLinkExpirationDaysPolicy { + switch swift { + case .day1: + return DBXTeamLogDefaultLinkExpirationDaysPolicyDay1() + case .day180: + return DBXTeamLogDefaultLinkExpirationDaysPolicyDay180() + case .day3: + return DBXTeamLogDefaultLinkExpirationDaysPolicyDay3() + case .day30: + return DBXTeamLogDefaultLinkExpirationDaysPolicyDay30() + case .day7: + return DBXTeamLogDefaultLinkExpirationDaysPolicyDay7() + case .day90: + return DBXTeamLogDefaultLinkExpirationDaysPolicyDay90() + case .none: + return DBXTeamLogDefaultLinkExpirationDaysPolicyNone() + case .year1: + return DBXTeamLogDefaultLinkExpirationDaysPolicyYear1() + case .other: + return DBXTeamLogDefaultLinkExpirationDaysPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDay1: DBXTeamLogDefaultLinkExpirationDaysPolicyDay1? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyDay1 + } + + @objc + public var asDay180: DBXTeamLogDefaultLinkExpirationDaysPolicyDay180? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyDay180 + } + + @objc + public var asDay3: DBXTeamLogDefaultLinkExpirationDaysPolicyDay3? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyDay3 + } + + @objc + public var asDay30: DBXTeamLogDefaultLinkExpirationDaysPolicyDay30? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyDay30 + } + + @objc + public var asDay7: DBXTeamLogDefaultLinkExpirationDaysPolicyDay7? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyDay7 + } + + @objc + public var asDay90: DBXTeamLogDefaultLinkExpirationDaysPolicyDay90? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyDay90 + } + + @objc + public var asNone: DBXTeamLogDefaultLinkExpirationDaysPolicyNone? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyNone + } + + @objc + public var asYear1: DBXTeamLogDefaultLinkExpirationDaysPolicyYear1? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyYear1 + } + + @objc + public var asOther: DBXTeamLogDefaultLinkExpirationDaysPolicyOther? { + self as? DBXTeamLogDefaultLinkExpirationDaysPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyDay1: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.day1 + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyDay180: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.day180 + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyDay3: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.day3 + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyDay30: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.day30 + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyDay7: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.day7 + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyDay90: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.day90 + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyNone: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.none + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyYear1: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.year1 + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDefaultLinkExpirationDaysPolicyOther: DBXTeamLogDefaultLinkExpirationDaysPolicy { + @objc + public init() { + let swift = TeamLog.DefaultLinkExpirationDaysPolicy.other + super.init(swift: swift) + } +} + +/// Deleted team invite link. +@objc +public class DBXTeamLogDeleteTeamInviteLinkDetails: NSObject { + /// The invite link url that was deleted. + @objc + public var linkUrl: String { swift.linkUrl } + + @objc + public init(linkUrl: String) { + self.swift = TeamLog.DeleteTeamInviteLinkDetails(linkUrl: linkUrl) + } + + let swift: TeamLog.DeleteTeamInviteLinkDetails + + public init(swift: TeamLog.DeleteTeamInviteLinkDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeleteTeamInviteLinkType struct +@objc +public class DBXTeamLogDeleteTeamInviteLinkType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeleteTeamInviteLinkType(description_: description_) + } + + let swift: TeamLog.DeleteTeamInviteLinkType + + public init(swift: TeamLog.DeleteTeamInviteLinkType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Device's session logged information. +@objc +public class DBXTeamLogDeviceSessionLogInfo: NSObject { + /// The IP address of the last activity from this session. + @objc + public var ipAddress: String? { swift.ipAddress } + /// The time this session was created. + @objc + public var created: Date? { swift.created } + /// The time of the last activity from this session. + @objc + public var updated: Date? { swift.updated } + + @objc + public init(ipAddress: String?, created: Date?, updated: Date?) { + self.swift = TeamLog.DeviceSessionLogInfo(ipAddress: ipAddress, created: created, updated: updated) + } + + let swift: TeamLog.DeviceSessionLogInfo + + public init(swift: TeamLog.DeviceSessionLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about linked Dropbox desktop client sessions +@objc +public class DBXTeamLogDesktopDeviceSessionLogInfo: DBXTeamLogDeviceSessionLogInfo { + /// Desktop session unique id. + @objc + public var sessionInfo: DBXTeamLogDesktopSessionLogInfo? { guard let swift = subSwift.sessionInfo else { return nil } + return DBXTeamLogDesktopSessionLogInfo(swift: swift) + } + + /// Name of the hosting desktop. + @objc + public var hostName: String { subSwift.hostName } + /// The Dropbox desktop client type. + @objc + public var clientType: DBXTeamDesktopPlatform { DBXTeamDesktopPlatform(swift: subSwift.clientType) } + /// The Dropbox client version. + @objc + public var clientVersion: String? { subSwift.clientVersion } + /// Information on the hosting platform. + @objc + public var platform: String { subSwift.platform } + /// Whether itu2019s possible to delete all of the account files upon unlinking. + @objc + public var isDeleteOnUnlinkSupported: NSNumber { subSwift.isDeleteOnUnlinkSupported as NSNumber } + + @objc + public init( + hostName: String, + clientType: DBXTeamDesktopPlatform, + platform: String, + isDeleteOnUnlinkSupported: NSNumber, + ipAddress: String?, + created: Date?, + updated: Date?, + sessionInfo: DBXTeamLogDesktopSessionLogInfo?, + clientVersion: String? + ) { + let swift = TeamLog.DesktopDeviceSessionLogInfo( + hostName: hostName, + clientType: clientType.swift, + platform: platform, + isDeleteOnUnlinkSupported: isDeleteOnUnlinkSupported.boolValue, + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo?.subSwift, + clientVersion: clientVersion + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: TeamLog.DesktopDeviceSessionLogInfo + + public init(swift: TeamLog.DesktopDeviceSessionLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Session's logged information. +@objc +public class DBXTeamLogSessionLogInfo: NSObject { + /// Session ID. + @objc + public var sessionId: String? { swift.sessionId } + + @objc + public init(sessionId: String?) { + self.swift = TeamLog.SessionLogInfo(sessionId: sessionId) + } + + let swift: TeamLog.SessionLogInfo + + public init(swift: TeamLog.SessionLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Desktop session. +@objc +public class DBXTeamLogDesktopSessionLogInfo: DBXTeamLogSessionLogInfo { + let subSwift: TeamLog.DesktopSessionLogInfo + + public init(swift: TeamLog.DesktopSessionLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Added members to device approvals exception list. +@objc +public class DBXTeamLogDeviceApprovalsAddExceptionDetails: NSObject { + let swift: TeamLog.DeviceApprovalsAddExceptionDetails + + public init(swift: TeamLog.DeviceApprovalsAddExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceApprovalsAddExceptionType struct +@objc +public class DBXTeamLogDeviceApprovalsAddExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceApprovalsAddExceptionType(description_: description_) + } + + let swift: TeamLog.DeviceApprovalsAddExceptionType + + public init(swift: TeamLog.DeviceApprovalsAddExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Set/removed limit on number of computers member can link to team Dropbox account. +@objc +public class DBXTeamLogDeviceApprovalsChangeDesktopPolicyDetails: NSObject { + /// New desktop device approvals policy. Might be missing due to historical data gap. + @objc + public var newValue: DBXTeamLogDeviceApprovalsPolicy? { guard let swift = swift.newValue else { return nil } + return DBXTeamLogDeviceApprovalsPolicy(swift: swift) + } + + /// Previous desktop device approvals policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogDeviceApprovalsPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogDeviceApprovalsPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogDeviceApprovalsPolicy?, previousValue: DBXTeamLogDeviceApprovalsPolicy?) { + self.swift = TeamLog.DeviceApprovalsChangeDesktopPolicyDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.DeviceApprovalsChangeDesktopPolicyDetails + + public init(swift: TeamLog.DeviceApprovalsChangeDesktopPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceApprovalsChangeDesktopPolicyType struct +@objc +public class DBXTeamLogDeviceApprovalsChangeDesktopPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceApprovalsChangeDesktopPolicyType(description_: description_) + } + + let swift: TeamLog.DeviceApprovalsChangeDesktopPolicyType + + public init(swift: TeamLog.DeviceApprovalsChangeDesktopPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Set/removed limit on number of mobile devices member can link to team Dropbox account. +@objc +public class DBXTeamLogDeviceApprovalsChangeMobilePolicyDetails: NSObject { + /// New mobile device approvals policy. Might be missing due to historical data gap. + @objc + public var newValue: DBXTeamLogDeviceApprovalsPolicy? { guard let swift = swift.newValue else { return nil } + return DBXTeamLogDeviceApprovalsPolicy(swift: swift) + } + + /// Previous mobile device approvals policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogDeviceApprovalsPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogDeviceApprovalsPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogDeviceApprovalsPolicy?, previousValue: DBXTeamLogDeviceApprovalsPolicy?) { + self.swift = TeamLog.DeviceApprovalsChangeMobilePolicyDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.DeviceApprovalsChangeMobilePolicyDetails + + public init(swift: TeamLog.DeviceApprovalsChangeMobilePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceApprovalsChangeMobilePolicyType struct +@objc +public class DBXTeamLogDeviceApprovalsChangeMobilePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceApprovalsChangeMobilePolicyType(description_: description_) + } + + let swift: TeamLog.DeviceApprovalsChangeMobilePolicyType + + public init(swift: TeamLog.DeviceApprovalsChangeMobilePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed device approvals setting when member is over limit. +@objc +public class DBXTeamLogDeviceApprovalsChangeOverageActionDetails: NSObject { + /// New over the limits policy. Might be missing due to historical data gap. + @objc + public var newValue: DBXTeamPoliciesRolloutMethod? { guard let swift = swift.newValue else { return nil } + return DBXTeamPoliciesRolloutMethod(swift: swift) + } + + /// Previous over the limit policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamPoliciesRolloutMethod? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesRolloutMethod(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesRolloutMethod?, previousValue: DBXTeamPoliciesRolloutMethod?) { + self.swift = TeamLog.DeviceApprovalsChangeOverageActionDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.DeviceApprovalsChangeOverageActionDetails + + public init(swift: TeamLog.DeviceApprovalsChangeOverageActionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceApprovalsChangeOverageActionType struct +@objc +public class DBXTeamLogDeviceApprovalsChangeOverageActionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceApprovalsChangeOverageActionType(description_: description_) + } + + let swift: TeamLog.DeviceApprovalsChangeOverageActionType + + public init(swift: TeamLog.DeviceApprovalsChangeOverageActionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed device approvals setting when member unlinks approved device. +@objc +public class DBXTeamLogDeviceApprovalsChangeUnlinkActionDetails: NSObject { + /// New device unlink policy. Might be missing due to historical data gap. + @objc + public var newValue: DBXTeamLogDeviceUnlinkPolicy? { guard let swift = swift.newValue else { return nil } + return DBXTeamLogDeviceUnlinkPolicy(swift: swift) + } + + /// Previous device unlink policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogDeviceUnlinkPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogDeviceUnlinkPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogDeviceUnlinkPolicy?, previousValue: DBXTeamLogDeviceUnlinkPolicy?) { + self.swift = TeamLog.DeviceApprovalsChangeUnlinkActionDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.DeviceApprovalsChangeUnlinkActionDetails + + public init(swift: TeamLog.DeviceApprovalsChangeUnlinkActionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceApprovalsChangeUnlinkActionType struct +@objc +public class DBXTeamLogDeviceApprovalsChangeUnlinkActionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceApprovalsChangeUnlinkActionType(description_: description_) + } + + let swift: TeamLog.DeviceApprovalsChangeUnlinkActionType + + public init(swift: TeamLog.DeviceApprovalsChangeUnlinkActionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceApprovalsPolicy union +@objc +public class DBXTeamLogDeviceApprovalsPolicy: NSObject { + let swift: TeamLog.DeviceApprovalsPolicy + + public init(swift: TeamLog.DeviceApprovalsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.DeviceApprovalsPolicy) -> DBXTeamLogDeviceApprovalsPolicy { + switch swift { + case .limited: + return DBXTeamLogDeviceApprovalsPolicyLimited() + case .unlimited: + return DBXTeamLogDeviceApprovalsPolicyUnlimited() + case .other: + return DBXTeamLogDeviceApprovalsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asLimited: DBXTeamLogDeviceApprovalsPolicyLimited? { + self as? DBXTeamLogDeviceApprovalsPolicyLimited + } + + @objc + public var asUnlimited: DBXTeamLogDeviceApprovalsPolicyUnlimited? { + self as? DBXTeamLogDeviceApprovalsPolicyUnlimited + } + + @objc + public var asOther: DBXTeamLogDeviceApprovalsPolicyOther? { + self as? DBXTeamLogDeviceApprovalsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceApprovalsPolicyLimited: DBXTeamLogDeviceApprovalsPolicy { + @objc + public init() { + let swift = TeamLog.DeviceApprovalsPolicy.limited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceApprovalsPolicyUnlimited: DBXTeamLogDeviceApprovalsPolicy { + @objc + public init() { + let swift = TeamLog.DeviceApprovalsPolicy.unlimited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceApprovalsPolicyOther: DBXTeamLogDeviceApprovalsPolicy { + @objc + public init() { + let swift = TeamLog.DeviceApprovalsPolicy.other + super.init(swift: swift) + } +} + +/// Removed members from device approvals exception list. +@objc +public class DBXTeamLogDeviceApprovalsRemoveExceptionDetails: NSObject { + let swift: TeamLog.DeviceApprovalsRemoveExceptionDetails + + public init(swift: TeamLog.DeviceApprovalsRemoveExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceApprovalsRemoveExceptionType struct +@objc +public class DBXTeamLogDeviceApprovalsRemoveExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceApprovalsRemoveExceptionType(description_: description_) + } + + let swift: TeamLog.DeviceApprovalsRemoveExceptionType + + public init(swift: TeamLog.DeviceApprovalsRemoveExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed IP address associated with active desktop session. +@objc +public class DBXTeamLogDeviceChangeIpDesktopDetails: NSObject { + /// Device's session logged information. + @objc + public var deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo { DBXTeamLogDeviceSessionLogInfo(swift: swift.deviceSessionInfo) } + + @objc + public init(deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo) { + self.swift = TeamLog.DeviceChangeIpDesktopDetails(deviceSessionInfo: deviceSessionInfo.swift) + } + + let swift: TeamLog.DeviceChangeIpDesktopDetails + + public init(swift: TeamLog.DeviceChangeIpDesktopDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceChangeIpDesktopType struct +@objc +public class DBXTeamLogDeviceChangeIpDesktopType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceChangeIpDesktopType(description_: description_) + } + + let swift: TeamLog.DeviceChangeIpDesktopType + + public init(swift: TeamLog.DeviceChangeIpDesktopType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed IP address associated with active mobile session. +@objc +public class DBXTeamLogDeviceChangeIpMobileDetails: NSObject { + /// Device's session logged information. + @objc + public var deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo? { guard let swift = swift.deviceSessionInfo else { return nil } + return DBXTeamLogDeviceSessionLogInfo(swift: swift) + } + + @objc + public init(deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo?) { + self.swift = TeamLog.DeviceChangeIpMobileDetails(deviceSessionInfo: deviceSessionInfo?.swift) + } + + let swift: TeamLog.DeviceChangeIpMobileDetails + + public init(swift: TeamLog.DeviceChangeIpMobileDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceChangeIpMobileType struct +@objc +public class DBXTeamLogDeviceChangeIpMobileType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceChangeIpMobileType(description_: description_) + } + + let swift: TeamLog.DeviceChangeIpMobileType + + public init(swift: TeamLog.DeviceChangeIpMobileType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed IP address associated with active web session. +@objc +public class DBXTeamLogDeviceChangeIpWebDetails: NSObject { + /// Web browser name. + @objc + public var userAgent: String { swift.userAgent } + + @objc + public init(userAgent: String) { + self.swift = TeamLog.DeviceChangeIpWebDetails(userAgent: userAgent) + } + + let swift: TeamLog.DeviceChangeIpWebDetails + + public init(swift: TeamLog.DeviceChangeIpWebDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceChangeIpWebType struct +@objc +public class DBXTeamLogDeviceChangeIpWebType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceChangeIpWebType(description_: description_) + } + + let swift: TeamLog.DeviceChangeIpWebType + + public init(swift: TeamLog.DeviceChangeIpWebType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Failed to delete all files from unlinked device. +@objc +public class DBXTeamLogDeviceDeleteOnUnlinkFailDetails: NSObject { + /// Session unique id. + @objc + public var sessionInfo: DBXTeamLogSessionLogInfo? { guard let swift = swift.sessionInfo else { return nil } + return DBXTeamLogSessionLogInfo(swift: swift) + } + + /// The device name. Might be missing due to historical data gap. + @objc + public var displayName: String? { swift.displayName } + /// The number of times that remote file deletion failed. + @objc + public var numFailures: NSNumber { swift.numFailures as NSNumber } + + @objc + public init(numFailures: NSNumber, sessionInfo: DBXTeamLogSessionLogInfo?, displayName: String?) { + self.swift = TeamLog.DeviceDeleteOnUnlinkFailDetails(numFailures: numFailures.int64Value, sessionInfo: sessionInfo?.swift, displayName: displayName) + } + + let swift: TeamLog.DeviceDeleteOnUnlinkFailDetails + + public init(swift: TeamLog.DeviceDeleteOnUnlinkFailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceDeleteOnUnlinkFailType struct +@objc +public class DBXTeamLogDeviceDeleteOnUnlinkFailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceDeleteOnUnlinkFailType(description_: description_) + } + + let swift: TeamLog.DeviceDeleteOnUnlinkFailType + + public init(swift: TeamLog.DeviceDeleteOnUnlinkFailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted all files from unlinked device. +@objc +public class DBXTeamLogDeviceDeleteOnUnlinkSuccessDetails: NSObject { + /// Session unique id. + @objc + public var sessionInfo: DBXTeamLogSessionLogInfo? { guard let swift = swift.sessionInfo else { return nil } + return DBXTeamLogSessionLogInfo(swift: swift) + } + + /// The device name. Might be missing due to historical data gap. + @objc + public var displayName: String? { swift.displayName } + + @objc + public init(sessionInfo: DBXTeamLogSessionLogInfo?, displayName: String?) { + self.swift = TeamLog.DeviceDeleteOnUnlinkSuccessDetails(sessionInfo: sessionInfo?.swift, displayName: displayName) + } + + let swift: TeamLog.DeviceDeleteOnUnlinkSuccessDetails + + public init(swift: TeamLog.DeviceDeleteOnUnlinkSuccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceDeleteOnUnlinkSuccessType struct +@objc +public class DBXTeamLogDeviceDeleteOnUnlinkSuccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceDeleteOnUnlinkSuccessType(description_: description_) + } + + let swift: TeamLog.DeviceDeleteOnUnlinkSuccessType + + public init(swift: TeamLog.DeviceDeleteOnUnlinkSuccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Failed to link device. +@objc +public class DBXTeamLogDeviceLinkFailDetails: NSObject { + /// IP address. Might be missing due to historical data gap. + @objc + public var ipAddress: String? { swift.ipAddress } + /// A description of the device used while user approval blocked. + @objc + public var deviceType: DBXTeamLogDeviceType { DBXTeamLogDeviceType(swift: swift.deviceType) } + + @objc + public init(deviceType: DBXTeamLogDeviceType, ipAddress: String?) { + self.swift = TeamLog.DeviceLinkFailDetails(deviceType: deviceType.swift, ipAddress: ipAddress) + } + + let swift: TeamLog.DeviceLinkFailDetails + + public init(swift: TeamLog.DeviceLinkFailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceLinkFailType struct +@objc +public class DBXTeamLogDeviceLinkFailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceLinkFailType(description_: description_) + } + + let swift: TeamLog.DeviceLinkFailType + + public init(swift: TeamLog.DeviceLinkFailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Linked device. +@objc +public class DBXTeamLogDeviceLinkSuccessDetails: NSObject { + /// Device's session logged information. + @objc + public var deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo? { guard let swift = swift.deviceSessionInfo else { return nil } + return DBXTeamLogDeviceSessionLogInfo(swift: swift) + } + + @objc + public init(deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo?) { + self.swift = TeamLog.DeviceLinkSuccessDetails(deviceSessionInfo: deviceSessionInfo?.swift) + } + + let swift: TeamLog.DeviceLinkSuccessDetails + + public init(swift: TeamLog.DeviceLinkSuccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceLinkSuccessType struct +@objc +public class DBXTeamLogDeviceLinkSuccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceLinkSuccessType(description_: description_) + } + + let swift: TeamLog.DeviceLinkSuccessType + + public init(swift: TeamLog.DeviceLinkSuccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Disabled device management. +@objc +public class DBXTeamLogDeviceManagementDisabledDetails: NSObject { + let swift: TeamLog.DeviceManagementDisabledDetails + + public init(swift: TeamLog.DeviceManagementDisabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceManagementDisabledType struct +@objc +public class DBXTeamLogDeviceManagementDisabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceManagementDisabledType(description_: description_) + } + + let swift: TeamLog.DeviceManagementDisabledType + + public init(swift: TeamLog.DeviceManagementDisabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled device management. +@objc +public class DBXTeamLogDeviceManagementEnabledDetails: NSObject { + let swift: TeamLog.DeviceManagementEnabledDetails + + public init(swift: TeamLog.DeviceManagementEnabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceManagementEnabledType struct +@objc +public class DBXTeamLogDeviceManagementEnabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceManagementEnabledType(description_: description_) + } + + let swift: TeamLog.DeviceManagementEnabledType + + public init(swift: TeamLog.DeviceManagementEnabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled backup for computer. +@objc +public class DBXTeamLogDeviceSyncBackupStatusChangedDetails: NSObject { + /// Device's session logged information. + @objc + public var desktopDeviceSessionInfo: DBXTeamLogDesktopDeviceSessionLogInfo { DBXTeamLogDesktopDeviceSessionLogInfo(swift: swift.desktopDeviceSessionInfo) } + /// Previous status of computer backup on the device. + @objc + public var previousValue: DBXTeamLogBackupStatus { DBXTeamLogBackupStatus(swift: swift.previousValue) } + /// Next status of computer backup on the device. + @objc + public var newValue: DBXTeamLogBackupStatus { DBXTeamLogBackupStatus(swift: swift.newValue) } + + @objc + public init(desktopDeviceSessionInfo: DBXTeamLogDesktopDeviceSessionLogInfo, previousValue: DBXTeamLogBackupStatus, newValue: DBXTeamLogBackupStatus) { + self.swift = TeamLog.DeviceSyncBackupStatusChangedDetails( + desktopDeviceSessionInfo: desktopDeviceSessionInfo.subSwift, + previousValue: previousValue.swift, + newValue: newValue.swift + ) + } + + let swift: TeamLog.DeviceSyncBackupStatusChangedDetails + + public init(swift: TeamLog.DeviceSyncBackupStatusChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceSyncBackupStatusChangedType struct +@objc +public class DBXTeamLogDeviceSyncBackupStatusChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceSyncBackupStatusChangedType(description_: description_) + } + + let swift: TeamLog.DeviceSyncBackupStatusChangedType + + public init(swift: TeamLog.DeviceSyncBackupStatusChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceType union +@objc +public class DBXTeamLogDeviceType: NSObject { + let swift: TeamLog.DeviceType + + public init(swift: TeamLog.DeviceType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.DeviceType) -> DBXTeamLogDeviceType { + switch swift { + case .desktop: + return DBXTeamLogDeviceTypeDesktop() + case .mobile: + return DBXTeamLogDeviceTypeMobile() + case .other: + return DBXTeamLogDeviceTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDesktop: DBXTeamLogDeviceTypeDesktop? { + self as? DBXTeamLogDeviceTypeDesktop + } + + @objc + public var asMobile: DBXTeamLogDeviceTypeMobile? { + self as? DBXTeamLogDeviceTypeMobile + } + + @objc + public var asOther: DBXTeamLogDeviceTypeOther? { + self as? DBXTeamLogDeviceTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceTypeDesktop: DBXTeamLogDeviceType { + @objc + public init() { + let swift = TeamLog.DeviceType.desktop + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceTypeMobile: DBXTeamLogDeviceType { + @objc + public init() { + let swift = TeamLog.DeviceType.mobile + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceTypeOther: DBXTeamLogDeviceType { + @objc + public init() { + let swift = TeamLog.DeviceType.other + super.init(swift: swift) + } +} + +/// Disconnected device. +@objc +public class DBXTeamLogDeviceUnlinkDetails: NSObject { + /// Session unique id. + @objc + public var sessionInfo: DBXTeamLogSessionLogInfo? { guard let swift = swift.sessionInfo else { return nil } + return DBXTeamLogSessionLogInfo(swift: swift) + } + + /// The device name. Might be missing due to historical data gap. + @objc + public var displayName: String? { swift.displayName } + /// True if the user requested to delete data after device unlink, false otherwise. + @objc + public var deleteData: NSNumber { swift.deleteData as NSNumber } + + @objc + public init(deleteData: NSNumber, sessionInfo: DBXTeamLogSessionLogInfo?, displayName: String?) { + self.swift = TeamLog.DeviceUnlinkDetails(deleteData: deleteData.boolValue, sessionInfo: sessionInfo?.swift, displayName: displayName) + } + + let swift: TeamLog.DeviceUnlinkDetails + + public init(swift: TeamLog.DeviceUnlinkDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DeviceUnlinkPolicy union +@objc +public class DBXTeamLogDeviceUnlinkPolicy: NSObject { + let swift: TeamLog.DeviceUnlinkPolicy + + public init(swift: TeamLog.DeviceUnlinkPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.DeviceUnlinkPolicy) -> DBXTeamLogDeviceUnlinkPolicy { + switch swift { + case .keep: + return DBXTeamLogDeviceUnlinkPolicyKeep() + case .remove: + return DBXTeamLogDeviceUnlinkPolicyRemove() + case .other: + return DBXTeamLogDeviceUnlinkPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asKeep: DBXTeamLogDeviceUnlinkPolicyKeep? { + self as? DBXTeamLogDeviceUnlinkPolicyKeep + } + + @objc + public var asRemove: DBXTeamLogDeviceUnlinkPolicyRemove? { + self as? DBXTeamLogDeviceUnlinkPolicyRemove + } + + @objc + public var asOther: DBXTeamLogDeviceUnlinkPolicyOther? { + self as? DBXTeamLogDeviceUnlinkPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceUnlinkPolicyKeep: DBXTeamLogDeviceUnlinkPolicy { + @objc + public init() { + let swift = TeamLog.DeviceUnlinkPolicy.keep + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceUnlinkPolicyRemove: DBXTeamLogDeviceUnlinkPolicy { + @objc + public init() { + let swift = TeamLog.DeviceUnlinkPolicy.remove + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDeviceUnlinkPolicyOther: DBXTeamLogDeviceUnlinkPolicy { + @objc + public init() { + let swift = TeamLog.DeviceUnlinkPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible DeviceUnlinkType struct +@objc +public class DBXTeamLogDeviceUnlinkType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DeviceUnlinkType(description_: description_) + } + + let swift: TeamLog.DeviceUnlinkType + + public init(swift: TeamLog.DeviceUnlinkType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added members to directory restrictions list. +@objc +public class DBXTeamLogDirectoryRestrictionsAddMembersDetails: NSObject { + let swift: TeamLog.DirectoryRestrictionsAddMembersDetails + + public init(swift: TeamLog.DirectoryRestrictionsAddMembersDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DirectoryRestrictionsAddMembersType struct +@objc +public class DBXTeamLogDirectoryRestrictionsAddMembersType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DirectoryRestrictionsAddMembersType(description_: description_) + } + + let swift: TeamLog.DirectoryRestrictionsAddMembersType + + public init(swift: TeamLog.DirectoryRestrictionsAddMembersType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed members from directory restrictions list. +@objc +public class DBXTeamLogDirectoryRestrictionsRemoveMembersDetails: NSObject { + let swift: TeamLog.DirectoryRestrictionsRemoveMembersDetails + + public init(swift: TeamLog.DirectoryRestrictionsRemoveMembersDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DirectoryRestrictionsRemoveMembersType struct +@objc +public class DBXTeamLogDirectoryRestrictionsRemoveMembersType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DirectoryRestrictionsRemoveMembersType(description_: description_) + } + + let swift: TeamLog.DirectoryRestrictionsRemoveMembersType + + public init(swift: TeamLog.DirectoryRestrictionsRemoveMembersType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Disabled domain invites. +@objc +public class DBXTeamLogDisabledDomainInvitesDetails: NSObject { + let swift: TeamLog.DisabledDomainInvitesDetails + + public init(swift: TeamLog.DisabledDomainInvitesDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DisabledDomainInvitesType struct +@objc +public class DBXTeamLogDisabledDomainInvitesType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DisabledDomainInvitesType(description_: description_) + } + + let swift: TeamLog.DisabledDomainInvitesType + + public init(swift: TeamLog.DisabledDomainInvitesType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DispositionActionType union +@objc +public class DBXTeamLogDispositionActionType: NSObject { + let swift: TeamLog.DispositionActionType + + public init(swift: TeamLog.DispositionActionType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.DispositionActionType) -> DBXTeamLogDispositionActionType { + switch swift { + case .automaticDelete: + return DBXTeamLogDispositionActionTypeAutomaticDelete() + case .automaticPermanentlyDelete: + return DBXTeamLogDispositionActionTypeAutomaticPermanentlyDelete() + case .other: + return DBXTeamLogDispositionActionTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAutomaticDelete: DBXTeamLogDispositionActionTypeAutomaticDelete? { + self as? DBXTeamLogDispositionActionTypeAutomaticDelete + } + + @objc + public var asAutomaticPermanentlyDelete: DBXTeamLogDispositionActionTypeAutomaticPermanentlyDelete? { + self as? DBXTeamLogDispositionActionTypeAutomaticPermanentlyDelete + } + + @objc + public var asOther: DBXTeamLogDispositionActionTypeOther? { + self as? DBXTeamLogDispositionActionTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDispositionActionTypeAutomaticDelete: DBXTeamLogDispositionActionType { + @objc + public init() { + let swift = TeamLog.DispositionActionType.automaticDelete + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDispositionActionTypeAutomaticPermanentlyDelete: DBXTeamLogDispositionActionType { + @objc + public init() { + let swift = TeamLog.DispositionActionType.automaticPermanentlyDelete + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDispositionActionTypeOther: DBXTeamLogDispositionActionType { + @objc + public init() { + let swift = TeamLog.DispositionActionType.other + super.init(swift: swift) + } +} + +/// Approved user's request to join team. +@objc +public class DBXTeamLogDomainInvitesApproveRequestToJoinTeamDetails: NSObject { + let swift: TeamLog.DomainInvitesApproveRequestToJoinTeamDetails + + public init(swift: TeamLog.DomainInvitesApproveRequestToJoinTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainInvitesApproveRequestToJoinTeamType struct +@objc +public class DBXTeamLogDomainInvitesApproveRequestToJoinTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainInvitesApproveRequestToJoinTeamType(description_: description_) + } + + let swift: TeamLog.DomainInvitesApproveRequestToJoinTeamType + + public init(swift: TeamLog.DomainInvitesApproveRequestToJoinTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Declined user's request to join team. +@objc +public class DBXTeamLogDomainInvitesDeclineRequestToJoinTeamDetails: NSObject { + let swift: TeamLog.DomainInvitesDeclineRequestToJoinTeamDetails + + public init(swift: TeamLog.DomainInvitesDeclineRequestToJoinTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainInvitesDeclineRequestToJoinTeamType struct +@objc +public class DBXTeamLogDomainInvitesDeclineRequestToJoinTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainInvitesDeclineRequestToJoinTeamType(description_: description_) + } + + let swift: TeamLog.DomainInvitesDeclineRequestToJoinTeamType + + public init(swift: TeamLog.DomainInvitesDeclineRequestToJoinTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Sent domain invites to existing domain accounts. +@objc +public class DBXTeamLogDomainInvitesEmailExistingUsersDetails: NSObject { + /// Domain names. + @objc + public var domainName: String { swift.domainName } + /// Number of recipients. + @objc + public var numRecipients: NSNumber { swift.numRecipients as NSNumber } + + @objc + public init(domainName: String, numRecipients: NSNumber) { + self.swift = TeamLog.DomainInvitesEmailExistingUsersDetails(domainName: domainName, numRecipients: numRecipients.uint64Value) + } + + let swift: TeamLog.DomainInvitesEmailExistingUsersDetails + + public init(swift: TeamLog.DomainInvitesEmailExistingUsersDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainInvitesEmailExistingUsersType struct +@objc +public class DBXTeamLogDomainInvitesEmailExistingUsersType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainInvitesEmailExistingUsersType(description_: description_) + } + + let swift: TeamLog.DomainInvitesEmailExistingUsersType + + public init(swift: TeamLog.DomainInvitesEmailExistingUsersType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Requested to join team. +@objc +public class DBXTeamLogDomainInvitesRequestToJoinTeamDetails: NSObject { + let swift: TeamLog.DomainInvitesRequestToJoinTeamDetails + + public init(swift: TeamLog.DomainInvitesRequestToJoinTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainInvitesRequestToJoinTeamType struct +@objc +public class DBXTeamLogDomainInvitesRequestToJoinTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainInvitesRequestToJoinTeamType(description_: description_) + } + + let swift: TeamLog.DomainInvitesRequestToJoinTeamType + + public init(swift: TeamLog.DomainInvitesRequestToJoinTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Disabled "Automatically invite new users". +@objc +public class DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoDetails: NSObject { + let swift: TeamLog.DomainInvitesSetInviteNewUserPrefToNoDetails + + public init(swift: TeamLog.DomainInvitesSetInviteNewUserPrefToNoDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainInvitesSetInviteNewUserPrefToNoType struct +@objc +public class DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainInvitesSetInviteNewUserPrefToNoType(description_: description_) + } + + let swift: TeamLog.DomainInvitesSetInviteNewUserPrefToNoType + + public init(swift: TeamLog.DomainInvitesSetInviteNewUserPrefToNoType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled "Automatically invite new users". +@objc +public class DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesDetails: NSObject { + let swift: TeamLog.DomainInvitesSetInviteNewUserPrefToYesDetails + + public init(swift: TeamLog.DomainInvitesSetInviteNewUserPrefToYesDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainInvitesSetInviteNewUserPrefToYesType struct +@objc +public class DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainInvitesSetInviteNewUserPrefToYesType(description_: description_) + } + + let swift: TeamLog.DomainInvitesSetInviteNewUserPrefToYesType + + public init(swift: TeamLog.DomainInvitesSetInviteNewUserPrefToYesType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Failed to verify team domain. +@objc +public class DBXTeamLogDomainVerificationAddDomainFailDetails: NSObject { + /// Domain name. + @objc + public var domainName: String { swift.domainName } + /// Domain name verification method. Might be missing due to historical data gap. + @objc + public var verificationMethod: String? { swift.verificationMethod } + + @objc + public init(domainName: String, verificationMethod: String?) { + self.swift = TeamLog.DomainVerificationAddDomainFailDetails(domainName: domainName, verificationMethod: verificationMethod) + } + + let swift: TeamLog.DomainVerificationAddDomainFailDetails + + public init(swift: TeamLog.DomainVerificationAddDomainFailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainVerificationAddDomainFailType struct +@objc +public class DBXTeamLogDomainVerificationAddDomainFailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainVerificationAddDomainFailType(description_: description_) + } + + let swift: TeamLog.DomainVerificationAddDomainFailType + + public init(swift: TeamLog.DomainVerificationAddDomainFailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Verified team domain. +@objc +public class DBXTeamLogDomainVerificationAddDomainSuccessDetails: NSObject { + /// Domain names. + @objc + public var domainNames: [String] { swift.domainNames } + /// Domain name verification method. Might be missing due to historical data gap. + @objc + public var verificationMethod: String? { swift.verificationMethod } + + @objc + public init(domainNames: [String], verificationMethod: String?) { + self.swift = TeamLog.DomainVerificationAddDomainSuccessDetails(domainNames: domainNames, verificationMethod: verificationMethod) + } + + let swift: TeamLog.DomainVerificationAddDomainSuccessDetails + + public init(swift: TeamLog.DomainVerificationAddDomainSuccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainVerificationAddDomainSuccessType struct +@objc +public class DBXTeamLogDomainVerificationAddDomainSuccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainVerificationAddDomainSuccessType(description_: description_) + } + + let swift: TeamLog.DomainVerificationAddDomainSuccessType + + public init(swift: TeamLog.DomainVerificationAddDomainSuccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed domain from list of verified team domains. +@objc +public class DBXTeamLogDomainVerificationRemoveDomainDetails: NSObject { + /// Domain names. + @objc + public var domainNames: [String] { swift.domainNames } + + @objc + public init(domainNames: [String]) { + self.swift = TeamLog.DomainVerificationRemoveDomainDetails(domainNames: domainNames) + } + + let swift: TeamLog.DomainVerificationRemoveDomainDetails + + public init(swift: TeamLog.DomainVerificationRemoveDomainDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DomainVerificationRemoveDomainType struct +@objc +public class DBXTeamLogDomainVerificationRemoveDomainType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DomainVerificationRemoveDomainType(description_: description_) + } + + let swift: TeamLog.DomainVerificationRemoveDomainType + + public init(swift: TeamLog.DomainVerificationRemoveDomainType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared content downloads policy +@objc +public class DBXTeamLogDownloadPolicyType: NSObject { + let swift: TeamLog.DownloadPolicyType + + public init(swift: TeamLog.DownloadPolicyType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.DownloadPolicyType) -> DBXTeamLogDownloadPolicyType { + switch swift { + case .allow: + return DBXTeamLogDownloadPolicyTypeAllow() + case .disallow: + return DBXTeamLogDownloadPolicyTypeDisallow() + case .other: + return DBXTeamLogDownloadPolicyTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAllow: DBXTeamLogDownloadPolicyTypeAllow? { + self as? DBXTeamLogDownloadPolicyTypeAllow + } + + @objc + public var asDisallow: DBXTeamLogDownloadPolicyTypeDisallow? { + self as? DBXTeamLogDownloadPolicyTypeDisallow + } + + @objc + public var asOther: DBXTeamLogDownloadPolicyTypeOther? { + self as? DBXTeamLogDownloadPolicyTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDownloadPolicyTypeAllow: DBXTeamLogDownloadPolicyType { + @objc + public init() { + let swift = TeamLog.DownloadPolicyType.allow + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDownloadPolicyTypeDisallow: DBXTeamLogDownloadPolicyType { + @objc + public init() { + let swift = TeamLog.DownloadPolicyType.disallow + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDownloadPolicyTypeOther: DBXTeamLogDownloadPolicyType { + @objc + public init() { + let swift = TeamLog.DownloadPolicyType.other + super.init(swift: swift) + } +} + +/// Exported passwords. +@objc +public class DBXTeamLogDropboxPasswordsExportedDetails: NSObject { + /// The platform the device runs export. + @objc + public var platform: String { swift.platform } + + @objc + public init(platform: String) { + self.swift = TeamLog.DropboxPasswordsExportedDetails(platform: platform) + } + + let swift: TeamLog.DropboxPasswordsExportedDetails + + public init(swift: TeamLog.DropboxPasswordsExportedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DropboxPasswordsExportedType struct +@objc +public class DBXTeamLogDropboxPasswordsExportedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DropboxPasswordsExportedType(description_: description_) + } + + let swift: TeamLog.DropboxPasswordsExportedType + + public init(swift: TeamLog.DropboxPasswordsExportedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enrolled new Dropbox Passwords device. +@objc +public class DBXTeamLogDropboxPasswordsNewDeviceEnrolledDetails: NSObject { + /// Whether it's a first device enrolled. + @objc + public var isFirstDevice: NSNumber { swift.isFirstDevice as NSNumber } + /// The platform the device is enrolled. + @objc + public var platform: String { swift.platform } + + @objc + public init(isFirstDevice: NSNumber, platform: String) { + self.swift = TeamLog.DropboxPasswordsNewDeviceEnrolledDetails(isFirstDevice: isFirstDevice.boolValue, platform: platform) + } + + let swift: TeamLog.DropboxPasswordsNewDeviceEnrolledDetails + + public init(swift: TeamLog.DropboxPasswordsNewDeviceEnrolledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DropboxPasswordsNewDeviceEnrolledType struct +@objc +public class DBXTeamLogDropboxPasswordsNewDeviceEnrolledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DropboxPasswordsNewDeviceEnrolledType(description_: description_) + } + + let swift: TeamLog.DropboxPasswordsNewDeviceEnrolledType + + public init(swift: TeamLog.DropboxPasswordsNewDeviceEnrolledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether team users can use Dropbox Passwords +@objc +public class DBXTeamLogDropboxPasswordsPolicy: NSObject { + let swift: TeamLog.DropboxPasswordsPolicy + + public init(swift: TeamLog.DropboxPasswordsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.DropboxPasswordsPolicy) -> DBXTeamLogDropboxPasswordsPolicy { + switch swift { + case .default_: + return DBXTeamLogDropboxPasswordsPolicyDefault_() + case .disabled: + return DBXTeamLogDropboxPasswordsPolicyDisabled() + case .enabled: + return DBXTeamLogDropboxPasswordsPolicyEnabled() + case .other: + return DBXTeamLogDropboxPasswordsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXTeamLogDropboxPasswordsPolicyDefault_? { + self as? DBXTeamLogDropboxPasswordsPolicyDefault_ + } + + @objc + public var asDisabled: DBXTeamLogDropboxPasswordsPolicyDisabled? { + self as? DBXTeamLogDropboxPasswordsPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogDropboxPasswordsPolicyEnabled? { + self as? DBXTeamLogDropboxPasswordsPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogDropboxPasswordsPolicyOther? { + self as? DBXTeamLogDropboxPasswordsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDropboxPasswordsPolicyDefault_: DBXTeamLogDropboxPasswordsPolicy { + @objc + public init() { + let swift = TeamLog.DropboxPasswordsPolicy.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDropboxPasswordsPolicyDisabled: DBXTeamLogDropboxPasswordsPolicy { + @objc + public init() { + let swift = TeamLog.DropboxPasswordsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDropboxPasswordsPolicyEnabled: DBXTeamLogDropboxPasswordsPolicy { + @objc + public init() { + let swift = TeamLog.DropboxPasswordsPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogDropboxPasswordsPolicyOther: DBXTeamLogDropboxPasswordsPolicy { + @objc + public init() { + let swift = TeamLog.DropboxPasswordsPolicy.other + super.init(swift: swift) + } +} + +/// Changed Dropbox Passwords policy for team. +@objc +public class DBXTeamLogDropboxPasswordsPolicyChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogDropboxPasswordsPolicy { DBXTeamLogDropboxPasswordsPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogDropboxPasswordsPolicy { DBXTeamLogDropboxPasswordsPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogDropboxPasswordsPolicy, previousValue: DBXTeamLogDropboxPasswordsPolicy) { + self.swift = TeamLog.DropboxPasswordsPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.DropboxPasswordsPolicyChangedDetails + + public init(swift: TeamLog.DropboxPasswordsPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible DropboxPasswordsPolicyChangedType struct +@objc +public class DBXTeamLogDropboxPasswordsPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.DropboxPasswordsPolicyChangedType(description_: description_) + } + + let swift: TeamLog.DropboxPasswordsPolicyChangedType + + public init(swift: TeamLog.DropboxPasswordsPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Represents a time duration: unit and amount +@objc +public class DBXTeamLogDurationLogInfo: NSObject { + /// Time unit. + @objc + public var unit: DBXTeamLogTimeUnit { DBXTeamLogTimeUnit(swift: swift.unit) } + /// Amount of time. + @objc + public var amount: NSNumber { swift.amount as NSNumber } + + @objc + public init(unit: DBXTeamLogTimeUnit, amount: NSNumber) { + self.swift = TeamLog.DurationLogInfo(unit: unit.swift, amount: amount.uint64Value) + } + + let swift: TeamLog.DurationLogInfo + + public init(swift: TeamLog.DurationLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether a team can use Email to Dropbox feature +@objc +public class DBXTeamLogEmailIngestPolicy: NSObject { + let swift: TeamLog.EmailIngestPolicy + + public init(swift: TeamLog.EmailIngestPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.EmailIngestPolicy) -> DBXTeamLogEmailIngestPolicy { + switch swift { + case .disabled: + return DBXTeamLogEmailIngestPolicyDisabled() + case .enabled: + return DBXTeamLogEmailIngestPolicyEnabled() + case .other: + return DBXTeamLogEmailIngestPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogEmailIngestPolicyDisabled? { + self as? DBXTeamLogEmailIngestPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogEmailIngestPolicyEnabled? { + self as? DBXTeamLogEmailIngestPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogEmailIngestPolicyOther? { + self as? DBXTeamLogEmailIngestPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEmailIngestPolicyDisabled: DBXTeamLogEmailIngestPolicy { + @objc + public init() { + let swift = TeamLog.EmailIngestPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEmailIngestPolicyEnabled: DBXTeamLogEmailIngestPolicy { + @objc + public init() { + let swift = TeamLog.EmailIngestPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEmailIngestPolicyOther: DBXTeamLogEmailIngestPolicy { + @objc + public init() { + let swift = TeamLog.EmailIngestPolicy.other + super.init(swift: swift) + } +} + +/// Changed email to Dropbox policy for team. +@objc +public class DBXTeamLogEmailIngestPolicyChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogEmailIngestPolicy { DBXTeamLogEmailIngestPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogEmailIngestPolicy { DBXTeamLogEmailIngestPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogEmailIngestPolicy, previousValue: DBXTeamLogEmailIngestPolicy) { + self.swift = TeamLog.EmailIngestPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.EmailIngestPolicyChangedDetails + + public init(swift: TeamLog.EmailIngestPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmailIngestPolicyChangedType struct +@objc +public class DBXTeamLogEmailIngestPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmailIngestPolicyChangedType(description_: description_) + } + + let swift: TeamLog.EmailIngestPolicyChangedType + + public init(swift: TeamLog.EmailIngestPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Received files via Email to Dropbox. +@objc +public class DBXTeamLogEmailIngestReceiveFileDetails: NSObject { + /// Inbox name. + @objc + public var inboxName: String { swift.inboxName } + /// Submitted file names. + @objc + public var attachmentNames: [String] { swift.attachmentNames } + /// Subject of the email. + @objc + public var subject: String? { swift.subject } + /// The name as provided by the submitter. + @objc + public var fromName: String? { swift.fromName } + /// The email as provided by the submitter. + @objc + public var fromEmail: String? { swift.fromEmail } + + @objc + public init(inboxName: String, attachmentNames: [String], subject: String?, fromName: String?, fromEmail: String?) { + self.swift = TeamLog.EmailIngestReceiveFileDetails( + inboxName: inboxName, + attachmentNames: attachmentNames, + subject: subject, + fromName: fromName, + fromEmail: fromEmail + ) + } + + let swift: TeamLog.EmailIngestReceiveFileDetails + + public init(swift: TeamLog.EmailIngestReceiveFileDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmailIngestReceiveFileType struct +@objc +public class DBXTeamLogEmailIngestReceiveFileType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmailIngestReceiveFileType(description_: description_) + } + + let swift: TeamLog.EmailIngestReceiveFileType + + public init(swift: TeamLog.EmailIngestReceiveFileType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added members to EMM exception list. +@objc +public class DBXTeamLogEmmAddExceptionDetails: NSObject { + let swift: TeamLog.EmmAddExceptionDetails + + public init(swift: TeamLog.EmmAddExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmmAddExceptionType struct +@objc +public class DBXTeamLogEmmAddExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmmAddExceptionType(description_: description_) + } + + let swift: TeamLog.EmmAddExceptionType + + public init(swift: TeamLog.EmmAddExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled enterprise mobility management for members. +@objc +public class DBXTeamLogEmmChangePolicyDetails: NSObject { + /// New enterprise mobility management policy. + @objc + public var newValue: DBXTeamPoliciesEmmState { DBXTeamPoliciesEmmState(swift: swift.newValue) } + /// Previous enterprise mobility management policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamPoliciesEmmState? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesEmmState(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesEmmState, previousValue: DBXTeamPoliciesEmmState?) { + self.swift = TeamLog.EmmChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.EmmChangePolicyDetails + + public init(swift: TeamLog.EmmChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmmChangePolicyType struct +@objc +public class DBXTeamLogEmmChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmmChangePolicyType(description_: description_) + } + + let swift: TeamLog.EmmChangePolicyType + + public init(swift: TeamLog.EmmChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created EMM-excluded users report. +@objc +public class DBXTeamLogEmmCreateExceptionsReportDetails: NSObject { + let swift: TeamLog.EmmCreateExceptionsReportDetails + + public init(swift: TeamLog.EmmCreateExceptionsReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmmCreateExceptionsReportType struct +@objc +public class DBXTeamLogEmmCreateExceptionsReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmmCreateExceptionsReportType(description_: description_) + } + + let swift: TeamLog.EmmCreateExceptionsReportType + + public init(swift: TeamLog.EmmCreateExceptionsReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created EMM mobile app usage report. +@objc +public class DBXTeamLogEmmCreateUsageReportDetails: NSObject { + let swift: TeamLog.EmmCreateUsageReportDetails + + public init(swift: TeamLog.EmmCreateUsageReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmmCreateUsageReportType struct +@objc +public class DBXTeamLogEmmCreateUsageReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmmCreateUsageReportType(description_: description_) + } + + let swift: TeamLog.EmmCreateUsageReportType + + public init(swift: TeamLog.EmmCreateUsageReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Failed to sign in via EMM. +@objc +public class DBXTeamLogEmmErrorDetails: NSObject { + /// Error details. + @objc + public var errorDetails: DBXTeamLogFailureDetailsLogInfo { DBXTeamLogFailureDetailsLogInfo(swift: swift.errorDetails) } + + @objc + public init(errorDetails: DBXTeamLogFailureDetailsLogInfo) { + self.swift = TeamLog.EmmErrorDetails(errorDetails: errorDetails.swift) + } + + let swift: TeamLog.EmmErrorDetails + + public init(swift: TeamLog.EmmErrorDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmmErrorType struct +@objc +public class DBXTeamLogEmmErrorType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmmErrorType(description_: description_) + } + + let swift: TeamLog.EmmErrorType + + public init(swift: TeamLog.EmmErrorType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Refreshed auth token used for setting up EMM. +@objc +public class DBXTeamLogEmmRefreshAuthTokenDetails: NSObject { + let swift: TeamLog.EmmRefreshAuthTokenDetails + + public init(swift: TeamLog.EmmRefreshAuthTokenDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmmRefreshAuthTokenType struct +@objc +public class DBXTeamLogEmmRefreshAuthTokenType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmmRefreshAuthTokenType(description_: description_) + } + + let swift: TeamLog.EmmRefreshAuthTokenType + + public init(swift: TeamLog.EmmRefreshAuthTokenType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed members from EMM exception list. +@objc +public class DBXTeamLogEmmRemoveExceptionDetails: NSObject { + let swift: TeamLog.EmmRemoveExceptionDetails + + public init(swift: TeamLog.EmmRemoveExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EmmRemoveExceptionType struct +@objc +public class DBXTeamLogEmmRemoveExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EmmRemoveExceptionType(description_: description_) + } + + let swift: TeamLog.EmmRemoveExceptionType + + public init(swift: TeamLog.EmmRemoveExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled domain invites. +@objc +public class DBXTeamLogEnabledDomainInvitesDetails: NSObject { + let swift: TeamLog.EnabledDomainInvitesDetails + + public init(swift: TeamLog.EnabledDomainInvitesDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EnabledDomainInvitesType struct +@objc +public class DBXTeamLogEnabledDomainInvitesType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EnabledDomainInvitesType(description_: description_) + } + + let swift: TeamLog.EnabledDomainInvitesType + + public init(swift: TeamLog.EnabledDomainInvitesType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Ended enterprise admin session. +@objc +public class DBXTeamLogEndedEnterpriseAdminSessionDeprecatedDetails: NSObject { + /// More information about the organization or team. + @objc + public var federationExtraDetails: DBXTeamLogFedExtraDetails { DBXTeamLogFedExtraDetails(swift: swift.federationExtraDetails) } + + @objc + public init(federationExtraDetails: DBXTeamLogFedExtraDetails) { + self.swift = TeamLog.EndedEnterpriseAdminSessionDeprecatedDetails(federationExtraDetails: federationExtraDetails.swift) + } + + let swift: TeamLog.EndedEnterpriseAdminSessionDeprecatedDetails + + public init(swift: TeamLog.EndedEnterpriseAdminSessionDeprecatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EndedEnterpriseAdminSessionDeprecatedType struct +@objc +public class DBXTeamLogEndedEnterpriseAdminSessionDeprecatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EndedEnterpriseAdminSessionDeprecatedType(description_: description_) + } + + let swift: TeamLog.EndedEnterpriseAdminSessionDeprecatedType + + public init(swift: TeamLog.EndedEnterpriseAdminSessionDeprecatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Ended enterprise admin session. +@objc +public class DBXTeamLogEndedEnterpriseAdminSessionDetails: NSObject { + let swift: TeamLog.EndedEnterpriseAdminSessionDetails + + public init(swift: TeamLog.EndedEnterpriseAdminSessionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EndedEnterpriseAdminSessionType struct +@objc +public class DBXTeamLogEndedEnterpriseAdminSessionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EndedEnterpriseAdminSessionType(description_: description_) + } + + let swift: TeamLog.EndedEnterpriseAdminSessionType + + public init(swift: TeamLog.EndedEnterpriseAdminSessionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether password must be enforced when an externally shared link is updated +@objc +public class DBXTeamLogEnforceLinkPasswordPolicy: NSObject { + let swift: TeamLog.EnforceLinkPasswordPolicy + + public init(swift: TeamLog.EnforceLinkPasswordPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.EnforceLinkPasswordPolicy) -> DBXTeamLogEnforceLinkPasswordPolicy { + switch swift { + case .optional: + return DBXTeamLogEnforceLinkPasswordPolicyOptional() + case .required: + return DBXTeamLogEnforceLinkPasswordPolicyRequired() + case .other: + return DBXTeamLogEnforceLinkPasswordPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOptional: DBXTeamLogEnforceLinkPasswordPolicyOptional? { + self as? DBXTeamLogEnforceLinkPasswordPolicyOptional + } + + @objc + public var asRequired: DBXTeamLogEnforceLinkPasswordPolicyRequired? { + self as? DBXTeamLogEnforceLinkPasswordPolicyRequired + } + + @objc + public var asOther: DBXTeamLogEnforceLinkPasswordPolicyOther? { + self as? DBXTeamLogEnforceLinkPasswordPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEnforceLinkPasswordPolicyOptional: DBXTeamLogEnforceLinkPasswordPolicy { + @objc + public init() { + let swift = TeamLog.EnforceLinkPasswordPolicy.optional + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEnforceLinkPasswordPolicyRequired: DBXTeamLogEnforceLinkPasswordPolicy { + @objc + public init() { + let swift = TeamLog.EnforceLinkPasswordPolicy.required + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEnforceLinkPasswordPolicyOther: DBXTeamLogEnforceLinkPasswordPolicy { + @objc + public init() { + let swift = TeamLog.EnforceLinkPasswordPolicy.other + super.init(swift: swift) + } +} + +/// Changed who can update a setting. +@objc +public class DBXTeamLogEnterpriseSettingsLockingDetails: NSObject { + /// The secondary team name. + @objc + public var teamName: String { swift.teamName } + /// Settings page name. + @objc + public var settingsPageName: String { swift.settingsPageName } + /// Previous locked settings page state. + @objc + public var previousSettingsPageLockingState: String { swift.previousSettingsPageLockingState } + /// New locked settings page state. + @objc + public var newSettingsPageLockingState: String { swift.newSettingsPageLockingState } + + @objc + public init(teamName: String, settingsPageName: String, previousSettingsPageLockingState: String, newSettingsPageLockingState: String) { + self.swift = TeamLog.EnterpriseSettingsLockingDetails( + teamName: teamName, + settingsPageName: settingsPageName, + previousSettingsPageLockingState: previousSettingsPageLockingState, + newSettingsPageLockingState: newSettingsPageLockingState + ) + } + + let swift: TeamLog.EnterpriseSettingsLockingDetails + + public init(swift: TeamLog.EnterpriseSettingsLockingDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible EnterpriseSettingsLockingType struct +@objc +public class DBXTeamLogEnterpriseSettingsLockingType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.EnterpriseSettingsLockingType(description_: description_) + } + + let swift: TeamLog.EnterpriseSettingsLockingType + + public init(swift: TeamLog.EnterpriseSettingsLockingType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Category of events in event audit log. +@objc +public class DBXTeamLogEventCategory: NSObject { + let swift: TeamLog.EventCategory + + public init(swift: TeamLog.EventCategory) { + self.swift = swift + } + + public static func factory(swift: TeamLog.EventCategory) -> DBXTeamLogEventCategory { + switch swift { + case .adminAlerting: + return DBXTeamLogEventCategoryAdminAlerting() + case .apps: + return DBXTeamLogEventCategoryApps() + case .comments: + return DBXTeamLogEventCategoryComments() + case .dataGovernance: + return DBXTeamLogEventCategoryDataGovernance() + case .devices: + return DBXTeamLogEventCategoryDevices() + case .domains: + return DBXTeamLogEventCategoryDomains() + case .encryption: + return DBXTeamLogEventCategoryEncryption() + case .fileOperations: + return DBXTeamLogEventCategoryFileOperations() + case .fileRequests: + return DBXTeamLogEventCategoryFileRequests() + case .groups: + return DBXTeamLogEventCategoryGroups() + case .logins: + return DBXTeamLogEventCategoryLogins() + case .members: + return DBXTeamLogEventCategoryMembers() + case .paper: + return DBXTeamLogEventCategoryPaper() + case .passwords: + return DBXTeamLogEventCategoryPasswords() + case .reports: + return DBXTeamLogEventCategoryReports() + case .sharing: + return DBXTeamLogEventCategorySharing() + case .showcase: + return DBXTeamLogEventCategoryShowcase() + case .sso: + return DBXTeamLogEventCategorySso() + case .teamFolders: + return DBXTeamLogEventCategoryTeamFolders() + case .teamPolicies: + return DBXTeamLogEventCategoryTeamPolicies() + case .teamProfile: + return DBXTeamLogEventCategoryTeamProfile() + case .tfa: + return DBXTeamLogEventCategoryTfa() + case .trustedTeams: + return DBXTeamLogEventCategoryTrustedTeams() + case .other: + return DBXTeamLogEventCategoryOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdminAlerting: DBXTeamLogEventCategoryAdminAlerting? { + self as? DBXTeamLogEventCategoryAdminAlerting + } + + @objc + public var asApps: DBXTeamLogEventCategoryApps? { + self as? DBXTeamLogEventCategoryApps + } + + @objc + public var asComments: DBXTeamLogEventCategoryComments? { + self as? DBXTeamLogEventCategoryComments + } + + @objc + public var asDataGovernance: DBXTeamLogEventCategoryDataGovernance? { + self as? DBXTeamLogEventCategoryDataGovernance + } + + @objc + public var asDevices: DBXTeamLogEventCategoryDevices? { + self as? DBXTeamLogEventCategoryDevices + } + + @objc + public var asDomains: DBXTeamLogEventCategoryDomains? { + self as? DBXTeamLogEventCategoryDomains + } + + @objc + public var asEncryption: DBXTeamLogEventCategoryEncryption? { + self as? DBXTeamLogEventCategoryEncryption + } + + @objc + public var asFileOperations: DBXTeamLogEventCategoryFileOperations? { + self as? DBXTeamLogEventCategoryFileOperations + } + + @objc + public var asFileRequests: DBXTeamLogEventCategoryFileRequests? { + self as? DBXTeamLogEventCategoryFileRequests + } + + @objc + public var asGroups: DBXTeamLogEventCategoryGroups? { + self as? DBXTeamLogEventCategoryGroups + } + + @objc + public var asLogins: DBXTeamLogEventCategoryLogins? { + self as? DBXTeamLogEventCategoryLogins + } + + @objc + public var asMembers: DBXTeamLogEventCategoryMembers? { + self as? DBXTeamLogEventCategoryMembers + } + + @objc + public var asPaper: DBXTeamLogEventCategoryPaper? { + self as? DBXTeamLogEventCategoryPaper + } + + @objc + public var asPasswords: DBXTeamLogEventCategoryPasswords? { + self as? DBXTeamLogEventCategoryPasswords + } + + @objc + public var asReports: DBXTeamLogEventCategoryReports? { + self as? DBXTeamLogEventCategoryReports + } + + @objc + public var asSharing: DBXTeamLogEventCategorySharing? { + self as? DBXTeamLogEventCategorySharing + } + + @objc + public var asShowcase: DBXTeamLogEventCategoryShowcase? { + self as? DBXTeamLogEventCategoryShowcase + } + + @objc + public var asSso: DBXTeamLogEventCategorySso? { + self as? DBXTeamLogEventCategorySso + } + + @objc + public var asTeamFolders: DBXTeamLogEventCategoryTeamFolders? { + self as? DBXTeamLogEventCategoryTeamFolders + } + + @objc + public var asTeamPolicies: DBXTeamLogEventCategoryTeamPolicies? { + self as? DBXTeamLogEventCategoryTeamPolicies + } + + @objc + public var asTeamProfile: DBXTeamLogEventCategoryTeamProfile? { + self as? DBXTeamLogEventCategoryTeamProfile + } + + @objc + public var asTfa: DBXTeamLogEventCategoryTfa? { + self as? DBXTeamLogEventCategoryTfa + } + + @objc + public var asTrustedTeams: DBXTeamLogEventCategoryTrustedTeams? { + self as? DBXTeamLogEventCategoryTrustedTeams + } + + @objc + public var asOther: DBXTeamLogEventCategoryOther? { + self as? DBXTeamLogEventCategoryOther + } +} + +/// Events that involve team related alerts. +@objc +public class DBXTeamLogEventCategoryAdminAlerting: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.adminAlerting + super.init(swift: swift) + } +} + +/// Events that apply to management of linked apps. +@objc +public class DBXTeamLogEventCategoryApps: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.apps + super.init(swift: swift) + } +} + +/// Events that have to do with comments on files and Paper documents. +@objc +public class DBXTeamLogEventCategoryComments: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.comments + super.init(swift: swift) + } +} + +/// Events that involve data governance actions +@objc +public class DBXTeamLogEventCategoryDataGovernance: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.dataGovernance + super.init(swift: swift) + } +} + +/// Events that apply to linked devices on mobile, desktop and Web platforms. +@objc +public class DBXTeamLogEventCategoryDevices: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.devices + super.init(swift: swift) + } +} + +/// Events that involve domain management feature: domain verification, invite enforcement and account capture. +@objc +public class DBXTeamLogEventCategoryDomains: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.domains + super.init(swift: swift) + } +} + +/// Events that involve encryption. +@objc +public class DBXTeamLogEventCategoryEncryption: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.encryption + super.init(swift: swift) + } +} + +/// Events that have to do with filesystem operations on files and folders: copy, move, delete, etc. +@objc +public class DBXTeamLogEventCategoryFileOperations: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.fileOperations + super.init(swift: swift) + } +} + +/// Events that apply to the file requests feature. +@objc +public class DBXTeamLogEventCategoryFileRequests: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.fileRequests + super.init(swift: swift) + } +} + +/// Events that involve group management. +@objc +public class DBXTeamLogEventCategoryGroups: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.groups + super.init(swift: swift) + } +} + +/// Events that involve users signing in to or out of Dropbox. +@objc +public class DBXTeamLogEventCategoryLogins: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.logins + super.init(swift: swift) + } +} + +/// Events that involve team member management. +@objc +public class DBXTeamLogEventCategoryMembers: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.members + super.init(swift: swift) + } +} + +/// Events that apply to Dropbox Paper. +@objc +public class DBXTeamLogEventCategoryPaper: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.paper + super.init(swift: swift) + } +} + +/// Events that involve using, changing or resetting passwords. +@objc +public class DBXTeamLogEventCategoryPasswords: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.passwords + super.init(swift: swift) + } +} + +/// Events that concern generation of admin reports, including team activity and device usage. +@objc +public class DBXTeamLogEventCategoryReports: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.reports + super.init(swift: swift) + } +} + +/// Events that apply to all types of sharing and collaboration. +@objc +public class DBXTeamLogEventCategorySharing: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.sharing + super.init(swift: swift) + } +} + +/// Events that apply to Dropbox Showcase. +@objc +public class DBXTeamLogEventCategoryShowcase: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.showcase + super.init(swift: swift) + } +} + +/// Events that involve using or configuring single sign-on as well as administrative policies concerning single +/// sign-on. +@objc +public class DBXTeamLogEventCategorySso: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.sso + super.init(swift: swift) + } +} + +/// Events that involve team folder management. +@objc +public class DBXTeamLogEventCategoryTeamFolders: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.teamFolders + super.init(swift: swift) + } +} + +/// Events that involve a change in team-wide policies. +@objc +public class DBXTeamLogEventCategoryTeamPolicies: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.teamPolicies + super.init(swift: swift) + } +} + +/// Events that involve a change in the team profile. +@objc +public class DBXTeamLogEventCategoryTeamProfile: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.teamProfile + super.init(swift: swift) + } +} + +/// Events that involve using or configuring two factor authentication as well as administrative policies +/// concerning two factor authentication. +@objc +public class DBXTeamLogEventCategoryTfa: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.tfa + super.init(swift: swift) + } +} + +/// Events that apply to cross-team trust establishment. +@objc +public class DBXTeamLogEventCategoryTrustedTeams: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.trustedTeams + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventCategoryOther: DBXTeamLogEventCategory { + @objc + public init() { + let swift = TeamLog.EventCategory.other + super.init(swift: swift) + } +} + +/// Additional fields depending on the event type. +@objc +public class DBXTeamLogEventDetails: NSObject { + let swift: TeamLog.EventDetails + + public init(swift: TeamLog.EventDetails) { + self.swift = swift + } + + public static func factory(swift: TeamLog.EventDetails) -> DBXTeamLogEventDetails { + switch swift { + case .adminAlertingAlertStateChangedDetails(let swiftArg): + let arg = DBXTeamLogAdminAlertingAlertStateChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAdminAlertingAlertStateChangedDetails(arg) + case .adminAlertingChangedAlertConfigDetails(let swiftArg): + let arg = DBXTeamLogAdminAlertingChangedAlertConfigDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAdminAlertingChangedAlertConfigDetails(arg) + case .adminAlertingTriggeredAlertDetails(let swiftArg): + let arg = DBXTeamLogAdminAlertingTriggeredAlertDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAdminAlertingTriggeredAlertDetails(arg) + case .ransomwareRestoreProcessCompletedDetails(let swiftArg): + let arg = DBXTeamLogRansomwareRestoreProcessCompletedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsRansomwareRestoreProcessCompletedDetails(arg) + case .ransomwareRestoreProcessStartedDetails(let swiftArg): + let arg = DBXTeamLogRansomwareRestoreProcessStartedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsRansomwareRestoreProcessStartedDetails(arg) + case .appBlockedByPermissionsDetails(let swiftArg): + let arg = DBXTeamLogAppBlockedByPermissionsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAppBlockedByPermissionsDetails(arg) + case .appLinkTeamDetails(let swiftArg): + let arg = DBXTeamLogAppLinkTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAppLinkTeamDetails(arg) + case .appLinkUserDetails(let swiftArg): + let arg = DBXTeamLogAppLinkUserDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAppLinkUserDetails(arg) + case .appUnlinkTeamDetails(let swiftArg): + let arg = DBXTeamLogAppUnlinkTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAppUnlinkTeamDetails(arg) + case .appUnlinkUserDetails(let swiftArg): + let arg = DBXTeamLogAppUnlinkUserDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAppUnlinkUserDetails(arg) + case .integrationConnectedDetails(let swiftArg): + let arg = DBXTeamLogIntegrationConnectedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsIntegrationConnectedDetails(arg) + case .integrationDisconnectedDetails(let swiftArg): + let arg = DBXTeamLogIntegrationDisconnectedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsIntegrationDisconnectedDetails(arg) + case .fileAddCommentDetails(let swiftArg): + let arg = DBXTeamLogFileAddCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileAddCommentDetails(arg) + case .fileChangeCommentSubscriptionDetails(let swiftArg): + let arg = DBXTeamLogFileChangeCommentSubscriptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileChangeCommentSubscriptionDetails(arg) + case .fileDeleteCommentDetails(let swiftArg): + let arg = DBXTeamLogFileDeleteCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileDeleteCommentDetails(arg) + case .fileEditCommentDetails(let swiftArg): + let arg = DBXTeamLogFileEditCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileEditCommentDetails(arg) + case .fileLikeCommentDetails(let swiftArg): + let arg = DBXTeamLogFileLikeCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileLikeCommentDetails(arg) + case .fileResolveCommentDetails(let swiftArg): + let arg = DBXTeamLogFileResolveCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileResolveCommentDetails(arg) + case .fileUnlikeCommentDetails(let swiftArg): + let arg = DBXTeamLogFileUnlikeCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileUnlikeCommentDetails(arg) + case .fileUnresolveCommentDetails(let swiftArg): + let arg = DBXTeamLogFileUnresolveCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileUnresolveCommentDetails(arg) + case .governancePolicyAddFoldersDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyAddFoldersDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyAddFoldersDetails(arg) + case .governancePolicyAddFolderFailedDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyAddFolderFailedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyAddFolderFailedDetails(arg) + case .governancePolicyContentDisposedDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyContentDisposedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyContentDisposedDetails(arg) + case .governancePolicyCreateDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyCreateDetails(arg) + case .governancePolicyDeleteDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyDeleteDetails(arg) + case .governancePolicyEditDetailsDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyEditDetailsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyEditDetailsDetails(arg) + case .governancePolicyEditDurationDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyEditDurationDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyEditDurationDetails(arg) + case .governancePolicyExportCreatedDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyExportCreatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyExportCreatedDetails(arg) + case .governancePolicyExportRemovedDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyExportRemovedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyExportRemovedDetails(arg) + case .governancePolicyRemoveFoldersDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyRemoveFoldersDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyRemoveFoldersDetails(arg) + case .governancePolicyReportCreatedDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyReportCreatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyReportCreatedDetails(arg) + case .governancePolicyZipPartDownloadedDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyZipPartDownloadedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGovernancePolicyZipPartDownloadedDetails(arg) + case .legalHoldsActivateAHoldDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsActivateAHoldDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsActivateAHoldDetails(arg) + case .legalHoldsAddMembersDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsAddMembersDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsAddMembersDetails(arg) + case .legalHoldsChangeHoldDetailsDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsChangeHoldDetailsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsChangeHoldDetailsDetails(arg) + case .legalHoldsChangeHoldNameDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsChangeHoldNameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsChangeHoldNameDetails(arg) + case .legalHoldsExportAHoldDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportAHoldDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsExportAHoldDetails(arg) + case .legalHoldsExportCancelledDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportCancelledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsExportCancelledDetails(arg) + case .legalHoldsExportDownloadedDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportDownloadedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsExportDownloadedDetails(arg) + case .legalHoldsExportRemovedDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportRemovedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsExportRemovedDetails(arg) + case .legalHoldsReleaseAHoldDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsReleaseAHoldDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsReleaseAHoldDetails(arg) + case .legalHoldsRemoveMembersDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsRemoveMembersDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsRemoveMembersDetails(arg) + case .legalHoldsReportAHoldDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsReportAHoldDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLegalHoldsReportAHoldDetails(arg) + case .deviceChangeIpDesktopDetails(let swiftArg): + let arg = DBXTeamLogDeviceChangeIpDesktopDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceChangeIpDesktopDetails(arg) + case .deviceChangeIpMobileDetails(let swiftArg): + let arg = DBXTeamLogDeviceChangeIpMobileDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceChangeIpMobileDetails(arg) + case .deviceChangeIpWebDetails(let swiftArg): + let arg = DBXTeamLogDeviceChangeIpWebDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceChangeIpWebDetails(arg) + case .deviceDeleteOnUnlinkFailDetails(let swiftArg): + let arg = DBXTeamLogDeviceDeleteOnUnlinkFailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceDeleteOnUnlinkFailDetails(arg) + case .deviceDeleteOnUnlinkSuccessDetails(let swiftArg): + let arg = DBXTeamLogDeviceDeleteOnUnlinkSuccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceDeleteOnUnlinkSuccessDetails(arg) + case .deviceLinkFailDetails(let swiftArg): + let arg = DBXTeamLogDeviceLinkFailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceLinkFailDetails(arg) + case .deviceLinkSuccessDetails(let swiftArg): + let arg = DBXTeamLogDeviceLinkSuccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceLinkSuccessDetails(arg) + case .deviceManagementDisabledDetails(let swiftArg): + let arg = DBXTeamLogDeviceManagementDisabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceManagementDisabledDetails(arg) + case .deviceManagementEnabledDetails(let swiftArg): + let arg = DBXTeamLogDeviceManagementEnabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceManagementEnabledDetails(arg) + case .deviceSyncBackupStatusChangedDetails(let swiftArg): + let arg = DBXTeamLogDeviceSyncBackupStatusChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceSyncBackupStatusChangedDetails(arg) + case .deviceUnlinkDetails(let swiftArg): + let arg = DBXTeamLogDeviceUnlinkDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceUnlinkDetails(arg) + case .dropboxPasswordsExportedDetails(let swiftArg): + let arg = DBXTeamLogDropboxPasswordsExportedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDropboxPasswordsExportedDetails(arg) + case .dropboxPasswordsNewDeviceEnrolledDetails(let swiftArg): + let arg = DBXTeamLogDropboxPasswordsNewDeviceEnrolledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDropboxPasswordsNewDeviceEnrolledDetails(arg) + case .emmRefreshAuthTokenDetails(let swiftArg): + let arg = DBXTeamLogEmmRefreshAuthTokenDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmmRefreshAuthTokenDetails(arg) + case .externalDriveBackupEligibilityStatusCheckedDetails(let swiftArg): + let arg = DBXTeamLogExternalDriveBackupEligibilityStatusCheckedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExternalDriveBackupEligibilityStatusCheckedDetails(arg) + case .externalDriveBackupStatusChangedDetails(let swiftArg): + let arg = DBXTeamLogExternalDriveBackupStatusChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExternalDriveBackupStatusChangedDetails(arg) + case .accountCaptureChangeAvailabilityDetails(let swiftArg): + let arg = DBXTeamLogAccountCaptureChangeAvailabilityDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAccountCaptureChangeAvailabilityDetails(arg) + case .accountCaptureMigrateAccountDetails(let swiftArg): + let arg = DBXTeamLogAccountCaptureMigrateAccountDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAccountCaptureMigrateAccountDetails(arg) + case .accountCaptureNotificationEmailsSentDetails(let swiftArg): + let arg = DBXTeamLogAccountCaptureNotificationEmailsSentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAccountCaptureNotificationEmailsSentDetails(arg) + case .accountCaptureRelinquishAccountDetails(let swiftArg): + let arg = DBXTeamLogAccountCaptureRelinquishAccountDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAccountCaptureRelinquishAccountDetails(arg) + case .disabledDomainInvitesDetails(let swiftArg): + let arg = DBXTeamLogDisabledDomainInvitesDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDisabledDomainInvitesDetails(arg) + case .domainInvitesApproveRequestToJoinTeamDetails(let swiftArg): + let arg = DBXTeamLogDomainInvitesApproveRequestToJoinTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainInvitesApproveRequestToJoinTeamDetails(arg) + case .domainInvitesDeclineRequestToJoinTeamDetails(let swiftArg): + let arg = DBXTeamLogDomainInvitesDeclineRequestToJoinTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainInvitesDeclineRequestToJoinTeamDetails(arg) + case .domainInvitesEmailExistingUsersDetails(let swiftArg): + let arg = DBXTeamLogDomainInvitesEmailExistingUsersDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainInvitesEmailExistingUsersDetails(arg) + case .domainInvitesRequestToJoinTeamDetails(let swiftArg): + let arg = DBXTeamLogDomainInvitesRequestToJoinTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainInvitesRequestToJoinTeamDetails(arg) + case .domainInvitesSetInviteNewUserPrefToNoDetails(let swiftArg): + let arg = DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToNoDetails(arg) + case .domainInvitesSetInviteNewUserPrefToYesDetails(let swiftArg): + let arg = DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToYesDetails(arg) + case .domainVerificationAddDomainFailDetails(let swiftArg): + let arg = DBXTeamLogDomainVerificationAddDomainFailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainVerificationAddDomainFailDetails(arg) + case .domainVerificationAddDomainSuccessDetails(let swiftArg): + let arg = DBXTeamLogDomainVerificationAddDomainSuccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainVerificationAddDomainSuccessDetails(arg) + case .domainVerificationRemoveDomainDetails(let swiftArg): + let arg = DBXTeamLogDomainVerificationRemoveDomainDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDomainVerificationRemoveDomainDetails(arg) + case .enabledDomainInvitesDetails(let swiftArg): + let arg = DBXTeamLogEnabledDomainInvitesDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEnabledDomainInvitesDetails(arg) + case .teamEncryptionKeyCancelKeyDeletionDetails(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyCancelKeyDeletionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamEncryptionKeyCancelKeyDeletionDetails(arg) + case .teamEncryptionKeyCreateKeyDetails(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyCreateKeyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamEncryptionKeyCreateKeyDetails(arg) + case .teamEncryptionKeyDeleteKeyDetails(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyDeleteKeyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamEncryptionKeyDeleteKeyDetails(arg) + case .teamEncryptionKeyDisableKeyDetails(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyDisableKeyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamEncryptionKeyDisableKeyDetails(arg) + case .teamEncryptionKeyEnableKeyDetails(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyEnableKeyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamEncryptionKeyEnableKeyDetails(arg) + case .teamEncryptionKeyRotateKeyDetails(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyRotateKeyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamEncryptionKeyRotateKeyDetails(arg) + case .teamEncryptionKeyScheduleKeyDeletionDetails(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamEncryptionKeyScheduleKeyDeletionDetails(arg) + case .applyNamingConventionDetails(let swiftArg): + let arg = DBXTeamLogApplyNamingConventionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsApplyNamingConventionDetails(arg) + case .createFolderDetails(let swiftArg): + let arg = DBXTeamLogCreateFolderDetails(swift: swiftArg) + return DBXTeamLogEventDetailsCreateFolderDetails(arg) + case .fileAddDetails(let swiftArg): + let arg = DBXTeamLogFileAddDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileAddDetails(arg) + case .fileAddFromAutomationDetails(let swiftArg): + let arg = DBXTeamLogFileAddFromAutomationDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileAddFromAutomationDetails(arg) + case .fileCopyDetails(let swiftArg): + let arg = DBXTeamLogFileCopyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileCopyDetails(arg) + case .fileDeleteDetails(let swiftArg): + let arg = DBXTeamLogFileDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileDeleteDetails(arg) + case .fileDownloadDetails(let swiftArg): + let arg = DBXTeamLogFileDownloadDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileDownloadDetails(arg) + case .fileEditDetails(let swiftArg): + let arg = DBXTeamLogFileEditDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileEditDetails(arg) + case .fileGetCopyReferenceDetails(let swiftArg): + let arg = DBXTeamLogFileGetCopyReferenceDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileGetCopyReferenceDetails(arg) + case .fileLockingLockStatusChangedDetails(let swiftArg): + let arg = DBXTeamLogFileLockingLockStatusChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileLockingLockStatusChangedDetails(arg) + case .fileMoveDetails(let swiftArg): + let arg = DBXTeamLogFileMoveDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileMoveDetails(arg) + case .filePermanentlyDeleteDetails(let swiftArg): + let arg = DBXTeamLogFilePermanentlyDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFilePermanentlyDeleteDetails(arg) + case .filePreviewDetails(let swiftArg): + let arg = DBXTeamLogFilePreviewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFilePreviewDetails(arg) + case .fileRenameDetails(let swiftArg): + let arg = DBXTeamLogFileRenameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRenameDetails(arg) + case .fileRestoreDetails(let swiftArg): + let arg = DBXTeamLogFileRestoreDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRestoreDetails(arg) + case .fileRevertDetails(let swiftArg): + let arg = DBXTeamLogFileRevertDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRevertDetails(arg) + case .fileRollbackChangesDetails(let swiftArg): + let arg = DBXTeamLogFileRollbackChangesDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRollbackChangesDetails(arg) + case .fileSaveCopyReferenceDetails(let swiftArg): + let arg = DBXTeamLogFileSaveCopyReferenceDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileSaveCopyReferenceDetails(arg) + case .folderOverviewDescriptionChangedDetails(let swiftArg): + let arg = DBXTeamLogFolderOverviewDescriptionChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFolderOverviewDescriptionChangedDetails(arg) + case .folderOverviewItemPinnedDetails(let swiftArg): + let arg = DBXTeamLogFolderOverviewItemPinnedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFolderOverviewItemPinnedDetails(arg) + case .folderOverviewItemUnpinnedDetails(let swiftArg): + let arg = DBXTeamLogFolderOverviewItemUnpinnedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFolderOverviewItemUnpinnedDetails(arg) + case .objectLabelAddedDetails(let swiftArg): + let arg = DBXTeamLogObjectLabelAddedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsObjectLabelAddedDetails(arg) + case .objectLabelRemovedDetails(let swiftArg): + let arg = DBXTeamLogObjectLabelRemovedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsObjectLabelRemovedDetails(arg) + case .objectLabelUpdatedValueDetails(let swiftArg): + let arg = DBXTeamLogObjectLabelUpdatedValueDetails(swift: swiftArg) + return DBXTeamLogEventDetailsObjectLabelUpdatedValueDetails(arg) + case .organizeFolderWithTidyDetails(let swiftArg): + let arg = DBXTeamLogOrganizeFolderWithTidyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsOrganizeFolderWithTidyDetails(arg) + case .replayFileDeleteDetails(let swiftArg): + let arg = DBXTeamLogReplayFileDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsReplayFileDeleteDetails(arg) + case .rewindFolderDetails(let swiftArg): + let arg = DBXTeamLogRewindFolderDetails(swift: swiftArg) + return DBXTeamLogEventDetailsRewindFolderDetails(arg) + case .undoNamingConventionDetails(let swiftArg): + let arg = DBXTeamLogUndoNamingConventionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsUndoNamingConventionDetails(arg) + case .undoOrganizeFolderWithTidyDetails(let swiftArg): + let arg = DBXTeamLogUndoOrganizeFolderWithTidyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsUndoOrganizeFolderWithTidyDetails(arg) + case .userTagsAddedDetails(let swiftArg): + let arg = DBXTeamLogUserTagsAddedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsUserTagsAddedDetails(arg) + case .userTagsRemovedDetails(let swiftArg): + let arg = DBXTeamLogUserTagsRemovedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsUserTagsRemovedDetails(arg) + case .emailIngestReceiveFileDetails(let swiftArg): + let arg = DBXTeamLogEmailIngestReceiveFileDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmailIngestReceiveFileDetails(arg) + case .fileRequestChangeDetails(let swiftArg): + let arg = DBXTeamLogFileRequestChangeDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestChangeDetails(arg) + case .fileRequestCloseDetails(let swiftArg): + let arg = DBXTeamLogFileRequestCloseDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestCloseDetails(arg) + case .fileRequestCreateDetails(let swiftArg): + let arg = DBXTeamLogFileRequestCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestCreateDetails(arg) + case .fileRequestDeleteDetails(let swiftArg): + let arg = DBXTeamLogFileRequestDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestDeleteDetails(arg) + case .fileRequestReceiveFileDetails(let swiftArg): + let arg = DBXTeamLogFileRequestReceiveFileDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestReceiveFileDetails(arg) + case .groupAddExternalIdDetails(let swiftArg): + let arg = DBXTeamLogGroupAddExternalIdDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupAddExternalIdDetails(arg) + case .groupAddMemberDetails(let swiftArg): + let arg = DBXTeamLogGroupAddMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupAddMemberDetails(arg) + case .groupChangeExternalIdDetails(let swiftArg): + let arg = DBXTeamLogGroupChangeExternalIdDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupChangeExternalIdDetails(arg) + case .groupChangeManagementTypeDetails(let swiftArg): + let arg = DBXTeamLogGroupChangeManagementTypeDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupChangeManagementTypeDetails(arg) + case .groupChangeMemberRoleDetails(let swiftArg): + let arg = DBXTeamLogGroupChangeMemberRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupChangeMemberRoleDetails(arg) + case .groupCreateDetails(let swiftArg): + let arg = DBXTeamLogGroupCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupCreateDetails(arg) + case .groupDeleteDetails(let swiftArg): + let arg = DBXTeamLogGroupDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupDeleteDetails(arg) + case .groupDescriptionUpdatedDetails(let swiftArg): + let arg = DBXTeamLogGroupDescriptionUpdatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupDescriptionUpdatedDetails(arg) + case .groupJoinPolicyUpdatedDetails(let swiftArg): + let arg = DBXTeamLogGroupJoinPolicyUpdatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupJoinPolicyUpdatedDetails(arg) + case .groupMovedDetails(let swiftArg): + let arg = DBXTeamLogGroupMovedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupMovedDetails(arg) + case .groupRemoveExternalIdDetails(let swiftArg): + let arg = DBXTeamLogGroupRemoveExternalIdDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupRemoveExternalIdDetails(arg) + case .groupRemoveMemberDetails(let swiftArg): + let arg = DBXTeamLogGroupRemoveMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupRemoveMemberDetails(arg) + case .groupRenameDetails(let swiftArg): + let arg = DBXTeamLogGroupRenameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupRenameDetails(arg) + case .accountLockOrUnlockedDetails(let swiftArg): + let arg = DBXTeamLogAccountLockOrUnlockedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAccountLockOrUnlockedDetails(arg) + case .emmErrorDetails(let swiftArg): + let arg = DBXTeamLogEmmErrorDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmmErrorDetails(arg) + case .guestAdminSignedInViaTrustedTeamsDetails(let swiftArg): + let arg = DBXTeamLogGuestAdminSignedInViaTrustedTeamsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGuestAdminSignedInViaTrustedTeamsDetails(arg) + case .guestAdminSignedOutViaTrustedTeamsDetails(let swiftArg): + let arg = DBXTeamLogGuestAdminSignedOutViaTrustedTeamsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGuestAdminSignedOutViaTrustedTeamsDetails(arg) + case .loginFailDetails(let swiftArg): + let arg = DBXTeamLogLoginFailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLoginFailDetails(arg) + case .loginSuccessDetails(let swiftArg): + let arg = DBXTeamLogLoginSuccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLoginSuccessDetails(arg) + case .logoutDetails(let swiftArg): + let arg = DBXTeamLogLogoutDetails(swift: swiftArg) + return DBXTeamLogEventDetailsLogoutDetails(arg) + case .resellerSupportSessionEndDetails(let swiftArg): + let arg = DBXTeamLogResellerSupportSessionEndDetails(swift: swiftArg) + return DBXTeamLogEventDetailsResellerSupportSessionEndDetails(arg) + case .resellerSupportSessionStartDetails(let swiftArg): + let arg = DBXTeamLogResellerSupportSessionStartDetails(swift: swiftArg) + return DBXTeamLogEventDetailsResellerSupportSessionStartDetails(arg) + case .signInAsSessionEndDetails(let swiftArg): + let arg = DBXTeamLogSignInAsSessionEndDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSignInAsSessionEndDetails(arg) + case .signInAsSessionStartDetails(let swiftArg): + let arg = DBXTeamLogSignInAsSessionStartDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSignInAsSessionStartDetails(arg) + case .ssoErrorDetails(let swiftArg): + let arg = DBXTeamLogSsoErrorDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoErrorDetails(arg) + case .backupAdminInvitationSentDetails(let swiftArg): + let arg = DBXTeamLogBackupAdminInvitationSentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBackupAdminInvitationSentDetails(arg) + case .backupInvitationOpenedDetails(let swiftArg): + let arg = DBXTeamLogBackupInvitationOpenedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBackupInvitationOpenedDetails(arg) + case .createTeamInviteLinkDetails(let swiftArg): + let arg = DBXTeamLogCreateTeamInviteLinkDetails(swift: swiftArg) + return DBXTeamLogEventDetailsCreateTeamInviteLinkDetails(arg) + case .deleteTeamInviteLinkDetails(let swiftArg): + let arg = DBXTeamLogDeleteTeamInviteLinkDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeleteTeamInviteLinkDetails(arg) + case .memberAddExternalIdDetails(let swiftArg): + let arg = DBXTeamLogMemberAddExternalIdDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberAddExternalIdDetails(arg) + case .memberAddNameDetails(let swiftArg): + let arg = DBXTeamLogMemberAddNameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberAddNameDetails(arg) + case .memberChangeAdminRoleDetails(let swiftArg): + let arg = DBXTeamLogMemberChangeAdminRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberChangeAdminRoleDetails(arg) + case .memberChangeEmailDetails(let swiftArg): + let arg = DBXTeamLogMemberChangeEmailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberChangeEmailDetails(arg) + case .memberChangeExternalIdDetails(let swiftArg): + let arg = DBXTeamLogMemberChangeExternalIdDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberChangeExternalIdDetails(arg) + case .memberChangeMembershipTypeDetails(let swiftArg): + let arg = DBXTeamLogMemberChangeMembershipTypeDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberChangeMembershipTypeDetails(arg) + case .memberChangeNameDetails(let swiftArg): + let arg = DBXTeamLogMemberChangeNameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberChangeNameDetails(arg) + case .memberChangeResellerRoleDetails(let swiftArg): + let arg = DBXTeamLogMemberChangeResellerRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberChangeResellerRoleDetails(arg) + case .memberChangeStatusDetails(let swiftArg): + let arg = DBXTeamLogMemberChangeStatusDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberChangeStatusDetails(arg) + case .memberDeleteManualContactsDetails(let swiftArg): + let arg = DBXTeamLogMemberDeleteManualContactsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberDeleteManualContactsDetails(arg) + case .memberDeleteProfilePhotoDetails(let swiftArg): + let arg = DBXTeamLogMemberDeleteProfilePhotoDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberDeleteProfilePhotoDetails(arg) + case .memberPermanentlyDeleteAccountContentsDetails(let swiftArg): + let arg = DBXTeamLogMemberPermanentlyDeleteAccountContentsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberPermanentlyDeleteAccountContentsDetails(arg) + case .memberRemoveExternalIdDetails(let swiftArg): + let arg = DBXTeamLogMemberRemoveExternalIdDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberRemoveExternalIdDetails(arg) + case .memberSetProfilePhotoDetails(let swiftArg): + let arg = DBXTeamLogMemberSetProfilePhotoDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSetProfilePhotoDetails(arg) + case .memberSpaceLimitsAddCustomQuotaDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsAddCustomQuotaDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsAddCustomQuotaDetails(arg) + case .memberSpaceLimitsChangeCustomQuotaDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangeCustomQuotaDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsChangeCustomQuotaDetails(arg) + case .memberSpaceLimitsChangeStatusDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangeStatusDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsChangeStatusDetails(arg) + case .memberSpaceLimitsRemoveCustomQuotaDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsRemoveCustomQuotaDetails(arg) + case .memberSuggestDetails(let swiftArg): + let arg = DBXTeamLogMemberSuggestDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSuggestDetails(arg) + case .memberTransferAccountContentsDetails(let swiftArg): + let arg = DBXTeamLogMemberTransferAccountContentsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberTransferAccountContentsDetails(arg) + case .pendingSecondaryEmailAddedDetails(let swiftArg): + let arg = DBXTeamLogPendingSecondaryEmailAddedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPendingSecondaryEmailAddedDetails(arg) + case .secondaryEmailDeletedDetails(let swiftArg): + let arg = DBXTeamLogSecondaryEmailDeletedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSecondaryEmailDeletedDetails(arg) + case .secondaryEmailVerifiedDetails(let swiftArg): + let arg = DBXTeamLogSecondaryEmailVerifiedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSecondaryEmailVerifiedDetails(arg) + case .secondaryMailsPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogSecondaryMailsPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSecondaryMailsPolicyChangedDetails(arg) + case .binderAddPageDetails(let swiftArg): + let arg = DBXTeamLogBinderAddPageDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderAddPageDetails(arg) + case .binderAddSectionDetails(let swiftArg): + let arg = DBXTeamLogBinderAddSectionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderAddSectionDetails(arg) + case .binderRemovePageDetails(let swiftArg): + let arg = DBXTeamLogBinderRemovePageDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderRemovePageDetails(arg) + case .binderRemoveSectionDetails(let swiftArg): + let arg = DBXTeamLogBinderRemoveSectionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderRemoveSectionDetails(arg) + case .binderRenamePageDetails(let swiftArg): + let arg = DBXTeamLogBinderRenamePageDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderRenamePageDetails(arg) + case .binderRenameSectionDetails(let swiftArg): + let arg = DBXTeamLogBinderRenameSectionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderRenameSectionDetails(arg) + case .binderReorderPageDetails(let swiftArg): + let arg = DBXTeamLogBinderReorderPageDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderReorderPageDetails(arg) + case .binderReorderSectionDetails(let swiftArg): + let arg = DBXTeamLogBinderReorderSectionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsBinderReorderSectionDetails(arg) + case .paperContentAddMemberDetails(let swiftArg): + let arg = DBXTeamLogPaperContentAddMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentAddMemberDetails(arg) + case .paperContentAddToFolderDetails(let swiftArg): + let arg = DBXTeamLogPaperContentAddToFolderDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentAddToFolderDetails(arg) + case .paperContentArchiveDetails(let swiftArg): + let arg = DBXTeamLogPaperContentArchiveDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentArchiveDetails(arg) + case .paperContentCreateDetails(let swiftArg): + let arg = DBXTeamLogPaperContentCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentCreateDetails(arg) + case .paperContentPermanentlyDeleteDetails(let swiftArg): + let arg = DBXTeamLogPaperContentPermanentlyDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentPermanentlyDeleteDetails(arg) + case .paperContentRemoveFromFolderDetails(let swiftArg): + let arg = DBXTeamLogPaperContentRemoveFromFolderDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentRemoveFromFolderDetails(arg) + case .paperContentRemoveMemberDetails(let swiftArg): + let arg = DBXTeamLogPaperContentRemoveMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentRemoveMemberDetails(arg) + case .paperContentRenameDetails(let swiftArg): + let arg = DBXTeamLogPaperContentRenameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentRenameDetails(arg) + case .paperContentRestoreDetails(let swiftArg): + let arg = DBXTeamLogPaperContentRestoreDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperContentRestoreDetails(arg) + case .paperDocAddCommentDetails(let swiftArg): + let arg = DBXTeamLogPaperDocAddCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocAddCommentDetails(arg) + case .paperDocChangeMemberRoleDetails(let swiftArg): + let arg = DBXTeamLogPaperDocChangeMemberRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocChangeMemberRoleDetails(arg) + case .paperDocChangeSharingPolicyDetails(let swiftArg): + let arg = DBXTeamLogPaperDocChangeSharingPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocChangeSharingPolicyDetails(arg) + case .paperDocChangeSubscriptionDetails(let swiftArg): + let arg = DBXTeamLogPaperDocChangeSubscriptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocChangeSubscriptionDetails(arg) + case .paperDocDeletedDetails(let swiftArg): + let arg = DBXTeamLogPaperDocDeletedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocDeletedDetails(arg) + case .paperDocDeleteCommentDetails(let swiftArg): + let arg = DBXTeamLogPaperDocDeleteCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocDeleteCommentDetails(arg) + case .paperDocDownloadDetails(let swiftArg): + let arg = DBXTeamLogPaperDocDownloadDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocDownloadDetails(arg) + case .paperDocEditDetails(let swiftArg): + let arg = DBXTeamLogPaperDocEditDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocEditDetails(arg) + case .paperDocEditCommentDetails(let swiftArg): + let arg = DBXTeamLogPaperDocEditCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocEditCommentDetails(arg) + case .paperDocFollowedDetails(let swiftArg): + let arg = DBXTeamLogPaperDocFollowedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocFollowedDetails(arg) + case .paperDocMentionDetails(let swiftArg): + let arg = DBXTeamLogPaperDocMentionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocMentionDetails(arg) + case .paperDocOwnershipChangedDetails(let swiftArg): + let arg = DBXTeamLogPaperDocOwnershipChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocOwnershipChangedDetails(arg) + case .paperDocRequestAccessDetails(let swiftArg): + let arg = DBXTeamLogPaperDocRequestAccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocRequestAccessDetails(arg) + case .paperDocResolveCommentDetails(let swiftArg): + let arg = DBXTeamLogPaperDocResolveCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocResolveCommentDetails(arg) + case .paperDocRevertDetails(let swiftArg): + let arg = DBXTeamLogPaperDocRevertDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocRevertDetails(arg) + case .paperDocSlackShareDetails(let swiftArg): + let arg = DBXTeamLogPaperDocSlackShareDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocSlackShareDetails(arg) + case .paperDocTeamInviteDetails(let swiftArg): + let arg = DBXTeamLogPaperDocTeamInviteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocTeamInviteDetails(arg) + case .paperDocTrashedDetails(let swiftArg): + let arg = DBXTeamLogPaperDocTrashedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocTrashedDetails(arg) + case .paperDocUnresolveCommentDetails(let swiftArg): + let arg = DBXTeamLogPaperDocUnresolveCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocUnresolveCommentDetails(arg) + case .paperDocUntrashedDetails(let swiftArg): + let arg = DBXTeamLogPaperDocUntrashedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocUntrashedDetails(arg) + case .paperDocViewDetails(let swiftArg): + let arg = DBXTeamLogPaperDocViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDocViewDetails(arg) + case .paperExternalViewAllowDetails(let swiftArg): + let arg = DBXTeamLogPaperExternalViewAllowDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperExternalViewAllowDetails(arg) + case .paperExternalViewDefaultTeamDetails(let swiftArg): + let arg = DBXTeamLogPaperExternalViewDefaultTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperExternalViewDefaultTeamDetails(arg) + case .paperExternalViewForbidDetails(let swiftArg): + let arg = DBXTeamLogPaperExternalViewForbidDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperExternalViewForbidDetails(arg) + case .paperFolderChangeSubscriptionDetails(let swiftArg): + let arg = DBXTeamLogPaperFolderChangeSubscriptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperFolderChangeSubscriptionDetails(arg) + case .paperFolderDeletedDetails(let swiftArg): + let arg = DBXTeamLogPaperFolderDeletedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperFolderDeletedDetails(arg) + case .paperFolderFollowedDetails(let swiftArg): + let arg = DBXTeamLogPaperFolderFollowedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperFolderFollowedDetails(arg) + case .paperFolderTeamInviteDetails(let swiftArg): + let arg = DBXTeamLogPaperFolderTeamInviteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperFolderTeamInviteDetails(arg) + case .paperPublishedLinkChangePermissionDetails(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkChangePermissionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperPublishedLinkChangePermissionDetails(arg) + case .paperPublishedLinkCreateDetails(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperPublishedLinkCreateDetails(arg) + case .paperPublishedLinkDisabledDetails(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkDisabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperPublishedLinkDisabledDetails(arg) + case .paperPublishedLinkViewDetails(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperPublishedLinkViewDetails(arg) + case .passwordChangeDetails(let swiftArg): + let arg = DBXTeamLogPasswordChangeDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPasswordChangeDetails(arg) + case .passwordResetDetails(let swiftArg): + let arg = DBXTeamLogPasswordResetDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPasswordResetDetails(arg) + case .passwordResetAllDetails(let swiftArg): + let arg = DBXTeamLogPasswordResetAllDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPasswordResetAllDetails(arg) + case .classificationCreateReportDetails(let swiftArg): + let arg = DBXTeamLogClassificationCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsClassificationCreateReportDetails(arg) + case .classificationCreateReportFailDetails(let swiftArg): + let arg = DBXTeamLogClassificationCreateReportFailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsClassificationCreateReportFailDetails(arg) + case .emmCreateExceptionsReportDetails(let swiftArg): + let arg = DBXTeamLogEmmCreateExceptionsReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmmCreateExceptionsReportDetails(arg) + case .emmCreateUsageReportDetails(let swiftArg): + let arg = DBXTeamLogEmmCreateUsageReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmmCreateUsageReportDetails(arg) + case .exportMembersReportDetails(let swiftArg): + let arg = DBXTeamLogExportMembersReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExportMembersReportDetails(arg) + case .exportMembersReportFailDetails(let swiftArg): + let arg = DBXTeamLogExportMembersReportFailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExportMembersReportFailDetails(arg) + case .externalSharingCreateReportDetails(let swiftArg): + let arg = DBXTeamLogExternalSharingCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExternalSharingCreateReportDetails(arg) + case .externalSharingReportFailedDetails(let swiftArg): + let arg = DBXTeamLogExternalSharingReportFailedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExternalSharingReportFailedDetails(arg) + case .noExpirationLinkGenCreateReportDetails(let swiftArg): + let arg = DBXTeamLogNoExpirationLinkGenCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoExpirationLinkGenCreateReportDetails(arg) + case .noExpirationLinkGenReportFailedDetails(let swiftArg): + let arg = DBXTeamLogNoExpirationLinkGenReportFailedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoExpirationLinkGenReportFailedDetails(arg) + case .noPasswordLinkGenCreateReportDetails(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkGenCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoPasswordLinkGenCreateReportDetails(arg) + case .noPasswordLinkGenReportFailedDetails(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkGenReportFailedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoPasswordLinkGenReportFailedDetails(arg) + case .noPasswordLinkViewCreateReportDetails(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkViewCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoPasswordLinkViewCreateReportDetails(arg) + case .noPasswordLinkViewReportFailedDetails(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkViewReportFailedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoPasswordLinkViewReportFailedDetails(arg) + case .outdatedLinkViewCreateReportDetails(let swiftArg): + let arg = DBXTeamLogOutdatedLinkViewCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsOutdatedLinkViewCreateReportDetails(arg) + case .outdatedLinkViewReportFailedDetails(let swiftArg): + let arg = DBXTeamLogOutdatedLinkViewReportFailedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsOutdatedLinkViewReportFailedDetails(arg) + case .paperAdminExportStartDetails(let swiftArg): + let arg = DBXTeamLogPaperAdminExportStartDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperAdminExportStartDetails(arg) + case .ransomwareAlertCreateReportDetails(let swiftArg): + let arg = DBXTeamLogRansomwareAlertCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsRansomwareAlertCreateReportDetails(arg) + case .ransomwareAlertCreateReportFailedDetails(let swiftArg): + let arg = DBXTeamLogRansomwareAlertCreateReportFailedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsRansomwareAlertCreateReportFailedDetails(arg) + case .smartSyncCreateAdminPrivilegeReportDetails(let swiftArg): + let arg = DBXTeamLogSmartSyncCreateAdminPrivilegeReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSmartSyncCreateAdminPrivilegeReportDetails(arg) + case .teamActivityCreateReportDetails(let swiftArg): + let arg = DBXTeamLogTeamActivityCreateReportDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamActivityCreateReportDetails(arg) + case .teamActivityCreateReportFailDetails(let swiftArg): + let arg = DBXTeamLogTeamActivityCreateReportFailDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamActivityCreateReportFailDetails(arg) + case .collectionShareDetails(let swiftArg): + let arg = DBXTeamLogCollectionShareDetails(swift: swiftArg) + return DBXTeamLogEventDetailsCollectionShareDetails(arg) + case .fileTransfersFileAddDetails(let swiftArg): + let arg = DBXTeamLogFileTransfersFileAddDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileTransfersFileAddDetails(arg) + case .fileTransfersTransferDeleteDetails(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileTransfersTransferDeleteDetails(arg) + case .fileTransfersTransferDownloadDetails(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferDownloadDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileTransfersTransferDownloadDetails(arg) + case .fileTransfersTransferSendDetails(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferSendDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileTransfersTransferSendDetails(arg) + case .fileTransfersTransferViewDetails(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileTransfersTransferViewDetails(arg) + case .noteAclInviteOnlyDetails(let swiftArg): + let arg = DBXTeamLogNoteAclInviteOnlyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoteAclInviteOnlyDetails(arg) + case .noteAclLinkDetails(let swiftArg): + let arg = DBXTeamLogNoteAclLinkDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoteAclLinkDetails(arg) + case .noteAclTeamLinkDetails(let swiftArg): + let arg = DBXTeamLogNoteAclTeamLinkDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoteAclTeamLinkDetails(arg) + case .noteSharedDetails(let swiftArg): + let arg = DBXTeamLogNoteSharedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoteSharedDetails(arg) + case .noteShareReceiveDetails(let swiftArg): + let arg = DBXTeamLogNoteShareReceiveDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNoteShareReceiveDetails(arg) + case .openNoteSharedDetails(let swiftArg): + let arg = DBXTeamLogOpenNoteSharedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsOpenNoteSharedDetails(arg) + case .replayFileSharedLinkCreatedDetails(let swiftArg): + let arg = DBXTeamLogReplayFileSharedLinkCreatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsReplayFileSharedLinkCreatedDetails(arg) + case .replayFileSharedLinkModifiedDetails(let swiftArg): + let arg = DBXTeamLogReplayFileSharedLinkModifiedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsReplayFileSharedLinkModifiedDetails(arg) + case .replayProjectTeamAddDetails(let swiftArg): + let arg = DBXTeamLogReplayProjectTeamAddDetails(swift: swiftArg) + return DBXTeamLogEventDetailsReplayProjectTeamAddDetails(arg) + case .replayProjectTeamDeleteDetails(let swiftArg): + let arg = DBXTeamLogReplayProjectTeamDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsReplayProjectTeamDeleteDetails(arg) + case .sfAddGroupDetails(let swiftArg): + let arg = DBXTeamLogSfAddGroupDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfAddGroupDetails(arg) + case .sfAllowNonMembersToViewSharedLinksDetails(let swiftArg): + let arg = DBXTeamLogSfAllowNonMembersToViewSharedLinksDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfAllowNonMembersToViewSharedLinksDetails(arg) + case .sfExternalInviteWarnDetails(let swiftArg): + let arg = DBXTeamLogSfExternalInviteWarnDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfExternalInviteWarnDetails(arg) + case .sfFbInviteDetails(let swiftArg): + let arg = DBXTeamLogSfFbInviteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfFbInviteDetails(arg) + case .sfFbInviteChangeRoleDetails(let swiftArg): + let arg = DBXTeamLogSfFbInviteChangeRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfFbInviteChangeRoleDetails(arg) + case .sfFbUninviteDetails(let swiftArg): + let arg = DBXTeamLogSfFbUninviteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfFbUninviteDetails(arg) + case .sfInviteGroupDetails(let swiftArg): + let arg = DBXTeamLogSfInviteGroupDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfInviteGroupDetails(arg) + case .sfTeamGrantAccessDetails(let swiftArg): + let arg = DBXTeamLogSfTeamGrantAccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfTeamGrantAccessDetails(arg) + case .sfTeamInviteDetails(let swiftArg): + let arg = DBXTeamLogSfTeamInviteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfTeamInviteDetails(arg) + case .sfTeamInviteChangeRoleDetails(let swiftArg): + let arg = DBXTeamLogSfTeamInviteChangeRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfTeamInviteChangeRoleDetails(arg) + case .sfTeamJoinDetails(let swiftArg): + let arg = DBXTeamLogSfTeamJoinDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfTeamJoinDetails(arg) + case .sfTeamJoinFromOobLinkDetails(let swiftArg): + let arg = DBXTeamLogSfTeamJoinFromOobLinkDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfTeamJoinFromOobLinkDetails(arg) + case .sfTeamUninviteDetails(let swiftArg): + let arg = DBXTeamLogSfTeamUninviteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSfTeamUninviteDetails(arg) + case .sharedContentAddInviteesDetails(let swiftArg): + let arg = DBXTeamLogSharedContentAddInviteesDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentAddInviteesDetails(arg) + case .sharedContentAddLinkExpiryDetails(let swiftArg): + let arg = DBXTeamLogSharedContentAddLinkExpiryDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentAddLinkExpiryDetails(arg) + case .sharedContentAddLinkPasswordDetails(let swiftArg): + let arg = DBXTeamLogSharedContentAddLinkPasswordDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentAddLinkPasswordDetails(arg) + case .sharedContentAddMemberDetails(let swiftArg): + let arg = DBXTeamLogSharedContentAddMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentAddMemberDetails(arg) + case .sharedContentChangeDownloadsPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharedContentChangeDownloadsPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentChangeDownloadsPolicyDetails(arg) + case .sharedContentChangeInviteeRoleDetails(let swiftArg): + let arg = DBXTeamLogSharedContentChangeInviteeRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentChangeInviteeRoleDetails(arg) + case .sharedContentChangeLinkAudienceDetails(let swiftArg): + let arg = DBXTeamLogSharedContentChangeLinkAudienceDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentChangeLinkAudienceDetails(arg) + case .sharedContentChangeLinkExpiryDetails(let swiftArg): + let arg = DBXTeamLogSharedContentChangeLinkExpiryDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentChangeLinkExpiryDetails(arg) + case .sharedContentChangeLinkPasswordDetails(let swiftArg): + let arg = DBXTeamLogSharedContentChangeLinkPasswordDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentChangeLinkPasswordDetails(arg) + case .sharedContentChangeMemberRoleDetails(let swiftArg): + let arg = DBXTeamLogSharedContentChangeMemberRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentChangeMemberRoleDetails(arg) + case .sharedContentChangeViewerInfoPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharedContentChangeViewerInfoPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentChangeViewerInfoPolicyDetails(arg) + case .sharedContentClaimInvitationDetails(let swiftArg): + let arg = DBXTeamLogSharedContentClaimInvitationDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentClaimInvitationDetails(arg) + case .sharedContentCopyDetails(let swiftArg): + let arg = DBXTeamLogSharedContentCopyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentCopyDetails(arg) + case .sharedContentDownloadDetails(let swiftArg): + let arg = DBXTeamLogSharedContentDownloadDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentDownloadDetails(arg) + case .sharedContentRelinquishMembershipDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRelinquishMembershipDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRelinquishMembershipDetails(arg) + case .sharedContentRemoveInviteesDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveInviteesDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRemoveInviteesDetails(arg) + case .sharedContentRemoveLinkExpiryDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveLinkExpiryDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRemoveLinkExpiryDetails(arg) + case .sharedContentRemoveLinkPasswordDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveLinkPasswordDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRemoveLinkPasswordDetails(arg) + case .sharedContentRemoveMemberDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRemoveMemberDetails(arg) + case .sharedContentRequestAccessDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRequestAccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRequestAccessDetails(arg) + case .sharedContentRestoreInviteesDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRestoreInviteesDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRestoreInviteesDetails(arg) + case .sharedContentRestoreMemberDetails(let swiftArg): + let arg = DBXTeamLogSharedContentRestoreMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentRestoreMemberDetails(arg) + case .sharedContentUnshareDetails(let swiftArg): + let arg = DBXTeamLogSharedContentUnshareDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentUnshareDetails(arg) + case .sharedContentViewDetails(let swiftArg): + let arg = DBXTeamLogSharedContentViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedContentViewDetails(arg) + case .sharedFolderChangeLinkPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeLinkPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderChangeLinkPolicyDetails(arg) + case .sharedFolderChangeMembersInheritancePolicyDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeMembersInheritancePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderChangeMembersInheritancePolicyDetails(arg) + case .sharedFolderChangeMembersManagementPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeMembersManagementPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderChangeMembersManagementPolicyDetails(arg) + case .sharedFolderChangeMembersPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeMembersPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderChangeMembersPolicyDetails(arg) + case .sharedFolderCreateDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderCreateDetails(arg) + case .sharedFolderDeclineInvitationDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderDeclineInvitationDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderDeclineInvitationDetails(arg) + case .sharedFolderMountDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderMountDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderMountDetails(arg) + case .sharedFolderNestDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderNestDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderNestDetails(arg) + case .sharedFolderTransferOwnershipDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderTransferOwnershipDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderTransferOwnershipDetails(arg) + case .sharedFolderUnmountDetails(let swiftArg): + let arg = DBXTeamLogSharedFolderUnmountDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedFolderUnmountDetails(arg) + case .sharedLinkAddExpiryDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkAddExpiryDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkAddExpiryDetails(arg) + case .sharedLinkChangeExpiryDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkChangeExpiryDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkChangeExpiryDetails(arg) + case .sharedLinkChangeVisibilityDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkChangeVisibilityDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkChangeVisibilityDetails(arg) + case .sharedLinkCopyDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkCopyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkCopyDetails(arg) + case .sharedLinkCreateDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkCreateDetails(arg) + case .sharedLinkDisableDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkDisableDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkDisableDetails(arg) + case .sharedLinkDownloadDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkDownloadDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkDownloadDetails(arg) + case .sharedLinkRemoveExpiryDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkRemoveExpiryDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkRemoveExpiryDetails(arg) + case .sharedLinkSettingsAddExpirationDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAddExpirationDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsAddExpirationDetails(arg) + case .sharedLinkSettingsAddPasswordDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAddPasswordDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsAddPasswordDetails(arg) + case .sharedLinkSettingsAllowDownloadDisabledDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAllowDownloadDisabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadDisabledDetails(arg) + case .sharedLinkSettingsAllowDownloadEnabledDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAllowDownloadEnabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadEnabledDetails(arg) + case .sharedLinkSettingsChangeAudienceDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsChangeAudienceDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsChangeAudienceDetails(arg) + case .sharedLinkSettingsChangeExpirationDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsChangeExpirationDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsChangeExpirationDetails(arg) + case .sharedLinkSettingsChangePasswordDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsChangePasswordDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsChangePasswordDetails(arg) + case .sharedLinkSettingsRemoveExpirationDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsRemoveExpirationDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsRemoveExpirationDetails(arg) + case .sharedLinkSettingsRemovePasswordDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsRemovePasswordDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkSettingsRemovePasswordDetails(arg) + case .sharedLinkShareDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkShareDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkShareDetails(arg) + case .sharedLinkViewDetails(let swiftArg): + let arg = DBXTeamLogSharedLinkViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedLinkViewDetails(arg) + case .sharedNoteOpenedDetails(let swiftArg): + let arg = DBXTeamLogSharedNoteOpenedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharedNoteOpenedDetails(arg) + case .shmodelDisableDownloadsDetails(let swiftArg): + let arg = DBXTeamLogShmodelDisableDownloadsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShmodelDisableDownloadsDetails(arg) + case .shmodelEnableDownloadsDetails(let swiftArg): + let arg = DBXTeamLogShmodelEnableDownloadsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShmodelEnableDownloadsDetails(arg) + case .shmodelGroupShareDetails(let swiftArg): + let arg = DBXTeamLogShmodelGroupShareDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShmodelGroupShareDetails(arg) + case .showcaseAccessGrantedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseAccessGrantedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseAccessGrantedDetails(arg) + case .showcaseAddMemberDetails(let swiftArg): + let arg = DBXTeamLogShowcaseAddMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseAddMemberDetails(arg) + case .showcaseArchivedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseArchivedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseArchivedDetails(arg) + case .showcaseCreatedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseCreatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseCreatedDetails(arg) + case .showcaseDeleteCommentDetails(let swiftArg): + let arg = DBXTeamLogShowcaseDeleteCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseDeleteCommentDetails(arg) + case .showcaseEditedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseEditedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseEditedDetails(arg) + case .showcaseEditCommentDetails(let swiftArg): + let arg = DBXTeamLogShowcaseEditCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseEditCommentDetails(arg) + case .showcaseFileAddedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseFileAddedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseFileAddedDetails(arg) + case .showcaseFileDownloadDetails(let swiftArg): + let arg = DBXTeamLogShowcaseFileDownloadDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseFileDownloadDetails(arg) + case .showcaseFileRemovedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseFileRemovedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseFileRemovedDetails(arg) + case .showcaseFileViewDetails(let swiftArg): + let arg = DBXTeamLogShowcaseFileViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseFileViewDetails(arg) + case .showcasePermanentlyDeletedDetails(let swiftArg): + let arg = DBXTeamLogShowcasePermanentlyDeletedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcasePermanentlyDeletedDetails(arg) + case .showcasePostCommentDetails(let swiftArg): + let arg = DBXTeamLogShowcasePostCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcasePostCommentDetails(arg) + case .showcaseRemoveMemberDetails(let swiftArg): + let arg = DBXTeamLogShowcaseRemoveMemberDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseRemoveMemberDetails(arg) + case .showcaseRenamedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseRenamedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseRenamedDetails(arg) + case .showcaseRequestAccessDetails(let swiftArg): + let arg = DBXTeamLogShowcaseRequestAccessDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseRequestAccessDetails(arg) + case .showcaseResolveCommentDetails(let swiftArg): + let arg = DBXTeamLogShowcaseResolveCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseResolveCommentDetails(arg) + case .showcaseRestoredDetails(let swiftArg): + let arg = DBXTeamLogShowcaseRestoredDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseRestoredDetails(arg) + case .showcaseTrashedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseTrashedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseTrashedDetails(arg) + case .showcaseTrashedDeprecatedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseTrashedDeprecatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseTrashedDeprecatedDetails(arg) + case .showcaseUnresolveCommentDetails(let swiftArg): + let arg = DBXTeamLogShowcaseUnresolveCommentDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseUnresolveCommentDetails(arg) + case .showcaseUntrashedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseUntrashedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseUntrashedDetails(arg) + case .showcaseUntrashedDeprecatedDetails(let swiftArg): + let arg = DBXTeamLogShowcaseUntrashedDeprecatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseUntrashedDeprecatedDetails(arg) + case .showcaseViewDetails(let swiftArg): + let arg = DBXTeamLogShowcaseViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseViewDetails(arg) + case .ssoAddCertDetails(let swiftArg): + let arg = DBXTeamLogSsoAddCertDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoAddCertDetails(arg) + case .ssoAddLoginUrlDetails(let swiftArg): + let arg = DBXTeamLogSsoAddLoginUrlDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoAddLoginUrlDetails(arg) + case .ssoAddLogoutUrlDetails(let swiftArg): + let arg = DBXTeamLogSsoAddLogoutUrlDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoAddLogoutUrlDetails(arg) + case .ssoChangeCertDetails(let swiftArg): + let arg = DBXTeamLogSsoChangeCertDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoChangeCertDetails(arg) + case .ssoChangeLoginUrlDetails(let swiftArg): + let arg = DBXTeamLogSsoChangeLoginUrlDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoChangeLoginUrlDetails(arg) + case .ssoChangeLogoutUrlDetails(let swiftArg): + let arg = DBXTeamLogSsoChangeLogoutUrlDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoChangeLogoutUrlDetails(arg) + case .ssoChangeSamlIdentityModeDetails(let swiftArg): + let arg = DBXTeamLogSsoChangeSamlIdentityModeDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoChangeSamlIdentityModeDetails(arg) + case .ssoRemoveCertDetails(let swiftArg): + let arg = DBXTeamLogSsoRemoveCertDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoRemoveCertDetails(arg) + case .ssoRemoveLoginUrlDetails(let swiftArg): + let arg = DBXTeamLogSsoRemoveLoginUrlDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoRemoveLoginUrlDetails(arg) + case .ssoRemoveLogoutUrlDetails(let swiftArg): + let arg = DBXTeamLogSsoRemoveLogoutUrlDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoRemoveLogoutUrlDetails(arg) + case .teamFolderChangeStatusDetails(let swiftArg): + let arg = DBXTeamLogTeamFolderChangeStatusDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamFolderChangeStatusDetails(arg) + case .teamFolderCreateDetails(let swiftArg): + let arg = DBXTeamLogTeamFolderCreateDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamFolderCreateDetails(arg) + case .teamFolderDowngradeDetails(let swiftArg): + let arg = DBXTeamLogTeamFolderDowngradeDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamFolderDowngradeDetails(arg) + case .teamFolderPermanentlyDeleteDetails(let swiftArg): + let arg = DBXTeamLogTeamFolderPermanentlyDeleteDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamFolderPermanentlyDeleteDetails(arg) + case .teamFolderRenameDetails(let swiftArg): + let arg = DBXTeamLogTeamFolderRenameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamFolderRenameDetails(arg) + case .teamSelectiveSyncSettingsChangedDetails(let swiftArg): + let arg = DBXTeamLogTeamSelectiveSyncSettingsChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamSelectiveSyncSettingsChangedDetails(arg) + case .accountCaptureChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogAccountCaptureChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAccountCaptureChangePolicyDetails(arg) + case .adminEmailRemindersChangedDetails(let swiftArg): + let arg = DBXTeamLogAdminEmailRemindersChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAdminEmailRemindersChangedDetails(arg) + case .allowDownloadDisabledDetails(let swiftArg): + let arg = DBXTeamLogAllowDownloadDisabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAllowDownloadDisabledDetails(arg) + case .allowDownloadEnabledDetails(let swiftArg): + let arg = DBXTeamLogAllowDownloadEnabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAllowDownloadEnabledDetails(arg) + case .appPermissionsChangedDetails(let swiftArg): + let arg = DBXTeamLogAppPermissionsChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsAppPermissionsChangedDetails(arg) + case .cameraUploadsPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogCameraUploadsPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsCameraUploadsPolicyChangedDetails(arg) + case .captureTranscriptPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogCaptureTranscriptPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsCaptureTranscriptPolicyChangedDetails(arg) + case .classificationChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogClassificationChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsClassificationChangePolicyDetails(arg) + case .computerBackupPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogComputerBackupPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsComputerBackupPolicyChangedDetails(arg) + case .contentAdministrationPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogContentAdministrationPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsContentAdministrationPolicyChangedDetails(arg) + case .dataPlacementRestrictionChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogDataPlacementRestrictionChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDataPlacementRestrictionChangePolicyDetails(arg) + case .dataPlacementRestrictionSatisfyPolicyDetails(let swiftArg): + let arg = DBXTeamLogDataPlacementRestrictionSatisfyPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDataPlacementRestrictionSatisfyPolicyDetails(arg) + case .deviceApprovalsAddExceptionDetails(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsAddExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceApprovalsAddExceptionDetails(arg) + case .deviceApprovalsChangeDesktopPolicyDetails(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeDesktopPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceApprovalsChangeDesktopPolicyDetails(arg) + case .deviceApprovalsChangeMobilePolicyDetails(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeMobilePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceApprovalsChangeMobilePolicyDetails(arg) + case .deviceApprovalsChangeOverageActionDetails(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeOverageActionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceApprovalsChangeOverageActionDetails(arg) + case .deviceApprovalsChangeUnlinkActionDetails(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeUnlinkActionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceApprovalsChangeUnlinkActionDetails(arg) + case .deviceApprovalsRemoveExceptionDetails(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsRemoveExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDeviceApprovalsRemoveExceptionDetails(arg) + case .directoryRestrictionsAddMembersDetails(let swiftArg): + let arg = DBXTeamLogDirectoryRestrictionsAddMembersDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDirectoryRestrictionsAddMembersDetails(arg) + case .directoryRestrictionsRemoveMembersDetails(let swiftArg): + let arg = DBXTeamLogDirectoryRestrictionsRemoveMembersDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDirectoryRestrictionsRemoveMembersDetails(arg) + case .dropboxPasswordsPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogDropboxPasswordsPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDropboxPasswordsPolicyChangedDetails(arg) + case .emailIngestPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogEmailIngestPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmailIngestPolicyChangedDetails(arg) + case .emmAddExceptionDetails(let swiftArg): + let arg = DBXTeamLogEmmAddExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmmAddExceptionDetails(arg) + case .emmChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogEmmChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmmChangePolicyDetails(arg) + case .emmRemoveExceptionDetails(let swiftArg): + let arg = DBXTeamLogEmmRemoveExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEmmRemoveExceptionDetails(arg) + case .extendedVersionHistoryChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogExtendedVersionHistoryChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExtendedVersionHistoryChangePolicyDetails(arg) + case .externalDriveBackupPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogExternalDriveBackupPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsExternalDriveBackupPolicyChangedDetails(arg) + case .fileCommentsChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogFileCommentsChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileCommentsChangePolicyDetails(arg) + case .fileLockingPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogFileLockingPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileLockingPolicyChangedDetails(arg) + case .fileProviderMigrationPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogFileProviderMigrationPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileProviderMigrationPolicyChangedDetails(arg) + case .fileRequestsChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogFileRequestsChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestsChangePolicyDetails(arg) + case .fileRequestsEmailsEnabledDetails(let swiftArg): + let arg = DBXTeamLogFileRequestsEmailsEnabledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestsEmailsEnabledDetails(arg) + case .fileRequestsEmailsRestrictedToTeamOnlyDetails(let swiftArg): + let arg = DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileRequestsEmailsRestrictedToTeamOnlyDetails(arg) + case .fileTransfersPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogFileTransfersPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFileTransfersPolicyChangedDetails(arg) + case .folderLinkRestrictionPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogFolderLinkRestrictionPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsFolderLinkRestrictionPolicyChangedDetails(arg) + case .googleSsoChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogGoogleSsoChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGoogleSsoChangePolicyDetails(arg) + case .groupUserManagementChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogGroupUserManagementChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGroupUserManagementChangePolicyDetails(arg) + case .integrationPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogIntegrationPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsIntegrationPolicyChangedDetails(arg) + case .inviteAcceptanceEmailPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogInviteAcceptanceEmailPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsInviteAcceptanceEmailPolicyChangedDetails(arg) + case .memberRequestsChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogMemberRequestsChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberRequestsChangePolicyDetails(arg) + case .memberSendInvitePolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogMemberSendInvitePolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSendInvitePolicyChangedDetails(arg) + case .memberSpaceLimitsAddExceptionDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsAddExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsAddExceptionDetails(arg) + case .memberSpaceLimitsChangeCapsTypePolicyDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsChangeCapsTypePolicyDetails(arg) + case .memberSpaceLimitsChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsChangePolicyDetails(arg) + case .memberSpaceLimitsRemoveExceptionDetails(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsRemoveExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSpaceLimitsRemoveExceptionDetails(arg) + case .memberSuggestionsChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogMemberSuggestionsChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMemberSuggestionsChangePolicyDetails(arg) + case .microsoftOfficeAddinChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogMicrosoftOfficeAddinChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMicrosoftOfficeAddinChangePolicyDetails(arg) + case .networkControlChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogNetworkControlChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsNetworkControlChangePolicyDetails(arg) + case .paperChangeDeploymentPolicyDetails(let swiftArg): + let arg = DBXTeamLogPaperChangeDeploymentPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperChangeDeploymentPolicyDetails(arg) + case .paperChangeMemberLinkPolicyDetails(let swiftArg): + let arg = DBXTeamLogPaperChangeMemberLinkPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperChangeMemberLinkPolicyDetails(arg) + case .paperChangeMemberPolicyDetails(let swiftArg): + let arg = DBXTeamLogPaperChangeMemberPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperChangeMemberPolicyDetails(arg) + case .paperChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogPaperChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperChangePolicyDetails(arg) + case .paperDefaultFolderPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogPaperDefaultFolderPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDefaultFolderPolicyChangedDetails(arg) + case .paperDesktopPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogPaperDesktopPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperDesktopPolicyChangedDetails(arg) + case .paperEnabledUsersGroupAdditionDetails(let swiftArg): + let arg = DBXTeamLogPaperEnabledUsersGroupAdditionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperEnabledUsersGroupAdditionDetails(arg) + case .paperEnabledUsersGroupRemovalDetails(let swiftArg): + let arg = DBXTeamLogPaperEnabledUsersGroupRemovalDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPaperEnabledUsersGroupRemovalDetails(arg) + case .passwordStrengthRequirementsChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogPasswordStrengthRequirementsChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPasswordStrengthRequirementsChangePolicyDetails(arg) + case .permanentDeleteChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogPermanentDeleteChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsPermanentDeleteChangePolicyDetails(arg) + case .resellerSupportChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogResellerSupportChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsResellerSupportChangePolicyDetails(arg) + case .rewindPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogRewindPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsRewindPolicyChangedDetails(arg) + case .sendForSignaturePolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogSendForSignaturePolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSendForSignaturePolicyChangedDetails(arg) + case .sharingChangeFolderJoinPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharingChangeFolderJoinPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharingChangeFolderJoinPolicyDetails(arg) + case .sharingChangeLinkAllowChangeExpirationPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharingChangeLinkAllowChangeExpirationPolicyDetails(arg) + case .sharingChangeLinkDefaultExpirationPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkDefaultExpirationPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharingChangeLinkDefaultExpirationPolicyDetails(arg) + case .sharingChangeLinkEnforcePasswordPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkEnforcePasswordPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharingChangeLinkEnforcePasswordPolicyDetails(arg) + case .sharingChangeLinkPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharingChangeLinkPolicyDetails(arg) + case .sharingChangeMemberPolicyDetails(let swiftArg): + let arg = DBXTeamLogSharingChangeMemberPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSharingChangeMemberPolicyDetails(arg) + case .showcaseChangeDownloadPolicyDetails(let swiftArg): + let arg = DBXTeamLogShowcaseChangeDownloadPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseChangeDownloadPolicyDetails(arg) + case .showcaseChangeEnabledPolicyDetails(let swiftArg): + let arg = DBXTeamLogShowcaseChangeEnabledPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseChangeEnabledPolicyDetails(arg) + case .showcaseChangeExternalSharingPolicyDetails(let swiftArg): + let arg = DBXTeamLogShowcaseChangeExternalSharingPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsShowcaseChangeExternalSharingPolicyDetails(arg) + case .smarterSmartSyncPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogSmarterSmartSyncPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSmarterSmartSyncPolicyChangedDetails(arg) + case .smartSyncChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogSmartSyncChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSmartSyncChangePolicyDetails(arg) + case .smartSyncNotOptOutDetails(let swiftArg): + let arg = DBXTeamLogSmartSyncNotOptOutDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSmartSyncNotOptOutDetails(arg) + case .smartSyncOptOutDetails(let swiftArg): + let arg = DBXTeamLogSmartSyncOptOutDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSmartSyncOptOutDetails(arg) + case .ssoChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogSsoChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsSsoChangePolicyDetails(arg) + case .teamBrandingPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogTeamBrandingPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamBrandingPolicyChangedDetails(arg) + case .teamExtensionsPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogTeamExtensionsPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamExtensionsPolicyChangedDetails(arg) + case .teamSelectiveSyncPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogTeamSelectiveSyncPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamSelectiveSyncPolicyChangedDetails(arg) + case .teamSharingWhitelistSubjectsChangedDetails(let swiftArg): + let arg = DBXTeamLogTeamSharingWhitelistSubjectsChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamSharingWhitelistSubjectsChangedDetails(arg) + case .tfaAddExceptionDetails(let swiftArg): + let arg = DBXTeamLogTfaAddExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaAddExceptionDetails(arg) + case .tfaChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogTfaChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaChangePolicyDetails(arg) + case .tfaRemoveExceptionDetails(let swiftArg): + let arg = DBXTeamLogTfaRemoveExceptionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaRemoveExceptionDetails(arg) + case .twoAccountChangePolicyDetails(let swiftArg): + let arg = DBXTeamLogTwoAccountChangePolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTwoAccountChangePolicyDetails(arg) + case .viewerInfoPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogViewerInfoPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsViewerInfoPolicyChangedDetails(arg) + case .watermarkingPolicyChangedDetails(let swiftArg): + let arg = DBXTeamLogWatermarkingPolicyChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsWatermarkingPolicyChangedDetails(arg) + case .webSessionsChangeActiveSessionLimitDetails(let swiftArg): + let arg = DBXTeamLogWebSessionsChangeActiveSessionLimitDetails(swift: swiftArg) + return DBXTeamLogEventDetailsWebSessionsChangeActiveSessionLimitDetails(arg) + case .webSessionsChangeFixedLengthPolicyDetails(let swiftArg): + let arg = DBXTeamLogWebSessionsChangeFixedLengthPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsWebSessionsChangeFixedLengthPolicyDetails(arg) + case .webSessionsChangeIdleLengthPolicyDetails(let swiftArg): + let arg = DBXTeamLogWebSessionsChangeIdleLengthPolicyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsWebSessionsChangeIdleLengthPolicyDetails(arg) + case .dataResidencyMigrationRequestSuccessfulDetails(let swiftArg): + let arg = DBXTeamLogDataResidencyMigrationRequestSuccessfulDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDataResidencyMigrationRequestSuccessfulDetails(arg) + case .dataResidencyMigrationRequestUnsuccessfulDetails(let swiftArg): + let arg = DBXTeamLogDataResidencyMigrationRequestUnsuccessfulDetails(swift: swiftArg) + return DBXTeamLogEventDetailsDataResidencyMigrationRequestUnsuccessfulDetails(arg) + case .teamMergeFromDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeFromDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeFromDetails(arg) + case .teamMergeToDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeToDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeToDetails(arg) + case .teamProfileAddBackgroundDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileAddBackgroundDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileAddBackgroundDetails(arg) + case .teamProfileAddLogoDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileAddLogoDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileAddLogoDetails(arg) + case .teamProfileChangeBackgroundDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeBackgroundDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileChangeBackgroundDetails(arg) + case .teamProfileChangeDefaultLanguageDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeDefaultLanguageDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileChangeDefaultLanguageDetails(arg) + case .teamProfileChangeLogoDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeLogoDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileChangeLogoDetails(arg) + case .teamProfileChangeNameDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeNameDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileChangeNameDetails(arg) + case .teamProfileRemoveBackgroundDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileRemoveBackgroundDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileRemoveBackgroundDetails(arg) + case .teamProfileRemoveLogoDetails(let swiftArg): + let arg = DBXTeamLogTeamProfileRemoveLogoDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamProfileRemoveLogoDetails(arg) + case .tfaAddBackupPhoneDetails(let swiftArg): + let arg = DBXTeamLogTfaAddBackupPhoneDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaAddBackupPhoneDetails(arg) + case .tfaAddSecurityKeyDetails(let swiftArg): + let arg = DBXTeamLogTfaAddSecurityKeyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaAddSecurityKeyDetails(arg) + case .tfaChangeBackupPhoneDetails(let swiftArg): + let arg = DBXTeamLogTfaChangeBackupPhoneDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaChangeBackupPhoneDetails(arg) + case .tfaChangeStatusDetails(let swiftArg): + let arg = DBXTeamLogTfaChangeStatusDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaChangeStatusDetails(arg) + case .tfaRemoveBackupPhoneDetails(let swiftArg): + let arg = DBXTeamLogTfaRemoveBackupPhoneDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaRemoveBackupPhoneDetails(arg) + case .tfaRemoveSecurityKeyDetails(let swiftArg): + let arg = DBXTeamLogTfaRemoveSecurityKeyDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaRemoveSecurityKeyDetails(arg) + case .tfaResetDetails(let swiftArg): + let arg = DBXTeamLogTfaResetDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTfaResetDetails(arg) + case .changedEnterpriseAdminRoleDetails(let swiftArg): + let arg = DBXTeamLogChangedEnterpriseAdminRoleDetails(swift: swiftArg) + return DBXTeamLogEventDetailsChangedEnterpriseAdminRoleDetails(arg) + case .changedEnterpriseConnectedTeamStatusDetails(let swiftArg): + let arg = DBXTeamLogChangedEnterpriseConnectedTeamStatusDetails(swift: swiftArg) + return DBXTeamLogEventDetailsChangedEnterpriseConnectedTeamStatusDetails(arg) + case .endedEnterpriseAdminSessionDetails(let swiftArg): + let arg = DBXTeamLogEndedEnterpriseAdminSessionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDetails(arg) + case .endedEnterpriseAdminSessionDeprecatedDetails(let swiftArg): + let arg = DBXTeamLogEndedEnterpriseAdminSessionDeprecatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDeprecatedDetails(arg) + case .enterpriseSettingsLockingDetails(let swiftArg): + let arg = DBXTeamLogEnterpriseSettingsLockingDetails(swift: swiftArg) + return DBXTeamLogEventDetailsEnterpriseSettingsLockingDetails(arg) + case .guestAdminChangeStatusDetails(let swiftArg): + let arg = DBXTeamLogGuestAdminChangeStatusDetails(swift: swiftArg) + return DBXTeamLogEventDetailsGuestAdminChangeStatusDetails(arg) + case .startedEnterpriseAdminSessionDetails(let swiftArg): + let arg = DBXTeamLogStartedEnterpriseAdminSessionDetails(swift: swiftArg) + return DBXTeamLogEventDetailsStartedEnterpriseAdminSessionDetails(arg) + case .teamMergeRequestAcceptedDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAcceptedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestAcceptedDetails(arg) + case .teamMergeRequestAcceptedShownToPrimaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToPrimaryTeamDetails(arg) + case .teamMergeRequestAcceptedShownToSecondaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToSecondaryTeamDetails(arg) + case .teamMergeRequestAutoCanceledDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAutoCanceledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestAutoCanceledDetails(arg) + case .teamMergeRequestCanceledDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestCanceledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestCanceledDetails(arg) + case .teamMergeRequestCanceledShownToPrimaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToPrimaryTeamDetails(arg) + case .teamMergeRequestCanceledShownToSecondaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToSecondaryTeamDetails(arg) + case .teamMergeRequestExpiredDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestExpiredDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestExpiredDetails(arg) + case .teamMergeRequestExpiredShownToPrimaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToPrimaryTeamDetails(arg) + case .teamMergeRequestExpiredShownToSecondaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToSecondaryTeamDetails(arg) + case .teamMergeRequestRejectedShownToPrimaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToPrimaryTeamDetails(arg) + case .teamMergeRequestRejectedShownToSecondaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToSecondaryTeamDetails(arg) + case .teamMergeRequestReminderDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestReminderDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestReminderDetails(arg) + case .teamMergeRequestReminderShownToPrimaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestReminderShownToPrimaryTeamDetails(arg) + case .teamMergeRequestReminderShownToSecondaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestReminderShownToSecondaryTeamDetails(arg) + case .teamMergeRequestRevokedDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestRevokedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestRevokedDetails(arg) + case .teamMergeRequestSentShownToPrimaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestSentShownToPrimaryTeamDetails(arg) + case .teamMergeRequestSentShownToSecondaryTeamDetails(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamMergeRequestSentShownToSecondaryTeamDetails(arg) + case .missingDetails(let swiftArg): + let arg = DBXTeamLogMissingDetails(swift: swiftArg) + return DBXTeamLogEventDetailsMissingDetails(arg) + case .other: + return DBXTeamLogEventDetailsOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdminAlertingAlertStateChangedDetails: DBXTeamLogEventDetailsAdminAlertingAlertStateChangedDetails? { + self as? DBXTeamLogEventDetailsAdminAlertingAlertStateChangedDetails + } + + @objc + public var asAdminAlertingChangedAlertConfigDetails: DBXTeamLogEventDetailsAdminAlertingChangedAlertConfigDetails? { + self as? DBXTeamLogEventDetailsAdminAlertingChangedAlertConfigDetails + } + + @objc + public var asAdminAlertingTriggeredAlertDetails: DBXTeamLogEventDetailsAdminAlertingTriggeredAlertDetails? { + self as? DBXTeamLogEventDetailsAdminAlertingTriggeredAlertDetails + } + + @objc + public var asRansomwareRestoreProcessCompletedDetails: DBXTeamLogEventDetailsRansomwareRestoreProcessCompletedDetails? { + self as? DBXTeamLogEventDetailsRansomwareRestoreProcessCompletedDetails + } + + @objc + public var asRansomwareRestoreProcessStartedDetails: DBXTeamLogEventDetailsRansomwareRestoreProcessStartedDetails? { + self as? DBXTeamLogEventDetailsRansomwareRestoreProcessStartedDetails + } + + @objc + public var asAppBlockedByPermissionsDetails: DBXTeamLogEventDetailsAppBlockedByPermissionsDetails? { + self as? DBXTeamLogEventDetailsAppBlockedByPermissionsDetails + } + + @objc + public var asAppLinkTeamDetails: DBXTeamLogEventDetailsAppLinkTeamDetails? { + self as? DBXTeamLogEventDetailsAppLinkTeamDetails + } + + @objc + public var asAppLinkUserDetails: DBXTeamLogEventDetailsAppLinkUserDetails? { + self as? DBXTeamLogEventDetailsAppLinkUserDetails + } + + @objc + public var asAppUnlinkTeamDetails: DBXTeamLogEventDetailsAppUnlinkTeamDetails? { + self as? DBXTeamLogEventDetailsAppUnlinkTeamDetails + } + + @objc + public var asAppUnlinkUserDetails: DBXTeamLogEventDetailsAppUnlinkUserDetails? { + self as? DBXTeamLogEventDetailsAppUnlinkUserDetails + } + + @objc + public var asIntegrationConnectedDetails: DBXTeamLogEventDetailsIntegrationConnectedDetails? { + self as? DBXTeamLogEventDetailsIntegrationConnectedDetails + } + + @objc + public var asIntegrationDisconnectedDetails: DBXTeamLogEventDetailsIntegrationDisconnectedDetails? { + self as? DBXTeamLogEventDetailsIntegrationDisconnectedDetails + } + + @objc + public var asFileAddCommentDetails: DBXTeamLogEventDetailsFileAddCommentDetails? { + self as? DBXTeamLogEventDetailsFileAddCommentDetails + } + + @objc + public var asFileChangeCommentSubscriptionDetails: DBXTeamLogEventDetailsFileChangeCommentSubscriptionDetails? { + self as? DBXTeamLogEventDetailsFileChangeCommentSubscriptionDetails + } + + @objc + public var asFileDeleteCommentDetails: DBXTeamLogEventDetailsFileDeleteCommentDetails? { + self as? DBXTeamLogEventDetailsFileDeleteCommentDetails + } + + @objc + public var asFileEditCommentDetails: DBXTeamLogEventDetailsFileEditCommentDetails? { + self as? DBXTeamLogEventDetailsFileEditCommentDetails + } + + @objc + public var asFileLikeCommentDetails: DBXTeamLogEventDetailsFileLikeCommentDetails? { + self as? DBXTeamLogEventDetailsFileLikeCommentDetails + } + + @objc + public var asFileResolveCommentDetails: DBXTeamLogEventDetailsFileResolveCommentDetails? { + self as? DBXTeamLogEventDetailsFileResolveCommentDetails + } + + @objc + public var asFileUnlikeCommentDetails: DBXTeamLogEventDetailsFileUnlikeCommentDetails? { + self as? DBXTeamLogEventDetailsFileUnlikeCommentDetails + } + + @objc + public var asFileUnresolveCommentDetails: DBXTeamLogEventDetailsFileUnresolveCommentDetails? { + self as? DBXTeamLogEventDetailsFileUnresolveCommentDetails + } + + @objc + public var asGovernancePolicyAddFoldersDetails: DBXTeamLogEventDetailsGovernancePolicyAddFoldersDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyAddFoldersDetails + } + + @objc + public var asGovernancePolicyAddFolderFailedDetails: DBXTeamLogEventDetailsGovernancePolicyAddFolderFailedDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyAddFolderFailedDetails + } + + @objc + public var asGovernancePolicyContentDisposedDetails: DBXTeamLogEventDetailsGovernancePolicyContentDisposedDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyContentDisposedDetails + } + + @objc + public var asGovernancePolicyCreateDetails: DBXTeamLogEventDetailsGovernancePolicyCreateDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyCreateDetails + } + + @objc + public var asGovernancePolicyDeleteDetails: DBXTeamLogEventDetailsGovernancePolicyDeleteDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyDeleteDetails + } + + @objc + public var asGovernancePolicyEditDetailsDetails: DBXTeamLogEventDetailsGovernancePolicyEditDetailsDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyEditDetailsDetails + } + + @objc + public var asGovernancePolicyEditDurationDetails: DBXTeamLogEventDetailsGovernancePolicyEditDurationDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyEditDurationDetails + } + + @objc + public var asGovernancePolicyExportCreatedDetails: DBXTeamLogEventDetailsGovernancePolicyExportCreatedDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyExportCreatedDetails + } + + @objc + public var asGovernancePolicyExportRemovedDetails: DBXTeamLogEventDetailsGovernancePolicyExportRemovedDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyExportRemovedDetails + } + + @objc + public var asGovernancePolicyRemoveFoldersDetails: DBXTeamLogEventDetailsGovernancePolicyRemoveFoldersDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyRemoveFoldersDetails + } + + @objc + public var asGovernancePolicyReportCreatedDetails: DBXTeamLogEventDetailsGovernancePolicyReportCreatedDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyReportCreatedDetails + } + + @objc + public var asGovernancePolicyZipPartDownloadedDetails: DBXTeamLogEventDetailsGovernancePolicyZipPartDownloadedDetails? { + self as? DBXTeamLogEventDetailsGovernancePolicyZipPartDownloadedDetails + } + + @objc + public var asLegalHoldsActivateAHoldDetails: DBXTeamLogEventDetailsLegalHoldsActivateAHoldDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsActivateAHoldDetails + } + + @objc + public var asLegalHoldsAddMembersDetails: DBXTeamLogEventDetailsLegalHoldsAddMembersDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsAddMembersDetails + } + + @objc + public var asLegalHoldsChangeHoldDetailsDetails: DBXTeamLogEventDetailsLegalHoldsChangeHoldDetailsDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsChangeHoldDetailsDetails + } + + @objc + public var asLegalHoldsChangeHoldNameDetails: DBXTeamLogEventDetailsLegalHoldsChangeHoldNameDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsChangeHoldNameDetails + } + + @objc + public var asLegalHoldsExportAHoldDetails: DBXTeamLogEventDetailsLegalHoldsExportAHoldDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsExportAHoldDetails + } + + @objc + public var asLegalHoldsExportCancelledDetails: DBXTeamLogEventDetailsLegalHoldsExportCancelledDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsExportCancelledDetails + } + + @objc + public var asLegalHoldsExportDownloadedDetails: DBXTeamLogEventDetailsLegalHoldsExportDownloadedDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsExportDownloadedDetails + } + + @objc + public var asLegalHoldsExportRemovedDetails: DBXTeamLogEventDetailsLegalHoldsExportRemovedDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsExportRemovedDetails + } + + @objc + public var asLegalHoldsReleaseAHoldDetails: DBXTeamLogEventDetailsLegalHoldsReleaseAHoldDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsReleaseAHoldDetails + } + + @objc + public var asLegalHoldsRemoveMembersDetails: DBXTeamLogEventDetailsLegalHoldsRemoveMembersDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsRemoveMembersDetails + } + + @objc + public var asLegalHoldsReportAHoldDetails: DBXTeamLogEventDetailsLegalHoldsReportAHoldDetails? { + self as? DBXTeamLogEventDetailsLegalHoldsReportAHoldDetails + } + + @objc + public var asDeviceChangeIpDesktopDetails: DBXTeamLogEventDetailsDeviceChangeIpDesktopDetails? { + self as? DBXTeamLogEventDetailsDeviceChangeIpDesktopDetails + } + + @objc + public var asDeviceChangeIpMobileDetails: DBXTeamLogEventDetailsDeviceChangeIpMobileDetails? { + self as? DBXTeamLogEventDetailsDeviceChangeIpMobileDetails + } + + @objc + public var asDeviceChangeIpWebDetails: DBXTeamLogEventDetailsDeviceChangeIpWebDetails? { + self as? DBXTeamLogEventDetailsDeviceChangeIpWebDetails + } + + @objc + public var asDeviceDeleteOnUnlinkFailDetails: DBXTeamLogEventDetailsDeviceDeleteOnUnlinkFailDetails? { + self as? DBXTeamLogEventDetailsDeviceDeleteOnUnlinkFailDetails + } + + @objc + public var asDeviceDeleteOnUnlinkSuccessDetails: DBXTeamLogEventDetailsDeviceDeleteOnUnlinkSuccessDetails? { + self as? DBXTeamLogEventDetailsDeviceDeleteOnUnlinkSuccessDetails + } + + @objc + public var asDeviceLinkFailDetails: DBXTeamLogEventDetailsDeviceLinkFailDetails? { + self as? DBXTeamLogEventDetailsDeviceLinkFailDetails + } + + @objc + public var asDeviceLinkSuccessDetails: DBXTeamLogEventDetailsDeviceLinkSuccessDetails? { + self as? DBXTeamLogEventDetailsDeviceLinkSuccessDetails + } + + @objc + public var asDeviceManagementDisabledDetails: DBXTeamLogEventDetailsDeviceManagementDisabledDetails? { + self as? DBXTeamLogEventDetailsDeviceManagementDisabledDetails + } + + @objc + public var asDeviceManagementEnabledDetails: DBXTeamLogEventDetailsDeviceManagementEnabledDetails? { + self as? DBXTeamLogEventDetailsDeviceManagementEnabledDetails + } + + @objc + public var asDeviceSyncBackupStatusChangedDetails: DBXTeamLogEventDetailsDeviceSyncBackupStatusChangedDetails? { + self as? DBXTeamLogEventDetailsDeviceSyncBackupStatusChangedDetails + } + + @objc + public var asDeviceUnlinkDetails: DBXTeamLogEventDetailsDeviceUnlinkDetails? { + self as? DBXTeamLogEventDetailsDeviceUnlinkDetails + } + + @objc + public var asDropboxPasswordsExportedDetails: DBXTeamLogEventDetailsDropboxPasswordsExportedDetails? { + self as? DBXTeamLogEventDetailsDropboxPasswordsExportedDetails + } + + @objc + public var asDropboxPasswordsNewDeviceEnrolledDetails: DBXTeamLogEventDetailsDropboxPasswordsNewDeviceEnrolledDetails? { + self as? DBXTeamLogEventDetailsDropboxPasswordsNewDeviceEnrolledDetails + } + + @objc + public var asEmmRefreshAuthTokenDetails: DBXTeamLogEventDetailsEmmRefreshAuthTokenDetails? { + self as? DBXTeamLogEventDetailsEmmRefreshAuthTokenDetails + } + + @objc + public var asExternalDriveBackupEligibilityStatusCheckedDetails: DBXTeamLogEventDetailsExternalDriveBackupEligibilityStatusCheckedDetails? { + self as? DBXTeamLogEventDetailsExternalDriveBackupEligibilityStatusCheckedDetails + } + + @objc + public var asExternalDriveBackupStatusChangedDetails: DBXTeamLogEventDetailsExternalDriveBackupStatusChangedDetails? { + self as? DBXTeamLogEventDetailsExternalDriveBackupStatusChangedDetails + } + + @objc + public var asAccountCaptureChangeAvailabilityDetails: DBXTeamLogEventDetailsAccountCaptureChangeAvailabilityDetails? { + self as? DBXTeamLogEventDetailsAccountCaptureChangeAvailabilityDetails + } + + @objc + public var asAccountCaptureMigrateAccountDetails: DBXTeamLogEventDetailsAccountCaptureMigrateAccountDetails? { + self as? DBXTeamLogEventDetailsAccountCaptureMigrateAccountDetails + } + + @objc + public var asAccountCaptureNotificationEmailsSentDetails: DBXTeamLogEventDetailsAccountCaptureNotificationEmailsSentDetails? { + self as? DBXTeamLogEventDetailsAccountCaptureNotificationEmailsSentDetails + } + + @objc + public var asAccountCaptureRelinquishAccountDetails: DBXTeamLogEventDetailsAccountCaptureRelinquishAccountDetails? { + self as? DBXTeamLogEventDetailsAccountCaptureRelinquishAccountDetails + } + + @objc + public var asDisabledDomainInvitesDetails: DBXTeamLogEventDetailsDisabledDomainInvitesDetails? { + self as? DBXTeamLogEventDetailsDisabledDomainInvitesDetails + } + + @objc + public var asDomainInvitesApproveRequestToJoinTeamDetails: DBXTeamLogEventDetailsDomainInvitesApproveRequestToJoinTeamDetails? { + self as? DBXTeamLogEventDetailsDomainInvitesApproveRequestToJoinTeamDetails + } + + @objc + public var asDomainInvitesDeclineRequestToJoinTeamDetails: DBXTeamLogEventDetailsDomainInvitesDeclineRequestToJoinTeamDetails? { + self as? DBXTeamLogEventDetailsDomainInvitesDeclineRequestToJoinTeamDetails + } + + @objc + public var asDomainInvitesEmailExistingUsersDetails: DBXTeamLogEventDetailsDomainInvitesEmailExistingUsersDetails? { + self as? DBXTeamLogEventDetailsDomainInvitesEmailExistingUsersDetails + } + + @objc + public var asDomainInvitesRequestToJoinTeamDetails: DBXTeamLogEventDetailsDomainInvitesRequestToJoinTeamDetails? { + self as? DBXTeamLogEventDetailsDomainInvitesRequestToJoinTeamDetails + } + + @objc + public var asDomainInvitesSetInviteNewUserPrefToNoDetails: DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToNoDetails? { + self as? DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToNoDetails + } + + @objc + public var asDomainInvitesSetInviteNewUserPrefToYesDetails: DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToYesDetails? { + self as? DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToYesDetails + } + + @objc + public var asDomainVerificationAddDomainFailDetails: DBXTeamLogEventDetailsDomainVerificationAddDomainFailDetails? { + self as? DBXTeamLogEventDetailsDomainVerificationAddDomainFailDetails + } + + @objc + public var asDomainVerificationAddDomainSuccessDetails: DBXTeamLogEventDetailsDomainVerificationAddDomainSuccessDetails? { + self as? DBXTeamLogEventDetailsDomainVerificationAddDomainSuccessDetails + } + + @objc + public var asDomainVerificationRemoveDomainDetails: DBXTeamLogEventDetailsDomainVerificationRemoveDomainDetails? { + self as? DBXTeamLogEventDetailsDomainVerificationRemoveDomainDetails + } + + @objc + public var asEnabledDomainInvitesDetails: DBXTeamLogEventDetailsEnabledDomainInvitesDetails? { + self as? DBXTeamLogEventDetailsEnabledDomainInvitesDetails + } + + @objc + public var asTeamEncryptionKeyCancelKeyDeletionDetails: DBXTeamLogEventDetailsTeamEncryptionKeyCancelKeyDeletionDetails? { + self as? DBXTeamLogEventDetailsTeamEncryptionKeyCancelKeyDeletionDetails + } + + @objc + public var asTeamEncryptionKeyCreateKeyDetails: DBXTeamLogEventDetailsTeamEncryptionKeyCreateKeyDetails? { + self as? DBXTeamLogEventDetailsTeamEncryptionKeyCreateKeyDetails + } + + @objc + public var asTeamEncryptionKeyDeleteKeyDetails: DBXTeamLogEventDetailsTeamEncryptionKeyDeleteKeyDetails? { + self as? DBXTeamLogEventDetailsTeamEncryptionKeyDeleteKeyDetails + } + + @objc + public var asTeamEncryptionKeyDisableKeyDetails: DBXTeamLogEventDetailsTeamEncryptionKeyDisableKeyDetails? { + self as? DBXTeamLogEventDetailsTeamEncryptionKeyDisableKeyDetails + } + + @objc + public var asTeamEncryptionKeyEnableKeyDetails: DBXTeamLogEventDetailsTeamEncryptionKeyEnableKeyDetails? { + self as? DBXTeamLogEventDetailsTeamEncryptionKeyEnableKeyDetails + } + + @objc + public var asTeamEncryptionKeyRotateKeyDetails: DBXTeamLogEventDetailsTeamEncryptionKeyRotateKeyDetails? { + self as? DBXTeamLogEventDetailsTeamEncryptionKeyRotateKeyDetails + } + + @objc + public var asTeamEncryptionKeyScheduleKeyDeletionDetails: DBXTeamLogEventDetailsTeamEncryptionKeyScheduleKeyDeletionDetails? { + self as? DBXTeamLogEventDetailsTeamEncryptionKeyScheduleKeyDeletionDetails + } + + @objc + public var asApplyNamingConventionDetails: DBXTeamLogEventDetailsApplyNamingConventionDetails? { + self as? DBXTeamLogEventDetailsApplyNamingConventionDetails + } + + @objc + public var asCreateFolderDetails: DBXTeamLogEventDetailsCreateFolderDetails? { + self as? DBXTeamLogEventDetailsCreateFolderDetails + } + + @objc + public var asFileAddDetails: DBXTeamLogEventDetailsFileAddDetails? { + self as? DBXTeamLogEventDetailsFileAddDetails + } + + @objc + public var asFileAddFromAutomationDetails: DBXTeamLogEventDetailsFileAddFromAutomationDetails? { + self as? DBXTeamLogEventDetailsFileAddFromAutomationDetails + } + + @objc + public var asFileCopyDetails: DBXTeamLogEventDetailsFileCopyDetails? { + self as? DBXTeamLogEventDetailsFileCopyDetails + } + + @objc + public var asFileDeleteDetails: DBXTeamLogEventDetailsFileDeleteDetails? { + self as? DBXTeamLogEventDetailsFileDeleteDetails + } + + @objc + public var asFileDownloadDetails: DBXTeamLogEventDetailsFileDownloadDetails? { + self as? DBXTeamLogEventDetailsFileDownloadDetails + } + + @objc + public var asFileEditDetails: DBXTeamLogEventDetailsFileEditDetails? { + self as? DBXTeamLogEventDetailsFileEditDetails + } + + @objc + public var asFileGetCopyReferenceDetails: DBXTeamLogEventDetailsFileGetCopyReferenceDetails? { + self as? DBXTeamLogEventDetailsFileGetCopyReferenceDetails + } + + @objc + public var asFileLockingLockStatusChangedDetails: DBXTeamLogEventDetailsFileLockingLockStatusChangedDetails? { + self as? DBXTeamLogEventDetailsFileLockingLockStatusChangedDetails + } + + @objc + public var asFileMoveDetails: DBXTeamLogEventDetailsFileMoveDetails? { + self as? DBXTeamLogEventDetailsFileMoveDetails + } + + @objc + public var asFilePermanentlyDeleteDetails: DBXTeamLogEventDetailsFilePermanentlyDeleteDetails? { + self as? DBXTeamLogEventDetailsFilePermanentlyDeleteDetails + } + + @objc + public var asFilePreviewDetails: DBXTeamLogEventDetailsFilePreviewDetails? { + self as? DBXTeamLogEventDetailsFilePreviewDetails + } + + @objc + public var asFileRenameDetails: DBXTeamLogEventDetailsFileRenameDetails? { + self as? DBXTeamLogEventDetailsFileRenameDetails + } + + @objc + public var asFileRestoreDetails: DBXTeamLogEventDetailsFileRestoreDetails? { + self as? DBXTeamLogEventDetailsFileRestoreDetails + } + + @objc + public var asFileRevertDetails: DBXTeamLogEventDetailsFileRevertDetails? { + self as? DBXTeamLogEventDetailsFileRevertDetails + } + + @objc + public var asFileRollbackChangesDetails: DBXTeamLogEventDetailsFileRollbackChangesDetails? { + self as? DBXTeamLogEventDetailsFileRollbackChangesDetails + } + + @objc + public var asFileSaveCopyReferenceDetails: DBXTeamLogEventDetailsFileSaveCopyReferenceDetails? { + self as? DBXTeamLogEventDetailsFileSaveCopyReferenceDetails + } + + @objc + public var asFolderOverviewDescriptionChangedDetails: DBXTeamLogEventDetailsFolderOverviewDescriptionChangedDetails? { + self as? DBXTeamLogEventDetailsFolderOverviewDescriptionChangedDetails + } + + @objc + public var asFolderOverviewItemPinnedDetails: DBXTeamLogEventDetailsFolderOverviewItemPinnedDetails? { + self as? DBXTeamLogEventDetailsFolderOverviewItemPinnedDetails + } + + @objc + public var asFolderOverviewItemUnpinnedDetails: DBXTeamLogEventDetailsFolderOverviewItemUnpinnedDetails? { + self as? DBXTeamLogEventDetailsFolderOverviewItemUnpinnedDetails + } + + @objc + public var asObjectLabelAddedDetails: DBXTeamLogEventDetailsObjectLabelAddedDetails? { + self as? DBXTeamLogEventDetailsObjectLabelAddedDetails + } + + @objc + public var asObjectLabelRemovedDetails: DBXTeamLogEventDetailsObjectLabelRemovedDetails? { + self as? DBXTeamLogEventDetailsObjectLabelRemovedDetails + } + + @objc + public var asObjectLabelUpdatedValueDetails: DBXTeamLogEventDetailsObjectLabelUpdatedValueDetails? { + self as? DBXTeamLogEventDetailsObjectLabelUpdatedValueDetails + } + + @objc + public var asOrganizeFolderWithTidyDetails: DBXTeamLogEventDetailsOrganizeFolderWithTidyDetails? { + self as? DBXTeamLogEventDetailsOrganizeFolderWithTidyDetails + } + + @objc + public var asReplayFileDeleteDetails: DBXTeamLogEventDetailsReplayFileDeleteDetails? { + self as? DBXTeamLogEventDetailsReplayFileDeleteDetails + } + + @objc + public var asRewindFolderDetails: DBXTeamLogEventDetailsRewindFolderDetails? { + self as? DBXTeamLogEventDetailsRewindFolderDetails + } + + @objc + public var asUndoNamingConventionDetails: DBXTeamLogEventDetailsUndoNamingConventionDetails? { + self as? DBXTeamLogEventDetailsUndoNamingConventionDetails + } + + @objc + public var asUndoOrganizeFolderWithTidyDetails: DBXTeamLogEventDetailsUndoOrganizeFolderWithTidyDetails? { + self as? DBXTeamLogEventDetailsUndoOrganizeFolderWithTidyDetails + } + + @objc + public var asUserTagsAddedDetails: DBXTeamLogEventDetailsUserTagsAddedDetails? { + self as? DBXTeamLogEventDetailsUserTagsAddedDetails + } + + @objc + public var asUserTagsRemovedDetails: DBXTeamLogEventDetailsUserTagsRemovedDetails? { + self as? DBXTeamLogEventDetailsUserTagsRemovedDetails + } + + @objc + public var asEmailIngestReceiveFileDetails: DBXTeamLogEventDetailsEmailIngestReceiveFileDetails? { + self as? DBXTeamLogEventDetailsEmailIngestReceiveFileDetails + } + + @objc + public var asFileRequestChangeDetails: DBXTeamLogEventDetailsFileRequestChangeDetails? { + self as? DBXTeamLogEventDetailsFileRequestChangeDetails + } + + @objc + public var asFileRequestCloseDetails: DBXTeamLogEventDetailsFileRequestCloseDetails? { + self as? DBXTeamLogEventDetailsFileRequestCloseDetails + } + + @objc + public var asFileRequestCreateDetails: DBXTeamLogEventDetailsFileRequestCreateDetails? { + self as? DBXTeamLogEventDetailsFileRequestCreateDetails + } + + @objc + public var asFileRequestDeleteDetails: DBXTeamLogEventDetailsFileRequestDeleteDetails? { + self as? DBXTeamLogEventDetailsFileRequestDeleteDetails + } + + @objc + public var asFileRequestReceiveFileDetails: DBXTeamLogEventDetailsFileRequestReceiveFileDetails? { + self as? DBXTeamLogEventDetailsFileRequestReceiveFileDetails + } + + @objc + public var asGroupAddExternalIdDetails: DBXTeamLogEventDetailsGroupAddExternalIdDetails? { + self as? DBXTeamLogEventDetailsGroupAddExternalIdDetails + } + + @objc + public var asGroupAddMemberDetails: DBXTeamLogEventDetailsGroupAddMemberDetails? { + self as? DBXTeamLogEventDetailsGroupAddMemberDetails + } + + @objc + public var asGroupChangeExternalIdDetails: DBXTeamLogEventDetailsGroupChangeExternalIdDetails? { + self as? DBXTeamLogEventDetailsGroupChangeExternalIdDetails + } + + @objc + public var asGroupChangeManagementTypeDetails: DBXTeamLogEventDetailsGroupChangeManagementTypeDetails? { + self as? DBXTeamLogEventDetailsGroupChangeManagementTypeDetails + } + + @objc + public var asGroupChangeMemberRoleDetails: DBXTeamLogEventDetailsGroupChangeMemberRoleDetails? { + self as? DBXTeamLogEventDetailsGroupChangeMemberRoleDetails + } + + @objc + public var asGroupCreateDetails: DBXTeamLogEventDetailsGroupCreateDetails? { + self as? DBXTeamLogEventDetailsGroupCreateDetails + } + + @objc + public var asGroupDeleteDetails: DBXTeamLogEventDetailsGroupDeleteDetails? { + self as? DBXTeamLogEventDetailsGroupDeleteDetails + } + + @objc + public var asGroupDescriptionUpdatedDetails: DBXTeamLogEventDetailsGroupDescriptionUpdatedDetails? { + self as? DBXTeamLogEventDetailsGroupDescriptionUpdatedDetails + } + + @objc + public var asGroupJoinPolicyUpdatedDetails: DBXTeamLogEventDetailsGroupJoinPolicyUpdatedDetails? { + self as? DBXTeamLogEventDetailsGroupJoinPolicyUpdatedDetails + } + + @objc + public var asGroupMovedDetails: DBXTeamLogEventDetailsGroupMovedDetails? { + self as? DBXTeamLogEventDetailsGroupMovedDetails + } + + @objc + public var asGroupRemoveExternalIdDetails: DBXTeamLogEventDetailsGroupRemoveExternalIdDetails? { + self as? DBXTeamLogEventDetailsGroupRemoveExternalIdDetails + } + + @objc + public var asGroupRemoveMemberDetails: DBXTeamLogEventDetailsGroupRemoveMemberDetails? { + self as? DBXTeamLogEventDetailsGroupRemoveMemberDetails + } + + @objc + public var asGroupRenameDetails: DBXTeamLogEventDetailsGroupRenameDetails? { + self as? DBXTeamLogEventDetailsGroupRenameDetails + } + + @objc + public var asAccountLockOrUnlockedDetails: DBXTeamLogEventDetailsAccountLockOrUnlockedDetails? { + self as? DBXTeamLogEventDetailsAccountLockOrUnlockedDetails + } + + @objc + public var asEmmErrorDetails: DBXTeamLogEventDetailsEmmErrorDetails? { + self as? DBXTeamLogEventDetailsEmmErrorDetails + } + + @objc + public var asGuestAdminSignedInViaTrustedTeamsDetails: DBXTeamLogEventDetailsGuestAdminSignedInViaTrustedTeamsDetails? { + self as? DBXTeamLogEventDetailsGuestAdminSignedInViaTrustedTeamsDetails + } + + @objc + public var asGuestAdminSignedOutViaTrustedTeamsDetails: DBXTeamLogEventDetailsGuestAdminSignedOutViaTrustedTeamsDetails? { + self as? DBXTeamLogEventDetailsGuestAdminSignedOutViaTrustedTeamsDetails + } + + @objc + public var asLoginFailDetails: DBXTeamLogEventDetailsLoginFailDetails? { + self as? DBXTeamLogEventDetailsLoginFailDetails + } + + @objc + public var asLoginSuccessDetails: DBXTeamLogEventDetailsLoginSuccessDetails? { + self as? DBXTeamLogEventDetailsLoginSuccessDetails + } + + @objc + public var asLogoutDetails: DBXTeamLogEventDetailsLogoutDetails? { + self as? DBXTeamLogEventDetailsLogoutDetails + } + + @objc + public var asResellerSupportSessionEndDetails: DBXTeamLogEventDetailsResellerSupportSessionEndDetails? { + self as? DBXTeamLogEventDetailsResellerSupportSessionEndDetails + } + + @objc + public var asResellerSupportSessionStartDetails: DBXTeamLogEventDetailsResellerSupportSessionStartDetails? { + self as? DBXTeamLogEventDetailsResellerSupportSessionStartDetails + } + + @objc + public var asSignInAsSessionEndDetails: DBXTeamLogEventDetailsSignInAsSessionEndDetails? { + self as? DBXTeamLogEventDetailsSignInAsSessionEndDetails + } + + @objc + public var asSignInAsSessionStartDetails: DBXTeamLogEventDetailsSignInAsSessionStartDetails? { + self as? DBXTeamLogEventDetailsSignInAsSessionStartDetails + } + + @objc + public var asSsoErrorDetails: DBXTeamLogEventDetailsSsoErrorDetails? { + self as? DBXTeamLogEventDetailsSsoErrorDetails + } + + @objc + public var asBackupAdminInvitationSentDetails: DBXTeamLogEventDetailsBackupAdminInvitationSentDetails? { + self as? DBXTeamLogEventDetailsBackupAdminInvitationSentDetails + } + + @objc + public var asBackupInvitationOpenedDetails: DBXTeamLogEventDetailsBackupInvitationOpenedDetails? { + self as? DBXTeamLogEventDetailsBackupInvitationOpenedDetails + } + + @objc + public var asCreateTeamInviteLinkDetails: DBXTeamLogEventDetailsCreateTeamInviteLinkDetails? { + self as? DBXTeamLogEventDetailsCreateTeamInviteLinkDetails + } + + @objc + public var asDeleteTeamInviteLinkDetails: DBXTeamLogEventDetailsDeleteTeamInviteLinkDetails? { + self as? DBXTeamLogEventDetailsDeleteTeamInviteLinkDetails + } + + @objc + public var asMemberAddExternalIdDetails: DBXTeamLogEventDetailsMemberAddExternalIdDetails? { + self as? DBXTeamLogEventDetailsMemberAddExternalIdDetails + } + + @objc + public var asMemberAddNameDetails: DBXTeamLogEventDetailsMemberAddNameDetails? { + self as? DBXTeamLogEventDetailsMemberAddNameDetails + } + + @objc + public var asMemberChangeAdminRoleDetails: DBXTeamLogEventDetailsMemberChangeAdminRoleDetails? { + self as? DBXTeamLogEventDetailsMemberChangeAdminRoleDetails + } + + @objc + public var asMemberChangeEmailDetails: DBXTeamLogEventDetailsMemberChangeEmailDetails? { + self as? DBXTeamLogEventDetailsMemberChangeEmailDetails + } + + @objc + public var asMemberChangeExternalIdDetails: DBXTeamLogEventDetailsMemberChangeExternalIdDetails? { + self as? DBXTeamLogEventDetailsMemberChangeExternalIdDetails + } + + @objc + public var asMemberChangeMembershipTypeDetails: DBXTeamLogEventDetailsMemberChangeMembershipTypeDetails? { + self as? DBXTeamLogEventDetailsMemberChangeMembershipTypeDetails + } + + @objc + public var asMemberChangeNameDetails: DBXTeamLogEventDetailsMemberChangeNameDetails? { + self as? DBXTeamLogEventDetailsMemberChangeNameDetails + } + + @objc + public var asMemberChangeResellerRoleDetails: DBXTeamLogEventDetailsMemberChangeResellerRoleDetails? { + self as? DBXTeamLogEventDetailsMemberChangeResellerRoleDetails + } + + @objc + public var asMemberChangeStatusDetails: DBXTeamLogEventDetailsMemberChangeStatusDetails? { + self as? DBXTeamLogEventDetailsMemberChangeStatusDetails + } + + @objc + public var asMemberDeleteManualContactsDetails: DBXTeamLogEventDetailsMemberDeleteManualContactsDetails? { + self as? DBXTeamLogEventDetailsMemberDeleteManualContactsDetails + } + + @objc + public var asMemberDeleteProfilePhotoDetails: DBXTeamLogEventDetailsMemberDeleteProfilePhotoDetails? { + self as? DBXTeamLogEventDetailsMemberDeleteProfilePhotoDetails + } + + @objc + public var asMemberPermanentlyDeleteAccountContentsDetails: DBXTeamLogEventDetailsMemberPermanentlyDeleteAccountContentsDetails? { + self as? DBXTeamLogEventDetailsMemberPermanentlyDeleteAccountContentsDetails + } + + @objc + public var asMemberRemoveExternalIdDetails: DBXTeamLogEventDetailsMemberRemoveExternalIdDetails? { + self as? DBXTeamLogEventDetailsMemberRemoveExternalIdDetails + } + + @objc + public var asMemberSetProfilePhotoDetails: DBXTeamLogEventDetailsMemberSetProfilePhotoDetails? { + self as? DBXTeamLogEventDetailsMemberSetProfilePhotoDetails + } + + @objc + public var asMemberSpaceLimitsAddCustomQuotaDetails: DBXTeamLogEventDetailsMemberSpaceLimitsAddCustomQuotaDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsAddCustomQuotaDetails + } + + @objc + public var asMemberSpaceLimitsChangeCustomQuotaDetails: DBXTeamLogEventDetailsMemberSpaceLimitsChangeCustomQuotaDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsChangeCustomQuotaDetails + } + + @objc + public var asMemberSpaceLimitsChangeStatusDetails: DBXTeamLogEventDetailsMemberSpaceLimitsChangeStatusDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsChangeStatusDetails + } + + @objc + public var asMemberSpaceLimitsRemoveCustomQuotaDetails: DBXTeamLogEventDetailsMemberSpaceLimitsRemoveCustomQuotaDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsRemoveCustomQuotaDetails + } + + @objc + public var asMemberSuggestDetails: DBXTeamLogEventDetailsMemberSuggestDetails? { + self as? DBXTeamLogEventDetailsMemberSuggestDetails + } + + @objc + public var asMemberTransferAccountContentsDetails: DBXTeamLogEventDetailsMemberTransferAccountContentsDetails? { + self as? DBXTeamLogEventDetailsMemberTransferAccountContentsDetails + } + + @objc + public var asPendingSecondaryEmailAddedDetails: DBXTeamLogEventDetailsPendingSecondaryEmailAddedDetails? { + self as? DBXTeamLogEventDetailsPendingSecondaryEmailAddedDetails + } + + @objc + public var asSecondaryEmailDeletedDetails: DBXTeamLogEventDetailsSecondaryEmailDeletedDetails? { + self as? DBXTeamLogEventDetailsSecondaryEmailDeletedDetails + } + + @objc + public var asSecondaryEmailVerifiedDetails: DBXTeamLogEventDetailsSecondaryEmailVerifiedDetails? { + self as? DBXTeamLogEventDetailsSecondaryEmailVerifiedDetails + } + + @objc + public var asSecondaryMailsPolicyChangedDetails: DBXTeamLogEventDetailsSecondaryMailsPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsSecondaryMailsPolicyChangedDetails + } + + @objc + public var asBinderAddPageDetails: DBXTeamLogEventDetailsBinderAddPageDetails? { + self as? DBXTeamLogEventDetailsBinderAddPageDetails + } + + @objc + public var asBinderAddSectionDetails: DBXTeamLogEventDetailsBinderAddSectionDetails? { + self as? DBXTeamLogEventDetailsBinderAddSectionDetails + } + + @objc + public var asBinderRemovePageDetails: DBXTeamLogEventDetailsBinderRemovePageDetails? { + self as? DBXTeamLogEventDetailsBinderRemovePageDetails + } + + @objc + public var asBinderRemoveSectionDetails: DBXTeamLogEventDetailsBinderRemoveSectionDetails? { + self as? DBXTeamLogEventDetailsBinderRemoveSectionDetails + } + + @objc + public var asBinderRenamePageDetails: DBXTeamLogEventDetailsBinderRenamePageDetails? { + self as? DBXTeamLogEventDetailsBinderRenamePageDetails + } + + @objc + public var asBinderRenameSectionDetails: DBXTeamLogEventDetailsBinderRenameSectionDetails? { + self as? DBXTeamLogEventDetailsBinderRenameSectionDetails + } + + @objc + public var asBinderReorderPageDetails: DBXTeamLogEventDetailsBinderReorderPageDetails? { + self as? DBXTeamLogEventDetailsBinderReorderPageDetails + } + + @objc + public var asBinderReorderSectionDetails: DBXTeamLogEventDetailsBinderReorderSectionDetails? { + self as? DBXTeamLogEventDetailsBinderReorderSectionDetails + } + + @objc + public var asPaperContentAddMemberDetails: DBXTeamLogEventDetailsPaperContentAddMemberDetails? { + self as? DBXTeamLogEventDetailsPaperContentAddMemberDetails + } + + @objc + public var asPaperContentAddToFolderDetails: DBXTeamLogEventDetailsPaperContentAddToFolderDetails? { + self as? DBXTeamLogEventDetailsPaperContentAddToFolderDetails + } + + @objc + public var asPaperContentArchiveDetails: DBXTeamLogEventDetailsPaperContentArchiveDetails? { + self as? DBXTeamLogEventDetailsPaperContentArchiveDetails + } + + @objc + public var asPaperContentCreateDetails: DBXTeamLogEventDetailsPaperContentCreateDetails? { + self as? DBXTeamLogEventDetailsPaperContentCreateDetails + } + + @objc + public var asPaperContentPermanentlyDeleteDetails: DBXTeamLogEventDetailsPaperContentPermanentlyDeleteDetails? { + self as? DBXTeamLogEventDetailsPaperContentPermanentlyDeleteDetails + } + + @objc + public var asPaperContentRemoveFromFolderDetails: DBXTeamLogEventDetailsPaperContentRemoveFromFolderDetails? { + self as? DBXTeamLogEventDetailsPaperContentRemoveFromFolderDetails + } + + @objc + public var asPaperContentRemoveMemberDetails: DBXTeamLogEventDetailsPaperContentRemoveMemberDetails? { + self as? DBXTeamLogEventDetailsPaperContentRemoveMemberDetails + } + + @objc + public var asPaperContentRenameDetails: DBXTeamLogEventDetailsPaperContentRenameDetails? { + self as? DBXTeamLogEventDetailsPaperContentRenameDetails + } + + @objc + public var asPaperContentRestoreDetails: DBXTeamLogEventDetailsPaperContentRestoreDetails? { + self as? DBXTeamLogEventDetailsPaperContentRestoreDetails + } + + @objc + public var asPaperDocAddCommentDetails: DBXTeamLogEventDetailsPaperDocAddCommentDetails? { + self as? DBXTeamLogEventDetailsPaperDocAddCommentDetails + } + + @objc + public var asPaperDocChangeMemberRoleDetails: DBXTeamLogEventDetailsPaperDocChangeMemberRoleDetails? { + self as? DBXTeamLogEventDetailsPaperDocChangeMemberRoleDetails + } + + @objc + public var asPaperDocChangeSharingPolicyDetails: DBXTeamLogEventDetailsPaperDocChangeSharingPolicyDetails? { + self as? DBXTeamLogEventDetailsPaperDocChangeSharingPolicyDetails + } + + @objc + public var asPaperDocChangeSubscriptionDetails: DBXTeamLogEventDetailsPaperDocChangeSubscriptionDetails? { + self as? DBXTeamLogEventDetailsPaperDocChangeSubscriptionDetails + } + + @objc + public var asPaperDocDeletedDetails: DBXTeamLogEventDetailsPaperDocDeletedDetails? { + self as? DBXTeamLogEventDetailsPaperDocDeletedDetails + } + + @objc + public var asPaperDocDeleteCommentDetails: DBXTeamLogEventDetailsPaperDocDeleteCommentDetails? { + self as? DBXTeamLogEventDetailsPaperDocDeleteCommentDetails + } + + @objc + public var asPaperDocDownloadDetails: DBXTeamLogEventDetailsPaperDocDownloadDetails? { + self as? DBXTeamLogEventDetailsPaperDocDownloadDetails + } + + @objc + public var asPaperDocEditDetails: DBXTeamLogEventDetailsPaperDocEditDetails? { + self as? DBXTeamLogEventDetailsPaperDocEditDetails + } + + @objc + public var asPaperDocEditCommentDetails: DBXTeamLogEventDetailsPaperDocEditCommentDetails? { + self as? DBXTeamLogEventDetailsPaperDocEditCommentDetails + } + + @objc + public var asPaperDocFollowedDetails: DBXTeamLogEventDetailsPaperDocFollowedDetails? { + self as? DBXTeamLogEventDetailsPaperDocFollowedDetails + } + + @objc + public var asPaperDocMentionDetails: DBXTeamLogEventDetailsPaperDocMentionDetails? { + self as? DBXTeamLogEventDetailsPaperDocMentionDetails + } + + @objc + public var asPaperDocOwnershipChangedDetails: DBXTeamLogEventDetailsPaperDocOwnershipChangedDetails? { + self as? DBXTeamLogEventDetailsPaperDocOwnershipChangedDetails + } + + @objc + public var asPaperDocRequestAccessDetails: DBXTeamLogEventDetailsPaperDocRequestAccessDetails? { + self as? DBXTeamLogEventDetailsPaperDocRequestAccessDetails + } + + @objc + public var asPaperDocResolveCommentDetails: DBXTeamLogEventDetailsPaperDocResolveCommentDetails? { + self as? DBXTeamLogEventDetailsPaperDocResolveCommentDetails + } + + @objc + public var asPaperDocRevertDetails: DBXTeamLogEventDetailsPaperDocRevertDetails? { + self as? DBXTeamLogEventDetailsPaperDocRevertDetails + } + + @objc + public var asPaperDocSlackShareDetails: DBXTeamLogEventDetailsPaperDocSlackShareDetails? { + self as? DBXTeamLogEventDetailsPaperDocSlackShareDetails + } + + @objc + public var asPaperDocTeamInviteDetails: DBXTeamLogEventDetailsPaperDocTeamInviteDetails? { + self as? DBXTeamLogEventDetailsPaperDocTeamInviteDetails + } + + @objc + public var asPaperDocTrashedDetails: DBXTeamLogEventDetailsPaperDocTrashedDetails? { + self as? DBXTeamLogEventDetailsPaperDocTrashedDetails + } + + @objc + public var asPaperDocUnresolveCommentDetails: DBXTeamLogEventDetailsPaperDocUnresolveCommentDetails? { + self as? DBXTeamLogEventDetailsPaperDocUnresolveCommentDetails + } + + @objc + public var asPaperDocUntrashedDetails: DBXTeamLogEventDetailsPaperDocUntrashedDetails? { + self as? DBXTeamLogEventDetailsPaperDocUntrashedDetails + } + + @objc + public var asPaperDocViewDetails: DBXTeamLogEventDetailsPaperDocViewDetails? { + self as? DBXTeamLogEventDetailsPaperDocViewDetails + } + + @objc + public var asPaperExternalViewAllowDetails: DBXTeamLogEventDetailsPaperExternalViewAllowDetails? { + self as? DBXTeamLogEventDetailsPaperExternalViewAllowDetails + } + + @objc + public var asPaperExternalViewDefaultTeamDetails: DBXTeamLogEventDetailsPaperExternalViewDefaultTeamDetails? { + self as? DBXTeamLogEventDetailsPaperExternalViewDefaultTeamDetails + } + + @objc + public var asPaperExternalViewForbidDetails: DBXTeamLogEventDetailsPaperExternalViewForbidDetails? { + self as? DBXTeamLogEventDetailsPaperExternalViewForbidDetails + } + + @objc + public var asPaperFolderChangeSubscriptionDetails: DBXTeamLogEventDetailsPaperFolderChangeSubscriptionDetails? { + self as? DBXTeamLogEventDetailsPaperFolderChangeSubscriptionDetails + } + + @objc + public var asPaperFolderDeletedDetails: DBXTeamLogEventDetailsPaperFolderDeletedDetails? { + self as? DBXTeamLogEventDetailsPaperFolderDeletedDetails + } + + @objc + public var asPaperFolderFollowedDetails: DBXTeamLogEventDetailsPaperFolderFollowedDetails? { + self as? DBXTeamLogEventDetailsPaperFolderFollowedDetails + } + + @objc + public var asPaperFolderTeamInviteDetails: DBXTeamLogEventDetailsPaperFolderTeamInviteDetails? { + self as? DBXTeamLogEventDetailsPaperFolderTeamInviteDetails + } + + @objc + public var asPaperPublishedLinkChangePermissionDetails: DBXTeamLogEventDetailsPaperPublishedLinkChangePermissionDetails? { + self as? DBXTeamLogEventDetailsPaperPublishedLinkChangePermissionDetails + } + + @objc + public var asPaperPublishedLinkCreateDetails: DBXTeamLogEventDetailsPaperPublishedLinkCreateDetails? { + self as? DBXTeamLogEventDetailsPaperPublishedLinkCreateDetails + } + + @objc + public var asPaperPublishedLinkDisabledDetails: DBXTeamLogEventDetailsPaperPublishedLinkDisabledDetails? { + self as? DBXTeamLogEventDetailsPaperPublishedLinkDisabledDetails + } + + @objc + public var asPaperPublishedLinkViewDetails: DBXTeamLogEventDetailsPaperPublishedLinkViewDetails? { + self as? DBXTeamLogEventDetailsPaperPublishedLinkViewDetails + } + + @objc + public var asPasswordChangeDetails: DBXTeamLogEventDetailsPasswordChangeDetails? { + self as? DBXTeamLogEventDetailsPasswordChangeDetails + } + + @objc + public var asPasswordResetDetails: DBXTeamLogEventDetailsPasswordResetDetails? { + self as? DBXTeamLogEventDetailsPasswordResetDetails + } + + @objc + public var asPasswordResetAllDetails: DBXTeamLogEventDetailsPasswordResetAllDetails? { + self as? DBXTeamLogEventDetailsPasswordResetAllDetails + } + + @objc + public var asClassificationCreateReportDetails: DBXTeamLogEventDetailsClassificationCreateReportDetails? { + self as? DBXTeamLogEventDetailsClassificationCreateReportDetails + } + + @objc + public var asClassificationCreateReportFailDetails: DBXTeamLogEventDetailsClassificationCreateReportFailDetails? { + self as? DBXTeamLogEventDetailsClassificationCreateReportFailDetails + } + + @objc + public var asEmmCreateExceptionsReportDetails: DBXTeamLogEventDetailsEmmCreateExceptionsReportDetails? { + self as? DBXTeamLogEventDetailsEmmCreateExceptionsReportDetails + } + + @objc + public var asEmmCreateUsageReportDetails: DBXTeamLogEventDetailsEmmCreateUsageReportDetails? { + self as? DBXTeamLogEventDetailsEmmCreateUsageReportDetails + } + + @objc + public var asExportMembersReportDetails: DBXTeamLogEventDetailsExportMembersReportDetails? { + self as? DBXTeamLogEventDetailsExportMembersReportDetails + } + + @objc + public var asExportMembersReportFailDetails: DBXTeamLogEventDetailsExportMembersReportFailDetails? { + self as? DBXTeamLogEventDetailsExportMembersReportFailDetails + } + + @objc + public var asExternalSharingCreateReportDetails: DBXTeamLogEventDetailsExternalSharingCreateReportDetails? { + self as? DBXTeamLogEventDetailsExternalSharingCreateReportDetails + } + + @objc + public var asExternalSharingReportFailedDetails: DBXTeamLogEventDetailsExternalSharingReportFailedDetails? { + self as? DBXTeamLogEventDetailsExternalSharingReportFailedDetails + } + + @objc + public var asNoExpirationLinkGenCreateReportDetails: DBXTeamLogEventDetailsNoExpirationLinkGenCreateReportDetails? { + self as? DBXTeamLogEventDetailsNoExpirationLinkGenCreateReportDetails + } + + @objc + public var asNoExpirationLinkGenReportFailedDetails: DBXTeamLogEventDetailsNoExpirationLinkGenReportFailedDetails? { + self as? DBXTeamLogEventDetailsNoExpirationLinkGenReportFailedDetails + } + + @objc + public var asNoPasswordLinkGenCreateReportDetails: DBXTeamLogEventDetailsNoPasswordLinkGenCreateReportDetails? { + self as? DBXTeamLogEventDetailsNoPasswordLinkGenCreateReportDetails + } + + @objc + public var asNoPasswordLinkGenReportFailedDetails: DBXTeamLogEventDetailsNoPasswordLinkGenReportFailedDetails? { + self as? DBXTeamLogEventDetailsNoPasswordLinkGenReportFailedDetails + } + + @objc + public var asNoPasswordLinkViewCreateReportDetails: DBXTeamLogEventDetailsNoPasswordLinkViewCreateReportDetails? { + self as? DBXTeamLogEventDetailsNoPasswordLinkViewCreateReportDetails + } + + @objc + public var asNoPasswordLinkViewReportFailedDetails: DBXTeamLogEventDetailsNoPasswordLinkViewReportFailedDetails? { + self as? DBXTeamLogEventDetailsNoPasswordLinkViewReportFailedDetails + } + + @objc + public var asOutdatedLinkViewCreateReportDetails: DBXTeamLogEventDetailsOutdatedLinkViewCreateReportDetails? { + self as? DBXTeamLogEventDetailsOutdatedLinkViewCreateReportDetails + } + + @objc + public var asOutdatedLinkViewReportFailedDetails: DBXTeamLogEventDetailsOutdatedLinkViewReportFailedDetails? { + self as? DBXTeamLogEventDetailsOutdatedLinkViewReportFailedDetails + } + + @objc + public var asPaperAdminExportStartDetails: DBXTeamLogEventDetailsPaperAdminExportStartDetails? { + self as? DBXTeamLogEventDetailsPaperAdminExportStartDetails + } + + @objc + public var asRansomwareAlertCreateReportDetails: DBXTeamLogEventDetailsRansomwareAlertCreateReportDetails? { + self as? DBXTeamLogEventDetailsRansomwareAlertCreateReportDetails + } + + @objc + public var asRansomwareAlertCreateReportFailedDetails: DBXTeamLogEventDetailsRansomwareAlertCreateReportFailedDetails? { + self as? DBXTeamLogEventDetailsRansomwareAlertCreateReportFailedDetails + } + + @objc + public var asSmartSyncCreateAdminPrivilegeReportDetails: DBXTeamLogEventDetailsSmartSyncCreateAdminPrivilegeReportDetails? { + self as? DBXTeamLogEventDetailsSmartSyncCreateAdminPrivilegeReportDetails + } + + @objc + public var asTeamActivityCreateReportDetails: DBXTeamLogEventDetailsTeamActivityCreateReportDetails? { + self as? DBXTeamLogEventDetailsTeamActivityCreateReportDetails + } + + @objc + public var asTeamActivityCreateReportFailDetails: DBXTeamLogEventDetailsTeamActivityCreateReportFailDetails? { + self as? DBXTeamLogEventDetailsTeamActivityCreateReportFailDetails + } + + @objc + public var asCollectionShareDetails: DBXTeamLogEventDetailsCollectionShareDetails? { + self as? DBXTeamLogEventDetailsCollectionShareDetails + } + + @objc + public var asFileTransfersFileAddDetails: DBXTeamLogEventDetailsFileTransfersFileAddDetails? { + self as? DBXTeamLogEventDetailsFileTransfersFileAddDetails + } + + @objc + public var asFileTransfersTransferDeleteDetails: DBXTeamLogEventDetailsFileTransfersTransferDeleteDetails? { + self as? DBXTeamLogEventDetailsFileTransfersTransferDeleteDetails + } + + @objc + public var asFileTransfersTransferDownloadDetails: DBXTeamLogEventDetailsFileTransfersTransferDownloadDetails? { + self as? DBXTeamLogEventDetailsFileTransfersTransferDownloadDetails + } + + @objc + public var asFileTransfersTransferSendDetails: DBXTeamLogEventDetailsFileTransfersTransferSendDetails? { + self as? DBXTeamLogEventDetailsFileTransfersTransferSendDetails + } + + @objc + public var asFileTransfersTransferViewDetails: DBXTeamLogEventDetailsFileTransfersTransferViewDetails? { + self as? DBXTeamLogEventDetailsFileTransfersTransferViewDetails + } + + @objc + public var asNoteAclInviteOnlyDetails: DBXTeamLogEventDetailsNoteAclInviteOnlyDetails? { + self as? DBXTeamLogEventDetailsNoteAclInviteOnlyDetails + } + + @objc + public var asNoteAclLinkDetails: DBXTeamLogEventDetailsNoteAclLinkDetails? { + self as? DBXTeamLogEventDetailsNoteAclLinkDetails + } + + @objc + public var asNoteAclTeamLinkDetails: DBXTeamLogEventDetailsNoteAclTeamLinkDetails? { + self as? DBXTeamLogEventDetailsNoteAclTeamLinkDetails + } + + @objc + public var asNoteSharedDetails: DBXTeamLogEventDetailsNoteSharedDetails? { + self as? DBXTeamLogEventDetailsNoteSharedDetails + } + + @objc + public var asNoteShareReceiveDetails: DBXTeamLogEventDetailsNoteShareReceiveDetails? { + self as? DBXTeamLogEventDetailsNoteShareReceiveDetails + } + + @objc + public var asOpenNoteSharedDetails: DBXTeamLogEventDetailsOpenNoteSharedDetails? { + self as? DBXTeamLogEventDetailsOpenNoteSharedDetails + } + + @objc + public var asReplayFileSharedLinkCreatedDetails: DBXTeamLogEventDetailsReplayFileSharedLinkCreatedDetails? { + self as? DBXTeamLogEventDetailsReplayFileSharedLinkCreatedDetails + } + + @objc + public var asReplayFileSharedLinkModifiedDetails: DBXTeamLogEventDetailsReplayFileSharedLinkModifiedDetails? { + self as? DBXTeamLogEventDetailsReplayFileSharedLinkModifiedDetails + } + + @objc + public var asReplayProjectTeamAddDetails: DBXTeamLogEventDetailsReplayProjectTeamAddDetails? { + self as? DBXTeamLogEventDetailsReplayProjectTeamAddDetails + } + + @objc + public var asReplayProjectTeamDeleteDetails: DBXTeamLogEventDetailsReplayProjectTeamDeleteDetails? { + self as? DBXTeamLogEventDetailsReplayProjectTeamDeleteDetails + } + + @objc + public var asSfAddGroupDetails: DBXTeamLogEventDetailsSfAddGroupDetails? { + self as? DBXTeamLogEventDetailsSfAddGroupDetails + } + + @objc + public var asSfAllowNonMembersToViewSharedLinksDetails: DBXTeamLogEventDetailsSfAllowNonMembersToViewSharedLinksDetails? { + self as? DBXTeamLogEventDetailsSfAllowNonMembersToViewSharedLinksDetails + } + + @objc + public var asSfExternalInviteWarnDetails: DBXTeamLogEventDetailsSfExternalInviteWarnDetails? { + self as? DBXTeamLogEventDetailsSfExternalInviteWarnDetails + } + + @objc + public var asSfFbInviteDetails: DBXTeamLogEventDetailsSfFbInviteDetails? { + self as? DBXTeamLogEventDetailsSfFbInviteDetails + } + + @objc + public var asSfFbInviteChangeRoleDetails: DBXTeamLogEventDetailsSfFbInviteChangeRoleDetails? { + self as? DBXTeamLogEventDetailsSfFbInviteChangeRoleDetails + } + + @objc + public var asSfFbUninviteDetails: DBXTeamLogEventDetailsSfFbUninviteDetails? { + self as? DBXTeamLogEventDetailsSfFbUninviteDetails + } + + @objc + public var asSfInviteGroupDetails: DBXTeamLogEventDetailsSfInviteGroupDetails? { + self as? DBXTeamLogEventDetailsSfInviteGroupDetails + } + + @objc + public var asSfTeamGrantAccessDetails: DBXTeamLogEventDetailsSfTeamGrantAccessDetails? { + self as? DBXTeamLogEventDetailsSfTeamGrantAccessDetails + } + + @objc + public var asSfTeamInviteDetails: DBXTeamLogEventDetailsSfTeamInviteDetails? { + self as? DBXTeamLogEventDetailsSfTeamInviteDetails + } + + @objc + public var asSfTeamInviteChangeRoleDetails: DBXTeamLogEventDetailsSfTeamInviteChangeRoleDetails? { + self as? DBXTeamLogEventDetailsSfTeamInviteChangeRoleDetails + } + + @objc + public var asSfTeamJoinDetails: DBXTeamLogEventDetailsSfTeamJoinDetails? { + self as? DBXTeamLogEventDetailsSfTeamJoinDetails + } + + @objc + public var asSfTeamJoinFromOobLinkDetails: DBXTeamLogEventDetailsSfTeamJoinFromOobLinkDetails? { + self as? DBXTeamLogEventDetailsSfTeamJoinFromOobLinkDetails + } + + @objc + public var asSfTeamUninviteDetails: DBXTeamLogEventDetailsSfTeamUninviteDetails? { + self as? DBXTeamLogEventDetailsSfTeamUninviteDetails + } + + @objc + public var asSharedContentAddInviteesDetails: DBXTeamLogEventDetailsSharedContentAddInviteesDetails? { + self as? DBXTeamLogEventDetailsSharedContentAddInviteesDetails + } + + @objc + public var asSharedContentAddLinkExpiryDetails: DBXTeamLogEventDetailsSharedContentAddLinkExpiryDetails? { + self as? DBXTeamLogEventDetailsSharedContentAddLinkExpiryDetails + } + + @objc + public var asSharedContentAddLinkPasswordDetails: DBXTeamLogEventDetailsSharedContentAddLinkPasswordDetails? { + self as? DBXTeamLogEventDetailsSharedContentAddLinkPasswordDetails + } + + @objc + public var asSharedContentAddMemberDetails: DBXTeamLogEventDetailsSharedContentAddMemberDetails? { + self as? DBXTeamLogEventDetailsSharedContentAddMemberDetails + } + + @objc + public var asSharedContentChangeDownloadsPolicyDetails: DBXTeamLogEventDetailsSharedContentChangeDownloadsPolicyDetails? { + self as? DBXTeamLogEventDetailsSharedContentChangeDownloadsPolicyDetails + } + + @objc + public var asSharedContentChangeInviteeRoleDetails: DBXTeamLogEventDetailsSharedContentChangeInviteeRoleDetails? { + self as? DBXTeamLogEventDetailsSharedContentChangeInviteeRoleDetails + } + + @objc + public var asSharedContentChangeLinkAudienceDetails: DBXTeamLogEventDetailsSharedContentChangeLinkAudienceDetails? { + self as? DBXTeamLogEventDetailsSharedContentChangeLinkAudienceDetails + } + + @objc + public var asSharedContentChangeLinkExpiryDetails: DBXTeamLogEventDetailsSharedContentChangeLinkExpiryDetails? { + self as? DBXTeamLogEventDetailsSharedContentChangeLinkExpiryDetails + } + + @objc + public var asSharedContentChangeLinkPasswordDetails: DBXTeamLogEventDetailsSharedContentChangeLinkPasswordDetails? { + self as? DBXTeamLogEventDetailsSharedContentChangeLinkPasswordDetails + } + + @objc + public var asSharedContentChangeMemberRoleDetails: DBXTeamLogEventDetailsSharedContentChangeMemberRoleDetails? { + self as? DBXTeamLogEventDetailsSharedContentChangeMemberRoleDetails + } + + @objc + public var asSharedContentChangeViewerInfoPolicyDetails: DBXTeamLogEventDetailsSharedContentChangeViewerInfoPolicyDetails? { + self as? DBXTeamLogEventDetailsSharedContentChangeViewerInfoPolicyDetails + } + + @objc + public var asSharedContentClaimInvitationDetails: DBXTeamLogEventDetailsSharedContentClaimInvitationDetails? { + self as? DBXTeamLogEventDetailsSharedContentClaimInvitationDetails + } + + @objc + public var asSharedContentCopyDetails: DBXTeamLogEventDetailsSharedContentCopyDetails? { + self as? DBXTeamLogEventDetailsSharedContentCopyDetails + } + + @objc + public var asSharedContentDownloadDetails: DBXTeamLogEventDetailsSharedContentDownloadDetails? { + self as? DBXTeamLogEventDetailsSharedContentDownloadDetails + } + + @objc + public var asSharedContentRelinquishMembershipDetails: DBXTeamLogEventDetailsSharedContentRelinquishMembershipDetails? { + self as? DBXTeamLogEventDetailsSharedContentRelinquishMembershipDetails + } + + @objc + public var asSharedContentRemoveInviteesDetails: DBXTeamLogEventDetailsSharedContentRemoveInviteesDetails? { + self as? DBXTeamLogEventDetailsSharedContentRemoveInviteesDetails + } + + @objc + public var asSharedContentRemoveLinkExpiryDetails: DBXTeamLogEventDetailsSharedContentRemoveLinkExpiryDetails? { + self as? DBXTeamLogEventDetailsSharedContentRemoveLinkExpiryDetails + } + + @objc + public var asSharedContentRemoveLinkPasswordDetails: DBXTeamLogEventDetailsSharedContentRemoveLinkPasswordDetails? { + self as? DBXTeamLogEventDetailsSharedContentRemoveLinkPasswordDetails + } + + @objc + public var asSharedContentRemoveMemberDetails: DBXTeamLogEventDetailsSharedContentRemoveMemberDetails? { + self as? DBXTeamLogEventDetailsSharedContentRemoveMemberDetails + } + + @objc + public var asSharedContentRequestAccessDetails: DBXTeamLogEventDetailsSharedContentRequestAccessDetails? { + self as? DBXTeamLogEventDetailsSharedContentRequestAccessDetails + } + + @objc + public var asSharedContentRestoreInviteesDetails: DBXTeamLogEventDetailsSharedContentRestoreInviteesDetails? { + self as? DBXTeamLogEventDetailsSharedContentRestoreInviteesDetails + } + + @objc + public var asSharedContentRestoreMemberDetails: DBXTeamLogEventDetailsSharedContentRestoreMemberDetails? { + self as? DBXTeamLogEventDetailsSharedContentRestoreMemberDetails + } + + @objc + public var asSharedContentUnshareDetails: DBXTeamLogEventDetailsSharedContentUnshareDetails? { + self as? DBXTeamLogEventDetailsSharedContentUnshareDetails + } + + @objc + public var asSharedContentViewDetails: DBXTeamLogEventDetailsSharedContentViewDetails? { + self as? DBXTeamLogEventDetailsSharedContentViewDetails + } + + @objc + public var asSharedFolderChangeLinkPolicyDetails: DBXTeamLogEventDetailsSharedFolderChangeLinkPolicyDetails? { + self as? DBXTeamLogEventDetailsSharedFolderChangeLinkPolicyDetails + } + + @objc + public var asSharedFolderChangeMembersInheritancePolicyDetails: DBXTeamLogEventDetailsSharedFolderChangeMembersInheritancePolicyDetails? { + self as? DBXTeamLogEventDetailsSharedFolderChangeMembersInheritancePolicyDetails + } + + @objc + public var asSharedFolderChangeMembersManagementPolicyDetails: DBXTeamLogEventDetailsSharedFolderChangeMembersManagementPolicyDetails? { + self as? DBXTeamLogEventDetailsSharedFolderChangeMembersManagementPolicyDetails + } + + @objc + public var asSharedFolderChangeMembersPolicyDetails: DBXTeamLogEventDetailsSharedFolderChangeMembersPolicyDetails? { + self as? DBXTeamLogEventDetailsSharedFolderChangeMembersPolicyDetails + } + + @objc + public var asSharedFolderCreateDetails: DBXTeamLogEventDetailsSharedFolderCreateDetails? { + self as? DBXTeamLogEventDetailsSharedFolderCreateDetails + } + + @objc + public var asSharedFolderDeclineInvitationDetails: DBXTeamLogEventDetailsSharedFolderDeclineInvitationDetails? { + self as? DBXTeamLogEventDetailsSharedFolderDeclineInvitationDetails + } + + @objc + public var asSharedFolderMountDetails: DBXTeamLogEventDetailsSharedFolderMountDetails? { + self as? DBXTeamLogEventDetailsSharedFolderMountDetails + } + + @objc + public var asSharedFolderNestDetails: DBXTeamLogEventDetailsSharedFolderNestDetails? { + self as? DBXTeamLogEventDetailsSharedFolderNestDetails + } + + @objc + public var asSharedFolderTransferOwnershipDetails: DBXTeamLogEventDetailsSharedFolderTransferOwnershipDetails? { + self as? DBXTeamLogEventDetailsSharedFolderTransferOwnershipDetails + } + + @objc + public var asSharedFolderUnmountDetails: DBXTeamLogEventDetailsSharedFolderUnmountDetails? { + self as? DBXTeamLogEventDetailsSharedFolderUnmountDetails + } + + @objc + public var asSharedLinkAddExpiryDetails: DBXTeamLogEventDetailsSharedLinkAddExpiryDetails? { + self as? DBXTeamLogEventDetailsSharedLinkAddExpiryDetails + } + + @objc + public var asSharedLinkChangeExpiryDetails: DBXTeamLogEventDetailsSharedLinkChangeExpiryDetails? { + self as? DBXTeamLogEventDetailsSharedLinkChangeExpiryDetails + } + + @objc + public var asSharedLinkChangeVisibilityDetails: DBXTeamLogEventDetailsSharedLinkChangeVisibilityDetails? { + self as? DBXTeamLogEventDetailsSharedLinkChangeVisibilityDetails + } + + @objc + public var asSharedLinkCopyDetails: DBXTeamLogEventDetailsSharedLinkCopyDetails? { + self as? DBXTeamLogEventDetailsSharedLinkCopyDetails + } + + @objc + public var asSharedLinkCreateDetails: DBXTeamLogEventDetailsSharedLinkCreateDetails? { + self as? DBXTeamLogEventDetailsSharedLinkCreateDetails + } + + @objc + public var asSharedLinkDisableDetails: DBXTeamLogEventDetailsSharedLinkDisableDetails? { + self as? DBXTeamLogEventDetailsSharedLinkDisableDetails + } + + @objc + public var asSharedLinkDownloadDetails: DBXTeamLogEventDetailsSharedLinkDownloadDetails? { + self as? DBXTeamLogEventDetailsSharedLinkDownloadDetails + } + + @objc + public var asSharedLinkRemoveExpiryDetails: DBXTeamLogEventDetailsSharedLinkRemoveExpiryDetails? { + self as? DBXTeamLogEventDetailsSharedLinkRemoveExpiryDetails + } + + @objc + public var asSharedLinkSettingsAddExpirationDetails: DBXTeamLogEventDetailsSharedLinkSettingsAddExpirationDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsAddExpirationDetails + } + + @objc + public var asSharedLinkSettingsAddPasswordDetails: DBXTeamLogEventDetailsSharedLinkSettingsAddPasswordDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsAddPasswordDetails + } + + @objc + public var asSharedLinkSettingsAllowDownloadDisabledDetails: DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadDisabledDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadDisabledDetails + } + + @objc + public var asSharedLinkSettingsAllowDownloadEnabledDetails: DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadEnabledDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadEnabledDetails + } + + @objc + public var asSharedLinkSettingsChangeAudienceDetails: DBXTeamLogEventDetailsSharedLinkSettingsChangeAudienceDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsChangeAudienceDetails + } + + @objc + public var asSharedLinkSettingsChangeExpirationDetails: DBXTeamLogEventDetailsSharedLinkSettingsChangeExpirationDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsChangeExpirationDetails + } + + @objc + public var asSharedLinkSettingsChangePasswordDetails: DBXTeamLogEventDetailsSharedLinkSettingsChangePasswordDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsChangePasswordDetails + } + + @objc + public var asSharedLinkSettingsRemoveExpirationDetails: DBXTeamLogEventDetailsSharedLinkSettingsRemoveExpirationDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsRemoveExpirationDetails + } + + @objc + public var asSharedLinkSettingsRemovePasswordDetails: DBXTeamLogEventDetailsSharedLinkSettingsRemovePasswordDetails? { + self as? DBXTeamLogEventDetailsSharedLinkSettingsRemovePasswordDetails + } + + @objc + public var asSharedLinkShareDetails: DBXTeamLogEventDetailsSharedLinkShareDetails? { + self as? DBXTeamLogEventDetailsSharedLinkShareDetails + } + + @objc + public var asSharedLinkViewDetails: DBXTeamLogEventDetailsSharedLinkViewDetails? { + self as? DBXTeamLogEventDetailsSharedLinkViewDetails + } + + @objc + public var asSharedNoteOpenedDetails: DBXTeamLogEventDetailsSharedNoteOpenedDetails? { + self as? DBXTeamLogEventDetailsSharedNoteOpenedDetails + } + + @objc + public var asShmodelDisableDownloadsDetails: DBXTeamLogEventDetailsShmodelDisableDownloadsDetails? { + self as? DBXTeamLogEventDetailsShmodelDisableDownloadsDetails + } + + @objc + public var asShmodelEnableDownloadsDetails: DBXTeamLogEventDetailsShmodelEnableDownloadsDetails? { + self as? DBXTeamLogEventDetailsShmodelEnableDownloadsDetails + } + + @objc + public var asShmodelGroupShareDetails: DBXTeamLogEventDetailsShmodelGroupShareDetails? { + self as? DBXTeamLogEventDetailsShmodelGroupShareDetails + } + + @objc + public var asShowcaseAccessGrantedDetails: DBXTeamLogEventDetailsShowcaseAccessGrantedDetails? { + self as? DBXTeamLogEventDetailsShowcaseAccessGrantedDetails + } + + @objc + public var asShowcaseAddMemberDetails: DBXTeamLogEventDetailsShowcaseAddMemberDetails? { + self as? DBXTeamLogEventDetailsShowcaseAddMemberDetails + } + + @objc + public var asShowcaseArchivedDetails: DBXTeamLogEventDetailsShowcaseArchivedDetails? { + self as? DBXTeamLogEventDetailsShowcaseArchivedDetails + } + + @objc + public var asShowcaseCreatedDetails: DBXTeamLogEventDetailsShowcaseCreatedDetails? { + self as? DBXTeamLogEventDetailsShowcaseCreatedDetails + } + + @objc + public var asShowcaseDeleteCommentDetails: DBXTeamLogEventDetailsShowcaseDeleteCommentDetails? { + self as? DBXTeamLogEventDetailsShowcaseDeleteCommentDetails + } + + @objc + public var asShowcaseEditedDetails: DBXTeamLogEventDetailsShowcaseEditedDetails? { + self as? DBXTeamLogEventDetailsShowcaseEditedDetails + } + + @objc + public var asShowcaseEditCommentDetails: DBXTeamLogEventDetailsShowcaseEditCommentDetails? { + self as? DBXTeamLogEventDetailsShowcaseEditCommentDetails + } + + @objc + public var asShowcaseFileAddedDetails: DBXTeamLogEventDetailsShowcaseFileAddedDetails? { + self as? DBXTeamLogEventDetailsShowcaseFileAddedDetails + } + + @objc + public var asShowcaseFileDownloadDetails: DBXTeamLogEventDetailsShowcaseFileDownloadDetails? { + self as? DBXTeamLogEventDetailsShowcaseFileDownloadDetails + } + + @objc + public var asShowcaseFileRemovedDetails: DBXTeamLogEventDetailsShowcaseFileRemovedDetails? { + self as? DBXTeamLogEventDetailsShowcaseFileRemovedDetails + } + + @objc + public var asShowcaseFileViewDetails: DBXTeamLogEventDetailsShowcaseFileViewDetails? { + self as? DBXTeamLogEventDetailsShowcaseFileViewDetails + } + + @objc + public var asShowcasePermanentlyDeletedDetails: DBXTeamLogEventDetailsShowcasePermanentlyDeletedDetails? { + self as? DBXTeamLogEventDetailsShowcasePermanentlyDeletedDetails + } + + @objc + public var asShowcasePostCommentDetails: DBXTeamLogEventDetailsShowcasePostCommentDetails? { + self as? DBXTeamLogEventDetailsShowcasePostCommentDetails + } + + @objc + public var asShowcaseRemoveMemberDetails: DBXTeamLogEventDetailsShowcaseRemoveMemberDetails? { + self as? DBXTeamLogEventDetailsShowcaseRemoveMemberDetails + } + + @objc + public var asShowcaseRenamedDetails: DBXTeamLogEventDetailsShowcaseRenamedDetails? { + self as? DBXTeamLogEventDetailsShowcaseRenamedDetails + } + + @objc + public var asShowcaseRequestAccessDetails: DBXTeamLogEventDetailsShowcaseRequestAccessDetails? { + self as? DBXTeamLogEventDetailsShowcaseRequestAccessDetails + } + + @objc + public var asShowcaseResolveCommentDetails: DBXTeamLogEventDetailsShowcaseResolveCommentDetails? { + self as? DBXTeamLogEventDetailsShowcaseResolveCommentDetails + } + + @objc + public var asShowcaseRestoredDetails: DBXTeamLogEventDetailsShowcaseRestoredDetails? { + self as? DBXTeamLogEventDetailsShowcaseRestoredDetails + } + + @objc + public var asShowcaseTrashedDetails: DBXTeamLogEventDetailsShowcaseTrashedDetails? { + self as? DBXTeamLogEventDetailsShowcaseTrashedDetails + } + + @objc + public var asShowcaseTrashedDeprecatedDetails: DBXTeamLogEventDetailsShowcaseTrashedDeprecatedDetails? { + self as? DBXTeamLogEventDetailsShowcaseTrashedDeprecatedDetails + } + + @objc + public var asShowcaseUnresolveCommentDetails: DBXTeamLogEventDetailsShowcaseUnresolveCommentDetails? { + self as? DBXTeamLogEventDetailsShowcaseUnresolveCommentDetails + } + + @objc + public var asShowcaseUntrashedDetails: DBXTeamLogEventDetailsShowcaseUntrashedDetails? { + self as? DBXTeamLogEventDetailsShowcaseUntrashedDetails + } + + @objc + public var asShowcaseUntrashedDeprecatedDetails: DBXTeamLogEventDetailsShowcaseUntrashedDeprecatedDetails? { + self as? DBXTeamLogEventDetailsShowcaseUntrashedDeprecatedDetails + } + + @objc + public var asShowcaseViewDetails: DBXTeamLogEventDetailsShowcaseViewDetails? { + self as? DBXTeamLogEventDetailsShowcaseViewDetails + } + + @objc + public var asSsoAddCertDetails: DBXTeamLogEventDetailsSsoAddCertDetails? { + self as? DBXTeamLogEventDetailsSsoAddCertDetails + } + + @objc + public var asSsoAddLoginUrlDetails: DBXTeamLogEventDetailsSsoAddLoginUrlDetails? { + self as? DBXTeamLogEventDetailsSsoAddLoginUrlDetails + } + + @objc + public var asSsoAddLogoutUrlDetails: DBXTeamLogEventDetailsSsoAddLogoutUrlDetails? { + self as? DBXTeamLogEventDetailsSsoAddLogoutUrlDetails + } + + @objc + public var asSsoChangeCertDetails: DBXTeamLogEventDetailsSsoChangeCertDetails? { + self as? DBXTeamLogEventDetailsSsoChangeCertDetails + } + + @objc + public var asSsoChangeLoginUrlDetails: DBXTeamLogEventDetailsSsoChangeLoginUrlDetails? { + self as? DBXTeamLogEventDetailsSsoChangeLoginUrlDetails + } + + @objc + public var asSsoChangeLogoutUrlDetails: DBXTeamLogEventDetailsSsoChangeLogoutUrlDetails? { + self as? DBXTeamLogEventDetailsSsoChangeLogoutUrlDetails + } + + @objc + public var asSsoChangeSamlIdentityModeDetails: DBXTeamLogEventDetailsSsoChangeSamlIdentityModeDetails? { + self as? DBXTeamLogEventDetailsSsoChangeSamlIdentityModeDetails + } + + @objc + public var asSsoRemoveCertDetails: DBXTeamLogEventDetailsSsoRemoveCertDetails? { + self as? DBXTeamLogEventDetailsSsoRemoveCertDetails + } + + @objc + public var asSsoRemoveLoginUrlDetails: DBXTeamLogEventDetailsSsoRemoveLoginUrlDetails? { + self as? DBXTeamLogEventDetailsSsoRemoveLoginUrlDetails + } + + @objc + public var asSsoRemoveLogoutUrlDetails: DBXTeamLogEventDetailsSsoRemoveLogoutUrlDetails? { + self as? DBXTeamLogEventDetailsSsoRemoveLogoutUrlDetails + } + + @objc + public var asTeamFolderChangeStatusDetails: DBXTeamLogEventDetailsTeamFolderChangeStatusDetails? { + self as? DBXTeamLogEventDetailsTeamFolderChangeStatusDetails + } + + @objc + public var asTeamFolderCreateDetails: DBXTeamLogEventDetailsTeamFolderCreateDetails? { + self as? DBXTeamLogEventDetailsTeamFolderCreateDetails + } + + @objc + public var asTeamFolderDowngradeDetails: DBXTeamLogEventDetailsTeamFolderDowngradeDetails? { + self as? DBXTeamLogEventDetailsTeamFolderDowngradeDetails + } + + @objc + public var asTeamFolderPermanentlyDeleteDetails: DBXTeamLogEventDetailsTeamFolderPermanentlyDeleteDetails? { + self as? DBXTeamLogEventDetailsTeamFolderPermanentlyDeleteDetails + } + + @objc + public var asTeamFolderRenameDetails: DBXTeamLogEventDetailsTeamFolderRenameDetails? { + self as? DBXTeamLogEventDetailsTeamFolderRenameDetails + } + + @objc + public var asTeamSelectiveSyncSettingsChangedDetails: DBXTeamLogEventDetailsTeamSelectiveSyncSettingsChangedDetails? { + self as? DBXTeamLogEventDetailsTeamSelectiveSyncSettingsChangedDetails + } + + @objc + public var asAccountCaptureChangePolicyDetails: DBXTeamLogEventDetailsAccountCaptureChangePolicyDetails? { + self as? DBXTeamLogEventDetailsAccountCaptureChangePolicyDetails + } + + @objc + public var asAdminEmailRemindersChangedDetails: DBXTeamLogEventDetailsAdminEmailRemindersChangedDetails? { + self as? DBXTeamLogEventDetailsAdminEmailRemindersChangedDetails + } + + @objc + public var asAllowDownloadDisabledDetails: DBXTeamLogEventDetailsAllowDownloadDisabledDetails? { + self as? DBXTeamLogEventDetailsAllowDownloadDisabledDetails + } + + @objc + public var asAllowDownloadEnabledDetails: DBXTeamLogEventDetailsAllowDownloadEnabledDetails? { + self as? DBXTeamLogEventDetailsAllowDownloadEnabledDetails + } + + @objc + public var asAppPermissionsChangedDetails: DBXTeamLogEventDetailsAppPermissionsChangedDetails? { + self as? DBXTeamLogEventDetailsAppPermissionsChangedDetails + } + + @objc + public var asCameraUploadsPolicyChangedDetails: DBXTeamLogEventDetailsCameraUploadsPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsCameraUploadsPolicyChangedDetails + } + + @objc + public var asCaptureTranscriptPolicyChangedDetails: DBXTeamLogEventDetailsCaptureTranscriptPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsCaptureTranscriptPolicyChangedDetails + } + + @objc + public var asClassificationChangePolicyDetails: DBXTeamLogEventDetailsClassificationChangePolicyDetails? { + self as? DBXTeamLogEventDetailsClassificationChangePolicyDetails + } + + @objc + public var asComputerBackupPolicyChangedDetails: DBXTeamLogEventDetailsComputerBackupPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsComputerBackupPolicyChangedDetails + } + + @objc + public var asContentAdministrationPolicyChangedDetails: DBXTeamLogEventDetailsContentAdministrationPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsContentAdministrationPolicyChangedDetails + } + + @objc + public var asDataPlacementRestrictionChangePolicyDetails: DBXTeamLogEventDetailsDataPlacementRestrictionChangePolicyDetails? { + self as? DBXTeamLogEventDetailsDataPlacementRestrictionChangePolicyDetails + } + + @objc + public var asDataPlacementRestrictionSatisfyPolicyDetails: DBXTeamLogEventDetailsDataPlacementRestrictionSatisfyPolicyDetails? { + self as? DBXTeamLogEventDetailsDataPlacementRestrictionSatisfyPolicyDetails + } + + @objc + public var asDeviceApprovalsAddExceptionDetails: DBXTeamLogEventDetailsDeviceApprovalsAddExceptionDetails? { + self as? DBXTeamLogEventDetailsDeviceApprovalsAddExceptionDetails + } + + @objc + public var asDeviceApprovalsChangeDesktopPolicyDetails: DBXTeamLogEventDetailsDeviceApprovalsChangeDesktopPolicyDetails? { + self as? DBXTeamLogEventDetailsDeviceApprovalsChangeDesktopPolicyDetails + } + + @objc + public var asDeviceApprovalsChangeMobilePolicyDetails: DBXTeamLogEventDetailsDeviceApprovalsChangeMobilePolicyDetails? { + self as? DBXTeamLogEventDetailsDeviceApprovalsChangeMobilePolicyDetails + } + + @objc + public var asDeviceApprovalsChangeOverageActionDetails: DBXTeamLogEventDetailsDeviceApprovalsChangeOverageActionDetails? { + self as? DBXTeamLogEventDetailsDeviceApprovalsChangeOverageActionDetails + } + + @objc + public var asDeviceApprovalsChangeUnlinkActionDetails: DBXTeamLogEventDetailsDeviceApprovalsChangeUnlinkActionDetails? { + self as? DBXTeamLogEventDetailsDeviceApprovalsChangeUnlinkActionDetails + } + + @objc + public var asDeviceApprovalsRemoveExceptionDetails: DBXTeamLogEventDetailsDeviceApprovalsRemoveExceptionDetails? { + self as? DBXTeamLogEventDetailsDeviceApprovalsRemoveExceptionDetails + } + + @objc + public var asDirectoryRestrictionsAddMembersDetails: DBXTeamLogEventDetailsDirectoryRestrictionsAddMembersDetails? { + self as? DBXTeamLogEventDetailsDirectoryRestrictionsAddMembersDetails + } + + @objc + public var asDirectoryRestrictionsRemoveMembersDetails: DBXTeamLogEventDetailsDirectoryRestrictionsRemoveMembersDetails? { + self as? DBXTeamLogEventDetailsDirectoryRestrictionsRemoveMembersDetails + } + + @objc + public var asDropboxPasswordsPolicyChangedDetails: DBXTeamLogEventDetailsDropboxPasswordsPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsDropboxPasswordsPolicyChangedDetails + } + + @objc + public var asEmailIngestPolicyChangedDetails: DBXTeamLogEventDetailsEmailIngestPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsEmailIngestPolicyChangedDetails + } + + @objc + public var asEmmAddExceptionDetails: DBXTeamLogEventDetailsEmmAddExceptionDetails? { + self as? DBXTeamLogEventDetailsEmmAddExceptionDetails + } + + @objc + public var asEmmChangePolicyDetails: DBXTeamLogEventDetailsEmmChangePolicyDetails? { + self as? DBXTeamLogEventDetailsEmmChangePolicyDetails + } + + @objc + public var asEmmRemoveExceptionDetails: DBXTeamLogEventDetailsEmmRemoveExceptionDetails? { + self as? DBXTeamLogEventDetailsEmmRemoveExceptionDetails + } + + @objc + public var asExtendedVersionHistoryChangePolicyDetails: DBXTeamLogEventDetailsExtendedVersionHistoryChangePolicyDetails? { + self as? DBXTeamLogEventDetailsExtendedVersionHistoryChangePolicyDetails + } + + @objc + public var asExternalDriveBackupPolicyChangedDetails: DBXTeamLogEventDetailsExternalDriveBackupPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsExternalDriveBackupPolicyChangedDetails + } + + @objc + public var asFileCommentsChangePolicyDetails: DBXTeamLogEventDetailsFileCommentsChangePolicyDetails? { + self as? DBXTeamLogEventDetailsFileCommentsChangePolicyDetails + } + + @objc + public var asFileLockingPolicyChangedDetails: DBXTeamLogEventDetailsFileLockingPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsFileLockingPolicyChangedDetails + } + + @objc + public var asFileProviderMigrationPolicyChangedDetails: DBXTeamLogEventDetailsFileProviderMigrationPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsFileProviderMigrationPolicyChangedDetails + } + + @objc + public var asFileRequestsChangePolicyDetails: DBXTeamLogEventDetailsFileRequestsChangePolicyDetails? { + self as? DBXTeamLogEventDetailsFileRequestsChangePolicyDetails + } + + @objc + public var asFileRequestsEmailsEnabledDetails: DBXTeamLogEventDetailsFileRequestsEmailsEnabledDetails? { + self as? DBXTeamLogEventDetailsFileRequestsEmailsEnabledDetails + } + + @objc + public var asFileRequestsEmailsRestrictedToTeamOnlyDetails: DBXTeamLogEventDetailsFileRequestsEmailsRestrictedToTeamOnlyDetails? { + self as? DBXTeamLogEventDetailsFileRequestsEmailsRestrictedToTeamOnlyDetails + } + + @objc + public var asFileTransfersPolicyChangedDetails: DBXTeamLogEventDetailsFileTransfersPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsFileTransfersPolicyChangedDetails + } + + @objc + public var asFolderLinkRestrictionPolicyChangedDetails: DBXTeamLogEventDetailsFolderLinkRestrictionPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsFolderLinkRestrictionPolicyChangedDetails + } + + @objc + public var asGoogleSsoChangePolicyDetails: DBXTeamLogEventDetailsGoogleSsoChangePolicyDetails? { + self as? DBXTeamLogEventDetailsGoogleSsoChangePolicyDetails + } + + @objc + public var asGroupUserManagementChangePolicyDetails: DBXTeamLogEventDetailsGroupUserManagementChangePolicyDetails? { + self as? DBXTeamLogEventDetailsGroupUserManagementChangePolicyDetails + } + + @objc + public var asIntegrationPolicyChangedDetails: DBXTeamLogEventDetailsIntegrationPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsIntegrationPolicyChangedDetails + } + + @objc + public var asInviteAcceptanceEmailPolicyChangedDetails: DBXTeamLogEventDetailsInviteAcceptanceEmailPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsInviteAcceptanceEmailPolicyChangedDetails + } + + @objc + public var asMemberRequestsChangePolicyDetails: DBXTeamLogEventDetailsMemberRequestsChangePolicyDetails? { + self as? DBXTeamLogEventDetailsMemberRequestsChangePolicyDetails + } + + @objc + public var asMemberSendInvitePolicyChangedDetails: DBXTeamLogEventDetailsMemberSendInvitePolicyChangedDetails? { + self as? DBXTeamLogEventDetailsMemberSendInvitePolicyChangedDetails + } + + @objc + public var asMemberSpaceLimitsAddExceptionDetails: DBXTeamLogEventDetailsMemberSpaceLimitsAddExceptionDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsAddExceptionDetails + } + + @objc + public var asMemberSpaceLimitsChangeCapsTypePolicyDetails: DBXTeamLogEventDetailsMemberSpaceLimitsChangeCapsTypePolicyDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsChangeCapsTypePolicyDetails + } + + @objc + public var asMemberSpaceLimitsChangePolicyDetails: DBXTeamLogEventDetailsMemberSpaceLimitsChangePolicyDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsChangePolicyDetails + } + + @objc + public var asMemberSpaceLimitsRemoveExceptionDetails: DBXTeamLogEventDetailsMemberSpaceLimitsRemoveExceptionDetails? { + self as? DBXTeamLogEventDetailsMemberSpaceLimitsRemoveExceptionDetails + } + + @objc + public var asMemberSuggestionsChangePolicyDetails: DBXTeamLogEventDetailsMemberSuggestionsChangePolicyDetails? { + self as? DBXTeamLogEventDetailsMemberSuggestionsChangePolicyDetails + } + + @objc + public var asMicrosoftOfficeAddinChangePolicyDetails: DBXTeamLogEventDetailsMicrosoftOfficeAddinChangePolicyDetails? { + self as? DBXTeamLogEventDetailsMicrosoftOfficeAddinChangePolicyDetails + } + + @objc + public var asNetworkControlChangePolicyDetails: DBXTeamLogEventDetailsNetworkControlChangePolicyDetails? { + self as? DBXTeamLogEventDetailsNetworkControlChangePolicyDetails + } + + @objc + public var asPaperChangeDeploymentPolicyDetails: DBXTeamLogEventDetailsPaperChangeDeploymentPolicyDetails? { + self as? DBXTeamLogEventDetailsPaperChangeDeploymentPolicyDetails + } + + @objc + public var asPaperChangeMemberLinkPolicyDetails: DBXTeamLogEventDetailsPaperChangeMemberLinkPolicyDetails? { + self as? DBXTeamLogEventDetailsPaperChangeMemberLinkPolicyDetails + } + + @objc + public var asPaperChangeMemberPolicyDetails: DBXTeamLogEventDetailsPaperChangeMemberPolicyDetails? { + self as? DBXTeamLogEventDetailsPaperChangeMemberPolicyDetails + } + + @objc + public var asPaperChangePolicyDetails: DBXTeamLogEventDetailsPaperChangePolicyDetails? { + self as? DBXTeamLogEventDetailsPaperChangePolicyDetails + } + + @objc + public var asPaperDefaultFolderPolicyChangedDetails: DBXTeamLogEventDetailsPaperDefaultFolderPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsPaperDefaultFolderPolicyChangedDetails + } + + @objc + public var asPaperDesktopPolicyChangedDetails: DBXTeamLogEventDetailsPaperDesktopPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsPaperDesktopPolicyChangedDetails + } + + @objc + public var asPaperEnabledUsersGroupAdditionDetails: DBXTeamLogEventDetailsPaperEnabledUsersGroupAdditionDetails? { + self as? DBXTeamLogEventDetailsPaperEnabledUsersGroupAdditionDetails + } + + @objc + public var asPaperEnabledUsersGroupRemovalDetails: DBXTeamLogEventDetailsPaperEnabledUsersGroupRemovalDetails? { + self as? DBXTeamLogEventDetailsPaperEnabledUsersGroupRemovalDetails + } + + @objc + public var asPasswordStrengthRequirementsChangePolicyDetails: DBXTeamLogEventDetailsPasswordStrengthRequirementsChangePolicyDetails? { + self as? DBXTeamLogEventDetailsPasswordStrengthRequirementsChangePolicyDetails + } + + @objc + public var asPermanentDeleteChangePolicyDetails: DBXTeamLogEventDetailsPermanentDeleteChangePolicyDetails? { + self as? DBXTeamLogEventDetailsPermanentDeleteChangePolicyDetails + } + + @objc + public var asResellerSupportChangePolicyDetails: DBXTeamLogEventDetailsResellerSupportChangePolicyDetails? { + self as? DBXTeamLogEventDetailsResellerSupportChangePolicyDetails + } + + @objc + public var asRewindPolicyChangedDetails: DBXTeamLogEventDetailsRewindPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsRewindPolicyChangedDetails + } + + @objc + public var asSendForSignaturePolicyChangedDetails: DBXTeamLogEventDetailsSendForSignaturePolicyChangedDetails? { + self as? DBXTeamLogEventDetailsSendForSignaturePolicyChangedDetails + } + + @objc + public var asSharingChangeFolderJoinPolicyDetails: DBXTeamLogEventDetailsSharingChangeFolderJoinPolicyDetails? { + self as? DBXTeamLogEventDetailsSharingChangeFolderJoinPolicyDetails + } + + @objc + public var asSharingChangeLinkAllowChangeExpirationPolicyDetails: DBXTeamLogEventDetailsSharingChangeLinkAllowChangeExpirationPolicyDetails? { + self as? DBXTeamLogEventDetailsSharingChangeLinkAllowChangeExpirationPolicyDetails + } + + @objc + public var asSharingChangeLinkDefaultExpirationPolicyDetails: DBXTeamLogEventDetailsSharingChangeLinkDefaultExpirationPolicyDetails? { + self as? DBXTeamLogEventDetailsSharingChangeLinkDefaultExpirationPolicyDetails + } + + @objc + public var asSharingChangeLinkEnforcePasswordPolicyDetails: DBXTeamLogEventDetailsSharingChangeLinkEnforcePasswordPolicyDetails? { + self as? DBXTeamLogEventDetailsSharingChangeLinkEnforcePasswordPolicyDetails + } + + @objc + public var asSharingChangeLinkPolicyDetails: DBXTeamLogEventDetailsSharingChangeLinkPolicyDetails? { + self as? DBXTeamLogEventDetailsSharingChangeLinkPolicyDetails + } + + @objc + public var asSharingChangeMemberPolicyDetails: DBXTeamLogEventDetailsSharingChangeMemberPolicyDetails? { + self as? DBXTeamLogEventDetailsSharingChangeMemberPolicyDetails + } + + @objc + public var asShowcaseChangeDownloadPolicyDetails: DBXTeamLogEventDetailsShowcaseChangeDownloadPolicyDetails? { + self as? DBXTeamLogEventDetailsShowcaseChangeDownloadPolicyDetails + } + + @objc + public var asShowcaseChangeEnabledPolicyDetails: DBXTeamLogEventDetailsShowcaseChangeEnabledPolicyDetails? { + self as? DBXTeamLogEventDetailsShowcaseChangeEnabledPolicyDetails + } + + @objc + public var asShowcaseChangeExternalSharingPolicyDetails: DBXTeamLogEventDetailsShowcaseChangeExternalSharingPolicyDetails? { + self as? DBXTeamLogEventDetailsShowcaseChangeExternalSharingPolicyDetails + } + + @objc + public var asSmarterSmartSyncPolicyChangedDetails: DBXTeamLogEventDetailsSmarterSmartSyncPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsSmarterSmartSyncPolicyChangedDetails + } + + @objc + public var asSmartSyncChangePolicyDetails: DBXTeamLogEventDetailsSmartSyncChangePolicyDetails? { + self as? DBXTeamLogEventDetailsSmartSyncChangePolicyDetails + } + + @objc + public var asSmartSyncNotOptOutDetails: DBXTeamLogEventDetailsSmartSyncNotOptOutDetails? { + self as? DBXTeamLogEventDetailsSmartSyncNotOptOutDetails + } + + @objc + public var asSmartSyncOptOutDetails: DBXTeamLogEventDetailsSmartSyncOptOutDetails? { + self as? DBXTeamLogEventDetailsSmartSyncOptOutDetails + } + + @objc + public var asSsoChangePolicyDetails: DBXTeamLogEventDetailsSsoChangePolicyDetails? { + self as? DBXTeamLogEventDetailsSsoChangePolicyDetails + } + + @objc + public var asTeamBrandingPolicyChangedDetails: DBXTeamLogEventDetailsTeamBrandingPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsTeamBrandingPolicyChangedDetails + } + + @objc + public var asTeamExtensionsPolicyChangedDetails: DBXTeamLogEventDetailsTeamExtensionsPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsTeamExtensionsPolicyChangedDetails + } + + @objc + public var asTeamSelectiveSyncPolicyChangedDetails: DBXTeamLogEventDetailsTeamSelectiveSyncPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsTeamSelectiveSyncPolicyChangedDetails + } + + @objc + public var asTeamSharingWhitelistSubjectsChangedDetails: DBXTeamLogEventDetailsTeamSharingWhitelistSubjectsChangedDetails? { + self as? DBXTeamLogEventDetailsTeamSharingWhitelistSubjectsChangedDetails + } + + @objc + public var asTfaAddExceptionDetails: DBXTeamLogEventDetailsTfaAddExceptionDetails? { + self as? DBXTeamLogEventDetailsTfaAddExceptionDetails + } + + @objc + public var asTfaChangePolicyDetails: DBXTeamLogEventDetailsTfaChangePolicyDetails? { + self as? DBXTeamLogEventDetailsTfaChangePolicyDetails + } + + @objc + public var asTfaRemoveExceptionDetails: DBXTeamLogEventDetailsTfaRemoveExceptionDetails? { + self as? DBXTeamLogEventDetailsTfaRemoveExceptionDetails + } + + @objc + public var asTwoAccountChangePolicyDetails: DBXTeamLogEventDetailsTwoAccountChangePolicyDetails? { + self as? DBXTeamLogEventDetailsTwoAccountChangePolicyDetails + } + + @objc + public var asViewerInfoPolicyChangedDetails: DBXTeamLogEventDetailsViewerInfoPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsViewerInfoPolicyChangedDetails + } + + @objc + public var asWatermarkingPolicyChangedDetails: DBXTeamLogEventDetailsWatermarkingPolicyChangedDetails? { + self as? DBXTeamLogEventDetailsWatermarkingPolicyChangedDetails + } + + @objc + public var asWebSessionsChangeActiveSessionLimitDetails: DBXTeamLogEventDetailsWebSessionsChangeActiveSessionLimitDetails? { + self as? DBXTeamLogEventDetailsWebSessionsChangeActiveSessionLimitDetails + } + + @objc + public var asWebSessionsChangeFixedLengthPolicyDetails: DBXTeamLogEventDetailsWebSessionsChangeFixedLengthPolicyDetails? { + self as? DBXTeamLogEventDetailsWebSessionsChangeFixedLengthPolicyDetails + } + + @objc + public var asWebSessionsChangeIdleLengthPolicyDetails: DBXTeamLogEventDetailsWebSessionsChangeIdleLengthPolicyDetails? { + self as? DBXTeamLogEventDetailsWebSessionsChangeIdleLengthPolicyDetails + } + + @objc + public var asDataResidencyMigrationRequestSuccessfulDetails: DBXTeamLogEventDetailsDataResidencyMigrationRequestSuccessfulDetails? { + self as? DBXTeamLogEventDetailsDataResidencyMigrationRequestSuccessfulDetails + } + + @objc + public var asDataResidencyMigrationRequestUnsuccessfulDetails: DBXTeamLogEventDetailsDataResidencyMigrationRequestUnsuccessfulDetails? { + self as? DBXTeamLogEventDetailsDataResidencyMigrationRequestUnsuccessfulDetails + } + + @objc + public var asTeamMergeFromDetails: DBXTeamLogEventDetailsTeamMergeFromDetails? { + self as? DBXTeamLogEventDetailsTeamMergeFromDetails + } + + @objc + public var asTeamMergeToDetails: DBXTeamLogEventDetailsTeamMergeToDetails? { + self as? DBXTeamLogEventDetailsTeamMergeToDetails + } + + @objc + public var asTeamProfileAddBackgroundDetails: DBXTeamLogEventDetailsTeamProfileAddBackgroundDetails? { + self as? DBXTeamLogEventDetailsTeamProfileAddBackgroundDetails + } + + @objc + public var asTeamProfileAddLogoDetails: DBXTeamLogEventDetailsTeamProfileAddLogoDetails? { + self as? DBXTeamLogEventDetailsTeamProfileAddLogoDetails + } + + @objc + public var asTeamProfileChangeBackgroundDetails: DBXTeamLogEventDetailsTeamProfileChangeBackgroundDetails? { + self as? DBXTeamLogEventDetailsTeamProfileChangeBackgroundDetails + } + + @objc + public var asTeamProfileChangeDefaultLanguageDetails: DBXTeamLogEventDetailsTeamProfileChangeDefaultLanguageDetails? { + self as? DBXTeamLogEventDetailsTeamProfileChangeDefaultLanguageDetails + } + + @objc + public var asTeamProfileChangeLogoDetails: DBXTeamLogEventDetailsTeamProfileChangeLogoDetails? { + self as? DBXTeamLogEventDetailsTeamProfileChangeLogoDetails + } + + @objc + public var asTeamProfileChangeNameDetails: DBXTeamLogEventDetailsTeamProfileChangeNameDetails? { + self as? DBXTeamLogEventDetailsTeamProfileChangeNameDetails + } + + @objc + public var asTeamProfileRemoveBackgroundDetails: DBXTeamLogEventDetailsTeamProfileRemoveBackgroundDetails? { + self as? DBXTeamLogEventDetailsTeamProfileRemoveBackgroundDetails + } + + @objc + public var asTeamProfileRemoveLogoDetails: DBXTeamLogEventDetailsTeamProfileRemoveLogoDetails? { + self as? DBXTeamLogEventDetailsTeamProfileRemoveLogoDetails + } + + @objc + public var asTfaAddBackupPhoneDetails: DBXTeamLogEventDetailsTfaAddBackupPhoneDetails? { + self as? DBXTeamLogEventDetailsTfaAddBackupPhoneDetails + } + + @objc + public var asTfaAddSecurityKeyDetails: DBXTeamLogEventDetailsTfaAddSecurityKeyDetails? { + self as? DBXTeamLogEventDetailsTfaAddSecurityKeyDetails + } + + @objc + public var asTfaChangeBackupPhoneDetails: DBXTeamLogEventDetailsTfaChangeBackupPhoneDetails? { + self as? DBXTeamLogEventDetailsTfaChangeBackupPhoneDetails + } + + @objc + public var asTfaChangeStatusDetails: DBXTeamLogEventDetailsTfaChangeStatusDetails? { + self as? DBXTeamLogEventDetailsTfaChangeStatusDetails + } + + @objc + public var asTfaRemoveBackupPhoneDetails: DBXTeamLogEventDetailsTfaRemoveBackupPhoneDetails? { + self as? DBXTeamLogEventDetailsTfaRemoveBackupPhoneDetails + } + + @objc + public var asTfaRemoveSecurityKeyDetails: DBXTeamLogEventDetailsTfaRemoveSecurityKeyDetails? { + self as? DBXTeamLogEventDetailsTfaRemoveSecurityKeyDetails + } + + @objc + public var asTfaResetDetails: DBXTeamLogEventDetailsTfaResetDetails? { + self as? DBXTeamLogEventDetailsTfaResetDetails + } + + @objc + public var asChangedEnterpriseAdminRoleDetails: DBXTeamLogEventDetailsChangedEnterpriseAdminRoleDetails? { + self as? DBXTeamLogEventDetailsChangedEnterpriseAdminRoleDetails + } + + @objc + public var asChangedEnterpriseConnectedTeamStatusDetails: DBXTeamLogEventDetailsChangedEnterpriseConnectedTeamStatusDetails? { + self as? DBXTeamLogEventDetailsChangedEnterpriseConnectedTeamStatusDetails + } + + @objc + public var asEndedEnterpriseAdminSessionDetails: DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDetails? { + self as? DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDetails + } + + @objc + public var asEndedEnterpriseAdminSessionDeprecatedDetails: DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDeprecatedDetails? { + self as? DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDeprecatedDetails + } + + @objc + public var asEnterpriseSettingsLockingDetails: DBXTeamLogEventDetailsEnterpriseSettingsLockingDetails? { + self as? DBXTeamLogEventDetailsEnterpriseSettingsLockingDetails + } + + @objc + public var asGuestAdminChangeStatusDetails: DBXTeamLogEventDetailsGuestAdminChangeStatusDetails? { + self as? DBXTeamLogEventDetailsGuestAdminChangeStatusDetails + } + + @objc + public var asStartedEnterpriseAdminSessionDetails: DBXTeamLogEventDetailsStartedEnterpriseAdminSessionDetails? { + self as? DBXTeamLogEventDetailsStartedEnterpriseAdminSessionDetails + } + + @objc + public var asTeamMergeRequestAcceptedDetails: DBXTeamLogEventDetailsTeamMergeRequestAcceptedDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestAcceptedDetails + } + + @objc + public var asTeamMergeRequestAcceptedShownToPrimaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToPrimaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToPrimaryTeamDetails + } + + @objc + public var asTeamMergeRequestAcceptedShownToSecondaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToSecondaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToSecondaryTeamDetails + } + + @objc + public var asTeamMergeRequestAutoCanceledDetails: DBXTeamLogEventDetailsTeamMergeRequestAutoCanceledDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestAutoCanceledDetails + } + + @objc + public var asTeamMergeRequestCanceledDetails: DBXTeamLogEventDetailsTeamMergeRequestCanceledDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestCanceledDetails + } + + @objc + public var asTeamMergeRequestCanceledShownToPrimaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToPrimaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToPrimaryTeamDetails + } + + @objc + public var asTeamMergeRequestCanceledShownToSecondaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToSecondaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToSecondaryTeamDetails + } + + @objc + public var asTeamMergeRequestExpiredDetails: DBXTeamLogEventDetailsTeamMergeRequestExpiredDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestExpiredDetails + } + + @objc + public var asTeamMergeRequestExpiredShownToPrimaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToPrimaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToPrimaryTeamDetails + } + + @objc + public var asTeamMergeRequestExpiredShownToSecondaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToSecondaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToSecondaryTeamDetails + } + + @objc + public var asTeamMergeRequestRejectedShownToPrimaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToPrimaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToPrimaryTeamDetails + } + + @objc + public var asTeamMergeRequestRejectedShownToSecondaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToSecondaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToSecondaryTeamDetails + } + + @objc + public var asTeamMergeRequestReminderDetails: DBXTeamLogEventDetailsTeamMergeRequestReminderDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestReminderDetails + } + + @objc + public var asTeamMergeRequestReminderShownToPrimaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestReminderShownToPrimaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestReminderShownToPrimaryTeamDetails + } + + @objc + public var asTeamMergeRequestReminderShownToSecondaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestReminderShownToSecondaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestReminderShownToSecondaryTeamDetails + } + + @objc + public var asTeamMergeRequestRevokedDetails: DBXTeamLogEventDetailsTeamMergeRequestRevokedDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestRevokedDetails + } + + @objc + public var asTeamMergeRequestSentShownToPrimaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestSentShownToPrimaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestSentShownToPrimaryTeamDetails + } + + @objc + public var asTeamMergeRequestSentShownToSecondaryTeamDetails: DBXTeamLogEventDetailsTeamMergeRequestSentShownToSecondaryTeamDetails? { + self as? DBXTeamLogEventDetailsTeamMergeRequestSentShownToSecondaryTeamDetails + } + + @objc + public var asMissingDetails: DBXTeamLogEventDetailsMissingDetails? { + self as? DBXTeamLogEventDetailsMissingDetails + } + + @objc + public var asOther: DBXTeamLogEventDetailsOther? { + self as? DBXTeamLogEventDetailsOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAdminAlertingAlertStateChangedDetails: DBXTeamLogEventDetails { + @objc + public var adminAlertingAlertStateChangedDetails: DBXTeamLogAdminAlertingAlertStateChangedDetails + + @objc + public init(_ arg: DBXTeamLogAdminAlertingAlertStateChangedDetails) { + self.adminAlertingAlertStateChangedDetails = arg + let swift = TeamLog.EventDetails.adminAlertingAlertStateChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAdminAlertingChangedAlertConfigDetails: DBXTeamLogEventDetails { + @objc + public var adminAlertingChangedAlertConfigDetails: DBXTeamLogAdminAlertingChangedAlertConfigDetails + + @objc + public init(_ arg: DBXTeamLogAdminAlertingChangedAlertConfigDetails) { + self.adminAlertingChangedAlertConfigDetails = arg + let swift = TeamLog.EventDetails.adminAlertingChangedAlertConfigDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAdminAlertingTriggeredAlertDetails: DBXTeamLogEventDetails { + @objc + public var adminAlertingTriggeredAlertDetails: DBXTeamLogAdminAlertingTriggeredAlertDetails + + @objc + public init(_ arg: DBXTeamLogAdminAlertingTriggeredAlertDetails) { + self.adminAlertingTriggeredAlertDetails = arg + let swift = TeamLog.EventDetails.adminAlertingTriggeredAlertDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsRansomwareRestoreProcessCompletedDetails: DBXTeamLogEventDetails { + @objc + public var ransomwareRestoreProcessCompletedDetails: DBXTeamLogRansomwareRestoreProcessCompletedDetails + + @objc + public init(_ arg: DBXTeamLogRansomwareRestoreProcessCompletedDetails) { + self.ransomwareRestoreProcessCompletedDetails = arg + let swift = TeamLog.EventDetails.ransomwareRestoreProcessCompletedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsRansomwareRestoreProcessStartedDetails: DBXTeamLogEventDetails { + @objc + public var ransomwareRestoreProcessStartedDetails: DBXTeamLogRansomwareRestoreProcessStartedDetails + + @objc + public init(_ arg: DBXTeamLogRansomwareRestoreProcessStartedDetails) { + self.ransomwareRestoreProcessStartedDetails = arg + let swift = TeamLog.EventDetails.ransomwareRestoreProcessStartedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAppBlockedByPermissionsDetails: DBXTeamLogEventDetails { + @objc + public var appBlockedByPermissionsDetails: DBXTeamLogAppBlockedByPermissionsDetails + + @objc + public init(_ arg: DBXTeamLogAppBlockedByPermissionsDetails) { + self.appBlockedByPermissionsDetails = arg + let swift = TeamLog.EventDetails.appBlockedByPermissionsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAppLinkTeamDetails: DBXTeamLogEventDetails { + @objc + public var appLinkTeamDetails: DBXTeamLogAppLinkTeamDetails + + @objc + public init(_ arg: DBXTeamLogAppLinkTeamDetails) { + self.appLinkTeamDetails = arg + let swift = TeamLog.EventDetails.appLinkTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAppLinkUserDetails: DBXTeamLogEventDetails { + @objc + public var appLinkUserDetails: DBXTeamLogAppLinkUserDetails + + @objc + public init(_ arg: DBXTeamLogAppLinkUserDetails) { + self.appLinkUserDetails = arg + let swift = TeamLog.EventDetails.appLinkUserDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAppUnlinkTeamDetails: DBXTeamLogEventDetails { + @objc + public var appUnlinkTeamDetails: DBXTeamLogAppUnlinkTeamDetails + + @objc + public init(_ arg: DBXTeamLogAppUnlinkTeamDetails) { + self.appUnlinkTeamDetails = arg + let swift = TeamLog.EventDetails.appUnlinkTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAppUnlinkUserDetails: DBXTeamLogEventDetails { + @objc + public var appUnlinkUserDetails: DBXTeamLogAppUnlinkUserDetails + + @objc + public init(_ arg: DBXTeamLogAppUnlinkUserDetails) { + self.appUnlinkUserDetails = arg + let swift = TeamLog.EventDetails.appUnlinkUserDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsIntegrationConnectedDetails: DBXTeamLogEventDetails { + @objc + public var integrationConnectedDetails: DBXTeamLogIntegrationConnectedDetails + + @objc + public init(_ arg: DBXTeamLogIntegrationConnectedDetails) { + self.integrationConnectedDetails = arg + let swift = TeamLog.EventDetails.integrationConnectedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsIntegrationDisconnectedDetails: DBXTeamLogEventDetails { + @objc + public var integrationDisconnectedDetails: DBXTeamLogIntegrationDisconnectedDetails + + @objc + public init(_ arg: DBXTeamLogIntegrationDisconnectedDetails) { + self.integrationDisconnectedDetails = arg + let swift = TeamLog.EventDetails.integrationDisconnectedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileAddCommentDetails: DBXTeamLogEventDetails { + @objc + public var fileAddCommentDetails: DBXTeamLogFileAddCommentDetails + + @objc + public init(_ arg: DBXTeamLogFileAddCommentDetails) { + self.fileAddCommentDetails = arg + let swift = TeamLog.EventDetails.fileAddCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileChangeCommentSubscriptionDetails: DBXTeamLogEventDetails { + @objc + public var fileChangeCommentSubscriptionDetails: DBXTeamLogFileChangeCommentSubscriptionDetails + + @objc + public init(_ arg: DBXTeamLogFileChangeCommentSubscriptionDetails) { + self.fileChangeCommentSubscriptionDetails = arg + let swift = TeamLog.EventDetails.fileChangeCommentSubscriptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileDeleteCommentDetails: DBXTeamLogEventDetails { + @objc + public var fileDeleteCommentDetails: DBXTeamLogFileDeleteCommentDetails + + @objc + public init(_ arg: DBXTeamLogFileDeleteCommentDetails) { + self.fileDeleteCommentDetails = arg + let swift = TeamLog.EventDetails.fileDeleteCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileEditCommentDetails: DBXTeamLogEventDetails { + @objc + public var fileEditCommentDetails: DBXTeamLogFileEditCommentDetails + + @objc + public init(_ arg: DBXTeamLogFileEditCommentDetails) { + self.fileEditCommentDetails = arg + let swift = TeamLog.EventDetails.fileEditCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileLikeCommentDetails: DBXTeamLogEventDetails { + @objc + public var fileLikeCommentDetails: DBXTeamLogFileLikeCommentDetails + + @objc + public init(_ arg: DBXTeamLogFileLikeCommentDetails) { + self.fileLikeCommentDetails = arg + let swift = TeamLog.EventDetails.fileLikeCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileResolveCommentDetails: DBXTeamLogEventDetails { + @objc + public var fileResolveCommentDetails: DBXTeamLogFileResolveCommentDetails + + @objc + public init(_ arg: DBXTeamLogFileResolveCommentDetails) { + self.fileResolveCommentDetails = arg + let swift = TeamLog.EventDetails.fileResolveCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileUnlikeCommentDetails: DBXTeamLogEventDetails { + @objc + public var fileUnlikeCommentDetails: DBXTeamLogFileUnlikeCommentDetails + + @objc + public init(_ arg: DBXTeamLogFileUnlikeCommentDetails) { + self.fileUnlikeCommentDetails = arg + let swift = TeamLog.EventDetails.fileUnlikeCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileUnresolveCommentDetails: DBXTeamLogEventDetails { + @objc + public var fileUnresolveCommentDetails: DBXTeamLogFileUnresolveCommentDetails + + @objc + public init(_ arg: DBXTeamLogFileUnresolveCommentDetails) { + self.fileUnresolveCommentDetails = arg + let swift = TeamLog.EventDetails.fileUnresolveCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyAddFoldersDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyAddFoldersDetails: DBXTeamLogGovernancePolicyAddFoldersDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyAddFoldersDetails) { + self.governancePolicyAddFoldersDetails = arg + let swift = TeamLog.EventDetails.governancePolicyAddFoldersDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyAddFolderFailedDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyAddFolderFailedDetails: DBXTeamLogGovernancePolicyAddFolderFailedDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyAddFolderFailedDetails) { + self.governancePolicyAddFolderFailedDetails = arg + let swift = TeamLog.EventDetails.governancePolicyAddFolderFailedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyContentDisposedDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyContentDisposedDetails: DBXTeamLogGovernancePolicyContentDisposedDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyContentDisposedDetails) { + self.governancePolicyContentDisposedDetails = arg + let swift = TeamLog.EventDetails.governancePolicyContentDisposedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyCreateDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyCreateDetails: DBXTeamLogGovernancePolicyCreateDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyCreateDetails) { + self.governancePolicyCreateDetails = arg + let swift = TeamLog.EventDetails.governancePolicyCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyDeleteDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyDeleteDetails: DBXTeamLogGovernancePolicyDeleteDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyDeleteDetails) { + self.governancePolicyDeleteDetails = arg + let swift = TeamLog.EventDetails.governancePolicyDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyEditDetailsDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyEditDetailsDetails: DBXTeamLogGovernancePolicyEditDetailsDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyEditDetailsDetails) { + self.governancePolicyEditDetailsDetails = arg + let swift = TeamLog.EventDetails.governancePolicyEditDetailsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyEditDurationDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyEditDurationDetails: DBXTeamLogGovernancePolicyEditDurationDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyEditDurationDetails) { + self.governancePolicyEditDurationDetails = arg + let swift = TeamLog.EventDetails.governancePolicyEditDurationDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyExportCreatedDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyExportCreatedDetails: DBXTeamLogGovernancePolicyExportCreatedDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyExportCreatedDetails) { + self.governancePolicyExportCreatedDetails = arg + let swift = TeamLog.EventDetails.governancePolicyExportCreatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyExportRemovedDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyExportRemovedDetails: DBXTeamLogGovernancePolicyExportRemovedDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyExportRemovedDetails) { + self.governancePolicyExportRemovedDetails = arg + let swift = TeamLog.EventDetails.governancePolicyExportRemovedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyRemoveFoldersDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyRemoveFoldersDetails: DBXTeamLogGovernancePolicyRemoveFoldersDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyRemoveFoldersDetails) { + self.governancePolicyRemoveFoldersDetails = arg + let swift = TeamLog.EventDetails.governancePolicyRemoveFoldersDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyReportCreatedDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyReportCreatedDetails: DBXTeamLogGovernancePolicyReportCreatedDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyReportCreatedDetails) { + self.governancePolicyReportCreatedDetails = arg + let swift = TeamLog.EventDetails.governancePolicyReportCreatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGovernancePolicyZipPartDownloadedDetails: DBXTeamLogEventDetails { + @objc + public var governancePolicyZipPartDownloadedDetails: DBXTeamLogGovernancePolicyZipPartDownloadedDetails + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyZipPartDownloadedDetails) { + self.governancePolicyZipPartDownloadedDetails = arg + let swift = TeamLog.EventDetails.governancePolicyZipPartDownloadedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsActivateAHoldDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsActivateAHoldDetails: DBXTeamLogLegalHoldsActivateAHoldDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsActivateAHoldDetails) { + self.legalHoldsActivateAHoldDetails = arg + let swift = TeamLog.EventDetails.legalHoldsActivateAHoldDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsAddMembersDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsAddMembersDetails: DBXTeamLogLegalHoldsAddMembersDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsAddMembersDetails) { + self.legalHoldsAddMembersDetails = arg + let swift = TeamLog.EventDetails.legalHoldsAddMembersDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsChangeHoldDetailsDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsChangeHoldDetailsDetails: DBXTeamLogLegalHoldsChangeHoldDetailsDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsChangeHoldDetailsDetails) { + self.legalHoldsChangeHoldDetailsDetails = arg + let swift = TeamLog.EventDetails.legalHoldsChangeHoldDetailsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsChangeHoldNameDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsChangeHoldNameDetails: DBXTeamLogLegalHoldsChangeHoldNameDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsChangeHoldNameDetails) { + self.legalHoldsChangeHoldNameDetails = arg + let swift = TeamLog.EventDetails.legalHoldsChangeHoldNameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsExportAHoldDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsExportAHoldDetails: DBXTeamLogLegalHoldsExportAHoldDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportAHoldDetails) { + self.legalHoldsExportAHoldDetails = arg + let swift = TeamLog.EventDetails.legalHoldsExportAHoldDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsExportCancelledDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsExportCancelledDetails: DBXTeamLogLegalHoldsExportCancelledDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportCancelledDetails) { + self.legalHoldsExportCancelledDetails = arg + let swift = TeamLog.EventDetails.legalHoldsExportCancelledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsExportDownloadedDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsExportDownloadedDetails: DBXTeamLogLegalHoldsExportDownloadedDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportDownloadedDetails) { + self.legalHoldsExportDownloadedDetails = arg + let swift = TeamLog.EventDetails.legalHoldsExportDownloadedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsExportRemovedDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsExportRemovedDetails: DBXTeamLogLegalHoldsExportRemovedDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportRemovedDetails) { + self.legalHoldsExportRemovedDetails = arg + let swift = TeamLog.EventDetails.legalHoldsExportRemovedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsReleaseAHoldDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsReleaseAHoldDetails: DBXTeamLogLegalHoldsReleaseAHoldDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsReleaseAHoldDetails) { + self.legalHoldsReleaseAHoldDetails = arg + let swift = TeamLog.EventDetails.legalHoldsReleaseAHoldDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsRemoveMembersDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsRemoveMembersDetails: DBXTeamLogLegalHoldsRemoveMembersDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsRemoveMembersDetails) { + self.legalHoldsRemoveMembersDetails = arg + let swift = TeamLog.EventDetails.legalHoldsRemoveMembersDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLegalHoldsReportAHoldDetails: DBXTeamLogEventDetails { + @objc + public var legalHoldsReportAHoldDetails: DBXTeamLogLegalHoldsReportAHoldDetails + + @objc + public init(_ arg: DBXTeamLogLegalHoldsReportAHoldDetails) { + self.legalHoldsReportAHoldDetails = arg + let swift = TeamLog.EventDetails.legalHoldsReportAHoldDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceChangeIpDesktopDetails: DBXTeamLogEventDetails { + @objc + public var deviceChangeIpDesktopDetails: DBXTeamLogDeviceChangeIpDesktopDetails + + @objc + public init(_ arg: DBXTeamLogDeviceChangeIpDesktopDetails) { + self.deviceChangeIpDesktopDetails = arg + let swift = TeamLog.EventDetails.deviceChangeIpDesktopDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceChangeIpMobileDetails: DBXTeamLogEventDetails { + @objc + public var deviceChangeIpMobileDetails: DBXTeamLogDeviceChangeIpMobileDetails + + @objc + public init(_ arg: DBXTeamLogDeviceChangeIpMobileDetails) { + self.deviceChangeIpMobileDetails = arg + let swift = TeamLog.EventDetails.deviceChangeIpMobileDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceChangeIpWebDetails: DBXTeamLogEventDetails { + @objc + public var deviceChangeIpWebDetails: DBXTeamLogDeviceChangeIpWebDetails + + @objc + public init(_ arg: DBXTeamLogDeviceChangeIpWebDetails) { + self.deviceChangeIpWebDetails = arg + let swift = TeamLog.EventDetails.deviceChangeIpWebDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceDeleteOnUnlinkFailDetails: DBXTeamLogEventDetails { + @objc + public var deviceDeleteOnUnlinkFailDetails: DBXTeamLogDeviceDeleteOnUnlinkFailDetails + + @objc + public init(_ arg: DBXTeamLogDeviceDeleteOnUnlinkFailDetails) { + self.deviceDeleteOnUnlinkFailDetails = arg + let swift = TeamLog.EventDetails.deviceDeleteOnUnlinkFailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceDeleteOnUnlinkSuccessDetails: DBXTeamLogEventDetails { + @objc + public var deviceDeleteOnUnlinkSuccessDetails: DBXTeamLogDeviceDeleteOnUnlinkSuccessDetails + + @objc + public init(_ arg: DBXTeamLogDeviceDeleteOnUnlinkSuccessDetails) { + self.deviceDeleteOnUnlinkSuccessDetails = arg + let swift = TeamLog.EventDetails.deviceDeleteOnUnlinkSuccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceLinkFailDetails: DBXTeamLogEventDetails { + @objc + public var deviceLinkFailDetails: DBXTeamLogDeviceLinkFailDetails + + @objc + public init(_ arg: DBXTeamLogDeviceLinkFailDetails) { + self.deviceLinkFailDetails = arg + let swift = TeamLog.EventDetails.deviceLinkFailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceLinkSuccessDetails: DBXTeamLogEventDetails { + @objc + public var deviceLinkSuccessDetails: DBXTeamLogDeviceLinkSuccessDetails + + @objc + public init(_ arg: DBXTeamLogDeviceLinkSuccessDetails) { + self.deviceLinkSuccessDetails = arg + let swift = TeamLog.EventDetails.deviceLinkSuccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceManagementDisabledDetails: DBXTeamLogEventDetails { + @objc + public var deviceManagementDisabledDetails: DBXTeamLogDeviceManagementDisabledDetails + + @objc + public init(_ arg: DBXTeamLogDeviceManagementDisabledDetails) { + self.deviceManagementDisabledDetails = arg + let swift = TeamLog.EventDetails.deviceManagementDisabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceManagementEnabledDetails: DBXTeamLogEventDetails { + @objc + public var deviceManagementEnabledDetails: DBXTeamLogDeviceManagementEnabledDetails + + @objc + public init(_ arg: DBXTeamLogDeviceManagementEnabledDetails) { + self.deviceManagementEnabledDetails = arg + let swift = TeamLog.EventDetails.deviceManagementEnabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceSyncBackupStatusChangedDetails: DBXTeamLogEventDetails { + @objc + public var deviceSyncBackupStatusChangedDetails: DBXTeamLogDeviceSyncBackupStatusChangedDetails + + @objc + public init(_ arg: DBXTeamLogDeviceSyncBackupStatusChangedDetails) { + self.deviceSyncBackupStatusChangedDetails = arg + let swift = TeamLog.EventDetails.deviceSyncBackupStatusChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceUnlinkDetails: DBXTeamLogEventDetails { + @objc + public var deviceUnlinkDetails: DBXTeamLogDeviceUnlinkDetails + + @objc + public init(_ arg: DBXTeamLogDeviceUnlinkDetails) { + self.deviceUnlinkDetails = arg + let swift = TeamLog.EventDetails.deviceUnlinkDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDropboxPasswordsExportedDetails: DBXTeamLogEventDetails { + @objc + public var dropboxPasswordsExportedDetails: DBXTeamLogDropboxPasswordsExportedDetails + + @objc + public init(_ arg: DBXTeamLogDropboxPasswordsExportedDetails) { + self.dropboxPasswordsExportedDetails = arg + let swift = TeamLog.EventDetails.dropboxPasswordsExportedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDropboxPasswordsNewDeviceEnrolledDetails: DBXTeamLogEventDetails { + @objc + public var dropboxPasswordsNewDeviceEnrolledDetails: DBXTeamLogDropboxPasswordsNewDeviceEnrolledDetails + + @objc + public init(_ arg: DBXTeamLogDropboxPasswordsNewDeviceEnrolledDetails) { + self.dropboxPasswordsNewDeviceEnrolledDetails = arg + let swift = TeamLog.EventDetails.dropboxPasswordsNewDeviceEnrolledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmmRefreshAuthTokenDetails: DBXTeamLogEventDetails { + @objc + public var emmRefreshAuthTokenDetails: DBXTeamLogEmmRefreshAuthTokenDetails + + @objc + public init(_ arg: DBXTeamLogEmmRefreshAuthTokenDetails) { + self.emmRefreshAuthTokenDetails = arg + let swift = TeamLog.EventDetails.emmRefreshAuthTokenDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExternalDriveBackupEligibilityStatusCheckedDetails: DBXTeamLogEventDetails { + @objc + public var externalDriveBackupEligibilityStatusCheckedDetails: DBXTeamLogExternalDriveBackupEligibilityStatusCheckedDetails + + @objc + public init(_ arg: DBXTeamLogExternalDriveBackupEligibilityStatusCheckedDetails) { + self.externalDriveBackupEligibilityStatusCheckedDetails = arg + let swift = TeamLog.EventDetails.externalDriveBackupEligibilityStatusCheckedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExternalDriveBackupStatusChangedDetails: DBXTeamLogEventDetails { + @objc + public var externalDriveBackupStatusChangedDetails: DBXTeamLogExternalDriveBackupStatusChangedDetails + + @objc + public init(_ arg: DBXTeamLogExternalDriveBackupStatusChangedDetails) { + self.externalDriveBackupStatusChangedDetails = arg + let swift = TeamLog.EventDetails.externalDriveBackupStatusChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAccountCaptureChangeAvailabilityDetails: DBXTeamLogEventDetails { + @objc + public var accountCaptureChangeAvailabilityDetails: DBXTeamLogAccountCaptureChangeAvailabilityDetails + + @objc + public init(_ arg: DBXTeamLogAccountCaptureChangeAvailabilityDetails) { + self.accountCaptureChangeAvailabilityDetails = arg + let swift = TeamLog.EventDetails.accountCaptureChangeAvailabilityDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAccountCaptureMigrateAccountDetails: DBXTeamLogEventDetails { + @objc + public var accountCaptureMigrateAccountDetails: DBXTeamLogAccountCaptureMigrateAccountDetails + + @objc + public init(_ arg: DBXTeamLogAccountCaptureMigrateAccountDetails) { + self.accountCaptureMigrateAccountDetails = arg + let swift = TeamLog.EventDetails.accountCaptureMigrateAccountDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAccountCaptureNotificationEmailsSentDetails: DBXTeamLogEventDetails { + @objc + public var accountCaptureNotificationEmailsSentDetails: DBXTeamLogAccountCaptureNotificationEmailsSentDetails + + @objc + public init(_ arg: DBXTeamLogAccountCaptureNotificationEmailsSentDetails) { + self.accountCaptureNotificationEmailsSentDetails = arg + let swift = TeamLog.EventDetails.accountCaptureNotificationEmailsSentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAccountCaptureRelinquishAccountDetails: DBXTeamLogEventDetails { + @objc + public var accountCaptureRelinquishAccountDetails: DBXTeamLogAccountCaptureRelinquishAccountDetails + + @objc + public init(_ arg: DBXTeamLogAccountCaptureRelinquishAccountDetails) { + self.accountCaptureRelinquishAccountDetails = arg + let swift = TeamLog.EventDetails.accountCaptureRelinquishAccountDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDisabledDomainInvitesDetails: DBXTeamLogEventDetails { + @objc + public var disabledDomainInvitesDetails: DBXTeamLogDisabledDomainInvitesDetails + + @objc + public init(_ arg: DBXTeamLogDisabledDomainInvitesDetails) { + self.disabledDomainInvitesDetails = arg + let swift = TeamLog.EventDetails.disabledDomainInvitesDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainInvitesApproveRequestToJoinTeamDetails: DBXTeamLogEventDetails { + @objc + public var domainInvitesApproveRequestToJoinTeamDetails: DBXTeamLogDomainInvitesApproveRequestToJoinTeamDetails + + @objc + public init(_ arg: DBXTeamLogDomainInvitesApproveRequestToJoinTeamDetails) { + self.domainInvitesApproveRequestToJoinTeamDetails = arg + let swift = TeamLog.EventDetails.domainInvitesApproveRequestToJoinTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainInvitesDeclineRequestToJoinTeamDetails: DBXTeamLogEventDetails { + @objc + public var domainInvitesDeclineRequestToJoinTeamDetails: DBXTeamLogDomainInvitesDeclineRequestToJoinTeamDetails + + @objc + public init(_ arg: DBXTeamLogDomainInvitesDeclineRequestToJoinTeamDetails) { + self.domainInvitesDeclineRequestToJoinTeamDetails = arg + let swift = TeamLog.EventDetails.domainInvitesDeclineRequestToJoinTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainInvitesEmailExistingUsersDetails: DBXTeamLogEventDetails { + @objc + public var domainInvitesEmailExistingUsersDetails: DBXTeamLogDomainInvitesEmailExistingUsersDetails + + @objc + public init(_ arg: DBXTeamLogDomainInvitesEmailExistingUsersDetails) { + self.domainInvitesEmailExistingUsersDetails = arg + let swift = TeamLog.EventDetails.domainInvitesEmailExistingUsersDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainInvitesRequestToJoinTeamDetails: DBXTeamLogEventDetails { + @objc + public var domainInvitesRequestToJoinTeamDetails: DBXTeamLogDomainInvitesRequestToJoinTeamDetails + + @objc + public init(_ arg: DBXTeamLogDomainInvitesRequestToJoinTeamDetails) { + self.domainInvitesRequestToJoinTeamDetails = arg + let swift = TeamLog.EventDetails.domainInvitesRequestToJoinTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToNoDetails: DBXTeamLogEventDetails { + @objc + public var domainInvitesSetInviteNewUserPrefToNoDetails: DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoDetails + + @objc + public init(_ arg: DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoDetails) { + self.domainInvitesSetInviteNewUserPrefToNoDetails = arg + let swift = TeamLog.EventDetails.domainInvitesSetInviteNewUserPrefToNoDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainInvitesSetInviteNewUserPrefToYesDetails: DBXTeamLogEventDetails { + @objc + public var domainInvitesSetInviteNewUserPrefToYesDetails: DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesDetails + + @objc + public init(_ arg: DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesDetails) { + self.domainInvitesSetInviteNewUserPrefToYesDetails = arg + let swift = TeamLog.EventDetails.domainInvitesSetInviteNewUserPrefToYesDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainVerificationAddDomainFailDetails: DBXTeamLogEventDetails { + @objc + public var domainVerificationAddDomainFailDetails: DBXTeamLogDomainVerificationAddDomainFailDetails + + @objc + public init(_ arg: DBXTeamLogDomainVerificationAddDomainFailDetails) { + self.domainVerificationAddDomainFailDetails = arg + let swift = TeamLog.EventDetails.domainVerificationAddDomainFailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainVerificationAddDomainSuccessDetails: DBXTeamLogEventDetails { + @objc + public var domainVerificationAddDomainSuccessDetails: DBXTeamLogDomainVerificationAddDomainSuccessDetails + + @objc + public init(_ arg: DBXTeamLogDomainVerificationAddDomainSuccessDetails) { + self.domainVerificationAddDomainSuccessDetails = arg + let swift = TeamLog.EventDetails.domainVerificationAddDomainSuccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDomainVerificationRemoveDomainDetails: DBXTeamLogEventDetails { + @objc + public var domainVerificationRemoveDomainDetails: DBXTeamLogDomainVerificationRemoveDomainDetails + + @objc + public init(_ arg: DBXTeamLogDomainVerificationRemoveDomainDetails) { + self.domainVerificationRemoveDomainDetails = arg + let swift = TeamLog.EventDetails.domainVerificationRemoveDomainDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEnabledDomainInvitesDetails: DBXTeamLogEventDetails { + @objc + public var enabledDomainInvitesDetails: DBXTeamLogEnabledDomainInvitesDetails + + @objc + public init(_ arg: DBXTeamLogEnabledDomainInvitesDetails) { + self.enabledDomainInvitesDetails = arg + let swift = TeamLog.EventDetails.enabledDomainInvitesDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamEncryptionKeyCancelKeyDeletionDetails: DBXTeamLogEventDetails { + @objc + public var teamEncryptionKeyCancelKeyDeletionDetails: DBXTeamLogTeamEncryptionKeyCancelKeyDeletionDetails + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyCancelKeyDeletionDetails) { + self.teamEncryptionKeyCancelKeyDeletionDetails = arg + let swift = TeamLog.EventDetails.teamEncryptionKeyCancelKeyDeletionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamEncryptionKeyCreateKeyDetails: DBXTeamLogEventDetails { + @objc + public var teamEncryptionKeyCreateKeyDetails: DBXTeamLogTeamEncryptionKeyCreateKeyDetails + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyCreateKeyDetails) { + self.teamEncryptionKeyCreateKeyDetails = arg + let swift = TeamLog.EventDetails.teamEncryptionKeyCreateKeyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamEncryptionKeyDeleteKeyDetails: DBXTeamLogEventDetails { + @objc + public var teamEncryptionKeyDeleteKeyDetails: DBXTeamLogTeamEncryptionKeyDeleteKeyDetails + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyDeleteKeyDetails) { + self.teamEncryptionKeyDeleteKeyDetails = arg + let swift = TeamLog.EventDetails.teamEncryptionKeyDeleteKeyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamEncryptionKeyDisableKeyDetails: DBXTeamLogEventDetails { + @objc + public var teamEncryptionKeyDisableKeyDetails: DBXTeamLogTeamEncryptionKeyDisableKeyDetails + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyDisableKeyDetails) { + self.teamEncryptionKeyDisableKeyDetails = arg + let swift = TeamLog.EventDetails.teamEncryptionKeyDisableKeyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamEncryptionKeyEnableKeyDetails: DBXTeamLogEventDetails { + @objc + public var teamEncryptionKeyEnableKeyDetails: DBXTeamLogTeamEncryptionKeyEnableKeyDetails + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyEnableKeyDetails) { + self.teamEncryptionKeyEnableKeyDetails = arg + let swift = TeamLog.EventDetails.teamEncryptionKeyEnableKeyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamEncryptionKeyRotateKeyDetails: DBXTeamLogEventDetails { + @objc + public var teamEncryptionKeyRotateKeyDetails: DBXTeamLogTeamEncryptionKeyRotateKeyDetails + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyRotateKeyDetails) { + self.teamEncryptionKeyRotateKeyDetails = arg + let swift = TeamLog.EventDetails.teamEncryptionKeyRotateKeyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamEncryptionKeyScheduleKeyDeletionDetails: DBXTeamLogEventDetails { + @objc + public var teamEncryptionKeyScheduleKeyDeletionDetails: DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionDetails + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionDetails) { + self.teamEncryptionKeyScheduleKeyDeletionDetails = arg + let swift = TeamLog.EventDetails.teamEncryptionKeyScheduleKeyDeletionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsApplyNamingConventionDetails: DBXTeamLogEventDetails { + @objc + public var applyNamingConventionDetails: DBXTeamLogApplyNamingConventionDetails + + @objc + public init(_ arg: DBXTeamLogApplyNamingConventionDetails) { + self.applyNamingConventionDetails = arg + let swift = TeamLog.EventDetails.applyNamingConventionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsCreateFolderDetails: DBXTeamLogEventDetails { + @objc + public var createFolderDetails: DBXTeamLogCreateFolderDetails + + @objc + public init(_ arg: DBXTeamLogCreateFolderDetails) { + self.createFolderDetails = arg + let swift = TeamLog.EventDetails.createFolderDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileAddDetails: DBXTeamLogEventDetails { + @objc + public var fileAddDetails: DBXTeamLogFileAddDetails + + @objc + public init(_ arg: DBXTeamLogFileAddDetails) { + self.fileAddDetails = arg + let swift = TeamLog.EventDetails.fileAddDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileAddFromAutomationDetails: DBXTeamLogEventDetails { + @objc + public var fileAddFromAutomationDetails: DBXTeamLogFileAddFromAutomationDetails + + @objc + public init(_ arg: DBXTeamLogFileAddFromAutomationDetails) { + self.fileAddFromAutomationDetails = arg + let swift = TeamLog.EventDetails.fileAddFromAutomationDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileCopyDetails: DBXTeamLogEventDetails { + @objc + public var fileCopyDetails: DBXTeamLogFileCopyDetails + + @objc + public init(_ arg: DBXTeamLogFileCopyDetails) { + self.fileCopyDetails = arg + let swift = TeamLog.EventDetails.fileCopyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileDeleteDetails: DBXTeamLogEventDetails { + @objc + public var fileDeleteDetails: DBXTeamLogFileDeleteDetails + + @objc + public init(_ arg: DBXTeamLogFileDeleteDetails) { + self.fileDeleteDetails = arg + let swift = TeamLog.EventDetails.fileDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileDownloadDetails: DBXTeamLogEventDetails { + @objc + public var fileDownloadDetails: DBXTeamLogFileDownloadDetails + + @objc + public init(_ arg: DBXTeamLogFileDownloadDetails) { + self.fileDownloadDetails = arg + let swift = TeamLog.EventDetails.fileDownloadDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileEditDetails: DBXTeamLogEventDetails { + @objc + public var fileEditDetails: DBXTeamLogFileEditDetails + + @objc + public init(_ arg: DBXTeamLogFileEditDetails) { + self.fileEditDetails = arg + let swift = TeamLog.EventDetails.fileEditDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileGetCopyReferenceDetails: DBXTeamLogEventDetails { + @objc + public var fileGetCopyReferenceDetails: DBXTeamLogFileGetCopyReferenceDetails + + @objc + public init(_ arg: DBXTeamLogFileGetCopyReferenceDetails) { + self.fileGetCopyReferenceDetails = arg + let swift = TeamLog.EventDetails.fileGetCopyReferenceDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileLockingLockStatusChangedDetails: DBXTeamLogEventDetails { + @objc + public var fileLockingLockStatusChangedDetails: DBXTeamLogFileLockingLockStatusChangedDetails + + @objc + public init(_ arg: DBXTeamLogFileLockingLockStatusChangedDetails) { + self.fileLockingLockStatusChangedDetails = arg + let swift = TeamLog.EventDetails.fileLockingLockStatusChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileMoveDetails: DBXTeamLogEventDetails { + @objc + public var fileMoveDetails: DBXTeamLogFileMoveDetails + + @objc + public init(_ arg: DBXTeamLogFileMoveDetails) { + self.fileMoveDetails = arg + let swift = TeamLog.EventDetails.fileMoveDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFilePermanentlyDeleteDetails: DBXTeamLogEventDetails { + @objc + public var filePermanentlyDeleteDetails: DBXTeamLogFilePermanentlyDeleteDetails + + @objc + public init(_ arg: DBXTeamLogFilePermanentlyDeleteDetails) { + self.filePermanentlyDeleteDetails = arg + let swift = TeamLog.EventDetails.filePermanentlyDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFilePreviewDetails: DBXTeamLogEventDetails { + @objc + public var filePreviewDetails: DBXTeamLogFilePreviewDetails + + @objc + public init(_ arg: DBXTeamLogFilePreviewDetails) { + self.filePreviewDetails = arg + let swift = TeamLog.EventDetails.filePreviewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRenameDetails: DBXTeamLogEventDetails { + @objc + public var fileRenameDetails: DBXTeamLogFileRenameDetails + + @objc + public init(_ arg: DBXTeamLogFileRenameDetails) { + self.fileRenameDetails = arg + let swift = TeamLog.EventDetails.fileRenameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRestoreDetails: DBXTeamLogEventDetails { + @objc + public var fileRestoreDetails: DBXTeamLogFileRestoreDetails + + @objc + public init(_ arg: DBXTeamLogFileRestoreDetails) { + self.fileRestoreDetails = arg + let swift = TeamLog.EventDetails.fileRestoreDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRevertDetails: DBXTeamLogEventDetails { + @objc + public var fileRevertDetails: DBXTeamLogFileRevertDetails + + @objc + public init(_ arg: DBXTeamLogFileRevertDetails) { + self.fileRevertDetails = arg + let swift = TeamLog.EventDetails.fileRevertDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRollbackChangesDetails: DBXTeamLogEventDetails { + @objc + public var fileRollbackChangesDetails: DBXTeamLogFileRollbackChangesDetails + + @objc + public init(_ arg: DBXTeamLogFileRollbackChangesDetails) { + self.fileRollbackChangesDetails = arg + let swift = TeamLog.EventDetails.fileRollbackChangesDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileSaveCopyReferenceDetails: DBXTeamLogEventDetails { + @objc + public var fileSaveCopyReferenceDetails: DBXTeamLogFileSaveCopyReferenceDetails + + @objc + public init(_ arg: DBXTeamLogFileSaveCopyReferenceDetails) { + self.fileSaveCopyReferenceDetails = arg + let swift = TeamLog.EventDetails.fileSaveCopyReferenceDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFolderOverviewDescriptionChangedDetails: DBXTeamLogEventDetails { + @objc + public var folderOverviewDescriptionChangedDetails: DBXTeamLogFolderOverviewDescriptionChangedDetails + + @objc + public init(_ arg: DBXTeamLogFolderOverviewDescriptionChangedDetails) { + self.folderOverviewDescriptionChangedDetails = arg + let swift = TeamLog.EventDetails.folderOverviewDescriptionChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFolderOverviewItemPinnedDetails: DBXTeamLogEventDetails { + @objc + public var folderOverviewItemPinnedDetails: DBXTeamLogFolderOverviewItemPinnedDetails + + @objc + public init(_ arg: DBXTeamLogFolderOverviewItemPinnedDetails) { + self.folderOverviewItemPinnedDetails = arg + let swift = TeamLog.EventDetails.folderOverviewItemPinnedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFolderOverviewItemUnpinnedDetails: DBXTeamLogEventDetails { + @objc + public var folderOverviewItemUnpinnedDetails: DBXTeamLogFolderOverviewItemUnpinnedDetails + + @objc + public init(_ arg: DBXTeamLogFolderOverviewItemUnpinnedDetails) { + self.folderOverviewItemUnpinnedDetails = arg + let swift = TeamLog.EventDetails.folderOverviewItemUnpinnedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsObjectLabelAddedDetails: DBXTeamLogEventDetails { + @objc + public var objectLabelAddedDetails: DBXTeamLogObjectLabelAddedDetails + + @objc + public init(_ arg: DBXTeamLogObjectLabelAddedDetails) { + self.objectLabelAddedDetails = arg + let swift = TeamLog.EventDetails.objectLabelAddedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsObjectLabelRemovedDetails: DBXTeamLogEventDetails { + @objc + public var objectLabelRemovedDetails: DBXTeamLogObjectLabelRemovedDetails + + @objc + public init(_ arg: DBXTeamLogObjectLabelRemovedDetails) { + self.objectLabelRemovedDetails = arg + let swift = TeamLog.EventDetails.objectLabelRemovedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsObjectLabelUpdatedValueDetails: DBXTeamLogEventDetails { + @objc + public var objectLabelUpdatedValueDetails: DBXTeamLogObjectLabelUpdatedValueDetails + + @objc + public init(_ arg: DBXTeamLogObjectLabelUpdatedValueDetails) { + self.objectLabelUpdatedValueDetails = arg + let swift = TeamLog.EventDetails.objectLabelUpdatedValueDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsOrganizeFolderWithTidyDetails: DBXTeamLogEventDetails { + @objc + public var organizeFolderWithTidyDetails: DBXTeamLogOrganizeFolderWithTidyDetails + + @objc + public init(_ arg: DBXTeamLogOrganizeFolderWithTidyDetails) { + self.organizeFolderWithTidyDetails = arg + let swift = TeamLog.EventDetails.organizeFolderWithTidyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsReplayFileDeleteDetails: DBXTeamLogEventDetails { + @objc + public var replayFileDeleteDetails: DBXTeamLogReplayFileDeleteDetails + + @objc + public init(_ arg: DBXTeamLogReplayFileDeleteDetails) { + self.replayFileDeleteDetails = arg + let swift = TeamLog.EventDetails.replayFileDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsRewindFolderDetails: DBXTeamLogEventDetails { + @objc + public var rewindFolderDetails: DBXTeamLogRewindFolderDetails + + @objc + public init(_ arg: DBXTeamLogRewindFolderDetails) { + self.rewindFolderDetails = arg + let swift = TeamLog.EventDetails.rewindFolderDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsUndoNamingConventionDetails: DBXTeamLogEventDetails { + @objc + public var undoNamingConventionDetails: DBXTeamLogUndoNamingConventionDetails + + @objc + public init(_ arg: DBXTeamLogUndoNamingConventionDetails) { + self.undoNamingConventionDetails = arg + let swift = TeamLog.EventDetails.undoNamingConventionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsUndoOrganizeFolderWithTidyDetails: DBXTeamLogEventDetails { + @objc + public var undoOrganizeFolderWithTidyDetails: DBXTeamLogUndoOrganizeFolderWithTidyDetails + + @objc + public init(_ arg: DBXTeamLogUndoOrganizeFolderWithTidyDetails) { + self.undoOrganizeFolderWithTidyDetails = arg + let swift = TeamLog.EventDetails.undoOrganizeFolderWithTidyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsUserTagsAddedDetails: DBXTeamLogEventDetails { + @objc + public var userTagsAddedDetails: DBXTeamLogUserTagsAddedDetails + + @objc + public init(_ arg: DBXTeamLogUserTagsAddedDetails) { + self.userTagsAddedDetails = arg + let swift = TeamLog.EventDetails.userTagsAddedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsUserTagsRemovedDetails: DBXTeamLogEventDetails { + @objc + public var userTagsRemovedDetails: DBXTeamLogUserTagsRemovedDetails + + @objc + public init(_ arg: DBXTeamLogUserTagsRemovedDetails) { + self.userTagsRemovedDetails = arg + let swift = TeamLog.EventDetails.userTagsRemovedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmailIngestReceiveFileDetails: DBXTeamLogEventDetails { + @objc + public var emailIngestReceiveFileDetails: DBXTeamLogEmailIngestReceiveFileDetails + + @objc + public init(_ arg: DBXTeamLogEmailIngestReceiveFileDetails) { + self.emailIngestReceiveFileDetails = arg + let swift = TeamLog.EventDetails.emailIngestReceiveFileDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestChangeDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestChangeDetails: DBXTeamLogFileRequestChangeDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestChangeDetails) { + self.fileRequestChangeDetails = arg + let swift = TeamLog.EventDetails.fileRequestChangeDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestCloseDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestCloseDetails: DBXTeamLogFileRequestCloseDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestCloseDetails) { + self.fileRequestCloseDetails = arg + let swift = TeamLog.EventDetails.fileRequestCloseDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestCreateDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestCreateDetails: DBXTeamLogFileRequestCreateDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestCreateDetails) { + self.fileRequestCreateDetails = arg + let swift = TeamLog.EventDetails.fileRequestCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestDeleteDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestDeleteDetails: DBXTeamLogFileRequestDeleteDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestDeleteDetails) { + self.fileRequestDeleteDetails = arg + let swift = TeamLog.EventDetails.fileRequestDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestReceiveFileDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestReceiveFileDetails: DBXTeamLogFileRequestReceiveFileDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestReceiveFileDetails) { + self.fileRequestReceiveFileDetails = arg + let swift = TeamLog.EventDetails.fileRequestReceiveFileDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupAddExternalIdDetails: DBXTeamLogEventDetails { + @objc + public var groupAddExternalIdDetails: DBXTeamLogGroupAddExternalIdDetails + + @objc + public init(_ arg: DBXTeamLogGroupAddExternalIdDetails) { + self.groupAddExternalIdDetails = arg + let swift = TeamLog.EventDetails.groupAddExternalIdDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupAddMemberDetails: DBXTeamLogEventDetails { + @objc + public var groupAddMemberDetails: DBXTeamLogGroupAddMemberDetails + + @objc + public init(_ arg: DBXTeamLogGroupAddMemberDetails) { + self.groupAddMemberDetails = arg + let swift = TeamLog.EventDetails.groupAddMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupChangeExternalIdDetails: DBXTeamLogEventDetails { + @objc + public var groupChangeExternalIdDetails: DBXTeamLogGroupChangeExternalIdDetails + + @objc + public init(_ arg: DBXTeamLogGroupChangeExternalIdDetails) { + self.groupChangeExternalIdDetails = arg + let swift = TeamLog.EventDetails.groupChangeExternalIdDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupChangeManagementTypeDetails: DBXTeamLogEventDetails { + @objc + public var groupChangeManagementTypeDetails: DBXTeamLogGroupChangeManagementTypeDetails + + @objc + public init(_ arg: DBXTeamLogGroupChangeManagementTypeDetails) { + self.groupChangeManagementTypeDetails = arg + let swift = TeamLog.EventDetails.groupChangeManagementTypeDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupChangeMemberRoleDetails: DBXTeamLogEventDetails { + @objc + public var groupChangeMemberRoleDetails: DBXTeamLogGroupChangeMemberRoleDetails + + @objc + public init(_ arg: DBXTeamLogGroupChangeMemberRoleDetails) { + self.groupChangeMemberRoleDetails = arg + let swift = TeamLog.EventDetails.groupChangeMemberRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupCreateDetails: DBXTeamLogEventDetails { + @objc + public var groupCreateDetails: DBXTeamLogGroupCreateDetails + + @objc + public init(_ arg: DBXTeamLogGroupCreateDetails) { + self.groupCreateDetails = arg + let swift = TeamLog.EventDetails.groupCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupDeleteDetails: DBXTeamLogEventDetails { + @objc + public var groupDeleteDetails: DBXTeamLogGroupDeleteDetails + + @objc + public init(_ arg: DBXTeamLogGroupDeleteDetails) { + self.groupDeleteDetails = arg + let swift = TeamLog.EventDetails.groupDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupDescriptionUpdatedDetails: DBXTeamLogEventDetails { + @objc + public var groupDescriptionUpdatedDetails: DBXTeamLogGroupDescriptionUpdatedDetails + + @objc + public init(_ arg: DBXTeamLogGroupDescriptionUpdatedDetails) { + self.groupDescriptionUpdatedDetails = arg + let swift = TeamLog.EventDetails.groupDescriptionUpdatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupJoinPolicyUpdatedDetails: DBXTeamLogEventDetails { + @objc + public var groupJoinPolicyUpdatedDetails: DBXTeamLogGroupJoinPolicyUpdatedDetails + + @objc + public init(_ arg: DBXTeamLogGroupJoinPolicyUpdatedDetails) { + self.groupJoinPolicyUpdatedDetails = arg + let swift = TeamLog.EventDetails.groupJoinPolicyUpdatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupMovedDetails: DBXTeamLogEventDetails { + @objc + public var groupMovedDetails: DBXTeamLogGroupMovedDetails + + @objc + public init(_ arg: DBXTeamLogGroupMovedDetails) { + self.groupMovedDetails = arg + let swift = TeamLog.EventDetails.groupMovedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupRemoveExternalIdDetails: DBXTeamLogEventDetails { + @objc + public var groupRemoveExternalIdDetails: DBXTeamLogGroupRemoveExternalIdDetails + + @objc + public init(_ arg: DBXTeamLogGroupRemoveExternalIdDetails) { + self.groupRemoveExternalIdDetails = arg + let swift = TeamLog.EventDetails.groupRemoveExternalIdDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupRemoveMemberDetails: DBXTeamLogEventDetails { + @objc + public var groupRemoveMemberDetails: DBXTeamLogGroupRemoveMemberDetails + + @objc + public init(_ arg: DBXTeamLogGroupRemoveMemberDetails) { + self.groupRemoveMemberDetails = arg + let swift = TeamLog.EventDetails.groupRemoveMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupRenameDetails: DBXTeamLogEventDetails { + @objc + public var groupRenameDetails: DBXTeamLogGroupRenameDetails + + @objc + public init(_ arg: DBXTeamLogGroupRenameDetails) { + self.groupRenameDetails = arg + let swift = TeamLog.EventDetails.groupRenameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAccountLockOrUnlockedDetails: DBXTeamLogEventDetails { + @objc + public var accountLockOrUnlockedDetails: DBXTeamLogAccountLockOrUnlockedDetails + + @objc + public init(_ arg: DBXTeamLogAccountLockOrUnlockedDetails) { + self.accountLockOrUnlockedDetails = arg + let swift = TeamLog.EventDetails.accountLockOrUnlockedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmmErrorDetails: DBXTeamLogEventDetails { + @objc + public var emmErrorDetails: DBXTeamLogEmmErrorDetails + + @objc + public init(_ arg: DBXTeamLogEmmErrorDetails) { + self.emmErrorDetails = arg + let swift = TeamLog.EventDetails.emmErrorDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGuestAdminSignedInViaTrustedTeamsDetails: DBXTeamLogEventDetails { + @objc + public var guestAdminSignedInViaTrustedTeamsDetails: DBXTeamLogGuestAdminSignedInViaTrustedTeamsDetails + + @objc + public init(_ arg: DBXTeamLogGuestAdminSignedInViaTrustedTeamsDetails) { + self.guestAdminSignedInViaTrustedTeamsDetails = arg + let swift = TeamLog.EventDetails.guestAdminSignedInViaTrustedTeamsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGuestAdminSignedOutViaTrustedTeamsDetails: DBXTeamLogEventDetails { + @objc + public var guestAdminSignedOutViaTrustedTeamsDetails: DBXTeamLogGuestAdminSignedOutViaTrustedTeamsDetails + + @objc + public init(_ arg: DBXTeamLogGuestAdminSignedOutViaTrustedTeamsDetails) { + self.guestAdminSignedOutViaTrustedTeamsDetails = arg + let swift = TeamLog.EventDetails.guestAdminSignedOutViaTrustedTeamsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLoginFailDetails: DBXTeamLogEventDetails { + @objc + public var loginFailDetails: DBXTeamLogLoginFailDetails + + @objc + public init(_ arg: DBXTeamLogLoginFailDetails) { + self.loginFailDetails = arg + let swift = TeamLog.EventDetails.loginFailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLoginSuccessDetails: DBXTeamLogEventDetails { + @objc + public var loginSuccessDetails: DBXTeamLogLoginSuccessDetails + + @objc + public init(_ arg: DBXTeamLogLoginSuccessDetails) { + self.loginSuccessDetails = arg + let swift = TeamLog.EventDetails.loginSuccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsLogoutDetails: DBXTeamLogEventDetails { + @objc + public var logoutDetails: DBXTeamLogLogoutDetails + + @objc + public init(_ arg: DBXTeamLogLogoutDetails) { + self.logoutDetails = arg + let swift = TeamLog.EventDetails.logoutDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsResellerSupportSessionEndDetails: DBXTeamLogEventDetails { + @objc + public var resellerSupportSessionEndDetails: DBXTeamLogResellerSupportSessionEndDetails + + @objc + public init(_ arg: DBXTeamLogResellerSupportSessionEndDetails) { + self.resellerSupportSessionEndDetails = arg + let swift = TeamLog.EventDetails.resellerSupportSessionEndDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsResellerSupportSessionStartDetails: DBXTeamLogEventDetails { + @objc + public var resellerSupportSessionStartDetails: DBXTeamLogResellerSupportSessionStartDetails + + @objc + public init(_ arg: DBXTeamLogResellerSupportSessionStartDetails) { + self.resellerSupportSessionStartDetails = arg + let swift = TeamLog.EventDetails.resellerSupportSessionStartDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSignInAsSessionEndDetails: DBXTeamLogEventDetails { + @objc + public var signInAsSessionEndDetails: DBXTeamLogSignInAsSessionEndDetails + + @objc + public init(_ arg: DBXTeamLogSignInAsSessionEndDetails) { + self.signInAsSessionEndDetails = arg + let swift = TeamLog.EventDetails.signInAsSessionEndDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSignInAsSessionStartDetails: DBXTeamLogEventDetails { + @objc + public var signInAsSessionStartDetails: DBXTeamLogSignInAsSessionStartDetails + + @objc + public init(_ arg: DBXTeamLogSignInAsSessionStartDetails) { + self.signInAsSessionStartDetails = arg + let swift = TeamLog.EventDetails.signInAsSessionStartDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoErrorDetails: DBXTeamLogEventDetails { + @objc + public var ssoErrorDetails: DBXTeamLogSsoErrorDetails + + @objc + public init(_ arg: DBXTeamLogSsoErrorDetails) { + self.ssoErrorDetails = arg + let swift = TeamLog.EventDetails.ssoErrorDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBackupAdminInvitationSentDetails: DBXTeamLogEventDetails { + @objc + public var backupAdminInvitationSentDetails: DBXTeamLogBackupAdminInvitationSentDetails + + @objc + public init(_ arg: DBXTeamLogBackupAdminInvitationSentDetails) { + self.backupAdminInvitationSentDetails = arg + let swift = TeamLog.EventDetails.backupAdminInvitationSentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBackupInvitationOpenedDetails: DBXTeamLogEventDetails { + @objc + public var backupInvitationOpenedDetails: DBXTeamLogBackupInvitationOpenedDetails + + @objc + public init(_ arg: DBXTeamLogBackupInvitationOpenedDetails) { + self.backupInvitationOpenedDetails = arg + let swift = TeamLog.EventDetails.backupInvitationOpenedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsCreateTeamInviteLinkDetails: DBXTeamLogEventDetails { + @objc + public var createTeamInviteLinkDetails: DBXTeamLogCreateTeamInviteLinkDetails + + @objc + public init(_ arg: DBXTeamLogCreateTeamInviteLinkDetails) { + self.createTeamInviteLinkDetails = arg + let swift = TeamLog.EventDetails.createTeamInviteLinkDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeleteTeamInviteLinkDetails: DBXTeamLogEventDetails { + @objc + public var deleteTeamInviteLinkDetails: DBXTeamLogDeleteTeamInviteLinkDetails + + @objc + public init(_ arg: DBXTeamLogDeleteTeamInviteLinkDetails) { + self.deleteTeamInviteLinkDetails = arg + let swift = TeamLog.EventDetails.deleteTeamInviteLinkDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberAddExternalIdDetails: DBXTeamLogEventDetails { + @objc + public var memberAddExternalIdDetails: DBXTeamLogMemberAddExternalIdDetails + + @objc + public init(_ arg: DBXTeamLogMemberAddExternalIdDetails) { + self.memberAddExternalIdDetails = arg + let swift = TeamLog.EventDetails.memberAddExternalIdDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberAddNameDetails: DBXTeamLogEventDetails { + @objc + public var memberAddNameDetails: DBXTeamLogMemberAddNameDetails + + @objc + public init(_ arg: DBXTeamLogMemberAddNameDetails) { + self.memberAddNameDetails = arg + let swift = TeamLog.EventDetails.memberAddNameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberChangeAdminRoleDetails: DBXTeamLogEventDetails { + @objc + public var memberChangeAdminRoleDetails: DBXTeamLogMemberChangeAdminRoleDetails + + @objc + public init(_ arg: DBXTeamLogMemberChangeAdminRoleDetails) { + self.memberChangeAdminRoleDetails = arg + let swift = TeamLog.EventDetails.memberChangeAdminRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberChangeEmailDetails: DBXTeamLogEventDetails { + @objc + public var memberChangeEmailDetails: DBXTeamLogMemberChangeEmailDetails + + @objc + public init(_ arg: DBXTeamLogMemberChangeEmailDetails) { + self.memberChangeEmailDetails = arg + let swift = TeamLog.EventDetails.memberChangeEmailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberChangeExternalIdDetails: DBXTeamLogEventDetails { + @objc + public var memberChangeExternalIdDetails: DBXTeamLogMemberChangeExternalIdDetails + + @objc + public init(_ arg: DBXTeamLogMemberChangeExternalIdDetails) { + self.memberChangeExternalIdDetails = arg + let swift = TeamLog.EventDetails.memberChangeExternalIdDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberChangeMembershipTypeDetails: DBXTeamLogEventDetails { + @objc + public var memberChangeMembershipTypeDetails: DBXTeamLogMemberChangeMembershipTypeDetails + + @objc + public init(_ arg: DBXTeamLogMemberChangeMembershipTypeDetails) { + self.memberChangeMembershipTypeDetails = arg + let swift = TeamLog.EventDetails.memberChangeMembershipTypeDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberChangeNameDetails: DBXTeamLogEventDetails { + @objc + public var memberChangeNameDetails: DBXTeamLogMemberChangeNameDetails + + @objc + public init(_ arg: DBXTeamLogMemberChangeNameDetails) { + self.memberChangeNameDetails = arg + let swift = TeamLog.EventDetails.memberChangeNameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberChangeResellerRoleDetails: DBXTeamLogEventDetails { + @objc + public var memberChangeResellerRoleDetails: DBXTeamLogMemberChangeResellerRoleDetails + + @objc + public init(_ arg: DBXTeamLogMemberChangeResellerRoleDetails) { + self.memberChangeResellerRoleDetails = arg + let swift = TeamLog.EventDetails.memberChangeResellerRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberChangeStatusDetails: DBXTeamLogEventDetails { + @objc + public var memberChangeStatusDetails: DBXTeamLogMemberChangeStatusDetails + + @objc + public init(_ arg: DBXTeamLogMemberChangeStatusDetails) { + self.memberChangeStatusDetails = arg + let swift = TeamLog.EventDetails.memberChangeStatusDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberDeleteManualContactsDetails: DBXTeamLogEventDetails { + @objc + public var memberDeleteManualContactsDetails: DBXTeamLogMemberDeleteManualContactsDetails + + @objc + public init(_ arg: DBXTeamLogMemberDeleteManualContactsDetails) { + self.memberDeleteManualContactsDetails = arg + let swift = TeamLog.EventDetails.memberDeleteManualContactsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberDeleteProfilePhotoDetails: DBXTeamLogEventDetails { + @objc + public var memberDeleteProfilePhotoDetails: DBXTeamLogMemberDeleteProfilePhotoDetails + + @objc + public init(_ arg: DBXTeamLogMemberDeleteProfilePhotoDetails) { + self.memberDeleteProfilePhotoDetails = arg + let swift = TeamLog.EventDetails.memberDeleteProfilePhotoDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberPermanentlyDeleteAccountContentsDetails: DBXTeamLogEventDetails { + @objc + public var memberPermanentlyDeleteAccountContentsDetails: DBXTeamLogMemberPermanentlyDeleteAccountContentsDetails + + @objc + public init(_ arg: DBXTeamLogMemberPermanentlyDeleteAccountContentsDetails) { + self.memberPermanentlyDeleteAccountContentsDetails = arg + let swift = TeamLog.EventDetails.memberPermanentlyDeleteAccountContentsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberRemoveExternalIdDetails: DBXTeamLogEventDetails { + @objc + public var memberRemoveExternalIdDetails: DBXTeamLogMemberRemoveExternalIdDetails + + @objc + public init(_ arg: DBXTeamLogMemberRemoveExternalIdDetails) { + self.memberRemoveExternalIdDetails = arg + let swift = TeamLog.EventDetails.memberRemoveExternalIdDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSetProfilePhotoDetails: DBXTeamLogEventDetails { + @objc + public var memberSetProfilePhotoDetails: DBXTeamLogMemberSetProfilePhotoDetails + + @objc + public init(_ arg: DBXTeamLogMemberSetProfilePhotoDetails) { + self.memberSetProfilePhotoDetails = arg + let swift = TeamLog.EventDetails.memberSetProfilePhotoDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsAddCustomQuotaDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsAddCustomQuotaDetails: DBXTeamLogMemberSpaceLimitsAddCustomQuotaDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsAddCustomQuotaDetails) { + self.memberSpaceLimitsAddCustomQuotaDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsAddCustomQuotaDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsChangeCustomQuotaDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsChangeCustomQuotaDetails: DBXTeamLogMemberSpaceLimitsChangeCustomQuotaDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangeCustomQuotaDetails) { + self.memberSpaceLimitsChangeCustomQuotaDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsChangeCustomQuotaDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsChangeStatusDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsChangeStatusDetails: DBXTeamLogMemberSpaceLimitsChangeStatusDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangeStatusDetails) { + self.memberSpaceLimitsChangeStatusDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsChangeStatusDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsRemoveCustomQuotaDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsRemoveCustomQuotaDetails: DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaDetails) { + self.memberSpaceLimitsRemoveCustomQuotaDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsRemoveCustomQuotaDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSuggestDetails: DBXTeamLogEventDetails { + @objc + public var memberSuggestDetails: DBXTeamLogMemberSuggestDetails + + @objc + public init(_ arg: DBXTeamLogMemberSuggestDetails) { + self.memberSuggestDetails = arg + let swift = TeamLog.EventDetails.memberSuggestDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberTransferAccountContentsDetails: DBXTeamLogEventDetails { + @objc + public var memberTransferAccountContentsDetails: DBXTeamLogMemberTransferAccountContentsDetails + + @objc + public init(_ arg: DBXTeamLogMemberTransferAccountContentsDetails) { + self.memberTransferAccountContentsDetails = arg + let swift = TeamLog.EventDetails.memberTransferAccountContentsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPendingSecondaryEmailAddedDetails: DBXTeamLogEventDetails { + @objc + public var pendingSecondaryEmailAddedDetails: DBXTeamLogPendingSecondaryEmailAddedDetails + + @objc + public init(_ arg: DBXTeamLogPendingSecondaryEmailAddedDetails) { + self.pendingSecondaryEmailAddedDetails = arg + let swift = TeamLog.EventDetails.pendingSecondaryEmailAddedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSecondaryEmailDeletedDetails: DBXTeamLogEventDetails { + @objc + public var secondaryEmailDeletedDetails: DBXTeamLogSecondaryEmailDeletedDetails + + @objc + public init(_ arg: DBXTeamLogSecondaryEmailDeletedDetails) { + self.secondaryEmailDeletedDetails = arg + let swift = TeamLog.EventDetails.secondaryEmailDeletedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSecondaryEmailVerifiedDetails: DBXTeamLogEventDetails { + @objc + public var secondaryEmailVerifiedDetails: DBXTeamLogSecondaryEmailVerifiedDetails + + @objc + public init(_ arg: DBXTeamLogSecondaryEmailVerifiedDetails) { + self.secondaryEmailVerifiedDetails = arg + let swift = TeamLog.EventDetails.secondaryEmailVerifiedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSecondaryMailsPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var secondaryMailsPolicyChangedDetails: DBXTeamLogSecondaryMailsPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogSecondaryMailsPolicyChangedDetails) { + self.secondaryMailsPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.secondaryMailsPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderAddPageDetails: DBXTeamLogEventDetails { + @objc + public var binderAddPageDetails: DBXTeamLogBinderAddPageDetails + + @objc + public init(_ arg: DBXTeamLogBinderAddPageDetails) { + self.binderAddPageDetails = arg + let swift = TeamLog.EventDetails.binderAddPageDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderAddSectionDetails: DBXTeamLogEventDetails { + @objc + public var binderAddSectionDetails: DBXTeamLogBinderAddSectionDetails + + @objc + public init(_ arg: DBXTeamLogBinderAddSectionDetails) { + self.binderAddSectionDetails = arg + let swift = TeamLog.EventDetails.binderAddSectionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderRemovePageDetails: DBXTeamLogEventDetails { + @objc + public var binderRemovePageDetails: DBXTeamLogBinderRemovePageDetails + + @objc + public init(_ arg: DBXTeamLogBinderRemovePageDetails) { + self.binderRemovePageDetails = arg + let swift = TeamLog.EventDetails.binderRemovePageDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderRemoveSectionDetails: DBXTeamLogEventDetails { + @objc + public var binderRemoveSectionDetails: DBXTeamLogBinderRemoveSectionDetails + + @objc + public init(_ arg: DBXTeamLogBinderRemoveSectionDetails) { + self.binderRemoveSectionDetails = arg + let swift = TeamLog.EventDetails.binderRemoveSectionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderRenamePageDetails: DBXTeamLogEventDetails { + @objc + public var binderRenamePageDetails: DBXTeamLogBinderRenamePageDetails + + @objc + public init(_ arg: DBXTeamLogBinderRenamePageDetails) { + self.binderRenamePageDetails = arg + let swift = TeamLog.EventDetails.binderRenamePageDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderRenameSectionDetails: DBXTeamLogEventDetails { + @objc + public var binderRenameSectionDetails: DBXTeamLogBinderRenameSectionDetails + + @objc + public init(_ arg: DBXTeamLogBinderRenameSectionDetails) { + self.binderRenameSectionDetails = arg + let swift = TeamLog.EventDetails.binderRenameSectionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderReorderPageDetails: DBXTeamLogEventDetails { + @objc + public var binderReorderPageDetails: DBXTeamLogBinderReorderPageDetails + + @objc + public init(_ arg: DBXTeamLogBinderReorderPageDetails) { + self.binderReorderPageDetails = arg + let swift = TeamLog.EventDetails.binderReorderPageDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsBinderReorderSectionDetails: DBXTeamLogEventDetails { + @objc + public var binderReorderSectionDetails: DBXTeamLogBinderReorderSectionDetails + + @objc + public init(_ arg: DBXTeamLogBinderReorderSectionDetails) { + self.binderReorderSectionDetails = arg + let swift = TeamLog.EventDetails.binderReorderSectionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentAddMemberDetails: DBXTeamLogEventDetails { + @objc + public var paperContentAddMemberDetails: DBXTeamLogPaperContentAddMemberDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentAddMemberDetails) { + self.paperContentAddMemberDetails = arg + let swift = TeamLog.EventDetails.paperContentAddMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentAddToFolderDetails: DBXTeamLogEventDetails { + @objc + public var paperContentAddToFolderDetails: DBXTeamLogPaperContentAddToFolderDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentAddToFolderDetails) { + self.paperContentAddToFolderDetails = arg + let swift = TeamLog.EventDetails.paperContentAddToFolderDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentArchiveDetails: DBXTeamLogEventDetails { + @objc + public var paperContentArchiveDetails: DBXTeamLogPaperContentArchiveDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentArchiveDetails) { + self.paperContentArchiveDetails = arg + let swift = TeamLog.EventDetails.paperContentArchiveDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentCreateDetails: DBXTeamLogEventDetails { + @objc + public var paperContentCreateDetails: DBXTeamLogPaperContentCreateDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentCreateDetails) { + self.paperContentCreateDetails = arg + let swift = TeamLog.EventDetails.paperContentCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentPermanentlyDeleteDetails: DBXTeamLogEventDetails { + @objc + public var paperContentPermanentlyDeleteDetails: DBXTeamLogPaperContentPermanentlyDeleteDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentPermanentlyDeleteDetails) { + self.paperContentPermanentlyDeleteDetails = arg + let swift = TeamLog.EventDetails.paperContentPermanentlyDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentRemoveFromFolderDetails: DBXTeamLogEventDetails { + @objc + public var paperContentRemoveFromFolderDetails: DBXTeamLogPaperContentRemoveFromFolderDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentRemoveFromFolderDetails) { + self.paperContentRemoveFromFolderDetails = arg + let swift = TeamLog.EventDetails.paperContentRemoveFromFolderDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentRemoveMemberDetails: DBXTeamLogEventDetails { + @objc + public var paperContentRemoveMemberDetails: DBXTeamLogPaperContentRemoveMemberDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentRemoveMemberDetails) { + self.paperContentRemoveMemberDetails = arg + let swift = TeamLog.EventDetails.paperContentRemoveMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentRenameDetails: DBXTeamLogEventDetails { + @objc + public var paperContentRenameDetails: DBXTeamLogPaperContentRenameDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentRenameDetails) { + self.paperContentRenameDetails = arg + let swift = TeamLog.EventDetails.paperContentRenameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperContentRestoreDetails: DBXTeamLogEventDetails { + @objc + public var paperContentRestoreDetails: DBXTeamLogPaperContentRestoreDetails + + @objc + public init(_ arg: DBXTeamLogPaperContentRestoreDetails) { + self.paperContentRestoreDetails = arg + let swift = TeamLog.EventDetails.paperContentRestoreDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocAddCommentDetails: DBXTeamLogEventDetails { + @objc + public var paperDocAddCommentDetails: DBXTeamLogPaperDocAddCommentDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocAddCommentDetails) { + self.paperDocAddCommentDetails = arg + let swift = TeamLog.EventDetails.paperDocAddCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocChangeMemberRoleDetails: DBXTeamLogEventDetails { + @objc + public var paperDocChangeMemberRoleDetails: DBXTeamLogPaperDocChangeMemberRoleDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocChangeMemberRoleDetails) { + self.paperDocChangeMemberRoleDetails = arg + let swift = TeamLog.EventDetails.paperDocChangeMemberRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocChangeSharingPolicyDetails: DBXTeamLogEventDetails { + @objc + public var paperDocChangeSharingPolicyDetails: DBXTeamLogPaperDocChangeSharingPolicyDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocChangeSharingPolicyDetails) { + self.paperDocChangeSharingPolicyDetails = arg + let swift = TeamLog.EventDetails.paperDocChangeSharingPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocChangeSubscriptionDetails: DBXTeamLogEventDetails { + @objc + public var paperDocChangeSubscriptionDetails: DBXTeamLogPaperDocChangeSubscriptionDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocChangeSubscriptionDetails) { + self.paperDocChangeSubscriptionDetails = arg + let swift = TeamLog.EventDetails.paperDocChangeSubscriptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocDeletedDetails: DBXTeamLogEventDetails { + @objc + public var paperDocDeletedDetails: DBXTeamLogPaperDocDeletedDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocDeletedDetails) { + self.paperDocDeletedDetails = arg + let swift = TeamLog.EventDetails.paperDocDeletedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocDeleteCommentDetails: DBXTeamLogEventDetails { + @objc + public var paperDocDeleteCommentDetails: DBXTeamLogPaperDocDeleteCommentDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocDeleteCommentDetails) { + self.paperDocDeleteCommentDetails = arg + let swift = TeamLog.EventDetails.paperDocDeleteCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocDownloadDetails: DBXTeamLogEventDetails { + @objc + public var paperDocDownloadDetails: DBXTeamLogPaperDocDownloadDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocDownloadDetails) { + self.paperDocDownloadDetails = arg + let swift = TeamLog.EventDetails.paperDocDownloadDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocEditDetails: DBXTeamLogEventDetails { + @objc + public var paperDocEditDetails: DBXTeamLogPaperDocEditDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocEditDetails) { + self.paperDocEditDetails = arg + let swift = TeamLog.EventDetails.paperDocEditDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocEditCommentDetails: DBXTeamLogEventDetails { + @objc + public var paperDocEditCommentDetails: DBXTeamLogPaperDocEditCommentDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocEditCommentDetails) { + self.paperDocEditCommentDetails = arg + let swift = TeamLog.EventDetails.paperDocEditCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocFollowedDetails: DBXTeamLogEventDetails { + @objc + public var paperDocFollowedDetails: DBXTeamLogPaperDocFollowedDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocFollowedDetails) { + self.paperDocFollowedDetails = arg + let swift = TeamLog.EventDetails.paperDocFollowedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocMentionDetails: DBXTeamLogEventDetails { + @objc + public var paperDocMentionDetails: DBXTeamLogPaperDocMentionDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocMentionDetails) { + self.paperDocMentionDetails = arg + let swift = TeamLog.EventDetails.paperDocMentionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocOwnershipChangedDetails: DBXTeamLogEventDetails { + @objc + public var paperDocOwnershipChangedDetails: DBXTeamLogPaperDocOwnershipChangedDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocOwnershipChangedDetails) { + self.paperDocOwnershipChangedDetails = arg + let swift = TeamLog.EventDetails.paperDocOwnershipChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocRequestAccessDetails: DBXTeamLogEventDetails { + @objc + public var paperDocRequestAccessDetails: DBXTeamLogPaperDocRequestAccessDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocRequestAccessDetails) { + self.paperDocRequestAccessDetails = arg + let swift = TeamLog.EventDetails.paperDocRequestAccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocResolveCommentDetails: DBXTeamLogEventDetails { + @objc + public var paperDocResolveCommentDetails: DBXTeamLogPaperDocResolveCommentDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocResolveCommentDetails) { + self.paperDocResolveCommentDetails = arg + let swift = TeamLog.EventDetails.paperDocResolveCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocRevertDetails: DBXTeamLogEventDetails { + @objc + public var paperDocRevertDetails: DBXTeamLogPaperDocRevertDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocRevertDetails) { + self.paperDocRevertDetails = arg + let swift = TeamLog.EventDetails.paperDocRevertDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocSlackShareDetails: DBXTeamLogEventDetails { + @objc + public var paperDocSlackShareDetails: DBXTeamLogPaperDocSlackShareDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocSlackShareDetails) { + self.paperDocSlackShareDetails = arg + let swift = TeamLog.EventDetails.paperDocSlackShareDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocTeamInviteDetails: DBXTeamLogEventDetails { + @objc + public var paperDocTeamInviteDetails: DBXTeamLogPaperDocTeamInviteDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocTeamInviteDetails) { + self.paperDocTeamInviteDetails = arg + let swift = TeamLog.EventDetails.paperDocTeamInviteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocTrashedDetails: DBXTeamLogEventDetails { + @objc + public var paperDocTrashedDetails: DBXTeamLogPaperDocTrashedDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocTrashedDetails) { + self.paperDocTrashedDetails = arg + let swift = TeamLog.EventDetails.paperDocTrashedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocUnresolveCommentDetails: DBXTeamLogEventDetails { + @objc + public var paperDocUnresolveCommentDetails: DBXTeamLogPaperDocUnresolveCommentDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocUnresolveCommentDetails) { + self.paperDocUnresolveCommentDetails = arg + let swift = TeamLog.EventDetails.paperDocUnresolveCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocUntrashedDetails: DBXTeamLogEventDetails { + @objc + public var paperDocUntrashedDetails: DBXTeamLogPaperDocUntrashedDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocUntrashedDetails) { + self.paperDocUntrashedDetails = arg + let swift = TeamLog.EventDetails.paperDocUntrashedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDocViewDetails: DBXTeamLogEventDetails { + @objc + public var paperDocViewDetails: DBXTeamLogPaperDocViewDetails + + @objc + public init(_ arg: DBXTeamLogPaperDocViewDetails) { + self.paperDocViewDetails = arg + let swift = TeamLog.EventDetails.paperDocViewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperExternalViewAllowDetails: DBXTeamLogEventDetails { + @objc + public var paperExternalViewAllowDetails: DBXTeamLogPaperExternalViewAllowDetails + + @objc + public init(_ arg: DBXTeamLogPaperExternalViewAllowDetails) { + self.paperExternalViewAllowDetails = arg + let swift = TeamLog.EventDetails.paperExternalViewAllowDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperExternalViewDefaultTeamDetails: DBXTeamLogEventDetails { + @objc + public var paperExternalViewDefaultTeamDetails: DBXTeamLogPaperExternalViewDefaultTeamDetails + + @objc + public init(_ arg: DBXTeamLogPaperExternalViewDefaultTeamDetails) { + self.paperExternalViewDefaultTeamDetails = arg + let swift = TeamLog.EventDetails.paperExternalViewDefaultTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperExternalViewForbidDetails: DBXTeamLogEventDetails { + @objc + public var paperExternalViewForbidDetails: DBXTeamLogPaperExternalViewForbidDetails + + @objc + public init(_ arg: DBXTeamLogPaperExternalViewForbidDetails) { + self.paperExternalViewForbidDetails = arg + let swift = TeamLog.EventDetails.paperExternalViewForbidDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperFolderChangeSubscriptionDetails: DBXTeamLogEventDetails { + @objc + public var paperFolderChangeSubscriptionDetails: DBXTeamLogPaperFolderChangeSubscriptionDetails + + @objc + public init(_ arg: DBXTeamLogPaperFolderChangeSubscriptionDetails) { + self.paperFolderChangeSubscriptionDetails = arg + let swift = TeamLog.EventDetails.paperFolderChangeSubscriptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperFolderDeletedDetails: DBXTeamLogEventDetails { + @objc + public var paperFolderDeletedDetails: DBXTeamLogPaperFolderDeletedDetails + + @objc + public init(_ arg: DBXTeamLogPaperFolderDeletedDetails) { + self.paperFolderDeletedDetails = arg + let swift = TeamLog.EventDetails.paperFolderDeletedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperFolderFollowedDetails: DBXTeamLogEventDetails { + @objc + public var paperFolderFollowedDetails: DBXTeamLogPaperFolderFollowedDetails + + @objc + public init(_ arg: DBXTeamLogPaperFolderFollowedDetails) { + self.paperFolderFollowedDetails = arg + let swift = TeamLog.EventDetails.paperFolderFollowedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperFolderTeamInviteDetails: DBXTeamLogEventDetails { + @objc + public var paperFolderTeamInviteDetails: DBXTeamLogPaperFolderTeamInviteDetails + + @objc + public init(_ arg: DBXTeamLogPaperFolderTeamInviteDetails) { + self.paperFolderTeamInviteDetails = arg + let swift = TeamLog.EventDetails.paperFolderTeamInviteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperPublishedLinkChangePermissionDetails: DBXTeamLogEventDetails { + @objc + public var paperPublishedLinkChangePermissionDetails: DBXTeamLogPaperPublishedLinkChangePermissionDetails + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkChangePermissionDetails) { + self.paperPublishedLinkChangePermissionDetails = arg + let swift = TeamLog.EventDetails.paperPublishedLinkChangePermissionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperPublishedLinkCreateDetails: DBXTeamLogEventDetails { + @objc + public var paperPublishedLinkCreateDetails: DBXTeamLogPaperPublishedLinkCreateDetails + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkCreateDetails) { + self.paperPublishedLinkCreateDetails = arg + let swift = TeamLog.EventDetails.paperPublishedLinkCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperPublishedLinkDisabledDetails: DBXTeamLogEventDetails { + @objc + public var paperPublishedLinkDisabledDetails: DBXTeamLogPaperPublishedLinkDisabledDetails + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkDisabledDetails) { + self.paperPublishedLinkDisabledDetails = arg + let swift = TeamLog.EventDetails.paperPublishedLinkDisabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperPublishedLinkViewDetails: DBXTeamLogEventDetails { + @objc + public var paperPublishedLinkViewDetails: DBXTeamLogPaperPublishedLinkViewDetails + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkViewDetails) { + self.paperPublishedLinkViewDetails = arg + let swift = TeamLog.EventDetails.paperPublishedLinkViewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPasswordChangeDetails: DBXTeamLogEventDetails { + @objc + public var passwordChangeDetails: DBXTeamLogPasswordChangeDetails + + @objc + public init(_ arg: DBXTeamLogPasswordChangeDetails) { + self.passwordChangeDetails = arg + let swift = TeamLog.EventDetails.passwordChangeDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPasswordResetDetails: DBXTeamLogEventDetails { + @objc + public var passwordResetDetails: DBXTeamLogPasswordResetDetails + + @objc + public init(_ arg: DBXTeamLogPasswordResetDetails) { + self.passwordResetDetails = arg + let swift = TeamLog.EventDetails.passwordResetDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPasswordResetAllDetails: DBXTeamLogEventDetails { + @objc + public var passwordResetAllDetails: DBXTeamLogPasswordResetAllDetails + + @objc + public init(_ arg: DBXTeamLogPasswordResetAllDetails) { + self.passwordResetAllDetails = arg + let swift = TeamLog.EventDetails.passwordResetAllDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsClassificationCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var classificationCreateReportDetails: DBXTeamLogClassificationCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogClassificationCreateReportDetails) { + self.classificationCreateReportDetails = arg + let swift = TeamLog.EventDetails.classificationCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsClassificationCreateReportFailDetails: DBXTeamLogEventDetails { + @objc + public var classificationCreateReportFailDetails: DBXTeamLogClassificationCreateReportFailDetails + + @objc + public init(_ arg: DBXTeamLogClassificationCreateReportFailDetails) { + self.classificationCreateReportFailDetails = arg + let swift = TeamLog.EventDetails.classificationCreateReportFailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmmCreateExceptionsReportDetails: DBXTeamLogEventDetails { + @objc + public var emmCreateExceptionsReportDetails: DBXTeamLogEmmCreateExceptionsReportDetails + + @objc + public init(_ arg: DBXTeamLogEmmCreateExceptionsReportDetails) { + self.emmCreateExceptionsReportDetails = arg + let swift = TeamLog.EventDetails.emmCreateExceptionsReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmmCreateUsageReportDetails: DBXTeamLogEventDetails { + @objc + public var emmCreateUsageReportDetails: DBXTeamLogEmmCreateUsageReportDetails + + @objc + public init(_ arg: DBXTeamLogEmmCreateUsageReportDetails) { + self.emmCreateUsageReportDetails = arg + let swift = TeamLog.EventDetails.emmCreateUsageReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExportMembersReportDetails: DBXTeamLogEventDetails { + @objc + public var exportMembersReportDetails: DBXTeamLogExportMembersReportDetails + + @objc + public init(_ arg: DBXTeamLogExportMembersReportDetails) { + self.exportMembersReportDetails = arg + let swift = TeamLog.EventDetails.exportMembersReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExportMembersReportFailDetails: DBXTeamLogEventDetails { + @objc + public var exportMembersReportFailDetails: DBXTeamLogExportMembersReportFailDetails + + @objc + public init(_ arg: DBXTeamLogExportMembersReportFailDetails) { + self.exportMembersReportFailDetails = arg + let swift = TeamLog.EventDetails.exportMembersReportFailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExternalSharingCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var externalSharingCreateReportDetails: DBXTeamLogExternalSharingCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogExternalSharingCreateReportDetails) { + self.externalSharingCreateReportDetails = arg + let swift = TeamLog.EventDetails.externalSharingCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExternalSharingReportFailedDetails: DBXTeamLogEventDetails { + @objc + public var externalSharingReportFailedDetails: DBXTeamLogExternalSharingReportFailedDetails + + @objc + public init(_ arg: DBXTeamLogExternalSharingReportFailedDetails) { + self.externalSharingReportFailedDetails = arg + let swift = TeamLog.EventDetails.externalSharingReportFailedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoExpirationLinkGenCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var noExpirationLinkGenCreateReportDetails: DBXTeamLogNoExpirationLinkGenCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogNoExpirationLinkGenCreateReportDetails) { + self.noExpirationLinkGenCreateReportDetails = arg + let swift = TeamLog.EventDetails.noExpirationLinkGenCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoExpirationLinkGenReportFailedDetails: DBXTeamLogEventDetails { + @objc + public var noExpirationLinkGenReportFailedDetails: DBXTeamLogNoExpirationLinkGenReportFailedDetails + + @objc + public init(_ arg: DBXTeamLogNoExpirationLinkGenReportFailedDetails) { + self.noExpirationLinkGenReportFailedDetails = arg + let swift = TeamLog.EventDetails.noExpirationLinkGenReportFailedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoPasswordLinkGenCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var noPasswordLinkGenCreateReportDetails: DBXTeamLogNoPasswordLinkGenCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkGenCreateReportDetails) { + self.noPasswordLinkGenCreateReportDetails = arg + let swift = TeamLog.EventDetails.noPasswordLinkGenCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoPasswordLinkGenReportFailedDetails: DBXTeamLogEventDetails { + @objc + public var noPasswordLinkGenReportFailedDetails: DBXTeamLogNoPasswordLinkGenReportFailedDetails + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkGenReportFailedDetails) { + self.noPasswordLinkGenReportFailedDetails = arg + let swift = TeamLog.EventDetails.noPasswordLinkGenReportFailedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoPasswordLinkViewCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var noPasswordLinkViewCreateReportDetails: DBXTeamLogNoPasswordLinkViewCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkViewCreateReportDetails) { + self.noPasswordLinkViewCreateReportDetails = arg + let swift = TeamLog.EventDetails.noPasswordLinkViewCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoPasswordLinkViewReportFailedDetails: DBXTeamLogEventDetails { + @objc + public var noPasswordLinkViewReportFailedDetails: DBXTeamLogNoPasswordLinkViewReportFailedDetails + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkViewReportFailedDetails) { + self.noPasswordLinkViewReportFailedDetails = arg + let swift = TeamLog.EventDetails.noPasswordLinkViewReportFailedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsOutdatedLinkViewCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var outdatedLinkViewCreateReportDetails: DBXTeamLogOutdatedLinkViewCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogOutdatedLinkViewCreateReportDetails) { + self.outdatedLinkViewCreateReportDetails = arg + let swift = TeamLog.EventDetails.outdatedLinkViewCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsOutdatedLinkViewReportFailedDetails: DBXTeamLogEventDetails { + @objc + public var outdatedLinkViewReportFailedDetails: DBXTeamLogOutdatedLinkViewReportFailedDetails + + @objc + public init(_ arg: DBXTeamLogOutdatedLinkViewReportFailedDetails) { + self.outdatedLinkViewReportFailedDetails = arg + let swift = TeamLog.EventDetails.outdatedLinkViewReportFailedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperAdminExportStartDetails: DBXTeamLogEventDetails { + @objc + public var paperAdminExportStartDetails: DBXTeamLogPaperAdminExportStartDetails + + @objc + public init(_ arg: DBXTeamLogPaperAdminExportStartDetails) { + self.paperAdminExportStartDetails = arg + let swift = TeamLog.EventDetails.paperAdminExportStartDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsRansomwareAlertCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var ransomwareAlertCreateReportDetails: DBXTeamLogRansomwareAlertCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogRansomwareAlertCreateReportDetails) { + self.ransomwareAlertCreateReportDetails = arg + let swift = TeamLog.EventDetails.ransomwareAlertCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsRansomwareAlertCreateReportFailedDetails: DBXTeamLogEventDetails { + @objc + public var ransomwareAlertCreateReportFailedDetails: DBXTeamLogRansomwareAlertCreateReportFailedDetails + + @objc + public init(_ arg: DBXTeamLogRansomwareAlertCreateReportFailedDetails) { + self.ransomwareAlertCreateReportFailedDetails = arg + let swift = TeamLog.EventDetails.ransomwareAlertCreateReportFailedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSmartSyncCreateAdminPrivilegeReportDetails: DBXTeamLogEventDetails { + @objc + public var smartSyncCreateAdminPrivilegeReportDetails: DBXTeamLogSmartSyncCreateAdminPrivilegeReportDetails + + @objc + public init(_ arg: DBXTeamLogSmartSyncCreateAdminPrivilegeReportDetails) { + self.smartSyncCreateAdminPrivilegeReportDetails = arg + let swift = TeamLog.EventDetails.smartSyncCreateAdminPrivilegeReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamActivityCreateReportDetails: DBXTeamLogEventDetails { + @objc + public var teamActivityCreateReportDetails: DBXTeamLogTeamActivityCreateReportDetails + + @objc + public init(_ arg: DBXTeamLogTeamActivityCreateReportDetails) { + self.teamActivityCreateReportDetails = arg + let swift = TeamLog.EventDetails.teamActivityCreateReportDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamActivityCreateReportFailDetails: DBXTeamLogEventDetails { + @objc + public var teamActivityCreateReportFailDetails: DBXTeamLogTeamActivityCreateReportFailDetails + + @objc + public init(_ arg: DBXTeamLogTeamActivityCreateReportFailDetails) { + self.teamActivityCreateReportFailDetails = arg + let swift = TeamLog.EventDetails.teamActivityCreateReportFailDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsCollectionShareDetails: DBXTeamLogEventDetails { + @objc + public var collectionShareDetails: DBXTeamLogCollectionShareDetails + + @objc + public init(_ arg: DBXTeamLogCollectionShareDetails) { + self.collectionShareDetails = arg + let swift = TeamLog.EventDetails.collectionShareDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileTransfersFileAddDetails: DBXTeamLogEventDetails { + @objc + public var fileTransfersFileAddDetails: DBXTeamLogFileTransfersFileAddDetails + + @objc + public init(_ arg: DBXTeamLogFileTransfersFileAddDetails) { + self.fileTransfersFileAddDetails = arg + let swift = TeamLog.EventDetails.fileTransfersFileAddDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileTransfersTransferDeleteDetails: DBXTeamLogEventDetails { + @objc + public var fileTransfersTransferDeleteDetails: DBXTeamLogFileTransfersTransferDeleteDetails + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferDeleteDetails) { + self.fileTransfersTransferDeleteDetails = arg + let swift = TeamLog.EventDetails.fileTransfersTransferDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileTransfersTransferDownloadDetails: DBXTeamLogEventDetails { + @objc + public var fileTransfersTransferDownloadDetails: DBXTeamLogFileTransfersTransferDownloadDetails + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferDownloadDetails) { + self.fileTransfersTransferDownloadDetails = arg + let swift = TeamLog.EventDetails.fileTransfersTransferDownloadDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileTransfersTransferSendDetails: DBXTeamLogEventDetails { + @objc + public var fileTransfersTransferSendDetails: DBXTeamLogFileTransfersTransferSendDetails + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferSendDetails) { + self.fileTransfersTransferSendDetails = arg + let swift = TeamLog.EventDetails.fileTransfersTransferSendDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileTransfersTransferViewDetails: DBXTeamLogEventDetails { + @objc + public var fileTransfersTransferViewDetails: DBXTeamLogFileTransfersTransferViewDetails + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferViewDetails) { + self.fileTransfersTransferViewDetails = arg + let swift = TeamLog.EventDetails.fileTransfersTransferViewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoteAclInviteOnlyDetails: DBXTeamLogEventDetails { + @objc + public var noteAclInviteOnlyDetails: DBXTeamLogNoteAclInviteOnlyDetails + + @objc + public init(_ arg: DBXTeamLogNoteAclInviteOnlyDetails) { + self.noteAclInviteOnlyDetails = arg + let swift = TeamLog.EventDetails.noteAclInviteOnlyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoteAclLinkDetails: DBXTeamLogEventDetails { + @objc + public var noteAclLinkDetails: DBXTeamLogNoteAclLinkDetails + + @objc + public init(_ arg: DBXTeamLogNoteAclLinkDetails) { + self.noteAclLinkDetails = arg + let swift = TeamLog.EventDetails.noteAclLinkDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoteAclTeamLinkDetails: DBXTeamLogEventDetails { + @objc + public var noteAclTeamLinkDetails: DBXTeamLogNoteAclTeamLinkDetails + + @objc + public init(_ arg: DBXTeamLogNoteAclTeamLinkDetails) { + self.noteAclTeamLinkDetails = arg + let swift = TeamLog.EventDetails.noteAclTeamLinkDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoteSharedDetails: DBXTeamLogEventDetails { + @objc + public var noteSharedDetails: DBXTeamLogNoteSharedDetails + + @objc + public init(_ arg: DBXTeamLogNoteSharedDetails) { + self.noteSharedDetails = arg + let swift = TeamLog.EventDetails.noteSharedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNoteShareReceiveDetails: DBXTeamLogEventDetails { + @objc + public var noteShareReceiveDetails: DBXTeamLogNoteShareReceiveDetails + + @objc + public init(_ arg: DBXTeamLogNoteShareReceiveDetails) { + self.noteShareReceiveDetails = arg + let swift = TeamLog.EventDetails.noteShareReceiveDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsOpenNoteSharedDetails: DBXTeamLogEventDetails { + @objc + public var openNoteSharedDetails: DBXTeamLogOpenNoteSharedDetails + + @objc + public init(_ arg: DBXTeamLogOpenNoteSharedDetails) { + self.openNoteSharedDetails = arg + let swift = TeamLog.EventDetails.openNoteSharedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsReplayFileSharedLinkCreatedDetails: DBXTeamLogEventDetails { + @objc + public var replayFileSharedLinkCreatedDetails: DBXTeamLogReplayFileSharedLinkCreatedDetails + + @objc + public init(_ arg: DBXTeamLogReplayFileSharedLinkCreatedDetails) { + self.replayFileSharedLinkCreatedDetails = arg + let swift = TeamLog.EventDetails.replayFileSharedLinkCreatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsReplayFileSharedLinkModifiedDetails: DBXTeamLogEventDetails { + @objc + public var replayFileSharedLinkModifiedDetails: DBXTeamLogReplayFileSharedLinkModifiedDetails + + @objc + public init(_ arg: DBXTeamLogReplayFileSharedLinkModifiedDetails) { + self.replayFileSharedLinkModifiedDetails = arg + let swift = TeamLog.EventDetails.replayFileSharedLinkModifiedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsReplayProjectTeamAddDetails: DBXTeamLogEventDetails { + @objc + public var replayProjectTeamAddDetails: DBXTeamLogReplayProjectTeamAddDetails + + @objc + public init(_ arg: DBXTeamLogReplayProjectTeamAddDetails) { + self.replayProjectTeamAddDetails = arg + let swift = TeamLog.EventDetails.replayProjectTeamAddDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsReplayProjectTeamDeleteDetails: DBXTeamLogEventDetails { + @objc + public var replayProjectTeamDeleteDetails: DBXTeamLogReplayProjectTeamDeleteDetails + + @objc + public init(_ arg: DBXTeamLogReplayProjectTeamDeleteDetails) { + self.replayProjectTeamDeleteDetails = arg + let swift = TeamLog.EventDetails.replayProjectTeamDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfAddGroupDetails: DBXTeamLogEventDetails { + @objc + public var sfAddGroupDetails: DBXTeamLogSfAddGroupDetails + + @objc + public init(_ arg: DBXTeamLogSfAddGroupDetails) { + self.sfAddGroupDetails = arg + let swift = TeamLog.EventDetails.sfAddGroupDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfAllowNonMembersToViewSharedLinksDetails: DBXTeamLogEventDetails { + @objc + public var sfAllowNonMembersToViewSharedLinksDetails: DBXTeamLogSfAllowNonMembersToViewSharedLinksDetails + + @objc + public init(_ arg: DBXTeamLogSfAllowNonMembersToViewSharedLinksDetails) { + self.sfAllowNonMembersToViewSharedLinksDetails = arg + let swift = TeamLog.EventDetails.sfAllowNonMembersToViewSharedLinksDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfExternalInviteWarnDetails: DBXTeamLogEventDetails { + @objc + public var sfExternalInviteWarnDetails: DBXTeamLogSfExternalInviteWarnDetails + + @objc + public init(_ arg: DBXTeamLogSfExternalInviteWarnDetails) { + self.sfExternalInviteWarnDetails = arg + let swift = TeamLog.EventDetails.sfExternalInviteWarnDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfFbInviteDetails: DBXTeamLogEventDetails { + @objc + public var sfFbInviteDetails: DBXTeamLogSfFbInviteDetails + + @objc + public init(_ arg: DBXTeamLogSfFbInviteDetails) { + self.sfFbInviteDetails = arg + let swift = TeamLog.EventDetails.sfFbInviteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfFbInviteChangeRoleDetails: DBXTeamLogEventDetails { + @objc + public var sfFbInviteChangeRoleDetails: DBXTeamLogSfFbInviteChangeRoleDetails + + @objc + public init(_ arg: DBXTeamLogSfFbInviteChangeRoleDetails) { + self.sfFbInviteChangeRoleDetails = arg + let swift = TeamLog.EventDetails.sfFbInviteChangeRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfFbUninviteDetails: DBXTeamLogEventDetails { + @objc + public var sfFbUninviteDetails: DBXTeamLogSfFbUninviteDetails + + @objc + public init(_ arg: DBXTeamLogSfFbUninviteDetails) { + self.sfFbUninviteDetails = arg + let swift = TeamLog.EventDetails.sfFbUninviteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfInviteGroupDetails: DBXTeamLogEventDetails { + @objc + public var sfInviteGroupDetails: DBXTeamLogSfInviteGroupDetails + + @objc + public init(_ arg: DBXTeamLogSfInviteGroupDetails) { + self.sfInviteGroupDetails = arg + let swift = TeamLog.EventDetails.sfInviteGroupDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfTeamGrantAccessDetails: DBXTeamLogEventDetails { + @objc + public var sfTeamGrantAccessDetails: DBXTeamLogSfTeamGrantAccessDetails + + @objc + public init(_ arg: DBXTeamLogSfTeamGrantAccessDetails) { + self.sfTeamGrantAccessDetails = arg + let swift = TeamLog.EventDetails.sfTeamGrantAccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfTeamInviteDetails: DBXTeamLogEventDetails { + @objc + public var sfTeamInviteDetails: DBXTeamLogSfTeamInviteDetails + + @objc + public init(_ arg: DBXTeamLogSfTeamInviteDetails) { + self.sfTeamInviteDetails = arg + let swift = TeamLog.EventDetails.sfTeamInviteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfTeamInviteChangeRoleDetails: DBXTeamLogEventDetails { + @objc + public var sfTeamInviteChangeRoleDetails: DBXTeamLogSfTeamInviteChangeRoleDetails + + @objc + public init(_ arg: DBXTeamLogSfTeamInviteChangeRoleDetails) { + self.sfTeamInviteChangeRoleDetails = arg + let swift = TeamLog.EventDetails.sfTeamInviteChangeRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfTeamJoinDetails: DBXTeamLogEventDetails { + @objc + public var sfTeamJoinDetails: DBXTeamLogSfTeamJoinDetails + + @objc + public init(_ arg: DBXTeamLogSfTeamJoinDetails) { + self.sfTeamJoinDetails = arg + let swift = TeamLog.EventDetails.sfTeamJoinDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfTeamJoinFromOobLinkDetails: DBXTeamLogEventDetails { + @objc + public var sfTeamJoinFromOobLinkDetails: DBXTeamLogSfTeamJoinFromOobLinkDetails + + @objc + public init(_ arg: DBXTeamLogSfTeamJoinFromOobLinkDetails) { + self.sfTeamJoinFromOobLinkDetails = arg + let swift = TeamLog.EventDetails.sfTeamJoinFromOobLinkDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSfTeamUninviteDetails: DBXTeamLogEventDetails { + @objc + public var sfTeamUninviteDetails: DBXTeamLogSfTeamUninviteDetails + + @objc + public init(_ arg: DBXTeamLogSfTeamUninviteDetails) { + self.sfTeamUninviteDetails = arg + let swift = TeamLog.EventDetails.sfTeamUninviteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentAddInviteesDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentAddInviteesDetails: DBXTeamLogSharedContentAddInviteesDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentAddInviteesDetails) { + self.sharedContentAddInviteesDetails = arg + let swift = TeamLog.EventDetails.sharedContentAddInviteesDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentAddLinkExpiryDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentAddLinkExpiryDetails: DBXTeamLogSharedContentAddLinkExpiryDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentAddLinkExpiryDetails) { + self.sharedContentAddLinkExpiryDetails = arg + let swift = TeamLog.EventDetails.sharedContentAddLinkExpiryDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentAddLinkPasswordDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentAddLinkPasswordDetails: DBXTeamLogSharedContentAddLinkPasswordDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentAddLinkPasswordDetails) { + self.sharedContentAddLinkPasswordDetails = arg + let swift = TeamLog.EventDetails.sharedContentAddLinkPasswordDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentAddMemberDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentAddMemberDetails: DBXTeamLogSharedContentAddMemberDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentAddMemberDetails) { + self.sharedContentAddMemberDetails = arg + let swift = TeamLog.EventDetails.sharedContentAddMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentChangeDownloadsPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentChangeDownloadsPolicyDetails: DBXTeamLogSharedContentChangeDownloadsPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeDownloadsPolicyDetails) { + self.sharedContentChangeDownloadsPolicyDetails = arg + let swift = TeamLog.EventDetails.sharedContentChangeDownloadsPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentChangeInviteeRoleDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentChangeInviteeRoleDetails: DBXTeamLogSharedContentChangeInviteeRoleDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeInviteeRoleDetails) { + self.sharedContentChangeInviteeRoleDetails = arg + let swift = TeamLog.EventDetails.sharedContentChangeInviteeRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentChangeLinkAudienceDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentChangeLinkAudienceDetails: DBXTeamLogSharedContentChangeLinkAudienceDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeLinkAudienceDetails) { + self.sharedContentChangeLinkAudienceDetails = arg + let swift = TeamLog.EventDetails.sharedContentChangeLinkAudienceDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentChangeLinkExpiryDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentChangeLinkExpiryDetails: DBXTeamLogSharedContentChangeLinkExpiryDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeLinkExpiryDetails) { + self.sharedContentChangeLinkExpiryDetails = arg + let swift = TeamLog.EventDetails.sharedContentChangeLinkExpiryDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentChangeLinkPasswordDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentChangeLinkPasswordDetails: DBXTeamLogSharedContentChangeLinkPasswordDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeLinkPasswordDetails) { + self.sharedContentChangeLinkPasswordDetails = arg + let swift = TeamLog.EventDetails.sharedContentChangeLinkPasswordDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentChangeMemberRoleDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentChangeMemberRoleDetails: DBXTeamLogSharedContentChangeMemberRoleDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeMemberRoleDetails) { + self.sharedContentChangeMemberRoleDetails = arg + let swift = TeamLog.EventDetails.sharedContentChangeMemberRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentChangeViewerInfoPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentChangeViewerInfoPolicyDetails: DBXTeamLogSharedContentChangeViewerInfoPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeViewerInfoPolicyDetails) { + self.sharedContentChangeViewerInfoPolicyDetails = arg + let swift = TeamLog.EventDetails.sharedContentChangeViewerInfoPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentClaimInvitationDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentClaimInvitationDetails: DBXTeamLogSharedContentClaimInvitationDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentClaimInvitationDetails) { + self.sharedContentClaimInvitationDetails = arg + let swift = TeamLog.EventDetails.sharedContentClaimInvitationDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentCopyDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentCopyDetails: DBXTeamLogSharedContentCopyDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentCopyDetails) { + self.sharedContentCopyDetails = arg + let swift = TeamLog.EventDetails.sharedContentCopyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentDownloadDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentDownloadDetails: DBXTeamLogSharedContentDownloadDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentDownloadDetails) { + self.sharedContentDownloadDetails = arg + let swift = TeamLog.EventDetails.sharedContentDownloadDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRelinquishMembershipDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRelinquishMembershipDetails: DBXTeamLogSharedContentRelinquishMembershipDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRelinquishMembershipDetails) { + self.sharedContentRelinquishMembershipDetails = arg + let swift = TeamLog.EventDetails.sharedContentRelinquishMembershipDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRemoveInviteesDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRemoveInviteesDetails: DBXTeamLogSharedContentRemoveInviteesDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveInviteesDetails) { + self.sharedContentRemoveInviteesDetails = arg + let swift = TeamLog.EventDetails.sharedContentRemoveInviteesDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRemoveLinkExpiryDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRemoveLinkExpiryDetails: DBXTeamLogSharedContentRemoveLinkExpiryDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveLinkExpiryDetails) { + self.sharedContentRemoveLinkExpiryDetails = arg + let swift = TeamLog.EventDetails.sharedContentRemoveLinkExpiryDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRemoveLinkPasswordDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRemoveLinkPasswordDetails: DBXTeamLogSharedContentRemoveLinkPasswordDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveLinkPasswordDetails) { + self.sharedContentRemoveLinkPasswordDetails = arg + let swift = TeamLog.EventDetails.sharedContentRemoveLinkPasswordDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRemoveMemberDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRemoveMemberDetails: DBXTeamLogSharedContentRemoveMemberDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveMemberDetails) { + self.sharedContentRemoveMemberDetails = arg + let swift = TeamLog.EventDetails.sharedContentRemoveMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRequestAccessDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRequestAccessDetails: DBXTeamLogSharedContentRequestAccessDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRequestAccessDetails) { + self.sharedContentRequestAccessDetails = arg + let swift = TeamLog.EventDetails.sharedContentRequestAccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRestoreInviteesDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRestoreInviteesDetails: DBXTeamLogSharedContentRestoreInviteesDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRestoreInviteesDetails) { + self.sharedContentRestoreInviteesDetails = arg + let swift = TeamLog.EventDetails.sharedContentRestoreInviteesDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentRestoreMemberDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentRestoreMemberDetails: DBXTeamLogSharedContentRestoreMemberDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentRestoreMemberDetails) { + self.sharedContentRestoreMemberDetails = arg + let swift = TeamLog.EventDetails.sharedContentRestoreMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentUnshareDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentUnshareDetails: DBXTeamLogSharedContentUnshareDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentUnshareDetails) { + self.sharedContentUnshareDetails = arg + let swift = TeamLog.EventDetails.sharedContentUnshareDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedContentViewDetails: DBXTeamLogEventDetails { + @objc + public var sharedContentViewDetails: DBXTeamLogSharedContentViewDetails + + @objc + public init(_ arg: DBXTeamLogSharedContentViewDetails) { + self.sharedContentViewDetails = arg + let swift = TeamLog.EventDetails.sharedContentViewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderChangeLinkPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderChangeLinkPolicyDetails: DBXTeamLogSharedFolderChangeLinkPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeLinkPolicyDetails) { + self.sharedFolderChangeLinkPolicyDetails = arg + let swift = TeamLog.EventDetails.sharedFolderChangeLinkPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderChangeMembersInheritancePolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderChangeMembersInheritancePolicyDetails: DBXTeamLogSharedFolderChangeMembersInheritancePolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeMembersInheritancePolicyDetails) { + self.sharedFolderChangeMembersInheritancePolicyDetails = arg + let swift = TeamLog.EventDetails.sharedFolderChangeMembersInheritancePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderChangeMembersManagementPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderChangeMembersManagementPolicyDetails: DBXTeamLogSharedFolderChangeMembersManagementPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeMembersManagementPolicyDetails) { + self.sharedFolderChangeMembersManagementPolicyDetails = arg + let swift = TeamLog.EventDetails.sharedFolderChangeMembersManagementPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderChangeMembersPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderChangeMembersPolicyDetails: DBXTeamLogSharedFolderChangeMembersPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeMembersPolicyDetails) { + self.sharedFolderChangeMembersPolicyDetails = arg + let swift = TeamLog.EventDetails.sharedFolderChangeMembersPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderCreateDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderCreateDetails: DBXTeamLogSharedFolderCreateDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderCreateDetails) { + self.sharedFolderCreateDetails = arg + let swift = TeamLog.EventDetails.sharedFolderCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderDeclineInvitationDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderDeclineInvitationDetails: DBXTeamLogSharedFolderDeclineInvitationDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderDeclineInvitationDetails) { + self.sharedFolderDeclineInvitationDetails = arg + let swift = TeamLog.EventDetails.sharedFolderDeclineInvitationDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderMountDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderMountDetails: DBXTeamLogSharedFolderMountDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderMountDetails) { + self.sharedFolderMountDetails = arg + let swift = TeamLog.EventDetails.sharedFolderMountDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderNestDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderNestDetails: DBXTeamLogSharedFolderNestDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderNestDetails) { + self.sharedFolderNestDetails = arg + let swift = TeamLog.EventDetails.sharedFolderNestDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderTransferOwnershipDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderTransferOwnershipDetails: DBXTeamLogSharedFolderTransferOwnershipDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderTransferOwnershipDetails) { + self.sharedFolderTransferOwnershipDetails = arg + let swift = TeamLog.EventDetails.sharedFolderTransferOwnershipDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedFolderUnmountDetails: DBXTeamLogEventDetails { + @objc + public var sharedFolderUnmountDetails: DBXTeamLogSharedFolderUnmountDetails + + @objc + public init(_ arg: DBXTeamLogSharedFolderUnmountDetails) { + self.sharedFolderUnmountDetails = arg + let swift = TeamLog.EventDetails.sharedFolderUnmountDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkAddExpiryDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkAddExpiryDetails: DBXTeamLogSharedLinkAddExpiryDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkAddExpiryDetails) { + self.sharedLinkAddExpiryDetails = arg + let swift = TeamLog.EventDetails.sharedLinkAddExpiryDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkChangeExpiryDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkChangeExpiryDetails: DBXTeamLogSharedLinkChangeExpiryDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkChangeExpiryDetails) { + self.sharedLinkChangeExpiryDetails = arg + let swift = TeamLog.EventDetails.sharedLinkChangeExpiryDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkChangeVisibilityDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkChangeVisibilityDetails: DBXTeamLogSharedLinkChangeVisibilityDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkChangeVisibilityDetails) { + self.sharedLinkChangeVisibilityDetails = arg + let swift = TeamLog.EventDetails.sharedLinkChangeVisibilityDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkCopyDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkCopyDetails: DBXTeamLogSharedLinkCopyDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkCopyDetails) { + self.sharedLinkCopyDetails = arg + let swift = TeamLog.EventDetails.sharedLinkCopyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkCreateDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkCreateDetails: DBXTeamLogSharedLinkCreateDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkCreateDetails) { + self.sharedLinkCreateDetails = arg + let swift = TeamLog.EventDetails.sharedLinkCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkDisableDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkDisableDetails: DBXTeamLogSharedLinkDisableDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkDisableDetails) { + self.sharedLinkDisableDetails = arg + let swift = TeamLog.EventDetails.sharedLinkDisableDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkDownloadDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkDownloadDetails: DBXTeamLogSharedLinkDownloadDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkDownloadDetails) { + self.sharedLinkDownloadDetails = arg + let swift = TeamLog.EventDetails.sharedLinkDownloadDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkRemoveExpiryDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkRemoveExpiryDetails: DBXTeamLogSharedLinkRemoveExpiryDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkRemoveExpiryDetails) { + self.sharedLinkRemoveExpiryDetails = arg + let swift = TeamLog.EventDetails.sharedLinkRemoveExpiryDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsAddExpirationDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsAddExpirationDetails: DBXTeamLogSharedLinkSettingsAddExpirationDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAddExpirationDetails) { + self.sharedLinkSettingsAddExpirationDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsAddExpirationDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsAddPasswordDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsAddPasswordDetails: DBXTeamLogSharedLinkSettingsAddPasswordDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAddPasswordDetails) { + self.sharedLinkSettingsAddPasswordDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsAddPasswordDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadDisabledDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsAllowDownloadDisabledDetails: DBXTeamLogSharedLinkSettingsAllowDownloadDisabledDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAllowDownloadDisabledDetails) { + self.sharedLinkSettingsAllowDownloadDisabledDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsAllowDownloadDisabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsAllowDownloadEnabledDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsAllowDownloadEnabledDetails: DBXTeamLogSharedLinkSettingsAllowDownloadEnabledDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAllowDownloadEnabledDetails) { + self.sharedLinkSettingsAllowDownloadEnabledDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsAllowDownloadEnabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsChangeAudienceDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsChangeAudienceDetails: DBXTeamLogSharedLinkSettingsChangeAudienceDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsChangeAudienceDetails) { + self.sharedLinkSettingsChangeAudienceDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsChangeAudienceDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsChangeExpirationDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsChangeExpirationDetails: DBXTeamLogSharedLinkSettingsChangeExpirationDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsChangeExpirationDetails) { + self.sharedLinkSettingsChangeExpirationDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsChangeExpirationDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsChangePasswordDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsChangePasswordDetails: DBXTeamLogSharedLinkSettingsChangePasswordDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsChangePasswordDetails) { + self.sharedLinkSettingsChangePasswordDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsChangePasswordDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsRemoveExpirationDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsRemoveExpirationDetails: DBXTeamLogSharedLinkSettingsRemoveExpirationDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsRemoveExpirationDetails) { + self.sharedLinkSettingsRemoveExpirationDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsRemoveExpirationDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkSettingsRemovePasswordDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkSettingsRemovePasswordDetails: DBXTeamLogSharedLinkSettingsRemovePasswordDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsRemovePasswordDetails) { + self.sharedLinkSettingsRemovePasswordDetails = arg + let swift = TeamLog.EventDetails.sharedLinkSettingsRemovePasswordDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkShareDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkShareDetails: DBXTeamLogSharedLinkShareDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkShareDetails) { + self.sharedLinkShareDetails = arg + let swift = TeamLog.EventDetails.sharedLinkShareDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedLinkViewDetails: DBXTeamLogEventDetails { + @objc + public var sharedLinkViewDetails: DBXTeamLogSharedLinkViewDetails + + @objc + public init(_ arg: DBXTeamLogSharedLinkViewDetails) { + self.sharedLinkViewDetails = arg + let swift = TeamLog.EventDetails.sharedLinkViewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharedNoteOpenedDetails: DBXTeamLogEventDetails { + @objc + public var sharedNoteOpenedDetails: DBXTeamLogSharedNoteOpenedDetails + + @objc + public init(_ arg: DBXTeamLogSharedNoteOpenedDetails) { + self.sharedNoteOpenedDetails = arg + let swift = TeamLog.EventDetails.sharedNoteOpenedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShmodelDisableDownloadsDetails: DBXTeamLogEventDetails { + @objc + public var shmodelDisableDownloadsDetails: DBXTeamLogShmodelDisableDownloadsDetails + + @objc + public init(_ arg: DBXTeamLogShmodelDisableDownloadsDetails) { + self.shmodelDisableDownloadsDetails = arg + let swift = TeamLog.EventDetails.shmodelDisableDownloadsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShmodelEnableDownloadsDetails: DBXTeamLogEventDetails { + @objc + public var shmodelEnableDownloadsDetails: DBXTeamLogShmodelEnableDownloadsDetails + + @objc + public init(_ arg: DBXTeamLogShmodelEnableDownloadsDetails) { + self.shmodelEnableDownloadsDetails = arg + let swift = TeamLog.EventDetails.shmodelEnableDownloadsDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShmodelGroupShareDetails: DBXTeamLogEventDetails { + @objc + public var shmodelGroupShareDetails: DBXTeamLogShmodelGroupShareDetails + + @objc + public init(_ arg: DBXTeamLogShmodelGroupShareDetails) { + self.shmodelGroupShareDetails = arg + let swift = TeamLog.EventDetails.shmodelGroupShareDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseAccessGrantedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseAccessGrantedDetails: DBXTeamLogShowcaseAccessGrantedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseAccessGrantedDetails) { + self.showcaseAccessGrantedDetails = arg + let swift = TeamLog.EventDetails.showcaseAccessGrantedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseAddMemberDetails: DBXTeamLogEventDetails { + @objc + public var showcaseAddMemberDetails: DBXTeamLogShowcaseAddMemberDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseAddMemberDetails) { + self.showcaseAddMemberDetails = arg + let swift = TeamLog.EventDetails.showcaseAddMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseArchivedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseArchivedDetails: DBXTeamLogShowcaseArchivedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseArchivedDetails) { + self.showcaseArchivedDetails = arg + let swift = TeamLog.EventDetails.showcaseArchivedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseCreatedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseCreatedDetails: DBXTeamLogShowcaseCreatedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseCreatedDetails) { + self.showcaseCreatedDetails = arg + let swift = TeamLog.EventDetails.showcaseCreatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseDeleteCommentDetails: DBXTeamLogEventDetails { + @objc + public var showcaseDeleteCommentDetails: DBXTeamLogShowcaseDeleteCommentDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseDeleteCommentDetails) { + self.showcaseDeleteCommentDetails = arg + let swift = TeamLog.EventDetails.showcaseDeleteCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseEditedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseEditedDetails: DBXTeamLogShowcaseEditedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseEditedDetails) { + self.showcaseEditedDetails = arg + let swift = TeamLog.EventDetails.showcaseEditedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseEditCommentDetails: DBXTeamLogEventDetails { + @objc + public var showcaseEditCommentDetails: DBXTeamLogShowcaseEditCommentDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseEditCommentDetails) { + self.showcaseEditCommentDetails = arg + let swift = TeamLog.EventDetails.showcaseEditCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseFileAddedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseFileAddedDetails: DBXTeamLogShowcaseFileAddedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseFileAddedDetails) { + self.showcaseFileAddedDetails = arg + let swift = TeamLog.EventDetails.showcaseFileAddedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseFileDownloadDetails: DBXTeamLogEventDetails { + @objc + public var showcaseFileDownloadDetails: DBXTeamLogShowcaseFileDownloadDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseFileDownloadDetails) { + self.showcaseFileDownloadDetails = arg + let swift = TeamLog.EventDetails.showcaseFileDownloadDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseFileRemovedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseFileRemovedDetails: DBXTeamLogShowcaseFileRemovedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseFileRemovedDetails) { + self.showcaseFileRemovedDetails = arg + let swift = TeamLog.EventDetails.showcaseFileRemovedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseFileViewDetails: DBXTeamLogEventDetails { + @objc + public var showcaseFileViewDetails: DBXTeamLogShowcaseFileViewDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseFileViewDetails) { + self.showcaseFileViewDetails = arg + let swift = TeamLog.EventDetails.showcaseFileViewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcasePermanentlyDeletedDetails: DBXTeamLogEventDetails { + @objc + public var showcasePermanentlyDeletedDetails: DBXTeamLogShowcasePermanentlyDeletedDetails + + @objc + public init(_ arg: DBXTeamLogShowcasePermanentlyDeletedDetails) { + self.showcasePermanentlyDeletedDetails = arg + let swift = TeamLog.EventDetails.showcasePermanentlyDeletedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcasePostCommentDetails: DBXTeamLogEventDetails { + @objc + public var showcasePostCommentDetails: DBXTeamLogShowcasePostCommentDetails + + @objc + public init(_ arg: DBXTeamLogShowcasePostCommentDetails) { + self.showcasePostCommentDetails = arg + let swift = TeamLog.EventDetails.showcasePostCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseRemoveMemberDetails: DBXTeamLogEventDetails { + @objc + public var showcaseRemoveMemberDetails: DBXTeamLogShowcaseRemoveMemberDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseRemoveMemberDetails) { + self.showcaseRemoveMemberDetails = arg + let swift = TeamLog.EventDetails.showcaseRemoveMemberDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseRenamedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseRenamedDetails: DBXTeamLogShowcaseRenamedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseRenamedDetails) { + self.showcaseRenamedDetails = arg + let swift = TeamLog.EventDetails.showcaseRenamedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseRequestAccessDetails: DBXTeamLogEventDetails { + @objc + public var showcaseRequestAccessDetails: DBXTeamLogShowcaseRequestAccessDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseRequestAccessDetails) { + self.showcaseRequestAccessDetails = arg + let swift = TeamLog.EventDetails.showcaseRequestAccessDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseResolveCommentDetails: DBXTeamLogEventDetails { + @objc + public var showcaseResolveCommentDetails: DBXTeamLogShowcaseResolveCommentDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseResolveCommentDetails) { + self.showcaseResolveCommentDetails = arg + let swift = TeamLog.EventDetails.showcaseResolveCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseRestoredDetails: DBXTeamLogEventDetails { + @objc + public var showcaseRestoredDetails: DBXTeamLogShowcaseRestoredDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseRestoredDetails) { + self.showcaseRestoredDetails = arg + let swift = TeamLog.EventDetails.showcaseRestoredDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseTrashedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseTrashedDetails: DBXTeamLogShowcaseTrashedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseTrashedDetails) { + self.showcaseTrashedDetails = arg + let swift = TeamLog.EventDetails.showcaseTrashedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseTrashedDeprecatedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseTrashedDeprecatedDetails: DBXTeamLogShowcaseTrashedDeprecatedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseTrashedDeprecatedDetails) { + self.showcaseTrashedDeprecatedDetails = arg + let swift = TeamLog.EventDetails.showcaseTrashedDeprecatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseUnresolveCommentDetails: DBXTeamLogEventDetails { + @objc + public var showcaseUnresolveCommentDetails: DBXTeamLogShowcaseUnresolveCommentDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseUnresolveCommentDetails) { + self.showcaseUnresolveCommentDetails = arg + let swift = TeamLog.EventDetails.showcaseUnresolveCommentDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseUntrashedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseUntrashedDetails: DBXTeamLogShowcaseUntrashedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseUntrashedDetails) { + self.showcaseUntrashedDetails = arg + let swift = TeamLog.EventDetails.showcaseUntrashedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseUntrashedDeprecatedDetails: DBXTeamLogEventDetails { + @objc + public var showcaseUntrashedDeprecatedDetails: DBXTeamLogShowcaseUntrashedDeprecatedDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseUntrashedDeprecatedDetails) { + self.showcaseUntrashedDeprecatedDetails = arg + let swift = TeamLog.EventDetails.showcaseUntrashedDeprecatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseViewDetails: DBXTeamLogEventDetails { + @objc + public var showcaseViewDetails: DBXTeamLogShowcaseViewDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseViewDetails) { + self.showcaseViewDetails = arg + let swift = TeamLog.EventDetails.showcaseViewDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoAddCertDetails: DBXTeamLogEventDetails { + @objc + public var ssoAddCertDetails: DBXTeamLogSsoAddCertDetails + + @objc + public init(_ arg: DBXTeamLogSsoAddCertDetails) { + self.ssoAddCertDetails = arg + let swift = TeamLog.EventDetails.ssoAddCertDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoAddLoginUrlDetails: DBXTeamLogEventDetails { + @objc + public var ssoAddLoginUrlDetails: DBXTeamLogSsoAddLoginUrlDetails + + @objc + public init(_ arg: DBXTeamLogSsoAddLoginUrlDetails) { + self.ssoAddLoginUrlDetails = arg + let swift = TeamLog.EventDetails.ssoAddLoginUrlDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoAddLogoutUrlDetails: DBXTeamLogEventDetails { + @objc + public var ssoAddLogoutUrlDetails: DBXTeamLogSsoAddLogoutUrlDetails + + @objc + public init(_ arg: DBXTeamLogSsoAddLogoutUrlDetails) { + self.ssoAddLogoutUrlDetails = arg + let swift = TeamLog.EventDetails.ssoAddLogoutUrlDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoChangeCertDetails: DBXTeamLogEventDetails { + @objc + public var ssoChangeCertDetails: DBXTeamLogSsoChangeCertDetails + + @objc + public init(_ arg: DBXTeamLogSsoChangeCertDetails) { + self.ssoChangeCertDetails = arg + let swift = TeamLog.EventDetails.ssoChangeCertDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoChangeLoginUrlDetails: DBXTeamLogEventDetails { + @objc + public var ssoChangeLoginUrlDetails: DBXTeamLogSsoChangeLoginUrlDetails + + @objc + public init(_ arg: DBXTeamLogSsoChangeLoginUrlDetails) { + self.ssoChangeLoginUrlDetails = arg + let swift = TeamLog.EventDetails.ssoChangeLoginUrlDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoChangeLogoutUrlDetails: DBXTeamLogEventDetails { + @objc + public var ssoChangeLogoutUrlDetails: DBXTeamLogSsoChangeLogoutUrlDetails + + @objc + public init(_ arg: DBXTeamLogSsoChangeLogoutUrlDetails) { + self.ssoChangeLogoutUrlDetails = arg + let swift = TeamLog.EventDetails.ssoChangeLogoutUrlDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoChangeSamlIdentityModeDetails: DBXTeamLogEventDetails { + @objc + public var ssoChangeSamlIdentityModeDetails: DBXTeamLogSsoChangeSamlIdentityModeDetails + + @objc + public init(_ arg: DBXTeamLogSsoChangeSamlIdentityModeDetails) { + self.ssoChangeSamlIdentityModeDetails = arg + let swift = TeamLog.EventDetails.ssoChangeSamlIdentityModeDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoRemoveCertDetails: DBXTeamLogEventDetails { + @objc + public var ssoRemoveCertDetails: DBXTeamLogSsoRemoveCertDetails + + @objc + public init(_ arg: DBXTeamLogSsoRemoveCertDetails) { + self.ssoRemoveCertDetails = arg + let swift = TeamLog.EventDetails.ssoRemoveCertDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoRemoveLoginUrlDetails: DBXTeamLogEventDetails { + @objc + public var ssoRemoveLoginUrlDetails: DBXTeamLogSsoRemoveLoginUrlDetails + + @objc + public init(_ arg: DBXTeamLogSsoRemoveLoginUrlDetails) { + self.ssoRemoveLoginUrlDetails = arg + let swift = TeamLog.EventDetails.ssoRemoveLoginUrlDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoRemoveLogoutUrlDetails: DBXTeamLogEventDetails { + @objc + public var ssoRemoveLogoutUrlDetails: DBXTeamLogSsoRemoveLogoutUrlDetails + + @objc + public init(_ arg: DBXTeamLogSsoRemoveLogoutUrlDetails) { + self.ssoRemoveLogoutUrlDetails = arg + let swift = TeamLog.EventDetails.ssoRemoveLogoutUrlDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamFolderChangeStatusDetails: DBXTeamLogEventDetails { + @objc + public var teamFolderChangeStatusDetails: DBXTeamLogTeamFolderChangeStatusDetails + + @objc + public init(_ arg: DBXTeamLogTeamFolderChangeStatusDetails) { + self.teamFolderChangeStatusDetails = arg + let swift = TeamLog.EventDetails.teamFolderChangeStatusDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamFolderCreateDetails: DBXTeamLogEventDetails { + @objc + public var teamFolderCreateDetails: DBXTeamLogTeamFolderCreateDetails + + @objc + public init(_ arg: DBXTeamLogTeamFolderCreateDetails) { + self.teamFolderCreateDetails = arg + let swift = TeamLog.EventDetails.teamFolderCreateDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamFolderDowngradeDetails: DBXTeamLogEventDetails { + @objc + public var teamFolderDowngradeDetails: DBXTeamLogTeamFolderDowngradeDetails + + @objc + public init(_ arg: DBXTeamLogTeamFolderDowngradeDetails) { + self.teamFolderDowngradeDetails = arg + let swift = TeamLog.EventDetails.teamFolderDowngradeDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamFolderPermanentlyDeleteDetails: DBXTeamLogEventDetails { + @objc + public var teamFolderPermanentlyDeleteDetails: DBXTeamLogTeamFolderPermanentlyDeleteDetails + + @objc + public init(_ arg: DBXTeamLogTeamFolderPermanentlyDeleteDetails) { + self.teamFolderPermanentlyDeleteDetails = arg + let swift = TeamLog.EventDetails.teamFolderPermanentlyDeleteDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamFolderRenameDetails: DBXTeamLogEventDetails { + @objc + public var teamFolderRenameDetails: DBXTeamLogTeamFolderRenameDetails + + @objc + public init(_ arg: DBXTeamLogTeamFolderRenameDetails) { + self.teamFolderRenameDetails = arg + let swift = TeamLog.EventDetails.teamFolderRenameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamSelectiveSyncSettingsChangedDetails: DBXTeamLogEventDetails { + @objc + public var teamSelectiveSyncSettingsChangedDetails: DBXTeamLogTeamSelectiveSyncSettingsChangedDetails + + @objc + public init(_ arg: DBXTeamLogTeamSelectiveSyncSettingsChangedDetails) { + self.teamSelectiveSyncSettingsChangedDetails = arg + let swift = TeamLog.EventDetails.teamSelectiveSyncSettingsChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAccountCaptureChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var accountCaptureChangePolicyDetails: DBXTeamLogAccountCaptureChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogAccountCaptureChangePolicyDetails) { + self.accountCaptureChangePolicyDetails = arg + let swift = TeamLog.EventDetails.accountCaptureChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAdminEmailRemindersChangedDetails: DBXTeamLogEventDetails { + @objc + public var adminEmailRemindersChangedDetails: DBXTeamLogAdminEmailRemindersChangedDetails + + @objc + public init(_ arg: DBXTeamLogAdminEmailRemindersChangedDetails) { + self.adminEmailRemindersChangedDetails = arg + let swift = TeamLog.EventDetails.adminEmailRemindersChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAllowDownloadDisabledDetails: DBXTeamLogEventDetails { + @objc + public var allowDownloadDisabledDetails: DBXTeamLogAllowDownloadDisabledDetails + + @objc + public init(_ arg: DBXTeamLogAllowDownloadDisabledDetails) { + self.allowDownloadDisabledDetails = arg + let swift = TeamLog.EventDetails.allowDownloadDisabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAllowDownloadEnabledDetails: DBXTeamLogEventDetails { + @objc + public var allowDownloadEnabledDetails: DBXTeamLogAllowDownloadEnabledDetails + + @objc + public init(_ arg: DBXTeamLogAllowDownloadEnabledDetails) { + self.allowDownloadEnabledDetails = arg + let swift = TeamLog.EventDetails.allowDownloadEnabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsAppPermissionsChangedDetails: DBXTeamLogEventDetails { + @objc + public var appPermissionsChangedDetails: DBXTeamLogAppPermissionsChangedDetails + + @objc + public init(_ arg: DBXTeamLogAppPermissionsChangedDetails) { + self.appPermissionsChangedDetails = arg + let swift = TeamLog.EventDetails.appPermissionsChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsCameraUploadsPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var cameraUploadsPolicyChangedDetails: DBXTeamLogCameraUploadsPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogCameraUploadsPolicyChangedDetails) { + self.cameraUploadsPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.cameraUploadsPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsCaptureTranscriptPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var captureTranscriptPolicyChangedDetails: DBXTeamLogCaptureTranscriptPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogCaptureTranscriptPolicyChangedDetails) { + self.captureTranscriptPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.captureTranscriptPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsClassificationChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var classificationChangePolicyDetails: DBXTeamLogClassificationChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogClassificationChangePolicyDetails) { + self.classificationChangePolicyDetails = arg + let swift = TeamLog.EventDetails.classificationChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsComputerBackupPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var computerBackupPolicyChangedDetails: DBXTeamLogComputerBackupPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogComputerBackupPolicyChangedDetails) { + self.computerBackupPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.computerBackupPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsContentAdministrationPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var contentAdministrationPolicyChangedDetails: DBXTeamLogContentAdministrationPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogContentAdministrationPolicyChangedDetails) { + self.contentAdministrationPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.contentAdministrationPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDataPlacementRestrictionChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var dataPlacementRestrictionChangePolicyDetails: DBXTeamLogDataPlacementRestrictionChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogDataPlacementRestrictionChangePolicyDetails) { + self.dataPlacementRestrictionChangePolicyDetails = arg + let swift = TeamLog.EventDetails.dataPlacementRestrictionChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDataPlacementRestrictionSatisfyPolicyDetails: DBXTeamLogEventDetails { + @objc + public var dataPlacementRestrictionSatisfyPolicyDetails: DBXTeamLogDataPlacementRestrictionSatisfyPolicyDetails + + @objc + public init(_ arg: DBXTeamLogDataPlacementRestrictionSatisfyPolicyDetails) { + self.dataPlacementRestrictionSatisfyPolicyDetails = arg + let swift = TeamLog.EventDetails.dataPlacementRestrictionSatisfyPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceApprovalsAddExceptionDetails: DBXTeamLogEventDetails { + @objc + public var deviceApprovalsAddExceptionDetails: DBXTeamLogDeviceApprovalsAddExceptionDetails + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsAddExceptionDetails) { + self.deviceApprovalsAddExceptionDetails = arg + let swift = TeamLog.EventDetails.deviceApprovalsAddExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceApprovalsChangeDesktopPolicyDetails: DBXTeamLogEventDetails { + @objc + public var deviceApprovalsChangeDesktopPolicyDetails: DBXTeamLogDeviceApprovalsChangeDesktopPolicyDetails + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeDesktopPolicyDetails) { + self.deviceApprovalsChangeDesktopPolicyDetails = arg + let swift = TeamLog.EventDetails.deviceApprovalsChangeDesktopPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceApprovalsChangeMobilePolicyDetails: DBXTeamLogEventDetails { + @objc + public var deviceApprovalsChangeMobilePolicyDetails: DBXTeamLogDeviceApprovalsChangeMobilePolicyDetails + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeMobilePolicyDetails) { + self.deviceApprovalsChangeMobilePolicyDetails = arg + let swift = TeamLog.EventDetails.deviceApprovalsChangeMobilePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceApprovalsChangeOverageActionDetails: DBXTeamLogEventDetails { + @objc + public var deviceApprovalsChangeOverageActionDetails: DBXTeamLogDeviceApprovalsChangeOverageActionDetails + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeOverageActionDetails) { + self.deviceApprovalsChangeOverageActionDetails = arg + let swift = TeamLog.EventDetails.deviceApprovalsChangeOverageActionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceApprovalsChangeUnlinkActionDetails: DBXTeamLogEventDetails { + @objc + public var deviceApprovalsChangeUnlinkActionDetails: DBXTeamLogDeviceApprovalsChangeUnlinkActionDetails + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeUnlinkActionDetails) { + self.deviceApprovalsChangeUnlinkActionDetails = arg + let swift = TeamLog.EventDetails.deviceApprovalsChangeUnlinkActionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDeviceApprovalsRemoveExceptionDetails: DBXTeamLogEventDetails { + @objc + public var deviceApprovalsRemoveExceptionDetails: DBXTeamLogDeviceApprovalsRemoveExceptionDetails + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsRemoveExceptionDetails) { + self.deviceApprovalsRemoveExceptionDetails = arg + let swift = TeamLog.EventDetails.deviceApprovalsRemoveExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDirectoryRestrictionsAddMembersDetails: DBXTeamLogEventDetails { + @objc + public var directoryRestrictionsAddMembersDetails: DBXTeamLogDirectoryRestrictionsAddMembersDetails + + @objc + public init(_ arg: DBXTeamLogDirectoryRestrictionsAddMembersDetails) { + self.directoryRestrictionsAddMembersDetails = arg + let swift = TeamLog.EventDetails.directoryRestrictionsAddMembersDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDirectoryRestrictionsRemoveMembersDetails: DBXTeamLogEventDetails { + @objc + public var directoryRestrictionsRemoveMembersDetails: DBXTeamLogDirectoryRestrictionsRemoveMembersDetails + + @objc + public init(_ arg: DBXTeamLogDirectoryRestrictionsRemoveMembersDetails) { + self.directoryRestrictionsRemoveMembersDetails = arg + let swift = TeamLog.EventDetails.directoryRestrictionsRemoveMembersDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDropboxPasswordsPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var dropboxPasswordsPolicyChangedDetails: DBXTeamLogDropboxPasswordsPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogDropboxPasswordsPolicyChangedDetails) { + self.dropboxPasswordsPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.dropboxPasswordsPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmailIngestPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var emailIngestPolicyChangedDetails: DBXTeamLogEmailIngestPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogEmailIngestPolicyChangedDetails) { + self.emailIngestPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.emailIngestPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmmAddExceptionDetails: DBXTeamLogEventDetails { + @objc + public var emmAddExceptionDetails: DBXTeamLogEmmAddExceptionDetails + + @objc + public init(_ arg: DBXTeamLogEmmAddExceptionDetails) { + self.emmAddExceptionDetails = arg + let swift = TeamLog.EventDetails.emmAddExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmmChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var emmChangePolicyDetails: DBXTeamLogEmmChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogEmmChangePolicyDetails) { + self.emmChangePolicyDetails = arg + let swift = TeamLog.EventDetails.emmChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEmmRemoveExceptionDetails: DBXTeamLogEventDetails { + @objc + public var emmRemoveExceptionDetails: DBXTeamLogEmmRemoveExceptionDetails + + @objc + public init(_ arg: DBXTeamLogEmmRemoveExceptionDetails) { + self.emmRemoveExceptionDetails = arg + let swift = TeamLog.EventDetails.emmRemoveExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExtendedVersionHistoryChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var extendedVersionHistoryChangePolicyDetails: DBXTeamLogExtendedVersionHistoryChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogExtendedVersionHistoryChangePolicyDetails) { + self.extendedVersionHistoryChangePolicyDetails = arg + let swift = TeamLog.EventDetails.extendedVersionHistoryChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsExternalDriveBackupPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var externalDriveBackupPolicyChangedDetails: DBXTeamLogExternalDriveBackupPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogExternalDriveBackupPolicyChangedDetails) { + self.externalDriveBackupPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.externalDriveBackupPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileCommentsChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var fileCommentsChangePolicyDetails: DBXTeamLogFileCommentsChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogFileCommentsChangePolicyDetails) { + self.fileCommentsChangePolicyDetails = arg + let swift = TeamLog.EventDetails.fileCommentsChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileLockingPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var fileLockingPolicyChangedDetails: DBXTeamLogFileLockingPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogFileLockingPolicyChangedDetails) { + self.fileLockingPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.fileLockingPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileProviderMigrationPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var fileProviderMigrationPolicyChangedDetails: DBXTeamLogFileProviderMigrationPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogFileProviderMigrationPolicyChangedDetails) { + self.fileProviderMigrationPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.fileProviderMigrationPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestsChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestsChangePolicyDetails: DBXTeamLogFileRequestsChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestsChangePolicyDetails) { + self.fileRequestsChangePolicyDetails = arg + let swift = TeamLog.EventDetails.fileRequestsChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestsEmailsEnabledDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestsEmailsEnabledDetails: DBXTeamLogFileRequestsEmailsEnabledDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestsEmailsEnabledDetails) { + self.fileRequestsEmailsEnabledDetails = arg + let swift = TeamLog.EventDetails.fileRequestsEmailsEnabledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileRequestsEmailsRestrictedToTeamOnlyDetails: DBXTeamLogEventDetails { + @objc + public var fileRequestsEmailsRestrictedToTeamOnlyDetails: DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyDetails + + @objc + public init(_ arg: DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyDetails) { + self.fileRequestsEmailsRestrictedToTeamOnlyDetails = arg + let swift = TeamLog.EventDetails.fileRequestsEmailsRestrictedToTeamOnlyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFileTransfersPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var fileTransfersPolicyChangedDetails: DBXTeamLogFileTransfersPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogFileTransfersPolicyChangedDetails) { + self.fileTransfersPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.fileTransfersPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsFolderLinkRestrictionPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var folderLinkRestrictionPolicyChangedDetails: DBXTeamLogFolderLinkRestrictionPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogFolderLinkRestrictionPolicyChangedDetails) { + self.folderLinkRestrictionPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.folderLinkRestrictionPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGoogleSsoChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var googleSsoChangePolicyDetails: DBXTeamLogGoogleSsoChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogGoogleSsoChangePolicyDetails) { + self.googleSsoChangePolicyDetails = arg + let swift = TeamLog.EventDetails.googleSsoChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGroupUserManagementChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var groupUserManagementChangePolicyDetails: DBXTeamLogGroupUserManagementChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogGroupUserManagementChangePolicyDetails) { + self.groupUserManagementChangePolicyDetails = arg + let swift = TeamLog.EventDetails.groupUserManagementChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsIntegrationPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var integrationPolicyChangedDetails: DBXTeamLogIntegrationPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogIntegrationPolicyChangedDetails) { + self.integrationPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.integrationPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsInviteAcceptanceEmailPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var inviteAcceptanceEmailPolicyChangedDetails: DBXTeamLogInviteAcceptanceEmailPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogInviteAcceptanceEmailPolicyChangedDetails) { + self.inviteAcceptanceEmailPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.inviteAcceptanceEmailPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberRequestsChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var memberRequestsChangePolicyDetails: DBXTeamLogMemberRequestsChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogMemberRequestsChangePolicyDetails) { + self.memberRequestsChangePolicyDetails = arg + let swift = TeamLog.EventDetails.memberRequestsChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSendInvitePolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var memberSendInvitePolicyChangedDetails: DBXTeamLogMemberSendInvitePolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogMemberSendInvitePolicyChangedDetails) { + self.memberSendInvitePolicyChangedDetails = arg + let swift = TeamLog.EventDetails.memberSendInvitePolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsAddExceptionDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsAddExceptionDetails: DBXTeamLogMemberSpaceLimitsAddExceptionDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsAddExceptionDetails) { + self.memberSpaceLimitsAddExceptionDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsAddExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsChangeCapsTypePolicyDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsChangeCapsTypePolicyDetails: DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyDetails) { + self.memberSpaceLimitsChangeCapsTypePolicyDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsChangeCapsTypePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsChangePolicyDetails: DBXTeamLogMemberSpaceLimitsChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangePolicyDetails) { + self.memberSpaceLimitsChangePolicyDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSpaceLimitsRemoveExceptionDetails: DBXTeamLogEventDetails { + @objc + public var memberSpaceLimitsRemoveExceptionDetails: DBXTeamLogMemberSpaceLimitsRemoveExceptionDetails + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsRemoveExceptionDetails) { + self.memberSpaceLimitsRemoveExceptionDetails = arg + let swift = TeamLog.EventDetails.memberSpaceLimitsRemoveExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMemberSuggestionsChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var memberSuggestionsChangePolicyDetails: DBXTeamLogMemberSuggestionsChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogMemberSuggestionsChangePolicyDetails) { + self.memberSuggestionsChangePolicyDetails = arg + let swift = TeamLog.EventDetails.memberSuggestionsChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsMicrosoftOfficeAddinChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var microsoftOfficeAddinChangePolicyDetails: DBXTeamLogMicrosoftOfficeAddinChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogMicrosoftOfficeAddinChangePolicyDetails) { + self.microsoftOfficeAddinChangePolicyDetails = arg + let swift = TeamLog.EventDetails.microsoftOfficeAddinChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsNetworkControlChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var networkControlChangePolicyDetails: DBXTeamLogNetworkControlChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogNetworkControlChangePolicyDetails) { + self.networkControlChangePolicyDetails = arg + let swift = TeamLog.EventDetails.networkControlChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperChangeDeploymentPolicyDetails: DBXTeamLogEventDetails { + @objc + public var paperChangeDeploymentPolicyDetails: DBXTeamLogPaperChangeDeploymentPolicyDetails + + @objc + public init(_ arg: DBXTeamLogPaperChangeDeploymentPolicyDetails) { + self.paperChangeDeploymentPolicyDetails = arg + let swift = TeamLog.EventDetails.paperChangeDeploymentPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperChangeMemberLinkPolicyDetails: DBXTeamLogEventDetails { + @objc + public var paperChangeMemberLinkPolicyDetails: DBXTeamLogPaperChangeMemberLinkPolicyDetails + + @objc + public init(_ arg: DBXTeamLogPaperChangeMemberLinkPolicyDetails) { + self.paperChangeMemberLinkPolicyDetails = arg + let swift = TeamLog.EventDetails.paperChangeMemberLinkPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperChangeMemberPolicyDetails: DBXTeamLogEventDetails { + @objc + public var paperChangeMemberPolicyDetails: DBXTeamLogPaperChangeMemberPolicyDetails + + @objc + public init(_ arg: DBXTeamLogPaperChangeMemberPolicyDetails) { + self.paperChangeMemberPolicyDetails = arg + let swift = TeamLog.EventDetails.paperChangeMemberPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var paperChangePolicyDetails: DBXTeamLogPaperChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogPaperChangePolicyDetails) { + self.paperChangePolicyDetails = arg + let swift = TeamLog.EventDetails.paperChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDefaultFolderPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var paperDefaultFolderPolicyChangedDetails: DBXTeamLogPaperDefaultFolderPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogPaperDefaultFolderPolicyChangedDetails) { + self.paperDefaultFolderPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.paperDefaultFolderPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperDesktopPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var paperDesktopPolicyChangedDetails: DBXTeamLogPaperDesktopPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogPaperDesktopPolicyChangedDetails) { + self.paperDesktopPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.paperDesktopPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperEnabledUsersGroupAdditionDetails: DBXTeamLogEventDetails { + @objc + public var paperEnabledUsersGroupAdditionDetails: DBXTeamLogPaperEnabledUsersGroupAdditionDetails + + @objc + public init(_ arg: DBXTeamLogPaperEnabledUsersGroupAdditionDetails) { + self.paperEnabledUsersGroupAdditionDetails = arg + let swift = TeamLog.EventDetails.paperEnabledUsersGroupAdditionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPaperEnabledUsersGroupRemovalDetails: DBXTeamLogEventDetails { + @objc + public var paperEnabledUsersGroupRemovalDetails: DBXTeamLogPaperEnabledUsersGroupRemovalDetails + + @objc + public init(_ arg: DBXTeamLogPaperEnabledUsersGroupRemovalDetails) { + self.paperEnabledUsersGroupRemovalDetails = arg + let swift = TeamLog.EventDetails.paperEnabledUsersGroupRemovalDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPasswordStrengthRequirementsChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var passwordStrengthRequirementsChangePolicyDetails: DBXTeamLogPasswordStrengthRequirementsChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogPasswordStrengthRequirementsChangePolicyDetails) { + self.passwordStrengthRequirementsChangePolicyDetails = arg + let swift = TeamLog.EventDetails.passwordStrengthRequirementsChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsPermanentDeleteChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var permanentDeleteChangePolicyDetails: DBXTeamLogPermanentDeleteChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogPermanentDeleteChangePolicyDetails) { + self.permanentDeleteChangePolicyDetails = arg + let swift = TeamLog.EventDetails.permanentDeleteChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsResellerSupportChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var resellerSupportChangePolicyDetails: DBXTeamLogResellerSupportChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogResellerSupportChangePolicyDetails) { + self.resellerSupportChangePolicyDetails = arg + let swift = TeamLog.EventDetails.resellerSupportChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsRewindPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var rewindPolicyChangedDetails: DBXTeamLogRewindPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogRewindPolicyChangedDetails) { + self.rewindPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.rewindPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSendForSignaturePolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var sendForSignaturePolicyChangedDetails: DBXTeamLogSendForSignaturePolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogSendForSignaturePolicyChangedDetails) { + self.sendForSignaturePolicyChangedDetails = arg + let swift = TeamLog.EventDetails.sendForSignaturePolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharingChangeFolderJoinPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharingChangeFolderJoinPolicyDetails: DBXTeamLogSharingChangeFolderJoinPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharingChangeFolderJoinPolicyDetails) { + self.sharingChangeFolderJoinPolicyDetails = arg + let swift = TeamLog.EventDetails.sharingChangeFolderJoinPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharingChangeLinkAllowChangeExpirationPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharingChangeLinkAllowChangeExpirationPolicyDetails: DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyDetails) { + self.sharingChangeLinkAllowChangeExpirationPolicyDetails = arg + let swift = TeamLog.EventDetails.sharingChangeLinkAllowChangeExpirationPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharingChangeLinkDefaultExpirationPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharingChangeLinkDefaultExpirationPolicyDetails: DBXTeamLogSharingChangeLinkDefaultExpirationPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkDefaultExpirationPolicyDetails) { + self.sharingChangeLinkDefaultExpirationPolicyDetails = arg + let swift = TeamLog.EventDetails.sharingChangeLinkDefaultExpirationPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharingChangeLinkEnforcePasswordPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharingChangeLinkEnforcePasswordPolicyDetails: DBXTeamLogSharingChangeLinkEnforcePasswordPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkEnforcePasswordPolicyDetails) { + self.sharingChangeLinkEnforcePasswordPolicyDetails = arg + let swift = TeamLog.EventDetails.sharingChangeLinkEnforcePasswordPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharingChangeLinkPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharingChangeLinkPolicyDetails: DBXTeamLogSharingChangeLinkPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkPolicyDetails) { + self.sharingChangeLinkPolicyDetails = arg + let swift = TeamLog.EventDetails.sharingChangeLinkPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSharingChangeMemberPolicyDetails: DBXTeamLogEventDetails { + @objc + public var sharingChangeMemberPolicyDetails: DBXTeamLogSharingChangeMemberPolicyDetails + + @objc + public init(_ arg: DBXTeamLogSharingChangeMemberPolicyDetails) { + self.sharingChangeMemberPolicyDetails = arg + let swift = TeamLog.EventDetails.sharingChangeMemberPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseChangeDownloadPolicyDetails: DBXTeamLogEventDetails { + @objc + public var showcaseChangeDownloadPolicyDetails: DBXTeamLogShowcaseChangeDownloadPolicyDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseChangeDownloadPolicyDetails) { + self.showcaseChangeDownloadPolicyDetails = arg + let swift = TeamLog.EventDetails.showcaseChangeDownloadPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseChangeEnabledPolicyDetails: DBXTeamLogEventDetails { + @objc + public var showcaseChangeEnabledPolicyDetails: DBXTeamLogShowcaseChangeEnabledPolicyDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseChangeEnabledPolicyDetails) { + self.showcaseChangeEnabledPolicyDetails = arg + let swift = TeamLog.EventDetails.showcaseChangeEnabledPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsShowcaseChangeExternalSharingPolicyDetails: DBXTeamLogEventDetails { + @objc + public var showcaseChangeExternalSharingPolicyDetails: DBXTeamLogShowcaseChangeExternalSharingPolicyDetails + + @objc + public init(_ arg: DBXTeamLogShowcaseChangeExternalSharingPolicyDetails) { + self.showcaseChangeExternalSharingPolicyDetails = arg + let swift = TeamLog.EventDetails.showcaseChangeExternalSharingPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSmarterSmartSyncPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var smarterSmartSyncPolicyChangedDetails: DBXTeamLogSmarterSmartSyncPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogSmarterSmartSyncPolicyChangedDetails) { + self.smarterSmartSyncPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.smarterSmartSyncPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSmartSyncChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var smartSyncChangePolicyDetails: DBXTeamLogSmartSyncChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogSmartSyncChangePolicyDetails) { + self.smartSyncChangePolicyDetails = arg + let swift = TeamLog.EventDetails.smartSyncChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSmartSyncNotOptOutDetails: DBXTeamLogEventDetails { + @objc + public var smartSyncNotOptOutDetails: DBXTeamLogSmartSyncNotOptOutDetails + + @objc + public init(_ arg: DBXTeamLogSmartSyncNotOptOutDetails) { + self.smartSyncNotOptOutDetails = arg + let swift = TeamLog.EventDetails.smartSyncNotOptOutDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSmartSyncOptOutDetails: DBXTeamLogEventDetails { + @objc + public var smartSyncOptOutDetails: DBXTeamLogSmartSyncOptOutDetails + + @objc + public init(_ arg: DBXTeamLogSmartSyncOptOutDetails) { + self.smartSyncOptOutDetails = arg + let swift = TeamLog.EventDetails.smartSyncOptOutDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsSsoChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var ssoChangePolicyDetails: DBXTeamLogSsoChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogSsoChangePolicyDetails) { + self.ssoChangePolicyDetails = arg + let swift = TeamLog.EventDetails.ssoChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamBrandingPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var teamBrandingPolicyChangedDetails: DBXTeamLogTeamBrandingPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogTeamBrandingPolicyChangedDetails) { + self.teamBrandingPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.teamBrandingPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamExtensionsPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var teamExtensionsPolicyChangedDetails: DBXTeamLogTeamExtensionsPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogTeamExtensionsPolicyChangedDetails) { + self.teamExtensionsPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.teamExtensionsPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamSelectiveSyncPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var teamSelectiveSyncPolicyChangedDetails: DBXTeamLogTeamSelectiveSyncPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogTeamSelectiveSyncPolicyChangedDetails) { + self.teamSelectiveSyncPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.teamSelectiveSyncPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamSharingWhitelistSubjectsChangedDetails: DBXTeamLogEventDetails { + @objc + public var teamSharingWhitelistSubjectsChangedDetails: DBXTeamLogTeamSharingWhitelistSubjectsChangedDetails + + @objc + public init(_ arg: DBXTeamLogTeamSharingWhitelistSubjectsChangedDetails) { + self.teamSharingWhitelistSubjectsChangedDetails = arg + let swift = TeamLog.EventDetails.teamSharingWhitelistSubjectsChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaAddExceptionDetails: DBXTeamLogEventDetails { + @objc + public var tfaAddExceptionDetails: DBXTeamLogTfaAddExceptionDetails + + @objc + public init(_ arg: DBXTeamLogTfaAddExceptionDetails) { + self.tfaAddExceptionDetails = arg + let swift = TeamLog.EventDetails.tfaAddExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var tfaChangePolicyDetails: DBXTeamLogTfaChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogTfaChangePolicyDetails) { + self.tfaChangePolicyDetails = arg + let swift = TeamLog.EventDetails.tfaChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaRemoveExceptionDetails: DBXTeamLogEventDetails { + @objc + public var tfaRemoveExceptionDetails: DBXTeamLogTfaRemoveExceptionDetails + + @objc + public init(_ arg: DBXTeamLogTfaRemoveExceptionDetails) { + self.tfaRemoveExceptionDetails = arg + let swift = TeamLog.EventDetails.tfaRemoveExceptionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTwoAccountChangePolicyDetails: DBXTeamLogEventDetails { + @objc + public var twoAccountChangePolicyDetails: DBXTeamLogTwoAccountChangePolicyDetails + + @objc + public init(_ arg: DBXTeamLogTwoAccountChangePolicyDetails) { + self.twoAccountChangePolicyDetails = arg + let swift = TeamLog.EventDetails.twoAccountChangePolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsViewerInfoPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var viewerInfoPolicyChangedDetails: DBXTeamLogViewerInfoPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogViewerInfoPolicyChangedDetails) { + self.viewerInfoPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.viewerInfoPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsWatermarkingPolicyChangedDetails: DBXTeamLogEventDetails { + @objc + public var watermarkingPolicyChangedDetails: DBXTeamLogWatermarkingPolicyChangedDetails + + @objc + public init(_ arg: DBXTeamLogWatermarkingPolicyChangedDetails) { + self.watermarkingPolicyChangedDetails = arg + let swift = TeamLog.EventDetails.watermarkingPolicyChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsWebSessionsChangeActiveSessionLimitDetails: DBXTeamLogEventDetails { + @objc + public var webSessionsChangeActiveSessionLimitDetails: DBXTeamLogWebSessionsChangeActiveSessionLimitDetails + + @objc + public init(_ arg: DBXTeamLogWebSessionsChangeActiveSessionLimitDetails) { + self.webSessionsChangeActiveSessionLimitDetails = arg + let swift = TeamLog.EventDetails.webSessionsChangeActiveSessionLimitDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsWebSessionsChangeFixedLengthPolicyDetails: DBXTeamLogEventDetails { + @objc + public var webSessionsChangeFixedLengthPolicyDetails: DBXTeamLogWebSessionsChangeFixedLengthPolicyDetails + + @objc + public init(_ arg: DBXTeamLogWebSessionsChangeFixedLengthPolicyDetails) { + self.webSessionsChangeFixedLengthPolicyDetails = arg + let swift = TeamLog.EventDetails.webSessionsChangeFixedLengthPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsWebSessionsChangeIdleLengthPolicyDetails: DBXTeamLogEventDetails { + @objc + public var webSessionsChangeIdleLengthPolicyDetails: DBXTeamLogWebSessionsChangeIdleLengthPolicyDetails + + @objc + public init(_ arg: DBXTeamLogWebSessionsChangeIdleLengthPolicyDetails) { + self.webSessionsChangeIdleLengthPolicyDetails = arg + let swift = TeamLog.EventDetails.webSessionsChangeIdleLengthPolicyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDataResidencyMigrationRequestSuccessfulDetails: DBXTeamLogEventDetails { + @objc + public var dataResidencyMigrationRequestSuccessfulDetails: DBXTeamLogDataResidencyMigrationRequestSuccessfulDetails + + @objc + public init(_ arg: DBXTeamLogDataResidencyMigrationRequestSuccessfulDetails) { + self.dataResidencyMigrationRequestSuccessfulDetails = arg + let swift = TeamLog.EventDetails.dataResidencyMigrationRequestSuccessfulDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsDataResidencyMigrationRequestUnsuccessfulDetails: DBXTeamLogEventDetails { + @objc + public var dataResidencyMigrationRequestUnsuccessfulDetails: DBXTeamLogDataResidencyMigrationRequestUnsuccessfulDetails + + @objc + public init(_ arg: DBXTeamLogDataResidencyMigrationRequestUnsuccessfulDetails) { + self.dataResidencyMigrationRequestUnsuccessfulDetails = arg + let swift = TeamLog.EventDetails.dataResidencyMigrationRequestUnsuccessfulDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeFromDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeFromDetails: DBXTeamLogTeamMergeFromDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeFromDetails) { + self.teamMergeFromDetails = arg + let swift = TeamLog.EventDetails.teamMergeFromDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeToDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeToDetails: DBXTeamLogTeamMergeToDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeToDetails) { + self.teamMergeToDetails = arg + let swift = TeamLog.EventDetails.teamMergeToDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileAddBackgroundDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileAddBackgroundDetails: DBXTeamLogTeamProfileAddBackgroundDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileAddBackgroundDetails) { + self.teamProfileAddBackgroundDetails = arg + let swift = TeamLog.EventDetails.teamProfileAddBackgroundDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileAddLogoDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileAddLogoDetails: DBXTeamLogTeamProfileAddLogoDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileAddLogoDetails) { + self.teamProfileAddLogoDetails = arg + let swift = TeamLog.EventDetails.teamProfileAddLogoDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileChangeBackgroundDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileChangeBackgroundDetails: DBXTeamLogTeamProfileChangeBackgroundDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeBackgroundDetails) { + self.teamProfileChangeBackgroundDetails = arg + let swift = TeamLog.EventDetails.teamProfileChangeBackgroundDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileChangeDefaultLanguageDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileChangeDefaultLanguageDetails: DBXTeamLogTeamProfileChangeDefaultLanguageDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeDefaultLanguageDetails) { + self.teamProfileChangeDefaultLanguageDetails = arg + let swift = TeamLog.EventDetails.teamProfileChangeDefaultLanguageDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileChangeLogoDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileChangeLogoDetails: DBXTeamLogTeamProfileChangeLogoDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeLogoDetails) { + self.teamProfileChangeLogoDetails = arg + let swift = TeamLog.EventDetails.teamProfileChangeLogoDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileChangeNameDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileChangeNameDetails: DBXTeamLogTeamProfileChangeNameDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeNameDetails) { + self.teamProfileChangeNameDetails = arg + let swift = TeamLog.EventDetails.teamProfileChangeNameDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileRemoveBackgroundDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileRemoveBackgroundDetails: DBXTeamLogTeamProfileRemoveBackgroundDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileRemoveBackgroundDetails) { + self.teamProfileRemoveBackgroundDetails = arg + let swift = TeamLog.EventDetails.teamProfileRemoveBackgroundDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamProfileRemoveLogoDetails: DBXTeamLogEventDetails { + @objc + public var teamProfileRemoveLogoDetails: DBXTeamLogTeamProfileRemoveLogoDetails + + @objc + public init(_ arg: DBXTeamLogTeamProfileRemoveLogoDetails) { + self.teamProfileRemoveLogoDetails = arg + let swift = TeamLog.EventDetails.teamProfileRemoveLogoDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaAddBackupPhoneDetails: DBXTeamLogEventDetails { + @objc + public var tfaAddBackupPhoneDetails: DBXTeamLogTfaAddBackupPhoneDetails + + @objc + public init(_ arg: DBXTeamLogTfaAddBackupPhoneDetails) { + self.tfaAddBackupPhoneDetails = arg + let swift = TeamLog.EventDetails.tfaAddBackupPhoneDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaAddSecurityKeyDetails: DBXTeamLogEventDetails { + @objc + public var tfaAddSecurityKeyDetails: DBXTeamLogTfaAddSecurityKeyDetails + + @objc + public init(_ arg: DBXTeamLogTfaAddSecurityKeyDetails) { + self.tfaAddSecurityKeyDetails = arg + let swift = TeamLog.EventDetails.tfaAddSecurityKeyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaChangeBackupPhoneDetails: DBXTeamLogEventDetails { + @objc + public var tfaChangeBackupPhoneDetails: DBXTeamLogTfaChangeBackupPhoneDetails + + @objc + public init(_ arg: DBXTeamLogTfaChangeBackupPhoneDetails) { + self.tfaChangeBackupPhoneDetails = arg + let swift = TeamLog.EventDetails.tfaChangeBackupPhoneDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaChangeStatusDetails: DBXTeamLogEventDetails { + @objc + public var tfaChangeStatusDetails: DBXTeamLogTfaChangeStatusDetails + + @objc + public init(_ arg: DBXTeamLogTfaChangeStatusDetails) { + self.tfaChangeStatusDetails = arg + let swift = TeamLog.EventDetails.tfaChangeStatusDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaRemoveBackupPhoneDetails: DBXTeamLogEventDetails { + @objc + public var tfaRemoveBackupPhoneDetails: DBXTeamLogTfaRemoveBackupPhoneDetails + + @objc + public init(_ arg: DBXTeamLogTfaRemoveBackupPhoneDetails) { + self.tfaRemoveBackupPhoneDetails = arg + let swift = TeamLog.EventDetails.tfaRemoveBackupPhoneDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaRemoveSecurityKeyDetails: DBXTeamLogEventDetails { + @objc + public var tfaRemoveSecurityKeyDetails: DBXTeamLogTfaRemoveSecurityKeyDetails + + @objc + public init(_ arg: DBXTeamLogTfaRemoveSecurityKeyDetails) { + self.tfaRemoveSecurityKeyDetails = arg + let swift = TeamLog.EventDetails.tfaRemoveSecurityKeyDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTfaResetDetails: DBXTeamLogEventDetails { + @objc + public var tfaResetDetails: DBXTeamLogTfaResetDetails + + @objc + public init(_ arg: DBXTeamLogTfaResetDetails) { + self.tfaResetDetails = arg + let swift = TeamLog.EventDetails.tfaResetDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsChangedEnterpriseAdminRoleDetails: DBXTeamLogEventDetails { + @objc + public var changedEnterpriseAdminRoleDetails: DBXTeamLogChangedEnterpriseAdminRoleDetails + + @objc + public init(_ arg: DBXTeamLogChangedEnterpriseAdminRoleDetails) { + self.changedEnterpriseAdminRoleDetails = arg + let swift = TeamLog.EventDetails.changedEnterpriseAdminRoleDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsChangedEnterpriseConnectedTeamStatusDetails: DBXTeamLogEventDetails { + @objc + public var changedEnterpriseConnectedTeamStatusDetails: DBXTeamLogChangedEnterpriseConnectedTeamStatusDetails + + @objc + public init(_ arg: DBXTeamLogChangedEnterpriseConnectedTeamStatusDetails) { + self.changedEnterpriseConnectedTeamStatusDetails = arg + let swift = TeamLog.EventDetails.changedEnterpriseConnectedTeamStatusDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDetails: DBXTeamLogEventDetails { + @objc + public var endedEnterpriseAdminSessionDetails: DBXTeamLogEndedEnterpriseAdminSessionDetails + + @objc + public init(_ arg: DBXTeamLogEndedEnterpriseAdminSessionDetails) { + self.endedEnterpriseAdminSessionDetails = arg + let swift = TeamLog.EventDetails.endedEnterpriseAdminSessionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEndedEnterpriseAdminSessionDeprecatedDetails: DBXTeamLogEventDetails { + @objc + public var endedEnterpriseAdminSessionDeprecatedDetails: DBXTeamLogEndedEnterpriseAdminSessionDeprecatedDetails + + @objc + public init(_ arg: DBXTeamLogEndedEnterpriseAdminSessionDeprecatedDetails) { + self.endedEnterpriseAdminSessionDeprecatedDetails = arg + let swift = TeamLog.EventDetails.endedEnterpriseAdminSessionDeprecatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsEnterpriseSettingsLockingDetails: DBXTeamLogEventDetails { + @objc + public var enterpriseSettingsLockingDetails: DBXTeamLogEnterpriseSettingsLockingDetails + + @objc + public init(_ arg: DBXTeamLogEnterpriseSettingsLockingDetails) { + self.enterpriseSettingsLockingDetails = arg + let swift = TeamLog.EventDetails.enterpriseSettingsLockingDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsGuestAdminChangeStatusDetails: DBXTeamLogEventDetails { + @objc + public var guestAdminChangeStatusDetails: DBXTeamLogGuestAdminChangeStatusDetails + + @objc + public init(_ arg: DBXTeamLogGuestAdminChangeStatusDetails) { + self.guestAdminChangeStatusDetails = arg + let swift = TeamLog.EventDetails.guestAdminChangeStatusDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsStartedEnterpriseAdminSessionDetails: DBXTeamLogEventDetails { + @objc + public var startedEnterpriseAdminSessionDetails: DBXTeamLogStartedEnterpriseAdminSessionDetails + + @objc + public init(_ arg: DBXTeamLogStartedEnterpriseAdminSessionDetails) { + self.startedEnterpriseAdminSessionDetails = arg + let swift = TeamLog.EventDetails.startedEnterpriseAdminSessionDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestAcceptedDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestAcceptedDetails: DBXTeamLogTeamMergeRequestAcceptedDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAcceptedDetails) { + self.teamMergeRequestAcceptedDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestAcceptedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToPrimaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestAcceptedShownToPrimaryTeamDetails: DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamDetails) { + self.teamMergeRequestAcceptedShownToPrimaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestAcceptedShownToPrimaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestAcceptedShownToSecondaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestAcceptedShownToSecondaryTeamDetails: DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamDetails) { + self.teamMergeRequestAcceptedShownToSecondaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestAcceptedShownToSecondaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestAutoCanceledDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestAutoCanceledDetails: DBXTeamLogTeamMergeRequestAutoCanceledDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAutoCanceledDetails) { + self.teamMergeRequestAutoCanceledDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestAutoCanceledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestCanceledDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestCanceledDetails: DBXTeamLogTeamMergeRequestCanceledDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestCanceledDetails) { + self.teamMergeRequestCanceledDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestCanceledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToPrimaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestCanceledShownToPrimaryTeamDetails: DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamDetails) { + self.teamMergeRequestCanceledShownToPrimaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestCanceledShownToPrimaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestCanceledShownToSecondaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestCanceledShownToSecondaryTeamDetails: DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamDetails) { + self.teamMergeRequestCanceledShownToSecondaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestCanceledShownToSecondaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestExpiredDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestExpiredDetails: DBXTeamLogTeamMergeRequestExpiredDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestExpiredDetails) { + self.teamMergeRequestExpiredDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestExpiredDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToPrimaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestExpiredShownToPrimaryTeamDetails: DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamDetails) { + self.teamMergeRequestExpiredShownToPrimaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestExpiredShownToPrimaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestExpiredShownToSecondaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestExpiredShownToSecondaryTeamDetails: DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamDetails) { + self.teamMergeRequestExpiredShownToSecondaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestExpiredShownToSecondaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToPrimaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestRejectedShownToPrimaryTeamDetails: DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamDetails) { + self.teamMergeRequestRejectedShownToPrimaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestRejectedShownToPrimaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestRejectedShownToSecondaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestRejectedShownToSecondaryTeamDetails: DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamDetails) { + self.teamMergeRequestRejectedShownToSecondaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestRejectedShownToSecondaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestReminderDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestReminderDetails: DBXTeamLogTeamMergeRequestReminderDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestReminderDetails) { + self.teamMergeRequestReminderDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestReminderDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestReminderShownToPrimaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestReminderShownToPrimaryTeamDetails: DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamDetails) { + self.teamMergeRequestReminderShownToPrimaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestReminderShownToPrimaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestReminderShownToSecondaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestReminderShownToSecondaryTeamDetails: DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamDetails) { + self.teamMergeRequestReminderShownToSecondaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestReminderShownToSecondaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestRevokedDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestRevokedDetails: DBXTeamLogTeamMergeRequestRevokedDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestRevokedDetails) { + self.teamMergeRequestRevokedDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestRevokedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestSentShownToPrimaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestSentShownToPrimaryTeamDetails: DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamDetails) { + self.teamMergeRequestSentShownToPrimaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestSentShownToPrimaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamMergeRequestSentShownToSecondaryTeamDetails: DBXTeamLogEventDetails { + @objc + public var teamMergeRequestSentShownToSecondaryTeamDetails: DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamDetails) { + self.teamMergeRequestSentShownToSecondaryTeamDetails = arg + let swift = TeamLog.EventDetails.teamMergeRequestSentShownToSecondaryTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// Hints that this event was returned with missing details due to an internal error. +@objc +public class DBXTeamLogEventDetailsMissingDetails: DBXTeamLogEventDetails { + @objc + public var missingDetails: DBXTeamLogMissingDetails + + @objc + public init(_ arg: DBXTeamLogMissingDetails) { + self.missingDetails = arg + let swift = TeamLog.EventDetails.missingDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsOther: DBXTeamLogEventDetails { + @objc + public init() { + let swift = TeamLog.EventDetails.other + super.init(swift: swift) + } +} + +/// The type of the event with description. +@objc +public class DBXTeamLogEventType: NSObject { + let swift: TeamLog.EventType + + public init(swift: TeamLog.EventType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.EventType) -> DBXTeamLogEventType { + switch swift { + case .adminAlertingAlertStateChanged(let swiftArg): + let arg = DBXTeamLogAdminAlertingAlertStateChangedType(swift: swiftArg) + return DBXTeamLogEventTypeAdminAlertingAlertStateChanged(arg) + case .adminAlertingChangedAlertConfig(let swiftArg): + let arg = DBXTeamLogAdminAlertingChangedAlertConfigType(swift: swiftArg) + return DBXTeamLogEventTypeAdminAlertingChangedAlertConfig(arg) + case .adminAlertingTriggeredAlert(let swiftArg): + let arg = DBXTeamLogAdminAlertingTriggeredAlertType(swift: swiftArg) + return DBXTeamLogEventTypeAdminAlertingTriggeredAlert(arg) + case .ransomwareRestoreProcessCompleted(let swiftArg): + let arg = DBXTeamLogRansomwareRestoreProcessCompletedType(swift: swiftArg) + return DBXTeamLogEventTypeRansomwareRestoreProcessCompleted(arg) + case .ransomwareRestoreProcessStarted(let swiftArg): + let arg = DBXTeamLogRansomwareRestoreProcessStartedType(swift: swiftArg) + return DBXTeamLogEventTypeRansomwareRestoreProcessStarted(arg) + case .appBlockedByPermissions(let swiftArg): + let arg = DBXTeamLogAppBlockedByPermissionsType(swift: swiftArg) + return DBXTeamLogEventTypeAppBlockedByPermissions(arg) + case .appLinkTeam(let swiftArg): + let arg = DBXTeamLogAppLinkTeamType(swift: swiftArg) + return DBXTeamLogEventTypeAppLinkTeam(arg) + case .appLinkUser(let swiftArg): + let arg = DBXTeamLogAppLinkUserType(swift: swiftArg) + return DBXTeamLogEventTypeAppLinkUser(arg) + case .appUnlinkTeam(let swiftArg): + let arg = DBXTeamLogAppUnlinkTeamType(swift: swiftArg) + return DBXTeamLogEventTypeAppUnlinkTeam(arg) + case .appUnlinkUser(let swiftArg): + let arg = DBXTeamLogAppUnlinkUserType(swift: swiftArg) + return DBXTeamLogEventTypeAppUnlinkUser(arg) + case .integrationConnected(let swiftArg): + let arg = DBXTeamLogIntegrationConnectedType(swift: swiftArg) + return DBXTeamLogEventTypeIntegrationConnected(arg) + case .integrationDisconnected(let swiftArg): + let arg = DBXTeamLogIntegrationDisconnectedType(swift: swiftArg) + return DBXTeamLogEventTypeIntegrationDisconnected(arg) + case .fileAddComment(let swiftArg): + let arg = DBXTeamLogFileAddCommentType(swift: swiftArg) + return DBXTeamLogEventTypeFileAddComment(arg) + case .fileChangeCommentSubscription(let swiftArg): + let arg = DBXTeamLogFileChangeCommentSubscriptionType(swift: swiftArg) + return DBXTeamLogEventTypeFileChangeCommentSubscription(arg) + case .fileDeleteComment(let swiftArg): + let arg = DBXTeamLogFileDeleteCommentType(swift: swiftArg) + return DBXTeamLogEventTypeFileDeleteComment(arg) + case .fileEditComment(let swiftArg): + let arg = DBXTeamLogFileEditCommentType(swift: swiftArg) + return DBXTeamLogEventTypeFileEditComment(arg) + case .fileLikeComment(let swiftArg): + let arg = DBXTeamLogFileLikeCommentType(swift: swiftArg) + return DBXTeamLogEventTypeFileLikeComment(arg) + case .fileResolveComment(let swiftArg): + let arg = DBXTeamLogFileResolveCommentType(swift: swiftArg) + return DBXTeamLogEventTypeFileResolveComment(arg) + case .fileUnlikeComment(let swiftArg): + let arg = DBXTeamLogFileUnlikeCommentType(swift: swiftArg) + return DBXTeamLogEventTypeFileUnlikeComment(arg) + case .fileUnresolveComment(let swiftArg): + let arg = DBXTeamLogFileUnresolveCommentType(swift: swiftArg) + return DBXTeamLogEventTypeFileUnresolveComment(arg) + case .governancePolicyAddFolders(let swiftArg): + let arg = DBXTeamLogGovernancePolicyAddFoldersType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyAddFolders(arg) + case .governancePolicyAddFolderFailed(let swiftArg): + let arg = DBXTeamLogGovernancePolicyAddFolderFailedType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyAddFolderFailed(arg) + case .governancePolicyContentDisposed(let swiftArg): + let arg = DBXTeamLogGovernancePolicyContentDisposedType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyContentDisposed(arg) + case .governancePolicyCreate(let swiftArg): + let arg = DBXTeamLogGovernancePolicyCreateType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyCreate(arg) + case .governancePolicyDelete(let swiftArg): + let arg = DBXTeamLogGovernancePolicyDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyDelete(arg) + case .governancePolicyEditDetails(let swiftArg): + let arg = DBXTeamLogGovernancePolicyEditDetailsType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyEditDetails(arg) + case .governancePolicyEditDuration(let swiftArg): + let arg = DBXTeamLogGovernancePolicyEditDurationType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyEditDuration(arg) + case .governancePolicyExportCreated(let swiftArg): + let arg = DBXTeamLogGovernancePolicyExportCreatedType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyExportCreated(arg) + case .governancePolicyExportRemoved(let swiftArg): + let arg = DBXTeamLogGovernancePolicyExportRemovedType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyExportRemoved(arg) + case .governancePolicyRemoveFolders(let swiftArg): + let arg = DBXTeamLogGovernancePolicyRemoveFoldersType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyRemoveFolders(arg) + case .governancePolicyReportCreated(let swiftArg): + let arg = DBXTeamLogGovernancePolicyReportCreatedType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyReportCreated(arg) + case .governancePolicyZipPartDownloaded(let swiftArg): + let arg = DBXTeamLogGovernancePolicyZipPartDownloadedType(swift: swiftArg) + return DBXTeamLogEventTypeGovernancePolicyZipPartDownloaded(arg) + case .legalHoldsActivateAHold(let swiftArg): + let arg = DBXTeamLogLegalHoldsActivateAHoldType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsActivateAHold(arg) + case .legalHoldsAddMembers(let swiftArg): + let arg = DBXTeamLogLegalHoldsAddMembersType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsAddMembers(arg) + case .legalHoldsChangeHoldDetails(let swiftArg): + let arg = DBXTeamLogLegalHoldsChangeHoldDetailsType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsChangeHoldDetails(arg) + case .legalHoldsChangeHoldName(let swiftArg): + let arg = DBXTeamLogLegalHoldsChangeHoldNameType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsChangeHoldName(arg) + case .legalHoldsExportAHold(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportAHoldType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsExportAHold(arg) + case .legalHoldsExportCancelled(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportCancelledType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsExportCancelled(arg) + case .legalHoldsExportDownloaded(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportDownloadedType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsExportDownloaded(arg) + case .legalHoldsExportRemoved(let swiftArg): + let arg = DBXTeamLogLegalHoldsExportRemovedType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsExportRemoved(arg) + case .legalHoldsReleaseAHold(let swiftArg): + let arg = DBXTeamLogLegalHoldsReleaseAHoldType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsReleaseAHold(arg) + case .legalHoldsRemoveMembers(let swiftArg): + let arg = DBXTeamLogLegalHoldsRemoveMembersType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsRemoveMembers(arg) + case .legalHoldsReportAHold(let swiftArg): + let arg = DBXTeamLogLegalHoldsReportAHoldType(swift: swiftArg) + return DBXTeamLogEventTypeLegalHoldsReportAHold(arg) + case .deviceChangeIpDesktop(let swiftArg): + let arg = DBXTeamLogDeviceChangeIpDesktopType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceChangeIpDesktop(arg) + case .deviceChangeIpMobile(let swiftArg): + let arg = DBXTeamLogDeviceChangeIpMobileType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceChangeIpMobile(arg) + case .deviceChangeIpWeb(let swiftArg): + let arg = DBXTeamLogDeviceChangeIpWebType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceChangeIpWeb(arg) + case .deviceDeleteOnUnlinkFail(let swiftArg): + let arg = DBXTeamLogDeviceDeleteOnUnlinkFailType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceDeleteOnUnlinkFail(arg) + case .deviceDeleteOnUnlinkSuccess(let swiftArg): + let arg = DBXTeamLogDeviceDeleteOnUnlinkSuccessType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceDeleteOnUnlinkSuccess(arg) + case .deviceLinkFail(let swiftArg): + let arg = DBXTeamLogDeviceLinkFailType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceLinkFail(arg) + case .deviceLinkSuccess(let swiftArg): + let arg = DBXTeamLogDeviceLinkSuccessType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceLinkSuccess(arg) + case .deviceManagementDisabled(let swiftArg): + let arg = DBXTeamLogDeviceManagementDisabledType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceManagementDisabled(arg) + case .deviceManagementEnabled(let swiftArg): + let arg = DBXTeamLogDeviceManagementEnabledType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceManagementEnabled(arg) + case .deviceSyncBackupStatusChanged(let swiftArg): + let arg = DBXTeamLogDeviceSyncBackupStatusChangedType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceSyncBackupStatusChanged(arg) + case .deviceUnlink(let swiftArg): + let arg = DBXTeamLogDeviceUnlinkType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceUnlink(arg) + case .dropboxPasswordsExported(let swiftArg): + let arg = DBXTeamLogDropboxPasswordsExportedType(swift: swiftArg) + return DBXTeamLogEventTypeDropboxPasswordsExported(arg) + case .dropboxPasswordsNewDeviceEnrolled(let swiftArg): + let arg = DBXTeamLogDropboxPasswordsNewDeviceEnrolledType(swift: swiftArg) + return DBXTeamLogEventTypeDropboxPasswordsNewDeviceEnrolled(arg) + case .emmRefreshAuthToken(let swiftArg): + let arg = DBXTeamLogEmmRefreshAuthTokenType(swift: swiftArg) + return DBXTeamLogEventTypeEmmRefreshAuthToken(arg) + case .externalDriveBackupEligibilityStatusChecked(let swiftArg): + let arg = DBXTeamLogExternalDriveBackupEligibilityStatusCheckedType(swift: swiftArg) + return DBXTeamLogEventTypeExternalDriveBackupEligibilityStatusChecked(arg) + case .externalDriveBackupStatusChanged(let swiftArg): + let arg = DBXTeamLogExternalDriveBackupStatusChangedType(swift: swiftArg) + return DBXTeamLogEventTypeExternalDriveBackupStatusChanged(arg) + case .accountCaptureChangeAvailability(let swiftArg): + let arg = DBXTeamLogAccountCaptureChangeAvailabilityType(swift: swiftArg) + return DBXTeamLogEventTypeAccountCaptureChangeAvailability(arg) + case .accountCaptureMigrateAccount(let swiftArg): + let arg = DBXTeamLogAccountCaptureMigrateAccountType(swift: swiftArg) + return DBXTeamLogEventTypeAccountCaptureMigrateAccount(arg) + case .accountCaptureNotificationEmailsSent(let swiftArg): + let arg = DBXTeamLogAccountCaptureNotificationEmailsSentType(swift: swiftArg) + return DBXTeamLogEventTypeAccountCaptureNotificationEmailsSent(arg) + case .accountCaptureRelinquishAccount(let swiftArg): + let arg = DBXTeamLogAccountCaptureRelinquishAccountType(swift: swiftArg) + return DBXTeamLogEventTypeAccountCaptureRelinquishAccount(arg) + case .disabledDomainInvites(let swiftArg): + let arg = DBXTeamLogDisabledDomainInvitesType(swift: swiftArg) + return DBXTeamLogEventTypeDisabledDomainInvites(arg) + case .domainInvitesApproveRequestToJoinTeam(let swiftArg): + let arg = DBXTeamLogDomainInvitesApproveRequestToJoinTeamType(swift: swiftArg) + return DBXTeamLogEventTypeDomainInvitesApproveRequestToJoinTeam(arg) + case .domainInvitesDeclineRequestToJoinTeam(let swiftArg): + let arg = DBXTeamLogDomainInvitesDeclineRequestToJoinTeamType(swift: swiftArg) + return DBXTeamLogEventTypeDomainInvitesDeclineRequestToJoinTeam(arg) + case .domainInvitesEmailExistingUsers(let swiftArg): + let arg = DBXTeamLogDomainInvitesEmailExistingUsersType(swift: swiftArg) + return DBXTeamLogEventTypeDomainInvitesEmailExistingUsers(arg) + case .domainInvitesRequestToJoinTeam(let swiftArg): + let arg = DBXTeamLogDomainInvitesRequestToJoinTeamType(swift: swiftArg) + return DBXTeamLogEventTypeDomainInvitesRequestToJoinTeam(arg) + case .domainInvitesSetInviteNewUserPrefToNo(let swiftArg): + let arg = DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoType(swift: swiftArg) + return DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToNo(arg) + case .domainInvitesSetInviteNewUserPrefToYes(let swiftArg): + let arg = DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesType(swift: swiftArg) + return DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToYes(arg) + case .domainVerificationAddDomainFail(let swiftArg): + let arg = DBXTeamLogDomainVerificationAddDomainFailType(swift: swiftArg) + return DBXTeamLogEventTypeDomainVerificationAddDomainFail(arg) + case .domainVerificationAddDomainSuccess(let swiftArg): + let arg = DBXTeamLogDomainVerificationAddDomainSuccessType(swift: swiftArg) + return DBXTeamLogEventTypeDomainVerificationAddDomainSuccess(arg) + case .domainVerificationRemoveDomain(let swiftArg): + let arg = DBXTeamLogDomainVerificationRemoveDomainType(swift: swiftArg) + return DBXTeamLogEventTypeDomainVerificationRemoveDomain(arg) + case .enabledDomainInvites(let swiftArg): + let arg = DBXTeamLogEnabledDomainInvitesType(swift: swiftArg) + return DBXTeamLogEventTypeEnabledDomainInvites(arg) + case .teamEncryptionKeyCancelKeyDeletion(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyCancelKeyDeletionType(swift: swiftArg) + return DBXTeamLogEventTypeTeamEncryptionKeyCancelKeyDeletion(arg) + case .teamEncryptionKeyCreateKey(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyCreateKeyType(swift: swiftArg) + return DBXTeamLogEventTypeTeamEncryptionKeyCreateKey(arg) + case .teamEncryptionKeyDeleteKey(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyDeleteKeyType(swift: swiftArg) + return DBXTeamLogEventTypeTeamEncryptionKeyDeleteKey(arg) + case .teamEncryptionKeyDisableKey(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyDisableKeyType(swift: swiftArg) + return DBXTeamLogEventTypeTeamEncryptionKeyDisableKey(arg) + case .teamEncryptionKeyEnableKey(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyEnableKeyType(swift: swiftArg) + return DBXTeamLogEventTypeTeamEncryptionKeyEnableKey(arg) + case .teamEncryptionKeyRotateKey(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyRotateKeyType(swift: swiftArg) + return DBXTeamLogEventTypeTeamEncryptionKeyRotateKey(arg) + case .teamEncryptionKeyScheduleKeyDeletion(let swiftArg): + let arg = DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionType(swift: swiftArg) + return DBXTeamLogEventTypeTeamEncryptionKeyScheduleKeyDeletion(arg) + case .applyNamingConvention(let swiftArg): + let arg = DBXTeamLogApplyNamingConventionType(swift: swiftArg) + return DBXTeamLogEventTypeApplyNamingConvention(arg) + case .createFolder(let swiftArg): + let arg = DBXTeamLogCreateFolderType(swift: swiftArg) + return DBXTeamLogEventTypeCreateFolder(arg) + case .fileAdd(let swiftArg): + let arg = DBXTeamLogFileAddType(swift: swiftArg) + return DBXTeamLogEventTypeFileAdd(arg) + case .fileAddFromAutomation(let swiftArg): + let arg = DBXTeamLogFileAddFromAutomationType(swift: swiftArg) + return DBXTeamLogEventTypeFileAddFromAutomation(arg) + case .fileCopy(let swiftArg): + let arg = DBXTeamLogFileCopyType(swift: swiftArg) + return DBXTeamLogEventTypeFileCopy(arg) + case .fileDelete(let swiftArg): + let arg = DBXTeamLogFileDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeFileDelete(arg) + case .fileDownload(let swiftArg): + let arg = DBXTeamLogFileDownloadType(swift: swiftArg) + return DBXTeamLogEventTypeFileDownload(arg) + case .fileEdit(let swiftArg): + let arg = DBXTeamLogFileEditType(swift: swiftArg) + return DBXTeamLogEventTypeFileEdit(arg) + case .fileGetCopyReference(let swiftArg): + let arg = DBXTeamLogFileGetCopyReferenceType(swift: swiftArg) + return DBXTeamLogEventTypeFileGetCopyReference(arg) + case .fileLockingLockStatusChanged(let swiftArg): + let arg = DBXTeamLogFileLockingLockStatusChangedType(swift: swiftArg) + return DBXTeamLogEventTypeFileLockingLockStatusChanged(arg) + case .fileMove(let swiftArg): + let arg = DBXTeamLogFileMoveType(swift: swiftArg) + return DBXTeamLogEventTypeFileMove(arg) + case .filePermanentlyDelete(let swiftArg): + let arg = DBXTeamLogFilePermanentlyDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeFilePermanentlyDelete(arg) + case .filePreview(let swiftArg): + let arg = DBXTeamLogFilePreviewType(swift: swiftArg) + return DBXTeamLogEventTypeFilePreview(arg) + case .fileRename(let swiftArg): + let arg = DBXTeamLogFileRenameType(swift: swiftArg) + return DBXTeamLogEventTypeFileRename(arg) + case .fileRestore(let swiftArg): + let arg = DBXTeamLogFileRestoreType(swift: swiftArg) + return DBXTeamLogEventTypeFileRestore(arg) + case .fileRevert(let swiftArg): + let arg = DBXTeamLogFileRevertType(swift: swiftArg) + return DBXTeamLogEventTypeFileRevert(arg) + case .fileRollbackChanges(let swiftArg): + let arg = DBXTeamLogFileRollbackChangesType(swift: swiftArg) + return DBXTeamLogEventTypeFileRollbackChanges(arg) + case .fileSaveCopyReference(let swiftArg): + let arg = DBXTeamLogFileSaveCopyReferenceType(swift: swiftArg) + return DBXTeamLogEventTypeFileSaveCopyReference(arg) + case .folderOverviewDescriptionChanged(let swiftArg): + let arg = DBXTeamLogFolderOverviewDescriptionChangedType(swift: swiftArg) + return DBXTeamLogEventTypeFolderOverviewDescriptionChanged(arg) + case .folderOverviewItemPinned(let swiftArg): + let arg = DBXTeamLogFolderOverviewItemPinnedType(swift: swiftArg) + return DBXTeamLogEventTypeFolderOverviewItemPinned(arg) + case .folderOverviewItemUnpinned(let swiftArg): + let arg = DBXTeamLogFolderOverviewItemUnpinnedType(swift: swiftArg) + return DBXTeamLogEventTypeFolderOverviewItemUnpinned(arg) + case .objectLabelAdded(let swiftArg): + let arg = DBXTeamLogObjectLabelAddedType(swift: swiftArg) + return DBXTeamLogEventTypeObjectLabelAdded(arg) + case .objectLabelRemoved(let swiftArg): + let arg = DBXTeamLogObjectLabelRemovedType(swift: swiftArg) + return DBXTeamLogEventTypeObjectLabelRemoved(arg) + case .objectLabelUpdatedValue(let swiftArg): + let arg = DBXTeamLogObjectLabelUpdatedValueType(swift: swiftArg) + return DBXTeamLogEventTypeObjectLabelUpdatedValue(arg) + case .organizeFolderWithTidy(let swiftArg): + let arg = DBXTeamLogOrganizeFolderWithTidyType(swift: swiftArg) + return DBXTeamLogEventTypeOrganizeFolderWithTidy(arg) + case .replayFileDelete(let swiftArg): + let arg = DBXTeamLogReplayFileDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeReplayFileDelete(arg) + case .rewindFolder(let swiftArg): + let arg = DBXTeamLogRewindFolderType(swift: swiftArg) + return DBXTeamLogEventTypeRewindFolder(arg) + case .undoNamingConvention(let swiftArg): + let arg = DBXTeamLogUndoNamingConventionType(swift: swiftArg) + return DBXTeamLogEventTypeUndoNamingConvention(arg) + case .undoOrganizeFolderWithTidy(let swiftArg): + let arg = DBXTeamLogUndoOrganizeFolderWithTidyType(swift: swiftArg) + return DBXTeamLogEventTypeUndoOrganizeFolderWithTidy(arg) + case .userTagsAdded(let swiftArg): + let arg = DBXTeamLogUserTagsAddedType(swift: swiftArg) + return DBXTeamLogEventTypeUserTagsAdded(arg) + case .userTagsRemoved(let swiftArg): + let arg = DBXTeamLogUserTagsRemovedType(swift: swiftArg) + return DBXTeamLogEventTypeUserTagsRemoved(arg) + case .emailIngestReceiveFile(let swiftArg): + let arg = DBXTeamLogEmailIngestReceiveFileType(swift: swiftArg) + return DBXTeamLogEventTypeEmailIngestReceiveFile(arg) + case .fileRequestChange(let swiftArg): + let arg = DBXTeamLogFileRequestChangeType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestChange(arg) + case .fileRequestClose(let swiftArg): + let arg = DBXTeamLogFileRequestCloseType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestClose(arg) + case .fileRequestCreate(let swiftArg): + let arg = DBXTeamLogFileRequestCreateType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestCreate(arg) + case .fileRequestDelete(let swiftArg): + let arg = DBXTeamLogFileRequestDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestDelete(arg) + case .fileRequestReceiveFile(let swiftArg): + let arg = DBXTeamLogFileRequestReceiveFileType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestReceiveFile(arg) + case .groupAddExternalId(let swiftArg): + let arg = DBXTeamLogGroupAddExternalIdType(swift: swiftArg) + return DBXTeamLogEventTypeGroupAddExternalId(arg) + case .groupAddMember(let swiftArg): + let arg = DBXTeamLogGroupAddMemberType(swift: swiftArg) + return DBXTeamLogEventTypeGroupAddMember(arg) + case .groupChangeExternalId(let swiftArg): + let arg = DBXTeamLogGroupChangeExternalIdType(swift: swiftArg) + return DBXTeamLogEventTypeGroupChangeExternalId(arg) + case .groupChangeManagementType(let swiftArg): + let arg = DBXTeamLogGroupChangeManagementTypeType(swift: swiftArg) + return DBXTeamLogEventTypeGroupChangeManagementType(arg) + case .groupChangeMemberRole(let swiftArg): + let arg = DBXTeamLogGroupChangeMemberRoleType(swift: swiftArg) + return DBXTeamLogEventTypeGroupChangeMemberRole(arg) + case .groupCreate(let swiftArg): + let arg = DBXTeamLogGroupCreateType(swift: swiftArg) + return DBXTeamLogEventTypeGroupCreate(arg) + case .groupDelete(let swiftArg): + let arg = DBXTeamLogGroupDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeGroupDelete(arg) + case .groupDescriptionUpdated(let swiftArg): + let arg = DBXTeamLogGroupDescriptionUpdatedType(swift: swiftArg) + return DBXTeamLogEventTypeGroupDescriptionUpdated(arg) + case .groupJoinPolicyUpdated(let swiftArg): + let arg = DBXTeamLogGroupJoinPolicyUpdatedType(swift: swiftArg) + return DBXTeamLogEventTypeGroupJoinPolicyUpdated(arg) + case .groupMoved(let swiftArg): + let arg = DBXTeamLogGroupMovedType(swift: swiftArg) + return DBXTeamLogEventTypeGroupMoved(arg) + case .groupRemoveExternalId(let swiftArg): + let arg = DBXTeamLogGroupRemoveExternalIdType(swift: swiftArg) + return DBXTeamLogEventTypeGroupRemoveExternalId(arg) + case .groupRemoveMember(let swiftArg): + let arg = DBXTeamLogGroupRemoveMemberType(swift: swiftArg) + return DBXTeamLogEventTypeGroupRemoveMember(arg) + case .groupRename(let swiftArg): + let arg = DBXTeamLogGroupRenameType(swift: swiftArg) + return DBXTeamLogEventTypeGroupRename(arg) + case .accountLockOrUnlocked(let swiftArg): + let arg = DBXTeamLogAccountLockOrUnlockedType(swift: swiftArg) + return DBXTeamLogEventTypeAccountLockOrUnlocked(arg) + case .emmError(let swiftArg): + let arg = DBXTeamLogEmmErrorType(swift: swiftArg) + return DBXTeamLogEventTypeEmmError(arg) + case .guestAdminSignedInViaTrustedTeams(let swiftArg): + let arg = DBXTeamLogGuestAdminSignedInViaTrustedTeamsType(swift: swiftArg) + return DBXTeamLogEventTypeGuestAdminSignedInViaTrustedTeams(arg) + case .guestAdminSignedOutViaTrustedTeams(let swiftArg): + let arg = DBXTeamLogGuestAdminSignedOutViaTrustedTeamsType(swift: swiftArg) + return DBXTeamLogEventTypeGuestAdminSignedOutViaTrustedTeams(arg) + case .loginFail(let swiftArg): + let arg = DBXTeamLogLoginFailType(swift: swiftArg) + return DBXTeamLogEventTypeLoginFail(arg) + case .loginSuccess(let swiftArg): + let arg = DBXTeamLogLoginSuccessType(swift: swiftArg) + return DBXTeamLogEventTypeLoginSuccess(arg) + case .logout(let swiftArg): + let arg = DBXTeamLogLogoutType(swift: swiftArg) + return DBXTeamLogEventTypeLogout(arg) + case .resellerSupportSessionEnd(let swiftArg): + let arg = DBXTeamLogResellerSupportSessionEndType(swift: swiftArg) + return DBXTeamLogEventTypeResellerSupportSessionEnd(arg) + case .resellerSupportSessionStart(let swiftArg): + let arg = DBXTeamLogResellerSupportSessionStartType(swift: swiftArg) + return DBXTeamLogEventTypeResellerSupportSessionStart(arg) + case .signInAsSessionEnd(let swiftArg): + let arg = DBXTeamLogSignInAsSessionEndType(swift: swiftArg) + return DBXTeamLogEventTypeSignInAsSessionEnd(arg) + case .signInAsSessionStart(let swiftArg): + let arg = DBXTeamLogSignInAsSessionStartType(swift: swiftArg) + return DBXTeamLogEventTypeSignInAsSessionStart(arg) + case .ssoError(let swiftArg): + let arg = DBXTeamLogSsoErrorType(swift: swiftArg) + return DBXTeamLogEventTypeSsoError(arg) + case .backupAdminInvitationSent(let swiftArg): + let arg = DBXTeamLogBackupAdminInvitationSentType(swift: swiftArg) + return DBXTeamLogEventTypeBackupAdminInvitationSent(arg) + case .backupInvitationOpened(let swiftArg): + let arg = DBXTeamLogBackupInvitationOpenedType(swift: swiftArg) + return DBXTeamLogEventTypeBackupInvitationOpened(arg) + case .createTeamInviteLink(let swiftArg): + let arg = DBXTeamLogCreateTeamInviteLinkType(swift: swiftArg) + return DBXTeamLogEventTypeCreateTeamInviteLink(arg) + case .deleteTeamInviteLink(let swiftArg): + let arg = DBXTeamLogDeleteTeamInviteLinkType(swift: swiftArg) + return DBXTeamLogEventTypeDeleteTeamInviteLink(arg) + case .memberAddExternalId(let swiftArg): + let arg = DBXTeamLogMemberAddExternalIdType(swift: swiftArg) + return DBXTeamLogEventTypeMemberAddExternalId(arg) + case .memberAddName(let swiftArg): + let arg = DBXTeamLogMemberAddNameType(swift: swiftArg) + return DBXTeamLogEventTypeMemberAddName(arg) + case .memberChangeAdminRole(let swiftArg): + let arg = DBXTeamLogMemberChangeAdminRoleType(swift: swiftArg) + return DBXTeamLogEventTypeMemberChangeAdminRole(arg) + case .memberChangeEmail(let swiftArg): + let arg = DBXTeamLogMemberChangeEmailType(swift: swiftArg) + return DBXTeamLogEventTypeMemberChangeEmail(arg) + case .memberChangeExternalId(let swiftArg): + let arg = DBXTeamLogMemberChangeExternalIdType(swift: swiftArg) + return DBXTeamLogEventTypeMemberChangeExternalId(arg) + case .memberChangeMembershipType(let swiftArg): + let arg = DBXTeamLogMemberChangeMembershipTypeType(swift: swiftArg) + return DBXTeamLogEventTypeMemberChangeMembershipType(arg) + case .memberChangeName(let swiftArg): + let arg = DBXTeamLogMemberChangeNameType(swift: swiftArg) + return DBXTeamLogEventTypeMemberChangeName(arg) + case .memberChangeResellerRole(let swiftArg): + let arg = DBXTeamLogMemberChangeResellerRoleType(swift: swiftArg) + return DBXTeamLogEventTypeMemberChangeResellerRole(arg) + case .memberChangeStatus(let swiftArg): + let arg = DBXTeamLogMemberChangeStatusType(swift: swiftArg) + return DBXTeamLogEventTypeMemberChangeStatus(arg) + case .memberDeleteManualContacts(let swiftArg): + let arg = DBXTeamLogMemberDeleteManualContactsType(swift: swiftArg) + return DBXTeamLogEventTypeMemberDeleteManualContacts(arg) + case .memberDeleteProfilePhoto(let swiftArg): + let arg = DBXTeamLogMemberDeleteProfilePhotoType(swift: swiftArg) + return DBXTeamLogEventTypeMemberDeleteProfilePhoto(arg) + case .memberPermanentlyDeleteAccountContents(let swiftArg): + let arg = DBXTeamLogMemberPermanentlyDeleteAccountContentsType(swift: swiftArg) + return DBXTeamLogEventTypeMemberPermanentlyDeleteAccountContents(arg) + case .memberRemoveExternalId(let swiftArg): + let arg = DBXTeamLogMemberRemoveExternalIdType(swift: swiftArg) + return DBXTeamLogEventTypeMemberRemoveExternalId(arg) + case .memberSetProfilePhoto(let swiftArg): + let arg = DBXTeamLogMemberSetProfilePhotoType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSetProfilePhoto(arg) + case .memberSpaceLimitsAddCustomQuota(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsAddCustomQuotaType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsAddCustomQuota(arg) + case .memberSpaceLimitsChangeCustomQuota(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangeCustomQuotaType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsChangeCustomQuota(arg) + case .memberSpaceLimitsChangeStatus(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangeStatusType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsChangeStatus(arg) + case .memberSpaceLimitsRemoveCustomQuota(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsRemoveCustomQuota(arg) + case .memberSuggest(let swiftArg): + let arg = DBXTeamLogMemberSuggestType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSuggest(arg) + case .memberTransferAccountContents(let swiftArg): + let arg = DBXTeamLogMemberTransferAccountContentsType(swift: swiftArg) + return DBXTeamLogEventTypeMemberTransferAccountContents(arg) + case .pendingSecondaryEmailAdded(let swiftArg): + let arg = DBXTeamLogPendingSecondaryEmailAddedType(swift: swiftArg) + return DBXTeamLogEventTypePendingSecondaryEmailAdded(arg) + case .secondaryEmailDeleted(let swiftArg): + let arg = DBXTeamLogSecondaryEmailDeletedType(swift: swiftArg) + return DBXTeamLogEventTypeSecondaryEmailDeleted(arg) + case .secondaryEmailVerified(let swiftArg): + let arg = DBXTeamLogSecondaryEmailVerifiedType(swift: swiftArg) + return DBXTeamLogEventTypeSecondaryEmailVerified(arg) + case .secondaryMailsPolicyChanged(let swiftArg): + let arg = DBXTeamLogSecondaryMailsPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeSecondaryMailsPolicyChanged(arg) + case .binderAddPage(let swiftArg): + let arg = DBXTeamLogBinderAddPageType(swift: swiftArg) + return DBXTeamLogEventTypeBinderAddPage(arg) + case .binderAddSection(let swiftArg): + let arg = DBXTeamLogBinderAddSectionType(swift: swiftArg) + return DBXTeamLogEventTypeBinderAddSection(arg) + case .binderRemovePage(let swiftArg): + let arg = DBXTeamLogBinderRemovePageType(swift: swiftArg) + return DBXTeamLogEventTypeBinderRemovePage(arg) + case .binderRemoveSection(let swiftArg): + let arg = DBXTeamLogBinderRemoveSectionType(swift: swiftArg) + return DBXTeamLogEventTypeBinderRemoveSection(arg) + case .binderRenamePage(let swiftArg): + let arg = DBXTeamLogBinderRenamePageType(swift: swiftArg) + return DBXTeamLogEventTypeBinderRenamePage(arg) + case .binderRenameSection(let swiftArg): + let arg = DBXTeamLogBinderRenameSectionType(swift: swiftArg) + return DBXTeamLogEventTypeBinderRenameSection(arg) + case .binderReorderPage(let swiftArg): + let arg = DBXTeamLogBinderReorderPageType(swift: swiftArg) + return DBXTeamLogEventTypeBinderReorderPage(arg) + case .binderReorderSection(let swiftArg): + let arg = DBXTeamLogBinderReorderSectionType(swift: swiftArg) + return DBXTeamLogEventTypeBinderReorderSection(arg) + case .paperContentAddMember(let swiftArg): + let arg = DBXTeamLogPaperContentAddMemberType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentAddMember(arg) + case .paperContentAddToFolder(let swiftArg): + let arg = DBXTeamLogPaperContentAddToFolderType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentAddToFolder(arg) + case .paperContentArchive(let swiftArg): + let arg = DBXTeamLogPaperContentArchiveType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentArchive(arg) + case .paperContentCreate(let swiftArg): + let arg = DBXTeamLogPaperContentCreateType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentCreate(arg) + case .paperContentPermanentlyDelete(let swiftArg): + let arg = DBXTeamLogPaperContentPermanentlyDeleteType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentPermanentlyDelete(arg) + case .paperContentRemoveFromFolder(let swiftArg): + let arg = DBXTeamLogPaperContentRemoveFromFolderType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentRemoveFromFolder(arg) + case .paperContentRemoveMember(let swiftArg): + let arg = DBXTeamLogPaperContentRemoveMemberType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentRemoveMember(arg) + case .paperContentRename(let swiftArg): + let arg = DBXTeamLogPaperContentRenameType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentRename(arg) + case .paperContentRestore(let swiftArg): + let arg = DBXTeamLogPaperContentRestoreType(swift: swiftArg) + return DBXTeamLogEventTypePaperContentRestore(arg) + case .paperDocAddComment(let swiftArg): + let arg = DBXTeamLogPaperDocAddCommentType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocAddComment(arg) + case .paperDocChangeMemberRole(let swiftArg): + let arg = DBXTeamLogPaperDocChangeMemberRoleType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocChangeMemberRole(arg) + case .paperDocChangeSharingPolicy(let swiftArg): + let arg = DBXTeamLogPaperDocChangeSharingPolicyType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocChangeSharingPolicy(arg) + case .paperDocChangeSubscription(let swiftArg): + let arg = DBXTeamLogPaperDocChangeSubscriptionType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocChangeSubscription(arg) + case .paperDocDeleted(let swiftArg): + let arg = DBXTeamLogPaperDocDeletedType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocDeleted(arg) + case .paperDocDeleteComment(let swiftArg): + let arg = DBXTeamLogPaperDocDeleteCommentType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocDeleteComment(arg) + case .paperDocDownload(let swiftArg): + let arg = DBXTeamLogPaperDocDownloadType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocDownload(arg) + case .paperDocEdit(let swiftArg): + let arg = DBXTeamLogPaperDocEditType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocEdit(arg) + case .paperDocEditComment(let swiftArg): + let arg = DBXTeamLogPaperDocEditCommentType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocEditComment(arg) + case .paperDocFollowed(let swiftArg): + let arg = DBXTeamLogPaperDocFollowedType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocFollowed(arg) + case .paperDocMention(let swiftArg): + let arg = DBXTeamLogPaperDocMentionType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocMention(arg) + case .paperDocOwnershipChanged(let swiftArg): + let arg = DBXTeamLogPaperDocOwnershipChangedType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocOwnershipChanged(arg) + case .paperDocRequestAccess(let swiftArg): + let arg = DBXTeamLogPaperDocRequestAccessType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocRequestAccess(arg) + case .paperDocResolveComment(let swiftArg): + let arg = DBXTeamLogPaperDocResolveCommentType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocResolveComment(arg) + case .paperDocRevert(let swiftArg): + let arg = DBXTeamLogPaperDocRevertType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocRevert(arg) + case .paperDocSlackShare(let swiftArg): + let arg = DBXTeamLogPaperDocSlackShareType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocSlackShare(arg) + case .paperDocTeamInvite(let swiftArg): + let arg = DBXTeamLogPaperDocTeamInviteType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocTeamInvite(arg) + case .paperDocTrashed(let swiftArg): + let arg = DBXTeamLogPaperDocTrashedType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocTrashed(arg) + case .paperDocUnresolveComment(let swiftArg): + let arg = DBXTeamLogPaperDocUnresolveCommentType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocUnresolveComment(arg) + case .paperDocUntrashed(let swiftArg): + let arg = DBXTeamLogPaperDocUntrashedType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocUntrashed(arg) + case .paperDocView(let swiftArg): + let arg = DBXTeamLogPaperDocViewType(swift: swiftArg) + return DBXTeamLogEventTypePaperDocView(arg) + case .paperExternalViewAllow(let swiftArg): + let arg = DBXTeamLogPaperExternalViewAllowType(swift: swiftArg) + return DBXTeamLogEventTypePaperExternalViewAllow(arg) + case .paperExternalViewDefaultTeam(let swiftArg): + let arg = DBXTeamLogPaperExternalViewDefaultTeamType(swift: swiftArg) + return DBXTeamLogEventTypePaperExternalViewDefaultTeam(arg) + case .paperExternalViewForbid(let swiftArg): + let arg = DBXTeamLogPaperExternalViewForbidType(swift: swiftArg) + return DBXTeamLogEventTypePaperExternalViewForbid(arg) + case .paperFolderChangeSubscription(let swiftArg): + let arg = DBXTeamLogPaperFolderChangeSubscriptionType(swift: swiftArg) + return DBXTeamLogEventTypePaperFolderChangeSubscription(arg) + case .paperFolderDeleted(let swiftArg): + let arg = DBXTeamLogPaperFolderDeletedType(swift: swiftArg) + return DBXTeamLogEventTypePaperFolderDeleted(arg) + case .paperFolderFollowed(let swiftArg): + let arg = DBXTeamLogPaperFolderFollowedType(swift: swiftArg) + return DBXTeamLogEventTypePaperFolderFollowed(arg) + case .paperFolderTeamInvite(let swiftArg): + let arg = DBXTeamLogPaperFolderTeamInviteType(swift: swiftArg) + return DBXTeamLogEventTypePaperFolderTeamInvite(arg) + case .paperPublishedLinkChangePermission(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkChangePermissionType(swift: swiftArg) + return DBXTeamLogEventTypePaperPublishedLinkChangePermission(arg) + case .paperPublishedLinkCreate(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkCreateType(swift: swiftArg) + return DBXTeamLogEventTypePaperPublishedLinkCreate(arg) + case .paperPublishedLinkDisabled(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkDisabledType(swift: swiftArg) + return DBXTeamLogEventTypePaperPublishedLinkDisabled(arg) + case .paperPublishedLinkView(let swiftArg): + let arg = DBXTeamLogPaperPublishedLinkViewType(swift: swiftArg) + return DBXTeamLogEventTypePaperPublishedLinkView(arg) + case .passwordChange(let swiftArg): + let arg = DBXTeamLogPasswordChangeType(swift: swiftArg) + return DBXTeamLogEventTypePasswordChange(arg) + case .passwordReset(let swiftArg): + let arg = DBXTeamLogPasswordResetType(swift: swiftArg) + return DBXTeamLogEventTypePasswordReset(arg) + case .passwordResetAll(let swiftArg): + let arg = DBXTeamLogPasswordResetAllType(swift: swiftArg) + return DBXTeamLogEventTypePasswordResetAll(arg) + case .classificationCreateReport(let swiftArg): + let arg = DBXTeamLogClassificationCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeClassificationCreateReport(arg) + case .classificationCreateReportFail(let swiftArg): + let arg = DBXTeamLogClassificationCreateReportFailType(swift: swiftArg) + return DBXTeamLogEventTypeClassificationCreateReportFail(arg) + case .emmCreateExceptionsReport(let swiftArg): + let arg = DBXTeamLogEmmCreateExceptionsReportType(swift: swiftArg) + return DBXTeamLogEventTypeEmmCreateExceptionsReport(arg) + case .emmCreateUsageReport(let swiftArg): + let arg = DBXTeamLogEmmCreateUsageReportType(swift: swiftArg) + return DBXTeamLogEventTypeEmmCreateUsageReport(arg) + case .exportMembersReport(let swiftArg): + let arg = DBXTeamLogExportMembersReportType(swift: swiftArg) + return DBXTeamLogEventTypeExportMembersReport(arg) + case .exportMembersReportFail(let swiftArg): + let arg = DBXTeamLogExportMembersReportFailType(swift: swiftArg) + return DBXTeamLogEventTypeExportMembersReportFail(arg) + case .externalSharingCreateReport(let swiftArg): + let arg = DBXTeamLogExternalSharingCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeExternalSharingCreateReport(arg) + case .externalSharingReportFailed(let swiftArg): + let arg = DBXTeamLogExternalSharingReportFailedType(swift: swiftArg) + return DBXTeamLogEventTypeExternalSharingReportFailed(arg) + case .noExpirationLinkGenCreateReport(let swiftArg): + let arg = DBXTeamLogNoExpirationLinkGenCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeNoExpirationLinkGenCreateReport(arg) + case .noExpirationLinkGenReportFailed(let swiftArg): + let arg = DBXTeamLogNoExpirationLinkGenReportFailedType(swift: swiftArg) + return DBXTeamLogEventTypeNoExpirationLinkGenReportFailed(arg) + case .noPasswordLinkGenCreateReport(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkGenCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeNoPasswordLinkGenCreateReport(arg) + case .noPasswordLinkGenReportFailed(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkGenReportFailedType(swift: swiftArg) + return DBXTeamLogEventTypeNoPasswordLinkGenReportFailed(arg) + case .noPasswordLinkViewCreateReport(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkViewCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeNoPasswordLinkViewCreateReport(arg) + case .noPasswordLinkViewReportFailed(let swiftArg): + let arg = DBXTeamLogNoPasswordLinkViewReportFailedType(swift: swiftArg) + return DBXTeamLogEventTypeNoPasswordLinkViewReportFailed(arg) + case .outdatedLinkViewCreateReport(let swiftArg): + let arg = DBXTeamLogOutdatedLinkViewCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeOutdatedLinkViewCreateReport(arg) + case .outdatedLinkViewReportFailed(let swiftArg): + let arg = DBXTeamLogOutdatedLinkViewReportFailedType(swift: swiftArg) + return DBXTeamLogEventTypeOutdatedLinkViewReportFailed(arg) + case .paperAdminExportStart(let swiftArg): + let arg = DBXTeamLogPaperAdminExportStartType(swift: swiftArg) + return DBXTeamLogEventTypePaperAdminExportStart(arg) + case .ransomwareAlertCreateReport(let swiftArg): + let arg = DBXTeamLogRansomwareAlertCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeRansomwareAlertCreateReport(arg) + case .ransomwareAlertCreateReportFailed(let swiftArg): + let arg = DBXTeamLogRansomwareAlertCreateReportFailedType(swift: swiftArg) + return DBXTeamLogEventTypeRansomwareAlertCreateReportFailed(arg) + case .smartSyncCreateAdminPrivilegeReport(let swiftArg): + let arg = DBXTeamLogSmartSyncCreateAdminPrivilegeReportType(swift: swiftArg) + return DBXTeamLogEventTypeSmartSyncCreateAdminPrivilegeReport(arg) + case .teamActivityCreateReport(let swiftArg): + let arg = DBXTeamLogTeamActivityCreateReportType(swift: swiftArg) + return DBXTeamLogEventTypeTeamActivityCreateReport(arg) + case .teamActivityCreateReportFail(let swiftArg): + let arg = DBXTeamLogTeamActivityCreateReportFailType(swift: swiftArg) + return DBXTeamLogEventTypeTeamActivityCreateReportFail(arg) + case .collectionShare(let swiftArg): + let arg = DBXTeamLogCollectionShareType(swift: swiftArg) + return DBXTeamLogEventTypeCollectionShare(arg) + case .fileTransfersFileAdd(let swiftArg): + let arg = DBXTeamLogFileTransfersFileAddType(swift: swiftArg) + return DBXTeamLogEventTypeFileTransfersFileAdd(arg) + case .fileTransfersTransferDelete(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeFileTransfersTransferDelete(arg) + case .fileTransfersTransferDownload(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferDownloadType(swift: swiftArg) + return DBXTeamLogEventTypeFileTransfersTransferDownload(arg) + case .fileTransfersTransferSend(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferSendType(swift: swiftArg) + return DBXTeamLogEventTypeFileTransfersTransferSend(arg) + case .fileTransfersTransferView(let swiftArg): + let arg = DBXTeamLogFileTransfersTransferViewType(swift: swiftArg) + return DBXTeamLogEventTypeFileTransfersTransferView(arg) + case .noteAclInviteOnly(let swiftArg): + let arg = DBXTeamLogNoteAclInviteOnlyType(swift: swiftArg) + return DBXTeamLogEventTypeNoteAclInviteOnly(arg) + case .noteAclLink(let swiftArg): + let arg = DBXTeamLogNoteAclLinkType(swift: swiftArg) + return DBXTeamLogEventTypeNoteAclLink(arg) + case .noteAclTeamLink(let swiftArg): + let arg = DBXTeamLogNoteAclTeamLinkType(swift: swiftArg) + return DBXTeamLogEventTypeNoteAclTeamLink(arg) + case .noteShared(let swiftArg): + let arg = DBXTeamLogNoteSharedType(swift: swiftArg) + return DBXTeamLogEventTypeNoteShared(arg) + case .noteShareReceive(let swiftArg): + let arg = DBXTeamLogNoteShareReceiveType(swift: swiftArg) + return DBXTeamLogEventTypeNoteShareReceive(arg) + case .openNoteShared(let swiftArg): + let arg = DBXTeamLogOpenNoteSharedType(swift: swiftArg) + return DBXTeamLogEventTypeOpenNoteShared(arg) + case .replayFileSharedLinkCreated(let swiftArg): + let arg = DBXTeamLogReplayFileSharedLinkCreatedType(swift: swiftArg) + return DBXTeamLogEventTypeReplayFileSharedLinkCreated(arg) + case .replayFileSharedLinkModified(let swiftArg): + let arg = DBXTeamLogReplayFileSharedLinkModifiedType(swift: swiftArg) + return DBXTeamLogEventTypeReplayFileSharedLinkModified(arg) + case .replayProjectTeamAdd(let swiftArg): + let arg = DBXTeamLogReplayProjectTeamAddType(swift: swiftArg) + return DBXTeamLogEventTypeReplayProjectTeamAdd(arg) + case .replayProjectTeamDelete(let swiftArg): + let arg = DBXTeamLogReplayProjectTeamDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeReplayProjectTeamDelete(arg) + case .sfAddGroup(let swiftArg): + let arg = DBXTeamLogSfAddGroupType(swift: swiftArg) + return DBXTeamLogEventTypeSfAddGroup(arg) + case .sfAllowNonMembersToViewSharedLinks(let swiftArg): + let arg = DBXTeamLogSfAllowNonMembersToViewSharedLinksType(swift: swiftArg) + return DBXTeamLogEventTypeSfAllowNonMembersToViewSharedLinks(arg) + case .sfExternalInviteWarn(let swiftArg): + let arg = DBXTeamLogSfExternalInviteWarnType(swift: swiftArg) + return DBXTeamLogEventTypeSfExternalInviteWarn(arg) + case .sfFbInvite(let swiftArg): + let arg = DBXTeamLogSfFbInviteType(swift: swiftArg) + return DBXTeamLogEventTypeSfFbInvite(arg) + case .sfFbInviteChangeRole(let swiftArg): + let arg = DBXTeamLogSfFbInviteChangeRoleType(swift: swiftArg) + return DBXTeamLogEventTypeSfFbInviteChangeRole(arg) + case .sfFbUninvite(let swiftArg): + let arg = DBXTeamLogSfFbUninviteType(swift: swiftArg) + return DBXTeamLogEventTypeSfFbUninvite(arg) + case .sfInviteGroup(let swiftArg): + let arg = DBXTeamLogSfInviteGroupType(swift: swiftArg) + return DBXTeamLogEventTypeSfInviteGroup(arg) + case .sfTeamGrantAccess(let swiftArg): + let arg = DBXTeamLogSfTeamGrantAccessType(swift: swiftArg) + return DBXTeamLogEventTypeSfTeamGrantAccess(arg) + case .sfTeamInvite(let swiftArg): + let arg = DBXTeamLogSfTeamInviteType(swift: swiftArg) + return DBXTeamLogEventTypeSfTeamInvite(arg) + case .sfTeamInviteChangeRole(let swiftArg): + let arg = DBXTeamLogSfTeamInviteChangeRoleType(swift: swiftArg) + return DBXTeamLogEventTypeSfTeamInviteChangeRole(arg) + case .sfTeamJoin(let swiftArg): + let arg = DBXTeamLogSfTeamJoinType(swift: swiftArg) + return DBXTeamLogEventTypeSfTeamJoin(arg) + case .sfTeamJoinFromOobLink(let swiftArg): + let arg = DBXTeamLogSfTeamJoinFromOobLinkType(swift: swiftArg) + return DBXTeamLogEventTypeSfTeamJoinFromOobLink(arg) + case .sfTeamUninvite(let swiftArg): + let arg = DBXTeamLogSfTeamUninviteType(swift: swiftArg) + return DBXTeamLogEventTypeSfTeamUninvite(arg) + case .sharedContentAddInvitees(let swiftArg): + let arg = DBXTeamLogSharedContentAddInviteesType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentAddInvitees(arg) + case .sharedContentAddLinkExpiry(let swiftArg): + let arg = DBXTeamLogSharedContentAddLinkExpiryType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentAddLinkExpiry(arg) + case .sharedContentAddLinkPassword(let swiftArg): + let arg = DBXTeamLogSharedContentAddLinkPasswordType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentAddLinkPassword(arg) + case .sharedContentAddMember(let swiftArg): + let arg = DBXTeamLogSharedContentAddMemberType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentAddMember(arg) + case .sharedContentChangeDownloadsPolicy(let swiftArg): + let arg = DBXTeamLogSharedContentChangeDownloadsPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentChangeDownloadsPolicy(arg) + case .sharedContentChangeInviteeRole(let swiftArg): + let arg = DBXTeamLogSharedContentChangeInviteeRoleType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentChangeInviteeRole(arg) + case .sharedContentChangeLinkAudience(let swiftArg): + let arg = DBXTeamLogSharedContentChangeLinkAudienceType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentChangeLinkAudience(arg) + case .sharedContentChangeLinkExpiry(let swiftArg): + let arg = DBXTeamLogSharedContentChangeLinkExpiryType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentChangeLinkExpiry(arg) + case .sharedContentChangeLinkPassword(let swiftArg): + let arg = DBXTeamLogSharedContentChangeLinkPasswordType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentChangeLinkPassword(arg) + case .sharedContentChangeMemberRole(let swiftArg): + let arg = DBXTeamLogSharedContentChangeMemberRoleType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentChangeMemberRole(arg) + case .sharedContentChangeViewerInfoPolicy(let swiftArg): + let arg = DBXTeamLogSharedContentChangeViewerInfoPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentChangeViewerInfoPolicy(arg) + case .sharedContentClaimInvitation(let swiftArg): + let arg = DBXTeamLogSharedContentClaimInvitationType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentClaimInvitation(arg) + case .sharedContentCopy(let swiftArg): + let arg = DBXTeamLogSharedContentCopyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentCopy(arg) + case .sharedContentDownload(let swiftArg): + let arg = DBXTeamLogSharedContentDownloadType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentDownload(arg) + case .sharedContentRelinquishMembership(let swiftArg): + let arg = DBXTeamLogSharedContentRelinquishMembershipType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRelinquishMembership(arg) + case .sharedContentRemoveInvitees(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveInviteesType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRemoveInvitees(arg) + case .sharedContentRemoveLinkExpiry(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveLinkExpiryType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRemoveLinkExpiry(arg) + case .sharedContentRemoveLinkPassword(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveLinkPasswordType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRemoveLinkPassword(arg) + case .sharedContentRemoveMember(let swiftArg): + let arg = DBXTeamLogSharedContentRemoveMemberType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRemoveMember(arg) + case .sharedContentRequestAccess(let swiftArg): + let arg = DBXTeamLogSharedContentRequestAccessType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRequestAccess(arg) + case .sharedContentRestoreInvitees(let swiftArg): + let arg = DBXTeamLogSharedContentRestoreInviteesType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRestoreInvitees(arg) + case .sharedContentRestoreMember(let swiftArg): + let arg = DBXTeamLogSharedContentRestoreMemberType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentRestoreMember(arg) + case .sharedContentUnshare(let swiftArg): + let arg = DBXTeamLogSharedContentUnshareType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentUnshare(arg) + case .sharedContentView(let swiftArg): + let arg = DBXTeamLogSharedContentViewType(swift: swiftArg) + return DBXTeamLogEventTypeSharedContentView(arg) + case .sharedFolderChangeLinkPolicy(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeLinkPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderChangeLinkPolicy(arg) + case .sharedFolderChangeMembersInheritancePolicy(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeMembersInheritancePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderChangeMembersInheritancePolicy(arg) + case .sharedFolderChangeMembersManagementPolicy(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeMembersManagementPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderChangeMembersManagementPolicy(arg) + case .sharedFolderChangeMembersPolicy(let swiftArg): + let arg = DBXTeamLogSharedFolderChangeMembersPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderChangeMembersPolicy(arg) + case .sharedFolderCreate(let swiftArg): + let arg = DBXTeamLogSharedFolderCreateType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderCreate(arg) + case .sharedFolderDeclineInvitation(let swiftArg): + let arg = DBXTeamLogSharedFolderDeclineInvitationType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderDeclineInvitation(arg) + case .sharedFolderMount(let swiftArg): + let arg = DBXTeamLogSharedFolderMountType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderMount(arg) + case .sharedFolderNest(let swiftArg): + let arg = DBXTeamLogSharedFolderNestType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderNest(arg) + case .sharedFolderTransferOwnership(let swiftArg): + let arg = DBXTeamLogSharedFolderTransferOwnershipType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderTransferOwnership(arg) + case .sharedFolderUnmount(let swiftArg): + let arg = DBXTeamLogSharedFolderUnmountType(swift: swiftArg) + return DBXTeamLogEventTypeSharedFolderUnmount(arg) + case .sharedLinkAddExpiry(let swiftArg): + let arg = DBXTeamLogSharedLinkAddExpiryType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkAddExpiry(arg) + case .sharedLinkChangeExpiry(let swiftArg): + let arg = DBXTeamLogSharedLinkChangeExpiryType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkChangeExpiry(arg) + case .sharedLinkChangeVisibility(let swiftArg): + let arg = DBXTeamLogSharedLinkChangeVisibilityType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkChangeVisibility(arg) + case .sharedLinkCopy(let swiftArg): + let arg = DBXTeamLogSharedLinkCopyType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkCopy(arg) + case .sharedLinkCreate(let swiftArg): + let arg = DBXTeamLogSharedLinkCreateType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkCreate(arg) + case .sharedLinkDisable(let swiftArg): + let arg = DBXTeamLogSharedLinkDisableType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkDisable(arg) + case .sharedLinkDownload(let swiftArg): + let arg = DBXTeamLogSharedLinkDownloadType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkDownload(arg) + case .sharedLinkRemoveExpiry(let swiftArg): + let arg = DBXTeamLogSharedLinkRemoveExpiryType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkRemoveExpiry(arg) + case .sharedLinkSettingsAddExpiration(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAddExpirationType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsAddExpiration(arg) + case .sharedLinkSettingsAddPassword(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAddPasswordType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsAddPassword(arg) + case .sharedLinkSettingsAllowDownloadDisabled(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAllowDownloadDisabledType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadDisabled(arg) + case .sharedLinkSettingsAllowDownloadEnabled(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsAllowDownloadEnabledType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadEnabled(arg) + case .sharedLinkSettingsChangeAudience(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsChangeAudienceType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsChangeAudience(arg) + case .sharedLinkSettingsChangeExpiration(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsChangeExpirationType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsChangeExpiration(arg) + case .sharedLinkSettingsChangePassword(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsChangePasswordType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsChangePassword(arg) + case .sharedLinkSettingsRemoveExpiration(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsRemoveExpirationType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsRemoveExpiration(arg) + case .sharedLinkSettingsRemovePassword(let swiftArg): + let arg = DBXTeamLogSharedLinkSettingsRemovePasswordType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkSettingsRemovePassword(arg) + case .sharedLinkShare(let swiftArg): + let arg = DBXTeamLogSharedLinkShareType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkShare(arg) + case .sharedLinkView(let swiftArg): + let arg = DBXTeamLogSharedLinkViewType(swift: swiftArg) + return DBXTeamLogEventTypeSharedLinkView(arg) + case .sharedNoteOpened(let swiftArg): + let arg = DBXTeamLogSharedNoteOpenedType(swift: swiftArg) + return DBXTeamLogEventTypeSharedNoteOpened(arg) + case .shmodelDisableDownloads(let swiftArg): + let arg = DBXTeamLogShmodelDisableDownloadsType(swift: swiftArg) + return DBXTeamLogEventTypeShmodelDisableDownloads(arg) + case .shmodelEnableDownloads(let swiftArg): + let arg = DBXTeamLogShmodelEnableDownloadsType(swift: swiftArg) + return DBXTeamLogEventTypeShmodelEnableDownloads(arg) + case .shmodelGroupShare(let swiftArg): + let arg = DBXTeamLogShmodelGroupShareType(swift: swiftArg) + return DBXTeamLogEventTypeShmodelGroupShare(arg) + case .showcaseAccessGranted(let swiftArg): + let arg = DBXTeamLogShowcaseAccessGrantedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseAccessGranted(arg) + case .showcaseAddMember(let swiftArg): + let arg = DBXTeamLogShowcaseAddMemberType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseAddMember(arg) + case .showcaseArchived(let swiftArg): + let arg = DBXTeamLogShowcaseArchivedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseArchived(arg) + case .showcaseCreated(let swiftArg): + let arg = DBXTeamLogShowcaseCreatedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseCreated(arg) + case .showcaseDeleteComment(let swiftArg): + let arg = DBXTeamLogShowcaseDeleteCommentType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseDeleteComment(arg) + case .showcaseEdited(let swiftArg): + let arg = DBXTeamLogShowcaseEditedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseEdited(arg) + case .showcaseEditComment(let swiftArg): + let arg = DBXTeamLogShowcaseEditCommentType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseEditComment(arg) + case .showcaseFileAdded(let swiftArg): + let arg = DBXTeamLogShowcaseFileAddedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseFileAdded(arg) + case .showcaseFileDownload(let swiftArg): + let arg = DBXTeamLogShowcaseFileDownloadType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseFileDownload(arg) + case .showcaseFileRemoved(let swiftArg): + let arg = DBXTeamLogShowcaseFileRemovedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseFileRemoved(arg) + case .showcaseFileView(let swiftArg): + let arg = DBXTeamLogShowcaseFileViewType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseFileView(arg) + case .showcasePermanentlyDeleted(let swiftArg): + let arg = DBXTeamLogShowcasePermanentlyDeletedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcasePermanentlyDeleted(arg) + case .showcasePostComment(let swiftArg): + let arg = DBXTeamLogShowcasePostCommentType(swift: swiftArg) + return DBXTeamLogEventTypeShowcasePostComment(arg) + case .showcaseRemoveMember(let swiftArg): + let arg = DBXTeamLogShowcaseRemoveMemberType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseRemoveMember(arg) + case .showcaseRenamed(let swiftArg): + let arg = DBXTeamLogShowcaseRenamedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseRenamed(arg) + case .showcaseRequestAccess(let swiftArg): + let arg = DBXTeamLogShowcaseRequestAccessType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseRequestAccess(arg) + case .showcaseResolveComment(let swiftArg): + let arg = DBXTeamLogShowcaseResolveCommentType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseResolveComment(arg) + case .showcaseRestored(let swiftArg): + let arg = DBXTeamLogShowcaseRestoredType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseRestored(arg) + case .showcaseTrashed(let swiftArg): + let arg = DBXTeamLogShowcaseTrashedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseTrashed(arg) + case .showcaseTrashedDeprecated(let swiftArg): + let arg = DBXTeamLogShowcaseTrashedDeprecatedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseTrashedDeprecated(arg) + case .showcaseUnresolveComment(let swiftArg): + let arg = DBXTeamLogShowcaseUnresolveCommentType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseUnresolveComment(arg) + case .showcaseUntrashed(let swiftArg): + let arg = DBXTeamLogShowcaseUntrashedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseUntrashed(arg) + case .showcaseUntrashedDeprecated(let swiftArg): + let arg = DBXTeamLogShowcaseUntrashedDeprecatedType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseUntrashedDeprecated(arg) + case .showcaseView(let swiftArg): + let arg = DBXTeamLogShowcaseViewType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseView(arg) + case .ssoAddCert(let swiftArg): + let arg = DBXTeamLogSsoAddCertType(swift: swiftArg) + return DBXTeamLogEventTypeSsoAddCert(arg) + case .ssoAddLoginUrl(let swiftArg): + let arg = DBXTeamLogSsoAddLoginUrlType(swift: swiftArg) + return DBXTeamLogEventTypeSsoAddLoginUrl(arg) + case .ssoAddLogoutUrl(let swiftArg): + let arg = DBXTeamLogSsoAddLogoutUrlType(swift: swiftArg) + return DBXTeamLogEventTypeSsoAddLogoutUrl(arg) + case .ssoChangeCert(let swiftArg): + let arg = DBXTeamLogSsoChangeCertType(swift: swiftArg) + return DBXTeamLogEventTypeSsoChangeCert(arg) + case .ssoChangeLoginUrl(let swiftArg): + let arg = DBXTeamLogSsoChangeLoginUrlType(swift: swiftArg) + return DBXTeamLogEventTypeSsoChangeLoginUrl(arg) + case .ssoChangeLogoutUrl(let swiftArg): + let arg = DBXTeamLogSsoChangeLogoutUrlType(swift: swiftArg) + return DBXTeamLogEventTypeSsoChangeLogoutUrl(arg) + case .ssoChangeSamlIdentityMode(let swiftArg): + let arg = DBXTeamLogSsoChangeSamlIdentityModeType(swift: swiftArg) + return DBXTeamLogEventTypeSsoChangeSamlIdentityMode(arg) + case .ssoRemoveCert(let swiftArg): + let arg = DBXTeamLogSsoRemoveCertType(swift: swiftArg) + return DBXTeamLogEventTypeSsoRemoveCert(arg) + case .ssoRemoveLoginUrl(let swiftArg): + let arg = DBXTeamLogSsoRemoveLoginUrlType(swift: swiftArg) + return DBXTeamLogEventTypeSsoRemoveLoginUrl(arg) + case .ssoRemoveLogoutUrl(let swiftArg): + let arg = DBXTeamLogSsoRemoveLogoutUrlType(swift: swiftArg) + return DBXTeamLogEventTypeSsoRemoveLogoutUrl(arg) + case .teamFolderChangeStatus(let swiftArg): + let arg = DBXTeamLogTeamFolderChangeStatusType(swift: swiftArg) + return DBXTeamLogEventTypeTeamFolderChangeStatus(arg) + case .teamFolderCreate(let swiftArg): + let arg = DBXTeamLogTeamFolderCreateType(swift: swiftArg) + return DBXTeamLogEventTypeTeamFolderCreate(arg) + case .teamFolderDowngrade(let swiftArg): + let arg = DBXTeamLogTeamFolderDowngradeType(swift: swiftArg) + return DBXTeamLogEventTypeTeamFolderDowngrade(arg) + case .teamFolderPermanentlyDelete(let swiftArg): + let arg = DBXTeamLogTeamFolderPermanentlyDeleteType(swift: swiftArg) + return DBXTeamLogEventTypeTeamFolderPermanentlyDelete(arg) + case .teamFolderRename(let swiftArg): + let arg = DBXTeamLogTeamFolderRenameType(swift: swiftArg) + return DBXTeamLogEventTypeTeamFolderRename(arg) + case .teamSelectiveSyncSettingsChanged(let swiftArg): + let arg = DBXTeamLogTeamSelectiveSyncSettingsChangedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamSelectiveSyncSettingsChanged(arg) + case .accountCaptureChangePolicy(let swiftArg): + let arg = DBXTeamLogAccountCaptureChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeAccountCaptureChangePolicy(arg) + case .adminEmailRemindersChanged(let swiftArg): + let arg = DBXTeamLogAdminEmailRemindersChangedType(swift: swiftArg) + return DBXTeamLogEventTypeAdminEmailRemindersChanged(arg) + case .allowDownloadDisabled(let swiftArg): + let arg = DBXTeamLogAllowDownloadDisabledType(swift: swiftArg) + return DBXTeamLogEventTypeAllowDownloadDisabled(arg) + case .allowDownloadEnabled(let swiftArg): + let arg = DBXTeamLogAllowDownloadEnabledType(swift: swiftArg) + return DBXTeamLogEventTypeAllowDownloadEnabled(arg) + case .appPermissionsChanged(let swiftArg): + let arg = DBXTeamLogAppPermissionsChangedType(swift: swiftArg) + return DBXTeamLogEventTypeAppPermissionsChanged(arg) + case .cameraUploadsPolicyChanged(let swiftArg): + let arg = DBXTeamLogCameraUploadsPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeCameraUploadsPolicyChanged(arg) + case .captureTranscriptPolicyChanged(let swiftArg): + let arg = DBXTeamLogCaptureTranscriptPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeCaptureTranscriptPolicyChanged(arg) + case .classificationChangePolicy(let swiftArg): + let arg = DBXTeamLogClassificationChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeClassificationChangePolicy(arg) + case .computerBackupPolicyChanged(let swiftArg): + let arg = DBXTeamLogComputerBackupPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeComputerBackupPolicyChanged(arg) + case .contentAdministrationPolicyChanged(let swiftArg): + let arg = DBXTeamLogContentAdministrationPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeContentAdministrationPolicyChanged(arg) + case .dataPlacementRestrictionChangePolicy(let swiftArg): + let arg = DBXTeamLogDataPlacementRestrictionChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeDataPlacementRestrictionChangePolicy(arg) + case .dataPlacementRestrictionSatisfyPolicy(let swiftArg): + let arg = DBXTeamLogDataPlacementRestrictionSatisfyPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeDataPlacementRestrictionSatisfyPolicy(arg) + case .deviceApprovalsAddException(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsAddExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceApprovalsAddException(arg) + case .deviceApprovalsChangeDesktopPolicy(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeDesktopPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceApprovalsChangeDesktopPolicy(arg) + case .deviceApprovalsChangeMobilePolicy(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeMobilePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceApprovalsChangeMobilePolicy(arg) + case .deviceApprovalsChangeOverageAction(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeOverageActionType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceApprovalsChangeOverageAction(arg) + case .deviceApprovalsChangeUnlinkAction(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsChangeUnlinkActionType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceApprovalsChangeUnlinkAction(arg) + case .deviceApprovalsRemoveException(let swiftArg): + let arg = DBXTeamLogDeviceApprovalsRemoveExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeDeviceApprovalsRemoveException(arg) + case .directoryRestrictionsAddMembers(let swiftArg): + let arg = DBXTeamLogDirectoryRestrictionsAddMembersType(swift: swiftArg) + return DBXTeamLogEventTypeDirectoryRestrictionsAddMembers(arg) + case .directoryRestrictionsRemoveMembers(let swiftArg): + let arg = DBXTeamLogDirectoryRestrictionsRemoveMembersType(swift: swiftArg) + return DBXTeamLogEventTypeDirectoryRestrictionsRemoveMembers(arg) + case .dropboxPasswordsPolicyChanged(let swiftArg): + let arg = DBXTeamLogDropboxPasswordsPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeDropboxPasswordsPolicyChanged(arg) + case .emailIngestPolicyChanged(let swiftArg): + let arg = DBXTeamLogEmailIngestPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeEmailIngestPolicyChanged(arg) + case .emmAddException(let swiftArg): + let arg = DBXTeamLogEmmAddExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeEmmAddException(arg) + case .emmChangePolicy(let swiftArg): + let arg = DBXTeamLogEmmChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeEmmChangePolicy(arg) + case .emmRemoveException(let swiftArg): + let arg = DBXTeamLogEmmRemoveExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeEmmRemoveException(arg) + case .extendedVersionHistoryChangePolicy(let swiftArg): + let arg = DBXTeamLogExtendedVersionHistoryChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeExtendedVersionHistoryChangePolicy(arg) + case .externalDriveBackupPolicyChanged(let swiftArg): + let arg = DBXTeamLogExternalDriveBackupPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeExternalDriveBackupPolicyChanged(arg) + case .fileCommentsChangePolicy(let swiftArg): + let arg = DBXTeamLogFileCommentsChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeFileCommentsChangePolicy(arg) + case .fileLockingPolicyChanged(let swiftArg): + let arg = DBXTeamLogFileLockingPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeFileLockingPolicyChanged(arg) + case .fileProviderMigrationPolicyChanged(let swiftArg): + let arg = DBXTeamLogFileProviderMigrationPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeFileProviderMigrationPolicyChanged(arg) + case .fileRequestsChangePolicy(let swiftArg): + let arg = DBXTeamLogFileRequestsChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestsChangePolicy(arg) + case .fileRequestsEmailsEnabled(let swiftArg): + let arg = DBXTeamLogFileRequestsEmailsEnabledType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestsEmailsEnabled(arg) + case .fileRequestsEmailsRestrictedToTeamOnly(let swiftArg): + let arg = DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyType(swift: swiftArg) + return DBXTeamLogEventTypeFileRequestsEmailsRestrictedToTeamOnly(arg) + case .fileTransfersPolicyChanged(let swiftArg): + let arg = DBXTeamLogFileTransfersPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeFileTransfersPolicyChanged(arg) + case .folderLinkRestrictionPolicyChanged(let swiftArg): + let arg = DBXTeamLogFolderLinkRestrictionPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeFolderLinkRestrictionPolicyChanged(arg) + case .googleSsoChangePolicy(let swiftArg): + let arg = DBXTeamLogGoogleSsoChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeGoogleSsoChangePolicy(arg) + case .groupUserManagementChangePolicy(let swiftArg): + let arg = DBXTeamLogGroupUserManagementChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeGroupUserManagementChangePolicy(arg) + case .integrationPolicyChanged(let swiftArg): + let arg = DBXTeamLogIntegrationPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeIntegrationPolicyChanged(arg) + case .inviteAcceptanceEmailPolicyChanged(let swiftArg): + let arg = DBXTeamLogInviteAcceptanceEmailPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeInviteAcceptanceEmailPolicyChanged(arg) + case .memberRequestsChangePolicy(let swiftArg): + let arg = DBXTeamLogMemberRequestsChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeMemberRequestsChangePolicy(arg) + case .memberSendInvitePolicyChanged(let swiftArg): + let arg = DBXTeamLogMemberSendInvitePolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSendInvitePolicyChanged(arg) + case .memberSpaceLimitsAddException(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsAddExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsAddException(arg) + case .memberSpaceLimitsChangeCapsTypePolicy(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsChangeCapsTypePolicy(arg) + case .memberSpaceLimitsChangePolicy(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsChangePolicy(arg) + case .memberSpaceLimitsRemoveException(let swiftArg): + let arg = DBXTeamLogMemberSpaceLimitsRemoveExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSpaceLimitsRemoveException(arg) + case .memberSuggestionsChangePolicy(let swiftArg): + let arg = DBXTeamLogMemberSuggestionsChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeMemberSuggestionsChangePolicy(arg) + case .microsoftOfficeAddinChangePolicy(let swiftArg): + let arg = DBXTeamLogMicrosoftOfficeAddinChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeMicrosoftOfficeAddinChangePolicy(arg) + case .networkControlChangePolicy(let swiftArg): + let arg = DBXTeamLogNetworkControlChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeNetworkControlChangePolicy(arg) + case .paperChangeDeploymentPolicy(let swiftArg): + let arg = DBXTeamLogPaperChangeDeploymentPolicyType(swift: swiftArg) + return DBXTeamLogEventTypePaperChangeDeploymentPolicy(arg) + case .paperChangeMemberLinkPolicy(let swiftArg): + let arg = DBXTeamLogPaperChangeMemberLinkPolicyType(swift: swiftArg) + return DBXTeamLogEventTypePaperChangeMemberLinkPolicy(arg) + case .paperChangeMemberPolicy(let swiftArg): + let arg = DBXTeamLogPaperChangeMemberPolicyType(swift: swiftArg) + return DBXTeamLogEventTypePaperChangeMemberPolicy(arg) + case .paperChangePolicy(let swiftArg): + let arg = DBXTeamLogPaperChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypePaperChangePolicy(arg) + case .paperDefaultFolderPolicyChanged(let swiftArg): + let arg = DBXTeamLogPaperDefaultFolderPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypePaperDefaultFolderPolicyChanged(arg) + case .paperDesktopPolicyChanged(let swiftArg): + let arg = DBXTeamLogPaperDesktopPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypePaperDesktopPolicyChanged(arg) + case .paperEnabledUsersGroupAddition(let swiftArg): + let arg = DBXTeamLogPaperEnabledUsersGroupAdditionType(swift: swiftArg) + return DBXTeamLogEventTypePaperEnabledUsersGroupAddition(arg) + case .paperEnabledUsersGroupRemoval(let swiftArg): + let arg = DBXTeamLogPaperEnabledUsersGroupRemovalType(swift: swiftArg) + return DBXTeamLogEventTypePaperEnabledUsersGroupRemoval(arg) + case .passwordStrengthRequirementsChangePolicy(let swiftArg): + let arg = DBXTeamLogPasswordStrengthRequirementsChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypePasswordStrengthRequirementsChangePolicy(arg) + case .permanentDeleteChangePolicy(let swiftArg): + let arg = DBXTeamLogPermanentDeleteChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypePermanentDeleteChangePolicy(arg) + case .resellerSupportChangePolicy(let swiftArg): + let arg = DBXTeamLogResellerSupportChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeResellerSupportChangePolicy(arg) + case .rewindPolicyChanged(let swiftArg): + let arg = DBXTeamLogRewindPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeRewindPolicyChanged(arg) + case .sendForSignaturePolicyChanged(let swiftArg): + let arg = DBXTeamLogSendForSignaturePolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeSendForSignaturePolicyChanged(arg) + case .sharingChangeFolderJoinPolicy(let swiftArg): + let arg = DBXTeamLogSharingChangeFolderJoinPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharingChangeFolderJoinPolicy(arg) + case .sharingChangeLinkAllowChangeExpirationPolicy(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharingChangeLinkAllowChangeExpirationPolicy(arg) + case .sharingChangeLinkDefaultExpirationPolicy(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkDefaultExpirationPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharingChangeLinkDefaultExpirationPolicy(arg) + case .sharingChangeLinkEnforcePasswordPolicy(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkEnforcePasswordPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharingChangeLinkEnforcePasswordPolicy(arg) + case .sharingChangeLinkPolicy(let swiftArg): + let arg = DBXTeamLogSharingChangeLinkPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharingChangeLinkPolicy(arg) + case .sharingChangeMemberPolicy(let swiftArg): + let arg = DBXTeamLogSharingChangeMemberPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSharingChangeMemberPolicy(arg) + case .showcaseChangeDownloadPolicy(let swiftArg): + let arg = DBXTeamLogShowcaseChangeDownloadPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseChangeDownloadPolicy(arg) + case .showcaseChangeEnabledPolicy(let swiftArg): + let arg = DBXTeamLogShowcaseChangeEnabledPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseChangeEnabledPolicy(arg) + case .showcaseChangeExternalSharingPolicy(let swiftArg): + let arg = DBXTeamLogShowcaseChangeExternalSharingPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeShowcaseChangeExternalSharingPolicy(arg) + case .smarterSmartSyncPolicyChanged(let swiftArg): + let arg = DBXTeamLogSmarterSmartSyncPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeSmarterSmartSyncPolicyChanged(arg) + case .smartSyncChangePolicy(let swiftArg): + let arg = DBXTeamLogSmartSyncChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSmartSyncChangePolicy(arg) + case .smartSyncNotOptOut(let swiftArg): + let arg = DBXTeamLogSmartSyncNotOptOutType(swift: swiftArg) + return DBXTeamLogEventTypeSmartSyncNotOptOut(arg) + case .smartSyncOptOut(let swiftArg): + let arg = DBXTeamLogSmartSyncOptOutType(swift: swiftArg) + return DBXTeamLogEventTypeSmartSyncOptOut(arg) + case .ssoChangePolicy(let swiftArg): + let arg = DBXTeamLogSsoChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeSsoChangePolicy(arg) + case .teamBrandingPolicyChanged(let swiftArg): + let arg = DBXTeamLogTeamBrandingPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamBrandingPolicyChanged(arg) + case .teamExtensionsPolicyChanged(let swiftArg): + let arg = DBXTeamLogTeamExtensionsPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamExtensionsPolicyChanged(arg) + case .teamSelectiveSyncPolicyChanged(let swiftArg): + let arg = DBXTeamLogTeamSelectiveSyncPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamSelectiveSyncPolicyChanged(arg) + case .teamSharingWhitelistSubjectsChanged(let swiftArg): + let arg = DBXTeamLogTeamSharingWhitelistSubjectsChangedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamSharingWhitelistSubjectsChanged(arg) + case .tfaAddException(let swiftArg): + let arg = DBXTeamLogTfaAddExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeTfaAddException(arg) + case .tfaChangePolicy(let swiftArg): + let arg = DBXTeamLogTfaChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeTfaChangePolicy(arg) + case .tfaRemoveException(let swiftArg): + let arg = DBXTeamLogTfaRemoveExceptionType(swift: swiftArg) + return DBXTeamLogEventTypeTfaRemoveException(arg) + case .twoAccountChangePolicy(let swiftArg): + let arg = DBXTeamLogTwoAccountChangePolicyType(swift: swiftArg) + return DBXTeamLogEventTypeTwoAccountChangePolicy(arg) + case .viewerInfoPolicyChanged(let swiftArg): + let arg = DBXTeamLogViewerInfoPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeViewerInfoPolicyChanged(arg) + case .watermarkingPolicyChanged(let swiftArg): + let arg = DBXTeamLogWatermarkingPolicyChangedType(swift: swiftArg) + return DBXTeamLogEventTypeWatermarkingPolicyChanged(arg) + case .webSessionsChangeActiveSessionLimit(let swiftArg): + let arg = DBXTeamLogWebSessionsChangeActiveSessionLimitType(swift: swiftArg) + return DBXTeamLogEventTypeWebSessionsChangeActiveSessionLimit(arg) + case .webSessionsChangeFixedLengthPolicy(let swiftArg): + let arg = DBXTeamLogWebSessionsChangeFixedLengthPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeWebSessionsChangeFixedLengthPolicy(arg) + case .webSessionsChangeIdleLengthPolicy(let swiftArg): + let arg = DBXTeamLogWebSessionsChangeIdleLengthPolicyType(swift: swiftArg) + return DBXTeamLogEventTypeWebSessionsChangeIdleLengthPolicy(arg) + case .dataResidencyMigrationRequestSuccessful(let swiftArg): + let arg = DBXTeamLogDataResidencyMigrationRequestSuccessfulType(swift: swiftArg) + return DBXTeamLogEventTypeDataResidencyMigrationRequestSuccessful(arg) + case .dataResidencyMigrationRequestUnsuccessful(let swiftArg): + let arg = DBXTeamLogDataResidencyMigrationRequestUnsuccessfulType(swift: swiftArg) + return DBXTeamLogEventTypeDataResidencyMigrationRequestUnsuccessful(arg) + case .teamMergeFrom(let swiftArg): + let arg = DBXTeamLogTeamMergeFromType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeFrom(arg) + case .teamMergeTo(let swiftArg): + let arg = DBXTeamLogTeamMergeToType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeTo(arg) + case .teamProfileAddBackground(let swiftArg): + let arg = DBXTeamLogTeamProfileAddBackgroundType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileAddBackground(arg) + case .teamProfileAddLogo(let swiftArg): + let arg = DBXTeamLogTeamProfileAddLogoType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileAddLogo(arg) + case .teamProfileChangeBackground(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeBackgroundType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileChangeBackground(arg) + case .teamProfileChangeDefaultLanguage(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeDefaultLanguageType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileChangeDefaultLanguage(arg) + case .teamProfileChangeLogo(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeLogoType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileChangeLogo(arg) + case .teamProfileChangeName(let swiftArg): + let arg = DBXTeamLogTeamProfileChangeNameType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileChangeName(arg) + case .teamProfileRemoveBackground(let swiftArg): + let arg = DBXTeamLogTeamProfileRemoveBackgroundType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileRemoveBackground(arg) + case .teamProfileRemoveLogo(let swiftArg): + let arg = DBXTeamLogTeamProfileRemoveLogoType(swift: swiftArg) + return DBXTeamLogEventTypeTeamProfileRemoveLogo(arg) + case .tfaAddBackupPhone(let swiftArg): + let arg = DBXTeamLogTfaAddBackupPhoneType(swift: swiftArg) + return DBXTeamLogEventTypeTfaAddBackupPhone(arg) + case .tfaAddSecurityKey(let swiftArg): + let arg = DBXTeamLogTfaAddSecurityKeyType(swift: swiftArg) + return DBXTeamLogEventTypeTfaAddSecurityKey(arg) + case .tfaChangeBackupPhone(let swiftArg): + let arg = DBXTeamLogTfaChangeBackupPhoneType(swift: swiftArg) + return DBXTeamLogEventTypeTfaChangeBackupPhone(arg) + case .tfaChangeStatus(let swiftArg): + let arg = DBXTeamLogTfaChangeStatusType(swift: swiftArg) + return DBXTeamLogEventTypeTfaChangeStatus(arg) + case .tfaRemoveBackupPhone(let swiftArg): + let arg = DBXTeamLogTfaRemoveBackupPhoneType(swift: swiftArg) + return DBXTeamLogEventTypeTfaRemoveBackupPhone(arg) + case .tfaRemoveSecurityKey(let swiftArg): + let arg = DBXTeamLogTfaRemoveSecurityKeyType(swift: swiftArg) + return DBXTeamLogEventTypeTfaRemoveSecurityKey(arg) + case .tfaReset(let swiftArg): + let arg = DBXTeamLogTfaResetType(swift: swiftArg) + return DBXTeamLogEventTypeTfaReset(arg) + case .changedEnterpriseAdminRole(let swiftArg): + let arg = DBXTeamLogChangedEnterpriseAdminRoleType(swift: swiftArg) + return DBXTeamLogEventTypeChangedEnterpriseAdminRole(arg) + case .changedEnterpriseConnectedTeamStatus(let swiftArg): + let arg = DBXTeamLogChangedEnterpriseConnectedTeamStatusType(swift: swiftArg) + return DBXTeamLogEventTypeChangedEnterpriseConnectedTeamStatus(arg) + case .endedEnterpriseAdminSession(let swiftArg): + let arg = DBXTeamLogEndedEnterpriseAdminSessionType(swift: swiftArg) + return DBXTeamLogEventTypeEndedEnterpriseAdminSession(arg) + case .endedEnterpriseAdminSessionDeprecated(let swiftArg): + let arg = DBXTeamLogEndedEnterpriseAdminSessionDeprecatedType(swift: swiftArg) + return DBXTeamLogEventTypeEndedEnterpriseAdminSessionDeprecated(arg) + case .enterpriseSettingsLocking(let swiftArg): + let arg = DBXTeamLogEnterpriseSettingsLockingType(swift: swiftArg) + return DBXTeamLogEventTypeEnterpriseSettingsLocking(arg) + case .guestAdminChangeStatus(let swiftArg): + let arg = DBXTeamLogGuestAdminChangeStatusType(swift: swiftArg) + return DBXTeamLogEventTypeGuestAdminChangeStatus(arg) + case .startedEnterpriseAdminSession(let swiftArg): + let arg = DBXTeamLogStartedEnterpriseAdminSessionType(swift: swiftArg) + return DBXTeamLogEventTypeStartedEnterpriseAdminSession(arg) + case .teamMergeRequestAccepted(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAcceptedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestAccepted(arg) + case .teamMergeRequestAcceptedShownToPrimaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToPrimaryTeam(arg) + case .teamMergeRequestAcceptedShownToSecondaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToSecondaryTeam(arg) + case .teamMergeRequestAutoCanceled(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestAutoCanceledType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestAutoCanceled(arg) + case .teamMergeRequestCanceled(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestCanceledType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestCanceled(arg) + case .teamMergeRequestCanceledShownToPrimaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestCanceledShownToPrimaryTeam(arg) + case .teamMergeRequestCanceledShownToSecondaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestCanceledShownToSecondaryTeam(arg) + case .teamMergeRequestExpired(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestExpiredType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestExpired(arg) + case .teamMergeRequestExpiredShownToPrimaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestExpiredShownToPrimaryTeam(arg) + case .teamMergeRequestExpiredShownToSecondaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestExpiredShownToSecondaryTeam(arg) + case .teamMergeRequestRejectedShownToPrimaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestRejectedShownToPrimaryTeam(arg) + case .teamMergeRequestRejectedShownToSecondaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestRejectedShownToSecondaryTeam(arg) + case .teamMergeRequestReminder(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestReminderType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestReminder(arg) + case .teamMergeRequestReminderShownToPrimaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestReminderShownToPrimaryTeam(arg) + case .teamMergeRequestReminderShownToSecondaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestReminderShownToSecondaryTeam(arg) + case .teamMergeRequestRevoked(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestRevokedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestRevoked(arg) + case .teamMergeRequestSentShownToPrimaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestSentShownToPrimaryTeam(arg) + case .teamMergeRequestSentShownToSecondaryTeam(let swiftArg): + let arg = DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamType(swift: swiftArg) + return DBXTeamLogEventTypeTeamMergeRequestSentShownToSecondaryTeam(arg) + case .other: + return DBXTeamLogEventTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdminAlertingAlertStateChanged: DBXTeamLogEventTypeAdminAlertingAlertStateChanged? { + self as? DBXTeamLogEventTypeAdminAlertingAlertStateChanged + } + + @objc + public var asAdminAlertingChangedAlertConfig: DBXTeamLogEventTypeAdminAlertingChangedAlertConfig? { + self as? DBXTeamLogEventTypeAdminAlertingChangedAlertConfig + } + + @objc + public var asAdminAlertingTriggeredAlert: DBXTeamLogEventTypeAdminAlertingTriggeredAlert? { + self as? DBXTeamLogEventTypeAdminAlertingTriggeredAlert + } + + @objc + public var asRansomwareRestoreProcessCompleted: DBXTeamLogEventTypeRansomwareRestoreProcessCompleted? { + self as? DBXTeamLogEventTypeRansomwareRestoreProcessCompleted + } + + @objc + public var asRansomwareRestoreProcessStarted: DBXTeamLogEventTypeRansomwareRestoreProcessStarted? { + self as? DBXTeamLogEventTypeRansomwareRestoreProcessStarted + } + + @objc + public var asAppBlockedByPermissions: DBXTeamLogEventTypeAppBlockedByPermissions? { + self as? DBXTeamLogEventTypeAppBlockedByPermissions + } + + @objc + public var asAppLinkTeam: DBXTeamLogEventTypeAppLinkTeam? { + self as? DBXTeamLogEventTypeAppLinkTeam + } + + @objc + public var asAppLinkUser: DBXTeamLogEventTypeAppLinkUser? { + self as? DBXTeamLogEventTypeAppLinkUser + } + + @objc + public var asAppUnlinkTeam: DBXTeamLogEventTypeAppUnlinkTeam? { + self as? DBXTeamLogEventTypeAppUnlinkTeam + } + + @objc + public var asAppUnlinkUser: DBXTeamLogEventTypeAppUnlinkUser? { + self as? DBXTeamLogEventTypeAppUnlinkUser + } + + @objc + public var asIntegrationConnected: DBXTeamLogEventTypeIntegrationConnected? { + self as? DBXTeamLogEventTypeIntegrationConnected + } + + @objc + public var asIntegrationDisconnected: DBXTeamLogEventTypeIntegrationDisconnected? { + self as? DBXTeamLogEventTypeIntegrationDisconnected + } + + @objc + public var asFileAddComment: DBXTeamLogEventTypeFileAddComment? { + self as? DBXTeamLogEventTypeFileAddComment + } + + @objc + public var asFileChangeCommentSubscription: DBXTeamLogEventTypeFileChangeCommentSubscription? { + self as? DBXTeamLogEventTypeFileChangeCommentSubscription + } + + @objc + public var asFileDeleteComment: DBXTeamLogEventTypeFileDeleteComment? { + self as? DBXTeamLogEventTypeFileDeleteComment + } + + @objc + public var asFileEditComment: DBXTeamLogEventTypeFileEditComment? { + self as? DBXTeamLogEventTypeFileEditComment + } + + @objc + public var asFileLikeComment: DBXTeamLogEventTypeFileLikeComment? { + self as? DBXTeamLogEventTypeFileLikeComment + } + + @objc + public var asFileResolveComment: DBXTeamLogEventTypeFileResolveComment? { + self as? DBXTeamLogEventTypeFileResolveComment + } + + @objc + public var asFileUnlikeComment: DBXTeamLogEventTypeFileUnlikeComment? { + self as? DBXTeamLogEventTypeFileUnlikeComment + } + + @objc + public var asFileUnresolveComment: DBXTeamLogEventTypeFileUnresolveComment? { + self as? DBXTeamLogEventTypeFileUnresolveComment + } + + @objc + public var asGovernancePolicyAddFolders: DBXTeamLogEventTypeGovernancePolicyAddFolders? { + self as? DBXTeamLogEventTypeGovernancePolicyAddFolders + } + + @objc + public var asGovernancePolicyAddFolderFailed: DBXTeamLogEventTypeGovernancePolicyAddFolderFailed? { + self as? DBXTeamLogEventTypeGovernancePolicyAddFolderFailed + } + + @objc + public var asGovernancePolicyContentDisposed: DBXTeamLogEventTypeGovernancePolicyContentDisposed? { + self as? DBXTeamLogEventTypeGovernancePolicyContentDisposed + } + + @objc + public var asGovernancePolicyCreate: DBXTeamLogEventTypeGovernancePolicyCreate? { + self as? DBXTeamLogEventTypeGovernancePolicyCreate + } + + @objc + public var asGovernancePolicyDelete: DBXTeamLogEventTypeGovernancePolicyDelete? { + self as? DBXTeamLogEventTypeGovernancePolicyDelete + } + + @objc + public var asGovernancePolicyEditDetails: DBXTeamLogEventTypeGovernancePolicyEditDetails? { + self as? DBXTeamLogEventTypeGovernancePolicyEditDetails + } + + @objc + public var asGovernancePolicyEditDuration: DBXTeamLogEventTypeGovernancePolicyEditDuration? { + self as? DBXTeamLogEventTypeGovernancePolicyEditDuration + } + + @objc + public var asGovernancePolicyExportCreated: DBXTeamLogEventTypeGovernancePolicyExportCreated? { + self as? DBXTeamLogEventTypeGovernancePolicyExportCreated + } + + @objc + public var asGovernancePolicyExportRemoved: DBXTeamLogEventTypeGovernancePolicyExportRemoved? { + self as? DBXTeamLogEventTypeGovernancePolicyExportRemoved + } + + @objc + public var asGovernancePolicyRemoveFolders: DBXTeamLogEventTypeGovernancePolicyRemoveFolders? { + self as? DBXTeamLogEventTypeGovernancePolicyRemoveFolders + } + + @objc + public var asGovernancePolicyReportCreated: DBXTeamLogEventTypeGovernancePolicyReportCreated? { + self as? DBXTeamLogEventTypeGovernancePolicyReportCreated + } + + @objc + public var asGovernancePolicyZipPartDownloaded: DBXTeamLogEventTypeGovernancePolicyZipPartDownloaded? { + self as? DBXTeamLogEventTypeGovernancePolicyZipPartDownloaded + } + + @objc + public var asLegalHoldsActivateAHold: DBXTeamLogEventTypeLegalHoldsActivateAHold? { + self as? DBXTeamLogEventTypeLegalHoldsActivateAHold + } + + @objc + public var asLegalHoldsAddMembers: DBXTeamLogEventTypeLegalHoldsAddMembers? { + self as? DBXTeamLogEventTypeLegalHoldsAddMembers + } + + @objc + public var asLegalHoldsChangeHoldDetails: DBXTeamLogEventTypeLegalHoldsChangeHoldDetails? { + self as? DBXTeamLogEventTypeLegalHoldsChangeHoldDetails + } + + @objc + public var asLegalHoldsChangeHoldName: DBXTeamLogEventTypeLegalHoldsChangeHoldName? { + self as? DBXTeamLogEventTypeLegalHoldsChangeHoldName + } + + @objc + public var asLegalHoldsExportAHold: DBXTeamLogEventTypeLegalHoldsExportAHold? { + self as? DBXTeamLogEventTypeLegalHoldsExportAHold + } + + @objc + public var asLegalHoldsExportCancelled: DBXTeamLogEventTypeLegalHoldsExportCancelled? { + self as? DBXTeamLogEventTypeLegalHoldsExportCancelled + } + + @objc + public var asLegalHoldsExportDownloaded: DBXTeamLogEventTypeLegalHoldsExportDownloaded? { + self as? DBXTeamLogEventTypeLegalHoldsExportDownloaded + } + + @objc + public var asLegalHoldsExportRemoved: DBXTeamLogEventTypeLegalHoldsExportRemoved? { + self as? DBXTeamLogEventTypeLegalHoldsExportRemoved + } + + @objc + public var asLegalHoldsReleaseAHold: DBXTeamLogEventTypeLegalHoldsReleaseAHold? { + self as? DBXTeamLogEventTypeLegalHoldsReleaseAHold + } + + @objc + public var asLegalHoldsRemoveMembers: DBXTeamLogEventTypeLegalHoldsRemoveMembers? { + self as? DBXTeamLogEventTypeLegalHoldsRemoveMembers + } + + @objc + public var asLegalHoldsReportAHold: DBXTeamLogEventTypeLegalHoldsReportAHold? { + self as? DBXTeamLogEventTypeLegalHoldsReportAHold + } + + @objc + public var asDeviceChangeIpDesktop: DBXTeamLogEventTypeDeviceChangeIpDesktop? { + self as? DBXTeamLogEventTypeDeviceChangeIpDesktop + } + + @objc + public var asDeviceChangeIpMobile: DBXTeamLogEventTypeDeviceChangeIpMobile? { + self as? DBXTeamLogEventTypeDeviceChangeIpMobile + } + + @objc + public var asDeviceChangeIpWeb: DBXTeamLogEventTypeDeviceChangeIpWeb? { + self as? DBXTeamLogEventTypeDeviceChangeIpWeb + } + + @objc + public var asDeviceDeleteOnUnlinkFail: DBXTeamLogEventTypeDeviceDeleteOnUnlinkFail? { + self as? DBXTeamLogEventTypeDeviceDeleteOnUnlinkFail + } + + @objc + public var asDeviceDeleteOnUnlinkSuccess: DBXTeamLogEventTypeDeviceDeleteOnUnlinkSuccess? { + self as? DBXTeamLogEventTypeDeviceDeleteOnUnlinkSuccess + } + + @objc + public var asDeviceLinkFail: DBXTeamLogEventTypeDeviceLinkFail? { + self as? DBXTeamLogEventTypeDeviceLinkFail + } + + @objc + public var asDeviceLinkSuccess: DBXTeamLogEventTypeDeviceLinkSuccess? { + self as? DBXTeamLogEventTypeDeviceLinkSuccess + } + + @objc + public var asDeviceManagementDisabled: DBXTeamLogEventTypeDeviceManagementDisabled? { + self as? DBXTeamLogEventTypeDeviceManagementDisabled + } + + @objc + public var asDeviceManagementEnabled: DBXTeamLogEventTypeDeviceManagementEnabled? { + self as? DBXTeamLogEventTypeDeviceManagementEnabled + } + + @objc + public var asDeviceSyncBackupStatusChanged: DBXTeamLogEventTypeDeviceSyncBackupStatusChanged? { + self as? DBXTeamLogEventTypeDeviceSyncBackupStatusChanged + } + + @objc + public var asDeviceUnlink: DBXTeamLogEventTypeDeviceUnlink? { + self as? DBXTeamLogEventTypeDeviceUnlink + } + + @objc + public var asDropboxPasswordsExported: DBXTeamLogEventTypeDropboxPasswordsExported? { + self as? DBXTeamLogEventTypeDropboxPasswordsExported + } + + @objc + public var asDropboxPasswordsNewDeviceEnrolled: DBXTeamLogEventTypeDropboxPasswordsNewDeviceEnrolled? { + self as? DBXTeamLogEventTypeDropboxPasswordsNewDeviceEnrolled + } + + @objc + public var asEmmRefreshAuthToken: DBXTeamLogEventTypeEmmRefreshAuthToken? { + self as? DBXTeamLogEventTypeEmmRefreshAuthToken + } + + @objc + public var asExternalDriveBackupEligibilityStatusChecked: DBXTeamLogEventTypeExternalDriveBackupEligibilityStatusChecked? { + self as? DBXTeamLogEventTypeExternalDriveBackupEligibilityStatusChecked + } + + @objc + public var asExternalDriveBackupStatusChanged: DBXTeamLogEventTypeExternalDriveBackupStatusChanged? { + self as? DBXTeamLogEventTypeExternalDriveBackupStatusChanged + } + + @objc + public var asAccountCaptureChangeAvailability: DBXTeamLogEventTypeAccountCaptureChangeAvailability? { + self as? DBXTeamLogEventTypeAccountCaptureChangeAvailability + } + + @objc + public var asAccountCaptureMigrateAccount: DBXTeamLogEventTypeAccountCaptureMigrateAccount? { + self as? DBXTeamLogEventTypeAccountCaptureMigrateAccount + } + + @objc + public var asAccountCaptureNotificationEmailsSent: DBXTeamLogEventTypeAccountCaptureNotificationEmailsSent? { + self as? DBXTeamLogEventTypeAccountCaptureNotificationEmailsSent + } + + @objc + public var asAccountCaptureRelinquishAccount: DBXTeamLogEventTypeAccountCaptureRelinquishAccount? { + self as? DBXTeamLogEventTypeAccountCaptureRelinquishAccount + } + + @objc + public var asDisabledDomainInvites: DBXTeamLogEventTypeDisabledDomainInvites? { + self as? DBXTeamLogEventTypeDisabledDomainInvites + } + + @objc + public var asDomainInvitesApproveRequestToJoinTeam: DBXTeamLogEventTypeDomainInvitesApproveRequestToJoinTeam? { + self as? DBXTeamLogEventTypeDomainInvitesApproveRequestToJoinTeam + } + + @objc + public var asDomainInvitesDeclineRequestToJoinTeam: DBXTeamLogEventTypeDomainInvitesDeclineRequestToJoinTeam? { + self as? DBXTeamLogEventTypeDomainInvitesDeclineRequestToJoinTeam + } + + @objc + public var asDomainInvitesEmailExistingUsers: DBXTeamLogEventTypeDomainInvitesEmailExistingUsers? { + self as? DBXTeamLogEventTypeDomainInvitesEmailExistingUsers + } + + @objc + public var asDomainInvitesRequestToJoinTeam: DBXTeamLogEventTypeDomainInvitesRequestToJoinTeam? { + self as? DBXTeamLogEventTypeDomainInvitesRequestToJoinTeam + } + + @objc + public var asDomainInvitesSetInviteNewUserPrefToNo: DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToNo? { + self as? DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToNo + } + + @objc + public var asDomainInvitesSetInviteNewUserPrefToYes: DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToYes? { + self as? DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToYes + } + + @objc + public var asDomainVerificationAddDomainFail: DBXTeamLogEventTypeDomainVerificationAddDomainFail? { + self as? DBXTeamLogEventTypeDomainVerificationAddDomainFail + } + + @objc + public var asDomainVerificationAddDomainSuccess: DBXTeamLogEventTypeDomainVerificationAddDomainSuccess? { + self as? DBXTeamLogEventTypeDomainVerificationAddDomainSuccess + } + + @objc + public var asDomainVerificationRemoveDomain: DBXTeamLogEventTypeDomainVerificationRemoveDomain? { + self as? DBXTeamLogEventTypeDomainVerificationRemoveDomain + } + + @objc + public var asEnabledDomainInvites: DBXTeamLogEventTypeEnabledDomainInvites? { + self as? DBXTeamLogEventTypeEnabledDomainInvites + } + + @objc + public var asTeamEncryptionKeyCancelKeyDeletion: DBXTeamLogEventTypeTeamEncryptionKeyCancelKeyDeletion? { + self as? DBXTeamLogEventTypeTeamEncryptionKeyCancelKeyDeletion + } + + @objc + public var asTeamEncryptionKeyCreateKey: DBXTeamLogEventTypeTeamEncryptionKeyCreateKey? { + self as? DBXTeamLogEventTypeTeamEncryptionKeyCreateKey + } + + @objc + public var asTeamEncryptionKeyDeleteKey: DBXTeamLogEventTypeTeamEncryptionKeyDeleteKey? { + self as? DBXTeamLogEventTypeTeamEncryptionKeyDeleteKey + } + + @objc + public var asTeamEncryptionKeyDisableKey: DBXTeamLogEventTypeTeamEncryptionKeyDisableKey? { + self as? DBXTeamLogEventTypeTeamEncryptionKeyDisableKey + } + + @objc + public var asTeamEncryptionKeyEnableKey: DBXTeamLogEventTypeTeamEncryptionKeyEnableKey? { + self as? DBXTeamLogEventTypeTeamEncryptionKeyEnableKey + } + + @objc + public var asTeamEncryptionKeyRotateKey: DBXTeamLogEventTypeTeamEncryptionKeyRotateKey? { + self as? DBXTeamLogEventTypeTeamEncryptionKeyRotateKey + } + + @objc + public var asTeamEncryptionKeyScheduleKeyDeletion: DBXTeamLogEventTypeTeamEncryptionKeyScheduleKeyDeletion? { + self as? DBXTeamLogEventTypeTeamEncryptionKeyScheduleKeyDeletion + } + + @objc + public var asApplyNamingConvention: DBXTeamLogEventTypeApplyNamingConvention? { + self as? DBXTeamLogEventTypeApplyNamingConvention + } + + @objc + public var asCreateFolder: DBXTeamLogEventTypeCreateFolder? { + self as? DBXTeamLogEventTypeCreateFolder + } + + @objc + public var asFileAdd: DBXTeamLogEventTypeFileAdd? { + self as? DBXTeamLogEventTypeFileAdd + } + + @objc + public var asFileAddFromAutomation: DBXTeamLogEventTypeFileAddFromAutomation? { + self as? DBXTeamLogEventTypeFileAddFromAutomation + } + + @objc + public var asFileCopy: DBXTeamLogEventTypeFileCopy? { + self as? DBXTeamLogEventTypeFileCopy + } + + @objc + public var asFileDelete: DBXTeamLogEventTypeFileDelete? { + self as? DBXTeamLogEventTypeFileDelete + } + + @objc + public var asFileDownload: DBXTeamLogEventTypeFileDownload? { + self as? DBXTeamLogEventTypeFileDownload + } + + @objc + public var asFileEdit: DBXTeamLogEventTypeFileEdit? { + self as? DBXTeamLogEventTypeFileEdit + } + + @objc + public var asFileGetCopyReference: DBXTeamLogEventTypeFileGetCopyReference? { + self as? DBXTeamLogEventTypeFileGetCopyReference + } + + @objc + public var asFileLockingLockStatusChanged: DBXTeamLogEventTypeFileLockingLockStatusChanged? { + self as? DBXTeamLogEventTypeFileLockingLockStatusChanged + } + + @objc + public var asFileMove: DBXTeamLogEventTypeFileMove? { + self as? DBXTeamLogEventTypeFileMove + } + + @objc + public var asFilePermanentlyDelete: DBXTeamLogEventTypeFilePermanentlyDelete? { + self as? DBXTeamLogEventTypeFilePermanentlyDelete + } + + @objc + public var asFilePreview: DBXTeamLogEventTypeFilePreview? { + self as? DBXTeamLogEventTypeFilePreview + } + + @objc + public var asFileRename: DBXTeamLogEventTypeFileRename? { + self as? DBXTeamLogEventTypeFileRename + } + + @objc + public var asFileRestore: DBXTeamLogEventTypeFileRestore? { + self as? DBXTeamLogEventTypeFileRestore + } + + @objc + public var asFileRevert: DBXTeamLogEventTypeFileRevert? { + self as? DBXTeamLogEventTypeFileRevert + } + + @objc + public var asFileRollbackChanges: DBXTeamLogEventTypeFileRollbackChanges? { + self as? DBXTeamLogEventTypeFileRollbackChanges + } + + @objc + public var asFileSaveCopyReference: DBXTeamLogEventTypeFileSaveCopyReference? { + self as? DBXTeamLogEventTypeFileSaveCopyReference + } + + @objc + public var asFolderOverviewDescriptionChanged: DBXTeamLogEventTypeFolderOverviewDescriptionChanged? { + self as? DBXTeamLogEventTypeFolderOverviewDescriptionChanged + } + + @objc + public var asFolderOverviewItemPinned: DBXTeamLogEventTypeFolderOverviewItemPinned? { + self as? DBXTeamLogEventTypeFolderOverviewItemPinned + } + + @objc + public var asFolderOverviewItemUnpinned: DBXTeamLogEventTypeFolderOverviewItemUnpinned? { + self as? DBXTeamLogEventTypeFolderOverviewItemUnpinned + } + + @objc + public var asObjectLabelAdded: DBXTeamLogEventTypeObjectLabelAdded? { + self as? DBXTeamLogEventTypeObjectLabelAdded + } + + @objc + public var asObjectLabelRemoved: DBXTeamLogEventTypeObjectLabelRemoved? { + self as? DBXTeamLogEventTypeObjectLabelRemoved + } + + @objc + public var asObjectLabelUpdatedValue: DBXTeamLogEventTypeObjectLabelUpdatedValue? { + self as? DBXTeamLogEventTypeObjectLabelUpdatedValue + } + + @objc + public var asOrganizeFolderWithTidy: DBXTeamLogEventTypeOrganizeFolderWithTidy? { + self as? DBXTeamLogEventTypeOrganizeFolderWithTidy + } + + @objc + public var asReplayFileDelete: DBXTeamLogEventTypeReplayFileDelete? { + self as? DBXTeamLogEventTypeReplayFileDelete + } + + @objc + public var asRewindFolder: DBXTeamLogEventTypeRewindFolder? { + self as? DBXTeamLogEventTypeRewindFolder + } + + @objc + public var asUndoNamingConvention: DBXTeamLogEventTypeUndoNamingConvention? { + self as? DBXTeamLogEventTypeUndoNamingConvention + } + + @objc + public var asUndoOrganizeFolderWithTidy: DBXTeamLogEventTypeUndoOrganizeFolderWithTidy? { + self as? DBXTeamLogEventTypeUndoOrganizeFolderWithTidy + } + + @objc + public var asUserTagsAdded: DBXTeamLogEventTypeUserTagsAdded? { + self as? DBXTeamLogEventTypeUserTagsAdded + } + + @objc + public var asUserTagsRemoved: DBXTeamLogEventTypeUserTagsRemoved? { + self as? DBXTeamLogEventTypeUserTagsRemoved + } + + @objc + public var asEmailIngestReceiveFile: DBXTeamLogEventTypeEmailIngestReceiveFile? { + self as? DBXTeamLogEventTypeEmailIngestReceiveFile + } + + @objc + public var asFileRequestChange: DBXTeamLogEventTypeFileRequestChange? { + self as? DBXTeamLogEventTypeFileRequestChange + } + + @objc + public var asFileRequestClose: DBXTeamLogEventTypeFileRequestClose? { + self as? DBXTeamLogEventTypeFileRequestClose + } + + @objc + public var asFileRequestCreate: DBXTeamLogEventTypeFileRequestCreate? { + self as? DBXTeamLogEventTypeFileRequestCreate + } + + @objc + public var asFileRequestDelete: DBXTeamLogEventTypeFileRequestDelete? { + self as? DBXTeamLogEventTypeFileRequestDelete + } + + @objc + public var asFileRequestReceiveFile: DBXTeamLogEventTypeFileRequestReceiveFile? { + self as? DBXTeamLogEventTypeFileRequestReceiveFile + } + + @objc + public var asGroupAddExternalId: DBXTeamLogEventTypeGroupAddExternalId? { + self as? DBXTeamLogEventTypeGroupAddExternalId + } + + @objc + public var asGroupAddMember: DBXTeamLogEventTypeGroupAddMember? { + self as? DBXTeamLogEventTypeGroupAddMember + } + + @objc + public var asGroupChangeExternalId: DBXTeamLogEventTypeGroupChangeExternalId? { + self as? DBXTeamLogEventTypeGroupChangeExternalId + } + + @objc + public var asGroupChangeManagementType: DBXTeamLogEventTypeGroupChangeManagementType? { + self as? DBXTeamLogEventTypeGroupChangeManagementType + } + + @objc + public var asGroupChangeMemberRole: DBXTeamLogEventTypeGroupChangeMemberRole? { + self as? DBXTeamLogEventTypeGroupChangeMemberRole + } + + @objc + public var asGroupCreate: DBXTeamLogEventTypeGroupCreate? { + self as? DBXTeamLogEventTypeGroupCreate + } + + @objc + public var asGroupDelete: DBXTeamLogEventTypeGroupDelete? { + self as? DBXTeamLogEventTypeGroupDelete + } + + @objc + public var asGroupDescriptionUpdated: DBXTeamLogEventTypeGroupDescriptionUpdated? { + self as? DBXTeamLogEventTypeGroupDescriptionUpdated + } + + @objc + public var asGroupJoinPolicyUpdated: DBXTeamLogEventTypeGroupJoinPolicyUpdated? { + self as? DBXTeamLogEventTypeGroupJoinPolicyUpdated + } + + @objc + public var asGroupMoved: DBXTeamLogEventTypeGroupMoved? { + self as? DBXTeamLogEventTypeGroupMoved + } + + @objc + public var asGroupRemoveExternalId: DBXTeamLogEventTypeGroupRemoveExternalId? { + self as? DBXTeamLogEventTypeGroupRemoveExternalId + } + + @objc + public var asGroupRemoveMember: DBXTeamLogEventTypeGroupRemoveMember? { + self as? DBXTeamLogEventTypeGroupRemoveMember + } + + @objc + public var asGroupRename: DBXTeamLogEventTypeGroupRename? { + self as? DBXTeamLogEventTypeGroupRename + } + + @objc + public var asAccountLockOrUnlocked: DBXTeamLogEventTypeAccountLockOrUnlocked? { + self as? DBXTeamLogEventTypeAccountLockOrUnlocked + } + + @objc + public var asEmmError: DBXTeamLogEventTypeEmmError? { + self as? DBXTeamLogEventTypeEmmError + } + + @objc + public var asGuestAdminSignedInViaTrustedTeams: DBXTeamLogEventTypeGuestAdminSignedInViaTrustedTeams? { + self as? DBXTeamLogEventTypeGuestAdminSignedInViaTrustedTeams + } + + @objc + public var asGuestAdminSignedOutViaTrustedTeams: DBXTeamLogEventTypeGuestAdminSignedOutViaTrustedTeams? { + self as? DBXTeamLogEventTypeGuestAdminSignedOutViaTrustedTeams + } + + @objc + public var asLoginFail: DBXTeamLogEventTypeLoginFail? { + self as? DBXTeamLogEventTypeLoginFail + } + + @objc + public var asLoginSuccess: DBXTeamLogEventTypeLoginSuccess? { + self as? DBXTeamLogEventTypeLoginSuccess + } + + @objc + public var asLogout: DBXTeamLogEventTypeLogout? { + self as? DBXTeamLogEventTypeLogout + } + + @objc + public var asResellerSupportSessionEnd: DBXTeamLogEventTypeResellerSupportSessionEnd? { + self as? DBXTeamLogEventTypeResellerSupportSessionEnd + } + + @objc + public var asResellerSupportSessionStart: DBXTeamLogEventTypeResellerSupportSessionStart? { + self as? DBXTeamLogEventTypeResellerSupportSessionStart + } + + @objc + public var asSignInAsSessionEnd: DBXTeamLogEventTypeSignInAsSessionEnd? { + self as? DBXTeamLogEventTypeSignInAsSessionEnd + } + + @objc + public var asSignInAsSessionStart: DBXTeamLogEventTypeSignInAsSessionStart? { + self as? DBXTeamLogEventTypeSignInAsSessionStart + } + + @objc + public var asSsoError: DBXTeamLogEventTypeSsoError? { + self as? DBXTeamLogEventTypeSsoError + } + + @objc + public var asBackupAdminInvitationSent: DBXTeamLogEventTypeBackupAdminInvitationSent? { + self as? DBXTeamLogEventTypeBackupAdminInvitationSent + } + + @objc + public var asBackupInvitationOpened: DBXTeamLogEventTypeBackupInvitationOpened? { + self as? DBXTeamLogEventTypeBackupInvitationOpened + } + + @objc + public var asCreateTeamInviteLink: DBXTeamLogEventTypeCreateTeamInviteLink? { + self as? DBXTeamLogEventTypeCreateTeamInviteLink + } + + @objc + public var asDeleteTeamInviteLink: DBXTeamLogEventTypeDeleteTeamInviteLink? { + self as? DBXTeamLogEventTypeDeleteTeamInviteLink + } + + @objc + public var asMemberAddExternalId: DBXTeamLogEventTypeMemberAddExternalId? { + self as? DBXTeamLogEventTypeMemberAddExternalId + } + + @objc + public var asMemberAddName: DBXTeamLogEventTypeMemberAddName? { + self as? DBXTeamLogEventTypeMemberAddName + } + + @objc + public var asMemberChangeAdminRole: DBXTeamLogEventTypeMemberChangeAdminRole? { + self as? DBXTeamLogEventTypeMemberChangeAdminRole + } + + @objc + public var asMemberChangeEmail: DBXTeamLogEventTypeMemberChangeEmail? { + self as? DBXTeamLogEventTypeMemberChangeEmail + } + + @objc + public var asMemberChangeExternalId: DBXTeamLogEventTypeMemberChangeExternalId? { + self as? DBXTeamLogEventTypeMemberChangeExternalId + } + + @objc + public var asMemberChangeMembershipType: DBXTeamLogEventTypeMemberChangeMembershipType? { + self as? DBXTeamLogEventTypeMemberChangeMembershipType + } + + @objc + public var asMemberChangeName: DBXTeamLogEventTypeMemberChangeName? { + self as? DBXTeamLogEventTypeMemberChangeName + } + + @objc + public var asMemberChangeResellerRole: DBXTeamLogEventTypeMemberChangeResellerRole? { + self as? DBXTeamLogEventTypeMemberChangeResellerRole + } + + @objc + public var asMemberChangeStatus: DBXTeamLogEventTypeMemberChangeStatus? { + self as? DBXTeamLogEventTypeMemberChangeStatus + } + + @objc + public var asMemberDeleteManualContacts: DBXTeamLogEventTypeMemberDeleteManualContacts? { + self as? DBXTeamLogEventTypeMemberDeleteManualContacts + } + + @objc + public var asMemberDeleteProfilePhoto: DBXTeamLogEventTypeMemberDeleteProfilePhoto? { + self as? DBXTeamLogEventTypeMemberDeleteProfilePhoto + } + + @objc + public var asMemberPermanentlyDeleteAccountContents: DBXTeamLogEventTypeMemberPermanentlyDeleteAccountContents? { + self as? DBXTeamLogEventTypeMemberPermanentlyDeleteAccountContents + } + + @objc + public var asMemberRemoveExternalId: DBXTeamLogEventTypeMemberRemoveExternalId? { + self as? DBXTeamLogEventTypeMemberRemoveExternalId + } + + @objc + public var asMemberSetProfilePhoto: DBXTeamLogEventTypeMemberSetProfilePhoto? { + self as? DBXTeamLogEventTypeMemberSetProfilePhoto + } + + @objc + public var asMemberSpaceLimitsAddCustomQuota: DBXTeamLogEventTypeMemberSpaceLimitsAddCustomQuota? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsAddCustomQuota + } + + @objc + public var asMemberSpaceLimitsChangeCustomQuota: DBXTeamLogEventTypeMemberSpaceLimitsChangeCustomQuota? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsChangeCustomQuota + } + + @objc + public var asMemberSpaceLimitsChangeStatus: DBXTeamLogEventTypeMemberSpaceLimitsChangeStatus? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsChangeStatus + } + + @objc + public var asMemberSpaceLimitsRemoveCustomQuota: DBXTeamLogEventTypeMemberSpaceLimitsRemoveCustomQuota? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsRemoveCustomQuota + } + + @objc + public var asMemberSuggest: DBXTeamLogEventTypeMemberSuggest? { + self as? DBXTeamLogEventTypeMemberSuggest + } + + @objc + public var asMemberTransferAccountContents: DBXTeamLogEventTypeMemberTransferAccountContents? { + self as? DBXTeamLogEventTypeMemberTransferAccountContents + } + + @objc + public var asPendingSecondaryEmailAdded: DBXTeamLogEventTypePendingSecondaryEmailAdded? { + self as? DBXTeamLogEventTypePendingSecondaryEmailAdded + } + + @objc + public var asSecondaryEmailDeleted: DBXTeamLogEventTypeSecondaryEmailDeleted? { + self as? DBXTeamLogEventTypeSecondaryEmailDeleted + } + + @objc + public var asSecondaryEmailVerified: DBXTeamLogEventTypeSecondaryEmailVerified? { + self as? DBXTeamLogEventTypeSecondaryEmailVerified + } + + @objc + public var asSecondaryMailsPolicyChanged: DBXTeamLogEventTypeSecondaryMailsPolicyChanged? { + self as? DBXTeamLogEventTypeSecondaryMailsPolicyChanged + } + + @objc + public var asBinderAddPage: DBXTeamLogEventTypeBinderAddPage? { + self as? DBXTeamLogEventTypeBinderAddPage + } + + @objc + public var asBinderAddSection: DBXTeamLogEventTypeBinderAddSection? { + self as? DBXTeamLogEventTypeBinderAddSection + } + + @objc + public var asBinderRemovePage: DBXTeamLogEventTypeBinderRemovePage? { + self as? DBXTeamLogEventTypeBinderRemovePage + } + + @objc + public var asBinderRemoveSection: DBXTeamLogEventTypeBinderRemoveSection? { + self as? DBXTeamLogEventTypeBinderRemoveSection + } + + @objc + public var asBinderRenamePage: DBXTeamLogEventTypeBinderRenamePage? { + self as? DBXTeamLogEventTypeBinderRenamePage + } + + @objc + public var asBinderRenameSection: DBXTeamLogEventTypeBinderRenameSection? { + self as? DBXTeamLogEventTypeBinderRenameSection + } + + @objc + public var asBinderReorderPage: DBXTeamLogEventTypeBinderReorderPage? { + self as? DBXTeamLogEventTypeBinderReorderPage + } + + @objc + public var asBinderReorderSection: DBXTeamLogEventTypeBinderReorderSection? { + self as? DBXTeamLogEventTypeBinderReorderSection + } + + @objc + public var asPaperContentAddMember: DBXTeamLogEventTypePaperContentAddMember? { + self as? DBXTeamLogEventTypePaperContentAddMember + } + + @objc + public var asPaperContentAddToFolder: DBXTeamLogEventTypePaperContentAddToFolder? { + self as? DBXTeamLogEventTypePaperContentAddToFolder + } + + @objc + public var asPaperContentArchive: DBXTeamLogEventTypePaperContentArchive? { + self as? DBXTeamLogEventTypePaperContentArchive + } + + @objc + public var asPaperContentCreate: DBXTeamLogEventTypePaperContentCreate? { + self as? DBXTeamLogEventTypePaperContentCreate + } + + @objc + public var asPaperContentPermanentlyDelete: DBXTeamLogEventTypePaperContentPermanentlyDelete? { + self as? DBXTeamLogEventTypePaperContentPermanentlyDelete + } + + @objc + public var asPaperContentRemoveFromFolder: DBXTeamLogEventTypePaperContentRemoveFromFolder? { + self as? DBXTeamLogEventTypePaperContentRemoveFromFolder + } + + @objc + public var asPaperContentRemoveMember: DBXTeamLogEventTypePaperContentRemoveMember? { + self as? DBXTeamLogEventTypePaperContentRemoveMember + } + + @objc + public var asPaperContentRename: DBXTeamLogEventTypePaperContentRename? { + self as? DBXTeamLogEventTypePaperContentRename + } + + @objc + public var asPaperContentRestore: DBXTeamLogEventTypePaperContentRestore? { + self as? DBXTeamLogEventTypePaperContentRestore + } + + @objc + public var asPaperDocAddComment: DBXTeamLogEventTypePaperDocAddComment? { + self as? DBXTeamLogEventTypePaperDocAddComment + } + + @objc + public var asPaperDocChangeMemberRole: DBXTeamLogEventTypePaperDocChangeMemberRole? { + self as? DBXTeamLogEventTypePaperDocChangeMemberRole + } + + @objc + public var asPaperDocChangeSharingPolicy: DBXTeamLogEventTypePaperDocChangeSharingPolicy? { + self as? DBXTeamLogEventTypePaperDocChangeSharingPolicy + } + + @objc + public var asPaperDocChangeSubscription: DBXTeamLogEventTypePaperDocChangeSubscription? { + self as? DBXTeamLogEventTypePaperDocChangeSubscription + } + + @objc + public var asPaperDocDeleted: DBXTeamLogEventTypePaperDocDeleted? { + self as? DBXTeamLogEventTypePaperDocDeleted + } + + @objc + public var asPaperDocDeleteComment: DBXTeamLogEventTypePaperDocDeleteComment? { + self as? DBXTeamLogEventTypePaperDocDeleteComment + } + + @objc + public var asPaperDocDownload: DBXTeamLogEventTypePaperDocDownload? { + self as? DBXTeamLogEventTypePaperDocDownload + } + + @objc + public var asPaperDocEdit: DBXTeamLogEventTypePaperDocEdit? { + self as? DBXTeamLogEventTypePaperDocEdit + } + + @objc + public var asPaperDocEditComment: DBXTeamLogEventTypePaperDocEditComment? { + self as? DBXTeamLogEventTypePaperDocEditComment + } + + @objc + public var asPaperDocFollowed: DBXTeamLogEventTypePaperDocFollowed? { + self as? DBXTeamLogEventTypePaperDocFollowed + } + + @objc + public var asPaperDocMention: DBXTeamLogEventTypePaperDocMention? { + self as? DBXTeamLogEventTypePaperDocMention + } + + @objc + public var asPaperDocOwnershipChanged: DBXTeamLogEventTypePaperDocOwnershipChanged? { + self as? DBXTeamLogEventTypePaperDocOwnershipChanged + } + + @objc + public var asPaperDocRequestAccess: DBXTeamLogEventTypePaperDocRequestAccess? { + self as? DBXTeamLogEventTypePaperDocRequestAccess + } + + @objc + public var asPaperDocResolveComment: DBXTeamLogEventTypePaperDocResolveComment? { + self as? DBXTeamLogEventTypePaperDocResolveComment + } + + @objc + public var asPaperDocRevert: DBXTeamLogEventTypePaperDocRevert? { + self as? DBXTeamLogEventTypePaperDocRevert + } + + @objc + public var asPaperDocSlackShare: DBXTeamLogEventTypePaperDocSlackShare? { + self as? DBXTeamLogEventTypePaperDocSlackShare + } + + @objc + public var asPaperDocTeamInvite: DBXTeamLogEventTypePaperDocTeamInvite? { + self as? DBXTeamLogEventTypePaperDocTeamInvite + } + + @objc + public var asPaperDocTrashed: DBXTeamLogEventTypePaperDocTrashed? { + self as? DBXTeamLogEventTypePaperDocTrashed + } + + @objc + public var asPaperDocUnresolveComment: DBXTeamLogEventTypePaperDocUnresolveComment? { + self as? DBXTeamLogEventTypePaperDocUnresolveComment + } + + @objc + public var asPaperDocUntrashed: DBXTeamLogEventTypePaperDocUntrashed? { + self as? DBXTeamLogEventTypePaperDocUntrashed + } + + @objc + public var asPaperDocView: DBXTeamLogEventTypePaperDocView? { + self as? DBXTeamLogEventTypePaperDocView + } + + @objc + public var asPaperExternalViewAllow: DBXTeamLogEventTypePaperExternalViewAllow? { + self as? DBXTeamLogEventTypePaperExternalViewAllow + } + + @objc + public var asPaperExternalViewDefaultTeam: DBXTeamLogEventTypePaperExternalViewDefaultTeam? { + self as? DBXTeamLogEventTypePaperExternalViewDefaultTeam + } + + @objc + public var asPaperExternalViewForbid: DBXTeamLogEventTypePaperExternalViewForbid? { + self as? DBXTeamLogEventTypePaperExternalViewForbid + } + + @objc + public var asPaperFolderChangeSubscription: DBXTeamLogEventTypePaperFolderChangeSubscription? { + self as? DBXTeamLogEventTypePaperFolderChangeSubscription + } + + @objc + public var asPaperFolderDeleted: DBXTeamLogEventTypePaperFolderDeleted? { + self as? DBXTeamLogEventTypePaperFolderDeleted + } + + @objc + public var asPaperFolderFollowed: DBXTeamLogEventTypePaperFolderFollowed? { + self as? DBXTeamLogEventTypePaperFolderFollowed + } + + @objc + public var asPaperFolderTeamInvite: DBXTeamLogEventTypePaperFolderTeamInvite? { + self as? DBXTeamLogEventTypePaperFolderTeamInvite + } + + @objc + public var asPaperPublishedLinkChangePermission: DBXTeamLogEventTypePaperPublishedLinkChangePermission? { + self as? DBXTeamLogEventTypePaperPublishedLinkChangePermission + } + + @objc + public var asPaperPublishedLinkCreate: DBXTeamLogEventTypePaperPublishedLinkCreate? { + self as? DBXTeamLogEventTypePaperPublishedLinkCreate + } + + @objc + public var asPaperPublishedLinkDisabled: DBXTeamLogEventTypePaperPublishedLinkDisabled? { + self as? DBXTeamLogEventTypePaperPublishedLinkDisabled + } + + @objc + public var asPaperPublishedLinkView: DBXTeamLogEventTypePaperPublishedLinkView? { + self as? DBXTeamLogEventTypePaperPublishedLinkView + } + + @objc + public var asPasswordChange: DBXTeamLogEventTypePasswordChange? { + self as? DBXTeamLogEventTypePasswordChange + } + + @objc + public var asPasswordReset: DBXTeamLogEventTypePasswordReset? { + self as? DBXTeamLogEventTypePasswordReset + } + + @objc + public var asPasswordResetAll: DBXTeamLogEventTypePasswordResetAll? { + self as? DBXTeamLogEventTypePasswordResetAll + } + + @objc + public var asClassificationCreateReport: DBXTeamLogEventTypeClassificationCreateReport? { + self as? DBXTeamLogEventTypeClassificationCreateReport + } + + @objc + public var asClassificationCreateReportFail: DBXTeamLogEventTypeClassificationCreateReportFail? { + self as? DBXTeamLogEventTypeClassificationCreateReportFail + } + + @objc + public var asEmmCreateExceptionsReport: DBXTeamLogEventTypeEmmCreateExceptionsReport? { + self as? DBXTeamLogEventTypeEmmCreateExceptionsReport + } + + @objc + public var asEmmCreateUsageReport: DBXTeamLogEventTypeEmmCreateUsageReport? { + self as? DBXTeamLogEventTypeEmmCreateUsageReport + } + + @objc + public var asExportMembersReport: DBXTeamLogEventTypeExportMembersReport? { + self as? DBXTeamLogEventTypeExportMembersReport + } + + @objc + public var asExportMembersReportFail: DBXTeamLogEventTypeExportMembersReportFail? { + self as? DBXTeamLogEventTypeExportMembersReportFail + } + + @objc + public var asExternalSharingCreateReport: DBXTeamLogEventTypeExternalSharingCreateReport? { + self as? DBXTeamLogEventTypeExternalSharingCreateReport + } + + @objc + public var asExternalSharingReportFailed: DBXTeamLogEventTypeExternalSharingReportFailed? { + self as? DBXTeamLogEventTypeExternalSharingReportFailed + } + + @objc + public var asNoExpirationLinkGenCreateReport: DBXTeamLogEventTypeNoExpirationLinkGenCreateReport? { + self as? DBXTeamLogEventTypeNoExpirationLinkGenCreateReport + } + + @objc + public var asNoExpirationLinkGenReportFailed: DBXTeamLogEventTypeNoExpirationLinkGenReportFailed? { + self as? DBXTeamLogEventTypeNoExpirationLinkGenReportFailed + } + + @objc + public var asNoPasswordLinkGenCreateReport: DBXTeamLogEventTypeNoPasswordLinkGenCreateReport? { + self as? DBXTeamLogEventTypeNoPasswordLinkGenCreateReport + } + + @objc + public var asNoPasswordLinkGenReportFailed: DBXTeamLogEventTypeNoPasswordLinkGenReportFailed? { + self as? DBXTeamLogEventTypeNoPasswordLinkGenReportFailed + } + + @objc + public var asNoPasswordLinkViewCreateReport: DBXTeamLogEventTypeNoPasswordLinkViewCreateReport? { + self as? DBXTeamLogEventTypeNoPasswordLinkViewCreateReport + } + + @objc + public var asNoPasswordLinkViewReportFailed: DBXTeamLogEventTypeNoPasswordLinkViewReportFailed? { + self as? DBXTeamLogEventTypeNoPasswordLinkViewReportFailed + } + + @objc + public var asOutdatedLinkViewCreateReport: DBXTeamLogEventTypeOutdatedLinkViewCreateReport? { + self as? DBXTeamLogEventTypeOutdatedLinkViewCreateReport + } + + @objc + public var asOutdatedLinkViewReportFailed: DBXTeamLogEventTypeOutdatedLinkViewReportFailed? { + self as? DBXTeamLogEventTypeOutdatedLinkViewReportFailed + } + + @objc + public var asPaperAdminExportStart: DBXTeamLogEventTypePaperAdminExportStart? { + self as? DBXTeamLogEventTypePaperAdminExportStart + } + + @objc + public var asRansomwareAlertCreateReport: DBXTeamLogEventTypeRansomwareAlertCreateReport? { + self as? DBXTeamLogEventTypeRansomwareAlertCreateReport + } + + @objc + public var asRansomwareAlertCreateReportFailed: DBXTeamLogEventTypeRansomwareAlertCreateReportFailed? { + self as? DBXTeamLogEventTypeRansomwareAlertCreateReportFailed + } + + @objc + public var asSmartSyncCreateAdminPrivilegeReport: DBXTeamLogEventTypeSmartSyncCreateAdminPrivilegeReport? { + self as? DBXTeamLogEventTypeSmartSyncCreateAdminPrivilegeReport + } + + @objc + public var asTeamActivityCreateReport: DBXTeamLogEventTypeTeamActivityCreateReport? { + self as? DBXTeamLogEventTypeTeamActivityCreateReport + } + + @objc + public var asTeamActivityCreateReportFail: DBXTeamLogEventTypeTeamActivityCreateReportFail? { + self as? DBXTeamLogEventTypeTeamActivityCreateReportFail + } + + @objc + public var asCollectionShare: DBXTeamLogEventTypeCollectionShare? { + self as? DBXTeamLogEventTypeCollectionShare + } + + @objc + public var asFileTransfersFileAdd: DBXTeamLogEventTypeFileTransfersFileAdd? { + self as? DBXTeamLogEventTypeFileTransfersFileAdd + } + + @objc + public var asFileTransfersTransferDelete: DBXTeamLogEventTypeFileTransfersTransferDelete? { + self as? DBXTeamLogEventTypeFileTransfersTransferDelete + } + + @objc + public var asFileTransfersTransferDownload: DBXTeamLogEventTypeFileTransfersTransferDownload? { + self as? DBXTeamLogEventTypeFileTransfersTransferDownload + } + + @objc + public var asFileTransfersTransferSend: DBXTeamLogEventTypeFileTransfersTransferSend? { + self as? DBXTeamLogEventTypeFileTransfersTransferSend + } + + @objc + public var asFileTransfersTransferView: DBXTeamLogEventTypeFileTransfersTransferView? { + self as? DBXTeamLogEventTypeFileTransfersTransferView + } + + @objc + public var asNoteAclInviteOnly: DBXTeamLogEventTypeNoteAclInviteOnly? { + self as? DBXTeamLogEventTypeNoteAclInviteOnly + } + + @objc + public var asNoteAclLink: DBXTeamLogEventTypeNoteAclLink? { + self as? DBXTeamLogEventTypeNoteAclLink + } + + @objc + public var asNoteAclTeamLink: DBXTeamLogEventTypeNoteAclTeamLink? { + self as? DBXTeamLogEventTypeNoteAclTeamLink + } + + @objc + public var asNoteShared: DBXTeamLogEventTypeNoteShared? { + self as? DBXTeamLogEventTypeNoteShared + } + + @objc + public var asNoteShareReceive: DBXTeamLogEventTypeNoteShareReceive? { + self as? DBXTeamLogEventTypeNoteShareReceive + } + + @objc + public var asOpenNoteShared: DBXTeamLogEventTypeOpenNoteShared? { + self as? DBXTeamLogEventTypeOpenNoteShared + } + + @objc + public var asReplayFileSharedLinkCreated: DBXTeamLogEventTypeReplayFileSharedLinkCreated? { + self as? DBXTeamLogEventTypeReplayFileSharedLinkCreated + } + + @objc + public var asReplayFileSharedLinkModified: DBXTeamLogEventTypeReplayFileSharedLinkModified? { + self as? DBXTeamLogEventTypeReplayFileSharedLinkModified + } + + @objc + public var asReplayProjectTeamAdd: DBXTeamLogEventTypeReplayProjectTeamAdd? { + self as? DBXTeamLogEventTypeReplayProjectTeamAdd + } + + @objc + public var asReplayProjectTeamDelete: DBXTeamLogEventTypeReplayProjectTeamDelete? { + self as? DBXTeamLogEventTypeReplayProjectTeamDelete + } + + @objc + public var asSfAddGroup: DBXTeamLogEventTypeSfAddGroup? { + self as? DBXTeamLogEventTypeSfAddGroup + } + + @objc + public var asSfAllowNonMembersToViewSharedLinks: DBXTeamLogEventTypeSfAllowNonMembersToViewSharedLinks? { + self as? DBXTeamLogEventTypeSfAllowNonMembersToViewSharedLinks + } + + @objc + public var asSfExternalInviteWarn: DBXTeamLogEventTypeSfExternalInviteWarn? { + self as? DBXTeamLogEventTypeSfExternalInviteWarn + } + + @objc + public var asSfFbInvite: DBXTeamLogEventTypeSfFbInvite? { + self as? DBXTeamLogEventTypeSfFbInvite + } + + @objc + public var asSfFbInviteChangeRole: DBXTeamLogEventTypeSfFbInviteChangeRole? { + self as? DBXTeamLogEventTypeSfFbInviteChangeRole + } + + @objc + public var asSfFbUninvite: DBXTeamLogEventTypeSfFbUninvite? { + self as? DBXTeamLogEventTypeSfFbUninvite + } + + @objc + public var asSfInviteGroup: DBXTeamLogEventTypeSfInviteGroup? { + self as? DBXTeamLogEventTypeSfInviteGroup + } + + @objc + public var asSfTeamGrantAccess: DBXTeamLogEventTypeSfTeamGrantAccess? { + self as? DBXTeamLogEventTypeSfTeamGrantAccess + } + + @objc + public var asSfTeamInvite: DBXTeamLogEventTypeSfTeamInvite? { + self as? DBXTeamLogEventTypeSfTeamInvite + } + + @objc + public var asSfTeamInviteChangeRole: DBXTeamLogEventTypeSfTeamInviteChangeRole? { + self as? DBXTeamLogEventTypeSfTeamInviteChangeRole + } + + @objc + public var asSfTeamJoin: DBXTeamLogEventTypeSfTeamJoin? { + self as? DBXTeamLogEventTypeSfTeamJoin + } + + @objc + public var asSfTeamJoinFromOobLink: DBXTeamLogEventTypeSfTeamJoinFromOobLink? { + self as? DBXTeamLogEventTypeSfTeamJoinFromOobLink + } + + @objc + public var asSfTeamUninvite: DBXTeamLogEventTypeSfTeamUninvite? { + self as? DBXTeamLogEventTypeSfTeamUninvite + } + + @objc + public var asSharedContentAddInvitees: DBXTeamLogEventTypeSharedContentAddInvitees? { + self as? DBXTeamLogEventTypeSharedContentAddInvitees + } + + @objc + public var asSharedContentAddLinkExpiry: DBXTeamLogEventTypeSharedContentAddLinkExpiry? { + self as? DBXTeamLogEventTypeSharedContentAddLinkExpiry + } + + @objc + public var asSharedContentAddLinkPassword: DBXTeamLogEventTypeSharedContentAddLinkPassword? { + self as? DBXTeamLogEventTypeSharedContentAddLinkPassword + } + + @objc + public var asSharedContentAddMember: DBXTeamLogEventTypeSharedContentAddMember? { + self as? DBXTeamLogEventTypeSharedContentAddMember + } + + @objc + public var asSharedContentChangeDownloadsPolicy: DBXTeamLogEventTypeSharedContentChangeDownloadsPolicy? { + self as? DBXTeamLogEventTypeSharedContentChangeDownloadsPolicy + } + + @objc + public var asSharedContentChangeInviteeRole: DBXTeamLogEventTypeSharedContentChangeInviteeRole? { + self as? DBXTeamLogEventTypeSharedContentChangeInviteeRole + } + + @objc + public var asSharedContentChangeLinkAudience: DBXTeamLogEventTypeSharedContentChangeLinkAudience? { + self as? DBXTeamLogEventTypeSharedContentChangeLinkAudience + } + + @objc + public var asSharedContentChangeLinkExpiry: DBXTeamLogEventTypeSharedContentChangeLinkExpiry? { + self as? DBXTeamLogEventTypeSharedContentChangeLinkExpiry + } + + @objc + public var asSharedContentChangeLinkPassword: DBXTeamLogEventTypeSharedContentChangeLinkPassword? { + self as? DBXTeamLogEventTypeSharedContentChangeLinkPassword + } + + @objc + public var asSharedContentChangeMemberRole: DBXTeamLogEventTypeSharedContentChangeMemberRole? { + self as? DBXTeamLogEventTypeSharedContentChangeMemberRole + } + + @objc + public var asSharedContentChangeViewerInfoPolicy: DBXTeamLogEventTypeSharedContentChangeViewerInfoPolicy? { + self as? DBXTeamLogEventTypeSharedContentChangeViewerInfoPolicy + } + + @objc + public var asSharedContentClaimInvitation: DBXTeamLogEventTypeSharedContentClaimInvitation? { + self as? DBXTeamLogEventTypeSharedContentClaimInvitation + } + + @objc + public var asSharedContentCopy: DBXTeamLogEventTypeSharedContentCopy? { + self as? DBXTeamLogEventTypeSharedContentCopy + } + + @objc + public var asSharedContentDownload: DBXTeamLogEventTypeSharedContentDownload? { + self as? DBXTeamLogEventTypeSharedContentDownload + } + + @objc + public var asSharedContentRelinquishMembership: DBXTeamLogEventTypeSharedContentRelinquishMembership? { + self as? DBXTeamLogEventTypeSharedContentRelinquishMembership + } + + @objc + public var asSharedContentRemoveInvitees: DBXTeamLogEventTypeSharedContentRemoveInvitees? { + self as? DBXTeamLogEventTypeSharedContentRemoveInvitees + } + + @objc + public var asSharedContentRemoveLinkExpiry: DBXTeamLogEventTypeSharedContentRemoveLinkExpiry? { + self as? DBXTeamLogEventTypeSharedContentRemoveLinkExpiry + } + + @objc + public var asSharedContentRemoveLinkPassword: DBXTeamLogEventTypeSharedContentRemoveLinkPassword? { + self as? DBXTeamLogEventTypeSharedContentRemoveLinkPassword + } + + @objc + public var asSharedContentRemoveMember: DBXTeamLogEventTypeSharedContentRemoveMember? { + self as? DBXTeamLogEventTypeSharedContentRemoveMember + } + + @objc + public var asSharedContentRequestAccess: DBXTeamLogEventTypeSharedContentRequestAccess? { + self as? DBXTeamLogEventTypeSharedContentRequestAccess + } + + @objc + public var asSharedContentRestoreInvitees: DBXTeamLogEventTypeSharedContentRestoreInvitees? { + self as? DBXTeamLogEventTypeSharedContentRestoreInvitees + } + + @objc + public var asSharedContentRestoreMember: DBXTeamLogEventTypeSharedContentRestoreMember? { + self as? DBXTeamLogEventTypeSharedContentRestoreMember + } + + @objc + public var asSharedContentUnshare: DBXTeamLogEventTypeSharedContentUnshare? { + self as? DBXTeamLogEventTypeSharedContentUnshare + } + + @objc + public var asSharedContentView: DBXTeamLogEventTypeSharedContentView? { + self as? DBXTeamLogEventTypeSharedContentView + } + + @objc + public var asSharedFolderChangeLinkPolicy: DBXTeamLogEventTypeSharedFolderChangeLinkPolicy? { + self as? DBXTeamLogEventTypeSharedFolderChangeLinkPolicy + } + + @objc + public var asSharedFolderChangeMembersInheritancePolicy: DBXTeamLogEventTypeSharedFolderChangeMembersInheritancePolicy? { + self as? DBXTeamLogEventTypeSharedFolderChangeMembersInheritancePolicy + } + + @objc + public var asSharedFolderChangeMembersManagementPolicy: DBXTeamLogEventTypeSharedFolderChangeMembersManagementPolicy? { + self as? DBXTeamLogEventTypeSharedFolderChangeMembersManagementPolicy + } + + @objc + public var asSharedFolderChangeMembersPolicy: DBXTeamLogEventTypeSharedFolderChangeMembersPolicy? { + self as? DBXTeamLogEventTypeSharedFolderChangeMembersPolicy + } + + @objc + public var asSharedFolderCreate: DBXTeamLogEventTypeSharedFolderCreate? { + self as? DBXTeamLogEventTypeSharedFolderCreate + } + + @objc + public var asSharedFolderDeclineInvitation: DBXTeamLogEventTypeSharedFolderDeclineInvitation? { + self as? DBXTeamLogEventTypeSharedFolderDeclineInvitation + } + + @objc + public var asSharedFolderMount: DBXTeamLogEventTypeSharedFolderMount? { + self as? DBXTeamLogEventTypeSharedFolderMount + } + + @objc + public var asSharedFolderNest: DBXTeamLogEventTypeSharedFolderNest? { + self as? DBXTeamLogEventTypeSharedFolderNest + } + + @objc + public var asSharedFolderTransferOwnership: DBXTeamLogEventTypeSharedFolderTransferOwnership? { + self as? DBXTeamLogEventTypeSharedFolderTransferOwnership + } + + @objc + public var asSharedFolderUnmount: DBXTeamLogEventTypeSharedFolderUnmount? { + self as? DBXTeamLogEventTypeSharedFolderUnmount + } + + @objc + public var asSharedLinkAddExpiry: DBXTeamLogEventTypeSharedLinkAddExpiry? { + self as? DBXTeamLogEventTypeSharedLinkAddExpiry + } + + @objc + public var asSharedLinkChangeExpiry: DBXTeamLogEventTypeSharedLinkChangeExpiry? { + self as? DBXTeamLogEventTypeSharedLinkChangeExpiry + } + + @objc + public var asSharedLinkChangeVisibility: DBXTeamLogEventTypeSharedLinkChangeVisibility? { + self as? DBXTeamLogEventTypeSharedLinkChangeVisibility + } + + @objc + public var asSharedLinkCopy: DBXTeamLogEventTypeSharedLinkCopy? { + self as? DBXTeamLogEventTypeSharedLinkCopy + } + + @objc + public var asSharedLinkCreate: DBXTeamLogEventTypeSharedLinkCreate? { + self as? DBXTeamLogEventTypeSharedLinkCreate + } + + @objc + public var asSharedLinkDisable: DBXTeamLogEventTypeSharedLinkDisable? { + self as? DBXTeamLogEventTypeSharedLinkDisable + } + + @objc + public var asSharedLinkDownload: DBXTeamLogEventTypeSharedLinkDownload? { + self as? DBXTeamLogEventTypeSharedLinkDownload + } + + @objc + public var asSharedLinkRemoveExpiry: DBXTeamLogEventTypeSharedLinkRemoveExpiry? { + self as? DBXTeamLogEventTypeSharedLinkRemoveExpiry + } + + @objc + public var asSharedLinkSettingsAddExpiration: DBXTeamLogEventTypeSharedLinkSettingsAddExpiration? { + self as? DBXTeamLogEventTypeSharedLinkSettingsAddExpiration + } + + @objc + public var asSharedLinkSettingsAddPassword: DBXTeamLogEventTypeSharedLinkSettingsAddPassword? { + self as? DBXTeamLogEventTypeSharedLinkSettingsAddPassword + } + + @objc + public var asSharedLinkSettingsAllowDownloadDisabled: DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadDisabled? { + self as? DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadDisabled + } + + @objc + public var asSharedLinkSettingsAllowDownloadEnabled: DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadEnabled? { + self as? DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadEnabled + } + + @objc + public var asSharedLinkSettingsChangeAudience: DBXTeamLogEventTypeSharedLinkSettingsChangeAudience? { + self as? DBXTeamLogEventTypeSharedLinkSettingsChangeAudience + } + + @objc + public var asSharedLinkSettingsChangeExpiration: DBXTeamLogEventTypeSharedLinkSettingsChangeExpiration? { + self as? DBXTeamLogEventTypeSharedLinkSettingsChangeExpiration + } + + @objc + public var asSharedLinkSettingsChangePassword: DBXTeamLogEventTypeSharedLinkSettingsChangePassword? { + self as? DBXTeamLogEventTypeSharedLinkSettingsChangePassword + } + + @objc + public var asSharedLinkSettingsRemoveExpiration: DBXTeamLogEventTypeSharedLinkSettingsRemoveExpiration? { + self as? DBXTeamLogEventTypeSharedLinkSettingsRemoveExpiration + } + + @objc + public var asSharedLinkSettingsRemovePassword: DBXTeamLogEventTypeSharedLinkSettingsRemovePassword? { + self as? DBXTeamLogEventTypeSharedLinkSettingsRemovePassword + } + + @objc + public var asSharedLinkShare: DBXTeamLogEventTypeSharedLinkShare? { + self as? DBXTeamLogEventTypeSharedLinkShare + } + + @objc + public var asSharedLinkView: DBXTeamLogEventTypeSharedLinkView? { + self as? DBXTeamLogEventTypeSharedLinkView + } + + @objc + public var asSharedNoteOpened: DBXTeamLogEventTypeSharedNoteOpened? { + self as? DBXTeamLogEventTypeSharedNoteOpened + } + + @objc + public var asShmodelDisableDownloads: DBXTeamLogEventTypeShmodelDisableDownloads? { + self as? DBXTeamLogEventTypeShmodelDisableDownloads + } + + @objc + public var asShmodelEnableDownloads: DBXTeamLogEventTypeShmodelEnableDownloads? { + self as? DBXTeamLogEventTypeShmodelEnableDownloads + } + + @objc + public var asShmodelGroupShare: DBXTeamLogEventTypeShmodelGroupShare? { + self as? DBXTeamLogEventTypeShmodelGroupShare + } + + @objc + public var asShowcaseAccessGranted: DBXTeamLogEventTypeShowcaseAccessGranted? { + self as? DBXTeamLogEventTypeShowcaseAccessGranted + } + + @objc + public var asShowcaseAddMember: DBXTeamLogEventTypeShowcaseAddMember? { + self as? DBXTeamLogEventTypeShowcaseAddMember + } + + @objc + public var asShowcaseArchived: DBXTeamLogEventTypeShowcaseArchived? { + self as? DBXTeamLogEventTypeShowcaseArchived + } + + @objc + public var asShowcaseCreated: DBXTeamLogEventTypeShowcaseCreated? { + self as? DBXTeamLogEventTypeShowcaseCreated + } + + @objc + public var asShowcaseDeleteComment: DBXTeamLogEventTypeShowcaseDeleteComment? { + self as? DBXTeamLogEventTypeShowcaseDeleteComment + } + + @objc + public var asShowcaseEdited: DBXTeamLogEventTypeShowcaseEdited? { + self as? DBXTeamLogEventTypeShowcaseEdited + } + + @objc + public var asShowcaseEditComment: DBXTeamLogEventTypeShowcaseEditComment? { + self as? DBXTeamLogEventTypeShowcaseEditComment + } + + @objc + public var asShowcaseFileAdded: DBXTeamLogEventTypeShowcaseFileAdded? { + self as? DBXTeamLogEventTypeShowcaseFileAdded + } + + @objc + public var asShowcaseFileDownload: DBXTeamLogEventTypeShowcaseFileDownload? { + self as? DBXTeamLogEventTypeShowcaseFileDownload + } + + @objc + public var asShowcaseFileRemoved: DBXTeamLogEventTypeShowcaseFileRemoved? { + self as? DBXTeamLogEventTypeShowcaseFileRemoved + } + + @objc + public var asShowcaseFileView: DBXTeamLogEventTypeShowcaseFileView? { + self as? DBXTeamLogEventTypeShowcaseFileView + } + + @objc + public var asShowcasePermanentlyDeleted: DBXTeamLogEventTypeShowcasePermanentlyDeleted? { + self as? DBXTeamLogEventTypeShowcasePermanentlyDeleted + } + + @objc + public var asShowcasePostComment: DBXTeamLogEventTypeShowcasePostComment? { + self as? DBXTeamLogEventTypeShowcasePostComment + } + + @objc + public var asShowcaseRemoveMember: DBXTeamLogEventTypeShowcaseRemoveMember? { + self as? DBXTeamLogEventTypeShowcaseRemoveMember + } + + @objc + public var asShowcaseRenamed: DBXTeamLogEventTypeShowcaseRenamed? { + self as? DBXTeamLogEventTypeShowcaseRenamed + } + + @objc + public var asShowcaseRequestAccess: DBXTeamLogEventTypeShowcaseRequestAccess? { + self as? DBXTeamLogEventTypeShowcaseRequestAccess + } + + @objc + public var asShowcaseResolveComment: DBXTeamLogEventTypeShowcaseResolveComment? { + self as? DBXTeamLogEventTypeShowcaseResolveComment + } + + @objc + public var asShowcaseRestored: DBXTeamLogEventTypeShowcaseRestored? { + self as? DBXTeamLogEventTypeShowcaseRestored + } + + @objc + public var asShowcaseTrashed: DBXTeamLogEventTypeShowcaseTrashed? { + self as? DBXTeamLogEventTypeShowcaseTrashed + } + + @objc + public var asShowcaseTrashedDeprecated: DBXTeamLogEventTypeShowcaseTrashedDeprecated? { + self as? DBXTeamLogEventTypeShowcaseTrashedDeprecated + } + + @objc + public var asShowcaseUnresolveComment: DBXTeamLogEventTypeShowcaseUnresolveComment? { + self as? DBXTeamLogEventTypeShowcaseUnresolveComment + } + + @objc + public var asShowcaseUntrashed: DBXTeamLogEventTypeShowcaseUntrashed? { + self as? DBXTeamLogEventTypeShowcaseUntrashed + } + + @objc + public var asShowcaseUntrashedDeprecated: DBXTeamLogEventTypeShowcaseUntrashedDeprecated? { + self as? DBXTeamLogEventTypeShowcaseUntrashedDeprecated + } + + @objc + public var asShowcaseView: DBXTeamLogEventTypeShowcaseView? { + self as? DBXTeamLogEventTypeShowcaseView + } + + @objc + public var asSsoAddCert: DBXTeamLogEventTypeSsoAddCert? { + self as? DBXTeamLogEventTypeSsoAddCert + } + + @objc + public var asSsoAddLoginUrl: DBXTeamLogEventTypeSsoAddLoginUrl? { + self as? DBXTeamLogEventTypeSsoAddLoginUrl + } + + @objc + public var asSsoAddLogoutUrl: DBXTeamLogEventTypeSsoAddLogoutUrl? { + self as? DBXTeamLogEventTypeSsoAddLogoutUrl + } + + @objc + public var asSsoChangeCert: DBXTeamLogEventTypeSsoChangeCert? { + self as? DBXTeamLogEventTypeSsoChangeCert + } + + @objc + public var asSsoChangeLoginUrl: DBXTeamLogEventTypeSsoChangeLoginUrl? { + self as? DBXTeamLogEventTypeSsoChangeLoginUrl + } + + @objc + public var asSsoChangeLogoutUrl: DBXTeamLogEventTypeSsoChangeLogoutUrl? { + self as? DBXTeamLogEventTypeSsoChangeLogoutUrl + } + + @objc + public var asSsoChangeSamlIdentityMode: DBXTeamLogEventTypeSsoChangeSamlIdentityMode? { + self as? DBXTeamLogEventTypeSsoChangeSamlIdentityMode + } + + @objc + public var asSsoRemoveCert: DBXTeamLogEventTypeSsoRemoveCert? { + self as? DBXTeamLogEventTypeSsoRemoveCert + } + + @objc + public var asSsoRemoveLoginUrl: DBXTeamLogEventTypeSsoRemoveLoginUrl? { + self as? DBXTeamLogEventTypeSsoRemoveLoginUrl + } + + @objc + public var asSsoRemoveLogoutUrl: DBXTeamLogEventTypeSsoRemoveLogoutUrl? { + self as? DBXTeamLogEventTypeSsoRemoveLogoutUrl + } + + @objc + public var asTeamFolderChangeStatus: DBXTeamLogEventTypeTeamFolderChangeStatus? { + self as? DBXTeamLogEventTypeTeamFolderChangeStatus + } + + @objc + public var asTeamFolderCreate: DBXTeamLogEventTypeTeamFolderCreate? { + self as? DBXTeamLogEventTypeTeamFolderCreate + } + + @objc + public var asTeamFolderDowngrade: DBXTeamLogEventTypeTeamFolderDowngrade? { + self as? DBXTeamLogEventTypeTeamFolderDowngrade + } + + @objc + public var asTeamFolderPermanentlyDelete: DBXTeamLogEventTypeTeamFolderPermanentlyDelete? { + self as? DBXTeamLogEventTypeTeamFolderPermanentlyDelete + } + + @objc + public var asTeamFolderRename: DBXTeamLogEventTypeTeamFolderRename? { + self as? DBXTeamLogEventTypeTeamFolderRename + } + + @objc + public var asTeamSelectiveSyncSettingsChanged: DBXTeamLogEventTypeTeamSelectiveSyncSettingsChanged? { + self as? DBXTeamLogEventTypeTeamSelectiveSyncSettingsChanged + } + + @objc + public var asAccountCaptureChangePolicy: DBXTeamLogEventTypeAccountCaptureChangePolicy? { + self as? DBXTeamLogEventTypeAccountCaptureChangePolicy + } + + @objc + public var asAdminEmailRemindersChanged: DBXTeamLogEventTypeAdminEmailRemindersChanged? { + self as? DBXTeamLogEventTypeAdminEmailRemindersChanged + } + + @objc + public var asAllowDownloadDisabled: DBXTeamLogEventTypeAllowDownloadDisabled? { + self as? DBXTeamLogEventTypeAllowDownloadDisabled + } + + @objc + public var asAllowDownloadEnabled: DBXTeamLogEventTypeAllowDownloadEnabled? { + self as? DBXTeamLogEventTypeAllowDownloadEnabled + } + + @objc + public var asAppPermissionsChanged: DBXTeamLogEventTypeAppPermissionsChanged? { + self as? DBXTeamLogEventTypeAppPermissionsChanged + } + + @objc + public var asCameraUploadsPolicyChanged: DBXTeamLogEventTypeCameraUploadsPolicyChanged? { + self as? DBXTeamLogEventTypeCameraUploadsPolicyChanged + } + + @objc + public var asCaptureTranscriptPolicyChanged: DBXTeamLogEventTypeCaptureTranscriptPolicyChanged? { + self as? DBXTeamLogEventTypeCaptureTranscriptPolicyChanged + } + + @objc + public var asClassificationChangePolicy: DBXTeamLogEventTypeClassificationChangePolicy? { + self as? DBXTeamLogEventTypeClassificationChangePolicy + } + + @objc + public var asComputerBackupPolicyChanged: DBXTeamLogEventTypeComputerBackupPolicyChanged? { + self as? DBXTeamLogEventTypeComputerBackupPolicyChanged + } + + @objc + public var asContentAdministrationPolicyChanged: DBXTeamLogEventTypeContentAdministrationPolicyChanged? { + self as? DBXTeamLogEventTypeContentAdministrationPolicyChanged + } + + @objc + public var asDataPlacementRestrictionChangePolicy: DBXTeamLogEventTypeDataPlacementRestrictionChangePolicy? { + self as? DBXTeamLogEventTypeDataPlacementRestrictionChangePolicy + } + + @objc + public var asDataPlacementRestrictionSatisfyPolicy: DBXTeamLogEventTypeDataPlacementRestrictionSatisfyPolicy? { + self as? DBXTeamLogEventTypeDataPlacementRestrictionSatisfyPolicy + } + + @objc + public var asDeviceApprovalsAddException: DBXTeamLogEventTypeDeviceApprovalsAddException? { + self as? DBXTeamLogEventTypeDeviceApprovalsAddException + } + + @objc + public var asDeviceApprovalsChangeDesktopPolicy: DBXTeamLogEventTypeDeviceApprovalsChangeDesktopPolicy? { + self as? DBXTeamLogEventTypeDeviceApprovalsChangeDesktopPolicy + } + + @objc + public var asDeviceApprovalsChangeMobilePolicy: DBXTeamLogEventTypeDeviceApprovalsChangeMobilePolicy? { + self as? DBXTeamLogEventTypeDeviceApprovalsChangeMobilePolicy + } + + @objc + public var asDeviceApprovalsChangeOverageAction: DBXTeamLogEventTypeDeviceApprovalsChangeOverageAction? { + self as? DBXTeamLogEventTypeDeviceApprovalsChangeOverageAction + } + + @objc + public var asDeviceApprovalsChangeUnlinkAction: DBXTeamLogEventTypeDeviceApprovalsChangeUnlinkAction? { + self as? DBXTeamLogEventTypeDeviceApprovalsChangeUnlinkAction + } + + @objc + public var asDeviceApprovalsRemoveException: DBXTeamLogEventTypeDeviceApprovalsRemoveException? { + self as? DBXTeamLogEventTypeDeviceApprovalsRemoveException + } + + @objc + public var asDirectoryRestrictionsAddMembers: DBXTeamLogEventTypeDirectoryRestrictionsAddMembers? { + self as? DBXTeamLogEventTypeDirectoryRestrictionsAddMembers + } + + @objc + public var asDirectoryRestrictionsRemoveMembers: DBXTeamLogEventTypeDirectoryRestrictionsRemoveMembers? { + self as? DBXTeamLogEventTypeDirectoryRestrictionsRemoveMembers + } + + @objc + public var asDropboxPasswordsPolicyChanged: DBXTeamLogEventTypeDropboxPasswordsPolicyChanged? { + self as? DBXTeamLogEventTypeDropboxPasswordsPolicyChanged + } + + @objc + public var asEmailIngestPolicyChanged: DBXTeamLogEventTypeEmailIngestPolicyChanged? { + self as? DBXTeamLogEventTypeEmailIngestPolicyChanged + } + + @objc + public var asEmmAddException: DBXTeamLogEventTypeEmmAddException? { + self as? DBXTeamLogEventTypeEmmAddException + } + + @objc + public var asEmmChangePolicy: DBXTeamLogEventTypeEmmChangePolicy? { + self as? DBXTeamLogEventTypeEmmChangePolicy + } + + @objc + public var asEmmRemoveException: DBXTeamLogEventTypeEmmRemoveException? { + self as? DBXTeamLogEventTypeEmmRemoveException + } + + @objc + public var asExtendedVersionHistoryChangePolicy: DBXTeamLogEventTypeExtendedVersionHistoryChangePolicy? { + self as? DBXTeamLogEventTypeExtendedVersionHistoryChangePolicy + } + + @objc + public var asExternalDriveBackupPolicyChanged: DBXTeamLogEventTypeExternalDriveBackupPolicyChanged? { + self as? DBXTeamLogEventTypeExternalDriveBackupPolicyChanged + } + + @objc + public var asFileCommentsChangePolicy: DBXTeamLogEventTypeFileCommentsChangePolicy? { + self as? DBXTeamLogEventTypeFileCommentsChangePolicy + } + + @objc + public var asFileLockingPolicyChanged: DBXTeamLogEventTypeFileLockingPolicyChanged? { + self as? DBXTeamLogEventTypeFileLockingPolicyChanged + } + + @objc + public var asFileProviderMigrationPolicyChanged: DBXTeamLogEventTypeFileProviderMigrationPolicyChanged? { + self as? DBXTeamLogEventTypeFileProviderMigrationPolicyChanged + } + + @objc + public var asFileRequestsChangePolicy: DBXTeamLogEventTypeFileRequestsChangePolicy? { + self as? DBXTeamLogEventTypeFileRequestsChangePolicy + } + + @objc + public var asFileRequestsEmailsEnabled: DBXTeamLogEventTypeFileRequestsEmailsEnabled? { + self as? DBXTeamLogEventTypeFileRequestsEmailsEnabled + } + + @objc + public var asFileRequestsEmailsRestrictedToTeamOnly: DBXTeamLogEventTypeFileRequestsEmailsRestrictedToTeamOnly? { + self as? DBXTeamLogEventTypeFileRequestsEmailsRestrictedToTeamOnly + } + + @objc + public var asFileTransfersPolicyChanged: DBXTeamLogEventTypeFileTransfersPolicyChanged? { + self as? DBXTeamLogEventTypeFileTransfersPolicyChanged + } + + @objc + public var asFolderLinkRestrictionPolicyChanged: DBXTeamLogEventTypeFolderLinkRestrictionPolicyChanged? { + self as? DBXTeamLogEventTypeFolderLinkRestrictionPolicyChanged + } + + @objc + public var asGoogleSsoChangePolicy: DBXTeamLogEventTypeGoogleSsoChangePolicy? { + self as? DBXTeamLogEventTypeGoogleSsoChangePolicy + } + + @objc + public var asGroupUserManagementChangePolicy: DBXTeamLogEventTypeGroupUserManagementChangePolicy? { + self as? DBXTeamLogEventTypeGroupUserManagementChangePolicy + } + + @objc + public var asIntegrationPolicyChanged: DBXTeamLogEventTypeIntegrationPolicyChanged? { + self as? DBXTeamLogEventTypeIntegrationPolicyChanged + } + + @objc + public var asInviteAcceptanceEmailPolicyChanged: DBXTeamLogEventTypeInviteAcceptanceEmailPolicyChanged? { + self as? DBXTeamLogEventTypeInviteAcceptanceEmailPolicyChanged + } + + @objc + public var asMemberRequestsChangePolicy: DBXTeamLogEventTypeMemberRequestsChangePolicy? { + self as? DBXTeamLogEventTypeMemberRequestsChangePolicy + } + + @objc + public var asMemberSendInvitePolicyChanged: DBXTeamLogEventTypeMemberSendInvitePolicyChanged? { + self as? DBXTeamLogEventTypeMemberSendInvitePolicyChanged + } + + @objc + public var asMemberSpaceLimitsAddException: DBXTeamLogEventTypeMemberSpaceLimitsAddException? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsAddException + } + + @objc + public var asMemberSpaceLimitsChangeCapsTypePolicy: DBXTeamLogEventTypeMemberSpaceLimitsChangeCapsTypePolicy? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsChangeCapsTypePolicy + } + + @objc + public var asMemberSpaceLimitsChangePolicy: DBXTeamLogEventTypeMemberSpaceLimitsChangePolicy? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsChangePolicy + } + + @objc + public var asMemberSpaceLimitsRemoveException: DBXTeamLogEventTypeMemberSpaceLimitsRemoveException? { + self as? DBXTeamLogEventTypeMemberSpaceLimitsRemoveException + } + + @objc + public var asMemberSuggestionsChangePolicy: DBXTeamLogEventTypeMemberSuggestionsChangePolicy? { + self as? DBXTeamLogEventTypeMemberSuggestionsChangePolicy + } + + @objc + public var asMicrosoftOfficeAddinChangePolicy: DBXTeamLogEventTypeMicrosoftOfficeAddinChangePolicy? { + self as? DBXTeamLogEventTypeMicrosoftOfficeAddinChangePolicy + } + + @objc + public var asNetworkControlChangePolicy: DBXTeamLogEventTypeNetworkControlChangePolicy? { + self as? DBXTeamLogEventTypeNetworkControlChangePolicy + } + + @objc + public var asPaperChangeDeploymentPolicy: DBXTeamLogEventTypePaperChangeDeploymentPolicy? { + self as? DBXTeamLogEventTypePaperChangeDeploymentPolicy + } + + @objc + public var asPaperChangeMemberLinkPolicy: DBXTeamLogEventTypePaperChangeMemberLinkPolicy? { + self as? DBXTeamLogEventTypePaperChangeMemberLinkPolicy + } + + @objc + public var asPaperChangeMemberPolicy: DBXTeamLogEventTypePaperChangeMemberPolicy? { + self as? DBXTeamLogEventTypePaperChangeMemberPolicy + } + + @objc + public var asPaperChangePolicy: DBXTeamLogEventTypePaperChangePolicy? { + self as? DBXTeamLogEventTypePaperChangePolicy + } + + @objc + public var asPaperDefaultFolderPolicyChanged: DBXTeamLogEventTypePaperDefaultFolderPolicyChanged? { + self as? DBXTeamLogEventTypePaperDefaultFolderPolicyChanged + } + + @objc + public var asPaperDesktopPolicyChanged: DBXTeamLogEventTypePaperDesktopPolicyChanged? { + self as? DBXTeamLogEventTypePaperDesktopPolicyChanged + } + + @objc + public var asPaperEnabledUsersGroupAddition: DBXTeamLogEventTypePaperEnabledUsersGroupAddition? { + self as? DBXTeamLogEventTypePaperEnabledUsersGroupAddition + } + + @objc + public var asPaperEnabledUsersGroupRemoval: DBXTeamLogEventTypePaperEnabledUsersGroupRemoval? { + self as? DBXTeamLogEventTypePaperEnabledUsersGroupRemoval + } + + @objc + public var asPasswordStrengthRequirementsChangePolicy: DBXTeamLogEventTypePasswordStrengthRequirementsChangePolicy? { + self as? DBXTeamLogEventTypePasswordStrengthRequirementsChangePolicy + } + + @objc + public var asPermanentDeleteChangePolicy: DBXTeamLogEventTypePermanentDeleteChangePolicy? { + self as? DBXTeamLogEventTypePermanentDeleteChangePolicy + } + + @objc + public var asResellerSupportChangePolicy: DBXTeamLogEventTypeResellerSupportChangePolicy? { + self as? DBXTeamLogEventTypeResellerSupportChangePolicy + } + + @objc + public var asRewindPolicyChanged: DBXTeamLogEventTypeRewindPolicyChanged? { + self as? DBXTeamLogEventTypeRewindPolicyChanged + } + + @objc + public var asSendForSignaturePolicyChanged: DBXTeamLogEventTypeSendForSignaturePolicyChanged? { + self as? DBXTeamLogEventTypeSendForSignaturePolicyChanged + } + + @objc + public var asSharingChangeFolderJoinPolicy: DBXTeamLogEventTypeSharingChangeFolderJoinPolicy? { + self as? DBXTeamLogEventTypeSharingChangeFolderJoinPolicy + } + + @objc + public var asSharingChangeLinkAllowChangeExpirationPolicy: DBXTeamLogEventTypeSharingChangeLinkAllowChangeExpirationPolicy? { + self as? DBXTeamLogEventTypeSharingChangeLinkAllowChangeExpirationPolicy + } + + @objc + public var asSharingChangeLinkDefaultExpirationPolicy: DBXTeamLogEventTypeSharingChangeLinkDefaultExpirationPolicy? { + self as? DBXTeamLogEventTypeSharingChangeLinkDefaultExpirationPolicy + } + + @objc + public var asSharingChangeLinkEnforcePasswordPolicy: DBXTeamLogEventTypeSharingChangeLinkEnforcePasswordPolicy? { + self as? DBXTeamLogEventTypeSharingChangeLinkEnforcePasswordPolicy + } + + @objc + public var asSharingChangeLinkPolicy: DBXTeamLogEventTypeSharingChangeLinkPolicy? { + self as? DBXTeamLogEventTypeSharingChangeLinkPolicy + } + + @objc + public var asSharingChangeMemberPolicy: DBXTeamLogEventTypeSharingChangeMemberPolicy? { + self as? DBXTeamLogEventTypeSharingChangeMemberPolicy + } + + @objc + public var asShowcaseChangeDownloadPolicy: DBXTeamLogEventTypeShowcaseChangeDownloadPolicy? { + self as? DBXTeamLogEventTypeShowcaseChangeDownloadPolicy + } + + @objc + public var asShowcaseChangeEnabledPolicy: DBXTeamLogEventTypeShowcaseChangeEnabledPolicy? { + self as? DBXTeamLogEventTypeShowcaseChangeEnabledPolicy + } + + @objc + public var asShowcaseChangeExternalSharingPolicy: DBXTeamLogEventTypeShowcaseChangeExternalSharingPolicy? { + self as? DBXTeamLogEventTypeShowcaseChangeExternalSharingPolicy + } + + @objc + public var asSmarterSmartSyncPolicyChanged: DBXTeamLogEventTypeSmarterSmartSyncPolicyChanged? { + self as? DBXTeamLogEventTypeSmarterSmartSyncPolicyChanged + } + + @objc + public var asSmartSyncChangePolicy: DBXTeamLogEventTypeSmartSyncChangePolicy? { + self as? DBXTeamLogEventTypeSmartSyncChangePolicy + } + + @objc + public var asSmartSyncNotOptOut: DBXTeamLogEventTypeSmartSyncNotOptOut? { + self as? DBXTeamLogEventTypeSmartSyncNotOptOut + } + + @objc + public var asSmartSyncOptOut: DBXTeamLogEventTypeSmartSyncOptOut? { + self as? DBXTeamLogEventTypeSmartSyncOptOut + } + + @objc + public var asSsoChangePolicy: DBXTeamLogEventTypeSsoChangePolicy? { + self as? DBXTeamLogEventTypeSsoChangePolicy + } + + @objc + public var asTeamBrandingPolicyChanged: DBXTeamLogEventTypeTeamBrandingPolicyChanged? { + self as? DBXTeamLogEventTypeTeamBrandingPolicyChanged + } + + @objc + public var asTeamExtensionsPolicyChanged: DBXTeamLogEventTypeTeamExtensionsPolicyChanged? { + self as? DBXTeamLogEventTypeTeamExtensionsPolicyChanged + } + + @objc + public var asTeamSelectiveSyncPolicyChanged: DBXTeamLogEventTypeTeamSelectiveSyncPolicyChanged? { + self as? DBXTeamLogEventTypeTeamSelectiveSyncPolicyChanged + } + + @objc + public var asTeamSharingWhitelistSubjectsChanged: DBXTeamLogEventTypeTeamSharingWhitelistSubjectsChanged? { + self as? DBXTeamLogEventTypeTeamSharingWhitelistSubjectsChanged + } + + @objc + public var asTfaAddException: DBXTeamLogEventTypeTfaAddException? { + self as? DBXTeamLogEventTypeTfaAddException + } + + @objc + public var asTfaChangePolicy: DBXTeamLogEventTypeTfaChangePolicy? { + self as? DBXTeamLogEventTypeTfaChangePolicy + } + + @objc + public var asTfaRemoveException: DBXTeamLogEventTypeTfaRemoveException? { + self as? DBXTeamLogEventTypeTfaRemoveException + } + + @objc + public var asTwoAccountChangePolicy: DBXTeamLogEventTypeTwoAccountChangePolicy? { + self as? DBXTeamLogEventTypeTwoAccountChangePolicy + } + + @objc + public var asViewerInfoPolicyChanged: DBXTeamLogEventTypeViewerInfoPolicyChanged? { + self as? DBXTeamLogEventTypeViewerInfoPolicyChanged + } + + @objc + public var asWatermarkingPolicyChanged: DBXTeamLogEventTypeWatermarkingPolicyChanged? { + self as? DBXTeamLogEventTypeWatermarkingPolicyChanged + } + + @objc + public var asWebSessionsChangeActiveSessionLimit: DBXTeamLogEventTypeWebSessionsChangeActiveSessionLimit? { + self as? DBXTeamLogEventTypeWebSessionsChangeActiveSessionLimit + } + + @objc + public var asWebSessionsChangeFixedLengthPolicy: DBXTeamLogEventTypeWebSessionsChangeFixedLengthPolicy? { + self as? DBXTeamLogEventTypeWebSessionsChangeFixedLengthPolicy + } + + @objc + public var asWebSessionsChangeIdleLengthPolicy: DBXTeamLogEventTypeWebSessionsChangeIdleLengthPolicy? { + self as? DBXTeamLogEventTypeWebSessionsChangeIdleLengthPolicy + } + + @objc + public var asDataResidencyMigrationRequestSuccessful: DBXTeamLogEventTypeDataResidencyMigrationRequestSuccessful? { + self as? DBXTeamLogEventTypeDataResidencyMigrationRequestSuccessful + } + + @objc + public var asDataResidencyMigrationRequestUnsuccessful: DBXTeamLogEventTypeDataResidencyMigrationRequestUnsuccessful? { + self as? DBXTeamLogEventTypeDataResidencyMigrationRequestUnsuccessful + } + + @objc + public var asTeamMergeFrom: DBXTeamLogEventTypeTeamMergeFrom? { + self as? DBXTeamLogEventTypeTeamMergeFrom + } + + @objc + public var asTeamMergeTo: DBXTeamLogEventTypeTeamMergeTo? { + self as? DBXTeamLogEventTypeTeamMergeTo + } + + @objc + public var asTeamProfileAddBackground: DBXTeamLogEventTypeTeamProfileAddBackground? { + self as? DBXTeamLogEventTypeTeamProfileAddBackground + } + + @objc + public var asTeamProfileAddLogo: DBXTeamLogEventTypeTeamProfileAddLogo? { + self as? DBXTeamLogEventTypeTeamProfileAddLogo + } + + @objc + public var asTeamProfileChangeBackground: DBXTeamLogEventTypeTeamProfileChangeBackground? { + self as? DBXTeamLogEventTypeTeamProfileChangeBackground + } + + @objc + public var asTeamProfileChangeDefaultLanguage: DBXTeamLogEventTypeTeamProfileChangeDefaultLanguage? { + self as? DBXTeamLogEventTypeTeamProfileChangeDefaultLanguage + } + + @objc + public var asTeamProfileChangeLogo: DBXTeamLogEventTypeTeamProfileChangeLogo? { + self as? DBXTeamLogEventTypeTeamProfileChangeLogo + } + + @objc + public var asTeamProfileChangeName: DBXTeamLogEventTypeTeamProfileChangeName? { + self as? DBXTeamLogEventTypeTeamProfileChangeName + } + + @objc + public var asTeamProfileRemoveBackground: DBXTeamLogEventTypeTeamProfileRemoveBackground? { + self as? DBXTeamLogEventTypeTeamProfileRemoveBackground + } + + @objc + public var asTeamProfileRemoveLogo: DBXTeamLogEventTypeTeamProfileRemoveLogo? { + self as? DBXTeamLogEventTypeTeamProfileRemoveLogo + } + + @objc + public var asTfaAddBackupPhone: DBXTeamLogEventTypeTfaAddBackupPhone? { + self as? DBXTeamLogEventTypeTfaAddBackupPhone + } + + @objc + public var asTfaAddSecurityKey: DBXTeamLogEventTypeTfaAddSecurityKey? { + self as? DBXTeamLogEventTypeTfaAddSecurityKey + } + + @objc + public var asTfaChangeBackupPhone: DBXTeamLogEventTypeTfaChangeBackupPhone? { + self as? DBXTeamLogEventTypeTfaChangeBackupPhone + } + + @objc + public var asTfaChangeStatus: DBXTeamLogEventTypeTfaChangeStatus? { + self as? DBXTeamLogEventTypeTfaChangeStatus + } + + @objc + public var asTfaRemoveBackupPhone: DBXTeamLogEventTypeTfaRemoveBackupPhone? { + self as? DBXTeamLogEventTypeTfaRemoveBackupPhone + } + + @objc + public var asTfaRemoveSecurityKey: DBXTeamLogEventTypeTfaRemoveSecurityKey? { + self as? DBXTeamLogEventTypeTfaRemoveSecurityKey + } + + @objc + public var asTfaReset: DBXTeamLogEventTypeTfaReset? { + self as? DBXTeamLogEventTypeTfaReset + } + + @objc + public var asChangedEnterpriseAdminRole: DBXTeamLogEventTypeChangedEnterpriseAdminRole? { + self as? DBXTeamLogEventTypeChangedEnterpriseAdminRole + } + + @objc + public var asChangedEnterpriseConnectedTeamStatus: DBXTeamLogEventTypeChangedEnterpriseConnectedTeamStatus? { + self as? DBXTeamLogEventTypeChangedEnterpriseConnectedTeamStatus + } + + @objc + public var asEndedEnterpriseAdminSession: DBXTeamLogEventTypeEndedEnterpriseAdminSession? { + self as? DBXTeamLogEventTypeEndedEnterpriseAdminSession + } + + @objc + public var asEndedEnterpriseAdminSessionDeprecated: DBXTeamLogEventTypeEndedEnterpriseAdminSessionDeprecated? { + self as? DBXTeamLogEventTypeEndedEnterpriseAdminSessionDeprecated + } + + @objc + public var asEnterpriseSettingsLocking: DBXTeamLogEventTypeEnterpriseSettingsLocking? { + self as? DBXTeamLogEventTypeEnterpriseSettingsLocking + } + + @objc + public var asGuestAdminChangeStatus: DBXTeamLogEventTypeGuestAdminChangeStatus? { + self as? DBXTeamLogEventTypeGuestAdminChangeStatus + } + + @objc + public var asStartedEnterpriseAdminSession: DBXTeamLogEventTypeStartedEnterpriseAdminSession? { + self as? DBXTeamLogEventTypeStartedEnterpriseAdminSession + } + + @objc + public var asTeamMergeRequestAccepted: DBXTeamLogEventTypeTeamMergeRequestAccepted? { + self as? DBXTeamLogEventTypeTeamMergeRequestAccepted + } + + @objc + public var asTeamMergeRequestAcceptedShownToPrimaryTeam: DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestAcceptedShownToSecondaryTeam: DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestAutoCanceled: DBXTeamLogEventTypeTeamMergeRequestAutoCanceled? { + self as? DBXTeamLogEventTypeTeamMergeRequestAutoCanceled + } + + @objc + public var asTeamMergeRequestCanceled: DBXTeamLogEventTypeTeamMergeRequestCanceled? { + self as? DBXTeamLogEventTypeTeamMergeRequestCanceled + } + + @objc + public var asTeamMergeRequestCanceledShownToPrimaryTeam: DBXTeamLogEventTypeTeamMergeRequestCanceledShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestCanceledShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestCanceledShownToSecondaryTeam: DBXTeamLogEventTypeTeamMergeRequestCanceledShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestCanceledShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestExpired: DBXTeamLogEventTypeTeamMergeRequestExpired? { + self as? DBXTeamLogEventTypeTeamMergeRequestExpired + } + + @objc + public var asTeamMergeRequestExpiredShownToPrimaryTeam: DBXTeamLogEventTypeTeamMergeRequestExpiredShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestExpiredShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestExpiredShownToSecondaryTeam: DBXTeamLogEventTypeTeamMergeRequestExpiredShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestExpiredShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestRejectedShownToPrimaryTeam: DBXTeamLogEventTypeTeamMergeRequestRejectedShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestRejectedShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestRejectedShownToSecondaryTeam: DBXTeamLogEventTypeTeamMergeRequestRejectedShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestRejectedShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestReminder: DBXTeamLogEventTypeTeamMergeRequestReminder? { + self as? DBXTeamLogEventTypeTeamMergeRequestReminder + } + + @objc + public var asTeamMergeRequestReminderShownToPrimaryTeam: DBXTeamLogEventTypeTeamMergeRequestReminderShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestReminderShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestReminderShownToSecondaryTeam: DBXTeamLogEventTypeTeamMergeRequestReminderShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestReminderShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestRevoked: DBXTeamLogEventTypeTeamMergeRequestRevoked? { + self as? DBXTeamLogEventTypeTeamMergeRequestRevoked + } + + @objc + public var asTeamMergeRequestSentShownToPrimaryTeam: DBXTeamLogEventTypeTeamMergeRequestSentShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestSentShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestSentShownToSecondaryTeam: DBXTeamLogEventTypeTeamMergeRequestSentShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeTeamMergeRequestSentShownToSecondaryTeam + } + + @objc + public var asOther: DBXTeamLogEventTypeOther? { + self as? DBXTeamLogEventTypeOther + } +} + +/// (admin_alerting) Changed an alert state +@objc +public class DBXTeamLogEventTypeAdminAlertingAlertStateChanged: DBXTeamLogEventType { + @objc + public var adminAlertingAlertStateChanged: DBXTeamLogAdminAlertingAlertStateChangedType + + @objc + public init(_ arg: DBXTeamLogAdminAlertingAlertStateChangedType) { + self.adminAlertingAlertStateChanged = arg + let swift = TeamLog.EventType.adminAlertingAlertStateChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (admin_alerting) Changed an alert setting +@objc +public class DBXTeamLogEventTypeAdminAlertingChangedAlertConfig: DBXTeamLogEventType { + @objc + public var adminAlertingChangedAlertConfig: DBXTeamLogAdminAlertingChangedAlertConfigType + + @objc + public init(_ arg: DBXTeamLogAdminAlertingChangedAlertConfigType) { + self.adminAlertingChangedAlertConfig = arg + let swift = TeamLog.EventType.adminAlertingChangedAlertConfig(arg.swift) + super.init(swift: swift) + } +} + +/// (admin_alerting) Triggered security alert +@objc +public class DBXTeamLogEventTypeAdminAlertingTriggeredAlert: DBXTeamLogEventType { + @objc + public var adminAlertingTriggeredAlert: DBXTeamLogAdminAlertingTriggeredAlertType + + @objc + public init(_ arg: DBXTeamLogAdminAlertingTriggeredAlertType) { + self.adminAlertingTriggeredAlert = arg + let swift = TeamLog.EventType.adminAlertingTriggeredAlert(arg.swift) + super.init(swift: swift) + } +} + +/// (admin_alerting) Completed ransomware restore process +@objc +public class DBXTeamLogEventTypeRansomwareRestoreProcessCompleted: DBXTeamLogEventType { + @objc + public var ransomwareRestoreProcessCompleted: DBXTeamLogRansomwareRestoreProcessCompletedType + + @objc + public init(_ arg: DBXTeamLogRansomwareRestoreProcessCompletedType) { + self.ransomwareRestoreProcessCompleted = arg + let swift = TeamLog.EventType.ransomwareRestoreProcessCompleted(arg.swift) + super.init(swift: swift) + } +} + +/// (admin_alerting) Started ransomware restore process +@objc +public class DBXTeamLogEventTypeRansomwareRestoreProcessStarted: DBXTeamLogEventType { + @objc + public var ransomwareRestoreProcessStarted: DBXTeamLogRansomwareRestoreProcessStartedType + + @objc + public init(_ arg: DBXTeamLogRansomwareRestoreProcessStartedType) { + self.ransomwareRestoreProcessStarted = arg + let swift = TeamLog.EventType.ransomwareRestoreProcessStarted(arg.swift) + super.init(swift: swift) + } +} + +/// (apps) Failed to connect app for member +@objc +public class DBXTeamLogEventTypeAppBlockedByPermissions: DBXTeamLogEventType { + @objc + public var appBlockedByPermissions: DBXTeamLogAppBlockedByPermissionsType + + @objc + public init(_ arg: DBXTeamLogAppBlockedByPermissionsType) { + self.appBlockedByPermissions = arg + let swift = TeamLog.EventType.appBlockedByPermissions(arg.swift) + super.init(swift: swift) + } +} + +/// (apps) Linked app for team +@objc +public class DBXTeamLogEventTypeAppLinkTeam: DBXTeamLogEventType { + @objc + public var appLinkTeam: DBXTeamLogAppLinkTeamType + + @objc + public init(_ arg: DBXTeamLogAppLinkTeamType) { + self.appLinkTeam = arg + let swift = TeamLog.EventType.appLinkTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (apps) Linked app for member +@objc +public class DBXTeamLogEventTypeAppLinkUser: DBXTeamLogEventType { + @objc + public var appLinkUser: DBXTeamLogAppLinkUserType + + @objc + public init(_ arg: DBXTeamLogAppLinkUserType) { + self.appLinkUser = arg + let swift = TeamLog.EventType.appLinkUser(arg.swift) + super.init(swift: swift) + } +} + +/// (apps) Unlinked app for team +@objc +public class DBXTeamLogEventTypeAppUnlinkTeam: DBXTeamLogEventType { + @objc + public var appUnlinkTeam: DBXTeamLogAppUnlinkTeamType + + @objc + public init(_ arg: DBXTeamLogAppUnlinkTeamType) { + self.appUnlinkTeam = arg + let swift = TeamLog.EventType.appUnlinkTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (apps) Unlinked app for member +@objc +public class DBXTeamLogEventTypeAppUnlinkUser: DBXTeamLogEventType { + @objc + public var appUnlinkUser: DBXTeamLogAppUnlinkUserType + + @objc + public init(_ arg: DBXTeamLogAppUnlinkUserType) { + self.appUnlinkUser = arg + let swift = TeamLog.EventType.appUnlinkUser(arg.swift) + super.init(swift: swift) + } +} + +/// (apps) Connected integration for member +@objc +public class DBXTeamLogEventTypeIntegrationConnected: DBXTeamLogEventType { + @objc + public var integrationConnected: DBXTeamLogIntegrationConnectedType + + @objc + public init(_ arg: DBXTeamLogIntegrationConnectedType) { + self.integrationConnected = arg + let swift = TeamLog.EventType.integrationConnected(arg.swift) + super.init(swift: swift) + } +} + +/// (apps) Disconnected integration for member +@objc +public class DBXTeamLogEventTypeIntegrationDisconnected: DBXTeamLogEventType { + @objc + public var integrationDisconnected: DBXTeamLogIntegrationDisconnectedType + + @objc + public init(_ arg: DBXTeamLogIntegrationDisconnectedType) { + self.integrationDisconnected = arg + let swift = TeamLog.EventType.integrationDisconnected(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Added file comment +@objc +public class DBXTeamLogEventTypeFileAddComment: DBXTeamLogEventType { + @objc + public var fileAddComment: DBXTeamLogFileAddCommentType + + @objc + public init(_ arg: DBXTeamLogFileAddCommentType) { + self.fileAddComment = arg + let swift = TeamLog.EventType.fileAddComment(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Subscribed to or unsubscribed from comment notifications for file +@objc +public class DBXTeamLogEventTypeFileChangeCommentSubscription: DBXTeamLogEventType { + @objc + public var fileChangeCommentSubscription: DBXTeamLogFileChangeCommentSubscriptionType + + @objc + public init(_ arg: DBXTeamLogFileChangeCommentSubscriptionType) { + self.fileChangeCommentSubscription = arg + let swift = TeamLog.EventType.fileChangeCommentSubscription(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Deleted file comment +@objc +public class DBXTeamLogEventTypeFileDeleteComment: DBXTeamLogEventType { + @objc + public var fileDeleteComment: DBXTeamLogFileDeleteCommentType + + @objc + public init(_ arg: DBXTeamLogFileDeleteCommentType) { + self.fileDeleteComment = arg + let swift = TeamLog.EventType.fileDeleteComment(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Edited file comment +@objc +public class DBXTeamLogEventTypeFileEditComment: DBXTeamLogEventType { + @objc + public var fileEditComment: DBXTeamLogFileEditCommentType + + @objc + public init(_ arg: DBXTeamLogFileEditCommentType) { + self.fileEditComment = arg + let swift = TeamLog.EventType.fileEditComment(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Liked file comment (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeFileLikeComment: DBXTeamLogEventType { + @objc + public var fileLikeComment: DBXTeamLogFileLikeCommentType + + @objc + public init(_ arg: DBXTeamLogFileLikeCommentType) { + self.fileLikeComment = arg + let swift = TeamLog.EventType.fileLikeComment(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Resolved file comment +@objc +public class DBXTeamLogEventTypeFileResolveComment: DBXTeamLogEventType { + @objc + public var fileResolveComment: DBXTeamLogFileResolveCommentType + + @objc + public init(_ arg: DBXTeamLogFileResolveCommentType) { + self.fileResolveComment = arg + let swift = TeamLog.EventType.fileResolveComment(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Unliked file comment (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeFileUnlikeComment: DBXTeamLogEventType { + @objc + public var fileUnlikeComment: DBXTeamLogFileUnlikeCommentType + + @objc + public init(_ arg: DBXTeamLogFileUnlikeCommentType) { + self.fileUnlikeComment = arg + let swift = TeamLog.EventType.fileUnlikeComment(arg.swift) + super.init(swift: swift) + } +} + +/// (comments) Unresolved file comment +@objc +public class DBXTeamLogEventTypeFileUnresolveComment: DBXTeamLogEventType { + @objc + public var fileUnresolveComment: DBXTeamLogFileUnresolveCommentType + + @objc + public init(_ arg: DBXTeamLogFileUnresolveCommentType) { + self.fileUnresolveComment = arg + let swift = TeamLog.EventType.fileUnresolveComment(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Added folders to policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyAddFolders: DBXTeamLogEventType { + @objc + public var governancePolicyAddFolders: DBXTeamLogGovernancePolicyAddFoldersType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyAddFoldersType) { + self.governancePolicyAddFolders = arg + let swift = TeamLog.EventType.governancePolicyAddFolders(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Couldn't add a folder to a policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyAddFolderFailed: DBXTeamLogEventType { + @objc + public var governancePolicyAddFolderFailed: DBXTeamLogGovernancePolicyAddFolderFailedType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyAddFolderFailedType) { + self.governancePolicyAddFolderFailed = arg + let swift = TeamLog.EventType.governancePolicyAddFolderFailed(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Content disposed +@objc +public class DBXTeamLogEventTypeGovernancePolicyContentDisposed: DBXTeamLogEventType { + @objc + public var governancePolicyContentDisposed: DBXTeamLogGovernancePolicyContentDisposedType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyContentDisposedType) { + self.governancePolicyContentDisposed = arg + let swift = TeamLog.EventType.governancePolicyContentDisposed(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Activated a new policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyCreate: DBXTeamLogEventType { + @objc + public var governancePolicyCreate: DBXTeamLogGovernancePolicyCreateType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyCreateType) { + self.governancePolicyCreate = arg + let swift = TeamLog.EventType.governancePolicyCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Deleted a policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyDelete: DBXTeamLogEventType { + @objc + public var governancePolicyDelete: DBXTeamLogGovernancePolicyDeleteType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyDeleteType) { + self.governancePolicyDelete = arg + let swift = TeamLog.EventType.governancePolicyDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Edited policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyEditDetails: DBXTeamLogEventType { + @objc + public var governancePolicyEditDetails: DBXTeamLogGovernancePolicyEditDetailsType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyEditDetailsType) { + self.governancePolicyEditDetails = arg + let swift = TeamLog.EventType.governancePolicyEditDetails(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Changed policy duration +@objc +public class DBXTeamLogEventTypeGovernancePolicyEditDuration: DBXTeamLogEventType { + @objc + public var governancePolicyEditDuration: DBXTeamLogGovernancePolicyEditDurationType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyEditDurationType) { + self.governancePolicyEditDuration = arg + let swift = TeamLog.EventType.governancePolicyEditDuration(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Created a policy download +@objc +public class DBXTeamLogEventTypeGovernancePolicyExportCreated: DBXTeamLogEventType { + @objc + public var governancePolicyExportCreated: DBXTeamLogGovernancePolicyExportCreatedType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyExportCreatedType) { + self.governancePolicyExportCreated = arg + let swift = TeamLog.EventType.governancePolicyExportCreated(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Removed a policy download +@objc +public class DBXTeamLogEventTypeGovernancePolicyExportRemoved: DBXTeamLogEventType { + @objc + public var governancePolicyExportRemoved: DBXTeamLogGovernancePolicyExportRemovedType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyExportRemovedType) { + self.governancePolicyExportRemoved = arg + let swift = TeamLog.EventType.governancePolicyExportRemoved(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Removed folders from policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyRemoveFolders: DBXTeamLogEventType { + @objc + public var governancePolicyRemoveFolders: DBXTeamLogGovernancePolicyRemoveFoldersType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyRemoveFoldersType) { + self.governancePolicyRemoveFolders = arg + let swift = TeamLog.EventType.governancePolicyRemoveFolders(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Created a summary report for a policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyReportCreated: DBXTeamLogEventType { + @objc + public var governancePolicyReportCreated: DBXTeamLogGovernancePolicyReportCreatedType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyReportCreatedType) { + self.governancePolicyReportCreated = arg + let swift = TeamLog.EventType.governancePolicyReportCreated(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Downloaded content from a policy +@objc +public class DBXTeamLogEventTypeGovernancePolicyZipPartDownloaded: DBXTeamLogEventType { + @objc + public var governancePolicyZipPartDownloaded: DBXTeamLogGovernancePolicyZipPartDownloadedType + + @objc + public init(_ arg: DBXTeamLogGovernancePolicyZipPartDownloadedType) { + self.governancePolicyZipPartDownloaded = arg + let swift = TeamLog.EventType.governancePolicyZipPartDownloaded(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Activated a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsActivateAHold: DBXTeamLogEventType { + @objc + public var legalHoldsActivateAHold: DBXTeamLogLegalHoldsActivateAHoldType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsActivateAHoldType) { + self.legalHoldsActivateAHold = arg + let swift = TeamLog.EventType.legalHoldsActivateAHold(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Added members to a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsAddMembers: DBXTeamLogEventType { + @objc + public var legalHoldsAddMembers: DBXTeamLogLegalHoldsAddMembersType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsAddMembersType) { + self.legalHoldsAddMembers = arg + let swift = TeamLog.EventType.legalHoldsAddMembers(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Edited details for a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsChangeHoldDetails: DBXTeamLogEventType { + @objc + public var legalHoldsChangeHoldDetails: DBXTeamLogLegalHoldsChangeHoldDetailsType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsChangeHoldDetailsType) { + self.legalHoldsChangeHoldDetails = arg + let swift = TeamLog.EventType.legalHoldsChangeHoldDetails(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Renamed a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsChangeHoldName: DBXTeamLogEventType { + @objc + public var legalHoldsChangeHoldName: DBXTeamLogLegalHoldsChangeHoldNameType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsChangeHoldNameType) { + self.legalHoldsChangeHoldName = arg + let swift = TeamLog.EventType.legalHoldsChangeHoldName(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Exported hold +@objc +public class DBXTeamLogEventTypeLegalHoldsExportAHold: DBXTeamLogEventType { + @objc + public var legalHoldsExportAHold: DBXTeamLogLegalHoldsExportAHoldType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportAHoldType) { + self.legalHoldsExportAHold = arg + let swift = TeamLog.EventType.legalHoldsExportAHold(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Canceled export for a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsExportCancelled: DBXTeamLogEventType { + @objc + public var legalHoldsExportCancelled: DBXTeamLogLegalHoldsExportCancelledType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportCancelledType) { + self.legalHoldsExportCancelled = arg + let swift = TeamLog.EventType.legalHoldsExportCancelled(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Downloaded export for a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsExportDownloaded: DBXTeamLogEventType { + @objc + public var legalHoldsExportDownloaded: DBXTeamLogLegalHoldsExportDownloadedType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportDownloadedType) { + self.legalHoldsExportDownloaded = arg + let swift = TeamLog.EventType.legalHoldsExportDownloaded(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Removed export for a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsExportRemoved: DBXTeamLogEventType { + @objc + public var legalHoldsExportRemoved: DBXTeamLogLegalHoldsExportRemovedType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsExportRemovedType) { + self.legalHoldsExportRemoved = arg + let swift = TeamLog.EventType.legalHoldsExportRemoved(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Released a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsReleaseAHold: DBXTeamLogEventType { + @objc + public var legalHoldsReleaseAHold: DBXTeamLogLegalHoldsReleaseAHoldType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsReleaseAHoldType) { + self.legalHoldsReleaseAHold = arg + let swift = TeamLog.EventType.legalHoldsReleaseAHold(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Removed members from a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsRemoveMembers: DBXTeamLogEventType { + @objc + public var legalHoldsRemoveMembers: DBXTeamLogLegalHoldsRemoveMembersType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsRemoveMembersType) { + self.legalHoldsRemoveMembers = arg + let swift = TeamLog.EventType.legalHoldsRemoveMembers(arg.swift) + super.init(swift: swift) + } +} + +/// (data_governance) Created a summary report for a hold +@objc +public class DBXTeamLogEventTypeLegalHoldsReportAHold: DBXTeamLogEventType { + @objc + public var legalHoldsReportAHold: DBXTeamLogLegalHoldsReportAHoldType + + @objc + public init(_ arg: DBXTeamLogLegalHoldsReportAHoldType) { + self.legalHoldsReportAHold = arg + let swift = TeamLog.EventType.legalHoldsReportAHold(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Changed IP address associated with active desktop session +@objc +public class DBXTeamLogEventTypeDeviceChangeIpDesktop: DBXTeamLogEventType { + @objc + public var deviceChangeIpDesktop: DBXTeamLogDeviceChangeIpDesktopType + + @objc + public init(_ arg: DBXTeamLogDeviceChangeIpDesktopType) { + self.deviceChangeIpDesktop = arg + let swift = TeamLog.EventType.deviceChangeIpDesktop(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Changed IP address associated with active mobile session +@objc +public class DBXTeamLogEventTypeDeviceChangeIpMobile: DBXTeamLogEventType { + @objc + public var deviceChangeIpMobile: DBXTeamLogDeviceChangeIpMobileType + + @objc + public init(_ arg: DBXTeamLogDeviceChangeIpMobileType) { + self.deviceChangeIpMobile = arg + let swift = TeamLog.EventType.deviceChangeIpMobile(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Changed IP address associated with active web session +@objc +public class DBXTeamLogEventTypeDeviceChangeIpWeb: DBXTeamLogEventType { + @objc + public var deviceChangeIpWeb: DBXTeamLogDeviceChangeIpWebType + + @objc + public init(_ arg: DBXTeamLogDeviceChangeIpWebType) { + self.deviceChangeIpWeb = arg + let swift = TeamLog.EventType.deviceChangeIpWeb(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Failed to delete all files from unlinked device +@objc +public class DBXTeamLogEventTypeDeviceDeleteOnUnlinkFail: DBXTeamLogEventType { + @objc + public var deviceDeleteOnUnlinkFail: DBXTeamLogDeviceDeleteOnUnlinkFailType + + @objc + public init(_ arg: DBXTeamLogDeviceDeleteOnUnlinkFailType) { + self.deviceDeleteOnUnlinkFail = arg + let swift = TeamLog.EventType.deviceDeleteOnUnlinkFail(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Deleted all files from unlinked device +@objc +public class DBXTeamLogEventTypeDeviceDeleteOnUnlinkSuccess: DBXTeamLogEventType { + @objc + public var deviceDeleteOnUnlinkSuccess: DBXTeamLogDeviceDeleteOnUnlinkSuccessType + + @objc + public init(_ arg: DBXTeamLogDeviceDeleteOnUnlinkSuccessType) { + self.deviceDeleteOnUnlinkSuccess = arg + let swift = TeamLog.EventType.deviceDeleteOnUnlinkSuccess(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Failed to link device +@objc +public class DBXTeamLogEventTypeDeviceLinkFail: DBXTeamLogEventType { + @objc + public var deviceLinkFail: DBXTeamLogDeviceLinkFailType + + @objc + public init(_ arg: DBXTeamLogDeviceLinkFailType) { + self.deviceLinkFail = arg + let swift = TeamLog.EventType.deviceLinkFail(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Linked device +@objc +public class DBXTeamLogEventTypeDeviceLinkSuccess: DBXTeamLogEventType { + @objc + public var deviceLinkSuccess: DBXTeamLogDeviceLinkSuccessType + + @objc + public init(_ arg: DBXTeamLogDeviceLinkSuccessType) { + self.deviceLinkSuccess = arg + let swift = TeamLog.EventType.deviceLinkSuccess(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Disabled device management (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeDeviceManagementDisabled: DBXTeamLogEventType { + @objc + public var deviceManagementDisabled: DBXTeamLogDeviceManagementDisabledType + + @objc + public init(_ arg: DBXTeamLogDeviceManagementDisabledType) { + self.deviceManagementDisabled = arg + let swift = TeamLog.EventType.deviceManagementDisabled(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Enabled device management (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeDeviceManagementEnabled: DBXTeamLogEventType { + @objc + public var deviceManagementEnabled: DBXTeamLogDeviceManagementEnabledType + + @objc + public init(_ arg: DBXTeamLogDeviceManagementEnabledType) { + self.deviceManagementEnabled = arg + let swift = TeamLog.EventType.deviceManagementEnabled(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Enabled/disabled backup for computer +@objc +public class DBXTeamLogEventTypeDeviceSyncBackupStatusChanged: DBXTeamLogEventType { + @objc + public var deviceSyncBackupStatusChanged: DBXTeamLogDeviceSyncBackupStatusChangedType + + @objc + public init(_ arg: DBXTeamLogDeviceSyncBackupStatusChangedType) { + self.deviceSyncBackupStatusChanged = arg + let swift = TeamLog.EventType.deviceSyncBackupStatusChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Disconnected device +@objc +public class DBXTeamLogEventTypeDeviceUnlink: DBXTeamLogEventType { + @objc + public var deviceUnlink: DBXTeamLogDeviceUnlinkType + + @objc + public init(_ arg: DBXTeamLogDeviceUnlinkType) { + self.deviceUnlink = arg + let swift = TeamLog.EventType.deviceUnlink(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Exported passwords +@objc +public class DBXTeamLogEventTypeDropboxPasswordsExported: DBXTeamLogEventType { + @objc + public var dropboxPasswordsExported: DBXTeamLogDropboxPasswordsExportedType + + @objc + public init(_ arg: DBXTeamLogDropboxPasswordsExportedType) { + self.dropboxPasswordsExported = arg + let swift = TeamLog.EventType.dropboxPasswordsExported(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Enrolled new Dropbox Passwords device +@objc +public class DBXTeamLogEventTypeDropboxPasswordsNewDeviceEnrolled: DBXTeamLogEventType { + @objc + public var dropboxPasswordsNewDeviceEnrolled: DBXTeamLogDropboxPasswordsNewDeviceEnrolledType + + @objc + public init(_ arg: DBXTeamLogDropboxPasswordsNewDeviceEnrolledType) { + self.dropboxPasswordsNewDeviceEnrolled = arg + let swift = TeamLog.EventType.dropboxPasswordsNewDeviceEnrolled(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Refreshed auth token used for setting up EMM +@objc +public class DBXTeamLogEventTypeEmmRefreshAuthToken: DBXTeamLogEventType { + @objc + public var emmRefreshAuthToken: DBXTeamLogEmmRefreshAuthTokenType + + @objc + public init(_ arg: DBXTeamLogEmmRefreshAuthTokenType) { + self.emmRefreshAuthToken = arg + let swift = TeamLog.EventType.emmRefreshAuthToken(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Checked external drive backup eligibility status +@objc +public class DBXTeamLogEventTypeExternalDriveBackupEligibilityStatusChecked: DBXTeamLogEventType { + @objc + public var externalDriveBackupEligibilityStatusChecked: DBXTeamLogExternalDriveBackupEligibilityStatusCheckedType + + @objc + public init(_ arg: DBXTeamLogExternalDriveBackupEligibilityStatusCheckedType) { + self.externalDriveBackupEligibilityStatusChecked = arg + let swift = TeamLog.EventType.externalDriveBackupEligibilityStatusChecked(arg.swift) + super.init(swift: swift) + } +} + +/// (devices) Modified external drive backup +@objc +public class DBXTeamLogEventTypeExternalDriveBackupStatusChanged: DBXTeamLogEventType { + @objc + public var externalDriveBackupStatusChanged: DBXTeamLogExternalDriveBackupStatusChangedType + + @objc + public init(_ arg: DBXTeamLogExternalDriveBackupStatusChangedType) { + self.externalDriveBackupStatusChanged = arg + let swift = TeamLog.EventType.externalDriveBackupStatusChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Granted/revoked option to enable account capture on team domains +@objc +public class DBXTeamLogEventTypeAccountCaptureChangeAvailability: DBXTeamLogEventType { + @objc + public var accountCaptureChangeAvailability: DBXTeamLogAccountCaptureChangeAvailabilityType + + @objc + public init(_ arg: DBXTeamLogAccountCaptureChangeAvailabilityType) { + self.accountCaptureChangeAvailability = arg + let swift = TeamLog.EventType.accountCaptureChangeAvailability(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Account-captured user migrated account to team +@objc +public class DBXTeamLogEventTypeAccountCaptureMigrateAccount: DBXTeamLogEventType { + @objc + public var accountCaptureMigrateAccount: DBXTeamLogAccountCaptureMigrateAccountType + + @objc + public init(_ arg: DBXTeamLogAccountCaptureMigrateAccountType) { + self.accountCaptureMigrateAccount = arg + let swift = TeamLog.EventType.accountCaptureMigrateAccount(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Sent account capture email to all unmanaged members +@objc +public class DBXTeamLogEventTypeAccountCaptureNotificationEmailsSent: DBXTeamLogEventType { + @objc + public var accountCaptureNotificationEmailsSent: DBXTeamLogAccountCaptureNotificationEmailsSentType + + @objc + public init(_ arg: DBXTeamLogAccountCaptureNotificationEmailsSentType) { + self.accountCaptureNotificationEmailsSent = arg + let swift = TeamLog.EventType.accountCaptureNotificationEmailsSent(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Account-captured user changed account email to personal email +@objc +public class DBXTeamLogEventTypeAccountCaptureRelinquishAccount: DBXTeamLogEventType { + @objc + public var accountCaptureRelinquishAccount: DBXTeamLogAccountCaptureRelinquishAccountType + + @objc + public init(_ arg: DBXTeamLogAccountCaptureRelinquishAccountType) { + self.accountCaptureRelinquishAccount = arg + let swift = TeamLog.EventType.accountCaptureRelinquishAccount(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Disabled domain invites (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeDisabledDomainInvites: DBXTeamLogEventType { + @objc + public var disabledDomainInvites: DBXTeamLogDisabledDomainInvitesType + + @objc + public init(_ arg: DBXTeamLogDisabledDomainInvitesType) { + self.disabledDomainInvites = arg + let swift = TeamLog.EventType.disabledDomainInvites(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Approved user's request to join team +@objc +public class DBXTeamLogEventTypeDomainInvitesApproveRequestToJoinTeam: DBXTeamLogEventType { + @objc + public var domainInvitesApproveRequestToJoinTeam: DBXTeamLogDomainInvitesApproveRequestToJoinTeamType + + @objc + public init(_ arg: DBXTeamLogDomainInvitesApproveRequestToJoinTeamType) { + self.domainInvitesApproveRequestToJoinTeam = arg + let swift = TeamLog.EventType.domainInvitesApproveRequestToJoinTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Declined user's request to join team +@objc +public class DBXTeamLogEventTypeDomainInvitesDeclineRequestToJoinTeam: DBXTeamLogEventType { + @objc + public var domainInvitesDeclineRequestToJoinTeam: DBXTeamLogDomainInvitesDeclineRequestToJoinTeamType + + @objc + public init(_ arg: DBXTeamLogDomainInvitesDeclineRequestToJoinTeamType) { + self.domainInvitesDeclineRequestToJoinTeam = arg + let swift = TeamLog.EventType.domainInvitesDeclineRequestToJoinTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Sent domain invites to existing domain accounts (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeDomainInvitesEmailExistingUsers: DBXTeamLogEventType { + @objc + public var domainInvitesEmailExistingUsers: DBXTeamLogDomainInvitesEmailExistingUsersType + + @objc + public init(_ arg: DBXTeamLogDomainInvitesEmailExistingUsersType) { + self.domainInvitesEmailExistingUsers = arg + let swift = TeamLog.EventType.domainInvitesEmailExistingUsers(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Requested to join team +@objc +public class DBXTeamLogEventTypeDomainInvitesRequestToJoinTeam: DBXTeamLogEventType { + @objc + public var domainInvitesRequestToJoinTeam: DBXTeamLogDomainInvitesRequestToJoinTeamType + + @objc + public init(_ arg: DBXTeamLogDomainInvitesRequestToJoinTeamType) { + self.domainInvitesRequestToJoinTeam = arg + let swift = TeamLog.EventType.domainInvitesRequestToJoinTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Disabled "Automatically invite new users" (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToNo: DBXTeamLogEventType { + @objc + public var domainInvitesSetInviteNewUserPrefToNo: DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoType + + @objc + public init(_ arg: DBXTeamLogDomainInvitesSetInviteNewUserPrefToNoType) { + self.domainInvitesSetInviteNewUserPrefToNo = arg + let swift = TeamLog.EventType.domainInvitesSetInviteNewUserPrefToNo(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Enabled "Automatically invite new users" (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeDomainInvitesSetInviteNewUserPrefToYes: DBXTeamLogEventType { + @objc + public var domainInvitesSetInviteNewUserPrefToYes: DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesType + + @objc + public init(_ arg: DBXTeamLogDomainInvitesSetInviteNewUserPrefToYesType) { + self.domainInvitesSetInviteNewUserPrefToYes = arg + let swift = TeamLog.EventType.domainInvitesSetInviteNewUserPrefToYes(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Failed to verify team domain +@objc +public class DBXTeamLogEventTypeDomainVerificationAddDomainFail: DBXTeamLogEventType { + @objc + public var domainVerificationAddDomainFail: DBXTeamLogDomainVerificationAddDomainFailType + + @objc + public init(_ arg: DBXTeamLogDomainVerificationAddDomainFailType) { + self.domainVerificationAddDomainFail = arg + let swift = TeamLog.EventType.domainVerificationAddDomainFail(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Verified team domain +@objc +public class DBXTeamLogEventTypeDomainVerificationAddDomainSuccess: DBXTeamLogEventType { + @objc + public var domainVerificationAddDomainSuccess: DBXTeamLogDomainVerificationAddDomainSuccessType + + @objc + public init(_ arg: DBXTeamLogDomainVerificationAddDomainSuccessType) { + self.domainVerificationAddDomainSuccess = arg + let swift = TeamLog.EventType.domainVerificationAddDomainSuccess(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Removed domain from list of verified team domains +@objc +public class DBXTeamLogEventTypeDomainVerificationRemoveDomain: DBXTeamLogEventType { + @objc + public var domainVerificationRemoveDomain: DBXTeamLogDomainVerificationRemoveDomainType + + @objc + public init(_ arg: DBXTeamLogDomainVerificationRemoveDomainType) { + self.domainVerificationRemoveDomain = arg + let swift = TeamLog.EventType.domainVerificationRemoveDomain(arg.swift) + super.init(swift: swift) + } +} + +/// (domains) Enabled domain invites (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeEnabledDomainInvites: DBXTeamLogEventType { + @objc + public var enabledDomainInvites: DBXTeamLogEnabledDomainInvitesType + + @objc + public init(_ arg: DBXTeamLogEnabledDomainInvitesType) { + self.enabledDomainInvites = arg + let swift = TeamLog.EventType.enabledDomainInvites(arg.swift) + super.init(swift: swift) + } +} + +/// (encryption) Canceled team encryption key deletion +@objc +public class DBXTeamLogEventTypeTeamEncryptionKeyCancelKeyDeletion: DBXTeamLogEventType { + @objc + public var teamEncryptionKeyCancelKeyDeletion: DBXTeamLogTeamEncryptionKeyCancelKeyDeletionType + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyCancelKeyDeletionType) { + self.teamEncryptionKeyCancelKeyDeletion = arg + let swift = TeamLog.EventType.teamEncryptionKeyCancelKeyDeletion(arg.swift) + super.init(swift: swift) + } +} + +/// (encryption) Created team encryption key +@objc +public class DBXTeamLogEventTypeTeamEncryptionKeyCreateKey: DBXTeamLogEventType { + @objc + public var teamEncryptionKeyCreateKey: DBXTeamLogTeamEncryptionKeyCreateKeyType + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyCreateKeyType) { + self.teamEncryptionKeyCreateKey = arg + let swift = TeamLog.EventType.teamEncryptionKeyCreateKey(arg.swift) + super.init(swift: swift) + } +} + +/// (encryption) Deleted team encryption key +@objc +public class DBXTeamLogEventTypeTeamEncryptionKeyDeleteKey: DBXTeamLogEventType { + @objc + public var teamEncryptionKeyDeleteKey: DBXTeamLogTeamEncryptionKeyDeleteKeyType + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyDeleteKeyType) { + self.teamEncryptionKeyDeleteKey = arg + let swift = TeamLog.EventType.teamEncryptionKeyDeleteKey(arg.swift) + super.init(swift: swift) + } +} + +/// (encryption) Disabled team encryption key +@objc +public class DBXTeamLogEventTypeTeamEncryptionKeyDisableKey: DBXTeamLogEventType { + @objc + public var teamEncryptionKeyDisableKey: DBXTeamLogTeamEncryptionKeyDisableKeyType + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyDisableKeyType) { + self.teamEncryptionKeyDisableKey = arg + let swift = TeamLog.EventType.teamEncryptionKeyDisableKey(arg.swift) + super.init(swift: swift) + } +} + +/// (encryption) Enabled team encryption key +@objc +public class DBXTeamLogEventTypeTeamEncryptionKeyEnableKey: DBXTeamLogEventType { + @objc + public var teamEncryptionKeyEnableKey: DBXTeamLogTeamEncryptionKeyEnableKeyType + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyEnableKeyType) { + self.teamEncryptionKeyEnableKey = arg + let swift = TeamLog.EventType.teamEncryptionKeyEnableKey(arg.swift) + super.init(swift: swift) + } +} + +/// (encryption) Rotated team encryption key (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeTeamEncryptionKeyRotateKey: DBXTeamLogEventType { + @objc + public var teamEncryptionKeyRotateKey: DBXTeamLogTeamEncryptionKeyRotateKeyType + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyRotateKeyType) { + self.teamEncryptionKeyRotateKey = arg + let swift = TeamLog.EventType.teamEncryptionKeyRotateKey(arg.swift) + super.init(swift: swift) + } +} + +/// (encryption) Scheduled encryption key deletion +@objc +public class DBXTeamLogEventTypeTeamEncryptionKeyScheduleKeyDeletion: DBXTeamLogEventType { + @objc + public var teamEncryptionKeyScheduleKeyDeletion: DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionType + + @objc + public init(_ arg: DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionType) { + self.teamEncryptionKeyScheduleKeyDeletion = arg + let swift = TeamLog.EventType.teamEncryptionKeyScheduleKeyDeletion(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Applied naming convention +@objc +public class DBXTeamLogEventTypeApplyNamingConvention: DBXTeamLogEventType { + @objc + public var applyNamingConvention: DBXTeamLogApplyNamingConventionType + + @objc + public init(_ arg: DBXTeamLogApplyNamingConventionType) { + self.applyNamingConvention = arg + let swift = TeamLog.EventType.applyNamingConvention(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Created folders (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeCreateFolder: DBXTeamLogEventType { + @objc + public var createFolder: DBXTeamLogCreateFolderType + + @objc + public init(_ arg: DBXTeamLogCreateFolderType) { + self.createFolder = arg + let swift = TeamLog.EventType.createFolder(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Added files and/or folders +@objc +public class DBXTeamLogEventTypeFileAdd: DBXTeamLogEventType { + @objc + public var fileAdd: DBXTeamLogFileAddType + + @objc + public init(_ arg: DBXTeamLogFileAddType) { + self.fileAdd = arg + let swift = TeamLog.EventType.fileAdd(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Added files and/or folders from automation +@objc +public class DBXTeamLogEventTypeFileAddFromAutomation: DBXTeamLogEventType { + @objc + public var fileAddFromAutomation: DBXTeamLogFileAddFromAutomationType + + @objc + public init(_ arg: DBXTeamLogFileAddFromAutomationType) { + self.fileAddFromAutomation = arg + let swift = TeamLog.EventType.fileAddFromAutomation(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Copied files and/or folders +@objc +public class DBXTeamLogEventTypeFileCopy: DBXTeamLogEventType { + @objc + public var fileCopy: DBXTeamLogFileCopyType + + @objc + public init(_ arg: DBXTeamLogFileCopyType) { + self.fileCopy = arg + let swift = TeamLog.EventType.fileCopy(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Deleted files and/or folders +@objc +public class DBXTeamLogEventTypeFileDelete: DBXTeamLogEventType { + @objc + public var fileDelete: DBXTeamLogFileDeleteType + + @objc + public init(_ arg: DBXTeamLogFileDeleteType) { + self.fileDelete = arg + let swift = TeamLog.EventType.fileDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Downloaded files and/or folders +@objc +public class DBXTeamLogEventTypeFileDownload: DBXTeamLogEventType { + @objc + public var fileDownload: DBXTeamLogFileDownloadType + + @objc + public init(_ arg: DBXTeamLogFileDownloadType) { + self.fileDownload = arg + let swift = TeamLog.EventType.fileDownload(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Edited files +@objc +public class DBXTeamLogEventTypeFileEdit: DBXTeamLogEventType { + @objc + public var fileEdit: DBXTeamLogFileEditType + + @objc + public init(_ arg: DBXTeamLogFileEditType) { + self.fileEdit = arg + let swift = TeamLog.EventType.fileEdit(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Created copy reference to file/folder +@objc +public class DBXTeamLogEventTypeFileGetCopyReference: DBXTeamLogEventType { + @objc + public var fileGetCopyReference: DBXTeamLogFileGetCopyReferenceType + + @objc + public init(_ arg: DBXTeamLogFileGetCopyReferenceType) { + self.fileGetCopyReference = arg + let swift = TeamLog.EventType.fileGetCopyReference(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Locked/unlocked editing for a file +@objc +public class DBXTeamLogEventTypeFileLockingLockStatusChanged: DBXTeamLogEventType { + @objc + public var fileLockingLockStatusChanged: DBXTeamLogFileLockingLockStatusChangedType + + @objc + public init(_ arg: DBXTeamLogFileLockingLockStatusChangedType) { + self.fileLockingLockStatusChanged = arg + let swift = TeamLog.EventType.fileLockingLockStatusChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Moved files and/or folders +@objc +public class DBXTeamLogEventTypeFileMove: DBXTeamLogEventType { + @objc + public var fileMove: DBXTeamLogFileMoveType + + @objc + public init(_ arg: DBXTeamLogFileMoveType) { + self.fileMove = arg + let swift = TeamLog.EventType.fileMove(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Permanently deleted files and/or folders +@objc +public class DBXTeamLogEventTypeFilePermanentlyDelete: DBXTeamLogEventType { + @objc + public var filePermanentlyDelete: DBXTeamLogFilePermanentlyDeleteType + + @objc + public init(_ arg: DBXTeamLogFilePermanentlyDeleteType) { + self.filePermanentlyDelete = arg + let swift = TeamLog.EventType.filePermanentlyDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Previewed files and/or folders +@objc +public class DBXTeamLogEventTypeFilePreview: DBXTeamLogEventType { + @objc + public var filePreview: DBXTeamLogFilePreviewType + + @objc + public init(_ arg: DBXTeamLogFilePreviewType) { + self.filePreview = arg + let swift = TeamLog.EventType.filePreview(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Renamed files and/or folders +@objc +public class DBXTeamLogEventTypeFileRename: DBXTeamLogEventType { + @objc + public var fileRename: DBXTeamLogFileRenameType + + @objc + public init(_ arg: DBXTeamLogFileRenameType) { + self.fileRename = arg + let swift = TeamLog.EventType.fileRename(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Restored deleted files and/or folders +@objc +public class DBXTeamLogEventTypeFileRestore: DBXTeamLogEventType { + @objc + public var fileRestore: DBXTeamLogFileRestoreType + + @objc + public init(_ arg: DBXTeamLogFileRestoreType) { + self.fileRestore = arg + let swift = TeamLog.EventType.fileRestore(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Reverted files to previous version +@objc +public class DBXTeamLogEventTypeFileRevert: DBXTeamLogEventType { + @objc + public var fileRevert: DBXTeamLogFileRevertType + + @objc + public init(_ arg: DBXTeamLogFileRevertType) { + self.fileRevert = arg + let swift = TeamLog.EventType.fileRevert(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Rolled back file actions +@objc +public class DBXTeamLogEventTypeFileRollbackChanges: DBXTeamLogEventType { + @objc + public var fileRollbackChanges: DBXTeamLogFileRollbackChangesType + + @objc + public init(_ arg: DBXTeamLogFileRollbackChangesType) { + self.fileRollbackChanges = arg + let swift = TeamLog.EventType.fileRollbackChanges(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Saved file/folder using copy reference +@objc +public class DBXTeamLogEventTypeFileSaveCopyReference: DBXTeamLogEventType { + @objc + public var fileSaveCopyReference: DBXTeamLogFileSaveCopyReferenceType + + @objc + public init(_ arg: DBXTeamLogFileSaveCopyReferenceType) { + self.fileSaveCopyReference = arg + let swift = TeamLog.EventType.fileSaveCopyReference(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Updated folder overview +@objc +public class DBXTeamLogEventTypeFolderOverviewDescriptionChanged: DBXTeamLogEventType { + @objc + public var folderOverviewDescriptionChanged: DBXTeamLogFolderOverviewDescriptionChangedType + + @objc + public init(_ arg: DBXTeamLogFolderOverviewDescriptionChangedType) { + self.folderOverviewDescriptionChanged = arg + let swift = TeamLog.EventType.folderOverviewDescriptionChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Pinned item to folder overview +@objc +public class DBXTeamLogEventTypeFolderOverviewItemPinned: DBXTeamLogEventType { + @objc + public var folderOverviewItemPinned: DBXTeamLogFolderOverviewItemPinnedType + + @objc + public init(_ arg: DBXTeamLogFolderOverviewItemPinnedType) { + self.folderOverviewItemPinned = arg + let swift = TeamLog.EventType.folderOverviewItemPinned(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Unpinned item from folder overview +@objc +public class DBXTeamLogEventTypeFolderOverviewItemUnpinned: DBXTeamLogEventType { + @objc + public var folderOverviewItemUnpinned: DBXTeamLogFolderOverviewItemUnpinnedType + + @objc + public init(_ arg: DBXTeamLogFolderOverviewItemUnpinnedType) { + self.folderOverviewItemUnpinned = arg + let swift = TeamLog.EventType.folderOverviewItemUnpinned(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Added a label +@objc +public class DBXTeamLogEventTypeObjectLabelAdded: DBXTeamLogEventType { + @objc + public var objectLabelAdded: DBXTeamLogObjectLabelAddedType + + @objc + public init(_ arg: DBXTeamLogObjectLabelAddedType) { + self.objectLabelAdded = arg + let swift = TeamLog.EventType.objectLabelAdded(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Removed a label +@objc +public class DBXTeamLogEventTypeObjectLabelRemoved: DBXTeamLogEventType { + @objc + public var objectLabelRemoved: DBXTeamLogObjectLabelRemovedType + + @objc + public init(_ arg: DBXTeamLogObjectLabelRemovedType) { + self.objectLabelRemoved = arg + let swift = TeamLog.EventType.objectLabelRemoved(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Updated a label's value +@objc +public class DBXTeamLogEventTypeObjectLabelUpdatedValue: DBXTeamLogEventType { + @objc + public var objectLabelUpdatedValue: DBXTeamLogObjectLabelUpdatedValueType + + @objc + public init(_ arg: DBXTeamLogObjectLabelUpdatedValueType) { + self.objectLabelUpdatedValue = arg + let swift = TeamLog.EventType.objectLabelUpdatedValue(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Organized a folder with multi-file organize +@objc +public class DBXTeamLogEventTypeOrganizeFolderWithTidy: DBXTeamLogEventType { + @objc + public var organizeFolderWithTidy: DBXTeamLogOrganizeFolderWithTidyType + + @objc + public init(_ arg: DBXTeamLogOrganizeFolderWithTidyType) { + self.organizeFolderWithTidy = arg + let swift = TeamLog.EventType.organizeFolderWithTidy(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Deleted files in Replay +@objc +public class DBXTeamLogEventTypeReplayFileDelete: DBXTeamLogEventType { + @objc + public var replayFileDelete: DBXTeamLogReplayFileDeleteType + + @objc + public init(_ arg: DBXTeamLogReplayFileDeleteType) { + self.replayFileDelete = arg + let swift = TeamLog.EventType.replayFileDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Rewound a folder +@objc +public class DBXTeamLogEventTypeRewindFolder: DBXTeamLogEventType { + @objc + public var rewindFolder: DBXTeamLogRewindFolderType + + @objc + public init(_ arg: DBXTeamLogRewindFolderType) { + self.rewindFolder = arg + let swift = TeamLog.EventType.rewindFolder(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Reverted naming convention +@objc +public class DBXTeamLogEventTypeUndoNamingConvention: DBXTeamLogEventType { + @objc + public var undoNamingConvention: DBXTeamLogUndoNamingConventionType + + @objc + public init(_ arg: DBXTeamLogUndoNamingConventionType) { + self.undoNamingConvention = arg + let swift = TeamLog.EventType.undoNamingConvention(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Removed multi-file organize +@objc +public class DBXTeamLogEventTypeUndoOrganizeFolderWithTidy: DBXTeamLogEventType { + @objc + public var undoOrganizeFolderWithTidy: DBXTeamLogUndoOrganizeFolderWithTidyType + + @objc + public init(_ arg: DBXTeamLogUndoOrganizeFolderWithTidyType) { + self.undoOrganizeFolderWithTidy = arg + let swift = TeamLog.EventType.undoOrganizeFolderWithTidy(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Tagged a file +@objc +public class DBXTeamLogEventTypeUserTagsAdded: DBXTeamLogEventType { + @objc + public var userTagsAdded: DBXTeamLogUserTagsAddedType + + @objc + public init(_ arg: DBXTeamLogUserTagsAddedType) { + self.userTagsAdded = arg + let swift = TeamLog.EventType.userTagsAdded(arg.swift) + super.init(swift: swift) + } +} + +/// (file_operations) Removed tags +@objc +public class DBXTeamLogEventTypeUserTagsRemoved: DBXTeamLogEventType { + @objc + public var userTagsRemoved: DBXTeamLogUserTagsRemovedType + + @objc + public init(_ arg: DBXTeamLogUserTagsRemovedType) { + self.userTagsRemoved = arg + let swift = TeamLog.EventType.userTagsRemoved(arg.swift) + super.init(swift: swift) + } +} + +/// (file_requests) Received files via Email to Dropbox +@objc +public class DBXTeamLogEventTypeEmailIngestReceiveFile: DBXTeamLogEventType { + @objc + public var emailIngestReceiveFile: DBXTeamLogEmailIngestReceiveFileType + + @objc + public init(_ arg: DBXTeamLogEmailIngestReceiveFileType) { + self.emailIngestReceiveFile = arg + let swift = TeamLog.EventType.emailIngestReceiveFile(arg.swift) + super.init(swift: swift) + } +} + +/// (file_requests) Changed file request +@objc +public class DBXTeamLogEventTypeFileRequestChange: DBXTeamLogEventType { + @objc + public var fileRequestChange: DBXTeamLogFileRequestChangeType + + @objc + public init(_ arg: DBXTeamLogFileRequestChangeType) { + self.fileRequestChange = arg + let swift = TeamLog.EventType.fileRequestChange(arg.swift) + super.init(swift: swift) + } +} + +/// (file_requests) Closed file request +@objc +public class DBXTeamLogEventTypeFileRequestClose: DBXTeamLogEventType { + @objc + public var fileRequestClose: DBXTeamLogFileRequestCloseType + + @objc + public init(_ arg: DBXTeamLogFileRequestCloseType) { + self.fileRequestClose = arg + let swift = TeamLog.EventType.fileRequestClose(arg.swift) + super.init(swift: swift) + } +} + +/// (file_requests) Created file request +@objc +public class DBXTeamLogEventTypeFileRequestCreate: DBXTeamLogEventType { + @objc + public var fileRequestCreate: DBXTeamLogFileRequestCreateType + + @objc + public init(_ arg: DBXTeamLogFileRequestCreateType) { + self.fileRequestCreate = arg + let swift = TeamLog.EventType.fileRequestCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (file_requests) Delete file request +@objc +public class DBXTeamLogEventTypeFileRequestDelete: DBXTeamLogEventType { + @objc + public var fileRequestDelete: DBXTeamLogFileRequestDeleteType + + @objc + public init(_ arg: DBXTeamLogFileRequestDeleteType) { + self.fileRequestDelete = arg + let swift = TeamLog.EventType.fileRequestDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (file_requests) Received files for file request +@objc +public class DBXTeamLogEventTypeFileRequestReceiveFile: DBXTeamLogEventType { + @objc + public var fileRequestReceiveFile: DBXTeamLogFileRequestReceiveFileType + + @objc + public init(_ arg: DBXTeamLogFileRequestReceiveFileType) { + self.fileRequestReceiveFile = arg + let swift = TeamLog.EventType.fileRequestReceiveFile(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Added external ID for group +@objc +public class DBXTeamLogEventTypeGroupAddExternalId: DBXTeamLogEventType { + @objc + public var groupAddExternalId: DBXTeamLogGroupAddExternalIdType + + @objc + public init(_ arg: DBXTeamLogGroupAddExternalIdType) { + self.groupAddExternalId = arg + let swift = TeamLog.EventType.groupAddExternalId(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Added team members to group +@objc +public class DBXTeamLogEventTypeGroupAddMember: DBXTeamLogEventType { + @objc + public var groupAddMember: DBXTeamLogGroupAddMemberType + + @objc + public init(_ arg: DBXTeamLogGroupAddMemberType) { + self.groupAddMember = arg + let swift = TeamLog.EventType.groupAddMember(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Changed external ID for group +@objc +public class DBXTeamLogEventTypeGroupChangeExternalId: DBXTeamLogEventType { + @objc + public var groupChangeExternalId: DBXTeamLogGroupChangeExternalIdType + + @objc + public init(_ arg: DBXTeamLogGroupChangeExternalIdType) { + self.groupChangeExternalId = arg + let swift = TeamLog.EventType.groupChangeExternalId(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Changed group management type +@objc +public class DBXTeamLogEventTypeGroupChangeManagementType: DBXTeamLogEventType { + @objc + public var groupChangeManagementType: DBXTeamLogGroupChangeManagementTypeType + + @objc + public init(_ arg: DBXTeamLogGroupChangeManagementTypeType) { + self.groupChangeManagementType = arg + let swift = TeamLog.EventType.groupChangeManagementType(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Changed manager permissions of group member +@objc +public class DBXTeamLogEventTypeGroupChangeMemberRole: DBXTeamLogEventType { + @objc + public var groupChangeMemberRole: DBXTeamLogGroupChangeMemberRoleType + + @objc + public init(_ arg: DBXTeamLogGroupChangeMemberRoleType) { + self.groupChangeMemberRole = arg + let swift = TeamLog.EventType.groupChangeMemberRole(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Created group +@objc +public class DBXTeamLogEventTypeGroupCreate: DBXTeamLogEventType { + @objc + public var groupCreate: DBXTeamLogGroupCreateType + + @objc + public init(_ arg: DBXTeamLogGroupCreateType) { + self.groupCreate = arg + let swift = TeamLog.EventType.groupCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Deleted group +@objc +public class DBXTeamLogEventTypeGroupDelete: DBXTeamLogEventType { + @objc + public var groupDelete: DBXTeamLogGroupDeleteType + + @objc + public init(_ arg: DBXTeamLogGroupDeleteType) { + self.groupDelete = arg + let swift = TeamLog.EventType.groupDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Updated group (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeGroupDescriptionUpdated: DBXTeamLogEventType { + @objc + public var groupDescriptionUpdated: DBXTeamLogGroupDescriptionUpdatedType + + @objc + public init(_ arg: DBXTeamLogGroupDescriptionUpdatedType) { + self.groupDescriptionUpdated = arg + let swift = TeamLog.EventType.groupDescriptionUpdated(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Updated group join policy (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeGroupJoinPolicyUpdated: DBXTeamLogEventType { + @objc + public var groupJoinPolicyUpdated: DBXTeamLogGroupJoinPolicyUpdatedType + + @objc + public init(_ arg: DBXTeamLogGroupJoinPolicyUpdatedType) { + self.groupJoinPolicyUpdated = arg + let swift = TeamLog.EventType.groupJoinPolicyUpdated(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Moved group (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeGroupMoved: DBXTeamLogEventType { + @objc + public var groupMoved: DBXTeamLogGroupMovedType + + @objc + public init(_ arg: DBXTeamLogGroupMovedType) { + self.groupMoved = arg + let swift = TeamLog.EventType.groupMoved(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Removed external ID for group +@objc +public class DBXTeamLogEventTypeGroupRemoveExternalId: DBXTeamLogEventType { + @objc + public var groupRemoveExternalId: DBXTeamLogGroupRemoveExternalIdType + + @objc + public init(_ arg: DBXTeamLogGroupRemoveExternalIdType) { + self.groupRemoveExternalId = arg + let swift = TeamLog.EventType.groupRemoveExternalId(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Removed team members from group +@objc +public class DBXTeamLogEventTypeGroupRemoveMember: DBXTeamLogEventType { + @objc + public var groupRemoveMember: DBXTeamLogGroupRemoveMemberType + + @objc + public init(_ arg: DBXTeamLogGroupRemoveMemberType) { + self.groupRemoveMember = arg + let swift = TeamLog.EventType.groupRemoveMember(arg.swift) + super.init(swift: swift) + } +} + +/// (groups) Renamed group +@objc +public class DBXTeamLogEventTypeGroupRename: DBXTeamLogEventType { + @objc + public var groupRename: DBXTeamLogGroupRenameType + + @objc + public init(_ arg: DBXTeamLogGroupRenameType) { + self.groupRename = arg + let swift = TeamLog.EventType.groupRename(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Unlocked/locked account after failed sign in attempts +@objc +public class DBXTeamLogEventTypeAccountLockOrUnlocked: DBXTeamLogEventType { + @objc + public var accountLockOrUnlocked: DBXTeamLogAccountLockOrUnlockedType + + @objc + public init(_ arg: DBXTeamLogAccountLockOrUnlockedType) { + self.accountLockOrUnlocked = arg + let swift = TeamLog.EventType.accountLockOrUnlocked(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Failed to sign in via EMM (deprecated, replaced by 'Failed to sign in') +@objc +public class DBXTeamLogEventTypeEmmError: DBXTeamLogEventType { + @objc + public var emmError: DBXTeamLogEmmErrorType + + @objc + public init(_ arg: DBXTeamLogEmmErrorType) { + self.emmError = arg + let swift = TeamLog.EventType.emmError(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Started trusted team admin session +@objc +public class DBXTeamLogEventTypeGuestAdminSignedInViaTrustedTeams: DBXTeamLogEventType { + @objc + public var guestAdminSignedInViaTrustedTeams: DBXTeamLogGuestAdminSignedInViaTrustedTeamsType + + @objc + public init(_ arg: DBXTeamLogGuestAdminSignedInViaTrustedTeamsType) { + self.guestAdminSignedInViaTrustedTeams = arg + let swift = TeamLog.EventType.guestAdminSignedInViaTrustedTeams(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Ended trusted team admin session +@objc +public class DBXTeamLogEventTypeGuestAdminSignedOutViaTrustedTeams: DBXTeamLogEventType { + @objc + public var guestAdminSignedOutViaTrustedTeams: DBXTeamLogGuestAdminSignedOutViaTrustedTeamsType + + @objc + public init(_ arg: DBXTeamLogGuestAdminSignedOutViaTrustedTeamsType) { + self.guestAdminSignedOutViaTrustedTeams = arg + let swift = TeamLog.EventType.guestAdminSignedOutViaTrustedTeams(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Failed to sign in +@objc +public class DBXTeamLogEventTypeLoginFail: DBXTeamLogEventType { + @objc + public var loginFail: DBXTeamLogLoginFailType + + @objc + public init(_ arg: DBXTeamLogLoginFailType) { + self.loginFail = arg + let swift = TeamLog.EventType.loginFail(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Signed in +@objc +public class DBXTeamLogEventTypeLoginSuccess: DBXTeamLogEventType { + @objc + public var loginSuccess: DBXTeamLogLoginSuccessType + + @objc + public init(_ arg: DBXTeamLogLoginSuccessType) { + self.loginSuccess = arg + let swift = TeamLog.EventType.loginSuccess(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Signed out +@objc +public class DBXTeamLogEventTypeLogout: DBXTeamLogEventType { + @objc + public var logout: DBXTeamLogLogoutType + + @objc + public init(_ arg: DBXTeamLogLogoutType) { + self.logout = arg + let swift = TeamLog.EventType.logout(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Ended reseller support session +@objc +public class DBXTeamLogEventTypeResellerSupportSessionEnd: DBXTeamLogEventType { + @objc + public var resellerSupportSessionEnd: DBXTeamLogResellerSupportSessionEndType + + @objc + public init(_ arg: DBXTeamLogResellerSupportSessionEndType) { + self.resellerSupportSessionEnd = arg + let swift = TeamLog.EventType.resellerSupportSessionEnd(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Started reseller support session +@objc +public class DBXTeamLogEventTypeResellerSupportSessionStart: DBXTeamLogEventType { + @objc + public var resellerSupportSessionStart: DBXTeamLogResellerSupportSessionStartType + + @objc + public init(_ arg: DBXTeamLogResellerSupportSessionStartType) { + self.resellerSupportSessionStart = arg + let swift = TeamLog.EventType.resellerSupportSessionStart(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Ended admin sign-in-as session +@objc +public class DBXTeamLogEventTypeSignInAsSessionEnd: DBXTeamLogEventType { + @objc + public var signInAsSessionEnd: DBXTeamLogSignInAsSessionEndType + + @objc + public init(_ arg: DBXTeamLogSignInAsSessionEndType) { + self.signInAsSessionEnd = arg + let swift = TeamLog.EventType.signInAsSessionEnd(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Started admin sign-in-as session +@objc +public class DBXTeamLogEventTypeSignInAsSessionStart: DBXTeamLogEventType { + @objc + public var signInAsSessionStart: DBXTeamLogSignInAsSessionStartType + + @objc + public init(_ arg: DBXTeamLogSignInAsSessionStartType) { + self.signInAsSessionStart = arg + let swift = TeamLog.EventType.signInAsSessionStart(arg.swift) + super.init(swift: swift) + } +} + +/// (logins) Failed to sign in via SSO (deprecated, replaced by 'Failed to sign in') +@objc +public class DBXTeamLogEventTypeSsoError: DBXTeamLogEventType { + @objc + public var ssoError: DBXTeamLogSsoErrorType + + @objc + public init(_ arg: DBXTeamLogSsoErrorType) { + self.ssoError = arg + let swift = TeamLog.EventType.ssoError(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Invited members to activate Backup +@objc +public class DBXTeamLogEventTypeBackupAdminInvitationSent: DBXTeamLogEventType { + @objc + public var backupAdminInvitationSent: DBXTeamLogBackupAdminInvitationSentType + + @objc + public init(_ arg: DBXTeamLogBackupAdminInvitationSentType) { + self.backupAdminInvitationSent = arg + let swift = TeamLog.EventType.backupAdminInvitationSent(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Opened Backup invite +@objc +public class DBXTeamLogEventTypeBackupInvitationOpened: DBXTeamLogEventType { + @objc + public var backupInvitationOpened: DBXTeamLogBackupInvitationOpenedType + + @objc + public init(_ arg: DBXTeamLogBackupInvitationOpenedType) { + self.backupInvitationOpened = arg + let swift = TeamLog.EventType.backupInvitationOpened(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Created team invite link +@objc +public class DBXTeamLogEventTypeCreateTeamInviteLink: DBXTeamLogEventType { + @objc + public var createTeamInviteLink: DBXTeamLogCreateTeamInviteLinkType + + @objc + public init(_ arg: DBXTeamLogCreateTeamInviteLinkType) { + self.createTeamInviteLink = arg + let swift = TeamLog.EventType.createTeamInviteLink(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Deleted team invite link +@objc +public class DBXTeamLogEventTypeDeleteTeamInviteLink: DBXTeamLogEventType { + @objc + public var deleteTeamInviteLink: DBXTeamLogDeleteTeamInviteLinkType + + @objc + public init(_ arg: DBXTeamLogDeleteTeamInviteLinkType) { + self.deleteTeamInviteLink = arg + let swift = TeamLog.EventType.deleteTeamInviteLink(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Added an external ID for team member +@objc +public class DBXTeamLogEventTypeMemberAddExternalId: DBXTeamLogEventType { + @objc + public var memberAddExternalId: DBXTeamLogMemberAddExternalIdType + + @objc + public init(_ arg: DBXTeamLogMemberAddExternalIdType) { + self.memberAddExternalId = arg + let swift = TeamLog.EventType.memberAddExternalId(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Added team member name +@objc +public class DBXTeamLogEventTypeMemberAddName: DBXTeamLogEventType { + @objc + public var memberAddName: DBXTeamLogMemberAddNameType + + @objc + public init(_ arg: DBXTeamLogMemberAddNameType) { + self.memberAddName = arg + let swift = TeamLog.EventType.memberAddName(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed team member admin role +@objc +public class DBXTeamLogEventTypeMemberChangeAdminRole: DBXTeamLogEventType { + @objc + public var memberChangeAdminRole: DBXTeamLogMemberChangeAdminRoleType + + @objc + public init(_ arg: DBXTeamLogMemberChangeAdminRoleType) { + self.memberChangeAdminRole = arg + let swift = TeamLog.EventType.memberChangeAdminRole(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed team member email +@objc +public class DBXTeamLogEventTypeMemberChangeEmail: DBXTeamLogEventType { + @objc + public var memberChangeEmail: DBXTeamLogMemberChangeEmailType + + @objc + public init(_ arg: DBXTeamLogMemberChangeEmailType) { + self.memberChangeEmail = arg + let swift = TeamLog.EventType.memberChangeEmail(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed the external ID for team member +@objc +public class DBXTeamLogEventTypeMemberChangeExternalId: DBXTeamLogEventType { + @objc + public var memberChangeExternalId: DBXTeamLogMemberChangeExternalIdType + + @objc + public init(_ arg: DBXTeamLogMemberChangeExternalIdType) { + self.memberChangeExternalId = arg + let swift = TeamLog.EventType.memberChangeExternalId(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed membership type (limited/full) of member (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeMemberChangeMembershipType: DBXTeamLogEventType { + @objc + public var memberChangeMembershipType: DBXTeamLogMemberChangeMembershipTypeType + + @objc + public init(_ arg: DBXTeamLogMemberChangeMembershipTypeType) { + self.memberChangeMembershipType = arg + let swift = TeamLog.EventType.memberChangeMembershipType(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed team member name +@objc +public class DBXTeamLogEventTypeMemberChangeName: DBXTeamLogEventType { + @objc + public var memberChangeName: DBXTeamLogMemberChangeNameType + + @objc + public init(_ arg: DBXTeamLogMemberChangeNameType) { + self.memberChangeName = arg + let swift = TeamLog.EventType.memberChangeName(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed team member reseller role +@objc +public class DBXTeamLogEventTypeMemberChangeResellerRole: DBXTeamLogEventType { + @objc + public var memberChangeResellerRole: DBXTeamLogMemberChangeResellerRoleType + + @objc + public init(_ arg: DBXTeamLogMemberChangeResellerRoleType) { + self.memberChangeResellerRole = arg + let swift = TeamLog.EventType.memberChangeResellerRole(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed member status (invited, joined, suspended, etc.) +@objc +public class DBXTeamLogEventTypeMemberChangeStatus: DBXTeamLogEventType { + @objc + public var memberChangeStatus: DBXTeamLogMemberChangeStatusType + + @objc + public init(_ arg: DBXTeamLogMemberChangeStatusType) { + self.memberChangeStatus = arg + let swift = TeamLog.EventType.memberChangeStatus(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Cleared manually added contacts +@objc +public class DBXTeamLogEventTypeMemberDeleteManualContacts: DBXTeamLogEventType { + @objc + public var memberDeleteManualContacts: DBXTeamLogMemberDeleteManualContactsType + + @objc + public init(_ arg: DBXTeamLogMemberDeleteManualContactsType) { + self.memberDeleteManualContacts = arg + let swift = TeamLog.EventType.memberDeleteManualContacts(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Deleted team member profile photo +@objc +public class DBXTeamLogEventTypeMemberDeleteProfilePhoto: DBXTeamLogEventType { + @objc + public var memberDeleteProfilePhoto: DBXTeamLogMemberDeleteProfilePhotoType + + @objc + public init(_ arg: DBXTeamLogMemberDeleteProfilePhotoType) { + self.memberDeleteProfilePhoto = arg + let swift = TeamLog.EventType.memberDeleteProfilePhoto(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Permanently deleted contents of deleted team member account +@objc +public class DBXTeamLogEventTypeMemberPermanentlyDeleteAccountContents: DBXTeamLogEventType { + @objc + public var memberPermanentlyDeleteAccountContents: DBXTeamLogMemberPermanentlyDeleteAccountContentsType + + @objc + public init(_ arg: DBXTeamLogMemberPermanentlyDeleteAccountContentsType) { + self.memberPermanentlyDeleteAccountContents = arg + let swift = TeamLog.EventType.memberPermanentlyDeleteAccountContents(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Removed the external ID for team member +@objc +public class DBXTeamLogEventTypeMemberRemoveExternalId: DBXTeamLogEventType { + @objc + public var memberRemoveExternalId: DBXTeamLogMemberRemoveExternalIdType + + @objc + public init(_ arg: DBXTeamLogMemberRemoveExternalIdType) { + self.memberRemoveExternalId = arg + let swift = TeamLog.EventType.memberRemoveExternalId(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Set team member profile photo +@objc +public class DBXTeamLogEventTypeMemberSetProfilePhoto: DBXTeamLogEventType { + @objc + public var memberSetProfilePhoto: DBXTeamLogMemberSetProfilePhotoType + + @objc + public init(_ arg: DBXTeamLogMemberSetProfilePhotoType) { + self.memberSetProfilePhoto = arg + let swift = TeamLog.EventType.memberSetProfilePhoto(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Set custom member space limit +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsAddCustomQuota: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsAddCustomQuota: DBXTeamLogMemberSpaceLimitsAddCustomQuotaType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsAddCustomQuotaType) { + self.memberSpaceLimitsAddCustomQuota = arg + let swift = TeamLog.EventType.memberSpaceLimitsAddCustomQuota(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed custom member space limit +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsChangeCustomQuota: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsChangeCustomQuota: DBXTeamLogMemberSpaceLimitsChangeCustomQuotaType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangeCustomQuotaType) { + self.memberSpaceLimitsChangeCustomQuota = arg + let swift = TeamLog.EventType.memberSpaceLimitsChangeCustomQuota(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Changed space limit status +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsChangeStatus: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsChangeStatus: DBXTeamLogMemberSpaceLimitsChangeStatusType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangeStatusType) { + self.memberSpaceLimitsChangeStatus = arg + let swift = TeamLog.EventType.memberSpaceLimitsChangeStatus(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Removed custom member space limit +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsRemoveCustomQuota: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsRemoveCustomQuota: DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaType) { + self.memberSpaceLimitsRemoveCustomQuota = arg + let swift = TeamLog.EventType.memberSpaceLimitsRemoveCustomQuota(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Suggested person to add to team +@objc +public class DBXTeamLogEventTypeMemberSuggest: DBXTeamLogEventType { + @objc + public var memberSuggest: DBXTeamLogMemberSuggestType + + @objc + public init(_ arg: DBXTeamLogMemberSuggestType) { + self.memberSuggest = arg + let swift = TeamLog.EventType.memberSuggest(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Transferred contents of deleted member account to another member +@objc +public class DBXTeamLogEventTypeMemberTransferAccountContents: DBXTeamLogEventType { + @objc + public var memberTransferAccountContents: DBXTeamLogMemberTransferAccountContentsType + + @objc + public init(_ arg: DBXTeamLogMemberTransferAccountContentsType) { + self.memberTransferAccountContents = arg + let swift = TeamLog.EventType.memberTransferAccountContents(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Added pending secondary email +@objc +public class DBXTeamLogEventTypePendingSecondaryEmailAdded: DBXTeamLogEventType { + @objc + public var pendingSecondaryEmailAdded: DBXTeamLogPendingSecondaryEmailAddedType + + @objc + public init(_ arg: DBXTeamLogPendingSecondaryEmailAddedType) { + self.pendingSecondaryEmailAdded = arg + let swift = TeamLog.EventType.pendingSecondaryEmailAdded(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Deleted secondary email +@objc +public class DBXTeamLogEventTypeSecondaryEmailDeleted: DBXTeamLogEventType { + @objc + public var secondaryEmailDeleted: DBXTeamLogSecondaryEmailDeletedType + + @objc + public init(_ arg: DBXTeamLogSecondaryEmailDeletedType) { + self.secondaryEmailDeleted = arg + let swift = TeamLog.EventType.secondaryEmailDeleted(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Verified secondary email +@objc +public class DBXTeamLogEventTypeSecondaryEmailVerified: DBXTeamLogEventType { + @objc + public var secondaryEmailVerified: DBXTeamLogSecondaryEmailVerifiedType + + @objc + public init(_ arg: DBXTeamLogSecondaryEmailVerifiedType) { + self.secondaryEmailVerified = arg + let swift = TeamLog.EventType.secondaryEmailVerified(arg.swift) + super.init(swift: swift) + } +} + +/// (members) Secondary mails policy changed +@objc +public class DBXTeamLogEventTypeSecondaryMailsPolicyChanged: DBXTeamLogEventType { + @objc + public var secondaryMailsPolicyChanged: DBXTeamLogSecondaryMailsPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogSecondaryMailsPolicyChangedType) { + self.secondaryMailsPolicyChanged = arg + let swift = TeamLog.EventType.secondaryMailsPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Added Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderAddPage: DBXTeamLogEventType { + @objc + public var binderAddPage: DBXTeamLogBinderAddPageType + + @objc + public init(_ arg: DBXTeamLogBinderAddPageType) { + self.binderAddPage = arg + let swift = TeamLog.EventType.binderAddPage(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Added Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderAddSection: DBXTeamLogEventType { + @objc + public var binderAddSection: DBXTeamLogBinderAddSectionType + + @objc + public init(_ arg: DBXTeamLogBinderAddSectionType) { + self.binderAddSection = arg + let swift = TeamLog.EventType.binderAddSection(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Removed Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderRemovePage: DBXTeamLogEventType { + @objc + public var binderRemovePage: DBXTeamLogBinderRemovePageType + + @objc + public init(_ arg: DBXTeamLogBinderRemovePageType) { + self.binderRemovePage = arg + let swift = TeamLog.EventType.binderRemovePage(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Removed Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderRemoveSection: DBXTeamLogEventType { + @objc + public var binderRemoveSection: DBXTeamLogBinderRemoveSectionType + + @objc + public init(_ arg: DBXTeamLogBinderRemoveSectionType) { + self.binderRemoveSection = arg + let swift = TeamLog.EventType.binderRemoveSection(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Renamed Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderRenamePage: DBXTeamLogEventType { + @objc + public var binderRenamePage: DBXTeamLogBinderRenamePageType + + @objc + public init(_ arg: DBXTeamLogBinderRenamePageType) { + self.binderRenamePage = arg + let swift = TeamLog.EventType.binderRenamePage(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Renamed Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderRenameSection: DBXTeamLogEventType { + @objc + public var binderRenameSection: DBXTeamLogBinderRenameSectionType + + @objc + public init(_ arg: DBXTeamLogBinderRenameSectionType) { + self.binderRenameSection = arg + let swift = TeamLog.EventType.binderRenameSection(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Reordered Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderReorderPage: DBXTeamLogEventType { + @objc + public var binderReorderPage: DBXTeamLogBinderReorderPageType + + @objc + public init(_ arg: DBXTeamLogBinderReorderPageType) { + self.binderReorderPage = arg + let swift = TeamLog.EventType.binderReorderPage(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Reordered Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeBinderReorderSection: DBXTeamLogEventType { + @objc + public var binderReorderSection: DBXTeamLogBinderReorderSectionType + + @objc + public init(_ arg: DBXTeamLogBinderReorderSectionType) { + self.binderReorderSection = arg + let swift = TeamLog.EventType.binderReorderSection(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Added users and/or groups to Paper doc/folder +@objc +public class DBXTeamLogEventTypePaperContentAddMember: DBXTeamLogEventType { + @objc + public var paperContentAddMember: DBXTeamLogPaperContentAddMemberType + + @objc + public init(_ arg: DBXTeamLogPaperContentAddMemberType) { + self.paperContentAddMember = arg + let swift = TeamLog.EventType.paperContentAddMember(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Added Paper doc/folder to folder +@objc +public class DBXTeamLogEventTypePaperContentAddToFolder: DBXTeamLogEventType { + @objc + public var paperContentAddToFolder: DBXTeamLogPaperContentAddToFolderType + + @objc + public init(_ arg: DBXTeamLogPaperContentAddToFolderType) { + self.paperContentAddToFolder = arg + let swift = TeamLog.EventType.paperContentAddToFolder(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Archived Paper doc/folder +@objc +public class DBXTeamLogEventTypePaperContentArchive: DBXTeamLogEventType { + @objc + public var paperContentArchive: DBXTeamLogPaperContentArchiveType + + @objc + public init(_ arg: DBXTeamLogPaperContentArchiveType) { + self.paperContentArchive = arg + let swift = TeamLog.EventType.paperContentArchive(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Created Paper doc/folder +@objc +public class DBXTeamLogEventTypePaperContentCreate: DBXTeamLogEventType { + @objc + public var paperContentCreate: DBXTeamLogPaperContentCreateType + + @objc + public init(_ arg: DBXTeamLogPaperContentCreateType) { + self.paperContentCreate = arg + let swift = TeamLog.EventType.paperContentCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Permanently deleted Paper doc/folder +@objc +public class DBXTeamLogEventTypePaperContentPermanentlyDelete: DBXTeamLogEventType { + @objc + public var paperContentPermanentlyDelete: DBXTeamLogPaperContentPermanentlyDeleteType + + @objc + public init(_ arg: DBXTeamLogPaperContentPermanentlyDeleteType) { + self.paperContentPermanentlyDelete = arg + let swift = TeamLog.EventType.paperContentPermanentlyDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Removed Paper doc/folder from folder +@objc +public class DBXTeamLogEventTypePaperContentRemoveFromFolder: DBXTeamLogEventType { + @objc + public var paperContentRemoveFromFolder: DBXTeamLogPaperContentRemoveFromFolderType + + @objc + public init(_ arg: DBXTeamLogPaperContentRemoveFromFolderType) { + self.paperContentRemoveFromFolder = arg + let swift = TeamLog.EventType.paperContentRemoveFromFolder(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Removed users and/or groups from Paper doc/folder +@objc +public class DBXTeamLogEventTypePaperContentRemoveMember: DBXTeamLogEventType { + @objc + public var paperContentRemoveMember: DBXTeamLogPaperContentRemoveMemberType + + @objc + public init(_ arg: DBXTeamLogPaperContentRemoveMemberType) { + self.paperContentRemoveMember = arg + let swift = TeamLog.EventType.paperContentRemoveMember(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Renamed Paper doc/folder +@objc +public class DBXTeamLogEventTypePaperContentRename: DBXTeamLogEventType { + @objc + public var paperContentRename: DBXTeamLogPaperContentRenameType + + @objc + public init(_ arg: DBXTeamLogPaperContentRenameType) { + self.paperContentRename = arg + let swift = TeamLog.EventType.paperContentRename(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Restored archived Paper doc/folder +@objc +public class DBXTeamLogEventTypePaperContentRestore: DBXTeamLogEventType { + @objc + public var paperContentRestore: DBXTeamLogPaperContentRestoreType + + @objc + public init(_ arg: DBXTeamLogPaperContentRestoreType) { + self.paperContentRestore = arg + let swift = TeamLog.EventType.paperContentRestore(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Added Paper doc comment +@objc +public class DBXTeamLogEventTypePaperDocAddComment: DBXTeamLogEventType { + @objc + public var paperDocAddComment: DBXTeamLogPaperDocAddCommentType + + @objc + public init(_ arg: DBXTeamLogPaperDocAddCommentType) { + self.paperDocAddComment = arg + let swift = TeamLog.EventType.paperDocAddComment(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Changed member permissions for Paper doc +@objc +public class DBXTeamLogEventTypePaperDocChangeMemberRole: DBXTeamLogEventType { + @objc + public var paperDocChangeMemberRole: DBXTeamLogPaperDocChangeMemberRoleType + + @objc + public init(_ arg: DBXTeamLogPaperDocChangeMemberRoleType) { + self.paperDocChangeMemberRole = arg + let swift = TeamLog.EventType.paperDocChangeMemberRole(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Changed sharing setting for Paper doc +@objc +public class DBXTeamLogEventTypePaperDocChangeSharingPolicy: DBXTeamLogEventType { + @objc + public var paperDocChangeSharingPolicy: DBXTeamLogPaperDocChangeSharingPolicyType + + @objc + public init(_ arg: DBXTeamLogPaperDocChangeSharingPolicyType) { + self.paperDocChangeSharingPolicy = arg + let swift = TeamLog.EventType.paperDocChangeSharingPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Followed/unfollowed Paper doc +@objc +public class DBXTeamLogEventTypePaperDocChangeSubscription: DBXTeamLogEventType { + @objc + public var paperDocChangeSubscription: DBXTeamLogPaperDocChangeSubscriptionType + + @objc + public init(_ arg: DBXTeamLogPaperDocChangeSubscriptionType) { + self.paperDocChangeSubscription = arg + let swift = TeamLog.EventType.paperDocChangeSubscription(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Archived Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperDocDeleted: DBXTeamLogEventType { + @objc + public var paperDocDeleted: DBXTeamLogPaperDocDeletedType + + @objc + public init(_ arg: DBXTeamLogPaperDocDeletedType) { + self.paperDocDeleted = arg + let swift = TeamLog.EventType.paperDocDeleted(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Deleted Paper doc comment +@objc +public class DBXTeamLogEventTypePaperDocDeleteComment: DBXTeamLogEventType { + @objc + public var paperDocDeleteComment: DBXTeamLogPaperDocDeleteCommentType + + @objc + public init(_ arg: DBXTeamLogPaperDocDeleteCommentType) { + self.paperDocDeleteComment = arg + let swift = TeamLog.EventType.paperDocDeleteComment(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Downloaded Paper doc in specific format +@objc +public class DBXTeamLogEventTypePaperDocDownload: DBXTeamLogEventType { + @objc + public var paperDocDownload: DBXTeamLogPaperDocDownloadType + + @objc + public init(_ arg: DBXTeamLogPaperDocDownloadType) { + self.paperDocDownload = arg + let swift = TeamLog.EventType.paperDocDownload(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Edited Paper doc +@objc +public class DBXTeamLogEventTypePaperDocEdit: DBXTeamLogEventType { + @objc + public var paperDocEdit: DBXTeamLogPaperDocEditType + + @objc + public init(_ arg: DBXTeamLogPaperDocEditType) { + self.paperDocEdit = arg + let swift = TeamLog.EventType.paperDocEdit(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Edited Paper doc comment +@objc +public class DBXTeamLogEventTypePaperDocEditComment: DBXTeamLogEventType { + @objc + public var paperDocEditComment: DBXTeamLogPaperDocEditCommentType + + @objc + public init(_ arg: DBXTeamLogPaperDocEditCommentType) { + self.paperDocEditComment = arg + let swift = TeamLog.EventType.paperDocEditComment(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Followed Paper doc (deprecated, replaced by 'Followed/unfollowed Paper doc') +@objc +public class DBXTeamLogEventTypePaperDocFollowed: DBXTeamLogEventType { + @objc + public var paperDocFollowed: DBXTeamLogPaperDocFollowedType + + @objc + public init(_ arg: DBXTeamLogPaperDocFollowedType) { + self.paperDocFollowed = arg + let swift = TeamLog.EventType.paperDocFollowed(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Mentioned user in Paper doc +@objc +public class DBXTeamLogEventTypePaperDocMention: DBXTeamLogEventType { + @objc + public var paperDocMention: DBXTeamLogPaperDocMentionType + + @objc + public init(_ arg: DBXTeamLogPaperDocMentionType) { + self.paperDocMention = arg + let swift = TeamLog.EventType.paperDocMention(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Transferred ownership of Paper doc +@objc +public class DBXTeamLogEventTypePaperDocOwnershipChanged: DBXTeamLogEventType { + @objc + public var paperDocOwnershipChanged: DBXTeamLogPaperDocOwnershipChangedType + + @objc + public init(_ arg: DBXTeamLogPaperDocOwnershipChangedType) { + self.paperDocOwnershipChanged = arg + let swift = TeamLog.EventType.paperDocOwnershipChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Requested access to Paper doc +@objc +public class DBXTeamLogEventTypePaperDocRequestAccess: DBXTeamLogEventType { + @objc + public var paperDocRequestAccess: DBXTeamLogPaperDocRequestAccessType + + @objc + public init(_ arg: DBXTeamLogPaperDocRequestAccessType) { + self.paperDocRequestAccess = arg + let swift = TeamLog.EventType.paperDocRequestAccess(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Resolved Paper doc comment +@objc +public class DBXTeamLogEventTypePaperDocResolveComment: DBXTeamLogEventType { + @objc + public var paperDocResolveComment: DBXTeamLogPaperDocResolveCommentType + + @objc + public init(_ arg: DBXTeamLogPaperDocResolveCommentType) { + self.paperDocResolveComment = arg + let swift = TeamLog.EventType.paperDocResolveComment(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Restored Paper doc to previous version +@objc +public class DBXTeamLogEventTypePaperDocRevert: DBXTeamLogEventType { + @objc + public var paperDocRevert: DBXTeamLogPaperDocRevertType + + @objc + public init(_ arg: DBXTeamLogPaperDocRevertType) { + self.paperDocRevert = arg + let swift = TeamLog.EventType.paperDocRevert(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Shared Paper doc via Slack +@objc +public class DBXTeamLogEventTypePaperDocSlackShare: DBXTeamLogEventType { + @objc + public var paperDocSlackShare: DBXTeamLogPaperDocSlackShareType + + @objc + public init(_ arg: DBXTeamLogPaperDocSlackShareType) { + self.paperDocSlackShare = arg + let swift = TeamLog.EventType.paperDocSlackShare(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Shared Paper doc with users and/or groups (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperDocTeamInvite: DBXTeamLogEventType { + @objc + public var paperDocTeamInvite: DBXTeamLogPaperDocTeamInviteType + + @objc + public init(_ arg: DBXTeamLogPaperDocTeamInviteType) { + self.paperDocTeamInvite = arg + let swift = TeamLog.EventType.paperDocTeamInvite(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Deleted Paper doc +@objc +public class DBXTeamLogEventTypePaperDocTrashed: DBXTeamLogEventType { + @objc + public var paperDocTrashed: DBXTeamLogPaperDocTrashedType + + @objc + public init(_ arg: DBXTeamLogPaperDocTrashedType) { + self.paperDocTrashed = arg + let swift = TeamLog.EventType.paperDocTrashed(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Unresolved Paper doc comment +@objc +public class DBXTeamLogEventTypePaperDocUnresolveComment: DBXTeamLogEventType { + @objc + public var paperDocUnresolveComment: DBXTeamLogPaperDocUnresolveCommentType + + @objc + public init(_ arg: DBXTeamLogPaperDocUnresolveCommentType) { + self.paperDocUnresolveComment = arg + let swift = TeamLog.EventType.paperDocUnresolveComment(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Restored Paper doc +@objc +public class DBXTeamLogEventTypePaperDocUntrashed: DBXTeamLogEventType { + @objc + public var paperDocUntrashed: DBXTeamLogPaperDocUntrashedType + + @objc + public init(_ arg: DBXTeamLogPaperDocUntrashedType) { + self.paperDocUntrashed = arg + let swift = TeamLog.EventType.paperDocUntrashed(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Viewed Paper doc +@objc +public class DBXTeamLogEventTypePaperDocView: DBXTeamLogEventType { + @objc + public var paperDocView: DBXTeamLogPaperDocViewType + + @objc + public init(_ arg: DBXTeamLogPaperDocViewType) { + self.paperDocView = arg + let swift = TeamLog.EventType.paperDocView(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Changed Paper external sharing setting to anyone (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperExternalViewAllow: DBXTeamLogEventType { + @objc + public var paperExternalViewAllow: DBXTeamLogPaperExternalViewAllowType + + @objc + public init(_ arg: DBXTeamLogPaperExternalViewAllowType) { + self.paperExternalViewAllow = arg + let swift = TeamLog.EventType.paperExternalViewAllow(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Changed Paper external sharing setting to default team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperExternalViewDefaultTeam: DBXTeamLogEventType { + @objc + public var paperExternalViewDefaultTeam: DBXTeamLogPaperExternalViewDefaultTeamType + + @objc + public init(_ arg: DBXTeamLogPaperExternalViewDefaultTeamType) { + self.paperExternalViewDefaultTeam = arg + let swift = TeamLog.EventType.paperExternalViewDefaultTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Changed Paper external sharing setting to team-only (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperExternalViewForbid: DBXTeamLogEventType { + @objc + public var paperExternalViewForbid: DBXTeamLogPaperExternalViewForbidType + + @objc + public init(_ arg: DBXTeamLogPaperExternalViewForbidType) { + self.paperExternalViewForbid = arg + let swift = TeamLog.EventType.paperExternalViewForbid(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Followed/unfollowed Paper folder +@objc +public class DBXTeamLogEventTypePaperFolderChangeSubscription: DBXTeamLogEventType { + @objc + public var paperFolderChangeSubscription: DBXTeamLogPaperFolderChangeSubscriptionType + + @objc + public init(_ arg: DBXTeamLogPaperFolderChangeSubscriptionType) { + self.paperFolderChangeSubscription = arg + let swift = TeamLog.EventType.paperFolderChangeSubscription(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Archived Paper folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperFolderDeleted: DBXTeamLogEventType { + @objc + public var paperFolderDeleted: DBXTeamLogPaperFolderDeletedType + + @objc + public init(_ arg: DBXTeamLogPaperFolderDeletedType) { + self.paperFolderDeleted = arg + let swift = TeamLog.EventType.paperFolderDeleted(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Followed Paper folder (deprecated, replaced by 'Followed/unfollowed Paper folder') +@objc +public class DBXTeamLogEventTypePaperFolderFollowed: DBXTeamLogEventType { + @objc + public var paperFolderFollowed: DBXTeamLogPaperFolderFollowedType + + @objc + public init(_ arg: DBXTeamLogPaperFolderFollowedType) { + self.paperFolderFollowed = arg + let swift = TeamLog.EventType.paperFolderFollowed(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Shared Paper folder with users and/or groups (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperFolderTeamInvite: DBXTeamLogEventType { + @objc + public var paperFolderTeamInvite: DBXTeamLogPaperFolderTeamInviteType + + @objc + public init(_ arg: DBXTeamLogPaperFolderTeamInviteType) { + self.paperFolderTeamInvite = arg + let swift = TeamLog.EventType.paperFolderTeamInvite(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Changed permissions for published doc +@objc +public class DBXTeamLogEventTypePaperPublishedLinkChangePermission: DBXTeamLogEventType { + @objc + public var paperPublishedLinkChangePermission: DBXTeamLogPaperPublishedLinkChangePermissionType + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkChangePermissionType) { + self.paperPublishedLinkChangePermission = arg + let swift = TeamLog.EventType.paperPublishedLinkChangePermission(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Published doc +@objc +public class DBXTeamLogEventTypePaperPublishedLinkCreate: DBXTeamLogEventType { + @objc + public var paperPublishedLinkCreate: DBXTeamLogPaperPublishedLinkCreateType + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkCreateType) { + self.paperPublishedLinkCreate = arg + let swift = TeamLog.EventType.paperPublishedLinkCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Unpublished doc +@objc +public class DBXTeamLogEventTypePaperPublishedLinkDisabled: DBXTeamLogEventType { + @objc + public var paperPublishedLinkDisabled: DBXTeamLogPaperPublishedLinkDisabledType + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkDisabledType) { + self.paperPublishedLinkDisabled = arg + let swift = TeamLog.EventType.paperPublishedLinkDisabled(arg.swift) + super.init(swift: swift) + } +} + +/// (paper) Viewed published doc +@objc +public class DBXTeamLogEventTypePaperPublishedLinkView: DBXTeamLogEventType { + @objc + public var paperPublishedLinkView: DBXTeamLogPaperPublishedLinkViewType + + @objc + public init(_ arg: DBXTeamLogPaperPublishedLinkViewType) { + self.paperPublishedLinkView = arg + let swift = TeamLog.EventType.paperPublishedLinkView(arg.swift) + super.init(swift: swift) + } +} + +/// (passwords) Changed password +@objc +public class DBXTeamLogEventTypePasswordChange: DBXTeamLogEventType { + @objc + public var passwordChange: DBXTeamLogPasswordChangeType + + @objc + public init(_ arg: DBXTeamLogPasswordChangeType) { + self.passwordChange = arg + let swift = TeamLog.EventType.passwordChange(arg.swift) + super.init(swift: swift) + } +} + +/// (passwords) Reset password +@objc +public class DBXTeamLogEventTypePasswordReset: DBXTeamLogEventType { + @objc + public var passwordReset: DBXTeamLogPasswordResetType + + @objc + public init(_ arg: DBXTeamLogPasswordResetType) { + self.passwordReset = arg + let swift = TeamLog.EventType.passwordReset(arg.swift) + super.init(swift: swift) + } +} + +/// (passwords) Reset all team member passwords +@objc +public class DBXTeamLogEventTypePasswordResetAll: DBXTeamLogEventType { + @objc + public var passwordResetAll: DBXTeamLogPasswordResetAllType + + @objc + public init(_ arg: DBXTeamLogPasswordResetAllType) { + self.passwordResetAll = arg + let swift = TeamLog.EventType.passwordResetAll(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created Classification report +@objc +public class DBXTeamLogEventTypeClassificationCreateReport: DBXTeamLogEventType { + @objc + public var classificationCreateReport: DBXTeamLogClassificationCreateReportType + + @objc + public init(_ arg: DBXTeamLogClassificationCreateReportType) { + self.classificationCreateReport = arg + let swift = TeamLog.EventType.classificationCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't create Classification report +@objc +public class DBXTeamLogEventTypeClassificationCreateReportFail: DBXTeamLogEventType { + @objc + public var classificationCreateReportFail: DBXTeamLogClassificationCreateReportFailType + + @objc + public init(_ arg: DBXTeamLogClassificationCreateReportFailType) { + self.classificationCreateReportFail = arg + let swift = TeamLog.EventType.classificationCreateReportFail(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created EMM-excluded users report +@objc +public class DBXTeamLogEventTypeEmmCreateExceptionsReport: DBXTeamLogEventType { + @objc + public var emmCreateExceptionsReport: DBXTeamLogEmmCreateExceptionsReportType + + @objc + public init(_ arg: DBXTeamLogEmmCreateExceptionsReportType) { + self.emmCreateExceptionsReport = arg + let swift = TeamLog.EventType.emmCreateExceptionsReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created EMM mobile app usage report +@objc +public class DBXTeamLogEventTypeEmmCreateUsageReport: DBXTeamLogEventType { + @objc + public var emmCreateUsageReport: DBXTeamLogEmmCreateUsageReportType + + @objc + public init(_ arg: DBXTeamLogEmmCreateUsageReportType) { + self.emmCreateUsageReport = arg + let swift = TeamLog.EventType.emmCreateUsageReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created member data report +@objc +public class DBXTeamLogEventTypeExportMembersReport: DBXTeamLogEventType { + @objc + public var exportMembersReport: DBXTeamLogExportMembersReportType + + @objc + public init(_ arg: DBXTeamLogExportMembersReportType) { + self.exportMembersReport = arg + let swift = TeamLog.EventType.exportMembersReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Failed to create members data report +@objc +public class DBXTeamLogEventTypeExportMembersReportFail: DBXTeamLogEventType { + @objc + public var exportMembersReportFail: DBXTeamLogExportMembersReportFailType + + @objc + public init(_ arg: DBXTeamLogExportMembersReportFailType) { + self.exportMembersReportFail = arg + let swift = TeamLog.EventType.exportMembersReportFail(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created External sharing report +@objc +public class DBXTeamLogEventTypeExternalSharingCreateReport: DBXTeamLogEventType { + @objc + public var externalSharingCreateReport: DBXTeamLogExternalSharingCreateReportType + + @objc + public init(_ arg: DBXTeamLogExternalSharingCreateReportType) { + self.externalSharingCreateReport = arg + let swift = TeamLog.EventType.externalSharingCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't create External sharing report +@objc +public class DBXTeamLogEventTypeExternalSharingReportFailed: DBXTeamLogEventType { + @objc + public var externalSharingReportFailed: DBXTeamLogExternalSharingReportFailedType + + @objc + public init(_ arg: DBXTeamLogExternalSharingReportFailedType) { + self.externalSharingReportFailed = arg + let swift = TeamLog.EventType.externalSharingReportFailed(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Report created: Links created with no expiration +@objc +public class DBXTeamLogEventTypeNoExpirationLinkGenCreateReport: DBXTeamLogEventType { + @objc + public var noExpirationLinkGenCreateReport: DBXTeamLogNoExpirationLinkGenCreateReportType + + @objc + public init(_ arg: DBXTeamLogNoExpirationLinkGenCreateReportType) { + self.noExpirationLinkGenCreateReport = arg + let swift = TeamLog.EventType.noExpirationLinkGenCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Links created with no expiration +@objc +public class DBXTeamLogEventTypeNoExpirationLinkGenReportFailed: DBXTeamLogEventType { + @objc + public var noExpirationLinkGenReportFailed: DBXTeamLogNoExpirationLinkGenReportFailedType + + @objc + public init(_ arg: DBXTeamLogNoExpirationLinkGenReportFailedType) { + self.noExpirationLinkGenReportFailed = arg + let swift = TeamLog.EventType.noExpirationLinkGenReportFailed(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Report created: Links created without passwords +@objc +public class DBXTeamLogEventTypeNoPasswordLinkGenCreateReport: DBXTeamLogEventType { + @objc + public var noPasswordLinkGenCreateReport: DBXTeamLogNoPasswordLinkGenCreateReportType + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkGenCreateReportType) { + self.noPasswordLinkGenCreateReport = arg + let swift = TeamLog.EventType.noPasswordLinkGenCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Links created without passwords +@objc +public class DBXTeamLogEventTypeNoPasswordLinkGenReportFailed: DBXTeamLogEventType { + @objc + public var noPasswordLinkGenReportFailed: DBXTeamLogNoPasswordLinkGenReportFailedType + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkGenReportFailedType) { + self.noPasswordLinkGenReportFailed = arg + let swift = TeamLog.EventType.noPasswordLinkGenReportFailed(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Report created: Views of links without passwords +@objc +public class DBXTeamLogEventTypeNoPasswordLinkViewCreateReport: DBXTeamLogEventType { + @objc + public var noPasswordLinkViewCreateReport: DBXTeamLogNoPasswordLinkViewCreateReportType + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkViewCreateReportType) { + self.noPasswordLinkViewCreateReport = arg + let swift = TeamLog.EventType.noPasswordLinkViewCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Views of links without passwords +@objc +public class DBXTeamLogEventTypeNoPasswordLinkViewReportFailed: DBXTeamLogEventType { + @objc + public var noPasswordLinkViewReportFailed: DBXTeamLogNoPasswordLinkViewReportFailedType + + @objc + public init(_ arg: DBXTeamLogNoPasswordLinkViewReportFailedType) { + self.noPasswordLinkViewReportFailed = arg + let swift = TeamLog.EventType.noPasswordLinkViewReportFailed(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Report created: Views of old links +@objc +public class DBXTeamLogEventTypeOutdatedLinkViewCreateReport: DBXTeamLogEventType { + @objc + public var outdatedLinkViewCreateReport: DBXTeamLogOutdatedLinkViewCreateReportType + + @objc + public init(_ arg: DBXTeamLogOutdatedLinkViewCreateReportType) { + self.outdatedLinkViewCreateReport = arg + let swift = TeamLog.EventType.outdatedLinkViewCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Views of old links +@objc +public class DBXTeamLogEventTypeOutdatedLinkViewReportFailed: DBXTeamLogEventType { + @objc + public var outdatedLinkViewReportFailed: DBXTeamLogOutdatedLinkViewReportFailedType + + @objc + public init(_ arg: DBXTeamLogOutdatedLinkViewReportFailedType) { + self.outdatedLinkViewReportFailed = arg + let swift = TeamLog.EventType.outdatedLinkViewReportFailed(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Exported all team Paper docs +@objc +public class DBXTeamLogEventTypePaperAdminExportStart: DBXTeamLogEventType { + @objc + public var paperAdminExportStart: DBXTeamLogPaperAdminExportStartType + + @objc + public init(_ arg: DBXTeamLogPaperAdminExportStartType) { + self.paperAdminExportStart = arg + let swift = TeamLog.EventType.paperAdminExportStart(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created ransomware report +@objc +public class DBXTeamLogEventTypeRansomwareAlertCreateReport: DBXTeamLogEventType { + @objc + public var ransomwareAlertCreateReport: DBXTeamLogRansomwareAlertCreateReportType + + @objc + public init(_ arg: DBXTeamLogRansomwareAlertCreateReportType) { + self.ransomwareAlertCreateReport = arg + let swift = TeamLog.EventType.ransomwareAlertCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't generate ransomware report +@objc +public class DBXTeamLogEventTypeRansomwareAlertCreateReportFailed: DBXTeamLogEventType { + @objc + public var ransomwareAlertCreateReportFailed: DBXTeamLogRansomwareAlertCreateReportFailedType + + @objc + public init(_ arg: DBXTeamLogRansomwareAlertCreateReportFailedType) { + self.ransomwareAlertCreateReportFailed = arg + let swift = TeamLog.EventType.ransomwareAlertCreateReportFailed(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created Smart Sync non-admin devices report +@objc +public class DBXTeamLogEventTypeSmartSyncCreateAdminPrivilegeReport: DBXTeamLogEventType { + @objc + public var smartSyncCreateAdminPrivilegeReport: DBXTeamLogSmartSyncCreateAdminPrivilegeReportType + + @objc + public init(_ arg: DBXTeamLogSmartSyncCreateAdminPrivilegeReportType) { + self.smartSyncCreateAdminPrivilegeReport = arg + let swift = TeamLog.EventType.smartSyncCreateAdminPrivilegeReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Created team activity report +@objc +public class DBXTeamLogEventTypeTeamActivityCreateReport: DBXTeamLogEventType { + @objc + public var teamActivityCreateReport: DBXTeamLogTeamActivityCreateReportType + + @objc + public init(_ arg: DBXTeamLogTeamActivityCreateReportType) { + self.teamActivityCreateReport = arg + let swift = TeamLog.EventType.teamActivityCreateReport(arg.swift) + super.init(swift: swift) + } +} + +/// (reports) Couldn't generate team activity report +@objc +public class DBXTeamLogEventTypeTeamActivityCreateReportFail: DBXTeamLogEventType { + @objc + public var teamActivityCreateReportFail: DBXTeamLogTeamActivityCreateReportFailType + + @objc + public init(_ arg: DBXTeamLogTeamActivityCreateReportFailType) { + self.teamActivityCreateReportFail = arg + let swift = TeamLog.EventType.teamActivityCreateReportFail(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Shared album +@objc +public class DBXTeamLogEventTypeCollectionShare: DBXTeamLogEventType { + @objc + public var collectionShare: DBXTeamLogCollectionShareType + + @objc + public init(_ arg: DBXTeamLogCollectionShareType) { + self.collectionShare = arg + let swift = TeamLog.EventType.collectionShare(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Transfer files added +@objc +public class DBXTeamLogEventTypeFileTransfersFileAdd: DBXTeamLogEventType { + @objc + public var fileTransfersFileAdd: DBXTeamLogFileTransfersFileAddType + + @objc + public init(_ arg: DBXTeamLogFileTransfersFileAddType) { + self.fileTransfersFileAdd = arg + let swift = TeamLog.EventType.fileTransfersFileAdd(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Deleted transfer +@objc +public class DBXTeamLogEventTypeFileTransfersTransferDelete: DBXTeamLogEventType { + @objc + public var fileTransfersTransferDelete: DBXTeamLogFileTransfersTransferDeleteType + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferDeleteType) { + self.fileTransfersTransferDelete = arg + let swift = TeamLog.EventType.fileTransfersTransferDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Transfer downloaded +@objc +public class DBXTeamLogEventTypeFileTransfersTransferDownload: DBXTeamLogEventType { + @objc + public var fileTransfersTransferDownload: DBXTeamLogFileTransfersTransferDownloadType + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferDownloadType) { + self.fileTransfersTransferDownload = arg + let swift = TeamLog.EventType.fileTransfersTransferDownload(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Sent transfer +@objc +public class DBXTeamLogEventTypeFileTransfersTransferSend: DBXTeamLogEventType { + @objc + public var fileTransfersTransferSend: DBXTeamLogFileTransfersTransferSendType + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferSendType) { + self.fileTransfersTransferSend = arg + let swift = TeamLog.EventType.fileTransfersTransferSend(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Viewed transfer +@objc +public class DBXTeamLogEventTypeFileTransfersTransferView: DBXTeamLogEventType { + @objc + public var fileTransfersTransferView: DBXTeamLogFileTransfersTransferViewType + + @objc + public init(_ arg: DBXTeamLogFileTransfersTransferViewType) { + self.fileTransfersTransferView = arg + let swift = TeamLog.EventType.fileTransfersTransferView(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed Paper doc to invite-only (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeNoteAclInviteOnly: DBXTeamLogEventType { + @objc + public var noteAclInviteOnly: DBXTeamLogNoteAclInviteOnlyType + + @objc + public init(_ arg: DBXTeamLogNoteAclInviteOnlyType) { + self.noteAclInviteOnly = arg + let swift = TeamLog.EventType.noteAclInviteOnly(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed Paper doc to link-accessible (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeNoteAclLink: DBXTeamLogEventType { + @objc + public var noteAclLink: DBXTeamLogNoteAclLinkType + + @objc + public init(_ arg: DBXTeamLogNoteAclLinkType) { + self.noteAclLink = arg + let swift = TeamLog.EventType.noteAclLink(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed Paper doc to link-accessible for team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeNoteAclTeamLink: DBXTeamLogEventType { + @objc + public var noteAclTeamLink: DBXTeamLogNoteAclTeamLinkType + + @objc + public init(_ arg: DBXTeamLogNoteAclTeamLinkType) { + self.noteAclTeamLink = arg + let swift = TeamLog.EventType.noteAclTeamLink(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Shared Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeNoteShared: DBXTeamLogEventType { + @objc + public var noteShared: DBXTeamLogNoteSharedType + + @objc + public init(_ arg: DBXTeamLogNoteSharedType) { + self.noteShared = arg + let swift = TeamLog.EventType.noteShared(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Shared received Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeNoteShareReceive: DBXTeamLogEventType { + @objc + public var noteShareReceive: DBXTeamLogNoteShareReceiveType + + @objc + public init(_ arg: DBXTeamLogNoteShareReceiveType) { + self.noteShareReceive = arg + let swift = TeamLog.EventType.noteShareReceive(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Opened shared Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeOpenNoteShared: DBXTeamLogEventType { + @objc + public var openNoteShared: DBXTeamLogOpenNoteSharedType + + @objc + public init(_ arg: DBXTeamLogOpenNoteSharedType) { + self.openNoteShared = arg + let swift = TeamLog.EventType.openNoteShared(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Created shared link in Replay +@objc +public class DBXTeamLogEventTypeReplayFileSharedLinkCreated: DBXTeamLogEventType { + @objc + public var replayFileSharedLinkCreated: DBXTeamLogReplayFileSharedLinkCreatedType + + @objc + public init(_ arg: DBXTeamLogReplayFileSharedLinkCreatedType) { + self.replayFileSharedLinkCreated = arg + let swift = TeamLog.EventType.replayFileSharedLinkCreated(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Modified shared link in Replay +@objc +public class DBXTeamLogEventTypeReplayFileSharedLinkModified: DBXTeamLogEventType { + @objc + public var replayFileSharedLinkModified: DBXTeamLogReplayFileSharedLinkModifiedType + + @objc + public init(_ arg: DBXTeamLogReplayFileSharedLinkModifiedType) { + self.replayFileSharedLinkModified = arg + let swift = TeamLog.EventType.replayFileSharedLinkModified(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added member to Replay Project +@objc +public class DBXTeamLogEventTypeReplayProjectTeamAdd: DBXTeamLogEventType { + @objc + public var replayProjectTeamAdd: DBXTeamLogReplayProjectTeamAddType + + @objc + public init(_ arg: DBXTeamLogReplayProjectTeamAddType) { + self.replayProjectTeamAdd = arg + let swift = TeamLog.EventType.replayProjectTeamAdd(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed member from Replay Project +@objc +public class DBXTeamLogEventTypeReplayProjectTeamDelete: DBXTeamLogEventType { + @objc + public var replayProjectTeamDelete: DBXTeamLogReplayProjectTeamDeleteType + + @objc + public init(_ arg: DBXTeamLogReplayProjectTeamDeleteType) { + self.replayProjectTeamDelete = arg + let swift = TeamLog.EventType.replayProjectTeamDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added team to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfAddGroup: DBXTeamLogEventType { + @objc + public var sfAddGroup: DBXTeamLogSfAddGroupType + + @objc + public init(_ arg: DBXTeamLogSfAddGroupType) { + self.sfAddGroup = arg + let swift = TeamLog.EventType.sfAddGroup(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Allowed non-collaborators to view links to files in shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfAllowNonMembersToViewSharedLinks: DBXTeamLogEventType { + @objc + public var sfAllowNonMembersToViewSharedLinks: DBXTeamLogSfAllowNonMembersToViewSharedLinksType + + @objc + public init(_ arg: DBXTeamLogSfAllowNonMembersToViewSharedLinksType) { + self.sfAllowNonMembersToViewSharedLinks = arg + let swift = TeamLog.EventType.sfAllowNonMembersToViewSharedLinks(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Set team members to see warning before sharing folders outside team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfExternalInviteWarn: DBXTeamLogEventType { + @objc + public var sfExternalInviteWarn: DBXTeamLogSfExternalInviteWarnType + + @objc + public init(_ arg: DBXTeamLogSfExternalInviteWarnType) { + self.sfExternalInviteWarn = arg + let swift = TeamLog.EventType.sfExternalInviteWarn(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Invited Facebook users to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfFbInvite: DBXTeamLogEventType { + @objc + public var sfFbInvite: DBXTeamLogSfFbInviteType + + @objc + public init(_ arg: DBXTeamLogSfFbInviteType) { + self.sfFbInvite = arg + let swift = TeamLog.EventType.sfFbInvite(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed Facebook user's role in shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfFbInviteChangeRole: DBXTeamLogEventType { + @objc + public var sfFbInviteChangeRole: DBXTeamLogSfFbInviteChangeRoleType + + @objc + public init(_ arg: DBXTeamLogSfFbInviteChangeRoleType) { + self.sfFbInviteChangeRole = arg + let swift = TeamLog.EventType.sfFbInviteChangeRole(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Uninvited Facebook user from shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfFbUninvite: DBXTeamLogEventType { + @objc + public var sfFbUninvite: DBXTeamLogSfFbUninviteType + + @objc + public init(_ arg: DBXTeamLogSfFbUninviteType) { + self.sfFbUninvite = arg + let swift = TeamLog.EventType.sfFbUninvite(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Invited group to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfInviteGroup: DBXTeamLogEventType { + @objc + public var sfInviteGroup: DBXTeamLogSfInviteGroupType + + @objc + public init(_ arg: DBXTeamLogSfInviteGroupType) { + self.sfInviteGroup = arg + let swift = TeamLog.EventType.sfInviteGroup(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Granted access to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfTeamGrantAccess: DBXTeamLogEventType { + @objc + public var sfTeamGrantAccess: DBXTeamLogSfTeamGrantAccessType + + @objc + public init(_ arg: DBXTeamLogSfTeamGrantAccessType) { + self.sfTeamGrantAccess = arg + let swift = TeamLog.EventType.sfTeamGrantAccess(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Invited team members to shared folder (deprecated, replaced by 'Invited user to Dropbox and added +/// them to shared file/folder') +@objc +public class DBXTeamLogEventTypeSfTeamInvite: DBXTeamLogEventType { + @objc + public var sfTeamInvite: DBXTeamLogSfTeamInviteType + + @objc + public init(_ arg: DBXTeamLogSfTeamInviteType) { + self.sfTeamInvite = arg + let swift = TeamLog.EventType.sfTeamInvite(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed team member's role in shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfTeamInviteChangeRole: DBXTeamLogEventType { + @objc + public var sfTeamInviteChangeRole: DBXTeamLogSfTeamInviteChangeRoleType + + @objc + public init(_ arg: DBXTeamLogSfTeamInviteChangeRoleType) { + self.sfTeamInviteChangeRole = arg + let swift = TeamLog.EventType.sfTeamInviteChangeRole(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Joined team member's shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfTeamJoin: DBXTeamLogEventType { + @objc + public var sfTeamJoin: DBXTeamLogSfTeamJoinType + + @objc + public init(_ arg: DBXTeamLogSfTeamJoinType) { + self.sfTeamJoin = arg + let swift = TeamLog.EventType.sfTeamJoin(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Joined team member's shared folder from link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSfTeamJoinFromOobLink: DBXTeamLogEventType { + @objc + public var sfTeamJoinFromOobLink: DBXTeamLogSfTeamJoinFromOobLinkType + + @objc + public init(_ arg: DBXTeamLogSfTeamJoinFromOobLinkType) { + self.sfTeamJoinFromOobLink = arg + let swift = TeamLog.EventType.sfTeamJoinFromOobLink(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Unshared folder with team member (deprecated, replaced by 'Removed invitee from shared file/folder +/// before invite was accepted') +@objc +public class DBXTeamLogEventTypeSfTeamUninvite: DBXTeamLogEventType { + @objc + public var sfTeamUninvite: DBXTeamLogSfTeamUninviteType + + @objc + public init(_ arg: DBXTeamLogSfTeamUninviteType) { + self.sfTeamUninvite = arg + let swift = TeamLog.EventType.sfTeamUninvite(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Invited user to Dropbox and added them to shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentAddInvitees: DBXTeamLogEventType { + @objc + public var sharedContentAddInvitees: DBXTeamLogSharedContentAddInviteesType + + @objc + public init(_ arg: DBXTeamLogSharedContentAddInviteesType) { + self.sharedContentAddInvitees = arg + let swift = TeamLog.EventType.sharedContentAddInvitees(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added expiration date to link for shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentAddLinkExpiry: DBXTeamLogEventType { + @objc + public var sharedContentAddLinkExpiry: DBXTeamLogSharedContentAddLinkExpiryType + + @objc + public init(_ arg: DBXTeamLogSharedContentAddLinkExpiryType) { + self.sharedContentAddLinkExpiry = arg + let swift = TeamLog.EventType.sharedContentAddLinkExpiry(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added password to link for shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentAddLinkPassword: DBXTeamLogEventType { + @objc + public var sharedContentAddLinkPassword: DBXTeamLogSharedContentAddLinkPasswordType + + @objc + public init(_ arg: DBXTeamLogSharedContentAddLinkPasswordType) { + self.sharedContentAddLinkPassword = arg + let swift = TeamLog.EventType.sharedContentAddLinkPassword(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added users and/or groups to shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentAddMember: DBXTeamLogEventType { + @objc + public var sharedContentAddMember: DBXTeamLogSharedContentAddMemberType + + @objc + public init(_ arg: DBXTeamLogSharedContentAddMemberType) { + self.sharedContentAddMember = arg + let swift = TeamLog.EventType.sharedContentAddMember(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed whether members can download shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentChangeDownloadsPolicy: DBXTeamLogEventType { + @objc + public var sharedContentChangeDownloadsPolicy: DBXTeamLogSharedContentChangeDownloadsPolicyType + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeDownloadsPolicyType) { + self.sharedContentChangeDownloadsPolicy = arg + let swift = TeamLog.EventType.sharedContentChangeDownloadsPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed access type of invitee to shared file/folder before invite was accepted +@objc +public class DBXTeamLogEventTypeSharedContentChangeInviteeRole: DBXTeamLogEventType { + @objc + public var sharedContentChangeInviteeRole: DBXTeamLogSharedContentChangeInviteeRoleType + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeInviteeRoleType) { + self.sharedContentChangeInviteeRole = arg + let swift = TeamLog.EventType.sharedContentChangeInviteeRole(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed link audience of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentChangeLinkAudience: DBXTeamLogEventType { + @objc + public var sharedContentChangeLinkAudience: DBXTeamLogSharedContentChangeLinkAudienceType + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeLinkAudienceType) { + self.sharedContentChangeLinkAudience = arg + let swift = TeamLog.EventType.sharedContentChangeLinkAudience(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed link expiration of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentChangeLinkExpiry: DBXTeamLogEventType { + @objc + public var sharedContentChangeLinkExpiry: DBXTeamLogSharedContentChangeLinkExpiryType + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeLinkExpiryType) { + self.sharedContentChangeLinkExpiry = arg + let swift = TeamLog.EventType.sharedContentChangeLinkExpiry(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed link password of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentChangeLinkPassword: DBXTeamLogEventType { + @objc + public var sharedContentChangeLinkPassword: DBXTeamLogSharedContentChangeLinkPasswordType + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeLinkPasswordType) { + self.sharedContentChangeLinkPassword = arg + let swift = TeamLog.EventType.sharedContentChangeLinkPassword(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed access type of shared file/folder member +@objc +public class DBXTeamLogEventTypeSharedContentChangeMemberRole: DBXTeamLogEventType { + @objc + public var sharedContentChangeMemberRole: DBXTeamLogSharedContentChangeMemberRoleType + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeMemberRoleType) { + self.sharedContentChangeMemberRole = arg + let swift = TeamLog.EventType.sharedContentChangeMemberRole(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed whether members can see who viewed shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentChangeViewerInfoPolicy: DBXTeamLogEventType { + @objc + public var sharedContentChangeViewerInfoPolicy: DBXTeamLogSharedContentChangeViewerInfoPolicyType + + @objc + public init(_ arg: DBXTeamLogSharedContentChangeViewerInfoPolicyType) { + self.sharedContentChangeViewerInfoPolicy = arg + let swift = TeamLog.EventType.sharedContentChangeViewerInfoPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Acquired membership of shared file/folder by accepting invite +@objc +public class DBXTeamLogEventTypeSharedContentClaimInvitation: DBXTeamLogEventType { + @objc + public var sharedContentClaimInvitation: DBXTeamLogSharedContentClaimInvitationType + + @objc + public init(_ arg: DBXTeamLogSharedContentClaimInvitationType) { + self.sharedContentClaimInvitation = arg + let swift = TeamLog.EventType.sharedContentClaimInvitation(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Copied shared file/folder to own Dropbox +@objc +public class DBXTeamLogEventTypeSharedContentCopy: DBXTeamLogEventType { + @objc + public var sharedContentCopy: DBXTeamLogSharedContentCopyType + + @objc + public init(_ arg: DBXTeamLogSharedContentCopyType) { + self.sharedContentCopy = arg + let swift = TeamLog.EventType.sharedContentCopy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Downloaded shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentDownload: DBXTeamLogEventType { + @objc + public var sharedContentDownload: DBXTeamLogSharedContentDownloadType + + @objc + public init(_ arg: DBXTeamLogSharedContentDownloadType) { + self.sharedContentDownload = arg + let swift = TeamLog.EventType.sharedContentDownload(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Left shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentRelinquishMembership: DBXTeamLogEventType { + @objc + public var sharedContentRelinquishMembership: DBXTeamLogSharedContentRelinquishMembershipType + + @objc + public init(_ arg: DBXTeamLogSharedContentRelinquishMembershipType) { + self.sharedContentRelinquishMembership = arg + let swift = TeamLog.EventType.sharedContentRelinquishMembership(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed invitee from shared file/folder before invite was accepted +@objc +public class DBXTeamLogEventTypeSharedContentRemoveInvitees: DBXTeamLogEventType { + @objc + public var sharedContentRemoveInvitees: DBXTeamLogSharedContentRemoveInviteesType + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveInviteesType) { + self.sharedContentRemoveInvitees = arg + let swift = TeamLog.EventType.sharedContentRemoveInvitees(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed link expiration date of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentRemoveLinkExpiry: DBXTeamLogEventType { + @objc + public var sharedContentRemoveLinkExpiry: DBXTeamLogSharedContentRemoveLinkExpiryType + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveLinkExpiryType) { + self.sharedContentRemoveLinkExpiry = arg + let swift = TeamLog.EventType.sharedContentRemoveLinkExpiry(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed link password of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedContentRemoveLinkPassword: DBXTeamLogEventType { + @objc + public var sharedContentRemoveLinkPassword: DBXTeamLogSharedContentRemoveLinkPasswordType + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveLinkPasswordType) { + self.sharedContentRemoveLinkPassword = arg + let swift = TeamLog.EventType.sharedContentRemoveLinkPassword(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed user/group from shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentRemoveMember: DBXTeamLogEventType { + @objc + public var sharedContentRemoveMember: DBXTeamLogSharedContentRemoveMemberType + + @objc + public init(_ arg: DBXTeamLogSharedContentRemoveMemberType) { + self.sharedContentRemoveMember = arg + let swift = TeamLog.EventType.sharedContentRemoveMember(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Requested access to shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentRequestAccess: DBXTeamLogEventType { + @objc + public var sharedContentRequestAccess: DBXTeamLogSharedContentRequestAccessType + + @objc + public init(_ arg: DBXTeamLogSharedContentRequestAccessType) { + self.sharedContentRequestAccess = arg + let swift = TeamLog.EventType.sharedContentRequestAccess(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Restored shared file/folder invitees +@objc +public class DBXTeamLogEventTypeSharedContentRestoreInvitees: DBXTeamLogEventType { + @objc + public var sharedContentRestoreInvitees: DBXTeamLogSharedContentRestoreInviteesType + + @objc + public init(_ arg: DBXTeamLogSharedContentRestoreInviteesType) { + self.sharedContentRestoreInvitees = arg + let swift = TeamLog.EventType.sharedContentRestoreInvitees(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Restored users and/or groups to membership of shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentRestoreMember: DBXTeamLogEventType { + @objc + public var sharedContentRestoreMember: DBXTeamLogSharedContentRestoreMemberType + + @objc + public init(_ arg: DBXTeamLogSharedContentRestoreMemberType) { + self.sharedContentRestoreMember = arg + let swift = TeamLog.EventType.sharedContentRestoreMember(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Unshared file/folder by clearing membership +@objc +public class DBXTeamLogEventTypeSharedContentUnshare: DBXTeamLogEventType { + @objc + public var sharedContentUnshare: DBXTeamLogSharedContentUnshareType + + @objc + public init(_ arg: DBXTeamLogSharedContentUnshareType) { + self.sharedContentUnshare = arg + let swift = TeamLog.EventType.sharedContentUnshare(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Previewed shared file/folder +@objc +public class DBXTeamLogEventTypeSharedContentView: DBXTeamLogEventType { + @objc + public var sharedContentView: DBXTeamLogSharedContentViewType + + @objc + public init(_ arg: DBXTeamLogSharedContentViewType) { + self.sharedContentView = arg + let swift = TeamLog.EventType.sharedContentView(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed who can access shared folder via link +@objc +public class DBXTeamLogEventTypeSharedFolderChangeLinkPolicy: DBXTeamLogEventType { + @objc + public var sharedFolderChangeLinkPolicy: DBXTeamLogSharedFolderChangeLinkPolicyType + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeLinkPolicyType) { + self.sharedFolderChangeLinkPolicy = arg + let swift = TeamLog.EventType.sharedFolderChangeLinkPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed whether shared folder inherits members from parent folder +@objc +public class DBXTeamLogEventTypeSharedFolderChangeMembersInheritancePolicy: DBXTeamLogEventType { + @objc + public var sharedFolderChangeMembersInheritancePolicy: DBXTeamLogSharedFolderChangeMembersInheritancePolicyType + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeMembersInheritancePolicyType) { + self.sharedFolderChangeMembersInheritancePolicy = arg + let swift = TeamLog.EventType.sharedFolderChangeMembersInheritancePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed who can add/remove members of shared folder +@objc +public class DBXTeamLogEventTypeSharedFolderChangeMembersManagementPolicy: DBXTeamLogEventType { + @objc + public var sharedFolderChangeMembersManagementPolicy: DBXTeamLogSharedFolderChangeMembersManagementPolicyType + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeMembersManagementPolicyType) { + self.sharedFolderChangeMembersManagementPolicy = arg + let swift = TeamLog.EventType.sharedFolderChangeMembersManagementPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed who can become member of shared folder +@objc +public class DBXTeamLogEventTypeSharedFolderChangeMembersPolicy: DBXTeamLogEventType { + @objc + public var sharedFolderChangeMembersPolicy: DBXTeamLogSharedFolderChangeMembersPolicyType + + @objc + public init(_ arg: DBXTeamLogSharedFolderChangeMembersPolicyType) { + self.sharedFolderChangeMembersPolicy = arg + let swift = TeamLog.EventType.sharedFolderChangeMembersPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Created shared folder +@objc +public class DBXTeamLogEventTypeSharedFolderCreate: DBXTeamLogEventType { + @objc + public var sharedFolderCreate: DBXTeamLogSharedFolderCreateType + + @objc + public init(_ arg: DBXTeamLogSharedFolderCreateType) { + self.sharedFolderCreate = arg + let swift = TeamLog.EventType.sharedFolderCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Declined team member's invite to shared folder +@objc +public class DBXTeamLogEventTypeSharedFolderDeclineInvitation: DBXTeamLogEventType { + @objc + public var sharedFolderDeclineInvitation: DBXTeamLogSharedFolderDeclineInvitationType + + @objc + public init(_ arg: DBXTeamLogSharedFolderDeclineInvitationType) { + self.sharedFolderDeclineInvitation = arg + let swift = TeamLog.EventType.sharedFolderDeclineInvitation(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added shared folder to own Dropbox +@objc +public class DBXTeamLogEventTypeSharedFolderMount: DBXTeamLogEventType { + @objc + public var sharedFolderMount: DBXTeamLogSharedFolderMountType + + @objc + public init(_ arg: DBXTeamLogSharedFolderMountType) { + self.sharedFolderMount = arg + let swift = TeamLog.EventType.sharedFolderMount(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed parent of shared folder +@objc +public class DBXTeamLogEventTypeSharedFolderNest: DBXTeamLogEventType { + @objc + public var sharedFolderNest: DBXTeamLogSharedFolderNestType + + @objc + public init(_ arg: DBXTeamLogSharedFolderNestType) { + self.sharedFolderNest = arg + let swift = TeamLog.EventType.sharedFolderNest(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Transferred ownership of shared folder to another member +@objc +public class DBXTeamLogEventTypeSharedFolderTransferOwnership: DBXTeamLogEventType { + @objc + public var sharedFolderTransferOwnership: DBXTeamLogSharedFolderTransferOwnershipType + + @objc + public init(_ arg: DBXTeamLogSharedFolderTransferOwnershipType) { + self.sharedFolderTransferOwnership = arg + let swift = TeamLog.EventType.sharedFolderTransferOwnership(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Deleted shared folder from Dropbox +@objc +public class DBXTeamLogEventTypeSharedFolderUnmount: DBXTeamLogEventType { + @objc + public var sharedFolderUnmount: DBXTeamLogSharedFolderUnmountType + + @objc + public init(_ arg: DBXTeamLogSharedFolderUnmountType) { + self.sharedFolderUnmount = arg + let swift = TeamLog.EventType.sharedFolderUnmount(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added shared link expiration date +@objc +public class DBXTeamLogEventTypeSharedLinkAddExpiry: DBXTeamLogEventType { + @objc + public var sharedLinkAddExpiry: DBXTeamLogSharedLinkAddExpiryType + + @objc + public init(_ arg: DBXTeamLogSharedLinkAddExpiryType) { + self.sharedLinkAddExpiry = arg + let swift = TeamLog.EventType.sharedLinkAddExpiry(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed shared link expiration date +@objc +public class DBXTeamLogEventTypeSharedLinkChangeExpiry: DBXTeamLogEventType { + @objc + public var sharedLinkChangeExpiry: DBXTeamLogSharedLinkChangeExpiryType + + @objc + public init(_ arg: DBXTeamLogSharedLinkChangeExpiryType) { + self.sharedLinkChangeExpiry = arg + let swift = TeamLog.EventType.sharedLinkChangeExpiry(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed visibility of shared link +@objc +public class DBXTeamLogEventTypeSharedLinkChangeVisibility: DBXTeamLogEventType { + @objc + public var sharedLinkChangeVisibility: DBXTeamLogSharedLinkChangeVisibilityType + + @objc + public init(_ arg: DBXTeamLogSharedLinkChangeVisibilityType) { + self.sharedLinkChangeVisibility = arg + let swift = TeamLog.EventType.sharedLinkChangeVisibility(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added file/folder to Dropbox from shared link +@objc +public class DBXTeamLogEventTypeSharedLinkCopy: DBXTeamLogEventType { + @objc + public var sharedLinkCopy: DBXTeamLogSharedLinkCopyType + + @objc + public init(_ arg: DBXTeamLogSharedLinkCopyType) { + self.sharedLinkCopy = arg + let swift = TeamLog.EventType.sharedLinkCopy(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Created shared link +@objc +public class DBXTeamLogEventTypeSharedLinkCreate: DBXTeamLogEventType { + @objc + public var sharedLinkCreate: DBXTeamLogSharedLinkCreateType + + @objc + public init(_ arg: DBXTeamLogSharedLinkCreateType) { + self.sharedLinkCreate = arg + let swift = TeamLog.EventType.sharedLinkCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed shared link +@objc +public class DBXTeamLogEventTypeSharedLinkDisable: DBXTeamLogEventType { + @objc + public var sharedLinkDisable: DBXTeamLogSharedLinkDisableType + + @objc + public init(_ arg: DBXTeamLogSharedLinkDisableType) { + self.sharedLinkDisable = arg + let swift = TeamLog.EventType.sharedLinkDisable(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Downloaded file/folder from shared link +@objc +public class DBXTeamLogEventTypeSharedLinkDownload: DBXTeamLogEventType { + @objc + public var sharedLinkDownload: DBXTeamLogSharedLinkDownloadType + + @objc + public init(_ arg: DBXTeamLogSharedLinkDownloadType) { + self.sharedLinkDownload = arg + let swift = TeamLog.EventType.sharedLinkDownload(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed shared link expiration date +@objc +public class DBXTeamLogEventTypeSharedLinkRemoveExpiry: DBXTeamLogEventType { + @objc + public var sharedLinkRemoveExpiry: DBXTeamLogSharedLinkRemoveExpiryType + + @objc + public init(_ arg: DBXTeamLogSharedLinkRemoveExpiryType) { + self.sharedLinkRemoveExpiry = arg + let swift = TeamLog.EventType.sharedLinkRemoveExpiry(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added an expiration date to the shared link +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsAddExpiration: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsAddExpiration: DBXTeamLogSharedLinkSettingsAddExpirationType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAddExpirationType) { + self.sharedLinkSettingsAddExpiration = arg + let swift = TeamLog.EventType.sharedLinkSettingsAddExpiration(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added a password to the shared link +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsAddPassword: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsAddPassword: DBXTeamLogSharedLinkSettingsAddPasswordType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAddPasswordType) { + self.sharedLinkSettingsAddPassword = arg + let swift = TeamLog.EventType.sharedLinkSettingsAddPassword(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Disabled downloads +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadDisabled: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsAllowDownloadDisabled: DBXTeamLogSharedLinkSettingsAllowDownloadDisabledType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAllowDownloadDisabledType) { + self.sharedLinkSettingsAllowDownloadDisabled = arg + let swift = TeamLog.EventType.sharedLinkSettingsAllowDownloadDisabled(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Enabled downloads +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsAllowDownloadEnabled: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsAllowDownloadEnabled: DBXTeamLogSharedLinkSettingsAllowDownloadEnabledType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsAllowDownloadEnabledType) { + self.sharedLinkSettingsAllowDownloadEnabled = arg + let swift = TeamLog.EventType.sharedLinkSettingsAllowDownloadEnabled(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed the audience of the shared link +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsChangeAudience: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsChangeAudience: DBXTeamLogSharedLinkSettingsChangeAudienceType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsChangeAudienceType) { + self.sharedLinkSettingsChangeAudience = arg + let swift = TeamLog.EventType.sharedLinkSettingsChangeAudience(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed the expiration date of the shared link +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsChangeExpiration: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsChangeExpiration: DBXTeamLogSharedLinkSettingsChangeExpirationType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsChangeExpirationType) { + self.sharedLinkSettingsChangeExpiration = arg + let swift = TeamLog.EventType.sharedLinkSettingsChangeExpiration(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Changed the password of the shared link +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsChangePassword: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsChangePassword: DBXTeamLogSharedLinkSettingsChangePasswordType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsChangePasswordType) { + self.sharedLinkSettingsChangePassword = arg + let swift = TeamLog.EventType.sharedLinkSettingsChangePassword(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed the expiration date from the shared link +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsRemoveExpiration: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsRemoveExpiration: DBXTeamLogSharedLinkSettingsRemoveExpirationType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsRemoveExpirationType) { + self.sharedLinkSettingsRemoveExpiration = arg + let swift = TeamLog.EventType.sharedLinkSettingsRemoveExpiration(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Removed the password from the shared link +@objc +public class DBXTeamLogEventTypeSharedLinkSettingsRemovePassword: DBXTeamLogEventType { + @objc + public var sharedLinkSettingsRemovePassword: DBXTeamLogSharedLinkSettingsRemovePasswordType + + @objc + public init(_ arg: DBXTeamLogSharedLinkSettingsRemovePasswordType) { + self.sharedLinkSettingsRemovePassword = arg + let swift = TeamLog.EventType.sharedLinkSettingsRemovePassword(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Added members as audience of shared link +@objc +public class DBXTeamLogEventTypeSharedLinkShare: DBXTeamLogEventType { + @objc + public var sharedLinkShare: DBXTeamLogSharedLinkShareType + + @objc + public init(_ arg: DBXTeamLogSharedLinkShareType) { + self.sharedLinkShare = arg + let swift = TeamLog.EventType.sharedLinkShare(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Opened shared link +@objc +public class DBXTeamLogEventTypeSharedLinkView: DBXTeamLogEventType { + @objc + public var sharedLinkView: DBXTeamLogSharedLinkViewType + + @objc + public init(_ arg: DBXTeamLogSharedLinkViewType) { + self.sharedLinkView = arg + let swift = TeamLog.EventType.sharedLinkView(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Opened shared Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeSharedNoteOpened: DBXTeamLogEventType { + @objc + public var sharedNoteOpened: DBXTeamLogSharedNoteOpenedType + + @objc + public init(_ arg: DBXTeamLogSharedNoteOpenedType) { + self.sharedNoteOpened = arg + let swift = TeamLog.EventType.sharedNoteOpened(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Disabled downloads for link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeShmodelDisableDownloads: DBXTeamLogEventType { + @objc + public var shmodelDisableDownloads: DBXTeamLogShmodelDisableDownloadsType + + @objc + public init(_ arg: DBXTeamLogShmodelDisableDownloadsType) { + self.shmodelDisableDownloads = arg + let swift = TeamLog.EventType.shmodelDisableDownloads(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Enabled downloads for link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeShmodelEnableDownloads: DBXTeamLogEventType { + @objc + public var shmodelEnableDownloads: DBXTeamLogShmodelEnableDownloadsType + + @objc + public init(_ arg: DBXTeamLogShmodelEnableDownloadsType) { + self.shmodelEnableDownloads = arg + let swift = TeamLog.EventType.shmodelEnableDownloads(arg.swift) + super.init(swift: swift) + } +} + +/// (sharing) Shared link with group (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeShmodelGroupShare: DBXTeamLogEventType { + @objc + public var shmodelGroupShare: DBXTeamLogShmodelGroupShareType + + @objc + public init(_ arg: DBXTeamLogShmodelGroupShareType) { + self.shmodelGroupShare = arg + let swift = TeamLog.EventType.shmodelGroupShare(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Granted access to showcase +@objc +public class DBXTeamLogEventTypeShowcaseAccessGranted: DBXTeamLogEventType { + @objc + public var showcaseAccessGranted: DBXTeamLogShowcaseAccessGrantedType + + @objc + public init(_ arg: DBXTeamLogShowcaseAccessGrantedType) { + self.showcaseAccessGranted = arg + let swift = TeamLog.EventType.showcaseAccessGranted(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Added member to showcase +@objc +public class DBXTeamLogEventTypeShowcaseAddMember: DBXTeamLogEventType { + @objc + public var showcaseAddMember: DBXTeamLogShowcaseAddMemberType + + @objc + public init(_ arg: DBXTeamLogShowcaseAddMemberType) { + self.showcaseAddMember = arg + let swift = TeamLog.EventType.showcaseAddMember(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Archived showcase +@objc +public class DBXTeamLogEventTypeShowcaseArchived: DBXTeamLogEventType { + @objc + public var showcaseArchived: DBXTeamLogShowcaseArchivedType + + @objc + public init(_ arg: DBXTeamLogShowcaseArchivedType) { + self.showcaseArchived = arg + let swift = TeamLog.EventType.showcaseArchived(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Created showcase +@objc +public class DBXTeamLogEventTypeShowcaseCreated: DBXTeamLogEventType { + @objc + public var showcaseCreated: DBXTeamLogShowcaseCreatedType + + @objc + public init(_ arg: DBXTeamLogShowcaseCreatedType) { + self.showcaseCreated = arg + let swift = TeamLog.EventType.showcaseCreated(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Deleted showcase comment +@objc +public class DBXTeamLogEventTypeShowcaseDeleteComment: DBXTeamLogEventType { + @objc + public var showcaseDeleteComment: DBXTeamLogShowcaseDeleteCommentType + + @objc + public init(_ arg: DBXTeamLogShowcaseDeleteCommentType) { + self.showcaseDeleteComment = arg + let swift = TeamLog.EventType.showcaseDeleteComment(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Edited showcase +@objc +public class DBXTeamLogEventTypeShowcaseEdited: DBXTeamLogEventType { + @objc + public var showcaseEdited: DBXTeamLogShowcaseEditedType + + @objc + public init(_ arg: DBXTeamLogShowcaseEditedType) { + self.showcaseEdited = arg + let swift = TeamLog.EventType.showcaseEdited(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Edited showcase comment +@objc +public class DBXTeamLogEventTypeShowcaseEditComment: DBXTeamLogEventType { + @objc + public var showcaseEditComment: DBXTeamLogShowcaseEditCommentType + + @objc + public init(_ arg: DBXTeamLogShowcaseEditCommentType) { + self.showcaseEditComment = arg + let swift = TeamLog.EventType.showcaseEditComment(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Added file to showcase +@objc +public class DBXTeamLogEventTypeShowcaseFileAdded: DBXTeamLogEventType { + @objc + public var showcaseFileAdded: DBXTeamLogShowcaseFileAddedType + + @objc + public init(_ arg: DBXTeamLogShowcaseFileAddedType) { + self.showcaseFileAdded = arg + let swift = TeamLog.EventType.showcaseFileAdded(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Downloaded file from showcase +@objc +public class DBXTeamLogEventTypeShowcaseFileDownload: DBXTeamLogEventType { + @objc + public var showcaseFileDownload: DBXTeamLogShowcaseFileDownloadType + + @objc + public init(_ arg: DBXTeamLogShowcaseFileDownloadType) { + self.showcaseFileDownload = arg + let swift = TeamLog.EventType.showcaseFileDownload(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Removed file from showcase +@objc +public class DBXTeamLogEventTypeShowcaseFileRemoved: DBXTeamLogEventType { + @objc + public var showcaseFileRemoved: DBXTeamLogShowcaseFileRemovedType + + @objc + public init(_ arg: DBXTeamLogShowcaseFileRemovedType) { + self.showcaseFileRemoved = arg + let swift = TeamLog.EventType.showcaseFileRemoved(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Viewed file in showcase +@objc +public class DBXTeamLogEventTypeShowcaseFileView: DBXTeamLogEventType { + @objc + public var showcaseFileView: DBXTeamLogShowcaseFileViewType + + @objc + public init(_ arg: DBXTeamLogShowcaseFileViewType) { + self.showcaseFileView = arg + let swift = TeamLog.EventType.showcaseFileView(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Permanently deleted showcase +@objc +public class DBXTeamLogEventTypeShowcasePermanentlyDeleted: DBXTeamLogEventType { + @objc + public var showcasePermanentlyDeleted: DBXTeamLogShowcasePermanentlyDeletedType + + @objc + public init(_ arg: DBXTeamLogShowcasePermanentlyDeletedType) { + self.showcasePermanentlyDeleted = arg + let swift = TeamLog.EventType.showcasePermanentlyDeleted(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Added showcase comment +@objc +public class DBXTeamLogEventTypeShowcasePostComment: DBXTeamLogEventType { + @objc + public var showcasePostComment: DBXTeamLogShowcasePostCommentType + + @objc + public init(_ arg: DBXTeamLogShowcasePostCommentType) { + self.showcasePostComment = arg + let swift = TeamLog.EventType.showcasePostComment(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Removed member from showcase +@objc +public class DBXTeamLogEventTypeShowcaseRemoveMember: DBXTeamLogEventType { + @objc + public var showcaseRemoveMember: DBXTeamLogShowcaseRemoveMemberType + + @objc + public init(_ arg: DBXTeamLogShowcaseRemoveMemberType) { + self.showcaseRemoveMember = arg + let swift = TeamLog.EventType.showcaseRemoveMember(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Renamed showcase +@objc +public class DBXTeamLogEventTypeShowcaseRenamed: DBXTeamLogEventType { + @objc + public var showcaseRenamed: DBXTeamLogShowcaseRenamedType + + @objc + public init(_ arg: DBXTeamLogShowcaseRenamedType) { + self.showcaseRenamed = arg + let swift = TeamLog.EventType.showcaseRenamed(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Requested access to showcase +@objc +public class DBXTeamLogEventTypeShowcaseRequestAccess: DBXTeamLogEventType { + @objc + public var showcaseRequestAccess: DBXTeamLogShowcaseRequestAccessType + + @objc + public init(_ arg: DBXTeamLogShowcaseRequestAccessType) { + self.showcaseRequestAccess = arg + let swift = TeamLog.EventType.showcaseRequestAccess(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Resolved showcase comment +@objc +public class DBXTeamLogEventTypeShowcaseResolveComment: DBXTeamLogEventType { + @objc + public var showcaseResolveComment: DBXTeamLogShowcaseResolveCommentType + + @objc + public init(_ arg: DBXTeamLogShowcaseResolveCommentType) { + self.showcaseResolveComment = arg + let swift = TeamLog.EventType.showcaseResolveComment(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Unarchived showcase +@objc +public class DBXTeamLogEventTypeShowcaseRestored: DBXTeamLogEventType { + @objc + public var showcaseRestored: DBXTeamLogShowcaseRestoredType + + @objc + public init(_ arg: DBXTeamLogShowcaseRestoredType) { + self.showcaseRestored = arg + let swift = TeamLog.EventType.showcaseRestored(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Deleted showcase +@objc +public class DBXTeamLogEventTypeShowcaseTrashed: DBXTeamLogEventType { + @objc + public var showcaseTrashed: DBXTeamLogShowcaseTrashedType + + @objc + public init(_ arg: DBXTeamLogShowcaseTrashedType) { + self.showcaseTrashed = arg + let swift = TeamLog.EventType.showcaseTrashed(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Deleted showcase (old version) (deprecated, replaced by 'Deleted showcase') +@objc +public class DBXTeamLogEventTypeShowcaseTrashedDeprecated: DBXTeamLogEventType { + @objc + public var showcaseTrashedDeprecated: DBXTeamLogShowcaseTrashedDeprecatedType + + @objc + public init(_ arg: DBXTeamLogShowcaseTrashedDeprecatedType) { + self.showcaseTrashedDeprecated = arg + let swift = TeamLog.EventType.showcaseTrashedDeprecated(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Unresolved showcase comment +@objc +public class DBXTeamLogEventTypeShowcaseUnresolveComment: DBXTeamLogEventType { + @objc + public var showcaseUnresolveComment: DBXTeamLogShowcaseUnresolveCommentType + + @objc + public init(_ arg: DBXTeamLogShowcaseUnresolveCommentType) { + self.showcaseUnresolveComment = arg + let swift = TeamLog.EventType.showcaseUnresolveComment(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Restored showcase +@objc +public class DBXTeamLogEventTypeShowcaseUntrashed: DBXTeamLogEventType { + @objc + public var showcaseUntrashed: DBXTeamLogShowcaseUntrashedType + + @objc + public init(_ arg: DBXTeamLogShowcaseUntrashedType) { + self.showcaseUntrashed = arg + let swift = TeamLog.EventType.showcaseUntrashed(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Restored showcase (old version) (deprecated, replaced by 'Restored showcase') +@objc +public class DBXTeamLogEventTypeShowcaseUntrashedDeprecated: DBXTeamLogEventType { + @objc + public var showcaseUntrashedDeprecated: DBXTeamLogShowcaseUntrashedDeprecatedType + + @objc + public init(_ arg: DBXTeamLogShowcaseUntrashedDeprecatedType) { + self.showcaseUntrashedDeprecated = arg + let swift = TeamLog.EventType.showcaseUntrashedDeprecated(arg.swift) + super.init(swift: swift) + } +} + +/// (showcase) Viewed showcase +@objc +public class DBXTeamLogEventTypeShowcaseView: DBXTeamLogEventType { + @objc + public var showcaseView: DBXTeamLogShowcaseViewType + + @objc + public init(_ arg: DBXTeamLogShowcaseViewType) { + self.showcaseView = arg + let swift = TeamLog.EventType.showcaseView(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Added X.509 certificate for SSO +@objc +public class DBXTeamLogEventTypeSsoAddCert: DBXTeamLogEventType { + @objc + public var ssoAddCert: DBXTeamLogSsoAddCertType + + @objc + public init(_ arg: DBXTeamLogSsoAddCertType) { + self.ssoAddCert = arg + let swift = TeamLog.EventType.ssoAddCert(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Added sign-in URL for SSO +@objc +public class DBXTeamLogEventTypeSsoAddLoginUrl: DBXTeamLogEventType { + @objc + public var ssoAddLoginUrl: DBXTeamLogSsoAddLoginUrlType + + @objc + public init(_ arg: DBXTeamLogSsoAddLoginUrlType) { + self.ssoAddLoginUrl = arg + let swift = TeamLog.EventType.ssoAddLoginUrl(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Added sign-out URL for SSO +@objc +public class DBXTeamLogEventTypeSsoAddLogoutUrl: DBXTeamLogEventType { + @objc + public var ssoAddLogoutUrl: DBXTeamLogSsoAddLogoutUrlType + + @objc + public init(_ arg: DBXTeamLogSsoAddLogoutUrlType) { + self.ssoAddLogoutUrl = arg + let swift = TeamLog.EventType.ssoAddLogoutUrl(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Changed X.509 certificate for SSO +@objc +public class DBXTeamLogEventTypeSsoChangeCert: DBXTeamLogEventType { + @objc + public var ssoChangeCert: DBXTeamLogSsoChangeCertType + + @objc + public init(_ arg: DBXTeamLogSsoChangeCertType) { + self.ssoChangeCert = arg + let swift = TeamLog.EventType.ssoChangeCert(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Changed sign-in URL for SSO +@objc +public class DBXTeamLogEventTypeSsoChangeLoginUrl: DBXTeamLogEventType { + @objc + public var ssoChangeLoginUrl: DBXTeamLogSsoChangeLoginUrlType + + @objc + public init(_ arg: DBXTeamLogSsoChangeLoginUrlType) { + self.ssoChangeLoginUrl = arg + let swift = TeamLog.EventType.ssoChangeLoginUrl(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Changed sign-out URL for SSO +@objc +public class DBXTeamLogEventTypeSsoChangeLogoutUrl: DBXTeamLogEventType { + @objc + public var ssoChangeLogoutUrl: DBXTeamLogSsoChangeLogoutUrlType + + @objc + public init(_ arg: DBXTeamLogSsoChangeLogoutUrlType) { + self.ssoChangeLogoutUrl = arg + let swift = TeamLog.EventType.ssoChangeLogoutUrl(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Changed SAML identity mode for SSO +@objc +public class DBXTeamLogEventTypeSsoChangeSamlIdentityMode: DBXTeamLogEventType { + @objc + public var ssoChangeSamlIdentityMode: DBXTeamLogSsoChangeSamlIdentityModeType + + @objc + public init(_ arg: DBXTeamLogSsoChangeSamlIdentityModeType) { + self.ssoChangeSamlIdentityMode = arg + let swift = TeamLog.EventType.ssoChangeSamlIdentityMode(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Removed X.509 certificate for SSO +@objc +public class DBXTeamLogEventTypeSsoRemoveCert: DBXTeamLogEventType { + @objc + public var ssoRemoveCert: DBXTeamLogSsoRemoveCertType + + @objc + public init(_ arg: DBXTeamLogSsoRemoveCertType) { + self.ssoRemoveCert = arg + let swift = TeamLog.EventType.ssoRemoveCert(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Removed sign-in URL for SSO +@objc +public class DBXTeamLogEventTypeSsoRemoveLoginUrl: DBXTeamLogEventType { + @objc + public var ssoRemoveLoginUrl: DBXTeamLogSsoRemoveLoginUrlType + + @objc + public init(_ arg: DBXTeamLogSsoRemoveLoginUrlType) { + self.ssoRemoveLoginUrl = arg + let swift = TeamLog.EventType.ssoRemoveLoginUrl(arg.swift) + super.init(swift: swift) + } +} + +/// (sso) Removed sign-out URL for SSO +@objc +public class DBXTeamLogEventTypeSsoRemoveLogoutUrl: DBXTeamLogEventType { + @objc + public var ssoRemoveLogoutUrl: DBXTeamLogSsoRemoveLogoutUrlType + + @objc + public init(_ arg: DBXTeamLogSsoRemoveLogoutUrlType) { + self.ssoRemoveLogoutUrl = arg + let swift = TeamLog.EventType.ssoRemoveLogoutUrl(arg.swift) + super.init(swift: swift) + } +} + +/// (team_folders) Changed archival status of team folder +@objc +public class DBXTeamLogEventTypeTeamFolderChangeStatus: DBXTeamLogEventType { + @objc + public var teamFolderChangeStatus: DBXTeamLogTeamFolderChangeStatusType + + @objc + public init(_ arg: DBXTeamLogTeamFolderChangeStatusType) { + self.teamFolderChangeStatus = arg + let swift = TeamLog.EventType.teamFolderChangeStatus(arg.swift) + super.init(swift: swift) + } +} + +/// (team_folders) Created team folder in active status +@objc +public class DBXTeamLogEventTypeTeamFolderCreate: DBXTeamLogEventType { + @objc + public var teamFolderCreate: DBXTeamLogTeamFolderCreateType + + @objc + public init(_ arg: DBXTeamLogTeamFolderCreateType) { + self.teamFolderCreate = arg + let swift = TeamLog.EventType.teamFolderCreate(arg.swift) + super.init(swift: swift) + } +} + +/// (team_folders) Downgraded team folder to regular shared folder +@objc +public class DBXTeamLogEventTypeTeamFolderDowngrade: DBXTeamLogEventType { + @objc + public var teamFolderDowngrade: DBXTeamLogTeamFolderDowngradeType + + @objc + public init(_ arg: DBXTeamLogTeamFolderDowngradeType) { + self.teamFolderDowngrade = arg + let swift = TeamLog.EventType.teamFolderDowngrade(arg.swift) + super.init(swift: swift) + } +} + +/// (team_folders) Permanently deleted archived team folder +@objc +public class DBXTeamLogEventTypeTeamFolderPermanentlyDelete: DBXTeamLogEventType { + @objc + public var teamFolderPermanentlyDelete: DBXTeamLogTeamFolderPermanentlyDeleteType + + @objc + public init(_ arg: DBXTeamLogTeamFolderPermanentlyDeleteType) { + self.teamFolderPermanentlyDelete = arg + let swift = TeamLog.EventType.teamFolderPermanentlyDelete(arg.swift) + super.init(swift: swift) + } +} + +/// (team_folders) Renamed active/archived team folder +@objc +public class DBXTeamLogEventTypeTeamFolderRename: DBXTeamLogEventType { + @objc + public var teamFolderRename: DBXTeamLogTeamFolderRenameType + + @objc + public init(_ arg: DBXTeamLogTeamFolderRenameType) { + self.teamFolderRename = arg + let swift = TeamLog.EventType.teamFolderRename(arg.swift) + super.init(swift: swift) + } +} + +/// (team_folders) Changed sync default +@objc +public class DBXTeamLogEventTypeTeamSelectiveSyncSettingsChanged: DBXTeamLogEventType { + @objc + public var teamSelectiveSyncSettingsChanged: DBXTeamLogTeamSelectiveSyncSettingsChangedType + + @objc + public init(_ arg: DBXTeamLogTeamSelectiveSyncSettingsChangedType) { + self.teamSelectiveSyncSettingsChanged = arg + let swift = TeamLog.EventType.teamSelectiveSyncSettingsChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed account capture setting on team domain +@objc +public class DBXTeamLogEventTypeAccountCaptureChangePolicy: DBXTeamLogEventType { + @objc + public var accountCaptureChangePolicy: DBXTeamLogAccountCaptureChangePolicyType + + @objc + public init(_ arg: DBXTeamLogAccountCaptureChangePolicyType) { + self.accountCaptureChangePolicy = arg + let swift = TeamLog.EventType.accountCaptureChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed admin reminder settings for requests to join the team +@objc +public class DBXTeamLogEventTypeAdminEmailRemindersChanged: DBXTeamLogEventType { + @objc + public var adminEmailRemindersChanged: DBXTeamLogAdminEmailRemindersChangedType + + @objc + public init(_ arg: DBXTeamLogAdminEmailRemindersChangedType) { + self.adminEmailRemindersChanged = arg + let swift = TeamLog.EventType.adminEmailRemindersChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Disabled downloads (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeAllowDownloadDisabled: DBXTeamLogEventType { + @objc + public var allowDownloadDisabled: DBXTeamLogAllowDownloadDisabledType + + @objc + public init(_ arg: DBXTeamLogAllowDownloadDisabledType) { + self.allowDownloadDisabled = arg + let swift = TeamLog.EventType.allowDownloadDisabled(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled downloads (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeAllowDownloadEnabled: DBXTeamLogEventType { + @objc + public var allowDownloadEnabled: DBXTeamLogAllowDownloadEnabledType + + @objc + public init(_ arg: DBXTeamLogAllowDownloadEnabledType) { + self.allowDownloadEnabled = arg + let swift = TeamLog.EventType.allowDownloadEnabled(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed app permissions +@objc +public class DBXTeamLogEventTypeAppPermissionsChanged: DBXTeamLogEventType { + @objc + public var appPermissionsChanged: DBXTeamLogAppPermissionsChangedType + + @objc + public init(_ arg: DBXTeamLogAppPermissionsChangedType) { + self.appPermissionsChanged = arg + let swift = TeamLog.EventType.appPermissionsChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed camera uploads setting for team +@objc +public class DBXTeamLogEventTypeCameraUploadsPolicyChanged: DBXTeamLogEventType { + @objc + public var cameraUploadsPolicyChanged: DBXTeamLogCameraUploadsPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogCameraUploadsPolicyChangedType) { + self.cameraUploadsPolicyChanged = arg + let swift = TeamLog.EventType.cameraUploadsPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed Capture transcription policy for team +@objc +public class DBXTeamLogEventTypeCaptureTranscriptPolicyChanged: DBXTeamLogEventType { + @objc + public var captureTranscriptPolicyChanged: DBXTeamLogCaptureTranscriptPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogCaptureTranscriptPolicyChangedType) { + self.captureTranscriptPolicyChanged = arg + let swift = TeamLog.EventType.captureTranscriptPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed classification policy for team +@objc +public class DBXTeamLogEventTypeClassificationChangePolicy: DBXTeamLogEventType { + @objc + public var classificationChangePolicy: DBXTeamLogClassificationChangePolicyType + + @objc + public init(_ arg: DBXTeamLogClassificationChangePolicyType) { + self.classificationChangePolicy = arg + let swift = TeamLog.EventType.classificationChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed computer backup policy for team +@objc +public class DBXTeamLogEventTypeComputerBackupPolicyChanged: DBXTeamLogEventType { + @objc + public var computerBackupPolicyChanged: DBXTeamLogComputerBackupPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogComputerBackupPolicyChangedType) { + self.computerBackupPolicyChanged = arg + let swift = TeamLog.EventType.computerBackupPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed content management setting +@objc +public class DBXTeamLogEventTypeContentAdministrationPolicyChanged: DBXTeamLogEventType { + @objc + public var contentAdministrationPolicyChanged: DBXTeamLogContentAdministrationPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogContentAdministrationPolicyChangedType) { + self.contentAdministrationPolicyChanged = arg + let swift = TeamLog.EventType.contentAdministrationPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Set restrictions on data center locations where team data resides +@objc +public class DBXTeamLogEventTypeDataPlacementRestrictionChangePolicy: DBXTeamLogEventType { + @objc + public var dataPlacementRestrictionChangePolicy: DBXTeamLogDataPlacementRestrictionChangePolicyType + + @objc + public init(_ arg: DBXTeamLogDataPlacementRestrictionChangePolicyType) { + self.dataPlacementRestrictionChangePolicy = arg + let swift = TeamLog.EventType.dataPlacementRestrictionChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Completed restrictions on data center locations where team data resides +@objc +public class DBXTeamLogEventTypeDataPlacementRestrictionSatisfyPolicy: DBXTeamLogEventType { + @objc + public var dataPlacementRestrictionSatisfyPolicy: DBXTeamLogDataPlacementRestrictionSatisfyPolicyType + + @objc + public init(_ arg: DBXTeamLogDataPlacementRestrictionSatisfyPolicyType) { + self.dataPlacementRestrictionSatisfyPolicy = arg + let swift = TeamLog.EventType.dataPlacementRestrictionSatisfyPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Added members to device approvals exception list +@objc +public class DBXTeamLogEventTypeDeviceApprovalsAddException: DBXTeamLogEventType { + @objc + public var deviceApprovalsAddException: DBXTeamLogDeviceApprovalsAddExceptionType + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsAddExceptionType) { + self.deviceApprovalsAddException = arg + let swift = TeamLog.EventType.deviceApprovalsAddException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Set/removed limit on number of computers member can link to team Dropbox account +@objc +public class DBXTeamLogEventTypeDeviceApprovalsChangeDesktopPolicy: DBXTeamLogEventType { + @objc + public var deviceApprovalsChangeDesktopPolicy: DBXTeamLogDeviceApprovalsChangeDesktopPolicyType + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeDesktopPolicyType) { + self.deviceApprovalsChangeDesktopPolicy = arg + let swift = TeamLog.EventType.deviceApprovalsChangeDesktopPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Set/removed limit on number of mobile devices member can link to team Dropbox account +@objc +public class DBXTeamLogEventTypeDeviceApprovalsChangeMobilePolicy: DBXTeamLogEventType { + @objc + public var deviceApprovalsChangeMobilePolicy: DBXTeamLogDeviceApprovalsChangeMobilePolicyType + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeMobilePolicyType) { + self.deviceApprovalsChangeMobilePolicy = arg + let swift = TeamLog.EventType.deviceApprovalsChangeMobilePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed device approvals setting when member is over limit +@objc +public class DBXTeamLogEventTypeDeviceApprovalsChangeOverageAction: DBXTeamLogEventType { + @objc + public var deviceApprovalsChangeOverageAction: DBXTeamLogDeviceApprovalsChangeOverageActionType + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeOverageActionType) { + self.deviceApprovalsChangeOverageAction = arg + let swift = TeamLog.EventType.deviceApprovalsChangeOverageAction(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed device approvals setting when member unlinks approved device +@objc +public class DBXTeamLogEventTypeDeviceApprovalsChangeUnlinkAction: DBXTeamLogEventType { + @objc + public var deviceApprovalsChangeUnlinkAction: DBXTeamLogDeviceApprovalsChangeUnlinkActionType + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsChangeUnlinkActionType) { + self.deviceApprovalsChangeUnlinkAction = arg + let swift = TeamLog.EventType.deviceApprovalsChangeUnlinkAction(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from device approvals exception list +@objc +public class DBXTeamLogEventTypeDeviceApprovalsRemoveException: DBXTeamLogEventType { + @objc + public var deviceApprovalsRemoveException: DBXTeamLogDeviceApprovalsRemoveExceptionType + + @objc + public init(_ arg: DBXTeamLogDeviceApprovalsRemoveExceptionType) { + self.deviceApprovalsRemoveException = arg + let swift = TeamLog.EventType.deviceApprovalsRemoveException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Added members to directory restrictions list +@objc +public class DBXTeamLogEventTypeDirectoryRestrictionsAddMembers: DBXTeamLogEventType { + @objc + public var directoryRestrictionsAddMembers: DBXTeamLogDirectoryRestrictionsAddMembersType + + @objc + public init(_ arg: DBXTeamLogDirectoryRestrictionsAddMembersType) { + self.directoryRestrictionsAddMembers = arg + let swift = TeamLog.EventType.directoryRestrictionsAddMembers(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from directory restrictions list +@objc +public class DBXTeamLogEventTypeDirectoryRestrictionsRemoveMembers: DBXTeamLogEventType { + @objc + public var directoryRestrictionsRemoveMembers: DBXTeamLogDirectoryRestrictionsRemoveMembersType + + @objc + public init(_ arg: DBXTeamLogDirectoryRestrictionsRemoveMembersType) { + self.directoryRestrictionsRemoveMembers = arg + let swift = TeamLog.EventType.directoryRestrictionsRemoveMembers(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed Dropbox Passwords policy for team +@objc +public class DBXTeamLogEventTypeDropboxPasswordsPolicyChanged: DBXTeamLogEventType { + @objc + public var dropboxPasswordsPolicyChanged: DBXTeamLogDropboxPasswordsPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogDropboxPasswordsPolicyChangedType) { + self.dropboxPasswordsPolicyChanged = arg + let swift = TeamLog.EventType.dropboxPasswordsPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed email to Dropbox policy for team +@objc +public class DBXTeamLogEventTypeEmailIngestPolicyChanged: DBXTeamLogEventType { + @objc + public var emailIngestPolicyChanged: DBXTeamLogEmailIngestPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogEmailIngestPolicyChangedType) { + self.emailIngestPolicyChanged = arg + let swift = TeamLog.EventType.emailIngestPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Added members to EMM exception list +@objc +public class DBXTeamLogEventTypeEmmAddException: DBXTeamLogEventType { + @objc + public var emmAddException: DBXTeamLogEmmAddExceptionType + + @objc + public init(_ arg: DBXTeamLogEmmAddExceptionType) { + self.emmAddException = arg + let swift = TeamLog.EventType.emmAddException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled enterprise mobility management for members +@objc +public class DBXTeamLogEventTypeEmmChangePolicy: DBXTeamLogEventType { + @objc + public var emmChangePolicy: DBXTeamLogEmmChangePolicyType + + @objc + public init(_ arg: DBXTeamLogEmmChangePolicyType) { + self.emmChangePolicy = arg + let swift = TeamLog.EventType.emmChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from EMM exception list +@objc +public class DBXTeamLogEventTypeEmmRemoveException: DBXTeamLogEventType { + @objc + public var emmRemoveException: DBXTeamLogEmmRemoveExceptionType + + @objc + public init(_ arg: DBXTeamLogEmmRemoveExceptionType) { + self.emmRemoveException = arg + let swift = TeamLog.EventType.emmRemoveException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Accepted/opted out of extended version history +@objc +public class DBXTeamLogEventTypeExtendedVersionHistoryChangePolicy: DBXTeamLogEventType { + @objc + public var extendedVersionHistoryChangePolicy: DBXTeamLogExtendedVersionHistoryChangePolicyType + + @objc + public init(_ arg: DBXTeamLogExtendedVersionHistoryChangePolicyType) { + self.extendedVersionHistoryChangePolicy = arg + let swift = TeamLog.EventType.extendedVersionHistoryChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed external drive backup policy for team +@objc +public class DBXTeamLogEventTypeExternalDriveBackupPolicyChanged: DBXTeamLogEventType { + @objc + public var externalDriveBackupPolicyChanged: DBXTeamLogExternalDriveBackupPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogExternalDriveBackupPolicyChangedType) { + self.externalDriveBackupPolicyChanged = arg + let swift = TeamLog.EventType.externalDriveBackupPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled commenting on team files +@objc +public class DBXTeamLogEventTypeFileCommentsChangePolicy: DBXTeamLogEventType { + @objc + public var fileCommentsChangePolicy: DBXTeamLogFileCommentsChangePolicyType + + @objc + public init(_ arg: DBXTeamLogFileCommentsChangePolicyType) { + self.fileCommentsChangePolicy = arg + let swift = TeamLog.EventType.fileCommentsChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed file locking policy for team +@objc +public class DBXTeamLogEventTypeFileLockingPolicyChanged: DBXTeamLogEventType { + @objc + public var fileLockingPolicyChanged: DBXTeamLogFileLockingPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogFileLockingPolicyChangedType) { + self.fileLockingPolicyChanged = arg + let swift = TeamLog.EventType.fileLockingPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed File Provider Migration policy for team +@objc +public class DBXTeamLogEventTypeFileProviderMigrationPolicyChanged: DBXTeamLogEventType { + @objc + public var fileProviderMigrationPolicyChanged: DBXTeamLogFileProviderMigrationPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogFileProviderMigrationPolicyChangedType) { + self.fileProviderMigrationPolicyChanged = arg + let swift = TeamLog.EventType.fileProviderMigrationPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled file requests +@objc +public class DBXTeamLogEventTypeFileRequestsChangePolicy: DBXTeamLogEventType { + @objc + public var fileRequestsChangePolicy: DBXTeamLogFileRequestsChangePolicyType + + @objc + public init(_ arg: DBXTeamLogFileRequestsChangePolicyType) { + self.fileRequestsChangePolicy = arg + let swift = TeamLog.EventType.fileRequestsChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled file request emails for everyone (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeFileRequestsEmailsEnabled: DBXTeamLogEventType { + @objc + public var fileRequestsEmailsEnabled: DBXTeamLogFileRequestsEmailsEnabledType + + @objc + public init(_ arg: DBXTeamLogFileRequestsEmailsEnabledType) { + self.fileRequestsEmailsEnabled = arg + let swift = TeamLog.EventType.fileRequestsEmailsEnabled(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled file request emails for team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeFileRequestsEmailsRestrictedToTeamOnly: DBXTeamLogEventType { + @objc + public var fileRequestsEmailsRestrictedToTeamOnly: DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyType + + @objc + public init(_ arg: DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyType) { + self.fileRequestsEmailsRestrictedToTeamOnly = arg + let swift = TeamLog.EventType.fileRequestsEmailsRestrictedToTeamOnly(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed file transfers policy for team +@objc +public class DBXTeamLogEventTypeFileTransfersPolicyChanged: DBXTeamLogEventType { + @objc + public var fileTransfersPolicyChanged: DBXTeamLogFileTransfersPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogFileTransfersPolicyChangedType) { + self.fileTransfersPolicyChanged = arg + let swift = TeamLog.EventType.fileTransfersPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed folder link restrictions policy for team +@objc +public class DBXTeamLogEventTypeFolderLinkRestrictionPolicyChanged: DBXTeamLogEventType { + @objc + public var folderLinkRestrictionPolicyChanged: DBXTeamLogFolderLinkRestrictionPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogFolderLinkRestrictionPolicyChangedType) { + self.folderLinkRestrictionPolicyChanged = arg + let swift = TeamLog.EventType.folderLinkRestrictionPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Google single sign-on for team +@objc +public class DBXTeamLogEventTypeGoogleSsoChangePolicy: DBXTeamLogEventType { + @objc + public var googleSsoChangePolicy: DBXTeamLogGoogleSsoChangePolicyType + + @objc + public init(_ arg: DBXTeamLogGoogleSsoChangePolicyType) { + self.googleSsoChangePolicy = arg + let swift = TeamLog.EventType.googleSsoChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed who can create groups +@objc +public class DBXTeamLogEventTypeGroupUserManagementChangePolicy: DBXTeamLogEventType { + @objc + public var groupUserManagementChangePolicy: DBXTeamLogGroupUserManagementChangePolicyType + + @objc + public init(_ arg: DBXTeamLogGroupUserManagementChangePolicyType) { + self.groupUserManagementChangePolicy = arg + let swift = TeamLog.EventType.groupUserManagementChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed integration policy for team +@objc +public class DBXTeamLogEventTypeIntegrationPolicyChanged: DBXTeamLogEventType { + @objc + public var integrationPolicyChanged: DBXTeamLogIntegrationPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogIntegrationPolicyChangedType) { + self.integrationPolicyChanged = arg + let swift = TeamLog.EventType.integrationPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed invite accept email policy for team +@objc +public class DBXTeamLogEventTypeInviteAcceptanceEmailPolicyChanged: DBXTeamLogEventType { + @objc + public var inviteAcceptanceEmailPolicyChanged: DBXTeamLogInviteAcceptanceEmailPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogInviteAcceptanceEmailPolicyChangedType) { + self.inviteAcceptanceEmailPolicyChanged = arg + let swift = TeamLog.EventType.inviteAcceptanceEmailPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether users can find team when not invited +@objc +public class DBXTeamLogEventTypeMemberRequestsChangePolicy: DBXTeamLogEventType { + @objc + public var memberRequestsChangePolicy: DBXTeamLogMemberRequestsChangePolicyType + + @objc + public init(_ arg: DBXTeamLogMemberRequestsChangePolicyType) { + self.memberRequestsChangePolicy = arg + let swift = TeamLog.EventType.memberRequestsChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed member send invite policy for team +@objc +public class DBXTeamLogEventTypeMemberSendInvitePolicyChanged: DBXTeamLogEventType { + @objc + public var memberSendInvitePolicyChanged: DBXTeamLogMemberSendInvitePolicyChangedType + + @objc + public init(_ arg: DBXTeamLogMemberSendInvitePolicyChangedType) { + self.memberSendInvitePolicyChanged = arg + let swift = TeamLog.EventType.memberSendInvitePolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Added members to member space limit exception list +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsAddException: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsAddException: DBXTeamLogMemberSpaceLimitsAddExceptionType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsAddExceptionType) { + self.memberSpaceLimitsAddException = arg + let swift = TeamLog.EventType.memberSpaceLimitsAddException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed member space limit type for team +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsChangeCapsTypePolicy: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsChangeCapsTypePolicy: DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyType) { + self.memberSpaceLimitsChangeCapsTypePolicy = arg + let swift = TeamLog.EventType.memberSpaceLimitsChangeCapsTypePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed team default member space limit +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsChangePolicy: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsChangePolicy: DBXTeamLogMemberSpaceLimitsChangePolicyType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsChangePolicyType) { + self.memberSpaceLimitsChangePolicy = arg + let swift = TeamLog.EventType.memberSpaceLimitsChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from member space limit exception list +@objc +public class DBXTeamLogEventTypeMemberSpaceLimitsRemoveException: DBXTeamLogEventType { + @objc + public var memberSpaceLimitsRemoveException: DBXTeamLogMemberSpaceLimitsRemoveExceptionType + + @objc + public init(_ arg: DBXTeamLogMemberSpaceLimitsRemoveExceptionType) { + self.memberSpaceLimitsRemoveException = arg + let swift = TeamLog.EventType.memberSpaceLimitsRemoveException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled option for team members to suggest people to add to team +@objc +public class DBXTeamLogEventTypeMemberSuggestionsChangePolicy: DBXTeamLogEventType { + @objc + public var memberSuggestionsChangePolicy: DBXTeamLogMemberSuggestionsChangePolicyType + + @objc + public init(_ arg: DBXTeamLogMemberSuggestionsChangePolicyType) { + self.memberSuggestionsChangePolicy = arg + let swift = TeamLog.EventType.memberSuggestionsChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Microsoft Office add-in +@objc +public class DBXTeamLogEventTypeMicrosoftOfficeAddinChangePolicy: DBXTeamLogEventType { + @objc + public var microsoftOfficeAddinChangePolicy: DBXTeamLogMicrosoftOfficeAddinChangePolicyType + + @objc + public init(_ arg: DBXTeamLogMicrosoftOfficeAddinChangePolicyType) { + self.microsoftOfficeAddinChangePolicy = arg + let swift = TeamLog.EventType.microsoftOfficeAddinChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled network control +@objc +public class DBXTeamLogEventTypeNetworkControlChangePolicy: DBXTeamLogEventType { + @objc + public var networkControlChangePolicy: DBXTeamLogNetworkControlChangePolicyType + + @objc + public init(_ arg: DBXTeamLogNetworkControlChangePolicyType) { + self.networkControlChangePolicy = arg + let swift = TeamLog.EventType.networkControlChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether Dropbox Paper, when enabled, is deployed to all members or to specific +/// members +@objc +public class DBXTeamLogEventTypePaperChangeDeploymentPolicy: DBXTeamLogEventType { + @objc + public var paperChangeDeploymentPolicy: DBXTeamLogPaperChangeDeploymentPolicyType + + @objc + public init(_ arg: DBXTeamLogPaperChangeDeploymentPolicyType) { + self.paperChangeDeploymentPolicy = arg + let swift = TeamLog.EventType.paperChangeDeploymentPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether non-members can view Paper docs with link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypePaperChangeMemberLinkPolicy: DBXTeamLogEventType { + @objc + public var paperChangeMemberLinkPolicy: DBXTeamLogPaperChangeMemberLinkPolicyType + + @objc + public init(_ arg: DBXTeamLogPaperChangeMemberLinkPolicyType) { + self.paperChangeMemberLinkPolicy = arg + let swift = TeamLog.EventType.paperChangeMemberLinkPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether members can share Paper docs outside team, and if docs are accessible only +/// by team members or anyone by default +@objc +public class DBXTeamLogEventTypePaperChangeMemberPolicy: DBXTeamLogEventType { + @objc + public var paperChangeMemberPolicy: DBXTeamLogPaperChangeMemberPolicyType + + @objc + public init(_ arg: DBXTeamLogPaperChangeMemberPolicyType) { + self.paperChangeMemberPolicy = arg + let swift = TeamLog.EventType.paperChangeMemberPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Dropbox Paper for team +@objc +public class DBXTeamLogEventTypePaperChangePolicy: DBXTeamLogEventType { + @objc + public var paperChangePolicy: DBXTeamLogPaperChangePolicyType + + @objc + public init(_ arg: DBXTeamLogPaperChangePolicyType) { + self.paperChangePolicy = arg + let swift = TeamLog.EventType.paperChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed Paper Default Folder Policy setting for team +@objc +public class DBXTeamLogEventTypePaperDefaultFolderPolicyChanged: DBXTeamLogEventType { + @objc + public var paperDefaultFolderPolicyChanged: DBXTeamLogPaperDefaultFolderPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogPaperDefaultFolderPolicyChangedType) { + self.paperDefaultFolderPolicyChanged = arg + let swift = TeamLog.EventType.paperDefaultFolderPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Paper Desktop for team +@objc +public class DBXTeamLogEventTypePaperDesktopPolicyChanged: DBXTeamLogEventType { + @objc + public var paperDesktopPolicyChanged: DBXTeamLogPaperDesktopPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogPaperDesktopPolicyChangedType) { + self.paperDesktopPolicyChanged = arg + let swift = TeamLog.EventType.paperDesktopPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Added users to Paper-enabled users list +@objc +public class DBXTeamLogEventTypePaperEnabledUsersGroupAddition: DBXTeamLogEventType { + @objc + public var paperEnabledUsersGroupAddition: DBXTeamLogPaperEnabledUsersGroupAdditionType + + @objc + public init(_ arg: DBXTeamLogPaperEnabledUsersGroupAdditionType) { + self.paperEnabledUsersGroupAddition = arg + let swift = TeamLog.EventType.paperEnabledUsersGroupAddition(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Removed users from Paper-enabled users list +@objc +public class DBXTeamLogEventTypePaperEnabledUsersGroupRemoval: DBXTeamLogEventType { + @objc + public var paperEnabledUsersGroupRemoval: DBXTeamLogPaperEnabledUsersGroupRemovalType + + @objc + public init(_ arg: DBXTeamLogPaperEnabledUsersGroupRemovalType) { + self.paperEnabledUsersGroupRemoval = arg + let swift = TeamLog.EventType.paperEnabledUsersGroupRemoval(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed team password strength requirements +@objc +public class DBXTeamLogEventTypePasswordStrengthRequirementsChangePolicy: DBXTeamLogEventType { + @objc + public var passwordStrengthRequirementsChangePolicy: DBXTeamLogPasswordStrengthRequirementsChangePolicyType + + @objc + public init(_ arg: DBXTeamLogPasswordStrengthRequirementsChangePolicyType) { + self.passwordStrengthRequirementsChangePolicy = arg + let swift = TeamLog.EventType.passwordStrengthRequirementsChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled ability of team members to permanently delete content +@objc +public class DBXTeamLogEventTypePermanentDeleteChangePolicy: DBXTeamLogEventType { + @objc + public var permanentDeleteChangePolicy: DBXTeamLogPermanentDeleteChangePolicyType + + @objc + public init(_ arg: DBXTeamLogPermanentDeleteChangePolicyType) { + self.permanentDeleteChangePolicy = arg + let swift = TeamLog.EventType.permanentDeleteChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled reseller support +@objc +public class DBXTeamLogEventTypeResellerSupportChangePolicy: DBXTeamLogEventType { + @objc + public var resellerSupportChangePolicy: DBXTeamLogResellerSupportChangePolicyType + + @objc + public init(_ arg: DBXTeamLogResellerSupportChangePolicyType) { + self.resellerSupportChangePolicy = arg + let swift = TeamLog.EventType.resellerSupportChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed Rewind policy for team +@objc +public class DBXTeamLogEventTypeRewindPolicyChanged: DBXTeamLogEventType { + @objc + public var rewindPolicyChanged: DBXTeamLogRewindPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogRewindPolicyChangedType) { + self.rewindPolicyChanged = arg + let swift = TeamLog.EventType.rewindPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed send for signature policy for team +@objc +public class DBXTeamLogEventTypeSendForSignaturePolicyChanged: DBXTeamLogEventType { + @objc + public var sendForSignaturePolicyChanged: DBXTeamLogSendForSignaturePolicyChangedType + + @objc + public init(_ arg: DBXTeamLogSendForSignaturePolicyChangedType) { + self.sendForSignaturePolicyChanged = arg + let swift = TeamLog.EventType.sendForSignaturePolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether team members can join shared folders owned outside team +@objc +public class DBXTeamLogEventTypeSharingChangeFolderJoinPolicy: DBXTeamLogEventType { + @objc + public var sharingChangeFolderJoinPolicy: DBXTeamLogSharingChangeFolderJoinPolicyType + + @objc + public init(_ arg: DBXTeamLogSharingChangeFolderJoinPolicyType) { + self.sharingChangeFolderJoinPolicy = arg + let swift = TeamLog.EventType.sharingChangeFolderJoinPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed the allow remove or change expiration policy for the links shared outside of the +/// team +@objc +public class DBXTeamLogEventTypeSharingChangeLinkAllowChangeExpirationPolicy: DBXTeamLogEventType { + @objc + public var sharingChangeLinkAllowChangeExpirationPolicy: DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyType + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyType) { + self.sharingChangeLinkAllowChangeExpirationPolicy = arg + let swift = TeamLog.EventType.sharingChangeLinkAllowChangeExpirationPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed the default expiration for the links shared outside of the team +@objc +public class DBXTeamLogEventTypeSharingChangeLinkDefaultExpirationPolicy: DBXTeamLogEventType { + @objc + public var sharingChangeLinkDefaultExpirationPolicy: DBXTeamLogSharingChangeLinkDefaultExpirationPolicyType + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkDefaultExpirationPolicyType) { + self.sharingChangeLinkDefaultExpirationPolicy = arg + let swift = TeamLog.EventType.sharingChangeLinkDefaultExpirationPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed the password requirement for the links shared outside of the team +@objc +public class DBXTeamLogEventTypeSharingChangeLinkEnforcePasswordPolicy: DBXTeamLogEventType { + @objc + public var sharingChangeLinkEnforcePasswordPolicy: DBXTeamLogSharingChangeLinkEnforcePasswordPolicyType + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkEnforcePasswordPolicyType) { + self.sharingChangeLinkEnforcePasswordPolicy = arg + let swift = TeamLog.EventType.sharingChangeLinkEnforcePasswordPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether members can share links outside team, and if links are accessible only by +/// team members or anyone by default +@objc +public class DBXTeamLogEventTypeSharingChangeLinkPolicy: DBXTeamLogEventType { + @objc + public var sharingChangeLinkPolicy: DBXTeamLogSharingChangeLinkPolicyType + + @objc + public init(_ arg: DBXTeamLogSharingChangeLinkPolicyType) { + self.sharingChangeLinkPolicy = arg + let swift = TeamLog.EventType.sharingChangeLinkPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether members can share files/folders outside team +@objc +public class DBXTeamLogEventTypeSharingChangeMemberPolicy: DBXTeamLogEventType { + @objc + public var sharingChangeMemberPolicy: DBXTeamLogSharingChangeMemberPolicyType + + @objc + public init(_ arg: DBXTeamLogSharingChangeMemberPolicyType) { + self.sharingChangeMemberPolicy = arg + let swift = TeamLog.EventType.sharingChangeMemberPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled downloading files from Dropbox Showcase for team +@objc +public class DBXTeamLogEventTypeShowcaseChangeDownloadPolicy: DBXTeamLogEventType { + @objc + public var showcaseChangeDownloadPolicy: DBXTeamLogShowcaseChangeDownloadPolicyType + + @objc + public init(_ arg: DBXTeamLogShowcaseChangeDownloadPolicyType) { + self.showcaseChangeDownloadPolicy = arg + let swift = TeamLog.EventType.showcaseChangeDownloadPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Dropbox Showcase for team +@objc +public class DBXTeamLogEventTypeShowcaseChangeEnabledPolicy: DBXTeamLogEventType { + @objc + public var showcaseChangeEnabledPolicy: DBXTeamLogShowcaseChangeEnabledPolicyType + + @objc + public init(_ arg: DBXTeamLogShowcaseChangeEnabledPolicyType) { + self.showcaseChangeEnabledPolicy = arg + let swift = TeamLog.EventType.showcaseChangeEnabledPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled sharing Dropbox Showcase externally for team +@objc +public class DBXTeamLogEventTypeShowcaseChangeExternalSharingPolicy: DBXTeamLogEventType { + @objc + public var showcaseChangeExternalSharingPolicy: DBXTeamLogShowcaseChangeExternalSharingPolicyType + + @objc + public init(_ arg: DBXTeamLogShowcaseChangeExternalSharingPolicyType) { + self.showcaseChangeExternalSharingPolicy = arg + let swift = TeamLog.EventType.showcaseChangeExternalSharingPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed automatic Smart Sync setting for team +@objc +public class DBXTeamLogEventTypeSmarterSmartSyncPolicyChanged: DBXTeamLogEventType { + @objc + public var smarterSmartSyncPolicyChanged: DBXTeamLogSmarterSmartSyncPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogSmarterSmartSyncPolicyChangedType) { + self.smarterSmartSyncPolicyChanged = arg + let swift = TeamLog.EventType.smarterSmartSyncPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed default Smart Sync setting for team members +@objc +public class DBXTeamLogEventTypeSmartSyncChangePolicy: DBXTeamLogEventType { + @objc + public var smartSyncChangePolicy: DBXTeamLogSmartSyncChangePolicyType + + @objc + public init(_ arg: DBXTeamLogSmartSyncChangePolicyType) { + self.smartSyncChangePolicy = arg + let swift = TeamLog.EventType.smartSyncChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Opted team into Smart Sync +@objc +public class DBXTeamLogEventTypeSmartSyncNotOptOut: DBXTeamLogEventType { + @objc + public var smartSyncNotOptOut: DBXTeamLogSmartSyncNotOptOutType + + @objc + public init(_ arg: DBXTeamLogSmartSyncNotOptOutType) { + self.smartSyncNotOptOut = arg + let swift = TeamLog.EventType.smartSyncNotOptOut(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Opted team out of Smart Sync +@objc +public class DBXTeamLogEventTypeSmartSyncOptOut: DBXTeamLogEventType { + @objc + public var smartSyncOptOut: DBXTeamLogSmartSyncOptOutType + + @objc + public init(_ arg: DBXTeamLogSmartSyncOptOutType) { + self.smartSyncOptOut = arg + let swift = TeamLog.EventType.smartSyncOptOut(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed single sign-on setting for team +@objc +public class DBXTeamLogEventTypeSsoChangePolicy: DBXTeamLogEventType { + @objc + public var ssoChangePolicy: DBXTeamLogSsoChangePolicyType + + @objc + public init(_ arg: DBXTeamLogSsoChangePolicyType) { + self.ssoChangePolicy = arg + let swift = TeamLog.EventType.ssoChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed team branding policy for team +@objc +public class DBXTeamLogEventTypeTeamBrandingPolicyChanged: DBXTeamLogEventType { + @objc + public var teamBrandingPolicyChanged: DBXTeamLogTeamBrandingPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogTeamBrandingPolicyChangedType) { + self.teamBrandingPolicyChanged = arg + let swift = TeamLog.EventType.teamBrandingPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed App Integrations setting for team +@objc +public class DBXTeamLogEventTypeTeamExtensionsPolicyChanged: DBXTeamLogEventType { + @objc + public var teamExtensionsPolicyChanged: DBXTeamLogTeamExtensionsPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogTeamExtensionsPolicyChangedType) { + self.teamExtensionsPolicyChanged = arg + let swift = TeamLog.EventType.teamExtensionsPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Team Selective Sync for team +@objc +public class DBXTeamLogEventTypeTeamSelectiveSyncPolicyChanged: DBXTeamLogEventType { + @objc + public var teamSelectiveSyncPolicyChanged: DBXTeamLogTeamSelectiveSyncPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogTeamSelectiveSyncPolicyChangedType) { + self.teamSelectiveSyncPolicyChanged = arg + let swift = TeamLog.EventType.teamSelectiveSyncPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Edited the approved list for sharing externally +@objc +public class DBXTeamLogEventTypeTeamSharingWhitelistSubjectsChanged: DBXTeamLogEventType { + @objc + public var teamSharingWhitelistSubjectsChanged: DBXTeamLogTeamSharingWhitelistSubjectsChangedType + + @objc + public init(_ arg: DBXTeamLogTeamSharingWhitelistSubjectsChangedType) { + self.teamSharingWhitelistSubjectsChanged = arg + let swift = TeamLog.EventType.teamSharingWhitelistSubjectsChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Added members to two factor authentication exception list +@objc +public class DBXTeamLogEventTypeTfaAddException: DBXTeamLogEventType { + @objc + public var tfaAddException: DBXTeamLogTfaAddExceptionType + + @objc + public init(_ arg: DBXTeamLogTfaAddExceptionType) { + self.tfaAddException = arg + let swift = TeamLog.EventType.tfaAddException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed two-step verification setting for team +@objc +public class DBXTeamLogEventTypeTfaChangePolicy: DBXTeamLogEventType { + @objc + public var tfaChangePolicy: DBXTeamLogTfaChangePolicyType + + @objc + public init(_ arg: DBXTeamLogTfaChangePolicyType) { + self.tfaChangePolicy = arg + let swift = TeamLog.EventType.tfaChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from two factor authentication exception list +@objc +public class DBXTeamLogEventTypeTfaRemoveException: DBXTeamLogEventType { + @objc + public var tfaRemoveException: DBXTeamLogTfaRemoveExceptionType + + @objc + public init(_ arg: DBXTeamLogTfaRemoveExceptionType) { + self.tfaRemoveException = arg + let swift = TeamLog.EventType.tfaRemoveException(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled option for members to link personal Dropbox account and team account to +/// same computer +@objc +public class DBXTeamLogEventTypeTwoAccountChangePolicy: DBXTeamLogEventType { + @objc + public var twoAccountChangePolicy: DBXTeamLogTwoAccountChangePolicyType + + @objc + public init(_ arg: DBXTeamLogTwoAccountChangePolicyType) { + self.twoAccountChangePolicy = arg + let swift = TeamLog.EventType.twoAccountChangePolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed team policy for viewer info +@objc +public class DBXTeamLogEventTypeViewerInfoPolicyChanged: DBXTeamLogEventType { + @objc + public var viewerInfoPolicyChanged: DBXTeamLogViewerInfoPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogViewerInfoPolicyChangedType) { + self.viewerInfoPolicyChanged = arg + let swift = TeamLog.EventType.viewerInfoPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed watermarking policy for team +@objc +public class DBXTeamLogEventTypeWatermarkingPolicyChanged: DBXTeamLogEventType { + @objc + public var watermarkingPolicyChanged: DBXTeamLogWatermarkingPolicyChangedType + + @objc + public init(_ arg: DBXTeamLogWatermarkingPolicyChangedType) { + self.watermarkingPolicyChanged = arg + let swift = TeamLog.EventType.watermarkingPolicyChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed limit on active sessions per member +@objc +public class DBXTeamLogEventTypeWebSessionsChangeActiveSessionLimit: DBXTeamLogEventType { + @objc + public var webSessionsChangeActiveSessionLimit: DBXTeamLogWebSessionsChangeActiveSessionLimitType + + @objc + public init(_ arg: DBXTeamLogWebSessionsChangeActiveSessionLimitType) { + self.webSessionsChangeActiveSessionLimit = arg + let swift = TeamLog.EventType.webSessionsChangeActiveSessionLimit(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed how long members can stay signed in to Dropbox.com +@objc +public class DBXTeamLogEventTypeWebSessionsChangeFixedLengthPolicy: DBXTeamLogEventType { + @objc + public var webSessionsChangeFixedLengthPolicy: DBXTeamLogWebSessionsChangeFixedLengthPolicyType + + @objc + public init(_ arg: DBXTeamLogWebSessionsChangeFixedLengthPolicyType) { + self.webSessionsChangeFixedLengthPolicy = arg + let swift = TeamLog.EventType.webSessionsChangeFixedLengthPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed how long team members can be idle while signed in to Dropbox.com +@objc +public class DBXTeamLogEventTypeWebSessionsChangeIdleLengthPolicy: DBXTeamLogEventType { + @objc + public var webSessionsChangeIdleLengthPolicy: DBXTeamLogWebSessionsChangeIdleLengthPolicyType + + @objc + public init(_ arg: DBXTeamLogWebSessionsChangeIdleLengthPolicyType) { + self.webSessionsChangeIdleLengthPolicy = arg + let swift = TeamLog.EventType.webSessionsChangeIdleLengthPolicy(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Requested data residency migration for team data +@objc +public class DBXTeamLogEventTypeDataResidencyMigrationRequestSuccessful: DBXTeamLogEventType { + @objc + public var dataResidencyMigrationRequestSuccessful: DBXTeamLogDataResidencyMigrationRequestSuccessfulType + + @objc + public init(_ arg: DBXTeamLogDataResidencyMigrationRequestSuccessfulType) { + self.dataResidencyMigrationRequestSuccessful = arg + let swift = TeamLog.EventType.dataResidencyMigrationRequestSuccessful(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Request for data residency migration for team data has failed +@objc +public class DBXTeamLogEventTypeDataResidencyMigrationRequestUnsuccessful: DBXTeamLogEventType { + @objc + public var dataResidencyMigrationRequestUnsuccessful: DBXTeamLogDataResidencyMigrationRequestUnsuccessfulType + + @objc + public init(_ arg: DBXTeamLogDataResidencyMigrationRequestUnsuccessfulType) { + self.dataResidencyMigrationRequestUnsuccessful = arg + let swift = TeamLog.EventType.dataResidencyMigrationRequestUnsuccessful(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Merged another team into this team +@objc +public class DBXTeamLogEventTypeTeamMergeFrom: DBXTeamLogEventType { + @objc + public var teamMergeFrom: DBXTeamLogTeamMergeFromType + + @objc + public init(_ arg: DBXTeamLogTeamMergeFromType) { + self.teamMergeFrom = arg + let swift = TeamLog.EventType.teamMergeFrom(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Merged this team into another team +@objc +public class DBXTeamLogEventTypeTeamMergeTo: DBXTeamLogEventType { + @objc + public var teamMergeTo: DBXTeamLogTeamMergeToType + + @objc + public init(_ arg: DBXTeamLogTeamMergeToType) { + self.teamMergeTo = arg + let swift = TeamLog.EventType.teamMergeTo(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Added team background to display on shared link headers +@objc +public class DBXTeamLogEventTypeTeamProfileAddBackground: DBXTeamLogEventType { + @objc + public var teamProfileAddBackground: DBXTeamLogTeamProfileAddBackgroundType + + @objc + public init(_ arg: DBXTeamLogTeamProfileAddBackgroundType) { + self.teamProfileAddBackground = arg + let swift = TeamLog.EventType.teamProfileAddBackground(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Added team logo to display on shared link headers +@objc +public class DBXTeamLogEventTypeTeamProfileAddLogo: DBXTeamLogEventType { + @objc + public var teamProfileAddLogo: DBXTeamLogTeamProfileAddLogoType + + @objc + public init(_ arg: DBXTeamLogTeamProfileAddLogoType) { + self.teamProfileAddLogo = arg + let swift = TeamLog.EventType.teamProfileAddLogo(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Changed team background displayed on shared link headers +@objc +public class DBXTeamLogEventTypeTeamProfileChangeBackground: DBXTeamLogEventType { + @objc + public var teamProfileChangeBackground: DBXTeamLogTeamProfileChangeBackgroundType + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeBackgroundType) { + self.teamProfileChangeBackground = arg + let swift = TeamLog.EventType.teamProfileChangeBackground(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Changed default language for team +@objc +public class DBXTeamLogEventTypeTeamProfileChangeDefaultLanguage: DBXTeamLogEventType { + @objc + public var teamProfileChangeDefaultLanguage: DBXTeamLogTeamProfileChangeDefaultLanguageType + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeDefaultLanguageType) { + self.teamProfileChangeDefaultLanguage = arg + let swift = TeamLog.EventType.teamProfileChangeDefaultLanguage(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Changed team logo displayed on shared link headers +@objc +public class DBXTeamLogEventTypeTeamProfileChangeLogo: DBXTeamLogEventType { + @objc + public var teamProfileChangeLogo: DBXTeamLogTeamProfileChangeLogoType + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeLogoType) { + self.teamProfileChangeLogo = arg + let swift = TeamLog.EventType.teamProfileChangeLogo(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Changed team name +@objc +public class DBXTeamLogEventTypeTeamProfileChangeName: DBXTeamLogEventType { + @objc + public var teamProfileChangeName: DBXTeamLogTeamProfileChangeNameType + + @objc + public init(_ arg: DBXTeamLogTeamProfileChangeNameType) { + self.teamProfileChangeName = arg + let swift = TeamLog.EventType.teamProfileChangeName(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Removed team background displayed on shared link headers +@objc +public class DBXTeamLogEventTypeTeamProfileRemoveBackground: DBXTeamLogEventType { + @objc + public var teamProfileRemoveBackground: DBXTeamLogTeamProfileRemoveBackgroundType + + @objc + public init(_ arg: DBXTeamLogTeamProfileRemoveBackgroundType) { + self.teamProfileRemoveBackground = arg + let swift = TeamLog.EventType.teamProfileRemoveBackground(arg.swift) + super.init(swift: swift) + } +} + +/// (team_profile) Removed team logo displayed on shared link headers +@objc +public class DBXTeamLogEventTypeTeamProfileRemoveLogo: DBXTeamLogEventType { + @objc + public var teamProfileRemoveLogo: DBXTeamLogTeamProfileRemoveLogoType + + @objc + public init(_ arg: DBXTeamLogTeamProfileRemoveLogoType) { + self.teamProfileRemoveLogo = arg + let swift = TeamLog.EventType.teamProfileRemoveLogo(arg.swift) + super.init(swift: swift) + } +} + +/// (tfa) Added backup phone for two-step verification +@objc +public class DBXTeamLogEventTypeTfaAddBackupPhone: DBXTeamLogEventType { + @objc + public var tfaAddBackupPhone: DBXTeamLogTfaAddBackupPhoneType + + @objc + public init(_ arg: DBXTeamLogTfaAddBackupPhoneType) { + self.tfaAddBackupPhone = arg + let swift = TeamLog.EventType.tfaAddBackupPhone(arg.swift) + super.init(swift: swift) + } +} + +/// (tfa) Added security key for two-step verification +@objc +public class DBXTeamLogEventTypeTfaAddSecurityKey: DBXTeamLogEventType { + @objc + public var tfaAddSecurityKey: DBXTeamLogTfaAddSecurityKeyType + + @objc + public init(_ arg: DBXTeamLogTfaAddSecurityKeyType) { + self.tfaAddSecurityKey = arg + let swift = TeamLog.EventType.tfaAddSecurityKey(arg.swift) + super.init(swift: swift) + } +} + +/// (tfa) Changed backup phone for two-step verification +@objc +public class DBXTeamLogEventTypeTfaChangeBackupPhone: DBXTeamLogEventType { + @objc + public var tfaChangeBackupPhone: DBXTeamLogTfaChangeBackupPhoneType + + @objc + public init(_ arg: DBXTeamLogTfaChangeBackupPhoneType) { + self.tfaChangeBackupPhone = arg + let swift = TeamLog.EventType.tfaChangeBackupPhone(arg.swift) + super.init(swift: swift) + } +} + +/// (tfa) Enabled/disabled/changed two-step verification setting +@objc +public class DBXTeamLogEventTypeTfaChangeStatus: DBXTeamLogEventType { + @objc + public var tfaChangeStatus: DBXTeamLogTfaChangeStatusType + + @objc + public init(_ arg: DBXTeamLogTfaChangeStatusType) { + self.tfaChangeStatus = arg + let swift = TeamLog.EventType.tfaChangeStatus(arg.swift) + super.init(swift: swift) + } +} + +/// (tfa) Removed backup phone for two-step verification +@objc +public class DBXTeamLogEventTypeTfaRemoveBackupPhone: DBXTeamLogEventType { + @objc + public var tfaRemoveBackupPhone: DBXTeamLogTfaRemoveBackupPhoneType + + @objc + public init(_ arg: DBXTeamLogTfaRemoveBackupPhoneType) { + self.tfaRemoveBackupPhone = arg + let swift = TeamLog.EventType.tfaRemoveBackupPhone(arg.swift) + super.init(swift: swift) + } +} + +/// (tfa) Removed security key for two-step verification +@objc +public class DBXTeamLogEventTypeTfaRemoveSecurityKey: DBXTeamLogEventType { + @objc + public var tfaRemoveSecurityKey: DBXTeamLogTfaRemoveSecurityKeyType + + @objc + public init(_ arg: DBXTeamLogTfaRemoveSecurityKeyType) { + self.tfaRemoveSecurityKey = arg + let swift = TeamLog.EventType.tfaRemoveSecurityKey(arg.swift) + super.init(swift: swift) + } +} + +/// (tfa) Reset two-step verification for team member +@objc +public class DBXTeamLogEventTypeTfaReset: DBXTeamLogEventType { + @objc + public var tfaReset: DBXTeamLogTfaResetType + + @objc + public init(_ arg: DBXTeamLogTfaResetType) { + self.tfaReset = arg + let swift = TeamLog.EventType.tfaReset(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed enterprise admin role +@objc +public class DBXTeamLogEventTypeChangedEnterpriseAdminRole: DBXTeamLogEventType { + @objc + public var changedEnterpriseAdminRole: DBXTeamLogChangedEnterpriseAdminRoleType + + @objc + public init(_ arg: DBXTeamLogChangedEnterpriseAdminRoleType) { + self.changedEnterpriseAdminRole = arg + let swift = TeamLog.EventType.changedEnterpriseAdminRole(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed enterprise-connected team status +@objc +public class DBXTeamLogEventTypeChangedEnterpriseConnectedTeamStatus: DBXTeamLogEventType { + @objc + public var changedEnterpriseConnectedTeamStatus: DBXTeamLogChangedEnterpriseConnectedTeamStatusType + + @objc + public init(_ arg: DBXTeamLogChangedEnterpriseConnectedTeamStatusType) { + self.changedEnterpriseConnectedTeamStatus = arg + let swift = TeamLog.EventType.changedEnterpriseConnectedTeamStatus(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Ended enterprise admin session +@objc +public class DBXTeamLogEventTypeEndedEnterpriseAdminSession: DBXTeamLogEventType { + @objc + public var endedEnterpriseAdminSession: DBXTeamLogEndedEnterpriseAdminSessionType + + @objc + public init(_ arg: DBXTeamLogEndedEnterpriseAdminSessionType) { + self.endedEnterpriseAdminSession = arg + let swift = TeamLog.EventType.endedEnterpriseAdminSession(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Ended enterprise admin session (deprecated, replaced by 'Ended enterprise admin session') +@objc +public class DBXTeamLogEventTypeEndedEnterpriseAdminSessionDeprecated: DBXTeamLogEventType { + @objc + public var endedEnterpriseAdminSessionDeprecated: DBXTeamLogEndedEnterpriseAdminSessionDeprecatedType + + @objc + public init(_ arg: DBXTeamLogEndedEnterpriseAdminSessionDeprecatedType) { + self.endedEnterpriseAdminSessionDeprecated = arg + let swift = TeamLog.EventType.endedEnterpriseAdminSessionDeprecated(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed who can update a setting +@objc +public class DBXTeamLogEventTypeEnterpriseSettingsLocking: DBXTeamLogEventType { + @objc + public var enterpriseSettingsLocking: DBXTeamLogEnterpriseSettingsLockingType + + @objc + public init(_ arg: DBXTeamLogEnterpriseSettingsLockingType) { + self.enterpriseSettingsLocking = arg + let swift = TeamLog.EventType.enterpriseSettingsLocking(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed guest team admin status +@objc +public class DBXTeamLogEventTypeGuestAdminChangeStatus: DBXTeamLogEventType { + @objc + public var guestAdminChangeStatus: DBXTeamLogGuestAdminChangeStatusType + + @objc + public init(_ arg: DBXTeamLogGuestAdminChangeStatusType) { + self.guestAdminChangeStatus = arg + let swift = TeamLog.EventType.guestAdminChangeStatus(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Started enterprise admin session +@objc +public class DBXTeamLogEventTypeStartedEnterpriseAdminSession: DBXTeamLogEventType { + @objc + public var startedEnterpriseAdminSession: DBXTeamLogStartedEnterpriseAdminSessionType + + @objc + public init(_ arg: DBXTeamLogStartedEnterpriseAdminSessionType) { + self.startedEnterpriseAdminSession = arg + let swift = TeamLog.EventType.startedEnterpriseAdminSession(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Accepted a team merge request +@objc +public class DBXTeamLogEventTypeTeamMergeRequestAccepted: DBXTeamLogEventType { + @objc + public var teamMergeRequestAccepted: DBXTeamLogTeamMergeRequestAcceptedType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAcceptedType) { + self.teamMergeRequestAccepted = arg + let swift = TeamLog.EventType.teamMergeRequestAccepted(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Accepted a team merge request (deprecated, replaced by 'Accepted a team merge request') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToPrimaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestAcceptedShownToPrimaryTeam: DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamType) { + self.teamMergeRequestAcceptedShownToPrimaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestAcceptedShownToPrimaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Accepted a team merge request (deprecated, replaced by 'Accepted a team merge request') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestAcceptedShownToSecondaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestAcceptedShownToSecondaryTeam: DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamType) { + self.teamMergeRequestAcceptedShownToSecondaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestAcceptedShownToSecondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Automatically canceled team merge request +@objc +public class DBXTeamLogEventTypeTeamMergeRequestAutoCanceled: DBXTeamLogEventType { + @objc + public var teamMergeRequestAutoCanceled: DBXTeamLogTeamMergeRequestAutoCanceledType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestAutoCanceledType) { + self.teamMergeRequestAutoCanceled = arg + let swift = TeamLog.EventType.teamMergeRequestAutoCanceled(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled a team merge request +@objc +public class DBXTeamLogEventTypeTeamMergeRequestCanceled: DBXTeamLogEventType { + @objc + public var teamMergeRequestCanceled: DBXTeamLogTeamMergeRequestCanceledType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestCanceledType) { + self.teamMergeRequestCanceled = arg + let swift = TeamLog.EventType.teamMergeRequestCanceled(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled a team merge request (deprecated, replaced by 'Canceled a team merge request') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestCanceledShownToPrimaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestCanceledShownToPrimaryTeam: DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamType) { + self.teamMergeRequestCanceledShownToPrimaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestCanceledShownToPrimaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled a team merge request (deprecated, replaced by 'Canceled a team merge request') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestCanceledShownToSecondaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestCanceledShownToSecondaryTeam: DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamType) { + self.teamMergeRequestCanceledShownToSecondaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestCanceledShownToSecondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Team merge request expired +@objc +public class DBXTeamLogEventTypeTeamMergeRequestExpired: DBXTeamLogEventType { + @objc + public var teamMergeRequestExpired: DBXTeamLogTeamMergeRequestExpiredType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestExpiredType) { + self.teamMergeRequestExpired = arg + let swift = TeamLog.EventType.teamMergeRequestExpired(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Team merge request expired (deprecated, replaced by 'Team merge request expired') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestExpiredShownToPrimaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestExpiredShownToPrimaryTeam: DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamType) { + self.teamMergeRequestExpiredShownToPrimaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestExpiredShownToPrimaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Team merge request expired (deprecated, replaced by 'Team merge request expired') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestExpiredShownToSecondaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestExpiredShownToSecondaryTeam: DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamType) { + self.teamMergeRequestExpiredShownToSecondaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestExpiredShownToSecondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Rejected a team merge request (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeTeamMergeRequestRejectedShownToPrimaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestRejectedShownToPrimaryTeam: DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamType) { + self.teamMergeRequestRejectedShownToPrimaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestRejectedShownToPrimaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Rejected a team merge request (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeTeamMergeRequestRejectedShownToSecondaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestRejectedShownToSecondaryTeam: DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamType) { + self.teamMergeRequestRejectedShownToSecondaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestRejectedShownToSecondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Sent a team merge request reminder +@objc +public class DBXTeamLogEventTypeTeamMergeRequestReminder: DBXTeamLogEventType { + @objc + public var teamMergeRequestReminder: DBXTeamLogTeamMergeRequestReminderType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestReminderType) { + self.teamMergeRequestReminder = arg + let swift = TeamLog.EventType.teamMergeRequestReminder(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Sent a team merge request reminder (deprecated, replaced by 'Sent a team merge request +/// reminder') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestReminderShownToPrimaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestReminderShownToPrimaryTeam: DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamType) { + self.teamMergeRequestReminderShownToPrimaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestReminderShownToPrimaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Sent a team merge request reminder (deprecated, replaced by 'Sent a team merge request +/// reminder') +@objc +public class DBXTeamLogEventTypeTeamMergeRequestReminderShownToSecondaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestReminderShownToSecondaryTeam: DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamType) { + self.teamMergeRequestReminderShownToSecondaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestReminderShownToSecondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled the team merge +@objc +public class DBXTeamLogEventTypeTeamMergeRequestRevoked: DBXTeamLogEventType { + @objc + public var teamMergeRequestRevoked: DBXTeamLogTeamMergeRequestRevokedType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestRevokedType) { + self.teamMergeRequestRevoked = arg + let swift = TeamLog.EventType.teamMergeRequestRevoked(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Requested to merge their Dropbox team into yours +@objc +public class DBXTeamLogEventTypeTeamMergeRequestSentShownToPrimaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestSentShownToPrimaryTeam: DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamType) { + self.teamMergeRequestSentShownToPrimaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestSentShownToPrimaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// (trusted_teams) Requested to merge your team into another Dropbox team +@objc +public class DBXTeamLogEventTypeTeamMergeRequestSentShownToSecondaryTeam: DBXTeamLogEventType { + @objc + public var teamMergeRequestSentShownToSecondaryTeam: DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamType + + @objc + public init(_ arg: DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamType) { + self.teamMergeRequestSentShownToSecondaryTeam = arg + let swift = TeamLog.EventType.teamMergeRequestSentShownToSecondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventTypeOther: DBXTeamLogEventType { + @objc + public init() { + let swift = TeamLog.EventType.other + super.init(swift: swift) + } +} + +/// The type of the event. +@objc +public class DBXTeamLogEventTypeArg: NSObject { + let swift: TeamLog.EventTypeArg + + public init(swift: TeamLog.EventTypeArg) { + self.swift = swift + } + + public static func factory(swift: TeamLog.EventTypeArg) -> DBXTeamLogEventTypeArg { + switch swift { + case .adminAlertingAlertStateChanged: + return DBXTeamLogEventTypeArgAdminAlertingAlertStateChanged() + case .adminAlertingChangedAlertConfig: + return DBXTeamLogEventTypeArgAdminAlertingChangedAlertConfig() + case .adminAlertingTriggeredAlert: + return DBXTeamLogEventTypeArgAdminAlertingTriggeredAlert() + case .ransomwareRestoreProcessCompleted: + return DBXTeamLogEventTypeArgRansomwareRestoreProcessCompleted() + case .ransomwareRestoreProcessStarted: + return DBXTeamLogEventTypeArgRansomwareRestoreProcessStarted() + case .appBlockedByPermissions: + return DBXTeamLogEventTypeArgAppBlockedByPermissions() + case .appLinkTeam: + return DBXTeamLogEventTypeArgAppLinkTeam() + case .appLinkUser: + return DBXTeamLogEventTypeArgAppLinkUser() + case .appUnlinkTeam: + return DBXTeamLogEventTypeArgAppUnlinkTeam() + case .appUnlinkUser: + return DBXTeamLogEventTypeArgAppUnlinkUser() + case .integrationConnected: + return DBXTeamLogEventTypeArgIntegrationConnected() + case .integrationDisconnected: + return DBXTeamLogEventTypeArgIntegrationDisconnected() + case .fileAddComment: + return DBXTeamLogEventTypeArgFileAddComment() + case .fileChangeCommentSubscription: + return DBXTeamLogEventTypeArgFileChangeCommentSubscription() + case .fileDeleteComment: + return DBXTeamLogEventTypeArgFileDeleteComment() + case .fileEditComment: + return DBXTeamLogEventTypeArgFileEditComment() + case .fileLikeComment: + return DBXTeamLogEventTypeArgFileLikeComment() + case .fileResolveComment: + return DBXTeamLogEventTypeArgFileResolveComment() + case .fileUnlikeComment: + return DBXTeamLogEventTypeArgFileUnlikeComment() + case .fileUnresolveComment: + return DBXTeamLogEventTypeArgFileUnresolveComment() + case .governancePolicyAddFolders: + return DBXTeamLogEventTypeArgGovernancePolicyAddFolders() + case .governancePolicyAddFolderFailed: + return DBXTeamLogEventTypeArgGovernancePolicyAddFolderFailed() + case .governancePolicyContentDisposed: + return DBXTeamLogEventTypeArgGovernancePolicyContentDisposed() + case .governancePolicyCreate: + return DBXTeamLogEventTypeArgGovernancePolicyCreate() + case .governancePolicyDelete: + return DBXTeamLogEventTypeArgGovernancePolicyDelete() + case .governancePolicyEditDetails: + return DBXTeamLogEventTypeArgGovernancePolicyEditDetails() + case .governancePolicyEditDuration: + return DBXTeamLogEventTypeArgGovernancePolicyEditDuration() + case .governancePolicyExportCreated: + return DBXTeamLogEventTypeArgGovernancePolicyExportCreated() + case .governancePolicyExportRemoved: + return DBXTeamLogEventTypeArgGovernancePolicyExportRemoved() + case .governancePolicyRemoveFolders: + return DBXTeamLogEventTypeArgGovernancePolicyRemoveFolders() + case .governancePolicyReportCreated: + return DBXTeamLogEventTypeArgGovernancePolicyReportCreated() + case .governancePolicyZipPartDownloaded: + return DBXTeamLogEventTypeArgGovernancePolicyZipPartDownloaded() + case .legalHoldsActivateAHold: + return DBXTeamLogEventTypeArgLegalHoldsActivateAHold() + case .legalHoldsAddMembers: + return DBXTeamLogEventTypeArgLegalHoldsAddMembers() + case .legalHoldsChangeHoldDetails: + return DBXTeamLogEventTypeArgLegalHoldsChangeHoldDetails() + case .legalHoldsChangeHoldName: + return DBXTeamLogEventTypeArgLegalHoldsChangeHoldName() + case .legalHoldsExportAHold: + return DBXTeamLogEventTypeArgLegalHoldsExportAHold() + case .legalHoldsExportCancelled: + return DBXTeamLogEventTypeArgLegalHoldsExportCancelled() + case .legalHoldsExportDownloaded: + return DBXTeamLogEventTypeArgLegalHoldsExportDownloaded() + case .legalHoldsExportRemoved: + return DBXTeamLogEventTypeArgLegalHoldsExportRemoved() + case .legalHoldsReleaseAHold: + return DBXTeamLogEventTypeArgLegalHoldsReleaseAHold() + case .legalHoldsRemoveMembers: + return DBXTeamLogEventTypeArgLegalHoldsRemoveMembers() + case .legalHoldsReportAHold: + return DBXTeamLogEventTypeArgLegalHoldsReportAHold() + case .deviceChangeIpDesktop: + return DBXTeamLogEventTypeArgDeviceChangeIpDesktop() + case .deviceChangeIpMobile: + return DBXTeamLogEventTypeArgDeviceChangeIpMobile() + case .deviceChangeIpWeb: + return DBXTeamLogEventTypeArgDeviceChangeIpWeb() + case .deviceDeleteOnUnlinkFail: + return DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkFail() + case .deviceDeleteOnUnlinkSuccess: + return DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkSuccess() + case .deviceLinkFail: + return DBXTeamLogEventTypeArgDeviceLinkFail() + case .deviceLinkSuccess: + return DBXTeamLogEventTypeArgDeviceLinkSuccess() + case .deviceManagementDisabled: + return DBXTeamLogEventTypeArgDeviceManagementDisabled() + case .deviceManagementEnabled: + return DBXTeamLogEventTypeArgDeviceManagementEnabled() + case .deviceSyncBackupStatusChanged: + return DBXTeamLogEventTypeArgDeviceSyncBackupStatusChanged() + case .deviceUnlink: + return DBXTeamLogEventTypeArgDeviceUnlink() + case .dropboxPasswordsExported: + return DBXTeamLogEventTypeArgDropboxPasswordsExported() + case .dropboxPasswordsNewDeviceEnrolled: + return DBXTeamLogEventTypeArgDropboxPasswordsNewDeviceEnrolled() + case .emmRefreshAuthToken: + return DBXTeamLogEventTypeArgEmmRefreshAuthToken() + case .externalDriveBackupEligibilityStatusChecked: + return DBXTeamLogEventTypeArgExternalDriveBackupEligibilityStatusChecked() + case .externalDriveBackupStatusChanged: + return DBXTeamLogEventTypeArgExternalDriveBackupStatusChanged() + case .accountCaptureChangeAvailability: + return DBXTeamLogEventTypeArgAccountCaptureChangeAvailability() + case .accountCaptureMigrateAccount: + return DBXTeamLogEventTypeArgAccountCaptureMigrateAccount() + case .accountCaptureNotificationEmailsSent: + return DBXTeamLogEventTypeArgAccountCaptureNotificationEmailsSent() + case .accountCaptureRelinquishAccount: + return DBXTeamLogEventTypeArgAccountCaptureRelinquishAccount() + case .disabledDomainInvites: + return DBXTeamLogEventTypeArgDisabledDomainInvites() + case .domainInvitesApproveRequestToJoinTeam: + return DBXTeamLogEventTypeArgDomainInvitesApproveRequestToJoinTeam() + case .domainInvitesDeclineRequestToJoinTeam: + return DBXTeamLogEventTypeArgDomainInvitesDeclineRequestToJoinTeam() + case .domainInvitesEmailExistingUsers: + return DBXTeamLogEventTypeArgDomainInvitesEmailExistingUsers() + case .domainInvitesRequestToJoinTeam: + return DBXTeamLogEventTypeArgDomainInvitesRequestToJoinTeam() + case .domainInvitesSetInviteNewUserPrefToNo: + return DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToNo() + case .domainInvitesSetInviteNewUserPrefToYes: + return DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToYes() + case .domainVerificationAddDomainFail: + return DBXTeamLogEventTypeArgDomainVerificationAddDomainFail() + case .domainVerificationAddDomainSuccess: + return DBXTeamLogEventTypeArgDomainVerificationAddDomainSuccess() + case .domainVerificationRemoveDomain: + return DBXTeamLogEventTypeArgDomainVerificationRemoveDomain() + case .enabledDomainInvites: + return DBXTeamLogEventTypeArgEnabledDomainInvites() + case .teamEncryptionKeyCancelKeyDeletion: + return DBXTeamLogEventTypeArgTeamEncryptionKeyCancelKeyDeletion() + case .teamEncryptionKeyCreateKey: + return DBXTeamLogEventTypeArgTeamEncryptionKeyCreateKey() + case .teamEncryptionKeyDeleteKey: + return DBXTeamLogEventTypeArgTeamEncryptionKeyDeleteKey() + case .teamEncryptionKeyDisableKey: + return DBXTeamLogEventTypeArgTeamEncryptionKeyDisableKey() + case .teamEncryptionKeyEnableKey: + return DBXTeamLogEventTypeArgTeamEncryptionKeyEnableKey() + case .teamEncryptionKeyRotateKey: + return DBXTeamLogEventTypeArgTeamEncryptionKeyRotateKey() + case .teamEncryptionKeyScheduleKeyDeletion: + return DBXTeamLogEventTypeArgTeamEncryptionKeyScheduleKeyDeletion() + case .applyNamingConvention: + return DBXTeamLogEventTypeArgApplyNamingConvention() + case .createFolder: + return DBXTeamLogEventTypeArgCreateFolder() + case .fileAdd: + return DBXTeamLogEventTypeArgFileAdd() + case .fileAddFromAutomation: + return DBXTeamLogEventTypeArgFileAddFromAutomation() + case .fileCopy: + return DBXTeamLogEventTypeArgFileCopy() + case .fileDelete: + return DBXTeamLogEventTypeArgFileDelete() + case .fileDownload: + return DBXTeamLogEventTypeArgFileDownload() + case .fileEdit: + return DBXTeamLogEventTypeArgFileEdit() + case .fileGetCopyReference: + return DBXTeamLogEventTypeArgFileGetCopyReference() + case .fileLockingLockStatusChanged: + return DBXTeamLogEventTypeArgFileLockingLockStatusChanged() + case .fileMove: + return DBXTeamLogEventTypeArgFileMove() + case .filePermanentlyDelete: + return DBXTeamLogEventTypeArgFilePermanentlyDelete() + case .filePreview: + return DBXTeamLogEventTypeArgFilePreview() + case .fileRename: + return DBXTeamLogEventTypeArgFileRename() + case .fileRestore: + return DBXTeamLogEventTypeArgFileRestore() + case .fileRevert: + return DBXTeamLogEventTypeArgFileRevert() + case .fileRollbackChanges: + return DBXTeamLogEventTypeArgFileRollbackChanges() + case .fileSaveCopyReference: + return DBXTeamLogEventTypeArgFileSaveCopyReference() + case .folderOverviewDescriptionChanged: + return DBXTeamLogEventTypeArgFolderOverviewDescriptionChanged() + case .folderOverviewItemPinned: + return DBXTeamLogEventTypeArgFolderOverviewItemPinned() + case .folderOverviewItemUnpinned: + return DBXTeamLogEventTypeArgFolderOverviewItemUnpinned() + case .objectLabelAdded: + return DBXTeamLogEventTypeArgObjectLabelAdded() + case .objectLabelRemoved: + return DBXTeamLogEventTypeArgObjectLabelRemoved() + case .objectLabelUpdatedValue: + return DBXTeamLogEventTypeArgObjectLabelUpdatedValue() + case .organizeFolderWithTidy: + return DBXTeamLogEventTypeArgOrganizeFolderWithTidy() + case .replayFileDelete: + return DBXTeamLogEventTypeArgReplayFileDelete() + case .rewindFolder: + return DBXTeamLogEventTypeArgRewindFolder() + case .undoNamingConvention: + return DBXTeamLogEventTypeArgUndoNamingConvention() + case .undoOrganizeFolderWithTidy: + return DBXTeamLogEventTypeArgUndoOrganizeFolderWithTidy() + case .userTagsAdded: + return DBXTeamLogEventTypeArgUserTagsAdded() + case .userTagsRemoved: + return DBXTeamLogEventTypeArgUserTagsRemoved() + case .emailIngestReceiveFile: + return DBXTeamLogEventTypeArgEmailIngestReceiveFile() + case .fileRequestChange: + return DBXTeamLogEventTypeArgFileRequestChange() + case .fileRequestClose: + return DBXTeamLogEventTypeArgFileRequestClose() + case .fileRequestCreate: + return DBXTeamLogEventTypeArgFileRequestCreate() + case .fileRequestDelete: + return DBXTeamLogEventTypeArgFileRequestDelete() + case .fileRequestReceiveFile: + return DBXTeamLogEventTypeArgFileRequestReceiveFile() + case .groupAddExternalId: + return DBXTeamLogEventTypeArgGroupAddExternalId() + case .groupAddMember: + return DBXTeamLogEventTypeArgGroupAddMember() + case .groupChangeExternalId: + return DBXTeamLogEventTypeArgGroupChangeExternalId() + case .groupChangeManagementType: + return DBXTeamLogEventTypeArgGroupChangeManagementType() + case .groupChangeMemberRole: + return DBXTeamLogEventTypeArgGroupChangeMemberRole() + case .groupCreate: + return DBXTeamLogEventTypeArgGroupCreate() + case .groupDelete: + return DBXTeamLogEventTypeArgGroupDelete() + case .groupDescriptionUpdated: + return DBXTeamLogEventTypeArgGroupDescriptionUpdated() + case .groupJoinPolicyUpdated: + return DBXTeamLogEventTypeArgGroupJoinPolicyUpdated() + case .groupMoved: + return DBXTeamLogEventTypeArgGroupMoved() + case .groupRemoveExternalId: + return DBXTeamLogEventTypeArgGroupRemoveExternalId() + case .groupRemoveMember: + return DBXTeamLogEventTypeArgGroupRemoveMember() + case .groupRename: + return DBXTeamLogEventTypeArgGroupRename() + case .accountLockOrUnlocked: + return DBXTeamLogEventTypeArgAccountLockOrUnlocked() + case .emmError: + return DBXTeamLogEventTypeArgEmmError() + case .guestAdminSignedInViaTrustedTeams: + return DBXTeamLogEventTypeArgGuestAdminSignedInViaTrustedTeams() + case .guestAdminSignedOutViaTrustedTeams: + return DBXTeamLogEventTypeArgGuestAdminSignedOutViaTrustedTeams() + case .loginFail: + return DBXTeamLogEventTypeArgLoginFail() + case .loginSuccess: + return DBXTeamLogEventTypeArgLoginSuccess() + case .logout: + return DBXTeamLogEventTypeArgLogout() + case .resellerSupportSessionEnd: + return DBXTeamLogEventTypeArgResellerSupportSessionEnd() + case .resellerSupportSessionStart: + return DBXTeamLogEventTypeArgResellerSupportSessionStart() + case .signInAsSessionEnd: + return DBXTeamLogEventTypeArgSignInAsSessionEnd() + case .signInAsSessionStart: + return DBXTeamLogEventTypeArgSignInAsSessionStart() + case .ssoError: + return DBXTeamLogEventTypeArgSsoError() + case .backupAdminInvitationSent: + return DBXTeamLogEventTypeArgBackupAdminInvitationSent() + case .backupInvitationOpened: + return DBXTeamLogEventTypeArgBackupInvitationOpened() + case .createTeamInviteLink: + return DBXTeamLogEventTypeArgCreateTeamInviteLink() + case .deleteTeamInviteLink: + return DBXTeamLogEventTypeArgDeleteTeamInviteLink() + case .memberAddExternalId: + return DBXTeamLogEventTypeArgMemberAddExternalId() + case .memberAddName: + return DBXTeamLogEventTypeArgMemberAddName() + case .memberChangeAdminRole: + return DBXTeamLogEventTypeArgMemberChangeAdminRole() + case .memberChangeEmail: + return DBXTeamLogEventTypeArgMemberChangeEmail() + case .memberChangeExternalId: + return DBXTeamLogEventTypeArgMemberChangeExternalId() + case .memberChangeMembershipType: + return DBXTeamLogEventTypeArgMemberChangeMembershipType() + case .memberChangeName: + return DBXTeamLogEventTypeArgMemberChangeName() + case .memberChangeResellerRole: + return DBXTeamLogEventTypeArgMemberChangeResellerRole() + case .memberChangeStatus: + return DBXTeamLogEventTypeArgMemberChangeStatus() + case .memberDeleteManualContacts: + return DBXTeamLogEventTypeArgMemberDeleteManualContacts() + case .memberDeleteProfilePhoto: + return DBXTeamLogEventTypeArgMemberDeleteProfilePhoto() + case .memberPermanentlyDeleteAccountContents: + return DBXTeamLogEventTypeArgMemberPermanentlyDeleteAccountContents() + case .memberRemoveExternalId: + return DBXTeamLogEventTypeArgMemberRemoveExternalId() + case .memberSetProfilePhoto: + return DBXTeamLogEventTypeArgMemberSetProfilePhoto() + case .memberSpaceLimitsAddCustomQuota: + return DBXTeamLogEventTypeArgMemberSpaceLimitsAddCustomQuota() + case .memberSpaceLimitsChangeCustomQuota: + return DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCustomQuota() + case .memberSpaceLimitsChangeStatus: + return DBXTeamLogEventTypeArgMemberSpaceLimitsChangeStatus() + case .memberSpaceLimitsRemoveCustomQuota: + return DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveCustomQuota() + case .memberSuggest: + return DBXTeamLogEventTypeArgMemberSuggest() + case .memberTransferAccountContents: + return DBXTeamLogEventTypeArgMemberTransferAccountContents() + case .pendingSecondaryEmailAdded: + return DBXTeamLogEventTypeArgPendingSecondaryEmailAdded() + case .secondaryEmailDeleted: + return DBXTeamLogEventTypeArgSecondaryEmailDeleted() + case .secondaryEmailVerified: + return DBXTeamLogEventTypeArgSecondaryEmailVerified() + case .secondaryMailsPolicyChanged: + return DBXTeamLogEventTypeArgSecondaryMailsPolicyChanged() + case .binderAddPage: + return DBXTeamLogEventTypeArgBinderAddPage() + case .binderAddSection: + return DBXTeamLogEventTypeArgBinderAddSection() + case .binderRemovePage: + return DBXTeamLogEventTypeArgBinderRemovePage() + case .binderRemoveSection: + return DBXTeamLogEventTypeArgBinderRemoveSection() + case .binderRenamePage: + return DBXTeamLogEventTypeArgBinderRenamePage() + case .binderRenameSection: + return DBXTeamLogEventTypeArgBinderRenameSection() + case .binderReorderPage: + return DBXTeamLogEventTypeArgBinderReorderPage() + case .binderReorderSection: + return DBXTeamLogEventTypeArgBinderReorderSection() + case .paperContentAddMember: + return DBXTeamLogEventTypeArgPaperContentAddMember() + case .paperContentAddToFolder: + return DBXTeamLogEventTypeArgPaperContentAddToFolder() + case .paperContentArchive: + return DBXTeamLogEventTypeArgPaperContentArchive() + case .paperContentCreate: + return DBXTeamLogEventTypeArgPaperContentCreate() + case .paperContentPermanentlyDelete: + return DBXTeamLogEventTypeArgPaperContentPermanentlyDelete() + case .paperContentRemoveFromFolder: + return DBXTeamLogEventTypeArgPaperContentRemoveFromFolder() + case .paperContentRemoveMember: + return DBXTeamLogEventTypeArgPaperContentRemoveMember() + case .paperContentRename: + return DBXTeamLogEventTypeArgPaperContentRename() + case .paperContentRestore: + return DBXTeamLogEventTypeArgPaperContentRestore() + case .paperDocAddComment: + return DBXTeamLogEventTypeArgPaperDocAddComment() + case .paperDocChangeMemberRole: + return DBXTeamLogEventTypeArgPaperDocChangeMemberRole() + case .paperDocChangeSharingPolicy: + return DBXTeamLogEventTypeArgPaperDocChangeSharingPolicy() + case .paperDocChangeSubscription: + return DBXTeamLogEventTypeArgPaperDocChangeSubscription() + case .paperDocDeleted: + return DBXTeamLogEventTypeArgPaperDocDeleted() + case .paperDocDeleteComment: + return DBXTeamLogEventTypeArgPaperDocDeleteComment() + case .paperDocDownload: + return DBXTeamLogEventTypeArgPaperDocDownload() + case .paperDocEdit: + return DBXTeamLogEventTypeArgPaperDocEdit() + case .paperDocEditComment: + return DBXTeamLogEventTypeArgPaperDocEditComment() + case .paperDocFollowed: + return DBXTeamLogEventTypeArgPaperDocFollowed() + case .paperDocMention: + return DBXTeamLogEventTypeArgPaperDocMention() + case .paperDocOwnershipChanged: + return DBXTeamLogEventTypeArgPaperDocOwnershipChanged() + case .paperDocRequestAccess: + return DBXTeamLogEventTypeArgPaperDocRequestAccess() + case .paperDocResolveComment: + return DBXTeamLogEventTypeArgPaperDocResolveComment() + case .paperDocRevert: + return DBXTeamLogEventTypeArgPaperDocRevert() + case .paperDocSlackShare: + return DBXTeamLogEventTypeArgPaperDocSlackShare() + case .paperDocTeamInvite: + return DBXTeamLogEventTypeArgPaperDocTeamInvite() + case .paperDocTrashed: + return DBXTeamLogEventTypeArgPaperDocTrashed() + case .paperDocUnresolveComment: + return DBXTeamLogEventTypeArgPaperDocUnresolveComment() + case .paperDocUntrashed: + return DBXTeamLogEventTypeArgPaperDocUntrashed() + case .paperDocView: + return DBXTeamLogEventTypeArgPaperDocView() + case .paperExternalViewAllow: + return DBXTeamLogEventTypeArgPaperExternalViewAllow() + case .paperExternalViewDefaultTeam: + return DBXTeamLogEventTypeArgPaperExternalViewDefaultTeam() + case .paperExternalViewForbid: + return DBXTeamLogEventTypeArgPaperExternalViewForbid() + case .paperFolderChangeSubscription: + return DBXTeamLogEventTypeArgPaperFolderChangeSubscription() + case .paperFolderDeleted: + return DBXTeamLogEventTypeArgPaperFolderDeleted() + case .paperFolderFollowed: + return DBXTeamLogEventTypeArgPaperFolderFollowed() + case .paperFolderTeamInvite: + return DBXTeamLogEventTypeArgPaperFolderTeamInvite() + case .paperPublishedLinkChangePermission: + return DBXTeamLogEventTypeArgPaperPublishedLinkChangePermission() + case .paperPublishedLinkCreate: + return DBXTeamLogEventTypeArgPaperPublishedLinkCreate() + case .paperPublishedLinkDisabled: + return DBXTeamLogEventTypeArgPaperPublishedLinkDisabled() + case .paperPublishedLinkView: + return DBXTeamLogEventTypeArgPaperPublishedLinkView() + case .passwordChange: + return DBXTeamLogEventTypeArgPasswordChange() + case .passwordReset: + return DBXTeamLogEventTypeArgPasswordReset() + case .passwordResetAll: + return DBXTeamLogEventTypeArgPasswordResetAll() + case .classificationCreateReport: + return DBXTeamLogEventTypeArgClassificationCreateReport() + case .classificationCreateReportFail: + return DBXTeamLogEventTypeArgClassificationCreateReportFail() + case .emmCreateExceptionsReport: + return DBXTeamLogEventTypeArgEmmCreateExceptionsReport() + case .emmCreateUsageReport: + return DBXTeamLogEventTypeArgEmmCreateUsageReport() + case .exportMembersReport: + return DBXTeamLogEventTypeArgExportMembersReport() + case .exportMembersReportFail: + return DBXTeamLogEventTypeArgExportMembersReportFail() + case .externalSharingCreateReport: + return DBXTeamLogEventTypeArgExternalSharingCreateReport() + case .externalSharingReportFailed: + return DBXTeamLogEventTypeArgExternalSharingReportFailed() + case .noExpirationLinkGenCreateReport: + return DBXTeamLogEventTypeArgNoExpirationLinkGenCreateReport() + case .noExpirationLinkGenReportFailed: + return DBXTeamLogEventTypeArgNoExpirationLinkGenReportFailed() + case .noPasswordLinkGenCreateReport: + return DBXTeamLogEventTypeArgNoPasswordLinkGenCreateReport() + case .noPasswordLinkGenReportFailed: + return DBXTeamLogEventTypeArgNoPasswordLinkGenReportFailed() + case .noPasswordLinkViewCreateReport: + return DBXTeamLogEventTypeArgNoPasswordLinkViewCreateReport() + case .noPasswordLinkViewReportFailed: + return DBXTeamLogEventTypeArgNoPasswordLinkViewReportFailed() + case .outdatedLinkViewCreateReport: + return DBXTeamLogEventTypeArgOutdatedLinkViewCreateReport() + case .outdatedLinkViewReportFailed: + return DBXTeamLogEventTypeArgOutdatedLinkViewReportFailed() + case .paperAdminExportStart: + return DBXTeamLogEventTypeArgPaperAdminExportStart() + case .ransomwareAlertCreateReport: + return DBXTeamLogEventTypeArgRansomwareAlertCreateReport() + case .ransomwareAlertCreateReportFailed: + return DBXTeamLogEventTypeArgRansomwareAlertCreateReportFailed() + case .smartSyncCreateAdminPrivilegeReport: + return DBXTeamLogEventTypeArgSmartSyncCreateAdminPrivilegeReport() + case .teamActivityCreateReport: + return DBXTeamLogEventTypeArgTeamActivityCreateReport() + case .teamActivityCreateReportFail: + return DBXTeamLogEventTypeArgTeamActivityCreateReportFail() + case .collectionShare: + return DBXTeamLogEventTypeArgCollectionShare() + case .fileTransfersFileAdd: + return DBXTeamLogEventTypeArgFileTransfersFileAdd() + case .fileTransfersTransferDelete: + return DBXTeamLogEventTypeArgFileTransfersTransferDelete() + case .fileTransfersTransferDownload: + return DBXTeamLogEventTypeArgFileTransfersTransferDownload() + case .fileTransfersTransferSend: + return DBXTeamLogEventTypeArgFileTransfersTransferSend() + case .fileTransfersTransferView: + return DBXTeamLogEventTypeArgFileTransfersTransferView() + case .noteAclInviteOnly: + return DBXTeamLogEventTypeArgNoteAclInviteOnly() + case .noteAclLink: + return DBXTeamLogEventTypeArgNoteAclLink() + case .noteAclTeamLink: + return DBXTeamLogEventTypeArgNoteAclTeamLink() + case .noteShared: + return DBXTeamLogEventTypeArgNoteShared() + case .noteShareReceive: + return DBXTeamLogEventTypeArgNoteShareReceive() + case .openNoteShared: + return DBXTeamLogEventTypeArgOpenNoteShared() + case .replayFileSharedLinkCreated: + return DBXTeamLogEventTypeArgReplayFileSharedLinkCreated() + case .replayFileSharedLinkModified: + return DBXTeamLogEventTypeArgReplayFileSharedLinkModified() + case .replayProjectTeamAdd: + return DBXTeamLogEventTypeArgReplayProjectTeamAdd() + case .replayProjectTeamDelete: + return DBXTeamLogEventTypeArgReplayProjectTeamDelete() + case .sfAddGroup: + return DBXTeamLogEventTypeArgSfAddGroup() + case .sfAllowNonMembersToViewSharedLinks: + return DBXTeamLogEventTypeArgSfAllowNonMembersToViewSharedLinks() + case .sfExternalInviteWarn: + return DBXTeamLogEventTypeArgSfExternalInviteWarn() + case .sfFbInvite: + return DBXTeamLogEventTypeArgSfFbInvite() + case .sfFbInviteChangeRole: + return DBXTeamLogEventTypeArgSfFbInviteChangeRole() + case .sfFbUninvite: + return DBXTeamLogEventTypeArgSfFbUninvite() + case .sfInviteGroup: + return DBXTeamLogEventTypeArgSfInviteGroup() + case .sfTeamGrantAccess: + return DBXTeamLogEventTypeArgSfTeamGrantAccess() + case .sfTeamInvite: + return DBXTeamLogEventTypeArgSfTeamInvite() + case .sfTeamInviteChangeRole: + return DBXTeamLogEventTypeArgSfTeamInviteChangeRole() + case .sfTeamJoin: + return DBXTeamLogEventTypeArgSfTeamJoin() + case .sfTeamJoinFromOobLink: + return DBXTeamLogEventTypeArgSfTeamJoinFromOobLink() + case .sfTeamUninvite: + return DBXTeamLogEventTypeArgSfTeamUninvite() + case .sharedContentAddInvitees: + return DBXTeamLogEventTypeArgSharedContentAddInvitees() + case .sharedContentAddLinkExpiry: + return DBXTeamLogEventTypeArgSharedContentAddLinkExpiry() + case .sharedContentAddLinkPassword: + return DBXTeamLogEventTypeArgSharedContentAddLinkPassword() + case .sharedContentAddMember: + return DBXTeamLogEventTypeArgSharedContentAddMember() + case .sharedContentChangeDownloadsPolicy: + return DBXTeamLogEventTypeArgSharedContentChangeDownloadsPolicy() + case .sharedContentChangeInviteeRole: + return DBXTeamLogEventTypeArgSharedContentChangeInviteeRole() + case .sharedContentChangeLinkAudience: + return DBXTeamLogEventTypeArgSharedContentChangeLinkAudience() + case .sharedContentChangeLinkExpiry: + return DBXTeamLogEventTypeArgSharedContentChangeLinkExpiry() + case .sharedContentChangeLinkPassword: + return DBXTeamLogEventTypeArgSharedContentChangeLinkPassword() + case .sharedContentChangeMemberRole: + return DBXTeamLogEventTypeArgSharedContentChangeMemberRole() + case .sharedContentChangeViewerInfoPolicy: + return DBXTeamLogEventTypeArgSharedContentChangeViewerInfoPolicy() + case .sharedContentClaimInvitation: + return DBXTeamLogEventTypeArgSharedContentClaimInvitation() + case .sharedContentCopy: + return DBXTeamLogEventTypeArgSharedContentCopy() + case .sharedContentDownload: + return DBXTeamLogEventTypeArgSharedContentDownload() + case .sharedContentRelinquishMembership: + return DBXTeamLogEventTypeArgSharedContentRelinquishMembership() + case .sharedContentRemoveInvitees: + return DBXTeamLogEventTypeArgSharedContentRemoveInvitees() + case .sharedContentRemoveLinkExpiry: + return DBXTeamLogEventTypeArgSharedContentRemoveLinkExpiry() + case .sharedContentRemoveLinkPassword: + return DBXTeamLogEventTypeArgSharedContentRemoveLinkPassword() + case .sharedContentRemoveMember: + return DBXTeamLogEventTypeArgSharedContentRemoveMember() + case .sharedContentRequestAccess: + return DBXTeamLogEventTypeArgSharedContentRequestAccess() + case .sharedContentRestoreInvitees: + return DBXTeamLogEventTypeArgSharedContentRestoreInvitees() + case .sharedContentRestoreMember: + return DBXTeamLogEventTypeArgSharedContentRestoreMember() + case .sharedContentUnshare: + return DBXTeamLogEventTypeArgSharedContentUnshare() + case .sharedContentView: + return DBXTeamLogEventTypeArgSharedContentView() + case .sharedFolderChangeLinkPolicy: + return DBXTeamLogEventTypeArgSharedFolderChangeLinkPolicy() + case .sharedFolderChangeMembersInheritancePolicy: + return DBXTeamLogEventTypeArgSharedFolderChangeMembersInheritancePolicy() + case .sharedFolderChangeMembersManagementPolicy: + return DBXTeamLogEventTypeArgSharedFolderChangeMembersManagementPolicy() + case .sharedFolderChangeMembersPolicy: + return DBXTeamLogEventTypeArgSharedFolderChangeMembersPolicy() + case .sharedFolderCreate: + return DBXTeamLogEventTypeArgSharedFolderCreate() + case .sharedFolderDeclineInvitation: + return DBXTeamLogEventTypeArgSharedFolderDeclineInvitation() + case .sharedFolderMount: + return DBXTeamLogEventTypeArgSharedFolderMount() + case .sharedFolderNest: + return DBXTeamLogEventTypeArgSharedFolderNest() + case .sharedFolderTransferOwnership: + return DBXTeamLogEventTypeArgSharedFolderTransferOwnership() + case .sharedFolderUnmount: + return DBXTeamLogEventTypeArgSharedFolderUnmount() + case .sharedLinkAddExpiry: + return DBXTeamLogEventTypeArgSharedLinkAddExpiry() + case .sharedLinkChangeExpiry: + return DBXTeamLogEventTypeArgSharedLinkChangeExpiry() + case .sharedLinkChangeVisibility: + return DBXTeamLogEventTypeArgSharedLinkChangeVisibility() + case .sharedLinkCopy: + return DBXTeamLogEventTypeArgSharedLinkCopy() + case .sharedLinkCreate: + return DBXTeamLogEventTypeArgSharedLinkCreate() + case .sharedLinkDisable: + return DBXTeamLogEventTypeArgSharedLinkDisable() + case .sharedLinkDownload: + return DBXTeamLogEventTypeArgSharedLinkDownload() + case .sharedLinkRemoveExpiry: + return DBXTeamLogEventTypeArgSharedLinkRemoveExpiry() + case .sharedLinkSettingsAddExpiration: + return DBXTeamLogEventTypeArgSharedLinkSettingsAddExpiration() + case .sharedLinkSettingsAddPassword: + return DBXTeamLogEventTypeArgSharedLinkSettingsAddPassword() + case .sharedLinkSettingsAllowDownloadDisabled: + return DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadDisabled() + case .sharedLinkSettingsAllowDownloadEnabled: + return DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadEnabled() + case .sharedLinkSettingsChangeAudience: + return DBXTeamLogEventTypeArgSharedLinkSettingsChangeAudience() + case .sharedLinkSettingsChangeExpiration: + return DBXTeamLogEventTypeArgSharedLinkSettingsChangeExpiration() + case .sharedLinkSettingsChangePassword: + return DBXTeamLogEventTypeArgSharedLinkSettingsChangePassword() + case .sharedLinkSettingsRemoveExpiration: + return DBXTeamLogEventTypeArgSharedLinkSettingsRemoveExpiration() + case .sharedLinkSettingsRemovePassword: + return DBXTeamLogEventTypeArgSharedLinkSettingsRemovePassword() + case .sharedLinkShare: + return DBXTeamLogEventTypeArgSharedLinkShare() + case .sharedLinkView: + return DBXTeamLogEventTypeArgSharedLinkView() + case .sharedNoteOpened: + return DBXTeamLogEventTypeArgSharedNoteOpened() + case .shmodelDisableDownloads: + return DBXTeamLogEventTypeArgShmodelDisableDownloads() + case .shmodelEnableDownloads: + return DBXTeamLogEventTypeArgShmodelEnableDownloads() + case .shmodelGroupShare: + return DBXTeamLogEventTypeArgShmodelGroupShare() + case .showcaseAccessGranted: + return DBXTeamLogEventTypeArgShowcaseAccessGranted() + case .showcaseAddMember: + return DBXTeamLogEventTypeArgShowcaseAddMember() + case .showcaseArchived: + return DBXTeamLogEventTypeArgShowcaseArchived() + case .showcaseCreated: + return DBXTeamLogEventTypeArgShowcaseCreated() + case .showcaseDeleteComment: + return DBXTeamLogEventTypeArgShowcaseDeleteComment() + case .showcaseEdited: + return DBXTeamLogEventTypeArgShowcaseEdited() + case .showcaseEditComment: + return DBXTeamLogEventTypeArgShowcaseEditComment() + case .showcaseFileAdded: + return DBXTeamLogEventTypeArgShowcaseFileAdded() + case .showcaseFileDownload: + return DBXTeamLogEventTypeArgShowcaseFileDownload() + case .showcaseFileRemoved: + return DBXTeamLogEventTypeArgShowcaseFileRemoved() + case .showcaseFileView: + return DBXTeamLogEventTypeArgShowcaseFileView() + case .showcasePermanentlyDeleted: + return DBXTeamLogEventTypeArgShowcasePermanentlyDeleted() + case .showcasePostComment: + return DBXTeamLogEventTypeArgShowcasePostComment() + case .showcaseRemoveMember: + return DBXTeamLogEventTypeArgShowcaseRemoveMember() + case .showcaseRenamed: + return DBXTeamLogEventTypeArgShowcaseRenamed() + case .showcaseRequestAccess: + return DBXTeamLogEventTypeArgShowcaseRequestAccess() + case .showcaseResolveComment: + return DBXTeamLogEventTypeArgShowcaseResolveComment() + case .showcaseRestored: + return DBXTeamLogEventTypeArgShowcaseRestored() + case .showcaseTrashed: + return DBXTeamLogEventTypeArgShowcaseTrashed() + case .showcaseTrashedDeprecated: + return DBXTeamLogEventTypeArgShowcaseTrashedDeprecated() + case .showcaseUnresolveComment: + return DBXTeamLogEventTypeArgShowcaseUnresolveComment() + case .showcaseUntrashed: + return DBXTeamLogEventTypeArgShowcaseUntrashed() + case .showcaseUntrashedDeprecated: + return DBXTeamLogEventTypeArgShowcaseUntrashedDeprecated() + case .showcaseView: + return DBXTeamLogEventTypeArgShowcaseView() + case .ssoAddCert: + return DBXTeamLogEventTypeArgSsoAddCert() + case .ssoAddLoginUrl: + return DBXTeamLogEventTypeArgSsoAddLoginUrl() + case .ssoAddLogoutUrl: + return DBXTeamLogEventTypeArgSsoAddLogoutUrl() + case .ssoChangeCert: + return DBXTeamLogEventTypeArgSsoChangeCert() + case .ssoChangeLoginUrl: + return DBXTeamLogEventTypeArgSsoChangeLoginUrl() + case .ssoChangeLogoutUrl: + return DBXTeamLogEventTypeArgSsoChangeLogoutUrl() + case .ssoChangeSamlIdentityMode: + return DBXTeamLogEventTypeArgSsoChangeSamlIdentityMode() + case .ssoRemoveCert: + return DBXTeamLogEventTypeArgSsoRemoveCert() + case .ssoRemoveLoginUrl: + return DBXTeamLogEventTypeArgSsoRemoveLoginUrl() + case .ssoRemoveLogoutUrl: + return DBXTeamLogEventTypeArgSsoRemoveLogoutUrl() + case .teamFolderChangeStatus: + return DBXTeamLogEventTypeArgTeamFolderChangeStatus() + case .teamFolderCreate: + return DBXTeamLogEventTypeArgTeamFolderCreate() + case .teamFolderDowngrade: + return DBXTeamLogEventTypeArgTeamFolderDowngrade() + case .teamFolderPermanentlyDelete: + return DBXTeamLogEventTypeArgTeamFolderPermanentlyDelete() + case .teamFolderRename: + return DBXTeamLogEventTypeArgTeamFolderRename() + case .teamSelectiveSyncSettingsChanged: + return DBXTeamLogEventTypeArgTeamSelectiveSyncSettingsChanged() + case .accountCaptureChangePolicy: + return DBXTeamLogEventTypeArgAccountCaptureChangePolicy() + case .adminEmailRemindersChanged: + return DBXTeamLogEventTypeArgAdminEmailRemindersChanged() + case .allowDownloadDisabled: + return DBXTeamLogEventTypeArgAllowDownloadDisabled() + case .allowDownloadEnabled: + return DBXTeamLogEventTypeArgAllowDownloadEnabled() + case .appPermissionsChanged: + return DBXTeamLogEventTypeArgAppPermissionsChanged() + case .cameraUploadsPolicyChanged: + return DBXTeamLogEventTypeArgCameraUploadsPolicyChanged() + case .captureTranscriptPolicyChanged: + return DBXTeamLogEventTypeArgCaptureTranscriptPolicyChanged() + case .classificationChangePolicy: + return DBXTeamLogEventTypeArgClassificationChangePolicy() + case .computerBackupPolicyChanged: + return DBXTeamLogEventTypeArgComputerBackupPolicyChanged() + case .contentAdministrationPolicyChanged: + return DBXTeamLogEventTypeArgContentAdministrationPolicyChanged() + case .dataPlacementRestrictionChangePolicy: + return DBXTeamLogEventTypeArgDataPlacementRestrictionChangePolicy() + case .dataPlacementRestrictionSatisfyPolicy: + return DBXTeamLogEventTypeArgDataPlacementRestrictionSatisfyPolicy() + case .deviceApprovalsAddException: + return DBXTeamLogEventTypeArgDeviceApprovalsAddException() + case .deviceApprovalsChangeDesktopPolicy: + return DBXTeamLogEventTypeArgDeviceApprovalsChangeDesktopPolicy() + case .deviceApprovalsChangeMobilePolicy: + return DBXTeamLogEventTypeArgDeviceApprovalsChangeMobilePolicy() + case .deviceApprovalsChangeOverageAction: + return DBXTeamLogEventTypeArgDeviceApprovalsChangeOverageAction() + case .deviceApprovalsChangeUnlinkAction: + return DBXTeamLogEventTypeArgDeviceApprovalsChangeUnlinkAction() + case .deviceApprovalsRemoveException: + return DBXTeamLogEventTypeArgDeviceApprovalsRemoveException() + case .directoryRestrictionsAddMembers: + return DBXTeamLogEventTypeArgDirectoryRestrictionsAddMembers() + case .directoryRestrictionsRemoveMembers: + return DBXTeamLogEventTypeArgDirectoryRestrictionsRemoveMembers() + case .dropboxPasswordsPolicyChanged: + return DBXTeamLogEventTypeArgDropboxPasswordsPolicyChanged() + case .emailIngestPolicyChanged: + return DBXTeamLogEventTypeArgEmailIngestPolicyChanged() + case .emmAddException: + return DBXTeamLogEventTypeArgEmmAddException() + case .emmChangePolicy: + return DBXTeamLogEventTypeArgEmmChangePolicy() + case .emmRemoveException: + return DBXTeamLogEventTypeArgEmmRemoveException() + case .extendedVersionHistoryChangePolicy: + return DBXTeamLogEventTypeArgExtendedVersionHistoryChangePolicy() + case .externalDriveBackupPolicyChanged: + return DBXTeamLogEventTypeArgExternalDriveBackupPolicyChanged() + case .fileCommentsChangePolicy: + return DBXTeamLogEventTypeArgFileCommentsChangePolicy() + case .fileLockingPolicyChanged: + return DBXTeamLogEventTypeArgFileLockingPolicyChanged() + case .fileProviderMigrationPolicyChanged: + return DBXTeamLogEventTypeArgFileProviderMigrationPolicyChanged() + case .fileRequestsChangePolicy: + return DBXTeamLogEventTypeArgFileRequestsChangePolicy() + case .fileRequestsEmailsEnabled: + return DBXTeamLogEventTypeArgFileRequestsEmailsEnabled() + case .fileRequestsEmailsRestrictedToTeamOnly: + return DBXTeamLogEventTypeArgFileRequestsEmailsRestrictedToTeamOnly() + case .fileTransfersPolicyChanged: + return DBXTeamLogEventTypeArgFileTransfersPolicyChanged() + case .folderLinkRestrictionPolicyChanged: + return DBXTeamLogEventTypeArgFolderLinkRestrictionPolicyChanged() + case .googleSsoChangePolicy: + return DBXTeamLogEventTypeArgGoogleSsoChangePolicy() + case .groupUserManagementChangePolicy: + return DBXTeamLogEventTypeArgGroupUserManagementChangePolicy() + case .integrationPolicyChanged: + return DBXTeamLogEventTypeArgIntegrationPolicyChanged() + case .inviteAcceptanceEmailPolicyChanged: + return DBXTeamLogEventTypeArgInviteAcceptanceEmailPolicyChanged() + case .memberRequestsChangePolicy: + return DBXTeamLogEventTypeArgMemberRequestsChangePolicy() + case .memberSendInvitePolicyChanged: + return DBXTeamLogEventTypeArgMemberSendInvitePolicyChanged() + case .memberSpaceLimitsAddException: + return DBXTeamLogEventTypeArgMemberSpaceLimitsAddException() + case .memberSpaceLimitsChangeCapsTypePolicy: + return DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCapsTypePolicy() + case .memberSpaceLimitsChangePolicy: + return DBXTeamLogEventTypeArgMemberSpaceLimitsChangePolicy() + case .memberSpaceLimitsRemoveException: + return DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveException() + case .memberSuggestionsChangePolicy: + return DBXTeamLogEventTypeArgMemberSuggestionsChangePolicy() + case .microsoftOfficeAddinChangePolicy: + return DBXTeamLogEventTypeArgMicrosoftOfficeAddinChangePolicy() + case .networkControlChangePolicy: + return DBXTeamLogEventTypeArgNetworkControlChangePolicy() + case .paperChangeDeploymentPolicy: + return DBXTeamLogEventTypeArgPaperChangeDeploymentPolicy() + case .paperChangeMemberLinkPolicy: + return DBXTeamLogEventTypeArgPaperChangeMemberLinkPolicy() + case .paperChangeMemberPolicy: + return DBXTeamLogEventTypeArgPaperChangeMemberPolicy() + case .paperChangePolicy: + return DBXTeamLogEventTypeArgPaperChangePolicy() + case .paperDefaultFolderPolicyChanged: + return DBXTeamLogEventTypeArgPaperDefaultFolderPolicyChanged() + case .paperDesktopPolicyChanged: + return DBXTeamLogEventTypeArgPaperDesktopPolicyChanged() + case .paperEnabledUsersGroupAddition: + return DBXTeamLogEventTypeArgPaperEnabledUsersGroupAddition() + case .paperEnabledUsersGroupRemoval: + return DBXTeamLogEventTypeArgPaperEnabledUsersGroupRemoval() + case .passwordStrengthRequirementsChangePolicy: + return DBXTeamLogEventTypeArgPasswordStrengthRequirementsChangePolicy() + case .permanentDeleteChangePolicy: + return DBXTeamLogEventTypeArgPermanentDeleteChangePolicy() + case .resellerSupportChangePolicy: + return DBXTeamLogEventTypeArgResellerSupportChangePolicy() + case .rewindPolicyChanged: + return DBXTeamLogEventTypeArgRewindPolicyChanged() + case .sendForSignaturePolicyChanged: + return DBXTeamLogEventTypeArgSendForSignaturePolicyChanged() + case .sharingChangeFolderJoinPolicy: + return DBXTeamLogEventTypeArgSharingChangeFolderJoinPolicy() + case .sharingChangeLinkAllowChangeExpirationPolicy: + return DBXTeamLogEventTypeArgSharingChangeLinkAllowChangeExpirationPolicy() + case .sharingChangeLinkDefaultExpirationPolicy: + return DBXTeamLogEventTypeArgSharingChangeLinkDefaultExpirationPolicy() + case .sharingChangeLinkEnforcePasswordPolicy: + return DBXTeamLogEventTypeArgSharingChangeLinkEnforcePasswordPolicy() + case .sharingChangeLinkPolicy: + return DBXTeamLogEventTypeArgSharingChangeLinkPolicy() + case .sharingChangeMemberPolicy: + return DBXTeamLogEventTypeArgSharingChangeMemberPolicy() + case .showcaseChangeDownloadPolicy: + return DBXTeamLogEventTypeArgShowcaseChangeDownloadPolicy() + case .showcaseChangeEnabledPolicy: + return DBXTeamLogEventTypeArgShowcaseChangeEnabledPolicy() + case .showcaseChangeExternalSharingPolicy: + return DBXTeamLogEventTypeArgShowcaseChangeExternalSharingPolicy() + case .smarterSmartSyncPolicyChanged: + return DBXTeamLogEventTypeArgSmarterSmartSyncPolicyChanged() + case .smartSyncChangePolicy: + return DBXTeamLogEventTypeArgSmartSyncChangePolicy() + case .smartSyncNotOptOut: + return DBXTeamLogEventTypeArgSmartSyncNotOptOut() + case .smartSyncOptOut: + return DBXTeamLogEventTypeArgSmartSyncOptOut() + case .ssoChangePolicy: + return DBXTeamLogEventTypeArgSsoChangePolicy() + case .teamBrandingPolicyChanged: + return DBXTeamLogEventTypeArgTeamBrandingPolicyChanged() + case .teamExtensionsPolicyChanged: + return DBXTeamLogEventTypeArgTeamExtensionsPolicyChanged() + case .teamSelectiveSyncPolicyChanged: + return DBXTeamLogEventTypeArgTeamSelectiveSyncPolicyChanged() + case .teamSharingWhitelistSubjectsChanged: + return DBXTeamLogEventTypeArgTeamSharingWhitelistSubjectsChanged() + case .tfaAddException: + return DBXTeamLogEventTypeArgTfaAddException() + case .tfaChangePolicy: + return DBXTeamLogEventTypeArgTfaChangePolicy() + case .tfaRemoveException: + return DBXTeamLogEventTypeArgTfaRemoveException() + case .twoAccountChangePolicy: + return DBXTeamLogEventTypeArgTwoAccountChangePolicy() + case .viewerInfoPolicyChanged: + return DBXTeamLogEventTypeArgViewerInfoPolicyChanged() + case .watermarkingPolicyChanged: + return DBXTeamLogEventTypeArgWatermarkingPolicyChanged() + case .webSessionsChangeActiveSessionLimit: + return DBXTeamLogEventTypeArgWebSessionsChangeActiveSessionLimit() + case .webSessionsChangeFixedLengthPolicy: + return DBXTeamLogEventTypeArgWebSessionsChangeFixedLengthPolicy() + case .webSessionsChangeIdleLengthPolicy: + return DBXTeamLogEventTypeArgWebSessionsChangeIdleLengthPolicy() + case .dataResidencyMigrationRequestSuccessful: + return DBXTeamLogEventTypeArgDataResidencyMigrationRequestSuccessful() + case .dataResidencyMigrationRequestUnsuccessful: + return DBXTeamLogEventTypeArgDataResidencyMigrationRequestUnsuccessful() + case .teamMergeFrom: + return DBXTeamLogEventTypeArgTeamMergeFrom() + case .teamMergeTo: + return DBXTeamLogEventTypeArgTeamMergeTo() + case .teamProfileAddBackground: + return DBXTeamLogEventTypeArgTeamProfileAddBackground() + case .teamProfileAddLogo: + return DBXTeamLogEventTypeArgTeamProfileAddLogo() + case .teamProfileChangeBackground: + return DBXTeamLogEventTypeArgTeamProfileChangeBackground() + case .teamProfileChangeDefaultLanguage: + return DBXTeamLogEventTypeArgTeamProfileChangeDefaultLanguage() + case .teamProfileChangeLogo: + return DBXTeamLogEventTypeArgTeamProfileChangeLogo() + case .teamProfileChangeName: + return DBXTeamLogEventTypeArgTeamProfileChangeName() + case .teamProfileRemoveBackground: + return DBXTeamLogEventTypeArgTeamProfileRemoveBackground() + case .teamProfileRemoveLogo: + return DBXTeamLogEventTypeArgTeamProfileRemoveLogo() + case .tfaAddBackupPhone: + return DBXTeamLogEventTypeArgTfaAddBackupPhone() + case .tfaAddSecurityKey: + return DBXTeamLogEventTypeArgTfaAddSecurityKey() + case .tfaChangeBackupPhone: + return DBXTeamLogEventTypeArgTfaChangeBackupPhone() + case .tfaChangeStatus: + return DBXTeamLogEventTypeArgTfaChangeStatus() + case .tfaRemoveBackupPhone: + return DBXTeamLogEventTypeArgTfaRemoveBackupPhone() + case .tfaRemoveSecurityKey: + return DBXTeamLogEventTypeArgTfaRemoveSecurityKey() + case .tfaReset: + return DBXTeamLogEventTypeArgTfaReset() + case .changedEnterpriseAdminRole: + return DBXTeamLogEventTypeArgChangedEnterpriseAdminRole() + case .changedEnterpriseConnectedTeamStatus: + return DBXTeamLogEventTypeArgChangedEnterpriseConnectedTeamStatus() + case .endedEnterpriseAdminSession: + return DBXTeamLogEventTypeArgEndedEnterpriseAdminSession() + case .endedEnterpriseAdminSessionDeprecated: + return DBXTeamLogEventTypeArgEndedEnterpriseAdminSessionDeprecated() + case .enterpriseSettingsLocking: + return DBXTeamLogEventTypeArgEnterpriseSettingsLocking() + case .guestAdminChangeStatus: + return DBXTeamLogEventTypeArgGuestAdminChangeStatus() + case .startedEnterpriseAdminSession: + return DBXTeamLogEventTypeArgStartedEnterpriseAdminSession() + case .teamMergeRequestAccepted: + return DBXTeamLogEventTypeArgTeamMergeRequestAccepted() + case .teamMergeRequestAcceptedShownToPrimaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToPrimaryTeam() + case .teamMergeRequestAcceptedShownToSecondaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToSecondaryTeam() + case .teamMergeRequestAutoCanceled: + return DBXTeamLogEventTypeArgTeamMergeRequestAutoCanceled() + case .teamMergeRequestCanceled: + return DBXTeamLogEventTypeArgTeamMergeRequestCanceled() + case .teamMergeRequestCanceledShownToPrimaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToPrimaryTeam() + case .teamMergeRequestCanceledShownToSecondaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToSecondaryTeam() + case .teamMergeRequestExpired: + return DBXTeamLogEventTypeArgTeamMergeRequestExpired() + case .teamMergeRequestExpiredShownToPrimaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToPrimaryTeam() + case .teamMergeRequestExpiredShownToSecondaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToSecondaryTeam() + case .teamMergeRequestRejectedShownToPrimaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToPrimaryTeam() + case .teamMergeRequestRejectedShownToSecondaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToSecondaryTeam() + case .teamMergeRequestReminder: + return DBXTeamLogEventTypeArgTeamMergeRequestReminder() + case .teamMergeRequestReminderShownToPrimaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToPrimaryTeam() + case .teamMergeRequestReminderShownToSecondaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToSecondaryTeam() + case .teamMergeRequestRevoked: + return DBXTeamLogEventTypeArgTeamMergeRequestRevoked() + case .teamMergeRequestSentShownToPrimaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestSentShownToPrimaryTeam() + case .teamMergeRequestSentShownToSecondaryTeam: + return DBXTeamLogEventTypeArgTeamMergeRequestSentShownToSecondaryTeam() + case .other: + return DBXTeamLogEventTypeArgOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdminAlertingAlertStateChanged: DBXTeamLogEventTypeArgAdminAlertingAlertStateChanged? { + self as? DBXTeamLogEventTypeArgAdminAlertingAlertStateChanged + } + + @objc + public var asAdminAlertingChangedAlertConfig: DBXTeamLogEventTypeArgAdminAlertingChangedAlertConfig? { + self as? DBXTeamLogEventTypeArgAdminAlertingChangedAlertConfig + } + + @objc + public var asAdminAlertingTriggeredAlert: DBXTeamLogEventTypeArgAdminAlertingTriggeredAlert? { + self as? DBXTeamLogEventTypeArgAdminAlertingTriggeredAlert + } + + @objc + public var asRansomwareRestoreProcessCompleted: DBXTeamLogEventTypeArgRansomwareRestoreProcessCompleted? { + self as? DBXTeamLogEventTypeArgRansomwareRestoreProcessCompleted + } + + @objc + public var asRansomwareRestoreProcessStarted: DBXTeamLogEventTypeArgRansomwareRestoreProcessStarted? { + self as? DBXTeamLogEventTypeArgRansomwareRestoreProcessStarted + } + + @objc + public var asAppBlockedByPermissions: DBXTeamLogEventTypeArgAppBlockedByPermissions? { + self as? DBXTeamLogEventTypeArgAppBlockedByPermissions + } + + @objc + public var asAppLinkTeam: DBXTeamLogEventTypeArgAppLinkTeam? { + self as? DBXTeamLogEventTypeArgAppLinkTeam + } + + @objc + public var asAppLinkUser: DBXTeamLogEventTypeArgAppLinkUser? { + self as? DBXTeamLogEventTypeArgAppLinkUser + } + + @objc + public var asAppUnlinkTeam: DBXTeamLogEventTypeArgAppUnlinkTeam? { + self as? DBXTeamLogEventTypeArgAppUnlinkTeam + } + + @objc + public var asAppUnlinkUser: DBXTeamLogEventTypeArgAppUnlinkUser? { + self as? DBXTeamLogEventTypeArgAppUnlinkUser + } + + @objc + public var asIntegrationConnected: DBXTeamLogEventTypeArgIntegrationConnected? { + self as? DBXTeamLogEventTypeArgIntegrationConnected + } + + @objc + public var asIntegrationDisconnected: DBXTeamLogEventTypeArgIntegrationDisconnected? { + self as? DBXTeamLogEventTypeArgIntegrationDisconnected + } + + @objc + public var asFileAddComment: DBXTeamLogEventTypeArgFileAddComment? { + self as? DBXTeamLogEventTypeArgFileAddComment + } + + @objc + public var asFileChangeCommentSubscription: DBXTeamLogEventTypeArgFileChangeCommentSubscription? { + self as? DBXTeamLogEventTypeArgFileChangeCommentSubscription + } + + @objc + public var asFileDeleteComment: DBXTeamLogEventTypeArgFileDeleteComment? { + self as? DBXTeamLogEventTypeArgFileDeleteComment + } + + @objc + public var asFileEditComment: DBXTeamLogEventTypeArgFileEditComment? { + self as? DBXTeamLogEventTypeArgFileEditComment + } + + @objc + public var asFileLikeComment: DBXTeamLogEventTypeArgFileLikeComment? { + self as? DBXTeamLogEventTypeArgFileLikeComment + } + + @objc + public var asFileResolveComment: DBXTeamLogEventTypeArgFileResolveComment? { + self as? DBXTeamLogEventTypeArgFileResolveComment + } + + @objc + public var asFileUnlikeComment: DBXTeamLogEventTypeArgFileUnlikeComment? { + self as? DBXTeamLogEventTypeArgFileUnlikeComment + } + + @objc + public var asFileUnresolveComment: DBXTeamLogEventTypeArgFileUnresolveComment? { + self as? DBXTeamLogEventTypeArgFileUnresolveComment + } + + @objc + public var asGovernancePolicyAddFolders: DBXTeamLogEventTypeArgGovernancePolicyAddFolders? { + self as? DBXTeamLogEventTypeArgGovernancePolicyAddFolders + } + + @objc + public var asGovernancePolicyAddFolderFailed: DBXTeamLogEventTypeArgGovernancePolicyAddFolderFailed? { + self as? DBXTeamLogEventTypeArgGovernancePolicyAddFolderFailed + } + + @objc + public var asGovernancePolicyContentDisposed: DBXTeamLogEventTypeArgGovernancePolicyContentDisposed? { + self as? DBXTeamLogEventTypeArgGovernancePolicyContentDisposed + } + + @objc + public var asGovernancePolicyCreate: DBXTeamLogEventTypeArgGovernancePolicyCreate? { + self as? DBXTeamLogEventTypeArgGovernancePolicyCreate + } + + @objc + public var asGovernancePolicyDelete: DBXTeamLogEventTypeArgGovernancePolicyDelete? { + self as? DBXTeamLogEventTypeArgGovernancePolicyDelete + } + + @objc + public var asGovernancePolicyEditDetails: DBXTeamLogEventTypeArgGovernancePolicyEditDetails? { + self as? DBXTeamLogEventTypeArgGovernancePolicyEditDetails + } + + @objc + public var asGovernancePolicyEditDuration: DBXTeamLogEventTypeArgGovernancePolicyEditDuration? { + self as? DBXTeamLogEventTypeArgGovernancePolicyEditDuration + } + + @objc + public var asGovernancePolicyExportCreated: DBXTeamLogEventTypeArgGovernancePolicyExportCreated? { + self as? DBXTeamLogEventTypeArgGovernancePolicyExportCreated + } + + @objc + public var asGovernancePolicyExportRemoved: DBXTeamLogEventTypeArgGovernancePolicyExportRemoved? { + self as? DBXTeamLogEventTypeArgGovernancePolicyExportRemoved + } + + @objc + public var asGovernancePolicyRemoveFolders: DBXTeamLogEventTypeArgGovernancePolicyRemoveFolders? { + self as? DBXTeamLogEventTypeArgGovernancePolicyRemoveFolders + } + + @objc + public var asGovernancePolicyReportCreated: DBXTeamLogEventTypeArgGovernancePolicyReportCreated? { + self as? DBXTeamLogEventTypeArgGovernancePolicyReportCreated + } + + @objc + public var asGovernancePolicyZipPartDownloaded: DBXTeamLogEventTypeArgGovernancePolicyZipPartDownloaded? { + self as? DBXTeamLogEventTypeArgGovernancePolicyZipPartDownloaded + } + + @objc + public var asLegalHoldsActivateAHold: DBXTeamLogEventTypeArgLegalHoldsActivateAHold? { + self as? DBXTeamLogEventTypeArgLegalHoldsActivateAHold + } + + @objc + public var asLegalHoldsAddMembers: DBXTeamLogEventTypeArgLegalHoldsAddMembers? { + self as? DBXTeamLogEventTypeArgLegalHoldsAddMembers + } + + @objc + public var asLegalHoldsChangeHoldDetails: DBXTeamLogEventTypeArgLegalHoldsChangeHoldDetails? { + self as? DBXTeamLogEventTypeArgLegalHoldsChangeHoldDetails + } + + @objc + public var asLegalHoldsChangeHoldName: DBXTeamLogEventTypeArgLegalHoldsChangeHoldName? { + self as? DBXTeamLogEventTypeArgLegalHoldsChangeHoldName + } + + @objc + public var asLegalHoldsExportAHold: DBXTeamLogEventTypeArgLegalHoldsExportAHold? { + self as? DBXTeamLogEventTypeArgLegalHoldsExportAHold + } + + @objc + public var asLegalHoldsExportCancelled: DBXTeamLogEventTypeArgLegalHoldsExportCancelled? { + self as? DBXTeamLogEventTypeArgLegalHoldsExportCancelled + } + + @objc + public var asLegalHoldsExportDownloaded: DBXTeamLogEventTypeArgLegalHoldsExportDownloaded? { + self as? DBXTeamLogEventTypeArgLegalHoldsExportDownloaded + } + + @objc + public var asLegalHoldsExportRemoved: DBXTeamLogEventTypeArgLegalHoldsExportRemoved? { + self as? DBXTeamLogEventTypeArgLegalHoldsExportRemoved + } + + @objc + public var asLegalHoldsReleaseAHold: DBXTeamLogEventTypeArgLegalHoldsReleaseAHold? { + self as? DBXTeamLogEventTypeArgLegalHoldsReleaseAHold + } + + @objc + public var asLegalHoldsRemoveMembers: DBXTeamLogEventTypeArgLegalHoldsRemoveMembers? { + self as? DBXTeamLogEventTypeArgLegalHoldsRemoveMembers + } + + @objc + public var asLegalHoldsReportAHold: DBXTeamLogEventTypeArgLegalHoldsReportAHold? { + self as? DBXTeamLogEventTypeArgLegalHoldsReportAHold + } + + @objc + public var asDeviceChangeIpDesktop: DBXTeamLogEventTypeArgDeviceChangeIpDesktop? { + self as? DBXTeamLogEventTypeArgDeviceChangeIpDesktop + } + + @objc + public var asDeviceChangeIpMobile: DBXTeamLogEventTypeArgDeviceChangeIpMobile? { + self as? DBXTeamLogEventTypeArgDeviceChangeIpMobile + } + + @objc + public var asDeviceChangeIpWeb: DBXTeamLogEventTypeArgDeviceChangeIpWeb? { + self as? DBXTeamLogEventTypeArgDeviceChangeIpWeb + } + + @objc + public var asDeviceDeleteOnUnlinkFail: DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkFail? { + self as? DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkFail + } + + @objc + public var asDeviceDeleteOnUnlinkSuccess: DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkSuccess? { + self as? DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkSuccess + } + + @objc + public var asDeviceLinkFail: DBXTeamLogEventTypeArgDeviceLinkFail? { + self as? DBXTeamLogEventTypeArgDeviceLinkFail + } + + @objc + public var asDeviceLinkSuccess: DBXTeamLogEventTypeArgDeviceLinkSuccess? { + self as? DBXTeamLogEventTypeArgDeviceLinkSuccess + } + + @objc + public var asDeviceManagementDisabled: DBXTeamLogEventTypeArgDeviceManagementDisabled? { + self as? DBXTeamLogEventTypeArgDeviceManagementDisabled + } + + @objc + public var asDeviceManagementEnabled: DBXTeamLogEventTypeArgDeviceManagementEnabled? { + self as? DBXTeamLogEventTypeArgDeviceManagementEnabled + } + + @objc + public var asDeviceSyncBackupStatusChanged: DBXTeamLogEventTypeArgDeviceSyncBackupStatusChanged? { + self as? DBXTeamLogEventTypeArgDeviceSyncBackupStatusChanged + } + + @objc + public var asDeviceUnlink: DBXTeamLogEventTypeArgDeviceUnlink? { + self as? DBXTeamLogEventTypeArgDeviceUnlink + } + + @objc + public var asDropboxPasswordsExported: DBXTeamLogEventTypeArgDropboxPasswordsExported? { + self as? DBXTeamLogEventTypeArgDropboxPasswordsExported + } + + @objc + public var asDropboxPasswordsNewDeviceEnrolled: DBXTeamLogEventTypeArgDropboxPasswordsNewDeviceEnrolled? { + self as? DBXTeamLogEventTypeArgDropboxPasswordsNewDeviceEnrolled + } + + @objc + public var asEmmRefreshAuthToken: DBXTeamLogEventTypeArgEmmRefreshAuthToken? { + self as? DBXTeamLogEventTypeArgEmmRefreshAuthToken + } + + @objc + public var asExternalDriveBackupEligibilityStatusChecked: DBXTeamLogEventTypeArgExternalDriveBackupEligibilityStatusChecked? { + self as? DBXTeamLogEventTypeArgExternalDriveBackupEligibilityStatusChecked + } + + @objc + public var asExternalDriveBackupStatusChanged: DBXTeamLogEventTypeArgExternalDriveBackupStatusChanged? { + self as? DBXTeamLogEventTypeArgExternalDriveBackupStatusChanged + } + + @objc + public var asAccountCaptureChangeAvailability: DBXTeamLogEventTypeArgAccountCaptureChangeAvailability? { + self as? DBXTeamLogEventTypeArgAccountCaptureChangeAvailability + } + + @objc + public var asAccountCaptureMigrateAccount: DBXTeamLogEventTypeArgAccountCaptureMigrateAccount? { + self as? DBXTeamLogEventTypeArgAccountCaptureMigrateAccount + } + + @objc + public var asAccountCaptureNotificationEmailsSent: DBXTeamLogEventTypeArgAccountCaptureNotificationEmailsSent? { + self as? DBXTeamLogEventTypeArgAccountCaptureNotificationEmailsSent + } + + @objc + public var asAccountCaptureRelinquishAccount: DBXTeamLogEventTypeArgAccountCaptureRelinquishAccount? { + self as? DBXTeamLogEventTypeArgAccountCaptureRelinquishAccount + } + + @objc + public var asDisabledDomainInvites: DBXTeamLogEventTypeArgDisabledDomainInvites? { + self as? DBXTeamLogEventTypeArgDisabledDomainInvites + } + + @objc + public var asDomainInvitesApproveRequestToJoinTeam: DBXTeamLogEventTypeArgDomainInvitesApproveRequestToJoinTeam? { + self as? DBXTeamLogEventTypeArgDomainInvitesApproveRequestToJoinTeam + } + + @objc + public var asDomainInvitesDeclineRequestToJoinTeam: DBXTeamLogEventTypeArgDomainInvitesDeclineRequestToJoinTeam? { + self as? DBXTeamLogEventTypeArgDomainInvitesDeclineRequestToJoinTeam + } + + @objc + public var asDomainInvitesEmailExistingUsers: DBXTeamLogEventTypeArgDomainInvitesEmailExistingUsers? { + self as? DBXTeamLogEventTypeArgDomainInvitesEmailExistingUsers + } + + @objc + public var asDomainInvitesRequestToJoinTeam: DBXTeamLogEventTypeArgDomainInvitesRequestToJoinTeam? { + self as? DBXTeamLogEventTypeArgDomainInvitesRequestToJoinTeam + } + + @objc + public var asDomainInvitesSetInviteNewUserPrefToNo: DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToNo? { + self as? DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToNo + } + + @objc + public var asDomainInvitesSetInviteNewUserPrefToYes: DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToYes? { + self as? DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToYes + } + + @objc + public var asDomainVerificationAddDomainFail: DBXTeamLogEventTypeArgDomainVerificationAddDomainFail? { + self as? DBXTeamLogEventTypeArgDomainVerificationAddDomainFail + } + + @objc + public var asDomainVerificationAddDomainSuccess: DBXTeamLogEventTypeArgDomainVerificationAddDomainSuccess? { + self as? DBXTeamLogEventTypeArgDomainVerificationAddDomainSuccess + } + + @objc + public var asDomainVerificationRemoveDomain: DBXTeamLogEventTypeArgDomainVerificationRemoveDomain? { + self as? DBXTeamLogEventTypeArgDomainVerificationRemoveDomain + } + + @objc + public var asEnabledDomainInvites: DBXTeamLogEventTypeArgEnabledDomainInvites? { + self as? DBXTeamLogEventTypeArgEnabledDomainInvites + } + + @objc + public var asTeamEncryptionKeyCancelKeyDeletion: DBXTeamLogEventTypeArgTeamEncryptionKeyCancelKeyDeletion? { + self as? DBXTeamLogEventTypeArgTeamEncryptionKeyCancelKeyDeletion + } + + @objc + public var asTeamEncryptionKeyCreateKey: DBXTeamLogEventTypeArgTeamEncryptionKeyCreateKey? { + self as? DBXTeamLogEventTypeArgTeamEncryptionKeyCreateKey + } + + @objc + public var asTeamEncryptionKeyDeleteKey: DBXTeamLogEventTypeArgTeamEncryptionKeyDeleteKey? { + self as? DBXTeamLogEventTypeArgTeamEncryptionKeyDeleteKey + } + + @objc + public var asTeamEncryptionKeyDisableKey: DBXTeamLogEventTypeArgTeamEncryptionKeyDisableKey? { + self as? DBXTeamLogEventTypeArgTeamEncryptionKeyDisableKey + } + + @objc + public var asTeamEncryptionKeyEnableKey: DBXTeamLogEventTypeArgTeamEncryptionKeyEnableKey? { + self as? DBXTeamLogEventTypeArgTeamEncryptionKeyEnableKey + } + + @objc + public var asTeamEncryptionKeyRotateKey: DBXTeamLogEventTypeArgTeamEncryptionKeyRotateKey? { + self as? DBXTeamLogEventTypeArgTeamEncryptionKeyRotateKey + } + + @objc + public var asTeamEncryptionKeyScheduleKeyDeletion: DBXTeamLogEventTypeArgTeamEncryptionKeyScheduleKeyDeletion? { + self as? DBXTeamLogEventTypeArgTeamEncryptionKeyScheduleKeyDeletion + } + + @objc + public var asApplyNamingConvention: DBXTeamLogEventTypeArgApplyNamingConvention? { + self as? DBXTeamLogEventTypeArgApplyNamingConvention + } + + @objc + public var asCreateFolder: DBXTeamLogEventTypeArgCreateFolder? { + self as? DBXTeamLogEventTypeArgCreateFolder + } + + @objc + public var asFileAdd: DBXTeamLogEventTypeArgFileAdd? { + self as? DBXTeamLogEventTypeArgFileAdd + } + + @objc + public var asFileAddFromAutomation: DBXTeamLogEventTypeArgFileAddFromAutomation? { + self as? DBXTeamLogEventTypeArgFileAddFromAutomation + } + + @objc + public var asFileCopy: DBXTeamLogEventTypeArgFileCopy? { + self as? DBXTeamLogEventTypeArgFileCopy + } + + @objc + public var asFileDelete: DBXTeamLogEventTypeArgFileDelete? { + self as? DBXTeamLogEventTypeArgFileDelete + } + + @objc + public var asFileDownload: DBXTeamLogEventTypeArgFileDownload? { + self as? DBXTeamLogEventTypeArgFileDownload + } + + @objc + public var asFileEdit: DBXTeamLogEventTypeArgFileEdit? { + self as? DBXTeamLogEventTypeArgFileEdit + } + + @objc + public var asFileGetCopyReference: DBXTeamLogEventTypeArgFileGetCopyReference? { + self as? DBXTeamLogEventTypeArgFileGetCopyReference + } + + @objc + public var asFileLockingLockStatusChanged: DBXTeamLogEventTypeArgFileLockingLockStatusChanged? { + self as? DBXTeamLogEventTypeArgFileLockingLockStatusChanged + } + + @objc + public var asFileMove: DBXTeamLogEventTypeArgFileMove? { + self as? DBXTeamLogEventTypeArgFileMove + } + + @objc + public var asFilePermanentlyDelete: DBXTeamLogEventTypeArgFilePermanentlyDelete? { + self as? DBXTeamLogEventTypeArgFilePermanentlyDelete + } + + @objc + public var asFilePreview: DBXTeamLogEventTypeArgFilePreview? { + self as? DBXTeamLogEventTypeArgFilePreview + } + + @objc + public var asFileRename: DBXTeamLogEventTypeArgFileRename? { + self as? DBXTeamLogEventTypeArgFileRename + } + + @objc + public var asFileRestore: DBXTeamLogEventTypeArgFileRestore? { + self as? DBXTeamLogEventTypeArgFileRestore + } + + @objc + public var asFileRevert: DBXTeamLogEventTypeArgFileRevert? { + self as? DBXTeamLogEventTypeArgFileRevert + } + + @objc + public var asFileRollbackChanges: DBXTeamLogEventTypeArgFileRollbackChanges? { + self as? DBXTeamLogEventTypeArgFileRollbackChanges + } + + @objc + public var asFileSaveCopyReference: DBXTeamLogEventTypeArgFileSaveCopyReference? { + self as? DBXTeamLogEventTypeArgFileSaveCopyReference + } + + @objc + public var asFolderOverviewDescriptionChanged: DBXTeamLogEventTypeArgFolderOverviewDescriptionChanged? { + self as? DBXTeamLogEventTypeArgFolderOverviewDescriptionChanged + } + + @objc + public var asFolderOverviewItemPinned: DBXTeamLogEventTypeArgFolderOverviewItemPinned? { + self as? DBXTeamLogEventTypeArgFolderOverviewItemPinned + } + + @objc + public var asFolderOverviewItemUnpinned: DBXTeamLogEventTypeArgFolderOverviewItemUnpinned? { + self as? DBXTeamLogEventTypeArgFolderOverviewItemUnpinned + } + + @objc + public var asObjectLabelAdded: DBXTeamLogEventTypeArgObjectLabelAdded? { + self as? DBXTeamLogEventTypeArgObjectLabelAdded + } + + @objc + public var asObjectLabelRemoved: DBXTeamLogEventTypeArgObjectLabelRemoved? { + self as? DBXTeamLogEventTypeArgObjectLabelRemoved + } + + @objc + public var asObjectLabelUpdatedValue: DBXTeamLogEventTypeArgObjectLabelUpdatedValue? { + self as? DBXTeamLogEventTypeArgObjectLabelUpdatedValue + } + + @objc + public var asOrganizeFolderWithTidy: DBXTeamLogEventTypeArgOrganizeFolderWithTidy? { + self as? DBXTeamLogEventTypeArgOrganizeFolderWithTidy + } + + @objc + public var asReplayFileDelete: DBXTeamLogEventTypeArgReplayFileDelete? { + self as? DBXTeamLogEventTypeArgReplayFileDelete + } + + @objc + public var asRewindFolder: DBXTeamLogEventTypeArgRewindFolder? { + self as? DBXTeamLogEventTypeArgRewindFolder + } + + @objc + public var asUndoNamingConvention: DBXTeamLogEventTypeArgUndoNamingConvention? { + self as? DBXTeamLogEventTypeArgUndoNamingConvention + } + + @objc + public var asUndoOrganizeFolderWithTidy: DBXTeamLogEventTypeArgUndoOrganizeFolderWithTidy? { + self as? DBXTeamLogEventTypeArgUndoOrganizeFolderWithTidy + } + + @objc + public var asUserTagsAdded: DBXTeamLogEventTypeArgUserTagsAdded? { + self as? DBXTeamLogEventTypeArgUserTagsAdded + } + + @objc + public var asUserTagsRemoved: DBXTeamLogEventTypeArgUserTagsRemoved? { + self as? DBXTeamLogEventTypeArgUserTagsRemoved + } + + @objc + public var asEmailIngestReceiveFile: DBXTeamLogEventTypeArgEmailIngestReceiveFile? { + self as? DBXTeamLogEventTypeArgEmailIngestReceiveFile + } + + @objc + public var asFileRequestChange: DBXTeamLogEventTypeArgFileRequestChange? { + self as? DBXTeamLogEventTypeArgFileRequestChange + } + + @objc + public var asFileRequestClose: DBXTeamLogEventTypeArgFileRequestClose? { + self as? DBXTeamLogEventTypeArgFileRequestClose + } + + @objc + public var asFileRequestCreate: DBXTeamLogEventTypeArgFileRequestCreate? { + self as? DBXTeamLogEventTypeArgFileRequestCreate + } + + @objc + public var asFileRequestDelete: DBXTeamLogEventTypeArgFileRequestDelete? { + self as? DBXTeamLogEventTypeArgFileRequestDelete + } + + @objc + public var asFileRequestReceiveFile: DBXTeamLogEventTypeArgFileRequestReceiveFile? { + self as? DBXTeamLogEventTypeArgFileRequestReceiveFile + } + + @objc + public var asGroupAddExternalId: DBXTeamLogEventTypeArgGroupAddExternalId? { + self as? DBXTeamLogEventTypeArgGroupAddExternalId + } + + @objc + public var asGroupAddMember: DBXTeamLogEventTypeArgGroupAddMember? { + self as? DBXTeamLogEventTypeArgGroupAddMember + } + + @objc + public var asGroupChangeExternalId: DBXTeamLogEventTypeArgGroupChangeExternalId? { + self as? DBXTeamLogEventTypeArgGroupChangeExternalId + } + + @objc + public var asGroupChangeManagementType: DBXTeamLogEventTypeArgGroupChangeManagementType? { + self as? DBXTeamLogEventTypeArgGroupChangeManagementType + } + + @objc + public var asGroupChangeMemberRole: DBXTeamLogEventTypeArgGroupChangeMemberRole? { + self as? DBXTeamLogEventTypeArgGroupChangeMemberRole + } + + @objc + public var asGroupCreate: DBXTeamLogEventTypeArgGroupCreate? { + self as? DBXTeamLogEventTypeArgGroupCreate + } + + @objc + public var asGroupDelete: DBXTeamLogEventTypeArgGroupDelete? { + self as? DBXTeamLogEventTypeArgGroupDelete + } + + @objc + public var asGroupDescriptionUpdated: DBXTeamLogEventTypeArgGroupDescriptionUpdated? { + self as? DBXTeamLogEventTypeArgGroupDescriptionUpdated + } + + @objc + public var asGroupJoinPolicyUpdated: DBXTeamLogEventTypeArgGroupJoinPolicyUpdated? { + self as? DBXTeamLogEventTypeArgGroupJoinPolicyUpdated + } + + @objc + public var asGroupMoved: DBXTeamLogEventTypeArgGroupMoved? { + self as? DBXTeamLogEventTypeArgGroupMoved + } + + @objc + public var asGroupRemoveExternalId: DBXTeamLogEventTypeArgGroupRemoveExternalId? { + self as? DBXTeamLogEventTypeArgGroupRemoveExternalId + } + + @objc + public var asGroupRemoveMember: DBXTeamLogEventTypeArgGroupRemoveMember? { + self as? DBXTeamLogEventTypeArgGroupRemoveMember + } + + @objc + public var asGroupRename: DBXTeamLogEventTypeArgGroupRename? { + self as? DBXTeamLogEventTypeArgGroupRename + } + + @objc + public var asAccountLockOrUnlocked: DBXTeamLogEventTypeArgAccountLockOrUnlocked? { + self as? DBXTeamLogEventTypeArgAccountLockOrUnlocked + } + + @objc + public var asEmmError: DBXTeamLogEventTypeArgEmmError? { + self as? DBXTeamLogEventTypeArgEmmError + } + + @objc + public var asGuestAdminSignedInViaTrustedTeams: DBXTeamLogEventTypeArgGuestAdminSignedInViaTrustedTeams? { + self as? DBXTeamLogEventTypeArgGuestAdminSignedInViaTrustedTeams + } + + @objc + public var asGuestAdminSignedOutViaTrustedTeams: DBXTeamLogEventTypeArgGuestAdminSignedOutViaTrustedTeams? { + self as? DBXTeamLogEventTypeArgGuestAdminSignedOutViaTrustedTeams + } + + @objc + public var asLoginFail: DBXTeamLogEventTypeArgLoginFail? { + self as? DBXTeamLogEventTypeArgLoginFail + } + + @objc + public var asLoginSuccess: DBXTeamLogEventTypeArgLoginSuccess? { + self as? DBXTeamLogEventTypeArgLoginSuccess + } + + @objc + public var asLogout: DBXTeamLogEventTypeArgLogout? { + self as? DBXTeamLogEventTypeArgLogout + } + + @objc + public var asResellerSupportSessionEnd: DBXTeamLogEventTypeArgResellerSupportSessionEnd? { + self as? DBXTeamLogEventTypeArgResellerSupportSessionEnd + } + + @objc + public var asResellerSupportSessionStart: DBXTeamLogEventTypeArgResellerSupportSessionStart? { + self as? DBXTeamLogEventTypeArgResellerSupportSessionStart + } + + @objc + public var asSignInAsSessionEnd: DBXTeamLogEventTypeArgSignInAsSessionEnd? { + self as? DBXTeamLogEventTypeArgSignInAsSessionEnd + } + + @objc + public var asSignInAsSessionStart: DBXTeamLogEventTypeArgSignInAsSessionStart? { + self as? DBXTeamLogEventTypeArgSignInAsSessionStart + } + + @objc + public var asSsoError: DBXTeamLogEventTypeArgSsoError? { + self as? DBXTeamLogEventTypeArgSsoError + } + + @objc + public var asBackupAdminInvitationSent: DBXTeamLogEventTypeArgBackupAdminInvitationSent? { + self as? DBXTeamLogEventTypeArgBackupAdminInvitationSent + } + + @objc + public var asBackupInvitationOpened: DBXTeamLogEventTypeArgBackupInvitationOpened? { + self as? DBXTeamLogEventTypeArgBackupInvitationOpened + } + + @objc + public var asCreateTeamInviteLink: DBXTeamLogEventTypeArgCreateTeamInviteLink? { + self as? DBXTeamLogEventTypeArgCreateTeamInviteLink + } + + @objc + public var asDeleteTeamInviteLink: DBXTeamLogEventTypeArgDeleteTeamInviteLink? { + self as? DBXTeamLogEventTypeArgDeleteTeamInviteLink + } + + @objc + public var asMemberAddExternalId: DBXTeamLogEventTypeArgMemberAddExternalId? { + self as? DBXTeamLogEventTypeArgMemberAddExternalId + } + + @objc + public var asMemberAddName: DBXTeamLogEventTypeArgMemberAddName? { + self as? DBXTeamLogEventTypeArgMemberAddName + } + + @objc + public var asMemberChangeAdminRole: DBXTeamLogEventTypeArgMemberChangeAdminRole? { + self as? DBXTeamLogEventTypeArgMemberChangeAdminRole + } + + @objc + public var asMemberChangeEmail: DBXTeamLogEventTypeArgMemberChangeEmail? { + self as? DBXTeamLogEventTypeArgMemberChangeEmail + } + + @objc + public var asMemberChangeExternalId: DBXTeamLogEventTypeArgMemberChangeExternalId? { + self as? DBXTeamLogEventTypeArgMemberChangeExternalId + } + + @objc + public var asMemberChangeMembershipType: DBXTeamLogEventTypeArgMemberChangeMembershipType? { + self as? DBXTeamLogEventTypeArgMemberChangeMembershipType + } + + @objc + public var asMemberChangeName: DBXTeamLogEventTypeArgMemberChangeName? { + self as? DBXTeamLogEventTypeArgMemberChangeName + } + + @objc + public var asMemberChangeResellerRole: DBXTeamLogEventTypeArgMemberChangeResellerRole? { + self as? DBXTeamLogEventTypeArgMemberChangeResellerRole + } + + @objc + public var asMemberChangeStatus: DBXTeamLogEventTypeArgMemberChangeStatus? { + self as? DBXTeamLogEventTypeArgMemberChangeStatus + } + + @objc + public var asMemberDeleteManualContacts: DBXTeamLogEventTypeArgMemberDeleteManualContacts? { + self as? DBXTeamLogEventTypeArgMemberDeleteManualContacts + } + + @objc + public var asMemberDeleteProfilePhoto: DBXTeamLogEventTypeArgMemberDeleteProfilePhoto? { + self as? DBXTeamLogEventTypeArgMemberDeleteProfilePhoto + } + + @objc + public var asMemberPermanentlyDeleteAccountContents: DBXTeamLogEventTypeArgMemberPermanentlyDeleteAccountContents? { + self as? DBXTeamLogEventTypeArgMemberPermanentlyDeleteAccountContents + } + + @objc + public var asMemberRemoveExternalId: DBXTeamLogEventTypeArgMemberRemoveExternalId? { + self as? DBXTeamLogEventTypeArgMemberRemoveExternalId + } + + @objc + public var asMemberSetProfilePhoto: DBXTeamLogEventTypeArgMemberSetProfilePhoto? { + self as? DBXTeamLogEventTypeArgMemberSetProfilePhoto + } + + @objc + public var asMemberSpaceLimitsAddCustomQuota: DBXTeamLogEventTypeArgMemberSpaceLimitsAddCustomQuota? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsAddCustomQuota + } + + @objc + public var asMemberSpaceLimitsChangeCustomQuota: DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCustomQuota? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCustomQuota + } + + @objc + public var asMemberSpaceLimitsChangeStatus: DBXTeamLogEventTypeArgMemberSpaceLimitsChangeStatus? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsChangeStatus + } + + @objc + public var asMemberSpaceLimitsRemoveCustomQuota: DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveCustomQuota? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveCustomQuota + } + + @objc + public var asMemberSuggest: DBXTeamLogEventTypeArgMemberSuggest? { + self as? DBXTeamLogEventTypeArgMemberSuggest + } + + @objc + public var asMemberTransferAccountContents: DBXTeamLogEventTypeArgMemberTransferAccountContents? { + self as? DBXTeamLogEventTypeArgMemberTransferAccountContents + } + + @objc + public var asPendingSecondaryEmailAdded: DBXTeamLogEventTypeArgPendingSecondaryEmailAdded? { + self as? DBXTeamLogEventTypeArgPendingSecondaryEmailAdded + } + + @objc + public var asSecondaryEmailDeleted: DBXTeamLogEventTypeArgSecondaryEmailDeleted? { + self as? DBXTeamLogEventTypeArgSecondaryEmailDeleted + } + + @objc + public var asSecondaryEmailVerified: DBXTeamLogEventTypeArgSecondaryEmailVerified? { + self as? DBXTeamLogEventTypeArgSecondaryEmailVerified + } + + @objc + public var asSecondaryMailsPolicyChanged: DBXTeamLogEventTypeArgSecondaryMailsPolicyChanged? { + self as? DBXTeamLogEventTypeArgSecondaryMailsPolicyChanged + } + + @objc + public var asBinderAddPage: DBXTeamLogEventTypeArgBinderAddPage? { + self as? DBXTeamLogEventTypeArgBinderAddPage + } + + @objc + public var asBinderAddSection: DBXTeamLogEventTypeArgBinderAddSection? { + self as? DBXTeamLogEventTypeArgBinderAddSection + } + + @objc + public var asBinderRemovePage: DBXTeamLogEventTypeArgBinderRemovePage? { + self as? DBXTeamLogEventTypeArgBinderRemovePage + } + + @objc + public var asBinderRemoveSection: DBXTeamLogEventTypeArgBinderRemoveSection? { + self as? DBXTeamLogEventTypeArgBinderRemoveSection + } + + @objc + public var asBinderRenamePage: DBXTeamLogEventTypeArgBinderRenamePage? { + self as? DBXTeamLogEventTypeArgBinderRenamePage + } + + @objc + public var asBinderRenameSection: DBXTeamLogEventTypeArgBinderRenameSection? { + self as? DBXTeamLogEventTypeArgBinderRenameSection + } + + @objc + public var asBinderReorderPage: DBXTeamLogEventTypeArgBinderReorderPage? { + self as? DBXTeamLogEventTypeArgBinderReorderPage + } + + @objc + public var asBinderReorderSection: DBXTeamLogEventTypeArgBinderReorderSection? { + self as? DBXTeamLogEventTypeArgBinderReorderSection + } + + @objc + public var asPaperContentAddMember: DBXTeamLogEventTypeArgPaperContentAddMember? { + self as? DBXTeamLogEventTypeArgPaperContentAddMember + } + + @objc + public var asPaperContentAddToFolder: DBXTeamLogEventTypeArgPaperContentAddToFolder? { + self as? DBXTeamLogEventTypeArgPaperContentAddToFolder + } + + @objc + public var asPaperContentArchive: DBXTeamLogEventTypeArgPaperContentArchive? { + self as? DBXTeamLogEventTypeArgPaperContentArchive + } + + @objc + public var asPaperContentCreate: DBXTeamLogEventTypeArgPaperContentCreate? { + self as? DBXTeamLogEventTypeArgPaperContentCreate + } + + @objc + public var asPaperContentPermanentlyDelete: DBXTeamLogEventTypeArgPaperContentPermanentlyDelete? { + self as? DBXTeamLogEventTypeArgPaperContentPermanentlyDelete + } + + @objc + public var asPaperContentRemoveFromFolder: DBXTeamLogEventTypeArgPaperContentRemoveFromFolder? { + self as? DBXTeamLogEventTypeArgPaperContentRemoveFromFolder + } + + @objc + public var asPaperContentRemoveMember: DBXTeamLogEventTypeArgPaperContentRemoveMember? { + self as? DBXTeamLogEventTypeArgPaperContentRemoveMember + } + + @objc + public var asPaperContentRename: DBXTeamLogEventTypeArgPaperContentRename? { + self as? DBXTeamLogEventTypeArgPaperContentRename + } + + @objc + public var asPaperContentRestore: DBXTeamLogEventTypeArgPaperContentRestore? { + self as? DBXTeamLogEventTypeArgPaperContentRestore + } + + @objc + public var asPaperDocAddComment: DBXTeamLogEventTypeArgPaperDocAddComment? { + self as? DBXTeamLogEventTypeArgPaperDocAddComment + } + + @objc + public var asPaperDocChangeMemberRole: DBXTeamLogEventTypeArgPaperDocChangeMemberRole? { + self as? DBXTeamLogEventTypeArgPaperDocChangeMemberRole + } + + @objc + public var asPaperDocChangeSharingPolicy: DBXTeamLogEventTypeArgPaperDocChangeSharingPolicy? { + self as? DBXTeamLogEventTypeArgPaperDocChangeSharingPolicy + } + + @objc + public var asPaperDocChangeSubscription: DBXTeamLogEventTypeArgPaperDocChangeSubscription? { + self as? DBXTeamLogEventTypeArgPaperDocChangeSubscription + } + + @objc + public var asPaperDocDeleted: DBXTeamLogEventTypeArgPaperDocDeleted? { + self as? DBXTeamLogEventTypeArgPaperDocDeleted + } + + @objc + public var asPaperDocDeleteComment: DBXTeamLogEventTypeArgPaperDocDeleteComment? { + self as? DBXTeamLogEventTypeArgPaperDocDeleteComment + } + + @objc + public var asPaperDocDownload: DBXTeamLogEventTypeArgPaperDocDownload? { + self as? DBXTeamLogEventTypeArgPaperDocDownload + } + + @objc + public var asPaperDocEdit: DBXTeamLogEventTypeArgPaperDocEdit? { + self as? DBXTeamLogEventTypeArgPaperDocEdit + } + + @objc + public var asPaperDocEditComment: DBXTeamLogEventTypeArgPaperDocEditComment? { + self as? DBXTeamLogEventTypeArgPaperDocEditComment + } + + @objc + public var asPaperDocFollowed: DBXTeamLogEventTypeArgPaperDocFollowed? { + self as? DBXTeamLogEventTypeArgPaperDocFollowed + } + + @objc + public var asPaperDocMention: DBXTeamLogEventTypeArgPaperDocMention? { + self as? DBXTeamLogEventTypeArgPaperDocMention + } + + @objc + public var asPaperDocOwnershipChanged: DBXTeamLogEventTypeArgPaperDocOwnershipChanged? { + self as? DBXTeamLogEventTypeArgPaperDocOwnershipChanged + } + + @objc + public var asPaperDocRequestAccess: DBXTeamLogEventTypeArgPaperDocRequestAccess? { + self as? DBXTeamLogEventTypeArgPaperDocRequestAccess + } + + @objc + public var asPaperDocResolveComment: DBXTeamLogEventTypeArgPaperDocResolveComment? { + self as? DBXTeamLogEventTypeArgPaperDocResolveComment + } + + @objc + public var asPaperDocRevert: DBXTeamLogEventTypeArgPaperDocRevert? { + self as? DBXTeamLogEventTypeArgPaperDocRevert + } + + @objc + public var asPaperDocSlackShare: DBXTeamLogEventTypeArgPaperDocSlackShare? { + self as? DBXTeamLogEventTypeArgPaperDocSlackShare + } + + @objc + public var asPaperDocTeamInvite: DBXTeamLogEventTypeArgPaperDocTeamInvite? { + self as? DBXTeamLogEventTypeArgPaperDocTeamInvite + } + + @objc + public var asPaperDocTrashed: DBXTeamLogEventTypeArgPaperDocTrashed? { + self as? DBXTeamLogEventTypeArgPaperDocTrashed + } + + @objc + public var asPaperDocUnresolveComment: DBXTeamLogEventTypeArgPaperDocUnresolveComment? { + self as? DBXTeamLogEventTypeArgPaperDocUnresolveComment + } + + @objc + public var asPaperDocUntrashed: DBXTeamLogEventTypeArgPaperDocUntrashed? { + self as? DBXTeamLogEventTypeArgPaperDocUntrashed + } + + @objc + public var asPaperDocView: DBXTeamLogEventTypeArgPaperDocView? { + self as? DBXTeamLogEventTypeArgPaperDocView + } + + @objc + public var asPaperExternalViewAllow: DBXTeamLogEventTypeArgPaperExternalViewAllow? { + self as? DBXTeamLogEventTypeArgPaperExternalViewAllow + } + + @objc + public var asPaperExternalViewDefaultTeam: DBXTeamLogEventTypeArgPaperExternalViewDefaultTeam? { + self as? DBXTeamLogEventTypeArgPaperExternalViewDefaultTeam + } + + @objc + public var asPaperExternalViewForbid: DBXTeamLogEventTypeArgPaperExternalViewForbid? { + self as? DBXTeamLogEventTypeArgPaperExternalViewForbid + } + + @objc + public var asPaperFolderChangeSubscription: DBXTeamLogEventTypeArgPaperFolderChangeSubscription? { + self as? DBXTeamLogEventTypeArgPaperFolderChangeSubscription + } + + @objc + public var asPaperFolderDeleted: DBXTeamLogEventTypeArgPaperFolderDeleted? { + self as? DBXTeamLogEventTypeArgPaperFolderDeleted + } + + @objc + public var asPaperFolderFollowed: DBXTeamLogEventTypeArgPaperFolderFollowed? { + self as? DBXTeamLogEventTypeArgPaperFolderFollowed + } + + @objc + public var asPaperFolderTeamInvite: DBXTeamLogEventTypeArgPaperFolderTeamInvite? { + self as? DBXTeamLogEventTypeArgPaperFolderTeamInvite + } + + @objc + public var asPaperPublishedLinkChangePermission: DBXTeamLogEventTypeArgPaperPublishedLinkChangePermission? { + self as? DBXTeamLogEventTypeArgPaperPublishedLinkChangePermission + } + + @objc + public var asPaperPublishedLinkCreate: DBXTeamLogEventTypeArgPaperPublishedLinkCreate? { + self as? DBXTeamLogEventTypeArgPaperPublishedLinkCreate + } + + @objc + public var asPaperPublishedLinkDisabled: DBXTeamLogEventTypeArgPaperPublishedLinkDisabled? { + self as? DBXTeamLogEventTypeArgPaperPublishedLinkDisabled + } + + @objc + public var asPaperPublishedLinkView: DBXTeamLogEventTypeArgPaperPublishedLinkView? { + self as? DBXTeamLogEventTypeArgPaperPublishedLinkView + } + + @objc + public var asPasswordChange: DBXTeamLogEventTypeArgPasswordChange? { + self as? DBXTeamLogEventTypeArgPasswordChange + } + + @objc + public var asPasswordReset: DBXTeamLogEventTypeArgPasswordReset? { + self as? DBXTeamLogEventTypeArgPasswordReset + } + + @objc + public var asPasswordResetAll: DBXTeamLogEventTypeArgPasswordResetAll? { + self as? DBXTeamLogEventTypeArgPasswordResetAll + } + + @objc + public var asClassificationCreateReport: DBXTeamLogEventTypeArgClassificationCreateReport? { + self as? DBXTeamLogEventTypeArgClassificationCreateReport + } + + @objc + public var asClassificationCreateReportFail: DBXTeamLogEventTypeArgClassificationCreateReportFail? { + self as? DBXTeamLogEventTypeArgClassificationCreateReportFail + } + + @objc + public var asEmmCreateExceptionsReport: DBXTeamLogEventTypeArgEmmCreateExceptionsReport? { + self as? DBXTeamLogEventTypeArgEmmCreateExceptionsReport + } + + @objc + public var asEmmCreateUsageReport: DBXTeamLogEventTypeArgEmmCreateUsageReport? { + self as? DBXTeamLogEventTypeArgEmmCreateUsageReport + } + + @objc + public var asExportMembersReport: DBXTeamLogEventTypeArgExportMembersReport? { + self as? DBXTeamLogEventTypeArgExportMembersReport + } + + @objc + public var asExportMembersReportFail: DBXTeamLogEventTypeArgExportMembersReportFail? { + self as? DBXTeamLogEventTypeArgExportMembersReportFail + } + + @objc + public var asExternalSharingCreateReport: DBXTeamLogEventTypeArgExternalSharingCreateReport? { + self as? DBXTeamLogEventTypeArgExternalSharingCreateReport + } + + @objc + public var asExternalSharingReportFailed: DBXTeamLogEventTypeArgExternalSharingReportFailed? { + self as? DBXTeamLogEventTypeArgExternalSharingReportFailed + } + + @objc + public var asNoExpirationLinkGenCreateReport: DBXTeamLogEventTypeArgNoExpirationLinkGenCreateReport? { + self as? DBXTeamLogEventTypeArgNoExpirationLinkGenCreateReport + } + + @objc + public var asNoExpirationLinkGenReportFailed: DBXTeamLogEventTypeArgNoExpirationLinkGenReportFailed? { + self as? DBXTeamLogEventTypeArgNoExpirationLinkGenReportFailed + } + + @objc + public var asNoPasswordLinkGenCreateReport: DBXTeamLogEventTypeArgNoPasswordLinkGenCreateReport? { + self as? DBXTeamLogEventTypeArgNoPasswordLinkGenCreateReport + } + + @objc + public var asNoPasswordLinkGenReportFailed: DBXTeamLogEventTypeArgNoPasswordLinkGenReportFailed? { + self as? DBXTeamLogEventTypeArgNoPasswordLinkGenReportFailed + } + + @objc + public var asNoPasswordLinkViewCreateReport: DBXTeamLogEventTypeArgNoPasswordLinkViewCreateReport? { + self as? DBXTeamLogEventTypeArgNoPasswordLinkViewCreateReport + } + + @objc + public var asNoPasswordLinkViewReportFailed: DBXTeamLogEventTypeArgNoPasswordLinkViewReportFailed? { + self as? DBXTeamLogEventTypeArgNoPasswordLinkViewReportFailed + } + + @objc + public var asOutdatedLinkViewCreateReport: DBXTeamLogEventTypeArgOutdatedLinkViewCreateReport? { + self as? DBXTeamLogEventTypeArgOutdatedLinkViewCreateReport + } + + @objc + public var asOutdatedLinkViewReportFailed: DBXTeamLogEventTypeArgOutdatedLinkViewReportFailed? { + self as? DBXTeamLogEventTypeArgOutdatedLinkViewReportFailed + } + + @objc + public var asPaperAdminExportStart: DBXTeamLogEventTypeArgPaperAdminExportStart? { + self as? DBXTeamLogEventTypeArgPaperAdminExportStart + } + + @objc + public var asRansomwareAlertCreateReport: DBXTeamLogEventTypeArgRansomwareAlertCreateReport? { + self as? DBXTeamLogEventTypeArgRansomwareAlertCreateReport + } + + @objc + public var asRansomwareAlertCreateReportFailed: DBXTeamLogEventTypeArgRansomwareAlertCreateReportFailed? { + self as? DBXTeamLogEventTypeArgRansomwareAlertCreateReportFailed + } + + @objc + public var asSmartSyncCreateAdminPrivilegeReport: DBXTeamLogEventTypeArgSmartSyncCreateAdminPrivilegeReport? { + self as? DBXTeamLogEventTypeArgSmartSyncCreateAdminPrivilegeReport + } + + @objc + public var asTeamActivityCreateReport: DBXTeamLogEventTypeArgTeamActivityCreateReport? { + self as? DBXTeamLogEventTypeArgTeamActivityCreateReport + } + + @objc + public var asTeamActivityCreateReportFail: DBXTeamLogEventTypeArgTeamActivityCreateReportFail? { + self as? DBXTeamLogEventTypeArgTeamActivityCreateReportFail + } + + @objc + public var asCollectionShare: DBXTeamLogEventTypeArgCollectionShare? { + self as? DBXTeamLogEventTypeArgCollectionShare + } + + @objc + public var asFileTransfersFileAdd: DBXTeamLogEventTypeArgFileTransfersFileAdd? { + self as? DBXTeamLogEventTypeArgFileTransfersFileAdd + } + + @objc + public var asFileTransfersTransferDelete: DBXTeamLogEventTypeArgFileTransfersTransferDelete? { + self as? DBXTeamLogEventTypeArgFileTransfersTransferDelete + } + + @objc + public var asFileTransfersTransferDownload: DBXTeamLogEventTypeArgFileTransfersTransferDownload? { + self as? DBXTeamLogEventTypeArgFileTransfersTransferDownload + } + + @objc + public var asFileTransfersTransferSend: DBXTeamLogEventTypeArgFileTransfersTransferSend? { + self as? DBXTeamLogEventTypeArgFileTransfersTransferSend + } + + @objc + public var asFileTransfersTransferView: DBXTeamLogEventTypeArgFileTransfersTransferView? { + self as? DBXTeamLogEventTypeArgFileTransfersTransferView + } + + @objc + public var asNoteAclInviteOnly: DBXTeamLogEventTypeArgNoteAclInviteOnly? { + self as? DBXTeamLogEventTypeArgNoteAclInviteOnly + } + + @objc + public var asNoteAclLink: DBXTeamLogEventTypeArgNoteAclLink? { + self as? DBXTeamLogEventTypeArgNoteAclLink + } + + @objc + public var asNoteAclTeamLink: DBXTeamLogEventTypeArgNoteAclTeamLink? { + self as? DBXTeamLogEventTypeArgNoteAclTeamLink + } + + @objc + public var asNoteShared: DBXTeamLogEventTypeArgNoteShared? { + self as? DBXTeamLogEventTypeArgNoteShared + } + + @objc + public var asNoteShareReceive: DBXTeamLogEventTypeArgNoteShareReceive? { + self as? DBXTeamLogEventTypeArgNoteShareReceive + } + + @objc + public var asOpenNoteShared: DBXTeamLogEventTypeArgOpenNoteShared? { + self as? DBXTeamLogEventTypeArgOpenNoteShared + } + + @objc + public var asReplayFileSharedLinkCreated: DBXTeamLogEventTypeArgReplayFileSharedLinkCreated? { + self as? DBXTeamLogEventTypeArgReplayFileSharedLinkCreated + } + + @objc + public var asReplayFileSharedLinkModified: DBXTeamLogEventTypeArgReplayFileSharedLinkModified? { + self as? DBXTeamLogEventTypeArgReplayFileSharedLinkModified + } + + @objc + public var asReplayProjectTeamAdd: DBXTeamLogEventTypeArgReplayProjectTeamAdd? { + self as? DBXTeamLogEventTypeArgReplayProjectTeamAdd + } + + @objc + public var asReplayProjectTeamDelete: DBXTeamLogEventTypeArgReplayProjectTeamDelete? { + self as? DBXTeamLogEventTypeArgReplayProjectTeamDelete + } + + @objc + public var asSfAddGroup: DBXTeamLogEventTypeArgSfAddGroup? { + self as? DBXTeamLogEventTypeArgSfAddGroup + } + + @objc + public var asSfAllowNonMembersToViewSharedLinks: DBXTeamLogEventTypeArgSfAllowNonMembersToViewSharedLinks? { + self as? DBXTeamLogEventTypeArgSfAllowNonMembersToViewSharedLinks + } + + @objc + public var asSfExternalInviteWarn: DBXTeamLogEventTypeArgSfExternalInviteWarn? { + self as? DBXTeamLogEventTypeArgSfExternalInviteWarn + } + + @objc + public var asSfFbInvite: DBXTeamLogEventTypeArgSfFbInvite? { + self as? DBXTeamLogEventTypeArgSfFbInvite + } + + @objc + public var asSfFbInviteChangeRole: DBXTeamLogEventTypeArgSfFbInviteChangeRole? { + self as? DBXTeamLogEventTypeArgSfFbInviteChangeRole + } + + @objc + public var asSfFbUninvite: DBXTeamLogEventTypeArgSfFbUninvite? { + self as? DBXTeamLogEventTypeArgSfFbUninvite + } + + @objc + public var asSfInviteGroup: DBXTeamLogEventTypeArgSfInviteGroup? { + self as? DBXTeamLogEventTypeArgSfInviteGroup + } + + @objc + public var asSfTeamGrantAccess: DBXTeamLogEventTypeArgSfTeamGrantAccess? { + self as? DBXTeamLogEventTypeArgSfTeamGrantAccess + } + + @objc + public var asSfTeamInvite: DBXTeamLogEventTypeArgSfTeamInvite? { + self as? DBXTeamLogEventTypeArgSfTeamInvite + } + + @objc + public var asSfTeamInviteChangeRole: DBXTeamLogEventTypeArgSfTeamInviteChangeRole? { + self as? DBXTeamLogEventTypeArgSfTeamInviteChangeRole + } + + @objc + public var asSfTeamJoin: DBXTeamLogEventTypeArgSfTeamJoin? { + self as? DBXTeamLogEventTypeArgSfTeamJoin + } + + @objc + public var asSfTeamJoinFromOobLink: DBXTeamLogEventTypeArgSfTeamJoinFromOobLink? { + self as? DBXTeamLogEventTypeArgSfTeamJoinFromOobLink + } + + @objc + public var asSfTeamUninvite: DBXTeamLogEventTypeArgSfTeamUninvite? { + self as? DBXTeamLogEventTypeArgSfTeamUninvite + } + + @objc + public var asSharedContentAddInvitees: DBXTeamLogEventTypeArgSharedContentAddInvitees? { + self as? DBXTeamLogEventTypeArgSharedContentAddInvitees + } + + @objc + public var asSharedContentAddLinkExpiry: DBXTeamLogEventTypeArgSharedContentAddLinkExpiry? { + self as? DBXTeamLogEventTypeArgSharedContentAddLinkExpiry + } + + @objc + public var asSharedContentAddLinkPassword: DBXTeamLogEventTypeArgSharedContentAddLinkPassword? { + self as? DBXTeamLogEventTypeArgSharedContentAddLinkPassword + } + + @objc + public var asSharedContentAddMember: DBXTeamLogEventTypeArgSharedContentAddMember? { + self as? DBXTeamLogEventTypeArgSharedContentAddMember + } + + @objc + public var asSharedContentChangeDownloadsPolicy: DBXTeamLogEventTypeArgSharedContentChangeDownloadsPolicy? { + self as? DBXTeamLogEventTypeArgSharedContentChangeDownloadsPolicy + } + + @objc + public var asSharedContentChangeInviteeRole: DBXTeamLogEventTypeArgSharedContentChangeInviteeRole? { + self as? DBXTeamLogEventTypeArgSharedContentChangeInviteeRole + } + + @objc + public var asSharedContentChangeLinkAudience: DBXTeamLogEventTypeArgSharedContentChangeLinkAudience? { + self as? DBXTeamLogEventTypeArgSharedContentChangeLinkAudience + } + + @objc + public var asSharedContentChangeLinkExpiry: DBXTeamLogEventTypeArgSharedContentChangeLinkExpiry? { + self as? DBXTeamLogEventTypeArgSharedContentChangeLinkExpiry + } + + @objc + public var asSharedContentChangeLinkPassword: DBXTeamLogEventTypeArgSharedContentChangeLinkPassword? { + self as? DBXTeamLogEventTypeArgSharedContentChangeLinkPassword + } + + @objc + public var asSharedContentChangeMemberRole: DBXTeamLogEventTypeArgSharedContentChangeMemberRole? { + self as? DBXTeamLogEventTypeArgSharedContentChangeMemberRole + } + + @objc + public var asSharedContentChangeViewerInfoPolicy: DBXTeamLogEventTypeArgSharedContentChangeViewerInfoPolicy? { + self as? DBXTeamLogEventTypeArgSharedContentChangeViewerInfoPolicy + } + + @objc + public var asSharedContentClaimInvitation: DBXTeamLogEventTypeArgSharedContentClaimInvitation? { + self as? DBXTeamLogEventTypeArgSharedContentClaimInvitation + } + + @objc + public var asSharedContentCopy: DBXTeamLogEventTypeArgSharedContentCopy? { + self as? DBXTeamLogEventTypeArgSharedContentCopy + } + + @objc + public var asSharedContentDownload: DBXTeamLogEventTypeArgSharedContentDownload? { + self as? DBXTeamLogEventTypeArgSharedContentDownload + } + + @objc + public var asSharedContentRelinquishMembership: DBXTeamLogEventTypeArgSharedContentRelinquishMembership? { + self as? DBXTeamLogEventTypeArgSharedContentRelinquishMembership + } + + @objc + public var asSharedContentRemoveInvitees: DBXTeamLogEventTypeArgSharedContentRemoveInvitees? { + self as? DBXTeamLogEventTypeArgSharedContentRemoveInvitees + } + + @objc + public var asSharedContentRemoveLinkExpiry: DBXTeamLogEventTypeArgSharedContentRemoveLinkExpiry? { + self as? DBXTeamLogEventTypeArgSharedContentRemoveLinkExpiry + } + + @objc + public var asSharedContentRemoveLinkPassword: DBXTeamLogEventTypeArgSharedContentRemoveLinkPassword? { + self as? DBXTeamLogEventTypeArgSharedContentRemoveLinkPassword + } + + @objc + public var asSharedContentRemoveMember: DBXTeamLogEventTypeArgSharedContentRemoveMember? { + self as? DBXTeamLogEventTypeArgSharedContentRemoveMember + } + + @objc + public var asSharedContentRequestAccess: DBXTeamLogEventTypeArgSharedContentRequestAccess? { + self as? DBXTeamLogEventTypeArgSharedContentRequestAccess + } + + @objc + public var asSharedContentRestoreInvitees: DBXTeamLogEventTypeArgSharedContentRestoreInvitees? { + self as? DBXTeamLogEventTypeArgSharedContentRestoreInvitees + } + + @objc + public var asSharedContentRestoreMember: DBXTeamLogEventTypeArgSharedContentRestoreMember? { + self as? DBXTeamLogEventTypeArgSharedContentRestoreMember + } + + @objc + public var asSharedContentUnshare: DBXTeamLogEventTypeArgSharedContentUnshare? { + self as? DBXTeamLogEventTypeArgSharedContentUnshare + } + + @objc + public var asSharedContentView: DBXTeamLogEventTypeArgSharedContentView? { + self as? DBXTeamLogEventTypeArgSharedContentView + } + + @objc + public var asSharedFolderChangeLinkPolicy: DBXTeamLogEventTypeArgSharedFolderChangeLinkPolicy? { + self as? DBXTeamLogEventTypeArgSharedFolderChangeLinkPolicy + } + + @objc + public var asSharedFolderChangeMembersInheritancePolicy: DBXTeamLogEventTypeArgSharedFolderChangeMembersInheritancePolicy? { + self as? DBXTeamLogEventTypeArgSharedFolderChangeMembersInheritancePolicy + } + + @objc + public var asSharedFolderChangeMembersManagementPolicy: DBXTeamLogEventTypeArgSharedFolderChangeMembersManagementPolicy? { + self as? DBXTeamLogEventTypeArgSharedFolderChangeMembersManagementPolicy + } + + @objc + public var asSharedFolderChangeMembersPolicy: DBXTeamLogEventTypeArgSharedFolderChangeMembersPolicy? { + self as? DBXTeamLogEventTypeArgSharedFolderChangeMembersPolicy + } + + @objc + public var asSharedFolderCreate: DBXTeamLogEventTypeArgSharedFolderCreate? { + self as? DBXTeamLogEventTypeArgSharedFolderCreate + } + + @objc + public var asSharedFolderDeclineInvitation: DBXTeamLogEventTypeArgSharedFolderDeclineInvitation? { + self as? DBXTeamLogEventTypeArgSharedFolderDeclineInvitation + } + + @objc + public var asSharedFolderMount: DBXTeamLogEventTypeArgSharedFolderMount? { + self as? DBXTeamLogEventTypeArgSharedFolderMount + } + + @objc + public var asSharedFolderNest: DBXTeamLogEventTypeArgSharedFolderNest? { + self as? DBXTeamLogEventTypeArgSharedFolderNest + } + + @objc + public var asSharedFolderTransferOwnership: DBXTeamLogEventTypeArgSharedFolderTransferOwnership? { + self as? DBXTeamLogEventTypeArgSharedFolderTransferOwnership + } + + @objc + public var asSharedFolderUnmount: DBXTeamLogEventTypeArgSharedFolderUnmount? { + self as? DBXTeamLogEventTypeArgSharedFolderUnmount + } + + @objc + public var asSharedLinkAddExpiry: DBXTeamLogEventTypeArgSharedLinkAddExpiry? { + self as? DBXTeamLogEventTypeArgSharedLinkAddExpiry + } + + @objc + public var asSharedLinkChangeExpiry: DBXTeamLogEventTypeArgSharedLinkChangeExpiry? { + self as? DBXTeamLogEventTypeArgSharedLinkChangeExpiry + } + + @objc + public var asSharedLinkChangeVisibility: DBXTeamLogEventTypeArgSharedLinkChangeVisibility? { + self as? DBXTeamLogEventTypeArgSharedLinkChangeVisibility + } + + @objc + public var asSharedLinkCopy: DBXTeamLogEventTypeArgSharedLinkCopy? { + self as? DBXTeamLogEventTypeArgSharedLinkCopy + } + + @objc + public var asSharedLinkCreate: DBXTeamLogEventTypeArgSharedLinkCreate? { + self as? DBXTeamLogEventTypeArgSharedLinkCreate + } + + @objc + public var asSharedLinkDisable: DBXTeamLogEventTypeArgSharedLinkDisable? { + self as? DBXTeamLogEventTypeArgSharedLinkDisable + } + + @objc + public var asSharedLinkDownload: DBXTeamLogEventTypeArgSharedLinkDownload? { + self as? DBXTeamLogEventTypeArgSharedLinkDownload + } + + @objc + public var asSharedLinkRemoveExpiry: DBXTeamLogEventTypeArgSharedLinkRemoveExpiry? { + self as? DBXTeamLogEventTypeArgSharedLinkRemoveExpiry + } + + @objc + public var asSharedLinkSettingsAddExpiration: DBXTeamLogEventTypeArgSharedLinkSettingsAddExpiration? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsAddExpiration + } + + @objc + public var asSharedLinkSettingsAddPassword: DBXTeamLogEventTypeArgSharedLinkSettingsAddPassword? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsAddPassword + } + + @objc + public var asSharedLinkSettingsAllowDownloadDisabled: DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadDisabled? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadDisabled + } + + @objc + public var asSharedLinkSettingsAllowDownloadEnabled: DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadEnabled? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadEnabled + } + + @objc + public var asSharedLinkSettingsChangeAudience: DBXTeamLogEventTypeArgSharedLinkSettingsChangeAudience? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsChangeAudience + } + + @objc + public var asSharedLinkSettingsChangeExpiration: DBXTeamLogEventTypeArgSharedLinkSettingsChangeExpiration? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsChangeExpiration + } + + @objc + public var asSharedLinkSettingsChangePassword: DBXTeamLogEventTypeArgSharedLinkSettingsChangePassword? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsChangePassword + } + + @objc + public var asSharedLinkSettingsRemoveExpiration: DBXTeamLogEventTypeArgSharedLinkSettingsRemoveExpiration? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsRemoveExpiration + } + + @objc + public var asSharedLinkSettingsRemovePassword: DBXTeamLogEventTypeArgSharedLinkSettingsRemovePassword? { + self as? DBXTeamLogEventTypeArgSharedLinkSettingsRemovePassword + } + + @objc + public var asSharedLinkShare: DBXTeamLogEventTypeArgSharedLinkShare? { + self as? DBXTeamLogEventTypeArgSharedLinkShare + } + + @objc + public var asSharedLinkView: DBXTeamLogEventTypeArgSharedLinkView? { + self as? DBXTeamLogEventTypeArgSharedLinkView + } + + @objc + public var asSharedNoteOpened: DBXTeamLogEventTypeArgSharedNoteOpened? { + self as? DBXTeamLogEventTypeArgSharedNoteOpened + } + + @objc + public var asShmodelDisableDownloads: DBXTeamLogEventTypeArgShmodelDisableDownloads? { + self as? DBXTeamLogEventTypeArgShmodelDisableDownloads + } + + @objc + public var asShmodelEnableDownloads: DBXTeamLogEventTypeArgShmodelEnableDownloads? { + self as? DBXTeamLogEventTypeArgShmodelEnableDownloads + } + + @objc + public var asShmodelGroupShare: DBXTeamLogEventTypeArgShmodelGroupShare? { + self as? DBXTeamLogEventTypeArgShmodelGroupShare + } + + @objc + public var asShowcaseAccessGranted: DBXTeamLogEventTypeArgShowcaseAccessGranted? { + self as? DBXTeamLogEventTypeArgShowcaseAccessGranted + } + + @objc + public var asShowcaseAddMember: DBXTeamLogEventTypeArgShowcaseAddMember? { + self as? DBXTeamLogEventTypeArgShowcaseAddMember + } + + @objc + public var asShowcaseArchived: DBXTeamLogEventTypeArgShowcaseArchived? { + self as? DBXTeamLogEventTypeArgShowcaseArchived + } + + @objc + public var asShowcaseCreated: DBXTeamLogEventTypeArgShowcaseCreated? { + self as? DBXTeamLogEventTypeArgShowcaseCreated + } + + @objc + public var asShowcaseDeleteComment: DBXTeamLogEventTypeArgShowcaseDeleteComment? { + self as? DBXTeamLogEventTypeArgShowcaseDeleteComment + } + + @objc + public var asShowcaseEdited: DBXTeamLogEventTypeArgShowcaseEdited? { + self as? DBXTeamLogEventTypeArgShowcaseEdited + } + + @objc + public var asShowcaseEditComment: DBXTeamLogEventTypeArgShowcaseEditComment? { + self as? DBXTeamLogEventTypeArgShowcaseEditComment + } + + @objc + public var asShowcaseFileAdded: DBXTeamLogEventTypeArgShowcaseFileAdded? { + self as? DBXTeamLogEventTypeArgShowcaseFileAdded + } + + @objc + public var asShowcaseFileDownload: DBXTeamLogEventTypeArgShowcaseFileDownload? { + self as? DBXTeamLogEventTypeArgShowcaseFileDownload + } + + @objc + public var asShowcaseFileRemoved: DBXTeamLogEventTypeArgShowcaseFileRemoved? { + self as? DBXTeamLogEventTypeArgShowcaseFileRemoved + } + + @objc + public var asShowcaseFileView: DBXTeamLogEventTypeArgShowcaseFileView? { + self as? DBXTeamLogEventTypeArgShowcaseFileView + } + + @objc + public var asShowcasePermanentlyDeleted: DBXTeamLogEventTypeArgShowcasePermanentlyDeleted? { + self as? DBXTeamLogEventTypeArgShowcasePermanentlyDeleted + } + + @objc + public var asShowcasePostComment: DBXTeamLogEventTypeArgShowcasePostComment? { + self as? DBXTeamLogEventTypeArgShowcasePostComment + } + + @objc + public var asShowcaseRemoveMember: DBXTeamLogEventTypeArgShowcaseRemoveMember? { + self as? DBXTeamLogEventTypeArgShowcaseRemoveMember + } + + @objc + public var asShowcaseRenamed: DBXTeamLogEventTypeArgShowcaseRenamed? { + self as? DBXTeamLogEventTypeArgShowcaseRenamed + } + + @objc + public var asShowcaseRequestAccess: DBXTeamLogEventTypeArgShowcaseRequestAccess? { + self as? DBXTeamLogEventTypeArgShowcaseRequestAccess + } + + @objc + public var asShowcaseResolveComment: DBXTeamLogEventTypeArgShowcaseResolveComment? { + self as? DBXTeamLogEventTypeArgShowcaseResolveComment + } + + @objc + public var asShowcaseRestored: DBXTeamLogEventTypeArgShowcaseRestored? { + self as? DBXTeamLogEventTypeArgShowcaseRestored + } + + @objc + public var asShowcaseTrashed: DBXTeamLogEventTypeArgShowcaseTrashed? { + self as? DBXTeamLogEventTypeArgShowcaseTrashed + } + + @objc + public var asShowcaseTrashedDeprecated: DBXTeamLogEventTypeArgShowcaseTrashedDeprecated? { + self as? DBXTeamLogEventTypeArgShowcaseTrashedDeprecated + } + + @objc + public var asShowcaseUnresolveComment: DBXTeamLogEventTypeArgShowcaseUnresolveComment? { + self as? DBXTeamLogEventTypeArgShowcaseUnresolveComment + } + + @objc + public var asShowcaseUntrashed: DBXTeamLogEventTypeArgShowcaseUntrashed? { + self as? DBXTeamLogEventTypeArgShowcaseUntrashed + } + + @objc + public var asShowcaseUntrashedDeprecated: DBXTeamLogEventTypeArgShowcaseUntrashedDeprecated? { + self as? DBXTeamLogEventTypeArgShowcaseUntrashedDeprecated + } + + @objc + public var asShowcaseView: DBXTeamLogEventTypeArgShowcaseView? { + self as? DBXTeamLogEventTypeArgShowcaseView + } + + @objc + public var asSsoAddCert: DBXTeamLogEventTypeArgSsoAddCert? { + self as? DBXTeamLogEventTypeArgSsoAddCert + } + + @objc + public var asSsoAddLoginUrl: DBXTeamLogEventTypeArgSsoAddLoginUrl? { + self as? DBXTeamLogEventTypeArgSsoAddLoginUrl + } + + @objc + public var asSsoAddLogoutUrl: DBXTeamLogEventTypeArgSsoAddLogoutUrl? { + self as? DBXTeamLogEventTypeArgSsoAddLogoutUrl + } + + @objc + public var asSsoChangeCert: DBXTeamLogEventTypeArgSsoChangeCert? { + self as? DBXTeamLogEventTypeArgSsoChangeCert + } + + @objc + public var asSsoChangeLoginUrl: DBXTeamLogEventTypeArgSsoChangeLoginUrl? { + self as? DBXTeamLogEventTypeArgSsoChangeLoginUrl + } + + @objc + public var asSsoChangeLogoutUrl: DBXTeamLogEventTypeArgSsoChangeLogoutUrl? { + self as? DBXTeamLogEventTypeArgSsoChangeLogoutUrl + } + + @objc + public var asSsoChangeSamlIdentityMode: DBXTeamLogEventTypeArgSsoChangeSamlIdentityMode? { + self as? DBXTeamLogEventTypeArgSsoChangeSamlIdentityMode + } + + @objc + public var asSsoRemoveCert: DBXTeamLogEventTypeArgSsoRemoveCert? { + self as? DBXTeamLogEventTypeArgSsoRemoveCert + } + + @objc + public var asSsoRemoveLoginUrl: DBXTeamLogEventTypeArgSsoRemoveLoginUrl? { + self as? DBXTeamLogEventTypeArgSsoRemoveLoginUrl + } + + @objc + public var asSsoRemoveLogoutUrl: DBXTeamLogEventTypeArgSsoRemoveLogoutUrl? { + self as? DBXTeamLogEventTypeArgSsoRemoveLogoutUrl + } + + @objc + public var asTeamFolderChangeStatus: DBXTeamLogEventTypeArgTeamFolderChangeStatus? { + self as? DBXTeamLogEventTypeArgTeamFolderChangeStatus + } + + @objc + public var asTeamFolderCreate: DBXTeamLogEventTypeArgTeamFolderCreate? { + self as? DBXTeamLogEventTypeArgTeamFolderCreate + } + + @objc + public var asTeamFolderDowngrade: DBXTeamLogEventTypeArgTeamFolderDowngrade? { + self as? DBXTeamLogEventTypeArgTeamFolderDowngrade + } + + @objc + public var asTeamFolderPermanentlyDelete: DBXTeamLogEventTypeArgTeamFolderPermanentlyDelete? { + self as? DBXTeamLogEventTypeArgTeamFolderPermanentlyDelete + } + + @objc + public var asTeamFolderRename: DBXTeamLogEventTypeArgTeamFolderRename? { + self as? DBXTeamLogEventTypeArgTeamFolderRename + } + + @objc + public var asTeamSelectiveSyncSettingsChanged: DBXTeamLogEventTypeArgTeamSelectiveSyncSettingsChanged? { + self as? DBXTeamLogEventTypeArgTeamSelectiveSyncSettingsChanged + } + + @objc + public var asAccountCaptureChangePolicy: DBXTeamLogEventTypeArgAccountCaptureChangePolicy? { + self as? DBXTeamLogEventTypeArgAccountCaptureChangePolicy + } + + @objc + public var asAdminEmailRemindersChanged: DBXTeamLogEventTypeArgAdminEmailRemindersChanged? { + self as? DBXTeamLogEventTypeArgAdminEmailRemindersChanged + } + + @objc + public var asAllowDownloadDisabled: DBXTeamLogEventTypeArgAllowDownloadDisabled? { + self as? DBXTeamLogEventTypeArgAllowDownloadDisabled + } + + @objc + public var asAllowDownloadEnabled: DBXTeamLogEventTypeArgAllowDownloadEnabled? { + self as? DBXTeamLogEventTypeArgAllowDownloadEnabled + } + + @objc + public var asAppPermissionsChanged: DBXTeamLogEventTypeArgAppPermissionsChanged? { + self as? DBXTeamLogEventTypeArgAppPermissionsChanged + } + + @objc + public var asCameraUploadsPolicyChanged: DBXTeamLogEventTypeArgCameraUploadsPolicyChanged? { + self as? DBXTeamLogEventTypeArgCameraUploadsPolicyChanged + } + + @objc + public var asCaptureTranscriptPolicyChanged: DBXTeamLogEventTypeArgCaptureTranscriptPolicyChanged? { + self as? DBXTeamLogEventTypeArgCaptureTranscriptPolicyChanged + } + + @objc + public var asClassificationChangePolicy: DBXTeamLogEventTypeArgClassificationChangePolicy? { + self as? DBXTeamLogEventTypeArgClassificationChangePolicy + } + + @objc + public var asComputerBackupPolicyChanged: DBXTeamLogEventTypeArgComputerBackupPolicyChanged? { + self as? DBXTeamLogEventTypeArgComputerBackupPolicyChanged + } + + @objc + public var asContentAdministrationPolicyChanged: DBXTeamLogEventTypeArgContentAdministrationPolicyChanged? { + self as? DBXTeamLogEventTypeArgContentAdministrationPolicyChanged + } + + @objc + public var asDataPlacementRestrictionChangePolicy: DBXTeamLogEventTypeArgDataPlacementRestrictionChangePolicy? { + self as? DBXTeamLogEventTypeArgDataPlacementRestrictionChangePolicy + } + + @objc + public var asDataPlacementRestrictionSatisfyPolicy: DBXTeamLogEventTypeArgDataPlacementRestrictionSatisfyPolicy? { + self as? DBXTeamLogEventTypeArgDataPlacementRestrictionSatisfyPolicy + } + + @objc + public var asDeviceApprovalsAddException: DBXTeamLogEventTypeArgDeviceApprovalsAddException? { + self as? DBXTeamLogEventTypeArgDeviceApprovalsAddException + } + + @objc + public var asDeviceApprovalsChangeDesktopPolicy: DBXTeamLogEventTypeArgDeviceApprovalsChangeDesktopPolicy? { + self as? DBXTeamLogEventTypeArgDeviceApprovalsChangeDesktopPolicy + } + + @objc + public var asDeviceApprovalsChangeMobilePolicy: DBXTeamLogEventTypeArgDeviceApprovalsChangeMobilePolicy? { + self as? DBXTeamLogEventTypeArgDeviceApprovalsChangeMobilePolicy + } + + @objc + public var asDeviceApprovalsChangeOverageAction: DBXTeamLogEventTypeArgDeviceApprovalsChangeOverageAction? { + self as? DBXTeamLogEventTypeArgDeviceApprovalsChangeOverageAction + } + + @objc + public var asDeviceApprovalsChangeUnlinkAction: DBXTeamLogEventTypeArgDeviceApprovalsChangeUnlinkAction? { + self as? DBXTeamLogEventTypeArgDeviceApprovalsChangeUnlinkAction + } + + @objc + public var asDeviceApprovalsRemoveException: DBXTeamLogEventTypeArgDeviceApprovalsRemoveException? { + self as? DBXTeamLogEventTypeArgDeviceApprovalsRemoveException + } + + @objc + public var asDirectoryRestrictionsAddMembers: DBXTeamLogEventTypeArgDirectoryRestrictionsAddMembers? { + self as? DBXTeamLogEventTypeArgDirectoryRestrictionsAddMembers + } + + @objc + public var asDirectoryRestrictionsRemoveMembers: DBXTeamLogEventTypeArgDirectoryRestrictionsRemoveMembers? { + self as? DBXTeamLogEventTypeArgDirectoryRestrictionsRemoveMembers + } + + @objc + public var asDropboxPasswordsPolicyChanged: DBXTeamLogEventTypeArgDropboxPasswordsPolicyChanged? { + self as? DBXTeamLogEventTypeArgDropboxPasswordsPolicyChanged + } + + @objc + public var asEmailIngestPolicyChanged: DBXTeamLogEventTypeArgEmailIngestPolicyChanged? { + self as? DBXTeamLogEventTypeArgEmailIngestPolicyChanged + } + + @objc + public var asEmmAddException: DBXTeamLogEventTypeArgEmmAddException? { + self as? DBXTeamLogEventTypeArgEmmAddException + } + + @objc + public var asEmmChangePolicy: DBXTeamLogEventTypeArgEmmChangePolicy? { + self as? DBXTeamLogEventTypeArgEmmChangePolicy + } + + @objc + public var asEmmRemoveException: DBXTeamLogEventTypeArgEmmRemoveException? { + self as? DBXTeamLogEventTypeArgEmmRemoveException + } + + @objc + public var asExtendedVersionHistoryChangePolicy: DBXTeamLogEventTypeArgExtendedVersionHistoryChangePolicy? { + self as? DBXTeamLogEventTypeArgExtendedVersionHistoryChangePolicy + } + + @objc + public var asExternalDriveBackupPolicyChanged: DBXTeamLogEventTypeArgExternalDriveBackupPolicyChanged? { + self as? DBXTeamLogEventTypeArgExternalDriveBackupPolicyChanged + } + + @objc + public var asFileCommentsChangePolicy: DBXTeamLogEventTypeArgFileCommentsChangePolicy? { + self as? DBXTeamLogEventTypeArgFileCommentsChangePolicy + } + + @objc + public var asFileLockingPolicyChanged: DBXTeamLogEventTypeArgFileLockingPolicyChanged? { + self as? DBXTeamLogEventTypeArgFileLockingPolicyChanged + } + + @objc + public var asFileProviderMigrationPolicyChanged: DBXTeamLogEventTypeArgFileProviderMigrationPolicyChanged? { + self as? DBXTeamLogEventTypeArgFileProviderMigrationPolicyChanged + } + + @objc + public var asFileRequestsChangePolicy: DBXTeamLogEventTypeArgFileRequestsChangePolicy? { + self as? DBXTeamLogEventTypeArgFileRequestsChangePolicy + } + + @objc + public var asFileRequestsEmailsEnabled: DBXTeamLogEventTypeArgFileRequestsEmailsEnabled? { + self as? DBXTeamLogEventTypeArgFileRequestsEmailsEnabled + } + + @objc + public var asFileRequestsEmailsRestrictedToTeamOnly: DBXTeamLogEventTypeArgFileRequestsEmailsRestrictedToTeamOnly? { + self as? DBXTeamLogEventTypeArgFileRequestsEmailsRestrictedToTeamOnly + } + + @objc + public var asFileTransfersPolicyChanged: DBXTeamLogEventTypeArgFileTransfersPolicyChanged? { + self as? DBXTeamLogEventTypeArgFileTransfersPolicyChanged + } + + @objc + public var asFolderLinkRestrictionPolicyChanged: DBXTeamLogEventTypeArgFolderLinkRestrictionPolicyChanged? { + self as? DBXTeamLogEventTypeArgFolderLinkRestrictionPolicyChanged + } + + @objc + public var asGoogleSsoChangePolicy: DBXTeamLogEventTypeArgGoogleSsoChangePolicy? { + self as? DBXTeamLogEventTypeArgGoogleSsoChangePolicy + } + + @objc + public var asGroupUserManagementChangePolicy: DBXTeamLogEventTypeArgGroupUserManagementChangePolicy? { + self as? DBXTeamLogEventTypeArgGroupUserManagementChangePolicy + } + + @objc + public var asIntegrationPolicyChanged: DBXTeamLogEventTypeArgIntegrationPolicyChanged? { + self as? DBXTeamLogEventTypeArgIntegrationPolicyChanged + } + + @objc + public var asInviteAcceptanceEmailPolicyChanged: DBXTeamLogEventTypeArgInviteAcceptanceEmailPolicyChanged? { + self as? DBXTeamLogEventTypeArgInviteAcceptanceEmailPolicyChanged + } + + @objc + public var asMemberRequestsChangePolicy: DBXTeamLogEventTypeArgMemberRequestsChangePolicy? { + self as? DBXTeamLogEventTypeArgMemberRequestsChangePolicy + } + + @objc + public var asMemberSendInvitePolicyChanged: DBXTeamLogEventTypeArgMemberSendInvitePolicyChanged? { + self as? DBXTeamLogEventTypeArgMemberSendInvitePolicyChanged + } + + @objc + public var asMemberSpaceLimitsAddException: DBXTeamLogEventTypeArgMemberSpaceLimitsAddException? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsAddException + } + + @objc + public var asMemberSpaceLimitsChangeCapsTypePolicy: DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCapsTypePolicy? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCapsTypePolicy + } + + @objc + public var asMemberSpaceLimitsChangePolicy: DBXTeamLogEventTypeArgMemberSpaceLimitsChangePolicy? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsChangePolicy + } + + @objc + public var asMemberSpaceLimitsRemoveException: DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveException? { + self as? DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveException + } + + @objc + public var asMemberSuggestionsChangePolicy: DBXTeamLogEventTypeArgMemberSuggestionsChangePolicy? { + self as? DBXTeamLogEventTypeArgMemberSuggestionsChangePolicy + } + + @objc + public var asMicrosoftOfficeAddinChangePolicy: DBXTeamLogEventTypeArgMicrosoftOfficeAddinChangePolicy? { + self as? DBXTeamLogEventTypeArgMicrosoftOfficeAddinChangePolicy + } + + @objc + public var asNetworkControlChangePolicy: DBXTeamLogEventTypeArgNetworkControlChangePolicy? { + self as? DBXTeamLogEventTypeArgNetworkControlChangePolicy + } + + @objc + public var asPaperChangeDeploymentPolicy: DBXTeamLogEventTypeArgPaperChangeDeploymentPolicy? { + self as? DBXTeamLogEventTypeArgPaperChangeDeploymentPolicy + } + + @objc + public var asPaperChangeMemberLinkPolicy: DBXTeamLogEventTypeArgPaperChangeMemberLinkPolicy? { + self as? DBXTeamLogEventTypeArgPaperChangeMemberLinkPolicy + } + + @objc + public var asPaperChangeMemberPolicy: DBXTeamLogEventTypeArgPaperChangeMemberPolicy? { + self as? DBXTeamLogEventTypeArgPaperChangeMemberPolicy + } + + @objc + public var asPaperChangePolicy: DBXTeamLogEventTypeArgPaperChangePolicy? { + self as? DBXTeamLogEventTypeArgPaperChangePolicy + } + + @objc + public var asPaperDefaultFolderPolicyChanged: DBXTeamLogEventTypeArgPaperDefaultFolderPolicyChanged? { + self as? DBXTeamLogEventTypeArgPaperDefaultFolderPolicyChanged + } + + @objc + public var asPaperDesktopPolicyChanged: DBXTeamLogEventTypeArgPaperDesktopPolicyChanged? { + self as? DBXTeamLogEventTypeArgPaperDesktopPolicyChanged + } + + @objc + public var asPaperEnabledUsersGroupAddition: DBXTeamLogEventTypeArgPaperEnabledUsersGroupAddition? { + self as? DBXTeamLogEventTypeArgPaperEnabledUsersGroupAddition + } + + @objc + public var asPaperEnabledUsersGroupRemoval: DBXTeamLogEventTypeArgPaperEnabledUsersGroupRemoval? { + self as? DBXTeamLogEventTypeArgPaperEnabledUsersGroupRemoval + } + + @objc + public var asPasswordStrengthRequirementsChangePolicy: DBXTeamLogEventTypeArgPasswordStrengthRequirementsChangePolicy? { + self as? DBXTeamLogEventTypeArgPasswordStrengthRequirementsChangePolicy + } + + @objc + public var asPermanentDeleteChangePolicy: DBXTeamLogEventTypeArgPermanentDeleteChangePolicy? { + self as? DBXTeamLogEventTypeArgPermanentDeleteChangePolicy + } + + @objc + public var asResellerSupportChangePolicy: DBXTeamLogEventTypeArgResellerSupportChangePolicy? { + self as? DBXTeamLogEventTypeArgResellerSupportChangePolicy + } + + @objc + public var asRewindPolicyChanged: DBXTeamLogEventTypeArgRewindPolicyChanged? { + self as? DBXTeamLogEventTypeArgRewindPolicyChanged + } + + @objc + public var asSendForSignaturePolicyChanged: DBXTeamLogEventTypeArgSendForSignaturePolicyChanged? { + self as? DBXTeamLogEventTypeArgSendForSignaturePolicyChanged + } + + @objc + public var asSharingChangeFolderJoinPolicy: DBXTeamLogEventTypeArgSharingChangeFolderJoinPolicy? { + self as? DBXTeamLogEventTypeArgSharingChangeFolderJoinPolicy + } + + @objc + public var asSharingChangeLinkAllowChangeExpirationPolicy: DBXTeamLogEventTypeArgSharingChangeLinkAllowChangeExpirationPolicy? { + self as? DBXTeamLogEventTypeArgSharingChangeLinkAllowChangeExpirationPolicy + } + + @objc + public var asSharingChangeLinkDefaultExpirationPolicy: DBXTeamLogEventTypeArgSharingChangeLinkDefaultExpirationPolicy? { + self as? DBXTeamLogEventTypeArgSharingChangeLinkDefaultExpirationPolicy + } + + @objc + public var asSharingChangeLinkEnforcePasswordPolicy: DBXTeamLogEventTypeArgSharingChangeLinkEnforcePasswordPolicy? { + self as? DBXTeamLogEventTypeArgSharingChangeLinkEnforcePasswordPolicy + } + + @objc + public var asSharingChangeLinkPolicy: DBXTeamLogEventTypeArgSharingChangeLinkPolicy? { + self as? DBXTeamLogEventTypeArgSharingChangeLinkPolicy + } + + @objc + public var asSharingChangeMemberPolicy: DBXTeamLogEventTypeArgSharingChangeMemberPolicy? { + self as? DBXTeamLogEventTypeArgSharingChangeMemberPolicy + } + + @objc + public var asShowcaseChangeDownloadPolicy: DBXTeamLogEventTypeArgShowcaseChangeDownloadPolicy? { + self as? DBXTeamLogEventTypeArgShowcaseChangeDownloadPolicy + } + + @objc + public var asShowcaseChangeEnabledPolicy: DBXTeamLogEventTypeArgShowcaseChangeEnabledPolicy? { + self as? DBXTeamLogEventTypeArgShowcaseChangeEnabledPolicy + } + + @objc + public var asShowcaseChangeExternalSharingPolicy: DBXTeamLogEventTypeArgShowcaseChangeExternalSharingPolicy? { + self as? DBXTeamLogEventTypeArgShowcaseChangeExternalSharingPolicy + } + + @objc + public var asSmarterSmartSyncPolicyChanged: DBXTeamLogEventTypeArgSmarterSmartSyncPolicyChanged? { + self as? DBXTeamLogEventTypeArgSmarterSmartSyncPolicyChanged + } + + @objc + public var asSmartSyncChangePolicy: DBXTeamLogEventTypeArgSmartSyncChangePolicy? { + self as? DBXTeamLogEventTypeArgSmartSyncChangePolicy + } + + @objc + public var asSmartSyncNotOptOut: DBXTeamLogEventTypeArgSmartSyncNotOptOut? { + self as? DBXTeamLogEventTypeArgSmartSyncNotOptOut + } + + @objc + public var asSmartSyncOptOut: DBXTeamLogEventTypeArgSmartSyncOptOut? { + self as? DBXTeamLogEventTypeArgSmartSyncOptOut + } + + @objc + public var asSsoChangePolicy: DBXTeamLogEventTypeArgSsoChangePolicy? { + self as? DBXTeamLogEventTypeArgSsoChangePolicy + } + + @objc + public var asTeamBrandingPolicyChanged: DBXTeamLogEventTypeArgTeamBrandingPolicyChanged? { + self as? DBXTeamLogEventTypeArgTeamBrandingPolicyChanged + } + + @objc + public var asTeamExtensionsPolicyChanged: DBXTeamLogEventTypeArgTeamExtensionsPolicyChanged? { + self as? DBXTeamLogEventTypeArgTeamExtensionsPolicyChanged + } + + @objc + public var asTeamSelectiveSyncPolicyChanged: DBXTeamLogEventTypeArgTeamSelectiveSyncPolicyChanged? { + self as? DBXTeamLogEventTypeArgTeamSelectiveSyncPolicyChanged + } + + @objc + public var asTeamSharingWhitelistSubjectsChanged: DBXTeamLogEventTypeArgTeamSharingWhitelistSubjectsChanged? { + self as? DBXTeamLogEventTypeArgTeamSharingWhitelistSubjectsChanged + } + + @objc + public var asTfaAddException: DBXTeamLogEventTypeArgTfaAddException? { + self as? DBXTeamLogEventTypeArgTfaAddException + } + + @objc + public var asTfaChangePolicy: DBXTeamLogEventTypeArgTfaChangePolicy? { + self as? DBXTeamLogEventTypeArgTfaChangePolicy + } + + @objc + public var asTfaRemoveException: DBXTeamLogEventTypeArgTfaRemoveException? { + self as? DBXTeamLogEventTypeArgTfaRemoveException + } + + @objc + public var asTwoAccountChangePolicy: DBXTeamLogEventTypeArgTwoAccountChangePolicy? { + self as? DBXTeamLogEventTypeArgTwoAccountChangePolicy + } + + @objc + public var asViewerInfoPolicyChanged: DBXTeamLogEventTypeArgViewerInfoPolicyChanged? { + self as? DBXTeamLogEventTypeArgViewerInfoPolicyChanged + } + + @objc + public var asWatermarkingPolicyChanged: DBXTeamLogEventTypeArgWatermarkingPolicyChanged? { + self as? DBXTeamLogEventTypeArgWatermarkingPolicyChanged + } + + @objc + public var asWebSessionsChangeActiveSessionLimit: DBXTeamLogEventTypeArgWebSessionsChangeActiveSessionLimit? { + self as? DBXTeamLogEventTypeArgWebSessionsChangeActiveSessionLimit + } + + @objc + public var asWebSessionsChangeFixedLengthPolicy: DBXTeamLogEventTypeArgWebSessionsChangeFixedLengthPolicy? { + self as? DBXTeamLogEventTypeArgWebSessionsChangeFixedLengthPolicy + } + + @objc + public var asWebSessionsChangeIdleLengthPolicy: DBXTeamLogEventTypeArgWebSessionsChangeIdleLengthPolicy? { + self as? DBXTeamLogEventTypeArgWebSessionsChangeIdleLengthPolicy + } + + @objc + public var asDataResidencyMigrationRequestSuccessful: DBXTeamLogEventTypeArgDataResidencyMigrationRequestSuccessful? { + self as? DBXTeamLogEventTypeArgDataResidencyMigrationRequestSuccessful + } + + @objc + public var asDataResidencyMigrationRequestUnsuccessful: DBXTeamLogEventTypeArgDataResidencyMigrationRequestUnsuccessful? { + self as? DBXTeamLogEventTypeArgDataResidencyMigrationRequestUnsuccessful + } + + @objc + public var asTeamMergeFrom: DBXTeamLogEventTypeArgTeamMergeFrom? { + self as? DBXTeamLogEventTypeArgTeamMergeFrom + } + + @objc + public var asTeamMergeTo: DBXTeamLogEventTypeArgTeamMergeTo? { + self as? DBXTeamLogEventTypeArgTeamMergeTo + } + + @objc + public var asTeamProfileAddBackground: DBXTeamLogEventTypeArgTeamProfileAddBackground? { + self as? DBXTeamLogEventTypeArgTeamProfileAddBackground + } + + @objc + public var asTeamProfileAddLogo: DBXTeamLogEventTypeArgTeamProfileAddLogo? { + self as? DBXTeamLogEventTypeArgTeamProfileAddLogo + } + + @objc + public var asTeamProfileChangeBackground: DBXTeamLogEventTypeArgTeamProfileChangeBackground? { + self as? DBXTeamLogEventTypeArgTeamProfileChangeBackground + } + + @objc + public var asTeamProfileChangeDefaultLanguage: DBXTeamLogEventTypeArgTeamProfileChangeDefaultLanguage? { + self as? DBXTeamLogEventTypeArgTeamProfileChangeDefaultLanguage + } + + @objc + public var asTeamProfileChangeLogo: DBXTeamLogEventTypeArgTeamProfileChangeLogo? { + self as? DBXTeamLogEventTypeArgTeamProfileChangeLogo + } + + @objc + public var asTeamProfileChangeName: DBXTeamLogEventTypeArgTeamProfileChangeName? { + self as? DBXTeamLogEventTypeArgTeamProfileChangeName + } + + @objc + public var asTeamProfileRemoveBackground: DBXTeamLogEventTypeArgTeamProfileRemoveBackground? { + self as? DBXTeamLogEventTypeArgTeamProfileRemoveBackground + } + + @objc + public var asTeamProfileRemoveLogo: DBXTeamLogEventTypeArgTeamProfileRemoveLogo? { + self as? DBXTeamLogEventTypeArgTeamProfileRemoveLogo + } + + @objc + public var asTfaAddBackupPhone: DBXTeamLogEventTypeArgTfaAddBackupPhone? { + self as? DBXTeamLogEventTypeArgTfaAddBackupPhone + } + + @objc + public var asTfaAddSecurityKey: DBXTeamLogEventTypeArgTfaAddSecurityKey? { + self as? DBXTeamLogEventTypeArgTfaAddSecurityKey + } + + @objc + public var asTfaChangeBackupPhone: DBXTeamLogEventTypeArgTfaChangeBackupPhone? { + self as? DBXTeamLogEventTypeArgTfaChangeBackupPhone + } + + @objc + public var asTfaChangeStatus: DBXTeamLogEventTypeArgTfaChangeStatus? { + self as? DBXTeamLogEventTypeArgTfaChangeStatus + } + + @objc + public var asTfaRemoveBackupPhone: DBXTeamLogEventTypeArgTfaRemoveBackupPhone? { + self as? DBXTeamLogEventTypeArgTfaRemoveBackupPhone + } + + @objc + public var asTfaRemoveSecurityKey: DBXTeamLogEventTypeArgTfaRemoveSecurityKey? { + self as? DBXTeamLogEventTypeArgTfaRemoveSecurityKey + } + + @objc + public var asTfaReset: DBXTeamLogEventTypeArgTfaReset? { + self as? DBXTeamLogEventTypeArgTfaReset + } + + @objc + public var asChangedEnterpriseAdminRole: DBXTeamLogEventTypeArgChangedEnterpriseAdminRole? { + self as? DBXTeamLogEventTypeArgChangedEnterpriseAdminRole + } + + @objc + public var asChangedEnterpriseConnectedTeamStatus: DBXTeamLogEventTypeArgChangedEnterpriseConnectedTeamStatus? { + self as? DBXTeamLogEventTypeArgChangedEnterpriseConnectedTeamStatus + } + + @objc + public var asEndedEnterpriseAdminSession: DBXTeamLogEventTypeArgEndedEnterpriseAdminSession? { + self as? DBXTeamLogEventTypeArgEndedEnterpriseAdminSession + } + + @objc + public var asEndedEnterpriseAdminSessionDeprecated: DBXTeamLogEventTypeArgEndedEnterpriseAdminSessionDeprecated? { + self as? DBXTeamLogEventTypeArgEndedEnterpriseAdminSessionDeprecated + } + + @objc + public var asEnterpriseSettingsLocking: DBXTeamLogEventTypeArgEnterpriseSettingsLocking? { + self as? DBXTeamLogEventTypeArgEnterpriseSettingsLocking + } + + @objc + public var asGuestAdminChangeStatus: DBXTeamLogEventTypeArgGuestAdminChangeStatus? { + self as? DBXTeamLogEventTypeArgGuestAdminChangeStatus + } + + @objc + public var asStartedEnterpriseAdminSession: DBXTeamLogEventTypeArgStartedEnterpriseAdminSession? { + self as? DBXTeamLogEventTypeArgStartedEnterpriseAdminSession + } + + @objc + public var asTeamMergeRequestAccepted: DBXTeamLogEventTypeArgTeamMergeRequestAccepted? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestAccepted + } + + @objc + public var asTeamMergeRequestAcceptedShownToPrimaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestAcceptedShownToSecondaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestAutoCanceled: DBXTeamLogEventTypeArgTeamMergeRequestAutoCanceled? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestAutoCanceled + } + + @objc + public var asTeamMergeRequestCanceled: DBXTeamLogEventTypeArgTeamMergeRequestCanceled? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestCanceled + } + + @objc + public var asTeamMergeRequestCanceledShownToPrimaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestCanceledShownToSecondaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestExpired: DBXTeamLogEventTypeArgTeamMergeRequestExpired? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestExpired + } + + @objc + public var asTeamMergeRequestExpiredShownToPrimaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestExpiredShownToSecondaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestRejectedShownToPrimaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestRejectedShownToSecondaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestReminder: DBXTeamLogEventTypeArgTeamMergeRequestReminder? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestReminder + } + + @objc + public var asTeamMergeRequestReminderShownToPrimaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestReminderShownToSecondaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToSecondaryTeam + } + + @objc + public var asTeamMergeRequestRevoked: DBXTeamLogEventTypeArgTeamMergeRequestRevoked? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestRevoked + } + + @objc + public var asTeamMergeRequestSentShownToPrimaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestSentShownToPrimaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestSentShownToPrimaryTeam + } + + @objc + public var asTeamMergeRequestSentShownToSecondaryTeam: DBXTeamLogEventTypeArgTeamMergeRequestSentShownToSecondaryTeam? { + self as? DBXTeamLogEventTypeArgTeamMergeRequestSentShownToSecondaryTeam + } + + @objc + public var asOther: DBXTeamLogEventTypeArgOther? { + self as? DBXTeamLogEventTypeArgOther + } +} + +/// (admin_alerting) Changed an alert state +@objc +public class DBXTeamLogEventTypeArgAdminAlertingAlertStateChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.adminAlertingAlertStateChanged + super.init(swift: swift) + } +} + +/// (admin_alerting) Changed an alert setting +@objc +public class DBXTeamLogEventTypeArgAdminAlertingChangedAlertConfig: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.adminAlertingChangedAlertConfig + super.init(swift: swift) + } +} + +/// (admin_alerting) Triggered security alert +@objc +public class DBXTeamLogEventTypeArgAdminAlertingTriggeredAlert: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.adminAlertingTriggeredAlert + super.init(swift: swift) + } +} + +/// (admin_alerting) Completed ransomware restore process +@objc +public class DBXTeamLogEventTypeArgRansomwareRestoreProcessCompleted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ransomwareRestoreProcessCompleted + super.init(swift: swift) + } +} + +/// (admin_alerting) Started ransomware restore process +@objc +public class DBXTeamLogEventTypeArgRansomwareRestoreProcessStarted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ransomwareRestoreProcessStarted + super.init(swift: swift) + } +} + +/// (apps) Failed to connect app for member +@objc +public class DBXTeamLogEventTypeArgAppBlockedByPermissions: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.appBlockedByPermissions + super.init(swift: swift) + } +} + +/// (apps) Linked app for team +@objc +public class DBXTeamLogEventTypeArgAppLinkTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.appLinkTeam + super.init(swift: swift) + } +} + +/// (apps) Linked app for member +@objc +public class DBXTeamLogEventTypeArgAppLinkUser: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.appLinkUser + super.init(swift: swift) + } +} + +/// (apps) Unlinked app for team +@objc +public class DBXTeamLogEventTypeArgAppUnlinkTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.appUnlinkTeam + super.init(swift: swift) + } +} + +/// (apps) Unlinked app for member +@objc +public class DBXTeamLogEventTypeArgAppUnlinkUser: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.appUnlinkUser + super.init(swift: swift) + } +} + +/// (apps) Connected integration for member +@objc +public class DBXTeamLogEventTypeArgIntegrationConnected: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.integrationConnected + super.init(swift: swift) + } +} + +/// (apps) Disconnected integration for member +@objc +public class DBXTeamLogEventTypeArgIntegrationDisconnected: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.integrationDisconnected + super.init(swift: swift) + } +} + +/// (comments) Added file comment +@objc +public class DBXTeamLogEventTypeArgFileAddComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileAddComment + super.init(swift: swift) + } +} + +/// (comments) Subscribed to or unsubscribed from comment notifications for file +@objc +public class DBXTeamLogEventTypeArgFileChangeCommentSubscription: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileChangeCommentSubscription + super.init(swift: swift) + } +} + +/// (comments) Deleted file comment +@objc +public class DBXTeamLogEventTypeArgFileDeleteComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileDeleteComment + super.init(swift: swift) + } +} + +/// (comments) Edited file comment +@objc +public class DBXTeamLogEventTypeArgFileEditComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileEditComment + super.init(swift: swift) + } +} + +/// (comments) Liked file comment (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgFileLikeComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileLikeComment + super.init(swift: swift) + } +} + +/// (comments) Resolved file comment +@objc +public class DBXTeamLogEventTypeArgFileResolveComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileResolveComment + super.init(swift: swift) + } +} + +/// (comments) Unliked file comment (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgFileUnlikeComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileUnlikeComment + super.init(swift: swift) + } +} + +/// (comments) Unresolved file comment +@objc +public class DBXTeamLogEventTypeArgFileUnresolveComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileUnresolveComment + super.init(swift: swift) + } +} + +/// (data_governance) Added folders to policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyAddFolders: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyAddFolders + super.init(swift: swift) + } +} + +/// (data_governance) Couldn't add a folder to a policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyAddFolderFailed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyAddFolderFailed + super.init(swift: swift) + } +} + +/// (data_governance) Content disposed +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyContentDisposed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyContentDisposed + super.init(swift: swift) + } +} + +/// (data_governance) Activated a new policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyCreate + super.init(swift: swift) + } +} + +/// (data_governance) Deleted a policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyDelete + super.init(swift: swift) + } +} + +/// (data_governance) Edited policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyEditDetails: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyEditDetails + super.init(swift: swift) + } +} + +/// (data_governance) Changed policy duration +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyEditDuration: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyEditDuration + super.init(swift: swift) + } +} + +/// (data_governance) Created a policy download +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyExportCreated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyExportCreated + super.init(swift: swift) + } +} + +/// (data_governance) Removed a policy download +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyExportRemoved: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyExportRemoved + super.init(swift: swift) + } +} + +/// (data_governance) Removed folders from policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyRemoveFolders: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyRemoveFolders + super.init(swift: swift) + } +} + +/// (data_governance) Created a summary report for a policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyReportCreated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyReportCreated + super.init(swift: swift) + } +} + +/// (data_governance) Downloaded content from a policy +@objc +public class DBXTeamLogEventTypeArgGovernancePolicyZipPartDownloaded: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.governancePolicyZipPartDownloaded + super.init(swift: swift) + } +} + +/// (data_governance) Activated a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsActivateAHold: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsActivateAHold + super.init(swift: swift) + } +} + +/// (data_governance) Added members to a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsAddMembers: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsAddMembers + super.init(swift: swift) + } +} + +/// (data_governance) Edited details for a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsChangeHoldDetails: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsChangeHoldDetails + super.init(swift: swift) + } +} + +/// (data_governance) Renamed a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsChangeHoldName: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsChangeHoldName + super.init(swift: swift) + } +} + +/// (data_governance) Exported hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsExportAHold: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsExportAHold + super.init(swift: swift) + } +} + +/// (data_governance) Canceled export for a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsExportCancelled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsExportCancelled + super.init(swift: swift) + } +} + +/// (data_governance) Downloaded export for a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsExportDownloaded: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsExportDownloaded + super.init(swift: swift) + } +} + +/// (data_governance) Removed export for a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsExportRemoved: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsExportRemoved + super.init(swift: swift) + } +} + +/// (data_governance) Released a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsReleaseAHold: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsReleaseAHold + super.init(swift: swift) + } +} + +/// (data_governance) Removed members from a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsRemoveMembers: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsRemoveMembers + super.init(swift: swift) + } +} + +/// (data_governance) Created a summary report for a hold +@objc +public class DBXTeamLogEventTypeArgLegalHoldsReportAHold: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.legalHoldsReportAHold + super.init(swift: swift) + } +} + +/// (devices) Changed IP address associated with active desktop session +@objc +public class DBXTeamLogEventTypeArgDeviceChangeIpDesktop: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceChangeIpDesktop + super.init(swift: swift) + } +} + +/// (devices) Changed IP address associated with active mobile session +@objc +public class DBXTeamLogEventTypeArgDeviceChangeIpMobile: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceChangeIpMobile + super.init(swift: swift) + } +} + +/// (devices) Changed IP address associated with active web session +@objc +public class DBXTeamLogEventTypeArgDeviceChangeIpWeb: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceChangeIpWeb + super.init(swift: swift) + } +} + +/// (devices) Failed to delete all files from unlinked device +@objc +public class DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkFail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceDeleteOnUnlinkFail + super.init(swift: swift) + } +} + +/// (devices) Deleted all files from unlinked device +@objc +public class DBXTeamLogEventTypeArgDeviceDeleteOnUnlinkSuccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceDeleteOnUnlinkSuccess + super.init(swift: swift) + } +} + +/// (devices) Failed to link device +@objc +public class DBXTeamLogEventTypeArgDeviceLinkFail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceLinkFail + super.init(swift: swift) + } +} + +/// (devices) Linked device +@objc +public class DBXTeamLogEventTypeArgDeviceLinkSuccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceLinkSuccess + super.init(swift: swift) + } +} + +/// (devices) Disabled device management (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgDeviceManagementDisabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceManagementDisabled + super.init(swift: swift) + } +} + +/// (devices) Enabled device management (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgDeviceManagementEnabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceManagementEnabled + super.init(swift: swift) + } +} + +/// (devices) Enabled/disabled backup for computer +@objc +public class DBXTeamLogEventTypeArgDeviceSyncBackupStatusChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceSyncBackupStatusChanged + super.init(swift: swift) + } +} + +/// (devices) Disconnected device +@objc +public class DBXTeamLogEventTypeArgDeviceUnlink: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceUnlink + super.init(swift: swift) + } +} + +/// (devices) Exported passwords +@objc +public class DBXTeamLogEventTypeArgDropboxPasswordsExported: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.dropboxPasswordsExported + super.init(swift: swift) + } +} + +/// (devices) Enrolled new Dropbox Passwords device +@objc +public class DBXTeamLogEventTypeArgDropboxPasswordsNewDeviceEnrolled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.dropboxPasswordsNewDeviceEnrolled + super.init(swift: swift) + } +} + +/// (devices) Refreshed auth token used for setting up EMM +@objc +public class DBXTeamLogEventTypeArgEmmRefreshAuthToken: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emmRefreshAuthToken + super.init(swift: swift) + } +} + +/// (devices) Checked external drive backup eligibility status +@objc +public class DBXTeamLogEventTypeArgExternalDriveBackupEligibilityStatusChecked: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.externalDriveBackupEligibilityStatusChecked + super.init(swift: swift) + } +} + +/// (devices) Modified external drive backup +@objc +public class DBXTeamLogEventTypeArgExternalDriveBackupStatusChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.externalDriveBackupStatusChanged + super.init(swift: swift) + } +} + +/// (domains) Granted/revoked option to enable account capture on team domains +@objc +public class DBXTeamLogEventTypeArgAccountCaptureChangeAvailability: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.accountCaptureChangeAvailability + super.init(swift: swift) + } +} + +/// (domains) Account-captured user migrated account to team +@objc +public class DBXTeamLogEventTypeArgAccountCaptureMigrateAccount: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.accountCaptureMigrateAccount + super.init(swift: swift) + } +} + +/// (domains) Sent account capture email to all unmanaged members +@objc +public class DBXTeamLogEventTypeArgAccountCaptureNotificationEmailsSent: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.accountCaptureNotificationEmailsSent + super.init(swift: swift) + } +} + +/// (domains) Account-captured user changed account email to personal email +@objc +public class DBXTeamLogEventTypeArgAccountCaptureRelinquishAccount: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.accountCaptureRelinquishAccount + super.init(swift: swift) + } +} + +/// (domains) Disabled domain invites (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgDisabledDomainInvites: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.disabledDomainInvites + super.init(swift: swift) + } +} + +/// (domains) Approved user's request to join team +@objc +public class DBXTeamLogEventTypeArgDomainInvitesApproveRequestToJoinTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainInvitesApproveRequestToJoinTeam + super.init(swift: swift) + } +} + +/// (domains) Declined user's request to join team +@objc +public class DBXTeamLogEventTypeArgDomainInvitesDeclineRequestToJoinTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainInvitesDeclineRequestToJoinTeam + super.init(swift: swift) + } +} + +/// (domains) Sent domain invites to existing domain accounts (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgDomainInvitesEmailExistingUsers: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainInvitesEmailExistingUsers + super.init(swift: swift) + } +} + +/// (domains) Requested to join team +@objc +public class DBXTeamLogEventTypeArgDomainInvitesRequestToJoinTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainInvitesRequestToJoinTeam + super.init(swift: swift) + } +} + +/// (domains) Disabled "Automatically invite new users" (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToNo: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainInvitesSetInviteNewUserPrefToNo + super.init(swift: swift) + } +} + +/// (domains) Enabled "Automatically invite new users" (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgDomainInvitesSetInviteNewUserPrefToYes: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainInvitesSetInviteNewUserPrefToYes + super.init(swift: swift) + } +} + +/// (domains) Failed to verify team domain +@objc +public class DBXTeamLogEventTypeArgDomainVerificationAddDomainFail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainVerificationAddDomainFail + super.init(swift: swift) + } +} + +/// (domains) Verified team domain +@objc +public class DBXTeamLogEventTypeArgDomainVerificationAddDomainSuccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainVerificationAddDomainSuccess + super.init(swift: swift) + } +} + +/// (domains) Removed domain from list of verified team domains +@objc +public class DBXTeamLogEventTypeArgDomainVerificationRemoveDomain: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.domainVerificationRemoveDomain + super.init(swift: swift) + } +} + +/// (domains) Enabled domain invites (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgEnabledDomainInvites: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.enabledDomainInvites + super.init(swift: swift) + } +} + +/// (encryption) Canceled team encryption key deletion +@objc +public class DBXTeamLogEventTypeArgTeamEncryptionKeyCancelKeyDeletion: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamEncryptionKeyCancelKeyDeletion + super.init(swift: swift) + } +} + +/// (encryption) Created team encryption key +@objc +public class DBXTeamLogEventTypeArgTeamEncryptionKeyCreateKey: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamEncryptionKeyCreateKey + super.init(swift: swift) + } +} + +/// (encryption) Deleted team encryption key +@objc +public class DBXTeamLogEventTypeArgTeamEncryptionKeyDeleteKey: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamEncryptionKeyDeleteKey + super.init(swift: swift) + } +} + +/// (encryption) Disabled team encryption key +@objc +public class DBXTeamLogEventTypeArgTeamEncryptionKeyDisableKey: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamEncryptionKeyDisableKey + super.init(swift: swift) + } +} + +/// (encryption) Enabled team encryption key +@objc +public class DBXTeamLogEventTypeArgTeamEncryptionKeyEnableKey: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamEncryptionKeyEnableKey + super.init(swift: swift) + } +} + +/// (encryption) Rotated team encryption key (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgTeamEncryptionKeyRotateKey: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamEncryptionKeyRotateKey + super.init(swift: swift) + } +} + +/// (encryption) Scheduled encryption key deletion +@objc +public class DBXTeamLogEventTypeArgTeamEncryptionKeyScheduleKeyDeletion: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamEncryptionKeyScheduleKeyDeletion + super.init(swift: swift) + } +} + +/// (file_operations) Applied naming convention +@objc +public class DBXTeamLogEventTypeArgApplyNamingConvention: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.applyNamingConvention + super.init(swift: swift) + } +} + +/// (file_operations) Created folders (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgCreateFolder: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.createFolder + super.init(swift: swift) + } +} + +/// (file_operations) Added files and/or folders +@objc +public class DBXTeamLogEventTypeArgFileAdd: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileAdd + super.init(swift: swift) + } +} + +/// (file_operations) Added files and/or folders from automation +@objc +public class DBXTeamLogEventTypeArgFileAddFromAutomation: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileAddFromAutomation + super.init(swift: swift) + } +} + +/// (file_operations) Copied files and/or folders +@objc +public class DBXTeamLogEventTypeArgFileCopy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileCopy + super.init(swift: swift) + } +} + +/// (file_operations) Deleted files and/or folders +@objc +public class DBXTeamLogEventTypeArgFileDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileDelete + super.init(swift: swift) + } +} + +/// (file_operations) Downloaded files and/or folders +@objc +public class DBXTeamLogEventTypeArgFileDownload: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileDownload + super.init(swift: swift) + } +} + +/// (file_operations) Edited files +@objc +public class DBXTeamLogEventTypeArgFileEdit: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileEdit + super.init(swift: swift) + } +} + +/// (file_operations) Created copy reference to file/folder +@objc +public class DBXTeamLogEventTypeArgFileGetCopyReference: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileGetCopyReference + super.init(swift: swift) + } +} + +/// (file_operations) Locked/unlocked editing for a file +@objc +public class DBXTeamLogEventTypeArgFileLockingLockStatusChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileLockingLockStatusChanged + super.init(swift: swift) + } +} + +/// (file_operations) Moved files and/or folders +@objc +public class DBXTeamLogEventTypeArgFileMove: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileMove + super.init(swift: swift) + } +} + +/// (file_operations) Permanently deleted files and/or folders +@objc +public class DBXTeamLogEventTypeArgFilePermanentlyDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.filePermanentlyDelete + super.init(swift: swift) + } +} + +/// (file_operations) Previewed files and/or folders +@objc +public class DBXTeamLogEventTypeArgFilePreview: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.filePreview + super.init(swift: swift) + } +} + +/// (file_operations) Renamed files and/or folders +@objc +public class DBXTeamLogEventTypeArgFileRename: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRename + super.init(swift: swift) + } +} + +/// (file_operations) Restored deleted files and/or folders +@objc +public class DBXTeamLogEventTypeArgFileRestore: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRestore + super.init(swift: swift) + } +} + +/// (file_operations) Reverted files to previous version +@objc +public class DBXTeamLogEventTypeArgFileRevert: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRevert + super.init(swift: swift) + } +} + +/// (file_operations) Rolled back file actions +@objc +public class DBXTeamLogEventTypeArgFileRollbackChanges: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRollbackChanges + super.init(swift: swift) + } +} + +/// (file_operations) Saved file/folder using copy reference +@objc +public class DBXTeamLogEventTypeArgFileSaveCopyReference: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileSaveCopyReference + super.init(swift: swift) + } +} + +/// (file_operations) Updated folder overview +@objc +public class DBXTeamLogEventTypeArgFolderOverviewDescriptionChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.folderOverviewDescriptionChanged + super.init(swift: swift) + } +} + +/// (file_operations) Pinned item to folder overview +@objc +public class DBXTeamLogEventTypeArgFolderOverviewItemPinned: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.folderOverviewItemPinned + super.init(swift: swift) + } +} + +/// (file_operations) Unpinned item from folder overview +@objc +public class DBXTeamLogEventTypeArgFolderOverviewItemUnpinned: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.folderOverviewItemUnpinned + super.init(swift: swift) + } +} + +/// (file_operations) Added a label +@objc +public class DBXTeamLogEventTypeArgObjectLabelAdded: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.objectLabelAdded + super.init(swift: swift) + } +} + +/// (file_operations) Removed a label +@objc +public class DBXTeamLogEventTypeArgObjectLabelRemoved: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.objectLabelRemoved + super.init(swift: swift) + } +} + +/// (file_operations) Updated a label's value +@objc +public class DBXTeamLogEventTypeArgObjectLabelUpdatedValue: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.objectLabelUpdatedValue + super.init(swift: swift) + } +} + +/// (file_operations) Organized a folder with multi-file organize +@objc +public class DBXTeamLogEventTypeArgOrganizeFolderWithTidy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.organizeFolderWithTidy + super.init(swift: swift) + } +} + +/// (file_operations) Deleted files in Replay +@objc +public class DBXTeamLogEventTypeArgReplayFileDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.replayFileDelete + super.init(swift: swift) + } +} + +/// (file_operations) Rewound a folder +@objc +public class DBXTeamLogEventTypeArgRewindFolder: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.rewindFolder + super.init(swift: swift) + } +} + +/// (file_operations) Reverted naming convention +@objc +public class DBXTeamLogEventTypeArgUndoNamingConvention: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.undoNamingConvention + super.init(swift: swift) + } +} + +/// (file_operations) Removed multi-file organize +@objc +public class DBXTeamLogEventTypeArgUndoOrganizeFolderWithTidy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.undoOrganizeFolderWithTidy + super.init(swift: swift) + } +} + +/// (file_operations) Tagged a file +@objc +public class DBXTeamLogEventTypeArgUserTagsAdded: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.userTagsAdded + super.init(swift: swift) + } +} + +/// (file_operations) Removed tags +@objc +public class DBXTeamLogEventTypeArgUserTagsRemoved: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.userTagsRemoved + super.init(swift: swift) + } +} + +/// (file_requests) Received files via Email to Dropbox +@objc +public class DBXTeamLogEventTypeArgEmailIngestReceiveFile: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emailIngestReceiveFile + super.init(swift: swift) + } +} + +/// (file_requests) Changed file request +@objc +public class DBXTeamLogEventTypeArgFileRequestChange: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestChange + super.init(swift: swift) + } +} + +/// (file_requests) Closed file request +@objc +public class DBXTeamLogEventTypeArgFileRequestClose: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestClose + super.init(swift: swift) + } +} + +/// (file_requests) Created file request +@objc +public class DBXTeamLogEventTypeArgFileRequestCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestCreate + super.init(swift: swift) + } +} + +/// (file_requests) Delete file request +@objc +public class DBXTeamLogEventTypeArgFileRequestDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestDelete + super.init(swift: swift) + } +} + +/// (file_requests) Received files for file request +@objc +public class DBXTeamLogEventTypeArgFileRequestReceiveFile: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestReceiveFile + super.init(swift: swift) + } +} + +/// (groups) Added external ID for group +@objc +public class DBXTeamLogEventTypeArgGroupAddExternalId: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupAddExternalId + super.init(swift: swift) + } +} + +/// (groups) Added team members to group +@objc +public class DBXTeamLogEventTypeArgGroupAddMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupAddMember + super.init(swift: swift) + } +} + +/// (groups) Changed external ID for group +@objc +public class DBXTeamLogEventTypeArgGroupChangeExternalId: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupChangeExternalId + super.init(swift: swift) + } +} + +/// (groups) Changed group management type +@objc +public class DBXTeamLogEventTypeArgGroupChangeManagementType: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupChangeManagementType + super.init(swift: swift) + } +} + +/// (groups) Changed manager permissions of group member +@objc +public class DBXTeamLogEventTypeArgGroupChangeMemberRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupChangeMemberRole + super.init(swift: swift) + } +} + +/// (groups) Created group +@objc +public class DBXTeamLogEventTypeArgGroupCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupCreate + super.init(swift: swift) + } +} + +/// (groups) Deleted group +@objc +public class DBXTeamLogEventTypeArgGroupDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupDelete + super.init(swift: swift) + } +} + +/// (groups) Updated group (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgGroupDescriptionUpdated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupDescriptionUpdated + super.init(swift: swift) + } +} + +/// (groups) Updated group join policy (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgGroupJoinPolicyUpdated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupJoinPolicyUpdated + super.init(swift: swift) + } +} + +/// (groups) Moved group (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgGroupMoved: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupMoved + super.init(swift: swift) + } +} + +/// (groups) Removed external ID for group +@objc +public class DBXTeamLogEventTypeArgGroupRemoveExternalId: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupRemoveExternalId + super.init(swift: swift) + } +} + +/// (groups) Removed team members from group +@objc +public class DBXTeamLogEventTypeArgGroupRemoveMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupRemoveMember + super.init(swift: swift) + } +} + +/// (groups) Renamed group +@objc +public class DBXTeamLogEventTypeArgGroupRename: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupRename + super.init(swift: swift) + } +} + +/// (logins) Unlocked/locked account after failed sign in attempts +@objc +public class DBXTeamLogEventTypeArgAccountLockOrUnlocked: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.accountLockOrUnlocked + super.init(swift: swift) + } +} + +/// (logins) Failed to sign in via EMM (deprecated, replaced by 'Failed to sign in') +@objc +public class DBXTeamLogEventTypeArgEmmError: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emmError + super.init(swift: swift) + } +} + +/// (logins) Started trusted team admin session +@objc +public class DBXTeamLogEventTypeArgGuestAdminSignedInViaTrustedTeams: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.guestAdminSignedInViaTrustedTeams + super.init(swift: swift) + } +} + +/// (logins) Ended trusted team admin session +@objc +public class DBXTeamLogEventTypeArgGuestAdminSignedOutViaTrustedTeams: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.guestAdminSignedOutViaTrustedTeams + super.init(swift: swift) + } +} + +/// (logins) Failed to sign in +@objc +public class DBXTeamLogEventTypeArgLoginFail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.loginFail + super.init(swift: swift) + } +} + +/// (logins) Signed in +@objc +public class DBXTeamLogEventTypeArgLoginSuccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.loginSuccess + super.init(swift: swift) + } +} + +/// (logins) Signed out +@objc +public class DBXTeamLogEventTypeArgLogout: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.logout + super.init(swift: swift) + } +} + +/// (logins) Ended reseller support session +@objc +public class DBXTeamLogEventTypeArgResellerSupportSessionEnd: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.resellerSupportSessionEnd + super.init(swift: swift) + } +} + +/// (logins) Started reseller support session +@objc +public class DBXTeamLogEventTypeArgResellerSupportSessionStart: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.resellerSupportSessionStart + super.init(swift: swift) + } +} + +/// (logins) Ended admin sign-in-as session +@objc +public class DBXTeamLogEventTypeArgSignInAsSessionEnd: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.signInAsSessionEnd + super.init(swift: swift) + } +} + +/// (logins) Started admin sign-in-as session +@objc +public class DBXTeamLogEventTypeArgSignInAsSessionStart: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.signInAsSessionStart + super.init(swift: swift) + } +} + +/// (logins) Failed to sign in via SSO (deprecated, replaced by 'Failed to sign in') +@objc +public class DBXTeamLogEventTypeArgSsoError: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoError + super.init(swift: swift) + } +} + +/// (members) Invited members to activate Backup +@objc +public class DBXTeamLogEventTypeArgBackupAdminInvitationSent: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.backupAdminInvitationSent + super.init(swift: swift) + } +} + +/// (members) Opened Backup invite +@objc +public class DBXTeamLogEventTypeArgBackupInvitationOpened: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.backupInvitationOpened + super.init(swift: swift) + } +} + +/// (members) Created team invite link +@objc +public class DBXTeamLogEventTypeArgCreateTeamInviteLink: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.createTeamInviteLink + super.init(swift: swift) + } +} + +/// (members) Deleted team invite link +@objc +public class DBXTeamLogEventTypeArgDeleteTeamInviteLink: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deleteTeamInviteLink + super.init(swift: swift) + } +} + +/// (members) Added an external ID for team member +@objc +public class DBXTeamLogEventTypeArgMemberAddExternalId: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberAddExternalId + super.init(swift: swift) + } +} + +/// (members) Added team member name +@objc +public class DBXTeamLogEventTypeArgMemberAddName: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberAddName + super.init(swift: swift) + } +} + +/// (members) Changed team member admin role +@objc +public class DBXTeamLogEventTypeArgMemberChangeAdminRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberChangeAdminRole + super.init(swift: swift) + } +} + +/// (members) Changed team member email +@objc +public class DBXTeamLogEventTypeArgMemberChangeEmail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberChangeEmail + super.init(swift: swift) + } +} + +/// (members) Changed the external ID for team member +@objc +public class DBXTeamLogEventTypeArgMemberChangeExternalId: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberChangeExternalId + super.init(swift: swift) + } +} + +/// (members) Changed membership type (limited/full) of member (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgMemberChangeMembershipType: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberChangeMembershipType + super.init(swift: swift) + } +} + +/// (members) Changed team member name +@objc +public class DBXTeamLogEventTypeArgMemberChangeName: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberChangeName + super.init(swift: swift) + } +} + +/// (members) Changed team member reseller role +@objc +public class DBXTeamLogEventTypeArgMemberChangeResellerRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberChangeResellerRole + super.init(swift: swift) + } +} + +/// (members) Changed member status (invited, joined, suspended, etc.) +@objc +public class DBXTeamLogEventTypeArgMemberChangeStatus: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberChangeStatus + super.init(swift: swift) + } +} + +/// (members) Cleared manually added contacts +@objc +public class DBXTeamLogEventTypeArgMemberDeleteManualContacts: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberDeleteManualContacts + super.init(swift: swift) + } +} + +/// (members) Deleted team member profile photo +@objc +public class DBXTeamLogEventTypeArgMemberDeleteProfilePhoto: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberDeleteProfilePhoto + super.init(swift: swift) + } +} + +/// (members) Permanently deleted contents of deleted team member account +@objc +public class DBXTeamLogEventTypeArgMemberPermanentlyDeleteAccountContents: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberPermanentlyDeleteAccountContents + super.init(swift: swift) + } +} + +/// (members) Removed the external ID for team member +@objc +public class DBXTeamLogEventTypeArgMemberRemoveExternalId: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberRemoveExternalId + super.init(swift: swift) + } +} + +/// (members) Set team member profile photo +@objc +public class DBXTeamLogEventTypeArgMemberSetProfilePhoto: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSetProfilePhoto + super.init(swift: swift) + } +} + +/// (members) Set custom member space limit +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsAddCustomQuota: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsAddCustomQuota + super.init(swift: swift) + } +} + +/// (members) Changed custom member space limit +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCustomQuota: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsChangeCustomQuota + super.init(swift: swift) + } +} + +/// (members) Changed space limit status +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsChangeStatus: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsChangeStatus + super.init(swift: swift) + } +} + +/// (members) Removed custom member space limit +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveCustomQuota: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsRemoveCustomQuota + super.init(swift: swift) + } +} + +/// (members) Suggested person to add to team +@objc +public class DBXTeamLogEventTypeArgMemberSuggest: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSuggest + super.init(swift: swift) + } +} + +/// (members) Transferred contents of deleted member account to another member +@objc +public class DBXTeamLogEventTypeArgMemberTransferAccountContents: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberTransferAccountContents + super.init(swift: swift) + } +} + +/// (members) Added pending secondary email +@objc +public class DBXTeamLogEventTypeArgPendingSecondaryEmailAdded: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.pendingSecondaryEmailAdded + super.init(swift: swift) + } +} + +/// (members) Deleted secondary email +@objc +public class DBXTeamLogEventTypeArgSecondaryEmailDeleted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.secondaryEmailDeleted + super.init(swift: swift) + } +} + +/// (members) Verified secondary email +@objc +public class DBXTeamLogEventTypeArgSecondaryEmailVerified: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.secondaryEmailVerified + super.init(swift: swift) + } +} + +/// (members) Secondary mails policy changed +@objc +public class DBXTeamLogEventTypeArgSecondaryMailsPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.secondaryMailsPolicyChanged + super.init(swift: swift) + } +} + +/// (paper) Added Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderAddPage: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderAddPage + super.init(swift: swift) + } +} + +/// (paper) Added Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderAddSection: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderAddSection + super.init(swift: swift) + } +} + +/// (paper) Removed Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderRemovePage: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderRemovePage + super.init(swift: swift) + } +} + +/// (paper) Removed Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderRemoveSection: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderRemoveSection + super.init(swift: swift) + } +} + +/// (paper) Renamed Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderRenamePage: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderRenamePage + super.init(swift: swift) + } +} + +/// (paper) Renamed Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderRenameSection: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderRenameSection + super.init(swift: swift) + } +} + +/// (paper) Reordered Binder page (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderReorderPage: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderReorderPage + super.init(swift: swift) + } +} + +/// (paper) Reordered Binder section (deprecated, replaced by 'Edited files') +@objc +public class DBXTeamLogEventTypeArgBinderReorderSection: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.binderReorderSection + super.init(swift: swift) + } +} + +/// (paper) Added users and/or groups to Paper doc/folder +@objc +public class DBXTeamLogEventTypeArgPaperContentAddMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentAddMember + super.init(swift: swift) + } +} + +/// (paper) Added Paper doc/folder to folder +@objc +public class DBXTeamLogEventTypeArgPaperContentAddToFolder: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentAddToFolder + super.init(swift: swift) + } +} + +/// (paper) Archived Paper doc/folder +@objc +public class DBXTeamLogEventTypeArgPaperContentArchive: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentArchive + super.init(swift: swift) + } +} + +/// (paper) Created Paper doc/folder +@objc +public class DBXTeamLogEventTypeArgPaperContentCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentCreate + super.init(swift: swift) + } +} + +/// (paper) Permanently deleted Paper doc/folder +@objc +public class DBXTeamLogEventTypeArgPaperContentPermanentlyDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentPermanentlyDelete + super.init(swift: swift) + } +} + +/// (paper) Removed Paper doc/folder from folder +@objc +public class DBXTeamLogEventTypeArgPaperContentRemoveFromFolder: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentRemoveFromFolder + super.init(swift: swift) + } +} + +/// (paper) Removed users and/or groups from Paper doc/folder +@objc +public class DBXTeamLogEventTypeArgPaperContentRemoveMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentRemoveMember + super.init(swift: swift) + } +} + +/// (paper) Renamed Paper doc/folder +@objc +public class DBXTeamLogEventTypeArgPaperContentRename: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentRename + super.init(swift: swift) + } +} + +/// (paper) Restored archived Paper doc/folder +@objc +public class DBXTeamLogEventTypeArgPaperContentRestore: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperContentRestore + super.init(swift: swift) + } +} + +/// (paper) Added Paper doc comment +@objc +public class DBXTeamLogEventTypeArgPaperDocAddComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocAddComment + super.init(swift: swift) + } +} + +/// (paper) Changed member permissions for Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocChangeMemberRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocChangeMemberRole + super.init(swift: swift) + } +} + +/// (paper) Changed sharing setting for Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocChangeSharingPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocChangeSharingPolicy + super.init(swift: swift) + } +} + +/// (paper) Followed/unfollowed Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocChangeSubscription: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocChangeSubscription + super.init(swift: swift) + } +} + +/// (paper) Archived Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperDocDeleted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocDeleted + super.init(swift: swift) + } +} + +/// (paper) Deleted Paper doc comment +@objc +public class DBXTeamLogEventTypeArgPaperDocDeleteComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocDeleteComment + super.init(swift: swift) + } +} + +/// (paper) Downloaded Paper doc in specific format +@objc +public class DBXTeamLogEventTypeArgPaperDocDownload: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocDownload + super.init(swift: swift) + } +} + +/// (paper) Edited Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocEdit: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocEdit + super.init(swift: swift) + } +} + +/// (paper) Edited Paper doc comment +@objc +public class DBXTeamLogEventTypeArgPaperDocEditComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocEditComment + super.init(swift: swift) + } +} + +/// (paper) Followed Paper doc (deprecated, replaced by 'Followed/unfollowed Paper doc') +@objc +public class DBXTeamLogEventTypeArgPaperDocFollowed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocFollowed + super.init(swift: swift) + } +} + +/// (paper) Mentioned user in Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocMention: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocMention + super.init(swift: swift) + } +} + +/// (paper) Transferred ownership of Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocOwnershipChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocOwnershipChanged + super.init(swift: swift) + } +} + +/// (paper) Requested access to Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocRequestAccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocRequestAccess + super.init(swift: swift) + } +} + +/// (paper) Resolved Paper doc comment +@objc +public class DBXTeamLogEventTypeArgPaperDocResolveComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocResolveComment + super.init(swift: swift) + } +} + +/// (paper) Restored Paper doc to previous version +@objc +public class DBXTeamLogEventTypeArgPaperDocRevert: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocRevert + super.init(swift: swift) + } +} + +/// (paper) Shared Paper doc via Slack +@objc +public class DBXTeamLogEventTypeArgPaperDocSlackShare: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocSlackShare + super.init(swift: swift) + } +} + +/// (paper) Shared Paper doc with users and/or groups (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperDocTeamInvite: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocTeamInvite + super.init(swift: swift) + } +} + +/// (paper) Deleted Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocTrashed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocTrashed + super.init(swift: swift) + } +} + +/// (paper) Unresolved Paper doc comment +@objc +public class DBXTeamLogEventTypeArgPaperDocUnresolveComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocUnresolveComment + super.init(swift: swift) + } +} + +/// (paper) Restored Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocUntrashed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocUntrashed + super.init(swift: swift) + } +} + +/// (paper) Viewed Paper doc +@objc +public class DBXTeamLogEventTypeArgPaperDocView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDocView + super.init(swift: swift) + } +} + +/// (paper) Changed Paper external sharing setting to anyone (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperExternalViewAllow: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperExternalViewAllow + super.init(swift: swift) + } +} + +/// (paper) Changed Paper external sharing setting to default team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperExternalViewDefaultTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperExternalViewDefaultTeam + super.init(swift: swift) + } +} + +/// (paper) Changed Paper external sharing setting to team-only (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperExternalViewForbid: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperExternalViewForbid + super.init(swift: swift) + } +} + +/// (paper) Followed/unfollowed Paper folder +@objc +public class DBXTeamLogEventTypeArgPaperFolderChangeSubscription: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperFolderChangeSubscription + super.init(swift: swift) + } +} + +/// (paper) Archived Paper folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperFolderDeleted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperFolderDeleted + super.init(swift: swift) + } +} + +/// (paper) Followed Paper folder (deprecated, replaced by 'Followed/unfollowed Paper folder') +@objc +public class DBXTeamLogEventTypeArgPaperFolderFollowed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperFolderFollowed + super.init(swift: swift) + } +} + +/// (paper) Shared Paper folder with users and/or groups (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperFolderTeamInvite: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperFolderTeamInvite + super.init(swift: swift) + } +} + +/// (paper) Changed permissions for published doc +@objc +public class DBXTeamLogEventTypeArgPaperPublishedLinkChangePermission: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperPublishedLinkChangePermission + super.init(swift: swift) + } +} + +/// (paper) Published doc +@objc +public class DBXTeamLogEventTypeArgPaperPublishedLinkCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperPublishedLinkCreate + super.init(swift: swift) + } +} + +/// (paper) Unpublished doc +@objc +public class DBXTeamLogEventTypeArgPaperPublishedLinkDisabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperPublishedLinkDisabled + super.init(swift: swift) + } +} + +/// (paper) Viewed published doc +@objc +public class DBXTeamLogEventTypeArgPaperPublishedLinkView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperPublishedLinkView + super.init(swift: swift) + } +} + +/// (passwords) Changed password +@objc +public class DBXTeamLogEventTypeArgPasswordChange: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.passwordChange + super.init(swift: swift) + } +} + +/// (passwords) Reset password +@objc +public class DBXTeamLogEventTypeArgPasswordReset: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.passwordReset + super.init(swift: swift) + } +} + +/// (passwords) Reset all team member passwords +@objc +public class DBXTeamLogEventTypeArgPasswordResetAll: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.passwordResetAll + super.init(swift: swift) + } +} + +/// (reports) Created Classification report +@objc +public class DBXTeamLogEventTypeArgClassificationCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.classificationCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't create Classification report +@objc +public class DBXTeamLogEventTypeArgClassificationCreateReportFail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.classificationCreateReportFail + super.init(swift: swift) + } +} + +/// (reports) Created EMM-excluded users report +@objc +public class DBXTeamLogEventTypeArgEmmCreateExceptionsReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emmCreateExceptionsReport + super.init(swift: swift) + } +} + +/// (reports) Created EMM mobile app usage report +@objc +public class DBXTeamLogEventTypeArgEmmCreateUsageReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emmCreateUsageReport + super.init(swift: swift) + } +} + +/// (reports) Created member data report +@objc +public class DBXTeamLogEventTypeArgExportMembersReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.exportMembersReport + super.init(swift: swift) + } +} + +/// (reports) Failed to create members data report +@objc +public class DBXTeamLogEventTypeArgExportMembersReportFail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.exportMembersReportFail + super.init(swift: swift) + } +} + +/// (reports) Created External sharing report +@objc +public class DBXTeamLogEventTypeArgExternalSharingCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.externalSharingCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't create External sharing report +@objc +public class DBXTeamLogEventTypeArgExternalSharingReportFailed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.externalSharingReportFailed + super.init(swift: swift) + } +} + +/// (reports) Report created: Links created with no expiration +@objc +public class DBXTeamLogEventTypeArgNoExpirationLinkGenCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noExpirationLinkGenCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Links created with no expiration +@objc +public class DBXTeamLogEventTypeArgNoExpirationLinkGenReportFailed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noExpirationLinkGenReportFailed + super.init(swift: swift) + } +} + +/// (reports) Report created: Links created without passwords +@objc +public class DBXTeamLogEventTypeArgNoPasswordLinkGenCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noPasswordLinkGenCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Links created without passwords +@objc +public class DBXTeamLogEventTypeArgNoPasswordLinkGenReportFailed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noPasswordLinkGenReportFailed + super.init(swift: swift) + } +} + +/// (reports) Report created: Views of links without passwords +@objc +public class DBXTeamLogEventTypeArgNoPasswordLinkViewCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noPasswordLinkViewCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Views of links without passwords +@objc +public class DBXTeamLogEventTypeArgNoPasswordLinkViewReportFailed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noPasswordLinkViewReportFailed + super.init(swift: swift) + } +} + +/// (reports) Report created: Views of old links +@objc +public class DBXTeamLogEventTypeArgOutdatedLinkViewCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.outdatedLinkViewCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't create report: Views of old links +@objc +public class DBXTeamLogEventTypeArgOutdatedLinkViewReportFailed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.outdatedLinkViewReportFailed + super.init(swift: swift) + } +} + +/// (reports) Exported all team Paper docs +@objc +public class DBXTeamLogEventTypeArgPaperAdminExportStart: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperAdminExportStart + super.init(swift: swift) + } +} + +/// (reports) Created ransomware report +@objc +public class DBXTeamLogEventTypeArgRansomwareAlertCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ransomwareAlertCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't generate ransomware report +@objc +public class DBXTeamLogEventTypeArgRansomwareAlertCreateReportFailed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ransomwareAlertCreateReportFailed + super.init(swift: swift) + } +} + +/// (reports) Created Smart Sync non-admin devices report +@objc +public class DBXTeamLogEventTypeArgSmartSyncCreateAdminPrivilegeReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.smartSyncCreateAdminPrivilegeReport + super.init(swift: swift) + } +} + +/// (reports) Created team activity report +@objc +public class DBXTeamLogEventTypeArgTeamActivityCreateReport: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamActivityCreateReport + super.init(swift: swift) + } +} + +/// (reports) Couldn't generate team activity report +@objc +public class DBXTeamLogEventTypeArgTeamActivityCreateReportFail: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamActivityCreateReportFail + super.init(swift: swift) + } +} + +/// (sharing) Shared album +@objc +public class DBXTeamLogEventTypeArgCollectionShare: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.collectionShare + super.init(swift: swift) + } +} + +/// (sharing) Transfer files added +@objc +public class DBXTeamLogEventTypeArgFileTransfersFileAdd: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileTransfersFileAdd + super.init(swift: swift) + } +} + +/// (sharing) Deleted transfer +@objc +public class DBXTeamLogEventTypeArgFileTransfersTransferDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileTransfersTransferDelete + super.init(swift: swift) + } +} + +/// (sharing) Transfer downloaded +@objc +public class DBXTeamLogEventTypeArgFileTransfersTransferDownload: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileTransfersTransferDownload + super.init(swift: swift) + } +} + +/// (sharing) Sent transfer +@objc +public class DBXTeamLogEventTypeArgFileTransfersTransferSend: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileTransfersTransferSend + super.init(swift: swift) + } +} + +/// (sharing) Viewed transfer +@objc +public class DBXTeamLogEventTypeArgFileTransfersTransferView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileTransfersTransferView + super.init(swift: swift) + } +} + +/// (sharing) Changed Paper doc to invite-only (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgNoteAclInviteOnly: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noteAclInviteOnly + super.init(swift: swift) + } +} + +/// (sharing) Changed Paper doc to link-accessible (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgNoteAclLink: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noteAclLink + super.init(swift: swift) + } +} + +/// (sharing) Changed Paper doc to link-accessible for team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgNoteAclTeamLink: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noteAclTeamLink + super.init(swift: swift) + } +} + +/// (sharing) Shared Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgNoteShared: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noteShared + super.init(swift: swift) + } +} + +/// (sharing) Shared received Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgNoteShareReceive: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.noteShareReceive + super.init(swift: swift) + } +} + +/// (sharing) Opened shared Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgOpenNoteShared: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.openNoteShared + super.init(swift: swift) + } +} + +/// (sharing) Created shared link in Replay +@objc +public class DBXTeamLogEventTypeArgReplayFileSharedLinkCreated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.replayFileSharedLinkCreated + super.init(swift: swift) + } +} + +/// (sharing) Modified shared link in Replay +@objc +public class DBXTeamLogEventTypeArgReplayFileSharedLinkModified: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.replayFileSharedLinkModified + super.init(swift: swift) + } +} + +/// (sharing) Added member to Replay Project +@objc +public class DBXTeamLogEventTypeArgReplayProjectTeamAdd: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.replayProjectTeamAdd + super.init(swift: swift) + } +} + +/// (sharing) Removed member from Replay Project +@objc +public class DBXTeamLogEventTypeArgReplayProjectTeamDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.replayProjectTeamDelete + super.init(swift: swift) + } +} + +/// (sharing) Added team to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfAddGroup: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfAddGroup + super.init(swift: swift) + } +} + +/// (sharing) Allowed non-collaborators to view links to files in shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfAllowNonMembersToViewSharedLinks: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfAllowNonMembersToViewSharedLinks + super.init(swift: swift) + } +} + +/// (sharing) Set team members to see warning before sharing folders outside team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfExternalInviteWarn: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfExternalInviteWarn + super.init(swift: swift) + } +} + +/// (sharing) Invited Facebook users to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfFbInvite: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfFbInvite + super.init(swift: swift) + } +} + +/// (sharing) Changed Facebook user's role in shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfFbInviteChangeRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfFbInviteChangeRole + super.init(swift: swift) + } +} + +/// (sharing) Uninvited Facebook user from shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfFbUninvite: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfFbUninvite + super.init(swift: swift) + } +} + +/// (sharing) Invited group to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfInviteGroup: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfInviteGroup + super.init(swift: swift) + } +} + +/// (sharing) Granted access to shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfTeamGrantAccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfTeamGrantAccess + super.init(swift: swift) + } +} + +/// (sharing) Invited team members to shared folder (deprecated, replaced by 'Invited user to Dropbox and added +/// them to shared file/folder') +@objc +public class DBXTeamLogEventTypeArgSfTeamInvite: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfTeamInvite + super.init(swift: swift) + } +} + +/// (sharing) Changed team member's role in shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfTeamInviteChangeRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfTeamInviteChangeRole + super.init(swift: swift) + } +} + +/// (sharing) Joined team member's shared folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfTeamJoin: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfTeamJoin + super.init(swift: swift) + } +} + +/// (sharing) Joined team member's shared folder from link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSfTeamJoinFromOobLink: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfTeamJoinFromOobLink + super.init(swift: swift) + } +} + +/// (sharing) Unshared folder with team member (deprecated, replaced by 'Removed invitee from shared file/folder +/// before invite was accepted') +@objc +public class DBXTeamLogEventTypeArgSfTeamUninvite: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sfTeamUninvite + super.init(swift: swift) + } +} + +/// (sharing) Invited user to Dropbox and added them to shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentAddInvitees: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentAddInvitees + super.init(swift: swift) + } +} + +/// (sharing) Added expiration date to link for shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentAddLinkExpiry: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentAddLinkExpiry + super.init(swift: swift) + } +} + +/// (sharing) Added password to link for shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentAddLinkPassword: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentAddLinkPassword + super.init(swift: swift) + } +} + +/// (sharing) Added users and/or groups to shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentAddMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentAddMember + super.init(swift: swift) + } +} + +/// (sharing) Changed whether members can download shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentChangeDownloadsPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentChangeDownloadsPolicy + super.init(swift: swift) + } +} + +/// (sharing) Changed access type of invitee to shared file/folder before invite was accepted +@objc +public class DBXTeamLogEventTypeArgSharedContentChangeInviteeRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentChangeInviteeRole + super.init(swift: swift) + } +} + +/// (sharing) Changed link audience of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentChangeLinkAudience: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentChangeLinkAudience + super.init(swift: swift) + } +} + +/// (sharing) Changed link expiration of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentChangeLinkExpiry: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentChangeLinkExpiry + super.init(swift: swift) + } +} + +/// (sharing) Changed link password of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentChangeLinkPassword: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentChangeLinkPassword + super.init(swift: swift) + } +} + +/// (sharing) Changed access type of shared file/folder member +@objc +public class DBXTeamLogEventTypeArgSharedContentChangeMemberRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentChangeMemberRole + super.init(swift: swift) + } +} + +/// (sharing) Changed whether members can see who viewed shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentChangeViewerInfoPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentChangeViewerInfoPolicy + super.init(swift: swift) + } +} + +/// (sharing) Acquired membership of shared file/folder by accepting invite +@objc +public class DBXTeamLogEventTypeArgSharedContentClaimInvitation: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentClaimInvitation + super.init(swift: swift) + } +} + +/// (sharing) Copied shared file/folder to own Dropbox +@objc +public class DBXTeamLogEventTypeArgSharedContentCopy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentCopy + super.init(swift: swift) + } +} + +/// (sharing) Downloaded shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentDownload: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentDownload + super.init(swift: swift) + } +} + +/// (sharing) Left shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentRelinquishMembership: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRelinquishMembership + super.init(swift: swift) + } +} + +/// (sharing) Removed invitee from shared file/folder before invite was accepted +@objc +public class DBXTeamLogEventTypeArgSharedContentRemoveInvitees: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRemoveInvitees + super.init(swift: swift) + } +} + +/// (sharing) Removed link expiration date of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentRemoveLinkExpiry: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRemoveLinkExpiry + super.init(swift: swift) + } +} + +/// (sharing) Removed link password of shared file/folder (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedContentRemoveLinkPassword: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRemoveLinkPassword + super.init(swift: swift) + } +} + +/// (sharing) Removed user/group from shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentRemoveMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRemoveMember + super.init(swift: swift) + } +} + +/// (sharing) Requested access to shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentRequestAccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRequestAccess + super.init(swift: swift) + } +} + +/// (sharing) Restored shared file/folder invitees +@objc +public class DBXTeamLogEventTypeArgSharedContentRestoreInvitees: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRestoreInvitees + super.init(swift: swift) + } +} + +/// (sharing) Restored users and/or groups to membership of shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentRestoreMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentRestoreMember + super.init(swift: swift) + } +} + +/// (sharing) Unshared file/folder by clearing membership +@objc +public class DBXTeamLogEventTypeArgSharedContentUnshare: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentUnshare + super.init(swift: swift) + } +} + +/// (sharing) Previewed shared file/folder +@objc +public class DBXTeamLogEventTypeArgSharedContentView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedContentView + super.init(swift: swift) + } +} + +/// (sharing) Changed who can access shared folder via link +@objc +public class DBXTeamLogEventTypeArgSharedFolderChangeLinkPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderChangeLinkPolicy + super.init(swift: swift) + } +} + +/// (sharing) Changed whether shared folder inherits members from parent folder +@objc +public class DBXTeamLogEventTypeArgSharedFolderChangeMembersInheritancePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderChangeMembersInheritancePolicy + super.init(swift: swift) + } +} + +/// (sharing) Changed who can add/remove members of shared folder +@objc +public class DBXTeamLogEventTypeArgSharedFolderChangeMembersManagementPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderChangeMembersManagementPolicy + super.init(swift: swift) + } +} + +/// (sharing) Changed who can become member of shared folder +@objc +public class DBXTeamLogEventTypeArgSharedFolderChangeMembersPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderChangeMembersPolicy + super.init(swift: swift) + } +} + +/// (sharing) Created shared folder +@objc +public class DBXTeamLogEventTypeArgSharedFolderCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderCreate + super.init(swift: swift) + } +} + +/// (sharing) Declined team member's invite to shared folder +@objc +public class DBXTeamLogEventTypeArgSharedFolderDeclineInvitation: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderDeclineInvitation + super.init(swift: swift) + } +} + +/// (sharing) Added shared folder to own Dropbox +@objc +public class DBXTeamLogEventTypeArgSharedFolderMount: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderMount + super.init(swift: swift) + } +} + +/// (sharing) Changed parent of shared folder +@objc +public class DBXTeamLogEventTypeArgSharedFolderNest: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderNest + super.init(swift: swift) + } +} + +/// (sharing) Transferred ownership of shared folder to another member +@objc +public class DBXTeamLogEventTypeArgSharedFolderTransferOwnership: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderTransferOwnership + super.init(swift: swift) + } +} + +/// (sharing) Deleted shared folder from Dropbox +@objc +public class DBXTeamLogEventTypeArgSharedFolderUnmount: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedFolderUnmount + super.init(swift: swift) + } +} + +/// (sharing) Added shared link expiration date +@objc +public class DBXTeamLogEventTypeArgSharedLinkAddExpiry: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkAddExpiry + super.init(swift: swift) + } +} + +/// (sharing) Changed shared link expiration date +@objc +public class DBXTeamLogEventTypeArgSharedLinkChangeExpiry: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkChangeExpiry + super.init(swift: swift) + } +} + +/// (sharing) Changed visibility of shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkChangeVisibility: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkChangeVisibility + super.init(swift: swift) + } +} + +/// (sharing) Added file/folder to Dropbox from shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkCopy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkCopy + super.init(swift: swift) + } +} + +/// (sharing) Created shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkCreate + super.init(swift: swift) + } +} + +/// (sharing) Removed shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkDisable: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkDisable + super.init(swift: swift) + } +} + +/// (sharing) Downloaded file/folder from shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkDownload: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkDownload + super.init(swift: swift) + } +} + +/// (sharing) Removed shared link expiration date +@objc +public class DBXTeamLogEventTypeArgSharedLinkRemoveExpiry: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkRemoveExpiry + super.init(swift: swift) + } +} + +/// (sharing) Added an expiration date to the shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsAddExpiration: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsAddExpiration + super.init(swift: swift) + } +} + +/// (sharing) Added a password to the shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsAddPassword: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsAddPassword + super.init(swift: swift) + } +} + +/// (sharing) Disabled downloads +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadDisabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsAllowDownloadDisabled + super.init(swift: swift) + } +} + +/// (sharing) Enabled downloads +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsAllowDownloadEnabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsAllowDownloadEnabled + super.init(swift: swift) + } +} + +/// (sharing) Changed the audience of the shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsChangeAudience: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsChangeAudience + super.init(swift: swift) + } +} + +/// (sharing) Changed the expiration date of the shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsChangeExpiration: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsChangeExpiration + super.init(swift: swift) + } +} + +/// (sharing) Changed the password of the shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsChangePassword: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsChangePassword + super.init(swift: swift) + } +} + +/// (sharing) Removed the expiration date from the shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsRemoveExpiration: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsRemoveExpiration + super.init(swift: swift) + } +} + +/// (sharing) Removed the password from the shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkSettingsRemovePassword: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkSettingsRemovePassword + super.init(swift: swift) + } +} + +/// (sharing) Added members as audience of shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkShare: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkShare + super.init(swift: swift) + } +} + +/// (sharing) Opened shared link +@objc +public class DBXTeamLogEventTypeArgSharedLinkView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedLinkView + super.init(swift: swift) + } +} + +/// (sharing) Opened shared Paper doc (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgSharedNoteOpened: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharedNoteOpened + super.init(swift: swift) + } +} + +/// (sharing) Disabled downloads for link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgShmodelDisableDownloads: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.shmodelDisableDownloads + super.init(swift: swift) + } +} + +/// (sharing) Enabled downloads for link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgShmodelEnableDownloads: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.shmodelEnableDownloads + super.init(swift: swift) + } +} + +/// (sharing) Shared link with group (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgShmodelGroupShare: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.shmodelGroupShare + super.init(swift: swift) + } +} + +/// (showcase) Granted access to showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseAccessGranted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseAccessGranted + super.init(swift: swift) + } +} + +/// (showcase) Added member to showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseAddMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseAddMember + super.init(swift: swift) + } +} + +/// (showcase) Archived showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseArchived: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseArchived + super.init(swift: swift) + } +} + +/// (showcase) Created showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseCreated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseCreated + super.init(swift: swift) + } +} + +/// (showcase) Deleted showcase comment +@objc +public class DBXTeamLogEventTypeArgShowcaseDeleteComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseDeleteComment + super.init(swift: swift) + } +} + +/// (showcase) Edited showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseEdited: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseEdited + super.init(swift: swift) + } +} + +/// (showcase) Edited showcase comment +@objc +public class DBXTeamLogEventTypeArgShowcaseEditComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseEditComment + super.init(swift: swift) + } +} + +/// (showcase) Added file to showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseFileAdded: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseFileAdded + super.init(swift: swift) + } +} + +/// (showcase) Downloaded file from showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseFileDownload: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseFileDownload + super.init(swift: swift) + } +} + +/// (showcase) Removed file from showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseFileRemoved: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseFileRemoved + super.init(swift: swift) + } +} + +/// (showcase) Viewed file in showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseFileView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseFileView + super.init(swift: swift) + } +} + +/// (showcase) Permanently deleted showcase +@objc +public class DBXTeamLogEventTypeArgShowcasePermanentlyDeleted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcasePermanentlyDeleted + super.init(swift: swift) + } +} + +/// (showcase) Added showcase comment +@objc +public class DBXTeamLogEventTypeArgShowcasePostComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcasePostComment + super.init(swift: swift) + } +} + +/// (showcase) Removed member from showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseRemoveMember: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseRemoveMember + super.init(swift: swift) + } +} + +/// (showcase) Renamed showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseRenamed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseRenamed + super.init(swift: swift) + } +} + +/// (showcase) Requested access to showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseRequestAccess: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseRequestAccess + super.init(swift: swift) + } +} + +/// (showcase) Resolved showcase comment +@objc +public class DBXTeamLogEventTypeArgShowcaseResolveComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseResolveComment + super.init(swift: swift) + } +} + +/// (showcase) Unarchived showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseRestored: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseRestored + super.init(swift: swift) + } +} + +/// (showcase) Deleted showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseTrashed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseTrashed + super.init(swift: swift) + } +} + +/// (showcase) Deleted showcase (old version) (deprecated, replaced by 'Deleted showcase') +@objc +public class DBXTeamLogEventTypeArgShowcaseTrashedDeprecated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseTrashedDeprecated + super.init(swift: swift) + } +} + +/// (showcase) Unresolved showcase comment +@objc +public class DBXTeamLogEventTypeArgShowcaseUnresolveComment: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseUnresolveComment + super.init(swift: swift) + } +} + +/// (showcase) Restored showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseUntrashed: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseUntrashed + super.init(swift: swift) + } +} + +/// (showcase) Restored showcase (old version) (deprecated, replaced by 'Restored showcase') +@objc +public class DBXTeamLogEventTypeArgShowcaseUntrashedDeprecated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseUntrashedDeprecated + super.init(swift: swift) + } +} + +/// (showcase) Viewed showcase +@objc +public class DBXTeamLogEventTypeArgShowcaseView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseView + super.init(swift: swift) + } +} + +/// (sso) Added X.509 certificate for SSO +@objc +public class DBXTeamLogEventTypeArgSsoAddCert: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoAddCert + super.init(swift: swift) + } +} + +/// (sso) Added sign-in URL for SSO +@objc +public class DBXTeamLogEventTypeArgSsoAddLoginUrl: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoAddLoginUrl + super.init(swift: swift) + } +} + +/// (sso) Added sign-out URL for SSO +@objc +public class DBXTeamLogEventTypeArgSsoAddLogoutUrl: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoAddLogoutUrl + super.init(swift: swift) + } +} + +/// (sso) Changed X.509 certificate for SSO +@objc +public class DBXTeamLogEventTypeArgSsoChangeCert: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoChangeCert + super.init(swift: swift) + } +} + +/// (sso) Changed sign-in URL for SSO +@objc +public class DBXTeamLogEventTypeArgSsoChangeLoginUrl: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoChangeLoginUrl + super.init(swift: swift) + } +} + +/// (sso) Changed sign-out URL for SSO +@objc +public class DBXTeamLogEventTypeArgSsoChangeLogoutUrl: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoChangeLogoutUrl + super.init(swift: swift) + } +} + +/// (sso) Changed SAML identity mode for SSO +@objc +public class DBXTeamLogEventTypeArgSsoChangeSamlIdentityMode: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoChangeSamlIdentityMode + super.init(swift: swift) + } +} + +/// (sso) Removed X.509 certificate for SSO +@objc +public class DBXTeamLogEventTypeArgSsoRemoveCert: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoRemoveCert + super.init(swift: swift) + } +} + +/// (sso) Removed sign-in URL for SSO +@objc +public class DBXTeamLogEventTypeArgSsoRemoveLoginUrl: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoRemoveLoginUrl + super.init(swift: swift) + } +} + +/// (sso) Removed sign-out URL for SSO +@objc +public class DBXTeamLogEventTypeArgSsoRemoveLogoutUrl: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoRemoveLogoutUrl + super.init(swift: swift) + } +} + +/// (team_folders) Changed archival status of team folder +@objc +public class DBXTeamLogEventTypeArgTeamFolderChangeStatus: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamFolderChangeStatus + super.init(swift: swift) + } +} + +/// (team_folders) Created team folder in active status +@objc +public class DBXTeamLogEventTypeArgTeamFolderCreate: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamFolderCreate + super.init(swift: swift) + } +} + +/// (team_folders) Downgraded team folder to regular shared folder +@objc +public class DBXTeamLogEventTypeArgTeamFolderDowngrade: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamFolderDowngrade + super.init(swift: swift) + } +} + +/// (team_folders) Permanently deleted archived team folder +@objc +public class DBXTeamLogEventTypeArgTeamFolderPermanentlyDelete: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamFolderPermanentlyDelete + super.init(swift: swift) + } +} + +/// (team_folders) Renamed active/archived team folder +@objc +public class DBXTeamLogEventTypeArgTeamFolderRename: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamFolderRename + super.init(swift: swift) + } +} + +/// (team_folders) Changed sync default +@objc +public class DBXTeamLogEventTypeArgTeamSelectiveSyncSettingsChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamSelectiveSyncSettingsChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed account capture setting on team domain +@objc +public class DBXTeamLogEventTypeArgAccountCaptureChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.accountCaptureChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed admin reminder settings for requests to join the team +@objc +public class DBXTeamLogEventTypeArgAdminEmailRemindersChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.adminEmailRemindersChanged + super.init(swift: swift) + } +} + +/// (team_policies) Disabled downloads (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgAllowDownloadDisabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.allowDownloadDisabled + super.init(swift: swift) + } +} + +/// (team_policies) Enabled downloads (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgAllowDownloadEnabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.allowDownloadEnabled + super.init(swift: swift) + } +} + +/// (team_policies) Changed app permissions +@objc +public class DBXTeamLogEventTypeArgAppPermissionsChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.appPermissionsChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed camera uploads setting for team +@objc +public class DBXTeamLogEventTypeArgCameraUploadsPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.cameraUploadsPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed Capture transcription policy for team +@objc +public class DBXTeamLogEventTypeArgCaptureTranscriptPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.captureTranscriptPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed classification policy for team +@objc +public class DBXTeamLogEventTypeArgClassificationChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.classificationChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed computer backup policy for team +@objc +public class DBXTeamLogEventTypeArgComputerBackupPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.computerBackupPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed content management setting +@objc +public class DBXTeamLogEventTypeArgContentAdministrationPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.contentAdministrationPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Set restrictions on data center locations where team data resides +@objc +public class DBXTeamLogEventTypeArgDataPlacementRestrictionChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.dataPlacementRestrictionChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Completed restrictions on data center locations where team data resides +@objc +public class DBXTeamLogEventTypeArgDataPlacementRestrictionSatisfyPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.dataPlacementRestrictionSatisfyPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Added members to device approvals exception list +@objc +public class DBXTeamLogEventTypeArgDeviceApprovalsAddException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceApprovalsAddException + super.init(swift: swift) + } +} + +/// (team_policies) Set/removed limit on number of computers member can link to team Dropbox account +@objc +public class DBXTeamLogEventTypeArgDeviceApprovalsChangeDesktopPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceApprovalsChangeDesktopPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Set/removed limit on number of mobile devices member can link to team Dropbox account +@objc +public class DBXTeamLogEventTypeArgDeviceApprovalsChangeMobilePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceApprovalsChangeMobilePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed device approvals setting when member is over limit +@objc +public class DBXTeamLogEventTypeArgDeviceApprovalsChangeOverageAction: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceApprovalsChangeOverageAction + super.init(swift: swift) + } +} + +/// (team_policies) Changed device approvals setting when member unlinks approved device +@objc +public class DBXTeamLogEventTypeArgDeviceApprovalsChangeUnlinkAction: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceApprovalsChangeUnlinkAction + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from device approvals exception list +@objc +public class DBXTeamLogEventTypeArgDeviceApprovalsRemoveException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.deviceApprovalsRemoveException + super.init(swift: swift) + } +} + +/// (team_policies) Added members to directory restrictions list +@objc +public class DBXTeamLogEventTypeArgDirectoryRestrictionsAddMembers: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.directoryRestrictionsAddMembers + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from directory restrictions list +@objc +public class DBXTeamLogEventTypeArgDirectoryRestrictionsRemoveMembers: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.directoryRestrictionsRemoveMembers + super.init(swift: swift) + } +} + +/// (team_policies) Changed Dropbox Passwords policy for team +@objc +public class DBXTeamLogEventTypeArgDropboxPasswordsPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.dropboxPasswordsPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed email to Dropbox policy for team +@objc +public class DBXTeamLogEventTypeArgEmailIngestPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emailIngestPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Added members to EMM exception list +@objc +public class DBXTeamLogEventTypeArgEmmAddException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emmAddException + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled enterprise mobility management for members +@objc +public class DBXTeamLogEventTypeArgEmmChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emmChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from EMM exception list +@objc +public class DBXTeamLogEventTypeArgEmmRemoveException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.emmRemoveException + super.init(swift: swift) + } +} + +/// (team_policies) Accepted/opted out of extended version history +@objc +public class DBXTeamLogEventTypeArgExtendedVersionHistoryChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.extendedVersionHistoryChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed external drive backup policy for team +@objc +public class DBXTeamLogEventTypeArgExternalDriveBackupPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.externalDriveBackupPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled commenting on team files +@objc +public class DBXTeamLogEventTypeArgFileCommentsChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileCommentsChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed file locking policy for team +@objc +public class DBXTeamLogEventTypeArgFileLockingPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileLockingPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed File Provider Migration policy for team +@objc +public class DBXTeamLogEventTypeArgFileProviderMigrationPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileProviderMigrationPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled file requests +@objc +public class DBXTeamLogEventTypeArgFileRequestsChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestsChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled file request emails for everyone (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgFileRequestsEmailsEnabled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestsEmailsEnabled + super.init(swift: swift) + } +} + +/// (team_policies) Enabled file request emails for team (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgFileRequestsEmailsRestrictedToTeamOnly: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileRequestsEmailsRestrictedToTeamOnly + super.init(swift: swift) + } +} + +/// (team_policies) Changed file transfers policy for team +@objc +public class DBXTeamLogEventTypeArgFileTransfersPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.fileTransfersPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed folder link restrictions policy for team +@objc +public class DBXTeamLogEventTypeArgFolderLinkRestrictionPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.folderLinkRestrictionPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Google single sign-on for team +@objc +public class DBXTeamLogEventTypeArgGoogleSsoChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.googleSsoChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed who can create groups +@objc +public class DBXTeamLogEventTypeArgGroupUserManagementChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.groupUserManagementChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed integration policy for team +@objc +public class DBXTeamLogEventTypeArgIntegrationPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.integrationPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed invite accept email policy for team +@objc +public class DBXTeamLogEventTypeArgInviteAcceptanceEmailPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.inviteAcceptanceEmailPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether users can find team when not invited +@objc +public class DBXTeamLogEventTypeArgMemberRequestsChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberRequestsChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed member send invite policy for team +@objc +public class DBXTeamLogEventTypeArgMemberSendInvitePolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSendInvitePolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Added members to member space limit exception list +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsAddException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsAddException + super.init(swift: swift) + } +} + +/// (team_policies) Changed member space limit type for team +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsChangeCapsTypePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsChangeCapsTypePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed team default member space limit +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from member space limit exception list +@objc +public class DBXTeamLogEventTypeArgMemberSpaceLimitsRemoveException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSpaceLimitsRemoveException + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled option for team members to suggest people to add to team +@objc +public class DBXTeamLogEventTypeArgMemberSuggestionsChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.memberSuggestionsChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Microsoft Office add-in +@objc +public class DBXTeamLogEventTypeArgMicrosoftOfficeAddinChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.microsoftOfficeAddinChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled network control +@objc +public class DBXTeamLogEventTypeArgNetworkControlChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.networkControlChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether Dropbox Paper, when enabled, is deployed to all members or to specific +/// members +@objc +public class DBXTeamLogEventTypeArgPaperChangeDeploymentPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperChangeDeploymentPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether non-members can view Paper docs with link (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgPaperChangeMemberLinkPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperChangeMemberLinkPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether members can share Paper docs outside team, and if docs are accessible only +/// by team members or anyone by default +@objc +public class DBXTeamLogEventTypeArgPaperChangeMemberPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperChangeMemberPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Dropbox Paper for team +@objc +public class DBXTeamLogEventTypeArgPaperChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed Paper Default Folder Policy setting for team +@objc +public class DBXTeamLogEventTypeArgPaperDefaultFolderPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDefaultFolderPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Paper Desktop for team +@objc +public class DBXTeamLogEventTypeArgPaperDesktopPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperDesktopPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Added users to Paper-enabled users list +@objc +public class DBXTeamLogEventTypeArgPaperEnabledUsersGroupAddition: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperEnabledUsersGroupAddition + super.init(swift: swift) + } +} + +/// (team_policies) Removed users from Paper-enabled users list +@objc +public class DBXTeamLogEventTypeArgPaperEnabledUsersGroupRemoval: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.paperEnabledUsersGroupRemoval + super.init(swift: swift) + } +} + +/// (team_policies) Changed team password strength requirements +@objc +public class DBXTeamLogEventTypeArgPasswordStrengthRequirementsChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.passwordStrengthRequirementsChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled ability of team members to permanently delete content +@objc +public class DBXTeamLogEventTypeArgPermanentDeleteChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.permanentDeleteChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled reseller support +@objc +public class DBXTeamLogEventTypeArgResellerSupportChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.resellerSupportChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed Rewind policy for team +@objc +public class DBXTeamLogEventTypeArgRewindPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.rewindPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed send for signature policy for team +@objc +public class DBXTeamLogEventTypeArgSendForSignaturePolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sendForSignaturePolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether team members can join shared folders owned outside team +@objc +public class DBXTeamLogEventTypeArgSharingChangeFolderJoinPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharingChangeFolderJoinPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed the allow remove or change expiration policy for the links shared outside of the +/// team +@objc +public class DBXTeamLogEventTypeArgSharingChangeLinkAllowChangeExpirationPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharingChangeLinkAllowChangeExpirationPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed the default expiration for the links shared outside of the team +@objc +public class DBXTeamLogEventTypeArgSharingChangeLinkDefaultExpirationPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharingChangeLinkDefaultExpirationPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed the password requirement for the links shared outside of the team +@objc +public class DBXTeamLogEventTypeArgSharingChangeLinkEnforcePasswordPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharingChangeLinkEnforcePasswordPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether members can share links outside team, and if links are accessible only by +/// team members or anyone by default +@objc +public class DBXTeamLogEventTypeArgSharingChangeLinkPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharingChangeLinkPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed whether members can share files/folders outside team +@objc +public class DBXTeamLogEventTypeArgSharingChangeMemberPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.sharingChangeMemberPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled downloading files from Dropbox Showcase for team +@objc +public class DBXTeamLogEventTypeArgShowcaseChangeDownloadPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseChangeDownloadPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Dropbox Showcase for team +@objc +public class DBXTeamLogEventTypeArgShowcaseChangeEnabledPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseChangeEnabledPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled sharing Dropbox Showcase externally for team +@objc +public class DBXTeamLogEventTypeArgShowcaseChangeExternalSharingPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.showcaseChangeExternalSharingPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed automatic Smart Sync setting for team +@objc +public class DBXTeamLogEventTypeArgSmarterSmartSyncPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.smarterSmartSyncPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed default Smart Sync setting for team members +@objc +public class DBXTeamLogEventTypeArgSmartSyncChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.smartSyncChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Opted team into Smart Sync +@objc +public class DBXTeamLogEventTypeArgSmartSyncNotOptOut: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.smartSyncNotOptOut + super.init(swift: swift) + } +} + +/// (team_policies) Opted team out of Smart Sync +@objc +public class DBXTeamLogEventTypeArgSmartSyncOptOut: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.smartSyncOptOut + super.init(swift: swift) + } +} + +/// (team_policies) Changed single sign-on setting for team +@objc +public class DBXTeamLogEventTypeArgSsoChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.ssoChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed team branding policy for team +@objc +public class DBXTeamLogEventTypeArgTeamBrandingPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamBrandingPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed App Integrations setting for team +@objc +public class DBXTeamLogEventTypeArgTeamExtensionsPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamExtensionsPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled Team Selective Sync for team +@objc +public class DBXTeamLogEventTypeArgTeamSelectiveSyncPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamSelectiveSyncPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Edited the approved list for sharing externally +@objc +public class DBXTeamLogEventTypeArgTeamSharingWhitelistSubjectsChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamSharingWhitelistSubjectsChanged + super.init(swift: swift) + } +} + +/// (team_policies) Added members to two factor authentication exception list +@objc +public class DBXTeamLogEventTypeArgTfaAddException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaAddException + super.init(swift: swift) + } +} + +/// (team_policies) Changed two-step verification setting for team +@objc +public class DBXTeamLogEventTypeArgTfaChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Removed members from two factor authentication exception list +@objc +public class DBXTeamLogEventTypeArgTfaRemoveException: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaRemoveException + super.init(swift: swift) + } +} + +/// (team_policies) Enabled/disabled option for members to link personal Dropbox account and team account to +/// same computer +@objc +public class DBXTeamLogEventTypeArgTwoAccountChangePolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.twoAccountChangePolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed team policy for viewer info +@objc +public class DBXTeamLogEventTypeArgViewerInfoPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.viewerInfoPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed watermarking policy for team +@objc +public class DBXTeamLogEventTypeArgWatermarkingPolicyChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.watermarkingPolicyChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed limit on active sessions per member +@objc +public class DBXTeamLogEventTypeArgWebSessionsChangeActiveSessionLimit: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.webSessionsChangeActiveSessionLimit + super.init(swift: swift) + } +} + +/// (team_policies) Changed how long members can stay signed in to Dropbox.com +@objc +public class DBXTeamLogEventTypeArgWebSessionsChangeFixedLengthPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.webSessionsChangeFixedLengthPolicy + super.init(swift: swift) + } +} + +/// (team_policies) Changed how long team members can be idle while signed in to Dropbox.com +@objc +public class DBXTeamLogEventTypeArgWebSessionsChangeIdleLengthPolicy: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.webSessionsChangeIdleLengthPolicy + super.init(swift: swift) + } +} + +/// (team_profile) Requested data residency migration for team data +@objc +public class DBXTeamLogEventTypeArgDataResidencyMigrationRequestSuccessful: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.dataResidencyMigrationRequestSuccessful + super.init(swift: swift) + } +} + +/// (team_profile) Request for data residency migration for team data has failed +@objc +public class DBXTeamLogEventTypeArgDataResidencyMigrationRequestUnsuccessful: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.dataResidencyMigrationRequestUnsuccessful + super.init(swift: swift) + } +} + +/// (team_profile) Merged another team into this team +@objc +public class DBXTeamLogEventTypeArgTeamMergeFrom: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeFrom + super.init(swift: swift) + } +} + +/// (team_profile) Merged this team into another team +@objc +public class DBXTeamLogEventTypeArgTeamMergeTo: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeTo + super.init(swift: swift) + } +} + +/// (team_profile) Added team background to display on shared link headers +@objc +public class DBXTeamLogEventTypeArgTeamProfileAddBackground: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileAddBackground + super.init(swift: swift) + } +} + +/// (team_profile) Added team logo to display on shared link headers +@objc +public class DBXTeamLogEventTypeArgTeamProfileAddLogo: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileAddLogo + super.init(swift: swift) + } +} + +/// (team_profile) Changed team background displayed on shared link headers +@objc +public class DBXTeamLogEventTypeArgTeamProfileChangeBackground: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileChangeBackground + super.init(swift: swift) + } +} + +/// (team_profile) Changed default language for team +@objc +public class DBXTeamLogEventTypeArgTeamProfileChangeDefaultLanguage: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileChangeDefaultLanguage + super.init(swift: swift) + } +} + +/// (team_profile) Changed team logo displayed on shared link headers +@objc +public class DBXTeamLogEventTypeArgTeamProfileChangeLogo: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileChangeLogo + super.init(swift: swift) + } +} + +/// (team_profile) Changed team name +@objc +public class DBXTeamLogEventTypeArgTeamProfileChangeName: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileChangeName + super.init(swift: swift) + } +} + +/// (team_profile) Removed team background displayed on shared link headers +@objc +public class DBXTeamLogEventTypeArgTeamProfileRemoveBackground: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileRemoveBackground + super.init(swift: swift) + } +} + +/// (team_profile) Removed team logo displayed on shared link headers +@objc +public class DBXTeamLogEventTypeArgTeamProfileRemoveLogo: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamProfileRemoveLogo + super.init(swift: swift) + } +} + +/// (tfa) Added backup phone for two-step verification +@objc +public class DBXTeamLogEventTypeArgTfaAddBackupPhone: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaAddBackupPhone + super.init(swift: swift) + } +} + +/// (tfa) Added security key for two-step verification +@objc +public class DBXTeamLogEventTypeArgTfaAddSecurityKey: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaAddSecurityKey + super.init(swift: swift) + } +} + +/// (tfa) Changed backup phone for two-step verification +@objc +public class DBXTeamLogEventTypeArgTfaChangeBackupPhone: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaChangeBackupPhone + super.init(swift: swift) + } +} + +/// (tfa) Enabled/disabled/changed two-step verification setting +@objc +public class DBXTeamLogEventTypeArgTfaChangeStatus: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaChangeStatus + super.init(swift: swift) + } +} + +/// (tfa) Removed backup phone for two-step verification +@objc +public class DBXTeamLogEventTypeArgTfaRemoveBackupPhone: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaRemoveBackupPhone + super.init(swift: swift) + } +} + +/// (tfa) Removed security key for two-step verification +@objc +public class DBXTeamLogEventTypeArgTfaRemoveSecurityKey: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaRemoveSecurityKey + super.init(swift: swift) + } +} + +/// (tfa) Reset two-step verification for team member +@objc +public class DBXTeamLogEventTypeArgTfaReset: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.tfaReset + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed enterprise admin role +@objc +public class DBXTeamLogEventTypeArgChangedEnterpriseAdminRole: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.changedEnterpriseAdminRole + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed enterprise-connected team status +@objc +public class DBXTeamLogEventTypeArgChangedEnterpriseConnectedTeamStatus: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.changedEnterpriseConnectedTeamStatus + super.init(swift: swift) + } +} + +/// (trusted_teams) Ended enterprise admin session +@objc +public class DBXTeamLogEventTypeArgEndedEnterpriseAdminSession: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.endedEnterpriseAdminSession + super.init(swift: swift) + } +} + +/// (trusted_teams) Ended enterprise admin session (deprecated, replaced by 'Ended enterprise admin session') +@objc +public class DBXTeamLogEventTypeArgEndedEnterpriseAdminSessionDeprecated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.endedEnterpriseAdminSessionDeprecated + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed who can update a setting +@objc +public class DBXTeamLogEventTypeArgEnterpriseSettingsLocking: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.enterpriseSettingsLocking + super.init(swift: swift) + } +} + +/// (trusted_teams) Changed guest team admin status +@objc +public class DBXTeamLogEventTypeArgGuestAdminChangeStatus: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.guestAdminChangeStatus + super.init(swift: swift) + } +} + +/// (trusted_teams) Started enterprise admin session +@objc +public class DBXTeamLogEventTypeArgStartedEnterpriseAdminSession: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.startedEnterpriseAdminSession + super.init(swift: swift) + } +} + +/// (trusted_teams) Accepted a team merge request +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestAccepted: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestAccepted + super.init(swift: swift) + } +} + +/// (trusted_teams) Accepted a team merge request (deprecated, replaced by 'Accepted a team merge request') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToPrimaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestAcceptedShownToPrimaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Accepted a team merge request (deprecated, replaced by 'Accepted a team merge request') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestAcceptedShownToSecondaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestAcceptedShownToSecondaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Automatically canceled team merge request +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestAutoCanceled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestAutoCanceled + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled a team merge request +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestCanceled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestCanceled + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled a team merge request (deprecated, replaced by 'Canceled a team merge request') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToPrimaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestCanceledShownToPrimaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled a team merge request (deprecated, replaced by 'Canceled a team merge request') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestCanceledShownToSecondaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestCanceledShownToSecondaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Team merge request expired +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestExpired: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestExpired + super.init(swift: swift) + } +} + +/// (trusted_teams) Team merge request expired (deprecated, replaced by 'Team merge request expired') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToPrimaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestExpiredShownToPrimaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Team merge request expired (deprecated, replaced by 'Team merge request expired') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestExpiredShownToSecondaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestExpiredShownToSecondaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Rejected a team merge request (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToPrimaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestRejectedShownToPrimaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Rejected a team merge request (deprecated, no longer logged) +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestRejectedShownToSecondaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestRejectedShownToSecondaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Sent a team merge request reminder +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestReminder: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestReminder + super.init(swift: swift) + } +} + +/// (trusted_teams) Sent a team merge request reminder (deprecated, replaced by 'Sent a team merge request +/// reminder') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToPrimaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestReminderShownToPrimaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Sent a team merge request reminder (deprecated, replaced by 'Sent a team merge request +/// reminder') +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestReminderShownToSecondaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestReminderShownToSecondaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Canceled the team merge +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestRevoked: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestRevoked + super.init(swift: swift) + } +} + +/// (trusted_teams) Requested to merge their Dropbox team into yours +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestSentShownToPrimaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestSentShownToPrimaryTeam + super.init(swift: swift) + } +} + +/// (trusted_teams) Requested to merge your team into another Dropbox team +@objc +public class DBXTeamLogEventTypeArgTeamMergeRequestSentShownToSecondaryTeam: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamMergeRequestSentShownToSecondaryTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventTypeArgOther: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.other + super.init(swift: swift) + } +} + +/// Created member data report. +@objc +public class DBXTeamLogExportMembersReportDetails: NSObject { + let swift: TeamLog.ExportMembersReportDetails + + public init(swift: TeamLog.ExportMembersReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Failed to create members data report. +@objc +public class DBXTeamLogExportMembersReportFailDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.ExportMembersReportFailDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.ExportMembersReportFailDetails + + public init(swift: TeamLog.ExportMembersReportFailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExportMembersReportFailType struct +@objc +public class DBXTeamLogExportMembersReportFailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExportMembersReportFailType(description_: description_) + } + + let swift: TeamLog.ExportMembersReportFailType + + public init(swift: TeamLog.ExportMembersReportFailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExportMembersReportType struct +@objc +public class DBXTeamLogExportMembersReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExportMembersReportType(description_: description_) + } + + let swift: TeamLog.ExportMembersReportType + + public init(swift: TeamLog.ExportMembersReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Accepted/opted out of extended version history. +@objc +public class DBXTeamLogExtendedVersionHistoryChangePolicyDetails: NSObject { + /// New extended version history policy. + @objc + public var newValue: DBXTeamLogExtendedVersionHistoryPolicy { DBXTeamLogExtendedVersionHistoryPolicy(swift: swift.newValue) } + /// Previous extended version history policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogExtendedVersionHistoryPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogExtendedVersionHistoryPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogExtendedVersionHistoryPolicy, previousValue: DBXTeamLogExtendedVersionHistoryPolicy?) { + self.swift = TeamLog.ExtendedVersionHistoryChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.ExtendedVersionHistoryChangePolicyDetails + + public init(swift: TeamLog.ExtendedVersionHistoryChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExtendedVersionHistoryChangePolicyType struct +@objc +public class DBXTeamLogExtendedVersionHistoryChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExtendedVersionHistoryChangePolicyType(description_: description_) + } + + let swift: TeamLog.ExtendedVersionHistoryChangePolicyType + + public init(swift: TeamLog.ExtendedVersionHistoryChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExtendedVersionHistoryPolicy union +@objc +public class DBXTeamLogExtendedVersionHistoryPolicy: NSObject { + let swift: TeamLog.ExtendedVersionHistoryPolicy + + public init(swift: TeamLog.ExtendedVersionHistoryPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ExtendedVersionHistoryPolicy) -> DBXTeamLogExtendedVersionHistoryPolicy { + switch swift { + case .explicitlyLimited: + return DBXTeamLogExtendedVersionHistoryPolicyExplicitlyLimited() + case .explicitlyUnlimited: + return DBXTeamLogExtendedVersionHistoryPolicyExplicitlyUnlimited() + case .implicitlyLimited: + return DBXTeamLogExtendedVersionHistoryPolicyImplicitlyLimited() + case .implicitlyUnlimited: + return DBXTeamLogExtendedVersionHistoryPolicyImplicitlyUnlimited() + case .other: + return DBXTeamLogExtendedVersionHistoryPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asExplicitlyLimited: DBXTeamLogExtendedVersionHistoryPolicyExplicitlyLimited? { + self as? DBXTeamLogExtendedVersionHistoryPolicyExplicitlyLimited + } + + @objc + public var asExplicitlyUnlimited: DBXTeamLogExtendedVersionHistoryPolicyExplicitlyUnlimited? { + self as? DBXTeamLogExtendedVersionHistoryPolicyExplicitlyUnlimited + } + + @objc + public var asImplicitlyLimited: DBXTeamLogExtendedVersionHistoryPolicyImplicitlyLimited? { + self as? DBXTeamLogExtendedVersionHistoryPolicyImplicitlyLimited + } + + @objc + public var asImplicitlyUnlimited: DBXTeamLogExtendedVersionHistoryPolicyImplicitlyUnlimited? { + self as? DBXTeamLogExtendedVersionHistoryPolicyImplicitlyUnlimited + } + + @objc + public var asOther: DBXTeamLogExtendedVersionHistoryPolicyOther? { + self as? DBXTeamLogExtendedVersionHistoryPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExtendedVersionHistoryPolicyExplicitlyLimited: DBXTeamLogExtendedVersionHistoryPolicy { + @objc + public init() { + let swift = TeamLog.ExtendedVersionHistoryPolicy.explicitlyLimited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExtendedVersionHistoryPolicyExplicitlyUnlimited: DBXTeamLogExtendedVersionHistoryPolicy { + @objc + public init() { + let swift = TeamLog.ExtendedVersionHistoryPolicy.explicitlyUnlimited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExtendedVersionHistoryPolicyImplicitlyLimited: DBXTeamLogExtendedVersionHistoryPolicy { + @objc + public init() { + let swift = TeamLog.ExtendedVersionHistoryPolicy.implicitlyLimited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExtendedVersionHistoryPolicyImplicitlyUnlimited: DBXTeamLogExtendedVersionHistoryPolicy { + @objc + public init() { + let swift = TeamLog.ExtendedVersionHistoryPolicy.implicitlyUnlimited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExtendedVersionHistoryPolicyOther: DBXTeamLogExtendedVersionHistoryPolicy { + @objc + public init() { + let swift = TeamLog.ExtendedVersionHistoryPolicy.other + super.init(swift: swift) + } +} + +/// External Drive Backup eligibility status +@objc +public class DBXTeamLogExternalDriveBackupEligibilityStatus: NSObject { + let swift: TeamLog.ExternalDriveBackupEligibilityStatus + + public init(swift: TeamLog.ExternalDriveBackupEligibilityStatus) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ExternalDriveBackupEligibilityStatus) -> DBXTeamLogExternalDriveBackupEligibilityStatus { + switch swift { + case .exceedLicenseCap: + return DBXTeamLogExternalDriveBackupEligibilityStatusExceedLicenseCap() + case .success: + return DBXTeamLogExternalDriveBackupEligibilityStatusSuccess() + case .other: + return DBXTeamLogExternalDriveBackupEligibilityStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asExceedLicenseCap: DBXTeamLogExternalDriveBackupEligibilityStatusExceedLicenseCap? { + self as? DBXTeamLogExternalDriveBackupEligibilityStatusExceedLicenseCap + } + + @objc + public var asSuccess: DBXTeamLogExternalDriveBackupEligibilityStatusSuccess? { + self as? DBXTeamLogExternalDriveBackupEligibilityStatusSuccess + } + + @objc + public var asOther: DBXTeamLogExternalDriveBackupEligibilityStatusOther? { + self as? DBXTeamLogExternalDriveBackupEligibilityStatusOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupEligibilityStatusExceedLicenseCap: DBXTeamLogExternalDriveBackupEligibilityStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupEligibilityStatus.exceedLicenseCap + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupEligibilityStatusSuccess: DBXTeamLogExternalDriveBackupEligibilityStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupEligibilityStatus.success + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupEligibilityStatusOther: DBXTeamLogExternalDriveBackupEligibilityStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupEligibilityStatus.other + super.init(swift: swift) + } +} + +/// Checked external drive backup eligibility status. +@objc +public class DBXTeamLogExternalDriveBackupEligibilityStatusCheckedDetails: NSObject { + /// Device's session logged information. + @objc + public var desktopDeviceSessionInfo: DBXTeamLogDesktopDeviceSessionLogInfo { DBXTeamLogDesktopDeviceSessionLogInfo(swift: swift.desktopDeviceSessionInfo) } + /// Current eligibility status of external drive backup. + @objc + public var status: DBXTeamLogExternalDriveBackupEligibilityStatus { DBXTeamLogExternalDriveBackupEligibilityStatus(swift: swift.status) } + /// Total number of valid external drive backup for all the team members. + @objc + public var numberOfExternalDriveBackup: NSNumber { swift.numberOfExternalDriveBackup as NSNumber } + + @objc + public init( + desktopDeviceSessionInfo: DBXTeamLogDesktopDeviceSessionLogInfo, + status: DBXTeamLogExternalDriveBackupEligibilityStatus, + numberOfExternalDriveBackup: NSNumber + ) { + self.swift = TeamLog.ExternalDriveBackupEligibilityStatusCheckedDetails( + desktopDeviceSessionInfo: desktopDeviceSessionInfo.subSwift, + status: status.swift, + numberOfExternalDriveBackup: numberOfExternalDriveBackup.uint64Value + ) + } + + let swift: TeamLog.ExternalDriveBackupEligibilityStatusCheckedDetails + + public init(swift: TeamLog.ExternalDriveBackupEligibilityStatusCheckedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExternalDriveBackupEligibilityStatusCheckedType struct +@objc +public class DBXTeamLogExternalDriveBackupEligibilityStatusCheckedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExternalDriveBackupEligibilityStatusCheckedType(description_: description_) + } + + let swift: TeamLog.ExternalDriveBackupEligibilityStatusCheckedType + + public init(swift: TeamLog.ExternalDriveBackupEligibilityStatusCheckedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling team access to external drive backup feature +@objc +public class DBXTeamLogExternalDriveBackupPolicy: NSObject { + let swift: TeamLog.ExternalDriveBackupPolicy + + public init(swift: TeamLog.ExternalDriveBackupPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ExternalDriveBackupPolicy) -> DBXTeamLogExternalDriveBackupPolicy { + switch swift { + case .default_: + return DBXTeamLogExternalDriveBackupPolicyDefault_() + case .disabled: + return DBXTeamLogExternalDriveBackupPolicyDisabled() + case .enabled: + return DBXTeamLogExternalDriveBackupPolicyEnabled() + case .other: + return DBXTeamLogExternalDriveBackupPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXTeamLogExternalDriveBackupPolicyDefault_? { + self as? DBXTeamLogExternalDriveBackupPolicyDefault_ + } + + @objc + public var asDisabled: DBXTeamLogExternalDriveBackupPolicyDisabled? { + self as? DBXTeamLogExternalDriveBackupPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogExternalDriveBackupPolicyEnabled? { + self as? DBXTeamLogExternalDriveBackupPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogExternalDriveBackupPolicyOther? { + self as? DBXTeamLogExternalDriveBackupPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupPolicyDefault_: DBXTeamLogExternalDriveBackupPolicy { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupPolicy.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupPolicyDisabled: DBXTeamLogExternalDriveBackupPolicy { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupPolicyEnabled: DBXTeamLogExternalDriveBackupPolicy { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupPolicyOther: DBXTeamLogExternalDriveBackupPolicy { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupPolicy.other + super.init(swift: swift) + } +} + +/// Changed external drive backup policy for team. +@objc +public class DBXTeamLogExternalDriveBackupPolicyChangedDetails: NSObject { + /// New external drive backup policy. + @objc + public var newValue: DBXTeamLogExternalDriveBackupPolicy { DBXTeamLogExternalDriveBackupPolicy(swift: swift.newValue) } + /// Previous external drive backup policy. + @objc + public var previousValue: DBXTeamLogExternalDriveBackupPolicy { DBXTeamLogExternalDriveBackupPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogExternalDriveBackupPolicy, previousValue: DBXTeamLogExternalDriveBackupPolicy) { + self.swift = TeamLog.ExternalDriveBackupPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.ExternalDriveBackupPolicyChangedDetails + + public init(swift: TeamLog.ExternalDriveBackupPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExternalDriveBackupPolicyChangedType struct +@objc +public class DBXTeamLogExternalDriveBackupPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExternalDriveBackupPolicyChangedType(description_: description_) + } + + let swift: TeamLog.ExternalDriveBackupPolicyChangedType + + public init(swift: TeamLog.ExternalDriveBackupPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// External Drive Backup status +@objc +public class DBXTeamLogExternalDriveBackupStatus: NSObject { + let swift: TeamLog.ExternalDriveBackupStatus + + public init(swift: TeamLog.ExternalDriveBackupStatus) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ExternalDriveBackupStatus) -> DBXTeamLogExternalDriveBackupStatus { + switch swift { + case .broken: + return DBXTeamLogExternalDriveBackupStatusBroken() + case .created: + return DBXTeamLogExternalDriveBackupStatusCreated() + case .createdOrBroken: + return DBXTeamLogExternalDriveBackupStatusCreatedOrBroken() + case .deleted: + return DBXTeamLogExternalDriveBackupStatusDeleted() + case .empty: + return DBXTeamLogExternalDriveBackupStatusEmpty() + case .unknown: + return DBXTeamLogExternalDriveBackupStatusUnknown() + case .other: + return DBXTeamLogExternalDriveBackupStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asBroken: DBXTeamLogExternalDriveBackupStatusBroken? { + self as? DBXTeamLogExternalDriveBackupStatusBroken + } + + @objc + public var asCreated: DBXTeamLogExternalDriveBackupStatusCreated? { + self as? DBXTeamLogExternalDriveBackupStatusCreated + } + + @objc + public var asCreatedOrBroken: DBXTeamLogExternalDriveBackupStatusCreatedOrBroken? { + self as? DBXTeamLogExternalDriveBackupStatusCreatedOrBroken + } + + @objc + public var asDeleted: DBXTeamLogExternalDriveBackupStatusDeleted? { + self as? DBXTeamLogExternalDriveBackupStatusDeleted + } + + @objc + public var asEmpty: DBXTeamLogExternalDriveBackupStatusEmpty? { + self as? DBXTeamLogExternalDriveBackupStatusEmpty + } + + @objc + public var asUnknown: DBXTeamLogExternalDriveBackupStatusUnknown? { + self as? DBXTeamLogExternalDriveBackupStatusUnknown + } + + @objc + public var asOther: DBXTeamLogExternalDriveBackupStatusOther? { + self as? DBXTeamLogExternalDriveBackupStatusOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupStatusBroken: DBXTeamLogExternalDriveBackupStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupStatus.broken + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupStatusCreated: DBXTeamLogExternalDriveBackupStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupStatus.created + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupStatusCreatedOrBroken: DBXTeamLogExternalDriveBackupStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupStatus.createdOrBroken + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupStatusDeleted: DBXTeamLogExternalDriveBackupStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupStatus.deleted + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupStatusEmpty: DBXTeamLogExternalDriveBackupStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupStatus.empty + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupStatusUnknown: DBXTeamLogExternalDriveBackupStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupStatus.unknown + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalDriveBackupStatusOther: DBXTeamLogExternalDriveBackupStatus { + @objc + public init() { + let swift = TeamLog.ExternalDriveBackupStatus.other + super.init(swift: swift) + } +} + +/// Modified external drive backup. +@objc +public class DBXTeamLogExternalDriveBackupStatusChangedDetails: NSObject { + /// Device's session logged information. + @objc + public var desktopDeviceSessionInfo: DBXTeamLogDesktopDeviceSessionLogInfo { DBXTeamLogDesktopDeviceSessionLogInfo(swift: swift.desktopDeviceSessionInfo) } + /// Previous status of this external drive backup. + @objc + public var previousValue: DBXTeamLogExternalDriveBackupStatus { DBXTeamLogExternalDriveBackupStatus(swift: swift.previousValue) } + /// Next status of this external drive backup. + @objc + public var newValue: DBXTeamLogExternalDriveBackupStatus { DBXTeamLogExternalDriveBackupStatus(swift: swift.newValue) } + + @objc + public init( + desktopDeviceSessionInfo: DBXTeamLogDesktopDeviceSessionLogInfo, + previousValue: DBXTeamLogExternalDriveBackupStatus, + newValue: DBXTeamLogExternalDriveBackupStatus + ) { + self.swift = TeamLog.ExternalDriveBackupStatusChangedDetails( + desktopDeviceSessionInfo: desktopDeviceSessionInfo.subSwift, + previousValue: previousValue.swift, + newValue: newValue.swift + ) + } + + let swift: TeamLog.ExternalDriveBackupStatusChangedDetails + + public init(swift: TeamLog.ExternalDriveBackupStatusChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExternalDriveBackupStatusChangedType struct +@objc +public class DBXTeamLogExternalDriveBackupStatusChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExternalDriveBackupStatusChangedType(description_: description_) + } + + let swift: TeamLog.ExternalDriveBackupStatusChangedType + + public init(swift: TeamLog.ExternalDriveBackupStatusChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created External sharing report. +@objc +public class DBXTeamLogExternalSharingCreateReportDetails: NSObject { + let swift: TeamLog.ExternalSharingCreateReportDetails + + public init(swift: TeamLog.ExternalSharingCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExternalSharingCreateReportType struct +@objc +public class DBXTeamLogExternalSharingCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExternalSharingCreateReportType(description_: description_) + } + + let swift: TeamLog.ExternalSharingCreateReportType + + public init(swift: TeamLog.ExternalSharingCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't create External sharing report. +@objc +public class DBXTeamLogExternalSharingReportFailedDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.ExternalSharingReportFailedDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.ExternalSharingReportFailedDetails + + public init(swift: TeamLog.ExternalSharingReportFailedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ExternalSharingReportFailedType struct +@objc +public class DBXTeamLogExternalSharingReportFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ExternalSharingReportFailedType(description_: description_) + } + + let swift: TeamLog.ExternalSharingReportFailedType + + public init(swift: TeamLog.ExternalSharingReportFailedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// A user without a Dropbox account. +@objc +public class DBXTeamLogExternalUserLogInfo: NSObject { + /// An external user identifier. + @objc + public var userIdentifier: String { swift.userIdentifier } + /// Identifier type. + @objc + public var identifierType: DBXTeamLogIdentifierType { DBXTeamLogIdentifierType(swift: swift.identifierType) } + + @objc + public init(userIdentifier: String, identifierType: DBXTeamLogIdentifierType) { + self.swift = TeamLog.ExternalUserLogInfo(userIdentifier: userIdentifier, identifierType: identifierType.swift) + } + + let swift: TeamLog.ExternalUserLogInfo + + public init(swift: TeamLog.ExternalUserLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Provides details about a failure +@objc +public class DBXTeamLogFailureDetailsLogInfo: NSObject { + /// A user friendly explanation of the error. + @objc + public var userFriendlyMessage: String? { swift.userFriendlyMessage } + /// A technical explanation of the error. This is relevant for some errors. + @objc + public var technicalErrorMessage: String? { swift.technicalErrorMessage } + + @objc + public init(userFriendlyMessage: String?, technicalErrorMessage: String?) { + self.swift = TeamLog.FailureDetailsLogInfo(userFriendlyMessage: userFriendlyMessage, technicalErrorMessage: technicalErrorMessage) + } + + let swift: TeamLog.FailureDetailsLogInfo + + public init(swift: TeamLog.FailureDetailsLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FedAdminRole union +@objc +public class DBXTeamLogFedAdminRole: NSObject { + let swift: TeamLog.FedAdminRole + + public init(swift: TeamLog.FedAdminRole) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FedAdminRole) -> DBXTeamLogFedAdminRole { + switch swift { + case .enterpriseAdmin: + return DBXTeamLogFedAdminRoleEnterpriseAdmin() + case .notEnterpriseAdmin: + return DBXTeamLogFedAdminRoleNotEnterpriseAdmin() + case .other: + return DBXTeamLogFedAdminRoleOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEnterpriseAdmin: DBXTeamLogFedAdminRoleEnterpriseAdmin? { + self as? DBXTeamLogFedAdminRoleEnterpriseAdmin + } + + @objc + public var asNotEnterpriseAdmin: DBXTeamLogFedAdminRoleNotEnterpriseAdmin? { + self as? DBXTeamLogFedAdminRoleNotEnterpriseAdmin + } + + @objc + public var asOther: DBXTeamLogFedAdminRoleOther? { + self as? DBXTeamLogFedAdminRoleOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedAdminRoleEnterpriseAdmin: DBXTeamLogFedAdminRole { + @objc + public init() { + let swift = TeamLog.FedAdminRole.enterpriseAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedAdminRoleNotEnterpriseAdmin: DBXTeamLogFedAdminRole { + @objc + public init() { + let swift = TeamLog.FedAdminRole.notEnterpriseAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedAdminRoleOther: DBXTeamLogFedAdminRole { + @objc + public init() { + let swift = TeamLog.FedAdminRole.other + super.init(swift: swift) + } +} + +/// More details about the organization or team. +@objc +public class DBXTeamLogFedExtraDetails: NSObject { + let swift: TeamLog.FedExtraDetails + + public init(swift: TeamLog.FedExtraDetails) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FedExtraDetails) -> DBXTeamLogFedExtraDetails { + switch swift { + case .organization(let swiftArg): + let arg = DBXTeamLogOrganizationDetails(swift: swiftArg) + return DBXTeamLogFedExtraDetailsOrganization(arg) + case .team(let swiftArg): + let arg = DBXTeamLogTeamDetails(swift: swiftArg) + return DBXTeamLogFedExtraDetailsTeam(arg) + case .other: + return DBXTeamLogFedExtraDetailsOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOrganization: DBXTeamLogFedExtraDetailsOrganization? { + self as? DBXTeamLogFedExtraDetailsOrganization + } + + @objc + public var asTeam: DBXTeamLogFedExtraDetailsTeam? { + self as? DBXTeamLogFedExtraDetailsTeam + } + + @objc + public var asOther: DBXTeamLogFedExtraDetailsOther? { + self as? DBXTeamLogFedExtraDetailsOther + } +} + +/// More details about the organization. +@objc +public class DBXTeamLogFedExtraDetailsOrganization: DBXTeamLogFedExtraDetails { + @objc + public var organization: DBXTeamLogOrganizationDetails + + @objc + public init(_ arg: DBXTeamLogOrganizationDetails) { + self.organization = arg + let swift = TeamLog.FedExtraDetails.organization(arg.swift) + super.init(swift: swift) + } +} + +/// More details about the team. +@objc +public class DBXTeamLogFedExtraDetailsTeam: DBXTeamLogFedExtraDetails { + @objc + public var team: DBXTeamLogTeamDetails + + @objc + public init(_ arg: DBXTeamLogTeamDetails) { + self.team = arg + let swift = TeamLog.FedExtraDetails.team(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedExtraDetailsOther: DBXTeamLogFedExtraDetails { + @objc + public init() { + let swift = TeamLog.FedExtraDetails.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FedHandshakeAction union +@objc +public class DBXTeamLogFedHandshakeAction: NSObject { + let swift: TeamLog.FedHandshakeAction + + public init(swift: TeamLog.FedHandshakeAction) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FedHandshakeAction) -> DBXTeamLogFedHandshakeAction { + switch swift { + case .acceptedInvite: + return DBXTeamLogFedHandshakeActionAcceptedInvite() + case .canceledInvite: + return DBXTeamLogFedHandshakeActionCanceledInvite() + case .inviteExpired: + return DBXTeamLogFedHandshakeActionInviteExpired() + case .invited: + return DBXTeamLogFedHandshakeActionInvited() + case .rejectedInvite: + return DBXTeamLogFedHandshakeActionRejectedInvite() + case .removedTeam: + return DBXTeamLogFedHandshakeActionRemovedTeam() + case .other: + return DBXTeamLogFedHandshakeActionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAcceptedInvite: DBXTeamLogFedHandshakeActionAcceptedInvite? { + self as? DBXTeamLogFedHandshakeActionAcceptedInvite + } + + @objc + public var asCanceledInvite: DBXTeamLogFedHandshakeActionCanceledInvite? { + self as? DBXTeamLogFedHandshakeActionCanceledInvite + } + + @objc + public var asInviteExpired: DBXTeamLogFedHandshakeActionInviteExpired? { + self as? DBXTeamLogFedHandshakeActionInviteExpired + } + + @objc + public var asInvited: DBXTeamLogFedHandshakeActionInvited? { + self as? DBXTeamLogFedHandshakeActionInvited + } + + @objc + public var asRejectedInvite: DBXTeamLogFedHandshakeActionRejectedInvite? { + self as? DBXTeamLogFedHandshakeActionRejectedInvite + } + + @objc + public var asRemovedTeam: DBXTeamLogFedHandshakeActionRemovedTeam? { + self as? DBXTeamLogFedHandshakeActionRemovedTeam + } + + @objc + public var asOther: DBXTeamLogFedHandshakeActionOther? { + self as? DBXTeamLogFedHandshakeActionOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedHandshakeActionAcceptedInvite: DBXTeamLogFedHandshakeAction { + @objc + public init() { + let swift = TeamLog.FedHandshakeAction.acceptedInvite + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedHandshakeActionCanceledInvite: DBXTeamLogFedHandshakeAction { + @objc + public init() { + let swift = TeamLog.FedHandshakeAction.canceledInvite + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedHandshakeActionInviteExpired: DBXTeamLogFedHandshakeAction { + @objc + public init() { + let swift = TeamLog.FedHandshakeAction.inviteExpired + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedHandshakeActionInvited: DBXTeamLogFedHandshakeAction { + @objc + public init() { + let swift = TeamLog.FedHandshakeAction.invited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedHandshakeActionRejectedInvite: DBXTeamLogFedHandshakeAction { + @objc + public init() { + let swift = TeamLog.FedHandshakeAction.rejectedInvite + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedHandshakeActionRemovedTeam: DBXTeamLogFedHandshakeAction { + @objc + public init() { + let swift = TeamLog.FedHandshakeAction.removedTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFedHandshakeActionOther: DBXTeamLogFedHandshakeAction { + @objc + public init() { + let swift = TeamLog.FedHandshakeAction.other + super.init(swift: swift) + } +} + +/// Additional information about the organization or connected team +@objc +public class DBXTeamLogFederationStatusChangeAdditionalInfo: NSObject { + let swift: TeamLog.FederationStatusChangeAdditionalInfo + + public init(swift: TeamLog.FederationStatusChangeAdditionalInfo) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FederationStatusChangeAdditionalInfo) -> DBXTeamLogFederationStatusChangeAdditionalInfo { + switch swift { + case .connectedTeamName(let swiftArg): + let arg = DBXTeamLogConnectedTeamName(swift: swiftArg) + return DBXTeamLogFederationStatusChangeAdditionalInfoConnectedTeamName(arg) + case .nonTrustedTeamDetails(let swiftArg): + let arg = DBXTeamLogNonTrustedTeamDetails(swift: swiftArg) + return DBXTeamLogFederationStatusChangeAdditionalInfoNonTrustedTeamDetails(arg) + case .organizationName(let swiftArg): + let arg = DBXTeamLogOrganizationName(swift: swiftArg) + return DBXTeamLogFederationStatusChangeAdditionalInfoOrganizationName(arg) + case .other: + return DBXTeamLogFederationStatusChangeAdditionalInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asConnectedTeamName: DBXTeamLogFederationStatusChangeAdditionalInfoConnectedTeamName? { + self as? DBXTeamLogFederationStatusChangeAdditionalInfoConnectedTeamName + } + + @objc + public var asNonTrustedTeamDetails: DBXTeamLogFederationStatusChangeAdditionalInfoNonTrustedTeamDetails? { + self as? DBXTeamLogFederationStatusChangeAdditionalInfoNonTrustedTeamDetails + } + + @objc + public var asOrganizationName: DBXTeamLogFederationStatusChangeAdditionalInfoOrganizationName? { + self as? DBXTeamLogFederationStatusChangeAdditionalInfoOrganizationName + } + + @objc + public var asOther: DBXTeamLogFederationStatusChangeAdditionalInfoOther? { + self as? DBXTeamLogFederationStatusChangeAdditionalInfoOther + } +} + +/// The name of the team. +@objc +public class DBXTeamLogFederationStatusChangeAdditionalInfoConnectedTeamName: DBXTeamLogFederationStatusChangeAdditionalInfo { + @objc + public var connectedTeamName: DBXTeamLogConnectedTeamName + + @objc + public init(_ arg: DBXTeamLogConnectedTeamName) { + self.connectedTeamName = arg + let swift = TeamLog.FederationStatusChangeAdditionalInfo.connectedTeamName(arg.swift) + super.init(swift: swift) + } +} + +/// The email to which the request was sent. +@objc +public class DBXTeamLogFederationStatusChangeAdditionalInfoNonTrustedTeamDetails: DBXTeamLogFederationStatusChangeAdditionalInfo { + @objc + public var nonTrustedTeamDetails: DBXTeamLogNonTrustedTeamDetails + + @objc + public init(_ arg: DBXTeamLogNonTrustedTeamDetails) { + self.nonTrustedTeamDetails = arg + let swift = TeamLog.FederationStatusChangeAdditionalInfo.nonTrustedTeamDetails(arg.swift) + super.init(swift: swift) + } +} + +/// The name of the organization. +@objc +public class DBXTeamLogFederationStatusChangeAdditionalInfoOrganizationName: DBXTeamLogFederationStatusChangeAdditionalInfo { + @objc + public var organizationName: DBXTeamLogOrganizationName + + @objc + public init(_ arg: DBXTeamLogOrganizationName) { + self.organizationName = arg + let swift = TeamLog.FederationStatusChangeAdditionalInfo.organizationName(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFederationStatusChangeAdditionalInfoOther: DBXTeamLogFederationStatusChangeAdditionalInfo { + @objc + public init() { + let swift = TeamLog.FederationStatusChangeAdditionalInfo.other + super.init(swift: swift) + } +} + +/// Added file comment. +@objc +public class DBXTeamLogFileAddCommentDetails: NSObject { + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(commentText: String?) { + self.swift = TeamLog.FileAddCommentDetails(commentText: commentText) + } + + let swift: TeamLog.FileAddCommentDetails + + public init(swift: TeamLog.FileAddCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileAddCommentType struct +@objc +public class DBXTeamLogFileAddCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileAddCommentType(description_: description_) + } + + let swift: TeamLog.FileAddCommentType + + public init(swift: TeamLog.FileAddCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added files and/or folders. +@objc +public class DBXTeamLogFileAddDetails: NSObject { + let swift: TeamLog.FileAddDetails + + public init(swift: TeamLog.FileAddDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added files and/or folders from automation. +@objc +public class DBXTeamLogFileAddFromAutomationDetails: NSObject { + let swift: TeamLog.FileAddFromAutomationDetails + + public init(swift: TeamLog.FileAddFromAutomationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileAddFromAutomationType struct +@objc +public class DBXTeamLogFileAddFromAutomationType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileAddFromAutomationType(description_: description_) + } + + let swift: TeamLog.FileAddFromAutomationType + + public init(swift: TeamLog.FileAddFromAutomationType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileAddType struct +@objc +public class DBXTeamLogFileAddType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileAddType(description_: description_) + } + + let swift: TeamLog.FileAddType + + public init(swift: TeamLog.FileAddType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Subscribed to or unsubscribed from comment notifications for file. +@objc +public class DBXTeamLogFileChangeCommentSubscriptionDetails: NSObject { + /// New file comment subscription. + @objc + public var newValue: DBXTeamLogFileCommentNotificationPolicy { DBXTeamLogFileCommentNotificationPolicy(swift: swift.newValue) } + /// Previous file comment subscription. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogFileCommentNotificationPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogFileCommentNotificationPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogFileCommentNotificationPolicy, previousValue: DBXTeamLogFileCommentNotificationPolicy?) { + self.swift = TeamLog.FileChangeCommentSubscriptionDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.FileChangeCommentSubscriptionDetails + + public init(swift: TeamLog.FileChangeCommentSubscriptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileChangeCommentSubscriptionType struct +@objc +public class DBXTeamLogFileChangeCommentSubscriptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileChangeCommentSubscriptionType(description_: description_) + } + + let swift: TeamLog.FileChangeCommentSubscriptionType + + public init(swift: TeamLog.FileChangeCommentSubscriptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enable or disable file comments notifications +@objc +public class DBXTeamLogFileCommentNotificationPolicy: NSObject { + let swift: TeamLog.FileCommentNotificationPolicy + + public init(swift: TeamLog.FileCommentNotificationPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FileCommentNotificationPolicy) -> DBXTeamLogFileCommentNotificationPolicy { + switch swift { + case .disabled: + return DBXTeamLogFileCommentNotificationPolicyDisabled() + case .enabled: + return DBXTeamLogFileCommentNotificationPolicyEnabled() + case .other: + return DBXTeamLogFileCommentNotificationPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogFileCommentNotificationPolicyDisabled? { + self as? DBXTeamLogFileCommentNotificationPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogFileCommentNotificationPolicyEnabled? { + self as? DBXTeamLogFileCommentNotificationPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogFileCommentNotificationPolicyOther? { + self as? DBXTeamLogFileCommentNotificationPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileCommentNotificationPolicyDisabled: DBXTeamLogFileCommentNotificationPolicy { + @objc + public init() { + let swift = TeamLog.FileCommentNotificationPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileCommentNotificationPolicyEnabled: DBXTeamLogFileCommentNotificationPolicy { + @objc + public init() { + let swift = TeamLog.FileCommentNotificationPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileCommentNotificationPolicyOther: DBXTeamLogFileCommentNotificationPolicy { + @objc + public init() { + let swift = TeamLog.FileCommentNotificationPolicy.other + super.init(swift: swift) + } +} + +/// Enabled/disabled commenting on team files. +@objc +public class DBXTeamLogFileCommentsChangePolicyDetails: NSObject { + /// New commenting on team files policy. + @objc + public var newValue: DBXTeamLogFileCommentsPolicy { DBXTeamLogFileCommentsPolicy(swift: swift.newValue) } + /// Previous commenting on team files policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogFileCommentsPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogFileCommentsPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogFileCommentsPolicy, previousValue: DBXTeamLogFileCommentsPolicy?) { + self.swift = TeamLog.FileCommentsChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.FileCommentsChangePolicyDetails + + public init(swift: TeamLog.FileCommentsChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileCommentsChangePolicyType struct +@objc +public class DBXTeamLogFileCommentsChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileCommentsChangePolicyType(description_: description_) + } + + let swift: TeamLog.FileCommentsChangePolicyType + + public init(swift: TeamLog.FileCommentsChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// File comments policy +@objc +public class DBXTeamLogFileCommentsPolicy: NSObject { + let swift: TeamLog.FileCommentsPolicy + + public init(swift: TeamLog.FileCommentsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FileCommentsPolicy) -> DBXTeamLogFileCommentsPolicy { + switch swift { + case .disabled: + return DBXTeamLogFileCommentsPolicyDisabled() + case .enabled: + return DBXTeamLogFileCommentsPolicyEnabled() + case .other: + return DBXTeamLogFileCommentsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogFileCommentsPolicyDisabled? { + self as? DBXTeamLogFileCommentsPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogFileCommentsPolicyEnabled? { + self as? DBXTeamLogFileCommentsPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogFileCommentsPolicyOther? { + self as? DBXTeamLogFileCommentsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileCommentsPolicyDisabled: DBXTeamLogFileCommentsPolicy { + @objc + public init() { + let swift = TeamLog.FileCommentsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileCommentsPolicyEnabled: DBXTeamLogFileCommentsPolicy { + @objc + public init() { + let swift = TeamLog.FileCommentsPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileCommentsPolicyOther: DBXTeamLogFileCommentsPolicy { + @objc + public init() { + let swift = TeamLog.FileCommentsPolicy.other + super.init(swift: swift) + } +} + +/// Copied files and/or folders. +@objc +public class DBXTeamLogFileCopyDetails: NSObject { + /// Relocate action details. + @objc + public var relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo] { + swift.relocateActionDetails.map { DBXTeamLogRelocateAssetReferencesLogInfo(swift: $0) } + } + + @objc + public init(relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo]) { + self.swift = TeamLog.FileCopyDetails(relocateActionDetails: relocateActionDetails.map(\.swift)) + } + + let swift: TeamLog.FileCopyDetails + + public init(swift: TeamLog.FileCopyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileCopyType struct +@objc +public class DBXTeamLogFileCopyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileCopyType(description_: description_) + } + + let swift: TeamLog.FileCopyType + + public init(swift: TeamLog.FileCopyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted file comment. +@objc +public class DBXTeamLogFileDeleteCommentDetails: NSObject { + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(commentText: String?) { + self.swift = TeamLog.FileDeleteCommentDetails(commentText: commentText) + } + + let swift: TeamLog.FileDeleteCommentDetails + + public init(swift: TeamLog.FileDeleteCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileDeleteCommentType struct +@objc +public class DBXTeamLogFileDeleteCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileDeleteCommentType(description_: description_) + } + + let swift: TeamLog.FileDeleteCommentType + + public init(swift: TeamLog.FileDeleteCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted files and/or folders. +@objc +public class DBXTeamLogFileDeleteDetails: NSObject { + let swift: TeamLog.FileDeleteDetails + + public init(swift: TeamLog.FileDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileDeleteType struct +@objc +public class DBXTeamLogFileDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileDeleteType(description_: description_) + } + + let swift: TeamLog.FileDeleteType + + public init(swift: TeamLog.FileDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downloaded files and/or folders. +@objc +public class DBXTeamLogFileDownloadDetails: NSObject { + let swift: TeamLog.FileDownloadDetails + + public init(swift: TeamLog.FileDownloadDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileDownloadType struct +@objc +public class DBXTeamLogFileDownloadType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileDownloadType(description_: description_) + } + + let swift: TeamLog.FileDownloadType + + public init(swift: TeamLog.FileDownloadType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited file comment. +@objc +public class DBXTeamLogFileEditCommentDetails: NSObject { + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + /// Previous comment text. + @objc + public var previousCommentText: String { swift.previousCommentText } + + @objc + public init(previousCommentText: String, commentText: String?) { + self.swift = TeamLog.FileEditCommentDetails(previousCommentText: previousCommentText, commentText: commentText) + } + + let swift: TeamLog.FileEditCommentDetails + + public init(swift: TeamLog.FileEditCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileEditCommentType struct +@objc +public class DBXTeamLogFileEditCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileEditCommentType(description_: description_) + } + + let swift: TeamLog.FileEditCommentType + + public init(swift: TeamLog.FileEditCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited files. +@objc +public class DBXTeamLogFileEditDetails: NSObject { + let swift: TeamLog.FileEditDetails + + public init(swift: TeamLog.FileEditDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileEditType struct +@objc +public class DBXTeamLogFileEditType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileEditType(description_: description_) + } + + let swift: TeamLog.FileEditType + + public init(swift: TeamLog.FileEditType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created copy reference to file/folder. +@objc +public class DBXTeamLogFileGetCopyReferenceDetails: NSObject { + let swift: TeamLog.FileGetCopyReferenceDetails + + public init(swift: TeamLog.FileGetCopyReferenceDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileGetCopyReferenceType struct +@objc +public class DBXTeamLogFileGetCopyReferenceType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileGetCopyReferenceType(description_: description_) + } + + let swift: TeamLog.FileGetCopyReferenceType + + public init(swift: TeamLog.FileGetCopyReferenceType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Liked file comment. +@objc +public class DBXTeamLogFileLikeCommentDetails: NSObject { + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(commentText: String?) { + self.swift = TeamLog.FileLikeCommentDetails(commentText: commentText) + } + + let swift: TeamLog.FileLikeCommentDetails + + public init(swift: TeamLog.FileLikeCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileLikeCommentType struct +@objc +public class DBXTeamLogFileLikeCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileLikeCommentType(description_: description_) + } + + let swift: TeamLog.FileLikeCommentType + + public init(swift: TeamLog.FileLikeCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Locked/unlocked editing for a file. +@objc +public class DBXTeamLogFileLockingLockStatusChangedDetails: NSObject { + /// Previous lock status of the file. + @objc + public var previousValue: DBXTeamLogLockStatus { DBXTeamLogLockStatus(swift: swift.previousValue) } + /// New lock status of the file. + @objc + public var newValue: DBXTeamLogLockStatus { DBXTeamLogLockStatus(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogLockStatus, newValue: DBXTeamLogLockStatus) { + self.swift = TeamLog.FileLockingLockStatusChangedDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.FileLockingLockStatusChangedDetails + + public init(swift: TeamLog.FileLockingLockStatusChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileLockingLockStatusChangedType struct +@objc +public class DBXTeamLogFileLockingLockStatusChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileLockingLockStatusChangedType(description_: description_) + } + + let swift: TeamLog.FileLockingLockStatusChangedType + + public init(swift: TeamLog.FileLockingLockStatusChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed file locking policy for team. +@objc +public class DBXTeamLogFileLockingPolicyChangedDetails: NSObject { + /// New file locking policy. + @objc + public var newValue: DBXTeamPoliciesFileLockingPolicyState { DBXTeamPoliciesFileLockingPolicyState(swift: swift.newValue) } + /// Previous file locking policy. + @objc + public var previousValue: DBXTeamPoliciesFileLockingPolicyState { DBXTeamPoliciesFileLockingPolicyState(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamPoliciesFileLockingPolicyState, previousValue: DBXTeamPoliciesFileLockingPolicyState) { + self.swift = TeamLog.FileLockingPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.FileLockingPolicyChangedDetails + + public init(swift: TeamLog.FileLockingPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileLockingPolicyChangedType struct +@objc +public class DBXTeamLogFileLockingPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileLockingPolicyChangedType(description_: description_) + } + + let swift: TeamLog.FileLockingPolicyChangedType + + public init(swift: TeamLog.FileLockingPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Generic information relevant both for files and folders +@objc +public class DBXTeamLogFileOrFolderLogInfo: NSObject { + /// Path relative to event context. + @objc + public var path: DBXTeamLogPathLogInfo { DBXTeamLogPathLogInfo(swift: swift.path) } + /// Display name. + @objc + public var displayName: String? { swift.displayName } + /// Unique ID. + @objc + public var fileId: String? { swift.fileId } + /// File or folder size in bytes. + @objc + public var fileSize: NSNumber? { swift.fileSize as NSNumber? } + + @objc + public init(path: DBXTeamLogPathLogInfo, displayName: String?, fileId: String?, fileSize: NSNumber?) { + self.swift = TeamLog.FileOrFolderLogInfo(path: path.swift, displayName: displayName, fileId: fileId, fileSize: fileSize?.uint64Value) + } + + let swift: TeamLog.FileOrFolderLogInfo + + public init(swift: TeamLog.FileOrFolderLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// File's logged information. +@objc +public class DBXTeamLogFileLogInfo: DBXTeamLogFileOrFolderLogInfo { + let subSwift: TeamLog.FileLogInfo + + public init(swift: TeamLog.FileLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Moved files and/or folders. +@objc +public class DBXTeamLogFileMoveDetails: NSObject { + /// Relocate action details. + @objc + public var relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo] { + swift.relocateActionDetails.map { DBXTeamLogRelocateAssetReferencesLogInfo(swift: $0) } + } + + @objc + public init(relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo]) { + self.swift = TeamLog.FileMoveDetails(relocateActionDetails: relocateActionDetails.map(\.swift)) + } + + let swift: TeamLog.FileMoveDetails + + public init(swift: TeamLog.FileMoveDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileMoveType struct +@objc +public class DBXTeamLogFileMoveType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileMoveType(description_: description_) + } + + let swift: TeamLog.FileMoveType + + public init(swift: TeamLog.FileMoveType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Permanently deleted files and/or folders. +@objc +public class DBXTeamLogFilePermanentlyDeleteDetails: NSObject { + let swift: TeamLog.FilePermanentlyDeleteDetails + + public init(swift: TeamLog.FilePermanentlyDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FilePermanentlyDeleteType struct +@objc +public class DBXTeamLogFilePermanentlyDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FilePermanentlyDeleteType(description_: description_) + } + + let swift: TeamLog.FilePermanentlyDeleteType + + public init(swift: TeamLog.FilePermanentlyDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Previewed files and/or folders. +@objc +public class DBXTeamLogFilePreviewDetails: NSObject { + let swift: TeamLog.FilePreviewDetails + + public init(swift: TeamLog.FilePreviewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FilePreviewType struct +@objc +public class DBXTeamLogFilePreviewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FilePreviewType(description_: description_) + } + + let swift: TeamLog.FilePreviewType + + public init(swift: TeamLog.FilePreviewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed File Provider Migration policy for team. +@objc +public class DBXTeamLogFileProviderMigrationPolicyChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamPoliciesFileProviderMigrationPolicyState { DBXTeamPoliciesFileProviderMigrationPolicyState(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamPoliciesFileProviderMigrationPolicyState { DBXTeamPoliciesFileProviderMigrationPolicyState(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamPoliciesFileProviderMigrationPolicyState, previousValue: DBXTeamPoliciesFileProviderMigrationPolicyState) { + self.swift = TeamLog.FileProviderMigrationPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.FileProviderMigrationPolicyChangedDetails + + public init(swift: TeamLog.FileProviderMigrationPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileProviderMigrationPolicyChangedType struct +@objc +public class DBXTeamLogFileProviderMigrationPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileProviderMigrationPolicyChangedType(description_: description_) + } + + let swift: TeamLog.FileProviderMigrationPolicyChangedType + + public init(swift: TeamLog.FileProviderMigrationPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed files and/or folders. +@objc +public class DBXTeamLogFileRenameDetails: NSObject { + /// Relocate action details. + @objc + public var relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo] { + swift.relocateActionDetails.map { DBXTeamLogRelocateAssetReferencesLogInfo(swift: $0) } + } + + @objc + public init(relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo]) { + self.swift = TeamLog.FileRenameDetails(relocateActionDetails: relocateActionDetails.map(\.swift)) + } + + let swift: TeamLog.FileRenameDetails + + public init(swift: TeamLog.FileRenameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRenameType struct +@objc +public class DBXTeamLogFileRenameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRenameType(description_: description_) + } + + let swift: TeamLog.FileRenameType + + public init(swift: TeamLog.FileRenameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed file request. +@objc +public class DBXTeamLogFileRequestChangeDetails: NSObject { + /// File request id. Might be missing due to historical data gap. + @objc + public var fileRequestId: String? { swift.fileRequestId } + /// Previous file request details. Might be missing due to historical data gap. + @objc + public var previousDetails: DBXTeamLogFileRequestDetails? { guard let swift = swift.previousDetails else { return nil } + return DBXTeamLogFileRequestDetails(swift: swift) + } + + /// New file request details. + @objc + public var newDetails: DBXTeamLogFileRequestDetails { DBXTeamLogFileRequestDetails(swift: swift.newDetails) } + + @objc + public init(newDetails: DBXTeamLogFileRequestDetails, fileRequestId: String?, previousDetails: DBXTeamLogFileRequestDetails?) { + self.swift = TeamLog.FileRequestChangeDetails(newDetails: newDetails.swift, fileRequestId: fileRequestId, previousDetails: previousDetails?.swift) + } + + let swift: TeamLog.FileRequestChangeDetails + + public init(swift: TeamLog.FileRequestChangeDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestChangeType struct +@objc +public class DBXTeamLogFileRequestChangeType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestChangeType(description_: description_) + } + + let swift: TeamLog.FileRequestChangeType + + public init(swift: TeamLog.FileRequestChangeType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Closed file request. +@objc +public class DBXTeamLogFileRequestCloseDetails: NSObject { + /// File request id. Might be missing due to historical data gap. + @objc + public var fileRequestId: String? { swift.fileRequestId } + /// Previous file request details. Might be missing due to historical data gap. + @objc + public var previousDetails: DBXTeamLogFileRequestDetails? { guard let swift = swift.previousDetails else { return nil } + return DBXTeamLogFileRequestDetails(swift: swift) + } + + @objc + public init(fileRequestId: String?, previousDetails: DBXTeamLogFileRequestDetails?) { + self.swift = TeamLog.FileRequestCloseDetails(fileRequestId: fileRequestId, previousDetails: previousDetails?.swift) + } + + let swift: TeamLog.FileRequestCloseDetails + + public init(swift: TeamLog.FileRequestCloseDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestCloseType struct +@objc +public class DBXTeamLogFileRequestCloseType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestCloseType(description_: description_) + } + + let swift: TeamLog.FileRequestCloseType + + public init(swift: TeamLog.FileRequestCloseType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created file request. +@objc +public class DBXTeamLogFileRequestCreateDetails: NSObject { + /// File request id. Might be missing due to historical data gap. + @objc + public var fileRequestId: String? { swift.fileRequestId } + /// File request details. Might be missing due to historical data gap. + @objc + public var requestDetails: DBXTeamLogFileRequestDetails? { guard let swift = swift.requestDetails else { return nil } + return DBXTeamLogFileRequestDetails(swift: swift) + } + + @objc + public init(fileRequestId: String?, requestDetails: DBXTeamLogFileRequestDetails?) { + self.swift = TeamLog.FileRequestCreateDetails(fileRequestId: fileRequestId, requestDetails: requestDetails?.swift) + } + + let swift: TeamLog.FileRequestCreateDetails + + public init(swift: TeamLog.FileRequestCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestCreateType struct +@objc +public class DBXTeamLogFileRequestCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestCreateType(description_: description_) + } + + let swift: TeamLog.FileRequestCreateType + + public init(swift: TeamLog.FileRequestCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// File request deadline +@objc +public class DBXTeamLogFileRequestDeadline: NSObject { + /// The deadline for this file request. Might be missing due to historical data gap. + @objc + public var deadline: Date? { swift.deadline } + /// If set, allow uploads after the deadline has passed. + @objc + public var allowLateUploads: String? { swift.allowLateUploads } + + @objc + public init(deadline: Date?, allowLateUploads: String?) { + self.swift = TeamLog.FileRequestDeadline(deadline: deadline, allowLateUploads: allowLateUploads) + } + + let swift: TeamLog.FileRequestDeadline + + public init(swift: TeamLog.FileRequestDeadline) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Delete file request. +@objc +public class DBXTeamLogFileRequestDeleteDetails: NSObject { + /// File request id. Might be missing due to historical data gap. + @objc + public var fileRequestId: String? { swift.fileRequestId } + /// Previous file request details. Might be missing due to historical data gap. + @objc + public var previousDetails: DBXTeamLogFileRequestDetails? { guard let swift = swift.previousDetails else { return nil } + return DBXTeamLogFileRequestDetails(swift: swift) + } + + @objc + public init(fileRequestId: String?, previousDetails: DBXTeamLogFileRequestDetails?) { + self.swift = TeamLog.FileRequestDeleteDetails(fileRequestId: fileRequestId, previousDetails: previousDetails?.swift) + } + + let swift: TeamLog.FileRequestDeleteDetails + + public init(swift: TeamLog.FileRequestDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestDeleteType struct +@objc +public class DBXTeamLogFileRequestDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestDeleteType(description_: description_) + } + + let swift: TeamLog.FileRequestDeleteType + + public init(swift: TeamLog.FileRequestDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// File request details +@objc +public class DBXTeamLogFileRequestDetails: NSObject { + /// Asset position in the Assets list. + @objc + public var assetIndex: NSNumber { swift.assetIndex as NSNumber } + /// File request deadline. + @objc + public var deadline: DBXTeamLogFileRequestDeadline? { guard let swift = swift.deadline else { return nil } + return DBXTeamLogFileRequestDeadline(swift: swift) + } + + @objc + public init(assetIndex: NSNumber, deadline: DBXTeamLogFileRequestDeadline?) { + self.swift = TeamLog.FileRequestDetails(assetIndex: assetIndex.uint64Value, deadline: deadline?.swift) + } + + let swift: TeamLog.FileRequestDetails + + public init(swift: TeamLog.FileRequestDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Received files for file request. +@objc +public class DBXTeamLogFileRequestReceiveFileDetails: NSObject { + /// File request id. Might be missing due to historical data gap. + @objc + public var fileRequestId: String? { swift.fileRequestId } + /// File request details. Might be missing due to historical data gap. + @objc + public var fileRequestDetails: DBXTeamLogFileRequestDetails? { guard let swift = swift.fileRequestDetails else { return nil } + return DBXTeamLogFileRequestDetails(swift: swift) + } + + /// Submitted file names. + @objc + public var submittedFileNames: [String] { swift.submittedFileNames } + /// The name as provided by the submitter. + @objc + public var submitterName: String? { swift.submitterName } + /// The email as provided by the submitter. + @objc + public var submitterEmail: String? { swift.submitterEmail } + + @objc + public init( + submittedFileNames: [String], + fileRequestId: String?, + fileRequestDetails: DBXTeamLogFileRequestDetails?, + submitterName: String?, + submitterEmail: String? + ) { + self.swift = TeamLog.FileRequestReceiveFileDetails( + submittedFileNames: submittedFileNames, + fileRequestId: fileRequestId, + fileRequestDetails: fileRequestDetails?.swift, + submitterName: submitterName, + submitterEmail: submitterEmail + ) + } + + let swift: TeamLog.FileRequestReceiveFileDetails + + public init(swift: TeamLog.FileRequestReceiveFileDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestReceiveFileType struct +@objc +public class DBXTeamLogFileRequestReceiveFileType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestReceiveFileType(description_: description_) + } + + let swift: TeamLog.FileRequestReceiveFileType + + public init(swift: TeamLog.FileRequestReceiveFileType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled file requests. +@objc +public class DBXTeamLogFileRequestsChangePolicyDetails: NSObject { + /// New file requests policy. + @objc + public var newValue: DBXTeamLogFileRequestsPolicy { DBXTeamLogFileRequestsPolicy(swift: swift.newValue) } + /// Previous file requests policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogFileRequestsPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogFileRequestsPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogFileRequestsPolicy, previousValue: DBXTeamLogFileRequestsPolicy?) { + self.swift = TeamLog.FileRequestsChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.FileRequestsChangePolicyDetails + + public init(swift: TeamLog.FileRequestsChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestsChangePolicyType struct +@objc +public class DBXTeamLogFileRequestsChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestsChangePolicyType(description_: description_) + } + + let swift: TeamLog.FileRequestsChangePolicyType + + public init(swift: TeamLog.FileRequestsChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled file request emails for everyone. +@objc +public class DBXTeamLogFileRequestsEmailsEnabledDetails: NSObject { + let swift: TeamLog.FileRequestsEmailsEnabledDetails + + public init(swift: TeamLog.FileRequestsEmailsEnabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestsEmailsEnabledType struct +@objc +public class DBXTeamLogFileRequestsEmailsEnabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestsEmailsEnabledType(description_: description_) + } + + let swift: TeamLog.FileRequestsEmailsEnabledType + + public init(swift: TeamLog.FileRequestsEmailsEnabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled file request emails for team. +@objc +public class DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyDetails: NSObject { + let swift: TeamLog.FileRequestsEmailsRestrictedToTeamOnlyDetails + + public init(swift: TeamLog.FileRequestsEmailsRestrictedToTeamOnlyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRequestsEmailsRestrictedToTeamOnlyType struct +@objc +public class DBXTeamLogFileRequestsEmailsRestrictedToTeamOnlyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRequestsEmailsRestrictedToTeamOnlyType(description_: description_) + } + + let swift: TeamLog.FileRequestsEmailsRestrictedToTeamOnlyType + + public init(swift: TeamLog.FileRequestsEmailsRestrictedToTeamOnlyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// File requests policy +@objc +public class DBXTeamLogFileRequestsPolicy: NSObject { + let swift: TeamLog.FileRequestsPolicy + + public init(swift: TeamLog.FileRequestsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FileRequestsPolicy) -> DBXTeamLogFileRequestsPolicy { + switch swift { + case .disabled: + return DBXTeamLogFileRequestsPolicyDisabled() + case .enabled: + return DBXTeamLogFileRequestsPolicyEnabled() + case .other: + return DBXTeamLogFileRequestsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogFileRequestsPolicyDisabled? { + self as? DBXTeamLogFileRequestsPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogFileRequestsPolicyEnabled? { + self as? DBXTeamLogFileRequestsPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogFileRequestsPolicyOther? { + self as? DBXTeamLogFileRequestsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileRequestsPolicyDisabled: DBXTeamLogFileRequestsPolicy { + @objc + public init() { + let swift = TeamLog.FileRequestsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileRequestsPolicyEnabled: DBXTeamLogFileRequestsPolicy { + @objc + public init() { + let swift = TeamLog.FileRequestsPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileRequestsPolicyOther: DBXTeamLogFileRequestsPolicy { + @objc + public init() { + let swift = TeamLog.FileRequestsPolicy.other + super.init(swift: swift) + } +} + +/// Resolved file comment. +@objc +public class DBXTeamLogFileResolveCommentDetails: NSObject { + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(commentText: String?) { + self.swift = TeamLog.FileResolveCommentDetails(commentText: commentText) + } + + let swift: TeamLog.FileResolveCommentDetails + + public init(swift: TeamLog.FileResolveCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileResolveCommentType struct +@objc +public class DBXTeamLogFileResolveCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileResolveCommentType(description_: description_) + } + + let swift: TeamLog.FileResolveCommentType + + public init(swift: TeamLog.FileResolveCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored deleted files and/or folders. +@objc +public class DBXTeamLogFileRestoreDetails: NSObject { + let swift: TeamLog.FileRestoreDetails + + public init(swift: TeamLog.FileRestoreDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRestoreType struct +@objc +public class DBXTeamLogFileRestoreType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRestoreType(description_: description_) + } + + let swift: TeamLog.FileRestoreType + + public init(swift: TeamLog.FileRestoreType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reverted files to previous version. +@objc +public class DBXTeamLogFileRevertDetails: NSObject { + let swift: TeamLog.FileRevertDetails + + public init(swift: TeamLog.FileRevertDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRevertType struct +@objc +public class DBXTeamLogFileRevertType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRevertType(description_: description_) + } + + let swift: TeamLog.FileRevertType + + public init(swift: TeamLog.FileRevertType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Rolled back file actions. +@objc +public class DBXTeamLogFileRollbackChangesDetails: NSObject { + let swift: TeamLog.FileRollbackChangesDetails + + public init(swift: TeamLog.FileRollbackChangesDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileRollbackChangesType struct +@objc +public class DBXTeamLogFileRollbackChangesType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileRollbackChangesType(description_: description_) + } + + let swift: TeamLog.FileRollbackChangesType + + public init(swift: TeamLog.FileRollbackChangesType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Saved file/folder using copy reference. +@objc +public class DBXTeamLogFileSaveCopyReferenceDetails: NSObject { + /// Relocate action details. + @objc + public var relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo] { + swift.relocateActionDetails.map { DBXTeamLogRelocateAssetReferencesLogInfo(swift: $0) } + } + + @objc + public init(relocateActionDetails: [DBXTeamLogRelocateAssetReferencesLogInfo]) { + self.swift = TeamLog.FileSaveCopyReferenceDetails(relocateActionDetails: relocateActionDetails.map(\.swift)) + } + + let swift: TeamLog.FileSaveCopyReferenceDetails + + public init(swift: TeamLog.FileSaveCopyReferenceDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileSaveCopyReferenceType struct +@objc +public class DBXTeamLogFileSaveCopyReferenceType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileSaveCopyReferenceType(description_: description_) + } + + let swift: TeamLog.FileSaveCopyReferenceType + + public init(swift: TeamLog.FileSaveCopyReferenceType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Transfer files added. +@objc +public class DBXTeamLogFileTransfersFileAddDetails: NSObject { + /// Transfer id. + @objc + public var fileTransferId: String { swift.fileTransferId } + + @objc + public init(fileTransferId: String) { + self.swift = TeamLog.FileTransfersFileAddDetails(fileTransferId: fileTransferId) + } + + let swift: TeamLog.FileTransfersFileAddDetails + + public init(swift: TeamLog.FileTransfersFileAddDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileTransfersFileAddType struct +@objc +public class DBXTeamLogFileTransfersFileAddType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileTransfersFileAddType(description_: description_) + } + + let swift: TeamLog.FileTransfersFileAddType + + public init(swift: TeamLog.FileTransfersFileAddType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// File transfers policy +@objc +public class DBXTeamLogFileTransfersPolicy: NSObject { + let swift: TeamLog.FileTransfersPolicy + + public init(swift: TeamLog.FileTransfersPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FileTransfersPolicy) -> DBXTeamLogFileTransfersPolicy { + switch swift { + case .disabled: + return DBXTeamLogFileTransfersPolicyDisabled() + case .enabled: + return DBXTeamLogFileTransfersPolicyEnabled() + case .other: + return DBXTeamLogFileTransfersPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogFileTransfersPolicyDisabled? { + self as? DBXTeamLogFileTransfersPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogFileTransfersPolicyEnabled? { + self as? DBXTeamLogFileTransfersPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogFileTransfersPolicyOther? { + self as? DBXTeamLogFileTransfersPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileTransfersPolicyDisabled: DBXTeamLogFileTransfersPolicy { + @objc + public init() { + let swift = TeamLog.FileTransfersPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileTransfersPolicyEnabled: DBXTeamLogFileTransfersPolicy { + @objc + public init() { + let swift = TeamLog.FileTransfersPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFileTransfersPolicyOther: DBXTeamLogFileTransfersPolicy { + @objc + public init() { + let swift = TeamLog.FileTransfersPolicy.other + super.init(swift: swift) + } +} + +/// Changed file transfers policy for team. +@objc +public class DBXTeamLogFileTransfersPolicyChangedDetails: NSObject { + /// New file transfers policy. + @objc + public var newValue: DBXTeamLogFileTransfersPolicy { DBXTeamLogFileTransfersPolicy(swift: swift.newValue) } + /// Previous file transfers policy. + @objc + public var previousValue: DBXTeamLogFileTransfersPolicy { DBXTeamLogFileTransfersPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogFileTransfersPolicy, previousValue: DBXTeamLogFileTransfersPolicy) { + self.swift = TeamLog.FileTransfersPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.FileTransfersPolicyChangedDetails + + public init(swift: TeamLog.FileTransfersPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileTransfersPolicyChangedType struct +@objc +public class DBXTeamLogFileTransfersPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileTransfersPolicyChangedType(description_: description_) + } + + let swift: TeamLog.FileTransfersPolicyChangedType + + public init(swift: TeamLog.FileTransfersPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted transfer. +@objc +public class DBXTeamLogFileTransfersTransferDeleteDetails: NSObject { + /// Transfer id. + @objc + public var fileTransferId: String { swift.fileTransferId } + + @objc + public init(fileTransferId: String) { + self.swift = TeamLog.FileTransfersTransferDeleteDetails(fileTransferId: fileTransferId) + } + + let swift: TeamLog.FileTransfersTransferDeleteDetails + + public init(swift: TeamLog.FileTransfersTransferDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileTransfersTransferDeleteType struct +@objc +public class DBXTeamLogFileTransfersTransferDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileTransfersTransferDeleteType(description_: description_) + } + + let swift: TeamLog.FileTransfersTransferDeleteType + + public init(swift: TeamLog.FileTransfersTransferDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Transfer downloaded. +@objc +public class DBXTeamLogFileTransfersTransferDownloadDetails: NSObject { + /// Transfer id. + @objc + public var fileTransferId: String { swift.fileTransferId } + + @objc + public init(fileTransferId: String) { + self.swift = TeamLog.FileTransfersTransferDownloadDetails(fileTransferId: fileTransferId) + } + + let swift: TeamLog.FileTransfersTransferDownloadDetails + + public init(swift: TeamLog.FileTransfersTransferDownloadDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileTransfersTransferDownloadType struct +@objc +public class DBXTeamLogFileTransfersTransferDownloadType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileTransfersTransferDownloadType(description_: description_) + } + + let swift: TeamLog.FileTransfersTransferDownloadType + + public init(swift: TeamLog.FileTransfersTransferDownloadType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Sent transfer. +@objc +public class DBXTeamLogFileTransfersTransferSendDetails: NSObject { + /// Transfer id. + @objc + public var fileTransferId: String { swift.fileTransferId } + + @objc + public init(fileTransferId: String) { + self.swift = TeamLog.FileTransfersTransferSendDetails(fileTransferId: fileTransferId) + } + + let swift: TeamLog.FileTransfersTransferSendDetails + + public init(swift: TeamLog.FileTransfersTransferSendDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileTransfersTransferSendType struct +@objc +public class DBXTeamLogFileTransfersTransferSendType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileTransfersTransferSendType(description_: description_) + } + + let swift: TeamLog.FileTransfersTransferSendType + + public init(swift: TeamLog.FileTransfersTransferSendType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Viewed transfer. +@objc +public class DBXTeamLogFileTransfersTransferViewDetails: NSObject { + /// Transfer id. + @objc + public var fileTransferId: String { swift.fileTransferId } + + @objc + public init(fileTransferId: String) { + self.swift = TeamLog.FileTransfersTransferViewDetails(fileTransferId: fileTransferId) + } + + let swift: TeamLog.FileTransfersTransferViewDetails + + public init(swift: TeamLog.FileTransfersTransferViewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileTransfersTransferViewType struct +@objc +public class DBXTeamLogFileTransfersTransferViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileTransfersTransferViewType(description_: description_) + } + + let swift: TeamLog.FileTransfersTransferViewType + + public init(swift: TeamLog.FileTransfersTransferViewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unliked file comment. +@objc +public class DBXTeamLogFileUnlikeCommentDetails: NSObject { + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(commentText: String?) { + self.swift = TeamLog.FileUnlikeCommentDetails(commentText: commentText) + } + + let swift: TeamLog.FileUnlikeCommentDetails + + public init(swift: TeamLog.FileUnlikeCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileUnlikeCommentType struct +@objc +public class DBXTeamLogFileUnlikeCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileUnlikeCommentType(description_: description_) + } + + let swift: TeamLog.FileUnlikeCommentType + + public init(swift: TeamLog.FileUnlikeCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unresolved file comment. +@objc +public class DBXTeamLogFileUnresolveCommentDetails: NSObject { + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(commentText: String?) { + self.swift = TeamLog.FileUnresolveCommentDetails(commentText: commentText) + } + + let swift: TeamLog.FileUnresolveCommentDetails + + public init(swift: TeamLog.FileUnresolveCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FileUnresolveCommentType struct +@objc +public class DBXTeamLogFileUnresolveCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FileUnresolveCommentType(description_: description_) + } + + let swift: TeamLog.FileUnresolveCommentType + + public init(swift: TeamLog.FileUnresolveCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether applying link restrictions on all team owned folders +@objc +public class DBXTeamLogFolderLinkRestrictionPolicy: NSObject { + let swift: TeamLog.FolderLinkRestrictionPolicy + + public init(swift: TeamLog.FolderLinkRestrictionPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.FolderLinkRestrictionPolicy) -> DBXTeamLogFolderLinkRestrictionPolicy { + switch swift { + case .disabled: + return DBXTeamLogFolderLinkRestrictionPolicyDisabled() + case .enabled: + return DBXTeamLogFolderLinkRestrictionPolicyEnabled() + case .other: + return DBXTeamLogFolderLinkRestrictionPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogFolderLinkRestrictionPolicyDisabled? { + self as? DBXTeamLogFolderLinkRestrictionPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogFolderLinkRestrictionPolicyEnabled? { + self as? DBXTeamLogFolderLinkRestrictionPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogFolderLinkRestrictionPolicyOther? { + self as? DBXTeamLogFolderLinkRestrictionPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFolderLinkRestrictionPolicyDisabled: DBXTeamLogFolderLinkRestrictionPolicy { + @objc + public init() { + let swift = TeamLog.FolderLinkRestrictionPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFolderLinkRestrictionPolicyEnabled: DBXTeamLogFolderLinkRestrictionPolicy { + @objc + public init() { + let swift = TeamLog.FolderLinkRestrictionPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogFolderLinkRestrictionPolicyOther: DBXTeamLogFolderLinkRestrictionPolicy { + @objc + public init() { + let swift = TeamLog.FolderLinkRestrictionPolicy.other + super.init(swift: swift) + } +} + +/// Changed folder link restrictions policy for team. +@objc +public class DBXTeamLogFolderLinkRestrictionPolicyChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogFolderLinkRestrictionPolicy { DBXTeamLogFolderLinkRestrictionPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogFolderLinkRestrictionPolicy { DBXTeamLogFolderLinkRestrictionPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogFolderLinkRestrictionPolicy, previousValue: DBXTeamLogFolderLinkRestrictionPolicy) { + self.swift = TeamLog.FolderLinkRestrictionPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.FolderLinkRestrictionPolicyChangedDetails + + public init(swift: TeamLog.FolderLinkRestrictionPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FolderLinkRestrictionPolicyChangedType struct +@objc +public class DBXTeamLogFolderLinkRestrictionPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FolderLinkRestrictionPolicyChangedType(description_: description_) + } + + let swift: TeamLog.FolderLinkRestrictionPolicyChangedType + + public init(swift: TeamLog.FolderLinkRestrictionPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Folder's logged information. +@objc +public class DBXTeamLogFolderLogInfo: DBXTeamLogFileOrFolderLogInfo { + /// Number of files within the folder. + @objc + public var fileCount: NSNumber? { subSwift.fileCount as NSNumber? } + + @objc + public init(path: DBXTeamLogPathLogInfo, displayName: String?, fileId: String?, fileSize: NSNumber?, fileCount: NSNumber?) { + let swift = TeamLog.FolderLogInfo( + path: path.swift, + displayName: displayName, + fileId: fileId, + fileSize: fileSize?.uint64Value, + fileCount: fileCount?.uint64Value + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: TeamLog.FolderLogInfo + + public init(swift: TeamLog.FolderLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Updated folder overview. +@objc +public class DBXTeamLogFolderOverviewDescriptionChangedDetails: NSObject { + /// Folder Overview location position in the Assets list. + @objc + public var folderOverviewLocationAsset: NSNumber { swift.folderOverviewLocationAsset as NSNumber } + + @objc + public init(folderOverviewLocationAsset: NSNumber) { + self.swift = TeamLog.FolderOverviewDescriptionChangedDetails(folderOverviewLocationAsset: folderOverviewLocationAsset.uint64Value) + } + + let swift: TeamLog.FolderOverviewDescriptionChangedDetails + + public init(swift: TeamLog.FolderOverviewDescriptionChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FolderOverviewDescriptionChangedType struct +@objc +public class DBXTeamLogFolderOverviewDescriptionChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FolderOverviewDescriptionChangedType(description_: description_) + } + + let swift: TeamLog.FolderOverviewDescriptionChangedType + + public init(swift: TeamLog.FolderOverviewDescriptionChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Pinned item to folder overview. +@objc +public class DBXTeamLogFolderOverviewItemPinnedDetails: NSObject { + /// Folder Overview location position in the Assets list. + @objc + public var folderOverviewLocationAsset: NSNumber { swift.folderOverviewLocationAsset as NSNumber } + /// Pinned items positions in the Assets list. + @objc + public var pinnedItemsAssetIndices: [NSNumber] { swift.pinnedItemsAssetIndices.map { $0 as NSNumber } } + + @objc + public init(folderOverviewLocationAsset: NSNumber, pinnedItemsAssetIndices: [NSNumber]) { + self.swift = TeamLog.FolderOverviewItemPinnedDetails( + folderOverviewLocationAsset: folderOverviewLocationAsset.uint64Value, + pinnedItemsAssetIndices: pinnedItemsAssetIndices.map(\.uint64Value) + ) + } + + let swift: TeamLog.FolderOverviewItemPinnedDetails + + public init(swift: TeamLog.FolderOverviewItemPinnedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FolderOverviewItemPinnedType struct +@objc +public class DBXTeamLogFolderOverviewItemPinnedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FolderOverviewItemPinnedType(description_: description_) + } + + let swift: TeamLog.FolderOverviewItemPinnedType + + public init(swift: TeamLog.FolderOverviewItemPinnedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unpinned item from folder overview. +@objc +public class DBXTeamLogFolderOverviewItemUnpinnedDetails: NSObject { + /// Folder Overview location position in the Assets list. + @objc + public var folderOverviewLocationAsset: NSNumber { swift.folderOverviewLocationAsset as NSNumber } + /// Pinned items positions in the Assets list. + @objc + public var pinnedItemsAssetIndices: [NSNumber] { swift.pinnedItemsAssetIndices.map { $0 as NSNumber } } + + @objc + public init(folderOverviewLocationAsset: NSNumber, pinnedItemsAssetIndices: [NSNumber]) { + self.swift = TeamLog.FolderOverviewItemUnpinnedDetails( + folderOverviewLocationAsset: folderOverviewLocationAsset.uint64Value, + pinnedItemsAssetIndices: pinnedItemsAssetIndices.map(\.uint64Value) + ) + } + + let swift: TeamLog.FolderOverviewItemUnpinnedDetails + + public init(swift: TeamLog.FolderOverviewItemUnpinnedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible FolderOverviewItemUnpinnedType struct +@objc +public class DBXTeamLogFolderOverviewItemUnpinnedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.FolderOverviewItemUnpinnedType(description_: description_) + } + + let swift: TeamLog.FolderOverviewItemUnpinnedType + + public init(swift: TeamLog.FolderOverviewItemUnpinnedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Geographic location details. +@objc +public class DBXTeamLogGeoLocationLogInfo: NSObject { + /// City name. + @objc + public var city: String? { swift.city } + /// Region name. + @objc + public var region: String? { swift.region } + /// Country code. + @objc + public var country: String? { swift.country } + /// IP address. + @objc + public var ipAddress: String { swift.ipAddress } + + @objc + public init(ipAddress: String, city: String?, region: String?, country: String?) { + self.swift = TeamLog.GeoLocationLogInfo(ipAddress: ipAddress, city: city, region: region, country: country) + } + + let swift: TeamLog.GeoLocationLogInfo + + public init(swift: TeamLog.GeoLocationLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTeamEventsArg struct +@objc +public class DBXTeamLogGetTeamEventsArg: NSObject { + /// The maximal number of results to return per call. Note that some calls may not return limit number of + /// events, and may even return no events, even with `has_more` set to true. In this case, callers should + /// fetch again using getEventsContinue. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + /// Filter the events by account ID. Return only events with this account_id as either Actor, Context, or + /// Participants. + @objc + public var accountId: String? { swift.accountId } + /// Filter by time range. + @objc + public var time: DBXTeamCommonTimeRange? { guard let swift = swift.time else { return nil } + return DBXTeamCommonTimeRange(swift: swift) + } + + /// Filter the returned events to a single category. Note that category shouldn't be provided together with + /// event_type. + @objc + public var category: DBXTeamLogEventCategory? { guard let swift = swift.category else { return nil } + return DBXTeamLogEventCategory(swift: swift) + } + + /// Filter the returned events to a single event type. Note that event_type shouldn't be provided together with + /// category. + @objc + public var eventType: DBXTeamLogEventTypeArg? { guard let swift = swift.eventType else { return nil } + return DBXTeamLogEventTypeArg(swift: swift) + } + + @objc + public init(limit: NSNumber, accountId: String?, time: DBXTeamCommonTimeRange?, category: DBXTeamLogEventCategory?, eventType: DBXTeamLogEventTypeArg?) { + self.swift = TeamLog.GetTeamEventsArg( + limit: limit.uint32Value, + accountId: accountId, + time: time?.swift, + category: category?.swift, + eventType: eventType?.swift + ) + } + + let swift: TeamLog.GetTeamEventsArg + + public init(swift: TeamLog.GetTeamEventsArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetTeamEventsContinueArg struct +@objc +public class DBXTeamLogGetTeamEventsContinueArg: NSObject { + /// Indicates from what point to get the next set of events. + @objc + public var cursor: String { swift.cursor } + + @objc + public init(cursor: String) { + self.swift = TeamLog.GetTeamEventsContinueArg(cursor: cursor) + } + + let swift: TeamLog.GetTeamEventsContinueArg + + public init(swift: TeamLog.GetTeamEventsContinueArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Errors that can be raised when calling getEventsContinue. +@objc +public class DBXTeamLogGetTeamEventsContinueError: NSObject { + let swift: TeamLog.GetTeamEventsContinueError + + public init(swift: TeamLog.GetTeamEventsContinueError) { + self.swift = swift + } + + public static func factory(swift: TeamLog.GetTeamEventsContinueError) -> DBXTeamLogGetTeamEventsContinueError { + switch swift { + case .badCursor: + return DBXTeamLogGetTeamEventsContinueErrorBadCursor() + case .reset(let swiftArg): + let arg = swiftArg + return DBXTeamLogGetTeamEventsContinueErrorReset(arg) + case .other: + return DBXTeamLogGetTeamEventsContinueErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asBadCursor: DBXTeamLogGetTeamEventsContinueErrorBadCursor? { + self as? DBXTeamLogGetTeamEventsContinueErrorBadCursor + } + + @objc + public var asReset: DBXTeamLogGetTeamEventsContinueErrorReset? { + self as? DBXTeamLogGetTeamEventsContinueErrorReset + } + + @objc + public var asOther: DBXTeamLogGetTeamEventsContinueErrorOther? { + self as? DBXTeamLogGetTeamEventsContinueErrorOther + } +} + +/// Bad cursor. +@objc +public class DBXTeamLogGetTeamEventsContinueErrorBadCursor: DBXTeamLogGetTeamEventsContinueError { + @objc + public init() { + let swift = TeamLog.GetTeamEventsContinueError.badCursor + super.init(swift: swift) + } +} + +/// Cursors are intended to be used quickly. Individual cursor values are normally valid for days, but in rare +/// cases may be reset sooner. Cursor reset errors should be handled by fetching a new cursor from +/// getEvents. The associated value is the approximate timestamp of the most recent event returned by +/// the cursor. This should be used as a resumption point when calling getEvents to obtain a new cursor. +@objc +public class DBXTeamLogGetTeamEventsContinueErrorReset: DBXTeamLogGetTeamEventsContinueError { + @objc + public var reset: Date + + @objc + public init(_ arg: Date) { + self.reset = arg + let swift = TeamLog.GetTeamEventsContinueError.reset(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGetTeamEventsContinueErrorOther: DBXTeamLogGetTeamEventsContinueError { + @objc + public init() { + let swift = TeamLog.GetTeamEventsContinueError.other + super.init(swift: swift) + } +} + +/// Errors that can be raised when calling getEvents. +@objc +public class DBXTeamLogGetTeamEventsError: NSObject { + let swift: TeamLog.GetTeamEventsError + + public init(swift: TeamLog.GetTeamEventsError) { + self.swift = swift + } + + public static func factory(swift: TeamLog.GetTeamEventsError) -> DBXTeamLogGetTeamEventsError { + switch swift { + case .accountIdNotFound: + return DBXTeamLogGetTeamEventsErrorAccountIdNotFound() + case .invalidTimeRange: + return DBXTeamLogGetTeamEventsErrorInvalidTimeRange() + case .invalidFilters: + return DBXTeamLogGetTeamEventsErrorInvalidFilters() + case .other: + return DBXTeamLogGetTeamEventsErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccountIdNotFound: DBXTeamLogGetTeamEventsErrorAccountIdNotFound? { + self as? DBXTeamLogGetTeamEventsErrorAccountIdNotFound + } + + @objc + public var asInvalidTimeRange: DBXTeamLogGetTeamEventsErrorInvalidTimeRange? { + self as? DBXTeamLogGetTeamEventsErrorInvalidTimeRange + } + + @objc + public var asInvalidFilters: DBXTeamLogGetTeamEventsErrorInvalidFilters? { + self as? DBXTeamLogGetTeamEventsErrorInvalidFilters + } + + @objc + public var asOther: DBXTeamLogGetTeamEventsErrorOther? { + self as? DBXTeamLogGetTeamEventsErrorOther + } +} + +/// No user found matching the provided account_id. +@objc +public class DBXTeamLogGetTeamEventsErrorAccountIdNotFound: DBXTeamLogGetTeamEventsError { + @objc + public init() { + let swift = TeamLog.GetTeamEventsError.accountIdNotFound + super.init(swift: swift) + } +} + +/// Invalid time range. +@objc +public class DBXTeamLogGetTeamEventsErrorInvalidTimeRange: DBXTeamLogGetTeamEventsError { + @objc + public init() { + let swift = TeamLog.GetTeamEventsError.invalidTimeRange + super.init(swift: swift) + } +} + +/// Invalid filters. Do not specify both event_type and category parameters for the same call. +@objc +public class DBXTeamLogGetTeamEventsErrorInvalidFilters: DBXTeamLogGetTeamEventsError { + @objc + public init() { + let swift = TeamLog.GetTeamEventsError.invalidFilters + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGetTeamEventsErrorOther: DBXTeamLogGetTeamEventsError { + @objc + public init() { + let swift = TeamLog.GetTeamEventsError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetTeamEventsResult struct +@objc +public class DBXTeamLogGetTeamEventsResult: NSObject { + /// List of events. Note that events are not guaranteed to be sorted by their timestamp value. + @objc + public var events: [DBXTeamLogTeamEvent] { swift.events.map { DBXTeamLogTeamEvent(swift: $0) } } + /// Pass the cursor into getEventsContinue to obtain additional events. The value of cursor may change for each + /// response from getEventsContinue, regardless of the value of hasMore; older cursor strings may expire. + /// Thus, callers should ensure that they update their cursor based on the latest value of cursor after each + /// call, and poll regularly if they wish to poll for new events. Callers should handle reset exceptions for + /// expired cursors. + @objc + public var cursor: String { swift.cursor } + /// Is true if there may be additional events that have not been returned yet. An additional call to + /// getEventsContinue can retrieve them. Note that hasMore may be true, even if events is empty. + @objc + public var hasMore: NSNumber { swift.hasMore as NSNumber } + + @objc + public init(events: [DBXTeamLogTeamEvent], cursor: String, hasMore: NSNumber) { + self.swift = TeamLog.GetTeamEventsResult(events: events.map(\.swift), cursor: cursor, hasMore: hasMore.boolValue) + } + + let swift: TeamLog.GetTeamEventsResult + + public init(swift: TeamLog.GetTeamEventsResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled Google single sign-on for team. +@objc +public class DBXTeamLogGoogleSsoChangePolicyDetails: NSObject { + /// New Google single sign-on policy. + @objc + public var newValue: DBXTeamLogGoogleSsoPolicy { DBXTeamLogGoogleSsoPolicy(swift: swift.newValue) } + /// Previous Google single sign-on policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogGoogleSsoPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogGoogleSsoPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogGoogleSsoPolicy, previousValue: DBXTeamLogGoogleSsoPolicy?) { + self.swift = TeamLog.GoogleSsoChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.GoogleSsoChangePolicyDetails + + public init(swift: TeamLog.GoogleSsoChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GoogleSsoChangePolicyType struct +@objc +public class DBXTeamLogGoogleSsoChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GoogleSsoChangePolicyType(description_: description_) + } + + let swift: TeamLog.GoogleSsoChangePolicyType + + public init(swift: TeamLog.GoogleSsoChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Google SSO policy +@objc +public class DBXTeamLogGoogleSsoPolicy: NSObject { + let swift: TeamLog.GoogleSsoPolicy + + public init(swift: TeamLog.GoogleSsoPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.GoogleSsoPolicy) -> DBXTeamLogGoogleSsoPolicy { + switch swift { + case .disabled: + return DBXTeamLogGoogleSsoPolicyDisabled() + case .enabled: + return DBXTeamLogGoogleSsoPolicyEnabled() + case .other: + return DBXTeamLogGoogleSsoPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogGoogleSsoPolicyDisabled? { + self as? DBXTeamLogGoogleSsoPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogGoogleSsoPolicyEnabled? { + self as? DBXTeamLogGoogleSsoPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogGoogleSsoPolicyOther? { + self as? DBXTeamLogGoogleSsoPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGoogleSsoPolicyDisabled: DBXTeamLogGoogleSsoPolicy { + @objc + public init() { + let swift = TeamLog.GoogleSsoPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGoogleSsoPolicyEnabled: DBXTeamLogGoogleSsoPolicy { + @objc + public init() { + let swift = TeamLog.GoogleSsoPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGoogleSsoPolicyOther: DBXTeamLogGoogleSsoPolicy { + @objc + public init() { + let swift = TeamLog.GoogleSsoPolicy.other + super.init(swift: swift) + } +} + +/// Couldn't add a folder to a policy. +@objc +public class DBXTeamLogGovernancePolicyAddFolderFailedDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Folder. + @objc + public var folder: String { swift.folder } + /// Reason. + @objc + public var reason: String? { swift.reason } + + @objc + public init(governancePolicyId: String, name: String, folder: String, policyType: DBXTeamLogPolicyType?, reason: String?) { + self.swift = TeamLog.GovernancePolicyAddFolderFailedDetails( + governancePolicyId: governancePolicyId, + name: name, + folder: folder, + policyType: policyType?.swift, + reason: reason + ) + } + + let swift: TeamLog.GovernancePolicyAddFolderFailedDetails + + public init(swift: TeamLog.GovernancePolicyAddFolderFailedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyAddFolderFailedType struct +@objc +public class DBXTeamLogGovernancePolicyAddFolderFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyAddFolderFailedType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyAddFolderFailedType + + public init(swift: TeamLog.GovernancePolicyAddFolderFailedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added folders to policy. +@objc +public class DBXTeamLogGovernancePolicyAddFoldersDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Folders. + @objc + public var folders: [String]? { swift.folders } + + @objc + public init(governancePolicyId: String, name: String, policyType: DBXTeamLogPolicyType?, folders: [String]?) { + self.swift = TeamLog.GovernancePolicyAddFoldersDetails( + governancePolicyId: governancePolicyId, + name: name, + policyType: policyType?.swift, + folders: folders + ) + } + + let swift: TeamLog.GovernancePolicyAddFoldersDetails + + public init(swift: TeamLog.GovernancePolicyAddFoldersDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyAddFoldersType struct +@objc +public class DBXTeamLogGovernancePolicyAddFoldersType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyAddFoldersType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyAddFoldersType + + public init(swift: TeamLog.GovernancePolicyAddFoldersType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Content disposed. +@objc +public class DBXTeamLogGovernancePolicyContentDisposedDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Disposition type. + @objc + public var dispositionType: DBXTeamLogDispositionActionType { DBXTeamLogDispositionActionType(swift: swift.dispositionType) } + + @objc + public init(governancePolicyId: String, name: String, dispositionType: DBXTeamLogDispositionActionType, policyType: DBXTeamLogPolicyType?) { + self.swift = TeamLog.GovernancePolicyContentDisposedDetails( + governancePolicyId: governancePolicyId, + name: name, + dispositionType: dispositionType.swift, + policyType: policyType?.swift + ) + } + + let swift: TeamLog.GovernancePolicyContentDisposedDetails + + public init(swift: TeamLog.GovernancePolicyContentDisposedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyContentDisposedType struct +@objc +public class DBXTeamLogGovernancePolicyContentDisposedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyContentDisposedType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyContentDisposedType + + public init(swift: TeamLog.GovernancePolicyContentDisposedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Activated a new policy. +@objc +public class DBXTeamLogGovernancePolicyCreateDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Duration in days. + @objc + public var duration: DBXTeamLogDurationLogInfo { DBXTeamLogDurationLogInfo(swift: swift.duration) } + /// Folders. + @objc + public var folders: [String]? { swift.folders } + + @objc + public init(governancePolicyId: String, name: String, duration: DBXTeamLogDurationLogInfo, policyType: DBXTeamLogPolicyType?, folders: [String]?) { + self.swift = TeamLog.GovernancePolicyCreateDetails( + governancePolicyId: governancePolicyId, + name: name, + duration: duration.swift, + policyType: policyType?.swift, + folders: folders + ) + } + + let swift: TeamLog.GovernancePolicyCreateDetails + + public init(swift: TeamLog.GovernancePolicyCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyCreateType struct +@objc +public class DBXTeamLogGovernancePolicyCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyCreateType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyCreateType + + public init(swift: TeamLog.GovernancePolicyCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted a policy. +@objc +public class DBXTeamLogGovernancePolicyDeleteDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + @objc + public init(governancePolicyId: String, name: String, policyType: DBXTeamLogPolicyType?) { + self.swift = TeamLog.GovernancePolicyDeleteDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType?.swift) + } + + let swift: TeamLog.GovernancePolicyDeleteDetails + + public init(swift: TeamLog.GovernancePolicyDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyDeleteType struct +@objc +public class DBXTeamLogGovernancePolicyDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyDeleteType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyDeleteType + + public init(swift: TeamLog.GovernancePolicyDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited policy. +@objc +public class DBXTeamLogGovernancePolicyEditDetailsDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Attribute. + @objc + public var attribute: String { swift.attribute } + /// From. + @objc + public var previousValue: String { swift.previousValue } + /// To. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(governancePolicyId: String, name: String, attribute: String, previousValue: String, newValue: String, policyType: DBXTeamLogPolicyType?) { + self.swift = TeamLog.GovernancePolicyEditDetailsDetails( + governancePolicyId: governancePolicyId, + name: name, + attribute: attribute, + previousValue: previousValue, + newValue: newValue, + policyType: policyType?.swift + ) + } + + let swift: TeamLog.GovernancePolicyEditDetailsDetails + + public init(swift: TeamLog.GovernancePolicyEditDetailsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyEditDetailsType struct +@objc +public class DBXTeamLogGovernancePolicyEditDetailsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyEditDetailsType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyEditDetailsType + + public init(swift: TeamLog.GovernancePolicyEditDetailsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed policy duration. +@objc +public class DBXTeamLogGovernancePolicyEditDurationDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// From. + @objc + public var previousValue: DBXTeamLogDurationLogInfo { DBXTeamLogDurationLogInfo(swift: swift.previousValue) } + /// To. + @objc + public var newValue: DBXTeamLogDurationLogInfo { DBXTeamLogDurationLogInfo(swift: swift.newValue) } + + @objc + public init( + governancePolicyId: String, + name: String, + previousValue: DBXTeamLogDurationLogInfo, + newValue: DBXTeamLogDurationLogInfo, + policyType: DBXTeamLogPolicyType? + ) { + self.swift = TeamLog.GovernancePolicyEditDurationDetails( + governancePolicyId: governancePolicyId, + name: name, + previousValue: previousValue.swift, + newValue: newValue.swift, + policyType: policyType?.swift + ) + } + + let swift: TeamLog.GovernancePolicyEditDurationDetails + + public init(swift: TeamLog.GovernancePolicyEditDurationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyEditDurationType struct +@objc +public class DBXTeamLogGovernancePolicyEditDurationType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyEditDurationType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyEditDurationType + + public init(swift: TeamLog.GovernancePolicyEditDurationType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created a policy download. +@objc +public class DBXTeamLogGovernancePolicyExportCreatedDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Export name. + @objc + public var exportName: String { swift.exportName } + + @objc + public init(governancePolicyId: String, name: String, exportName: String, policyType: DBXTeamLogPolicyType?) { + self.swift = TeamLog.GovernancePolicyExportCreatedDetails( + governancePolicyId: governancePolicyId, + name: name, + exportName: exportName, + policyType: policyType?.swift + ) + } + + let swift: TeamLog.GovernancePolicyExportCreatedDetails + + public init(swift: TeamLog.GovernancePolicyExportCreatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyExportCreatedType struct +@objc +public class DBXTeamLogGovernancePolicyExportCreatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyExportCreatedType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyExportCreatedType + + public init(swift: TeamLog.GovernancePolicyExportCreatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed a policy download. +@objc +public class DBXTeamLogGovernancePolicyExportRemovedDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Export name. + @objc + public var exportName: String { swift.exportName } + + @objc + public init(governancePolicyId: String, name: String, exportName: String, policyType: DBXTeamLogPolicyType?) { + self.swift = TeamLog.GovernancePolicyExportRemovedDetails( + governancePolicyId: governancePolicyId, + name: name, + exportName: exportName, + policyType: policyType?.swift + ) + } + + let swift: TeamLog.GovernancePolicyExportRemovedDetails + + public init(swift: TeamLog.GovernancePolicyExportRemovedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyExportRemovedType struct +@objc +public class DBXTeamLogGovernancePolicyExportRemovedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyExportRemovedType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyExportRemovedType + + public init(swift: TeamLog.GovernancePolicyExportRemovedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed folders from policy. +@objc +public class DBXTeamLogGovernancePolicyRemoveFoldersDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Folders. + @objc + public var folders: [String]? { swift.folders } + /// Reason. + @objc + public var reason: String? { swift.reason } + + @objc + public init(governancePolicyId: String, name: String, policyType: DBXTeamLogPolicyType?, folders: [String]?, reason: String?) { + self.swift = TeamLog.GovernancePolicyRemoveFoldersDetails( + governancePolicyId: governancePolicyId, + name: name, + policyType: policyType?.swift, + folders: folders, + reason: reason + ) + } + + let swift: TeamLog.GovernancePolicyRemoveFoldersDetails + + public init(swift: TeamLog.GovernancePolicyRemoveFoldersDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyRemoveFoldersType struct +@objc +public class DBXTeamLogGovernancePolicyRemoveFoldersType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyRemoveFoldersType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyRemoveFoldersType + + public init(swift: TeamLog.GovernancePolicyRemoveFoldersType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created a summary report for a policy. +@objc +public class DBXTeamLogGovernancePolicyReportCreatedDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + @objc + public init(governancePolicyId: String, name: String, policyType: DBXTeamLogPolicyType?) { + self.swift = TeamLog.GovernancePolicyReportCreatedDetails(governancePolicyId: governancePolicyId, name: name, policyType: policyType?.swift) + } + + let swift: TeamLog.GovernancePolicyReportCreatedDetails + + public init(swift: TeamLog.GovernancePolicyReportCreatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyReportCreatedType struct +@objc +public class DBXTeamLogGovernancePolicyReportCreatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyReportCreatedType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyReportCreatedType + + public init(swift: TeamLog.GovernancePolicyReportCreatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downloaded content from a policy. +@objc +public class DBXTeamLogGovernancePolicyZipPartDownloadedDetails: NSObject { + /// Policy ID. + @objc + public var governancePolicyId: String { swift.governancePolicyId } + /// Policy name. + @objc + public var name: String { swift.name } + /// Policy type. + @objc + public var policyType: DBXTeamLogPolicyType? { guard let swift = swift.policyType else { return nil } + return DBXTeamLogPolicyType(swift: swift) + } + + /// Export name. + @objc + public var exportName: String { swift.exportName } + /// Part. + @objc + public var part: String? { swift.part } + + @objc + public init(governancePolicyId: String, name: String, exportName: String, policyType: DBXTeamLogPolicyType?, part: String?) { + self.swift = TeamLog.GovernancePolicyZipPartDownloadedDetails( + governancePolicyId: governancePolicyId, + name: name, + exportName: exportName, + policyType: policyType?.swift, + part: part + ) + } + + let swift: TeamLog.GovernancePolicyZipPartDownloadedDetails + + public init(swift: TeamLog.GovernancePolicyZipPartDownloadedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GovernancePolicyZipPartDownloadedType struct +@objc +public class DBXTeamLogGovernancePolicyZipPartDownloadedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GovernancePolicyZipPartDownloadedType(description_: description_) + } + + let swift: TeamLog.GovernancePolicyZipPartDownloadedType + + public init(swift: TeamLog.GovernancePolicyZipPartDownloadedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added external ID for group. +@objc +public class DBXTeamLogGroupAddExternalIdDetails: NSObject { + /// Current external id. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(newValue: String) { + self.swift = TeamLog.GroupAddExternalIdDetails(newValue: newValue) + } + + let swift: TeamLog.GroupAddExternalIdDetails + + public init(swift: TeamLog.GroupAddExternalIdDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupAddExternalIdType struct +@objc +public class DBXTeamLogGroupAddExternalIdType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupAddExternalIdType(description_: description_) + } + + let swift: TeamLog.GroupAddExternalIdType + + public init(swift: TeamLog.GroupAddExternalIdType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added team members to group. +@objc +public class DBXTeamLogGroupAddMemberDetails: NSObject { + /// Is group owner. + @objc + public var isGroupOwner: NSNumber { swift.isGroupOwner as NSNumber } + + @objc + public init(isGroupOwner: NSNumber) { + self.swift = TeamLog.GroupAddMemberDetails(isGroupOwner: isGroupOwner.boolValue) + } + + let swift: TeamLog.GroupAddMemberDetails + + public init(swift: TeamLog.GroupAddMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupAddMemberType struct +@objc +public class DBXTeamLogGroupAddMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupAddMemberType(description_: description_) + } + + let swift: TeamLog.GroupAddMemberType + + public init(swift: TeamLog.GroupAddMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed external ID for group. +@objc +public class DBXTeamLogGroupChangeExternalIdDetails: NSObject { + /// Current external id. + @objc + public var newValue: String { swift.newValue } + /// Old external id. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(newValue: String, previousValue: String) { + self.swift = TeamLog.GroupChangeExternalIdDetails(newValue: newValue, previousValue: previousValue) + } + + let swift: TeamLog.GroupChangeExternalIdDetails + + public init(swift: TeamLog.GroupChangeExternalIdDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupChangeExternalIdType struct +@objc +public class DBXTeamLogGroupChangeExternalIdType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupChangeExternalIdType(description_: description_) + } + + let swift: TeamLog.GroupChangeExternalIdType + + public init(swift: TeamLog.GroupChangeExternalIdType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed group management type. +@objc +public class DBXTeamLogGroupChangeManagementTypeDetails: NSObject { + /// New group management type. + @objc + public var newValue: DBXTeamCommonGroupManagementType { DBXTeamCommonGroupManagementType(swift: swift.newValue) } + /// Previous group management type. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamCommonGroupManagementType? { guard let swift = swift.previousValue else { return nil } + return DBXTeamCommonGroupManagementType(swift: swift) + } + + @objc + public init(newValue: DBXTeamCommonGroupManagementType, previousValue: DBXTeamCommonGroupManagementType?) { + self.swift = TeamLog.GroupChangeManagementTypeDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.GroupChangeManagementTypeDetails + + public init(swift: TeamLog.GroupChangeManagementTypeDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupChangeManagementTypeType struct +@objc +public class DBXTeamLogGroupChangeManagementTypeType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupChangeManagementTypeType(description_: description_) + } + + let swift: TeamLog.GroupChangeManagementTypeType + + public init(swift: TeamLog.GroupChangeManagementTypeType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed manager permissions of group member. +@objc +public class DBXTeamLogGroupChangeMemberRoleDetails: NSObject { + /// Is group owner. + @objc + public var isGroupOwner: NSNumber { swift.isGroupOwner as NSNumber } + + @objc + public init(isGroupOwner: NSNumber) { + self.swift = TeamLog.GroupChangeMemberRoleDetails(isGroupOwner: isGroupOwner.boolValue) + } + + let swift: TeamLog.GroupChangeMemberRoleDetails + + public init(swift: TeamLog.GroupChangeMemberRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupChangeMemberRoleType struct +@objc +public class DBXTeamLogGroupChangeMemberRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupChangeMemberRoleType(description_: description_) + } + + let swift: TeamLog.GroupChangeMemberRoleType + + public init(swift: TeamLog.GroupChangeMemberRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created group. +@objc +public class DBXTeamLogGroupCreateDetails: NSObject { + /// Is company managed group. + @objc + public var isCompanyManaged: NSNumber? { swift.isCompanyManaged as NSNumber? } + /// Group join policy. + @objc + public var joinPolicy: DBXTeamLogGroupJoinPolicy? { guard let swift = swift.joinPolicy else { return nil } + return DBXTeamLogGroupJoinPolicy(swift: swift) + } + + @objc + public init(isCompanyManaged: NSNumber?, joinPolicy: DBXTeamLogGroupJoinPolicy?) { + self.swift = TeamLog.GroupCreateDetails(isCompanyManaged: isCompanyManaged?.boolValue, joinPolicy: joinPolicy?.swift) + } + + let swift: TeamLog.GroupCreateDetails + + public init(swift: TeamLog.GroupCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupCreateType struct +@objc +public class DBXTeamLogGroupCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupCreateType(description_: description_) + } + + let swift: TeamLog.GroupCreateType + + public init(swift: TeamLog.GroupCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted group. +@objc +public class DBXTeamLogGroupDeleteDetails: NSObject { + /// Is company managed group. + @objc + public var isCompanyManaged: NSNumber? { swift.isCompanyManaged as NSNumber? } + + @objc + public init(isCompanyManaged: NSNumber?) { + self.swift = TeamLog.GroupDeleteDetails(isCompanyManaged: isCompanyManaged?.boolValue) + } + + let swift: TeamLog.GroupDeleteDetails + + public init(swift: TeamLog.GroupDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupDeleteType struct +@objc +public class DBXTeamLogGroupDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupDeleteType(description_: description_) + } + + let swift: TeamLog.GroupDeleteType + + public init(swift: TeamLog.GroupDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Updated group. +@objc +public class DBXTeamLogGroupDescriptionUpdatedDetails: NSObject { + let swift: TeamLog.GroupDescriptionUpdatedDetails + + public init(swift: TeamLog.GroupDescriptionUpdatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupDescriptionUpdatedType struct +@objc +public class DBXTeamLogGroupDescriptionUpdatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupDescriptionUpdatedType(description_: description_) + } + + let swift: TeamLog.GroupDescriptionUpdatedType + + public init(swift: TeamLog.GroupDescriptionUpdatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupJoinPolicy union +@objc +public class DBXTeamLogGroupJoinPolicy: NSObject { + let swift: TeamLog.GroupJoinPolicy + + public init(swift: TeamLog.GroupJoinPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.GroupJoinPolicy) -> DBXTeamLogGroupJoinPolicy { + switch swift { + case .open: + return DBXTeamLogGroupJoinPolicyOpen() + case .requestToJoin: + return DBXTeamLogGroupJoinPolicyRequestToJoin() + case .other: + return DBXTeamLogGroupJoinPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asOpen: DBXTeamLogGroupJoinPolicyOpen? { + self as? DBXTeamLogGroupJoinPolicyOpen + } + + @objc + public var asRequestToJoin: DBXTeamLogGroupJoinPolicyRequestToJoin? { + self as? DBXTeamLogGroupJoinPolicyRequestToJoin + } + + @objc + public var asOther: DBXTeamLogGroupJoinPolicyOther? { + self as? DBXTeamLogGroupJoinPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGroupJoinPolicyOpen: DBXTeamLogGroupJoinPolicy { + @objc + public init() { + let swift = TeamLog.GroupJoinPolicy.open + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGroupJoinPolicyRequestToJoin: DBXTeamLogGroupJoinPolicy { + @objc + public init() { + let swift = TeamLog.GroupJoinPolicy.requestToJoin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogGroupJoinPolicyOther: DBXTeamLogGroupJoinPolicy { + @objc + public init() { + let swift = TeamLog.GroupJoinPolicy.other + super.init(swift: swift) + } +} + +/// Updated group join policy. +@objc +public class DBXTeamLogGroupJoinPolicyUpdatedDetails: NSObject { + /// Is company managed group. + @objc + public var isCompanyManaged: NSNumber? { swift.isCompanyManaged as NSNumber? } + /// Group join policy. + @objc + public var joinPolicy: DBXTeamLogGroupJoinPolicy? { guard let swift = swift.joinPolicy else { return nil } + return DBXTeamLogGroupJoinPolicy(swift: swift) + } + + @objc + public init(isCompanyManaged: NSNumber?, joinPolicy: DBXTeamLogGroupJoinPolicy?) { + self.swift = TeamLog.GroupJoinPolicyUpdatedDetails(isCompanyManaged: isCompanyManaged?.boolValue, joinPolicy: joinPolicy?.swift) + } + + let swift: TeamLog.GroupJoinPolicyUpdatedDetails + + public init(swift: TeamLog.GroupJoinPolicyUpdatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupJoinPolicyUpdatedType struct +@objc +public class DBXTeamLogGroupJoinPolicyUpdatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupJoinPolicyUpdatedType(description_: description_) + } + + let swift: TeamLog.GroupJoinPolicyUpdatedType + + public init(swift: TeamLog.GroupJoinPolicyUpdatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Group's logged information. +@objc +public class DBXTeamLogGroupLogInfo: NSObject { + /// The unique id of this group. + @objc + public var groupId: String? { swift.groupId } + /// The name of this group. + @objc + public var displayName: String { swift.displayName } + /// External group ID. + @objc + public var externalId: String? { swift.externalId } + + @objc + public init(displayName: String, groupId: String?, externalId: String?) { + self.swift = TeamLog.GroupLogInfo(displayName: displayName, groupId: groupId, externalId: externalId) + } + + let swift: TeamLog.GroupLogInfo + + public init(swift: TeamLog.GroupLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Moved group. +@objc +public class DBXTeamLogGroupMovedDetails: NSObject { + let swift: TeamLog.GroupMovedDetails + + public init(swift: TeamLog.GroupMovedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupMovedType struct +@objc +public class DBXTeamLogGroupMovedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupMovedType(description_: description_) + } + + let swift: TeamLog.GroupMovedType + + public init(swift: TeamLog.GroupMovedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed external ID for group. +@objc +public class DBXTeamLogGroupRemoveExternalIdDetails: NSObject { + /// Old external id. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(previousValue: String) { + self.swift = TeamLog.GroupRemoveExternalIdDetails(previousValue: previousValue) + } + + let swift: TeamLog.GroupRemoveExternalIdDetails + + public init(swift: TeamLog.GroupRemoveExternalIdDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupRemoveExternalIdType struct +@objc +public class DBXTeamLogGroupRemoveExternalIdType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupRemoveExternalIdType(description_: description_) + } + + let swift: TeamLog.GroupRemoveExternalIdType + + public init(swift: TeamLog.GroupRemoveExternalIdType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed team members from group. +@objc +public class DBXTeamLogGroupRemoveMemberDetails: NSObject { + let swift: TeamLog.GroupRemoveMemberDetails + + public init(swift: TeamLog.GroupRemoveMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupRemoveMemberType struct +@objc +public class DBXTeamLogGroupRemoveMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupRemoveMemberType(description_: description_) + } + + let swift: TeamLog.GroupRemoveMemberType + + public init(swift: TeamLog.GroupRemoveMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed group. +@objc +public class DBXTeamLogGroupRenameDetails: NSObject { + /// Previous display name. + @objc + public var previousValue: String { swift.previousValue } + /// New display name. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(previousValue: String, newValue: String) { + self.swift = TeamLog.GroupRenameDetails(previousValue: previousValue, newValue: newValue) + } + + let swift: TeamLog.GroupRenameDetails + + public init(swift: TeamLog.GroupRenameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupRenameType struct +@objc +public class DBXTeamLogGroupRenameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupRenameType(description_: description_) + } + + let swift: TeamLog.GroupRenameType + + public init(swift: TeamLog.GroupRenameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed who can create groups. +@objc +public class DBXTeamLogGroupUserManagementChangePolicyDetails: NSObject { + /// New group users management policy. + @objc + public var newValue: DBXTeamPoliciesGroupCreation { DBXTeamPoliciesGroupCreation(swift: swift.newValue) } + /// Previous group users management policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamPoliciesGroupCreation? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesGroupCreation(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesGroupCreation, previousValue: DBXTeamPoliciesGroupCreation?) { + self.swift = TeamLog.GroupUserManagementChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.GroupUserManagementChangePolicyDetails + + public init(swift: TeamLog.GroupUserManagementChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GroupUserManagementChangePolicyType struct +@objc +public class DBXTeamLogGroupUserManagementChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GroupUserManagementChangePolicyType(description_: description_) + } + + let swift: TeamLog.GroupUserManagementChangePolicyType + + public init(swift: TeamLog.GroupUserManagementChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed guest team admin status. +@objc +public class DBXTeamLogGuestAdminChangeStatusDetails: NSObject { + /// True for guest, false for host. + @objc + public var isGuest: NSNumber { swift.isGuest as NSNumber } + /// The name of the guest team. + @objc + public var guestTeamName: String? { swift.guestTeamName } + /// The name of the host team. + @objc + public var hostTeamName: String? { swift.hostTeamName } + /// Previous request state. + @objc + public var previousValue: DBXTeamLogTrustedTeamsRequestState { DBXTeamLogTrustedTeamsRequestState(swift: swift.previousValue) } + /// New request state. + @objc + public var newValue: DBXTeamLogTrustedTeamsRequestState { DBXTeamLogTrustedTeamsRequestState(swift: swift.newValue) } + /// Action details. + @objc + public var actionDetails: DBXTeamLogTrustedTeamsRequestAction { DBXTeamLogTrustedTeamsRequestAction(swift: swift.actionDetails) } + + @objc + public init( + isGuest: NSNumber, + previousValue: DBXTeamLogTrustedTeamsRequestState, + newValue: DBXTeamLogTrustedTeamsRequestState, + actionDetails: DBXTeamLogTrustedTeamsRequestAction, + guestTeamName: String?, + hostTeamName: String? + ) { + self.swift = TeamLog.GuestAdminChangeStatusDetails( + isGuest: isGuest.boolValue, + previousValue: previousValue.swift, + newValue: newValue.swift, + actionDetails: actionDetails.swift, + guestTeamName: guestTeamName, + hostTeamName: hostTeamName + ) + } + + let swift: TeamLog.GuestAdminChangeStatusDetails + + public init(swift: TeamLog.GuestAdminChangeStatusDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GuestAdminChangeStatusType struct +@objc +public class DBXTeamLogGuestAdminChangeStatusType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GuestAdminChangeStatusType(description_: description_) + } + + let swift: TeamLog.GuestAdminChangeStatusType + + public init(swift: TeamLog.GuestAdminChangeStatusType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Started trusted team admin session. +@objc +public class DBXTeamLogGuestAdminSignedInViaTrustedTeamsDetails: NSObject { + /// Host team name. + @objc + public var teamName: String? { swift.teamName } + /// Trusted team name. + @objc + public var trustedTeamName: String? { swift.trustedTeamName } + + @objc + public init(teamName: String?, trustedTeamName: String?) { + self.swift = TeamLog.GuestAdminSignedInViaTrustedTeamsDetails(teamName: teamName, trustedTeamName: trustedTeamName) + } + + let swift: TeamLog.GuestAdminSignedInViaTrustedTeamsDetails + + public init(swift: TeamLog.GuestAdminSignedInViaTrustedTeamsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GuestAdminSignedInViaTrustedTeamsType struct +@objc +public class DBXTeamLogGuestAdminSignedInViaTrustedTeamsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GuestAdminSignedInViaTrustedTeamsType(description_: description_) + } + + let swift: TeamLog.GuestAdminSignedInViaTrustedTeamsType + + public init(swift: TeamLog.GuestAdminSignedInViaTrustedTeamsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Ended trusted team admin session. +@objc +public class DBXTeamLogGuestAdminSignedOutViaTrustedTeamsDetails: NSObject { + /// Host team name. + @objc + public var teamName: String? { swift.teamName } + /// Trusted team name. + @objc + public var trustedTeamName: String? { swift.trustedTeamName } + + @objc + public init(teamName: String?, trustedTeamName: String?) { + self.swift = TeamLog.GuestAdminSignedOutViaTrustedTeamsDetails(teamName: teamName, trustedTeamName: trustedTeamName) + } + + let swift: TeamLog.GuestAdminSignedOutViaTrustedTeamsDetails + + public init(swift: TeamLog.GuestAdminSignedOutViaTrustedTeamsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GuestAdminSignedOutViaTrustedTeamsType struct +@objc +public class DBXTeamLogGuestAdminSignedOutViaTrustedTeamsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.GuestAdminSignedOutViaTrustedTeamsType(description_: description_) + } + + let swift: TeamLog.GuestAdminSignedOutViaTrustedTeamsType + + public init(swift: TeamLog.GuestAdminSignedOutViaTrustedTeamsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible IdentifierType union +@objc +public class DBXTeamLogIdentifierType: NSObject { + let swift: TeamLog.IdentifierType + + public init(swift: TeamLog.IdentifierType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.IdentifierType) -> DBXTeamLogIdentifierType { + switch swift { + case .email: + return DBXTeamLogIdentifierTypeEmail() + case .facebookProfileName: + return DBXTeamLogIdentifierTypeFacebookProfileName() + case .other: + return DBXTeamLogIdentifierTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEmail: DBXTeamLogIdentifierTypeEmail? { + self as? DBXTeamLogIdentifierTypeEmail + } + + @objc + public var asFacebookProfileName: DBXTeamLogIdentifierTypeFacebookProfileName? { + self as? DBXTeamLogIdentifierTypeFacebookProfileName + } + + @objc + public var asOther: DBXTeamLogIdentifierTypeOther? { + self as? DBXTeamLogIdentifierTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogIdentifierTypeEmail: DBXTeamLogIdentifierType { + @objc + public init() { + let swift = TeamLog.IdentifierType.email + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogIdentifierTypeFacebookProfileName: DBXTeamLogIdentifierType { + @objc + public init() { + let swift = TeamLog.IdentifierType.facebookProfileName + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogIdentifierTypeOther: DBXTeamLogIdentifierType { + @objc + public init() { + let swift = TeamLog.IdentifierType.other + super.init(swift: swift) + } +} + +/// Connected integration for member. +@objc +public class DBXTeamLogIntegrationConnectedDetails: NSObject { + /// Name of the third-party integration. + @objc + public var integrationName: String { swift.integrationName } + + @objc + public init(integrationName: String) { + self.swift = TeamLog.IntegrationConnectedDetails(integrationName: integrationName) + } + + let swift: TeamLog.IntegrationConnectedDetails + + public init(swift: TeamLog.IntegrationConnectedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible IntegrationConnectedType struct +@objc +public class DBXTeamLogIntegrationConnectedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.IntegrationConnectedType(description_: description_) + } + + let swift: TeamLog.IntegrationConnectedType + + public init(swift: TeamLog.IntegrationConnectedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Disconnected integration for member. +@objc +public class DBXTeamLogIntegrationDisconnectedDetails: NSObject { + /// Name of the third-party integration. + @objc + public var integrationName: String { swift.integrationName } + + @objc + public init(integrationName: String) { + self.swift = TeamLog.IntegrationDisconnectedDetails(integrationName: integrationName) + } + + let swift: TeamLog.IntegrationDisconnectedDetails + + public init(swift: TeamLog.IntegrationDisconnectedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible IntegrationDisconnectedType struct +@objc +public class DBXTeamLogIntegrationDisconnectedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.IntegrationDisconnectedType(description_: description_) + } + + let swift: TeamLog.IntegrationDisconnectedType + + public init(swift: TeamLog.IntegrationDisconnectedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling whether a service integration is enabled for the team. +@objc +public class DBXTeamLogIntegrationPolicy: NSObject { + let swift: TeamLog.IntegrationPolicy + + public init(swift: TeamLog.IntegrationPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.IntegrationPolicy) -> DBXTeamLogIntegrationPolicy { + switch swift { + case .disabled: + return DBXTeamLogIntegrationPolicyDisabled() + case .enabled: + return DBXTeamLogIntegrationPolicyEnabled() + case .other: + return DBXTeamLogIntegrationPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogIntegrationPolicyDisabled? { + self as? DBXTeamLogIntegrationPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogIntegrationPolicyEnabled? { + self as? DBXTeamLogIntegrationPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogIntegrationPolicyOther? { + self as? DBXTeamLogIntegrationPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogIntegrationPolicyDisabled: DBXTeamLogIntegrationPolicy { + @objc + public init() { + let swift = TeamLog.IntegrationPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogIntegrationPolicyEnabled: DBXTeamLogIntegrationPolicy { + @objc + public init() { + let swift = TeamLog.IntegrationPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogIntegrationPolicyOther: DBXTeamLogIntegrationPolicy { + @objc + public init() { + let swift = TeamLog.IntegrationPolicy.other + super.init(swift: swift) + } +} + +/// Changed integration policy for team. +@objc +public class DBXTeamLogIntegrationPolicyChangedDetails: NSObject { + /// Name of the third-party integration. + @objc + public var integrationName: String { swift.integrationName } + /// New integration policy. + @objc + public var newValue: DBXTeamLogIntegrationPolicy { DBXTeamLogIntegrationPolicy(swift: swift.newValue) } + /// Previous integration policy. + @objc + public var previousValue: DBXTeamLogIntegrationPolicy { DBXTeamLogIntegrationPolicy(swift: swift.previousValue) } + + @objc + public init(integrationName: String, newValue: DBXTeamLogIntegrationPolicy, previousValue: DBXTeamLogIntegrationPolicy) { + self.swift = TeamLog.IntegrationPolicyChangedDetails(integrationName: integrationName, newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.IntegrationPolicyChangedDetails + + public init(swift: TeamLog.IntegrationPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible IntegrationPolicyChangedType struct +@objc +public class DBXTeamLogIntegrationPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.IntegrationPolicyChangedType(description_: description_) + } + + let swift: TeamLog.IntegrationPolicyChangedType + + public init(swift: TeamLog.IntegrationPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding whether team admins receive email when an invitation to join the team is accepted +@objc +public class DBXTeamLogInviteAcceptanceEmailPolicy: NSObject { + let swift: TeamLog.InviteAcceptanceEmailPolicy + + public init(swift: TeamLog.InviteAcceptanceEmailPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.InviteAcceptanceEmailPolicy) -> DBXTeamLogInviteAcceptanceEmailPolicy { + switch swift { + case .disabled: + return DBXTeamLogInviteAcceptanceEmailPolicyDisabled() + case .enabled: + return DBXTeamLogInviteAcceptanceEmailPolicyEnabled() + case .other: + return DBXTeamLogInviteAcceptanceEmailPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogInviteAcceptanceEmailPolicyDisabled? { + self as? DBXTeamLogInviteAcceptanceEmailPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogInviteAcceptanceEmailPolicyEnabled? { + self as? DBXTeamLogInviteAcceptanceEmailPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogInviteAcceptanceEmailPolicyOther? { + self as? DBXTeamLogInviteAcceptanceEmailPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteAcceptanceEmailPolicyDisabled: DBXTeamLogInviteAcceptanceEmailPolicy { + @objc + public init() { + let swift = TeamLog.InviteAcceptanceEmailPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteAcceptanceEmailPolicyEnabled: DBXTeamLogInviteAcceptanceEmailPolicy { + @objc + public init() { + let swift = TeamLog.InviteAcceptanceEmailPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteAcceptanceEmailPolicyOther: DBXTeamLogInviteAcceptanceEmailPolicy { + @objc + public init() { + let swift = TeamLog.InviteAcceptanceEmailPolicy.other + super.init(swift: swift) + } +} + +/// Changed invite accept email policy for team. +@objc +public class DBXTeamLogInviteAcceptanceEmailPolicyChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogInviteAcceptanceEmailPolicy { DBXTeamLogInviteAcceptanceEmailPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogInviteAcceptanceEmailPolicy { DBXTeamLogInviteAcceptanceEmailPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogInviteAcceptanceEmailPolicy, previousValue: DBXTeamLogInviteAcceptanceEmailPolicy) { + self.swift = TeamLog.InviteAcceptanceEmailPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.InviteAcceptanceEmailPolicyChangedDetails + + public init(swift: TeamLog.InviteAcceptanceEmailPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible InviteAcceptanceEmailPolicyChangedType struct +@objc +public class DBXTeamLogInviteAcceptanceEmailPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.InviteAcceptanceEmailPolicyChangedType(description_: description_) + } + + let swift: TeamLog.InviteAcceptanceEmailPolicyChangedType + + public init(swift: TeamLog.InviteAcceptanceEmailPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible InviteMethod union +@objc +public class DBXTeamLogInviteMethod: NSObject { + let swift: TeamLog.InviteMethod + + public init(swift: TeamLog.InviteMethod) { + self.swift = swift + } + + public static func factory(swift: TeamLog.InviteMethod) -> DBXTeamLogInviteMethod { + switch swift { + case .autoApprove: + return DBXTeamLogInviteMethodAutoApprove() + case .inviteLink: + return DBXTeamLogInviteMethodInviteLink() + case .memberInvite: + return DBXTeamLogInviteMethodMemberInvite() + case .movedFromAnotherTeam: + return DBXTeamLogInviteMethodMovedFromAnotherTeam() + case .other: + return DBXTeamLogInviteMethodOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAutoApprove: DBXTeamLogInviteMethodAutoApprove? { + self as? DBXTeamLogInviteMethodAutoApprove + } + + @objc + public var asInviteLink: DBXTeamLogInviteMethodInviteLink? { + self as? DBXTeamLogInviteMethodInviteLink + } + + @objc + public var asMemberInvite: DBXTeamLogInviteMethodMemberInvite? { + self as? DBXTeamLogInviteMethodMemberInvite + } + + @objc + public var asMovedFromAnotherTeam: DBXTeamLogInviteMethodMovedFromAnotherTeam? { + self as? DBXTeamLogInviteMethodMovedFromAnotherTeam + } + + @objc + public var asOther: DBXTeamLogInviteMethodOther? { + self as? DBXTeamLogInviteMethodOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteMethodAutoApprove: DBXTeamLogInviteMethod { + @objc + public init() { + let swift = TeamLog.InviteMethod.autoApprove + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteMethodInviteLink: DBXTeamLogInviteMethod { + @objc + public init() { + let swift = TeamLog.InviteMethod.inviteLink + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteMethodMemberInvite: DBXTeamLogInviteMethod { + @objc + public init() { + let swift = TeamLog.InviteMethod.memberInvite + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteMethodMovedFromAnotherTeam: DBXTeamLogInviteMethod { + @objc + public init() { + let swift = TeamLog.InviteMethod.movedFromAnotherTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogInviteMethodOther: DBXTeamLogInviteMethod { + @objc + public init() { + let swift = TeamLog.InviteMethod.other + super.init(swift: swift) + } +} + +/// Additional information relevant when a new member joins the team. +@objc +public class DBXTeamLogJoinTeamDetails: NSObject { + /// Linked applications. (Deprecated) Please use has_linked_apps boolean field instead. + @objc + public var linkedApps: [DBXTeamLogUserLinkedAppLogInfo] { swift.linkedApps.map { DBXTeamLogUserLinkedAppLogInfo(swift: $0) } } + /// Linked devices. (Deprecated) Please use has_linked_devices boolean field instead. + @objc + public var linkedDevices: [DBXTeamLogLinkedDeviceLogInfo] { swift.linkedDevices.map { DBXTeamLogLinkedDeviceLogInfo(swift: $0) } } + /// Linked shared folders. (Deprecated) Please use has_linked_shared_folders boolean field instead. + @objc + public var linkedSharedFolders: [DBXTeamLogFolderLogInfo] { swift.linkedSharedFolders.map { DBXTeamLogFolderLogInfo(swift: $0) } } + /// (Deprecated) True if the linked_apps list was truncated to the maximum supported length (50). + @objc + public var wasLinkedAppsTruncated: NSNumber? { swift.wasLinkedAppsTruncated as NSNumber? } + /// (Deprecated) True if the linked_devices list was truncated to the maximum supported length (50). + @objc + public var wasLinkedDevicesTruncated: NSNumber? { swift.wasLinkedDevicesTruncated as NSNumber? } + /// (Deprecated) True if the linked_shared_folders list was truncated to the maximum supported length (50). + @objc + public var wasLinkedSharedFoldersTruncated: NSNumber? { swift.wasLinkedSharedFoldersTruncated as NSNumber? } + /// True if the user had linked apps at event time. + @objc + public var hasLinkedApps: NSNumber? { swift.hasLinkedApps as NSNumber? } + /// True if the user had linked apps at event time. + @objc + public var hasLinkedDevices: NSNumber? { swift.hasLinkedDevices as NSNumber? } + /// True if the user had linked shared folders at event time. + @objc + public var hasLinkedSharedFolders: NSNumber? { swift.hasLinkedSharedFolders as NSNumber? } + + @objc + public init( + linkedApps: [DBXTeamLogUserLinkedAppLogInfo], + linkedDevices: [DBXTeamLogLinkedDeviceLogInfo], + linkedSharedFolders: [DBXTeamLogFolderLogInfo], + wasLinkedAppsTruncated: NSNumber?, + wasLinkedDevicesTruncated: NSNumber?, + wasLinkedSharedFoldersTruncated: NSNumber?, + hasLinkedApps: NSNumber?, + hasLinkedDevices: NSNumber?, + hasLinkedSharedFolders: NSNumber? + ) { + self.swift = TeamLog.JoinTeamDetails( + linkedApps: linkedApps.map(\.subSwift), + linkedDevices: linkedDevices.map(\.swift), + linkedSharedFolders: linkedSharedFolders.map(\.subSwift), + wasLinkedAppsTruncated: wasLinkedAppsTruncated?.boolValue, + wasLinkedDevicesTruncated: wasLinkedDevicesTruncated?.boolValue, + wasLinkedSharedFoldersTruncated: wasLinkedSharedFoldersTruncated?.boolValue, + hasLinkedApps: hasLinkedApps?.boolValue, + hasLinkedDevices: hasLinkedDevices?.boolValue, + hasLinkedSharedFolders: hasLinkedSharedFolders?.boolValue + ) + } + + let swift: TeamLog.JoinTeamDetails + + public init(swift: TeamLog.JoinTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Label type +@objc +public class DBXTeamLogLabelType: NSObject { + let swift: TeamLog.LabelType + + public init(swift: TeamLog.LabelType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.LabelType) -> DBXTeamLogLabelType { + switch swift { + case .personalInformation: + return DBXTeamLogLabelTypePersonalInformation() + case .testOnly: + return DBXTeamLogLabelTypeTestOnly() + case .userDefinedTag: + return DBXTeamLogLabelTypeUserDefinedTag() + case .other: + return DBXTeamLogLabelTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPersonalInformation: DBXTeamLogLabelTypePersonalInformation? { + self as? DBXTeamLogLabelTypePersonalInformation + } + + @objc + public var asTestOnly: DBXTeamLogLabelTypeTestOnly? { + self as? DBXTeamLogLabelTypeTestOnly + } + + @objc + public var asUserDefinedTag: DBXTeamLogLabelTypeUserDefinedTag? { + self as? DBXTeamLogLabelTypeUserDefinedTag + } + + @objc + public var asOther: DBXTeamLogLabelTypeOther? { + self as? DBXTeamLogLabelTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLabelTypePersonalInformation: DBXTeamLogLabelType { + @objc + public init() { + let swift = TeamLog.LabelType.personalInformation + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLabelTypeTestOnly: DBXTeamLogLabelType { + @objc + public init() { + let swift = TeamLog.LabelType.testOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLabelTypeUserDefinedTag: DBXTeamLogLabelType { + @objc + public init() { + let swift = TeamLog.LabelType.userDefinedTag + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLabelTypeOther: DBXTeamLogLabelType { + @objc + public init() { + let swift = TeamLog.LabelType.other + super.init(swift: swift) + } +} + +/// Information on sessions, in legacy format +@objc +public class DBXTeamLogLegacyDeviceSessionLogInfo: DBXTeamLogDeviceSessionLogInfo { + /// Session unique id. + @objc + public var sessionInfo: DBXTeamLogSessionLogInfo? { guard let swift = subSwift.sessionInfo else { return nil } + return DBXTeamLogSessionLogInfo(swift: swift) + } + + /// The device name. Might be missing due to historical data gap. + @objc + public var displayName: String? { subSwift.displayName } + /// Is device managed by emm. Might be missing due to historical data gap. + @objc + public var isEmmManaged: NSNumber? { subSwift.isEmmManaged as NSNumber? } + /// Information on the hosting platform. Might be missing due to historical data gap. + @objc + public var platform: String? { subSwift.platform } + /// The mac address of the last activity from this session. Might be missing due to historical data gap. + @objc + public var macAddress: String? { subSwift.macAddress } + /// The hosting OS version. Might be missing due to historical data gap. + @objc + public var osVersion: String? { subSwift.osVersion } + /// Information on the hosting device type. Might be missing due to historical data gap. + @objc + public var deviceType: String? { subSwift.deviceType } + /// The Dropbox client version. Might be missing due to historical data gap. + @objc + public var clientVersion: String? { subSwift.clientVersion } + /// Alternative unique device session id, instead of session id field. Might be missing due to historical data + /// gap. + @objc + public var legacyUniqId: String? { subSwift.legacyUniqId } + + @objc + public init( + ipAddress: String?, + created: Date?, + updated: Date?, + sessionInfo: DBXTeamLogSessionLogInfo?, + displayName: String?, + isEmmManaged: NSNumber?, + platform: String?, + macAddress: String?, + osVersion: String?, + deviceType: String?, + clientVersion: String?, + legacyUniqId: String? + ) { + let swift = TeamLog.LegacyDeviceSessionLogInfo( + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo?.swift, + displayName: displayName, + isEmmManaged: isEmmManaged?.boolValue, + platform: platform, + macAddress: macAddress, + osVersion: osVersion, + deviceType: deviceType, + clientVersion: clientVersion, + legacyUniqId: legacyUniqId + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: TeamLog.LegacyDeviceSessionLogInfo + + public init(swift: TeamLog.LegacyDeviceSessionLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Activated a hold. +@objc +public class DBXTeamLogLegalHoldsActivateAHoldDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + /// Hold start date. + @objc + public var startDate: Date { swift.startDate } + /// Hold end date. + @objc + public var endDate: Date? { swift.endDate } + + @objc + public init(legalHoldId: String, name: String, startDate: Date, endDate: Date?) { + self.swift = TeamLog.LegalHoldsActivateAHoldDetails(legalHoldId: legalHoldId, name: name, startDate: startDate, endDate: endDate) + } + + let swift: TeamLog.LegalHoldsActivateAHoldDetails + + public init(swift: TeamLog.LegalHoldsActivateAHoldDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsActivateAHoldType struct +@objc +public class DBXTeamLogLegalHoldsActivateAHoldType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsActivateAHoldType(description_: description_) + } + + let swift: TeamLog.LegalHoldsActivateAHoldType + + public init(swift: TeamLog.LegalHoldsActivateAHoldType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added members to a hold. +@objc +public class DBXTeamLogLegalHoldsAddMembersDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + + @objc + public init(legalHoldId: String, name: String) { + self.swift = TeamLog.LegalHoldsAddMembersDetails(legalHoldId: legalHoldId, name: name) + } + + let swift: TeamLog.LegalHoldsAddMembersDetails + + public init(swift: TeamLog.LegalHoldsAddMembersDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsAddMembersType struct +@objc +public class DBXTeamLogLegalHoldsAddMembersType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsAddMembersType(description_: description_) + } + + let swift: TeamLog.LegalHoldsAddMembersType + + public init(swift: TeamLog.LegalHoldsAddMembersType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited details for a hold. +@objc +public class DBXTeamLogLegalHoldsChangeHoldDetailsDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + /// Previous details. + @objc + public var previousValue: String { swift.previousValue } + /// New details. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(legalHoldId: String, name: String, previousValue: String, newValue: String) { + self.swift = TeamLog.LegalHoldsChangeHoldDetailsDetails(legalHoldId: legalHoldId, name: name, previousValue: previousValue, newValue: newValue) + } + + let swift: TeamLog.LegalHoldsChangeHoldDetailsDetails + + public init(swift: TeamLog.LegalHoldsChangeHoldDetailsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsChangeHoldDetailsType struct +@objc +public class DBXTeamLogLegalHoldsChangeHoldDetailsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsChangeHoldDetailsType(description_: description_) + } + + let swift: TeamLog.LegalHoldsChangeHoldDetailsType + + public init(swift: TeamLog.LegalHoldsChangeHoldDetailsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed a hold. +@objc +public class DBXTeamLogLegalHoldsChangeHoldNameDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Previous Name. + @objc + public var previousValue: String { swift.previousValue } + /// New Name. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(legalHoldId: String, previousValue: String, newValue: String) { + self.swift = TeamLog.LegalHoldsChangeHoldNameDetails(legalHoldId: legalHoldId, previousValue: previousValue, newValue: newValue) + } + + let swift: TeamLog.LegalHoldsChangeHoldNameDetails + + public init(swift: TeamLog.LegalHoldsChangeHoldNameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsChangeHoldNameType struct +@objc +public class DBXTeamLogLegalHoldsChangeHoldNameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsChangeHoldNameType(description_: description_) + } + + let swift: TeamLog.LegalHoldsChangeHoldNameType + + public init(swift: TeamLog.LegalHoldsChangeHoldNameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Exported hold. +@objc +public class DBXTeamLogLegalHoldsExportAHoldDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + /// Export name. + @objc + public var exportName: String? { swift.exportName } + + @objc + public init(legalHoldId: String, name: String, exportName: String?) { + self.swift = TeamLog.LegalHoldsExportAHoldDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) + } + + let swift: TeamLog.LegalHoldsExportAHoldDetails + + public init(swift: TeamLog.LegalHoldsExportAHoldDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsExportAHoldType struct +@objc +public class DBXTeamLogLegalHoldsExportAHoldType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsExportAHoldType(description_: description_) + } + + let swift: TeamLog.LegalHoldsExportAHoldType + + public init(swift: TeamLog.LegalHoldsExportAHoldType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Canceled export for a hold. +@objc +public class DBXTeamLogLegalHoldsExportCancelledDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + /// Export name. + @objc + public var exportName: String { swift.exportName } + + @objc + public init(legalHoldId: String, name: String, exportName: String) { + self.swift = TeamLog.LegalHoldsExportCancelledDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) + } + + let swift: TeamLog.LegalHoldsExportCancelledDetails + + public init(swift: TeamLog.LegalHoldsExportCancelledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsExportCancelledType struct +@objc +public class DBXTeamLogLegalHoldsExportCancelledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsExportCancelledType(description_: description_) + } + + let swift: TeamLog.LegalHoldsExportCancelledType + + public init(swift: TeamLog.LegalHoldsExportCancelledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downloaded export for a hold. +@objc +public class DBXTeamLogLegalHoldsExportDownloadedDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + /// Export name. + @objc + public var exportName: String { swift.exportName } + /// Part. + @objc + public var part: String? { swift.part } + /// Filename. + @objc + public var fileName: String? { swift.fileName } + + @objc + public init(legalHoldId: String, name: String, exportName: String, part: String?, fileName: String?) { + self.swift = TeamLog.LegalHoldsExportDownloadedDetails(legalHoldId: legalHoldId, name: name, exportName: exportName, part: part, fileName: fileName) + } + + let swift: TeamLog.LegalHoldsExportDownloadedDetails + + public init(swift: TeamLog.LegalHoldsExportDownloadedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsExportDownloadedType struct +@objc +public class DBXTeamLogLegalHoldsExportDownloadedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsExportDownloadedType(description_: description_) + } + + let swift: TeamLog.LegalHoldsExportDownloadedType + + public init(swift: TeamLog.LegalHoldsExportDownloadedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed export for a hold. +@objc +public class DBXTeamLogLegalHoldsExportRemovedDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + /// Export name. + @objc + public var exportName: String { swift.exportName } + + @objc + public init(legalHoldId: String, name: String, exportName: String) { + self.swift = TeamLog.LegalHoldsExportRemovedDetails(legalHoldId: legalHoldId, name: name, exportName: exportName) + } + + let swift: TeamLog.LegalHoldsExportRemovedDetails + + public init(swift: TeamLog.LegalHoldsExportRemovedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsExportRemovedType struct +@objc +public class DBXTeamLogLegalHoldsExportRemovedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsExportRemovedType(description_: description_) + } + + let swift: TeamLog.LegalHoldsExportRemovedType + + public init(swift: TeamLog.LegalHoldsExportRemovedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Released a hold. +@objc +public class DBXTeamLogLegalHoldsReleaseAHoldDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + + @objc + public init(legalHoldId: String, name: String) { + self.swift = TeamLog.LegalHoldsReleaseAHoldDetails(legalHoldId: legalHoldId, name: name) + } + + let swift: TeamLog.LegalHoldsReleaseAHoldDetails + + public init(swift: TeamLog.LegalHoldsReleaseAHoldDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsReleaseAHoldType struct +@objc +public class DBXTeamLogLegalHoldsReleaseAHoldType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsReleaseAHoldType(description_: description_) + } + + let swift: TeamLog.LegalHoldsReleaseAHoldType + + public init(swift: TeamLog.LegalHoldsReleaseAHoldType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed members from a hold. +@objc +public class DBXTeamLogLegalHoldsRemoveMembersDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + + @objc + public init(legalHoldId: String, name: String) { + self.swift = TeamLog.LegalHoldsRemoveMembersDetails(legalHoldId: legalHoldId, name: name) + } + + let swift: TeamLog.LegalHoldsRemoveMembersDetails + + public init(swift: TeamLog.LegalHoldsRemoveMembersDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsRemoveMembersType struct +@objc +public class DBXTeamLogLegalHoldsRemoveMembersType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsRemoveMembersType(description_: description_) + } + + let swift: TeamLog.LegalHoldsRemoveMembersType + + public init(swift: TeamLog.LegalHoldsRemoveMembersType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created a summary report for a hold. +@objc +public class DBXTeamLogLegalHoldsReportAHoldDetails: NSObject { + /// Hold ID. + @objc + public var legalHoldId: String { swift.legalHoldId } + /// Hold name. + @objc + public var name: String { swift.name } + + @objc + public init(legalHoldId: String, name: String) { + self.swift = TeamLog.LegalHoldsReportAHoldDetails(legalHoldId: legalHoldId, name: name) + } + + let swift: TeamLog.LegalHoldsReportAHoldDetails + + public init(swift: TeamLog.LegalHoldsReportAHoldDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LegalHoldsReportAHoldType struct +@objc +public class DBXTeamLogLegalHoldsReportAHoldType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LegalHoldsReportAHoldType(description_: description_) + } + + let swift: TeamLog.LegalHoldsReportAHoldType + + public init(swift: TeamLog.LegalHoldsReportAHoldType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The device sessions that user is linked to. +@objc +public class DBXTeamLogLinkedDeviceLogInfo: NSObject { + let swift: TeamLog.LinkedDeviceLogInfo + + public init(swift: TeamLog.LinkedDeviceLogInfo) { + self.swift = swift + } + + public static func factory(swift: TeamLog.LinkedDeviceLogInfo) -> DBXTeamLogLinkedDeviceLogInfo { + switch swift { + case .desktopDeviceSession(let swiftArg): + let arg = DBXTeamLogDesktopDeviceSessionLogInfo(swift: swiftArg) + return DBXTeamLogLinkedDeviceLogInfoDesktopDeviceSession(arg) + case .legacyDeviceSession(let swiftArg): + let arg = DBXTeamLogLegacyDeviceSessionLogInfo(swift: swiftArg) + return DBXTeamLogLinkedDeviceLogInfoLegacyDeviceSession(arg) + case .mobileDeviceSession(let swiftArg): + let arg = DBXTeamLogMobileDeviceSessionLogInfo(swift: swiftArg) + return DBXTeamLogLinkedDeviceLogInfoMobileDeviceSession(arg) + case .webDeviceSession(let swiftArg): + let arg = DBXTeamLogWebDeviceSessionLogInfo(swift: swiftArg) + return DBXTeamLogLinkedDeviceLogInfoWebDeviceSession(arg) + case .other: + return DBXTeamLogLinkedDeviceLogInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDesktopDeviceSession: DBXTeamLogLinkedDeviceLogInfoDesktopDeviceSession? { + self as? DBXTeamLogLinkedDeviceLogInfoDesktopDeviceSession + } + + @objc + public var asLegacyDeviceSession: DBXTeamLogLinkedDeviceLogInfoLegacyDeviceSession? { + self as? DBXTeamLogLinkedDeviceLogInfoLegacyDeviceSession + } + + @objc + public var asMobileDeviceSession: DBXTeamLogLinkedDeviceLogInfoMobileDeviceSession? { + self as? DBXTeamLogLinkedDeviceLogInfoMobileDeviceSession + } + + @objc + public var asWebDeviceSession: DBXTeamLogLinkedDeviceLogInfoWebDeviceSession? { + self as? DBXTeamLogLinkedDeviceLogInfoWebDeviceSession + } + + @objc + public var asOther: DBXTeamLogLinkedDeviceLogInfoOther? { + self as? DBXTeamLogLinkedDeviceLogInfoOther + } +} + +/// desktop device session's details. +@objc +public class DBXTeamLogLinkedDeviceLogInfoDesktopDeviceSession: DBXTeamLogLinkedDeviceLogInfo { + @objc + public var desktopDeviceSession: DBXTeamLogDesktopDeviceSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogDesktopDeviceSessionLogInfo) { + self.desktopDeviceSession = arg + let swift = TeamLog.LinkedDeviceLogInfo.desktopDeviceSession(arg.subSwift) + super.init(swift: swift) + } +} + +/// legacy device session's details. +@objc +public class DBXTeamLogLinkedDeviceLogInfoLegacyDeviceSession: DBXTeamLogLinkedDeviceLogInfo { + @objc + public var legacyDeviceSession: DBXTeamLogLegacyDeviceSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogLegacyDeviceSessionLogInfo) { + self.legacyDeviceSession = arg + let swift = TeamLog.LinkedDeviceLogInfo.legacyDeviceSession(arg.subSwift) + super.init(swift: swift) + } +} + +/// mobile device session's details. +@objc +public class DBXTeamLogLinkedDeviceLogInfoMobileDeviceSession: DBXTeamLogLinkedDeviceLogInfo { + @objc + public var mobileDeviceSession: DBXTeamLogMobileDeviceSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogMobileDeviceSessionLogInfo) { + self.mobileDeviceSession = arg + let swift = TeamLog.LinkedDeviceLogInfo.mobileDeviceSession(arg.subSwift) + super.init(swift: swift) + } +} + +/// web device session's details. +@objc +public class DBXTeamLogLinkedDeviceLogInfoWebDeviceSession: DBXTeamLogLinkedDeviceLogInfo { + @objc + public var webDeviceSession: DBXTeamLogWebDeviceSessionLogInfo + + @objc + public init(_ arg: DBXTeamLogWebDeviceSessionLogInfo) { + self.webDeviceSession = arg + let swift = TeamLog.LinkedDeviceLogInfo.webDeviceSession(arg.subSwift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLinkedDeviceLogInfoOther: DBXTeamLogLinkedDeviceLogInfo { + @objc + public init() { + let swift = TeamLog.LinkedDeviceLogInfo.other + super.init(swift: swift) + } +} + +/// File lock status +@objc +public class DBXTeamLogLockStatus: NSObject { + let swift: TeamLog.LockStatus + + public init(swift: TeamLog.LockStatus) { + self.swift = swift + } + + public static func factory(swift: TeamLog.LockStatus) -> DBXTeamLogLockStatus { + switch swift { + case .locked: + return DBXTeamLogLockStatusLocked() + case .unlocked: + return DBXTeamLogLockStatusUnlocked() + case .other: + return DBXTeamLogLockStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asLocked: DBXTeamLogLockStatusLocked? { + self as? DBXTeamLogLockStatusLocked + } + + @objc + public var asUnlocked: DBXTeamLogLockStatusUnlocked? { + self as? DBXTeamLogLockStatusUnlocked + } + + @objc + public var asOther: DBXTeamLogLockStatusOther? { + self as? DBXTeamLogLockStatusOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLockStatusLocked: DBXTeamLogLockStatus { + @objc + public init() { + let swift = TeamLog.LockStatus.locked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLockStatusUnlocked: DBXTeamLogLockStatus { + @objc + public init() { + let swift = TeamLog.LockStatus.unlocked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLockStatusOther: DBXTeamLogLockStatus { + @objc + public init() { + let swift = TeamLog.LockStatus.other + super.init(swift: swift) + } +} + +/// Failed to sign in. +@objc +public class DBXTeamLogLoginFailDetails: NSObject { + /// Tells if the login device is EMM managed. Might be missing due to historical data gap. + @objc + public var isEmmManaged: NSNumber? { swift.isEmmManaged as NSNumber? } + /// Login method. + @objc + public var loginMethod: DBXTeamLogLoginMethod { DBXTeamLogLoginMethod(swift: swift.loginMethod) } + /// Error details. + @objc + public var errorDetails: DBXTeamLogFailureDetailsLogInfo { DBXTeamLogFailureDetailsLogInfo(swift: swift.errorDetails) } + + @objc + public init(loginMethod: DBXTeamLogLoginMethod, errorDetails: DBXTeamLogFailureDetailsLogInfo, isEmmManaged: NSNumber?) { + self.swift = TeamLog.LoginFailDetails(loginMethod: loginMethod.swift, errorDetails: errorDetails.swift, isEmmManaged: isEmmManaged?.boolValue) + } + + let swift: TeamLog.LoginFailDetails + + public init(swift: TeamLog.LoginFailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LoginFailType struct +@objc +public class DBXTeamLogLoginFailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LoginFailType(description_: description_) + } + + let swift: TeamLog.LoginFailType + + public init(swift: TeamLog.LoginFailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LoginMethod union +@objc +public class DBXTeamLogLoginMethod: NSObject { + let swift: TeamLog.LoginMethod + + public init(swift: TeamLog.LoginMethod) { + self.swift = swift + } + + public static func factory(swift: TeamLog.LoginMethod) -> DBXTeamLogLoginMethod { + switch swift { + case .appleOauth: + return DBXTeamLogLoginMethodAppleOauth() + case .firstPartyTokenExchange: + return DBXTeamLogLoginMethodFirstPartyTokenExchange() + case .googleOauth: + return DBXTeamLogLoginMethodGoogleOauth() + case .lenovoOauth: + return DBXTeamLogLoginMethodLenovoOauth() + case .password: + return DBXTeamLogLoginMethodPassword() + case .qrCode: + return DBXTeamLogLoginMethodQrCode() + case .saml: + return DBXTeamLogLoginMethodSaml() + case .twoFactorAuthentication: + return DBXTeamLogLoginMethodTwoFactorAuthentication() + case .webSession: + return DBXTeamLogLoginMethodWebSession() + case .other: + return DBXTeamLogLoginMethodOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAppleOauth: DBXTeamLogLoginMethodAppleOauth? { + self as? DBXTeamLogLoginMethodAppleOauth + } + + @objc + public var asFirstPartyTokenExchange: DBXTeamLogLoginMethodFirstPartyTokenExchange? { + self as? DBXTeamLogLoginMethodFirstPartyTokenExchange + } + + @objc + public var asGoogleOauth: DBXTeamLogLoginMethodGoogleOauth? { + self as? DBXTeamLogLoginMethodGoogleOauth + } + + @objc + public var asLenovoOauth: DBXTeamLogLoginMethodLenovoOauth? { + self as? DBXTeamLogLoginMethodLenovoOauth + } + + @objc + public var asPassword: DBXTeamLogLoginMethodPassword? { + self as? DBXTeamLogLoginMethodPassword + } + + @objc + public var asQrCode: DBXTeamLogLoginMethodQrCode? { + self as? DBXTeamLogLoginMethodQrCode + } + + @objc + public var asSaml: DBXTeamLogLoginMethodSaml? { + self as? DBXTeamLogLoginMethodSaml + } + + @objc + public var asTwoFactorAuthentication: DBXTeamLogLoginMethodTwoFactorAuthentication? { + self as? DBXTeamLogLoginMethodTwoFactorAuthentication + } + + @objc + public var asWebSession: DBXTeamLogLoginMethodWebSession? { + self as? DBXTeamLogLoginMethodWebSession + } + + @objc + public var asOther: DBXTeamLogLoginMethodOther? { + self as? DBXTeamLogLoginMethodOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodAppleOauth: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.appleOauth + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodFirstPartyTokenExchange: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.firstPartyTokenExchange + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodGoogleOauth: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.googleOauth + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodLenovoOauth: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.lenovoOauth + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodPassword: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.password + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodQrCode: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.qrCode + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodSaml: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.saml + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodTwoFactorAuthentication: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.twoFactorAuthentication + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodWebSession: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.webSession + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogLoginMethodOther: DBXTeamLogLoginMethod { + @objc + public init() { + let swift = TeamLog.LoginMethod.other + super.init(swift: swift) + } +} + +/// Signed in. +@objc +public class DBXTeamLogLoginSuccessDetails: NSObject { + /// Tells if the login device is EMM managed. Might be missing due to historical data gap. + @objc + public var isEmmManaged: NSNumber? { swift.isEmmManaged as NSNumber? } + /// Login method. + @objc + public var loginMethod: DBXTeamLogLoginMethod { DBXTeamLogLoginMethod(swift: swift.loginMethod) } + + @objc + public init(loginMethod: DBXTeamLogLoginMethod, isEmmManaged: NSNumber?) { + self.swift = TeamLog.LoginSuccessDetails(loginMethod: loginMethod.swift, isEmmManaged: isEmmManaged?.boolValue) + } + + let swift: TeamLog.LoginSuccessDetails + + public init(swift: TeamLog.LoginSuccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LoginSuccessType struct +@objc +public class DBXTeamLogLoginSuccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LoginSuccessType(description_: description_) + } + + let swift: TeamLog.LoginSuccessType + + public init(swift: TeamLog.LoginSuccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Signed out. +@objc +public class DBXTeamLogLogoutDetails: NSObject { + /// Login session id. + @objc + public var loginId: String? { swift.loginId } + + @objc + public init(loginId: String?) { + self.swift = TeamLog.LogoutDetails(loginId: loginId) + } + + let swift: TeamLog.LogoutDetails + + public init(swift: TeamLog.LogoutDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible LogoutType struct +@objc +public class DBXTeamLogLogoutType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.LogoutType(description_: description_) + } + + let swift: TeamLog.LogoutType + + public init(swift: TeamLog.LogoutType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added an external ID for team member. +@objc +public class DBXTeamLogMemberAddExternalIdDetails: NSObject { + /// Current external id. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(newValue: String) { + self.swift = TeamLog.MemberAddExternalIdDetails(newValue: newValue) + } + + let swift: TeamLog.MemberAddExternalIdDetails + + public init(swift: TeamLog.MemberAddExternalIdDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberAddExternalIdType struct +@objc +public class DBXTeamLogMemberAddExternalIdType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberAddExternalIdType(description_: description_) + } + + let swift: TeamLog.MemberAddExternalIdType + + public init(swift: TeamLog.MemberAddExternalIdType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added team member name. +@objc +public class DBXTeamLogMemberAddNameDetails: NSObject { + /// New user's name. + @objc + public var newValue: DBXTeamLogUserNameLogInfo { DBXTeamLogUserNameLogInfo(swift: swift.newValue) } + + @objc + public init(newValue: DBXTeamLogUserNameLogInfo) { + self.swift = TeamLog.MemberAddNameDetails(newValue: newValue.swift) + } + + let swift: TeamLog.MemberAddNameDetails + + public init(swift: TeamLog.MemberAddNameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberAddNameType struct +@objc +public class DBXTeamLogMemberAddNameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberAddNameType(description_: description_) + } + + let swift: TeamLog.MemberAddNameType + + public init(swift: TeamLog.MemberAddNameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team member admin role. +@objc +public class DBXTeamLogMemberChangeAdminRoleDetails: NSObject { + /// New admin role. This field is relevant when the admin role is changed or whenthe user role changes from no + /// admin rights to with admin rights. + @objc + public var newValue: DBXTeamLogAdminRole? { guard let swift = swift.newValue else { return nil } + return DBXTeamLogAdminRole(swift: swift) + } + + /// Previous admin role. This field is relevant when the admin role is changed or when the admin role is + /// removed. + @objc + public var previousValue: DBXTeamLogAdminRole? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogAdminRole(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogAdminRole?, previousValue: DBXTeamLogAdminRole?) { + self.swift = TeamLog.MemberChangeAdminRoleDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.MemberChangeAdminRoleDetails + + public init(swift: TeamLog.MemberChangeAdminRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberChangeAdminRoleType struct +@objc +public class DBXTeamLogMemberChangeAdminRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberChangeAdminRoleType(description_: description_) + } + + let swift: TeamLog.MemberChangeAdminRoleType + + public init(swift: TeamLog.MemberChangeAdminRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team member email. +@objc +public class DBXTeamLogMemberChangeEmailDetails: NSObject { + /// New email. + @objc + public var newValue: String { swift.newValue } + /// Previous email. Might be missing due to historical data gap. + @objc + public var previousValue: String? { swift.previousValue } + + @objc + public init(newValue: String, previousValue: String?) { + self.swift = TeamLog.MemberChangeEmailDetails(newValue: newValue, previousValue: previousValue) + } + + let swift: TeamLog.MemberChangeEmailDetails + + public init(swift: TeamLog.MemberChangeEmailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberChangeEmailType struct +@objc +public class DBXTeamLogMemberChangeEmailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberChangeEmailType(description_: description_) + } + + let swift: TeamLog.MemberChangeEmailType + + public init(swift: TeamLog.MemberChangeEmailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed the external ID for team member. +@objc +public class DBXTeamLogMemberChangeExternalIdDetails: NSObject { + /// Current external id. + @objc + public var newValue: String { swift.newValue } + /// Old external id. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(newValue: String, previousValue: String) { + self.swift = TeamLog.MemberChangeExternalIdDetails(newValue: newValue, previousValue: previousValue) + } + + let swift: TeamLog.MemberChangeExternalIdDetails + + public init(swift: TeamLog.MemberChangeExternalIdDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberChangeExternalIdType struct +@objc +public class DBXTeamLogMemberChangeExternalIdType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberChangeExternalIdType(description_: description_) + } + + let swift: TeamLog.MemberChangeExternalIdType + + public init(swift: TeamLog.MemberChangeExternalIdType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed membership type (limited/full) of member. +@objc +public class DBXTeamLogMemberChangeMembershipTypeDetails: NSObject { + /// Previous membership type. + @objc + public var prevValue: DBXTeamLogTeamMembershipType { DBXTeamLogTeamMembershipType(swift: swift.prevValue) } + /// New membership type. + @objc + public var newValue: DBXTeamLogTeamMembershipType { DBXTeamLogTeamMembershipType(swift: swift.newValue) } + + @objc + public init(prevValue: DBXTeamLogTeamMembershipType, newValue: DBXTeamLogTeamMembershipType) { + self.swift = TeamLog.MemberChangeMembershipTypeDetails(prevValue: prevValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.MemberChangeMembershipTypeDetails + + public init(swift: TeamLog.MemberChangeMembershipTypeDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberChangeMembershipTypeType struct +@objc +public class DBXTeamLogMemberChangeMembershipTypeType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberChangeMembershipTypeType(description_: description_) + } + + let swift: TeamLog.MemberChangeMembershipTypeType + + public init(swift: TeamLog.MemberChangeMembershipTypeType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team member name. +@objc +public class DBXTeamLogMemberChangeNameDetails: NSObject { + /// New user's name. + @objc + public var newValue: DBXTeamLogUserNameLogInfo { DBXTeamLogUserNameLogInfo(swift: swift.newValue) } + /// Previous user's name. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogUserNameLogInfo? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogUserNameLogInfo(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogUserNameLogInfo, previousValue: DBXTeamLogUserNameLogInfo?) { + self.swift = TeamLog.MemberChangeNameDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.MemberChangeNameDetails + + public init(swift: TeamLog.MemberChangeNameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberChangeNameType struct +@objc +public class DBXTeamLogMemberChangeNameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberChangeNameType(description_: description_) + } + + let swift: TeamLog.MemberChangeNameType + + public init(swift: TeamLog.MemberChangeNameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team member reseller role. +@objc +public class DBXTeamLogMemberChangeResellerRoleDetails: NSObject { + /// New reseller role. This field is relevant when the reseller role is changed. + @objc + public var newValue: DBXTeamLogResellerRole { DBXTeamLogResellerRole(swift: swift.newValue) } + /// Previous reseller role. This field is relevant when the reseller role is changed or when the reseller role + /// is removed. + @objc + public var previousValue: DBXTeamLogResellerRole { DBXTeamLogResellerRole(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogResellerRole, previousValue: DBXTeamLogResellerRole) { + self.swift = TeamLog.MemberChangeResellerRoleDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.MemberChangeResellerRoleDetails + + public init(swift: TeamLog.MemberChangeResellerRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberChangeResellerRoleType struct +@objc +public class DBXTeamLogMemberChangeResellerRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberChangeResellerRoleType(description_: description_) + } + + let swift: TeamLog.MemberChangeResellerRoleType + + public init(swift: TeamLog.MemberChangeResellerRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed member status (invited, joined, suspended, etc.). +@objc +public class DBXTeamLogMemberChangeStatusDetails: NSObject { + /// Previous member status. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogMemberStatus? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogMemberStatus(swift: swift) + } + + /// New member status. + @objc + public var newValue: DBXTeamLogMemberStatus { DBXTeamLogMemberStatus(swift: swift.newValue) } + /// Additional information indicating the action taken that caused status change. + @objc + public var action: DBXTeamLogActionDetails? { guard let swift = swift.action else { return nil } + return DBXTeamLogActionDetails(swift: swift) + } + + /// The user's new team name. This field is relevant when the user is transferred off the team. + @objc + public var newTeam: String? { swift.newTeam } + /// The user's previous team name. This field is relevant when the user is transferred onto the team. + @objc + public var previousTeam: String? { swift.previousTeam } + + @objc + public init( + newValue: DBXTeamLogMemberStatus, + previousValue: DBXTeamLogMemberStatus?, + action: DBXTeamLogActionDetails?, + newTeam: String?, + previousTeam: String? + ) { + self.swift = TeamLog.MemberChangeStatusDetails( + newValue: newValue.swift, + previousValue: previousValue?.swift, + action: action?.swift, + newTeam: newTeam, + previousTeam: previousTeam + ) + } + + let swift: TeamLog.MemberChangeStatusDetails + + public init(swift: TeamLog.MemberChangeStatusDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberChangeStatusType struct +@objc +public class DBXTeamLogMemberChangeStatusType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberChangeStatusType(description_: description_) + } + + let swift: TeamLog.MemberChangeStatusType + + public init(swift: TeamLog.MemberChangeStatusType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Cleared manually added contacts. +@objc +public class DBXTeamLogMemberDeleteManualContactsDetails: NSObject { + let swift: TeamLog.MemberDeleteManualContactsDetails + + public init(swift: TeamLog.MemberDeleteManualContactsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberDeleteManualContactsType struct +@objc +public class DBXTeamLogMemberDeleteManualContactsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberDeleteManualContactsType(description_: description_) + } + + let swift: TeamLog.MemberDeleteManualContactsType + + public init(swift: TeamLog.MemberDeleteManualContactsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted team member profile photo. +@objc +public class DBXTeamLogMemberDeleteProfilePhotoDetails: NSObject { + let swift: TeamLog.MemberDeleteProfilePhotoDetails + + public init(swift: TeamLog.MemberDeleteProfilePhotoDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberDeleteProfilePhotoType struct +@objc +public class DBXTeamLogMemberDeleteProfilePhotoType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberDeleteProfilePhotoType(description_: description_) + } + + let swift: TeamLog.MemberDeleteProfilePhotoType + + public init(swift: TeamLog.MemberDeleteProfilePhotoType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Permanently deleted contents of deleted team member account. +@objc +public class DBXTeamLogMemberPermanentlyDeleteAccountContentsDetails: NSObject { + let swift: TeamLog.MemberPermanentlyDeleteAccountContentsDetails + + public init(swift: TeamLog.MemberPermanentlyDeleteAccountContentsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberPermanentlyDeleteAccountContentsType struct +@objc +public class DBXTeamLogMemberPermanentlyDeleteAccountContentsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberPermanentlyDeleteAccountContentsType(description_: description_) + } + + let swift: TeamLog.MemberPermanentlyDeleteAccountContentsType + + public init(swift: TeamLog.MemberPermanentlyDeleteAccountContentsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberRemoveActionType union +@objc +public class DBXTeamLogMemberRemoveActionType: NSObject { + let swift: TeamLog.MemberRemoveActionType + + public init(swift: TeamLog.MemberRemoveActionType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.MemberRemoveActionType) -> DBXTeamLogMemberRemoveActionType { + switch swift { + case .delete: + return DBXTeamLogMemberRemoveActionTypeDelete() + case .leave: + return DBXTeamLogMemberRemoveActionTypeLeave() + case .offboard: + return DBXTeamLogMemberRemoveActionTypeOffboard() + case .offboardAndRetainTeamFolders: + return DBXTeamLogMemberRemoveActionTypeOffboardAndRetainTeamFolders() + case .other: + return DBXTeamLogMemberRemoveActionTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDelete: DBXTeamLogMemberRemoveActionTypeDelete? { + self as? DBXTeamLogMemberRemoveActionTypeDelete + } + + @objc + public var asLeave: DBXTeamLogMemberRemoveActionTypeLeave? { + self as? DBXTeamLogMemberRemoveActionTypeLeave + } + + @objc + public var asOffboard: DBXTeamLogMemberRemoveActionTypeOffboard? { + self as? DBXTeamLogMemberRemoveActionTypeOffboard + } + + @objc + public var asOffboardAndRetainTeamFolders: DBXTeamLogMemberRemoveActionTypeOffboardAndRetainTeamFolders? { + self as? DBXTeamLogMemberRemoveActionTypeOffboardAndRetainTeamFolders + } + + @objc + public var asOther: DBXTeamLogMemberRemoveActionTypeOther? { + self as? DBXTeamLogMemberRemoveActionTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRemoveActionTypeDelete: DBXTeamLogMemberRemoveActionType { + @objc + public init() { + let swift = TeamLog.MemberRemoveActionType.delete + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRemoveActionTypeLeave: DBXTeamLogMemberRemoveActionType { + @objc + public init() { + let swift = TeamLog.MemberRemoveActionType.leave + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRemoveActionTypeOffboard: DBXTeamLogMemberRemoveActionType { + @objc + public init() { + let swift = TeamLog.MemberRemoveActionType.offboard + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRemoveActionTypeOffboardAndRetainTeamFolders: DBXTeamLogMemberRemoveActionType { + @objc + public init() { + let swift = TeamLog.MemberRemoveActionType.offboardAndRetainTeamFolders + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRemoveActionTypeOther: DBXTeamLogMemberRemoveActionType { + @objc + public init() { + let swift = TeamLog.MemberRemoveActionType.other + super.init(swift: swift) + } +} + +/// Removed the external ID for team member. +@objc +public class DBXTeamLogMemberRemoveExternalIdDetails: NSObject { + /// Old external id. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(previousValue: String) { + self.swift = TeamLog.MemberRemoveExternalIdDetails(previousValue: previousValue) + } + + let swift: TeamLog.MemberRemoveExternalIdDetails + + public init(swift: TeamLog.MemberRemoveExternalIdDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberRemoveExternalIdType struct +@objc +public class DBXTeamLogMemberRemoveExternalIdType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberRemoveExternalIdType(description_: description_) + } + + let swift: TeamLog.MemberRemoveExternalIdType + + public init(swift: TeamLog.MemberRemoveExternalIdType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether users can find team when not invited. +@objc +public class DBXTeamLogMemberRequestsChangePolicyDetails: NSObject { + /// New member change requests policy. + @objc + public var newValue: DBXTeamLogMemberRequestsPolicy { DBXTeamLogMemberRequestsPolicy(swift: swift.newValue) } + /// Previous member change requests policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogMemberRequestsPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogMemberRequestsPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogMemberRequestsPolicy, previousValue: DBXTeamLogMemberRequestsPolicy?) { + self.swift = TeamLog.MemberRequestsChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.MemberRequestsChangePolicyDetails + + public init(swift: TeamLog.MemberRequestsChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberRequestsChangePolicyType struct +@objc +public class DBXTeamLogMemberRequestsChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberRequestsChangePolicyType(description_: description_) + } + + let swift: TeamLog.MemberRequestsChangePolicyType + + public init(swift: TeamLog.MemberRequestsChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberRequestsPolicy union +@objc +public class DBXTeamLogMemberRequestsPolicy: NSObject { + let swift: TeamLog.MemberRequestsPolicy + + public init(swift: TeamLog.MemberRequestsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.MemberRequestsPolicy) -> DBXTeamLogMemberRequestsPolicy { + switch swift { + case .autoAccept: + return DBXTeamLogMemberRequestsPolicyAutoAccept() + case .disabled: + return DBXTeamLogMemberRequestsPolicyDisabled() + case .requireApproval: + return DBXTeamLogMemberRequestsPolicyRequireApproval() + case .other: + return DBXTeamLogMemberRequestsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAutoAccept: DBXTeamLogMemberRequestsPolicyAutoAccept? { + self as? DBXTeamLogMemberRequestsPolicyAutoAccept + } + + @objc + public var asDisabled: DBXTeamLogMemberRequestsPolicyDisabled? { + self as? DBXTeamLogMemberRequestsPolicyDisabled + } + + @objc + public var asRequireApproval: DBXTeamLogMemberRequestsPolicyRequireApproval? { + self as? DBXTeamLogMemberRequestsPolicyRequireApproval + } + + @objc + public var asOther: DBXTeamLogMemberRequestsPolicyOther? { + self as? DBXTeamLogMemberRequestsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRequestsPolicyAutoAccept: DBXTeamLogMemberRequestsPolicy { + @objc + public init() { + let swift = TeamLog.MemberRequestsPolicy.autoAccept + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRequestsPolicyDisabled: DBXTeamLogMemberRequestsPolicy { + @objc + public init() { + let swift = TeamLog.MemberRequestsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRequestsPolicyRequireApproval: DBXTeamLogMemberRequestsPolicy { + @objc + public init() { + let swift = TeamLog.MemberRequestsPolicy.requireApproval + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberRequestsPolicyOther: DBXTeamLogMemberRequestsPolicy { + @objc + public init() { + let swift = TeamLog.MemberRequestsPolicy.other + super.init(swift: swift) + } +} + +/// Policy for controlling whether team members can send team invites +@objc +public class DBXTeamLogMemberSendInvitePolicy: NSObject { + let swift: TeamLog.MemberSendInvitePolicy + + public init(swift: TeamLog.MemberSendInvitePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.MemberSendInvitePolicy) -> DBXTeamLogMemberSendInvitePolicy { + switch swift { + case .disabled: + return DBXTeamLogMemberSendInvitePolicyDisabled() + case .everyone: + return DBXTeamLogMemberSendInvitePolicyEveryone() + case .specificMembers: + return DBXTeamLogMemberSendInvitePolicySpecificMembers() + case .other: + return DBXTeamLogMemberSendInvitePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogMemberSendInvitePolicyDisabled? { + self as? DBXTeamLogMemberSendInvitePolicyDisabled + } + + @objc + public var asEveryone: DBXTeamLogMemberSendInvitePolicyEveryone? { + self as? DBXTeamLogMemberSendInvitePolicyEveryone + } + + @objc + public var asSpecificMembers: DBXTeamLogMemberSendInvitePolicySpecificMembers? { + self as? DBXTeamLogMemberSendInvitePolicySpecificMembers + } + + @objc + public var asOther: DBXTeamLogMemberSendInvitePolicyOther? { + self as? DBXTeamLogMemberSendInvitePolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberSendInvitePolicyDisabled: DBXTeamLogMemberSendInvitePolicy { + @objc + public init() { + let swift = TeamLog.MemberSendInvitePolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberSendInvitePolicyEveryone: DBXTeamLogMemberSendInvitePolicy { + @objc + public init() { + let swift = TeamLog.MemberSendInvitePolicy.everyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberSendInvitePolicySpecificMembers: DBXTeamLogMemberSendInvitePolicy { + @objc + public init() { + let swift = TeamLog.MemberSendInvitePolicy.specificMembers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberSendInvitePolicyOther: DBXTeamLogMemberSendInvitePolicy { + @objc + public init() { + let swift = TeamLog.MemberSendInvitePolicy.other + super.init(swift: swift) + } +} + +/// Changed member send invite policy for team. +@objc +public class DBXTeamLogMemberSendInvitePolicyChangedDetails: NSObject { + /// New team member send invite policy. + @objc + public var newValue: DBXTeamLogMemberSendInvitePolicy { DBXTeamLogMemberSendInvitePolicy(swift: swift.newValue) } + /// Previous team member send invite policy. + @objc + public var previousValue: DBXTeamLogMemberSendInvitePolicy { DBXTeamLogMemberSendInvitePolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogMemberSendInvitePolicy, previousValue: DBXTeamLogMemberSendInvitePolicy) { + self.swift = TeamLog.MemberSendInvitePolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.MemberSendInvitePolicyChangedDetails + + public init(swift: TeamLog.MemberSendInvitePolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSendInvitePolicyChangedType struct +@objc +public class DBXTeamLogMemberSendInvitePolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSendInvitePolicyChangedType(description_: description_) + } + + let swift: TeamLog.MemberSendInvitePolicyChangedType + + public init(swift: TeamLog.MemberSendInvitePolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Set team member profile photo. +@objc +public class DBXTeamLogMemberSetProfilePhotoDetails: NSObject { + let swift: TeamLog.MemberSetProfilePhotoDetails + + public init(swift: TeamLog.MemberSetProfilePhotoDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSetProfilePhotoType struct +@objc +public class DBXTeamLogMemberSetProfilePhotoType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSetProfilePhotoType(description_: description_) + } + + let swift: TeamLog.MemberSetProfilePhotoType + + public init(swift: TeamLog.MemberSetProfilePhotoType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Set custom member space limit. +@objc +public class DBXTeamLogMemberSpaceLimitsAddCustomQuotaDetails: NSObject { + /// New custom quota value in bytes. + @objc + public var newValue: NSNumber { swift.newValue as NSNumber } + + @objc + public init(newValue: NSNumber) { + self.swift = TeamLog.MemberSpaceLimitsAddCustomQuotaDetails(newValue: newValue.uint64Value) + } + + let swift: TeamLog.MemberSpaceLimitsAddCustomQuotaDetails + + public init(swift: TeamLog.MemberSpaceLimitsAddCustomQuotaDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsAddCustomQuotaType struct +@objc +public class DBXTeamLogMemberSpaceLimitsAddCustomQuotaType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsAddCustomQuotaType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsAddCustomQuotaType + + public init(swift: TeamLog.MemberSpaceLimitsAddCustomQuotaType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added members to member space limit exception list. +@objc +public class DBXTeamLogMemberSpaceLimitsAddExceptionDetails: NSObject { + let swift: TeamLog.MemberSpaceLimitsAddExceptionDetails + + public init(swift: TeamLog.MemberSpaceLimitsAddExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsAddExceptionType struct +@objc +public class DBXTeamLogMemberSpaceLimitsAddExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsAddExceptionType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsAddExceptionType + + public init(swift: TeamLog.MemberSpaceLimitsAddExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed member space limit type for team. +@objc +public class DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyDetails: NSObject { + /// Previous space limit type. + @objc + public var previousValue: DBXTeamLogSpaceCapsType { DBXTeamLogSpaceCapsType(swift: swift.previousValue) } + /// New space limit type. + @objc + public var newValue: DBXTeamLogSpaceCapsType { DBXTeamLogSpaceCapsType(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogSpaceCapsType, newValue: DBXTeamLogSpaceCapsType) { + self.swift = TeamLog.MemberSpaceLimitsChangeCapsTypePolicyDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.MemberSpaceLimitsChangeCapsTypePolicyDetails + + public init(swift: TeamLog.MemberSpaceLimitsChangeCapsTypePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsChangeCapsTypePolicyType struct +@objc +public class DBXTeamLogMemberSpaceLimitsChangeCapsTypePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsChangeCapsTypePolicyType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsChangeCapsTypePolicyType + + public init(swift: TeamLog.MemberSpaceLimitsChangeCapsTypePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed custom member space limit. +@objc +public class DBXTeamLogMemberSpaceLimitsChangeCustomQuotaDetails: NSObject { + /// Previous custom quota value in bytes. + @objc + public var previousValue: NSNumber { swift.previousValue as NSNumber } + /// New custom quota value in bytes. + @objc + public var newValue: NSNumber { swift.newValue as NSNumber } + + @objc + public init(previousValue: NSNumber, newValue: NSNumber) { + self.swift = TeamLog.MemberSpaceLimitsChangeCustomQuotaDetails(previousValue: previousValue.uint64Value, newValue: newValue.uint64Value) + } + + let swift: TeamLog.MemberSpaceLimitsChangeCustomQuotaDetails + + public init(swift: TeamLog.MemberSpaceLimitsChangeCustomQuotaDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsChangeCustomQuotaType struct +@objc +public class DBXTeamLogMemberSpaceLimitsChangeCustomQuotaType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsChangeCustomQuotaType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsChangeCustomQuotaType + + public init(swift: TeamLog.MemberSpaceLimitsChangeCustomQuotaType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team default member space limit. +@objc +public class DBXTeamLogMemberSpaceLimitsChangePolicyDetails: NSObject { + /// Previous team default limit value in bytes. Might be missing due to historical data gap. + @objc + public var previousValue: NSNumber? { swift.previousValue as NSNumber? } + /// New team default limit value in bytes. Might be missing due to historical data gap. + @objc + public var newValue: NSNumber? { swift.newValue as NSNumber? } + + @objc + public init(previousValue: NSNumber?, newValue: NSNumber?) { + self.swift = TeamLog.MemberSpaceLimitsChangePolicyDetails(previousValue: previousValue?.uint64Value, newValue: newValue?.uint64Value) + } + + let swift: TeamLog.MemberSpaceLimitsChangePolicyDetails + + public init(swift: TeamLog.MemberSpaceLimitsChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsChangePolicyType struct +@objc +public class DBXTeamLogMemberSpaceLimitsChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsChangePolicyType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsChangePolicyType + + public init(swift: TeamLog.MemberSpaceLimitsChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed space limit status. +@objc +public class DBXTeamLogMemberSpaceLimitsChangeStatusDetails: NSObject { + /// Previous storage quota status. + @objc + public var previousValue: DBXTeamLogSpaceLimitsStatus { DBXTeamLogSpaceLimitsStatus(swift: swift.previousValue) } + /// New storage quota status. + @objc + public var newValue: DBXTeamLogSpaceLimitsStatus { DBXTeamLogSpaceLimitsStatus(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogSpaceLimitsStatus, newValue: DBXTeamLogSpaceLimitsStatus) { + self.swift = TeamLog.MemberSpaceLimitsChangeStatusDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.MemberSpaceLimitsChangeStatusDetails + + public init(swift: TeamLog.MemberSpaceLimitsChangeStatusDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsChangeStatusType struct +@objc +public class DBXTeamLogMemberSpaceLimitsChangeStatusType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsChangeStatusType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsChangeStatusType + + public init(swift: TeamLog.MemberSpaceLimitsChangeStatusType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed custom member space limit. +@objc +public class DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaDetails: NSObject { + let swift: TeamLog.MemberSpaceLimitsRemoveCustomQuotaDetails + + public init(swift: TeamLog.MemberSpaceLimitsRemoveCustomQuotaDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsRemoveCustomQuotaType struct +@objc +public class DBXTeamLogMemberSpaceLimitsRemoveCustomQuotaType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsRemoveCustomQuotaType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsRemoveCustomQuotaType + + public init(swift: TeamLog.MemberSpaceLimitsRemoveCustomQuotaType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed members from member space limit exception list. +@objc +public class DBXTeamLogMemberSpaceLimitsRemoveExceptionDetails: NSObject { + let swift: TeamLog.MemberSpaceLimitsRemoveExceptionDetails + + public init(swift: TeamLog.MemberSpaceLimitsRemoveExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSpaceLimitsRemoveExceptionType struct +@objc +public class DBXTeamLogMemberSpaceLimitsRemoveExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSpaceLimitsRemoveExceptionType(description_: description_) + } + + let swift: TeamLog.MemberSpaceLimitsRemoveExceptionType + + public init(swift: TeamLog.MemberSpaceLimitsRemoveExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberStatus union +@objc +public class DBXTeamLogMemberStatus: NSObject { + let swift: TeamLog.MemberStatus + + public init(swift: TeamLog.MemberStatus) { + self.swift = swift + } + + public static func factory(swift: TeamLog.MemberStatus) -> DBXTeamLogMemberStatus { + switch swift { + case .active: + return DBXTeamLogMemberStatusActive() + case .invited: + return DBXTeamLogMemberStatusInvited() + case .movedToAnotherTeam: + return DBXTeamLogMemberStatusMovedToAnotherTeam() + case .notJoined: + return DBXTeamLogMemberStatusNotJoined() + case .removed: + return DBXTeamLogMemberStatusRemoved() + case .suspended: + return DBXTeamLogMemberStatusSuspended() + case .other: + return DBXTeamLogMemberStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXTeamLogMemberStatusActive? { + self as? DBXTeamLogMemberStatusActive + } + + @objc + public var asInvited: DBXTeamLogMemberStatusInvited? { + self as? DBXTeamLogMemberStatusInvited + } + + @objc + public var asMovedToAnotherTeam: DBXTeamLogMemberStatusMovedToAnotherTeam? { + self as? DBXTeamLogMemberStatusMovedToAnotherTeam + } + + @objc + public var asNotJoined: DBXTeamLogMemberStatusNotJoined? { + self as? DBXTeamLogMemberStatusNotJoined + } + + @objc + public var asRemoved: DBXTeamLogMemberStatusRemoved? { + self as? DBXTeamLogMemberStatusRemoved + } + + @objc + public var asSuspended: DBXTeamLogMemberStatusSuspended? { + self as? DBXTeamLogMemberStatusSuspended + } + + @objc + public var asOther: DBXTeamLogMemberStatusOther? { + self as? DBXTeamLogMemberStatusOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberStatusActive: DBXTeamLogMemberStatus { + @objc + public init() { + let swift = TeamLog.MemberStatus.active + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberStatusInvited: DBXTeamLogMemberStatus { + @objc + public init() { + let swift = TeamLog.MemberStatus.invited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberStatusMovedToAnotherTeam: DBXTeamLogMemberStatus { + @objc + public init() { + let swift = TeamLog.MemberStatus.movedToAnotherTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberStatusNotJoined: DBXTeamLogMemberStatus { + @objc + public init() { + let swift = TeamLog.MemberStatus.notJoined + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberStatusRemoved: DBXTeamLogMemberStatus { + @objc + public init() { + let swift = TeamLog.MemberStatus.removed + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberStatusSuspended: DBXTeamLogMemberStatus { + @objc + public init() { + let swift = TeamLog.MemberStatus.suspended + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberStatusOther: DBXTeamLogMemberStatus { + @objc + public init() { + let swift = TeamLog.MemberStatus.other + super.init(swift: swift) + } +} + +/// Suggested person to add to team. +@objc +public class DBXTeamLogMemberSuggestDetails: NSObject { + /// suggested users emails. + @objc + public var suggestedMembers: [String] { swift.suggestedMembers } + + @objc + public init(suggestedMembers: [String]) { + self.swift = TeamLog.MemberSuggestDetails(suggestedMembers: suggestedMembers) + } + + let swift: TeamLog.MemberSuggestDetails + + public init(swift: TeamLog.MemberSuggestDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSuggestType struct +@objc +public class DBXTeamLogMemberSuggestType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSuggestType(description_: description_) + } + + let swift: TeamLog.MemberSuggestType + + public init(swift: TeamLog.MemberSuggestType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled option for team members to suggest people to add to team. +@objc +public class DBXTeamLogMemberSuggestionsChangePolicyDetails: NSObject { + /// New team member suggestions policy. + @objc + public var newValue: DBXTeamLogMemberSuggestionsPolicy { DBXTeamLogMemberSuggestionsPolicy(swift: swift.newValue) } + /// Previous team member suggestions policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogMemberSuggestionsPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogMemberSuggestionsPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogMemberSuggestionsPolicy, previousValue: DBXTeamLogMemberSuggestionsPolicy?) { + self.swift = TeamLog.MemberSuggestionsChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.MemberSuggestionsChangePolicyDetails + + public init(swift: TeamLog.MemberSuggestionsChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberSuggestionsChangePolicyType struct +@objc +public class DBXTeamLogMemberSuggestionsChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberSuggestionsChangePolicyType(description_: description_) + } + + let swift: TeamLog.MemberSuggestionsChangePolicyType + + public init(swift: TeamLog.MemberSuggestionsChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Member suggestions policy +@objc +public class DBXTeamLogMemberSuggestionsPolicy: NSObject { + let swift: TeamLog.MemberSuggestionsPolicy + + public init(swift: TeamLog.MemberSuggestionsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.MemberSuggestionsPolicy) -> DBXTeamLogMemberSuggestionsPolicy { + switch swift { + case .disabled: + return DBXTeamLogMemberSuggestionsPolicyDisabled() + case .enabled: + return DBXTeamLogMemberSuggestionsPolicyEnabled() + case .other: + return DBXTeamLogMemberSuggestionsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogMemberSuggestionsPolicyDisabled? { + self as? DBXTeamLogMemberSuggestionsPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogMemberSuggestionsPolicyEnabled? { + self as? DBXTeamLogMemberSuggestionsPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogMemberSuggestionsPolicyOther? { + self as? DBXTeamLogMemberSuggestionsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberSuggestionsPolicyDisabled: DBXTeamLogMemberSuggestionsPolicy { + @objc + public init() { + let swift = TeamLog.MemberSuggestionsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberSuggestionsPolicyEnabled: DBXTeamLogMemberSuggestionsPolicy { + @objc + public init() { + let swift = TeamLog.MemberSuggestionsPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMemberSuggestionsPolicyOther: DBXTeamLogMemberSuggestionsPolicy { + @objc + public init() { + let swift = TeamLog.MemberSuggestionsPolicy.other + super.init(swift: swift) + } +} + +/// Transferred contents of deleted member account to another member. +@objc +public class DBXTeamLogMemberTransferAccountContentsDetails: NSObject { + let swift: TeamLog.MemberTransferAccountContentsDetails + + public init(swift: TeamLog.MemberTransferAccountContentsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MemberTransferAccountContentsType struct +@objc +public class DBXTeamLogMemberTransferAccountContentsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MemberTransferAccountContentsType(description_: description_) + } + + let swift: TeamLog.MemberTransferAccountContentsType + + public init(swift: TeamLog.MemberTransferAccountContentsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Internal only - fields for target team computations +@objc +public class DBXTeamLogMemberTransferredInternalFields: NSObject { + /// Internal only - team user was moved from. + @objc + public var sourceTeamId: String { swift.sourceTeamId } + /// Internal only - team user was moved to. + @objc + public var targetTeamId: String { swift.targetTeamId } + + @objc + public init(sourceTeamId: String, targetTeamId: String) { + self.swift = TeamLog.MemberTransferredInternalFields(sourceTeamId: sourceTeamId, targetTeamId: targetTeamId) + } + + let swift: TeamLog.MemberTransferredInternalFields + + public init(swift: TeamLog.MemberTransferredInternalFields) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled Microsoft Office add-in. +@objc +public class DBXTeamLogMicrosoftOfficeAddinChangePolicyDetails: NSObject { + /// New Microsoft Office addin policy. + @objc + public var newValue: DBXTeamLogMicrosoftOfficeAddinPolicy { DBXTeamLogMicrosoftOfficeAddinPolicy(swift: swift.newValue) } + /// Previous Microsoft Office addin policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogMicrosoftOfficeAddinPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogMicrosoftOfficeAddinPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogMicrosoftOfficeAddinPolicy, previousValue: DBXTeamLogMicrosoftOfficeAddinPolicy?) { + self.swift = TeamLog.MicrosoftOfficeAddinChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.MicrosoftOfficeAddinChangePolicyDetails + + public init(swift: TeamLog.MicrosoftOfficeAddinChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible MicrosoftOfficeAddinChangePolicyType struct +@objc +public class DBXTeamLogMicrosoftOfficeAddinChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.MicrosoftOfficeAddinChangePolicyType(description_: description_) + } + + let swift: TeamLog.MicrosoftOfficeAddinChangePolicyType + + public init(swift: TeamLog.MicrosoftOfficeAddinChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Microsoft Office addin policy +@objc +public class DBXTeamLogMicrosoftOfficeAddinPolicy: NSObject { + let swift: TeamLog.MicrosoftOfficeAddinPolicy + + public init(swift: TeamLog.MicrosoftOfficeAddinPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.MicrosoftOfficeAddinPolicy) -> DBXTeamLogMicrosoftOfficeAddinPolicy { + switch swift { + case .disabled: + return DBXTeamLogMicrosoftOfficeAddinPolicyDisabled() + case .enabled: + return DBXTeamLogMicrosoftOfficeAddinPolicyEnabled() + case .other: + return DBXTeamLogMicrosoftOfficeAddinPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogMicrosoftOfficeAddinPolicyDisabled? { + self as? DBXTeamLogMicrosoftOfficeAddinPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogMicrosoftOfficeAddinPolicyEnabled? { + self as? DBXTeamLogMicrosoftOfficeAddinPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogMicrosoftOfficeAddinPolicyOther? { + self as? DBXTeamLogMicrosoftOfficeAddinPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMicrosoftOfficeAddinPolicyDisabled: DBXTeamLogMicrosoftOfficeAddinPolicy { + @objc + public init() { + let swift = TeamLog.MicrosoftOfficeAddinPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMicrosoftOfficeAddinPolicyEnabled: DBXTeamLogMicrosoftOfficeAddinPolicy { + @objc + public init() { + let swift = TeamLog.MicrosoftOfficeAddinPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogMicrosoftOfficeAddinPolicyOther: DBXTeamLogMicrosoftOfficeAddinPolicy { + @objc + public init() { + let swift = TeamLog.MicrosoftOfficeAddinPolicy.other + super.init(swift: swift) + } +} + +/// An indication that an error occurred while retrieving the event. Some attributes of the event may be omitted as +/// a result. +@objc +public class DBXTeamLogMissingDetails: NSObject { + /// All the data that could be retrieved and converted from the source event. + @objc + public var sourceEventFields: String? { swift.sourceEventFields } + + @objc + public init(sourceEventFields: String?) { + self.swift = TeamLog.MissingDetails(sourceEventFields: sourceEventFields) + } + + let swift: TeamLog.MissingDetails + + public init(swift: TeamLog.MissingDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information about linked Dropbox mobile client sessions +@objc +public class DBXTeamLogMobileDeviceSessionLogInfo: DBXTeamLogDeviceSessionLogInfo { + /// Mobile session unique id. + @objc + public var sessionInfo: DBXTeamLogMobileSessionLogInfo? { guard let swift = subSwift.sessionInfo else { return nil } + return DBXTeamLogMobileSessionLogInfo(swift: swift) + } + + /// The device name. + @objc + public var deviceName: String { subSwift.deviceName } + /// The mobile application type. + @objc + public var clientType: DBXTeamMobileClientPlatform { DBXTeamMobileClientPlatform(swift: subSwift.clientType) } + /// The Dropbox client version. + @objc + public var clientVersion: String? { subSwift.clientVersion } + /// The hosting OS version. + @objc + public var osVersion: String? { subSwift.osVersion } + /// last carrier used by the device. + @objc + public var lastCarrier: String? { subSwift.lastCarrier } + + @objc + public init( + deviceName: String, + clientType: DBXTeamMobileClientPlatform, + ipAddress: String?, + created: Date?, + updated: Date?, + sessionInfo: DBXTeamLogMobileSessionLogInfo?, + clientVersion: String?, + osVersion: String?, + lastCarrier: String? + ) { + let swift = TeamLog.MobileDeviceSessionLogInfo( + deviceName: deviceName, + clientType: clientType.swift, + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo?.subSwift, + clientVersion: clientVersion, + osVersion: osVersion, + lastCarrier: lastCarrier + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: TeamLog.MobileDeviceSessionLogInfo + + public init(swift: TeamLog.MobileDeviceSessionLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Mobile session. +@objc +public class DBXTeamLogMobileSessionLogInfo: DBXTeamLogSessionLogInfo { + let subSwift: TeamLog.MobileSessionLogInfo + + public init(swift: TeamLog.MobileSessionLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Namespace relative path details. +@objc +public class DBXTeamLogNamespaceRelativePathLogInfo: NSObject { + /// Namespace ID. + @objc + public var nsId: String? { swift.nsId } + /// A path relative to the specified namespace ID. + @objc + public var relativePath: String? { swift.relativePath } + /// True if the namespace is shared. + @objc + public var isSharedNamespace: NSNumber? { swift.isSharedNamespace as NSNumber? } + + @objc + public init(nsId: String?, relativePath: String?, isSharedNamespace: NSNumber?) { + self.swift = TeamLog.NamespaceRelativePathLogInfo(nsId: nsId, relativePath: relativePath, isSharedNamespace: isSharedNamespace?.boolValue) + } + + let swift: TeamLog.NamespaceRelativePathLogInfo + + public init(swift: TeamLog.NamespaceRelativePathLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled network control. +@objc +public class DBXTeamLogNetworkControlChangePolicyDetails: NSObject { + /// New network control policy. + @objc + public var newValue: DBXTeamLogNetworkControlPolicy { DBXTeamLogNetworkControlPolicy(swift: swift.newValue) } + /// Previous network control policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogNetworkControlPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogNetworkControlPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogNetworkControlPolicy, previousValue: DBXTeamLogNetworkControlPolicy?) { + self.swift = TeamLog.NetworkControlChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.NetworkControlChangePolicyDetails + + public init(swift: TeamLog.NetworkControlChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NetworkControlChangePolicyType struct +@objc +public class DBXTeamLogNetworkControlChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NetworkControlChangePolicyType(description_: description_) + } + + let swift: TeamLog.NetworkControlChangePolicyType + + public init(swift: TeamLog.NetworkControlChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Network control policy +@objc +public class DBXTeamLogNetworkControlPolicy: NSObject { + let swift: TeamLog.NetworkControlPolicy + + public init(swift: TeamLog.NetworkControlPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.NetworkControlPolicy) -> DBXTeamLogNetworkControlPolicy { + switch swift { + case .disabled: + return DBXTeamLogNetworkControlPolicyDisabled() + case .enabled: + return DBXTeamLogNetworkControlPolicyEnabled() + case .other: + return DBXTeamLogNetworkControlPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogNetworkControlPolicyDisabled? { + self as? DBXTeamLogNetworkControlPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogNetworkControlPolicyEnabled? { + self as? DBXTeamLogNetworkControlPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogNetworkControlPolicyOther? { + self as? DBXTeamLogNetworkControlPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogNetworkControlPolicyDisabled: DBXTeamLogNetworkControlPolicy { + @objc + public init() { + let swift = TeamLog.NetworkControlPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogNetworkControlPolicyEnabled: DBXTeamLogNetworkControlPolicy { + @objc + public init() { + let swift = TeamLog.NetworkControlPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogNetworkControlPolicyOther: DBXTeamLogNetworkControlPolicy { + @objc + public init() { + let swift = TeamLog.NetworkControlPolicy.other + super.init(swift: swift) + } +} + +/// Report created: Links created with no expiration. +@objc +public class DBXTeamLogNoExpirationLinkGenCreateReportDetails: NSObject { + /// Report start date. + @objc + public var startDate: Date { swift.startDate } + /// Report end date. + @objc + public var endDate: Date { swift.endDate } + + @objc + public init(startDate: Date, endDate: Date) { + self.swift = TeamLog.NoExpirationLinkGenCreateReportDetails(startDate: startDate, endDate: endDate) + } + + let swift: TeamLog.NoExpirationLinkGenCreateReportDetails + + public init(swift: TeamLog.NoExpirationLinkGenCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoExpirationLinkGenCreateReportType struct +@objc +public class DBXTeamLogNoExpirationLinkGenCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoExpirationLinkGenCreateReportType(description_: description_) + } + + let swift: TeamLog.NoExpirationLinkGenCreateReportType + + public init(swift: TeamLog.NoExpirationLinkGenCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't create report: Links created with no expiration. +@objc +public class DBXTeamLogNoExpirationLinkGenReportFailedDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.NoExpirationLinkGenReportFailedDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.NoExpirationLinkGenReportFailedDetails + + public init(swift: TeamLog.NoExpirationLinkGenReportFailedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoExpirationLinkGenReportFailedType struct +@objc +public class DBXTeamLogNoExpirationLinkGenReportFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoExpirationLinkGenReportFailedType(description_: description_) + } + + let swift: TeamLog.NoExpirationLinkGenReportFailedType + + public init(swift: TeamLog.NoExpirationLinkGenReportFailedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Report created: Links created without passwords. +@objc +public class DBXTeamLogNoPasswordLinkGenCreateReportDetails: NSObject { + /// Report start date. + @objc + public var startDate: Date { swift.startDate } + /// Report end date. + @objc + public var endDate: Date { swift.endDate } + + @objc + public init(startDate: Date, endDate: Date) { + self.swift = TeamLog.NoPasswordLinkGenCreateReportDetails(startDate: startDate, endDate: endDate) + } + + let swift: TeamLog.NoPasswordLinkGenCreateReportDetails + + public init(swift: TeamLog.NoPasswordLinkGenCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoPasswordLinkGenCreateReportType struct +@objc +public class DBXTeamLogNoPasswordLinkGenCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoPasswordLinkGenCreateReportType(description_: description_) + } + + let swift: TeamLog.NoPasswordLinkGenCreateReportType + + public init(swift: TeamLog.NoPasswordLinkGenCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't create report: Links created without passwords. +@objc +public class DBXTeamLogNoPasswordLinkGenReportFailedDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.NoPasswordLinkGenReportFailedDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.NoPasswordLinkGenReportFailedDetails + + public init(swift: TeamLog.NoPasswordLinkGenReportFailedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoPasswordLinkGenReportFailedType struct +@objc +public class DBXTeamLogNoPasswordLinkGenReportFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoPasswordLinkGenReportFailedType(description_: description_) + } + + let swift: TeamLog.NoPasswordLinkGenReportFailedType + + public init(swift: TeamLog.NoPasswordLinkGenReportFailedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Report created: Views of links without passwords. +@objc +public class DBXTeamLogNoPasswordLinkViewCreateReportDetails: NSObject { + /// Report start date. + @objc + public var startDate: Date { swift.startDate } + /// Report end date. + @objc + public var endDate: Date { swift.endDate } + + @objc + public init(startDate: Date, endDate: Date) { + self.swift = TeamLog.NoPasswordLinkViewCreateReportDetails(startDate: startDate, endDate: endDate) + } + + let swift: TeamLog.NoPasswordLinkViewCreateReportDetails + + public init(swift: TeamLog.NoPasswordLinkViewCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoPasswordLinkViewCreateReportType struct +@objc +public class DBXTeamLogNoPasswordLinkViewCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoPasswordLinkViewCreateReportType(description_: description_) + } + + let swift: TeamLog.NoPasswordLinkViewCreateReportType + + public init(swift: TeamLog.NoPasswordLinkViewCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't create report: Views of links without passwords. +@objc +public class DBXTeamLogNoPasswordLinkViewReportFailedDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.NoPasswordLinkViewReportFailedDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.NoPasswordLinkViewReportFailedDetails + + public init(swift: TeamLog.NoPasswordLinkViewReportFailedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoPasswordLinkViewReportFailedType struct +@objc +public class DBXTeamLogNoPasswordLinkViewReportFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoPasswordLinkViewReportFailedType(description_: description_) + } + + let swift: TeamLog.NoPasswordLinkViewReportFailedType + + public init(swift: TeamLog.NoPasswordLinkViewReportFailedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// User's logged information. +@objc +public class DBXTeamLogUserLogInfo: NSObject { + /// User unique ID. + @objc + public var accountId: String? { swift.accountId } + /// User display name. + @objc + public var displayName: String? { swift.displayName } + /// User email address. + @objc + public var email: String? { swift.email } + + @objc + public init(accountId: String?, displayName: String?, email: String?) { + self.swift = TeamLog.UserLogInfo(accountId: accountId, displayName: displayName, email: email) + } + + let swift: TeamLog.UserLogInfo + + public init(swift: TeamLog.UserLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Non team member's logged information. +@objc +public class DBXTeamLogNonTeamMemberLogInfo: DBXTeamLogUserLogInfo { + let subSwift: TeamLog.NonTeamMemberLogInfo + + public init(swift: TeamLog.NonTeamMemberLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// The email to which the request was sent +@objc +public class DBXTeamLogNonTrustedTeamDetails: NSObject { + /// The email to which the request was sent. + @objc + public var team: String { swift.team } + + @objc + public init(team: String) { + self.swift = TeamLog.NonTrustedTeamDetails(team: team) + } + + let swift: TeamLog.NonTrustedTeamDetails + + public init(swift: TeamLog.NonTrustedTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed Paper doc to invite-only. +@objc +public class DBXTeamLogNoteAclInviteOnlyDetails: NSObject { + let swift: TeamLog.NoteAclInviteOnlyDetails + + public init(swift: TeamLog.NoteAclInviteOnlyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoteAclInviteOnlyType struct +@objc +public class DBXTeamLogNoteAclInviteOnlyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoteAclInviteOnlyType(description_: description_) + } + + let swift: TeamLog.NoteAclInviteOnlyType + + public init(swift: TeamLog.NoteAclInviteOnlyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed Paper doc to link-accessible. +@objc +public class DBXTeamLogNoteAclLinkDetails: NSObject { + let swift: TeamLog.NoteAclLinkDetails + + public init(swift: TeamLog.NoteAclLinkDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoteAclLinkType struct +@objc +public class DBXTeamLogNoteAclLinkType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoteAclLinkType(description_: description_) + } + + let swift: TeamLog.NoteAclLinkType + + public init(swift: TeamLog.NoteAclLinkType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed Paper doc to link-accessible for team. +@objc +public class DBXTeamLogNoteAclTeamLinkDetails: NSObject { + let swift: TeamLog.NoteAclTeamLinkDetails + + public init(swift: TeamLog.NoteAclTeamLinkDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoteAclTeamLinkType struct +@objc +public class DBXTeamLogNoteAclTeamLinkType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoteAclTeamLinkType(description_: description_) + } + + let swift: TeamLog.NoteAclTeamLinkType + + public init(swift: TeamLog.NoteAclTeamLinkType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared received Paper doc. +@objc +public class DBXTeamLogNoteShareReceiveDetails: NSObject { + let swift: TeamLog.NoteShareReceiveDetails + + public init(swift: TeamLog.NoteShareReceiveDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoteShareReceiveType struct +@objc +public class DBXTeamLogNoteShareReceiveType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoteShareReceiveType(description_: description_) + } + + let swift: TeamLog.NoteShareReceiveType + + public init(swift: TeamLog.NoteShareReceiveType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared Paper doc. +@objc +public class DBXTeamLogNoteSharedDetails: NSObject { + let swift: TeamLog.NoteSharedDetails + + public init(swift: TeamLog.NoteSharedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible NoteSharedType struct +@objc +public class DBXTeamLogNoteSharedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.NoteSharedType(description_: description_) + } + + let swift: TeamLog.NoteSharedType + + public init(swift: TeamLog.NoteSharedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added a label. +@objc +public class DBXTeamLogObjectLabelAddedDetails: NSObject { + /// Labels mark a file or folder. + @objc + public var labelType: DBXTeamLogLabelType { DBXTeamLogLabelType(swift: swift.labelType) } + + @objc + public init(labelType: DBXTeamLogLabelType) { + self.swift = TeamLog.ObjectLabelAddedDetails(labelType: labelType.swift) + } + + let swift: TeamLog.ObjectLabelAddedDetails + + public init(swift: TeamLog.ObjectLabelAddedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ObjectLabelAddedType struct +@objc +public class DBXTeamLogObjectLabelAddedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ObjectLabelAddedType(description_: description_) + } + + let swift: TeamLog.ObjectLabelAddedType + + public init(swift: TeamLog.ObjectLabelAddedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed a label. +@objc +public class DBXTeamLogObjectLabelRemovedDetails: NSObject { + /// Labels mark a file or folder. + @objc + public var labelType: DBXTeamLogLabelType { DBXTeamLogLabelType(swift: swift.labelType) } + + @objc + public init(labelType: DBXTeamLogLabelType) { + self.swift = TeamLog.ObjectLabelRemovedDetails(labelType: labelType.swift) + } + + let swift: TeamLog.ObjectLabelRemovedDetails + + public init(swift: TeamLog.ObjectLabelRemovedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ObjectLabelRemovedType struct +@objc +public class DBXTeamLogObjectLabelRemovedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ObjectLabelRemovedType(description_: description_) + } + + let swift: TeamLog.ObjectLabelRemovedType + + public init(swift: TeamLog.ObjectLabelRemovedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Updated a label's value. +@objc +public class DBXTeamLogObjectLabelUpdatedValueDetails: NSObject { + /// Labels mark a file or folder. + @objc + public var labelType: DBXTeamLogLabelType { DBXTeamLogLabelType(swift: swift.labelType) } + + @objc + public init(labelType: DBXTeamLogLabelType) { + self.swift = TeamLog.ObjectLabelUpdatedValueDetails(labelType: labelType.swift) + } + + let swift: TeamLog.ObjectLabelUpdatedValueDetails + + public init(swift: TeamLog.ObjectLabelUpdatedValueDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ObjectLabelUpdatedValueType struct +@objc +public class DBXTeamLogObjectLabelUpdatedValueType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ObjectLabelUpdatedValueType(description_: description_) + } + + let swift: TeamLog.ObjectLabelUpdatedValueType + + public init(swift: TeamLog.ObjectLabelUpdatedValueType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Opened shared Paper doc. +@objc +public class DBXTeamLogOpenNoteSharedDetails: NSObject { + let swift: TeamLog.OpenNoteSharedDetails + + public init(swift: TeamLog.OpenNoteSharedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible OpenNoteSharedType struct +@objc +public class DBXTeamLogOpenNoteSharedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.OpenNoteSharedType(description_: description_) + } + + let swift: TeamLog.OpenNoteSharedType + + public init(swift: TeamLog.OpenNoteSharedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// More details about the organization. +@objc +public class DBXTeamLogOrganizationDetails: NSObject { + /// The name of the organization. + @objc + public var organization: String { swift.organization } + + @objc + public init(organization: String) { + self.swift = TeamLog.OrganizationDetails(organization: organization) + } + + let swift: TeamLog.OrganizationDetails + + public init(swift: TeamLog.OrganizationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The name of the organization +@objc +public class DBXTeamLogOrganizationName: NSObject { + /// The name of the organization. + @objc + public var organization: String { swift.organization } + + @objc + public init(organization: String) { + self.swift = TeamLog.OrganizationName(organization: organization) + } + + let swift: TeamLog.OrganizationName + + public init(swift: TeamLog.OrganizationName) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Organized a folder with multi-file organize. +@objc +public class DBXTeamLogOrganizeFolderWithTidyDetails: NSObject { + let swift: TeamLog.OrganizeFolderWithTidyDetails + + public init(swift: TeamLog.OrganizeFolderWithTidyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible OrganizeFolderWithTidyType struct +@objc +public class DBXTeamLogOrganizeFolderWithTidyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.OrganizeFolderWithTidyType(description_: description_) + } + + let swift: TeamLog.OrganizeFolderWithTidyType + + public init(swift: TeamLog.OrganizeFolderWithTidyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The origin from which the actor performed the action. +@objc +public class DBXTeamLogOriginLogInfo: NSObject { + /// Geographic location details. + @objc + public var geoLocation: DBXTeamLogGeoLocationLogInfo? { guard let swift = swift.geoLocation else { return nil } + return DBXTeamLogGeoLocationLogInfo(swift: swift) + } + + /// The method that was used to perform the action. + @objc + public var accessMethod: DBXTeamLogAccessMethodLogInfo { DBXTeamLogAccessMethodLogInfo(swift: swift.accessMethod) } + + @objc + public init(accessMethod: DBXTeamLogAccessMethodLogInfo, geoLocation: DBXTeamLogGeoLocationLogInfo?) { + self.swift = TeamLog.OriginLogInfo(accessMethod: accessMethod.swift, geoLocation: geoLocation?.swift) + } + + let swift: TeamLog.OriginLogInfo + + public init(swift: TeamLog.OriginLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Report created: Views of old links. +@objc +public class DBXTeamLogOutdatedLinkViewCreateReportDetails: NSObject { + /// Report start date. + @objc + public var startDate: Date { swift.startDate } + /// Report end date. + @objc + public var endDate: Date { swift.endDate } + + @objc + public init(startDate: Date, endDate: Date) { + self.swift = TeamLog.OutdatedLinkViewCreateReportDetails(startDate: startDate, endDate: endDate) + } + + let swift: TeamLog.OutdatedLinkViewCreateReportDetails + + public init(swift: TeamLog.OutdatedLinkViewCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible OutdatedLinkViewCreateReportType struct +@objc +public class DBXTeamLogOutdatedLinkViewCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.OutdatedLinkViewCreateReportType(description_: description_) + } + + let swift: TeamLog.OutdatedLinkViewCreateReportType + + public init(swift: TeamLog.OutdatedLinkViewCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't create report: Views of old links. +@objc +public class DBXTeamLogOutdatedLinkViewReportFailedDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.OutdatedLinkViewReportFailedDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.OutdatedLinkViewReportFailedDetails + + public init(swift: TeamLog.OutdatedLinkViewReportFailedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible OutdatedLinkViewReportFailedType struct +@objc +public class DBXTeamLogOutdatedLinkViewReportFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.OutdatedLinkViewReportFailedType(description_: description_) + } + + let swift: TeamLog.OutdatedLinkViewReportFailedType + + public init(swift: TeamLog.OutdatedLinkViewReportFailedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperAccessType union +@objc +public class DBXTeamLogPaperAccessType: NSObject { + let swift: TeamLog.PaperAccessType + + public init(swift: TeamLog.PaperAccessType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PaperAccessType) -> DBXTeamLogPaperAccessType { + switch swift { + case .commenter: + return DBXTeamLogPaperAccessTypeCommenter() + case .editor: + return DBXTeamLogPaperAccessTypeEditor() + case .viewer: + return DBXTeamLogPaperAccessTypeViewer() + case .other: + return DBXTeamLogPaperAccessTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asCommenter: DBXTeamLogPaperAccessTypeCommenter? { + self as? DBXTeamLogPaperAccessTypeCommenter + } + + @objc + public var asEditor: DBXTeamLogPaperAccessTypeEditor? { + self as? DBXTeamLogPaperAccessTypeEditor + } + + @objc + public var asViewer: DBXTeamLogPaperAccessTypeViewer? { + self as? DBXTeamLogPaperAccessTypeViewer + } + + @objc + public var asOther: DBXTeamLogPaperAccessTypeOther? { + self as? DBXTeamLogPaperAccessTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperAccessTypeCommenter: DBXTeamLogPaperAccessType { + @objc + public init() { + let swift = TeamLog.PaperAccessType.commenter + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperAccessTypeEditor: DBXTeamLogPaperAccessType { + @objc + public init() { + let swift = TeamLog.PaperAccessType.editor + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperAccessTypeViewer: DBXTeamLogPaperAccessType { + @objc + public init() { + let swift = TeamLog.PaperAccessType.viewer + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperAccessTypeOther: DBXTeamLogPaperAccessType { + @objc + public init() { + let swift = TeamLog.PaperAccessType.other + super.init(swift: swift) + } +} + +/// Exported all team Paper docs. +@objc +public class DBXTeamLogPaperAdminExportStartDetails: NSObject { + let swift: TeamLog.PaperAdminExportStartDetails + + public init(swift: TeamLog.PaperAdminExportStartDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperAdminExportStartType struct +@objc +public class DBXTeamLogPaperAdminExportStartType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperAdminExportStartType(description_: description_) + } + + let swift: TeamLog.PaperAdminExportStartType + + public init(swift: TeamLog.PaperAdminExportStartType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether Dropbox Paper, when enabled, is deployed to all members or to specific members. +@objc +public class DBXTeamLogPaperChangeDeploymentPolicyDetails: NSObject { + /// New Dropbox Paper deployment policy. + @objc + public var newValue: DBXTeamPoliciesPaperDeploymentPolicy { DBXTeamPoliciesPaperDeploymentPolicy(swift: swift.newValue) } + /// Previous Dropbox Paper deployment policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamPoliciesPaperDeploymentPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesPaperDeploymentPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesPaperDeploymentPolicy, previousValue: DBXTeamPoliciesPaperDeploymentPolicy?) { + self.swift = TeamLog.PaperChangeDeploymentPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.PaperChangeDeploymentPolicyDetails + + public init(swift: TeamLog.PaperChangeDeploymentPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperChangeDeploymentPolicyType struct +@objc +public class DBXTeamLogPaperChangeDeploymentPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperChangeDeploymentPolicyType(description_: description_) + } + + let swift: TeamLog.PaperChangeDeploymentPolicyType + + public init(swift: TeamLog.PaperChangeDeploymentPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether non-members can view Paper docs with link. +@objc +public class DBXTeamLogPaperChangeMemberLinkPolicyDetails: NSObject { + /// New paper external link accessibility policy. + @objc + public var newValue: DBXTeamLogPaperMemberPolicy { DBXTeamLogPaperMemberPolicy(swift: swift.newValue) } + + @objc + public init(newValue: DBXTeamLogPaperMemberPolicy) { + self.swift = TeamLog.PaperChangeMemberLinkPolicyDetails(newValue: newValue.swift) + } + + let swift: TeamLog.PaperChangeMemberLinkPolicyDetails + + public init(swift: TeamLog.PaperChangeMemberLinkPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperChangeMemberLinkPolicyType struct +@objc +public class DBXTeamLogPaperChangeMemberLinkPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperChangeMemberLinkPolicyType(description_: description_) + } + + let swift: TeamLog.PaperChangeMemberLinkPolicyType + + public init(swift: TeamLog.PaperChangeMemberLinkPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether members can share Paper docs outside team, and if docs are accessible only by team members or +/// anyone by default. +@objc +public class DBXTeamLogPaperChangeMemberPolicyDetails: NSObject { + /// New paper external accessibility policy. + @objc + public var newValue: DBXTeamLogPaperMemberPolicy { DBXTeamLogPaperMemberPolicy(swift: swift.newValue) } + /// Previous paper external accessibility policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogPaperMemberPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogPaperMemberPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogPaperMemberPolicy, previousValue: DBXTeamLogPaperMemberPolicy?) { + self.swift = TeamLog.PaperChangeMemberPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.PaperChangeMemberPolicyDetails + + public init(swift: TeamLog.PaperChangeMemberPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperChangeMemberPolicyType struct +@objc +public class DBXTeamLogPaperChangeMemberPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperChangeMemberPolicyType(description_: description_) + } + + let swift: TeamLog.PaperChangeMemberPolicyType + + public init(swift: TeamLog.PaperChangeMemberPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled Dropbox Paper for team. +@objc +public class DBXTeamLogPaperChangePolicyDetails: NSObject { + /// New Dropbox Paper policy. + @objc + public var newValue: DBXTeamPoliciesPaperEnabledPolicy { DBXTeamPoliciesPaperEnabledPolicy(swift: swift.newValue) } + /// Previous Dropbox Paper policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamPoliciesPaperEnabledPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesPaperEnabledPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesPaperEnabledPolicy, previousValue: DBXTeamPoliciesPaperEnabledPolicy?) { + self.swift = TeamLog.PaperChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.PaperChangePolicyDetails + + public init(swift: TeamLog.PaperChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperChangePolicyType struct +@objc +public class DBXTeamLogPaperChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperChangePolicyType(description_: description_) + } + + let swift: TeamLog.PaperChangePolicyType + + public init(swift: TeamLog.PaperChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added users and/or groups to Paper doc/folder. +@objc +public class DBXTeamLogPaperContentAddMemberDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperContentAddMemberDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperContentAddMemberDetails + + public init(swift: TeamLog.PaperContentAddMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentAddMemberType struct +@objc +public class DBXTeamLogPaperContentAddMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentAddMemberType(description_: description_) + } + + let swift: TeamLog.PaperContentAddMemberType + + public init(swift: TeamLog.PaperContentAddMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added Paper doc/folder to folder. +@objc +public class DBXTeamLogPaperContentAddToFolderDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Parent asset position in the Assets list. + @objc + public var parentAssetIndex: NSNumber { swift.parentAssetIndex as NSNumber } + + @objc + public init(eventUuid: String, targetAssetIndex: NSNumber, parentAssetIndex: NSNumber) { + self.swift = TeamLog.PaperContentAddToFolderDetails( + eventUuid: eventUuid, + targetAssetIndex: targetAssetIndex.uint64Value, + parentAssetIndex: parentAssetIndex.uint64Value + ) + } + + let swift: TeamLog.PaperContentAddToFolderDetails + + public init(swift: TeamLog.PaperContentAddToFolderDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentAddToFolderType struct +@objc +public class DBXTeamLogPaperContentAddToFolderType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentAddToFolderType(description_: description_) + } + + let swift: TeamLog.PaperContentAddToFolderType + + public init(swift: TeamLog.PaperContentAddToFolderType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Archived Paper doc/folder. +@objc +public class DBXTeamLogPaperContentArchiveDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperContentArchiveDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperContentArchiveDetails + + public init(swift: TeamLog.PaperContentArchiveDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentArchiveType struct +@objc +public class DBXTeamLogPaperContentArchiveType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentArchiveType(description_: description_) + } + + let swift: TeamLog.PaperContentArchiveType + + public init(swift: TeamLog.PaperContentArchiveType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created Paper doc/folder. +@objc +public class DBXTeamLogPaperContentCreateDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperContentCreateDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperContentCreateDetails + + public init(swift: TeamLog.PaperContentCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentCreateType struct +@objc +public class DBXTeamLogPaperContentCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentCreateType(description_: description_) + } + + let swift: TeamLog.PaperContentCreateType + + public init(swift: TeamLog.PaperContentCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Permanently deleted Paper doc/folder. +@objc +public class DBXTeamLogPaperContentPermanentlyDeleteDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperContentPermanentlyDeleteDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperContentPermanentlyDeleteDetails + + public init(swift: TeamLog.PaperContentPermanentlyDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentPermanentlyDeleteType struct +@objc +public class DBXTeamLogPaperContentPermanentlyDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentPermanentlyDeleteType(description_: description_) + } + + let swift: TeamLog.PaperContentPermanentlyDeleteType + + public init(swift: TeamLog.PaperContentPermanentlyDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed Paper doc/folder from folder. +@objc +public class DBXTeamLogPaperContentRemoveFromFolderDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber? { swift.targetAssetIndex as NSNumber? } + /// Parent asset position in the Assets list. + @objc + public var parentAssetIndex: NSNumber? { swift.parentAssetIndex as NSNumber? } + + @objc + public init(eventUuid: String, targetAssetIndex: NSNumber?, parentAssetIndex: NSNumber?) { + self.swift = TeamLog.PaperContentRemoveFromFolderDetails( + eventUuid: eventUuid, + targetAssetIndex: targetAssetIndex?.uint64Value, + parentAssetIndex: parentAssetIndex?.uint64Value + ) + } + + let swift: TeamLog.PaperContentRemoveFromFolderDetails + + public init(swift: TeamLog.PaperContentRemoveFromFolderDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentRemoveFromFolderType struct +@objc +public class DBXTeamLogPaperContentRemoveFromFolderType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentRemoveFromFolderType(description_: description_) + } + + let swift: TeamLog.PaperContentRemoveFromFolderType + + public init(swift: TeamLog.PaperContentRemoveFromFolderType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed users and/or groups from Paper doc/folder. +@objc +public class DBXTeamLogPaperContentRemoveMemberDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperContentRemoveMemberDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperContentRemoveMemberDetails + + public init(swift: TeamLog.PaperContentRemoveMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentRemoveMemberType struct +@objc +public class DBXTeamLogPaperContentRemoveMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentRemoveMemberType(description_: description_) + } + + let swift: TeamLog.PaperContentRemoveMemberType + + public init(swift: TeamLog.PaperContentRemoveMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed Paper doc/folder. +@objc +public class DBXTeamLogPaperContentRenameDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperContentRenameDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperContentRenameDetails + + public init(swift: TeamLog.PaperContentRenameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentRenameType struct +@objc +public class DBXTeamLogPaperContentRenameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentRenameType(description_: description_) + } + + let swift: TeamLog.PaperContentRenameType + + public init(swift: TeamLog.PaperContentRenameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored archived Paper doc/folder. +@objc +public class DBXTeamLogPaperContentRestoreDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperContentRestoreDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperContentRestoreDetails + + public init(swift: TeamLog.PaperContentRestoreDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperContentRestoreType struct +@objc +public class DBXTeamLogPaperContentRestoreType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperContentRestoreType(description_: description_) + } + + let swift: TeamLog.PaperContentRestoreType + + public init(swift: TeamLog.PaperContentRestoreType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy to set default access for newly created Paper folders. +@objc +public class DBXTeamLogPaperDefaultFolderPolicy: NSObject { + let swift: TeamLog.PaperDefaultFolderPolicy + + public init(swift: TeamLog.PaperDefaultFolderPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PaperDefaultFolderPolicy) -> DBXTeamLogPaperDefaultFolderPolicy { + switch swift { + case .everyoneInTeam: + return DBXTeamLogPaperDefaultFolderPolicyEveryoneInTeam() + case .inviteOnly: + return DBXTeamLogPaperDefaultFolderPolicyInviteOnly() + case .other: + return DBXTeamLogPaperDefaultFolderPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEveryoneInTeam: DBXTeamLogPaperDefaultFolderPolicyEveryoneInTeam? { + self as? DBXTeamLogPaperDefaultFolderPolicyEveryoneInTeam + } + + @objc + public var asInviteOnly: DBXTeamLogPaperDefaultFolderPolicyInviteOnly? { + self as? DBXTeamLogPaperDefaultFolderPolicyInviteOnly + } + + @objc + public var asOther: DBXTeamLogPaperDefaultFolderPolicyOther? { + self as? DBXTeamLogPaperDefaultFolderPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDefaultFolderPolicyEveryoneInTeam: DBXTeamLogPaperDefaultFolderPolicy { + @objc + public init() { + let swift = TeamLog.PaperDefaultFolderPolicy.everyoneInTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDefaultFolderPolicyInviteOnly: DBXTeamLogPaperDefaultFolderPolicy { + @objc + public init() { + let swift = TeamLog.PaperDefaultFolderPolicy.inviteOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDefaultFolderPolicyOther: DBXTeamLogPaperDefaultFolderPolicy { + @objc + public init() { + let swift = TeamLog.PaperDefaultFolderPolicy.other + super.init(swift: swift) + } +} + +/// Changed Paper Default Folder Policy setting for team. +@objc +public class DBXTeamLogPaperDefaultFolderPolicyChangedDetails: NSObject { + /// New Paper Default Folder Policy. + @objc + public var newValue: DBXTeamLogPaperDefaultFolderPolicy { DBXTeamLogPaperDefaultFolderPolicy(swift: swift.newValue) } + /// Previous Paper Default Folder Policy. + @objc + public var previousValue: DBXTeamLogPaperDefaultFolderPolicy { DBXTeamLogPaperDefaultFolderPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogPaperDefaultFolderPolicy, previousValue: DBXTeamLogPaperDefaultFolderPolicy) { + self.swift = TeamLog.PaperDefaultFolderPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.PaperDefaultFolderPolicyChangedDetails + + public init(swift: TeamLog.PaperDefaultFolderPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDefaultFolderPolicyChangedType struct +@objc +public class DBXTeamLogPaperDefaultFolderPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDefaultFolderPolicyChangedType(description_: description_) + } + + let swift: TeamLog.PaperDefaultFolderPolicyChangedType + + public init(swift: TeamLog.PaperDefaultFolderPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling if team members can use Paper Desktop +@objc +public class DBXTeamLogPaperDesktopPolicy: NSObject { + let swift: TeamLog.PaperDesktopPolicy + + public init(swift: TeamLog.PaperDesktopPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PaperDesktopPolicy) -> DBXTeamLogPaperDesktopPolicy { + switch swift { + case .disabled: + return DBXTeamLogPaperDesktopPolicyDisabled() + case .enabled: + return DBXTeamLogPaperDesktopPolicyEnabled() + case .other: + return DBXTeamLogPaperDesktopPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogPaperDesktopPolicyDisabled? { + self as? DBXTeamLogPaperDesktopPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogPaperDesktopPolicyEnabled? { + self as? DBXTeamLogPaperDesktopPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogPaperDesktopPolicyOther? { + self as? DBXTeamLogPaperDesktopPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDesktopPolicyDisabled: DBXTeamLogPaperDesktopPolicy { + @objc + public init() { + let swift = TeamLog.PaperDesktopPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDesktopPolicyEnabled: DBXTeamLogPaperDesktopPolicy { + @objc + public init() { + let swift = TeamLog.PaperDesktopPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDesktopPolicyOther: DBXTeamLogPaperDesktopPolicy { + @objc + public init() { + let swift = TeamLog.PaperDesktopPolicy.other + super.init(swift: swift) + } +} + +/// Enabled/disabled Paper Desktop for team. +@objc +public class DBXTeamLogPaperDesktopPolicyChangedDetails: NSObject { + /// New Paper Desktop policy. + @objc + public var newValue: DBXTeamLogPaperDesktopPolicy { DBXTeamLogPaperDesktopPolicy(swift: swift.newValue) } + /// Previous Paper Desktop policy. + @objc + public var previousValue: DBXTeamLogPaperDesktopPolicy { DBXTeamLogPaperDesktopPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogPaperDesktopPolicy, previousValue: DBXTeamLogPaperDesktopPolicy) { + self.swift = TeamLog.PaperDesktopPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.PaperDesktopPolicyChangedDetails + + public init(swift: TeamLog.PaperDesktopPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDesktopPolicyChangedType struct +@objc +public class DBXTeamLogPaperDesktopPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDesktopPolicyChangedType(description_: description_) + } + + let swift: TeamLog.PaperDesktopPolicyChangedType + + public init(swift: TeamLog.PaperDesktopPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added Paper doc comment. +@objc +public class DBXTeamLogPaperDocAddCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.PaperDocAddCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.PaperDocAddCommentDetails + + public init(swift: TeamLog.PaperDocAddCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocAddCommentType struct +@objc +public class DBXTeamLogPaperDocAddCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocAddCommentType(description_: description_) + } + + let swift: TeamLog.PaperDocAddCommentType + + public init(swift: TeamLog.PaperDocAddCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed member permissions for Paper doc. +@objc +public class DBXTeamLogPaperDocChangeMemberRoleDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Paper doc access type. + @objc + public var accessType: DBXTeamLogPaperAccessType { DBXTeamLogPaperAccessType(swift: swift.accessType) } + + @objc + public init(eventUuid: String, accessType: DBXTeamLogPaperAccessType) { + self.swift = TeamLog.PaperDocChangeMemberRoleDetails(eventUuid: eventUuid, accessType: accessType.swift) + } + + let swift: TeamLog.PaperDocChangeMemberRoleDetails + + public init(swift: TeamLog.PaperDocChangeMemberRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocChangeMemberRoleType struct +@objc +public class DBXTeamLogPaperDocChangeMemberRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocChangeMemberRoleType(description_: description_) + } + + let swift: TeamLog.PaperDocChangeMemberRoleType + + public init(swift: TeamLog.PaperDocChangeMemberRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed sharing setting for Paper doc. +@objc +public class DBXTeamLogPaperDocChangeSharingPolicyDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Sharing policy with external users. + @objc + public var publicSharingPolicy: String? { swift.publicSharingPolicy } + /// Sharing policy with team. + @objc + public var teamSharingPolicy: String? { swift.teamSharingPolicy } + + @objc + public init(eventUuid: String, publicSharingPolicy: String?, teamSharingPolicy: String?) { + self.swift = TeamLog.PaperDocChangeSharingPolicyDetails( + eventUuid: eventUuid, + publicSharingPolicy: publicSharingPolicy, + teamSharingPolicy: teamSharingPolicy + ) + } + + let swift: TeamLog.PaperDocChangeSharingPolicyDetails + + public init(swift: TeamLog.PaperDocChangeSharingPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocChangeSharingPolicyType struct +@objc +public class DBXTeamLogPaperDocChangeSharingPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocChangeSharingPolicyType(description_: description_) + } + + let swift: TeamLog.PaperDocChangeSharingPolicyType + + public init(swift: TeamLog.PaperDocChangeSharingPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Followed/unfollowed Paper doc. +@objc +public class DBXTeamLogPaperDocChangeSubscriptionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// New doc subscription level. + @objc + public var newSubscriptionLevel: String { swift.newSubscriptionLevel } + /// Previous doc subscription level. Might be missing due to historical data gap. + @objc + public var previousSubscriptionLevel: String? { swift.previousSubscriptionLevel } + + @objc + public init(eventUuid: String, newSubscriptionLevel: String, previousSubscriptionLevel: String?) { + self.swift = TeamLog.PaperDocChangeSubscriptionDetails( + eventUuid: eventUuid, + newSubscriptionLevel: newSubscriptionLevel, + previousSubscriptionLevel: previousSubscriptionLevel + ) + } + + let swift: TeamLog.PaperDocChangeSubscriptionDetails + + public init(swift: TeamLog.PaperDocChangeSubscriptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocChangeSubscriptionType struct +@objc +public class DBXTeamLogPaperDocChangeSubscriptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocChangeSubscriptionType(description_: description_) + } + + let swift: TeamLog.PaperDocChangeSubscriptionType + + public init(swift: TeamLog.PaperDocChangeSubscriptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted Paper doc comment. +@objc +public class DBXTeamLogPaperDocDeleteCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.PaperDocDeleteCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.PaperDocDeleteCommentDetails + + public init(swift: TeamLog.PaperDocDeleteCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocDeleteCommentType struct +@objc +public class DBXTeamLogPaperDocDeleteCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocDeleteCommentType(description_: description_) + } + + let swift: TeamLog.PaperDocDeleteCommentType + + public init(swift: TeamLog.PaperDocDeleteCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Archived Paper doc. +@objc +public class DBXTeamLogPaperDocDeletedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocDeletedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocDeletedDetails + + public init(swift: TeamLog.PaperDocDeletedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocDeletedType struct +@objc +public class DBXTeamLogPaperDocDeletedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocDeletedType(description_: description_) + } + + let swift: TeamLog.PaperDocDeletedType + + public init(swift: TeamLog.PaperDocDeletedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downloaded Paper doc in specific format. +@objc +public class DBXTeamLogPaperDocDownloadDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Export file format. + @objc + public var exportFileFormat: DBXTeamLogPaperDownloadFormat { DBXTeamLogPaperDownloadFormat(swift: swift.exportFileFormat) } + + @objc + public init(eventUuid: String, exportFileFormat: DBXTeamLogPaperDownloadFormat) { + self.swift = TeamLog.PaperDocDownloadDetails(eventUuid: eventUuid, exportFileFormat: exportFileFormat.swift) + } + + let swift: TeamLog.PaperDocDownloadDetails + + public init(swift: TeamLog.PaperDocDownloadDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocDownloadType struct +@objc +public class DBXTeamLogPaperDocDownloadType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocDownloadType(description_: description_) + } + + let swift: TeamLog.PaperDocDownloadType + + public init(swift: TeamLog.PaperDocDownloadType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited Paper doc comment. +@objc +public class DBXTeamLogPaperDocEditCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.PaperDocEditCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.PaperDocEditCommentDetails + + public init(swift: TeamLog.PaperDocEditCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocEditCommentType struct +@objc +public class DBXTeamLogPaperDocEditCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocEditCommentType(description_: description_) + } + + let swift: TeamLog.PaperDocEditCommentType + + public init(swift: TeamLog.PaperDocEditCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited Paper doc. +@objc +public class DBXTeamLogPaperDocEditDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocEditDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocEditDetails + + public init(swift: TeamLog.PaperDocEditDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocEditType struct +@objc +public class DBXTeamLogPaperDocEditType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocEditType(description_: description_) + } + + let swift: TeamLog.PaperDocEditType + + public init(swift: TeamLog.PaperDocEditType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Followed Paper doc. +@objc +public class DBXTeamLogPaperDocFollowedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocFollowedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocFollowedDetails + + public init(swift: TeamLog.PaperDocFollowedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocFollowedType struct +@objc +public class DBXTeamLogPaperDocFollowedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocFollowedType(description_: description_) + } + + let swift: TeamLog.PaperDocFollowedType + + public init(swift: TeamLog.PaperDocFollowedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Mentioned user in Paper doc. +@objc +public class DBXTeamLogPaperDocMentionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocMentionDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocMentionDetails + + public init(swift: TeamLog.PaperDocMentionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocMentionType struct +@objc +public class DBXTeamLogPaperDocMentionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocMentionType(description_: description_) + } + + let swift: TeamLog.PaperDocMentionType + + public init(swift: TeamLog.PaperDocMentionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Transferred ownership of Paper doc. +@objc +public class DBXTeamLogPaperDocOwnershipChangedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Previous owner. + @objc + public var oldOwnerUserId: String? { swift.oldOwnerUserId } + /// New owner. + @objc + public var newOwnerUserId: String { swift.newOwnerUserId } + + @objc + public init(eventUuid: String, newOwnerUserId: String, oldOwnerUserId: String?) { + self.swift = TeamLog.PaperDocOwnershipChangedDetails(eventUuid: eventUuid, newOwnerUserId: newOwnerUserId, oldOwnerUserId: oldOwnerUserId) + } + + let swift: TeamLog.PaperDocOwnershipChangedDetails + + public init(swift: TeamLog.PaperDocOwnershipChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocOwnershipChangedType struct +@objc +public class DBXTeamLogPaperDocOwnershipChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocOwnershipChangedType(description_: description_) + } + + let swift: TeamLog.PaperDocOwnershipChangedType + + public init(swift: TeamLog.PaperDocOwnershipChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Requested access to Paper doc. +@objc +public class DBXTeamLogPaperDocRequestAccessDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocRequestAccessDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocRequestAccessDetails + + public init(swift: TeamLog.PaperDocRequestAccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocRequestAccessType struct +@objc +public class DBXTeamLogPaperDocRequestAccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocRequestAccessType(description_: description_) + } + + let swift: TeamLog.PaperDocRequestAccessType + + public init(swift: TeamLog.PaperDocRequestAccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Resolved Paper doc comment. +@objc +public class DBXTeamLogPaperDocResolveCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.PaperDocResolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.PaperDocResolveCommentDetails + + public init(swift: TeamLog.PaperDocResolveCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocResolveCommentType struct +@objc +public class DBXTeamLogPaperDocResolveCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocResolveCommentType(description_: description_) + } + + let swift: TeamLog.PaperDocResolveCommentType + + public init(swift: TeamLog.PaperDocResolveCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored Paper doc to previous version. +@objc +public class DBXTeamLogPaperDocRevertDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocRevertDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocRevertDetails + + public init(swift: TeamLog.PaperDocRevertDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocRevertType struct +@objc +public class DBXTeamLogPaperDocRevertType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocRevertType(description_: description_) + } + + let swift: TeamLog.PaperDocRevertType + + public init(swift: TeamLog.PaperDocRevertType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared Paper doc via Slack. +@objc +public class DBXTeamLogPaperDocSlackShareDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocSlackShareDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocSlackShareDetails + + public init(swift: TeamLog.PaperDocSlackShareDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocSlackShareType struct +@objc +public class DBXTeamLogPaperDocSlackShareType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocSlackShareType(description_: description_) + } + + let swift: TeamLog.PaperDocSlackShareType + + public init(swift: TeamLog.PaperDocSlackShareType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared Paper doc with users and/or groups. +@objc +public class DBXTeamLogPaperDocTeamInviteDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocTeamInviteDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocTeamInviteDetails + + public init(swift: TeamLog.PaperDocTeamInviteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocTeamInviteType struct +@objc +public class DBXTeamLogPaperDocTeamInviteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocTeamInviteType(description_: description_) + } + + let swift: TeamLog.PaperDocTeamInviteType + + public init(swift: TeamLog.PaperDocTeamInviteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted Paper doc. +@objc +public class DBXTeamLogPaperDocTrashedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocTrashedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocTrashedDetails + + public init(swift: TeamLog.PaperDocTrashedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocTrashedType struct +@objc +public class DBXTeamLogPaperDocTrashedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocTrashedType(description_: description_) + } + + let swift: TeamLog.PaperDocTrashedType + + public init(swift: TeamLog.PaperDocTrashedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unresolved Paper doc comment. +@objc +public class DBXTeamLogPaperDocUnresolveCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.PaperDocUnresolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.PaperDocUnresolveCommentDetails + + public init(swift: TeamLog.PaperDocUnresolveCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocUnresolveCommentType struct +@objc +public class DBXTeamLogPaperDocUnresolveCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocUnresolveCommentType(description_: description_) + } + + let swift: TeamLog.PaperDocUnresolveCommentType + + public init(swift: TeamLog.PaperDocUnresolveCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored Paper doc. +@objc +public class DBXTeamLogPaperDocUntrashedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocUntrashedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocUntrashedDetails + + public init(swift: TeamLog.PaperDocUntrashedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocUntrashedType struct +@objc +public class DBXTeamLogPaperDocUntrashedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocUntrashedType(description_: description_) + } + + let swift: TeamLog.PaperDocUntrashedType + + public init(swift: TeamLog.PaperDocUntrashedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Viewed Paper doc. +@objc +public class DBXTeamLogPaperDocViewDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperDocViewDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperDocViewDetails + + public init(swift: TeamLog.PaperDocViewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDocViewType struct +@objc +public class DBXTeamLogPaperDocViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperDocViewType(description_: description_) + } + + let swift: TeamLog.PaperDocViewType + + public init(swift: TeamLog.PaperDocViewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Paper document's logged information. +@objc +public class DBXTeamLogPaperDocumentLogInfo: NSObject { + /// Papers document Id. + @objc + public var docId: String { swift.docId } + /// Paper document title. + @objc + public var docTitle: String { swift.docTitle } + + @objc + public init(docId: String, docTitle: String) { + self.swift = TeamLog.PaperDocumentLogInfo(docId: docId, docTitle: docTitle) + } + + let swift: TeamLog.PaperDocumentLogInfo + + public init(swift: TeamLog.PaperDocumentLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperDownloadFormat union +@objc +public class DBXTeamLogPaperDownloadFormat: NSObject { + let swift: TeamLog.PaperDownloadFormat + + public init(swift: TeamLog.PaperDownloadFormat) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PaperDownloadFormat) -> DBXTeamLogPaperDownloadFormat { + switch swift { + case .docx: + return DBXTeamLogPaperDownloadFormatDocx() + case .html: + return DBXTeamLogPaperDownloadFormatHtml() + case .markdown: + return DBXTeamLogPaperDownloadFormatMarkdown() + case .pdf: + return DBXTeamLogPaperDownloadFormatPdf() + case .other: + return DBXTeamLogPaperDownloadFormatOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDocx: DBXTeamLogPaperDownloadFormatDocx? { + self as? DBXTeamLogPaperDownloadFormatDocx + } + + @objc + public var asHtml: DBXTeamLogPaperDownloadFormatHtml? { + self as? DBXTeamLogPaperDownloadFormatHtml + } + + @objc + public var asMarkdown: DBXTeamLogPaperDownloadFormatMarkdown? { + self as? DBXTeamLogPaperDownloadFormatMarkdown + } + + @objc + public var asPdf: DBXTeamLogPaperDownloadFormatPdf? { + self as? DBXTeamLogPaperDownloadFormatPdf + } + + @objc + public var asOther: DBXTeamLogPaperDownloadFormatOther? { + self as? DBXTeamLogPaperDownloadFormatOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDownloadFormatDocx: DBXTeamLogPaperDownloadFormat { + @objc + public init() { + let swift = TeamLog.PaperDownloadFormat.docx + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDownloadFormatHtml: DBXTeamLogPaperDownloadFormat { + @objc + public init() { + let swift = TeamLog.PaperDownloadFormat.html + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDownloadFormatMarkdown: DBXTeamLogPaperDownloadFormat { + @objc + public init() { + let swift = TeamLog.PaperDownloadFormat.markdown + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDownloadFormatPdf: DBXTeamLogPaperDownloadFormat { + @objc + public init() { + let swift = TeamLog.PaperDownloadFormat.pdf + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperDownloadFormatOther: DBXTeamLogPaperDownloadFormat { + @objc + public init() { + let swift = TeamLog.PaperDownloadFormat.other + super.init(swift: swift) + } +} + +/// Added users to Paper-enabled users list. +@objc +public class DBXTeamLogPaperEnabledUsersGroupAdditionDetails: NSObject { + let swift: TeamLog.PaperEnabledUsersGroupAdditionDetails + + public init(swift: TeamLog.PaperEnabledUsersGroupAdditionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperEnabledUsersGroupAdditionType struct +@objc +public class DBXTeamLogPaperEnabledUsersGroupAdditionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperEnabledUsersGroupAdditionType(description_: description_) + } + + let swift: TeamLog.PaperEnabledUsersGroupAdditionType + + public init(swift: TeamLog.PaperEnabledUsersGroupAdditionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed users from Paper-enabled users list. +@objc +public class DBXTeamLogPaperEnabledUsersGroupRemovalDetails: NSObject { + let swift: TeamLog.PaperEnabledUsersGroupRemovalDetails + + public init(swift: TeamLog.PaperEnabledUsersGroupRemovalDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperEnabledUsersGroupRemovalType struct +@objc +public class DBXTeamLogPaperEnabledUsersGroupRemovalType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperEnabledUsersGroupRemovalType(description_: description_) + } + + let swift: TeamLog.PaperEnabledUsersGroupRemovalType + + public init(swift: TeamLog.PaperEnabledUsersGroupRemovalType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed Paper external sharing setting to anyone. +@objc +public class DBXTeamLogPaperExternalViewAllowDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperExternalViewAllowDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperExternalViewAllowDetails + + public init(swift: TeamLog.PaperExternalViewAllowDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperExternalViewAllowType struct +@objc +public class DBXTeamLogPaperExternalViewAllowType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperExternalViewAllowType(description_: description_) + } + + let swift: TeamLog.PaperExternalViewAllowType + + public init(swift: TeamLog.PaperExternalViewAllowType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed Paper external sharing setting to default team. +@objc +public class DBXTeamLogPaperExternalViewDefaultTeamDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperExternalViewDefaultTeamDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperExternalViewDefaultTeamDetails + + public init(swift: TeamLog.PaperExternalViewDefaultTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperExternalViewDefaultTeamType struct +@objc +public class DBXTeamLogPaperExternalViewDefaultTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperExternalViewDefaultTeamType(description_: description_) + } + + let swift: TeamLog.PaperExternalViewDefaultTeamType + + public init(swift: TeamLog.PaperExternalViewDefaultTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed Paper external sharing setting to team-only. +@objc +public class DBXTeamLogPaperExternalViewForbidDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperExternalViewForbidDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperExternalViewForbidDetails + + public init(swift: TeamLog.PaperExternalViewForbidDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperExternalViewForbidType struct +@objc +public class DBXTeamLogPaperExternalViewForbidType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperExternalViewForbidType(description_: description_) + } + + let swift: TeamLog.PaperExternalViewForbidType + + public init(swift: TeamLog.PaperExternalViewForbidType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Followed/unfollowed Paper folder. +@objc +public class DBXTeamLogPaperFolderChangeSubscriptionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// New folder subscription level. + @objc + public var newSubscriptionLevel: String { swift.newSubscriptionLevel } + /// Previous folder subscription level. Might be missing due to historical data gap. + @objc + public var previousSubscriptionLevel: String? { swift.previousSubscriptionLevel } + + @objc + public init(eventUuid: String, newSubscriptionLevel: String, previousSubscriptionLevel: String?) { + self.swift = TeamLog.PaperFolderChangeSubscriptionDetails( + eventUuid: eventUuid, + newSubscriptionLevel: newSubscriptionLevel, + previousSubscriptionLevel: previousSubscriptionLevel + ) + } + + let swift: TeamLog.PaperFolderChangeSubscriptionDetails + + public init(swift: TeamLog.PaperFolderChangeSubscriptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperFolderChangeSubscriptionType struct +@objc +public class DBXTeamLogPaperFolderChangeSubscriptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperFolderChangeSubscriptionType(description_: description_) + } + + let swift: TeamLog.PaperFolderChangeSubscriptionType + + public init(swift: TeamLog.PaperFolderChangeSubscriptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Archived Paper folder. +@objc +public class DBXTeamLogPaperFolderDeletedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperFolderDeletedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperFolderDeletedDetails + + public init(swift: TeamLog.PaperFolderDeletedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperFolderDeletedType struct +@objc +public class DBXTeamLogPaperFolderDeletedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperFolderDeletedType(description_: description_) + } + + let swift: TeamLog.PaperFolderDeletedType + + public init(swift: TeamLog.PaperFolderDeletedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Followed Paper folder. +@objc +public class DBXTeamLogPaperFolderFollowedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperFolderFollowedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperFolderFollowedDetails + + public init(swift: TeamLog.PaperFolderFollowedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperFolderFollowedType struct +@objc +public class DBXTeamLogPaperFolderFollowedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperFolderFollowedType(description_: description_) + } + + let swift: TeamLog.PaperFolderFollowedType + + public init(swift: TeamLog.PaperFolderFollowedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Paper folder's logged information. +@objc +public class DBXTeamLogPaperFolderLogInfo: NSObject { + /// Papers folder Id. + @objc + public var folderId: String { swift.folderId } + /// Paper folder name. + @objc + public var folderName: String { swift.folderName } + + @objc + public init(folderId: String, folderName: String) { + self.swift = TeamLog.PaperFolderLogInfo(folderId: folderId, folderName: folderName) + } + + let swift: TeamLog.PaperFolderLogInfo + + public init(swift: TeamLog.PaperFolderLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared Paper folder with users and/or groups. +@objc +public class DBXTeamLogPaperFolderTeamInviteDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperFolderTeamInviteDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperFolderTeamInviteDetails + + public init(swift: TeamLog.PaperFolderTeamInviteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperFolderTeamInviteType struct +@objc +public class DBXTeamLogPaperFolderTeamInviteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperFolderTeamInviteType(description_: description_) + } + + let swift: TeamLog.PaperFolderTeamInviteType + + public init(swift: TeamLog.PaperFolderTeamInviteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling if team members can share Paper documents externally. +@objc +public class DBXTeamLogPaperMemberPolicy: NSObject { + let swift: TeamLog.PaperMemberPolicy + + public init(swift: TeamLog.PaperMemberPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PaperMemberPolicy) -> DBXTeamLogPaperMemberPolicy { + switch swift { + case .anyoneWithLink: + return DBXTeamLogPaperMemberPolicyAnyoneWithLink() + case .onlyTeam: + return DBXTeamLogPaperMemberPolicyOnlyTeam() + case .teamAndExplicitlyShared: + return DBXTeamLogPaperMemberPolicyTeamAndExplicitlyShared() + case .other: + return DBXTeamLogPaperMemberPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAnyoneWithLink: DBXTeamLogPaperMemberPolicyAnyoneWithLink? { + self as? DBXTeamLogPaperMemberPolicyAnyoneWithLink + } + + @objc + public var asOnlyTeam: DBXTeamLogPaperMemberPolicyOnlyTeam? { + self as? DBXTeamLogPaperMemberPolicyOnlyTeam + } + + @objc + public var asTeamAndExplicitlyShared: DBXTeamLogPaperMemberPolicyTeamAndExplicitlyShared? { + self as? DBXTeamLogPaperMemberPolicyTeamAndExplicitlyShared + } + + @objc + public var asOther: DBXTeamLogPaperMemberPolicyOther? { + self as? DBXTeamLogPaperMemberPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperMemberPolicyAnyoneWithLink: DBXTeamLogPaperMemberPolicy { + @objc + public init() { + let swift = TeamLog.PaperMemberPolicy.anyoneWithLink + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperMemberPolicyOnlyTeam: DBXTeamLogPaperMemberPolicy { + @objc + public init() { + let swift = TeamLog.PaperMemberPolicy.onlyTeam + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperMemberPolicyTeamAndExplicitlyShared: DBXTeamLogPaperMemberPolicy { + @objc + public init() { + let swift = TeamLog.PaperMemberPolicy.teamAndExplicitlyShared + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPaperMemberPolicyOther: DBXTeamLogPaperMemberPolicy { + @objc + public init() { + let swift = TeamLog.PaperMemberPolicy.other + super.init(swift: swift) + } +} + +/// Changed permissions for published doc. +@objc +public class DBXTeamLogPaperPublishedLinkChangePermissionDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// New permission level. + @objc + public var newPermissionLevel: String { swift.newPermissionLevel } + /// Previous permission level. + @objc + public var previousPermissionLevel: String { swift.previousPermissionLevel } + + @objc + public init(eventUuid: String, newPermissionLevel: String, previousPermissionLevel: String) { + self.swift = TeamLog.PaperPublishedLinkChangePermissionDetails( + eventUuid: eventUuid, + newPermissionLevel: newPermissionLevel, + previousPermissionLevel: previousPermissionLevel + ) + } + + let swift: TeamLog.PaperPublishedLinkChangePermissionDetails + + public init(swift: TeamLog.PaperPublishedLinkChangePermissionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperPublishedLinkChangePermissionType struct +@objc +public class DBXTeamLogPaperPublishedLinkChangePermissionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperPublishedLinkChangePermissionType(description_: description_) + } + + let swift: TeamLog.PaperPublishedLinkChangePermissionType + + public init(swift: TeamLog.PaperPublishedLinkChangePermissionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Published doc. +@objc +public class DBXTeamLogPaperPublishedLinkCreateDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperPublishedLinkCreateDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperPublishedLinkCreateDetails + + public init(swift: TeamLog.PaperPublishedLinkCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperPublishedLinkCreateType struct +@objc +public class DBXTeamLogPaperPublishedLinkCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperPublishedLinkCreateType(description_: description_) + } + + let swift: TeamLog.PaperPublishedLinkCreateType + + public init(swift: TeamLog.PaperPublishedLinkCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unpublished doc. +@objc +public class DBXTeamLogPaperPublishedLinkDisabledDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperPublishedLinkDisabledDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperPublishedLinkDisabledDetails + + public init(swift: TeamLog.PaperPublishedLinkDisabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperPublishedLinkDisabledType struct +@objc +public class DBXTeamLogPaperPublishedLinkDisabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperPublishedLinkDisabledType(description_: description_) + } + + let swift: TeamLog.PaperPublishedLinkDisabledType + + public init(swift: TeamLog.PaperPublishedLinkDisabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Viewed published doc. +@objc +public class DBXTeamLogPaperPublishedLinkViewDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.PaperPublishedLinkViewDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.PaperPublishedLinkViewDetails + + public init(swift: TeamLog.PaperPublishedLinkViewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PaperPublishedLinkViewType struct +@objc +public class DBXTeamLogPaperPublishedLinkViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PaperPublishedLinkViewType(description_: description_) + } + + let swift: TeamLog.PaperPublishedLinkViewType + + public init(swift: TeamLog.PaperPublishedLinkViewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// A user or group +@objc +public class DBXTeamLogParticipantLogInfo: NSObject { + let swift: TeamLog.ParticipantLogInfo + + public init(swift: TeamLog.ParticipantLogInfo) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ParticipantLogInfo) -> DBXTeamLogParticipantLogInfo { + switch swift { + case .group(let swiftArg): + let arg = DBXTeamLogGroupLogInfo(swift: swiftArg) + return DBXTeamLogParticipantLogInfoGroup(arg) + case .user(let swiftArg): + let arg = DBXTeamLogUserLogInfo(swift: swiftArg) + return DBXTeamLogParticipantLogInfoUser(arg) + case .other: + return DBXTeamLogParticipantLogInfoOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asGroup: DBXTeamLogParticipantLogInfoGroup? { + self as? DBXTeamLogParticipantLogInfoGroup + } + + @objc + public var asUser: DBXTeamLogParticipantLogInfoUser? { + self as? DBXTeamLogParticipantLogInfoUser + } + + @objc + public var asOther: DBXTeamLogParticipantLogInfoOther? { + self as? DBXTeamLogParticipantLogInfoOther + } +} + +/// Group details. +@objc +public class DBXTeamLogParticipantLogInfoGroup: DBXTeamLogParticipantLogInfo { + @objc + public var group: DBXTeamLogGroupLogInfo + + @objc + public init(_ arg: DBXTeamLogGroupLogInfo) { + self.group = arg + let swift = TeamLog.ParticipantLogInfo.group(arg.swift) + super.init(swift: swift) + } +} + +/// A user with a Dropbox account. +@objc +public class DBXTeamLogParticipantLogInfoUser: DBXTeamLogParticipantLogInfo { + @objc + public var user: DBXTeamLogUserLogInfo + + @objc + public init(_ arg: DBXTeamLogUserLogInfo) { + self.user = arg + let swift = TeamLog.ParticipantLogInfo.user(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogParticipantLogInfoOther: DBXTeamLogParticipantLogInfo { + @objc + public init() { + let swift = TeamLog.ParticipantLogInfo.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PassPolicy union +@objc +public class DBXTeamLogPassPolicy: NSObject { + let swift: TeamLog.PassPolicy + + public init(swift: TeamLog.PassPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PassPolicy) -> DBXTeamLogPassPolicy { + switch swift { + case .allow: + return DBXTeamLogPassPolicyAllow() + case .disabled: + return DBXTeamLogPassPolicyDisabled() + case .enabled: + return DBXTeamLogPassPolicyEnabled() + case .other: + return DBXTeamLogPassPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAllow: DBXTeamLogPassPolicyAllow? { + self as? DBXTeamLogPassPolicyAllow + } + + @objc + public var asDisabled: DBXTeamLogPassPolicyDisabled? { + self as? DBXTeamLogPassPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogPassPolicyEnabled? { + self as? DBXTeamLogPassPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogPassPolicyOther? { + self as? DBXTeamLogPassPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPassPolicyAllow: DBXTeamLogPassPolicy { + @objc + public init() { + let swift = TeamLog.PassPolicy.allow + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPassPolicyDisabled: DBXTeamLogPassPolicy { + @objc + public init() { + let swift = TeamLog.PassPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPassPolicyEnabled: DBXTeamLogPassPolicy { + @objc + public init() { + let swift = TeamLog.PassPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPassPolicyOther: DBXTeamLogPassPolicy { + @objc + public init() { + let swift = TeamLog.PassPolicy.other + super.init(swift: swift) + } +} + +/// Changed password. +@objc +public class DBXTeamLogPasswordChangeDetails: NSObject { + let swift: TeamLog.PasswordChangeDetails + + public init(swift: TeamLog.PasswordChangeDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PasswordChangeType struct +@objc +public class DBXTeamLogPasswordChangeType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PasswordChangeType(description_: description_) + } + + let swift: TeamLog.PasswordChangeType + + public init(swift: TeamLog.PasswordChangeType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reset all team member passwords. +@objc +public class DBXTeamLogPasswordResetAllDetails: NSObject { + let swift: TeamLog.PasswordResetAllDetails + + public init(swift: TeamLog.PasswordResetAllDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PasswordResetAllType struct +@objc +public class DBXTeamLogPasswordResetAllType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PasswordResetAllType(description_: description_) + } + + let swift: TeamLog.PasswordResetAllType + + public init(swift: TeamLog.PasswordResetAllType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reset password. +@objc +public class DBXTeamLogPasswordResetDetails: NSObject { + let swift: TeamLog.PasswordResetDetails + + public init(swift: TeamLog.PasswordResetDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PasswordResetType struct +@objc +public class DBXTeamLogPasswordResetType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PasswordResetType(description_: description_) + } + + let swift: TeamLog.PasswordResetType + + public init(swift: TeamLog.PasswordResetType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team password strength requirements. +@objc +public class DBXTeamLogPasswordStrengthRequirementsChangePolicyDetails: NSObject { + /// Old password strength policy. + @objc + public var previousValue: DBXTeamPoliciesPasswordStrengthPolicy { DBXTeamPoliciesPasswordStrengthPolicy(swift: swift.previousValue) } + /// New password strength policy. + @objc + public var newValue: DBXTeamPoliciesPasswordStrengthPolicy { DBXTeamPoliciesPasswordStrengthPolicy(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamPoliciesPasswordStrengthPolicy, newValue: DBXTeamPoliciesPasswordStrengthPolicy) { + self.swift = TeamLog.PasswordStrengthRequirementsChangePolicyDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.PasswordStrengthRequirementsChangePolicyDetails + + public init(swift: TeamLog.PasswordStrengthRequirementsChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PasswordStrengthRequirementsChangePolicyType struct +@objc +public class DBXTeamLogPasswordStrengthRequirementsChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PasswordStrengthRequirementsChangePolicyType(description_: description_) + } + + let swift: TeamLog.PasswordStrengthRequirementsChangePolicyType + + public init(swift: TeamLog.PasswordStrengthRequirementsChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Path's details. +@objc +public class DBXTeamLogPathLogInfo: NSObject { + /// Fully qualified path relative to event's context. + @objc + public var contextual: String? { swift.contextual } + /// Path relative to the namespace containing the content. + @objc + public var namespaceRelative: DBXTeamLogNamespaceRelativePathLogInfo { DBXTeamLogNamespaceRelativePathLogInfo(swift: swift.namespaceRelative) } + + @objc + public init(namespaceRelative: DBXTeamLogNamespaceRelativePathLogInfo, contextual: String?) { + self.swift = TeamLog.PathLogInfo(namespaceRelative: namespaceRelative.swift, contextual: contextual) + } + + let swift: TeamLog.PathLogInfo + + public init(swift: TeamLog.PathLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added pending secondary email. +@objc +public class DBXTeamLogPendingSecondaryEmailAddedDetails: NSObject { + /// New pending secondary email. + @objc + public var secondaryEmail: String { swift.secondaryEmail } + + @objc + public init(secondaryEmail: String) { + self.swift = TeamLog.PendingSecondaryEmailAddedDetails(secondaryEmail: secondaryEmail) + } + + let swift: TeamLog.PendingSecondaryEmailAddedDetails + + public init(swift: TeamLog.PendingSecondaryEmailAddedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PendingSecondaryEmailAddedType struct +@objc +public class DBXTeamLogPendingSecondaryEmailAddedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PendingSecondaryEmailAddedType(description_: description_) + } + + let swift: TeamLog.PendingSecondaryEmailAddedType + + public init(swift: TeamLog.PendingSecondaryEmailAddedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled ability of team members to permanently delete content. +@objc +public class DBXTeamLogPermanentDeleteChangePolicyDetails: NSObject { + /// New permanent delete content policy. + @objc + public var newValue: DBXTeamLogContentPermanentDeletePolicy { DBXTeamLogContentPermanentDeletePolicy(swift: swift.newValue) } + /// Previous permanent delete content policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogContentPermanentDeletePolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogContentPermanentDeletePolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogContentPermanentDeletePolicy, previousValue: DBXTeamLogContentPermanentDeletePolicy?) { + self.swift = TeamLog.PermanentDeleteChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.PermanentDeleteChangePolicyDetails + + public init(swift: TeamLog.PermanentDeleteChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PermanentDeleteChangePolicyType struct +@objc +public class DBXTeamLogPermanentDeleteChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.PermanentDeleteChangePolicyType(description_: description_) + } + + let swift: TeamLog.PermanentDeleteChangePolicyType + + public init(swift: TeamLog.PermanentDeleteChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible PlacementRestriction union +@objc +public class DBXTeamLogPlacementRestriction: NSObject { + let swift: TeamLog.PlacementRestriction + + public init(swift: TeamLog.PlacementRestriction) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PlacementRestriction) -> DBXTeamLogPlacementRestriction { + switch swift { + case .australiaOnly: + return DBXTeamLogPlacementRestrictionAustraliaOnly() + case .europeOnly: + return DBXTeamLogPlacementRestrictionEuropeOnly() + case .japanOnly: + return DBXTeamLogPlacementRestrictionJapanOnly() + case .none: + return DBXTeamLogPlacementRestrictionNone() + case .ukOnly: + return DBXTeamLogPlacementRestrictionUkOnly() + case .usS3Only: + return DBXTeamLogPlacementRestrictionUsS3Only() + case .other: + return DBXTeamLogPlacementRestrictionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAustraliaOnly: DBXTeamLogPlacementRestrictionAustraliaOnly? { + self as? DBXTeamLogPlacementRestrictionAustraliaOnly + } + + @objc + public var asEuropeOnly: DBXTeamLogPlacementRestrictionEuropeOnly? { + self as? DBXTeamLogPlacementRestrictionEuropeOnly + } + + @objc + public var asJapanOnly: DBXTeamLogPlacementRestrictionJapanOnly? { + self as? DBXTeamLogPlacementRestrictionJapanOnly + } + + @objc + public var asNone: DBXTeamLogPlacementRestrictionNone? { + self as? DBXTeamLogPlacementRestrictionNone + } + + @objc + public var asUkOnly: DBXTeamLogPlacementRestrictionUkOnly? { + self as? DBXTeamLogPlacementRestrictionUkOnly + } + + @objc + public var asUsS3Only: DBXTeamLogPlacementRestrictionUsS3Only? { + self as? DBXTeamLogPlacementRestrictionUsS3Only + } + + @objc + public var asOther: DBXTeamLogPlacementRestrictionOther? { + self as? DBXTeamLogPlacementRestrictionOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPlacementRestrictionAustraliaOnly: DBXTeamLogPlacementRestriction { + @objc + public init() { + let swift = TeamLog.PlacementRestriction.australiaOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPlacementRestrictionEuropeOnly: DBXTeamLogPlacementRestriction { + @objc + public init() { + let swift = TeamLog.PlacementRestriction.europeOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPlacementRestrictionJapanOnly: DBXTeamLogPlacementRestriction { + @objc + public init() { + let swift = TeamLog.PlacementRestriction.japanOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPlacementRestrictionNone: DBXTeamLogPlacementRestriction { + @objc + public init() { + let swift = TeamLog.PlacementRestriction.none + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPlacementRestrictionUkOnly: DBXTeamLogPlacementRestriction { + @objc + public init() { + let swift = TeamLog.PlacementRestriction.ukOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPlacementRestrictionUsS3Only: DBXTeamLogPlacementRestriction { + @objc + public init() { + let swift = TeamLog.PlacementRestriction.usS3Only + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPlacementRestrictionOther: DBXTeamLogPlacementRestriction { + @objc + public init() { + let swift = TeamLog.PlacementRestriction.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PolicyType union +@objc +public class DBXTeamLogPolicyType: NSObject { + let swift: TeamLog.PolicyType + + public init(swift: TeamLog.PolicyType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.PolicyType) -> DBXTeamLogPolicyType { + switch swift { + case .disposition: + return DBXTeamLogPolicyTypeDisposition() + case .retention: + return DBXTeamLogPolicyTypeRetention() + case .other: + return DBXTeamLogPolicyTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisposition: DBXTeamLogPolicyTypeDisposition? { + self as? DBXTeamLogPolicyTypeDisposition + } + + @objc + public var asRetention: DBXTeamLogPolicyTypeRetention? { + self as? DBXTeamLogPolicyTypeRetention + } + + @objc + public var asOther: DBXTeamLogPolicyTypeOther? { + self as? DBXTeamLogPolicyTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPolicyTypeDisposition: DBXTeamLogPolicyType { + @objc + public init() { + let swift = TeamLog.PolicyType.disposition + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPolicyTypeRetention: DBXTeamLogPolicyType { + @objc + public init() { + let swift = TeamLog.PolicyType.retention + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogPolicyTypeOther: DBXTeamLogPolicyType { + @objc + public init() { + let swift = TeamLog.PolicyType.other + super.init(swift: swift) + } +} + +/// Team merge request acceptance details shown to the primary team +@objc +public class DBXTeamLogPrimaryTeamRequestAcceptedDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(secondaryTeam: String, sentBy: String) { + self.swift = TeamLog.PrimaryTeamRequestAcceptedDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.PrimaryTeamRequestAcceptedDetails + + public init(swift: TeamLog.PrimaryTeamRequestAcceptedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request cancellation details shown to the primary team +@objc +public class DBXTeamLogPrimaryTeamRequestCanceledDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(secondaryTeam: String, sentBy: String) { + self.swift = TeamLog.PrimaryTeamRequestCanceledDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.PrimaryTeamRequestCanceledDetails + + public init(swift: TeamLog.PrimaryTeamRequestCanceledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request expiration details shown to the primary team +@objc +public class DBXTeamLogPrimaryTeamRequestExpiredDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(secondaryTeam: String, sentBy: String) { + self.swift = TeamLog.PrimaryTeamRequestExpiredDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.PrimaryTeamRequestExpiredDetails + + public init(swift: TeamLog.PrimaryTeamRequestExpiredDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request reminder details shown to the primary team +@objc +public class DBXTeamLogPrimaryTeamRequestReminderDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(secondaryTeam: String, sentTo: String) { + self.swift = TeamLog.PrimaryTeamRequestReminderDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) + } + + let swift: TeamLog.PrimaryTeamRequestReminderDetails + + public init(swift: TeamLog.PrimaryTeamRequestReminderDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Quick action type. +@objc +public class DBXTeamLogQuickActionType: NSObject { + let swift: TeamLog.QuickActionType + + public init(swift: TeamLog.QuickActionType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.QuickActionType) -> DBXTeamLogQuickActionType { + switch swift { + case .deleteSharedLink: + return DBXTeamLogQuickActionTypeDeleteSharedLink() + case .resetPassword: + return DBXTeamLogQuickActionTypeResetPassword() + case .restoreFileOrFolder: + return DBXTeamLogQuickActionTypeRestoreFileOrFolder() + case .unlinkApp: + return DBXTeamLogQuickActionTypeUnlinkApp() + case .unlinkDevice: + return DBXTeamLogQuickActionTypeUnlinkDevice() + case .unlinkSession: + return DBXTeamLogQuickActionTypeUnlinkSession() + case .other: + return DBXTeamLogQuickActionTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDeleteSharedLink: DBXTeamLogQuickActionTypeDeleteSharedLink? { + self as? DBXTeamLogQuickActionTypeDeleteSharedLink + } + + @objc + public var asResetPassword: DBXTeamLogQuickActionTypeResetPassword? { + self as? DBXTeamLogQuickActionTypeResetPassword + } + + @objc + public var asRestoreFileOrFolder: DBXTeamLogQuickActionTypeRestoreFileOrFolder? { + self as? DBXTeamLogQuickActionTypeRestoreFileOrFolder + } + + @objc + public var asUnlinkApp: DBXTeamLogQuickActionTypeUnlinkApp? { + self as? DBXTeamLogQuickActionTypeUnlinkApp + } + + @objc + public var asUnlinkDevice: DBXTeamLogQuickActionTypeUnlinkDevice? { + self as? DBXTeamLogQuickActionTypeUnlinkDevice + } + + @objc + public var asUnlinkSession: DBXTeamLogQuickActionTypeUnlinkSession? { + self as? DBXTeamLogQuickActionTypeUnlinkSession + } + + @objc + public var asOther: DBXTeamLogQuickActionTypeOther? { + self as? DBXTeamLogQuickActionTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeDeleteSharedLink: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.deleteSharedLink + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeResetPassword: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.resetPassword + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeRestoreFileOrFolder: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.restoreFileOrFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeUnlinkApp: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.unlinkApp + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeUnlinkDevice: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.unlinkDevice + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeUnlinkSession: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.unlinkSession + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeOther: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.other + super.init(swift: swift) + } +} + +/// Created ransomware report. +@objc +public class DBXTeamLogRansomwareAlertCreateReportDetails: NSObject { + let swift: TeamLog.RansomwareAlertCreateReportDetails + + public init(swift: TeamLog.RansomwareAlertCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't generate ransomware report. +@objc +public class DBXTeamLogRansomwareAlertCreateReportFailedDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.RansomwareAlertCreateReportFailedDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.RansomwareAlertCreateReportFailedDetails + + public init(swift: TeamLog.RansomwareAlertCreateReportFailedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareAlertCreateReportFailedType struct +@objc +public class DBXTeamLogRansomwareAlertCreateReportFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareAlertCreateReportFailedType(description_: description_) + } + + let swift: TeamLog.RansomwareAlertCreateReportFailedType + + public init(swift: TeamLog.RansomwareAlertCreateReportFailedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareAlertCreateReportType struct +@objc +public class DBXTeamLogRansomwareAlertCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareAlertCreateReportType(description_: description_) + } + + let swift: TeamLog.RansomwareAlertCreateReportType + + public init(swift: TeamLog.RansomwareAlertCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Completed ransomware restore process. +@objc +public class DBXTeamLogRansomwareRestoreProcessCompletedDetails: NSObject { + /// The status of the restore process. + @objc + public var status: String { swift.status } + /// Restored files count. + @objc + public var restoredFilesCount: NSNumber { swift.restoredFilesCount as NSNumber } + /// Restored files failed count. + @objc + public var restoredFilesFailedCount: NSNumber { swift.restoredFilesFailedCount as NSNumber } + + @objc + public init(status: String, restoredFilesCount: NSNumber, restoredFilesFailedCount: NSNumber) { + self.swift = TeamLog.RansomwareRestoreProcessCompletedDetails( + status: status, + restoredFilesCount: restoredFilesCount.int64Value, + restoredFilesFailedCount: restoredFilesFailedCount.int64Value + ) + } + + let swift: TeamLog.RansomwareRestoreProcessCompletedDetails + + public init(swift: TeamLog.RansomwareRestoreProcessCompletedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareRestoreProcessCompletedType struct +@objc +public class DBXTeamLogRansomwareRestoreProcessCompletedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareRestoreProcessCompletedType(description_: description_) + } + + let swift: TeamLog.RansomwareRestoreProcessCompletedType + + public init(swift: TeamLog.RansomwareRestoreProcessCompletedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Started ransomware restore process. +@objc +public class DBXTeamLogRansomwareRestoreProcessStartedDetails: NSObject { + /// Ransomware filename extension. + @objc + public var extension_: String { swift.extension_ } + + @objc + public init(extension_: String) { + self.swift = TeamLog.RansomwareRestoreProcessStartedDetails(extension_: extension_) + } + + let swift: TeamLog.RansomwareRestoreProcessStartedDetails + + public init(swift: TeamLog.RansomwareRestoreProcessStartedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareRestoreProcessStartedType struct +@objc +public class DBXTeamLogRansomwareRestoreProcessStartedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareRestoreProcessStartedType(description_: description_) + } + + let swift: TeamLog.RansomwareRestoreProcessStartedType + + public init(swift: TeamLog.RansomwareRestoreProcessStartedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Recipients Configuration +@objc +public class DBXTeamLogRecipientsConfiguration: NSObject { + /// Recipients setting type. + @objc + public var recipientSettingType: DBXTeamLogAlertRecipientsSettingType? { guard let swift = swift.recipientSettingType else { return nil } + return DBXTeamLogAlertRecipientsSettingType(swift: swift) + } + + /// A list of user emails to notify. + @objc + public var emails: [String]? { swift.emails } + /// A list of groups to notify. + @objc + public var groups: [String]? { swift.groups } + + @objc + public init(recipientSettingType: DBXTeamLogAlertRecipientsSettingType?, emails: [String]?, groups: [String]?) { + self.swift = TeamLog.RecipientsConfiguration(recipientSettingType: recipientSettingType?.swift, emails: emails, groups: groups) + } + + let swift: TeamLog.RecipientsConfiguration + + public init(swift: TeamLog.RecipientsConfiguration) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Provides the indices of the source asset and the destination asset for a relocate action. +@objc +public class DBXTeamLogRelocateAssetReferencesLogInfo: NSObject { + /// Source asset position in the Assets list. + @objc + public var srcAssetIndex: NSNumber { swift.srcAssetIndex as NSNumber } + /// Destination asset position in the Assets list. + @objc + public var destAssetIndex: NSNumber { swift.destAssetIndex as NSNumber } + + @objc + public init(srcAssetIndex: NSNumber, destAssetIndex: NSNumber) { + self.swift = TeamLog.RelocateAssetReferencesLogInfo(srcAssetIndex: srcAssetIndex.uint64Value, destAssetIndex: destAssetIndex.uint64Value) + } + + let swift: TeamLog.RelocateAssetReferencesLogInfo + + public init(swift: TeamLog.RelocateAssetReferencesLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted files in Replay. +@objc +public class DBXTeamLogReplayFileDeleteDetails: NSObject { + let swift: TeamLog.ReplayFileDeleteDetails + + public init(swift: TeamLog.ReplayFileDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ReplayFileDeleteType struct +@objc +public class DBXTeamLogReplayFileDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ReplayFileDeleteType(description_: description_) + } + + let swift: TeamLog.ReplayFileDeleteType + + public init(swift: TeamLog.ReplayFileDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created shared link in Replay. +@objc +public class DBXTeamLogReplayFileSharedLinkCreatedDetails: NSObject { + let swift: TeamLog.ReplayFileSharedLinkCreatedDetails + + public init(swift: TeamLog.ReplayFileSharedLinkCreatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ReplayFileSharedLinkCreatedType struct +@objc +public class DBXTeamLogReplayFileSharedLinkCreatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ReplayFileSharedLinkCreatedType(description_: description_) + } + + let swift: TeamLog.ReplayFileSharedLinkCreatedType + + public init(swift: TeamLog.ReplayFileSharedLinkCreatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Modified shared link in Replay. +@objc +public class DBXTeamLogReplayFileSharedLinkModifiedDetails: NSObject { + let swift: TeamLog.ReplayFileSharedLinkModifiedDetails + + public init(swift: TeamLog.ReplayFileSharedLinkModifiedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ReplayFileSharedLinkModifiedType struct +@objc +public class DBXTeamLogReplayFileSharedLinkModifiedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ReplayFileSharedLinkModifiedType(description_: description_) + } + + let swift: TeamLog.ReplayFileSharedLinkModifiedType + + public init(swift: TeamLog.ReplayFileSharedLinkModifiedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added member to Replay Project. +@objc +public class DBXTeamLogReplayProjectTeamAddDetails: NSObject { + let swift: TeamLog.ReplayProjectTeamAddDetails + + public init(swift: TeamLog.ReplayProjectTeamAddDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ReplayProjectTeamAddType struct +@objc +public class DBXTeamLogReplayProjectTeamAddType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ReplayProjectTeamAddType(description_: description_) + } + + let swift: TeamLog.ReplayProjectTeamAddType + + public init(swift: TeamLog.ReplayProjectTeamAddType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed member from Replay Project. +@objc +public class DBXTeamLogReplayProjectTeamDeleteDetails: NSObject { + let swift: TeamLog.ReplayProjectTeamDeleteDetails + + public init(swift: TeamLog.ReplayProjectTeamDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ReplayProjectTeamDeleteType struct +@objc +public class DBXTeamLogReplayProjectTeamDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ReplayProjectTeamDeleteType(description_: description_) + } + + let swift: TeamLog.ReplayProjectTeamDeleteType + + public init(swift: TeamLog.ReplayProjectTeamDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reseller information. +@objc +public class DBXTeamLogResellerLogInfo: NSObject { + /// Reseller name. + @objc + public var resellerName: String { swift.resellerName } + /// Reseller email. + @objc + public var resellerEmail: String { swift.resellerEmail } + + @objc + public init(resellerName: String, resellerEmail: String) { + self.swift = TeamLog.ResellerLogInfo(resellerName: resellerName, resellerEmail: resellerEmail) + } + + let swift: TeamLog.ResellerLogInfo + + public init(swift: TeamLog.ResellerLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ResellerRole union +@objc +public class DBXTeamLogResellerRole: NSObject { + let swift: TeamLog.ResellerRole + + public init(swift: TeamLog.ResellerRole) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ResellerRole) -> DBXTeamLogResellerRole { + switch swift { + case .notReseller: + return DBXTeamLogResellerRoleNotReseller() + case .resellerAdmin: + return DBXTeamLogResellerRoleResellerAdmin() + case .other: + return DBXTeamLogResellerRoleOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNotReseller: DBXTeamLogResellerRoleNotReseller? { + self as? DBXTeamLogResellerRoleNotReseller + } + + @objc + public var asResellerAdmin: DBXTeamLogResellerRoleResellerAdmin? { + self as? DBXTeamLogResellerRoleResellerAdmin + } + + @objc + public var asOther: DBXTeamLogResellerRoleOther? { + self as? DBXTeamLogResellerRoleOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogResellerRoleNotReseller: DBXTeamLogResellerRole { + @objc + public init() { + let swift = TeamLog.ResellerRole.notReseller + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogResellerRoleResellerAdmin: DBXTeamLogResellerRole { + @objc + public init() { + let swift = TeamLog.ResellerRole.resellerAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogResellerRoleOther: DBXTeamLogResellerRole { + @objc + public init() { + let swift = TeamLog.ResellerRole.other + super.init(swift: swift) + } +} + +/// Enabled/disabled reseller support. +@objc +public class DBXTeamLogResellerSupportChangePolicyDetails: NSObject { + /// New Reseller support policy. + @objc + public var newValue: DBXTeamLogResellerSupportPolicy { DBXTeamLogResellerSupportPolicy(swift: swift.newValue) } + /// Previous Reseller support policy. + @objc + public var previousValue: DBXTeamLogResellerSupportPolicy { DBXTeamLogResellerSupportPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogResellerSupportPolicy, previousValue: DBXTeamLogResellerSupportPolicy) { + self.swift = TeamLog.ResellerSupportChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.ResellerSupportChangePolicyDetails + + public init(swift: TeamLog.ResellerSupportChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ResellerSupportChangePolicyType struct +@objc +public class DBXTeamLogResellerSupportChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ResellerSupportChangePolicyType(description_: description_) + } + + let swift: TeamLog.ResellerSupportChangePolicyType + + public init(swift: TeamLog.ResellerSupportChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling if reseller can access the admin console as administrator +@objc +public class DBXTeamLogResellerSupportPolicy: NSObject { + let swift: TeamLog.ResellerSupportPolicy + + public init(swift: TeamLog.ResellerSupportPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ResellerSupportPolicy) -> DBXTeamLogResellerSupportPolicy { + switch swift { + case .disabled: + return DBXTeamLogResellerSupportPolicyDisabled() + case .enabled: + return DBXTeamLogResellerSupportPolicyEnabled() + case .other: + return DBXTeamLogResellerSupportPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogResellerSupportPolicyDisabled? { + self as? DBXTeamLogResellerSupportPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogResellerSupportPolicyEnabled? { + self as? DBXTeamLogResellerSupportPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogResellerSupportPolicyOther? { + self as? DBXTeamLogResellerSupportPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogResellerSupportPolicyDisabled: DBXTeamLogResellerSupportPolicy { + @objc + public init() { + let swift = TeamLog.ResellerSupportPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogResellerSupportPolicyEnabled: DBXTeamLogResellerSupportPolicy { + @objc + public init() { + let swift = TeamLog.ResellerSupportPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogResellerSupportPolicyOther: DBXTeamLogResellerSupportPolicy { + @objc + public init() { + let swift = TeamLog.ResellerSupportPolicy.other + super.init(swift: swift) + } +} + +/// Ended reseller support session. +@objc +public class DBXTeamLogResellerSupportSessionEndDetails: NSObject { + let swift: TeamLog.ResellerSupportSessionEndDetails + + public init(swift: TeamLog.ResellerSupportSessionEndDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ResellerSupportSessionEndType struct +@objc +public class DBXTeamLogResellerSupportSessionEndType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ResellerSupportSessionEndType(description_: description_) + } + + let swift: TeamLog.ResellerSupportSessionEndType + + public init(swift: TeamLog.ResellerSupportSessionEndType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Started reseller support session. +@objc +public class DBXTeamLogResellerSupportSessionStartDetails: NSObject { + let swift: TeamLog.ResellerSupportSessionStartDetails + + public init(swift: TeamLog.ResellerSupportSessionStartDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ResellerSupportSessionStartType struct +@objc +public class DBXTeamLogResellerSupportSessionStartType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ResellerSupportSessionStartType(description_: description_) + } + + let swift: TeamLog.ResellerSupportSessionStartType + + public init(swift: TeamLog.ResellerSupportSessionStartType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Rewound a folder. +@objc +public class DBXTeamLogRewindFolderDetails: NSObject { + /// Folder was Rewound to this date. + @objc + public var rewindFolderTargetTsMs: Date { swift.rewindFolderTargetTsMs } + + @objc + public init(rewindFolderTargetTsMs: Date) { + self.swift = TeamLog.RewindFolderDetails(rewindFolderTargetTsMs: rewindFolderTargetTsMs) + } + + let swift: TeamLog.RewindFolderDetails + + public init(swift: TeamLog.RewindFolderDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RewindFolderType struct +@objc +public class DBXTeamLogRewindFolderType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RewindFolderType(description_: description_) + } + + let swift: TeamLog.RewindFolderType + + public init(swift: TeamLog.RewindFolderType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling whether team members can rewind +@objc +public class DBXTeamLogRewindPolicy: NSObject { + let swift: TeamLog.RewindPolicy + + public init(swift: TeamLog.RewindPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.RewindPolicy) -> DBXTeamLogRewindPolicy { + switch swift { + case .adminsOnly: + return DBXTeamLogRewindPolicyAdminsOnly() + case .everyone: + return DBXTeamLogRewindPolicyEveryone() + case .other: + return DBXTeamLogRewindPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdminsOnly: DBXTeamLogRewindPolicyAdminsOnly? { + self as? DBXTeamLogRewindPolicyAdminsOnly + } + + @objc + public var asEveryone: DBXTeamLogRewindPolicyEveryone? { + self as? DBXTeamLogRewindPolicyEveryone + } + + @objc + public var asOther: DBXTeamLogRewindPolicyOther? { + self as? DBXTeamLogRewindPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogRewindPolicyAdminsOnly: DBXTeamLogRewindPolicy { + @objc + public init() { + let swift = TeamLog.RewindPolicy.adminsOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogRewindPolicyEveryone: DBXTeamLogRewindPolicy { + @objc + public init() { + let swift = TeamLog.RewindPolicy.everyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogRewindPolicyOther: DBXTeamLogRewindPolicy { + @objc + public init() { + let swift = TeamLog.RewindPolicy.other + super.init(swift: swift) + } +} + +/// Changed Rewind policy for team. +@objc +public class DBXTeamLogRewindPolicyChangedDetails: NSObject { + /// New Dropbox Rewind policy. + @objc + public var newValue: DBXTeamLogRewindPolicy { DBXTeamLogRewindPolicy(swift: swift.newValue) } + /// Previous Dropbox Rewind policy. + @objc + public var previousValue: DBXTeamLogRewindPolicy { DBXTeamLogRewindPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogRewindPolicy, previousValue: DBXTeamLogRewindPolicy) { + self.swift = TeamLog.RewindPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.RewindPolicyChangedDetails + + public init(swift: TeamLog.RewindPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RewindPolicyChangedType struct +@objc +public class DBXTeamLogRewindPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RewindPolicyChangedType(description_: description_) + } + + let swift: TeamLog.RewindPolicyChangedType + + public init(swift: TeamLog.RewindPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted secondary email. +@objc +public class DBXTeamLogSecondaryEmailDeletedDetails: NSObject { + /// Deleted secondary email. + @objc + public var secondaryEmail: String { swift.secondaryEmail } + + @objc + public init(secondaryEmail: String) { + self.swift = TeamLog.SecondaryEmailDeletedDetails(secondaryEmail: secondaryEmail) + } + + let swift: TeamLog.SecondaryEmailDeletedDetails + + public init(swift: TeamLog.SecondaryEmailDeletedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SecondaryEmailDeletedType struct +@objc +public class DBXTeamLogSecondaryEmailDeletedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SecondaryEmailDeletedType(description_: description_) + } + + let swift: TeamLog.SecondaryEmailDeletedType + + public init(swift: TeamLog.SecondaryEmailDeletedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Verified secondary email. +@objc +public class DBXTeamLogSecondaryEmailVerifiedDetails: NSObject { + /// Verified secondary email. + @objc + public var secondaryEmail: String { swift.secondaryEmail } + + @objc + public init(secondaryEmail: String) { + self.swift = TeamLog.SecondaryEmailVerifiedDetails(secondaryEmail: secondaryEmail) + } + + let swift: TeamLog.SecondaryEmailVerifiedDetails + + public init(swift: TeamLog.SecondaryEmailVerifiedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SecondaryEmailVerifiedType struct +@objc +public class DBXTeamLogSecondaryEmailVerifiedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SecondaryEmailVerifiedType(description_: description_) + } + + let swift: TeamLog.SecondaryEmailVerifiedType + + public init(swift: TeamLog.SecondaryEmailVerifiedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SecondaryMailsPolicy union +@objc +public class DBXTeamLogSecondaryMailsPolicy: NSObject { + let swift: TeamLog.SecondaryMailsPolicy + + public init(swift: TeamLog.SecondaryMailsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SecondaryMailsPolicy) -> DBXTeamLogSecondaryMailsPolicy { + switch swift { + case .disabled: + return DBXTeamLogSecondaryMailsPolicyDisabled() + case .enabled: + return DBXTeamLogSecondaryMailsPolicyEnabled() + case .other: + return DBXTeamLogSecondaryMailsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogSecondaryMailsPolicyDisabled? { + self as? DBXTeamLogSecondaryMailsPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogSecondaryMailsPolicyEnabled? { + self as? DBXTeamLogSecondaryMailsPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogSecondaryMailsPolicyOther? { + self as? DBXTeamLogSecondaryMailsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSecondaryMailsPolicyDisabled: DBXTeamLogSecondaryMailsPolicy { + @objc + public init() { + let swift = TeamLog.SecondaryMailsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSecondaryMailsPolicyEnabled: DBXTeamLogSecondaryMailsPolicy { + @objc + public init() { + let swift = TeamLog.SecondaryMailsPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSecondaryMailsPolicyOther: DBXTeamLogSecondaryMailsPolicy { + @objc + public init() { + let swift = TeamLog.SecondaryMailsPolicy.other + super.init(swift: swift) + } +} + +/// Secondary mails policy changed. +@objc +public class DBXTeamLogSecondaryMailsPolicyChangedDetails: NSObject { + /// Previous secondary mails policy. + @objc + public var previousValue: DBXTeamLogSecondaryMailsPolicy { DBXTeamLogSecondaryMailsPolicy(swift: swift.previousValue) } + /// New secondary mails policy. + @objc + public var newValue: DBXTeamLogSecondaryMailsPolicy { DBXTeamLogSecondaryMailsPolicy(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogSecondaryMailsPolicy, newValue: DBXTeamLogSecondaryMailsPolicy) { + self.swift = TeamLog.SecondaryMailsPolicyChangedDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.SecondaryMailsPolicyChangedDetails + + public init(swift: TeamLog.SecondaryMailsPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SecondaryMailsPolicyChangedType struct +@objc +public class DBXTeamLogSecondaryMailsPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SecondaryMailsPolicyChangedType(description_: description_) + } + + let swift: TeamLog.SecondaryMailsPolicyChangedType + + public init(swift: TeamLog.SecondaryMailsPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request acceptance details shown to the secondary team +@objc +public class DBXTeamLogSecondaryTeamRequestAcceptedDetails: NSObject { + /// The primary team name. + @objc + public var primaryTeam: String { swift.primaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(primaryTeam: String, sentBy: String) { + self.swift = TeamLog.SecondaryTeamRequestAcceptedDetails(primaryTeam: primaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.SecondaryTeamRequestAcceptedDetails + + public init(swift: TeamLog.SecondaryTeamRequestAcceptedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request cancellation details shown to the secondary team +@objc +public class DBXTeamLogSecondaryTeamRequestCanceledDetails: NSObject { + /// The email of the primary team admin that the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(sentTo: String, sentBy: String) { + self.swift = TeamLog.SecondaryTeamRequestCanceledDetails(sentTo: sentTo, sentBy: sentBy) + } + + let swift: TeamLog.SecondaryTeamRequestCanceledDetails + + public init(swift: TeamLog.SecondaryTeamRequestCanceledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request expiration details shown to the secondary team +@objc +public class DBXTeamLogSecondaryTeamRequestExpiredDetails: NSObject { + /// The email of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(sentTo: String) { + self.swift = TeamLog.SecondaryTeamRequestExpiredDetails(sentTo: sentTo) + } + + let swift: TeamLog.SecondaryTeamRequestExpiredDetails + + public init(swift: TeamLog.SecondaryTeamRequestExpiredDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request reminder details shown to the secondary team +@objc +public class DBXTeamLogSecondaryTeamRequestReminderDetails: NSObject { + /// The email of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(sentTo: String) { + self.swift = TeamLog.SecondaryTeamRequestReminderDetails(sentTo: sentTo) + } + + let swift: TeamLog.SecondaryTeamRequestReminderDetails + + public init(swift: TeamLog.SecondaryTeamRequestReminderDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling team access to send for signature feature +@objc +public class DBXTeamLogSendForSignaturePolicy: NSObject { + let swift: TeamLog.SendForSignaturePolicy + + public init(swift: TeamLog.SendForSignaturePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SendForSignaturePolicy) -> DBXTeamLogSendForSignaturePolicy { + switch swift { + case .disabled: + return DBXTeamLogSendForSignaturePolicyDisabled() + case .enabled: + return DBXTeamLogSendForSignaturePolicyEnabled() + case .other: + return DBXTeamLogSendForSignaturePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogSendForSignaturePolicyDisabled? { + self as? DBXTeamLogSendForSignaturePolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogSendForSignaturePolicyEnabled? { + self as? DBXTeamLogSendForSignaturePolicyEnabled + } + + @objc + public var asOther: DBXTeamLogSendForSignaturePolicyOther? { + self as? DBXTeamLogSendForSignaturePolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSendForSignaturePolicyDisabled: DBXTeamLogSendForSignaturePolicy { + @objc + public init() { + let swift = TeamLog.SendForSignaturePolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSendForSignaturePolicyEnabled: DBXTeamLogSendForSignaturePolicy { + @objc + public init() { + let swift = TeamLog.SendForSignaturePolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSendForSignaturePolicyOther: DBXTeamLogSendForSignaturePolicy { + @objc + public init() { + let swift = TeamLog.SendForSignaturePolicy.other + super.init(swift: swift) + } +} + +/// Changed send for signature policy for team. +@objc +public class DBXTeamLogSendForSignaturePolicyChangedDetails: NSObject { + /// New send for signature policy. + @objc + public var newValue: DBXTeamLogSendForSignaturePolicy { DBXTeamLogSendForSignaturePolicy(swift: swift.newValue) } + /// Previous send for signature policy. + @objc + public var previousValue: DBXTeamLogSendForSignaturePolicy { DBXTeamLogSendForSignaturePolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogSendForSignaturePolicy, previousValue: DBXTeamLogSendForSignaturePolicy) { + self.swift = TeamLog.SendForSignaturePolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.SendForSignaturePolicyChangedDetails + + public init(swift: TeamLog.SendForSignaturePolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SendForSignaturePolicyChangedType struct +@objc +public class DBXTeamLogSendForSignaturePolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SendForSignaturePolicyChangedType(description_: description_) + } + + let swift: TeamLog.SendForSignaturePolicyChangedType + + public init(swift: TeamLog.SendForSignaturePolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added team to shared folder. +@objc +public class DBXTeamLogSfAddGroupDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// Sharing permission. + @objc + public var sharingPermission: String? { swift.sharingPermission } + /// Team name. + @objc + public var teamName: String { swift.teamName } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, teamName: String, sharingPermission: String?) { + self.swift = TeamLog.SfAddGroupDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + teamName: teamName, + sharingPermission: sharingPermission + ) + } + + let swift: TeamLog.SfAddGroupDetails + + public init(swift: TeamLog.SfAddGroupDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfAddGroupType struct +@objc +public class DBXTeamLogSfAddGroupType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfAddGroupType(description_: description_) + } + + let swift: TeamLog.SfAddGroupType + + public init(swift: TeamLog.SfAddGroupType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Allowed non-collaborators to view links to files in shared folder. +@objc +public class DBXTeamLogSfAllowNonMembersToViewSharedLinksDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// Shared folder type. + @objc + public var sharedFolderType: String? { swift.sharedFolderType } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, sharedFolderType: String?) { + self.swift = TeamLog.SfAllowNonMembersToViewSharedLinksDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + sharedFolderType: sharedFolderType + ) + } + + let swift: TeamLog.SfAllowNonMembersToViewSharedLinksDetails + + public init(swift: TeamLog.SfAllowNonMembersToViewSharedLinksDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfAllowNonMembersToViewSharedLinksType struct +@objc +public class DBXTeamLogSfAllowNonMembersToViewSharedLinksType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfAllowNonMembersToViewSharedLinksType(description_: description_) + } + + let swift: TeamLog.SfAllowNonMembersToViewSharedLinksType + + public init(swift: TeamLog.SfAllowNonMembersToViewSharedLinksType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Set team members to see warning before sharing folders outside team. +@objc +public class DBXTeamLogSfExternalInviteWarnDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// New sharing permission. + @objc + public var newSharingPermission: String? { swift.newSharingPermission } + /// Previous sharing permission. + @objc + public var previousSharingPermission: String? { swift.previousSharingPermission } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, newSharingPermission: String?, previousSharingPermission: String?) { + self.swift = TeamLog.SfExternalInviteWarnDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + newSharingPermission: newSharingPermission, + previousSharingPermission: previousSharingPermission + ) + } + + let swift: TeamLog.SfExternalInviteWarnDetails + + public init(swift: TeamLog.SfExternalInviteWarnDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfExternalInviteWarnType struct +@objc +public class DBXTeamLogSfExternalInviteWarnType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfExternalInviteWarnType(description_: description_) + } + + let swift: TeamLog.SfExternalInviteWarnType + + public init(swift: TeamLog.SfExternalInviteWarnType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed Facebook user's role in shared folder. +@objc +public class DBXTeamLogSfFbInviteChangeRoleDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// Previous sharing permission. + @objc + public var previousSharingPermission: String? { swift.previousSharingPermission } + /// New sharing permission. + @objc + public var newSharingPermission: String? { swift.newSharingPermission } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, previousSharingPermission: String?, newSharingPermission: String?) { + self.swift = TeamLog.SfFbInviteChangeRoleDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + previousSharingPermission: previousSharingPermission, + newSharingPermission: newSharingPermission + ) + } + + let swift: TeamLog.SfFbInviteChangeRoleDetails + + public init(swift: TeamLog.SfFbInviteChangeRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfFbInviteChangeRoleType struct +@objc +public class DBXTeamLogSfFbInviteChangeRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfFbInviteChangeRoleType(description_: description_) + } + + let swift: TeamLog.SfFbInviteChangeRoleType + + public init(swift: TeamLog.SfFbInviteChangeRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Invited Facebook users to shared folder. +@objc +public class DBXTeamLogSfFbInviteDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// Sharing permission. + @objc + public var sharingPermission: String? { swift.sharingPermission } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, sharingPermission: String?) { + self.swift = TeamLog.SfFbInviteDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + sharingPermission: sharingPermission + ) + } + + let swift: TeamLog.SfFbInviteDetails + + public init(swift: TeamLog.SfFbInviteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfFbInviteType struct +@objc +public class DBXTeamLogSfFbInviteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfFbInviteType(description_: description_) + } + + let swift: TeamLog.SfFbInviteType + + public init(swift: TeamLog.SfFbInviteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Uninvited Facebook user from shared folder. +@objc +public class DBXTeamLogSfFbUninviteDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String) { + self.swift = TeamLog.SfFbUninviteDetails(targetAssetIndex: targetAssetIndex.uint64Value, originalFolderName: originalFolderName) + } + + let swift: TeamLog.SfFbUninviteDetails + + public init(swift: TeamLog.SfFbUninviteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfFbUninviteType struct +@objc +public class DBXTeamLogSfFbUninviteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfFbUninviteType(description_: description_) + } + + let swift: TeamLog.SfFbUninviteType + + public init(swift: TeamLog.SfFbUninviteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Invited group to shared folder. +@objc +public class DBXTeamLogSfInviteGroupDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + + @objc + public init(targetAssetIndex: NSNumber) { + self.swift = TeamLog.SfInviteGroupDetails(targetAssetIndex: targetAssetIndex.uint64Value) + } + + let swift: TeamLog.SfInviteGroupDetails + + public init(swift: TeamLog.SfInviteGroupDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfInviteGroupType struct +@objc +public class DBXTeamLogSfInviteGroupType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfInviteGroupType(description_: description_) + } + + let swift: TeamLog.SfInviteGroupType + + public init(swift: TeamLog.SfInviteGroupType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Granted access to shared folder. +@objc +public class DBXTeamLogSfTeamGrantAccessDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String) { + self.swift = TeamLog.SfTeamGrantAccessDetails(targetAssetIndex: targetAssetIndex.uint64Value, originalFolderName: originalFolderName) + } + + let swift: TeamLog.SfTeamGrantAccessDetails + + public init(swift: TeamLog.SfTeamGrantAccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfTeamGrantAccessType struct +@objc +public class DBXTeamLogSfTeamGrantAccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfTeamGrantAccessType(description_: description_) + } + + let swift: TeamLog.SfTeamGrantAccessType + + public init(swift: TeamLog.SfTeamGrantAccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team member's role in shared folder. +@objc +public class DBXTeamLogSfTeamInviteChangeRoleDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// New sharing permission. + @objc + public var newSharingPermission: String? { swift.newSharingPermission } + /// Previous sharing permission. + @objc + public var previousSharingPermission: String? { swift.previousSharingPermission } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, newSharingPermission: String?, previousSharingPermission: String?) { + self.swift = TeamLog.SfTeamInviteChangeRoleDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + newSharingPermission: newSharingPermission, + previousSharingPermission: previousSharingPermission + ) + } + + let swift: TeamLog.SfTeamInviteChangeRoleDetails + + public init(swift: TeamLog.SfTeamInviteChangeRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfTeamInviteChangeRoleType struct +@objc +public class DBXTeamLogSfTeamInviteChangeRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfTeamInviteChangeRoleType(description_: description_) + } + + let swift: TeamLog.SfTeamInviteChangeRoleType + + public init(swift: TeamLog.SfTeamInviteChangeRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Invited team members to shared folder. +@objc +public class DBXTeamLogSfTeamInviteDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// Sharing permission. + @objc + public var sharingPermission: String? { swift.sharingPermission } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, sharingPermission: String?) { + self.swift = TeamLog.SfTeamInviteDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + sharingPermission: sharingPermission + ) + } + + let swift: TeamLog.SfTeamInviteDetails + + public init(swift: TeamLog.SfTeamInviteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfTeamInviteType struct +@objc +public class DBXTeamLogSfTeamInviteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfTeamInviteType(description_: description_) + } + + let swift: TeamLog.SfTeamInviteType + + public init(swift: TeamLog.SfTeamInviteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Joined team member's shared folder. +@objc +public class DBXTeamLogSfTeamJoinDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String) { + self.swift = TeamLog.SfTeamJoinDetails(targetAssetIndex: targetAssetIndex.uint64Value, originalFolderName: originalFolderName) + } + + let swift: TeamLog.SfTeamJoinDetails + + public init(swift: TeamLog.SfTeamJoinDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Joined team member's shared folder from link. +@objc +public class DBXTeamLogSfTeamJoinFromOobLinkDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + /// Shared link token key. + @objc + public var tokenKey: String? { swift.tokenKey } + /// Sharing permission. + @objc + public var sharingPermission: String? { swift.sharingPermission } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String, tokenKey: String?, sharingPermission: String?) { + self.swift = TeamLog.SfTeamJoinFromOobLinkDetails( + targetAssetIndex: targetAssetIndex.uint64Value, + originalFolderName: originalFolderName, + tokenKey: tokenKey, + sharingPermission: sharingPermission + ) + } + + let swift: TeamLog.SfTeamJoinFromOobLinkDetails + + public init(swift: TeamLog.SfTeamJoinFromOobLinkDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfTeamJoinFromOobLinkType struct +@objc +public class DBXTeamLogSfTeamJoinFromOobLinkType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfTeamJoinFromOobLinkType(description_: description_) + } + + let swift: TeamLog.SfTeamJoinFromOobLinkType + + public init(swift: TeamLog.SfTeamJoinFromOobLinkType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfTeamJoinType struct +@objc +public class DBXTeamLogSfTeamJoinType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfTeamJoinType(description_: description_) + } + + let swift: TeamLog.SfTeamJoinType + + public init(swift: TeamLog.SfTeamJoinType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unshared folder with team member. +@objc +public class DBXTeamLogSfTeamUninviteDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + /// Original shared folder name. + @objc + public var originalFolderName: String { swift.originalFolderName } + + @objc + public init(targetAssetIndex: NSNumber, originalFolderName: String) { + self.swift = TeamLog.SfTeamUninviteDetails(targetAssetIndex: targetAssetIndex.uint64Value, originalFolderName: originalFolderName) + } + + let swift: TeamLog.SfTeamUninviteDetails + + public init(swift: TeamLog.SfTeamUninviteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SfTeamUninviteType struct +@objc +public class DBXTeamLogSfTeamUninviteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SfTeamUninviteType(description_: description_) + } + + let swift: TeamLog.SfTeamUninviteType + + public init(swift: TeamLog.SfTeamUninviteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Invited user to Dropbox and added them to shared file/folder. +@objc +public class DBXTeamLogSharedContentAddInviteesDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// A list of invitees. + @objc + public var invitees: [String] { swift.invitees } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, invitees: [String]) { + self.swift = TeamLog.SharedContentAddInviteesDetails(sharedContentAccessLevel: sharedContentAccessLevel.swift, invitees: invitees) + } + + let swift: TeamLog.SharedContentAddInviteesDetails + + public init(swift: TeamLog.SharedContentAddInviteesDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentAddInviteesType struct +@objc +public class DBXTeamLogSharedContentAddInviteesType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentAddInviteesType(description_: description_) + } + + let swift: TeamLog.SharedContentAddInviteesType + + public init(swift: TeamLog.SharedContentAddInviteesType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added expiration date to link for shared file/folder. +@objc +public class DBXTeamLogSharedContentAddLinkExpiryDetails: NSObject { + /// New shared content link expiration date. Might be missing due to historical data gap. + @objc + public var newValue: Date? { swift.newValue } + + @objc + public init(newValue: Date?) { + self.swift = TeamLog.SharedContentAddLinkExpiryDetails(newValue: newValue) + } + + let swift: TeamLog.SharedContentAddLinkExpiryDetails + + public init(swift: TeamLog.SharedContentAddLinkExpiryDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentAddLinkExpiryType struct +@objc +public class DBXTeamLogSharedContentAddLinkExpiryType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentAddLinkExpiryType(description_: description_) + } + + let swift: TeamLog.SharedContentAddLinkExpiryType + + public init(swift: TeamLog.SharedContentAddLinkExpiryType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added password to link for shared file/folder. +@objc +public class DBXTeamLogSharedContentAddLinkPasswordDetails: NSObject { + let swift: TeamLog.SharedContentAddLinkPasswordDetails + + public init(swift: TeamLog.SharedContentAddLinkPasswordDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentAddLinkPasswordType struct +@objc +public class DBXTeamLogSharedContentAddLinkPasswordType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentAddLinkPasswordType(description_: description_) + } + + let swift: TeamLog.SharedContentAddLinkPasswordType + + public init(swift: TeamLog.SharedContentAddLinkPasswordType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added users and/or groups to shared file/folder. +@objc +public class DBXTeamLogSharedContentAddMemberDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel) { + self.swift = TeamLog.SharedContentAddMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel.swift) + } + + let swift: TeamLog.SharedContentAddMemberDetails + + public init(swift: TeamLog.SharedContentAddMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentAddMemberType struct +@objc +public class DBXTeamLogSharedContentAddMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentAddMemberType(description_: description_) + } + + let swift: TeamLog.SharedContentAddMemberType + + public init(swift: TeamLog.SharedContentAddMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether members can download shared file/folder. +@objc +public class DBXTeamLogSharedContentChangeDownloadsPolicyDetails: NSObject { + /// New downloads policy. + @objc + public var newValue: DBXTeamLogDownloadPolicyType { DBXTeamLogDownloadPolicyType(swift: swift.newValue) } + /// Previous downloads policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogDownloadPolicyType? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogDownloadPolicyType(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogDownloadPolicyType, previousValue: DBXTeamLogDownloadPolicyType?) { + self.swift = TeamLog.SharedContentChangeDownloadsPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedContentChangeDownloadsPolicyDetails + + public init(swift: TeamLog.SharedContentChangeDownloadsPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentChangeDownloadsPolicyType struct +@objc +public class DBXTeamLogSharedContentChangeDownloadsPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentChangeDownloadsPolicyType(description_: description_) + } + + let swift: TeamLog.SharedContentChangeDownloadsPolicyType + + public init(swift: TeamLog.SharedContentChangeDownloadsPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed access type of invitee to shared file/folder before invite was accepted. +@objc +public class DBXTeamLogSharedContentChangeInviteeRoleDetails: NSObject { + /// Previous access level. Might be missing due to historical data gap. + @objc + public var previousAccessLevel: DBXSharingAccessLevel? { guard let swift = swift.previousAccessLevel else { return nil } + return DBXSharingAccessLevel(swift: swift) + } + + /// New access level. + @objc + public var newAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.newAccessLevel) } + /// The invitee whose role was changed. + @objc + public var invitee: String { swift.invitee } + + @objc + public init(newAccessLevel: DBXSharingAccessLevel, invitee: String, previousAccessLevel: DBXSharingAccessLevel?) { + self.swift = TeamLog.SharedContentChangeInviteeRoleDetails( + newAccessLevel: newAccessLevel.swift, + invitee: invitee, + previousAccessLevel: previousAccessLevel?.swift + ) + } + + let swift: TeamLog.SharedContentChangeInviteeRoleDetails + + public init(swift: TeamLog.SharedContentChangeInviteeRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentChangeInviteeRoleType struct +@objc +public class DBXTeamLogSharedContentChangeInviteeRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentChangeInviteeRoleType(description_: description_) + } + + let swift: TeamLog.SharedContentChangeInviteeRoleType + + public init(swift: TeamLog.SharedContentChangeInviteeRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed link audience of shared file/folder. +@objc +public class DBXTeamLogSharedContentChangeLinkAudienceDetails: NSObject { + /// New link audience value. + @objc + public var newValue: DBXSharingLinkAudience { DBXSharingLinkAudience(swift: swift.newValue) } + /// Previous link audience value. + @objc + public var previousValue: DBXSharingLinkAudience? { guard let swift = swift.previousValue else { return nil } + return DBXSharingLinkAudience(swift: swift) + } + + @objc + public init(newValue: DBXSharingLinkAudience, previousValue: DBXSharingLinkAudience?) { + self.swift = TeamLog.SharedContentChangeLinkAudienceDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedContentChangeLinkAudienceDetails + + public init(swift: TeamLog.SharedContentChangeLinkAudienceDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentChangeLinkAudienceType struct +@objc +public class DBXTeamLogSharedContentChangeLinkAudienceType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentChangeLinkAudienceType(description_: description_) + } + + let swift: TeamLog.SharedContentChangeLinkAudienceType + + public init(swift: TeamLog.SharedContentChangeLinkAudienceType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed link expiration of shared file/folder. +@objc +public class DBXTeamLogSharedContentChangeLinkExpiryDetails: NSObject { + /// New shared content link expiration date. Might be missing due to historical data gap. + @objc + public var newValue: Date? { swift.newValue } + /// Previous shared content link expiration date. Might be missing due to historical data gap. + @objc + public var previousValue: Date? { swift.previousValue } + + @objc + public init(newValue: Date?, previousValue: Date?) { + self.swift = TeamLog.SharedContentChangeLinkExpiryDetails(newValue: newValue, previousValue: previousValue) + } + + let swift: TeamLog.SharedContentChangeLinkExpiryDetails + + public init(swift: TeamLog.SharedContentChangeLinkExpiryDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentChangeLinkExpiryType struct +@objc +public class DBXTeamLogSharedContentChangeLinkExpiryType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentChangeLinkExpiryType(description_: description_) + } + + let swift: TeamLog.SharedContentChangeLinkExpiryType + + public init(swift: TeamLog.SharedContentChangeLinkExpiryType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed link password of shared file/folder. +@objc +public class DBXTeamLogSharedContentChangeLinkPasswordDetails: NSObject { + let swift: TeamLog.SharedContentChangeLinkPasswordDetails + + public init(swift: TeamLog.SharedContentChangeLinkPasswordDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentChangeLinkPasswordType struct +@objc +public class DBXTeamLogSharedContentChangeLinkPasswordType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentChangeLinkPasswordType(description_: description_) + } + + let swift: TeamLog.SharedContentChangeLinkPasswordType + + public init(swift: TeamLog.SharedContentChangeLinkPasswordType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed access type of shared file/folder member. +@objc +public class DBXTeamLogSharedContentChangeMemberRoleDetails: NSObject { + /// Previous access level. Might be missing due to historical data gap. + @objc + public var previousAccessLevel: DBXSharingAccessLevel? { guard let swift = swift.previousAccessLevel else { return nil } + return DBXSharingAccessLevel(swift: swift) + } + + /// New access level. + @objc + public var newAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.newAccessLevel) } + + @objc + public init(newAccessLevel: DBXSharingAccessLevel, previousAccessLevel: DBXSharingAccessLevel?) { + self.swift = TeamLog.SharedContentChangeMemberRoleDetails(newAccessLevel: newAccessLevel.swift, previousAccessLevel: previousAccessLevel?.swift) + } + + let swift: TeamLog.SharedContentChangeMemberRoleDetails + + public init(swift: TeamLog.SharedContentChangeMemberRoleDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentChangeMemberRoleType struct +@objc +public class DBXTeamLogSharedContentChangeMemberRoleType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentChangeMemberRoleType(description_: description_) + } + + let swift: TeamLog.SharedContentChangeMemberRoleType + + public init(swift: TeamLog.SharedContentChangeMemberRoleType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether members can see who viewed shared file/folder. +@objc +public class DBXTeamLogSharedContentChangeViewerInfoPolicyDetails: NSObject { + /// New viewer info policy. + @objc + public var newValue: DBXSharingViewerInfoPolicy { DBXSharingViewerInfoPolicy(swift: swift.newValue) } + /// Previous view info policy. + @objc + public var previousValue: DBXSharingViewerInfoPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXSharingViewerInfoPolicy(swift: swift) + } + + @objc + public init(newValue: DBXSharingViewerInfoPolicy, previousValue: DBXSharingViewerInfoPolicy?) { + self.swift = TeamLog.SharedContentChangeViewerInfoPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedContentChangeViewerInfoPolicyDetails + + public init(swift: TeamLog.SharedContentChangeViewerInfoPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentChangeViewerInfoPolicyType struct +@objc +public class DBXTeamLogSharedContentChangeViewerInfoPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentChangeViewerInfoPolicyType(description_: description_) + } + + let swift: TeamLog.SharedContentChangeViewerInfoPolicyType + + public init(swift: TeamLog.SharedContentChangeViewerInfoPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Acquired membership of shared file/folder by accepting invite. +@objc +public class DBXTeamLogSharedContentClaimInvitationDetails: NSObject { + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + + @objc + public init(sharedContentLink: String?) { + self.swift = TeamLog.SharedContentClaimInvitationDetails(sharedContentLink: sharedContentLink) + } + + let swift: TeamLog.SharedContentClaimInvitationDetails + + public init(swift: TeamLog.SharedContentClaimInvitationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentClaimInvitationType struct +@objc +public class DBXTeamLogSharedContentClaimInvitationType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentClaimInvitationType(description_: description_) + } + + let swift: TeamLog.SharedContentClaimInvitationType + + public init(swift: TeamLog.SharedContentClaimInvitationType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Copied shared file/folder to own Dropbox. +@objc +public class DBXTeamLogSharedContentCopyDetails: NSObject { + /// Shared content link. + @objc + public var sharedContentLink: String { swift.sharedContentLink } + /// The shared content owner. + @objc + public var sharedContentOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedContentOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// The path where the member saved the content. + @objc + public var destinationPath: String { swift.destinationPath } + + @objc + public init( + sharedContentLink: String, + sharedContentAccessLevel: DBXSharingAccessLevel, + destinationPath: String, + sharedContentOwner: DBXTeamLogUserLogInfo? + ) { + self.swift = TeamLog.SharedContentCopyDetails( + sharedContentLink: sharedContentLink, + sharedContentAccessLevel: sharedContentAccessLevel.swift, + destinationPath: destinationPath, + sharedContentOwner: sharedContentOwner?.swift + ) + } + + let swift: TeamLog.SharedContentCopyDetails + + public init(swift: TeamLog.SharedContentCopyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentCopyType struct +@objc +public class DBXTeamLogSharedContentCopyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentCopyType(description_: description_) + } + + let swift: TeamLog.SharedContentCopyType + + public init(swift: TeamLog.SharedContentCopyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downloaded shared file/folder. +@objc +public class DBXTeamLogSharedContentDownloadDetails: NSObject { + /// Shared content link. + @objc + public var sharedContentLink: String { swift.sharedContentLink } + /// The shared content owner. + @objc + public var sharedContentOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedContentOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + + @objc + public init(sharedContentLink: String, sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.SharedContentDownloadDetails( + sharedContentLink: sharedContentLink, + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentOwner: sharedContentOwner?.swift + ) + } + + let swift: TeamLog.SharedContentDownloadDetails + + public init(swift: TeamLog.SharedContentDownloadDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentDownloadType struct +@objc +public class DBXTeamLogSharedContentDownloadType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentDownloadType(description_: description_) + } + + let swift: TeamLog.SharedContentDownloadType + + public init(swift: TeamLog.SharedContentDownloadType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Left shared file/folder. +@objc +public class DBXTeamLogSharedContentRelinquishMembershipDetails: NSObject { + let swift: TeamLog.SharedContentRelinquishMembershipDetails + + public init(swift: TeamLog.SharedContentRelinquishMembershipDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRelinquishMembershipType struct +@objc +public class DBXTeamLogSharedContentRelinquishMembershipType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRelinquishMembershipType(description_: description_) + } + + let swift: TeamLog.SharedContentRelinquishMembershipType + + public init(swift: TeamLog.SharedContentRelinquishMembershipType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed invitee from shared file/folder before invite was accepted. +@objc +public class DBXTeamLogSharedContentRemoveInviteesDetails: NSObject { + /// A list of invitees. + @objc + public var invitees: [String] { swift.invitees } + + @objc + public init(invitees: [String]) { + self.swift = TeamLog.SharedContentRemoveInviteesDetails(invitees: invitees) + } + + let swift: TeamLog.SharedContentRemoveInviteesDetails + + public init(swift: TeamLog.SharedContentRemoveInviteesDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRemoveInviteesType struct +@objc +public class DBXTeamLogSharedContentRemoveInviteesType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRemoveInviteesType(description_: description_) + } + + let swift: TeamLog.SharedContentRemoveInviteesType + + public init(swift: TeamLog.SharedContentRemoveInviteesType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed link expiration date of shared file/folder. +@objc +public class DBXTeamLogSharedContentRemoveLinkExpiryDetails: NSObject { + /// Previous shared content link expiration date. Might be missing due to historical data gap. + @objc + public var previousValue: Date? { swift.previousValue } + + @objc + public init(previousValue: Date?) { + self.swift = TeamLog.SharedContentRemoveLinkExpiryDetails(previousValue: previousValue) + } + + let swift: TeamLog.SharedContentRemoveLinkExpiryDetails + + public init(swift: TeamLog.SharedContentRemoveLinkExpiryDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRemoveLinkExpiryType struct +@objc +public class DBXTeamLogSharedContentRemoveLinkExpiryType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRemoveLinkExpiryType(description_: description_) + } + + let swift: TeamLog.SharedContentRemoveLinkExpiryType + + public init(swift: TeamLog.SharedContentRemoveLinkExpiryType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed link password of shared file/folder. +@objc +public class DBXTeamLogSharedContentRemoveLinkPasswordDetails: NSObject { + let swift: TeamLog.SharedContentRemoveLinkPasswordDetails + + public init(swift: TeamLog.SharedContentRemoveLinkPasswordDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRemoveLinkPasswordType struct +@objc +public class DBXTeamLogSharedContentRemoveLinkPasswordType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRemoveLinkPasswordType(description_: description_) + } + + let swift: TeamLog.SharedContentRemoveLinkPasswordType + + public init(swift: TeamLog.SharedContentRemoveLinkPasswordType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed user/group from shared file/folder. +@objc +public class DBXTeamLogSharedContentRemoveMemberDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel? { guard let swift = swift.sharedContentAccessLevel else { return nil } + return DBXSharingAccessLevel(swift: swift) + } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel?) { + self.swift = TeamLog.SharedContentRemoveMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel?.swift) + } + + let swift: TeamLog.SharedContentRemoveMemberDetails + + public init(swift: TeamLog.SharedContentRemoveMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRemoveMemberType struct +@objc +public class DBXTeamLogSharedContentRemoveMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRemoveMemberType(description_: description_) + } + + let swift: TeamLog.SharedContentRemoveMemberType + + public init(swift: TeamLog.SharedContentRemoveMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Requested access to shared file/folder. +@objc +public class DBXTeamLogSharedContentRequestAccessDetails: NSObject { + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + + @objc + public init(sharedContentLink: String?) { + self.swift = TeamLog.SharedContentRequestAccessDetails(sharedContentLink: sharedContentLink) + } + + let swift: TeamLog.SharedContentRequestAccessDetails + + public init(swift: TeamLog.SharedContentRequestAccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRequestAccessType struct +@objc +public class DBXTeamLogSharedContentRequestAccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRequestAccessType(description_: description_) + } + + let swift: TeamLog.SharedContentRequestAccessType + + public init(swift: TeamLog.SharedContentRequestAccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored shared file/folder invitees. +@objc +public class DBXTeamLogSharedContentRestoreInviteesDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// A list of invitees. + @objc + public var invitees: [String] { swift.invitees } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, invitees: [String]) { + self.swift = TeamLog.SharedContentRestoreInviteesDetails(sharedContentAccessLevel: sharedContentAccessLevel.swift, invitees: invitees) + } + + let swift: TeamLog.SharedContentRestoreInviteesDetails + + public init(swift: TeamLog.SharedContentRestoreInviteesDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRestoreInviteesType struct +@objc +public class DBXTeamLogSharedContentRestoreInviteesType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRestoreInviteesType(description_: description_) + } + + let swift: TeamLog.SharedContentRestoreInviteesType + + public init(swift: TeamLog.SharedContentRestoreInviteesType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored users and/or groups to membership of shared file/folder. +@objc +public class DBXTeamLogSharedContentRestoreMemberDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel) { + self.swift = TeamLog.SharedContentRestoreMemberDetails(sharedContentAccessLevel: sharedContentAccessLevel.swift) + } + + let swift: TeamLog.SharedContentRestoreMemberDetails + + public init(swift: TeamLog.SharedContentRestoreMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentRestoreMemberType struct +@objc +public class DBXTeamLogSharedContentRestoreMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentRestoreMemberType(description_: description_) + } + + let swift: TeamLog.SharedContentRestoreMemberType + + public init(swift: TeamLog.SharedContentRestoreMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unshared file/folder by clearing membership. +@objc +public class DBXTeamLogSharedContentUnshareDetails: NSObject { + let swift: TeamLog.SharedContentUnshareDetails + + public init(swift: TeamLog.SharedContentUnshareDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentUnshareType struct +@objc +public class DBXTeamLogSharedContentUnshareType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentUnshareType(description_: description_) + } + + let swift: TeamLog.SharedContentUnshareType + + public init(swift: TeamLog.SharedContentUnshareType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Previewed shared file/folder. +@objc +public class DBXTeamLogSharedContentViewDetails: NSObject { + /// Shared content link. + @objc + public var sharedContentLink: String { swift.sharedContentLink } + /// The shared content owner. + @objc + public var sharedContentOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedContentOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + + @objc + public init(sharedContentLink: String, sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.SharedContentViewDetails( + sharedContentLink: sharedContentLink, + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentOwner: sharedContentOwner?.swift + ) + } + + let swift: TeamLog.SharedContentViewDetails + + public init(swift: TeamLog.SharedContentViewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedContentViewType struct +@objc +public class DBXTeamLogSharedContentViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedContentViewType(description_: description_) + } + + let swift: TeamLog.SharedContentViewType + + public init(swift: TeamLog.SharedContentViewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed who can access shared folder via link. +@objc +public class DBXTeamLogSharedFolderChangeLinkPolicyDetails: NSObject { + /// New shared folder link policy. + @objc + public var newValue: DBXSharingSharedLinkPolicy { DBXSharingSharedLinkPolicy(swift: swift.newValue) } + /// Previous shared folder link policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXSharingSharedLinkPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXSharingSharedLinkPolicy(swift: swift) + } + + @objc + public init(newValue: DBXSharingSharedLinkPolicy, previousValue: DBXSharingSharedLinkPolicy?) { + self.swift = TeamLog.SharedFolderChangeLinkPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedFolderChangeLinkPolicyDetails + + public init(swift: TeamLog.SharedFolderChangeLinkPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderChangeLinkPolicyType struct +@objc +public class DBXTeamLogSharedFolderChangeLinkPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderChangeLinkPolicyType(description_: description_) + } + + let swift: TeamLog.SharedFolderChangeLinkPolicyType + + public init(swift: TeamLog.SharedFolderChangeLinkPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether shared folder inherits members from parent folder. +@objc +public class DBXTeamLogSharedFolderChangeMembersInheritancePolicyDetails: NSObject { + /// New member inheritance policy. + @objc + public var newValue: DBXTeamLogSharedFolderMembersInheritancePolicy { DBXTeamLogSharedFolderMembersInheritancePolicy(swift: swift.newValue) } + /// Previous member inheritance policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogSharedFolderMembersInheritancePolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogSharedFolderMembersInheritancePolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogSharedFolderMembersInheritancePolicy, previousValue: DBXTeamLogSharedFolderMembersInheritancePolicy?) { + self.swift = TeamLog.SharedFolderChangeMembersInheritancePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedFolderChangeMembersInheritancePolicyDetails + + public init(swift: TeamLog.SharedFolderChangeMembersInheritancePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderChangeMembersInheritancePolicyType struct +@objc +public class DBXTeamLogSharedFolderChangeMembersInheritancePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderChangeMembersInheritancePolicyType(description_: description_) + } + + let swift: TeamLog.SharedFolderChangeMembersInheritancePolicyType + + public init(swift: TeamLog.SharedFolderChangeMembersInheritancePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed who can add/remove members of shared folder. +@objc +public class DBXTeamLogSharedFolderChangeMembersManagementPolicyDetails: NSObject { + /// New members management policy. + @objc + public var newValue: DBXSharingAclUpdatePolicy { DBXSharingAclUpdatePolicy(swift: swift.newValue) } + /// Previous members management policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXSharingAclUpdatePolicy? { guard let swift = swift.previousValue else { return nil } + return DBXSharingAclUpdatePolicy(swift: swift) + } + + @objc + public init(newValue: DBXSharingAclUpdatePolicy, previousValue: DBXSharingAclUpdatePolicy?) { + self.swift = TeamLog.SharedFolderChangeMembersManagementPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedFolderChangeMembersManagementPolicyDetails + + public init(swift: TeamLog.SharedFolderChangeMembersManagementPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderChangeMembersManagementPolicyType struct +@objc +public class DBXTeamLogSharedFolderChangeMembersManagementPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderChangeMembersManagementPolicyType(description_: description_) + } + + let swift: TeamLog.SharedFolderChangeMembersManagementPolicyType + + public init(swift: TeamLog.SharedFolderChangeMembersManagementPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed who can become member of shared folder. +@objc +public class DBXTeamLogSharedFolderChangeMembersPolicyDetails: NSObject { + /// New external invite policy. + @objc + public var newValue: DBXSharingMemberPolicy { DBXSharingMemberPolicy(swift: swift.newValue) } + /// Previous external invite policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXSharingMemberPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXSharingMemberPolicy(swift: swift) + } + + @objc + public init(newValue: DBXSharingMemberPolicy, previousValue: DBXSharingMemberPolicy?) { + self.swift = TeamLog.SharedFolderChangeMembersPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedFolderChangeMembersPolicyDetails + + public init(swift: TeamLog.SharedFolderChangeMembersPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderChangeMembersPolicyType struct +@objc +public class DBXTeamLogSharedFolderChangeMembersPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderChangeMembersPolicyType(description_: description_) + } + + let swift: TeamLog.SharedFolderChangeMembersPolicyType + + public init(swift: TeamLog.SharedFolderChangeMembersPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created shared folder. +@objc +public class DBXTeamLogSharedFolderCreateDetails: NSObject { + /// Target namespace ID. + @objc + public var targetNsId: String? { swift.targetNsId } + + @objc + public init(targetNsId: String?) { + self.swift = TeamLog.SharedFolderCreateDetails(targetNsId: targetNsId) + } + + let swift: TeamLog.SharedFolderCreateDetails + + public init(swift: TeamLog.SharedFolderCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderCreateType struct +@objc +public class DBXTeamLogSharedFolderCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderCreateType(description_: description_) + } + + let swift: TeamLog.SharedFolderCreateType + + public init(swift: TeamLog.SharedFolderCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Declined team member's invite to shared folder. +@objc +public class DBXTeamLogSharedFolderDeclineInvitationDetails: NSObject { + let swift: TeamLog.SharedFolderDeclineInvitationDetails + + public init(swift: TeamLog.SharedFolderDeclineInvitationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderDeclineInvitationType struct +@objc +public class DBXTeamLogSharedFolderDeclineInvitationType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderDeclineInvitationType(description_: description_) + } + + let swift: TeamLog.SharedFolderDeclineInvitationType + + public init(swift: TeamLog.SharedFolderDeclineInvitationType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Specifies if a shared folder inherits its members from the parent folder. +@objc +public class DBXTeamLogSharedFolderMembersInheritancePolicy: NSObject { + let swift: TeamLog.SharedFolderMembersInheritancePolicy + + public init(swift: TeamLog.SharedFolderMembersInheritancePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SharedFolderMembersInheritancePolicy) -> DBXTeamLogSharedFolderMembersInheritancePolicy { + switch swift { + case .dontInheritMembers: + return DBXTeamLogSharedFolderMembersInheritancePolicyDontInheritMembers() + case .inheritMembers: + return DBXTeamLogSharedFolderMembersInheritancePolicyInheritMembers() + case .other: + return DBXTeamLogSharedFolderMembersInheritancePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDontInheritMembers: DBXTeamLogSharedFolderMembersInheritancePolicyDontInheritMembers? { + self as? DBXTeamLogSharedFolderMembersInheritancePolicyDontInheritMembers + } + + @objc + public var asInheritMembers: DBXTeamLogSharedFolderMembersInheritancePolicyInheritMembers? { + self as? DBXTeamLogSharedFolderMembersInheritancePolicyInheritMembers + } + + @objc + public var asOther: DBXTeamLogSharedFolderMembersInheritancePolicyOther? { + self as? DBXTeamLogSharedFolderMembersInheritancePolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedFolderMembersInheritancePolicyDontInheritMembers: DBXTeamLogSharedFolderMembersInheritancePolicy { + @objc + public init() { + let swift = TeamLog.SharedFolderMembersInheritancePolicy.dontInheritMembers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedFolderMembersInheritancePolicyInheritMembers: DBXTeamLogSharedFolderMembersInheritancePolicy { + @objc + public init() { + let swift = TeamLog.SharedFolderMembersInheritancePolicy.inheritMembers + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedFolderMembersInheritancePolicyOther: DBXTeamLogSharedFolderMembersInheritancePolicy { + @objc + public init() { + let swift = TeamLog.SharedFolderMembersInheritancePolicy.other + super.init(swift: swift) + } +} + +/// Added shared folder to own Dropbox. +@objc +public class DBXTeamLogSharedFolderMountDetails: NSObject { + let swift: TeamLog.SharedFolderMountDetails + + public init(swift: TeamLog.SharedFolderMountDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderMountType struct +@objc +public class DBXTeamLogSharedFolderMountType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderMountType(description_: description_) + } + + let swift: TeamLog.SharedFolderMountType + + public init(swift: TeamLog.SharedFolderMountType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed parent of shared folder. +@objc +public class DBXTeamLogSharedFolderNestDetails: NSObject { + /// Previous parent namespace ID. + @objc + public var previousParentNsId: String? { swift.previousParentNsId } + /// New parent namespace ID. + @objc + public var newParentNsId: String? { swift.newParentNsId } + /// Previous namespace path. + @objc + public var previousNsPath: String? { swift.previousNsPath } + /// New namespace path. + @objc + public var newNsPath: String? { swift.newNsPath } + + @objc + public init(previousParentNsId: String?, newParentNsId: String?, previousNsPath: String?, newNsPath: String?) { + self.swift = TeamLog.SharedFolderNestDetails( + previousParentNsId: previousParentNsId, + newParentNsId: newParentNsId, + previousNsPath: previousNsPath, + newNsPath: newNsPath + ) + } + + let swift: TeamLog.SharedFolderNestDetails + + public init(swift: TeamLog.SharedFolderNestDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderNestType struct +@objc +public class DBXTeamLogSharedFolderNestType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderNestType(description_: description_) + } + + let swift: TeamLog.SharedFolderNestType + + public init(swift: TeamLog.SharedFolderNestType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Transferred ownership of shared folder to another member. +@objc +public class DBXTeamLogSharedFolderTransferOwnershipDetails: NSObject { + /// The email address of the previous shared folder owner. + @objc + public var previousOwnerEmail: String? { swift.previousOwnerEmail } + /// The email address of the new shared folder owner. + @objc + public var newOwnerEmail: String { swift.newOwnerEmail } + + @objc + public init(newOwnerEmail: String, previousOwnerEmail: String?) { + self.swift = TeamLog.SharedFolderTransferOwnershipDetails(newOwnerEmail: newOwnerEmail, previousOwnerEmail: previousOwnerEmail) + } + + let swift: TeamLog.SharedFolderTransferOwnershipDetails + + public init(swift: TeamLog.SharedFolderTransferOwnershipDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderTransferOwnershipType struct +@objc +public class DBXTeamLogSharedFolderTransferOwnershipType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderTransferOwnershipType(description_: description_) + } + + let swift: TeamLog.SharedFolderTransferOwnershipType + + public init(swift: TeamLog.SharedFolderTransferOwnershipType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted shared folder from Dropbox. +@objc +public class DBXTeamLogSharedFolderUnmountDetails: NSObject { + let swift: TeamLog.SharedFolderUnmountDetails + + public init(swift: TeamLog.SharedFolderUnmountDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedFolderUnmountType struct +@objc +public class DBXTeamLogSharedFolderUnmountType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedFolderUnmountType(description_: description_) + } + + let swift: TeamLog.SharedFolderUnmountType + + public init(swift: TeamLog.SharedFolderUnmountType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared link access level. +@objc +public class DBXTeamLogSharedLinkAccessLevel: NSObject { + let swift: TeamLog.SharedLinkAccessLevel + + public init(swift: TeamLog.SharedLinkAccessLevel) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SharedLinkAccessLevel) -> DBXTeamLogSharedLinkAccessLevel { + switch swift { + case .none: + return DBXTeamLogSharedLinkAccessLevelNone() + case .reader: + return DBXTeamLogSharedLinkAccessLevelReader() + case .writer: + return DBXTeamLogSharedLinkAccessLevelWriter() + case .other: + return DBXTeamLogSharedLinkAccessLevelOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNone: DBXTeamLogSharedLinkAccessLevelNone? { + self as? DBXTeamLogSharedLinkAccessLevelNone + } + + @objc + public var asReader: DBXTeamLogSharedLinkAccessLevelReader? { + self as? DBXTeamLogSharedLinkAccessLevelReader + } + + @objc + public var asWriter: DBXTeamLogSharedLinkAccessLevelWriter? { + self as? DBXTeamLogSharedLinkAccessLevelWriter + } + + @objc + public var asOther: DBXTeamLogSharedLinkAccessLevelOther? { + self as? DBXTeamLogSharedLinkAccessLevelOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkAccessLevelNone: DBXTeamLogSharedLinkAccessLevel { + @objc + public init() { + let swift = TeamLog.SharedLinkAccessLevel.none + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkAccessLevelReader: DBXTeamLogSharedLinkAccessLevel { + @objc + public init() { + let swift = TeamLog.SharedLinkAccessLevel.reader + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkAccessLevelWriter: DBXTeamLogSharedLinkAccessLevel { + @objc + public init() { + let swift = TeamLog.SharedLinkAccessLevel.writer + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkAccessLevelOther: DBXTeamLogSharedLinkAccessLevel { + @objc + public init() { + let swift = TeamLog.SharedLinkAccessLevel.other + super.init(swift: swift) + } +} + +/// Added shared link expiration date. +@objc +public class DBXTeamLogSharedLinkAddExpiryDetails: NSObject { + /// New shared link expiration date. + @objc + public var newValue: Date { swift.newValue } + + @objc + public init(newValue: Date) { + self.swift = TeamLog.SharedLinkAddExpiryDetails(newValue: newValue) + } + + let swift: TeamLog.SharedLinkAddExpiryDetails + + public init(swift: TeamLog.SharedLinkAddExpiryDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkAddExpiryType struct +@objc +public class DBXTeamLogSharedLinkAddExpiryType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkAddExpiryType(description_: description_) + } + + let swift: TeamLog.SharedLinkAddExpiryType + + public init(swift: TeamLog.SharedLinkAddExpiryType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed shared link expiration date. +@objc +public class DBXTeamLogSharedLinkChangeExpiryDetails: NSObject { + /// New shared link expiration date. Might be missing due to historical data gap. + @objc + public var newValue: Date? { swift.newValue } + /// Previous shared link expiration date. Might be missing due to historical data gap. + @objc + public var previousValue: Date? { swift.previousValue } + + @objc + public init(newValue: Date?, previousValue: Date?) { + self.swift = TeamLog.SharedLinkChangeExpiryDetails(newValue: newValue, previousValue: previousValue) + } + + let swift: TeamLog.SharedLinkChangeExpiryDetails + + public init(swift: TeamLog.SharedLinkChangeExpiryDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkChangeExpiryType struct +@objc +public class DBXTeamLogSharedLinkChangeExpiryType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkChangeExpiryType(description_: description_) + } + + let swift: TeamLog.SharedLinkChangeExpiryType + + public init(swift: TeamLog.SharedLinkChangeExpiryType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed visibility of shared link. +@objc +public class DBXTeamLogSharedLinkChangeVisibilityDetails: NSObject { + /// New shared link visibility. + @objc + public var newValue: DBXTeamLogSharedLinkVisibility { DBXTeamLogSharedLinkVisibility(swift: swift.newValue) } + /// Previous shared link visibility. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogSharedLinkVisibility? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogSharedLinkVisibility(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogSharedLinkVisibility, previousValue: DBXTeamLogSharedLinkVisibility?) { + self.swift = TeamLog.SharedLinkChangeVisibilityDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharedLinkChangeVisibilityDetails + + public init(swift: TeamLog.SharedLinkChangeVisibilityDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkChangeVisibilityType struct +@objc +public class DBXTeamLogSharedLinkChangeVisibilityType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkChangeVisibilityType(description_: description_) + } + + let swift: TeamLog.SharedLinkChangeVisibilityType + + public init(swift: TeamLog.SharedLinkChangeVisibilityType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added file/folder to Dropbox from shared link. +@objc +public class DBXTeamLogSharedLinkCopyDetails: NSObject { + /// Shared link owner details. Might be missing due to historical data gap. + @objc + public var sharedLinkOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedLinkOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + @objc + public init(sharedLinkOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.SharedLinkCopyDetails(sharedLinkOwner: sharedLinkOwner?.swift) + } + + let swift: TeamLog.SharedLinkCopyDetails + + public init(swift: TeamLog.SharedLinkCopyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkCopyType struct +@objc +public class DBXTeamLogSharedLinkCopyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkCopyType(description_: description_) + } + + let swift: TeamLog.SharedLinkCopyType + + public init(swift: TeamLog.SharedLinkCopyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created shared link. +@objc +public class DBXTeamLogSharedLinkCreateDetails: NSObject { + /// Defines who can access the shared link. Might be missing due to historical data gap. + @objc + public var sharedLinkAccessLevel: DBXTeamLogSharedLinkAccessLevel? { guard let swift = swift.sharedLinkAccessLevel else { return nil } + return DBXTeamLogSharedLinkAccessLevel(swift: swift) + } + + @objc + public init(sharedLinkAccessLevel: DBXTeamLogSharedLinkAccessLevel?) { + self.swift = TeamLog.SharedLinkCreateDetails(sharedLinkAccessLevel: sharedLinkAccessLevel?.swift) + } + + let swift: TeamLog.SharedLinkCreateDetails + + public init(swift: TeamLog.SharedLinkCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkCreateType struct +@objc +public class DBXTeamLogSharedLinkCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkCreateType(description_: description_) + } + + let swift: TeamLog.SharedLinkCreateType + + public init(swift: TeamLog.SharedLinkCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed shared link. +@objc +public class DBXTeamLogSharedLinkDisableDetails: NSObject { + /// Shared link owner details. Might be missing due to historical data gap. + @objc + public var sharedLinkOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedLinkOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + @objc + public init(sharedLinkOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.SharedLinkDisableDetails(sharedLinkOwner: sharedLinkOwner?.swift) + } + + let swift: TeamLog.SharedLinkDisableDetails + + public init(swift: TeamLog.SharedLinkDisableDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkDisableType struct +@objc +public class DBXTeamLogSharedLinkDisableType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkDisableType(description_: description_) + } + + let swift: TeamLog.SharedLinkDisableType + + public init(swift: TeamLog.SharedLinkDisableType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downloaded file/folder from shared link. +@objc +public class DBXTeamLogSharedLinkDownloadDetails: NSObject { + /// Shared link owner details. Might be missing due to historical data gap. + @objc + public var sharedLinkOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedLinkOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + @objc + public init(sharedLinkOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.SharedLinkDownloadDetails(sharedLinkOwner: sharedLinkOwner?.swift) + } + + let swift: TeamLog.SharedLinkDownloadDetails + + public init(swift: TeamLog.SharedLinkDownloadDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkDownloadType struct +@objc +public class DBXTeamLogSharedLinkDownloadType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkDownloadType(description_: description_) + } + + let swift: TeamLog.SharedLinkDownloadType + + public init(swift: TeamLog.SharedLinkDownloadType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed shared link expiration date. +@objc +public class DBXTeamLogSharedLinkRemoveExpiryDetails: NSObject { + /// Previous shared link expiration date. Might be missing due to historical data gap. + @objc + public var previousValue: Date? { swift.previousValue } + + @objc + public init(previousValue: Date?) { + self.swift = TeamLog.SharedLinkRemoveExpiryDetails(previousValue: previousValue) + } + + let swift: TeamLog.SharedLinkRemoveExpiryDetails + + public init(swift: TeamLog.SharedLinkRemoveExpiryDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkRemoveExpiryType struct +@objc +public class DBXTeamLogSharedLinkRemoveExpiryType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkRemoveExpiryType(description_: description_) + } + + let swift: TeamLog.SharedLinkRemoveExpiryType + + public init(swift: TeamLog.SharedLinkRemoveExpiryType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added an expiration date to the shared link. +@objc +public class DBXTeamLogSharedLinkSettingsAddExpirationDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + /// New shared content link expiration date. Might be missing due to historical data gap. + @objc + public var newValue: Date? { swift.newValue } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?, newValue: Date?) { + self.swift = TeamLog.SharedLinkSettingsAddExpirationDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink, + newValue: newValue + ) + } + + let swift: TeamLog.SharedLinkSettingsAddExpirationDetails + + public init(swift: TeamLog.SharedLinkSettingsAddExpirationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsAddExpirationType struct +@objc +public class DBXTeamLogSharedLinkSettingsAddExpirationType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsAddExpirationType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsAddExpirationType + + public init(swift: TeamLog.SharedLinkSettingsAddExpirationType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added a password to the shared link. +@objc +public class DBXTeamLogSharedLinkSettingsAddPasswordDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?) { + self.swift = TeamLog.SharedLinkSettingsAddPasswordDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink + ) + } + + let swift: TeamLog.SharedLinkSettingsAddPasswordDetails + + public init(swift: TeamLog.SharedLinkSettingsAddPasswordDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsAddPasswordType struct +@objc +public class DBXTeamLogSharedLinkSettingsAddPasswordType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsAddPasswordType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsAddPasswordType + + public init(swift: TeamLog.SharedLinkSettingsAddPasswordType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Disabled downloads. +@objc +public class DBXTeamLogSharedLinkSettingsAllowDownloadDisabledDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?) { + self.swift = TeamLog.SharedLinkSettingsAllowDownloadDisabledDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink + ) + } + + let swift: TeamLog.SharedLinkSettingsAllowDownloadDisabledDetails + + public init(swift: TeamLog.SharedLinkSettingsAllowDownloadDisabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsAllowDownloadDisabledType struct +@objc +public class DBXTeamLogSharedLinkSettingsAllowDownloadDisabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsAllowDownloadDisabledType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsAllowDownloadDisabledType + + public init(swift: TeamLog.SharedLinkSettingsAllowDownloadDisabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled downloads. +@objc +public class DBXTeamLogSharedLinkSettingsAllowDownloadEnabledDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?) { + self.swift = TeamLog.SharedLinkSettingsAllowDownloadEnabledDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink + ) + } + + let swift: TeamLog.SharedLinkSettingsAllowDownloadEnabledDetails + + public init(swift: TeamLog.SharedLinkSettingsAllowDownloadEnabledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsAllowDownloadEnabledType struct +@objc +public class DBXTeamLogSharedLinkSettingsAllowDownloadEnabledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsAllowDownloadEnabledType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsAllowDownloadEnabledType + + public init(swift: TeamLog.SharedLinkSettingsAllowDownloadEnabledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed the audience of the shared link. +@objc +public class DBXTeamLogSharedLinkSettingsChangeAudienceDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + /// New link audience value. + @objc + public var newValue: DBXSharingLinkAudience { DBXSharingLinkAudience(swift: swift.newValue) } + /// Previous link audience value. + @objc + public var previousValue: DBXSharingLinkAudience? { guard let swift = swift.previousValue else { return nil } + return DBXSharingLinkAudience(swift: swift) + } + + @objc + public init( + sharedContentAccessLevel: DBXSharingAccessLevel, + newValue: DBXSharingLinkAudience, + sharedContentLink: String?, + previousValue: DBXSharingLinkAudience? + ) { + self.swift = TeamLog.SharedLinkSettingsChangeAudienceDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + newValue: newValue.swift, + sharedContentLink: sharedContentLink, + previousValue: previousValue?.swift + ) + } + + let swift: TeamLog.SharedLinkSettingsChangeAudienceDetails + + public init(swift: TeamLog.SharedLinkSettingsChangeAudienceDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsChangeAudienceType struct +@objc +public class DBXTeamLogSharedLinkSettingsChangeAudienceType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsChangeAudienceType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsChangeAudienceType + + public init(swift: TeamLog.SharedLinkSettingsChangeAudienceType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed the expiration date of the shared link. +@objc +public class DBXTeamLogSharedLinkSettingsChangeExpirationDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + /// New shared content link expiration date. Might be missing due to historical data gap. + @objc + public var newValue: Date? { swift.newValue } + /// Previous shared content link expiration date. Might be missing due to historical data gap. + @objc + public var previousValue: Date? { swift.previousValue } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?, newValue: Date?, previousValue: Date?) { + self.swift = TeamLog.SharedLinkSettingsChangeExpirationDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink, + newValue: newValue, + previousValue: previousValue + ) + } + + let swift: TeamLog.SharedLinkSettingsChangeExpirationDetails + + public init(swift: TeamLog.SharedLinkSettingsChangeExpirationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsChangeExpirationType struct +@objc +public class DBXTeamLogSharedLinkSettingsChangeExpirationType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsChangeExpirationType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsChangeExpirationType + + public init(swift: TeamLog.SharedLinkSettingsChangeExpirationType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed the password of the shared link. +@objc +public class DBXTeamLogSharedLinkSettingsChangePasswordDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?) { + self.swift = TeamLog.SharedLinkSettingsChangePasswordDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink + ) + } + + let swift: TeamLog.SharedLinkSettingsChangePasswordDetails + + public init(swift: TeamLog.SharedLinkSettingsChangePasswordDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsChangePasswordType struct +@objc +public class DBXTeamLogSharedLinkSettingsChangePasswordType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsChangePasswordType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsChangePasswordType + + public init(swift: TeamLog.SharedLinkSettingsChangePasswordType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed the expiration date from the shared link. +@objc +public class DBXTeamLogSharedLinkSettingsRemoveExpirationDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + /// Previous shared link expiration date. Might be missing due to historical data gap. + @objc + public var previousValue: Date? { swift.previousValue } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?, previousValue: Date?) { + self.swift = TeamLog.SharedLinkSettingsRemoveExpirationDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink, + previousValue: previousValue + ) + } + + let swift: TeamLog.SharedLinkSettingsRemoveExpirationDetails + + public init(swift: TeamLog.SharedLinkSettingsRemoveExpirationDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsRemoveExpirationType struct +@objc +public class DBXTeamLogSharedLinkSettingsRemoveExpirationType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsRemoveExpirationType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsRemoveExpirationType + + public init(swift: TeamLog.SharedLinkSettingsRemoveExpirationType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed the password from the shared link. +@objc +public class DBXTeamLogSharedLinkSettingsRemovePasswordDetails: NSObject { + /// Shared content access level. + @objc + public var sharedContentAccessLevel: DBXSharingAccessLevel { DBXSharingAccessLevel(swift: swift.sharedContentAccessLevel) } + /// Shared content link. + @objc + public var sharedContentLink: String? { swift.sharedContentLink } + + @objc + public init(sharedContentAccessLevel: DBXSharingAccessLevel, sharedContentLink: String?) { + self.swift = TeamLog.SharedLinkSettingsRemovePasswordDetails( + sharedContentAccessLevel: sharedContentAccessLevel.swift, + sharedContentLink: sharedContentLink + ) + } + + let swift: TeamLog.SharedLinkSettingsRemovePasswordDetails + + public init(swift: TeamLog.SharedLinkSettingsRemovePasswordDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkSettingsRemovePasswordType struct +@objc +public class DBXTeamLogSharedLinkSettingsRemovePasswordType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkSettingsRemovePasswordType(description_: description_) + } + + let swift: TeamLog.SharedLinkSettingsRemovePasswordType + + public init(swift: TeamLog.SharedLinkSettingsRemovePasswordType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added members as audience of shared link. +@objc +public class DBXTeamLogSharedLinkShareDetails: NSObject { + /// Shared link owner details. Might be missing due to historical data gap. + @objc + public var sharedLinkOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedLinkOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + /// Users without a Dropbox account that were added as shared link audience. + @objc + public var externalUsers: [DBXTeamLogExternalUserLogInfo]? { swift.externalUsers?.map { DBXTeamLogExternalUserLogInfo(swift: $0) } } + + @objc + public init(sharedLinkOwner: DBXTeamLogUserLogInfo?, externalUsers: [DBXTeamLogExternalUserLogInfo]?) { + self.swift = TeamLog.SharedLinkShareDetails(sharedLinkOwner: sharedLinkOwner?.swift, externalUsers: externalUsers?.map(\.swift)) + } + + let swift: TeamLog.SharedLinkShareDetails + + public init(swift: TeamLog.SharedLinkShareDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkShareType struct +@objc +public class DBXTeamLogSharedLinkShareType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkShareType(description_: description_) + } + + let swift: TeamLog.SharedLinkShareType + + public init(swift: TeamLog.SharedLinkShareType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Opened shared link. +@objc +public class DBXTeamLogSharedLinkViewDetails: NSObject { + /// Shared link owner details. Might be missing due to historical data gap. + @objc + public var sharedLinkOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedLinkOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + @objc + public init(sharedLinkOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.SharedLinkViewDetails(sharedLinkOwner: sharedLinkOwner?.swift) + } + + let swift: TeamLog.SharedLinkViewDetails + + public init(swift: TeamLog.SharedLinkViewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedLinkViewType struct +@objc +public class DBXTeamLogSharedLinkViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedLinkViewType(description_: description_) + } + + let swift: TeamLog.SharedLinkViewType + + public init(swift: TeamLog.SharedLinkViewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Defines who has access to a shared link. +@objc +public class DBXTeamLogSharedLinkVisibility: NSObject { + let swift: TeamLog.SharedLinkVisibility + + public init(swift: TeamLog.SharedLinkVisibility) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SharedLinkVisibility) -> DBXTeamLogSharedLinkVisibility { + switch swift { + case .noOne: + return DBXTeamLogSharedLinkVisibilityNoOne() + case .password: + return DBXTeamLogSharedLinkVisibilityPassword() + case .public_: + return DBXTeamLogSharedLinkVisibilityPublic_() + case .teamOnly: + return DBXTeamLogSharedLinkVisibilityTeamOnly() + case .other: + return DBXTeamLogSharedLinkVisibilityOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNoOne: DBXTeamLogSharedLinkVisibilityNoOne? { + self as? DBXTeamLogSharedLinkVisibilityNoOne + } + + @objc + public var asPassword: DBXTeamLogSharedLinkVisibilityPassword? { + self as? DBXTeamLogSharedLinkVisibilityPassword + } + + @objc + public var asPublic_: DBXTeamLogSharedLinkVisibilityPublic_? { + self as? DBXTeamLogSharedLinkVisibilityPublic_ + } + + @objc + public var asTeamOnly: DBXTeamLogSharedLinkVisibilityTeamOnly? { + self as? DBXTeamLogSharedLinkVisibilityTeamOnly + } + + @objc + public var asOther: DBXTeamLogSharedLinkVisibilityOther? { + self as? DBXTeamLogSharedLinkVisibilityOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkVisibilityNoOne: DBXTeamLogSharedLinkVisibility { + @objc + public init() { + let swift = TeamLog.SharedLinkVisibility.noOne + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkVisibilityPassword: DBXTeamLogSharedLinkVisibility { + @objc + public init() { + let swift = TeamLog.SharedLinkVisibility.password + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkVisibilityPublic_: DBXTeamLogSharedLinkVisibility { + @objc + public init() { + let swift = TeamLog.SharedLinkVisibility.public_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkVisibilityTeamOnly: DBXTeamLogSharedLinkVisibility { + @objc + public init() { + let swift = TeamLog.SharedLinkVisibility.teamOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharedLinkVisibilityOther: DBXTeamLogSharedLinkVisibility { + @objc + public init() { + let swift = TeamLog.SharedLinkVisibility.other + super.init(swift: swift) + } +} + +/// Opened shared Paper doc. +@objc +public class DBXTeamLogSharedNoteOpenedDetails: NSObject { + let swift: TeamLog.SharedNoteOpenedDetails + + public init(swift: TeamLog.SharedNoteOpenedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharedNoteOpenedType struct +@objc +public class DBXTeamLogSharedNoteOpenedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharedNoteOpenedType(description_: description_) + } + + let swift: TeamLog.SharedNoteOpenedType + + public init(swift: TeamLog.SharedNoteOpenedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether team members can join shared folders owned outside team. +@objc +public class DBXTeamLogSharingChangeFolderJoinPolicyDetails: NSObject { + /// New external join policy. + @objc + public var newValue: DBXTeamLogSharingFolderJoinPolicy { DBXTeamLogSharingFolderJoinPolicy(swift: swift.newValue) } + /// Previous external join policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogSharingFolderJoinPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogSharingFolderJoinPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogSharingFolderJoinPolicy, previousValue: DBXTeamLogSharingFolderJoinPolicy?) { + self.swift = TeamLog.SharingChangeFolderJoinPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharingChangeFolderJoinPolicyDetails + + public init(swift: TeamLog.SharingChangeFolderJoinPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingChangeFolderJoinPolicyType struct +@objc +public class DBXTeamLogSharingChangeFolderJoinPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharingChangeFolderJoinPolicyType(description_: description_) + } + + let swift: TeamLog.SharingChangeFolderJoinPolicyType + + public init(swift: TeamLog.SharingChangeFolderJoinPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed the allow remove or change expiration policy for the links shared outside of the team. +@objc +public class DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogEnforceLinkPasswordPolicy { DBXTeamLogEnforceLinkPasswordPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogEnforceLinkPasswordPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogEnforceLinkPasswordPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogEnforceLinkPasswordPolicy, previousValue: DBXTeamLogEnforceLinkPasswordPolicy?) { + self.swift = TeamLog.SharingChangeLinkAllowChangeExpirationPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharingChangeLinkAllowChangeExpirationPolicyDetails + + public init(swift: TeamLog.SharingChangeLinkAllowChangeExpirationPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingChangeLinkAllowChangeExpirationPolicyType struct +@objc +public class DBXTeamLogSharingChangeLinkAllowChangeExpirationPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharingChangeLinkAllowChangeExpirationPolicyType(description_: description_) + } + + let swift: TeamLog.SharingChangeLinkAllowChangeExpirationPolicyType + + public init(swift: TeamLog.SharingChangeLinkAllowChangeExpirationPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed the default expiration for the links shared outside of the team. +@objc +public class DBXTeamLogSharingChangeLinkDefaultExpirationPolicyDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogDefaultLinkExpirationDaysPolicy { DBXTeamLogDefaultLinkExpirationDaysPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogDefaultLinkExpirationDaysPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogDefaultLinkExpirationDaysPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogDefaultLinkExpirationDaysPolicy, previousValue: DBXTeamLogDefaultLinkExpirationDaysPolicy?) { + self.swift = TeamLog.SharingChangeLinkDefaultExpirationPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharingChangeLinkDefaultExpirationPolicyDetails + + public init(swift: TeamLog.SharingChangeLinkDefaultExpirationPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingChangeLinkDefaultExpirationPolicyType struct +@objc +public class DBXTeamLogSharingChangeLinkDefaultExpirationPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharingChangeLinkDefaultExpirationPolicyType(description_: description_) + } + + let swift: TeamLog.SharingChangeLinkDefaultExpirationPolicyType + + public init(swift: TeamLog.SharingChangeLinkDefaultExpirationPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed the password requirement for the links shared outside of the team. +@objc +public class DBXTeamLogSharingChangeLinkEnforcePasswordPolicyDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogChangeLinkExpirationPolicy { DBXTeamLogChangeLinkExpirationPolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogChangeLinkExpirationPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogChangeLinkExpirationPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogChangeLinkExpirationPolicy, previousValue: DBXTeamLogChangeLinkExpirationPolicy?) { + self.swift = TeamLog.SharingChangeLinkEnforcePasswordPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharingChangeLinkEnforcePasswordPolicyDetails + + public init(swift: TeamLog.SharingChangeLinkEnforcePasswordPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingChangeLinkEnforcePasswordPolicyType struct +@objc +public class DBXTeamLogSharingChangeLinkEnforcePasswordPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharingChangeLinkEnforcePasswordPolicyType(description_: description_) + } + + let swift: TeamLog.SharingChangeLinkEnforcePasswordPolicyType + + public init(swift: TeamLog.SharingChangeLinkEnforcePasswordPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether members can share links outside team, and if links are accessible only by team members or anyone +/// by default. +@objc +public class DBXTeamLogSharingChangeLinkPolicyDetails: NSObject { + /// New external link accessibility policy. + @objc + public var newValue: DBXTeamLogSharingLinkPolicy { DBXTeamLogSharingLinkPolicy(swift: swift.newValue) } + /// Previous external link accessibility policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogSharingLinkPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogSharingLinkPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogSharingLinkPolicy, previousValue: DBXTeamLogSharingLinkPolicy?) { + self.swift = TeamLog.SharingChangeLinkPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharingChangeLinkPolicyDetails + + public init(swift: TeamLog.SharingChangeLinkPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingChangeLinkPolicyType struct +@objc +public class DBXTeamLogSharingChangeLinkPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharingChangeLinkPolicyType(description_: description_) + } + + let swift: TeamLog.SharingChangeLinkPolicyType + + public init(swift: TeamLog.SharingChangeLinkPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed whether members can share files/folders outside team. +@objc +public class DBXTeamLogSharingChangeMemberPolicyDetails: NSObject { + /// New external invite policy. + @objc + public var newValue: DBXTeamLogSharingMemberPolicy { DBXTeamLogSharingMemberPolicy(swift: swift.newValue) } + /// Previous external invite policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogSharingMemberPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogSharingMemberPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogSharingMemberPolicy, previousValue: DBXTeamLogSharingMemberPolicy?) { + self.swift = TeamLog.SharingChangeMemberPolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SharingChangeMemberPolicyDetails + + public init(swift: TeamLog.SharingChangeMemberPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SharingChangeMemberPolicyType struct +@objc +public class DBXTeamLogSharingChangeMemberPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SharingChangeMemberPolicyType(description_: description_) + } + + let swift: TeamLog.SharingChangeMemberPolicyType + + public init(swift: TeamLog.SharingChangeMemberPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling if team members can join shared folders owned by non team members. +@objc +public class DBXTeamLogSharingFolderJoinPolicy: NSObject { + let swift: TeamLog.SharingFolderJoinPolicy + + public init(swift: TeamLog.SharingFolderJoinPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SharingFolderJoinPolicy) -> DBXTeamLogSharingFolderJoinPolicy { + switch swift { + case .fromAnyone: + return DBXTeamLogSharingFolderJoinPolicyFromAnyone() + case .fromTeamOnly: + return DBXTeamLogSharingFolderJoinPolicyFromTeamOnly() + case .other: + return DBXTeamLogSharingFolderJoinPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFromAnyone: DBXTeamLogSharingFolderJoinPolicyFromAnyone? { + self as? DBXTeamLogSharingFolderJoinPolicyFromAnyone + } + + @objc + public var asFromTeamOnly: DBXTeamLogSharingFolderJoinPolicyFromTeamOnly? { + self as? DBXTeamLogSharingFolderJoinPolicyFromTeamOnly + } + + @objc + public var asOther: DBXTeamLogSharingFolderJoinPolicyOther? { + self as? DBXTeamLogSharingFolderJoinPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingFolderJoinPolicyFromAnyone: DBXTeamLogSharingFolderJoinPolicy { + @objc + public init() { + let swift = TeamLog.SharingFolderJoinPolicy.fromAnyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingFolderJoinPolicyFromTeamOnly: DBXTeamLogSharingFolderJoinPolicy { + @objc + public init() { + let swift = TeamLog.SharingFolderJoinPolicy.fromTeamOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingFolderJoinPolicyOther: DBXTeamLogSharingFolderJoinPolicy { + @objc + public init() { + let swift = TeamLog.SharingFolderJoinPolicy.other + super.init(swift: swift) + } +} + +/// Policy for controlling if team members can share links externally +@objc +public class DBXTeamLogSharingLinkPolicy: NSObject { + let swift: TeamLog.SharingLinkPolicy + + public init(swift: TeamLog.SharingLinkPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SharingLinkPolicy) -> DBXTeamLogSharingLinkPolicy { + switch swift { + case .defaultNoOne: + return DBXTeamLogSharingLinkPolicyDefaultNoOne() + case .defaultPrivate: + return DBXTeamLogSharingLinkPolicyDefaultPrivate() + case .defaultPublic: + return DBXTeamLogSharingLinkPolicyDefaultPublic() + case .onlyPrivate: + return DBXTeamLogSharingLinkPolicyOnlyPrivate() + case .other: + return DBXTeamLogSharingLinkPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefaultNoOne: DBXTeamLogSharingLinkPolicyDefaultNoOne? { + self as? DBXTeamLogSharingLinkPolicyDefaultNoOne + } + + @objc + public var asDefaultPrivate: DBXTeamLogSharingLinkPolicyDefaultPrivate? { + self as? DBXTeamLogSharingLinkPolicyDefaultPrivate + } + + @objc + public var asDefaultPublic: DBXTeamLogSharingLinkPolicyDefaultPublic? { + self as? DBXTeamLogSharingLinkPolicyDefaultPublic + } + + @objc + public var asOnlyPrivate: DBXTeamLogSharingLinkPolicyOnlyPrivate? { + self as? DBXTeamLogSharingLinkPolicyOnlyPrivate + } + + @objc + public var asOther: DBXTeamLogSharingLinkPolicyOther? { + self as? DBXTeamLogSharingLinkPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingLinkPolicyDefaultNoOne: DBXTeamLogSharingLinkPolicy { + @objc + public init() { + let swift = TeamLog.SharingLinkPolicy.defaultNoOne + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingLinkPolicyDefaultPrivate: DBXTeamLogSharingLinkPolicy { + @objc + public init() { + let swift = TeamLog.SharingLinkPolicy.defaultPrivate + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingLinkPolicyDefaultPublic: DBXTeamLogSharingLinkPolicy { + @objc + public init() { + let swift = TeamLog.SharingLinkPolicy.defaultPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingLinkPolicyOnlyPrivate: DBXTeamLogSharingLinkPolicy { + @objc + public init() { + let swift = TeamLog.SharingLinkPolicy.onlyPrivate + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingLinkPolicyOther: DBXTeamLogSharingLinkPolicy { + @objc + public init() { + let swift = TeamLog.SharingLinkPolicy.other + super.init(swift: swift) + } +} + +/// External sharing policy +@objc +public class DBXTeamLogSharingMemberPolicy: NSObject { + let swift: TeamLog.SharingMemberPolicy + + public init(swift: TeamLog.SharingMemberPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SharingMemberPolicy) -> DBXTeamLogSharingMemberPolicy { + switch swift { + case .allow: + return DBXTeamLogSharingMemberPolicyAllow() + case .forbid: + return DBXTeamLogSharingMemberPolicyForbid() + case .forbidWithExclusions: + return DBXTeamLogSharingMemberPolicyForbidWithExclusions() + case .other: + return DBXTeamLogSharingMemberPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAllow: DBXTeamLogSharingMemberPolicyAllow? { + self as? DBXTeamLogSharingMemberPolicyAllow + } + + @objc + public var asForbid: DBXTeamLogSharingMemberPolicyForbid? { + self as? DBXTeamLogSharingMemberPolicyForbid + } + + @objc + public var asForbidWithExclusions: DBXTeamLogSharingMemberPolicyForbidWithExclusions? { + self as? DBXTeamLogSharingMemberPolicyForbidWithExclusions + } + + @objc + public var asOther: DBXTeamLogSharingMemberPolicyOther? { + self as? DBXTeamLogSharingMemberPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingMemberPolicyAllow: DBXTeamLogSharingMemberPolicy { + @objc + public init() { + let swift = TeamLog.SharingMemberPolicy.allow + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingMemberPolicyForbid: DBXTeamLogSharingMemberPolicy { + @objc + public init() { + let swift = TeamLog.SharingMemberPolicy.forbid + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingMemberPolicyForbidWithExclusions: DBXTeamLogSharingMemberPolicy { + @objc + public init() { + let swift = TeamLog.SharingMemberPolicy.forbidWithExclusions + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSharingMemberPolicyOther: DBXTeamLogSharingMemberPolicy { + @objc + public init() { + let swift = TeamLog.SharingMemberPolicy.other + super.init(swift: swift) + } +} + +/// Disabled downloads for link. +@objc +public class DBXTeamLogShmodelDisableDownloadsDetails: NSObject { + /// Shared link owner details. Might be missing due to historical data gap. + @objc + public var sharedLinkOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedLinkOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + @objc + public init(sharedLinkOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.ShmodelDisableDownloadsDetails(sharedLinkOwner: sharedLinkOwner?.swift) + } + + let swift: TeamLog.ShmodelDisableDownloadsDetails + + public init(swift: TeamLog.ShmodelDisableDownloadsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShmodelDisableDownloadsType struct +@objc +public class DBXTeamLogShmodelDisableDownloadsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShmodelDisableDownloadsType(description_: description_) + } + + let swift: TeamLog.ShmodelDisableDownloadsType + + public init(swift: TeamLog.ShmodelDisableDownloadsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled downloads for link. +@objc +public class DBXTeamLogShmodelEnableDownloadsDetails: NSObject { + /// Shared link owner details. Might be missing due to historical data gap. + @objc + public var sharedLinkOwner: DBXTeamLogUserLogInfo? { guard let swift = swift.sharedLinkOwner else { return nil } + return DBXTeamLogUserLogInfo(swift: swift) + } + + @objc + public init(sharedLinkOwner: DBXTeamLogUserLogInfo?) { + self.swift = TeamLog.ShmodelEnableDownloadsDetails(sharedLinkOwner: sharedLinkOwner?.swift) + } + + let swift: TeamLog.ShmodelEnableDownloadsDetails + + public init(swift: TeamLog.ShmodelEnableDownloadsDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShmodelEnableDownloadsType struct +@objc +public class DBXTeamLogShmodelEnableDownloadsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShmodelEnableDownloadsType(description_: description_) + } + + let swift: TeamLog.ShmodelEnableDownloadsType + + public init(swift: TeamLog.ShmodelEnableDownloadsType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Shared link with group. +@objc +public class DBXTeamLogShmodelGroupShareDetails: NSObject { + let swift: TeamLog.ShmodelGroupShareDetails + + public init(swift: TeamLog.ShmodelGroupShareDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShmodelGroupShareType struct +@objc +public class DBXTeamLogShmodelGroupShareType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShmodelGroupShareType(description_: description_) + } + + let swift: TeamLog.ShmodelGroupShareType + + public init(swift: TeamLog.ShmodelGroupShareType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Granted access to showcase. +@objc +public class DBXTeamLogShowcaseAccessGrantedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseAccessGrantedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseAccessGrantedDetails + + public init(swift: TeamLog.ShowcaseAccessGrantedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseAccessGrantedType struct +@objc +public class DBXTeamLogShowcaseAccessGrantedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseAccessGrantedType(description_: description_) + } + + let swift: TeamLog.ShowcaseAccessGrantedType + + public init(swift: TeamLog.ShowcaseAccessGrantedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added member to showcase. +@objc +public class DBXTeamLogShowcaseAddMemberDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseAddMemberDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseAddMemberDetails + + public init(swift: TeamLog.ShowcaseAddMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseAddMemberType struct +@objc +public class DBXTeamLogShowcaseAddMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseAddMemberType(description_: description_) + } + + let swift: TeamLog.ShowcaseAddMemberType + + public init(swift: TeamLog.ShowcaseAddMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Archived showcase. +@objc +public class DBXTeamLogShowcaseArchivedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseArchivedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseArchivedDetails + + public init(swift: TeamLog.ShowcaseArchivedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseArchivedType struct +@objc +public class DBXTeamLogShowcaseArchivedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseArchivedType(description_: description_) + } + + let swift: TeamLog.ShowcaseArchivedType + + public init(swift: TeamLog.ShowcaseArchivedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled downloading files from Dropbox Showcase for team. +@objc +public class DBXTeamLogShowcaseChangeDownloadPolicyDetails: NSObject { + /// New Dropbox Showcase download policy. + @objc + public var newValue: DBXTeamLogShowcaseDownloadPolicy { DBXTeamLogShowcaseDownloadPolicy(swift: swift.newValue) } + /// Previous Dropbox Showcase download policy. + @objc + public var previousValue: DBXTeamLogShowcaseDownloadPolicy { DBXTeamLogShowcaseDownloadPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogShowcaseDownloadPolicy, previousValue: DBXTeamLogShowcaseDownloadPolicy) { + self.swift = TeamLog.ShowcaseChangeDownloadPolicyDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.ShowcaseChangeDownloadPolicyDetails + + public init(swift: TeamLog.ShowcaseChangeDownloadPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseChangeDownloadPolicyType struct +@objc +public class DBXTeamLogShowcaseChangeDownloadPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseChangeDownloadPolicyType(description_: description_) + } + + let swift: TeamLog.ShowcaseChangeDownloadPolicyType + + public init(swift: TeamLog.ShowcaseChangeDownloadPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled Dropbox Showcase for team. +@objc +public class DBXTeamLogShowcaseChangeEnabledPolicyDetails: NSObject { + /// New Dropbox Showcase policy. + @objc + public var newValue: DBXTeamLogShowcaseEnabledPolicy { DBXTeamLogShowcaseEnabledPolicy(swift: swift.newValue) } + /// Previous Dropbox Showcase policy. + @objc + public var previousValue: DBXTeamLogShowcaseEnabledPolicy { DBXTeamLogShowcaseEnabledPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogShowcaseEnabledPolicy, previousValue: DBXTeamLogShowcaseEnabledPolicy) { + self.swift = TeamLog.ShowcaseChangeEnabledPolicyDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.ShowcaseChangeEnabledPolicyDetails + + public init(swift: TeamLog.ShowcaseChangeEnabledPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseChangeEnabledPolicyType struct +@objc +public class DBXTeamLogShowcaseChangeEnabledPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseChangeEnabledPolicyType(description_: description_) + } + + let swift: TeamLog.ShowcaseChangeEnabledPolicyType + + public init(swift: TeamLog.ShowcaseChangeEnabledPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled sharing Dropbox Showcase externally for team. +@objc +public class DBXTeamLogShowcaseChangeExternalSharingPolicyDetails: NSObject { + /// New Dropbox Showcase external sharing policy. + @objc + public var newValue: DBXTeamLogShowcaseExternalSharingPolicy { DBXTeamLogShowcaseExternalSharingPolicy(swift: swift.newValue) } + /// Previous Dropbox Showcase external sharing policy. + @objc + public var previousValue: DBXTeamLogShowcaseExternalSharingPolicy { DBXTeamLogShowcaseExternalSharingPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogShowcaseExternalSharingPolicy, previousValue: DBXTeamLogShowcaseExternalSharingPolicy) { + self.swift = TeamLog.ShowcaseChangeExternalSharingPolicyDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.ShowcaseChangeExternalSharingPolicyDetails + + public init(swift: TeamLog.ShowcaseChangeExternalSharingPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseChangeExternalSharingPolicyType struct +@objc +public class DBXTeamLogShowcaseChangeExternalSharingPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseChangeExternalSharingPolicyType(description_: description_) + } + + let swift: TeamLog.ShowcaseChangeExternalSharingPolicyType + + public init(swift: TeamLog.ShowcaseChangeExternalSharingPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created showcase. +@objc +public class DBXTeamLogShowcaseCreatedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseCreatedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseCreatedDetails + + public init(swift: TeamLog.ShowcaseCreatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseCreatedType struct +@objc +public class DBXTeamLogShowcaseCreatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseCreatedType(description_: description_) + } + + let swift: TeamLog.ShowcaseCreatedType + + public init(swift: TeamLog.ShowcaseCreatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted showcase comment. +@objc +public class DBXTeamLogShowcaseDeleteCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.ShowcaseDeleteCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.ShowcaseDeleteCommentDetails + + public init(swift: TeamLog.ShowcaseDeleteCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseDeleteCommentType struct +@objc +public class DBXTeamLogShowcaseDeleteCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseDeleteCommentType(description_: description_) + } + + let swift: TeamLog.ShowcaseDeleteCommentType + + public init(swift: TeamLog.ShowcaseDeleteCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Showcase document's logged information. +@objc +public class DBXTeamLogShowcaseDocumentLogInfo: NSObject { + /// Showcase document Id. + @objc + public var showcaseId: String { swift.showcaseId } + /// Showcase document title. + @objc + public var showcaseTitle: String { swift.showcaseTitle } + + @objc + public init(showcaseId: String, showcaseTitle: String) { + self.swift = TeamLog.ShowcaseDocumentLogInfo(showcaseId: showcaseId, showcaseTitle: showcaseTitle) + } + + let swift: TeamLog.ShowcaseDocumentLogInfo + + public init(swift: TeamLog.ShowcaseDocumentLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling if files can be downloaded from Showcases by team members +@objc +public class DBXTeamLogShowcaseDownloadPolicy: NSObject { + let swift: TeamLog.ShowcaseDownloadPolicy + + public init(swift: TeamLog.ShowcaseDownloadPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ShowcaseDownloadPolicy) -> DBXTeamLogShowcaseDownloadPolicy { + switch swift { + case .disabled: + return DBXTeamLogShowcaseDownloadPolicyDisabled() + case .enabled: + return DBXTeamLogShowcaseDownloadPolicyEnabled() + case .other: + return DBXTeamLogShowcaseDownloadPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogShowcaseDownloadPolicyDisabled? { + self as? DBXTeamLogShowcaseDownloadPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogShowcaseDownloadPolicyEnabled? { + self as? DBXTeamLogShowcaseDownloadPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogShowcaseDownloadPolicyOther? { + self as? DBXTeamLogShowcaseDownloadPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseDownloadPolicyDisabled: DBXTeamLogShowcaseDownloadPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseDownloadPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseDownloadPolicyEnabled: DBXTeamLogShowcaseDownloadPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseDownloadPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseDownloadPolicyOther: DBXTeamLogShowcaseDownloadPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseDownloadPolicy.other + super.init(swift: swift) + } +} + +/// Edited showcase comment. +@objc +public class DBXTeamLogShowcaseEditCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.ShowcaseEditCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.ShowcaseEditCommentDetails + + public init(swift: TeamLog.ShowcaseEditCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseEditCommentType struct +@objc +public class DBXTeamLogShowcaseEditCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseEditCommentType(description_: description_) + } + + let swift: TeamLog.ShowcaseEditCommentType + + public init(swift: TeamLog.ShowcaseEditCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited showcase. +@objc +public class DBXTeamLogShowcaseEditedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseEditedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseEditedDetails + + public init(swift: TeamLog.ShowcaseEditedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseEditedType struct +@objc +public class DBXTeamLogShowcaseEditedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseEditedType(description_: description_) + } + + let swift: TeamLog.ShowcaseEditedType + + public init(swift: TeamLog.ShowcaseEditedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling whether Showcase is enabled. +@objc +public class DBXTeamLogShowcaseEnabledPolicy: NSObject { + let swift: TeamLog.ShowcaseEnabledPolicy + + public init(swift: TeamLog.ShowcaseEnabledPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ShowcaseEnabledPolicy) -> DBXTeamLogShowcaseEnabledPolicy { + switch swift { + case .disabled: + return DBXTeamLogShowcaseEnabledPolicyDisabled() + case .enabled: + return DBXTeamLogShowcaseEnabledPolicyEnabled() + case .other: + return DBXTeamLogShowcaseEnabledPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogShowcaseEnabledPolicyDisabled? { + self as? DBXTeamLogShowcaseEnabledPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogShowcaseEnabledPolicyEnabled? { + self as? DBXTeamLogShowcaseEnabledPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogShowcaseEnabledPolicyOther? { + self as? DBXTeamLogShowcaseEnabledPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseEnabledPolicyDisabled: DBXTeamLogShowcaseEnabledPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseEnabledPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseEnabledPolicyEnabled: DBXTeamLogShowcaseEnabledPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseEnabledPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseEnabledPolicyOther: DBXTeamLogShowcaseEnabledPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseEnabledPolicy.other + super.init(swift: swift) + } +} + +/// Policy for controlling if team members can share Showcases externally. +@objc +public class DBXTeamLogShowcaseExternalSharingPolicy: NSObject { + let swift: TeamLog.ShowcaseExternalSharingPolicy + + public init(swift: TeamLog.ShowcaseExternalSharingPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ShowcaseExternalSharingPolicy) -> DBXTeamLogShowcaseExternalSharingPolicy { + switch swift { + case .disabled: + return DBXTeamLogShowcaseExternalSharingPolicyDisabled() + case .enabled: + return DBXTeamLogShowcaseExternalSharingPolicyEnabled() + case .other: + return DBXTeamLogShowcaseExternalSharingPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogShowcaseExternalSharingPolicyDisabled? { + self as? DBXTeamLogShowcaseExternalSharingPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogShowcaseExternalSharingPolicyEnabled? { + self as? DBXTeamLogShowcaseExternalSharingPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogShowcaseExternalSharingPolicyOther? { + self as? DBXTeamLogShowcaseExternalSharingPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseExternalSharingPolicyDisabled: DBXTeamLogShowcaseExternalSharingPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseExternalSharingPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseExternalSharingPolicyEnabled: DBXTeamLogShowcaseExternalSharingPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseExternalSharingPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogShowcaseExternalSharingPolicyOther: DBXTeamLogShowcaseExternalSharingPolicy { + @objc + public init() { + let swift = TeamLog.ShowcaseExternalSharingPolicy.other + super.init(swift: swift) + } +} + +/// Added file to showcase. +@objc +public class DBXTeamLogShowcaseFileAddedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseFileAddedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseFileAddedDetails + + public init(swift: TeamLog.ShowcaseFileAddedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseFileAddedType struct +@objc +public class DBXTeamLogShowcaseFileAddedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseFileAddedType(description_: description_) + } + + let swift: TeamLog.ShowcaseFileAddedType + + public init(swift: TeamLog.ShowcaseFileAddedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downloaded file from showcase. +@objc +public class DBXTeamLogShowcaseFileDownloadDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Showcase download type. + @objc + public var downloadType: String { swift.downloadType } + + @objc + public init(eventUuid: String, downloadType: String) { + self.swift = TeamLog.ShowcaseFileDownloadDetails(eventUuid: eventUuid, downloadType: downloadType) + } + + let swift: TeamLog.ShowcaseFileDownloadDetails + + public init(swift: TeamLog.ShowcaseFileDownloadDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseFileDownloadType struct +@objc +public class DBXTeamLogShowcaseFileDownloadType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseFileDownloadType(description_: description_) + } + + let swift: TeamLog.ShowcaseFileDownloadType + + public init(swift: TeamLog.ShowcaseFileDownloadType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed file from showcase. +@objc +public class DBXTeamLogShowcaseFileRemovedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseFileRemovedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseFileRemovedDetails + + public init(swift: TeamLog.ShowcaseFileRemovedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseFileRemovedType struct +@objc +public class DBXTeamLogShowcaseFileRemovedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseFileRemovedType(description_: description_) + } + + let swift: TeamLog.ShowcaseFileRemovedType + + public init(swift: TeamLog.ShowcaseFileRemovedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Viewed file in showcase. +@objc +public class DBXTeamLogShowcaseFileViewDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseFileViewDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseFileViewDetails + + public init(swift: TeamLog.ShowcaseFileViewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseFileViewType struct +@objc +public class DBXTeamLogShowcaseFileViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseFileViewType(description_: description_) + } + + let swift: TeamLog.ShowcaseFileViewType + + public init(swift: TeamLog.ShowcaseFileViewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Permanently deleted showcase. +@objc +public class DBXTeamLogShowcasePermanentlyDeletedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcasePermanentlyDeletedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcasePermanentlyDeletedDetails + + public init(swift: TeamLog.ShowcasePermanentlyDeletedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcasePermanentlyDeletedType struct +@objc +public class DBXTeamLogShowcasePermanentlyDeletedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcasePermanentlyDeletedType(description_: description_) + } + + let swift: TeamLog.ShowcasePermanentlyDeletedType + + public init(swift: TeamLog.ShowcasePermanentlyDeletedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added showcase comment. +@objc +public class DBXTeamLogShowcasePostCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.ShowcasePostCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.ShowcasePostCommentDetails + + public init(swift: TeamLog.ShowcasePostCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcasePostCommentType struct +@objc +public class DBXTeamLogShowcasePostCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcasePostCommentType(description_: description_) + } + + let swift: TeamLog.ShowcasePostCommentType + + public init(swift: TeamLog.ShowcasePostCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed member from showcase. +@objc +public class DBXTeamLogShowcaseRemoveMemberDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseRemoveMemberDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseRemoveMemberDetails + + public init(swift: TeamLog.ShowcaseRemoveMemberDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseRemoveMemberType struct +@objc +public class DBXTeamLogShowcaseRemoveMemberType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseRemoveMemberType(description_: description_) + } + + let swift: TeamLog.ShowcaseRemoveMemberType + + public init(swift: TeamLog.ShowcaseRemoveMemberType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed showcase. +@objc +public class DBXTeamLogShowcaseRenamedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseRenamedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseRenamedDetails + + public init(swift: TeamLog.ShowcaseRenamedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseRenamedType struct +@objc +public class DBXTeamLogShowcaseRenamedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseRenamedType(description_: description_) + } + + let swift: TeamLog.ShowcaseRenamedType + + public init(swift: TeamLog.ShowcaseRenamedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Requested access to showcase. +@objc +public class DBXTeamLogShowcaseRequestAccessDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseRequestAccessDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseRequestAccessDetails + + public init(swift: TeamLog.ShowcaseRequestAccessDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseRequestAccessType struct +@objc +public class DBXTeamLogShowcaseRequestAccessType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseRequestAccessType(description_: description_) + } + + let swift: TeamLog.ShowcaseRequestAccessType + + public init(swift: TeamLog.ShowcaseRequestAccessType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Resolved showcase comment. +@objc +public class DBXTeamLogShowcaseResolveCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.ShowcaseResolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.ShowcaseResolveCommentDetails + + public init(swift: TeamLog.ShowcaseResolveCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseResolveCommentType struct +@objc +public class DBXTeamLogShowcaseResolveCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseResolveCommentType(description_: description_) + } + + let swift: TeamLog.ShowcaseResolveCommentType + + public init(swift: TeamLog.ShowcaseResolveCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unarchived showcase. +@objc +public class DBXTeamLogShowcaseRestoredDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseRestoredDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseRestoredDetails + + public init(swift: TeamLog.ShowcaseRestoredDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseRestoredType struct +@objc +public class DBXTeamLogShowcaseRestoredType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseRestoredType(description_: description_) + } + + let swift: TeamLog.ShowcaseRestoredType + + public init(swift: TeamLog.ShowcaseRestoredType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted showcase (old version). +@objc +public class DBXTeamLogShowcaseTrashedDeprecatedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseTrashedDeprecatedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseTrashedDeprecatedDetails + + public init(swift: TeamLog.ShowcaseTrashedDeprecatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseTrashedDeprecatedType struct +@objc +public class DBXTeamLogShowcaseTrashedDeprecatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseTrashedDeprecatedType(description_: description_) + } + + let swift: TeamLog.ShowcaseTrashedDeprecatedType + + public init(swift: TeamLog.ShowcaseTrashedDeprecatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted showcase. +@objc +public class DBXTeamLogShowcaseTrashedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseTrashedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseTrashedDetails + + public init(swift: TeamLog.ShowcaseTrashedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseTrashedType struct +@objc +public class DBXTeamLogShowcaseTrashedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseTrashedType(description_: description_) + } + + let swift: TeamLog.ShowcaseTrashedType + + public init(swift: TeamLog.ShowcaseTrashedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Unresolved showcase comment. +@objc +public class DBXTeamLogShowcaseUnresolveCommentDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + /// Comment text. + @objc + public var commentText: String? { swift.commentText } + + @objc + public init(eventUuid: String, commentText: String?) { + self.swift = TeamLog.ShowcaseUnresolveCommentDetails(eventUuid: eventUuid, commentText: commentText) + } + + let swift: TeamLog.ShowcaseUnresolveCommentDetails + + public init(swift: TeamLog.ShowcaseUnresolveCommentDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseUnresolveCommentType struct +@objc +public class DBXTeamLogShowcaseUnresolveCommentType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseUnresolveCommentType(description_: description_) + } + + let swift: TeamLog.ShowcaseUnresolveCommentType + + public init(swift: TeamLog.ShowcaseUnresolveCommentType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored showcase (old version). +@objc +public class DBXTeamLogShowcaseUntrashedDeprecatedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseUntrashedDeprecatedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseUntrashedDeprecatedDetails + + public init(swift: TeamLog.ShowcaseUntrashedDeprecatedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseUntrashedDeprecatedType struct +@objc +public class DBXTeamLogShowcaseUntrashedDeprecatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseUntrashedDeprecatedType(description_: description_) + } + + let swift: TeamLog.ShowcaseUntrashedDeprecatedType + + public init(swift: TeamLog.ShowcaseUntrashedDeprecatedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Restored showcase. +@objc +public class DBXTeamLogShowcaseUntrashedDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseUntrashedDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseUntrashedDetails + + public init(swift: TeamLog.ShowcaseUntrashedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseUntrashedType struct +@objc +public class DBXTeamLogShowcaseUntrashedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseUntrashedType(description_: description_) + } + + let swift: TeamLog.ShowcaseUntrashedType + + public init(swift: TeamLog.ShowcaseUntrashedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Viewed showcase. +@objc +public class DBXTeamLogShowcaseViewDetails: NSObject { + /// Event unique identifier. + @objc + public var eventUuid: String { swift.eventUuid } + + @objc + public init(eventUuid: String) { + self.swift = TeamLog.ShowcaseViewDetails(eventUuid: eventUuid) + } + + let swift: TeamLog.ShowcaseViewDetails + + public init(swift: TeamLog.ShowcaseViewDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ShowcaseViewType struct +@objc +public class DBXTeamLogShowcaseViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ShowcaseViewType(description_: description_) + } + + let swift: TeamLog.ShowcaseViewType + + public init(swift: TeamLog.ShowcaseViewType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Ended admin sign-in-as session. +@objc +public class DBXTeamLogSignInAsSessionEndDetails: NSObject { + let swift: TeamLog.SignInAsSessionEndDetails + + public init(swift: TeamLog.SignInAsSessionEndDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SignInAsSessionEndType struct +@objc +public class DBXTeamLogSignInAsSessionEndType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SignInAsSessionEndType(description_: description_) + } + + let swift: TeamLog.SignInAsSessionEndType + + public init(swift: TeamLog.SignInAsSessionEndType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Started admin sign-in-as session. +@objc +public class DBXTeamLogSignInAsSessionStartDetails: NSObject { + let swift: TeamLog.SignInAsSessionStartDetails + + public init(swift: TeamLog.SignInAsSessionStartDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SignInAsSessionStartType struct +@objc +public class DBXTeamLogSignInAsSessionStartType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SignInAsSessionStartType(description_: description_) + } + + let swift: TeamLog.SignInAsSessionStartType + + public init(swift: TeamLog.SignInAsSessionStartType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed default Smart Sync setting for team members. +@objc +public class DBXTeamLogSmartSyncChangePolicyDetails: NSObject { + /// New smart sync policy. + @objc + public var newValue: DBXTeamPoliciesSmartSyncPolicy? { guard let swift = swift.newValue else { return nil } + return DBXTeamPoliciesSmartSyncPolicy(swift: swift) + } + + /// Previous smart sync policy. + @objc + public var previousValue: DBXTeamPoliciesSmartSyncPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesSmartSyncPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesSmartSyncPolicy?, previousValue: DBXTeamPoliciesSmartSyncPolicy?) { + self.swift = TeamLog.SmartSyncChangePolicyDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SmartSyncChangePolicyDetails + + public init(swift: TeamLog.SmartSyncChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SmartSyncChangePolicyType struct +@objc +public class DBXTeamLogSmartSyncChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SmartSyncChangePolicyType(description_: description_) + } + + let swift: TeamLog.SmartSyncChangePolicyType + + public init(swift: TeamLog.SmartSyncChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created Smart Sync non-admin devices report. +@objc +public class DBXTeamLogSmartSyncCreateAdminPrivilegeReportDetails: NSObject { + let swift: TeamLog.SmartSyncCreateAdminPrivilegeReportDetails + + public init(swift: TeamLog.SmartSyncCreateAdminPrivilegeReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SmartSyncCreateAdminPrivilegeReportType struct +@objc +public class DBXTeamLogSmartSyncCreateAdminPrivilegeReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SmartSyncCreateAdminPrivilegeReportType(description_: description_) + } + + let swift: TeamLog.SmartSyncCreateAdminPrivilegeReportType + + public init(swift: TeamLog.SmartSyncCreateAdminPrivilegeReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Opted team into Smart Sync. +@objc +public class DBXTeamLogSmartSyncNotOptOutDetails: NSObject { + /// Previous Smart Sync opt out policy. + @objc + public var previousValue: DBXTeamLogSmartSyncOptOutPolicy { DBXTeamLogSmartSyncOptOutPolicy(swift: swift.previousValue) } + /// New Smart Sync opt out policy. + @objc + public var newValue: DBXTeamLogSmartSyncOptOutPolicy { DBXTeamLogSmartSyncOptOutPolicy(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogSmartSyncOptOutPolicy, newValue: DBXTeamLogSmartSyncOptOutPolicy) { + self.swift = TeamLog.SmartSyncNotOptOutDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.SmartSyncNotOptOutDetails + + public init(swift: TeamLog.SmartSyncNotOptOutDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SmartSyncNotOptOutType struct +@objc +public class DBXTeamLogSmartSyncNotOptOutType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SmartSyncNotOptOutType(description_: description_) + } + + let swift: TeamLog.SmartSyncNotOptOutType + + public init(swift: TeamLog.SmartSyncNotOptOutType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Opted team out of Smart Sync. +@objc +public class DBXTeamLogSmartSyncOptOutDetails: NSObject { + /// Previous Smart Sync opt out policy. + @objc + public var previousValue: DBXTeamLogSmartSyncOptOutPolicy { DBXTeamLogSmartSyncOptOutPolicy(swift: swift.previousValue) } + /// New Smart Sync opt out policy. + @objc + public var newValue: DBXTeamLogSmartSyncOptOutPolicy { DBXTeamLogSmartSyncOptOutPolicy(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogSmartSyncOptOutPolicy, newValue: DBXTeamLogSmartSyncOptOutPolicy) { + self.swift = TeamLog.SmartSyncOptOutDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.SmartSyncOptOutDetails + + public init(swift: TeamLog.SmartSyncOptOutDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SmartSyncOptOutPolicy union +@objc +public class DBXTeamLogSmartSyncOptOutPolicy: NSObject { + let swift: TeamLog.SmartSyncOptOutPolicy + + public init(swift: TeamLog.SmartSyncOptOutPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SmartSyncOptOutPolicy) -> DBXTeamLogSmartSyncOptOutPolicy { + switch swift { + case .default_: + return DBXTeamLogSmartSyncOptOutPolicyDefault_() + case .optedOut: + return DBXTeamLogSmartSyncOptOutPolicyOptedOut() + case .other: + return DBXTeamLogSmartSyncOptOutPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefault_: DBXTeamLogSmartSyncOptOutPolicyDefault_? { + self as? DBXTeamLogSmartSyncOptOutPolicyDefault_ + } + + @objc + public var asOptedOut: DBXTeamLogSmartSyncOptOutPolicyOptedOut? { + self as? DBXTeamLogSmartSyncOptOutPolicyOptedOut + } + + @objc + public var asOther: DBXTeamLogSmartSyncOptOutPolicyOther? { + self as? DBXTeamLogSmartSyncOptOutPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSmartSyncOptOutPolicyDefault_: DBXTeamLogSmartSyncOptOutPolicy { + @objc + public init() { + let swift = TeamLog.SmartSyncOptOutPolicy.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSmartSyncOptOutPolicyOptedOut: DBXTeamLogSmartSyncOptOutPolicy { + @objc + public init() { + let swift = TeamLog.SmartSyncOptOutPolicy.optedOut + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSmartSyncOptOutPolicyOther: DBXTeamLogSmartSyncOptOutPolicy { + @objc + public init() { + let swift = TeamLog.SmartSyncOptOutPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SmartSyncOptOutType struct +@objc +public class DBXTeamLogSmartSyncOptOutType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SmartSyncOptOutType(description_: description_) + } + + let swift: TeamLog.SmartSyncOptOutType + + public init(swift: TeamLog.SmartSyncOptOutType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed automatic Smart Sync setting for team. +@objc +public class DBXTeamLogSmarterSmartSyncPolicyChangedDetails: NSObject { + /// Previous automatic Smart Sync setting. + @objc + public var previousValue: DBXTeamPoliciesSmarterSmartSyncPolicyState { DBXTeamPoliciesSmarterSmartSyncPolicyState(swift: swift.previousValue) } + /// New automatic Smart Sync setting. + @objc + public var newValue: DBXTeamPoliciesSmarterSmartSyncPolicyState { DBXTeamPoliciesSmarterSmartSyncPolicyState(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamPoliciesSmarterSmartSyncPolicyState, newValue: DBXTeamPoliciesSmarterSmartSyncPolicyState) { + self.swift = TeamLog.SmarterSmartSyncPolicyChangedDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.SmarterSmartSyncPolicyChangedDetails + + public init(swift: TeamLog.SmarterSmartSyncPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SmarterSmartSyncPolicyChangedType struct +@objc +public class DBXTeamLogSmarterSmartSyncPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SmarterSmartSyncPolicyChangedType(description_: description_) + } + + let swift: TeamLog.SmarterSmartSyncPolicyChangedType + + public init(swift: TeamLog.SmarterSmartSyncPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Space limit alert policy +@objc +public class DBXTeamLogSpaceCapsType: NSObject { + let swift: TeamLog.SpaceCapsType + + public init(swift: TeamLog.SpaceCapsType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SpaceCapsType) -> DBXTeamLogSpaceCapsType { + switch swift { + case .hard: + return DBXTeamLogSpaceCapsTypeHard() + case .off: + return DBXTeamLogSpaceCapsTypeOff() + case .soft: + return DBXTeamLogSpaceCapsTypeSoft() + case .other: + return DBXTeamLogSpaceCapsTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asHard: DBXTeamLogSpaceCapsTypeHard? { + self as? DBXTeamLogSpaceCapsTypeHard + } + + @objc + public var asOff: DBXTeamLogSpaceCapsTypeOff? { + self as? DBXTeamLogSpaceCapsTypeOff + } + + @objc + public var asSoft: DBXTeamLogSpaceCapsTypeSoft? { + self as? DBXTeamLogSpaceCapsTypeSoft + } + + @objc + public var asOther: DBXTeamLogSpaceCapsTypeOther? { + self as? DBXTeamLogSpaceCapsTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceCapsTypeHard: DBXTeamLogSpaceCapsType { + @objc + public init() { + let swift = TeamLog.SpaceCapsType.hard + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceCapsTypeOff: DBXTeamLogSpaceCapsType { + @objc + public init() { + let swift = TeamLog.SpaceCapsType.off + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceCapsTypeSoft: DBXTeamLogSpaceCapsType { + @objc + public init() { + let swift = TeamLog.SpaceCapsType.soft + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceCapsTypeOther: DBXTeamLogSpaceCapsType { + @objc + public init() { + let swift = TeamLog.SpaceCapsType.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SpaceLimitsStatus union +@objc +public class DBXTeamLogSpaceLimitsStatus: NSObject { + let swift: TeamLog.SpaceLimitsStatus + + public init(swift: TeamLog.SpaceLimitsStatus) { + self.swift = swift + } + + public static func factory(swift: TeamLog.SpaceLimitsStatus) -> DBXTeamLogSpaceLimitsStatus { + switch swift { + case .nearQuota: + return DBXTeamLogSpaceLimitsStatusNearQuota() + case .overQuota: + return DBXTeamLogSpaceLimitsStatusOverQuota() + case .withinQuota: + return DBXTeamLogSpaceLimitsStatusWithinQuota() + case .other: + return DBXTeamLogSpaceLimitsStatusOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNearQuota: DBXTeamLogSpaceLimitsStatusNearQuota? { + self as? DBXTeamLogSpaceLimitsStatusNearQuota + } + + @objc + public var asOverQuota: DBXTeamLogSpaceLimitsStatusOverQuota? { + self as? DBXTeamLogSpaceLimitsStatusOverQuota + } + + @objc + public var asWithinQuota: DBXTeamLogSpaceLimitsStatusWithinQuota? { + self as? DBXTeamLogSpaceLimitsStatusWithinQuota + } + + @objc + public var asOther: DBXTeamLogSpaceLimitsStatusOther? { + self as? DBXTeamLogSpaceLimitsStatusOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceLimitsStatusNearQuota: DBXTeamLogSpaceLimitsStatus { + @objc + public init() { + let swift = TeamLog.SpaceLimitsStatus.nearQuota + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceLimitsStatusOverQuota: DBXTeamLogSpaceLimitsStatus { + @objc + public init() { + let swift = TeamLog.SpaceLimitsStatus.overQuota + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceLimitsStatusWithinQuota: DBXTeamLogSpaceLimitsStatus { + @objc + public init() { + let swift = TeamLog.SpaceLimitsStatus.withinQuota + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogSpaceLimitsStatusOther: DBXTeamLogSpaceLimitsStatus { + @objc + public init() { + let swift = TeamLog.SpaceLimitsStatus.other + super.init(swift: swift) + } +} + +/// Added X.509 certificate for SSO. +@objc +public class DBXTeamLogSsoAddCertDetails: NSObject { + /// SSO certificate details. + @objc + public var certificateDetails: DBXTeamLogCertificate { DBXTeamLogCertificate(swift: swift.certificateDetails) } + + @objc + public init(certificateDetails: DBXTeamLogCertificate) { + self.swift = TeamLog.SsoAddCertDetails(certificateDetails: certificateDetails.swift) + } + + let swift: TeamLog.SsoAddCertDetails + + public init(swift: TeamLog.SsoAddCertDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoAddCertType struct +@objc +public class DBXTeamLogSsoAddCertType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoAddCertType(description_: description_) + } + + let swift: TeamLog.SsoAddCertType + + public init(swift: TeamLog.SsoAddCertType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added sign-in URL for SSO. +@objc +public class DBXTeamLogSsoAddLoginUrlDetails: NSObject { + /// New single sign-on login URL. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(newValue: String) { + self.swift = TeamLog.SsoAddLoginUrlDetails(newValue: newValue) + } + + let swift: TeamLog.SsoAddLoginUrlDetails + + public init(swift: TeamLog.SsoAddLoginUrlDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoAddLoginUrlType struct +@objc +public class DBXTeamLogSsoAddLoginUrlType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoAddLoginUrlType(description_: description_) + } + + let swift: TeamLog.SsoAddLoginUrlType + + public init(swift: TeamLog.SsoAddLoginUrlType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added sign-out URL for SSO. +@objc +public class DBXTeamLogSsoAddLogoutUrlDetails: NSObject { + /// New single sign-on logout URL. + @objc + public var newValue: String? { swift.newValue } + + @objc + public init(newValue: String?) { + self.swift = TeamLog.SsoAddLogoutUrlDetails(newValue: newValue) + } + + let swift: TeamLog.SsoAddLogoutUrlDetails + + public init(swift: TeamLog.SsoAddLogoutUrlDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoAddLogoutUrlType struct +@objc +public class DBXTeamLogSsoAddLogoutUrlType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoAddLogoutUrlType(description_: description_) + } + + let swift: TeamLog.SsoAddLogoutUrlType + + public init(swift: TeamLog.SsoAddLogoutUrlType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed X.509 certificate for SSO. +@objc +public class DBXTeamLogSsoChangeCertDetails: NSObject { + /// Previous SSO certificate details. Might be missing due to historical data gap. + @objc + public var previousCertificateDetails: DBXTeamLogCertificate? { guard let swift = swift.previousCertificateDetails else { return nil } + return DBXTeamLogCertificate(swift: swift) + } + + /// New SSO certificate details. + @objc + public var newCertificateDetails: DBXTeamLogCertificate { DBXTeamLogCertificate(swift: swift.newCertificateDetails) } + + @objc + public init(newCertificateDetails: DBXTeamLogCertificate, previousCertificateDetails: DBXTeamLogCertificate?) { + self.swift = TeamLog.SsoChangeCertDetails( + newCertificateDetails: newCertificateDetails.swift, + previousCertificateDetails: previousCertificateDetails?.swift + ) + } + + let swift: TeamLog.SsoChangeCertDetails + + public init(swift: TeamLog.SsoChangeCertDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoChangeCertType struct +@objc +public class DBXTeamLogSsoChangeCertType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoChangeCertType(description_: description_) + } + + let swift: TeamLog.SsoChangeCertType + + public init(swift: TeamLog.SsoChangeCertType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed sign-in URL for SSO. +@objc +public class DBXTeamLogSsoChangeLoginUrlDetails: NSObject { + /// Previous single sign-on login URL. + @objc + public var previousValue: String { swift.previousValue } + /// New single sign-on login URL. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(previousValue: String, newValue: String) { + self.swift = TeamLog.SsoChangeLoginUrlDetails(previousValue: previousValue, newValue: newValue) + } + + let swift: TeamLog.SsoChangeLoginUrlDetails + + public init(swift: TeamLog.SsoChangeLoginUrlDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoChangeLoginUrlType struct +@objc +public class DBXTeamLogSsoChangeLoginUrlType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoChangeLoginUrlType(description_: description_) + } + + let swift: TeamLog.SsoChangeLoginUrlType + + public init(swift: TeamLog.SsoChangeLoginUrlType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed sign-out URL for SSO. +@objc +public class DBXTeamLogSsoChangeLogoutUrlDetails: NSObject { + /// Previous single sign-on logout URL. Might be missing due to historical data gap. + @objc + public var previousValue: String? { swift.previousValue } + /// New single sign-on logout URL. + @objc + public var newValue: String? { swift.newValue } + + @objc + public init(previousValue: String?, newValue: String?) { + self.swift = TeamLog.SsoChangeLogoutUrlDetails(previousValue: previousValue, newValue: newValue) + } + + let swift: TeamLog.SsoChangeLogoutUrlDetails + + public init(swift: TeamLog.SsoChangeLogoutUrlDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoChangeLogoutUrlType struct +@objc +public class DBXTeamLogSsoChangeLogoutUrlType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoChangeLogoutUrlType(description_: description_) + } + + let swift: TeamLog.SsoChangeLogoutUrlType + + public init(swift: TeamLog.SsoChangeLogoutUrlType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed single sign-on setting for team. +@objc +public class DBXTeamLogSsoChangePolicyDetails: NSObject { + /// New single sign-on policy. + @objc + public var newValue: DBXTeamPoliciesSsoPolicy { DBXTeamPoliciesSsoPolicy(swift: swift.newValue) } + /// Previous single sign-on policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamPoliciesSsoPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesSsoPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesSsoPolicy, previousValue: DBXTeamPoliciesSsoPolicy?) { + self.swift = TeamLog.SsoChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.SsoChangePolicyDetails + + public init(swift: TeamLog.SsoChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoChangePolicyType struct +@objc +public class DBXTeamLogSsoChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoChangePolicyType(description_: description_) + } + + let swift: TeamLog.SsoChangePolicyType + + public init(swift: TeamLog.SsoChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed SAML identity mode for SSO. +@objc +public class DBXTeamLogSsoChangeSamlIdentityModeDetails: NSObject { + /// Previous single sign-on identity mode. + @objc + public var previousValue: NSNumber { swift.previousValue as NSNumber } + /// New single sign-on identity mode. + @objc + public var newValue: NSNumber { swift.newValue as NSNumber } + + @objc + public init(previousValue: NSNumber, newValue: NSNumber) { + self.swift = TeamLog.SsoChangeSamlIdentityModeDetails(previousValue: previousValue.int64Value, newValue: newValue.int64Value) + } + + let swift: TeamLog.SsoChangeSamlIdentityModeDetails + + public init(swift: TeamLog.SsoChangeSamlIdentityModeDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoChangeSamlIdentityModeType struct +@objc +public class DBXTeamLogSsoChangeSamlIdentityModeType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoChangeSamlIdentityModeType(description_: description_) + } + + let swift: TeamLog.SsoChangeSamlIdentityModeType + + public init(swift: TeamLog.SsoChangeSamlIdentityModeType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Failed to sign in via SSO. +@objc +public class DBXTeamLogSsoErrorDetails: NSObject { + /// Error details. + @objc + public var errorDetails: DBXTeamLogFailureDetailsLogInfo { DBXTeamLogFailureDetailsLogInfo(swift: swift.errorDetails) } + + @objc + public init(errorDetails: DBXTeamLogFailureDetailsLogInfo) { + self.swift = TeamLog.SsoErrorDetails(errorDetails: errorDetails.swift) + } + + let swift: TeamLog.SsoErrorDetails + + public init(swift: TeamLog.SsoErrorDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoErrorType struct +@objc +public class DBXTeamLogSsoErrorType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoErrorType(description_: description_) + } + + let swift: TeamLog.SsoErrorType + + public init(swift: TeamLog.SsoErrorType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed X.509 certificate for SSO. +@objc +public class DBXTeamLogSsoRemoveCertDetails: NSObject { + let swift: TeamLog.SsoRemoveCertDetails + + public init(swift: TeamLog.SsoRemoveCertDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoRemoveCertType struct +@objc +public class DBXTeamLogSsoRemoveCertType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoRemoveCertType(description_: description_) + } + + let swift: TeamLog.SsoRemoveCertType + + public init(swift: TeamLog.SsoRemoveCertType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed sign-in URL for SSO. +@objc +public class DBXTeamLogSsoRemoveLoginUrlDetails: NSObject { + /// Previous single sign-on login URL. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(previousValue: String) { + self.swift = TeamLog.SsoRemoveLoginUrlDetails(previousValue: previousValue) + } + + let swift: TeamLog.SsoRemoveLoginUrlDetails + + public init(swift: TeamLog.SsoRemoveLoginUrlDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoRemoveLoginUrlType struct +@objc +public class DBXTeamLogSsoRemoveLoginUrlType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoRemoveLoginUrlType(description_: description_) + } + + let swift: TeamLog.SsoRemoveLoginUrlType + + public init(swift: TeamLog.SsoRemoveLoginUrlType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed sign-out URL for SSO. +@objc +public class DBXTeamLogSsoRemoveLogoutUrlDetails: NSObject { + /// Previous single sign-on logout URL. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(previousValue: String) { + self.swift = TeamLog.SsoRemoveLogoutUrlDetails(previousValue: previousValue) + } + + let swift: TeamLog.SsoRemoveLogoutUrlDetails + + public init(swift: TeamLog.SsoRemoveLogoutUrlDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible SsoRemoveLogoutUrlType struct +@objc +public class DBXTeamLogSsoRemoveLogoutUrlType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.SsoRemoveLogoutUrlType(description_: description_) + } + + let swift: TeamLog.SsoRemoveLogoutUrlType + + public init(swift: TeamLog.SsoRemoveLogoutUrlType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Started enterprise admin session. +@objc +public class DBXTeamLogStartedEnterpriseAdminSessionDetails: NSObject { + /// More information about the organization or team. + @objc + public var federationExtraDetails: DBXTeamLogFedExtraDetails { DBXTeamLogFedExtraDetails(swift: swift.federationExtraDetails) } + + @objc + public init(federationExtraDetails: DBXTeamLogFedExtraDetails) { + self.swift = TeamLog.StartedEnterpriseAdminSessionDetails(federationExtraDetails: federationExtraDetails.swift) + } + + let swift: TeamLog.StartedEnterpriseAdminSessionDetails + + public init(swift: TeamLog.StartedEnterpriseAdminSessionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible StartedEnterpriseAdminSessionType struct +@objc +public class DBXTeamLogStartedEnterpriseAdminSessionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.StartedEnterpriseAdminSessionType(description_: description_) + } + + let swift: TeamLog.StartedEnterpriseAdminSessionType + + public init(swift: TeamLog.StartedEnterpriseAdminSessionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created team activity report. +@objc +public class DBXTeamLogTeamActivityCreateReportDetails: NSObject { + /// Report start date. + @objc + public var startDate: Date { swift.startDate } + /// Report end date. + @objc + public var endDate: Date { swift.endDate } + + @objc + public init(startDate: Date, endDate: Date) { + self.swift = TeamLog.TeamActivityCreateReportDetails(startDate: startDate, endDate: endDate) + } + + let swift: TeamLog.TeamActivityCreateReportDetails + + public init(swift: TeamLog.TeamActivityCreateReportDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Couldn't generate team activity report. +@objc +public class DBXTeamLogTeamActivityCreateReportFailDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.TeamActivityCreateReportFailDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.TeamActivityCreateReportFailDetails + + public init(swift: TeamLog.TeamActivityCreateReportFailDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamActivityCreateReportFailType struct +@objc +public class DBXTeamLogTeamActivityCreateReportFailType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamActivityCreateReportFailType(description_: description_) + } + + let swift: TeamLog.TeamActivityCreateReportFailType + + public init(swift: TeamLog.TeamActivityCreateReportFailType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamActivityCreateReportType struct +@objc +public class DBXTeamLogTeamActivityCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamActivityCreateReportType(description_: description_) + } + + let swift: TeamLog.TeamActivityCreateReportType + + public init(swift: TeamLog.TeamActivityCreateReportType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling team access to setting up branding feature +@objc +public class DBXTeamLogTeamBrandingPolicy: NSObject { + let swift: TeamLog.TeamBrandingPolicy + + public init(swift: TeamLog.TeamBrandingPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamBrandingPolicy) -> DBXTeamLogTeamBrandingPolicy { + switch swift { + case .disabled: + return DBXTeamLogTeamBrandingPolicyDisabled() + case .enabled: + return DBXTeamLogTeamBrandingPolicyEnabled() + case .other: + return DBXTeamLogTeamBrandingPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogTeamBrandingPolicyDisabled? { + self as? DBXTeamLogTeamBrandingPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogTeamBrandingPolicyEnabled? { + self as? DBXTeamLogTeamBrandingPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogTeamBrandingPolicyOther? { + self as? DBXTeamLogTeamBrandingPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamBrandingPolicyDisabled: DBXTeamLogTeamBrandingPolicy { + @objc + public init() { + let swift = TeamLog.TeamBrandingPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamBrandingPolicyEnabled: DBXTeamLogTeamBrandingPolicy { + @objc + public init() { + let swift = TeamLog.TeamBrandingPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamBrandingPolicyOther: DBXTeamLogTeamBrandingPolicy { + @objc + public init() { + let swift = TeamLog.TeamBrandingPolicy.other + super.init(swift: swift) + } +} + +/// Changed team branding policy for team. +@objc +public class DBXTeamLogTeamBrandingPolicyChangedDetails: NSObject { + /// New team branding policy. + @objc + public var newValue: DBXTeamLogTeamBrandingPolicy { DBXTeamLogTeamBrandingPolicy(swift: swift.newValue) } + /// Previous team branding policy. + @objc + public var previousValue: DBXTeamLogTeamBrandingPolicy { DBXTeamLogTeamBrandingPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogTeamBrandingPolicy, previousValue: DBXTeamLogTeamBrandingPolicy) { + self.swift = TeamLog.TeamBrandingPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.TeamBrandingPolicyChangedDetails + + public init(swift: TeamLog.TeamBrandingPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamBrandingPolicyChangedType struct +@objc +public class DBXTeamLogTeamBrandingPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamBrandingPolicyChangedType(description_: description_) + } + + let swift: TeamLog.TeamBrandingPolicyChangedType + + public init(swift: TeamLog.TeamBrandingPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// More details about the team. +@objc +public class DBXTeamLogTeamDetails: NSObject { + /// The name of the team. + @objc + public var team: String { swift.team } + + @objc + public init(team: String) { + self.swift = TeamLog.TeamDetails(team: team) + } + + let swift: TeamLog.TeamDetails + + public init(swift: TeamLog.TeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Canceled team encryption key deletion. +@objc +public class DBXTeamLogTeamEncryptionKeyCancelKeyDeletionDetails: NSObject { + let swift: TeamLog.TeamEncryptionKeyCancelKeyDeletionDetails + + public init(swift: TeamLog.TeamEncryptionKeyCancelKeyDeletionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamEncryptionKeyCancelKeyDeletionType struct +@objc +public class DBXTeamLogTeamEncryptionKeyCancelKeyDeletionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamEncryptionKeyCancelKeyDeletionType(description_: description_) + } + + let swift: TeamLog.TeamEncryptionKeyCancelKeyDeletionType + + public init(swift: TeamLog.TeamEncryptionKeyCancelKeyDeletionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created team encryption key. +@objc +public class DBXTeamLogTeamEncryptionKeyCreateKeyDetails: NSObject { + let swift: TeamLog.TeamEncryptionKeyCreateKeyDetails + + public init(swift: TeamLog.TeamEncryptionKeyCreateKeyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamEncryptionKeyCreateKeyType struct +@objc +public class DBXTeamLogTeamEncryptionKeyCreateKeyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamEncryptionKeyCreateKeyType(description_: description_) + } + + let swift: TeamLog.TeamEncryptionKeyCreateKeyType + + public init(swift: TeamLog.TeamEncryptionKeyCreateKeyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Deleted team encryption key. +@objc +public class DBXTeamLogTeamEncryptionKeyDeleteKeyDetails: NSObject { + let swift: TeamLog.TeamEncryptionKeyDeleteKeyDetails + + public init(swift: TeamLog.TeamEncryptionKeyDeleteKeyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamEncryptionKeyDeleteKeyType struct +@objc +public class DBXTeamLogTeamEncryptionKeyDeleteKeyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamEncryptionKeyDeleteKeyType(description_: description_) + } + + let swift: TeamLog.TeamEncryptionKeyDeleteKeyType + + public init(swift: TeamLog.TeamEncryptionKeyDeleteKeyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Disabled team encryption key. +@objc +public class DBXTeamLogTeamEncryptionKeyDisableKeyDetails: NSObject { + let swift: TeamLog.TeamEncryptionKeyDisableKeyDetails + + public init(swift: TeamLog.TeamEncryptionKeyDisableKeyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamEncryptionKeyDisableKeyType struct +@objc +public class DBXTeamLogTeamEncryptionKeyDisableKeyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamEncryptionKeyDisableKeyType(description_: description_) + } + + let swift: TeamLog.TeamEncryptionKeyDisableKeyType + + public init(swift: TeamLog.TeamEncryptionKeyDisableKeyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled team encryption key. +@objc +public class DBXTeamLogTeamEncryptionKeyEnableKeyDetails: NSObject { + let swift: TeamLog.TeamEncryptionKeyEnableKeyDetails + + public init(swift: TeamLog.TeamEncryptionKeyEnableKeyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamEncryptionKeyEnableKeyType struct +@objc +public class DBXTeamLogTeamEncryptionKeyEnableKeyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamEncryptionKeyEnableKeyType(description_: description_) + } + + let swift: TeamLog.TeamEncryptionKeyEnableKeyType + + public init(swift: TeamLog.TeamEncryptionKeyEnableKeyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Rotated team encryption key. +@objc +public class DBXTeamLogTeamEncryptionKeyRotateKeyDetails: NSObject { + let swift: TeamLog.TeamEncryptionKeyRotateKeyDetails + + public init(swift: TeamLog.TeamEncryptionKeyRotateKeyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamEncryptionKeyRotateKeyType struct +@objc +public class DBXTeamLogTeamEncryptionKeyRotateKeyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamEncryptionKeyRotateKeyType(description_: description_) + } + + let swift: TeamLog.TeamEncryptionKeyRotateKeyType + + public init(swift: TeamLog.TeamEncryptionKeyRotateKeyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Scheduled encryption key deletion. +@objc +public class DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionDetails: NSObject { + let swift: TeamLog.TeamEncryptionKeyScheduleKeyDeletionDetails + + public init(swift: TeamLog.TeamEncryptionKeyScheduleKeyDeletionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamEncryptionKeyScheduleKeyDeletionType struct +@objc +public class DBXTeamLogTeamEncryptionKeyScheduleKeyDeletionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamEncryptionKeyScheduleKeyDeletionType(description_: description_) + } + + let swift: TeamLog.TeamEncryptionKeyScheduleKeyDeletionType + + public init(swift: TeamLog.TeamEncryptionKeyScheduleKeyDeletionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// An audit log event. +@objc +public class DBXTeamLogTeamEvent: NSObject { + /// The Dropbox timestamp representing when the action was taken. + @objc + public var timestamp_: Date { swift.timestamp_ } + /// The category that this type of action belongs to. + @objc + public var eventCategory: DBXTeamLogEventCategory { DBXTeamLogEventCategory(swift: swift.eventCategory) } + /// The entity who actually performed the action. Might be missing due to historical data gap. + @objc + public var actor: DBXTeamLogActorLogInfo? { guard let swift = swift.actor else { return nil } + return DBXTeamLogActorLogInfo(swift: swift) + } + + /// The origin from which the actor performed the action including information about host, ip address, location, + /// session, etc. If the action was performed programmatically via the API the origin represents the API + /// client. + @objc + public var origin: DBXTeamLogOriginLogInfo? { guard let swift = swift.origin else { return nil } + return DBXTeamLogOriginLogInfo(swift: swift) + } + + /// True if the action involved a non team member either as the actor or as one of the affected users. Might be + /// missing due to historical data gap. + @objc + public var involveNonTeamMember: NSNumber? { swift.involveNonTeamMember as NSNumber? } + /// The user or team on whose behalf the actor performed the action. Might be missing due to historical data + /// gap. + @objc + public var context: DBXTeamLogContextLogInfo? { guard let swift = swift.context else { return nil } + return DBXTeamLogContextLogInfo(swift: swift) + } + + /// Zero or more users and/or groups that are affected by the action. Note that this list doesn't include any + /// actors or users in context. + @objc + public var participants: [DBXTeamLogParticipantLogInfo]? { swift.participants?.map { DBXTeamLogParticipantLogInfo(swift: $0) } } + /// Zero or more content assets involved in the action. Currently these include Dropbox files and folders but in + /// the future we might add other asset types such as Paper documents, folders, projects, etc. + @objc + public var assets: [DBXTeamLogAssetLogInfo]? { swift.assets?.map { DBXTeamLogAssetLogInfo(swift: $0) } } + /// The particular type of action taken. + @objc + public var eventType: DBXTeamLogEventType { DBXTeamLogEventType(swift: swift.eventType) } + /// The variable event schema applicable to this type of action, instantiated with respect to this particular + /// action. + @objc + public var details: DBXTeamLogEventDetails { DBXTeamLogEventDetails(swift: swift.details) } + + @objc + public init( + timestamp_: Date, + eventCategory: DBXTeamLogEventCategory, + eventType: DBXTeamLogEventType, + details: DBXTeamLogEventDetails, + actor: DBXTeamLogActorLogInfo?, + origin: DBXTeamLogOriginLogInfo?, + involveNonTeamMember: NSNumber?, + context: DBXTeamLogContextLogInfo?, + participants: [DBXTeamLogParticipantLogInfo]?, + assets: [DBXTeamLogAssetLogInfo]? + ) { + self.swift = TeamLog.TeamEvent( + timestamp_: timestamp_, + eventCategory: eventCategory.swift, + eventType: eventType.swift, + details: details.swift, + actor: actor?.swift, + origin: origin?.swift, + involveNonTeamMember: involveNonTeamMember?.boolValue, + context: context?.swift, + participants: participants?.map(\.swift), + assets: assets?.map(\.swift) + ) + } + + let swift: TeamLog.TeamEvent + + public init(swift: TeamLog.TeamEvent) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling whether App Integrations are enabled for the team. +@objc +public class DBXTeamLogTeamExtensionsPolicy: NSObject { + let swift: TeamLog.TeamExtensionsPolicy + + public init(swift: TeamLog.TeamExtensionsPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamExtensionsPolicy) -> DBXTeamLogTeamExtensionsPolicy { + switch swift { + case .disabled: + return DBXTeamLogTeamExtensionsPolicyDisabled() + case .enabled: + return DBXTeamLogTeamExtensionsPolicyEnabled() + case .other: + return DBXTeamLogTeamExtensionsPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogTeamExtensionsPolicyDisabled? { + self as? DBXTeamLogTeamExtensionsPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogTeamExtensionsPolicyEnabled? { + self as? DBXTeamLogTeamExtensionsPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogTeamExtensionsPolicyOther? { + self as? DBXTeamLogTeamExtensionsPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamExtensionsPolicyDisabled: DBXTeamLogTeamExtensionsPolicy { + @objc + public init() { + let swift = TeamLog.TeamExtensionsPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamExtensionsPolicyEnabled: DBXTeamLogTeamExtensionsPolicy { + @objc + public init() { + let swift = TeamLog.TeamExtensionsPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamExtensionsPolicyOther: DBXTeamLogTeamExtensionsPolicy { + @objc + public init() { + let swift = TeamLog.TeamExtensionsPolicy.other + super.init(swift: swift) + } +} + +/// Changed App Integrations setting for team. +@objc +public class DBXTeamLogTeamExtensionsPolicyChangedDetails: NSObject { + /// New Extensions policy. + @objc + public var newValue: DBXTeamLogTeamExtensionsPolicy { DBXTeamLogTeamExtensionsPolicy(swift: swift.newValue) } + /// Previous Extensions policy. + @objc + public var previousValue: DBXTeamLogTeamExtensionsPolicy { DBXTeamLogTeamExtensionsPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogTeamExtensionsPolicy, previousValue: DBXTeamLogTeamExtensionsPolicy) { + self.swift = TeamLog.TeamExtensionsPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.TeamExtensionsPolicyChangedDetails + + public init(swift: TeamLog.TeamExtensionsPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamExtensionsPolicyChangedType struct +@objc +public class DBXTeamLogTeamExtensionsPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamExtensionsPolicyChangedType(description_: description_) + } + + let swift: TeamLog.TeamExtensionsPolicyChangedType + + public init(swift: TeamLog.TeamExtensionsPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed archival status of team folder. +@objc +public class DBXTeamLogTeamFolderChangeStatusDetails: NSObject { + /// New team folder status. + @objc + public var newValue: DBXTeamTeamFolderStatus { DBXTeamTeamFolderStatus(swift: swift.newValue) } + /// Previous team folder status. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamTeamFolderStatus? { guard let swift = swift.previousValue else { return nil } + return DBXTeamTeamFolderStatus(swift: swift) + } + + @objc + public init(newValue: DBXTeamTeamFolderStatus, previousValue: DBXTeamTeamFolderStatus?) { + self.swift = TeamLog.TeamFolderChangeStatusDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.TeamFolderChangeStatusDetails + + public init(swift: TeamLog.TeamFolderChangeStatusDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderChangeStatusType struct +@objc +public class DBXTeamLogTeamFolderChangeStatusType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamFolderChangeStatusType(description_: description_) + } + + let swift: TeamLog.TeamFolderChangeStatusType + + public init(swift: TeamLog.TeamFolderChangeStatusType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Created team folder in active status. +@objc +public class DBXTeamLogTeamFolderCreateDetails: NSObject { + let swift: TeamLog.TeamFolderCreateDetails + + public init(swift: TeamLog.TeamFolderCreateDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderCreateType struct +@objc +public class DBXTeamLogTeamFolderCreateType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamFolderCreateType(description_: description_) + } + + let swift: TeamLog.TeamFolderCreateType + + public init(swift: TeamLog.TeamFolderCreateType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Downgraded team folder to regular shared folder. +@objc +public class DBXTeamLogTeamFolderDowngradeDetails: NSObject { + /// Target asset position in the Assets list. + @objc + public var targetAssetIndex: NSNumber { swift.targetAssetIndex as NSNumber } + + @objc + public init(targetAssetIndex: NSNumber) { + self.swift = TeamLog.TeamFolderDowngradeDetails(targetAssetIndex: targetAssetIndex.uint64Value) + } + + let swift: TeamLog.TeamFolderDowngradeDetails + + public init(swift: TeamLog.TeamFolderDowngradeDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderDowngradeType struct +@objc +public class DBXTeamLogTeamFolderDowngradeType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamFolderDowngradeType(description_: description_) + } + + let swift: TeamLog.TeamFolderDowngradeType + + public init(swift: TeamLog.TeamFolderDowngradeType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Permanently deleted archived team folder. +@objc +public class DBXTeamLogTeamFolderPermanentlyDeleteDetails: NSObject { + let swift: TeamLog.TeamFolderPermanentlyDeleteDetails + + public init(swift: TeamLog.TeamFolderPermanentlyDeleteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderPermanentlyDeleteType struct +@objc +public class DBXTeamLogTeamFolderPermanentlyDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamFolderPermanentlyDeleteType(description_: description_) + } + + let swift: TeamLog.TeamFolderPermanentlyDeleteType + + public init(swift: TeamLog.TeamFolderPermanentlyDeleteType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Renamed active/archived team folder. +@objc +public class DBXTeamLogTeamFolderRenameDetails: NSObject { + /// Previous folder name. + @objc + public var previousFolderName: String { swift.previousFolderName } + /// New folder name. + @objc + public var newFolderName: String { swift.newFolderName } + + @objc + public init(previousFolderName: String, newFolderName: String) { + self.swift = TeamLog.TeamFolderRenameDetails(previousFolderName: previousFolderName, newFolderName: newFolderName) + } + + let swift: TeamLog.TeamFolderRenameDetails + + public init(swift: TeamLog.TeamFolderRenameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamFolderRenameType struct +@objc +public class DBXTeamLogTeamFolderRenameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamFolderRenameType(description_: description_) + } + + let swift: TeamLog.TeamFolderRenameType + + public init(swift: TeamLog.TeamFolderRenameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Details about team invites +@objc +public class DBXTeamLogTeamInviteDetails: NSObject { + /// How the user was invited to the team. + @objc + public var inviteMethod: DBXTeamLogInviteMethod { DBXTeamLogInviteMethod(swift: swift.inviteMethod) } + /// True if the invitation incurred an additional license purchase. + @objc + public var additionalLicensePurchase: NSNumber? { swift.additionalLicensePurchase as NSNumber? } + + @objc + public init(inviteMethod: DBXTeamLogInviteMethod, additionalLicensePurchase: NSNumber?) { + self.swift = TeamLog.TeamInviteDetails(inviteMethod: inviteMethod.swift, additionalLicensePurchase: additionalLicensePurchase?.boolValue) + } + + let swift: TeamLog.TeamInviteDetails + + public init(swift: TeamLog.TeamInviteDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team linked app +@objc +public class DBXTeamLogTeamLinkedAppLogInfo: DBXTeamLogAppLogInfo { + let subSwift: TeamLog.TeamLinkedAppLogInfo + + public init(swift: TeamLog.TeamLinkedAppLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Team's logged information. +@objc +public class DBXTeamLogTeamLogInfo: NSObject { + /// Team display name. + @objc + public var displayName: String { swift.displayName } + + @objc + public init(displayName: String) { + self.swift = TeamLog.TeamLogInfo(displayName: displayName) + } + + let swift: TeamLog.TeamLogInfo + + public init(swift: TeamLog.TeamLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team member's logged information. +@objc +public class DBXTeamLogTeamMemberLogInfo: DBXTeamLogUserLogInfo { + /// Team member ID. + @objc + public var teamMemberId: String? { subSwift.teamMemberId } + /// Team member external ID. + @objc + public var memberExternalId: String? { subSwift.memberExternalId } + /// Details about this user’s team for enterprise event. + @objc + public var team: DBXTeamLogTeamLogInfo? { guard let swift = subSwift.team else { return nil } + return DBXTeamLogTeamLogInfo(swift: swift) + } + + @objc + public init(accountId: String?, displayName: String?, email: String?, teamMemberId: String?, memberExternalId: String?, team: DBXTeamLogTeamLogInfo?) { + let swift = TeamLog.TeamMemberLogInfo( + accountId: accountId, + displayName: displayName, + email: email, + teamMemberId: teamMemberId, + memberExternalId: memberExternalId, + team: team?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: TeamLog.TeamMemberLogInfo + + public init(swift: TeamLog.TeamMemberLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible TeamMembershipType union +@objc +public class DBXTeamLogTeamMembershipType: NSObject { + let swift: TeamLog.TeamMembershipType + + public init(swift: TeamLog.TeamMembershipType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamMembershipType) -> DBXTeamLogTeamMembershipType { + switch swift { + case .free: + return DBXTeamLogTeamMembershipTypeFree() + case .full: + return DBXTeamLogTeamMembershipTypeFull() + case .guest: + return DBXTeamLogTeamMembershipTypeGuest() + case .other: + return DBXTeamLogTeamMembershipTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFree: DBXTeamLogTeamMembershipTypeFree? { + self as? DBXTeamLogTeamMembershipTypeFree + } + + @objc + public var asFull: DBXTeamLogTeamMembershipTypeFull? { + self as? DBXTeamLogTeamMembershipTypeFull + } + + @objc + public var asGuest: DBXTeamLogTeamMembershipTypeGuest? { + self as? DBXTeamLogTeamMembershipTypeGuest + } + + @objc + public var asOther: DBXTeamLogTeamMembershipTypeOther? { + self as? DBXTeamLogTeamMembershipTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMembershipTypeFree: DBXTeamLogTeamMembershipType { + @objc + public init() { + let swift = TeamLog.TeamMembershipType.free + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMembershipTypeFull: DBXTeamLogTeamMembershipType { + @objc + public init() { + let swift = TeamLog.TeamMembershipType.full + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMembershipTypeGuest: DBXTeamLogTeamMembershipType { + @objc + public init() { + let swift = TeamLog.TeamMembershipType.guest + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMembershipTypeOther: DBXTeamLogTeamMembershipType { + @objc + public init() { + let swift = TeamLog.TeamMembershipType.other + super.init(swift: swift) + } +} + +/// Merged another team into this team. +@objc +public class DBXTeamLogTeamMergeFromDetails: NSObject { + /// The name of the team that was merged into this team. + @objc + public var teamName: String { swift.teamName } + + @objc + public init(teamName: String) { + self.swift = TeamLog.TeamMergeFromDetails(teamName: teamName) + } + + let swift: TeamLog.TeamMergeFromDetails + + public init(swift: TeamLog.TeamMergeFromDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeFromType struct +@objc +public class DBXTeamLogTeamMergeFromType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeFromType(description_: description_) + } + + let swift: TeamLog.TeamMergeFromType + + public init(swift: TeamLog.TeamMergeFromType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Accepted a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestAcceptedDetails: NSObject { + /// Team merge request acceptance details. + @objc + public var requestAcceptedDetails: DBXTeamLogTeamMergeRequestAcceptedExtraDetails { + DBXTeamLogTeamMergeRequestAcceptedExtraDetails(swift: swift.requestAcceptedDetails) + } + + @objc + public init(requestAcceptedDetails: DBXTeamLogTeamMergeRequestAcceptedExtraDetails) { + self.swift = TeamLog.TeamMergeRequestAcceptedDetails(requestAcceptedDetails: requestAcceptedDetails.swift) + } + + let swift: TeamLog.TeamMergeRequestAcceptedDetails + + public init(swift: TeamLog.TeamMergeRequestAcceptedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request acceptance details +@objc +public class DBXTeamLogTeamMergeRequestAcceptedExtraDetails: NSObject { + let swift: TeamLog.TeamMergeRequestAcceptedExtraDetails + + public init(swift: TeamLog.TeamMergeRequestAcceptedExtraDetails) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamMergeRequestAcceptedExtraDetails) -> DBXTeamLogTeamMergeRequestAcceptedExtraDetails { + switch swift { + case .primaryTeam(let swiftArg): + let arg = DBXTeamLogPrimaryTeamRequestAcceptedDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestAcceptedExtraDetailsPrimaryTeam(arg) + case .secondaryTeam(let swiftArg): + let arg = DBXTeamLogSecondaryTeamRequestAcceptedDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestAcceptedExtraDetailsSecondaryTeam(arg) + case .other: + return DBXTeamLogTeamMergeRequestAcceptedExtraDetailsOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPrimaryTeam: DBXTeamLogTeamMergeRequestAcceptedExtraDetailsPrimaryTeam? { + self as? DBXTeamLogTeamMergeRequestAcceptedExtraDetailsPrimaryTeam + } + + @objc + public var asSecondaryTeam: DBXTeamLogTeamMergeRequestAcceptedExtraDetailsSecondaryTeam? { + self as? DBXTeamLogTeamMergeRequestAcceptedExtraDetailsSecondaryTeam + } + + @objc + public var asOther: DBXTeamLogTeamMergeRequestAcceptedExtraDetailsOther? { + self as? DBXTeamLogTeamMergeRequestAcceptedExtraDetailsOther + } +} + +/// Team merge request accepted details shown to the primary team. +@objc +public class DBXTeamLogTeamMergeRequestAcceptedExtraDetailsPrimaryTeam: DBXTeamLogTeamMergeRequestAcceptedExtraDetails { + @objc + public var primaryTeam: DBXTeamLogPrimaryTeamRequestAcceptedDetails + + @objc + public init(_ arg: DBXTeamLogPrimaryTeamRequestAcceptedDetails) { + self.primaryTeam = arg + let swift = TeamLog.TeamMergeRequestAcceptedExtraDetails.primaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// Team merge request accepted details shown to the secondary team. +@objc +public class DBXTeamLogTeamMergeRequestAcceptedExtraDetailsSecondaryTeam: DBXTeamLogTeamMergeRequestAcceptedExtraDetails { + @objc + public var secondaryTeam: DBXTeamLogSecondaryTeamRequestAcceptedDetails + + @objc + public init(_ arg: DBXTeamLogSecondaryTeamRequestAcceptedDetails) { + self.secondaryTeam = arg + let swift = TeamLog.TeamMergeRequestAcceptedExtraDetails.secondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMergeRequestAcceptedExtraDetailsOther: DBXTeamLogTeamMergeRequestAcceptedExtraDetails { + @objc + public init() { + let swift = TeamLog.TeamMergeRequestAcceptedExtraDetails.other + super.init(swift: swift) + } +} + +/// Accepted a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(secondaryTeam: String, sentBy: String) { + self.swift = TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestAcceptedShownToPrimaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestAcceptedShownToPrimaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamType + + public init(swift: TeamLog.TeamMergeRequestAcceptedShownToPrimaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Accepted a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamDetails: NSObject { + /// The primary team name. + @objc + public var primaryTeam: String { swift.primaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(primaryTeam: String, sentBy: String) { + self.swift = TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamDetails(primaryTeam: primaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestAcceptedShownToSecondaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestAcceptedShownToSecondaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamType + + public init(swift: TeamLog.TeamMergeRequestAcceptedShownToSecondaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestAcceptedType struct +@objc +public class DBXTeamLogTeamMergeRequestAcceptedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestAcceptedType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestAcceptedType + + public init(swift: TeamLog.TeamMergeRequestAcceptedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Automatically canceled team merge request. +@objc +public class DBXTeamLogTeamMergeRequestAutoCanceledDetails: NSObject { + /// The cancellation reason. + @objc + public var details: String? { swift.details } + + @objc + public init(details: String?) { + self.swift = TeamLog.TeamMergeRequestAutoCanceledDetails(details: details) + } + + let swift: TeamLog.TeamMergeRequestAutoCanceledDetails + + public init(swift: TeamLog.TeamMergeRequestAutoCanceledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestAutoCanceledType struct +@objc +public class DBXTeamLogTeamMergeRequestAutoCanceledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestAutoCanceledType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestAutoCanceledType + + public init(swift: TeamLog.TeamMergeRequestAutoCanceledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Canceled a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestCanceledDetails: NSObject { + /// Team merge request cancellation details. + @objc + public var requestCanceledDetails: DBXTeamLogTeamMergeRequestCanceledExtraDetails { + DBXTeamLogTeamMergeRequestCanceledExtraDetails(swift: swift.requestCanceledDetails) + } + + @objc + public init(requestCanceledDetails: DBXTeamLogTeamMergeRequestCanceledExtraDetails) { + self.swift = TeamLog.TeamMergeRequestCanceledDetails(requestCanceledDetails: requestCanceledDetails.swift) + } + + let swift: TeamLog.TeamMergeRequestCanceledDetails + + public init(swift: TeamLog.TeamMergeRequestCanceledDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request cancellation details +@objc +public class DBXTeamLogTeamMergeRequestCanceledExtraDetails: NSObject { + let swift: TeamLog.TeamMergeRequestCanceledExtraDetails + + public init(swift: TeamLog.TeamMergeRequestCanceledExtraDetails) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamMergeRequestCanceledExtraDetails) -> DBXTeamLogTeamMergeRequestCanceledExtraDetails { + switch swift { + case .primaryTeam(let swiftArg): + let arg = DBXTeamLogPrimaryTeamRequestCanceledDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestCanceledExtraDetailsPrimaryTeam(arg) + case .secondaryTeam(let swiftArg): + let arg = DBXTeamLogSecondaryTeamRequestCanceledDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestCanceledExtraDetailsSecondaryTeam(arg) + case .other: + return DBXTeamLogTeamMergeRequestCanceledExtraDetailsOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPrimaryTeam: DBXTeamLogTeamMergeRequestCanceledExtraDetailsPrimaryTeam? { + self as? DBXTeamLogTeamMergeRequestCanceledExtraDetailsPrimaryTeam + } + + @objc + public var asSecondaryTeam: DBXTeamLogTeamMergeRequestCanceledExtraDetailsSecondaryTeam? { + self as? DBXTeamLogTeamMergeRequestCanceledExtraDetailsSecondaryTeam + } + + @objc + public var asOther: DBXTeamLogTeamMergeRequestCanceledExtraDetailsOther? { + self as? DBXTeamLogTeamMergeRequestCanceledExtraDetailsOther + } +} + +/// Team merge request cancellation details shown to the primary team. +@objc +public class DBXTeamLogTeamMergeRequestCanceledExtraDetailsPrimaryTeam: DBXTeamLogTeamMergeRequestCanceledExtraDetails { + @objc + public var primaryTeam: DBXTeamLogPrimaryTeamRequestCanceledDetails + + @objc + public init(_ arg: DBXTeamLogPrimaryTeamRequestCanceledDetails) { + self.primaryTeam = arg + let swift = TeamLog.TeamMergeRequestCanceledExtraDetails.primaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// Team merge request cancellation details shown to the secondary team. +@objc +public class DBXTeamLogTeamMergeRequestCanceledExtraDetailsSecondaryTeam: DBXTeamLogTeamMergeRequestCanceledExtraDetails { + @objc + public var secondaryTeam: DBXTeamLogSecondaryTeamRequestCanceledDetails + + @objc + public init(_ arg: DBXTeamLogSecondaryTeamRequestCanceledDetails) { + self.secondaryTeam = arg + let swift = TeamLog.TeamMergeRequestCanceledExtraDetails.secondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMergeRequestCanceledExtraDetailsOther: DBXTeamLogTeamMergeRequestCanceledExtraDetails { + @objc + public init() { + let swift = TeamLog.TeamMergeRequestCanceledExtraDetails.other + super.init(swift: swift) + } +} + +/// Canceled a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(secondaryTeam: String, sentBy: String) { + self.swift = TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestCanceledShownToPrimaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestCanceledShownToPrimaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamType + + public init(swift: TeamLog.TeamMergeRequestCanceledShownToPrimaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Canceled a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamDetails: NSObject { + /// The email of the primary team admin that the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(sentTo: String, sentBy: String) { + self.swift = TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamDetails(sentTo: sentTo, sentBy: sentBy) + } + + let swift: TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestCanceledShownToSecondaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestCanceledShownToSecondaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamType + + public init(swift: TeamLog.TeamMergeRequestCanceledShownToSecondaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestCanceledType struct +@objc +public class DBXTeamLogTeamMergeRequestCanceledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestCanceledType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestCanceledType + + public init(swift: TeamLog.TeamMergeRequestCanceledType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request expired. +@objc +public class DBXTeamLogTeamMergeRequestExpiredDetails: NSObject { + /// Team merge request expiration details. + @objc + public var requestExpiredDetails: DBXTeamLogTeamMergeRequestExpiredExtraDetails { + DBXTeamLogTeamMergeRequestExpiredExtraDetails(swift: swift.requestExpiredDetails) + } + + @objc + public init(requestExpiredDetails: DBXTeamLogTeamMergeRequestExpiredExtraDetails) { + self.swift = TeamLog.TeamMergeRequestExpiredDetails(requestExpiredDetails: requestExpiredDetails.swift) + } + + let swift: TeamLog.TeamMergeRequestExpiredDetails + + public init(swift: TeamLog.TeamMergeRequestExpiredDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request expiration details +@objc +public class DBXTeamLogTeamMergeRequestExpiredExtraDetails: NSObject { + let swift: TeamLog.TeamMergeRequestExpiredExtraDetails + + public init(swift: TeamLog.TeamMergeRequestExpiredExtraDetails) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamMergeRequestExpiredExtraDetails) -> DBXTeamLogTeamMergeRequestExpiredExtraDetails { + switch swift { + case .primaryTeam(let swiftArg): + let arg = DBXTeamLogPrimaryTeamRequestExpiredDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestExpiredExtraDetailsPrimaryTeam(arg) + case .secondaryTeam(let swiftArg): + let arg = DBXTeamLogSecondaryTeamRequestExpiredDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestExpiredExtraDetailsSecondaryTeam(arg) + case .other: + return DBXTeamLogTeamMergeRequestExpiredExtraDetailsOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPrimaryTeam: DBXTeamLogTeamMergeRequestExpiredExtraDetailsPrimaryTeam? { + self as? DBXTeamLogTeamMergeRequestExpiredExtraDetailsPrimaryTeam + } + + @objc + public var asSecondaryTeam: DBXTeamLogTeamMergeRequestExpiredExtraDetailsSecondaryTeam? { + self as? DBXTeamLogTeamMergeRequestExpiredExtraDetailsSecondaryTeam + } + + @objc + public var asOther: DBXTeamLogTeamMergeRequestExpiredExtraDetailsOther? { + self as? DBXTeamLogTeamMergeRequestExpiredExtraDetailsOther + } +} + +/// Team merge request canceled details shown to the primary team. +@objc +public class DBXTeamLogTeamMergeRequestExpiredExtraDetailsPrimaryTeam: DBXTeamLogTeamMergeRequestExpiredExtraDetails { + @objc + public var primaryTeam: DBXTeamLogPrimaryTeamRequestExpiredDetails + + @objc + public init(_ arg: DBXTeamLogPrimaryTeamRequestExpiredDetails) { + self.primaryTeam = arg + let swift = TeamLog.TeamMergeRequestExpiredExtraDetails.primaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// Team merge request canceled details shown to the secondary team. +@objc +public class DBXTeamLogTeamMergeRequestExpiredExtraDetailsSecondaryTeam: DBXTeamLogTeamMergeRequestExpiredExtraDetails { + @objc + public var secondaryTeam: DBXTeamLogSecondaryTeamRequestExpiredDetails + + @objc + public init(_ arg: DBXTeamLogSecondaryTeamRequestExpiredDetails) { + self.secondaryTeam = arg + let swift = TeamLog.TeamMergeRequestExpiredExtraDetails.secondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMergeRequestExpiredExtraDetailsOther: DBXTeamLogTeamMergeRequestExpiredExtraDetails { + @objc + public init() { + let swift = TeamLog.TeamMergeRequestExpiredExtraDetails.other + super.init(swift: swift) + } +} + +/// Team merge request expired. +@objc +public class DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(secondaryTeam: String, sentBy: String) { + self.swift = TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestExpiredShownToPrimaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestExpiredShownToPrimaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamType + + public init(swift: TeamLog.TeamMergeRequestExpiredShownToPrimaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request expired. +@objc +public class DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamDetails: NSObject { + /// The email of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(sentTo: String) { + self.swift = TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamDetails(sentTo: sentTo) + } + + let swift: TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestExpiredShownToSecondaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestExpiredShownToSecondaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamType + + public init(swift: TeamLog.TeamMergeRequestExpiredShownToSecondaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestExpiredType struct +@objc +public class DBXTeamLogTeamMergeRequestExpiredType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestExpiredType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestExpiredType + + public init(swift: TeamLog.TeamMergeRequestExpiredType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Rejected a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(secondaryTeam: String, sentBy: String) { + self.swift = TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentBy: sentBy) + } + + let swift: TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestRejectedShownToPrimaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestRejectedShownToPrimaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamType + + public init(swift: TeamLog.TeamMergeRequestRejectedShownToPrimaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Rejected a team merge request. +@objc +public class DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamDetails: NSObject { + /// The name of the secondary team admin who sent the request originally. + @objc + public var sentBy: String { swift.sentBy } + + @objc + public init(sentBy: String) { + self.swift = TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamDetails(sentBy: sentBy) + } + + let swift: TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestRejectedShownToSecondaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestRejectedShownToSecondaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamType + + public init(swift: TeamLog.TeamMergeRequestRejectedShownToSecondaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Sent a team merge request reminder. +@objc +public class DBXTeamLogTeamMergeRequestReminderDetails: NSObject { + /// Team merge request reminder details. + @objc + public var requestReminderDetails: DBXTeamLogTeamMergeRequestReminderExtraDetails { + DBXTeamLogTeamMergeRequestReminderExtraDetails(swift: swift.requestReminderDetails) + } + + @objc + public init(requestReminderDetails: DBXTeamLogTeamMergeRequestReminderExtraDetails) { + self.swift = TeamLog.TeamMergeRequestReminderDetails(requestReminderDetails: requestReminderDetails.swift) + } + + let swift: TeamLog.TeamMergeRequestReminderDetails + + public init(swift: TeamLog.TeamMergeRequestReminderDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team merge request reminder details +@objc +public class DBXTeamLogTeamMergeRequestReminderExtraDetails: NSObject { + let swift: TeamLog.TeamMergeRequestReminderExtraDetails + + public init(swift: TeamLog.TeamMergeRequestReminderExtraDetails) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamMergeRequestReminderExtraDetails) -> DBXTeamLogTeamMergeRequestReminderExtraDetails { + switch swift { + case .primaryTeam(let swiftArg): + let arg = DBXTeamLogPrimaryTeamRequestReminderDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestReminderExtraDetailsPrimaryTeam(arg) + case .secondaryTeam(let swiftArg): + let arg = DBXTeamLogSecondaryTeamRequestReminderDetails(swift: swiftArg) + return DBXTeamLogTeamMergeRequestReminderExtraDetailsSecondaryTeam(arg) + case .other: + return DBXTeamLogTeamMergeRequestReminderExtraDetailsOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPrimaryTeam: DBXTeamLogTeamMergeRequestReminderExtraDetailsPrimaryTeam? { + self as? DBXTeamLogTeamMergeRequestReminderExtraDetailsPrimaryTeam + } + + @objc + public var asSecondaryTeam: DBXTeamLogTeamMergeRequestReminderExtraDetailsSecondaryTeam? { + self as? DBXTeamLogTeamMergeRequestReminderExtraDetailsSecondaryTeam + } + + @objc + public var asOther: DBXTeamLogTeamMergeRequestReminderExtraDetailsOther? { + self as? DBXTeamLogTeamMergeRequestReminderExtraDetailsOther + } +} + +/// Team merge request reminder details shown to the primary team. +@objc +public class DBXTeamLogTeamMergeRequestReminderExtraDetailsPrimaryTeam: DBXTeamLogTeamMergeRequestReminderExtraDetails { + @objc + public var primaryTeam: DBXTeamLogPrimaryTeamRequestReminderDetails + + @objc + public init(_ arg: DBXTeamLogPrimaryTeamRequestReminderDetails) { + self.primaryTeam = arg + let swift = TeamLog.TeamMergeRequestReminderExtraDetails.primaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// Team merge request reminder details shown to the secondary team. +@objc +public class DBXTeamLogTeamMergeRequestReminderExtraDetailsSecondaryTeam: DBXTeamLogTeamMergeRequestReminderExtraDetails { + @objc + public var secondaryTeam: DBXTeamLogSecondaryTeamRequestReminderDetails + + @objc + public init(_ arg: DBXTeamLogSecondaryTeamRequestReminderDetails) { + self.secondaryTeam = arg + let swift = TeamLog.TeamMergeRequestReminderExtraDetails.secondaryTeam(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamMergeRequestReminderExtraDetailsOther: DBXTeamLogTeamMergeRequestReminderExtraDetails { + @objc + public init() { + let swift = TeamLog.TeamMergeRequestReminderExtraDetails.other + super.init(swift: swift) + } +} + +/// Sent a team merge request reminder. +@objc +public class DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(secondaryTeam: String, sentTo: String) { + self.swift = TeamLog.TeamMergeRequestReminderShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) + } + + let swift: TeamLog.TeamMergeRequestReminderShownToPrimaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestReminderShownToPrimaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestReminderShownToPrimaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestReminderShownToPrimaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestReminderShownToPrimaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestReminderShownToPrimaryTeamType + + public init(swift: TeamLog.TeamMergeRequestReminderShownToPrimaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Sent a team merge request reminder. +@objc +public class DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamDetails: NSObject { + /// The email of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(sentTo: String) { + self.swift = TeamLog.TeamMergeRequestReminderShownToSecondaryTeamDetails(sentTo: sentTo) + } + + let swift: TeamLog.TeamMergeRequestReminderShownToSecondaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestReminderShownToSecondaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestReminderShownToSecondaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestReminderShownToSecondaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestReminderShownToSecondaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestReminderShownToSecondaryTeamType + + public init(swift: TeamLog.TeamMergeRequestReminderShownToSecondaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestReminderType struct +@objc +public class DBXTeamLogTeamMergeRequestReminderType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestReminderType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestReminderType + + public init(swift: TeamLog.TeamMergeRequestReminderType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Canceled the team merge. +@objc +public class DBXTeamLogTeamMergeRequestRevokedDetails: NSObject { + /// The name of the other team. + @objc + public var team: String { swift.team } + + @objc + public init(team: String) { + self.swift = TeamLog.TeamMergeRequestRevokedDetails(team: team) + } + + let swift: TeamLog.TeamMergeRequestRevokedDetails + + public init(swift: TeamLog.TeamMergeRequestRevokedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestRevokedType struct +@objc +public class DBXTeamLogTeamMergeRequestRevokedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestRevokedType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestRevokedType + + public init(swift: TeamLog.TeamMergeRequestRevokedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Requested to merge their Dropbox team into yours. +@objc +public class DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamDetails: NSObject { + /// The secondary team name. + @objc + public var secondaryTeam: String { swift.secondaryTeam } + /// The name of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(secondaryTeam: String, sentTo: String) { + self.swift = TeamLog.TeamMergeRequestSentShownToPrimaryTeamDetails(secondaryTeam: secondaryTeam, sentTo: sentTo) + } + + let swift: TeamLog.TeamMergeRequestSentShownToPrimaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestSentShownToPrimaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestSentShownToPrimaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestSentShownToPrimaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestSentShownToPrimaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestSentShownToPrimaryTeamType + + public init(swift: TeamLog.TeamMergeRequestSentShownToPrimaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Requested to merge your team into another Dropbox team. +@objc +public class DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamDetails: NSObject { + /// The email of the primary team admin the request was sent to. + @objc + public var sentTo: String { swift.sentTo } + + @objc + public init(sentTo: String) { + self.swift = TeamLog.TeamMergeRequestSentShownToSecondaryTeamDetails(sentTo: sentTo) + } + + let swift: TeamLog.TeamMergeRequestSentShownToSecondaryTeamDetails + + public init(swift: TeamLog.TeamMergeRequestSentShownToSecondaryTeamDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeRequestSentShownToSecondaryTeamType struct +@objc +public class DBXTeamLogTeamMergeRequestSentShownToSecondaryTeamType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeRequestSentShownToSecondaryTeamType(description_: description_) + } + + let swift: TeamLog.TeamMergeRequestSentShownToSecondaryTeamType + + public init(swift: TeamLog.TeamMergeRequestSentShownToSecondaryTeamType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Merged this team into another team. +@objc +public class DBXTeamLogTeamMergeToDetails: NSObject { + /// The name of the team that this team was merged into. + @objc + public var teamName: String { swift.teamName } + + @objc + public init(teamName: String) { + self.swift = TeamLog.TeamMergeToDetails(teamName: teamName) + } + + let swift: TeamLog.TeamMergeToDetails + + public init(swift: TeamLog.TeamMergeToDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamMergeToType struct +@objc +public class DBXTeamLogTeamMergeToType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamMergeToType(description_: description_) + } + + let swift: TeamLog.TeamMergeToType + + public init(swift: TeamLog.TeamMergeToType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Team name details +@objc +public class DBXTeamLogTeamName: NSObject { + /// Team's display name. + @objc + public var teamDisplayName: String { swift.teamDisplayName } + /// Team's legal name. + @objc + public var teamLegalName: String { swift.teamLegalName } + + @objc + public init(teamDisplayName: String, teamLegalName: String) { + self.swift = TeamLog.TeamName(teamDisplayName: teamDisplayName, teamLegalName: teamLegalName) + } + + let swift: TeamLog.TeamName + + public init(swift: TeamLog.TeamName) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added team background to display on shared link headers. +@objc +public class DBXTeamLogTeamProfileAddBackgroundDetails: NSObject { + let swift: TeamLog.TeamProfileAddBackgroundDetails + + public init(swift: TeamLog.TeamProfileAddBackgroundDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileAddBackgroundType struct +@objc +public class DBXTeamLogTeamProfileAddBackgroundType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileAddBackgroundType(description_: description_) + } + + let swift: TeamLog.TeamProfileAddBackgroundType + + public init(swift: TeamLog.TeamProfileAddBackgroundType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added team logo to display on shared link headers. +@objc +public class DBXTeamLogTeamProfileAddLogoDetails: NSObject { + let swift: TeamLog.TeamProfileAddLogoDetails + + public init(swift: TeamLog.TeamProfileAddLogoDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileAddLogoType struct +@objc +public class DBXTeamLogTeamProfileAddLogoType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileAddLogoType(description_: description_) + } + + let swift: TeamLog.TeamProfileAddLogoType + + public init(swift: TeamLog.TeamProfileAddLogoType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team background displayed on shared link headers. +@objc +public class DBXTeamLogTeamProfileChangeBackgroundDetails: NSObject { + let swift: TeamLog.TeamProfileChangeBackgroundDetails + + public init(swift: TeamLog.TeamProfileChangeBackgroundDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileChangeBackgroundType struct +@objc +public class DBXTeamLogTeamProfileChangeBackgroundType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileChangeBackgroundType(description_: description_) + } + + let swift: TeamLog.TeamProfileChangeBackgroundType + + public init(swift: TeamLog.TeamProfileChangeBackgroundType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed default language for team. +@objc +public class DBXTeamLogTeamProfileChangeDefaultLanguageDetails: NSObject { + /// New team's default language. + @objc + public var newValue: String { swift.newValue } + /// Previous team's default language. + @objc + public var previousValue: String { swift.previousValue } + + @objc + public init(newValue: String, previousValue: String) { + self.swift = TeamLog.TeamProfileChangeDefaultLanguageDetails(newValue: newValue, previousValue: previousValue) + } + + let swift: TeamLog.TeamProfileChangeDefaultLanguageDetails + + public init(swift: TeamLog.TeamProfileChangeDefaultLanguageDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileChangeDefaultLanguageType struct +@objc +public class DBXTeamLogTeamProfileChangeDefaultLanguageType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileChangeDefaultLanguageType(description_: description_) + } + + let swift: TeamLog.TeamProfileChangeDefaultLanguageType + + public init(swift: TeamLog.TeamProfileChangeDefaultLanguageType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team logo displayed on shared link headers. +@objc +public class DBXTeamLogTeamProfileChangeLogoDetails: NSObject { + let swift: TeamLog.TeamProfileChangeLogoDetails + + public init(swift: TeamLog.TeamProfileChangeLogoDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileChangeLogoType struct +@objc +public class DBXTeamLogTeamProfileChangeLogoType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileChangeLogoType(description_: description_) + } + + let swift: TeamLog.TeamProfileChangeLogoType + + public init(swift: TeamLog.TeamProfileChangeLogoType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team name. +@objc +public class DBXTeamLogTeamProfileChangeNameDetails: NSObject { + /// Previous teams name. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogTeamName? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogTeamName(swift: swift) + } + + /// New team name. + @objc + public var newValue: DBXTeamLogTeamName { DBXTeamLogTeamName(swift: swift.newValue) } + + @objc + public init(newValue: DBXTeamLogTeamName, previousValue: DBXTeamLogTeamName?) { + self.swift = TeamLog.TeamProfileChangeNameDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.TeamProfileChangeNameDetails + + public init(swift: TeamLog.TeamProfileChangeNameDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileChangeNameType struct +@objc +public class DBXTeamLogTeamProfileChangeNameType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileChangeNameType(description_: description_) + } + + let swift: TeamLog.TeamProfileChangeNameType + + public init(swift: TeamLog.TeamProfileChangeNameType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed team background displayed on shared link headers. +@objc +public class DBXTeamLogTeamProfileRemoveBackgroundDetails: NSObject { + let swift: TeamLog.TeamProfileRemoveBackgroundDetails + + public init(swift: TeamLog.TeamProfileRemoveBackgroundDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileRemoveBackgroundType struct +@objc +public class DBXTeamLogTeamProfileRemoveBackgroundType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileRemoveBackgroundType(description_: description_) + } + + let swift: TeamLog.TeamProfileRemoveBackgroundType + + public init(swift: TeamLog.TeamProfileRemoveBackgroundType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed team logo displayed on shared link headers. +@objc +public class DBXTeamLogTeamProfileRemoveLogoDetails: NSObject { + let swift: TeamLog.TeamProfileRemoveLogoDetails + + public init(swift: TeamLog.TeamProfileRemoveLogoDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamProfileRemoveLogoType struct +@objc +public class DBXTeamLogTeamProfileRemoveLogoType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamProfileRemoveLogoType(description_: description_) + } + + let swift: TeamLog.TeamProfileRemoveLogoType + + public init(swift: TeamLog.TeamProfileRemoveLogoType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling whether team selective sync is enabled for team. +@objc +public class DBXTeamLogTeamSelectiveSyncPolicy: NSObject { + let swift: TeamLog.TeamSelectiveSyncPolicy + + public init(swift: TeamLog.TeamSelectiveSyncPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TeamSelectiveSyncPolicy) -> DBXTeamLogTeamSelectiveSyncPolicy { + switch swift { + case .disabled: + return DBXTeamLogTeamSelectiveSyncPolicyDisabled() + case .enabled: + return DBXTeamLogTeamSelectiveSyncPolicyEnabled() + case .other: + return DBXTeamLogTeamSelectiveSyncPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogTeamSelectiveSyncPolicyDisabled? { + self as? DBXTeamLogTeamSelectiveSyncPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogTeamSelectiveSyncPolicyEnabled? { + self as? DBXTeamLogTeamSelectiveSyncPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogTeamSelectiveSyncPolicyOther? { + self as? DBXTeamLogTeamSelectiveSyncPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamSelectiveSyncPolicyDisabled: DBXTeamLogTeamSelectiveSyncPolicy { + @objc + public init() { + let swift = TeamLog.TeamSelectiveSyncPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamSelectiveSyncPolicyEnabled: DBXTeamLogTeamSelectiveSyncPolicy { + @objc + public init() { + let swift = TeamLog.TeamSelectiveSyncPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTeamSelectiveSyncPolicyOther: DBXTeamLogTeamSelectiveSyncPolicy { + @objc + public init() { + let swift = TeamLog.TeamSelectiveSyncPolicy.other + super.init(swift: swift) + } +} + +/// Enabled/disabled Team Selective Sync for team. +@objc +public class DBXTeamLogTeamSelectiveSyncPolicyChangedDetails: NSObject { + /// New Team Selective Sync policy. + @objc + public var newValue: DBXTeamLogTeamSelectiveSyncPolicy { DBXTeamLogTeamSelectiveSyncPolicy(swift: swift.newValue) } + /// Previous Team Selective Sync policy. + @objc + public var previousValue: DBXTeamLogTeamSelectiveSyncPolicy { DBXTeamLogTeamSelectiveSyncPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogTeamSelectiveSyncPolicy, previousValue: DBXTeamLogTeamSelectiveSyncPolicy) { + self.swift = TeamLog.TeamSelectiveSyncPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.TeamSelectiveSyncPolicyChangedDetails + + public init(swift: TeamLog.TeamSelectiveSyncPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamSelectiveSyncPolicyChangedType struct +@objc +public class DBXTeamLogTeamSelectiveSyncPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamSelectiveSyncPolicyChangedType(description_: description_) + } + + let swift: TeamLog.TeamSelectiveSyncPolicyChangedType + + public init(swift: TeamLog.TeamSelectiveSyncPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed sync default. +@objc +public class DBXTeamLogTeamSelectiveSyncSettingsChangedDetails: NSObject { + /// Previous value. + @objc + public var previousValue: DBXFilesSyncSetting { DBXFilesSyncSetting(swift: swift.previousValue) } + /// New value. + @objc + public var newValue: DBXFilesSyncSetting { DBXFilesSyncSetting(swift: swift.newValue) } + + @objc + public init(previousValue: DBXFilesSyncSetting, newValue: DBXFilesSyncSetting) { + self.swift = TeamLog.TeamSelectiveSyncSettingsChangedDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.TeamSelectiveSyncSettingsChangedDetails + + public init(swift: TeamLog.TeamSelectiveSyncSettingsChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamSelectiveSyncSettingsChangedType struct +@objc +public class DBXTeamLogTeamSelectiveSyncSettingsChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamSelectiveSyncSettingsChangedType(description_: description_) + } + + let swift: TeamLog.TeamSelectiveSyncSettingsChangedType + + public init(swift: TeamLog.TeamSelectiveSyncSettingsChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Edited the approved list for sharing externally. +@objc +public class DBXTeamLogTeamSharingWhitelistSubjectsChangedDetails: NSObject { + /// Domains or emails added to the approved list for sharing externally. + @objc + public var addedWhitelistSubjects: [String] { swift.addedWhitelistSubjects } + /// Domains or emails removed from the approved list for sharing externally. + @objc + public var removedWhitelistSubjects: [String] { swift.removedWhitelistSubjects } + + @objc + public init(addedWhitelistSubjects: [String], removedWhitelistSubjects: [String]) { + self.swift = TeamLog.TeamSharingWhitelistSubjectsChangedDetails( + addedWhitelistSubjects: addedWhitelistSubjects, + removedWhitelistSubjects: removedWhitelistSubjects + ) + } + + let swift: TeamLog.TeamSharingWhitelistSubjectsChangedDetails + + public init(swift: TeamLog.TeamSharingWhitelistSubjectsChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamSharingWhitelistSubjectsChangedType struct +@objc +public class DBXTeamLogTeamSharingWhitelistSubjectsChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamSharingWhitelistSubjectsChangedType(description_: description_) + } + + let swift: TeamLog.TeamSharingWhitelistSubjectsChangedType + + public init(swift: TeamLog.TeamSharingWhitelistSubjectsChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added backup phone for two-step verification. +@objc +public class DBXTeamLogTfaAddBackupPhoneDetails: NSObject { + let swift: TeamLog.TfaAddBackupPhoneDetails + + public init(swift: TeamLog.TfaAddBackupPhoneDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaAddBackupPhoneType struct +@objc +public class DBXTeamLogTfaAddBackupPhoneType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaAddBackupPhoneType(description_: description_) + } + + let swift: TeamLog.TfaAddBackupPhoneType + + public init(swift: TeamLog.TfaAddBackupPhoneType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added members to two factor authentication exception list. +@objc +public class DBXTeamLogTfaAddExceptionDetails: NSObject { + let swift: TeamLog.TfaAddExceptionDetails + + public init(swift: TeamLog.TfaAddExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaAddExceptionType struct +@objc +public class DBXTeamLogTfaAddExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaAddExceptionType(description_: description_) + } + + let swift: TeamLog.TfaAddExceptionType + + public init(swift: TeamLog.TfaAddExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Added security key for two-step verification. +@objc +public class DBXTeamLogTfaAddSecurityKeyDetails: NSObject { + let swift: TeamLog.TfaAddSecurityKeyDetails + + public init(swift: TeamLog.TfaAddSecurityKeyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaAddSecurityKeyType struct +@objc +public class DBXTeamLogTfaAddSecurityKeyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaAddSecurityKeyType(description_: description_) + } + + let swift: TeamLog.TfaAddSecurityKeyType + + public init(swift: TeamLog.TfaAddSecurityKeyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed backup phone for two-step verification. +@objc +public class DBXTeamLogTfaChangeBackupPhoneDetails: NSObject { + let swift: TeamLog.TfaChangeBackupPhoneDetails + + public init(swift: TeamLog.TfaChangeBackupPhoneDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaChangeBackupPhoneType struct +@objc +public class DBXTeamLogTfaChangeBackupPhoneType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaChangeBackupPhoneType(description_: description_) + } + + let swift: TeamLog.TfaChangeBackupPhoneType + + public init(swift: TeamLog.TfaChangeBackupPhoneType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed two-step verification setting for team. +@objc +public class DBXTeamLogTfaChangePolicyDetails: NSObject { + /// New change policy. + @objc + public var newValue: DBXTeamPoliciesTwoStepVerificationPolicy { DBXTeamPoliciesTwoStepVerificationPolicy(swift: swift.newValue) } + /// Previous change policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamPoliciesTwoStepVerificationPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamPoliciesTwoStepVerificationPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamPoliciesTwoStepVerificationPolicy, previousValue: DBXTeamPoliciesTwoStepVerificationPolicy?) { + self.swift = TeamLog.TfaChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.TfaChangePolicyDetails + + public init(swift: TeamLog.TfaChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaChangePolicyType struct +@objc +public class DBXTeamLogTfaChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaChangePolicyType(description_: description_) + } + + let swift: TeamLog.TfaChangePolicyType + + public init(swift: TeamLog.TfaChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Enabled/disabled/changed two-step verification setting. +@objc +public class DBXTeamLogTfaChangeStatusDetails: NSObject { + /// The new two factor authentication configuration. + @objc + public var newValue: DBXTeamLogTfaConfiguration { DBXTeamLogTfaConfiguration(swift: swift.newValue) } + /// The previous two factor authentication configuration. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogTfaConfiguration? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogTfaConfiguration(swift: swift) + } + + /// Used two factor authentication rescue code. This flag is relevant when the two factor authentication + /// configuration is disabled. + @objc + public var usedRescueCode: NSNumber? { swift.usedRescueCode as NSNumber? } + + @objc + public init(newValue: DBXTeamLogTfaConfiguration, previousValue: DBXTeamLogTfaConfiguration?, usedRescueCode: NSNumber?) { + self.swift = TeamLog.TfaChangeStatusDetails(newValue: newValue.swift, previousValue: previousValue?.swift, usedRescueCode: usedRescueCode?.boolValue) + } + + let swift: TeamLog.TfaChangeStatusDetails + + public init(swift: TeamLog.TfaChangeStatusDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaChangeStatusType struct +@objc +public class DBXTeamLogTfaChangeStatusType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaChangeStatusType(description_: description_) + } + + let swift: TeamLog.TfaChangeStatusType + + public init(swift: TeamLog.TfaChangeStatusType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Two factor authentication configuration. Note: the enabled option is deprecated. +@objc +public class DBXTeamLogTfaConfiguration: NSObject { + let swift: TeamLog.TfaConfiguration + + public init(swift: TeamLog.TfaConfiguration) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TfaConfiguration) -> DBXTeamLogTfaConfiguration { + switch swift { + case .authenticator: + return DBXTeamLogTfaConfigurationAuthenticator() + case .disabled: + return DBXTeamLogTfaConfigurationDisabled() + case .enabled: + return DBXTeamLogTfaConfigurationEnabled() + case .sms: + return DBXTeamLogTfaConfigurationSms() + case .other: + return DBXTeamLogTfaConfigurationOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAuthenticator: DBXTeamLogTfaConfigurationAuthenticator? { + self as? DBXTeamLogTfaConfigurationAuthenticator + } + + @objc + public var asDisabled: DBXTeamLogTfaConfigurationDisabled? { + self as? DBXTeamLogTfaConfigurationDisabled + } + + @objc + public var asEnabled: DBXTeamLogTfaConfigurationEnabled? { + self as? DBXTeamLogTfaConfigurationEnabled + } + + @objc + public var asSms: DBXTeamLogTfaConfigurationSms? { + self as? DBXTeamLogTfaConfigurationSms + } + + @objc + public var asOther: DBXTeamLogTfaConfigurationOther? { + self as? DBXTeamLogTfaConfigurationOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTfaConfigurationAuthenticator: DBXTeamLogTfaConfiguration { + @objc + public init() { + let swift = TeamLog.TfaConfiguration.authenticator + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTfaConfigurationDisabled: DBXTeamLogTfaConfiguration { + @objc + public init() { + let swift = TeamLog.TfaConfiguration.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTfaConfigurationEnabled: DBXTeamLogTfaConfiguration { + @objc + public init() { + let swift = TeamLog.TfaConfiguration.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTfaConfigurationSms: DBXTeamLogTfaConfiguration { + @objc + public init() { + let swift = TeamLog.TfaConfiguration.sms + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTfaConfigurationOther: DBXTeamLogTfaConfiguration { + @objc + public init() { + let swift = TeamLog.TfaConfiguration.other + super.init(swift: swift) + } +} + +/// Removed backup phone for two-step verification. +@objc +public class DBXTeamLogTfaRemoveBackupPhoneDetails: NSObject { + let swift: TeamLog.TfaRemoveBackupPhoneDetails + + public init(swift: TeamLog.TfaRemoveBackupPhoneDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaRemoveBackupPhoneType struct +@objc +public class DBXTeamLogTfaRemoveBackupPhoneType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaRemoveBackupPhoneType(description_: description_) + } + + let swift: TeamLog.TfaRemoveBackupPhoneType + + public init(swift: TeamLog.TfaRemoveBackupPhoneType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed members from two factor authentication exception list. +@objc +public class DBXTeamLogTfaRemoveExceptionDetails: NSObject { + let swift: TeamLog.TfaRemoveExceptionDetails + + public init(swift: TeamLog.TfaRemoveExceptionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaRemoveExceptionType struct +@objc +public class DBXTeamLogTfaRemoveExceptionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaRemoveExceptionType(description_: description_) + } + + let swift: TeamLog.TfaRemoveExceptionType + + public init(swift: TeamLog.TfaRemoveExceptionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed security key for two-step verification. +@objc +public class DBXTeamLogTfaRemoveSecurityKeyDetails: NSObject { + let swift: TeamLog.TfaRemoveSecurityKeyDetails + + public init(swift: TeamLog.TfaRemoveSecurityKeyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaRemoveSecurityKeyType struct +@objc +public class DBXTeamLogTfaRemoveSecurityKeyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaRemoveSecurityKeyType(description_: description_) + } + + let swift: TeamLog.TfaRemoveSecurityKeyType + + public init(swift: TeamLog.TfaRemoveSecurityKeyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reset two-step verification for team member. +@objc +public class DBXTeamLogTfaResetDetails: NSObject { + let swift: TeamLog.TfaResetDetails + + public init(swift: TeamLog.TfaResetDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TfaResetType struct +@objc +public class DBXTeamLogTfaResetType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TfaResetType(description_: description_) + } + + let swift: TeamLog.TfaResetType + + public init(swift: TeamLog.TfaResetType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TimeUnit union +@objc +public class DBXTeamLogTimeUnit: NSObject { + let swift: TeamLog.TimeUnit + + public init(swift: TeamLog.TimeUnit) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TimeUnit) -> DBXTeamLogTimeUnit { + switch swift { + case .days: + return DBXTeamLogTimeUnitDays() + case .hours: + return DBXTeamLogTimeUnitHours() + case .milliseconds: + return DBXTeamLogTimeUnitMilliseconds() + case .minutes: + return DBXTeamLogTimeUnitMinutes() + case .months: + return DBXTeamLogTimeUnitMonths() + case .seconds: + return DBXTeamLogTimeUnitSeconds() + case .weeks: + return DBXTeamLogTimeUnitWeeks() + case .years: + return DBXTeamLogTimeUnitYears() + case .other: + return DBXTeamLogTimeUnitOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDays: DBXTeamLogTimeUnitDays? { + self as? DBXTeamLogTimeUnitDays + } + + @objc + public var asHours: DBXTeamLogTimeUnitHours? { + self as? DBXTeamLogTimeUnitHours + } + + @objc + public var asMilliseconds: DBXTeamLogTimeUnitMilliseconds? { + self as? DBXTeamLogTimeUnitMilliseconds + } + + @objc + public var asMinutes: DBXTeamLogTimeUnitMinutes? { + self as? DBXTeamLogTimeUnitMinutes + } + + @objc + public var asMonths: DBXTeamLogTimeUnitMonths? { + self as? DBXTeamLogTimeUnitMonths + } + + @objc + public var asSeconds: DBXTeamLogTimeUnitSeconds? { + self as? DBXTeamLogTimeUnitSeconds + } + + @objc + public var asWeeks: DBXTeamLogTimeUnitWeeks? { + self as? DBXTeamLogTimeUnitWeeks + } + + @objc + public var asYears: DBXTeamLogTimeUnitYears? { + self as? DBXTeamLogTimeUnitYears + } + + @objc + public var asOther: DBXTeamLogTimeUnitOther? { + self as? DBXTeamLogTimeUnitOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitDays: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.days + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitHours: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.hours + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitMilliseconds: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.milliseconds + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitMinutes: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.minutes + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitMonths: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.months + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitSeconds: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.seconds + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitWeeks: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.weeks + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitYears: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTimeUnitOther: DBXTeamLogTimeUnit { + @objc + public init() { + let swift = TeamLog.TimeUnit.other + super.init(swift: swift) + } +} + +/// User that is not a member of the team but considered trusted. +@objc +public class DBXTeamLogTrustedNonTeamMemberLogInfo: DBXTeamLogUserLogInfo { + /// Indicates the type of the member of a trusted team. + @objc + public var trustedNonTeamMemberType: DBXTeamLogTrustedNonTeamMemberType { DBXTeamLogTrustedNonTeamMemberType(swift: subSwift.trustedNonTeamMemberType) } + /// Details about this user's trusted team. + @objc + public var team: DBXTeamLogTeamLogInfo? { guard let swift = subSwift.team else { return nil } + return DBXTeamLogTeamLogInfo(swift: swift) + } + + @objc + public init( + trustedNonTeamMemberType: DBXTeamLogTrustedNonTeamMemberType, + accountId: String?, + displayName: String?, + email: String?, + team: DBXTeamLogTeamLogInfo? + ) { + let swift = TeamLog.TrustedNonTeamMemberLogInfo( + trustedNonTeamMemberType: trustedNonTeamMemberType.swift, + accountId: accountId, + displayName: displayName, + email: email, + team: team?.swift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: TeamLog.TrustedNonTeamMemberLogInfo + + public init(swift: TeamLog.TrustedNonTeamMemberLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible TrustedNonTeamMemberType union +@objc +public class DBXTeamLogTrustedNonTeamMemberType: NSObject { + let swift: TeamLog.TrustedNonTeamMemberType + + public init(swift: TeamLog.TrustedNonTeamMemberType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TrustedNonTeamMemberType) -> DBXTeamLogTrustedNonTeamMemberType { + switch swift { + case .enterpriseAdmin: + return DBXTeamLogTrustedNonTeamMemberTypeEnterpriseAdmin() + case .multiInstanceAdmin: + return DBXTeamLogTrustedNonTeamMemberTypeMultiInstanceAdmin() + case .other: + return DBXTeamLogTrustedNonTeamMemberTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEnterpriseAdmin: DBXTeamLogTrustedNonTeamMemberTypeEnterpriseAdmin? { + self as? DBXTeamLogTrustedNonTeamMemberTypeEnterpriseAdmin + } + + @objc + public var asMultiInstanceAdmin: DBXTeamLogTrustedNonTeamMemberTypeMultiInstanceAdmin? { + self as? DBXTeamLogTrustedNonTeamMemberTypeMultiInstanceAdmin + } + + @objc + public var asOther: DBXTeamLogTrustedNonTeamMemberTypeOther? { + self as? DBXTeamLogTrustedNonTeamMemberTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedNonTeamMemberTypeEnterpriseAdmin: DBXTeamLogTrustedNonTeamMemberType { + @objc + public init() { + let swift = TeamLog.TrustedNonTeamMemberType.enterpriseAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedNonTeamMemberTypeMultiInstanceAdmin: DBXTeamLogTrustedNonTeamMemberType { + @objc + public init() { + let swift = TeamLog.TrustedNonTeamMemberType.multiInstanceAdmin + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedNonTeamMemberTypeOther: DBXTeamLogTrustedNonTeamMemberType { + @objc + public init() { + let swift = TeamLog.TrustedNonTeamMemberType.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TrustedTeamsRequestAction union +@objc +public class DBXTeamLogTrustedTeamsRequestAction: NSObject { + let swift: TeamLog.TrustedTeamsRequestAction + + public init(swift: TeamLog.TrustedTeamsRequestAction) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TrustedTeamsRequestAction) -> DBXTeamLogTrustedTeamsRequestAction { + switch swift { + case .accepted: + return DBXTeamLogTrustedTeamsRequestActionAccepted() + case .declined: + return DBXTeamLogTrustedTeamsRequestActionDeclined() + case .expired: + return DBXTeamLogTrustedTeamsRequestActionExpired() + case .invited: + return DBXTeamLogTrustedTeamsRequestActionInvited() + case .revoked: + return DBXTeamLogTrustedTeamsRequestActionRevoked() + case .other: + return DBXTeamLogTrustedTeamsRequestActionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAccepted: DBXTeamLogTrustedTeamsRequestActionAccepted? { + self as? DBXTeamLogTrustedTeamsRequestActionAccepted + } + + @objc + public var asDeclined: DBXTeamLogTrustedTeamsRequestActionDeclined? { + self as? DBXTeamLogTrustedTeamsRequestActionDeclined + } + + @objc + public var asExpired: DBXTeamLogTrustedTeamsRequestActionExpired? { + self as? DBXTeamLogTrustedTeamsRequestActionExpired + } + + @objc + public var asInvited: DBXTeamLogTrustedTeamsRequestActionInvited? { + self as? DBXTeamLogTrustedTeamsRequestActionInvited + } + + @objc + public var asRevoked: DBXTeamLogTrustedTeamsRequestActionRevoked? { + self as? DBXTeamLogTrustedTeamsRequestActionRevoked + } + + @objc + public var asOther: DBXTeamLogTrustedTeamsRequestActionOther? { + self as? DBXTeamLogTrustedTeamsRequestActionOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestActionAccepted: DBXTeamLogTrustedTeamsRequestAction { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestAction.accepted + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestActionDeclined: DBXTeamLogTrustedTeamsRequestAction { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestAction.declined + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestActionExpired: DBXTeamLogTrustedTeamsRequestAction { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestAction.expired + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestActionInvited: DBXTeamLogTrustedTeamsRequestAction { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestAction.invited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestActionRevoked: DBXTeamLogTrustedTeamsRequestAction { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestAction.revoked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestActionOther: DBXTeamLogTrustedTeamsRequestAction { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestAction.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TrustedTeamsRequestState union +@objc +public class DBXTeamLogTrustedTeamsRequestState: NSObject { + let swift: TeamLog.TrustedTeamsRequestState + + public init(swift: TeamLog.TrustedTeamsRequestState) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TrustedTeamsRequestState) -> DBXTeamLogTrustedTeamsRequestState { + switch swift { + case .invited: + return DBXTeamLogTrustedTeamsRequestStateInvited() + case .linked: + return DBXTeamLogTrustedTeamsRequestStateLinked() + case .unlinked: + return DBXTeamLogTrustedTeamsRequestStateUnlinked() + case .other: + return DBXTeamLogTrustedTeamsRequestStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInvited: DBXTeamLogTrustedTeamsRequestStateInvited? { + self as? DBXTeamLogTrustedTeamsRequestStateInvited + } + + @objc + public var asLinked: DBXTeamLogTrustedTeamsRequestStateLinked? { + self as? DBXTeamLogTrustedTeamsRequestStateLinked + } + + @objc + public var asUnlinked: DBXTeamLogTrustedTeamsRequestStateUnlinked? { + self as? DBXTeamLogTrustedTeamsRequestStateUnlinked + } + + @objc + public var asOther: DBXTeamLogTrustedTeamsRequestStateOther? { + self as? DBXTeamLogTrustedTeamsRequestStateOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestStateInvited: DBXTeamLogTrustedTeamsRequestState { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestState.invited + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestStateLinked: DBXTeamLogTrustedTeamsRequestState { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestState.linked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestStateUnlinked: DBXTeamLogTrustedTeamsRequestState { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestState.unlinked + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTrustedTeamsRequestStateOther: DBXTeamLogTrustedTeamsRequestState { + @objc + public init() { + let swift = TeamLog.TrustedTeamsRequestState.other + super.init(swift: swift) + } +} + +/// Enabled/disabled option for members to link personal Dropbox account and team account to same computer. +@objc +public class DBXTeamLogTwoAccountChangePolicyDetails: NSObject { + /// New two account policy. + @objc + public var newValue: DBXTeamLogTwoAccountPolicy { DBXTeamLogTwoAccountPolicy(swift: swift.newValue) } + /// Previous two account policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogTwoAccountPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogTwoAccountPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogTwoAccountPolicy, previousValue: DBXTeamLogTwoAccountPolicy?) { + self.swift = TeamLog.TwoAccountChangePolicyDetails(newValue: newValue.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.TwoAccountChangePolicyDetails + + public init(swift: TeamLog.TwoAccountChangePolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TwoAccountChangePolicyType struct +@objc +public class DBXTeamLogTwoAccountChangePolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TwoAccountChangePolicyType(description_: description_) + } + + let swift: TeamLog.TwoAccountChangePolicyType + + public init(swift: TeamLog.TwoAccountChangePolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for pairing personal account to work account +@objc +public class DBXTeamLogTwoAccountPolicy: NSObject { + let swift: TeamLog.TwoAccountPolicy + + public init(swift: TeamLog.TwoAccountPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.TwoAccountPolicy) -> DBXTeamLogTwoAccountPolicy { + switch swift { + case .disabled: + return DBXTeamLogTwoAccountPolicyDisabled() + case .enabled: + return DBXTeamLogTwoAccountPolicyEnabled() + case .other: + return DBXTeamLogTwoAccountPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogTwoAccountPolicyDisabled? { + self as? DBXTeamLogTwoAccountPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogTwoAccountPolicyEnabled? { + self as? DBXTeamLogTwoAccountPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogTwoAccountPolicyOther? { + self as? DBXTeamLogTwoAccountPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTwoAccountPolicyDisabled: DBXTeamLogTwoAccountPolicy { + @objc + public init() { + let swift = TeamLog.TwoAccountPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTwoAccountPolicyEnabled: DBXTeamLogTwoAccountPolicy { + @objc + public init() { + let swift = TeamLog.TwoAccountPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogTwoAccountPolicyOther: DBXTeamLogTwoAccountPolicy { + @objc + public init() { + let swift = TeamLog.TwoAccountPolicy.other + super.init(swift: swift) + } +} + +/// Reverted naming convention. +@objc +public class DBXTeamLogUndoNamingConventionDetails: NSObject { + let swift: TeamLog.UndoNamingConventionDetails + + public init(swift: TeamLog.UndoNamingConventionDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UndoNamingConventionType struct +@objc +public class DBXTeamLogUndoNamingConventionType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.UndoNamingConventionType(description_: description_) + } + + let swift: TeamLog.UndoNamingConventionType + + public init(swift: TeamLog.UndoNamingConventionType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed multi-file organize. +@objc +public class DBXTeamLogUndoOrganizeFolderWithTidyDetails: NSObject { + let swift: TeamLog.UndoOrganizeFolderWithTidyDetails + + public init(swift: TeamLog.UndoOrganizeFolderWithTidyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UndoOrganizeFolderWithTidyType struct +@objc +public class DBXTeamLogUndoOrganizeFolderWithTidyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.UndoOrganizeFolderWithTidyType(description_: description_) + } + + let swift: TeamLog.UndoOrganizeFolderWithTidyType + + public init(swift: TeamLog.UndoOrganizeFolderWithTidyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// User linked app +@objc +public class DBXTeamLogUserLinkedAppLogInfo: DBXTeamLogAppLogInfo { + let subSwift: TeamLog.UserLinkedAppLogInfo + + public init(swift: TeamLog.UserLinkedAppLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// User's name logged information +@objc +public class DBXTeamLogUserNameLogInfo: NSObject { + /// Given name. + @objc + public var givenName: String { swift.givenName } + /// Surname. + @objc + public var surname: String { swift.surname } + /// Locale. Might be missing due to historical data gap. + @objc + public var locale: String? { swift.locale } + + @objc + public init(givenName: String, surname: String, locale: String?) { + self.swift = TeamLog.UserNameLogInfo(givenName: givenName, surname: surname, locale: locale) + } + + let swift: TeamLog.UserNameLogInfo + + public init(swift: TeamLog.UserNameLogInfo) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// User or team linked app. Used when linked type is missing due to historical data gap. +@objc +public class DBXTeamLogUserOrTeamLinkedAppLogInfo: DBXTeamLogAppLogInfo { + let subSwift: TeamLog.UserOrTeamLinkedAppLogInfo + + public init(swift: TeamLog.UserOrTeamLinkedAppLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Tagged a file. +@objc +public class DBXTeamLogUserTagsAddedDetails: NSObject { + /// values. + @objc + public var values: [String] { swift.values } + + @objc + public init(values: [String]) { + self.swift = TeamLog.UserTagsAddedDetails(values: values) + } + + let swift: TeamLog.UserTagsAddedDetails + + public init(swift: TeamLog.UserTagsAddedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserTagsAddedType struct +@objc +public class DBXTeamLogUserTagsAddedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.UserTagsAddedType(description_: description_) + } + + let swift: TeamLog.UserTagsAddedType + + public init(swift: TeamLog.UserTagsAddedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Removed tags. +@objc +public class DBXTeamLogUserTagsRemovedDetails: NSObject { + /// values. + @objc + public var values: [String] { swift.values } + + @objc + public init(values: [String]) { + self.swift = TeamLog.UserTagsRemovedDetails(values: values) + } + + let swift: TeamLog.UserTagsRemovedDetails + + public init(swift: TeamLog.UserTagsRemovedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserTagsRemovedType struct +@objc +public class DBXTeamLogUserTagsRemovedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.UserTagsRemovedType(description_: description_) + } + + let swift: TeamLog.UserTagsRemovedType + + public init(swift: TeamLog.UserTagsRemovedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed team policy for viewer info. +@objc +public class DBXTeamLogViewerInfoPolicyChangedDetails: NSObject { + /// Previous Viewer Info policy. + @objc + public var previousValue: DBXTeamLogPassPolicy { DBXTeamLogPassPolicy(swift: swift.previousValue) } + /// New Viewer Info policy. + @objc + public var newValue: DBXTeamLogPassPolicy { DBXTeamLogPassPolicy(swift: swift.newValue) } + + @objc + public init(previousValue: DBXTeamLogPassPolicy, newValue: DBXTeamLogPassPolicy) { + self.swift = TeamLog.ViewerInfoPolicyChangedDetails(previousValue: previousValue.swift, newValue: newValue.swift) + } + + let swift: TeamLog.ViewerInfoPolicyChangedDetails + + public init(swift: TeamLog.ViewerInfoPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ViewerInfoPolicyChangedType struct +@objc +public class DBXTeamLogViewerInfoPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ViewerInfoPolicyChangedType(description_: description_) + } + + let swift: TeamLog.ViewerInfoPolicyChangedType + + public init(swift: TeamLog.ViewerInfoPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policy for controlling team access to watermarking feature +@objc +public class DBXTeamLogWatermarkingPolicy: NSObject { + let swift: TeamLog.WatermarkingPolicy + + public init(swift: TeamLog.WatermarkingPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.WatermarkingPolicy) -> DBXTeamLogWatermarkingPolicy { + switch swift { + case .disabled: + return DBXTeamLogWatermarkingPolicyDisabled() + case .enabled: + return DBXTeamLogWatermarkingPolicyEnabled() + case .other: + return DBXTeamLogWatermarkingPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamLogWatermarkingPolicyDisabled? { + self as? DBXTeamLogWatermarkingPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamLogWatermarkingPolicyEnabled? { + self as? DBXTeamLogWatermarkingPolicyEnabled + } + + @objc + public var asOther: DBXTeamLogWatermarkingPolicyOther? { + self as? DBXTeamLogWatermarkingPolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogWatermarkingPolicyDisabled: DBXTeamLogWatermarkingPolicy { + @objc + public init() { + let swift = TeamLog.WatermarkingPolicy.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogWatermarkingPolicyEnabled: DBXTeamLogWatermarkingPolicy { + @objc + public init() { + let swift = TeamLog.WatermarkingPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogWatermarkingPolicyOther: DBXTeamLogWatermarkingPolicy { + @objc + public init() { + let swift = TeamLog.WatermarkingPolicy.other + super.init(swift: swift) + } +} + +/// Changed watermarking policy for team. +@objc +public class DBXTeamLogWatermarkingPolicyChangedDetails: NSObject { + /// New watermarking policy. + @objc + public var newValue: DBXTeamLogWatermarkingPolicy { DBXTeamLogWatermarkingPolicy(swift: swift.newValue) } + /// Previous watermarking policy. + @objc + public var previousValue: DBXTeamLogWatermarkingPolicy { DBXTeamLogWatermarkingPolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogWatermarkingPolicy, previousValue: DBXTeamLogWatermarkingPolicy) { + self.swift = TeamLog.WatermarkingPolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.WatermarkingPolicyChangedDetails + + public init(swift: TeamLog.WatermarkingPolicyChangedDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible WatermarkingPolicyChangedType struct +@objc +public class DBXTeamLogWatermarkingPolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.WatermarkingPolicyChangedType(description_: description_) + } + + let swift: TeamLog.WatermarkingPolicyChangedType + + public init(swift: TeamLog.WatermarkingPolicyChangedType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Information on active web sessions +@objc +public class DBXTeamLogWebDeviceSessionLogInfo: DBXTeamLogDeviceSessionLogInfo { + /// Web session unique id. + @objc + public var sessionInfo: DBXTeamLogWebSessionLogInfo? { guard let swift = subSwift.sessionInfo else { return nil } + return DBXTeamLogWebSessionLogInfo(swift: swift) + } + + /// Information on the hosting device. + @objc + public var userAgent: String { subSwift.userAgent } + /// Information on the hosting operating system. + @objc + public var os: String { subSwift.os } + /// Information on the browser used for this web session. + @objc + public var browser: String { subSwift.browser } + + @objc + public init(userAgent: String, os: String, browser: String, ipAddress: String?, created: Date?, updated: Date?, sessionInfo: DBXTeamLogWebSessionLogInfo?) { + let swift = TeamLog.WebDeviceSessionLogInfo( + userAgent: userAgent, + os: os, + browser: browser, + ipAddress: ipAddress, + created: created, + updated: updated, + sessionInfo: sessionInfo?.subSwift + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: TeamLog.WebDeviceSessionLogInfo + + public init(swift: TeamLog.WebDeviceSessionLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Web session. +@objc +public class DBXTeamLogWebSessionLogInfo: DBXTeamLogSessionLogInfo { + let subSwift: TeamLog.WebSessionLogInfo + + public init(swift: TeamLog.WebSessionLogInfo) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Changed limit on active sessions per member. +@objc +public class DBXTeamLogWebSessionsChangeActiveSessionLimitDetails: NSObject { + /// Previous max number of concurrent active sessions policy. + @objc + public var previousValue: String { swift.previousValue } + /// New max number of concurrent active sessions policy. + @objc + public var newValue: String { swift.newValue } + + @objc + public init(previousValue: String, newValue: String) { + self.swift = TeamLog.WebSessionsChangeActiveSessionLimitDetails(previousValue: previousValue, newValue: newValue) + } + + let swift: TeamLog.WebSessionsChangeActiveSessionLimitDetails + + public init(swift: TeamLog.WebSessionsChangeActiveSessionLimitDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible WebSessionsChangeActiveSessionLimitType struct +@objc +public class DBXTeamLogWebSessionsChangeActiveSessionLimitType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.WebSessionsChangeActiveSessionLimitType(description_: description_) + } + + let swift: TeamLog.WebSessionsChangeActiveSessionLimitType + + public init(swift: TeamLog.WebSessionsChangeActiveSessionLimitType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed how long members can stay signed in to Dropbox.com. +@objc +public class DBXTeamLogWebSessionsChangeFixedLengthPolicyDetails: NSObject { + /// New session length policy. Might be missing due to historical data gap. + @objc + public var newValue: DBXTeamLogWebSessionsFixedLengthPolicy? { guard let swift = swift.newValue else { return nil } + return DBXTeamLogWebSessionsFixedLengthPolicy(swift: swift) + } + + /// Previous session length policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogWebSessionsFixedLengthPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogWebSessionsFixedLengthPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogWebSessionsFixedLengthPolicy?, previousValue: DBXTeamLogWebSessionsFixedLengthPolicy?) { + self.swift = TeamLog.WebSessionsChangeFixedLengthPolicyDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.WebSessionsChangeFixedLengthPolicyDetails + + public init(swift: TeamLog.WebSessionsChangeFixedLengthPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible WebSessionsChangeFixedLengthPolicyType struct +@objc +public class DBXTeamLogWebSessionsChangeFixedLengthPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.WebSessionsChangeFixedLengthPolicyType(description_: description_) + } + + let swift: TeamLog.WebSessionsChangeFixedLengthPolicyType + + public init(swift: TeamLog.WebSessionsChangeFixedLengthPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Changed how long team members can be idle while signed in to Dropbox.com. +@objc +public class DBXTeamLogWebSessionsChangeIdleLengthPolicyDetails: NSObject { + /// New idle length policy. Might be missing due to historical data gap. + @objc + public var newValue: DBXTeamLogWebSessionsIdleLengthPolicy? { guard let swift = swift.newValue else { return nil } + return DBXTeamLogWebSessionsIdleLengthPolicy(swift: swift) + } + + /// Previous idle length policy. Might be missing due to historical data gap. + @objc + public var previousValue: DBXTeamLogWebSessionsIdleLengthPolicy? { guard let swift = swift.previousValue else { return nil } + return DBXTeamLogWebSessionsIdleLengthPolicy(swift: swift) + } + + @objc + public init(newValue: DBXTeamLogWebSessionsIdleLengthPolicy?, previousValue: DBXTeamLogWebSessionsIdleLengthPolicy?) { + self.swift = TeamLog.WebSessionsChangeIdleLengthPolicyDetails(newValue: newValue?.swift, previousValue: previousValue?.swift) + } + + let swift: TeamLog.WebSessionsChangeIdleLengthPolicyDetails + + public init(swift: TeamLog.WebSessionsChangeIdleLengthPolicyDetails) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible WebSessionsChangeIdleLengthPolicyType struct +@objc +public class DBXTeamLogWebSessionsChangeIdleLengthPolicyType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.WebSessionsChangeIdleLengthPolicyType(description_: description_) + } + + let swift: TeamLog.WebSessionsChangeIdleLengthPolicyType + + public init(swift: TeamLog.WebSessionsChangeIdleLengthPolicyType) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Web sessions fixed length policy. +@objc +public class DBXTeamLogWebSessionsFixedLengthPolicy: NSObject { + let swift: TeamLog.WebSessionsFixedLengthPolicy + + public init(swift: TeamLog.WebSessionsFixedLengthPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.WebSessionsFixedLengthPolicy) -> DBXTeamLogWebSessionsFixedLengthPolicy { + switch swift { + case .defined(let swiftArg): + let arg = DBXTeamLogDurationLogInfo(swift: swiftArg) + return DBXTeamLogWebSessionsFixedLengthPolicyDefined(arg) + case .undefined: + return DBXTeamLogWebSessionsFixedLengthPolicyUndefined() + case .other: + return DBXTeamLogWebSessionsFixedLengthPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefined: DBXTeamLogWebSessionsFixedLengthPolicyDefined? { + self as? DBXTeamLogWebSessionsFixedLengthPolicyDefined + } + + @objc + public var asUndefined: DBXTeamLogWebSessionsFixedLengthPolicyUndefined? { + self as? DBXTeamLogWebSessionsFixedLengthPolicyUndefined + } + + @objc + public var asOther: DBXTeamLogWebSessionsFixedLengthPolicyOther? { + self as? DBXTeamLogWebSessionsFixedLengthPolicyOther + } +} + +/// Defined fixed session length. +@objc +public class DBXTeamLogWebSessionsFixedLengthPolicyDefined: DBXTeamLogWebSessionsFixedLengthPolicy { + @objc + public var defined: DBXTeamLogDurationLogInfo + + @objc + public init(_ arg: DBXTeamLogDurationLogInfo) { + self.defined = arg + let swift = TeamLog.WebSessionsFixedLengthPolicy.defined(arg.swift) + super.init(swift: swift) + } +} + +/// Undefined fixed session length. +@objc +public class DBXTeamLogWebSessionsFixedLengthPolicyUndefined: DBXTeamLogWebSessionsFixedLengthPolicy { + @objc + public init() { + let swift = TeamLog.WebSessionsFixedLengthPolicy.undefined + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogWebSessionsFixedLengthPolicyOther: DBXTeamLogWebSessionsFixedLengthPolicy { + @objc + public init() { + let swift = TeamLog.WebSessionsFixedLengthPolicy.other + super.init(swift: swift) + } +} + +/// Web sessions idle length policy. +@objc +public class DBXTeamLogWebSessionsIdleLengthPolicy: NSObject { + let swift: TeamLog.WebSessionsIdleLengthPolicy + + public init(swift: TeamLog.WebSessionsIdleLengthPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.WebSessionsIdleLengthPolicy) -> DBXTeamLogWebSessionsIdleLengthPolicy { + switch swift { + case .defined(let swiftArg): + let arg = DBXTeamLogDurationLogInfo(swift: swiftArg) + return DBXTeamLogWebSessionsIdleLengthPolicyDefined(arg) + case .undefined: + return DBXTeamLogWebSessionsIdleLengthPolicyUndefined() + case .other: + return DBXTeamLogWebSessionsIdleLengthPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefined: DBXTeamLogWebSessionsIdleLengthPolicyDefined? { + self as? DBXTeamLogWebSessionsIdleLengthPolicyDefined + } + + @objc + public var asUndefined: DBXTeamLogWebSessionsIdleLengthPolicyUndefined? { + self as? DBXTeamLogWebSessionsIdleLengthPolicyUndefined + } + + @objc + public var asOther: DBXTeamLogWebSessionsIdleLengthPolicyOther? { + self as? DBXTeamLogWebSessionsIdleLengthPolicyOther + } +} + +/// Defined idle session length. +@objc +public class DBXTeamLogWebSessionsIdleLengthPolicyDefined: DBXTeamLogWebSessionsIdleLengthPolicy { + @objc + public var defined: DBXTeamLogDurationLogInfo + + @objc + public init(_ arg: DBXTeamLogDurationLogInfo) { + self.defined = arg + let swift = TeamLog.WebSessionsIdleLengthPolicy.defined(arg.swift) + super.init(swift: swift) + } +} + +/// Undefined idle session length. +@objc +public class DBXTeamLogWebSessionsIdleLengthPolicyUndefined: DBXTeamLogWebSessionsIdleLengthPolicy { + @objc + public init() { + let swift = TeamLog.WebSessionsIdleLengthPolicy.undefined + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogWebSessionsIdleLengthPolicyOther: DBXTeamLogWebSessionsIdleLengthPolicy { + @objc + public init() { + let swift = TeamLog.WebSessionsIdleLengthPolicy.other + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLogRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLogRoutes.swift new file mode 100644 index 000000000..7670b6da7 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLogRoutes.swift @@ -0,0 +1,223 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the team_log namespace +/// For Swift routes see TeamLogRoutes +@objc +public class DBXTeamLogRoutes: NSObject { + private let swift: TeamLogRoutes + init(swift: TeamLogRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Retrieves team events. If the result's hasMore in GetTeamEventsResult field is true, call getEventsContinue with + /// the returned cursor to retrieve more entries. If end_time is not specified in your request, you may use the + /// returned cursor to poll getEventsContinue for new events. Many attributes note 'may be missing due to + /// historical data gap'. Note that the file_operations category and & analogous paper events are not available + /// on all Dropbox Business plans /business/plans-comparison. Use features/get_values + /// /developers/documentation/http/teams#team-features-get_values to check for this feature. Permission : Team + /// Auditing. + /// + /// - scope: events.read + /// + /// - parameter limit: The maximal number of results to return per call. Note that some calls may not return limit + /// number of events, and may even return no events, even with `has_more` set to true. In this case, callers + /// should fetch again using getEventsContinue. + /// - parameter accountId: Filter the events by account ID. Return only events with this account_id as either Actor, + /// Context, or Participants. + /// - parameter time: Filter by time range. + /// - parameter category: Filter the returned events to a single category. Note that category shouldn't be provided + /// together with event_type. + /// - parameter eventType: Filter the returned events to a single event type. Note that event_type shouldn't be + /// provided together with category. + /// + /// - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on + /// success or a `TeamLog.GetTeamEventsError` object on failure. + @objc + @discardableResult public func getEvents( + limit: NSNumber, + accountId: String?, + time: DBXTeamCommonTimeRange?, + category: DBXTeamLogEventCategory?, + eventType: DBXTeamLogEventTypeArg? + ) -> DBXTeamLogGetEventsRpcRequest { + let swift = swift.getEvents(limit: limit.uint32Value, accountId: accountId, time: time?.swift, category: category?.swift, eventType: eventType?.swift) + return DBXTeamLogGetEventsRpcRequest(swift: swift) + } + + /// Retrieves team events. If the result's hasMore in GetTeamEventsResult field is true, call getEventsContinue with + /// the returned cursor to retrieve more entries. If end_time is not specified in your request, you may use the + /// returned cursor to poll getEventsContinue for new events. Many attributes note 'may be missing due to + /// historical data gap'. Note that the file_operations category and & analogous paper events are not available + /// on all Dropbox Business plans /business/plans-comparison. Use features/get_values + /// /developers/documentation/http/teams#team-features-get_values to check for this feature. Permission : Team + /// Auditing. + /// + /// - scope: events.read + /// + /// - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on + /// success or a `TeamLog.GetTeamEventsError` object on failure. + @objc + @discardableResult public func getEvents() -> DBXTeamLogGetEventsRpcRequest { + let swift = swift.getEvents() + return DBXTeamLogGetEventsRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from getEvents, use this to paginate through all events. Permission : Team + /// Auditing. + /// + /// - scope: events.read + /// + /// - parameter cursor: Indicates from what point to get the next set of events. + /// + /// - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on + /// success or a `TeamLog.GetTeamEventsContinueError` object on failure. + @objc + @discardableResult public func getEventsContinue(cursor: String) -> DBXTeamLogGetEventsContinueRpcRequest { + let swift = swift.getEventsContinue(cursor: cursor) + return DBXTeamLogGetEventsContinueRpcRequest(swift: swift) + } +} + +@objc +public class DBXTeamLogGetEventsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLogGetTeamEventsResult?, DBXTeamLogGetTeamEventsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLogGetTeamEventsResult?, DBXTeamLogGetTeamEventsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLogGetTeamEventsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLogGetTeamEventsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLogGetTeamEventsResult? + if let swift = result { + objc = DBXTeamLogGetTeamEventsResult(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 DBXTeamLogGetEventsContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLogGetTeamEventsResult?, DBXTeamLogGetTeamEventsContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLogGetTeamEventsResult?, DBXTeamLogGetTeamEventsContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLogGetTeamEventsContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLogGetTeamEventsContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLogGetTeamEventsResult? + if let swift = result { + objc = DBXTeamLogGetTeamEventsResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamPolicies.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamPolicies.swift new file mode 100644 index 000000000..75ffee5fc --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamPolicies.swift @@ -0,0 +1,2197 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the team_policies namespace +/// For Swift see team_policies + +/// Objective-C compatible CameraUploadsPolicyState union +@objc +public class DBXTeamPoliciesCameraUploadsPolicyState: NSObject { + let swift: TeamPolicies.CameraUploadsPolicyState + + public init(swift: TeamPolicies.CameraUploadsPolicyState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.CameraUploadsPolicyState) -> DBXTeamPoliciesCameraUploadsPolicyState { + switch swift { + case .disabled: + return DBXTeamPoliciesCameraUploadsPolicyStateDisabled() + case .enabled: + return DBXTeamPoliciesCameraUploadsPolicyStateEnabled() + case .other: + return DBXTeamPoliciesCameraUploadsPolicyStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesCameraUploadsPolicyStateDisabled? { + self as? DBXTeamPoliciesCameraUploadsPolicyStateDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesCameraUploadsPolicyStateEnabled? { + self as? DBXTeamPoliciesCameraUploadsPolicyStateEnabled + } + + @objc + public var asOther: DBXTeamPoliciesCameraUploadsPolicyStateOther? { + self as? DBXTeamPoliciesCameraUploadsPolicyStateOther + } +} + +/// Background camera uploads are disabled. +@objc +public class DBXTeamPoliciesCameraUploadsPolicyStateDisabled: DBXTeamPoliciesCameraUploadsPolicyState { + @objc + public init() { + let swift = TeamPolicies.CameraUploadsPolicyState.disabled + super.init(swift: swift) + } +} + +/// Background camera uploads are allowed. +@objc +public class DBXTeamPoliciesCameraUploadsPolicyStateEnabled: DBXTeamPoliciesCameraUploadsPolicyState { + @objc + public init() { + let swift = TeamPolicies.CameraUploadsPolicyState.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesCameraUploadsPolicyStateOther: DBXTeamPoliciesCameraUploadsPolicyState { + @objc + public init() { + let swift = TeamPolicies.CameraUploadsPolicyState.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ComputerBackupPolicyState union +@objc +public class DBXTeamPoliciesComputerBackupPolicyState: NSObject { + let swift: TeamPolicies.ComputerBackupPolicyState + + public init(swift: TeamPolicies.ComputerBackupPolicyState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.ComputerBackupPolicyState) -> DBXTeamPoliciesComputerBackupPolicyState { + switch swift { + case .disabled: + return DBXTeamPoliciesComputerBackupPolicyStateDisabled() + case .enabled: + return DBXTeamPoliciesComputerBackupPolicyStateEnabled() + case .default_: + return DBXTeamPoliciesComputerBackupPolicyStateDefault_() + case .other: + return DBXTeamPoliciesComputerBackupPolicyStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesComputerBackupPolicyStateDisabled? { + self as? DBXTeamPoliciesComputerBackupPolicyStateDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesComputerBackupPolicyStateEnabled? { + self as? DBXTeamPoliciesComputerBackupPolicyStateEnabled + } + + @objc + public var asDefault_: DBXTeamPoliciesComputerBackupPolicyStateDefault_? { + self as? DBXTeamPoliciesComputerBackupPolicyStateDefault_ + } + + @objc + public var asOther: DBXTeamPoliciesComputerBackupPolicyStateOther? { + self as? DBXTeamPoliciesComputerBackupPolicyStateOther + } +} + +/// Computer Backup feature is disabled. +@objc +public class DBXTeamPoliciesComputerBackupPolicyStateDisabled: DBXTeamPoliciesComputerBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ComputerBackupPolicyState.disabled + super.init(swift: swift) + } +} + +/// Computer Backup feature is enabled. +@objc +public class DBXTeamPoliciesComputerBackupPolicyStateEnabled: DBXTeamPoliciesComputerBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ComputerBackupPolicyState.enabled + super.init(swift: swift) + } +} + +/// Computer Backup defaults to ON for SSB teams, and OFF for Enterprise teams. +@objc +public class DBXTeamPoliciesComputerBackupPolicyStateDefault_: DBXTeamPoliciesComputerBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ComputerBackupPolicyState.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesComputerBackupPolicyStateOther: DBXTeamPoliciesComputerBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ComputerBackupPolicyState.other + super.init(swift: swift) + } +} + +/// Objective-C compatible EmmState union +@objc +public class DBXTeamPoliciesEmmState: NSObject { + let swift: TeamPolicies.EmmState + + public init(swift: TeamPolicies.EmmState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.EmmState) -> DBXTeamPoliciesEmmState { + switch swift { + case .disabled: + return DBXTeamPoliciesEmmStateDisabled() + case .optional: + return DBXTeamPoliciesEmmStateOptional() + case .required: + return DBXTeamPoliciesEmmStateRequired() + case .other: + return DBXTeamPoliciesEmmStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesEmmStateDisabled? { + self as? DBXTeamPoliciesEmmStateDisabled + } + + @objc + public var asOptional: DBXTeamPoliciesEmmStateOptional? { + self as? DBXTeamPoliciesEmmStateOptional + } + + @objc + public var asRequired: DBXTeamPoliciesEmmStateRequired? { + self as? DBXTeamPoliciesEmmStateRequired + } + + @objc + public var asOther: DBXTeamPoliciesEmmStateOther? { + self as? DBXTeamPoliciesEmmStateOther + } +} + +/// Emm token is disabled. +@objc +public class DBXTeamPoliciesEmmStateDisabled: DBXTeamPoliciesEmmState { + @objc + public init() { + let swift = TeamPolicies.EmmState.disabled + super.init(swift: swift) + } +} + +/// Emm token is optional. +@objc +public class DBXTeamPoliciesEmmStateOptional: DBXTeamPoliciesEmmState { + @objc + public init() { + let swift = TeamPolicies.EmmState.optional + super.init(swift: swift) + } +} + +/// Emm token is required. +@objc +public class DBXTeamPoliciesEmmStateRequired: DBXTeamPoliciesEmmState { + @objc + public init() { + let swift = TeamPolicies.EmmState.required + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesEmmStateOther: DBXTeamPoliciesEmmState { + @objc + public init() { + let swift = TeamPolicies.EmmState.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ExternalDriveBackupPolicyState union +@objc +public class DBXTeamPoliciesExternalDriveBackupPolicyState: NSObject { + let swift: TeamPolicies.ExternalDriveBackupPolicyState + + public init(swift: TeamPolicies.ExternalDriveBackupPolicyState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.ExternalDriveBackupPolicyState) -> DBXTeamPoliciesExternalDriveBackupPolicyState { + switch swift { + case .disabled: + return DBXTeamPoliciesExternalDriveBackupPolicyStateDisabled() + case .enabled: + return DBXTeamPoliciesExternalDriveBackupPolicyStateEnabled() + case .default_: + return DBXTeamPoliciesExternalDriveBackupPolicyStateDefault_() + case .other: + return DBXTeamPoliciesExternalDriveBackupPolicyStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesExternalDriveBackupPolicyStateDisabled? { + self as? DBXTeamPoliciesExternalDriveBackupPolicyStateDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesExternalDriveBackupPolicyStateEnabled? { + self as? DBXTeamPoliciesExternalDriveBackupPolicyStateEnabled + } + + @objc + public var asDefault_: DBXTeamPoliciesExternalDriveBackupPolicyStateDefault_? { + self as? DBXTeamPoliciesExternalDriveBackupPolicyStateDefault_ + } + + @objc + public var asOther: DBXTeamPoliciesExternalDriveBackupPolicyStateOther? { + self as? DBXTeamPoliciesExternalDriveBackupPolicyStateOther + } +} + +/// External Drive Backup feature is disabled. +@objc +public class DBXTeamPoliciesExternalDriveBackupPolicyStateDisabled: DBXTeamPoliciesExternalDriveBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ExternalDriveBackupPolicyState.disabled + super.init(swift: swift) + } +} + +/// External Drive Backup feature is enabled. +@objc +public class DBXTeamPoliciesExternalDriveBackupPolicyStateEnabled: DBXTeamPoliciesExternalDriveBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ExternalDriveBackupPolicyState.enabled + super.init(swift: swift) + } +} + +/// External Drive Backup default value based on team tier. +@objc +public class DBXTeamPoliciesExternalDriveBackupPolicyStateDefault_: DBXTeamPoliciesExternalDriveBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ExternalDriveBackupPolicyState.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesExternalDriveBackupPolicyStateOther: DBXTeamPoliciesExternalDriveBackupPolicyState { + @objc + public init() { + let swift = TeamPolicies.ExternalDriveBackupPolicyState.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FileLockingPolicyState union +@objc +public class DBXTeamPoliciesFileLockingPolicyState: NSObject { + let swift: TeamPolicies.FileLockingPolicyState + + public init(swift: TeamPolicies.FileLockingPolicyState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.FileLockingPolicyState) -> DBXTeamPoliciesFileLockingPolicyState { + switch swift { + case .disabled: + return DBXTeamPoliciesFileLockingPolicyStateDisabled() + case .enabled: + return DBXTeamPoliciesFileLockingPolicyStateEnabled() + case .other: + return DBXTeamPoliciesFileLockingPolicyStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesFileLockingPolicyStateDisabled? { + self as? DBXTeamPoliciesFileLockingPolicyStateDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesFileLockingPolicyStateEnabled? { + self as? DBXTeamPoliciesFileLockingPolicyStateEnabled + } + + @objc + public var asOther: DBXTeamPoliciesFileLockingPolicyStateOther? { + self as? DBXTeamPoliciesFileLockingPolicyStateOther + } +} + +/// File locking feature is disabled. +@objc +public class DBXTeamPoliciesFileLockingPolicyStateDisabled: DBXTeamPoliciesFileLockingPolicyState { + @objc + public init() { + let swift = TeamPolicies.FileLockingPolicyState.disabled + super.init(swift: swift) + } +} + +/// File locking feature is allowed. +@objc +public class DBXTeamPoliciesFileLockingPolicyStateEnabled: DBXTeamPoliciesFileLockingPolicyState { + @objc + public init() { + let swift = TeamPolicies.FileLockingPolicyState.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesFileLockingPolicyStateOther: DBXTeamPoliciesFileLockingPolicyState { + @objc + public init() { + let swift = TeamPolicies.FileLockingPolicyState.other + super.init(swift: swift) + } +} + +/// Objective-C compatible FileProviderMigrationPolicyState union +@objc +public class DBXTeamPoliciesFileProviderMigrationPolicyState: NSObject { + let swift: TeamPolicies.FileProviderMigrationPolicyState + + public init(swift: TeamPolicies.FileProviderMigrationPolicyState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.FileProviderMigrationPolicyState) -> DBXTeamPoliciesFileProviderMigrationPolicyState { + switch swift { + case .disabled: + return DBXTeamPoliciesFileProviderMigrationPolicyStateDisabled() + case .enabled: + return DBXTeamPoliciesFileProviderMigrationPolicyStateEnabled() + case .default_: + return DBXTeamPoliciesFileProviderMigrationPolicyStateDefault_() + case .other: + return DBXTeamPoliciesFileProviderMigrationPolicyStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesFileProviderMigrationPolicyStateDisabled? { + self as? DBXTeamPoliciesFileProviderMigrationPolicyStateDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesFileProviderMigrationPolicyStateEnabled? { + self as? DBXTeamPoliciesFileProviderMigrationPolicyStateEnabled + } + + @objc + public var asDefault_: DBXTeamPoliciesFileProviderMigrationPolicyStateDefault_? { + self as? DBXTeamPoliciesFileProviderMigrationPolicyStateDefault_ + } + + @objc + public var asOther: DBXTeamPoliciesFileProviderMigrationPolicyStateOther? { + self as? DBXTeamPoliciesFileProviderMigrationPolicyStateOther + } +} + +/// Team admin has opted out of File Provider Migration for team members. +@objc +public class DBXTeamPoliciesFileProviderMigrationPolicyStateDisabled: DBXTeamPoliciesFileProviderMigrationPolicyState { + @objc + public init() { + let swift = TeamPolicies.FileProviderMigrationPolicyState.disabled + super.init(swift: swift) + } +} + +/// Team admin has not opted out of File Provider Migration for team members. +@objc +public class DBXTeamPoliciesFileProviderMigrationPolicyStateEnabled: DBXTeamPoliciesFileProviderMigrationPolicyState { + @objc + public init() { + let swift = TeamPolicies.FileProviderMigrationPolicyState.enabled + super.init(swift: swift) + } +} + +/// Team admin has default value based on team tier. +@objc +public class DBXTeamPoliciesFileProviderMigrationPolicyStateDefault_: DBXTeamPoliciesFileProviderMigrationPolicyState { + @objc + public init() { + let swift = TeamPolicies.FileProviderMigrationPolicyState.default_ + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesFileProviderMigrationPolicyStateOther: DBXTeamPoliciesFileProviderMigrationPolicyState { + @objc + public init() { + let swift = TeamPolicies.FileProviderMigrationPolicyState.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GroupCreation union +@objc +public class DBXTeamPoliciesGroupCreation: NSObject { + let swift: TeamPolicies.GroupCreation + + public init(swift: TeamPolicies.GroupCreation) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.GroupCreation) -> DBXTeamPoliciesGroupCreation { + switch swift { + case .adminsAndMembers: + return DBXTeamPoliciesGroupCreationAdminsAndMembers() + case .adminsOnly: + return DBXTeamPoliciesGroupCreationAdminsOnly() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAdminsAndMembers: DBXTeamPoliciesGroupCreationAdminsAndMembers? { + self as? DBXTeamPoliciesGroupCreationAdminsAndMembers + } + + @objc + public var asAdminsOnly: DBXTeamPoliciesGroupCreationAdminsOnly? { + self as? DBXTeamPoliciesGroupCreationAdminsOnly + } +} + +/// Team admins and members can create groups. +@objc +public class DBXTeamPoliciesGroupCreationAdminsAndMembers: DBXTeamPoliciesGroupCreation { + @objc + public init() { + let swift = TeamPolicies.GroupCreation.adminsAndMembers + super.init(swift: swift) + } +} + +/// Only team admins can create groups. +@objc +public class DBXTeamPoliciesGroupCreationAdminsOnly: DBXTeamPoliciesGroupCreation { + @objc + public init() { + let swift = TeamPolicies.GroupCreation.adminsOnly + super.init(swift: swift) + } +} + +/// Objective-C compatible OfficeAddInPolicy union +@objc +public class DBXTeamPoliciesOfficeAddInPolicy: NSObject { + let swift: TeamPolicies.OfficeAddInPolicy + + public init(swift: TeamPolicies.OfficeAddInPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.OfficeAddInPolicy) -> DBXTeamPoliciesOfficeAddInPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesOfficeAddInPolicyDisabled() + case .enabled: + return DBXTeamPoliciesOfficeAddInPolicyEnabled() + case .other: + return DBXTeamPoliciesOfficeAddInPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesOfficeAddInPolicyDisabled? { + self as? DBXTeamPoliciesOfficeAddInPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesOfficeAddInPolicyEnabled? { + self as? DBXTeamPoliciesOfficeAddInPolicyEnabled + } + + @objc + public var asOther: DBXTeamPoliciesOfficeAddInPolicyOther? { + self as? DBXTeamPoliciesOfficeAddInPolicyOther + } +} + +/// Office Add-In is disabled. +@objc +public class DBXTeamPoliciesOfficeAddInPolicyDisabled: DBXTeamPoliciesOfficeAddInPolicy { + @objc + public init() { + let swift = TeamPolicies.OfficeAddInPolicy.disabled + super.init(swift: swift) + } +} + +/// Office Add-In is enabled. +@objc +public class DBXTeamPoliciesOfficeAddInPolicyEnabled: DBXTeamPoliciesOfficeAddInPolicy { + @objc + public init() { + let swift = TeamPolicies.OfficeAddInPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesOfficeAddInPolicyOther: DBXTeamPoliciesOfficeAddInPolicy { + @objc + public init() { + let swift = TeamPolicies.OfficeAddInPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperDefaultFolderPolicy union +@objc +public class DBXTeamPoliciesPaperDefaultFolderPolicy: NSObject { + let swift: TeamPolicies.PaperDefaultFolderPolicy + + public init(swift: TeamPolicies.PaperDefaultFolderPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.PaperDefaultFolderPolicy) -> DBXTeamPoliciesPaperDefaultFolderPolicy { + switch swift { + case .everyoneInTeam: + return DBXTeamPoliciesPaperDefaultFolderPolicyEveryoneInTeam() + case .inviteOnly: + return DBXTeamPoliciesPaperDefaultFolderPolicyInviteOnly() + case .other: + return DBXTeamPoliciesPaperDefaultFolderPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEveryoneInTeam: DBXTeamPoliciesPaperDefaultFolderPolicyEveryoneInTeam? { + self as? DBXTeamPoliciesPaperDefaultFolderPolicyEveryoneInTeam + } + + @objc + public var asInviteOnly: DBXTeamPoliciesPaperDefaultFolderPolicyInviteOnly? { + self as? DBXTeamPoliciesPaperDefaultFolderPolicyInviteOnly + } + + @objc + public var asOther: DBXTeamPoliciesPaperDefaultFolderPolicyOther? { + self as? DBXTeamPoliciesPaperDefaultFolderPolicyOther + } +} + +/// Everyone in team will be the default option when creating a folder in Paper. +@objc +public class DBXTeamPoliciesPaperDefaultFolderPolicyEveryoneInTeam: DBXTeamPoliciesPaperDefaultFolderPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDefaultFolderPolicy.everyoneInTeam + super.init(swift: swift) + } +} + +/// Invite only will be the default option when creating a folder in Paper. +@objc +public class DBXTeamPoliciesPaperDefaultFolderPolicyInviteOnly: DBXTeamPoliciesPaperDefaultFolderPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDefaultFolderPolicy.inviteOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesPaperDefaultFolderPolicyOther: DBXTeamPoliciesPaperDefaultFolderPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDefaultFolderPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperDeploymentPolicy union +@objc +public class DBXTeamPoliciesPaperDeploymentPolicy: NSObject { + let swift: TeamPolicies.PaperDeploymentPolicy + + public init(swift: TeamPolicies.PaperDeploymentPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.PaperDeploymentPolicy) -> DBXTeamPoliciesPaperDeploymentPolicy { + switch swift { + case .full: + return DBXTeamPoliciesPaperDeploymentPolicyFull() + case .partial: + return DBXTeamPoliciesPaperDeploymentPolicyPartial() + case .other: + return DBXTeamPoliciesPaperDeploymentPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFull: DBXTeamPoliciesPaperDeploymentPolicyFull? { + self as? DBXTeamPoliciesPaperDeploymentPolicyFull + } + + @objc + public var asPartial: DBXTeamPoliciesPaperDeploymentPolicyPartial? { + self as? DBXTeamPoliciesPaperDeploymentPolicyPartial + } + + @objc + public var asOther: DBXTeamPoliciesPaperDeploymentPolicyOther? { + self as? DBXTeamPoliciesPaperDeploymentPolicyOther + } +} + +/// All team members have access to Paper. +@objc +public class DBXTeamPoliciesPaperDeploymentPolicyFull: DBXTeamPoliciesPaperDeploymentPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDeploymentPolicy.full + super.init(swift: swift) + } +} + +/// Only whitelisted team members can access Paper. To see which user is whitelisted, check +/// 'is_paper_whitelisted' on 'account/info'. +@objc +public class DBXTeamPoliciesPaperDeploymentPolicyPartial: DBXTeamPoliciesPaperDeploymentPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDeploymentPolicy.partial + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesPaperDeploymentPolicyOther: DBXTeamPoliciesPaperDeploymentPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDeploymentPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperDesktopPolicy union +@objc +public class DBXTeamPoliciesPaperDesktopPolicy: NSObject { + let swift: TeamPolicies.PaperDesktopPolicy + + public init(swift: TeamPolicies.PaperDesktopPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.PaperDesktopPolicy) -> DBXTeamPoliciesPaperDesktopPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesPaperDesktopPolicyDisabled() + case .enabled: + return DBXTeamPoliciesPaperDesktopPolicyEnabled() + case .other: + return DBXTeamPoliciesPaperDesktopPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesPaperDesktopPolicyDisabled? { + self as? DBXTeamPoliciesPaperDesktopPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesPaperDesktopPolicyEnabled? { + self as? DBXTeamPoliciesPaperDesktopPolicyEnabled + } + + @objc + public var asOther: DBXTeamPoliciesPaperDesktopPolicyOther? { + self as? DBXTeamPoliciesPaperDesktopPolicyOther + } +} + +/// Do not allow team members to use Paper Desktop. +@objc +public class DBXTeamPoliciesPaperDesktopPolicyDisabled: DBXTeamPoliciesPaperDesktopPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDesktopPolicy.disabled + super.init(swift: swift) + } +} + +/// Allow team members to use Paper Desktop. +@objc +public class DBXTeamPoliciesPaperDesktopPolicyEnabled: DBXTeamPoliciesPaperDesktopPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDesktopPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesPaperDesktopPolicyOther: DBXTeamPoliciesPaperDesktopPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperDesktopPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PaperEnabledPolicy union +@objc +public class DBXTeamPoliciesPaperEnabledPolicy: NSObject { + let swift: TeamPolicies.PaperEnabledPolicy + + public init(swift: TeamPolicies.PaperEnabledPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.PaperEnabledPolicy) -> DBXTeamPoliciesPaperEnabledPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesPaperEnabledPolicyDisabled() + case .enabled: + return DBXTeamPoliciesPaperEnabledPolicyEnabled() + case .unspecified: + return DBXTeamPoliciesPaperEnabledPolicyUnspecified() + case .other: + return DBXTeamPoliciesPaperEnabledPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesPaperEnabledPolicyDisabled? { + self as? DBXTeamPoliciesPaperEnabledPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesPaperEnabledPolicyEnabled? { + self as? DBXTeamPoliciesPaperEnabledPolicyEnabled + } + + @objc + public var asUnspecified: DBXTeamPoliciesPaperEnabledPolicyUnspecified? { + self as? DBXTeamPoliciesPaperEnabledPolicyUnspecified + } + + @objc + public var asOther: DBXTeamPoliciesPaperEnabledPolicyOther? { + self as? DBXTeamPoliciesPaperEnabledPolicyOther + } +} + +/// Paper is disabled. +@objc +public class DBXTeamPoliciesPaperEnabledPolicyDisabled: DBXTeamPoliciesPaperEnabledPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperEnabledPolicy.disabled + super.init(swift: swift) + } +} + +/// Paper is enabled. +@objc +public class DBXTeamPoliciesPaperEnabledPolicyEnabled: DBXTeamPoliciesPaperEnabledPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperEnabledPolicy.enabled + super.init(swift: swift) + } +} + +/// Unspecified policy. +@objc +public class DBXTeamPoliciesPaperEnabledPolicyUnspecified: DBXTeamPoliciesPaperEnabledPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperEnabledPolicy.unspecified + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesPaperEnabledPolicyOther: DBXTeamPoliciesPaperEnabledPolicy { + @objc + public init() { + let swift = TeamPolicies.PaperEnabledPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PasswordControlMode union +@objc +public class DBXTeamPoliciesPasswordControlMode: NSObject { + let swift: TeamPolicies.PasswordControlMode + + public init(swift: TeamPolicies.PasswordControlMode) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.PasswordControlMode) -> DBXTeamPoliciesPasswordControlMode { + switch swift { + case .disabled: + return DBXTeamPoliciesPasswordControlModeDisabled() + case .enabled: + return DBXTeamPoliciesPasswordControlModeEnabled() + case .other: + return DBXTeamPoliciesPasswordControlModeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesPasswordControlModeDisabled? { + self as? DBXTeamPoliciesPasswordControlModeDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesPasswordControlModeEnabled? { + self as? DBXTeamPoliciesPasswordControlModeEnabled + } + + @objc + public var asOther: DBXTeamPoliciesPasswordControlModeOther? { + self as? DBXTeamPoliciesPasswordControlModeOther + } +} + +/// Password is disabled. +@objc +public class DBXTeamPoliciesPasswordControlModeDisabled: DBXTeamPoliciesPasswordControlMode { + @objc + public init() { + let swift = TeamPolicies.PasswordControlMode.disabled + super.init(swift: swift) + } +} + +/// Password is enabled. +@objc +public class DBXTeamPoliciesPasswordControlModeEnabled: DBXTeamPoliciesPasswordControlMode { + @objc + public init() { + let swift = TeamPolicies.PasswordControlMode.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesPasswordControlModeOther: DBXTeamPoliciesPasswordControlMode { + @objc + public init() { + let swift = TeamPolicies.PasswordControlMode.other + super.init(swift: swift) + } +} + +/// Objective-C compatible PasswordStrengthPolicy union +@objc +public class DBXTeamPoliciesPasswordStrengthPolicy: NSObject { + let swift: TeamPolicies.PasswordStrengthPolicy + + public init(swift: TeamPolicies.PasswordStrengthPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.PasswordStrengthPolicy) -> DBXTeamPoliciesPasswordStrengthPolicy { + switch swift { + case .minimalRequirements: + return DBXTeamPoliciesPasswordStrengthPolicyMinimalRequirements() + case .moderatePassword: + return DBXTeamPoliciesPasswordStrengthPolicyModeratePassword() + case .strongPassword: + return DBXTeamPoliciesPasswordStrengthPolicyStrongPassword() + case .other: + return DBXTeamPoliciesPasswordStrengthPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMinimalRequirements: DBXTeamPoliciesPasswordStrengthPolicyMinimalRequirements? { + self as? DBXTeamPoliciesPasswordStrengthPolicyMinimalRequirements + } + + @objc + public var asModeratePassword: DBXTeamPoliciesPasswordStrengthPolicyModeratePassword? { + self as? DBXTeamPoliciesPasswordStrengthPolicyModeratePassword + } + + @objc + public var asStrongPassword: DBXTeamPoliciesPasswordStrengthPolicyStrongPassword? { + self as? DBXTeamPoliciesPasswordStrengthPolicyStrongPassword + } + + @objc + public var asOther: DBXTeamPoliciesPasswordStrengthPolicyOther? { + self as? DBXTeamPoliciesPasswordStrengthPolicyOther + } +} + +/// User passwords will adhere to the minimal password strength policy. +@objc +public class DBXTeamPoliciesPasswordStrengthPolicyMinimalRequirements: DBXTeamPoliciesPasswordStrengthPolicy { + @objc + public init() { + let swift = TeamPolicies.PasswordStrengthPolicy.minimalRequirements + super.init(swift: swift) + } +} + +/// User passwords will adhere to the moderate password strength policy. +@objc +public class DBXTeamPoliciesPasswordStrengthPolicyModeratePassword: DBXTeamPoliciesPasswordStrengthPolicy { + @objc + public init() { + let swift = TeamPolicies.PasswordStrengthPolicy.moderatePassword + super.init(swift: swift) + } +} + +/// User passwords will adhere to the very strong password strength policy. +@objc +public class DBXTeamPoliciesPasswordStrengthPolicyStrongPassword: DBXTeamPoliciesPasswordStrengthPolicy { + @objc + public init() { + let swift = TeamPolicies.PasswordStrengthPolicy.strongPassword + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesPasswordStrengthPolicyOther: DBXTeamPoliciesPasswordStrengthPolicy { + @objc + public init() { + let swift = TeamPolicies.PasswordStrengthPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible RolloutMethod union +@objc +public class DBXTeamPoliciesRolloutMethod: NSObject { + let swift: TeamPolicies.RolloutMethod + + public init(swift: TeamPolicies.RolloutMethod) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.RolloutMethod) -> DBXTeamPoliciesRolloutMethod { + switch swift { + case .unlinkAll: + return DBXTeamPoliciesRolloutMethodUnlinkAll() + case .unlinkMostInactive: + return DBXTeamPoliciesRolloutMethodUnlinkMostInactive() + case .addMemberToExceptions: + return DBXTeamPoliciesRolloutMethodAddMemberToExceptions() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asUnlinkAll: DBXTeamPoliciesRolloutMethodUnlinkAll? { + self as? DBXTeamPoliciesRolloutMethodUnlinkAll + } + + @objc + public var asUnlinkMostInactive: DBXTeamPoliciesRolloutMethodUnlinkMostInactive? { + self as? DBXTeamPoliciesRolloutMethodUnlinkMostInactive + } + + @objc + public var asAddMemberToExceptions: DBXTeamPoliciesRolloutMethodAddMemberToExceptions? { + self as? DBXTeamPoliciesRolloutMethodAddMemberToExceptions + } +} + +/// Unlink all. +@objc +public class DBXTeamPoliciesRolloutMethodUnlinkAll: DBXTeamPoliciesRolloutMethod { + @objc + public init() { + let swift = TeamPolicies.RolloutMethod.unlinkAll + super.init(swift: swift) + } +} + +/// Unlink devices with the most inactivity. +@objc +public class DBXTeamPoliciesRolloutMethodUnlinkMostInactive: DBXTeamPoliciesRolloutMethod { + @objc + public init() { + let swift = TeamPolicies.RolloutMethod.unlinkMostInactive + super.init(swift: swift) + } +} + +/// Add member to Exceptions. +@objc +public class DBXTeamPoliciesRolloutMethodAddMemberToExceptions: DBXTeamPoliciesRolloutMethod { + @objc + public init() { + let swift = TeamPolicies.RolloutMethod.addMemberToExceptions + super.init(swift: swift) + } +} + +/// Policy governing whether shared folder membership is required to access shared links. +@objc +public class DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy: NSObject { + let swift: TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy + + public init(swift: TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy) -> DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy { + switch swift { + case .members: + return DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyMembers() + case .anyone: + return DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyAnyone() + case .other: + return DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asMembers: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyMembers? { + self as? DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyMembers + } + + @objc + public var asAnyone: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyAnyone? { + self as? DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyAnyone + } + + @objc + public var asOther: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyOther? { + self as? DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyOther + } +} + +/// Only members of shared folders can access folder content via shared link. +@objc +public class DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyMembers: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy.members + super.init(swift: swift) + } +} + +/// Anyone can access folder content via shared link. +@objc +public class DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyAnyone: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy.anyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicyOther: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderBlanketLinkRestrictionPolicy.other + super.init(swift: swift) + } +} + +/// Policy governing which shared folders a team member can join. +@objc +public class DBXTeamPoliciesSharedFolderJoinPolicy: NSObject { + let swift: TeamPolicies.SharedFolderJoinPolicy + + public init(swift: TeamPolicies.SharedFolderJoinPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SharedFolderJoinPolicy) -> DBXTeamPoliciesSharedFolderJoinPolicy { + switch swift { + case .fromTeamOnly: + return DBXTeamPoliciesSharedFolderJoinPolicyFromTeamOnly() + case .fromAnyone: + return DBXTeamPoliciesSharedFolderJoinPolicyFromAnyone() + case .other: + return DBXTeamPoliciesSharedFolderJoinPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asFromTeamOnly: DBXTeamPoliciesSharedFolderJoinPolicyFromTeamOnly? { + self as? DBXTeamPoliciesSharedFolderJoinPolicyFromTeamOnly + } + + @objc + public var asFromAnyone: DBXTeamPoliciesSharedFolderJoinPolicyFromAnyone? { + self as? DBXTeamPoliciesSharedFolderJoinPolicyFromAnyone + } + + @objc + public var asOther: DBXTeamPoliciesSharedFolderJoinPolicyOther? { + self as? DBXTeamPoliciesSharedFolderJoinPolicyOther + } +} + +/// Team members can only join folders shared by teammates. +@objc +public class DBXTeamPoliciesSharedFolderJoinPolicyFromTeamOnly: DBXTeamPoliciesSharedFolderJoinPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderJoinPolicy.fromTeamOnly + super.init(swift: swift) + } +} + +/// Team members can join any shared folder, including those shared by users outside the team. +@objc +public class DBXTeamPoliciesSharedFolderJoinPolicyFromAnyone: DBXTeamPoliciesSharedFolderJoinPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderJoinPolicy.fromAnyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSharedFolderJoinPolicyOther: DBXTeamPoliciesSharedFolderJoinPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderJoinPolicy.other + super.init(swift: swift) + } +} + +/// Policy governing who can be a member of a folder shared by a team member. +@objc +public class DBXTeamPoliciesSharedFolderMemberPolicy: NSObject { + let swift: TeamPolicies.SharedFolderMemberPolicy + + public init(swift: TeamPolicies.SharedFolderMemberPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SharedFolderMemberPolicy) -> DBXTeamPoliciesSharedFolderMemberPolicy { + switch swift { + case .team: + return DBXTeamPoliciesSharedFolderMemberPolicyTeam() + case .anyone: + return DBXTeamPoliciesSharedFolderMemberPolicyAnyone() + case .other: + return DBXTeamPoliciesSharedFolderMemberPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asTeam: DBXTeamPoliciesSharedFolderMemberPolicyTeam? { + self as? DBXTeamPoliciesSharedFolderMemberPolicyTeam + } + + @objc + public var asAnyone: DBXTeamPoliciesSharedFolderMemberPolicyAnyone? { + self as? DBXTeamPoliciesSharedFolderMemberPolicyAnyone + } + + @objc + public var asOther: DBXTeamPoliciesSharedFolderMemberPolicyOther? { + self as? DBXTeamPoliciesSharedFolderMemberPolicyOther + } +} + +/// Only a teammate can be a member of a folder shared by a team member. +@objc +public class DBXTeamPoliciesSharedFolderMemberPolicyTeam: DBXTeamPoliciesSharedFolderMemberPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderMemberPolicy.team + super.init(swift: swift) + } +} + +/// Anyone can be a member of a folder shared by a team member. +@objc +public class DBXTeamPoliciesSharedFolderMemberPolicyAnyone: DBXTeamPoliciesSharedFolderMemberPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderMemberPolicy.anyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSharedFolderMemberPolicyOther: DBXTeamPoliciesSharedFolderMemberPolicy { + @objc + public init() { + let swift = TeamPolicies.SharedFolderMemberPolicy.other + super.init(swift: swift) + } +} + +/// Policy governing the visibility of shared links. This policy can apply to newly created shared links, or all +/// shared links. +@objc +public class DBXTeamPoliciesSharedLinkCreatePolicy: NSObject { + let swift: TeamPolicies.SharedLinkCreatePolicy + + public init(swift: TeamPolicies.SharedLinkCreatePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SharedLinkCreatePolicy) -> DBXTeamPoliciesSharedLinkCreatePolicy { + switch swift { + case .defaultPublic: + return DBXTeamPoliciesSharedLinkCreatePolicyDefaultPublic() + case .defaultTeamOnly: + return DBXTeamPoliciesSharedLinkCreatePolicyDefaultTeamOnly() + case .teamOnly: + return DBXTeamPoliciesSharedLinkCreatePolicyTeamOnly() + case .defaultNoOne: + return DBXTeamPoliciesSharedLinkCreatePolicyDefaultNoOne() + case .other: + return DBXTeamPoliciesSharedLinkCreatePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDefaultPublic: DBXTeamPoliciesSharedLinkCreatePolicyDefaultPublic? { + self as? DBXTeamPoliciesSharedLinkCreatePolicyDefaultPublic + } + + @objc + public var asDefaultTeamOnly: DBXTeamPoliciesSharedLinkCreatePolicyDefaultTeamOnly? { + self as? DBXTeamPoliciesSharedLinkCreatePolicyDefaultTeamOnly + } + + @objc + public var asTeamOnly: DBXTeamPoliciesSharedLinkCreatePolicyTeamOnly? { + self as? DBXTeamPoliciesSharedLinkCreatePolicyTeamOnly + } + + @objc + public var asDefaultNoOne: DBXTeamPoliciesSharedLinkCreatePolicyDefaultNoOne? { + self as? DBXTeamPoliciesSharedLinkCreatePolicyDefaultNoOne + } + + @objc + public var asOther: DBXTeamPoliciesSharedLinkCreatePolicyOther? { + self as? DBXTeamPoliciesSharedLinkCreatePolicyOther + } +} + +/// By default, anyone can access newly created shared links. No login will be required to access the shared +/// links unless overridden. +@objc +public class DBXTeamPoliciesSharedLinkCreatePolicyDefaultPublic: DBXTeamPoliciesSharedLinkCreatePolicy { + @objc + public init() { + let swift = TeamPolicies.SharedLinkCreatePolicy.defaultPublic + super.init(swift: swift) + } +} + +/// By default, only members of the same team can access newly created shared links. Login will be required to +/// access the shared links unless overridden. +@objc +public class DBXTeamPoliciesSharedLinkCreatePolicyDefaultTeamOnly: DBXTeamPoliciesSharedLinkCreatePolicy { + @objc + public init() { + let swift = TeamPolicies.SharedLinkCreatePolicy.defaultTeamOnly + super.init(swift: swift) + } +} + +/// Only members of the same team can access all shared links. Login will be required to access all shared +/// links. +@objc +public class DBXTeamPoliciesSharedLinkCreatePolicyTeamOnly: DBXTeamPoliciesSharedLinkCreatePolicy { + @objc + public init() { + let swift = TeamPolicies.SharedLinkCreatePolicy.teamOnly + super.init(swift: swift) + } +} + +/// Only people invited can access newly created links. Login will be required to access the shared links unless +/// overridden. +@objc +public class DBXTeamPoliciesSharedLinkCreatePolicyDefaultNoOne: DBXTeamPoliciesSharedLinkCreatePolicy { + @objc + public init() { + let swift = TeamPolicies.SharedLinkCreatePolicy.defaultNoOne + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSharedLinkCreatePolicyOther: DBXTeamPoliciesSharedLinkCreatePolicy { + @objc + public init() { + let swift = TeamPolicies.SharedLinkCreatePolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ShowcaseDownloadPolicy union +@objc +public class DBXTeamPoliciesShowcaseDownloadPolicy: NSObject { + let swift: TeamPolicies.ShowcaseDownloadPolicy + + public init(swift: TeamPolicies.ShowcaseDownloadPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.ShowcaseDownloadPolicy) -> DBXTeamPoliciesShowcaseDownloadPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesShowcaseDownloadPolicyDisabled() + case .enabled: + return DBXTeamPoliciesShowcaseDownloadPolicyEnabled() + case .other: + return DBXTeamPoliciesShowcaseDownloadPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesShowcaseDownloadPolicyDisabled? { + self as? DBXTeamPoliciesShowcaseDownloadPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesShowcaseDownloadPolicyEnabled? { + self as? DBXTeamPoliciesShowcaseDownloadPolicyEnabled + } + + @objc + public var asOther: DBXTeamPoliciesShowcaseDownloadPolicyOther? { + self as? DBXTeamPoliciesShowcaseDownloadPolicyOther + } +} + +/// Do not allow files to be downloaded from Showcases. +@objc +public class DBXTeamPoliciesShowcaseDownloadPolicyDisabled: DBXTeamPoliciesShowcaseDownloadPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseDownloadPolicy.disabled + super.init(swift: swift) + } +} + +/// Allow files to be downloaded from Showcases. +@objc +public class DBXTeamPoliciesShowcaseDownloadPolicyEnabled: DBXTeamPoliciesShowcaseDownloadPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseDownloadPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesShowcaseDownloadPolicyOther: DBXTeamPoliciesShowcaseDownloadPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseDownloadPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ShowcaseEnabledPolicy union +@objc +public class DBXTeamPoliciesShowcaseEnabledPolicy: NSObject { + let swift: TeamPolicies.ShowcaseEnabledPolicy + + public init(swift: TeamPolicies.ShowcaseEnabledPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.ShowcaseEnabledPolicy) -> DBXTeamPoliciesShowcaseEnabledPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesShowcaseEnabledPolicyDisabled() + case .enabled: + return DBXTeamPoliciesShowcaseEnabledPolicyEnabled() + case .other: + return DBXTeamPoliciesShowcaseEnabledPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesShowcaseEnabledPolicyDisabled? { + self as? DBXTeamPoliciesShowcaseEnabledPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesShowcaseEnabledPolicyEnabled? { + self as? DBXTeamPoliciesShowcaseEnabledPolicyEnabled + } + + @objc + public var asOther: DBXTeamPoliciesShowcaseEnabledPolicyOther? { + self as? DBXTeamPoliciesShowcaseEnabledPolicyOther + } +} + +/// Showcase is disabled. +@objc +public class DBXTeamPoliciesShowcaseEnabledPolicyDisabled: DBXTeamPoliciesShowcaseEnabledPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseEnabledPolicy.disabled + super.init(swift: swift) + } +} + +/// Showcase is enabled. +@objc +public class DBXTeamPoliciesShowcaseEnabledPolicyEnabled: DBXTeamPoliciesShowcaseEnabledPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseEnabledPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesShowcaseEnabledPolicyOther: DBXTeamPoliciesShowcaseEnabledPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseEnabledPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible ShowcaseExternalSharingPolicy union +@objc +public class DBXTeamPoliciesShowcaseExternalSharingPolicy: NSObject { + let swift: TeamPolicies.ShowcaseExternalSharingPolicy + + public init(swift: TeamPolicies.ShowcaseExternalSharingPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.ShowcaseExternalSharingPolicy) -> DBXTeamPoliciesShowcaseExternalSharingPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesShowcaseExternalSharingPolicyDisabled() + case .enabled: + return DBXTeamPoliciesShowcaseExternalSharingPolicyEnabled() + case .other: + return DBXTeamPoliciesShowcaseExternalSharingPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesShowcaseExternalSharingPolicyDisabled? { + self as? DBXTeamPoliciesShowcaseExternalSharingPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesShowcaseExternalSharingPolicyEnabled? { + self as? DBXTeamPoliciesShowcaseExternalSharingPolicyEnabled + } + + @objc + public var asOther: DBXTeamPoliciesShowcaseExternalSharingPolicyOther? { + self as? DBXTeamPoliciesShowcaseExternalSharingPolicyOther + } +} + +/// Do not allow showcases to be shared with people not on the team. +@objc +public class DBXTeamPoliciesShowcaseExternalSharingPolicyDisabled: DBXTeamPoliciesShowcaseExternalSharingPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseExternalSharingPolicy.disabled + super.init(swift: swift) + } +} + +/// Allow showcases to be shared with people not on the team. +@objc +public class DBXTeamPoliciesShowcaseExternalSharingPolicyEnabled: DBXTeamPoliciesShowcaseExternalSharingPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseExternalSharingPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesShowcaseExternalSharingPolicyOther: DBXTeamPoliciesShowcaseExternalSharingPolicy { + @objc + public init() { + let swift = TeamPolicies.ShowcaseExternalSharingPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SmartSyncPolicy union +@objc +public class DBXTeamPoliciesSmartSyncPolicy: NSObject { + let swift: TeamPolicies.SmartSyncPolicy + + public init(swift: TeamPolicies.SmartSyncPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SmartSyncPolicy) -> DBXTeamPoliciesSmartSyncPolicy { + switch swift { + case .local: + return DBXTeamPoliciesSmartSyncPolicyLocal() + case .onDemand: + return DBXTeamPoliciesSmartSyncPolicyOnDemand() + case .other: + return DBXTeamPoliciesSmartSyncPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asLocal: DBXTeamPoliciesSmartSyncPolicyLocal? { + self as? DBXTeamPoliciesSmartSyncPolicyLocal + } + + @objc + public var asOnDemand: DBXTeamPoliciesSmartSyncPolicyOnDemand? { + self as? DBXTeamPoliciesSmartSyncPolicyOnDemand + } + + @objc + public var asOther: DBXTeamPoliciesSmartSyncPolicyOther? { + self as? DBXTeamPoliciesSmartSyncPolicyOther + } +} + +/// The specified content will be synced as local files by default. +@objc +public class DBXTeamPoliciesSmartSyncPolicyLocal: DBXTeamPoliciesSmartSyncPolicy { + @objc + public init() { + let swift = TeamPolicies.SmartSyncPolicy.local + super.init(swift: swift) + } +} + +/// The specified content will be synced as on-demand files by default. +@objc +public class DBXTeamPoliciesSmartSyncPolicyOnDemand: DBXTeamPoliciesSmartSyncPolicy { + @objc + public init() { + let swift = TeamPolicies.SmartSyncPolicy.onDemand + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSmartSyncPolicyOther: DBXTeamPoliciesSmartSyncPolicy { + @objc + public init() { + let swift = TeamPolicies.SmartSyncPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SmarterSmartSyncPolicyState union +@objc +public class DBXTeamPoliciesSmarterSmartSyncPolicyState: NSObject { + let swift: TeamPolicies.SmarterSmartSyncPolicyState + + public init(swift: TeamPolicies.SmarterSmartSyncPolicyState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SmarterSmartSyncPolicyState) -> DBXTeamPoliciesSmarterSmartSyncPolicyState { + switch swift { + case .disabled: + return DBXTeamPoliciesSmarterSmartSyncPolicyStateDisabled() + case .enabled: + return DBXTeamPoliciesSmarterSmartSyncPolicyStateEnabled() + case .other: + return DBXTeamPoliciesSmarterSmartSyncPolicyStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesSmarterSmartSyncPolicyStateDisabled? { + self as? DBXTeamPoliciesSmarterSmartSyncPolicyStateDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesSmarterSmartSyncPolicyStateEnabled? { + self as? DBXTeamPoliciesSmarterSmartSyncPolicyStateEnabled + } + + @objc + public var asOther: DBXTeamPoliciesSmarterSmartSyncPolicyStateOther? { + self as? DBXTeamPoliciesSmarterSmartSyncPolicyStateOther + } +} + +/// Smarter Smart Sync feature is disabled. +@objc +public class DBXTeamPoliciesSmarterSmartSyncPolicyStateDisabled: DBXTeamPoliciesSmarterSmartSyncPolicyState { + @objc + public init() { + let swift = TeamPolicies.SmarterSmartSyncPolicyState.disabled + super.init(swift: swift) + } +} + +/// Smarter Smart Sync feature is enabled. +@objc +public class DBXTeamPoliciesSmarterSmartSyncPolicyStateEnabled: DBXTeamPoliciesSmarterSmartSyncPolicyState { + @objc + public init() { + let swift = TeamPolicies.SmarterSmartSyncPolicyState.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSmarterSmartSyncPolicyStateOther: DBXTeamPoliciesSmarterSmartSyncPolicyState { + @objc + public init() { + let swift = TeamPolicies.SmarterSmartSyncPolicyState.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SsoPolicy union +@objc +public class DBXTeamPoliciesSsoPolicy: NSObject { + let swift: TeamPolicies.SsoPolicy + + public init(swift: TeamPolicies.SsoPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SsoPolicy) -> DBXTeamPoliciesSsoPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesSsoPolicyDisabled() + case .optional: + return DBXTeamPoliciesSsoPolicyOptional() + case .required: + return DBXTeamPoliciesSsoPolicyRequired() + case .other: + return DBXTeamPoliciesSsoPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesSsoPolicyDisabled? { + self as? DBXTeamPoliciesSsoPolicyDisabled + } + + @objc + public var asOptional: DBXTeamPoliciesSsoPolicyOptional? { + self as? DBXTeamPoliciesSsoPolicyOptional + } + + @objc + public var asRequired: DBXTeamPoliciesSsoPolicyRequired? { + self as? DBXTeamPoliciesSsoPolicyRequired + } + + @objc + public var asOther: DBXTeamPoliciesSsoPolicyOther? { + self as? DBXTeamPoliciesSsoPolicyOther + } +} + +/// Users will be able to sign in with their Dropbox credentials. +@objc +public class DBXTeamPoliciesSsoPolicyDisabled: DBXTeamPoliciesSsoPolicy { + @objc + public init() { + let swift = TeamPolicies.SsoPolicy.disabled + super.init(swift: swift) + } +} + +/// Users will be able to sign in with either their Dropbox or single sign-on credentials. +@objc +public class DBXTeamPoliciesSsoPolicyOptional: DBXTeamPoliciesSsoPolicy { + @objc + public init() { + let swift = TeamPolicies.SsoPolicy.optional + super.init(swift: swift) + } +} + +/// Users will be required to sign in with their single sign-on credentials. +@objc +public class DBXTeamPoliciesSsoPolicyRequired: DBXTeamPoliciesSsoPolicy { + @objc + public init() { + let swift = TeamPolicies.SsoPolicy.required + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSsoPolicyOther: DBXTeamPoliciesSsoPolicy { + @objc + public init() { + let swift = TeamPolicies.SsoPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible SuggestMembersPolicy union +@objc +public class DBXTeamPoliciesSuggestMembersPolicy: NSObject { + let swift: TeamPolicies.SuggestMembersPolicy + + public init(swift: TeamPolicies.SuggestMembersPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.SuggestMembersPolicy) -> DBXTeamPoliciesSuggestMembersPolicy { + switch swift { + case .disabled: + return DBXTeamPoliciesSuggestMembersPolicyDisabled() + case .enabled: + return DBXTeamPoliciesSuggestMembersPolicyEnabled() + case .other: + return DBXTeamPoliciesSuggestMembersPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDisabled: DBXTeamPoliciesSuggestMembersPolicyDisabled? { + self as? DBXTeamPoliciesSuggestMembersPolicyDisabled + } + + @objc + public var asEnabled: DBXTeamPoliciesSuggestMembersPolicyEnabled? { + self as? DBXTeamPoliciesSuggestMembersPolicyEnabled + } + + @objc + public var asOther: DBXTeamPoliciesSuggestMembersPolicyOther? { + self as? DBXTeamPoliciesSuggestMembersPolicyOther + } +} + +/// Suggest members is disabled. +@objc +public class DBXTeamPoliciesSuggestMembersPolicyDisabled: DBXTeamPoliciesSuggestMembersPolicy { + @objc + public init() { + let swift = TeamPolicies.SuggestMembersPolicy.disabled + super.init(swift: swift) + } +} + +/// Suggest members is enabled. +@objc +public class DBXTeamPoliciesSuggestMembersPolicyEnabled: DBXTeamPoliciesSuggestMembersPolicy { + @objc + public init() { + let swift = TeamPolicies.SuggestMembersPolicy.enabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesSuggestMembersPolicyOther: DBXTeamPoliciesSuggestMembersPolicy { + @objc + public init() { + let swift = TeamPolicies.SuggestMembersPolicy.other + super.init(swift: swift) + } +} + +/// Policies governing team members. +@objc +public class DBXTeamPoliciesTeamMemberPolicies: NSObject { + /// Policies governing sharing. + @objc + public var sharing: DBXTeamPoliciesTeamSharingPolicies { DBXTeamPoliciesTeamSharingPolicies(swift: swift.sharing) } + /// This describes the Enterprise Mobility Management (EMM) state for this team. This information can be used to + /// understand if an organization is integrating with a third-party EMM vendor to further manage and apply + /// restrictions upon the team's Dropbox usage on mobile devices. This is a new feature and in the future + /// we'll be adding more new fields and additional documentation. + @objc + public var emmState: DBXTeamPoliciesEmmState { DBXTeamPoliciesEmmState(swift: swift.emmState) } + /// The admin policy around the Dropbox Office Add-In for this team. + @objc + public var officeAddin: DBXTeamPoliciesOfficeAddInPolicy { DBXTeamPoliciesOfficeAddInPolicy(swift: swift.officeAddin) } + /// The team policy on if teammembers are allowed to suggest users for admins to invite to the team. + @objc + public var suggestMembersPolicy: DBXTeamPoliciesSuggestMembersPolicy { DBXTeamPoliciesSuggestMembersPolicy(swift: swift.suggestMembersPolicy) } + + @objc + public init( + sharing: DBXTeamPoliciesTeamSharingPolicies, + emmState: DBXTeamPoliciesEmmState, + officeAddin: DBXTeamPoliciesOfficeAddInPolicy, + suggestMembersPolicy: DBXTeamPoliciesSuggestMembersPolicy + ) { + self.swift = TeamPolicies.TeamMemberPolicies( + sharing: sharing.swift, + emmState: emmState.swift, + officeAddin: officeAddin.swift, + suggestMembersPolicy: suggestMembersPolicy.swift + ) + } + + let swift: TeamPolicies.TeamMemberPolicies + + public init(swift: TeamPolicies.TeamMemberPolicies) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Policies governing sharing within and outside of the team. +@objc +public class DBXTeamPoliciesTeamSharingPolicies: NSObject { + /// Who can join folders shared by team members. + @objc + public var sharedFolderMemberPolicy: DBXTeamPoliciesSharedFolderMemberPolicy { + DBXTeamPoliciesSharedFolderMemberPolicy(swift: swift.sharedFolderMemberPolicy) + } + + /// Which shared folders team members can join. + @objc + public var sharedFolderJoinPolicy: DBXTeamPoliciesSharedFolderJoinPolicy { DBXTeamPoliciesSharedFolderJoinPolicy(swift: swift.sharedFolderJoinPolicy) } + /// Who can view shared links owned by team members. + @objc + public var sharedLinkCreatePolicy: DBXTeamPoliciesSharedLinkCreatePolicy { DBXTeamPoliciesSharedLinkCreatePolicy(swift: swift.sharedLinkCreatePolicy) } + /// Who can create groups. + @objc + public var groupCreationPolicy: DBXTeamPoliciesGroupCreation { DBXTeamPoliciesGroupCreation(swift: swift.groupCreationPolicy) } + /// Who can view links to content in shared folders. + @objc + public var sharedFolderLinkRestrictionPolicy: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy { + DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy(swift: swift.sharedFolderLinkRestrictionPolicy) + } + + @objc + public init( + sharedFolderMemberPolicy: DBXTeamPoliciesSharedFolderMemberPolicy, + sharedFolderJoinPolicy: DBXTeamPoliciesSharedFolderJoinPolicy, + sharedLinkCreatePolicy: DBXTeamPoliciesSharedLinkCreatePolicy, + groupCreationPolicy: DBXTeamPoliciesGroupCreation, + sharedFolderLinkRestrictionPolicy: DBXTeamPoliciesSharedFolderBlanketLinkRestrictionPolicy + ) { + self.swift = TeamPolicies.TeamSharingPolicies( + sharedFolderMemberPolicy: sharedFolderMemberPolicy.swift, + sharedFolderJoinPolicy: sharedFolderJoinPolicy.swift, + sharedLinkCreatePolicy: sharedLinkCreatePolicy.swift, + groupCreationPolicy: groupCreationPolicy.swift, + sharedFolderLinkRestrictionPolicy: sharedFolderLinkRestrictionPolicy.swift + ) + } + + let swift: TeamPolicies.TeamSharingPolicies + + public init(swift: TeamPolicies.TeamSharingPolicies) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TwoStepVerificationPolicy union +@objc +public class DBXTeamPoliciesTwoStepVerificationPolicy: NSObject { + let swift: TeamPolicies.TwoStepVerificationPolicy + + public init(swift: TeamPolicies.TwoStepVerificationPolicy) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.TwoStepVerificationPolicy) -> DBXTeamPoliciesTwoStepVerificationPolicy { + switch swift { + case .requireTfaEnable: + return DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaEnable() + case .requireTfaDisable: + return DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaDisable() + case .other: + return DBXTeamPoliciesTwoStepVerificationPolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asRequireTfaEnable: DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaEnable? { + self as? DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaEnable + } + + @objc + public var asRequireTfaDisable: DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaDisable? { + self as? DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaDisable + } + + @objc + public var asOther: DBXTeamPoliciesTwoStepVerificationPolicyOther? { + self as? DBXTeamPoliciesTwoStepVerificationPolicyOther + } +} + +/// Enabled require two factor authorization. +@objc +public class DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaEnable: DBXTeamPoliciesTwoStepVerificationPolicy { + @objc + public init() { + let swift = TeamPolicies.TwoStepVerificationPolicy.requireTfaEnable + super.init(swift: swift) + } +} + +/// Disabled require two factor authorization. +@objc +public class DBXTeamPoliciesTwoStepVerificationPolicyRequireTfaDisable: DBXTeamPoliciesTwoStepVerificationPolicy { + @objc + public init() { + let swift = TeamPolicies.TwoStepVerificationPolicy.requireTfaDisable + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesTwoStepVerificationPolicyOther: DBXTeamPoliciesTwoStepVerificationPolicy { + @objc + public init() { + let swift = TeamPolicies.TwoStepVerificationPolicy.other + super.init(swift: swift) + } +} + +/// Objective-C compatible TwoStepVerificationState union +@objc +public class DBXTeamPoliciesTwoStepVerificationState: NSObject { + let swift: TeamPolicies.TwoStepVerificationState + + public init(swift: TeamPolicies.TwoStepVerificationState) { + self.swift = swift + } + + public static func factory(swift: TeamPolicies.TwoStepVerificationState) -> DBXTeamPoliciesTwoStepVerificationState { + switch swift { + case .required: + return DBXTeamPoliciesTwoStepVerificationStateRequired() + case .optional: + return DBXTeamPoliciesTwoStepVerificationStateOptional() + case .disabled: + return DBXTeamPoliciesTwoStepVerificationStateDisabled() + case .other: + return DBXTeamPoliciesTwoStepVerificationStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asRequired: DBXTeamPoliciesTwoStepVerificationStateRequired? { + self as? DBXTeamPoliciesTwoStepVerificationStateRequired + } + + @objc + public var asOptional: DBXTeamPoliciesTwoStepVerificationStateOptional? { + self as? DBXTeamPoliciesTwoStepVerificationStateOptional + } + + @objc + public var asDisabled: DBXTeamPoliciesTwoStepVerificationStateDisabled? { + self as? DBXTeamPoliciesTwoStepVerificationStateDisabled + } + + @objc + public var asOther: DBXTeamPoliciesTwoStepVerificationStateOther? { + self as? DBXTeamPoliciesTwoStepVerificationStateOther + } +} + +/// Enabled require two factor authorization. +@objc +public class DBXTeamPoliciesTwoStepVerificationStateRequired: DBXTeamPoliciesTwoStepVerificationState { + @objc + public init() { + let swift = TeamPolicies.TwoStepVerificationState.required + super.init(swift: swift) + } +} + +/// Optional require two factor authorization. +@objc +public class DBXTeamPoliciesTwoStepVerificationStateOptional: DBXTeamPoliciesTwoStepVerificationState { + @objc + public init() { + let swift = TeamPolicies.TwoStepVerificationState.optional + super.init(swift: swift) + } +} + +/// Disabled require two factor authorization. +@objc +public class DBXTeamPoliciesTwoStepVerificationStateDisabled: DBXTeamPoliciesTwoStepVerificationState { + @objc + public init() { + let swift = TeamPolicies.TwoStepVerificationState.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamPoliciesTwoStepVerificationStateOther: DBXTeamPoliciesTwoStepVerificationState { + @objc + public init() { + let swift = TeamPolicies.TwoStepVerificationState.other + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamRoutes.swift new file mode 100644 index 000000000..66c766f48 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamRoutes.swift @@ -0,0 +1,8066 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the team namespace +/// For Swift routes see TeamRoutes +@objc +public class DBXTeamRoutes: NSObject { + private let swift: TeamRoutes + init(swift: TeamRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// List all device sessions of a team's member. + /// + /// - scope: sessions.list + /// + /// - parameter teamMemberId: The team's member id. + /// - parameter includeWebSessions: Whether to list web sessions of the team's member. + /// - parameter includeDesktopClients: Whether to list linked desktop devices of the team's member. + /// - parameter includeMobileClients: Whether to list linked mobile devices of the team's member. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ListMemberDevicesResult` object on + /// success or a `Team.ListMemberDevicesError` object on failure. + @objc + @discardableResult public func devicesListMemberDevices( + teamMemberId: String, + includeWebSessions: NSNumber, + includeDesktopClients: NSNumber, + includeMobileClients: NSNumber + ) -> DBXTeamDevicesListMemberDevicesRpcRequest { + let swift = swift.devicesListMemberDevices( + teamMemberId: teamMemberId, + includeWebSessions: includeWebSessions.boolValue, + includeDesktopClients: includeDesktopClients.boolValue, + includeMobileClients: includeMobileClients.boolValue + ) + return DBXTeamDevicesListMemberDevicesRpcRequest(swift: swift) + } + + /// List all device sessions of a team's member. + /// + /// - scope: sessions.list + /// + /// - returns: Through the response callback, the caller will receive a `Team.ListMemberDevicesResult` object on + /// success or a `Team.ListMemberDevicesError` object on failure. + @objc + @discardableResult public func devicesListMemberDevices(teamMemberId: String) -> DBXTeamDevicesListMemberDevicesRpcRequest { + let swift = swift.devicesListMemberDevices(teamMemberId: teamMemberId) + return DBXTeamDevicesListMemberDevicesRpcRequest(swift: swift) + } + + /// List all device sessions of a team. Permission : Team member file access. + /// + /// - scope: sessions.list + /// + /// - parameter cursor: At the first call to the devicesListMembersDevices the cursor shouldn't be passed. Then, if + /// the result of the call includes a cursor, the following requests should include the received cursors in + /// order to receive the next sub list of team devices. + /// - parameter includeWebSessions: Whether to list web sessions of the team members. + /// - parameter includeDesktopClients: Whether to list desktop clients of the team members. + /// - parameter includeMobileClients: Whether to list mobile clients of the team members. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ListMembersDevicesResult` object on + /// success or a `Team.ListMembersDevicesError` object on failure. + @objc + @discardableResult public func devicesListMembersDevices( + cursor: String?, + includeWebSessions: NSNumber, + includeDesktopClients: NSNumber, + includeMobileClients: NSNumber + ) -> DBXTeamDevicesListMembersDevicesRpcRequest { + let swift = swift.devicesListMembersDevices( + cursor: cursor, + includeWebSessions: includeWebSessions.boolValue, + includeDesktopClients: includeDesktopClients.boolValue, + includeMobileClients: includeMobileClients.boolValue + ) + return DBXTeamDevicesListMembersDevicesRpcRequest(swift: swift) + } + + /// List all device sessions of a team. Permission : Team member file access. + /// + /// - scope: sessions.list + /// + /// - returns: Through the response callback, the caller will receive a `Team.ListMembersDevicesResult` object on + /// success or a `Team.ListMembersDevicesError` object on failure. + @objc + @discardableResult public func devicesListMembersDevices() -> DBXTeamDevicesListMembersDevicesRpcRequest { + let swift = swift.devicesListMembersDevices() + return DBXTeamDevicesListMembersDevicesRpcRequest(swift: swift) + } + + /// Revoke a device session of a team's member. + /// + /// - scope: sessions.modify + /// + /// - parameter revokeDeviceSessionArg: The RevokeDeviceSessionArg union + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.RevokeDeviceSessionError` object on failure. + @objc + @discardableResult public func devicesRevokeDeviceSession(revokeDeviceSessionArg: DBXTeamRevokeDeviceSessionArg) + -> DBXTeamDevicesRevokeDeviceSessionRpcRequest { + let swift = swift.devicesRevokeDeviceSession(revokeDeviceSessionArg: revokeDeviceSessionArg.swift) + return DBXTeamDevicesRevokeDeviceSessionRpcRequest(swift: swift) + } + + /// Revoke a list of device sessions of team members. + /// + /// - scope: sessions.modify + /// + /// + /// - returns: Through the response callback, the caller will receive a `Team.RevokeDeviceSessionBatchResult` object + /// on success or a `Team.RevokeDeviceSessionBatchError` object on failure. + @objc + @discardableResult public func devicesRevokeDeviceSessionBatch(revokeDevices: [DBXTeamRevokeDeviceSessionArg]) + -> DBXTeamDevicesRevokeDeviceSessionBatchRpcRequest { + let swift = swift.devicesRevokeDeviceSessionBatch(revokeDevices: revokeDevices.map(\.swift)) + return DBXTeamDevicesRevokeDeviceSessionBatchRpcRequest(swift: swift) + } + + /// Get the values for one or more featues. This route allows you to check your account's capability for what + /// feature you can access or what value you have for certain features. Permission : Team information. + /// + /// - scope: team_info.read + /// + /// - parameter features: A list of features in Feature. If the list is empty, this route will return + /// FeaturesGetValuesBatchError. + /// + /// - returns: Through the response callback, the caller will receive a `Team.FeaturesGetValuesBatchResult` object + /// on success or a `Team.FeaturesGetValuesBatchError` object on failure. + @objc + @discardableResult public func featuresGetValues(features: [DBXTeamFeature]) -> DBXTeamFeaturesGetValuesRpcRequest { + let swift = swift.featuresGetValues(features: features.map(\.swift)) + return DBXTeamFeaturesGetValuesRpcRequest(swift: swift) + } + + /// Retrieves information about a team. + /// + /// - scope: team_info.read + /// + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamGetInfoResult` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getInfo() -> DBXTeamGetInfoRpcRequest { + let swift = swift.getInfo() + return DBXTeamGetInfoRpcRequest(swift: swift) + } + + /// Creates a new, empty group, with a requested name. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - parameter groupName: Group name. + /// - parameter addCreatorAsOwner: Automatically add the creator of the group. + /// - parameter groupExternalId: The creator of a team can associate an arbitrary external ID to the group. + /// - parameter groupManagementType: Whether the team can be managed by selected users, or only by team admins. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a + /// `Team.GroupCreateError` object on failure. + @objc + @discardableResult public func groupsCreate( + groupName: String, + addCreatorAsOwner: NSNumber, + groupExternalId: String?, + groupManagementType: DBXTeamCommonGroupManagementType? + ) -> DBXTeamGroupsCreateRpcRequest { + let swift = swift.groupsCreate( + groupName: groupName, + addCreatorAsOwner: addCreatorAsOwner.boolValue, + groupExternalId: groupExternalId, + groupManagementType: groupManagementType?.swift + ) + return DBXTeamGroupsCreateRpcRequest(swift: swift) + } + + /// Creates a new, empty group, with a requested name. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a + /// `Team.GroupCreateError` object on failure. + @objc + @discardableResult public func groupsCreate(groupName: String) -> DBXTeamGroupsCreateRpcRequest { + let swift = swift.groupsCreate(groupName: groupName) + return DBXTeamGroupsCreateRpcRequest(swift: swift) + } + + /// Deletes a group. The group is deleted immediately. However the revoking of group-owned resources may take + /// additional time. Use the groupsJobStatusGet to determine whether this process has completed. Permission : + /// Team member management. + /// + /// - scope: groups.write + /// + /// - parameter groupSelector: Argument for selecting a single group, either by group_id or by external group ID. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Team.GroupDeleteError` object on failure. + @objc + @discardableResult public func groupsDelete(groupSelector: DBXTeamGroupSelector) -> DBXTeamGroupsDeleteRpcRequest { + let swift = swift.groupsDelete(groupSelector: groupSelector.swift) + return DBXTeamGroupsDeleteRpcRequest(swift: swift) + } + + /// Retrieves information about one or more groups. Note that the optional field members in GroupFullInfo is not + /// returned for system-managed groups. Permission : Team Information. + /// + /// - scope: groups.read + /// + /// - parameter groupsSelector: Argument for selecting a list of groups, either by group_ids, or external group IDs. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object on + /// success or a `Team.GroupsGetInfoError` object on failure. + @objc + @discardableResult public func groupsGetInfo(groupsSelector: DBXTeamGroupsSelector) -> DBXTeamGroupsGetInfoRpcRequest { + let swift = swift.groupsGetInfo(groupsSelector: groupsSelector.swift) + return DBXTeamGroupsGetInfoRpcRequest(swift: swift) + } + + /// Once an async_job_id is returned from groupsDelete, groupsMembersAdd , or groupsMembersRemove use this method to + /// poll the status of granting/revoking group members' access to group-owned resources. Permission : Team + /// member management. + /// + /// - scope: groups.write + /// + /// - 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 `Async.PollEmptyResult` object on success or + /// a `Team.GroupsPollError` object on failure. + @objc + @discardableResult public func groupsJobStatusGet(asyncJobId: String) -> DBXTeamGroupsJobStatusGetRpcRequest { + let swift = swift.groupsJobStatusGet(asyncJobId: asyncJobId) + return DBXTeamGroupsJobStatusGetRpcRequest(swift: swift) + } + + /// Lists groups on a team. Permission : Team Information. + /// + /// - scope: groups.read + /// + /// - parameter limit: Number of results to return per call. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupsListResult` object on success or + /// a `Void` object on failure. + @objc + @discardableResult public func groupsList(limit: NSNumber) -> DBXTeamGroupsListRpcRequest { + let swift = swift.groupsList(limit: limit.uint32Value) + return DBXTeamGroupsListRpcRequest(swift: swift) + } + + /// Lists groups on a team. Permission : Team Information. + /// + /// - scope: groups.read + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupsListResult` object on success or + /// a `Void` object on failure. + @objc + @discardableResult public func groupsList() -> DBXTeamGroupsListRpcRequest { + let swift = swift.groupsList() + return DBXTeamGroupsListRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from groupsList, use this to paginate through all groups. Permission : Team + /// Information. + /// + /// - scope: groups.read + /// + /// - parameter cursor: Indicates from what point to get the next set of groups. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupsListResult` object on success or + /// a `Team.GroupsListContinueError` object on failure. + @objc + @discardableResult public func groupsListContinue(cursor: String) -> DBXTeamGroupsListContinueRpcRequest { + let swift = swift.groupsListContinue(cursor: cursor) + return DBXTeamGroupsListContinueRpcRequest(swift: swift) + } + + /// Adds members to a group. The members are added immediately. However the granting of group-owned resources may + /// take additional time. Use the groupsJobStatusGet to determine whether this process has completed. Permission + /// : Team member management. + /// + /// - scope: groups.write + /// + /// - parameter group: Group to which users will be added. + /// - parameter members: List of users to be added to the group. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on + /// success or a `Team.GroupMembersAddError` object on failure. + @objc + @discardableResult public func groupsMembersAdd( + group: DBXTeamGroupSelector, + members: [DBXTeamMemberAccess], + returnMembers: NSNumber + ) -> DBXTeamGroupsMembersAddRpcRequest { + let swift = swift.groupsMembersAdd(group: group.swift, members: members.map(\.swift), returnMembers: returnMembers.boolValue) + return DBXTeamGroupsMembersAddRpcRequest(swift: swift) + } + + /// Adds members to a group. The members are added immediately. However the granting of group-owned resources may + /// take additional time. Use the groupsJobStatusGet to determine whether this process has completed. Permission + /// : Team member management. + /// + /// - scope: groups.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on + /// success or a `Team.GroupMembersAddError` object on failure. + @objc + @discardableResult public func groupsMembersAdd(group: DBXTeamGroupSelector, members: [DBXTeamMemberAccess]) -> DBXTeamGroupsMembersAddRpcRequest { + let swift = swift.groupsMembersAdd(group: group.swift, members: members.map(\.swift)) + return DBXTeamGroupsMembersAddRpcRequest(swift: swift) + } + + /// Lists members of a group. Permission : Team Information. + /// + /// - scope: groups.read + /// + /// - parameter group: The group whose members are to be listed. + /// - parameter limit: Number of results to return per call. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupsMembersListResult` object on + /// success or a `Team.GroupSelectorError` object on failure. + @objc + @discardableResult public func groupsMembersList(group: DBXTeamGroupSelector, limit: NSNumber) -> DBXTeamGroupsMembersListRpcRequest { + let swift = swift.groupsMembersList(group: group.swift, limit: limit.uint32Value) + return DBXTeamGroupsMembersListRpcRequest(swift: swift) + } + + /// Lists members of a group. Permission : Team Information. + /// + /// - scope: groups.read + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupsMembersListResult` object on + /// success or a `Team.GroupSelectorError` object on failure. + @objc + @discardableResult public func groupsMembersList(group: DBXTeamGroupSelector) -> DBXTeamGroupsMembersListRpcRequest { + let swift = swift.groupsMembersList(group: group.swift) + return DBXTeamGroupsMembersListRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from groupsMembersList, use this to paginate through all members of the group. + /// Permission : Team information. + /// + /// - scope: groups.read + /// + /// - parameter cursor: Indicates from what point to get the next set of groups. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupsMembersListResult` object on + /// success or a `Team.GroupsMembersListContinueError` object on failure. + @objc + @discardableResult public func groupsMembersListContinue(cursor: String) -> DBXTeamGroupsMembersListContinueRpcRequest { + let swift = swift.groupsMembersListContinue(cursor: cursor) + return DBXTeamGroupsMembersListContinueRpcRequest(swift: swift) + } + + /// Removes members from a group. The members are removed immediately. However the revoking of group-owned resources + /// may take additional time. Use the groupsJobStatusGet to determine whether this process has completed. This + /// method permits removing the only owner of a group, even in cases where this is not possible via the web + /// client. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - parameter group: Group from which users will be removed. + /// - parameter users: List of users to be removed from the group. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on + /// success or a `Team.GroupMembersRemoveError` object on failure. + @objc + @discardableResult public func groupsMembersRemove( + group: DBXTeamGroupSelector, + users: [DBXTeamUserSelectorArg], + returnMembers: NSNumber + ) -> DBXTeamGroupsMembersRemoveRpcRequest { + let swift = swift.groupsMembersRemove(group: group.swift, users: users.map(\.swift), returnMembers: returnMembers.boolValue) + return DBXTeamGroupsMembersRemoveRpcRequest(swift: swift) + } + + /// Removes members from a group. The members are removed immediately. However the revoking of group-owned resources + /// may take additional time. Use the groupsJobStatusGet to determine whether this process has completed. This + /// method permits removing the only owner of a group, even in cases where this is not possible via the web + /// client. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupMembersChangeResult` object on + /// success or a `Team.GroupMembersRemoveError` object on failure. + @objc + @discardableResult public func groupsMembersRemove(group: DBXTeamGroupSelector, users: [DBXTeamUserSelectorArg]) -> DBXTeamGroupsMembersRemoveRpcRequest { + let swift = swift.groupsMembersRemove(group: group.swift, users: users.map(\.swift)) + return DBXTeamGroupsMembersRemoveRpcRequest(swift: swift) + } + + /// Sets a member's access type in a group. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - parameter accessType: New group access type the user will have. + /// - parameter returnMembers: Whether to return the list of members in the group. Note that the default value will + /// cause all the group members to be returned in the response. This may take a long time for large groups. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object on + /// success or a `Team.GroupMemberSetAccessTypeError` object on failure. + @objc + @discardableResult public func groupsMembersSetAccessType( + group: DBXTeamGroupSelector, + user: DBXTeamUserSelectorArg, + accessType: DBXTeamGroupAccessType, + returnMembers: NSNumber + ) -> DBXTeamGroupsMembersSetAccessTypeRpcRequest { + let swift = swift.groupsMembersSetAccessType(group: group.swift, user: user.swift, accessType: accessType.swift, returnMembers: returnMembers.boolValue) + return DBXTeamGroupsMembersSetAccessTypeRpcRequest(swift: swift) + } + + /// Sets a member's access type in a group. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - returns: Through the response callback, the caller will receive a `Array` object on + /// success or a `Team.GroupMemberSetAccessTypeError` object on failure. + @objc + @discardableResult public func groupsMembersSetAccessType( + group: DBXTeamGroupSelector, + user: DBXTeamUserSelectorArg, + accessType: DBXTeamGroupAccessType + ) -> DBXTeamGroupsMembersSetAccessTypeRpcRequest { + let swift = swift.groupsMembersSetAccessType(group: group.swift, user: user.swift, accessType: accessType.swift) + return DBXTeamGroupsMembersSetAccessTypeRpcRequest(swift: swift) + } + + /// Updates a group's name and/or external ID. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - parameter group: Specify a group. + /// - parameter newGroupName: Optional argument. Set group name to this if provided. + /// - parameter newGroupExternalId: Optional argument. New group external ID. If the argument is None, the group's + /// external_id won't be updated. If the argument is empty string, the group's external id will be cleared. + /// - parameter newGroupManagementType: Set new group management type, if provided. + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a + /// `Team.GroupUpdateError` object on failure. + @objc + @discardableResult public func groupsUpdate( + group: DBXTeamGroupSelector, + returnMembers: NSNumber, + newGroupName: String?, + newGroupExternalId: String?, + newGroupManagementType: DBXTeamCommonGroupManagementType? + ) -> DBXTeamGroupsUpdateRpcRequest { + let swift = swift.groupsUpdate( + group: group.swift, + returnMembers: returnMembers.boolValue, + newGroupName: newGroupName, + newGroupExternalId: newGroupExternalId, + newGroupManagementType: newGroupManagementType?.swift + ) + return DBXTeamGroupsUpdateRpcRequest(swift: swift) + } + + /// Updates a group's name and/or external ID. Permission : Team member management. + /// + /// - scope: groups.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.GroupFullInfo` object on success or a + /// `Team.GroupUpdateError` object on failure. + @objc + @discardableResult public func groupsUpdate(group: DBXTeamGroupSelector) -> DBXTeamGroupsUpdateRpcRequest { + let swift = swift.groupsUpdate(group: group.swift) + return DBXTeamGroupsUpdateRpcRequest(swift: swift) + } + + /// Creates new legal hold policy. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : + /// Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - parameter name: Policy name. + /// - parameter description_: A description of the legal hold policy. + /// - parameter members: List of team member IDs added to the hold. + /// - parameter startDate: start date of the legal hold policy. + /// - parameter endDate: end date of the legal hold policy. + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// a `Team.LegalHoldsPolicyCreateError` object on failure. + @objc + @discardableResult public func legalHoldsCreatePolicy( + name: String, + members: [String], + description_: String?, + startDate: Date?, + endDate: Date? + ) -> DBXTeamLegalHoldsCreatePolicyRpcRequest { + let swift = swift.legalHoldsCreatePolicy(name: name, members: members, description_: description_, startDate: startDate, endDate: endDate) + return DBXTeamLegalHoldsCreatePolicyRpcRequest(swift: swift) + } + + /// Creates new legal hold policy. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : + /// Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// a `Team.LegalHoldsPolicyCreateError` object on failure. + @objc + @discardableResult public func legalHoldsCreatePolicy(name: String, members: [String]) -> DBXTeamLegalHoldsCreatePolicyRpcRequest { + let swift = swift.legalHoldsCreatePolicy(name: name, members: members) + return DBXTeamLegalHoldsCreatePolicyRpcRequest(swift: swift) + } + + /// Gets a legal hold by Id. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team + /// member file access. + /// + /// - scope: team_data.governance.write + /// + /// - parameter id: The legal hold Id. + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// a `Team.LegalHoldsGetPolicyError` object on failure. + @objc + @discardableResult public func legalHoldsGetPolicy(id: String) -> DBXTeamLegalHoldsGetPolicyRpcRequest { + let swift = swift.legalHoldsGetPolicy(id: id) + return DBXTeamLegalHoldsGetPolicyRpcRequest(swift: swift) + } + + /// List the file metadata that's under the hold. Note: Legal Holds is a paid add-on. Not all teams have the + /// feature. Permission : Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - parameter id: The legal hold Id. + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListHeldRevisionResult` + /// object on success or a `Team.LegalHoldsListHeldRevisionsError` object on failure. + @objc + @discardableResult public func legalHoldsListHeldRevisions(id: String) -> DBXTeamLegalHoldsListHeldRevisionsRpcRequest { + let swift = swift.legalHoldsListHeldRevisions(id: id) + return DBXTeamLegalHoldsListHeldRevisionsRpcRequest(swift: swift) + } + + /// Continue listing the file metadata that's under the hold. Note: Legal Holds is a paid add-on. Not all teams have + /// the feature. Permission : Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - parameter id: The legal hold Id. + /// - parameter cursor: The cursor idicates where to continue reading file metadata entries for the next API call. + /// When there are no more entries, the cursor will return none. + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListHeldRevisionResult` + /// object on success or a `Team.LegalHoldsListHeldRevisionsError` object on failure. + @objc + @discardableResult public func legalHoldsListHeldRevisionsContinue(id: String, cursor: String?) -> DBXTeamLegalHoldsListHeldRevisionsContinueRpcRequest { + let swift = swift.legalHoldsListHeldRevisionsContinue(id: id, cursor: cursor) + return DBXTeamLegalHoldsListHeldRevisionsContinueRpcRequest(swift: swift) + } + + /// Continue listing the file metadata that's under the hold. Note: Legal Holds is a paid add-on. Not all teams have + /// the feature. Permission : Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListHeldRevisionResult` + /// object on success or a `Team.LegalHoldsListHeldRevisionsError` object on failure. + @objc + @discardableResult public func legalHoldsListHeldRevisionsContinue(id: String) -> DBXTeamLegalHoldsListHeldRevisionsContinueRpcRequest { + let swift = swift.legalHoldsListHeldRevisionsContinue(id: id) + return DBXTeamLegalHoldsListHeldRevisionsContinueRpcRequest(swift: swift) + } + + /// Lists legal holds on a team. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : + /// Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - parameter includeReleased: Whether to return holds that were released. + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListPoliciesResult` object + /// on success or a `Team.LegalHoldsListPoliciesError` object on failure. + @objc + @discardableResult public func legalHoldsListPolicies(includeReleased: NSNumber) -> DBXTeamLegalHoldsListPoliciesRpcRequest { + let swift = swift.legalHoldsListPolicies(includeReleased: includeReleased.boolValue) + return DBXTeamLegalHoldsListPoliciesRpcRequest(swift: swift) + } + + /// Lists legal holds on a team. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : + /// Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldsListPoliciesResult` object + /// on success or a `Team.LegalHoldsListPoliciesError` object on failure. + @objc + @discardableResult public func legalHoldsListPolicies() -> DBXTeamLegalHoldsListPoliciesRpcRequest { + let swift = swift.legalHoldsListPolicies() + return DBXTeamLegalHoldsListPoliciesRpcRequest(swift: swift) + } + + /// Releases a legal hold by Id. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : + /// Team member file access. + /// + /// - scope: team_data.governance.write + /// + /// - parameter id: The legal hold Id. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.LegalHoldsPolicyReleaseError` object on failure. + @objc + @discardableResult public func legalHoldsReleasePolicy(id: String) -> DBXTeamLegalHoldsReleasePolicyRpcRequest { + let swift = swift.legalHoldsReleasePolicy(id: id) + return DBXTeamLegalHoldsReleasePolicyRpcRequest(swift: swift) + } + + /// Updates a legal hold. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team + /// member file access. + /// + /// - scope: team_data.governance.write + /// + /// - parameter id: The legal hold Id. + /// - parameter name: Policy new name. + /// - parameter description_: Policy new description. + /// - parameter members: List of team member IDs to apply the policy on. + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// a `Team.LegalHoldsPolicyUpdateError` object on failure. + @objc + @discardableResult public func legalHoldsUpdatePolicy( + id: String, + name: String?, + description_: String?, + members: [String]? + ) -> DBXTeamLegalHoldsUpdatePolicyRpcRequest { + let swift = swift.legalHoldsUpdatePolicy(id: id, name: name, description_: description_, members: members) + return DBXTeamLegalHoldsUpdatePolicyRpcRequest(swift: swift) + } + + /// Updates a legal hold. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team + /// member file access. + /// + /// - scope: team_data.governance.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.LegalHoldPolicy` object on success or + /// a `Team.LegalHoldsPolicyUpdateError` object on failure. + @objc + @discardableResult public func legalHoldsUpdatePolicy(id: String) -> DBXTeamLegalHoldsUpdatePolicyRpcRequest { + let swift = swift.legalHoldsUpdatePolicy(id: id) + return DBXTeamLegalHoldsUpdatePolicyRpcRequest(swift: swift) + } + + /// List all linked applications of the team member. Note, this endpoint does not list any team-linked applications. + /// + /// - scope: sessions.list + /// + /// - parameter teamMemberId: The team member id. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ListMemberAppsResult` object on + /// success or a `Team.ListMemberAppsError` object on failure. + @objc + @discardableResult public func linkedAppsListMemberLinkedApps(teamMemberId: String) -> DBXTeamLinkedAppsListMemberLinkedAppsRpcRequest { + let swift = swift.linkedAppsListMemberLinkedApps(teamMemberId: teamMemberId) + return DBXTeamLinkedAppsListMemberLinkedAppsRpcRequest(swift: swift) + } + + /// List all applications linked to the team members' accounts. Note, this endpoint does not list any team-linked + /// applications. + /// + /// - scope: sessions.list + /// + /// - parameter cursor: At the first call to the linkedAppsListMembersLinkedApps the cursor shouldn't be passed. + /// Then, if the result of the call includes a cursor, the following requests should include the received + /// cursors in order to receive the next sub list of the team applications. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ListMembersAppsResult` object on + /// success or a `Team.ListMembersAppsError` object on failure. + @objc + @discardableResult public func linkedAppsListMembersLinkedApps(cursor: String?) -> DBXTeamLinkedAppsListMembersLinkedAppsRpcRequest { + let swift = swift.linkedAppsListMembersLinkedApps(cursor: cursor) + return DBXTeamLinkedAppsListMembersLinkedAppsRpcRequest(swift: swift) + } + + /// List all applications linked to the team members' accounts. Note, this endpoint does not list any team-linked + /// applications. + /// + /// - scope: sessions.list + /// + /// - returns: Through the response callback, the caller will receive a `Team.ListMembersAppsResult` object on + /// success or a `Team.ListMembersAppsError` object on failure. + @objc + @discardableResult public func linkedAppsListMembersLinkedApps() -> DBXTeamLinkedAppsListMembersLinkedAppsRpcRequest { + let swift = swift.linkedAppsListMembersLinkedApps() + return DBXTeamLinkedAppsListMembersLinkedAppsRpcRequest(swift: swift) + } + + /// Revoke a linked application of the team member. + /// + /// - scope: sessions.modify + /// + /// - parameter appId: The application's unique id. + /// - parameter teamMemberId: The unique id of the member owning the device. + /// - parameter keepAppFolder: This flag is not longer supported, the application dedicated folder (in case the + /// application uses one) will be kept. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.RevokeLinkedAppError` object on failure. + @objc + @discardableResult public func linkedAppsRevokeLinkedApp( + appId: String, + teamMemberId: String, + keepAppFolder: NSNumber + ) -> DBXTeamLinkedAppsRevokeLinkedAppRpcRequest { + let swift = swift.linkedAppsRevokeLinkedApp(appId: appId, teamMemberId: teamMemberId, keepAppFolder: keepAppFolder.boolValue) + return DBXTeamLinkedAppsRevokeLinkedAppRpcRequest(swift: swift) + } + + /// Revoke a linked application of the team member. + /// + /// - scope: sessions.modify + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.RevokeLinkedAppError` object on failure. + @objc + @discardableResult public func linkedAppsRevokeLinkedApp(appId: String, teamMemberId: String) -> DBXTeamLinkedAppsRevokeLinkedAppRpcRequest { + let swift = swift.linkedAppsRevokeLinkedApp(appId: appId, teamMemberId: teamMemberId) + return DBXTeamLinkedAppsRevokeLinkedAppRpcRequest(swift: swift) + } + + /// Revoke a list of linked applications of the team members. + /// + /// - scope: sessions.modify + /// + /// + /// - returns: Through the response callback, the caller will receive a `Team.RevokeLinkedAppBatchResult` object on + /// success or a `Team.RevokeLinkedAppBatchError` object on failure. + @objc + @discardableResult public func linkedAppsRevokeLinkedAppBatch(revokeLinkedApp: [DBXTeamRevokeLinkedApiAppArg]) + -> DBXTeamLinkedAppsRevokeLinkedAppBatchRpcRequest { + let swift = swift.linkedAppsRevokeLinkedAppBatch(revokeLinkedApp: revokeLinkedApp.map(\.swift)) + return DBXTeamLinkedAppsRevokeLinkedAppBatchRpcRequest(swift: swift) + } + + /// Add users to member space limits excluded users list. + /// + /// - scope: members.write + /// + /// - parameter users: List of users to be added/removed. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on + /// success or a `Team.ExcludedUsersUpdateError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsExcludedUsersAdd(users: [DBXTeamUserSelectorArg]?) -> DBXTeamMemberSpaceLimitsExcludedUsersAddRpcRequest { + let swift = swift.memberSpaceLimitsExcludedUsersAdd(users: users?.map(\.swift)) + return DBXTeamMemberSpaceLimitsExcludedUsersAddRpcRequest(swift: swift) + } + + /// Add users to member space limits excluded users list. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on + /// success or a `Team.ExcludedUsersUpdateError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsExcludedUsersAdd() -> DBXTeamMemberSpaceLimitsExcludedUsersAddRpcRequest { + let swift = swift.memberSpaceLimitsExcludedUsersAdd() + return DBXTeamMemberSpaceLimitsExcludedUsersAddRpcRequest(swift: swift) + } + + /// List member space limits excluded users. + /// + /// - scope: members.read + /// + /// - parameter limit: Number of results to return per call. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersListResult` object on + /// success or a `Team.ExcludedUsersListError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsExcludedUsersList(limit: NSNumber) -> DBXTeamMemberSpaceLimitsExcludedUsersListRpcRequest { + let swift = swift.memberSpaceLimitsExcludedUsersList(limit: limit.uint32Value) + return DBXTeamMemberSpaceLimitsExcludedUsersListRpcRequest(swift: swift) + } + + /// List member space limits excluded users. + /// + /// - scope: members.read + /// + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersListResult` object on + /// success or a `Team.ExcludedUsersListError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsExcludedUsersList() -> DBXTeamMemberSpaceLimitsExcludedUsersListRpcRequest { + let swift = swift.memberSpaceLimitsExcludedUsersList() + return DBXTeamMemberSpaceLimitsExcludedUsersListRpcRequest(swift: swift) + } + + /// Continue listing member space limits excluded users. + /// + /// - scope: members.read + /// + /// - parameter cursor: Indicates from what point to get the next set of users. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersListResult` object on + /// success or a `Team.ExcludedUsersListContinueError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsExcludedUsersListContinue(cursor: String) -> DBXTeamMemberSpaceLimitsExcludedUsersListContinueRpcRequest { + let swift = swift.memberSpaceLimitsExcludedUsersListContinue(cursor: cursor) + return DBXTeamMemberSpaceLimitsExcludedUsersListContinueRpcRequest(swift: swift) + } + + /// Remove users from member space limits excluded users list. + /// + /// - scope: members.write + /// + /// - parameter users: List of users to be added/removed. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on + /// success or a `Team.ExcludedUsersUpdateError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsExcludedUsersRemove(users: [DBXTeamUserSelectorArg]?) + -> DBXTeamMemberSpaceLimitsExcludedUsersRemoveRpcRequest { + let swift = swift.memberSpaceLimitsExcludedUsersRemove(users: users?.map(\.swift)) + return DBXTeamMemberSpaceLimitsExcludedUsersRemoveRpcRequest(swift: swift) + } + + /// Remove users from member space limits excluded users list. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.ExcludedUsersUpdateResult` object on + /// success or a `Team.ExcludedUsersUpdateError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsExcludedUsersRemove() -> DBXTeamMemberSpaceLimitsExcludedUsersRemoveRpcRequest { + let swift = swift.memberSpaceLimitsExcludedUsersRemove() + return DBXTeamMemberSpaceLimitsExcludedUsersRemoveRpcRequest(swift: swift) + } + + /// Get users custom quota. A maximum of 1000 members can be specified in a single call. Note: to apply a custom + /// space limit, a team admin needs to set a member space limit for the team first. (the team admin can check + /// the settings here: https://www.dropbox.com/team/admin/settings/space). + /// + /// - scope: members.read + /// + /// - parameter users: List of users. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object on + /// success or a `Team.CustomQuotaError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsGetCustomQuota(users: [DBXTeamUserSelectorArg]) -> DBXTeamMemberSpaceLimitsGetCustomQuotaRpcRequest { + let swift = swift.memberSpaceLimitsGetCustomQuota(users: users.map(\.swift)) + return DBXTeamMemberSpaceLimitsGetCustomQuotaRpcRequest(swift: swift) + } + + /// Remove users custom quota. A maximum of 1000 members can be specified in a single call. Note: to apply a custom + /// space limit, a team admin needs to set a member space limit for the team first. (the team admin can check + /// the settings here: https://www.dropbox.com/team/admin/settings/space). + /// + /// - scope: members.write + /// + /// - parameter users: List of users. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object + /// on success or a `Team.CustomQuotaError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsRemoveCustomQuota(users: [DBXTeamUserSelectorArg]) -> DBXTeamMemberSpaceLimitsRemoveCustomQuotaRpcRequest { + let swift = swift.memberSpaceLimitsRemoveCustomQuota(users: users.map(\.swift)) + return DBXTeamMemberSpaceLimitsRemoveCustomQuotaRpcRequest(swift: swift) + } + + /// Set users custom quota. Custom quota has to be at least 15GB. A maximum of 1000 members can be specified in a + /// single call. Note: to apply a custom space limit, a team admin needs to set a member space limit for the + /// team first. (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space). + /// + /// - scope: members.read + /// + /// - parameter usersAndQuotas: List of users and their custom quotas. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object on + /// success or a `Team.SetCustomQuotaError` object on failure. + @objc + @discardableResult public func memberSpaceLimitsSetCustomQuota(usersAndQuotas: [DBXTeamUserCustomQuotaArg]) + -> DBXTeamMemberSpaceLimitsSetCustomQuotaRpcRequest { + let swift = swift.memberSpaceLimitsSetCustomQuota(usersAndQuotas: usersAndQuotas.map(\.swift)) + return DBXTeamMemberSpaceLimitsSetCustomQuotaRpcRequest(swift: swift) + } + + /// Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single + /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created + /// with the given email address, and that account will be invited to the team. If a personal Dropbox account + /// exists with the email address specified in the call, this call will create a placeholder Dropbox account for + /// the user on the team and send an email inviting the user to migrate their existing personal account onto the + /// team. Team member management apps are required to set an initial given_name and surname for a user to use in + /// the team invitation and for 'Perform as team member' actions taken on the user before they become 'active'. + /// + /// - scope: members.write + /// + /// - parameter newMembers: Details of new members to be added to the team. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunchV2Result` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func membersAddV2(newMembers: [DBXTeamMemberAddV2Arg], forceAsync: NSNumber) -> DBXTeamMembersAddRpcRequestV2 { + let swift = swift.membersAddV2(newMembers: newMembers.map(\.subSwift), forceAsync: forceAsync.boolValue) + return DBXTeamMembersAddRpcRequestV2(swift: swift) + } + + /// Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single + /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created + /// with the given email address, and that account will be invited to the team. If a personal Dropbox account + /// exists with the email address specified in the call, this call will create a placeholder Dropbox account for + /// the user on the team and send an email inviting the user to migrate their existing personal account onto the + /// team. Team member management apps are required to set an initial given_name and surname for a user to use in + /// the team invitation and for 'Perform as team member' actions taken on the user before they become 'active'. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunchV2Result` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func membersAddV2(newMembers: [DBXTeamMemberAddV2Arg]) -> DBXTeamMembersAddRpcRequestV2 { + let swift = swift.membersAddV2(newMembers: newMembers.map(\.subSwift)) + return DBXTeamMembersAddRpcRequestV2(swift: swift) + } + + /// Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single + /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created + /// with the given email address, and that account will be invited to the team. If a personal Dropbox account + /// exists with the email address specified in the call, this call will create a placeholder Dropbox account for + /// the user on the team and send an email inviting the user to migrate their existing personal account onto the + /// team. Team member management apps are required to set an initial given_name and surname for a user to use in + /// the team invitation and for 'Perform as team member' actions taken on the user before they become 'active'. + /// + /// - scope: members.write + /// + /// - parameter newMembers: Details of new members to be added to the team. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunch` object on success or + /// a `Void` object on failure. + @objc + @discardableResult public func membersAdd(newMembers: [DBXTeamMemberAddArg], forceAsync: NSNumber) -> DBXTeamMembersAddRpcRequest { + let swift = swift.membersAdd(newMembers: newMembers.map(\.subSwift), forceAsync: forceAsync.boolValue) + return DBXTeamMembersAddRpcRequest(swift: swift) + } + + /// Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single + /// call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created + /// with the given email address, and that account will be invited to the team. If a personal Dropbox account + /// exists with the email address specified in the call, this call will create a placeholder Dropbox account for + /// the user on the team and send an email inviting the user to migrate their existing personal account onto the + /// team. Team member management apps are required to set an initial given_name and surname for a user to use in + /// the team invitation and for 'Perform as team member' actions taken on the user before they become 'active'. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersAddLaunch` object on success or + /// a `Void` object on failure. + @objc + @discardableResult public func membersAdd(newMembers: [DBXTeamMemberAddArg]) -> DBXTeamMembersAddRpcRequest { + let swift = swift.membersAdd(newMembers: newMembers.map(\.subSwift)) + return DBXTeamMembersAddRpcRequest(swift: swift) + } + + /// Once an async_job_id is returned from membersAddV2 , use this to poll the status of the asynchronous request. + /// Permission : Team member management. + /// + /// - scope: members.write + /// + /// - 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 `Team.MembersAddJobStatusV2Result` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func membersAddJobStatusGetV2(asyncJobId: String) -> DBXTeamMembersAddJobStatusGetRpcRequestV2 { + let swift = swift.membersAddJobStatusGetV2(asyncJobId: asyncJobId) + return DBXTeamMembersAddJobStatusGetRpcRequestV2(swift: swift) + } + + /// Once an async_job_id is returned from membersAdd , use this to poll the status of the asynchronous request. + /// Permission : Team member management. + /// + /// - scope: members.write + /// + /// - 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 `Team.MembersAddJobStatus` object on success + /// or a `Async.PollError` object on failure. + @objc + @discardableResult public func membersAddJobStatusGet(asyncJobId: String) -> DBXTeamMembersAddJobStatusGetRpcRequest { + let swift = swift.membersAddJobStatusGet(asyncJobId: asyncJobId) + return DBXTeamMembersAddJobStatusGetRpcRequest(swift: swift) + } + + /// Deletes a team member's profile photo. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of the user whose profile photo will be deleted. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on + /// success or a `Team.MembersDeleteProfilePhotoError` object on failure. + @objc + @discardableResult public func membersDeleteProfilePhotoV2(user: DBXTeamUserSelectorArg) -> DBXTeamMembersDeleteProfilePhotoRpcRequestV2 { + let swift = swift.membersDeleteProfilePhotoV2(user: user.swift) + return DBXTeamMembersDeleteProfilePhotoRpcRequestV2(swift: swift) + } + + /// Deletes a team member's profile photo. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of the user whose profile photo will be deleted. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or a + /// `Team.MembersDeleteProfilePhotoError` object on failure. + @objc + @discardableResult public func membersDeleteProfilePhoto(user: DBXTeamUserSelectorArg) -> DBXTeamMembersDeleteProfilePhotoRpcRequest { + let swift = swift.membersDeleteProfilePhoto(user: user.swift) + return DBXTeamMembersDeleteProfilePhotoRpcRequest(swift: swift) + } + + /// Get available TeamMemberRoles for the connected team. To be used with membersSetAdminPermissionsV2. Permission : + /// Team member management. + /// + /// - scope: members.read + /// + /// + /// - returns: Through the response callback, the caller will receive a + /// `Team.MembersGetAvailableTeamMemberRolesResult` object on success or a `Void` object on failure. + @objc + @discardableResult public func membersGetAvailableTeamMemberRoles() -> DBXTeamMembersGetAvailableTeamMemberRolesRpcRequest { + let swift = swift.membersGetAvailableTeamMemberRoles() + return DBXTeamMembersGetAvailableTeamMemberRolesRpcRequest(swift: swift) + } + + /// Returns information about multiple team members. Permission : Team information This endpoint will return + /// idNotFound in MembersGetInfoItem, for IDs (or emails) that cannot be matched to a valid team member. + /// + /// - scope: members.read + /// + /// - parameter members: List of team members. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersGetInfoV2Result` object on + /// success or a `Team.MembersGetInfoError` object on failure. + @objc + @discardableResult public func membersGetInfoV2(members: [DBXTeamUserSelectorArg]) -> DBXTeamMembersGetInfoRpcRequestV2 { + let swift = swift.membersGetInfoV2(members: members.map(\.swift)) + return DBXTeamMembersGetInfoRpcRequestV2(swift: swift) + } + + /// Returns information about multiple team members. Permission : Team information This endpoint will return + /// idNotFound in MembersGetInfoItem, for IDs (or emails) that cannot be matched to a valid team member. + /// + /// - scope: members.read + /// + /// - parameter members: List of team members. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object on + /// success or a `Team.MembersGetInfoError` object on failure. + @objc + @discardableResult public func membersGetInfo(members: [DBXTeamUserSelectorArg]) -> DBXTeamMembersGetInfoRpcRequest { + let swift = swift.membersGetInfo(members: members.map(\.swift)) + return DBXTeamMembersGetInfoRpcRequest(swift: swift) + } + + /// Lists members of a team. Permission : Team information. + /// + /// - scope: members.read + /// + /// - parameter limit: Number of results to return per call. + /// - parameter includeRemoved: Whether to return removed members. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersListV2Result` object on success + /// or a `Team.MembersListError` object on failure. + @objc + @discardableResult public func membersListV2(limit: NSNumber, includeRemoved: NSNumber) -> DBXTeamMembersListRpcRequestV2 { + let swift = swift.membersListV2(limit: limit.uint32Value, includeRemoved: includeRemoved.boolValue) + return DBXTeamMembersListRpcRequestV2(swift: swift) + } + + /// Lists members of a team. Permission : Team information. + /// + /// - scope: members.read + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersListV2Result` object on success + /// or a `Team.MembersListError` object on failure. + @objc + @discardableResult public func membersListV2() -> DBXTeamMembersListRpcRequestV2 { + let swift = swift.membersListV2() + return DBXTeamMembersListRpcRequestV2(swift: swift) + } + + /// Lists members of a team. Permission : Team information. + /// + /// - scope: members.read + /// + /// - parameter limit: Number of results to return per call. + /// - parameter includeRemoved: Whether to return removed members. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersListResult` object on success + /// or a `Team.MembersListError` object on failure. + @objc + @discardableResult public func membersList(limit: NSNumber, includeRemoved: NSNumber) -> DBXTeamMembersListRpcRequest { + let swift = swift.membersList(limit: limit.uint32Value, includeRemoved: includeRemoved.boolValue) + return DBXTeamMembersListRpcRequest(swift: swift) + } + + /// Lists members of a team. Permission : Team information. + /// + /// - scope: members.read + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersListResult` object on success + /// or a `Team.MembersListError` object on failure. + @objc + @discardableResult public func membersList() -> DBXTeamMembersListRpcRequest { + let swift = swift.membersList() + return DBXTeamMembersListRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from membersListV2, use this to paginate through all team members. Permission : + /// Team information. + /// + /// - scope: members.read + /// + /// - parameter cursor: Indicates from what point to get the next set of members. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersListV2Result` object on success + /// or a `Team.MembersListContinueError` object on failure. + @objc + @discardableResult public func membersListContinueV2(cursor: String) -> DBXTeamMembersListContinueRpcRequestV2 { + let swift = swift.membersListContinueV2(cursor: cursor) + return DBXTeamMembersListContinueRpcRequestV2(swift: swift) + } + + /// Once a cursor has been retrieved from membersList, use this to paginate through all team members. Permission : + /// Team information. + /// + /// - scope: members.read + /// + /// - parameter cursor: Indicates from what point to get the next set of members. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersListResult` object on success + /// or a `Team.MembersListContinueError` object on failure. + @objc + @discardableResult public func membersListContinue(cursor: String) -> DBXTeamMembersListContinueRpcRequest { + let swift = swift.membersListContinue(cursor: cursor) + return DBXTeamMembersListContinueRpcRequest(swift: swift) + } + + /// Moves removed member's files to a different member. This endpoint initiates an asynchronous job. To obtain the + /// final result of the job, the client should periodically poll membersMoveFormerMemberFilesJobStatusCheck. + /// Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter transferDestId: Files from the deleted member account will be transferred to this user. + /// - parameter transferAdminId: Errors during the transfer process will be sent via email to this user. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Team.MembersTransferFormerMembersFilesError` object on failure. + @objc + @discardableResult public func membersMoveFormerMemberFiles( + user: DBXTeamUserSelectorArg, + transferDestId: DBXTeamUserSelectorArg, + transferAdminId: DBXTeamUserSelectorArg + ) -> DBXTeamMembersMoveFormerMemberFilesRpcRequest { + let swift = swift.membersMoveFormerMemberFiles(user: user.swift, transferDestId: transferDestId.swift, transferAdminId: transferAdminId.swift) + return DBXTeamMembersMoveFormerMemberFilesRpcRequest(swift: swift) + } + + /// Once an async_job_id is returned from membersMoveFormerMemberFiles , use this to poll the status of the + /// asynchronous request. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - 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 `Async.PollEmptyResult` object on success or + /// a `Async.PollError` object on failure. + @objc + @discardableResult public func membersMoveFormerMemberFilesJobStatusCheck(asyncJobId: String) + -> DBXTeamMembersMoveFormerMemberFilesJobStatusCheckRpcRequest { + let swift = swift.membersMoveFormerMemberFilesJobStatusCheck(asyncJobId: asyncJobId) + return DBXTeamMembersMoveFormerMemberFilesJobStatusCheckRpcRequest(swift: swift) + } + + /// Recover a deleted member. Permission : Team member management Exactly one of team_member_id, email, or + /// external_id must be provided to identify the user account. + /// + /// - scope: members.delete + /// + /// - parameter user: Identity of user to recover. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.MembersRecoverError` object on failure. + @objc + @discardableResult public func membersRecover(user: DBXTeamUserSelectorArg) -> DBXTeamMembersRecoverRpcRequest { + let swift = swift.membersRecover(user: user.swift) + return DBXTeamMembersRecoverRpcRequest(swift: swift) + } + + /// Removes a member from a team. Permission : Team member management Exactly one of team_member_id, email, or + /// external_id must be provided to identify the user account. Accounts can be recovered via membersRecover for + /// a 7 day period or until the account has been permanently deleted or transferred to another account + /// (whichever comes first). Calling membersAdd while a user is still recoverable on your team will return with + /// userAlreadyOnTeam in MemberAddResult. Accounts can have their files transferred via the admin console for a + /// limited time, based on the version history length associated with the team (180 days for most teams). This + /// endpoint may initiate an asynchronous job. To obtain the final result of the job, the client should + /// periodically poll membersRemoveJobStatusGet. + /// + /// - scope: members.delete + /// + /// - parameter transferDestId: If provided, files from the deleted member account will be transferred to this user. + /// - parameter transferAdminId: If provided, errors during the transfer process will be sent via email to this + /// user. If the transfer_dest_id argument was provided, then this argument must be provided as well. + /// - parameter keepAccount: Downgrade the member to a Basic account. The user will retain the email address + /// associated with their Dropbox account and data in their account that is not restricted to team members. In + /// order to keep the account the argument wipeData should be set to false. + /// - parameter retainTeamShares: If provided, allows removed users to keep access to Dropbox folders (not Dropbox + /// Paper folders) already explicitly shared with them (not via a group) when they are downgraded to a Basic + /// account. Users will not retain access to folders that do not allow external sharing. In order to keep the + /// sharing relationships, the arguments wipeData should be set to false and keepAccount should be set to true. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Team.MembersRemoveError` object on failure. + @objc + @discardableResult public func membersRemove( + user: DBXTeamUserSelectorArg, + wipeData: NSNumber, + transferDestId: DBXTeamUserSelectorArg?, + transferAdminId: DBXTeamUserSelectorArg?, + keepAccount: NSNumber, + retainTeamShares: NSNumber + ) -> DBXTeamMembersRemoveRpcRequest { + let swift = swift.membersRemove( + user: user.swift, + wipeData: wipeData.boolValue, + transferDestId: transferDestId?.swift, + transferAdminId: transferAdminId?.swift, + keepAccount: keepAccount.boolValue, + retainTeamShares: retainTeamShares.boolValue + ) + return DBXTeamMembersRemoveRpcRequest(swift: swift) + } + + /// Removes a member from a team. Permission : Team member management Exactly one of team_member_id, email, or + /// external_id must be provided to identify the user account. Accounts can be recovered via membersRecover for + /// a 7 day period or until the account has been permanently deleted or transferred to another account + /// (whichever comes first). Calling membersAdd while a user is still recoverable on your team will return with + /// userAlreadyOnTeam in MemberAddResult. Accounts can have their files transferred via the admin console for a + /// limited time, based on the version history length associated with the team (180 days for most teams). This + /// endpoint may initiate an asynchronous job. To obtain the final result of the job, the client should + /// periodically poll membersRemoveJobStatusGet. + /// + /// - scope: members.delete + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchEmptyResult` object on success + /// or a `Team.MembersRemoveError` object on failure. + @objc + @discardableResult public func membersRemove(user: DBXTeamUserSelectorArg) -> DBXTeamMembersRemoveRpcRequest { + let swift = swift.membersRemove(user: user.swift) + return DBXTeamMembersRemoveRpcRequest(swift: swift) + } + + /// Once an async_job_id is returned from membersRemove , use this to poll the status of the asynchronous request. + /// Permission : Team member management. + /// + /// - scope: members.delete + /// + /// - 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 `Async.PollEmptyResult` object on success or + /// a `Async.PollError` object on failure. + @objc + @discardableResult public func membersRemoveJobStatusGet(asyncJobId: String) -> DBXTeamMembersRemoveJobStatusGetRpcRequest { + let swift = swift.membersRemoveJobStatusGet(asyncJobId: asyncJobId) + return DBXTeamMembersRemoveJobStatusGetRpcRequest(swift: swift) + } + + /// Add secondary emails to users. Permission : Team member management. Emails that are on verified domains will be + /// verified automatically. For each email address not on a verified domain a verification email will be sent. + /// + /// - scope: members.write + /// + /// - parameter newSecondaryEmails: List of users and secondary emails to add. + /// + /// - returns: Through the response callback, the caller will receive a `Team.AddSecondaryEmailsResult` object on + /// success or a `Team.AddSecondaryEmailsError` object on failure. + @objc + @discardableResult public func membersSecondaryEmailsAdd(newSecondaryEmails: [DBXTeamUserSecondaryEmailsArg]) + -> DBXTeamMembersSecondaryEmailsAddRpcRequest { + let swift = swift.membersSecondaryEmailsAdd(newSecondaryEmails: newSecondaryEmails.map(\.swift)) + return DBXTeamMembersSecondaryEmailsAddRpcRequest(swift: swift) + } + + /// Delete secondary emails from users Permission : Team member management. Users will be notified of deletions of + /// verified secondary emails at both the secondary email and their primary email. + /// + /// - scope: members.write + /// + /// - parameter emailsToDelete: List of users and their secondary emails to delete. + /// + /// - returns: Through the response callback, the caller will receive a `Team.DeleteSecondaryEmailsResult` object on + /// success or a `Void` object on failure. + @objc + @discardableResult public func membersSecondaryEmailsDelete(emailsToDelete: [DBXTeamUserSecondaryEmailsArg]) + -> DBXTeamMembersSecondaryEmailsDeleteRpcRequest { + let swift = swift.membersSecondaryEmailsDelete(emailsToDelete: emailsToDelete.map(\.swift)) + return DBXTeamMembersSecondaryEmailsDeleteRpcRequest(swift: swift) + } + + /// Resend secondary email verification emails. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter emailsToResend: List of users and secondary emails to resend verification emails to. + /// + /// - returns: Through the response callback, the caller will receive a `Team.ResendVerificationEmailResult` object + /// on success or a `Void` object on failure. + @objc + @discardableResult public func membersSecondaryEmailsResendVerificationEmails(emailsToResend: [DBXTeamUserSecondaryEmailsArg]) + -> DBXTeamMembersSecondaryEmailsResendVerificationEmailsRpcRequest { + let swift = swift.membersSecondaryEmailsResendVerificationEmails(emailsToResend: emailsToResend.map(\.swift)) + return DBXTeamMembersSecondaryEmailsResendVerificationEmailsRpcRequest(swift: swift) + } + + /// Sends welcome email to pending team member. Permission : Team member management Exactly one of team_member_id, + /// email, or external_id must be provided to identify the user account. No-op if team member is not pending. + /// + /// - scope: members.write + /// + /// - parameter userSelectorArg: Argument for selecting a single user, either by team_member_id, external_id or + /// email. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.MembersSendWelcomeError` object on failure. + @objc + @discardableResult public func membersSendWelcomeEmail(userSelectorArg: DBXTeamUserSelectorArg) -> DBXTeamMembersSendWelcomeEmailRpcRequest { + let swift = swift.membersSendWelcomeEmail(userSelectorArg: userSelectorArg.swift) + return DBXTeamMembersSendWelcomeEmailRpcRequest(swift: swift) + } + + /// Updates a team member's permissions. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of user whose role will be set. + /// - parameter newRoles: The new roles for the member. Send empty list to make user member only. For now, only up + /// to one role is allowed. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersSetPermissions2Result` object + /// on success or a `Team.MembersSetPermissions2Error` object on failure. + @objc + @discardableResult public func membersSetAdminPermissionsV2( + user: DBXTeamUserSelectorArg, + newRoles: [String]? + ) -> DBXTeamMembersSetAdminPermissionsRpcRequestV2 { + let swift = swift.membersSetAdminPermissionsV2(user: user.swift, newRoles: newRoles) + return DBXTeamMembersSetAdminPermissionsRpcRequestV2(swift: swift) + } + + /// Updates a team member's permissions. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersSetPermissions2Result` object + /// on success or a `Team.MembersSetPermissions2Error` object on failure. + @objc + @discardableResult public func membersSetAdminPermissionsV2(user: DBXTeamUserSelectorArg) -> DBXTeamMembersSetAdminPermissionsRpcRequestV2 { + let swift = swift.membersSetAdminPermissionsV2(user: user.swift) + return DBXTeamMembersSetAdminPermissionsRpcRequestV2(swift: swift) + } + + /// Updates a team member's permissions. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of user whose role will be set. + /// - parameter newRole: The new role of the member. + /// + /// - returns: Through the response callback, the caller will receive a `Team.MembersSetPermissionsResult` object on + /// success or a `Team.MembersSetPermissionsError` object on failure. + @objc + @discardableResult public func membersSetAdminPermissions( + user: DBXTeamUserSelectorArg, + newRole: DBXTeamAdminTier + ) -> DBXTeamMembersSetAdminPermissionsRpcRequest { + let swift = swift.membersSetAdminPermissions(user: user.swift, newRole: newRole.swift) + return DBXTeamMembersSetAdminPermissionsRpcRequest(swift: swift) + } + + /// Updates a team member's profile. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of user whose profile will be set. + /// - parameter newEmail: New email for member. + /// - parameter newExternalId: New external ID for member. + /// - parameter newGivenName: New given name for member. + /// - parameter newSurname: New surname for member. + /// - parameter newPersistentId: New persistent ID. This field only available to teams using persistent ID SAML + /// configuration. + /// - parameter newIsDirectoryRestricted: New value for whether the user is a directory restricted user. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on + /// success or a `Team.MembersSetProfileError` object on failure. + @objc + @discardableResult public func membersSetProfileV2( + user: DBXTeamUserSelectorArg, + newEmail: String?, + newExternalId: String?, + newGivenName: String?, + newSurname: String?, + newPersistentId: String?, + newIsDirectoryRestricted: NSNumber? + ) -> DBXTeamMembersSetProfileRpcRequestV2 { + let swift = swift.membersSetProfileV2( + user: user.swift, + newEmail: newEmail, + newExternalId: newExternalId, + newGivenName: newGivenName, + newSurname: newSurname, + newPersistentId: newPersistentId, + newIsDirectoryRestricted: newIsDirectoryRestricted?.boolValue + ) + return DBXTeamMembersSetProfileRpcRequestV2(swift: swift) + } + + /// Updates a team member's profile. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on + /// success or a `Team.MembersSetProfileError` object on failure. + @objc + @discardableResult public func membersSetProfileV2(user: DBXTeamUserSelectorArg) -> DBXTeamMembersSetProfileRpcRequestV2 { + let swift = swift.membersSetProfileV2(user: user.swift) + return DBXTeamMembersSetProfileRpcRequestV2(swift: swift) + } + + /// Updates a team member's profile. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of user whose profile will be set. + /// - parameter newEmail: New email for member. + /// - parameter newExternalId: New external ID for member. + /// - parameter newGivenName: New given name for member. + /// - parameter newSurname: New surname for member. + /// - parameter newPersistentId: New persistent ID. This field only available to teams using persistent ID SAML + /// configuration. + /// - parameter newIsDirectoryRestricted: New value for whether the user is a directory restricted user. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or a + /// `Team.MembersSetProfileError` object on failure. + @objc + @discardableResult public func membersSetProfile( + user: DBXTeamUserSelectorArg, + newEmail: String?, + newExternalId: String?, + newGivenName: String?, + newSurname: String?, + newPersistentId: String?, + newIsDirectoryRestricted: NSNumber? + ) -> DBXTeamMembersSetProfileRpcRequest { + let swift = swift.membersSetProfile( + user: user.swift, + newEmail: newEmail, + newExternalId: newExternalId, + newGivenName: newGivenName, + newSurname: newSurname, + newPersistentId: newPersistentId, + newIsDirectoryRestricted: newIsDirectoryRestricted?.boolValue + ) + return DBXTeamMembersSetProfileRpcRequest(swift: swift) + } + + /// Updates a team member's profile. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or a + /// `Team.MembersSetProfileError` object on failure. + @objc + @discardableResult public func membersSetProfile(user: DBXTeamUserSelectorArg) -> DBXTeamMembersSetProfileRpcRequest { + let swift = swift.membersSetProfile(user: user.swift) + return DBXTeamMembersSetProfileRpcRequest(swift: swift) + } + + /// Updates a team member's profile photo. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of the user whose profile photo will be set. + /// - parameter photo: Image to set as the member's new profile photo. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfoV2Result` object on + /// success or a `Team.MembersSetProfilePhotoError` object on failure. + @objc + @discardableResult public func membersSetProfilePhotoV2( + user: DBXTeamUserSelectorArg, + photo: DBXAccountPhotoSourceArg + ) -> DBXTeamMembersSetProfilePhotoRpcRequestV2 { + let swift = swift.membersSetProfilePhotoV2(user: user.swift, photo: photo.swift) + return DBXTeamMembersSetProfilePhotoRpcRequestV2(swift: swift) + } + + /// Updates a team member's profile photo. Permission : Team member management. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of the user whose profile photo will be set. + /// - parameter photo: Image to set as the member's new profile photo. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamMemberInfo` object on success or a + /// `Team.MembersSetProfilePhotoError` object on failure. + @objc + @discardableResult public func membersSetProfilePhoto( + user: DBXTeamUserSelectorArg, + photo: DBXAccountPhotoSourceArg + ) -> DBXTeamMembersSetProfilePhotoRpcRequest { + let swift = swift.membersSetProfilePhoto(user: user.swift, photo: photo.swift) + return DBXTeamMembersSetProfilePhotoRpcRequest(swift: swift) + } + + /// Suspend a member from a team. Permission : Team member management Exactly one of team_member_id, email, or + /// external_id must be provided to identify the user account. + /// + /// - scope: members.write + /// + /// - parameter wipeData: If provided, controls if the user's data will be deleted on their linked devices. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.MembersSuspendError` object on failure. + @objc + @discardableResult public func membersSuspend(user: DBXTeamUserSelectorArg, wipeData: NSNumber) -> DBXTeamMembersSuspendRpcRequest { + let swift = swift.membersSuspend(user: user.swift, wipeData: wipeData.boolValue) + return DBXTeamMembersSuspendRpcRequest(swift: swift) + } + + /// Suspend a member from a team. Permission : Team member management Exactly one of team_member_id, email, or + /// external_id must be provided to identify the user account. + /// + /// - scope: members.write + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.MembersSuspendError` object on failure. + @objc + @discardableResult public func membersSuspend(user: DBXTeamUserSelectorArg) -> DBXTeamMembersSuspendRpcRequest { + let swift = swift.membersSuspend(user: user.swift) + return DBXTeamMembersSuspendRpcRequest(swift: swift) + } + + /// Unsuspend a member from a team. Permission : Team member management Exactly one of team_member_id, email, or + /// external_id must be provided to identify the user account. + /// + /// - scope: members.write + /// + /// - parameter user: Identity of user to unsuspend. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.MembersUnsuspendError` object on failure. + @objc + @discardableResult public func membersUnsuspend(user: DBXTeamUserSelectorArg) -> DBXTeamMembersUnsuspendRpcRequest { + let swift = swift.membersUnsuspend(user: user.swift) + return DBXTeamMembersUnsuspendRpcRequest(swift: swift) + } + + /// Returns a list of all team-accessible namespaces. This list includes team folders, shared folders containing + /// team members, team members' home namespaces, and team members' app folders. Home namespaces and app folders + /// are always owned by this team or members of the team, but shared folders may be owned by other users or + /// other teams. Duplicates may occur in the list. + /// + /// - scope: team_data.member + /// + /// - parameter limit: Specifying a value here has no effect. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamNamespacesListResult` object on + /// success or a `Team.TeamNamespacesListError` object on failure. + @objc + @discardableResult public func namespacesList(limit: NSNumber) -> DBXTeamNamespacesListRpcRequest { + let swift = swift.namespacesList(limit: limit.uint32Value) + return DBXTeamNamespacesListRpcRequest(swift: swift) + } + + /// Returns a list of all team-accessible namespaces. This list includes team folders, shared folders containing + /// team members, team members' home namespaces, and team members' app folders. Home namespaces and app folders + /// are always owned by this team or members of the team, but shared folders may be owned by other users or + /// other teams. Duplicates may occur in the list. + /// + /// - scope: team_data.member + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamNamespacesListResult` object on + /// success or a `Team.TeamNamespacesListError` object on failure. + @objc + @discardableResult public func namespacesList() -> DBXTeamNamespacesListRpcRequest { + let swift = swift.namespacesList() + return DBXTeamNamespacesListRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from namespacesList, use this to paginate through all team-accessible + /// namespaces. Duplicates may occur in the list. + /// + /// - scope: team_data.member + /// + /// - parameter cursor: Indicates from what point to get the next set of team-accessible namespaces. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamNamespacesListResult` object on + /// success or a `Team.TeamNamespacesListContinueError` object on failure. + @objc + @discardableResult public func namespacesListContinue(cursor: String) -> DBXTeamNamespacesListContinueRpcRequest { + let swift = swift.namespacesListContinue(cursor: cursor) + return DBXTeamNamespacesListContinueRpcRequest(swift: swift) + } + + /// Endpoint adds Approve List entries. Changes are effective immediately. Changes are committed in transaction. In + /// case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails + /// (RFC-5322/822) are accepted. Added entries cannot overflow limit of 10000 entries per team. Maximum 100 + /// entries per call is allowed. + /// + /// - scope: team_info.write + /// + /// - parameter domains: List of domains represented by valid string representation (RFC-1034/5). + /// - parameter emails: List of emails represented by valid string representation (RFC-5322/822). + /// + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistAddResponse` object on + /// success or a `Team.SharingAllowlistAddError` object on failure. + @objc + @discardableResult public func sharingAllowlistAdd(domains: [String]?, emails: [String]?) -> DBXTeamSharingAllowlistAddRpcRequest { + let swift = swift.sharingAllowlistAdd(domains: domains, emails: emails) + return DBXTeamSharingAllowlistAddRpcRequest(swift: swift) + } + + /// Endpoint adds Approve List entries. Changes are effective immediately. Changes are committed in transaction. In + /// case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails + /// (RFC-5322/822) are accepted. Added entries cannot overflow limit of 10000 entries per team. Maximum 100 + /// entries per call is allowed. + /// + /// - scope: team_info.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistAddResponse` object on + /// success or a `Team.SharingAllowlistAddError` object on failure. + @objc + @discardableResult public func sharingAllowlistAdd() -> DBXTeamSharingAllowlistAddRpcRequest { + let swift = swift.sharingAllowlistAdd() + return DBXTeamSharingAllowlistAddRpcRequest(swift: swift) + } + + /// Lists Approve List entries for given team, from newest to oldest, returning up to `limit` entries at a time. If + /// there are more than `limit` entries associated with the current team, more can be fetched by passing the + /// returned `cursor` to sharingAllowlistListContinue. + /// + /// - scope: team_info.read + /// + /// - parameter limit: The number of entries to fetch at one time. + /// + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistListResponse` object + /// on success or a `Team.SharingAllowlistListError` object on failure. + @objc + @discardableResult public func sharingAllowlistList(limit: NSNumber) -> DBXTeamSharingAllowlistListRpcRequest { + let swift = swift.sharingAllowlistList(limit: limit.uint32Value) + return DBXTeamSharingAllowlistListRpcRequest(swift: swift) + } + + /// Lists Approve List entries for given team, from newest to oldest, returning up to `limit` entries at a time. If + /// there are more than `limit` entries associated with the current team, more can be fetched by passing the + /// returned `cursor` to sharingAllowlistListContinue. + /// + /// - scope: team_info.read + /// + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistListResponse` object + /// on success or a `Team.SharingAllowlistListError` object on failure. + @objc + @discardableResult public func sharingAllowlistList() -> DBXTeamSharingAllowlistListRpcRequest { + let swift = swift.sharingAllowlistList() + return DBXTeamSharingAllowlistListRpcRequest(swift: swift) + } + + /// Lists entries associated with given team, starting from a the cursor. See sharingAllowlistList. + /// + /// - scope: team_info.read + /// + /// - parameter cursor: The cursor returned from a previous call to sharingAllowlistList or + /// sharingAllowlistListContinue. + /// + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistListResponse` object + /// on success or a `Team.SharingAllowlistListContinueError` object on failure. + @objc + @discardableResult public func sharingAllowlistListContinue(cursor: String) -> DBXTeamSharingAllowlistListContinueRpcRequest { + let swift = swift.sharingAllowlistListContinue(cursor: cursor) + return DBXTeamSharingAllowlistListContinueRpcRequest(swift: swift) + } + + /// Endpoint removes Approve List entries. Changes are effective immediately. Changes are committed in transaction. + /// In case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails + /// (RFC-5322/822) are accepted. Entries being removed have to be present on the list. Maximum 1000 entries per + /// call is allowed. + /// + /// - scope: team_info.write + /// + /// - parameter domains: List of domains represented by valid string representation (RFC-1034/5). + /// - parameter emails: List of emails represented by valid string representation (RFC-5322/822). + /// + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistRemoveResponse` object + /// on success or a `Team.SharingAllowlistRemoveError` object on failure. + @objc + @discardableResult public func sharingAllowlistRemove(domains: [String]?, emails: [String]?) -> DBXTeamSharingAllowlistRemoveRpcRequest { + let swift = swift.sharingAllowlistRemove(domains: domains, emails: emails) + return DBXTeamSharingAllowlistRemoveRpcRequest(swift: swift) + } + + /// Endpoint removes Approve List entries. Changes are effective immediately. Changes are committed in transaction. + /// In case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails + /// (RFC-5322/822) are accepted. Entries being removed have to be present on the list. Maximum 1000 entries per + /// call is allowed. + /// + /// - scope: team_info.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.SharingAllowlistRemoveResponse` object + /// on success or a `Team.SharingAllowlistRemoveError` object on failure. + @objc + @discardableResult public func sharingAllowlistRemove() -> DBXTeamSharingAllowlistRemoveRpcRequest { + let swift = swift.sharingAllowlistRemove() + return DBXTeamSharingAllowlistRemoveRpcRequest(swift: swift) + } + + /// Sets an archived team folder's status to active. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - parameter teamFolderId: The ID of the team folder. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// or a `Team.TeamFolderActivateError` object on failure. + @objc + @discardableResult public func teamFolderActivate(teamFolderId: String) -> DBXTeamTeamFolderActivateRpcRequest { + let swift = swift.teamFolderActivate(teamFolderId: teamFolderId) + return DBXTeamTeamFolderActivateRpcRequest(swift: swift) + } + + /// Sets an active team folder's status to archived and removes all folder and file members. This endpoint cannot be + /// used for teams that have a shared team space. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - parameter forceAsyncOff: Whether to force the archive to happen synchronously. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderArchiveLaunch` object on + /// success or a `Team.TeamFolderArchiveError` object on failure. + @objc + @discardableResult public func teamFolderArchive(teamFolderId: String, forceAsyncOff: NSNumber) -> DBXTeamTeamFolderArchiveRpcRequest { + let swift = swift.teamFolderArchive(teamFolderId: teamFolderId, forceAsyncOff: forceAsyncOff.boolValue) + return DBXTeamTeamFolderArchiveRpcRequest(swift: swift) + } + + /// Sets an active team folder's status to archived and removes all folder and file members. This endpoint cannot be + /// used for teams that have a shared team space. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderArchiveLaunch` object on + /// success or a `Team.TeamFolderArchiveError` object on failure. + @objc + @discardableResult public func teamFolderArchive(teamFolderId: String) -> DBXTeamTeamFolderArchiveRpcRequest { + let swift = swift.teamFolderArchive(teamFolderId: teamFolderId) + return DBXTeamTeamFolderArchiveRpcRequest(swift: swift) + } + + /// Returns the status of an asynchronous job for archiving a team folder. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - 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 `Team.TeamFolderArchiveJobStatus` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func teamFolderArchiveCheck(asyncJobId: String) -> DBXTeamTeamFolderArchiveCheckRpcRequest { + let swift = swift.teamFolderArchiveCheck(asyncJobId: asyncJobId) + return DBXTeamTeamFolderArchiveCheckRpcRequest(swift: swift) + } + + /// Creates a new, active, team folder with no members. This endpoint can only be used for teams that do not already + /// have a shared team space. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - parameter name: Name for the new team folder. + /// - parameter syncSetting: The sync setting to apply to this team folder. Only permitted if the team has team + /// selective sync enabled. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// or a `Team.TeamFolderCreateError` object on failure. + @objc + @discardableResult public func teamFolderCreate(name: String, syncSetting: DBXFilesSyncSettingArg?) -> DBXTeamTeamFolderCreateRpcRequest { + let swift = swift.teamFolderCreate(name: name, syncSetting: syncSetting?.swift) + return DBXTeamTeamFolderCreateRpcRequest(swift: swift) + } + + /// Creates a new, active, team folder with no members. This endpoint can only be used for teams that do not already + /// have a shared team space. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// or a `Team.TeamFolderCreateError` object on failure. + @objc + @discardableResult public func teamFolderCreate(name: String) -> DBXTeamTeamFolderCreateRpcRequest { + let swift = swift.teamFolderCreate(name: name) + return DBXTeamTeamFolderCreateRpcRequest(swift: swift) + } + + /// Retrieves metadata for team folders. Permission : Team member file access. + /// + /// - scope: team_data.content.read + /// + /// - parameter teamFolderIds: The list of team folder IDs. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object + /// on success or a `Void` object on failure. + @objc + @discardableResult public func teamFolderGetInfo(teamFolderIds: [String]) -> DBXTeamTeamFolderGetInfoRpcRequest { + let swift = swift.teamFolderGetInfo(teamFolderIds: teamFolderIds) + return DBXTeamTeamFolderGetInfoRpcRequest(swift: swift) + } + + /// Lists all team folders. Permission : Team member file access. + /// + /// - scope: team_data.content.read + /// + /// - parameter limit: The maximum number of results to return per request. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderListResult` object on + /// success or a `Team.TeamFolderListError` object on failure. + @objc + @discardableResult public func teamFolderList(limit: NSNumber) -> DBXTeamTeamFolderListRpcRequest { + let swift = swift.teamFolderList(limit: limit.uint32Value) + return DBXTeamTeamFolderListRpcRequest(swift: swift) + } + + /// Lists all team folders. Permission : Team member file access. + /// + /// - scope: team_data.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderListResult` object on + /// success or a `Team.TeamFolderListError` object on failure. + @objc + @discardableResult public func teamFolderList() -> DBXTeamTeamFolderListRpcRequest { + let swift = swift.teamFolderList() + return DBXTeamTeamFolderListRpcRequest(swift: swift) + } + + /// Once a cursor has been retrieved from teamFolderList, use this to paginate through all team folders. Permission + /// : Team member file access. + /// + /// - scope: team_data.content.read + /// + /// - parameter cursor: Indicates from what point to get the next set of team folders. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderListResult` object on + /// success or a `Team.TeamFolderListContinueError` object on failure. + @objc + @discardableResult public func teamFolderListContinue(cursor: String) -> DBXTeamTeamFolderListContinueRpcRequest { + let swift = swift.teamFolderListContinue(cursor: cursor) + return DBXTeamTeamFolderListContinueRpcRequest(swift: swift) + } + + /// Permanently deletes an archived team folder. This endpoint cannot be used for teams that have a shared team + /// space. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - parameter teamFolderId: The ID of the team folder. + /// + /// - returns: Through the response callback, the caller will receive a `Void` object on success or a + /// `Team.TeamFolderPermanentlyDeleteError` object on failure. + @objc + @discardableResult public func teamFolderPermanentlyDelete(teamFolderId: String) -> DBXTeamTeamFolderPermanentlyDeleteRpcRequest { + let swift = swift.teamFolderPermanentlyDelete(teamFolderId: teamFolderId) + return DBXTeamTeamFolderPermanentlyDeleteRpcRequest(swift: swift) + } + + /// Changes an active team folder's name. Permission : Team member file access. + /// + /// - scope: team_data.content.write + /// + /// - parameter name: New team folder name. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// or a `Team.TeamFolderRenameError` object on failure. + @objc + @discardableResult public func teamFolderRename(teamFolderId: String, name: String) -> DBXTeamTeamFolderRenameRpcRequest { + let swift = swift.teamFolderRename(teamFolderId: teamFolderId, name: name) + return DBXTeamTeamFolderRenameRpcRequest(swift: swift) + } + + /// Updates the sync settings on a team folder or its contents. Use of this endpoint requires that the team has + /// team selective sync enabled. + /// + /// - scope: team_data.content.write + /// + /// - parameter syncSetting: Sync setting to apply to the team folder itself. Only meaningful if the team folder is + /// not a shared team root. + /// - parameter contentSyncSettings: Sync settings to apply to contents of this team folder. + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// or a `Team.TeamFolderUpdateSyncSettingsError` object on failure. + @objc + @discardableResult public func teamFolderUpdateSyncSettings( + teamFolderId: String, + syncSetting: DBXFilesSyncSettingArg?, + contentSyncSettings: [DBXFilesContentSyncSettingArg]? + ) -> DBXTeamTeamFolderUpdateSyncSettingsRpcRequest { + let swift = swift.teamFolderUpdateSyncSettings( + teamFolderId: teamFolderId, + syncSetting: syncSetting?.swift, + contentSyncSettings: contentSyncSettings?.map(\.swift) + ) + return DBXTeamTeamFolderUpdateSyncSettingsRpcRequest(swift: swift) + } + + /// Updates the sync settings on a team folder or its contents. Use of this endpoint requires that the team has + /// team selective sync enabled. + /// + /// - scope: team_data.content.write + /// + /// - returns: Through the response callback, the caller will receive a `Team.TeamFolderMetadata` object on success + /// or a `Team.TeamFolderUpdateSyncSettingsError` object on failure. + @objc + @discardableResult public func teamFolderUpdateSyncSettings(teamFolderId: String) -> DBXTeamTeamFolderUpdateSyncSettingsRpcRequest { + let swift = swift.teamFolderUpdateSyncSettings(teamFolderId: teamFolderId) + return DBXTeamTeamFolderUpdateSyncSettingsRpcRequest(swift: swift) + } + + /// Returns the member profile of the admin who generated the team access token used to make the call. + /// + /// - scope: team_info.read + /// + /// + /// - returns: Through the response callback, the caller will receive a `Team.TokenGetAuthenticatedAdminResult` + /// object on success or a `Team.TokenGetAuthenticatedAdminError` object on failure. + @objc + @discardableResult public func tokenGetAuthenticatedAdmin() -> DBXTeamTokenGetAuthenticatedAdminRpcRequest { + let swift = swift.tokenGetAuthenticatedAdmin() + return DBXTeamTokenGetAuthenticatedAdminRpcRequest(swift: swift) + } +} + +@objc +public class DBXTeamDevicesListMemberDevicesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamListMemberDevicesResult?, DBXTeamListMemberDevicesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamListMemberDevicesResult?, DBXTeamListMemberDevicesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamListMemberDevicesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamListMemberDevicesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamListMemberDevicesResult? + if let swift = result { + objc = DBXTeamListMemberDevicesResult(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 DBXTeamDevicesListMembersDevicesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamListMembersDevicesResult?, DBXTeamListMembersDevicesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamListMembersDevicesResult?, DBXTeamListMembersDevicesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamListMembersDevicesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamListMembersDevicesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamListMembersDevicesResult? + if let swift = result { + objc = DBXTeamListMembersDevicesResult(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 DBXTeamDevicesListTeamDevicesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamListTeamDevicesResult?, DBXTeamListTeamDevicesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamListTeamDevicesResult?, DBXTeamListTeamDevicesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamListTeamDevicesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamListTeamDevicesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamListTeamDevicesResult? + if let swift = result { + objc = DBXTeamListTeamDevicesResult(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 DBXTeamDevicesRevokeDeviceSessionRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamRevokeDeviceSessionError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamRevokeDeviceSessionError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamRevokeDeviceSessionError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamRevokeDeviceSessionError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamDevicesRevokeDeviceSessionBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamRevokeDeviceSessionBatchResult?, DBXTeamRevokeDeviceSessionBatchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamRevokeDeviceSessionBatchResult?, DBXTeamRevokeDeviceSessionBatchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamRevokeDeviceSessionBatchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamRevokeDeviceSessionBatchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamRevokeDeviceSessionBatchResult? + if let swift = result { + objc = DBXTeamRevokeDeviceSessionBatchResult(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 DBXTeamFeaturesGetValuesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamFeaturesGetValuesBatchResult?, DBXTeamFeaturesGetValuesBatchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamFeaturesGetValuesBatchResult?, DBXTeamFeaturesGetValuesBatchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamFeaturesGetValuesBatchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamFeaturesGetValuesBatchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamFeaturesGetValuesBatchResult? + if let swift = result { + objc = DBXTeamFeaturesGetValuesBatchResult(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 DBXTeamGetInfoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamGetInfoResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamGetInfoResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXTeamTeamGetInfoResult? + if let swift = result { + objc = DBXTeamTeamGetInfoResult(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 DBXTeamGroupsCreateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupFullInfo?, DBXTeamGroupCreateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupFullInfo?, DBXTeamGroupCreateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupCreateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupCreateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGroupFullInfo? + if let swift = result { + objc = DBXTeamGroupFullInfo(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 DBXTeamGroupsDeleteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXTeamGroupDeleteError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXTeamGroupDeleteError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupDeleteError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupDeleteError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAsyncLaunchEmptyResult? + if let swift = result { + objc = DBXAsyncLaunchEmptyResult.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 DBXTeamGroupsGetInfoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Team.GroupsGetInfoErrorSerializer> + + init(swift: RpcRequest, Team.GroupsGetInfoErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXTeamGroupsGetInfoItem]?, DBXTeamGroupsGetInfoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXTeamGroupsGetInfoItem]?, DBXTeamGroupsGetInfoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupsGetInfoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupsGetInfoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXTeamGroupsGetInfoItem]? + if let swift = result { + objc = swift.map { DBXTeamGroupsGetInfoItem.factory(swift: $0) } + } + 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 DBXTeamGroupsJobStatusGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncPollEmptyResult?, DBXTeamGroupsPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncPollEmptyResult?, DBXTeamGroupsPollError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupsPollError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupsPollError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAsyncPollEmptyResult? + if let swift = result { + objc = DBXAsyncPollEmptyResult.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 DBXTeamGroupsListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupsListResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupsListResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXTeamGroupsListResult? + if let swift = result { + objc = DBXTeamGroupsListResult(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 DBXTeamGroupsListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupsListResult?, DBXTeamGroupsListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupsListResult?, DBXTeamGroupsListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupsListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupsListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGroupsListResult? + if let swift = result { + objc = DBXTeamGroupsListResult(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 DBXTeamGroupsMembersAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupMembersChangeResult?, DBXTeamGroupMembersAddError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupMembersChangeResult?, DBXTeamGroupMembersAddError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupMembersAddError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupMembersAddError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGroupMembersChangeResult? + if let swift = result { + objc = DBXTeamGroupMembersChangeResult(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 DBXTeamGroupsMembersListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupsMembersListResult?, DBXTeamGroupSelectorError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupsMembersListResult?, DBXTeamGroupSelectorError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupSelectorError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupSelectorError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGroupsMembersListResult? + if let swift = result { + objc = DBXTeamGroupsMembersListResult(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 DBXTeamGroupsMembersListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupsMembersListResult?, DBXTeamGroupsMembersListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupsMembersListResult?, DBXTeamGroupsMembersListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupsMembersListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupsMembersListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGroupsMembersListResult? + if let swift = result { + objc = DBXTeamGroupsMembersListResult(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 DBXTeamGroupsMembersRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupMembersChangeResult?, DBXTeamGroupMembersRemoveError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupMembersChangeResult?, DBXTeamGroupMembersRemoveError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupMembersRemoveError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupMembersRemoveError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGroupMembersChangeResult? + if let swift = result { + objc = DBXTeamGroupMembersChangeResult(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 DBXTeamGroupsMembersSetAccessTypeRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Team.GroupMemberSetAccessTypeErrorSerializer> + + init(swift: RpcRequest, Team.GroupMemberSetAccessTypeErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXTeamGroupsGetInfoItem]?, DBXTeamGroupMemberSetAccessTypeError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXTeamGroupsGetInfoItem]?, DBXTeamGroupMemberSetAccessTypeError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupMemberSetAccessTypeError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupMemberSetAccessTypeError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXTeamGroupsGetInfoItem]? + if let swift = result { + objc = swift.map { DBXTeamGroupsGetInfoItem.factory(swift: $0) } + } + 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 DBXTeamGroupsUpdateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGroupFullInfo?, DBXTeamGroupUpdateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGroupFullInfo?, DBXTeamGroupUpdateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamGroupUpdateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamGroupUpdateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGroupFullInfo? + if let swift = result { + objc = DBXTeamGroupFullInfo(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 DBXTeamLegalHoldsCreatePolicyRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLegalHoldPolicy?, DBXTeamLegalHoldsPolicyCreateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLegalHoldPolicy?, DBXTeamLegalHoldsPolicyCreateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLegalHoldsPolicyCreateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLegalHoldsPolicyCreateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLegalHoldPolicy? + if let swift = result { + objc = DBXTeamLegalHoldPolicy(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 DBXTeamLegalHoldsGetPolicyRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLegalHoldPolicy?, DBXTeamLegalHoldsGetPolicyError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLegalHoldPolicy?, DBXTeamLegalHoldsGetPolicyError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLegalHoldsGetPolicyError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLegalHoldsGetPolicyError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLegalHoldPolicy? + if let swift = result { + objc = DBXTeamLegalHoldPolicy(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 DBXTeamLegalHoldsListHeldRevisionsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLegalHoldsListHeldRevisionResult?, DBXTeamLegalHoldsListHeldRevisionsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLegalHoldsListHeldRevisionResult?, DBXTeamLegalHoldsListHeldRevisionsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLegalHoldsListHeldRevisionsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLegalHoldsListHeldRevisionsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLegalHoldsListHeldRevisionResult? + if let swift = result { + objc = DBXTeamLegalHoldsListHeldRevisionResult(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 DBXTeamLegalHoldsListHeldRevisionsContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLegalHoldsListHeldRevisionResult?, DBXTeamLegalHoldsListHeldRevisionsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLegalHoldsListHeldRevisionResult?, DBXTeamLegalHoldsListHeldRevisionsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLegalHoldsListHeldRevisionsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLegalHoldsListHeldRevisionsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLegalHoldsListHeldRevisionResult? + if let swift = result { + objc = DBXTeamLegalHoldsListHeldRevisionResult(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 DBXTeamLegalHoldsListPoliciesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLegalHoldsListPoliciesResult?, DBXTeamLegalHoldsListPoliciesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLegalHoldsListPoliciesResult?, DBXTeamLegalHoldsListPoliciesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLegalHoldsListPoliciesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLegalHoldsListPoliciesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLegalHoldsListPoliciesResult? + if let swift = result { + objc = DBXTeamLegalHoldsListPoliciesResult(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 DBXTeamLegalHoldsReleasePolicyRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLegalHoldsPolicyReleaseError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLegalHoldsPolicyReleaseError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamLegalHoldsPolicyReleaseError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLegalHoldsPolicyReleaseError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamLegalHoldsUpdatePolicyRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamLegalHoldPolicy?, DBXTeamLegalHoldsPolicyUpdateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamLegalHoldPolicy?, DBXTeamLegalHoldsPolicyUpdateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamLegalHoldsPolicyUpdateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamLegalHoldsPolicyUpdateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamLegalHoldPolicy? + if let swift = result { + objc = DBXTeamLegalHoldPolicy(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 DBXTeamLinkedAppsListMemberLinkedAppsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamListMemberAppsResult?, DBXTeamListMemberAppsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamListMemberAppsResult?, DBXTeamListMemberAppsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamListMemberAppsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamListMemberAppsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamListMemberAppsResult? + if let swift = result { + objc = DBXTeamListMemberAppsResult(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 DBXTeamLinkedAppsListMembersLinkedAppsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamListMembersAppsResult?, DBXTeamListMembersAppsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamListMembersAppsResult?, DBXTeamListMembersAppsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamListMembersAppsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamListMembersAppsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamListMembersAppsResult? + if let swift = result { + objc = DBXTeamListMembersAppsResult(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 DBXTeamLinkedAppsListTeamLinkedAppsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamListTeamAppsResult?, DBXTeamListTeamAppsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamListTeamAppsResult?, DBXTeamListTeamAppsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamListTeamAppsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamListTeamAppsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamListTeamAppsResult? + if let swift = result { + objc = DBXTeamListTeamAppsResult(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 DBXTeamLinkedAppsRevokeLinkedAppRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamRevokeLinkedAppError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamRevokeLinkedAppError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamRevokeLinkedAppError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamRevokeLinkedAppError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamLinkedAppsRevokeLinkedAppBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamRevokeLinkedAppBatchResult?, DBXTeamRevokeLinkedAppBatchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamRevokeLinkedAppBatchResult?, DBXTeamRevokeLinkedAppBatchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamRevokeLinkedAppBatchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamRevokeLinkedAppBatchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamRevokeLinkedAppBatchResult? + if let swift = result { + objc = DBXTeamRevokeLinkedAppBatchResult(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 DBXTeamMemberSpaceLimitsExcludedUsersAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamExcludedUsersUpdateResult?, DBXTeamExcludedUsersUpdateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamExcludedUsersUpdateResult?, DBXTeamExcludedUsersUpdateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamExcludedUsersUpdateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamExcludedUsersUpdateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamExcludedUsersUpdateResult? + if let swift = result { + objc = DBXTeamExcludedUsersUpdateResult(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 DBXTeamMemberSpaceLimitsExcludedUsersListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamExcludedUsersListResult?, DBXTeamExcludedUsersListError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamExcludedUsersListResult?, DBXTeamExcludedUsersListError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamExcludedUsersListError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamExcludedUsersListError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamExcludedUsersListResult? + if let swift = result { + objc = DBXTeamExcludedUsersListResult(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 DBXTeamMemberSpaceLimitsExcludedUsersListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamExcludedUsersListResult?, DBXTeamExcludedUsersListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamExcludedUsersListResult?, DBXTeamExcludedUsersListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamExcludedUsersListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamExcludedUsersListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamExcludedUsersListResult? + if let swift = result { + objc = DBXTeamExcludedUsersListResult(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 DBXTeamMemberSpaceLimitsExcludedUsersRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamExcludedUsersUpdateResult?, DBXTeamExcludedUsersUpdateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamExcludedUsersUpdateResult?, DBXTeamExcludedUsersUpdateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamExcludedUsersUpdateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamExcludedUsersUpdateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamExcludedUsersUpdateResult? + if let swift = result { + objc = DBXTeamExcludedUsersUpdateResult(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 DBXTeamMemberSpaceLimitsGetCustomQuotaRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Team.CustomQuotaErrorSerializer> + + init(swift: RpcRequest, Team.CustomQuotaErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXTeamCustomQuotaResult]?, DBXTeamCustomQuotaError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXTeamCustomQuotaResult]?, DBXTeamCustomQuotaError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamCustomQuotaError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamCustomQuotaError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXTeamCustomQuotaResult]? + if let swift = result { + objc = swift.map { DBXTeamCustomQuotaResult.factory(swift: $0) } + } + 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 DBXTeamMemberSpaceLimitsRemoveCustomQuotaRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Team.CustomQuotaErrorSerializer> + + init(swift: RpcRequest, Team.CustomQuotaErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXTeamRemoveCustomQuotaResult]?, DBXTeamCustomQuotaError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXTeamRemoveCustomQuotaResult]?, DBXTeamCustomQuotaError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamCustomQuotaError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamCustomQuotaError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXTeamRemoveCustomQuotaResult]? + if let swift = result { + objc = swift.map { DBXTeamRemoveCustomQuotaResult.factory(swift: $0) } + } + 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 DBXTeamMemberSpaceLimitsSetCustomQuotaRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Team.SetCustomQuotaErrorSerializer> + + init(swift: RpcRequest, Team.SetCustomQuotaErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXTeamCustomQuotaResult]?, DBXTeamSetCustomQuotaError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXTeamCustomQuotaResult]?, DBXTeamSetCustomQuotaError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamSetCustomQuotaError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamSetCustomQuotaError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXTeamCustomQuotaResult]? + if let swift = result { + objc = swift.map { DBXTeamCustomQuotaResult.factory(swift: $0) } + } + 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 DBXTeamMembersAddRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersAddLaunchV2Result?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersAddLaunchV2Result?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXTeamMembersAddLaunchV2Result? + if let swift = result { + objc = DBXTeamMembersAddLaunchV2Result.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 DBXTeamMembersAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersAddLaunch?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersAddLaunch?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXTeamMembersAddLaunch? + if let swift = result { + objc = DBXTeamMembersAddLaunch.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 DBXTeamMembersAddJobStatusGetRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersAddJobStatusV2Result?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersAddJobStatusV2Result?, 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: DBXTeamMembersAddJobStatusV2Result? + if let swift = result { + objc = DBXTeamMembersAddJobStatusV2Result.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 DBXTeamMembersAddJobStatusGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersAddJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersAddJobStatus?, 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: DBXTeamMembersAddJobStatus? + if let swift = result { + objc = DBXTeamMembersAddJobStatus.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 DBXTeamMembersDeleteProfilePhotoRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamMemberInfoV2Result?, DBXTeamMembersDeleteProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamMemberInfoV2Result?, DBXTeamMembersDeleteProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersDeleteProfilePhotoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersDeleteProfilePhotoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamMemberInfoV2Result? + if let swift = result { + objc = DBXTeamTeamMemberInfoV2Result(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 DBXTeamMembersDeleteProfilePhotoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamMemberInfo?, DBXTeamMembersDeleteProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamMemberInfo?, DBXTeamMembersDeleteProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersDeleteProfilePhotoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersDeleteProfilePhotoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamMemberInfo? + if let swift = result { + objc = DBXTeamTeamMemberInfo(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 DBXTeamMembersGetAvailableTeamMemberRolesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersGetAvailableTeamMemberRolesResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersGetAvailableTeamMemberRolesResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXTeamMembersGetAvailableTeamMemberRolesResult? + if let swift = result { + objc = DBXTeamMembersGetAvailableTeamMemberRolesResult(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 DBXTeamMembersGetInfoRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersGetInfoV2Result?, DBXTeamMembersGetInfoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersGetInfoV2Result?, DBXTeamMembersGetInfoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersGetInfoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersGetInfoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamMembersGetInfoV2Result? + if let swift = result { + objc = DBXTeamMembersGetInfoV2Result(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 DBXTeamMembersGetInfoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Team.MembersGetInfoErrorSerializer> + + init(swift: RpcRequest, Team.MembersGetInfoErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXTeamMembersGetInfoItem]?, DBXTeamMembersGetInfoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXTeamMembersGetInfoItem]?, DBXTeamMembersGetInfoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersGetInfoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersGetInfoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXTeamMembersGetInfoItem]? + if let swift = result { + objc = swift.map { DBXTeamMembersGetInfoItem.factory(swift: $0) } + } + 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 DBXTeamMembersListRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersListV2Result?, DBXTeamMembersListError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersListV2Result?, DBXTeamMembersListError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersListError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersListError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamMembersListV2Result? + if let swift = result { + objc = DBXTeamMembersListV2Result(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 DBXTeamMembersListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersListResult?, DBXTeamMembersListError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersListResult?, DBXTeamMembersListError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersListError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersListError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamMembersListResult? + if let swift = result { + objc = DBXTeamMembersListResult(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 DBXTeamMembersListContinueRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersListV2Result?, DBXTeamMembersListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersListV2Result?, DBXTeamMembersListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamMembersListV2Result? + if let swift = result { + objc = DBXTeamMembersListV2Result(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 DBXTeamMembersListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersListResult?, DBXTeamMembersListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersListResult?, DBXTeamMembersListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamMembersListResult? + if let swift = result { + objc = DBXTeamMembersListResult(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 DBXTeamMembersMoveFormerMemberFilesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXTeamMembersTransferFormerMembersFilesError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXTeamMembersTransferFormerMembersFilesError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersTransferFormerMembersFilesError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersTransferFormerMembersFilesError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAsyncLaunchEmptyResult? + if let swift = result { + objc = DBXAsyncLaunchEmptyResult.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 DBXTeamMembersMoveFormerMemberFilesJobStatusCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncPollEmptyResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncPollEmptyResult?, 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: DBXAsyncPollEmptyResult? + if let swift = result { + objc = DBXAsyncPollEmptyResult.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 DBXTeamMembersRecoverRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersRecoverError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersRecoverError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamMembersRecoverError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersRecoverError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamMembersRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXTeamMembersRemoveError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchEmptyResult?, DBXTeamMembersRemoveError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersRemoveError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersRemoveError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXAsyncLaunchEmptyResult? + if let swift = result { + objc = DBXAsyncLaunchEmptyResult.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 DBXTeamMembersRemoveJobStatusGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncPollEmptyResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncPollEmptyResult?, 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: DBXAsyncPollEmptyResult? + if let swift = result { + objc = DBXAsyncPollEmptyResult.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 DBXTeamMembersSecondaryEmailsAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamAddSecondaryEmailsResult?, DBXTeamAddSecondaryEmailsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamAddSecondaryEmailsResult?, DBXTeamAddSecondaryEmailsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamAddSecondaryEmailsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamAddSecondaryEmailsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamAddSecondaryEmailsResult? + if let swift = result { + objc = DBXTeamAddSecondaryEmailsResult(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 DBXTeamMembersSecondaryEmailsDeleteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamDeleteSecondaryEmailsResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamDeleteSecondaryEmailsResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXTeamDeleteSecondaryEmailsResult? + if let swift = result { + objc = DBXTeamDeleteSecondaryEmailsResult(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 DBXTeamMembersSecondaryEmailsResendVerificationEmailsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamResendVerificationEmailResult?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamResendVerificationEmailResult?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXTeamResendVerificationEmailResult? + if let swift = result { + objc = DBXTeamResendVerificationEmailResult(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 DBXTeamMembersSendWelcomeEmailRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersSendWelcomeError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersSendWelcomeError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamMembersSendWelcomeError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSendWelcomeError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamMembersSetAdminPermissionsRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersSetPermissions2Result?, DBXTeamMembersSetPermissions2Error?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersSetPermissions2Result?, DBXTeamMembersSetPermissions2Error?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersSetPermissions2Error? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSetPermissions2Error(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamMembersSetPermissions2Result? + if let swift = result { + objc = DBXTeamMembersSetPermissions2Result(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 DBXTeamMembersSetAdminPermissionsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersSetPermissionsResult?, DBXTeamMembersSetPermissionsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersSetPermissionsResult?, DBXTeamMembersSetPermissionsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersSetPermissionsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSetPermissionsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamMembersSetPermissionsResult? + if let swift = result { + objc = DBXTeamMembersSetPermissionsResult(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 DBXTeamMembersSetProfileRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamMemberInfoV2Result?, DBXTeamMembersSetProfileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamMemberInfoV2Result?, DBXTeamMembersSetProfileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersSetProfileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSetProfileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamMemberInfoV2Result? + if let swift = result { + objc = DBXTeamTeamMemberInfoV2Result(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 DBXTeamMembersSetProfileRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamMemberInfo?, DBXTeamMembersSetProfileError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamMemberInfo?, DBXTeamMembersSetProfileError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersSetProfileError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSetProfileError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamMemberInfo? + if let swift = result { + objc = DBXTeamTeamMemberInfo(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 DBXTeamMembersSetProfilePhotoRpcRequestV2: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamMemberInfoV2Result?, DBXTeamMembersSetProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamMemberInfoV2Result?, DBXTeamMembersSetProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersSetProfilePhotoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSetProfilePhotoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamMemberInfoV2Result? + if let swift = result { + objc = DBXTeamTeamMemberInfoV2Result(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 DBXTeamMembersSetProfilePhotoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamMemberInfo?, DBXTeamMembersSetProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamMemberInfo?, DBXTeamMembersSetProfilePhotoError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamMembersSetProfilePhotoError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSetProfilePhotoError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamMemberInfo? + if let swift = result { + objc = DBXTeamTeamMemberInfo(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 DBXTeamMembersSuspendRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersSuspendError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersSuspendError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamMembersSuspendError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersSuspendError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamMembersUnsuspendRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamMembersUnsuspendError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamMembersUnsuspendError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamMembersUnsuspendError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamMembersUnsuspendError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamNamespacesListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamNamespacesListResult?, DBXTeamTeamNamespacesListError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamNamespacesListResult?, DBXTeamTeamNamespacesListError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamNamespacesListError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamNamespacesListError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamNamespacesListResult? + if let swift = result { + objc = DBXTeamTeamNamespacesListResult(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 DBXTeamNamespacesListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamNamespacesListResult?, DBXTeamTeamNamespacesListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamNamespacesListResult?, DBXTeamTeamNamespacesListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamNamespacesListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamNamespacesListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamNamespacesListResult? + if let swift = result { + objc = DBXTeamTeamNamespacesListResult(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 DBXTeamPropertiesTemplateAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesAddTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesAddTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesModifyTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesModifyTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesAddTemplateResult? + if let swift = result { + objc = DBXFilePropertiesAddTemplateResult(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 DBXTeamPropertiesTemplateGetRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesGetTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesGetTemplateResult? + if let swift = result { + objc = DBXFilePropertiesGetTemplateResult(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 DBXTeamPropertiesTemplateListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesListTemplateResult?, DBXFilePropertiesTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesListTemplateResult? + if let swift = result { + objc = DBXFilePropertiesListTemplateResult(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 DBXTeamPropertiesTemplateUpdateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXFilePropertiesUpdateTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXFilePropertiesUpdateTemplateResult?, DBXFilePropertiesModifyTemplateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXFilePropertiesModifyTemplateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXFilePropertiesModifyTemplateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXFilePropertiesUpdateTemplateResult? + if let swift = result { + objc = DBXFilePropertiesUpdateTemplateResult(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 DBXTeamReportsGetActivityRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGetActivityReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGetActivityReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamDateRangeError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamDateRangeError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGetActivityReport? + if let swift = result { + objc = DBXTeamGetActivityReport(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 DBXTeamReportsGetDevicesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGetDevicesReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGetDevicesReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamDateRangeError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamDateRangeError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGetDevicesReport? + if let swift = result { + objc = DBXTeamGetDevicesReport(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 DBXTeamReportsGetMembershipRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGetMembershipReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGetMembershipReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamDateRangeError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamDateRangeError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGetMembershipReport? + if let swift = result { + objc = DBXTeamGetMembershipReport(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 DBXTeamReportsGetStorageRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamGetStorageReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamGetStorageReport?, DBXTeamDateRangeError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamDateRangeError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamDateRangeError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamGetStorageReport? + if let swift = result { + objc = DBXTeamGetStorageReport(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 DBXTeamSharingAllowlistAddRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamSharingAllowlistAddResponse?, DBXTeamSharingAllowlistAddError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamSharingAllowlistAddResponse?, DBXTeamSharingAllowlistAddError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamSharingAllowlistAddError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamSharingAllowlistAddError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamSharingAllowlistAddResponse? + if let swift = result { + objc = DBXTeamSharingAllowlistAddResponse(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 DBXTeamSharingAllowlistListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamSharingAllowlistListResponse?, DBXTeamSharingAllowlistListError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamSharingAllowlistListResponse?, DBXTeamSharingAllowlistListError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamSharingAllowlistListError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamSharingAllowlistListError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamSharingAllowlistListResponse? + if let swift = result { + objc = DBXTeamSharingAllowlistListResponse(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 DBXTeamSharingAllowlistListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamSharingAllowlistListResponse?, DBXTeamSharingAllowlistListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamSharingAllowlistListResponse?, DBXTeamSharingAllowlistListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamSharingAllowlistListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamSharingAllowlistListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamSharingAllowlistListResponse? + if let swift = result { + objc = DBXTeamSharingAllowlistListResponse(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 DBXTeamSharingAllowlistRemoveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamSharingAllowlistRemoveResponse?, DBXTeamSharingAllowlistRemoveError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamSharingAllowlistRemoveResponse?, DBXTeamSharingAllowlistRemoveError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamSharingAllowlistRemoveError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamSharingAllowlistRemoveError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamSharingAllowlistRemoveResponse? + if let swift = result { + objc = DBXTeamSharingAllowlistRemoveResponse(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 DBXTeamTeamFolderActivateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderActivateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderActivateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamFolderActivateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderActivateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamFolderMetadata? + if let swift = result { + objc = DBXTeamTeamFolderMetadata(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 DBXTeamTeamFolderArchiveRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderArchiveLaunch?, DBXTeamTeamFolderArchiveError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderArchiveLaunch?, DBXTeamTeamFolderArchiveError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamFolderArchiveError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderArchiveError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamFolderArchiveLaunch? + if let swift = result { + objc = DBXTeamTeamFolderArchiveLaunch.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 DBXTeamTeamFolderArchiveCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderArchiveJobStatus?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderArchiveJobStatus?, 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: DBXTeamTeamFolderArchiveJobStatus? + if let swift = result { + objc = DBXTeamTeamFolderArchiveJobStatus.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 DBXTeamTeamFolderCreateRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderCreateError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderCreateError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamFolderCreateError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderCreateError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamFolderMetadata? + if let swift = result { + objc = DBXTeamTeamFolderMetadata(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 DBXTeamTeamFolderGetInfoRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, VoidSerializer> + + init(swift: RpcRequest, VoidSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXTeamTeamFolderGetInfoItem]?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXTeamTeamFolderGetInfoItem]?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: [DBXTeamTeamFolderGetInfoItem]? + if let swift = result { + objc = swift.map { DBXTeamTeamFolderGetInfoItem.factory(swift: $0) } + } + 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 DBXTeamTeamFolderListRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderListResult?, DBXTeamTeamFolderListError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderListResult?, DBXTeamTeamFolderListError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamFolderListError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderListError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamFolderListResult? + if let swift = result { + objc = DBXTeamTeamFolderListResult(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 DBXTeamTeamFolderListContinueRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderListResult?, DBXTeamTeamFolderListContinueError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderListResult?, DBXTeamTeamFolderListContinueError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamFolderListContinueError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderListContinueError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamFolderListResult? + if let swift = result { + objc = DBXTeamTeamFolderListResult(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 DBXTeamTeamFolderPermanentlyDeleteRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderPermanentlyDeleteError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderPermanentlyDeleteError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { _, error in + var routeError: DBXTeamTeamFolderPermanentlyDeleteError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderPermanentlyDeleteError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + completionHandler(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 DBXTeamTeamFolderRenameRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderRenameError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderRenameError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamFolderRenameError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderRenameError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamFolderMetadata? + if let swift = result { + objc = DBXTeamTeamFolderMetadata(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 DBXTeamTeamFolderUpdateSyncSettingsRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderUpdateSyncSettingsError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTeamFolderMetadata?, DBXTeamTeamFolderUpdateSyncSettingsError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTeamFolderUpdateSyncSettingsError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTeamFolderUpdateSyncSettingsError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTeamFolderMetadata? + if let swift = result { + objc = DBXTeamTeamFolderMetadata(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 DBXTeamTokenGetAuthenticatedAdminRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXTeamTokenGetAuthenticatedAdminResult?, DBXTeamTokenGetAuthenticatedAdminError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXTeamTokenGetAuthenticatedAdminResult?, DBXTeamTokenGetAuthenticatedAdminError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXTeamTokenGetAuthenticatedAdminError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXTeamTokenGetAuthenticatedAdminError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXTeamTokenGetAuthenticatedAdminResult? + if let swift = result { + objc = DBXTeamTokenGetAuthenticatedAdminResult(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsers.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsers.swift new file mode 100644 index 000000000..3a98f666f --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsers.swift @@ -0,0 +1,962 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the users namespace +/// For Swift see users + +/// The amount of detail revealed about an account depends on the user being queried and the user making the query. +@objc +public class DBXUsersAccount: NSObject { + /// The user's unique Dropbox ID. + @objc + public var accountId: String { swift.accountId } + /// Details of a user's name. + @objc + public var name: DBXUsersName { DBXUsersName(swift: swift.name) } + /// The user's email address. Do not rely on this without checking the emailVerified field. Even then, it's + /// possible that the user has since lost access to their email. + @objc + public var email: String { swift.email } + /// Whether the user has verified their email address. + @objc + public var emailVerified: NSNumber { swift.emailVerified as NSNumber } + /// URL for the photo representing the user, if one is set. + @objc + public var profilePhotoUrl: String? { swift.profilePhotoUrl } + /// Whether the user has been disabled. + @objc + public var disabled: NSNumber { swift.disabled as NSNumber } + + @objc + public init(accountId: String, name: DBXUsersName, email: String, emailVerified: NSNumber, disabled: NSNumber, profilePhotoUrl: String?) { + self.swift = Users.Account( + accountId: accountId, + name: name.swift, + email: email, + emailVerified: emailVerified.boolValue, + disabled: disabled.boolValue, + profilePhotoUrl: profilePhotoUrl + ) + } + + let swift: Users.Account + + public init(swift: Users.Account) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Basic information about any account. +@objc +public class DBXUsersBasicAccount: DBXUsersAccount { + /// Whether this user is a teammate of the current user. If this account is the current user's account, then + /// this will be true. + @objc + public var isTeammate: NSNumber { subSwift.isTeammate as NSNumber } + /// The user's unique team member id. This field will only be present if the user is part of a team and + /// isTeammate is true. + @objc + public var teamMemberId: String? { subSwift.teamMemberId } + + @objc + public init( + accountId: String, + name: DBXUsersName, + email: String, + emailVerified: NSNumber, + disabled: NSNumber, + isTeammate: NSNumber, + profilePhotoUrl: String?, + teamMemberId: String? + ) { + let swift = Users.BasicAccount( + accountId: accountId, + name: name.swift, + email: email, + emailVerified: emailVerified.boolValue, + disabled: disabled.boolValue, + isTeammate: isTeammate.boolValue, + profilePhotoUrl: profilePhotoUrl, + teamMemberId: teamMemberId + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Users.BasicAccount + + public init(swift: Users.BasicAccount) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// The value for fileLocking in UserFeature. +@objc +public class DBXUsersFileLockingValue: NSObject { + let swift: Users.FileLockingValue + + public init(swift: Users.FileLockingValue) { + self.swift = swift + } + + public static func factory(swift: Users.FileLockingValue) -> DBXUsersFileLockingValue { + switch swift { + case .enabled(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXUsersFileLockingValueEnabled(arg) + case .other: + return DBXUsersFileLockingValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEnabled: DBXUsersFileLockingValueEnabled? { + self as? DBXUsersFileLockingValueEnabled + } + + @objc + public var asOther: DBXUsersFileLockingValueOther? { + self as? DBXUsersFileLockingValueOther + } +} + +/// When this value is True, the user can lock files in shared directories. When the value is False the user can +/// unlock the files they have locked or request to unlock files locked by others. +@objc +public class DBXUsersFileLockingValueEnabled: DBXUsersFileLockingValue { + @objc + public var enabled: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.enabled = arg + let swift = Users.FileLockingValue.enabled(arg.boolValue) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersFileLockingValueOther: DBXUsersFileLockingValue { + @objc + public init() { + let swift = Users.FileLockingValue.other + super.init(swift: swift) + } +} + +/// Detailed information about the current user's account. +@objc +public class DBXUsersFullAccount: DBXUsersAccount { + /// The user's two-letter country code, if available. Country codes are based on ISO 3166-1 + /// http://en.wikipedia.org/wiki/ISO_3166-1. + @objc + public var country: String? { subSwift.country } + /// The language that the user specified. Locale tags will be IETF language tags + /// http://en.wikipedia.org/wiki/IETF_language_tag. + @objc + public var locale: String { subSwift.locale } + /// The user's referral link https://www.dropbox.com/referrals. + @objc + public var referralLink: String { subSwift.referralLink } + /// If this account is a member of a team, information about that team. + @objc + public var team: DBXUsersFullTeam? { guard let swift = subSwift.team else { return nil } + return DBXUsersFullTeam(swift: swift) + } + + /// This account's unique team member id. This field will only be present if team is present. + @objc + public var teamMemberId: String? { subSwift.teamMemberId } + /// Whether the user has a personal and work account. If the current account is personal, then team will always + /// be null, but isPaired will indicate if a work account is linked. + @objc + public var isPaired: NSNumber { subSwift.isPaired as NSNumber } + /// What type of account this user has. + @objc + public var accountType: DBXUsersCommonAccountType { DBXUsersCommonAccountType(swift: subSwift.accountType) } + /// The root info for this account. + @objc + public var rootInfo: DBXCommonRootInfo { DBXCommonRootInfo(swift: subSwift.rootInfo) } + + @objc + public init( + accountId: String, + name: DBXUsersName, + email: String, + emailVerified: NSNumber, + disabled: NSNumber, + locale: String, + referralLink: String, + isPaired: NSNumber, + accountType: DBXUsersCommonAccountType, + rootInfo: DBXCommonRootInfo, + profilePhotoUrl: String?, + country: String?, + team: DBXUsersFullTeam?, + teamMemberId: String? + ) { + let swift = Users.FullAccount( + accountId: accountId, + name: name.swift, + email: email, + emailVerified: emailVerified.boolValue, + disabled: disabled.boolValue, + locale: locale, + referralLink: referralLink, + isPaired: isPaired.boolValue, + accountType: accountType.swift, + rootInfo: rootInfo.swift, + profilePhotoUrl: profilePhotoUrl, + country: country, + team: team?.subSwift, + teamMemberId: teamMemberId + ) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Users.FullAccount + + public init(swift: Users.FullAccount) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Information about a team. +@objc +public class DBXUsersTeam: NSObject { + /// The team's unique ID. + @objc + public var id: String { swift.id } + /// The name of the team. + @objc + public var name: String { swift.name } + + @objc + public init(id: String, name: String) { + self.swift = Users.Team(id: id, name: name) + } + + let swift: Users.Team + + public init(swift: Users.Team) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Detailed information about a team. +@objc +public class DBXUsersFullTeam: DBXUsersTeam { + /// Team policies governing sharing. + @objc + public var sharingPolicies: DBXTeamPoliciesTeamSharingPolicies { DBXTeamPoliciesTeamSharingPolicies(swift: subSwift.sharingPolicies) } + /// Team policy governing the use of the Office Add-In. + @objc + public var officeAddinPolicy: DBXTeamPoliciesOfficeAddInPolicy { DBXTeamPoliciesOfficeAddInPolicy(swift: subSwift.officeAddinPolicy) } + + @objc + public init(id: String, name: String, sharingPolicies: DBXTeamPoliciesTeamSharingPolicies, officeAddinPolicy: DBXTeamPoliciesOfficeAddInPolicy) { + let swift = Users.FullTeam(id: id, name: name, sharingPolicies: sharingPolicies.swift, officeAddinPolicy: officeAddinPolicy.swift) + self.subSwift = swift + super.init(swift: swift) + } + + let subSwift: Users.FullTeam + + public init(swift: Users.FullTeam) { + self.subSwift = swift + super.init(swift: swift) + } + + @objc + public override var description: String { subSwift.description } +} + +/// Objective-C compatible GetAccountArg struct +@objc +public class DBXUsersGetAccountArg: NSObject { + /// A user's account identifier. + @objc + public var accountId: String { swift.accountId } + + @objc + public init(accountId: String) { + self.swift = Users.GetAccountArg(accountId: accountId) + } + + let swift: Users.GetAccountArg + + public init(swift: Users.GetAccountArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetAccountBatchArg struct +@objc +public class DBXUsersGetAccountBatchArg: NSObject { + /// List of user account identifiers. Should not contain any duplicate account IDs. + @objc + public var accountIds: [String] { swift.accountIds } + + @objc + public init(accountIds: [String]) { + self.swift = Users.GetAccountBatchArg(accountIds: accountIds) + } + + let swift: Users.GetAccountBatchArg + + public init(swift: Users.GetAccountBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible GetAccountBatchError union +@objc +public class DBXUsersGetAccountBatchError: NSObject { + let swift: Users.GetAccountBatchError + + public init(swift: Users.GetAccountBatchError) { + self.swift = swift + } + + public static func factory(swift: Users.GetAccountBatchError) -> DBXUsersGetAccountBatchError { + switch swift { + case .noAccount(let swiftArg): + let arg = swiftArg + return DBXUsersGetAccountBatchErrorNoAccount(arg) + case .other: + return DBXUsersGetAccountBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNoAccount: DBXUsersGetAccountBatchErrorNoAccount? { + self as? DBXUsersGetAccountBatchErrorNoAccount + } + + @objc + public var asOther: DBXUsersGetAccountBatchErrorOther? { + self as? DBXUsersGetAccountBatchErrorOther + } +} + +/// The value is an account ID specified in accountIds in GetAccountBatchArg that does not exist. +@objc +public class DBXUsersGetAccountBatchErrorNoAccount: DBXUsersGetAccountBatchError { + @objc + public var noAccount: String + + @objc + public init(_ arg: String) { + self.noAccount = arg + let swift = Users.GetAccountBatchError.noAccount(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersGetAccountBatchErrorOther: DBXUsersGetAccountBatchError { + @objc + public init() { + let swift = Users.GetAccountBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetAccountError union +@objc +public class DBXUsersGetAccountError: NSObject { + let swift: Users.GetAccountError + + public init(swift: Users.GetAccountError) { + self.swift = swift + } + + public static func factory(swift: Users.GetAccountError) -> DBXUsersGetAccountError { + switch swift { + case .noAccount: + return DBXUsersGetAccountErrorNoAccount() + case .other: + return DBXUsersGetAccountErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asNoAccount: DBXUsersGetAccountErrorNoAccount? { + self as? DBXUsersGetAccountErrorNoAccount + } + + @objc + public var asOther: DBXUsersGetAccountErrorOther? { + self as? DBXUsersGetAccountErrorOther + } +} + +/// The specified accountId in GetAccountArg does not exist. +@objc +public class DBXUsersGetAccountErrorNoAccount: DBXUsersGetAccountError { + @objc + public init() { + let swift = Users.GetAccountError.noAccount + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersGetAccountErrorOther: DBXUsersGetAccountError { + @objc + public init() { + let swift = Users.GetAccountError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible IndividualSpaceAllocation struct +@objc +public class DBXUsersIndividualSpaceAllocation: NSObject { + /// The total space allocated to the user's account (bytes). + @objc + public var allocated: NSNumber { swift.allocated as NSNumber } + + @objc + public init(allocated: NSNumber) { + self.swift = Users.IndividualSpaceAllocation(allocated: allocated.uint64Value) + } + + let swift: Users.IndividualSpaceAllocation + + public init(swift: Users.IndividualSpaceAllocation) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Representations for a person's name to assist with internationalization. +@objc +public class DBXUsersName: NSObject { + /// Also known as a first name. + @objc + public var givenName: String { swift.givenName } + /// Also known as a last name or family name. + @objc + public var surname: String { swift.surname } + /// Locale-dependent name. In the US, a person's familiar name is their givenName, but elsewhere, it could be + /// any combination of a person's givenName and surname. + @objc + public var familiarName: String { swift.familiarName } + /// A name that can be used directly to represent the name of a user's Dropbox account. + @objc + public var displayName: String { swift.displayName } + /// An abbreviated form of the person's name. Their initials in most locales. + @objc + public var abbreviatedName: String { swift.abbreviatedName } + + @objc + public init(givenName: String, surname: String, familiarName: String, displayName: String, abbreviatedName: String) { + self.swift = Users.Name(givenName: givenName, surname: surname, familiarName: familiarName, displayName: displayName, abbreviatedName: abbreviatedName) + } + + let swift: Users.Name + + public init(swift: Users.Name) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// The value for paperAsFiles in UserFeature. +@objc +public class DBXUsersPaperAsFilesValue: NSObject { + let swift: Users.PaperAsFilesValue + + public init(swift: Users.PaperAsFilesValue) { + self.swift = swift + } + + public static func factory(swift: Users.PaperAsFilesValue) -> DBXUsersPaperAsFilesValue { + switch swift { + case .enabled(let swiftArg): + let arg = NSNumber(value: swiftArg) + return DBXUsersPaperAsFilesValueEnabled(arg) + case .other: + return DBXUsersPaperAsFilesValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEnabled: DBXUsersPaperAsFilesValueEnabled? { + self as? DBXUsersPaperAsFilesValueEnabled + } + + @objc + public var asOther: DBXUsersPaperAsFilesValueOther? { + self as? DBXUsersPaperAsFilesValueOther + } +} + +/// When this value is true, the user's Paper docs are accessible in Dropbox with the .paper extension and must +/// be accessed via the /files endpoints. When this value is false, the user's Paper docs are stored +/// separate from Dropbox files and folders and should be accessed via the /paper endpoints. +@objc +public class DBXUsersPaperAsFilesValueEnabled: DBXUsersPaperAsFilesValue { + @objc + public var enabled: NSNumber + + @objc + public init(_ arg: NSNumber) { + self.enabled = arg + let swift = Users.PaperAsFilesValue.enabled(arg.boolValue) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersPaperAsFilesValueOther: DBXUsersPaperAsFilesValue { + @objc + public init() { + let swift = Users.PaperAsFilesValue.other + super.init(swift: swift) + } +} + +/// Space is allocated differently based on the type of account. +@objc +public class DBXUsersSpaceAllocation: NSObject { + let swift: Users.SpaceAllocation + + public init(swift: Users.SpaceAllocation) { + self.swift = swift + } + + public static func factory(swift: Users.SpaceAllocation) -> DBXUsersSpaceAllocation { + switch swift { + case .individual(let swiftArg): + let arg = DBXUsersIndividualSpaceAllocation(swift: swiftArg) + return DBXUsersSpaceAllocationIndividual(arg) + case .team(let swiftArg): + let arg = DBXUsersTeamSpaceAllocation(swift: swiftArg) + return DBXUsersSpaceAllocationTeam(arg) + case .other: + return DBXUsersSpaceAllocationOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asIndividual: DBXUsersSpaceAllocationIndividual? { + self as? DBXUsersSpaceAllocationIndividual + } + + @objc + public var asTeam: DBXUsersSpaceAllocationTeam? { + self as? DBXUsersSpaceAllocationTeam + } + + @objc + public var asOther: DBXUsersSpaceAllocationOther? { + self as? DBXUsersSpaceAllocationOther + } +} + +/// The user's space allocation applies only to their individual account. +@objc +public class DBXUsersSpaceAllocationIndividual: DBXUsersSpaceAllocation { + @objc + public var individual: DBXUsersIndividualSpaceAllocation + + @objc + public init(_ arg: DBXUsersIndividualSpaceAllocation) { + self.individual = arg + let swift = Users.SpaceAllocation.individual(arg.swift) + super.init(swift: swift) + } +} + +/// The user shares space with other members of their team. +@objc +public class DBXUsersSpaceAllocationTeam: DBXUsersSpaceAllocation { + @objc + public var team: DBXUsersTeamSpaceAllocation + + @objc + public init(_ arg: DBXUsersTeamSpaceAllocation) { + self.team = arg + let swift = Users.SpaceAllocation.team(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersSpaceAllocationOther: DBXUsersSpaceAllocation { + @objc + public init() { + let swift = Users.SpaceAllocation.other + super.init(swift: swift) + } +} + +/// Information about a user's space usage and quota. +@objc +public class DBXUsersSpaceUsage: NSObject { + /// The user's total space usage (bytes). + @objc + public var used: NSNumber { swift.used as NSNumber } + /// The user's space allocation. + @objc + public var allocation: DBXUsersSpaceAllocation { DBXUsersSpaceAllocation(swift: swift.allocation) } + + @objc + public init(used: NSNumber, allocation: DBXUsersSpaceAllocation) { + self.swift = Users.SpaceUsage(used: used.uint64Value, allocation: allocation.swift) + } + + let swift: Users.SpaceUsage + + public init(swift: Users.SpaceUsage) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamSpaceAllocation struct +@objc +public class DBXUsersTeamSpaceAllocation: NSObject { + /// The total space currently used by the user's team (bytes). + @objc + public var used: NSNumber { swift.used as NSNumber } + /// The total space allocated to the user's team (bytes). + @objc + public var allocated: NSNumber { swift.allocated as NSNumber } + /// The total space allocated to the user within its team allocated space (0 means that no restriction is + /// imposed on the user's quota within its team). + @objc + public var userWithinTeamSpaceAllocated: NSNumber { swift.userWithinTeamSpaceAllocated as NSNumber } + /// The type of the space limit imposed on the team member (off, alert_only, stop_sync). + @objc + public var userWithinTeamSpaceLimitType: DBXTeamCommonMemberSpaceLimitType { DBXTeamCommonMemberSpaceLimitType(swift: swift.userWithinTeamSpaceLimitType) } + /// An accurate cached calculation of a team member's total space usage (bytes). + @objc + public var userWithinTeamSpaceUsedCached: NSNumber { swift.userWithinTeamSpaceUsedCached as NSNumber } + + @objc + public init( + used: NSNumber, + allocated: NSNumber, + userWithinTeamSpaceAllocated: NSNumber, + userWithinTeamSpaceLimitType: DBXTeamCommonMemberSpaceLimitType, + userWithinTeamSpaceUsedCached: NSNumber + ) { + self.swift = Users.TeamSpaceAllocation( + used: used.uint64Value, + allocated: allocated.uint64Value, + userWithinTeamSpaceAllocated: userWithinTeamSpaceAllocated.uint64Value, + userWithinTeamSpaceLimitType: userWithinTeamSpaceLimitType.swift, + userWithinTeamSpaceUsedCached: userWithinTeamSpaceUsedCached.uint64Value + ) + } + + let swift: Users.TeamSpaceAllocation + + public init(swift: Users.TeamSpaceAllocation) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// A set of features that a Dropbox User account may have configured. +@objc +public class DBXUsersUserFeature: NSObject { + let swift: Users.UserFeature + + public init(swift: Users.UserFeature) { + self.swift = swift + } + + public static func factory(swift: Users.UserFeature) -> DBXUsersUserFeature { + switch swift { + case .paperAsFiles: + return DBXUsersUserFeaturePaperAsFiles() + case .fileLocking: + return DBXUsersUserFeatureFileLocking() + case .other: + return DBXUsersUserFeatureOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPaperAsFiles: DBXUsersUserFeaturePaperAsFiles? { + self as? DBXUsersUserFeaturePaperAsFiles + } + + @objc + public var asFileLocking: DBXUsersUserFeatureFileLocking? { + self as? DBXUsersUserFeatureFileLocking + } + + @objc + public var asOther: DBXUsersUserFeatureOther? { + self as? DBXUsersUserFeatureOther + } +} + +/// This feature contains information about how the user's Paper files are stored. +@objc +public class DBXUsersUserFeaturePaperAsFiles: DBXUsersUserFeature { + @objc + public init() { + let swift = Users.UserFeature.paperAsFiles + super.init(swift: swift) + } +} + +/// This feature allows users to lock files in order to restrict other users from editing them. +@objc +public class DBXUsersUserFeatureFileLocking: DBXUsersUserFeature { + @objc + public init() { + let swift = Users.UserFeature.fileLocking + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersUserFeatureOther: DBXUsersUserFeature { + @objc + public init() { + let swift = Users.UserFeature.other + super.init(swift: swift) + } +} + +/// Values that correspond to entries in UserFeature. +@objc +public class DBXUsersUserFeatureValue: NSObject { + let swift: Users.UserFeatureValue + + public init(swift: Users.UserFeatureValue) { + self.swift = swift + } + + public static func factory(swift: Users.UserFeatureValue) -> DBXUsersUserFeatureValue { + switch swift { + case .paperAsFiles(let swiftArg): + let arg = DBXUsersPaperAsFilesValue(swift: swiftArg) + return DBXUsersUserFeatureValuePaperAsFiles(arg) + case .fileLocking(let swiftArg): + let arg = DBXUsersFileLockingValue(swift: swiftArg) + return DBXUsersUserFeatureValueFileLocking(arg) + case .other: + return DBXUsersUserFeatureValueOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asPaperAsFiles: DBXUsersUserFeatureValuePaperAsFiles? { + self as? DBXUsersUserFeatureValuePaperAsFiles + } + + @objc + public var asFileLocking: DBXUsersUserFeatureValueFileLocking? { + self as? DBXUsersUserFeatureValueFileLocking + } + + @objc + public var asOther: DBXUsersUserFeatureValueOther? { + self as? DBXUsersUserFeatureValueOther + } +} + +/// An unspecified error. +@objc +public class DBXUsersUserFeatureValuePaperAsFiles: DBXUsersUserFeatureValue { + @objc + public var paperAsFiles: DBXUsersPaperAsFilesValue + + @objc + public init(_ arg: DBXUsersPaperAsFilesValue) { + self.paperAsFiles = arg + let swift = Users.UserFeatureValue.paperAsFiles(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersUserFeatureValueFileLocking: DBXUsersUserFeatureValue { + @objc + public var fileLocking: DBXUsersFileLockingValue + + @objc + public init(_ arg: DBXUsersFileLockingValue) { + self.fileLocking = arg + let swift = Users.UserFeatureValue.fileLocking(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersUserFeatureValueOther: DBXUsersUserFeatureValue { + @objc + public init() { + let swift = Users.UserFeatureValue.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UserFeaturesGetValuesBatchArg struct +@objc +public class DBXUsersUserFeaturesGetValuesBatchArg: NSObject { + /// A list of features in UserFeature. If the list is empty, this route will return + /// UserFeaturesGetValuesBatchError. + @objc + public var features: [DBXUsersUserFeature] { swift.features.map { DBXUsersUserFeature(swift: $0) } } + + @objc + public init(features: [DBXUsersUserFeature]) { + self.swift = Users.UserFeaturesGetValuesBatchArg(features: features.map(\.swift)) + } + + let swift: Users.UserFeaturesGetValuesBatchArg + + public init(swift: Users.UserFeaturesGetValuesBatchArg) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible UserFeaturesGetValuesBatchError union +@objc +public class DBXUsersUserFeaturesGetValuesBatchError: NSObject { + let swift: Users.UserFeaturesGetValuesBatchError + + public init(swift: Users.UserFeaturesGetValuesBatchError) { + self.swift = swift + } + + public static func factory(swift: Users.UserFeaturesGetValuesBatchError) -> DBXUsersUserFeaturesGetValuesBatchError { + switch swift { + case .emptyFeaturesList: + return DBXUsersUserFeaturesGetValuesBatchErrorEmptyFeaturesList() + case .other: + return DBXUsersUserFeaturesGetValuesBatchErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asEmptyFeaturesList: DBXUsersUserFeaturesGetValuesBatchErrorEmptyFeaturesList? { + self as? DBXUsersUserFeaturesGetValuesBatchErrorEmptyFeaturesList + } + + @objc + public var asOther: DBXUsersUserFeaturesGetValuesBatchErrorOther? { + self as? DBXUsersUserFeaturesGetValuesBatchErrorOther + } +} + +/// At least one UserFeature must be included in the UserFeaturesGetValuesBatchArg.features list. +@objc +public class DBXUsersUserFeaturesGetValuesBatchErrorEmptyFeaturesList: DBXUsersUserFeaturesGetValuesBatchError { + @objc + public init() { + let swift = Users.UserFeaturesGetValuesBatchError.emptyFeaturesList + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXUsersUserFeaturesGetValuesBatchErrorOther: DBXUsersUserFeaturesGetValuesBatchError { + @objc + public init() { + let swift = Users.UserFeaturesGetValuesBatchError.other + super.init(swift: swift) + } +} + +/// Objective-C compatible UserFeaturesGetValuesBatchResult struct +@objc +public class DBXUsersUserFeaturesGetValuesBatchResult: NSObject { + /// (no description) + @objc + public var values: [DBXUsersUserFeatureValue] { swift.values.map { DBXUsersUserFeatureValue(swift: $0) } } + + @objc + public init(values: [DBXUsersUserFeatureValue]) { + self.swift = Users.UserFeaturesGetValuesBatchResult(values: values.map(\.swift)) + } + + let swift: Users.UserFeaturesGetValuesBatchResult + + public init(swift: Users.UserFeaturesGetValuesBatchResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersCommon.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersCommon.swift new file mode 100644 index 000000000..0b8a36d72 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersCommon.swift @@ -0,0 +1,80 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible datatypes for the users_common namespace +/// For Swift see users_common + +/// What type of account this user has. +@objc +public class DBXUsersCommonAccountType: NSObject { + let swift: UsersCommon.AccountType + + public init(swift: UsersCommon.AccountType) { + self.swift = swift + } + + public static func factory(swift: UsersCommon.AccountType) -> DBXUsersCommonAccountType { + switch swift { + case .basic: + return DBXUsersCommonAccountTypeBasic() + case .pro: + return DBXUsersCommonAccountTypePro() + case .business: + return DBXUsersCommonAccountTypeBusiness() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asBasic: DBXUsersCommonAccountTypeBasic? { + self as? DBXUsersCommonAccountTypeBasic + } + + @objc + public var asPro: DBXUsersCommonAccountTypePro? { + self as? DBXUsersCommonAccountTypePro + } + + @objc + public var asBusiness: DBXUsersCommonAccountTypeBusiness? { + self as? DBXUsersCommonAccountTypeBusiness + } +} + +/// The basic account type. +@objc +public class DBXUsersCommonAccountTypeBasic: DBXUsersCommonAccountType { + @objc + public init() { + let swift = UsersCommon.AccountType.basic + super.init(swift: swift) + } +} + +/// The Dropbox Pro account type. +@objc +public class DBXUsersCommonAccountTypePro: DBXUsersCommonAccountType { + @objc + public init() { + let swift = UsersCommon.AccountType.pro + super.init(swift: swift) + } +} + +/// The Dropbox Business account type. +@objc +public class DBXUsersCommonAccountTypeBusiness: DBXUsersCommonAccountType { + @objc + public init() { + let swift = UsersCommon.AccountType.business + super.init(swift: swift) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersRoutes.swift new file mode 100644 index 000000000..9fd65a612 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXUsersRoutes.swift @@ -0,0 +1,403 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// +/// Auto-generated by Stone, do not modify. +/// + +import Foundation +import SwiftyDropbox + +/// Objective-C compatible routes for the users namespace +/// For Swift routes see UsersRoutes +@objc +public class DBXUsersRoutes: NSObject { + private let swift: UsersRoutes + init(swift: UsersRoutes) { + self.swift = swift + self.client = swift.client.objc + } + + public let client: DBXDropboxTransportClient + + /// Get a list of feature values that may be configured for the current account. + /// + /// - scope: account_info.read + /// + /// - parameter features: A list of features in UserFeature. If the list is empty, this route will return + /// UserFeaturesGetValuesBatchError. + /// + /// - returns: Through the response callback, the caller will receive a `Users.UserFeaturesGetValuesBatchResult` + /// object on success or a `Users.UserFeaturesGetValuesBatchError` object on failure. + @objc + @discardableResult public func featuresGetValues(features: [DBXUsersUserFeature]) -> DBXUsersFeaturesGetValuesRpcRequest { + let swift = swift.featuresGetValues(features: features.map(\.swift)) + return DBXUsersFeaturesGetValuesRpcRequest(swift: swift) + } + + /// Get information about a user's account. + /// + /// - scope: sharing.read + /// + /// - parameter accountId: A user's account identifier. + /// + /// - returns: Through the response callback, the caller will receive a `Users.BasicAccount` object on success or a + /// `Users.GetAccountError` object on failure. + @objc + @discardableResult public func getAccount(accountId: String) -> DBXUsersGetAccountRpcRequest { + let swift = swift.getAccount(accountId: accountId) + return DBXUsersGetAccountRpcRequest(swift: swift) + } + + /// Get information about multiple user accounts. At most 300 accounts may be queried per request. + /// + /// - scope: sharing.read + /// + /// - parameter accountIds: List of user account identifiers. Should not contain any duplicate account IDs. + /// + /// - returns: Through the response callback, the caller will receive a `Array` object on + /// success or a `Users.GetAccountBatchError` object on failure. + @objc + @discardableResult public func getAccountBatch(accountIds: [String]) -> DBXUsersGetAccountBatchRpcRequest { + let swift = swift.getAccountBatch(accountIds: accountIds) + return DBXUsersGetAccountBatchRpcRequest(swift: swift) + } + + /// Get information about the current user's account. + /// + /// - scope: account_info.read + /// + /// + /// - returns: Through the response callback, the caller will receive a `Users.FullAccount` object on success or a + /// `Void` object on failure. + @objc + @discardableResult public func getCurrentAccount() -> DBXUsersGetCurrentAccountRpcRequest { + let swift = swift.getCurrentAccount() + return DBXUsersGetCurrentAccountRpcRequest(swift: swift) + } + + /// Get the space usage information for the current user's account. + /// + /// - scope: account_info.read + /// + /// + /// - returns: Through the response callback, the caller will receive a `Users.SpaceUsage` object on success or a + /// `Void` object on failure. + @objc + @discardableResult public func getSpaceUsage() -> DBXUsersGetSpaceUsageRpcRequest { + let swift = swift.getSpaceUsage() + return DBXUsersGetSpaceUsageRpcRequest(swift: swift) + } +} + +@objc +public class DBXUsersFeaturesGetValuesRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXUsersUserFeaturesGetValuesBatchResult?, DBXUsersUserFeaturesGetValuesBatchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXUsersUserFeaturesGetValuesBatchResult?, DBXUsersUserFeaturesGetValuesBatchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXUsersUserFeaturesGetValuesBatchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXUsersUserFeaturesGetValuesBatchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXUsersUserFeaturesGetValuesBatchResult? + if let swift = result { + objc = DBXUsersUserFeaturesGetValuesBatchResult(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 DBXUsersGetAccountRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXUsersBasicAccount?, DBXUsersGetAccountError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXUsersBasicAccount?, DBXUsersGetAccountError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXUsersGetAccountError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXUsersGetAccountError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXUsersBasicAccount? + if let swift = result { + objc = DBXUsersBasicAccount(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 DBXUsersGetAccountBatchRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest, Users.GetAccountBatchErrorSerializer> + + init(swift: RpcRequest, Users.GetAccountBatchErrorSerializer>) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping ([DBXUsersBasicAccount]?, DBXUsersGetAccountBatchError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping ([DBXUsersBasicAccount]?, DBXUsersGetAccountBatchError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXUsersGetAccountBatchError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXUsersGetAccountBatchError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: [DBXUsersBasicAccount]? + if let swift = result { + objc = swift.map { DBXUsersBasicAccount(swift: $0) } + } + 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 DBXUsersGetCurrentAccountRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXUsersFullAccount?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXUsersFullAccount?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXUsersFullAccount? + if let swift = result { + objc = DBXUsersFullAccount(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 DBXUsersGetSpaceUsageRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXUsersSpaceUsage?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXUsersSpaceUsage?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXUsersSpaceUsage? + if let swift = result { + objc = DBXUsersSpaceUsage(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() + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCallError.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCallError.swift new file mode 100644 index 000000000..0896fd1de --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCallError.swift @@ -0,0 +1,265 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension CallError { + var objc: DBXCallError { + switch self { + case let .internalServerError(code, message, requestId): + return DBXInternalServerError(code: code, message: message, requestId: requestId, description: description) + case let .badInputError(message, requestId): + return DBXBadInputError(message: message, requestId: requestId, description: description) + case let .authError(error, localizedUserMessage, message, requestId): + return DBXAuthError(error: error, localizedUserMessage: localizedUserMessage, message: message, requestId: requestId, description: description) + case let .accessError(error, localizedUserMessage, message, requestId): + return DBXAccessError(error: error, localizedUserMessage: localizedUserMessage, message: message, requestId: requestId, description: description) + case let .httpError(code, message, requestId): + return DBXHttpError(code: code, message: message, requestId: requestId, description: description) + case let .routeError(_, localizedUserMessage, message, requestId): + return DBXRouteError(localizedUserMessage: localizedUserMessage, message: message, requestId: requestId, description: description) + case let .rateLimitError(error, localizedUserMessage, message, requestId): + return DBXRateLimitError(error: error, localizedUserMessage: localizedUserMessage, message: message, requestId: requestId, description: description) + case let .serializationError(error): + return DBXSerializationError(error: error, description: description) + case let .reconnectionError(error): + return DBXReconnectionError(error: error, description: description) + case let .clientError(error): + return DBXClientError(error: error, description: description) + } + } +} + +@objc +public class DBXLocalizedUserMessage: NSObject { + @objc + public let text: String + @objc + public let locale: String + + convenience init(localizedUserMessage: LocalizedUserMessage) { + self.init(text: localizedUserMessage.text, locale: localizedUserMessage.locale) + } + + init(text: String, locale: String) { + self.text = text + self.locale = locale + } +} + +@objc +public class DBXCallError: NSObject { + private let swiftDescription: String + + init(description: String) { + self.swiftDescription = description + } + + @objc + public override var description: String { + swiftDescription + } + + @objc + public var asInternalServerError: DBXInternalServerError? { + self as? DBXInternalServerError + } + + @objc + public var asBadInputError: DBXBadInputError? { + self as? DBXBadInputError + } + + @objc + public var asAuthError: DBXAuthError? { + self as? DBXAuthError + } + + @objc + public var asAccessError: DBXAccessError? { + self as? DBXAccessError + } + + @objc + public var asHttpError: DBXHttpError? { + self as? DBXHttpError + } + + @objc + public var asRouteError: DBXRouteError? { + self as? DBXRouteError + } + + @objc + public var asRateLimitError: DBXRateLimitError? { + self as? DBXRateLimitError + } + + @objc + public var asSerializationError: DBXSerializationError? { + self as? DBXSerializationError + } + + @objc + public var asReconnectionError: DBXReconnectionError? { + self as? DBXReconnectionError + } + + @objc + public var asClientError: DBXClientError? { + self as? DBXClientError + } +} + +@objc +public class DBXRequestError: DBXCallError { + @objc + public let message: String? + @objc + public let requestId: String? + + init(message: String?, requestId: String?, description: String) { + self.message = message + self.requestId = requestId + + super.init(description: description) + } +} + +@objc +public class DBXInternalServerError: DBXRequestError { + @objc + public let code: Int + + init(code: Int, message: String?, requestId: String?, description: String) { + self.code = code + + super.init(message: message, requestId: requestId, description: description) + } +} + +@objc +public class DBXBadInputError: DBXRequestError {} + +@objc +public class DBXRateLimitError: DBXRequestError { + @objc + public let error: DBXAuthRateLimitError + @objc + public let localizedUserMessage: DBXLocalizedUserMessage? + + init(error: Auth.RateLimitError, localizedUserMessage: LocalizedUserMessage?, message: String?, requestId: String?, description: String) { + self.error = DBXAuthRateLimitError(swift: error) + if let localizedUserMessage = localizedUserMessage { + self.localizedUserMessage = DBXLocalizedUserMessage(localizedUserMessage: localizedUserMessage) + } else { + self.localizedUserMessage = nil + } + + super.init(message: message, requestId: requestId, description: description) + } +} + +@objc +public class DBXHttpError: DBXRequestError { + @objc + public let code: Int + + init(code: Int?, message: String?, requestId: String?, description: String) { + self.code = code ?? 0 + + super.init(message: message, requestId: requestId, description: description) + } +} + +@objc +public class DBXAuthError: DBXRequestError { + @objc + public let error: DBXAuthAuthError + @objc + public let localizedUserMessage: DBXLocalizedUserMessage? + + init(error: Auth.AuthError, localizedUserMessage: LocalizedUserMessage?, message: String?, requestId: String?, description: String) { + self.error = DBXAuthAuthError(swift: error) + if let localizedUserMessage = localizedUserMessage { + self.localizedUserMessage = DBXLocalizedUserMessage(localizedUserMessage: localizedUserMessage) + } else { + self.localizedUserMessage = nil + } + + super.init(message: message, requestId: requestId, description: description) + } +} + +@objc +public class DBXAccessError: DBXRequestError { + @objc + public let error: DBXAuthAccessError + @objc + public let localizedUserMessage: DBXLocalizedUserMessage? + + init(error: Auth.AccessError, localizedUserMessage: LocalizedUserMessage?, message: String?, requestId: String?, description: String) { + self.error = DBXAuthAccessError(swift: error) + if let localizedUserMessage = localizedUserMessage { + self.localizedUserMessage = DBXLocalizedUserMessage(localizedUserMessage: localizedUserMessage) + } else { + self.localizedUserMessage = nil + } + + super.init(message: message, requestId: requestId, description: description) + } +} + +@objc +public class DBXRouteError: DBXRequestError { + @objc + public let localizedUserMessage: DBXLocalizedUserMessage? + + init(localizedUserMessage: LocalizedUserMessage?, message: String?, requestId: String?, description: String) { + if let localizedUserMessage = localizedUserMessage { + self.localizedUserMessage = DBXLocalizedUserMessage(localizedUserMessage: localizedUserMessage) + } else { + self.localizedUserMessage = nil + } + + super.init(message: message, requestId: requestId, description: description) + } +} + +@objc +public class DBXSerializationError: DBXCallError { + @objc + public let error: Error + + init(error: Error, description: String) { + self.error = error + + super.init(description: description) + } +} + +@objc +public class DBXReconnectionError: DBXCallError { + @objc + public let error: Error + + init(error: Error, description: String) { + self.error = error + + super.init(description: description) + } +} + +@objc +public class DBXClientError: DBXCallError { + @objc + public let error: Error? + + init(error: Error?, description: String) { + self.error = error + + super.init(description: description) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCertificatePinning.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCertificatePinning.swift new file mode 100644 index 000000000..c1a39e590 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXCertificatePinning.swift @@ -0,0 +1,36 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +@objc +public protocol DBXAuthChallengeHandler { + func handle(challenge: URLAuthenticationChallenge) -> DBXAuthChallengeHandlerResult +} + +extension DBXAuthChallengeHandler { + var swift: AuthChallenge.Handler { + { [weak self] challenge in + guard let self = self else { + return (.cancelAuthenticationChallenge, nil) + } + let result = self.handle(challenge: challenge) + return (result.disposition, result.credential) + } + } +} + +public class DBXAuthChallengeHandlerResult: NSObject { + @objc + public let disposition: URLSession.AuthChallengeDisposition + @objc + public let credential: URLCredential? + + @objc + init(disposition: URLSession.AuthChallengeDisposition, credential: URLCredential?) { + self.disposition = disposition + self.credential = credential + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxAppClient.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxAppClient.swift new file mode 100644 index 000000000..f3643c486 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxAppClient.swift @@ -0,0 +1,28 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +/// The client for the App API. Call routes using the namespaces inside this object (inherited from parent). +@objc +public class DBXDropboxAppClient: DBXDropboxAppBase { + let subSwift: DropboxAppClient + + /// Initialize a client from swift using an existing Swift client. + /// + /// - Parameter swift: The underlying DropboxAppClient to make API calls. + public init(swift: DropboxAppClient) { + self.subSwift = swift + super.init(swiftClient: swift.client) + } + + /// Designated Initializer. + /// + /// - Parameter transportClient: The underlying DropboxTransportClient to make API calls. + @objc + public convenience init(transportClient: DBXDropboxTransportClient) { + self.init(swift: DropboxAppClient(transportClient: transportClient.swift)) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClient.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClient.swift new file mode 100644 index 000000000..3a205362b --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClient.swift @@ -0,0 +1,138 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension DropboxClient { + var objc: DBXDropboxClient { + DBXDropboxClient(swift: self) + } +} + +/// The client for the User API. Call routes using the namespaces inside this object (inherited from parent). +@objc +public class DBXDropboxClient: DBXDropboxBase { + let subSwift: DropboxClient + + /// Initialize a client from swift using an existing Swift client. + /// + /// - Parameter swift: The underlying DropboxClient to make API calls. + public init(swift: DropboxClient) { + self.subSwift = swift + super.init(swiftClient: swift.client) + } + + /// Initialize a client with a static accessToken string. + /// Use this method if your access token is long-lived. + /// + /// - Parameters: + /// - accessToken: Static access token string. + /// - selectUser: Id of a team member. This allows the api client to makes call on a team member's behalf. + /// - sessionConfiguration: Optional custom network session configuration + /// - pathRoot: User's path root. + @objc + public convenience init( + accessToken: String, + selectUser: String? = nil, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil, + pathRoot: DBXCommonPathRoot? = nil + ) { + let transportClient = DBXDropboxTransportClient( + accessToken: accessToken, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration, + pathRoot: pathRoot + ) + self.init(transportClient: transportClient) + } + + /// Initialize a client with an `AccessTokenProvider`. + /// Use this method if your access token is short-lived. + /// See `ShortLivedAccessTokenProvider` for a default implementation. + /// + /// - Parameters: + /// - accessTokenProvider: Access token provider that wraps a short-lived token and its refresh logic. + /// - selectUser: Id of a team member. This allows the api client to makes call on a team member's behalf. + /// - sessionConfiguration: Optional custom network session configuration + /// - pathRoot: User's path root. + @objc + public convenience init( + accessTokenProvider: DBXAccessTokenProvider, + selectUser: String? = nil, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil, + pathRoot: DBXCommonPathRoot? = nil + ) { + let transportClient = DBXDropboxTransportClient( + accessTokenProvider: accessTokenProvider, selectUser: selectUser, sessionConfiguration: sessionConfiguration, pathRoot: pathRoot + ) + self.init(transportClient: transportClient) + } + + /// Initialize a client with an `DropboxAccessToken`. + /// + /// - Parameters: + /// - accessToken: The token itself, could be long or short lived. + /// - dropboxOauthManager: an oauthManager, used for creating the token provider. + /// - sessionConfiguration: Optional custom network session configuration + @objc + public convenience init( + accessToken: DBXDropboxAccessToken, + dropboxOauthManager: DBXDropboxOAuthManager, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil + ) { + let accessTokenProvider = dropboxOauthManager.accessTokenProviderForToken(accessToken) + let transportClient = DBXDropboxTransportClient(accessTokenProvider: accessTokenProvider, sessionConfiguration: sessionConfiguration) + self.init(transportClient: transportClient) + } + + /// Designated Initializer. + /// + /// - Parameter transportClient: The underlying DropboxTransportClient to make API calls. + @objc + public convenience init(transportClient: DBXDropboxTransportClient) { + self.init(swift: DropboxClient(transportClient: transportClient.swift)) + } + + /// Creates a new DropboxClient instance with the given path root. + /// + /// - Parameter pathRoot: User's path root. + /// - Returns: A new DropboxClient instance for the same user but with an updated path root. + @objc + public func withPathRoot(_ pathRoot: DBXCommonPathRoot) -> DBXDropboxClient { + guard let accessTokenProvider = swift.client.accessTokenProvider else { + fatalError("Attempting to copy a app auth client using a path root") + } + + return DBXDropboxClient(accessTokenProvider: accessTokenProvider.objc, selectUser: swift.client.selectUser, pathRoot: pathRoot) + } + + @objc + public var didFinishBackgroundEvents: (() -> Void)? { + set { + swift.client.didFinishBackgroundEvents = newValue + } + get { + swift.client.didFinishBackgroundEvents + } + } + + /// Fetches completed and running background tasks to be reconnected + /// + /// - Parameter completion: The callback closure to recieve the reconnected requests or errors + @objc + public func getAllRequests(completion: @escaping ([DBXReconnectionResult]) -> Void) { + subSwift.getAllRequests { swifts in + let objcs = swifts.map { swift in + switch swift { + case .success(let box): + return DBXReconnectionResult(request: box.objc, error: nil) + case .failure(let error): + return DBXReconnectionResult(request: nil, error: error.objc) + } + } + completion(objcs) + } + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClientsManager.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClientsManager.swift new file mode 100644 index 000000000..1808f7624 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxClientsManager.swift @@ -0,0 +1,244 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +@objc +public class DBXDropboxClientsManager: NSObject { + /// An authorized client. This will be set to nil if unlinked. + @objc + public static var authorizedClient: DBXDropboxClient? { + get { + DropboxClientsManager.authorizedClient?.objc + } + set { + DropboxClientsManager.authorizedClient = newValue?.subSwift + } + } + + /// An authorized background client. This will be set to nil if unlinked. + @objc + public static var authorizedBackgroundClient: DBXDropboxClient? { + get { + DropboxClientsManager.authorizedBackgroundClient?.objc + } + set { + DropboxClientsManager.authorizedBackgroundClient = newValue?.subSwift + } + } + + /// Authorized background clients created in the course of handling background events from extensions, keyed by session identifiers. + @objc + public static var authorizedExtensionBackgroundClient: [String: DBXDropboxClient] { + get { + DropboxClientsManager.authorizedExtensionBackgroundClients.mapValues { client in + client.objc + } + } + set { + DropboxClientsManager.authorizedExtensionBackgroundClients = newValue.mapValues { client in + client.subSwift + } + } + } + + /// An authorized team client. This will be set to nil if unlinked. + @objc + public static var authorizedTeamClient: DBXDropboxTeamClient? { + get { + DropboxClientsManager.authorizedTeamClient?.objc + } + set { + DropboxClientsManager.authorizedTeamClient = newValue?.subSwift + } + } + + /// A sdk-caller provided logger for debugging. + @objc + public static var loggingClosure: ((DBXLogLevel, String) -> Void)? { + get { + { level, message in + DropboxClientsManager.loggingClosure?(level.swift, message) + } + } + set { + DropboxClientsManager.loggingClosure = { level, message in + newValue?(DBXLogLevel(logLevel: level), message) + } + } + } + + /// The installed version of the SDK + @objc + public static var sdkVersion: String { DropboxClientsManager.sdkVersion } + + @objc + public static func reauthorizeClient(_ tokenUid: String) { + DropboxClientsManager.reauthorizeClient(tokenUid) + } + + @objc + public static func reauthorizeBackgroundClient(_ tokenUid: String, requestsToReconnect: @escaping ([DBXReconnectionResult]) -> Void) { + DropboxClientsManager.reauthorizeBackgroundClient(tokenUid, requestsToReconnect: { swiftRequests in + requestsToReconnect(objcRequests(from: swiftRequests)) + }) + } + + @objc + public static func reauthorizeTeamClient(_ tokenUid: String) { + DropboxClientsManager.reauthorizeTeamClient(tokenUid) + } + + /// Handle a redirect and automatically initialize the client and save the token. + /// + /// - parameters: + /// - url: The URL to attempt to handle. + /// - includeBackgroundClient: additionally auth background client. + /// - completion: The callback closure to receive auth result. + /// - returns: Whether the redirect URL can be handled. + @objc + @discardableResult + public static func handleRedirectURL(_ url: URL, includeBackgroundClient: Bool, completion: @escaping (DBXDropboxOAuthResult?) -> Void) -> Bool { + DropboxClientsManager.handleRedirectURL(url, includeBackgroundClient: includeBackgroundClient, completion: bridgeDropboxOAuthCompletion(completion)) + } + + /// Handle a redirect and automatically initialize the client and save the token. + /// + /// - parameters: + /// - url: The URL to attempt to handle. + /// - includeBackgroundClient: additionally auth background client. + /// - completion: The callback closure to receive auth result. + /// - returns: Whether the redirect URL can be handled. + @objc + @discardableResult + public static func handleRedirectURLTeam(_ url: URL, includeBackgroundClient: Bool, completion: @escaping (DBXDropboxOAuthResult?) -> Void) -> Bool { + DropboxClientsManager.handleRedirectURLTeam(url, completion: bridgeDropboxOAuthCompletion(completion)) + } + + /// Prepare the appropriate single user DropboxClient to handle incoming background session events and make ongoing tasks available for reconnection + /// + /// - parameters: + /// - identifier: The identifier of the URLSession for which events must be handled. + /// - creationInfos: Information to configure extension DropboxClients in the event that they must be recreated in the main app to handle events. + /// - completionHandler: The completion handler to be executed when the underlying URLSessionDelegate recieves urlSessionDidFinishEvents(forBackgroundURLSession:). + /// - requestsToReconnect: The callback closure to receive requests for reconnection. + @objc + public static func handleEventsForBackgroundURLSession( + with identifier: String, + creationInfos: [DBXBackgroundExtensionSessionCreationInfo], + completionHandler: @escaping () -> Void, + requestsToReconnect: @escaping ([DBXReconnectionResult]) -> Void + ) { + DropboxClientsManager.handleEventsForBackgroundURLSession( + with: identifier, + creationInfos: creationInfos.map(\.swift), + completionHandler: completionHandler, + requestsToReconnect: { swiftRequests in + requestsToReconnect(objcRequests(from: swiftRequests)) + } + ) + } + + /// Prepare the appropriate multiuser DropboxClient to handle incoming background session events and make ongoing tasks available for reconnection + /// + /// - parameters: + /// - identifier: The identifier of the URLSession for which events must be handled. + /// - tokenUid: The uid of the token to authenticate this client with. + /// - creationInfos: Information to configure extension DropboxClients in the event that they must be recreated in the main app to handle events. + /// - completionHandler: The completion handler to be executed when the underlying URLSessionDelegate recieves urlSessionDidFinishEvents(forBackgroundURLSession:). + /// - requestsToReconnect: The callback closure to receive requests for reconnection. + @objc + public static func handleEventsForBackgroundURLSessionMultiUser( + with identifier: String, + tokenUid: String, + creationInfos: [DBXBackgroundExtensionSessionCreationInfo], + completionHandler: @escaping () -> Void, + requestsToReconnect: @escaping ([DBXReconnectionResult]) -> Void + ) { + DropboxClientsManager.handleEventsForBackgroundURLSessionMultiUser( + with: identifier, + tokenUid: tokenUid, + creationInfos: creationInfos.map(\.swift), + completionHandler: completionHandler, + requestsToReconnect: { swiftRequests in + requestsToReconnect(objcRequests(from: swiftRequests)) + } + ) + } + + static func objcRequests(from swiftRequests: [Result]) -> [DBXReconnectionResult] { + swiftRequests.map { swiftRequest in + switch swiftRequest { + case .success(let box): + return DBXReconnectionResult(request: box.objc, error: nil) + case .failure(let error): + return DBXReconnectionResult(request: nil, error: error.objc) + } + } + } + + /// Unlink the user. + @objc + public static func unlinkClients() { + DropboxClientsManager.unlinkClients() + } + + /// Unlink the user. + @objc + public static func resetClients() { + DropboxClientsManager.resetClients() + } + + /// Logs to the provided logging closure + @objc + public static func log(_ level: DBXLogLevel, _ message: String) { + DropboxClientsManager.log(level.swift, message) + } + + /// Logs to the provided logging closure with background session tag and log level. + @objc + public static func logBackgroundSession(_ message: String) { + DropboxClientsManager.logBackgroundSession(message) + } + + /// Logs to the provided logging closure with background session tag. + @objc + public static func logBackgroundSession(_ level: DBXLogLevel, _ message: String) { + DropboxClientsManager.logBackgroundSession(level.swift, message) + } +} + +// MARK: Bridging helpers + +@objc +public enum DBXLogLevel: Int { + public typealias RawValue = Int + + case error + case info + case debug + + var swift: LogLevel { + switch self { + case .error: + return .error + case .info: + return .info + case .debug: + return .debug + } + } + + init(logLevel: LogLevel) { + switch logLevel { + case .error: + self = .error + case .info: + self = .info + case .debug: + self = .debug + } + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTeamClient.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTeamClient.swift new file mode 100644 index 000000000..41a8056bc --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTeamClient.swift @@ -0,0 +1,88 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +/// The client for the Business API. Call routes using the namespaces inside this object (inherited from parent). + +extension DropboxTeamClient { + var objc: DBXDropboxTeamClient { + DBXDropboxTeamClient(swift: self) + } +} + +@objc +public class DBXDropboxTeamClient: DBXDropboxTeamBase { + let subSwift: DropboxTeamClient + + fileprivate init(swift: DropboxTeamClient) { + self.subSwift = swift + super.init(swiftClient: swift.client) + } + + /// Initialize a client with a static accessToken string. + /// Use this method if your access token is long-lived. + /// + /// - Parameters: + /// - accessToken: Static access token string. + /// - sessionConfiguration: Optional custom network session configuration + /// + @objc + public convenience init( + accessToken: String, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil + ) { + let transportClient = DBXDropboxTransportClient(accessToken: accessToken) + self.init(transportClient: transportClient) + } + + /// Initialize a client with an `AccessTokenProvider`. + /// Use this method if your access token is short-lived. + /// See `ShortLivedAccessTokenProvider` for a default implementation. + /// + /// - Parameter accessTokenProvider: Access token provider that wraps a short-lived token and its refresh logic. + @objc + public convenience init( + accessTokenProvider: DBXAccessTokenProvider, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil + ) { + let transportClient = DBXDropboxTransportClient(accessTokenProvider: accessTokenProvider) + self.init(transportClient: transportClient) + } + + /// Initialize a client with an `DropboxAccessToken`. + /// + /// - Parameters: + /// - accessToken: The token itself, could be long or short lived. + /// - dropboxOauthManager: an oauthManager, used for creating the token provider. + /// - sessionConfiguration: Optional custom network session configuration + @objc + public convenience init( + accessToken: DBXDropboxAccessToken, + dropboxOauthManager: DBXDropboxOAuthManager, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil + ) { + let accessTokenProvider = dropboxOauthManager.accessTokenProviderForToken(accessToken) + let transportClient = DBXDropboxTransportClient(accessTokenProvider: accessTokenProvider) + self.init(transportClient: transportClient) + } + + /// Designated Initializer. + /// + /// - Parameter transportClient: The underlying DropboxTransportClient to make API calls. + @objc + public convenience init(transportClient: DBXDropboxTransportClient) { + self.init(swift: DropboxTeamClient(transportClient: transportClient.swift)) + } + + /// Creates a new DropboxClient instance for the team member id. + /// + /// - Parameter memberId: Team member id. + /// - Returns: A new DropboxClient instance that can be used to call APIs on the team member's behalf. + @objc + public func asMember(_ memberId: String) -> DBXDropboxClient { + DropboxClient(accessTokenProvider: subSwift.accessTokenProvider, selectUser: memberId).objc + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTransportClient.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTransportClient.swift new file mode 100644 index 000000000..625ea40ff --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXDropboxTransportClient.swift @@ -0,0 +1,154 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension DropboxTransportClient { + var objc: DBXDropboxTransportClient { + DBXDropboxTransportClient(swift: self) + } +} + +@objc +public class DBXDropboxTransportClient: NSObject { + var swift: DropboxTransportClient + + @objc + public var selectUser: String? { + get { swift.selectUser } + set { swift.selectUser = newValue } + } + + @objc + public var pathRoot: DBXCommonPathRoot? { + get { + guard let swift = swift.pathRoot else { return nil } + return DBXCommonPathRoot(swift: swift) + } + set { swift.pathRoot = newValue?.swift } + } + + @objc + public var didFinishBackgroundEvents: (() -> Void)? { + get { swift.didFinishBackgroundEvents } + set { swift.didFinishBackgroundEvents = newValue } + } + + @objc + public convenience init( + accessToken: String, + selectUser: String? = nil, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil, + pathRoot: DBXCommonPathRoot? = nil + ) { + self.init( + accessToken: accessToken, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration ?? .default, + pathRoot: pathRoot + ) + } + + @objc + public convenience init( + accessToken: String, + baseHosts: BaseHosts = .default, + userAgent: String? = nil, + selectUser: String? = nil, + sessionConfiguration: DBXNetworkSessionConfiguration = DBXNetworkSessionConfiguration.default, + longpollSessionConfiguration: DBXNetworkSessionConfiguration = DBXNetworkSessionConfiguration.defaultLongpoll, + filesAccess: FilesAccess = FilesAccessImpl(), + authChallengeHandler: DBXAuthChallengeHandler? = nil, + pathRoot: DBXCommonPathRoot? = nil + ) { + self.init( + accessTokenProvider: DBXLongLivedAccessTokenProvider(accessToken: accessToken), + baseHosts: baseHosts, + userAgent: userAgent, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration, + longpollSessionConfiguration: longpollSessionConfiguration, + filesAccess: filesAccess, + authChallengeHandler: authChallengeHandler, + pathRoot: pathRoot + ) + } + + @objc + public convenience init( + accessTokenProvider: DBXAccessTokenProvider, + selectUser: String? = nil, + sessionConfiguration: DBXNetworkSessionConfiguration? = nil, + pathRoot: DBXCommonPathRoot? = nil + ) { + self.init( + accessTokenProvider: accessTokenProvider, + userAgent: nil, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration ?? .default, + pathRoot: pathRoot + ) + } + + convenience init( + accessTokenProvider: DBXAccessTokenProvider, + baseHosts: BaseHosts = .default, + userAgent: String?, + selectUser: String?, + sessionConfiguration: DBXNetworkSessionConfiguration = DBXNetworkSessionConfiguration.default, + longpollSessionConfiguration: DBXNetworkSessionConfiguration = DBXNetworkSessionConfiguration.defaultLongpoll, + filesAccess: FilesAccess = FilesAccessImpl(), + authChallengeHandler: DBXAuthChallengeHandler? = nil, + pathRoot: DBXCommonPathRoot? = nil + ) { + let swift = DropboxTransportClientImpl( + accessTokenProvider: accessTokenProvider, + baseHosts: baseHosts, + userAgent: userAgent, + selectUser: selectUser, + sessionConfiguration: sessionConfiguration.swift, + longpollSessionConfiguration: longpollSessionConfiguration.swift, + filesAccess: filesAccess, + authChallengeHandler: authChallengeHandler?.swift, + pathRoot: pathRoot?.swift + ) + self.init(swift: swift) + } + + fileprivate init(swift: DropboxTransportClient) { + self.swift = swift + } +} + +/// Only called by other ObjC wrappers and/or other Swift code +extension DBXDropboxTransportClient { + public func request( + _ route: Route, serverArgs: ASerial.ValueType? = nil + ) -> RpcRequest { + swift.request(route, serverArgs: serverArgs) + } + + public func request( + _ route: Route, serverArgs: ASerial.ValueType, input: UploadBody + ) -> UploadRequest { + swift.request(route, serverArgs: serverArgs, input: input) + } + + public func request( + _ route: Route, + serverArgs: ASerial.ValueType, + overwrite: Bool, + destination: URL + ) -> DownloadRequestFile { + swift.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination) + } + + public func request( + _ route: Route, + serverArgs: ASerial.ValueType + ) -> DownloadRequestMemory { + swift.request(route, serverArgs: serverArgs) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXReconnectionHelpers.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXReconnectionHelpers.swift new file mode 100644 index 000000000..b3e054544 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXReconnectionHelpers.swift @@ -0,0 +1,95 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension ReconnectionError { + var objc: DBXReconnectionHelperError { + DBXReconnectionHelperError(swift: self) + } +} + +@objc +public class DBXReconnectionHelperError: NSObject { + let swift: ReconnectionError + + @objc + public var errorMessage: String { swift.reconnectionErrorKind.rawValue } + + @objc + public var taskDescription: String? { swift.taskDescription } + + init(swift: ReconnectionError) { + self.swift = swift + } +} + +@objc +public class DBXReconnectionResult: NSObject { + @objc + public let request: DBXRequest? + @objc + public let error: DBXReconnectionHelperError? + + init(request: DBXRequest?, error: DBXReconnectionHelperError?) { + self.request = request + self.error = error + } +} + +@objc +public class DBXDefaultBackgroundExtensionSessionCreationInfo: NSObject { + let swift: DefaultBackgroundExtensionSessionCreationInfo + + public init(swift: DefaultBackgroundExtensionSessionCreationInfo) { + self.swift = swift + } + + @objc + public init(backgroundSessionIdentifier: String, sharedContainerIdentifier: String) { + self.swift = DefaultBackgroundExtensionSessionCreationInfo( + backgroundSessionIdentifier: backgroundSessionIdentifier, + sharedContainerIdentifier: sharedContainerIdentifier + ) + } +} + +@objc +public class DBXCustomBackgroundExtensionSessionCreationInfo: NSObject { + let swift: CustomBackgroundExtensionSessionCreationInfo + + @objc + public init(backgroundTransportClient: DBXDropboxTransportClient) { + self.swift = .init(backgroundTransportClient: backgroundTransportClient.swift) + } + + @objc + public init(backgroundSessionConfiguration: DBXNetworkSessionConfiguration) { + self.swift = .init(backgroundSessionConfiguration: backgroundSessionConfiguration.swift) + } + + init(swift: CustomBackgroundExtensionSessionCreationInfo) { + self.swift = swift + } +} + +@objc +public class DBXBackgroundExtensionSessionCreationInfo: NSObject { + let swift: BackgroundExtensionSessionCreationInfo + + @objc + public init(defaultInfo: DBXDefaultBackgroundExtensionSessionCreationInfo) { + self.swift = .init(defaultInfo: defaultInfo.swift) + } + + @objc + public init(customInfo: DBXCustomBackgroundExtensionSessionCreationInfo) { + self.swift = .init(customInfo: customInfo.swift) + } + + init(swift: BackgroundExtensionSessionCreationInfo) { + self.swift = swift + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXRequest.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXRequest.swift new file mode 100644 index 000000000..66343f04a --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/DBXRequest.swift @@ -0,0 +1,22 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +@objc +public protocol DBXRequest { + var clientPersistedString: String? { get } + + @available(iOS 13.0, macOS 10.13, *) + var earliestBeginDate: Date? { get } + + @discardableResult + func persistingString(string: String?) -> Self + + @available(iOS 13.0, macOS 10.13, *) + @discardableResult + func settingEarliestBeginDate(date: Date?) -> Self + + func cancel() +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/NetworkSession/DBXNetworkSessionConfiguration.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/NetworkSession/DBXNetworkSessionConfiguration.swift new file mode 100644 index 000000000..879331ecf --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/NetworkSession/DBXNetworkSessionConfiguration.swift @@ -0,0 +1,109 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension NetworkSessionConfiguration { + var objc: DBXNetworkSessionConfiguration { + DBXNetworkSessionConfiguration(swift: self) + } +} + +public class DBXNetworkSessionConfiguration: NSObject { + var swift: NetworkSessionConfiguration + + fileprivate init(swift: NetworkSessionConfiguration) { + self.swift = swift + } + + @objc + public var timeoutIntervalForRequest: Double { + get { + swift.timeoutIntervalForRequest + } + set { + swift.timeoutIntervalForRequest = newValue + } + } + + @objc + public var timeoutIntervalForResource: Double { + get { + swift.timeoutIntervalForResource + } + set { + swift.timeoutIntervalForResource = newValue + } + } + + @objc + public var allowsCellularAccess: Bool { + get { + swift.allowsCellularAccess + } + set { + swift.allowsCellularAccess = newValue + } + } + + @objc + @available(iOS 13.0, macOS 10.15, *) + public var allowsExpensiveNetworkAccess: Bool { + get { + swift.allowsExpensiveNetworkAccess + } + set { + swift.allowsExpensiveNetworkAccess = newValue + } + } + + @objc + @available(iOS 13.0, macOS 10.15, *) + public var allowsConstrainedNetworkAccess: Bool { + get { + swift.allowsConstrainedNetworkAccess + } + set { + swift.allowsConstrainedNetworkAccess = newValue + } + } + + @objc + public var sharedContainerIdentifier: String? { + get { + swift.sharedContainerIdentifier + } + set { + swift.sharedContainerIdentifier = newValue + } + } + + @objc + public var httpMaximumConnectionsPerHost: Int { + get { + swift.httpMaximumConnectionsPerHost + } + set { + swift.httpMaximumConnectionsPerHost = newValue + } + } + + @objc + public static var `default` = DBXNetworkSessionConfiguration(swift: NetworkSessionConfiguration.default) + @objc + public static var defaultLongpoll = DBXNetworkSessionConfiguration(swift: NetworkSessionConfiguration.defaultLongpoll) + @objc + public static func background(withIdentifier identifier: String) -> DBXNetworkSessionConfiguration { + DBXNetworkSessionConfiguration(swift: NetworkSessionConfiguration(kind: .background(identifier))) + } + + @objc + public static func background(withIdentifier identifier: String, sharedContainerIdentifier: String) -> DBXNetworkSessionConfiguration { + DBXNetworkSessionConfiguration( + swift: NetworkSessionConfiguration + .background(withIdentifier: identifier, sharedContainerIdentifier: sharedContainerIdentifier) + ) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAccessTokenProvider.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAccessTokenProvider.swift new file mode 100644 index 000000000..bb7753223 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAccessTokenProvider.swift @@ -0,0 +1,68 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension AccessTokenProvider { + var objc: DBXAccessTokenProvider { + DBXAccessTokenProvider(swift: self) + } +} + +@objc +public class DBXAccessTokenProvider: NSObject { + @objc + public var accessToken: String { swift.accessToken } + + let swift: AccessTokenProvider + + fileprivate init(swift: AccessTokenProvider) { + self.swift = swift + } +} + +extension DBXAccessTokenProvider: AccessTokenProvider { + public func refreshAccessTokenIfNecessary(completion: @escaping DropboxOAuthCompletion) { + swift.refreshAccessTokenIfNecessary(completion: completion) + } +} + +extension LongLivedAccessTokenProvider { + var objc: DBXLongLivedAccessTokenProvider { + DBXLongLivedAccessTokenProvider(swift: self) + } +} + +public class DBXLongLivedAccessTokenProvider: DBXAccessTokenProvider { + fileprivate init(swift: LongLivedAccessTokenProvider) { + super.init(swift: swift) + } + + @objc + public init(accessToken: String) { + super.init(swift: LongLivedAccessTokenProvider(accessToken: accessToken)) + } +} + +extension ShortLivedAccessTokenProvider { + var objc: DBXShortLivedAccessTokenProvider { + DBXShortLivedAccessTokenProvider(swift: self) + } +} + +@objc +public class DBXShortLivedAccessTokenProvider: DBXAccessTokenProvider { + fileprivate init(swift: ShortLivedAccessTokenProvider) { + super.init(swift: swift) + } + + /// - Parameters: + /// - token: The `DropboxAccessToken` object for a short-lived token. + /// - tokenRefresher: Helper object that refreshes a token over network. + @objc + init(token: DBXDropboxAccessToken, tokenRefresher: DBXAccessTokenRefreshing) { + super.init(swift: ShortLivedAccessTokenProvider(token: token.swift, tokenRefresher: tokenRefresher.swift)) + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAuthSession.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAuthSession.swift new file mode 100644 index 000000000..a9524541f --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXAuthSession.swift @@ -0,0 +1,65 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension ScopeRequest { + var objc: DBXScopeRequest { + DBXScopeRequest(swift: self) + } +} + +@objc +public class DBXScopeRequest: NSObject { + let swift: ScopeRequest + + /// Type of the requested scopes. + @objc public enum DBXScopeType: Int { + case team + case user + } + + /// An array of scopes to be granted. + @objc + var scopes: [String] { swift.scopes } + /// Boolean indicating whether to keep all previously granted scopes. + @objc + var includeGrantedScopes: Bool { swift.includeGrantedScopes } + /// Type of the scopes to be granted. + @objc + var scopeType: DBXScopeType { + switch swift.scopeType { + case .team: + return .team + case .user: + return .user + } + } + + /// String representation of the scopes, used in URL query. Nil if the array is empty. + @objc + var scopeString: String? { + swift.scopeString + } + + /// Designated Initializer. + /// + /// - Parameters: + /// - scopeType: Type of the requested scopes. + /// - scopes: A list of scope returned by Dropbox server. Each scope correspond to a group of API endpoints. + /// To call one API endpoint you have to obtains the scope first otherwise you will get HTTP 401. + /// - includeGrantedScopes: If false, Dropbox will give you the scopes in scopes array. + /// Otherwise Dropbox server will return a token with all scopes user previously granted your app + /// together with the new scopes. + @objc + public init(scopeType: DBXScopeType, scopes: [String], includeGrantedScopes: Bool) { + let swiftScopeType: ScopeRequest.ScopeType = scopeType == .team ? .team : .user + self.swift = ScopeRequest(scopeType: swiftScopeType, scopes: scopes, includeGrantedScopes: includeGrantedScopes) + } + + fileprivate init(swift: ScopeRequest) { + self.swift = swift + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuth.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuth.swift new file mode 100644 index 000000000..4698b2e6c --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuth.swift @@ -0,0 +1,263 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +@objc +public protocol DBXSharedApplication: AnyObject { + func presentErrorMessage(_ message: String, title: String) + func presentErrorMessageWithHandlers(_ message: String, title: String, buttonTitles: [String], buttonHandler: (String) -> Void) + func presentPlatformSpecificAuth(_ authURL: URL) -> Bool + func presentAuthChannel(_ authURL: URL, tryIntercept: @escaping ((URL) -> Bool), cancelHandler: @escaping (() -> Void)) + func presentExternalApp(_ url: URL) + func canPresentExternalApp(_ url: URL) -> Bool + func presentLoading() + func dismissLoading() +} + +extension DBXSharedApplication { + var swift: SharedApplication { + SharedApplicationBridge(objc: self) + } +} + +class SharedApplicationBridge: SharedApplication { + func presentErrorMessage(_ message: String, title: String) { + objc.presentErrorMessage(message, title: title) + } + + func presentErrorMessageWithHandlers(_ message: String, title: String, buttonHandlers: [String: () -> Void]) { + let buttonHandler: (String) -> Void = { buttonTitle in + buttonHandlers[buttonTitle]?() + } + objc.presentErrorMessageWithHandlers(message, title: title, buttonTitles: buttonHandlers.keys.sorted(), buttonHandler: buttonHandler) + } + + func presentPlatformSpecificAuth(_ authURL: URL) -> Bool { + objc.presentPlatformSpecificAuth(authURL) + } + + func presentAuthChannel(_ authURL: URL, tryIntercept: @escaping ((URL) -> Bool), cancelHandler: @escaping (() -> Void)) { + objc.presentAuthChannel(authURL, tryIntercept: tryIntercept, cancelHandler: cancelHandler) + } + + func presentExternalApp(_ url: URL) { + objc.presentExternalApp(url) + } + + func canPresentExternalApp(_ url: URL) -> Bool { + objc.canPresentExternalApp(url) + } + + func presentLoading() { + objc.presentLoading() + } + + func dismissLoading() { + objc.dismissLoading() + } + + let objc: DBXSharedApplication + + init(objc: DBXSharedApplication) { + self.objc = objc + } +} + +@objc public protocol DBXAccessTokenRefreshing { + /// Refreshes a (short-lived) access token for a given DropboxAccessToken. + /// + /// - Parameters: + /// - accessToken: A `DropboxAccessToken` object. + /// - scopes: An array of scopes to be granted for the refreshed access token. + /// The requested scope MUST NOT include any scope not originally granted. + /// Useful if users want to reduce the granted scopes for the new access token. + /// Pass in an empty array if you don't want to change scopes of the access token. + /// - queue: The queue where completion block will be called from. + /// - completion: A block to notify caller the result. + func refreshAccessToken( + _ accessToken: DBXDropboxAccessToken, + scopes: [String], + queue: DispatchQueue?, + completion: @escaping (DBXDropboxOAuthResult?) -> Void + ) +} + +extension DBXAccessTokenRefreshing { + var swift: AccessTokenRefreshing { + AccessTokenRefreshingBridge(objc: self) + } +} + +class AccessTokenRefreshingBridge: AccessTokenRefreshing { + let objc: DBXAccessTokenRefreshing + init(objc: DBXAccessTokenRefreshing) { + self.objc = objc + } + + func refreshAccessToken( + _ accessToken: DropboxAccessToken, + scopes: [String], + queue: DispatchQueue?, + completion: @escaping DropboxOAuthCompletion + ) { + objc.refreshAccessToken(DBXDropboxAccessToken(swift: accessToken), scopes: scopes, queue: queue) { dbresult in + completion(dbresult?.swift) + } + } +} + +extension DropboxAccessToken { + var objc: DBXDropboxAccessToken { + DBXDropboxAccessToken(swift: self) + } +} + +@objc +public class DBXDropboxAccessToken: NSObject { + let swift: DropboxAccessToken + + fileprivate init(swift: DropboxAccessToken) { + self.swift = swift + } + + /// The access token string. + @objc + public var accessToken: String { swift.accessToken } + + /// The associated user id. + @objc + public var uid: String { swift.uid } + + /// The refresh token if accessToken is short-lived. + @objc + public var refreshToken: String? { swift.refreshToken } + + /// The expiration time of the (short-lived) accessToken. + @objc + public var tokenExpirationTimestamp: NSNumber? { + guard let value = swift.tokenExpirationTimestamp else { return nil } + return NSNumber(value: value) + } + + /// Indicates whether the access token is short-lived. + @objc + var isShortLivedToken: Bool { + refreshToken != nil && tokenExpirationTimestamp != nil + } + + /// Designated Initializer + /// + /// - parameters: + /// - accessToken: The access token string. + /// - uid: The associated user id. + /// - refreshToken: The refresh token if accessToken is short-lived. + /// - tokenExpirationTimestamp: The expiration time of the (short-lived) accessToken. + @objc + public init( + accessToken: String, + uid: String, + refreshToken: String? = nil, + tokenExpirationTimestamp: NSNumber? = nil + ) { + self.swift = DropboxAccessToken( + accessToken: accessToken, + uid: uid, + refreshToken: refreshToken, + tokenExpirationTimestamp: tokenExpirationTimestamp?.doubleValue + ) + } + + @objc + open override var description: String { + swift.description + } +} + +func bridgeDropboxOAuthCompletion(_ completion: @escaping (DBXDropboxOAuthResult?) -> Void) -> DropboxOAuthCompletion { + { + if let swift = $0 { + let dbResult = DBXDropboxOAuthResult(swift: swift) + completion(dbResult) + } else { + completion(nil) + } + } +} + +extension OAuth2Error { + var objc: DBXOAuth2Error { + DBXOAuth2Error(swift: self) + } +} + +@objc +public class DBXOAuth2Error: NSObject { + let swift: OAuth2Error + + /// Initializes an error code from the string specced in RFC6749 + fileprivate init(swift: OAuth2Error) { + self.swift = swift + } + + /// Indicates whether the error is invalid_grant error. + @objc + var isInvalidGrantError: Bool { swift.isInvalidGrantError } +} + +extension DropboxOAuthResult { + var objc: DBXDropboxOAuthResult { + DBXDropboxOAuthResult(swift: self) + } +} + +@objc +public class DBXDropboxOAuthResult: NSObject { + let swift: DropboxOAuthResult + + fileprivate init(swift: DropboxOAuthResult) { + self.swift = swift + } + + @objc + public var token: DBXDropboxAccessToken? { + switch swift { + case .success(let swift): + return DBXDropboxAccessToken(swift: swift) + default: + return nil + } + } + + @objc + public var error: DBXOAuth2Error? { + switch swift { + case .error(let swift, _): + return DBXOAuth2Error(swift: swift) + default: + return nil + } + } + + @objc + public var errorMessage: String? { + switch swift { + case .error(_, let errorMessage): + return errorMessage + default: + return nil + } + } + + @objc + public var wasCancelled: Bool { + switch swift { + case .cancel: + return true + default: + return false + } + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuthImpl.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuthImpl.swift new file mode 100644 index 000000000..dff513465 --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXOAuthImpl.swift @@ -0,0 +1,192 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +extension DropboxOAuthManager { + var objc: DBXDropboxOAuthManager { + DBXDropboxOAuthManager(swift: self) + } +} + +@objc +public class DBXDropboxOAuthManager: NSObject { + @objc + public var locale: Locale? { swift.locale } + + // MARK: Shared instance + + /// A shared instance of a `DropboxOAuthManager` for convenience + @objc + public static var sharedOAuthManager: DBXDropboxOAuthManager { + get { + DBXDropboxOAuthManager(swift: .sharedOAuthManager) + } + set { + DropboxOAuthManager.sharedOAuthManager = newValue.swift + } + } + + let swift: DropboxOAuthManager + + init(swift: DropboxOAuthManager) { + self.swift = swift + } + + @objc + public convenience init( + appKey: String, + host: String, + secureStorageAccess: DBXSecureStorageAccess + ) { + let secureStorageAccessBridge = secureStorageAccess.swift + self.init(swift: DropboxOAuthManager(appKey: appKey, host: host, secureStorageAccess: secureStorageAccessBridge)) + } + + /// + /// Create an instance + /// parameter appKey: The app key from the developer console that identifies this app. + /// + @objc + public convenience init(appKey: String, secureStorageAccess: DBXSecureStorageAccess) { + self.init(appKey: appKey, host: "www.dropbox.com", secureStorageAccess: secureStorageAccess) + } + + /// + /// Try to handle a redirect back into the application + /// + /// - parameters: + /// - url: The URL to attempt to handle. + /// - completion: The callback closure to receive auth result. + /// - returns: Whether the redirect URL can be handled. + /// + @objc + public func handleRedirectURL(_ url: URL, completion: @escaping (DBXDropboxOAuthResult?) -> Void) -> Bool { + swift.handleRedirectURL(url, completion: bridgeDropboxOAuthCompletion(completion)) + } + + /// + /// Present the OAuth2 authorization request page by presenting a web view controller modally. + /// + /// - parameters: + /// - sharedApplication: The application to present from. + /// - usePKCE: Whether to use OAuth2 code flow with PKCE. Default is false, i.e. use the legacy token flow. + /// - scopeRequest: The ScopeRequest, only used in code flow with PKCE. + @objc + public func authorizeFromSharedApplication( + _ sharedApplication: DBXSharedApplication, usePKCE: Bool = false, scopeRequest: DBXScopeRequest? = nil + ) { + swift.authorizeFromSharedApplication(sharedApplication.swift, usePKCE: usePKCE, scopeRequest: scopeRequest?.swift) + } + + /// + /// Retrieve all stored access tokens + /// + /// - returns: a dictionary mapping users to their access tokens + /// + @objc + public func getAllAccessTokens() -> [String: DBXDropboxAccessToken] { + swift.getAllAccessTokens().mapValues { $0.objc } + } + + /// + /// Check if there are any stored access tokens + /// + /// - returns: Whether there are stored access tokens + /// + @objc + public func hasStoredAccessTokens() -> Bool { + swift.hasStoredAccessTokens() + } + + /// + /// Retrieve the access token for a particular user + /// + /// - parameter user: The user whose token to retrieve + /// + /// - returns: An access token if present, otherwise `nil`. + /// + @objc + public func getAccessToken(_ user: String?) -> DBXDropboxAccessToken? { + swift.getAccessToken(user)?.objc + } + + /// + /// Delete a specific access token + /// + /// - parameter token: The access token to delete + /// + /// - returns: whether the operation succeeded + /// + @objc + public func clearStoredAccessToken(_ token: DBXDropboxAccessToken) -> Bool { + swift.clearStoredAccessToken(token.swift) + } + + /// + /// Delete all stored access tokens + /// + /// - returns: whether the operation succeeded + /// + @objc + public func clearStoredAccessTokens() -> Bool { + swift.clearStoredAccessTokens() + } + + /// + /// Save an access token + /// + /// - parameter token: The access token to save + /// + /// - returns: whether the operation succeeded + /// + @objc + @discardableResult + public func storeAccessToken(_ token: DBXDropboxAccessToken) -> Bool { + swift.storeAccessToken(token.swift) + } + + /// + /// Utility function to return an arbitrary access token + /// + /// - returns: the "first" access token found, if any (otherwise `nil`) + /// + @objc + public func getFirstAccessToken() -> DBXDropboxAccessToken? { + swift.getFirstAccessToken()?.objc + } + + // MARK: Short-lived token support. + + /// Refreshes a (short-lived) access token for a given DropboxAccessToken. + /// + /// - Parameters: + /// - accessToken: A `DropboxAccessToken` object. + /// - scopes: An array of scopes to be granted for the refreshed access token. + /// The requested scope MUST NOT include any scope not originally granted. + /// Useful if users want to reduce the granted scopes for the new access token. + /// Pass in an empty array if you don't want to change scopes of the access token. + /// - queue: The queue where completion block will be called from. + /// - completion: A `DropboxOAuthCompletion` block to notify caller the result. + /// + /// - NOTE: Completion block will be called on main queue if a callback queue is not provided. + @objc + public func refreshAccessToken( + _ accessToken: DBXDropboxAccessToken, + scopes: [String], + queue: DispatchQueue?, + completion: @escaping (DBXDropboxOAuthResult?) -> Void + ) { + swift.refreshAccessToken(accessToken.swift, scopes: scopes, queue: queue, completion: bridgeDropboxOAuthCompletion(completion)) + } + + /// Creates an `AccessTokenProvider` that wraps short-lived for token refresh + /// or a static provider for long-live token. + /// - Parameter token: The `DropboxAccessToken` object. + @objc + public func accessTokenProviderForToken(_ token: DBXDropboxAccessToken) -> DBXAccessTokenProvider { + swift.accessTokenProviderForToken(token.swift).objc + } +} diff --git a/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXSecureStorageAccess.swift b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXSecureStorageAccess.swift new file mode 100644 index 000000000..93c36f2da --- /dev/null +++ b/Source/SwiftyDropboxObjC/Shared/Handwritten/OAuth/DBXSecureStorageAccess.swift @@ -0,0 +1,105 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation +import SwiftyDropbox + +@objc +public protocol DBXSecureStorageAccess { + func checkAccessibilityMigrationOneTime() + func setAccessTokenData(for userId: String, data: Data) -> Bool + func getAllUserIds() -> [String] + func getDropboxAccessToken(for key: String) -> DBXDropboxAccessToken? + func deleteInfo(for key: String) -> Bool + func deleteInfoForAllKeys() -> Bool +} + +extension SecureStorageAccessDefaultImpl { + var objc: DBXSecureStorageAccessDefaultImpl { + DBXSecureStorageAccessDefaultImpl(swift: self) + } +} + +@objc +open class DBXSecureStorageAccessImpl: NSObject, DBXSecureStorageAccess { + let swift: SecureStorageAccess + + public init(swift: SecureStorageAccess) { + self.swift = swift + } + + public func checkAccessibilityMigrationOneTime() { + swift.checkAccessibilityMigrationOneTime() + } + + public func setAccessTokenData(for userId: String, data: Data) -> Bool { + swift.setAccessTokenData(for: userId, data: data) + } + + public func getAllUserIds() -> [String] { + swift.getAllUserIds() + } + + public func getDropboxAccessToken(for key: String) -> DBXDropboxAccessToken? { + swift.getDropboxAccessToken(for: key)?.objc + } + + public func deleteInfo(for key: String) -> Bool { + swift.deleteInfo(for: key) + } + + public func deleteInfoForAllKeys() -> Bool { + swift.deleteInfoForAllKeys() + } +} + +@objc +public class DBXSecureStorageAccessDefaultImpl: DBXSecureStorageAccessImpl { + @objc + public convenience init() { + self.init(swift: SecureStorageAccessDefaultImpl()) + } + + fileprivate init(swift: SecureStorageAccessDefaultImpl) { + super.init(swift: swift) + } +} + +extension DBXSecureStorageAccess { + var swift: SecureStorageAccess { + SecureStorageAccessBridge(objc: self) + } +} + +public class SecureStorageAccessBridge: NSObject, SecureStorageAccess { + let objc: DBXSecureStorageAccess + + init(objc: DBXSecureStorageAccess) { + self.objc = objc + } + + public func checkAccessibilityMigrationOneTime() { + objc.checkAccessibilityMigrationOneTime() + } + + public func setAccessTokenData(for userId: String, data: Data) -> Bool { + objc.setAccessTokenData(for: userId, data: data) + } + + public func getAllUserIds() -> [String] { + objc.getAllUserIds() + } + + public func getDropboxAccessToken(for key: String) -> DropboxAccessToken? { + objc.getDropboxAccessToken(for: key)?.swift + } + + public func deleteInfo(for key: String) -> Bool { + objc.deleteInfo(for: key) + } + + public func deleteInfoForAllKeys() -> Bool { + objc.deleteInfoForAllKeys() + } +} diff --git a/Source/SwiftyDropboxUnitTests/OAuthImplTests.swift b/Source/SwiftyDropboxUnitTests/OAuthImplTests.swift new file mode 100644 index 000000000..460dab8ac --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/OAuthImplTests.swift @@ -0,0 +1,196 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +final class TestMobileOAuthImpl: XCTestCase { + var sut: DropboxOAuthManager! + var mockNetworkSession: MockNetworkSession! + var mockSecureStorageAccess: MockSecureStorageAccess! + + let appKey = "appkey" + let oauthTokenSecret = "oauth_token_secret" + let refreshToken = "refresh_token" + let accessToken = "access_token" + let userId = "user_id" + let userIdTwo = "user_id_2" + let state = "state" + + override func setUpWithError() throws { + mockNetworkSession = MockNetworkSession() + mockSecureStorageAccess = MockSecureStorageAccess() + sut = DropboxMobileOAuthManager( + appKey: appKey, + host: "www.dropbox.com", + secureStorageAccess: mockSecureStorageAccess, + networkSession: mockNetworkSession, + dismissSharedAppAuthController: {} + ) + } + + func testHandleRedirectURLCancelsWhenCancelPathProvided() throws { + let e = expectation(description: "completion called") + + let url = try URL(string: "db-\(appKey)://2/cancel").orThrow() + + _ = sut.handleRedirectURL(url) { result in + XCTAssert(result == DropboxOAuthResult.cancel) + e.fulfill() + } + + wait(for: [e], timeout: 1) + } + + func testHandleDauthRedirectURLStoresRecievesAndStoresTokenOnSuccess() throws { + let e = expectation(description: "completion called") + + let url = try exampleRedirectUrl(appKey: appKey) + + // fake that we're in a pkce session + hardcode pkce state + sut.authSession = OAuthPKCESession(scopeRequest: nil) + sut.authSession?.__test_only_setState(value: state) + + mockNetworkSession.mockInputs["OAuthTokenRequest"] = .success(json: [ + "token_type": "bearer", + "expires_in": 14_400, + "account_id": "dbid:some_account", + "refresh_token": refreshToken, + "scope": "account_info.read", + "access_token": "access_token", + "uid": userId, + ]) + + let expectedToken = DropboxAccessToken( + accessToken: accessToken, + uid: userId, + refreshToken: refreshToken, + tokenExpirationTimestamp: Date().timeIntervalSince1970 + ) + + _ = sut.handleRedirectURL(url) { result in + if case .success(let token) = result { + // expect token info passed through + XCTAssertEqual(token.accessToken, expectedToken.accessToken) + XCTAssertEqual(token.uid, expectedToken.uid) + XCTAssertEqual(token.refreshToken, expectedToken.refreshToken) + + // expect token stored + XCTAssertEqual(self.mockSecureStorageAccess.setAccessTokenDataPassed?.0, expectedToken.uid) + } else { + XCTFail() + } + + e.fulfill() + } + + wait(for: [e], timeout: 1) + } + + func testAccessTokenProviderForTokenReturnsCorrectProviderType() throws { + let longLivedToken = DropboxAccessToken(accessToken: accessToken, uid: userId) + let shortLivedToken = DropboxAccessToken( + accessToken: accessToken, + uid: userId, + refreshToken: refreshToken, + tokenExpirationTimestamp: Date().timeIntervalSince1970 + ) + + let expectShortLivedAccessProvider = sut.accessTokenProviderForToken(shortLivedToken) + let expectLongLivedAccessProvider = sut.accessTokenProviderForToken(longLivedToken) + + XCTAssertTrue(expectLongLivedAccessProvider is LongLivedAccessTokenProvider) + XCTAssertTrue(expectShortLivedAccessProvider is ShortLivedAccessTokenProvider) + } + + func testAccessTokensAreRetrievedFromSecureStorage() throws { + mockSecureStorageAccess.userIdsToTokens = exampleAccessTokenData() + + let fetchedTokens = sut.getAllAccessTokens().count + + XCTAssertEqual(exampleAccessTokenData().count, fetchedTokens) + } + + func testAccessTokenIsStoredInSecureStorage() throws { + let tokenToStore = exampleShortLivedAccessToken() + + sut.storeAccessToken(exampleShortLivedAccessToken()) + + XCTAssertEqual(mockSecureStorageAccess.setAccessTokenDataPassed?.0, tokenToStore.uid) + } + + func testCheckAccessibilityMigrationOneTimeCallsThroughToSecureStorage() throws { + sut.checkAccessibilityMigrationOneTime() + + XCTAssertTrue(mockSecureStorageAccess.migrationCheckCalled) + } + + func testURLSchemeRejectsIncorrectAppKeys() throws { + let e = expectation(description: "completion called") + + let url = try exampleRedirectUrl(appKey: "bad-app-key") + + _ = sut.handleRedirectURL(url) { result in + XCTAssertNil(result) + e.fulfill() + } + + wait(for: [e], timeout: 1) + } + + // MARK: Helpers + + func exampleLongLivedAccessToken() -> DropboxAccessToken { + DropboxAccessToken(accessToken: accessToken, uid: userId) + } + + func exampleShortLivedAccessToken() -> DropboxAccessToken { + DropboxAccessToken(accessToken: accessToken, uid: userIdTwo, refreshToken: refreshToken, tokenExpirationTimestamp: Date().timeIntervalSince1970) + } + + func exampleAccessTokenData() -> [String: DropboxAccessToken] { + [ + userId: exampleLongLivedAccessToken(), + userIdTwo: exampleShortLivedAccessToken(), + ] + } + + func exampleRedirectUrl(appKey: String) throws -> URL { + try URL(string: "db-\(appKey)://1/connect?oauth_token_secret=\(oauthTokenSecret)&uid=\(userId)&state=\(state)&oauth_token=oauth2code%3A").orThrow() + } +} + +class MockSecureStorageAccess: SecureStorageAccess { + var migrationCheckCalled = false + var setAccessTokenDataPassed: (String, Data)? + var deleteInfoCalled = false + var deleteInfoForAllKeysCalled = false + + var userIdsToTokens: [String: DropboxAccessToken] = [:] + + func checkAccessibilityMigrationOneTime() { + migrationCheckCalled = true + } + + func setAccessTokenData(for userId: String, data: Data) -> Bool { + setAccessTokenDataPassed = (userId, data) + return true + } + + func getAllUserIds() -> [String] { + Array(userIdsToTokens.keys) + } + + func getDropboxAccessToken(for key: String) -> SwiftyDropbox.DropboxAccessToken? { + userIdsToTokens[key] + } + + func deleteInfo(for key: String) -> Bool { + fatalError() + } + + func deleteInfoForAllKeys() -> Bool { + fatalError() + } +} diff --git a/Source/SwiftyDropboxUnitTests/ReconnectionHelperPersistedRequestInfoTests.swift b/Source/SwiftyDropboxUnitTests/ReconnectionHelperPersistedRequestInfoTests.swift new file mode 100644 index 000000000..18948d8f0 --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/ReconnectionHelperPersistedRequestInfoTests.swift @@ -0,0 +1,51 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +@testable import SwiftyDropbox +import XCTest + +final class TestReconnectionHelperPersistedRequestInfo: XCTestCase { + let routeName = "deleteV2" + let routeNamespace = "files" + let clientProvidedInfo = "example" + + let destination = URL(string: "/some/file.jpg")! + let overwrite = true + + lazy var uploadInfo: ReconnectionHelpers.PersistedRequestInfo = .upload( + ReconnectionHelpers.PersistedRequestInfo.StandardInfo( + originalSDKVersion: DropboxClientsManager.sdkVersion, + routeName: routeName, + routeNamespace: routeNamespace, + clientProvidedInfo: clientProvidedInfo + ) + ) + + lazy var downloadFileInfo: ReconnectionHelpers.PersistedRequestInfo = .downloadFile( + ReconnectionHelpers.PersistedRequestInfo.DownloadFileInfo( + originalSDKVersion: DropboxClientsManager.sdkVersion, + routeName: routeName, + routeNamespace: routeNamespace, + clientProvidedInfo: clientProvidedInfo, + destination: destination, + overwrite: overwrite + ) + ) + + func testCodingRoundtrip() throws { + XCTAssertEqual( + uploadInfo, + try ReconnectionHelpers.PersistedRequestInfo.from(jsonString: try uploadInfo.asJsonString()) + ) + } + + func testDownloadFileCodingRoundtrip() throws { + XCTAssertEqual( + downloadFileInfo, + try ReconnectionHelpers.PersistedRequestInfo.from(jsonString: try downloadFileInfo.asJsonString()) + ) + } +} diff --git a/Source/SwiftyDropboxUnitTests/Request+Async.test.swift b/Source/SwiftyDropboxUnitTests/Request+Async.test.swift new file mode 100644 index 000000000..523a84606 --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/Request+Async.test.swift @@ -0,0 +1,35 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +@available(iOS 13.0, macOS 10.15, *) +final class RequestAsyncTests: XCTestCase { + func testRpcResponseFails() async throws { + let mockTransferClient = MockDropboxTransportClient() + mockTransferClient.mockRequestHandler = MockDropboxTransportClient.alwaysFailMockRequestHandler + let apiClient = DropboxClient(transportClient: mockTransferClient) + + let exp = expectation(description: "should fail") + do { + _ = try await apiClient.check.user().response() + XCTFail("This should fail") + } catch { + exp.fulfill() + } + await fulfillment(of: [exp]) + } + + func testRpcResponseSucceeds() async throws { + let mockTransferClient = MockDropboxTransportClient() + mockTransferClient.mockRequestHandler = { request in + try? request.handleMockInput(.success(json: [:])) + } + let apiClient = DropboxClient(transportClient: mockTransferClient) + + let userCheck = try await apiClient.check.user().response() + XCTAssertNotNil(userCheck) + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestAsciiEncoding.swift b/Source/SwiftyDropboxUnitTests/TestAsciiEncoding.swift new file mode 100644 index 000000000..5d9d91acb --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestAsciiEncoding.swift @@ -0,0 +1,29 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +@testable import SwiftyDropbox +import XCTest + +final class TestAsciiEncoding: XCTestCase { + let stringsToEncodedStrings = [ + "héllø wörld": "h\\u00e9ll\\u00f8 w\\u00f6rld", + "hello": "hello", + "": "", + "こんにちは": "\\u3053\\u3093\\u306b\\u3061\\u306f", + "this has a clustered flag 🇺🇸": "this has a clustered flag \\ud83c\\uddfa\\ud83c\\uddf8", + "this is a big emoji 👩‍👩‍👧‍👦": "this is a big emoji \\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d\\udc66", + "🍺": "\\ud83c\\udf7a", + "this\nhas some whitespace": "this\nhas some whitespace", + ] + + func testEncodings() { + for (key, value) in stringsToEncodedStrings { + let lhs = Utilities.asciiEscape(key) + let rhs = value + XCTAssertEqual(lhs, rhs) + } + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestDropboxTransportClient.swift b/Source/SwiftyDropboxUnitTests/TestDropboxTransportClient.swift new file mode 100644 index 000000000..443003d9b --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestDropboxTransportClient.swift @@ -0,0 +1,97 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +final class TestDropboxTransportClient: XCTestCase { + var sut: DropboxTransportClient! + var mockNetworkSession: MockNetworkSession! + + override func setUpWithError() throws { + mockNetworkSession = MockNetworkSession() + } + + func testAdditionalHeadersForRouteHostAreAddedToRequest() throws { + sut = DropboxTransportClientImpl(accessToken: "", sessionCreation: { _, _, _ in + mockNetworkSession + }, headersForRouteHost: { _ in + ["key1": "value1"] + }) + + let urlRequest = try createRequestAndReturnURLRequest(for: Check.user) + + XCTAssertEqual( + urlRequest.allHTTPHeaderFields?["key1"], + "value1" + ) + } + + func testBaseAppHeadersAddedToRequest() throws { + sut = DropboxTransportClientImpl( + authStrategy: .appKeyAndSecret("appKey", "appSecret"), + userAgent: nil, + firstPartyUserAgent: "userAgent", + selectUser: nil, + sessionCreation: { _, _, _ in + mockNetworkSession + }, + authChallengeHandler: nil + ) + + let urlRequest = try createRequestAndReturnURLRequest(for: Check.app) + + let headers = try XCTUnwrap(urlRequest.allHTTPHeaderFields) + + XCTAssertEqual(headers["Content-Type"], "application/json") + XCTAssertEqual(headers["Authorization"], "Basic YXBwS2V5OmFwcFNlY3JldA==") + XCTAssertEqual(headers["User-Agent"], "userAgent") + } + + func testBaseUserTeamHeadersAddedToRequest() throws { + sut = DropboxTransportClientImpl( + authStrategy: .accessToken(LongLivedAccessTokenProvider(accessToken: "accessToken")), + userAgent: nil, + firstPartyUserAgent: "userAgent", + selectUser: nil, + sessionCreation: { _, _, _ in + mockNetworkSession + }, + authChallengeHandler: nil + ) + + let urlRequest = try createRequestAndReturnURLRequest(for: Check.user) + + let headers = try XCTUnwrap(urlRequest.allHTTPHeaderFields) + + XCTAssertEqual(headers["Content-Type"], "application/json") + XCTAssertEqual(headers["Authorization"], "Bearer accessToken") + XCTAssertEqual(headers["User-Agent"], "userAgent") + } + + private func createRequestAndReturnURLRequest(for route: Route) throws -> URLRequest { + let request = sut.request(route) + + let maybeApiRequest = request.request + let urlRequest = try urlRequest(from: maybeApiRequest) + return urlRequest + } + + private func urlRequest(from maybeApiRequest: ApiRequest?) throws -> URLRequest { + let apiRequest = try XCTUnwrap(maybeApiRequest) + + let expectation = expectation(description: "request created") + + let requestImpl = try XCTUnwrap(apiRequest as? RequestWithTokenRefresh) + + requestImpl.__test_only_mutableState.__test_only_setOnRequestCreation { + expectation.fulfill() + } + + wait(for: [expectation], timeout: 5) + + let maybeUrlRequest = apiRequest.networkTask?.originalRequest + return try XCTUnwrap(maybeUrlRequest) + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestMockingUtilities.swift b/Source/SwiftyDropboxUnitTests/TestMockingUtilities.swift new file mode 100644 index 000000000..0d7438586 --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestMockingUtilities.swift @@ -0,0 +1,91 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +final class TestMockingUtilities: XCTestCase { + func testExampleModel() throws { + let e = expectation(description: "webservice closure called") + + let (filesRoutes, mockTransportClient) = MockingUtilities.makeMock(forType: FilesRoutes.self) + let webService = ExampleWebService(routes: filesRoutes) + + webService.getMetadata { result, _ in + XCTAssertNotNil(result) + e.fulfill() + } + + let model: Files.Metadata = Files.FileMetadata( + name: "name", id: "id", clientModified: Date(), serverModified: Date(), rev: "123456789", size: 0 + ) + try mockTransportClient.getLastRequest()?.handleMockInput( + .success(model: model) + ) + + wait(for: [e], timeout: 1) + } + + func testExampleJsonFixture() throws { + let e = expectation(description: "webservice closure called") + + let (filesRoutes, mockTransportClient) = MockingUtilities.makeMock(forType: FilesRoutes.self) + let webService = ExampleWebService(routes: filesRoutes) + + webService.getMetadata { result, _ in + XCTAssertNotNil(result) + e.fulfill() + } + + let fileMetadataJSON: [String: Any] = + [ + ".tag": "file", + "id": "id", + "server_modified": "2023-12-15T13:43:32Z", + "name": "name", + "size": 0, + "client_modified": "2023-12-15T13:43:32Z", + "rev": "123456789", + "is_downloadable": 1, + ] + try mockTransportClient.getLastRequest()?.handleMockInput( + .success(json: fileMetadataJSON) + ) + + wait(for: [e], timeout: 1) + } + + func testExampleError() throws { + let e = expectation(description: "webservice closure called") + + let (filesRoutes, mockTransportClient) = MockingUtilities.makeMock(forType: FilesRoutes.self) + let webService = ExampleWebService(routes: filesRoutes) + + webService.getMetadata { _, error in + XCTAssertNotNil(error) + e.fulfill() + } + + let error = Files.GetMetadataError.path(.notFound) + try mockTransportClient.getLastRequest()?.handleMockInput( + .routeError(model: error) + ) + + wait(for: [e], timeout: 1) + } +} + +private class ExampleWebService { + var routes: FilesRoutes + + init(routes: FilesRoutes) { + self.routes = routes + } + + func getMetadata(completion: @escaping (Files.Metadata?, CallError?) -> Void) { + routes.getMetadata(path: "/real/path").response { result, error in + completion(result, error) + } + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestNetworkSessionManager+Background.swift b/Source/SwiftyDropboxUnitTests/TestNetworkSessionManager+Background.swift new file mode 100644 index 000000000..444ab710d --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestNetworkSessionManager+Background.swift @@ -0,0 +1,73 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +extension TestNetworkSessionManager { + func testRecievingADelegateCallbackForAnUnregisteredTaskWrapsAndRegistersIt() throws { + let request = sut.apiRequestData(request: { .example() }, networkTaskTag: "delegate-task") + let mockRequest = try XCTUnwrap(request as? MockApiRequest) + wait(for: taskCreationExpectations, timeout: 1) + + let underlyingTask = try XCTUnwrap(mockNetworkSession.tasks["delegate-task"] as? NetworkDataTask) + + sut.networkSession(mockNetworkSession, dataTask: underlyingTask, didReceive: Data()) + + XCTAssertEqual(sut.requestMap.getAllRequests().count, 1) + XCTAssertEqual(sut.requestMap.getAllRequests().first?.identifier, mockRequest.identifier) + } + + func testMultipleDelegateCallbacksDoNotLeadToMultipleRegistrations() throws { + let request = sut.apiRequestData(request: { .example() }, networkTaskTag: "delegate-task") + let mockRequest = try XCTUnwrap(request as? MockApiRequest) + wait(for: taskCreationExpectations, timeout: 1) + + let underlyingTask = try XCTUnwrap(mockNetworkSession.tasks["delegate-task"] as? NetworkDataTask) + + // First + sut.networkSession(mockNetworkSession, dataTask: underlyingTask, didReceive: Data()) + + // Second + sut.networkSession(mockNetworkSession, task: underlyingTask, didCompleteWithError: nil) + + XCTAssertEqual(createdRequestCount, 1) + XCTAssertEqual(sut.requestMap.getAllRequests().count, 1) + XCTAssertEqual(sut.requestMap.getAllRequests().first?.identifier, mockRequest.identifier) + } + + func testGetAllTasksRewrapsOnlyNewTasksAndReturnsAllUnownedApiRequests() throws { + let e = expectation(description: "completion called") + + // Set a network session id so that the manager knows it's a background session + // In background sessions we treat incoming unknown URLSessionDelegate calls differently + mockNetworkSession.identifier = "bg" + + let existingApiRequest = sut.apiRequestData(request: { .example() }, networkTaskTag: "delegate-task") + (existingApiRequest as? MockApiRequest)?.identifier = 0 + wait(for: taskCreationExpectations, timeout: 1) + + XCTAssertEqual(createdRequestCount, 1) + + // Add a pending task via URLSessionDelegate + let pendingViaDelegateTask = MockNetworkTaskDelegate(request: .example()) + pendingViaDelegateTask.taskIdentifier = 1 + sut.networkSession(sut.session, task: pendingViaDelegateTask, didSendBodyData: 0, totalBytesSent: 0, totalBytesExpectedToSend: 0) + + // add a pending task to be vended from URLSession.getAllTasks + let pendingViaCompletionTask = MockNetworkTaskDelegate(request: .example()) + pendingViaCompletionTask.taskIdentifier = 2 + + mockNetworkSession.tasksPendingReconnection = [pendingViaCompletionTask] + + sut.getAllTasks { requests in + XCTAssertEqual(requests.count, 2) + XCTAssertEqual(self.createdRequestCount, 3) + XCTAssertEqual(requests.idSet, [1, 2]) + e.fulfill() + } + + wait(for: [e], timeout: 1) + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestNetworkSessionManager.swift b/Source/SwiftyDropboxUnitTests/TestNetworkSessionManager.swift new file mode 100644 index 000000000..94961e37a --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestNetworkSessionManager.swift @@ -0,0 +1,218 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +final class TestNetworkSessionManager: XCTestCase { + var sut: NetworkSessionManager! + var mockNetworkSession: MockNetworkSession! + var createdRequestCount: Int = 0 + var certEvaluationResult: (URLSession.AuthChallengeDisposition, URLCredential?)! + var taskCreationExpectations: [XCTestExpectation] = [] + + override func setUpWithError() throws { + mockNetworkSession = MockNetworkSession() + + let apiRequestCreationBody: (NetworkTask) -> ApiRequest = { _ in + defer { self.createdRequestCount += 1 } + return MockApiRequest(identifier: self.createdRequestCount) + } + + let apiRequestCreation: ApiRequestCreation = { networkTaskCreation, onTaskCreation in + let taskCreationExpectation = self.expectation(description: "wait for task creation") + self.taskCreationExpectations.append(taskCreationExpectation) + + let networkTask = networkTaskCreation() + let apiRequest = apiRequestCreationBody(networkTask) + + // emulating the behavior of RequestWithToken refresh, which calls this block async after token refresh + DispatchQueue.global().async { + onTaskCreation(apiRequest) + taskCreationExpectation.fulfill() + } + return apiRequest + } + + let apiRequestReconnectionCreation: (NetworkTask) -> ApiRequest = { networkTask in + apiRequestCreationBody(networkTask) + } + + sut = NetworkSessionManager( + sessionCreation: { _, _ in + self.mockNetworkSession + }, + apiRequestCreation: apiRequestCreation, + apiRequestReconnectionCreation: apiRequestReconnectionCreation, + authChallengeHandler: { _ in + self.certEvaluationResult + } + ) + } + + func testCreatingEachTaskTypeRegistersToRequestMap() throws { + let one = sut.apiRequestData(request: { .example() }, networkTaskTag: nil) + let two = sut.apiRequestUpload(request: { .example() }, input: .data(.init()), networkTaskTag: nil) + let three = sut.apiRequestDownloadFile(request: { .example() }, networkTaskTag: nil) + + wait(for: taskCreationExpectations, timeout: 1) + XCTAssert(sut.requestMap.getAllRequests().count == [one, two, three].count) + } + + func testRequestMapDoesntStronglyRetainRequests() throws { + _ = sut.apiRequestData(request: { .example() }, networkTaskTag: nil) + _ = sut.apiRequestUpload(request: { .example() }, input: .data(.init()), networkTaskTag: nil) + _ = sut.apiRequestDownloadFile(request: { .example() }, networkTaskTag: nil) + + wait(for: taskCreationExpectations, timeout: 1) + XCTAssert(sut.requestMap.getAllRequests().count == 0) + } + + func testURLSessionDelegateDataTaskCallbacksAreForwardedToRequest() throws { + let dataExpectation = expectation(description: "completion called") + let completionExpectation = expectation(description: "data recieved called") + + let request = sut.apiRequestData(request: { .example() }, networkTaskTag: "delegate-task") + let mockRequest = try XCTUnwrap(request as? MockApiRequest) + + mockRequest.handleRecieveDataSignal = { + dataExpectation.fulfill() + } + + mockRequest.handleCompletionSignal = { + completionExpectation.fulfill() + } + + wait(for: taskCreationExpectations, timeout: 1) + + let underlyingTask = try XCTUnwrap(mockNetworkSession.tasks["delegate-task"] as? NetworkDataTask) + + sut.networkSession(mockNetworkSession, dataTask: underlyingTask, didReceive: Data()) + sut.networkSession(mockNetworkSession, task: underlyingTask, didCompleteWithError: nil) + + wait(for: [dataExpectation, completionExpectation], timeout: 1) + } + + func testURLSessionDelegateDownloadTaskProgressCallbacksAreForwardedToRequest() throws { + let e = expectation(description: "progress called") + + let request = sut.apiRequestDownloadFile(request: { .example() }, networkTaskTag: "delegate-task") + wait(for: taskCreationExpectations, timeout: 1) + + let underlyingTask = try XCTUnwrap(mockNetworkSession.tasks["delegate-task"] as? NetworkDownloadTask) + + let mockRequest = try XCTUnwrap(request as? MockApiRequest) + + mockRequest.handleWroteDownloadDataSignal = { + e.fulfill() + } + + sut.networkSession(mockNetworkSession, downloadTask: underlyingTask, didWriteData: 2, totalBytesWritten: 2, totalBytesExpectedToWrite: 8) + + wait(for: [e], timeout: 1) + } + + func testURLSessionDelegateDownloadTaskFinishedCallbacksAreForwardedToRequestSynchronously() throws { + let request = sut.apiRequestDownloadFile(request: { .example() }, networkTaskTag: "delegate-task") + wait(for: taskCreationExpectations, timeout: 1) + + let underlyingTask = try XCTUnwrap(mockNetworkSession.tasks["delegate-task"] as? NetworkDownloadTask) + + let mockRequest = try XCTUnwrap(request as? MockApiRequest) + + var pass = false + mockRequest.handleDownloadFinishedSignal = { + pass = true + } + + sut.networkSession(mockNetworkSession, downloadTask: underlyingTask, didFinishDownloadingTo: .example) + sut.networkSession(mockNetworkSession, downloadTask: underlyingTask, didWriteData: 2, totalBytesWritten: 2, totalBytesExpectedToWrite: 8) + + XCTAssertTrue(pass) + } + + func testURLSessionDelegateUploadTaskCallbacksAreForwardedToRequest() throws { + let e = expectation(description: "progress called") + + let request = sut.apiRequestUpload(request: { .example() }, input: .stream(.init(data: .init())), networkTaskTag: "delegate-task") + wait(for: taskCreationExpectations, timeout: 1) + + let underlyingTask = try XCTUnwrap(mockNetworkSession.tasks["delegate-task"] as? NetworkUploadTask) + let mockRequest = try XCTUnwrap(request as? MockApiRequest) + + sut.networkSession(mockNetworkSession, task: underlyingTask, didSendBodyData: 2, totalBytesSent: 2, totalBytesExpectedToSend: 8) + + mockRequest.handleSentBodyDataSignal = { + e.fulfill() + } + + wait(for: [e], timeout: 1) + } + + func testURLSessionDelegateProcessesAndPropogatesCertEvaluationClosure() throws { + let e = expectation(description: "completion called") + + certEvaluationResult = (.cancelAuthenticationChallenge, nil) + + sut.networkSession(mockNetworkSession, didReceive: URLAuthenticationChallenge()) { disposition, credential in + XCTAssertEqual( + disposition, + self.certEvaluationResult.0 + ) + XCTAssertEqual( + credential, + self.certEvaluationResult.1 + ) + e.fulfill() + } + + wait(for: [e], timeout: 1) + } + + func testShutdownInvalidatesNetworkSession() throws { + sut.shutdown() + XCTAssert(mockNetworkSession.invalidateCalled) + } + + func testShutdownManagerProvidersNoopApiRequests() throws { + sut.shutdown() + + let apiRequest = sut.apiRequestData(request: { .example() }, networkTaskTag: nil) + + XCTAssert(apiRequest is NoopApiRequest) + XCTAssert(apiRequest.networkTask is NoopNetworkTask) + } +} + +// MARK: + +func URLAuthenticationChallenge() -> URLAuthenticationChallenge { + .init( + protectionSpace: + .init( + host: "www.dropbox.com", + port: 80, + protocol: NSURLProtectionSpaceHTTPS, + realm: nil, + authenticationMethod: NSURLAuthenticationMethodServerTrust + ), + proposedCredential: nil, + previousFailureCount: 0, + failureResponse: nil, + error: nil, + sender: MockURLAuthenticationChallengeSender() + ) +} + +extension URL { + static var example: URL { + .init(string: "/files/file.tpm")! + } +} + +class MockURLAuthenticationChallengeSender: NSObject, URLAuthenticationChallengeSender { + func use(_ credential: URLCredential, for challenge: URLAuthenticationChallenge) {} + func continueWithoutCredential(for challenge: URLAuthenticationChallenge) {} + func cancel(_ challenge: URLAuthenticationChallenge) {} +} diff --git a/Source/SwiftyDropboxUnitTests/TestOAuthTokenRequest.swift b/Source/SwiftyDropboxUnitTests/TestOAuthTokenRequest.swift new file mode 100644 index 000000000..0bd4015df --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestOAuthTokenRequest.swift @@ -0,0 +1,197 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation +@testable import SwiftyDropbox +import XCTest + +class TestOAuthTokenRequest: XCTestCase { + var sut: OAuthTokenRequest! + var mockSession = MockNetworkSession() + + // MARK: Request creation + + func testThatRefreshRequestIsWellFormed() throws { + // Given + sut = OAuthTokenRefreshRequest( + dataTaskCreation: mockSession.dataTask(request:networkTaskTag:completionHandler:), + uid: "uid", + refreshToken: "refreshToken", + scopes: ["scope-1", "scope-2"], + appKey: "appKey", + locale: "locale" + ) + + // When + let result = sut.request + + // Then + XCTAssertEqual(result.httpMethod, "POST") + + XCTAssertQueryStringEqual( + String(data: sut.request.httpBody ?? .init(), encoding: .utf8), + "refresh_token=refreshToken&locale=locale&client_id=appKey&scope=scope-1%20scope-2&grant_type=refresh_token" + ) + + XCTAssertNotNil(result.allHTTPHeaderFields) + XCTAssertEqual( + result.allHTTPHeaderFields?["Content-Type"], + "application/x-www-form-urlencoded; charset=utf-8" + ) + } + + func testThatExchangeRequestIsWellFormed() throws { + // Given + sut = OAuthTokenExchangeRequest( + dataTaskCreation: mockSession.dataTask(request:networkTaskTag:completionHandler:), + oauthCode: "oauthCode", + codeVerifier: "codeVerifier", + appKey: "appKey", + locale: "locale", + redirectUri: "redirectUri" + ) + + // When + let result = sut.request + + // Then + XCTAssertNotNil(result.httpBody) + XCTAssertEqual(result.httpMethod, "POST") + + XCTAssertQueryStringEqual( + String(data: sut.request.httpBody ?? .init(), encoding: .utf8), + "client_id=appKey&code=oauthCode&code_verifier=codeVerifier&redirect_uri=redirectUri&grant_type=authorization_code&locale=locale" + ) + + XCTAssertEqual( + result.allHTTPHeaderFields?["Content-Type"], + "application/x-www-form-urlencoded; charset=utf-8" + ) + } + + // MARK: Response handling + + func testThatRefreshRequestCompletesWithTokenGivenSucessfulResponse() throws { + let e = expectation(description: "completion called") + + // Given + let date = Date() + sut = OAuthTokenRefreshRequest( + dataTaskCreation: mockSession.dataTask(request:networkTaskTag:completionHandler:), + uid: "uid", + refreshToken: "refreshToken", + scopes: ["scope-1", "scope-2"], + appKey: "appKey", + locale: "locale", + date: date + ) + + // When + var result: DropboxOAuthResult? + mockSession.mockInputs["OAuthTokenRequest"] = .success(json: [ + "token_type": "bearer", + "access_token": "accessToken", + "expires_in": 3_600.0, + ]) + + sut.start { oauthResult in + result = oauthResult + e.fulfill() + } + + waitForExpectations(timeout: 1) + + // Then + XCTAssertEqual(result, .success( + .init( + accessToken: "accessToken", + uid: "uid", + refreshToken: "refreshToken", + tokenExpirationTimestamp: date.addingTimeInterval(3_600).timeIntervalSince1970 + ) + )) + } + + func testThatRefreshRequestCompletesWithErrorGivenBadJSONInResponse() throws { + let e = expectation(description: "completion called") + + // Given + sut = OAuthTokenRefreshRequest( + dataTaskCreation: mockSession.dataTask(request:networkTaskTag:completionHandler:), + uid: "uid", + refreshToken: "refreshToken", + scopes: ["scope-1", "scope-2"], + appKey: "appKey", + locale: "locale" + ) + + // When + var result: DropboxOAuthResult? + mockSession.mockInputs["OAuthTokenRequest"] = .success(json: [ + "access_token": "accessToken", + ]) + + sut.start { oauthResult in + result = oauthResult + e.fulfill() + } + + waitForExpectations(timeout: 1) + + // Then + XCTAssertEqual(result, .error(.unknown, "Invalid response.")) + } + + func testThatRefreshRequestCompletesWithErrorWithMessageGivenOAuth2ErrorResponse() throws { + continueAfterFailure = false + let e = expectation(description: "completion called") + + // Given + let date = Date() + sut = OAuthTokenRefreshRequest( + dataTaskCreation: mockSession.dataTask(request:networkTaskTag:completionHandler:), + uid: "uid", + refreshToken: "refreshToken", + scopes: ["scope-1", "scope-2"], + appKey: "appKey", + locale: "locale", + date: date + ) + + // When + var result: DropboxOAuthResult? + mockSession.mockInputs["OAuthTokenRequest"] = .requestError(json: [ + "error": "unsupported_grant_type", + "error_description": "errorDescription", + ], code: 400) + + sut.start { oauthResult in + result = oauthResult + e.fulfill() + } + + waitForExpectations(timeout: 1) + + // Then + XCTAssertEqual(result, .error(OAuth2Error(errorCode: "unsupported_grant_type"), "errorDescription")) + } + + // MARK: Helpers + + public func XCTAssertQueryStringEqual( + _ expression1: @autoclosure () throws -> String?, + _ expression2: @autoclosure () throws -> String?, + _ message: @autoclosure () -> String = "", + file: StaticString = #filePath, + line: UInt = #line + ) { + let sortedQueryItems: (String?) -> [URLQueryItem]? = { string in + let components = string.flatMap { URLComponents(string: $0) } + let sort: (URLQueryItem, URLQueryItem) -> Bool = { $0.name < $1.name } + return components?.queryItems?.sorted(by: sort) + } + + XCTAssertEqual(try sortedQueryItems(expression1()), try sortedQueryItems(expression2())) + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestRequest.swift b/Source/SwiftyDropboxUnitTests/TestRequest.swift new file mode 100644 index 000000000..f998e889c --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestRequest.swift @@ -0,0 +1,117 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +final class TestRequest: XCTestCase { + var sut: DownloadRequestFile! + var mockApiRequest: MockApiRequest! + var apiRequest: ApiRequest! + var mockTask: MockNetworkTaskDelegate! + var persistedInfo: ReconnectionHelpers.PersistedRequestInfo! + + func setUp(with authStrategy: AuthStrategy, taskCreationExpectation: XCTestExpectation? = nil) throws { + mockTask = MockNetworkTaskDelegate(request: .example()) + apiRequest = RequestWithTokenRefresh( + requestCreation: { self.mockTask }, + onTaskCreation: { _ in taskCreationExpectation?.fulfill() }, + authStrategy: authStrategy, + filesAccess: FilesAccessImpl(fileManager: MockFileManager()) + ) + + sut = DownloadRequestFile( + request: apiRequest, + responseSerializer: Files.FileMetadataSerializer(), + errorSerializer: Files.DownloadErrorSerializer(), + moveToDestination: { url in url }, + errorDataFromLocation: { _ in Data() } + ) + + persistedInfo = ReconnectionHelpers.PersistedRequestInfo.downloadFile( + .init( + originalSDKVersion: DropboxClientsManager.sdkVersion, + routeName: "downloadRequestFile", + routeNamespace: "Files", + clientProvidedInfo: nil, + destination: .example, + overwrite: false + ) + ) + + apiRequest.taskDescription = try? persistedInfo.asJsonString() + } + + func testSettingPersistentStringBeforeTaskCreation() throws { + let expectation = expectation(description: "task creation") + try setUp(with: .accessToken(MockAccessTokenProvider()), taskCreationExpectation: expectation) + let persistedString = "persist this" + let _ = sut.persistingString(string: persistedString) + wait(for: [expectation], timeout: 1) + XCTAssertEqual(sut.clientPersistedString, persistedString) + } + + func testSettingPersistentStringAfterTaskCreation() throws { + let expectation = expectation(description: "task creation") + try setUp(with: .accessToken(MockAccessTokenProvider()), taskCreationExpectation: expectation) + wait(for: [expectation], timeout: 1) + let persistedString = "persist this" + let _ = sut.persistingString(string: persistedString) + XCTAssertEqual(sut.clientPersistedString, persistedString) + } + + @available(iOS 13.0, macOS 10.13, *) + func testSettingEarliestBeginDateBeforeTaskCreation() throws { + let expectation = expectation(description: "task creation") + try setUp(with: .accessToken(MockAccessTokenProvider()), taskCreationExpectation: expectation) + let date = Date(timeIntervalSince1970: 0) + let _ = sut.settingEarliestBeginDate(date: date) + wait(for: [expectation], timeout: 1) + XCTAssertEqual(sut.earliestBeginDate, date) + } + + @available(iOS 13.0, macOS 10.13, *) + func testSettingEarliestBeginDateAfterTaskCreation() throws { + let expectation = expectation(description: "task creation") + try setUp(with: .accessToken(MockAccessTokenProvider()), taskCreationExpectation: expectation) + wait(for: [expectation], timeout: 1) + let date = Date(timeIntervalSince1970: 0) + let _ = sut.settingEarliestBeginDate(date: date) + XCTAssertEqual(sut.earliestBeginDate, date) + } + + func testSelfRetainRetains() throws { + try setUp(with: .accessToken(MockAccessTokenProvider())) + + weak var request = sut + sut = nil + XCTAssertNotNil(request) + } + + func testSelfRetainEndsAfterCompletionExecution() throws { + try setUp(with: .accessToken(MockAccessTokenProvider())) + + let e = expectation(description: "completion handler") + weak var request = sut + sut = nil + + // Request will be retained until completion handler is called + request?.response(completionHandler: { _, _ in + e.fulfill() + }) + + apiRequest.handleCompletion(error: nil) + + wait(for: [e], timeout: 1) + + XCTAssertNil(request) + } + + func testUnderlyingRequestIsCalledWithAppAuth() throws { + let e = expectation(description: "task created") + try setUp(with: .appKeyAndSecret("key", "secret"), taskCreationExpectation: e) + wait(for: [e], timeout: 1) + XCTAssert(mockTask.resumeCalled) + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestRequestMap.swift b/Source/SwiftyDropboxUnitTests/TestRequestMap.swift new file mode 100644 index 000000000..3d101f0d9 --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestRequestMap.swift @@ -0,0 +1,155 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +final class TestRequestMap: XCTestCase { + var sut: RequestMapImpl! + + override func setUp() { + sut = RequestMapImpl() + } + + func testSetAndGet() throws { + let request1 = MockApiRequest(identifier: 1) + let request2 = MockApiRequest(identifier: 2) + sut.set(request: request1, taskIdentifier: 1) + sut.set(request: request2, taskIdentifier: 2) + + XCTAssertEqual( + request1.identifier, + sut.getRequest(taskIdentifier: 1)?.identifier + ) + + XCTAssertEqual( + request2.identifier, + sut.getRequest(taskIdentifier: 2)?.identifier + ) + } + + func testSetAndGetAll() throws { + let request1 = MockApiRequest(identifier: 1) + let request2 = MockApiRequest(identifier: 2) + sut.set(request: request1, taskIdentifier: 1) + sut.set(request: request2, taskIdentifier: 2) + XCTAssertEqual( + [request1, request2].idSet, + sut.getAllRequests().idSet + ) + } + + func testRemove() throws { + let request1 = MockApiRequest(identifier: 1) + let request2 = MockApiRequest(identifier: 2) + sut.set(request: request1, taskIdentifier: 1) + sut.set(request: request2, taskIdentifier: 2) + sut.removeRequest(taskIdentifier: 1) + XCTAssertEqual( + [request2].idSet, + sut.getAllRequests().idSet + ) + } + + func testRemoveAll() throws { + let request1 = MockApiRequest(identifier: 1) + let request2 = MockApiRequest(identifier: 2) + sut.set(request: request1, taskIdentifier: 1) + sut.set(request: request2, taskIdentifier: 2) + sut.removeAllRequests() + XCTAssertEqual( + [].idSet, + sut.getAllRequests().idSet + ) + } + + func testWeaklyReferencesRequests() throws { + sut.set(request: MockApiRequest(identifier: 1), taskIdentifier: 1) + sut.set(request: MockApiRequest(identifier: 2), taskIdentifier: 2) + + XCTAssertEqual( + [].idSet, + sut.getAllRequests().idSet + ) + } + + func testRetainsPendingReconnections() throws { + sut.setPendingReconnection(request: MockApiRequest(identifier: 1), taskIdentifier: 1) + sut.setPendingReconnection(request: MockApiRequest(identifier: 2), taskIdentifier: 2) + + XCTAssertEqual( + [1, 2], + sut.getAllRequests().idSet + ) + } + + func testCanStopRetainingReconnectedRequests() throws { + sut.setPendingReconnection(request: MockApiRequest(identifier: 1), taskIdentifier: 1) + sut.setPendingReconnection(request: MockApiRequest(identifier: 2), taskIdentifier: 2) + + XCTAssertEqual( + [1, 2], + sut.getAllRequests().idSet + ) + + sut.weakifyReferencesToReconnectedRequests() + + XCTAssertEqual( + [], + sut.getAllRequests().idSet + ) + } + + func testGetAllPendingReconnectionRequests() throws { + sut.setPendingReconnection(request: MockApiRequest(identifier: 1), taskIdentifier: 1) + sut.setPendingReconnection(request: MockApiRequest(identifier: 2), taskIdentifier: 2) + + let request = MockApiRequest(identifier: 3) + sut.set(request: request, taskIdentifier: 3) + + XCTAssertEqual( + [1, 2], + sut.getAllPendingReconnectionRequests().idSet + ) + } + + func testWillCleanupBoxesWithNilRequests() throws { + sut.__test_only_setCleanupThreshold(value: 3) + + sut.set(request: MockApiRequest(identifier: 1), taskIdentifier: 1) + sut.set(request: MockApiRequest(identifier: 2), taskIdentifier: 2) + + XCTAssertEqual(sut.__test_only_map.count, 2) + + sut.set(request: MockApiRequest(identifier: 3), taskIdentifier: 3) + + sut.cleanupEmptyBoxes() + + XCTAssertEqual(sut.__test_only_map.count, 0) + } + + func testWillNotCleanupBoxesWithNonNilRequests() throws { + sut.__test_only_setCleanupThreshold(value: 3) + + let request1 = MockApiRequest(identifier: 1) + let request2 = MockApiRequest(identifier: 2) + let request3 = MockApiRequest(identifier: 3) + let request4 = MockApiRequest(identifier: 4) + + sut.set(request: request1, taskIdentifier: 1) + sut.set(request: request2, taskIdentifier: 2) + sut.set(request: request3, taskIdentifier: 3) + sut.set(request: request4, taskIdentifier: 4) + + sut.cleanupEmptyBoxes() + + XCTAssertEqual(sut.__test_only_map.count, 4) + } +} + +extension Array where Element == ApiRequest { + var idSet: Set { + Set(map(\.identifier)) + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestRequestWithTokenRefresh.swift b/Source/SwiftyDropboxUnitTests/TestRequestWithTokenRefresh.swift new file mode 100644 index 000000000..c52df45bb --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestRequestWithTokenRefresh.swift @@ -0,0 +1,550 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +class TestRequestWithTokenRefresh: XCTestCase { + var sut: RequestWithTokenRefresh! + var mockAccessTokenProvider: MockAccessTokenProvider! + var mockFileManager: MockFileManager! + var mockFilesAccess: FilesAccess! + + override func setUpWithError() throws { + mockAccessTokenProvider = MockAccessTokenProvider() + mockFileManager = MockFileManager() + mockFilesAccess = FilesAccessImpl(fileManager: mockFileManager) + } + + // MARK: Handing oauth outcomes + + func testThatOriginalRequestResumesAfterOauthRequestSucceeds() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let expectation = expectation(description: "wait for task creation") + + // When + mockAccessTokenProvider.result = .success(.init(accessToken: "access-token", uid: "123abc")) + sut = makeRequestWithTokenRefresh(expectationFulfilledOnTaskCreation: expectation, request: urlTask) + + // Then + wait(for: [expectation], timeout: 1) + XCTAssert(urlTask.resumeCalled) + } + + func testThatOriginalRequestDoesNotResumeAndCompletionCalledAfterOauthRequestFails() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let e = expectation(description: "completion called") + + // When + mockAccessTokenProvider.result = .error(.accessDenied, "error") + sut = makeRequestWithTokenRefresh(request: urlTask) + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .dataCompletionHandler({ result in + XCTAssertEqual( + result.innerError as? ClientError, + ClientError.oauthError(OAuth2Error.accessDenied) + ) + e.fulfill() + }) + ) + + // Then + wait(for: [e], timeout: 1) + XCTAssertFalse(urlTask.resumeCalled) + } + + // MARK: Handling inputs via delegate + + func testThatIncomingDataIsAppendedToExistingData() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let testDataOne = Data("test-data-one".utf8) + let testDataTwo = Data("test-data-two".utf8) + + var expectedResult = testDataOne + expectedResult.append(testDataTwo) + + // When + sut = makeRequestWithTokenRefresh(request: urlTask) + sut.handleRecieve(data: testDataOne) + sut.handleRecieve(data: testDataTwo) + + // Then + _ = XCTWaiter.wait(for: [expectation(description: "wait for async")], timeout: 0.1) + + XCTAssert(urlTask.resumeCalled) + + XCTAssertEqual( + String(data: sut.__test_only_mutableState.data, encoding: .utf8), + String(data: expectedResult, encoding: .utf8) + ) + } + + func testThatACompletedDataTaskVendsDataInCompletionHandler() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let testData = Data("test-data-one".utf8) + let completionCalledExpectaion = expectation(description: "completion called") + let taskCreatedExpectation = expectation(description: "task created") + + // When + sut = makeRequestWithTokenRefresh(expectationFulfilledOnTaskCreation: taskCreatedExpectation, request: urlTask) + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .dataCompletionHandler({ result in + XCTAssertEqual( + String(data: result.successData ?? .init(), encoding: .utf8), + String(data: testData, encoding: .utf8) + ) + completionCalledExpectaion.fulfill() + }) + ) + + sut.handleRecieve(data: testData) + urlTask.response = successfulResponse() + + // Must wait for the task to be set before we call the completion handler + wait(for: [taskCreatedExpectation], timeout: 1) + sut.handleCompletion(error: nil) + + // Then + wait(for: [completionCalledExpectaion], timeout: 1) + } + + func testThatUploadProgressIsReportedThroughProgressHandlers() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let e = expectation(description: "completion called") + + // When + sut = makeRequestWithTokenRefresh(request: urlTask) + _ = sut.setProgressHandler { progress in + XCTAssertEqual( + 0.25, + progress.fractionCompleted + ) + e.fulfill() + } + + sut.handleSentBodyData(totalBytesSent: 2, totalBytesExpectedToSend: 8) + + // Then + wait(for: [e], timeout: 1) + } + + func testThatDownloadProgressIsReportedThroughProgressHandlers() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let e = expectation(description: "completion called") + + // When + sut = makeRequestWithTokenRefresh(request: urlTask) + _ = sut.setProgressHandler { progress in + XCTAssertEqual( + 0.25, + progress.fractionCompleted + ) + e.fulfill() + } + + sut.handleWroteDownloadData(totalBytesWritten: 2, totalBytesExpectedToWrite: 8) + + // Then + wait(for: [e], timeout: 1) + } + + // MARK: Threading + + func testThatCompletionHandlerDefaultsToMainThread() throws { + // Given + let e = expectation(description: "completion called") + + // When + sut = makeRequestWithTokenRefresh() + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .dataCompletionHandler({ _ in + XCTAssert(Thread.isMainThread) + e.fulfill() + }) + ) + sut.handleCompletion(error: nil) + + // Then + wait(for: [e], timeout: 1) + } + + func testThatCompletionHandlerThreadCanBeOverriden() throws { + // Given + let e = expectation(description: "completion called") + + // When + sut = makeRequestWithTokenRefresh() + + _ = sut.setCompletionHandler( + queue: DispatchQueue.global(qos: .default), + completionHandler: .dataCompletionHandler({ _ in + XCTAssertFalse(Thread.isMainThread) + e.fulfill() + }) + ) + sut.handleCompletion(error: nil) + + // Then + wait(for: [e], timeout: 1) + } + + func testThatOauthFailureCompletionCallWillNotDeadlock() throws { + // Given + let e = expectation(description: "reached end of completion block") + + // When + mockAccessTokenProvider.result = .error(.accessDenied, "error") + sut = makeRequestWithTokenRefresh() + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .dataCompletionHandler({ _ in + // This cancel call toggles the sut's internal lock + self.sut.cancel() + + e.fulfill() + }) + ) + + // Then + wait(for: [e], timeout: 1) + } + + func testThatCompletionHandlerCallWillNotDeadlock() throws { + // Given + let e = expectation(description: "reached end of completion block") + + // When + sut = makeRequestWithTokenRefresh() + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .dataCompletionHandler({ _ in + // This cancel call toggles the sut's internal lock + self.sut.cancel() + + e.fulfill() + }) + ) + sut.handleCompletion(error: nil) + + // Then + wait(for: [e], timeout: 1) + } + + func testThatLateSetCompletionHandlerCallWillNotDeadlock() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let e = expectation(description: "reached end of completion block") + + // When + sut = makeRequestWithTokenRefresh(request: urlTask) + + urlTask.response = successfulResponse() + sut.handleCompletion(error: nil) + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .dataCompletionHandler({ _ in + // This cancel call toggles the sut's internal lock + self.sut.cancel() + e.fulfill() + }) + ) + + // Then + wait(for: [e], timeout: 1) + } + + // MARK: Adding completion handler late + + func testThatACompletionHandlerIsCalledIfSetAfterTaskCompletion() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let e = expectation(description: "completion called") + + // When + sut = makeRequestWithTokenRefresh(request: urlTask) + + urlTask.response = successfulResponse() + sut.handleCompletion(error: nil) + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .dataCompletionHandler({ _ in + e.fulfill() + }) + ) + + // Then + wait(for: [e], timeout: 1) + } + + // MARK: Downloads + + func testThatDownloadedFileIsWrittenToSpecifiedLocation() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let completionExpectation = expectation(description: "completion called") + let taskCreationExpectation = expectation(description: "task created") + + // When + sut = makeRequestWithTokenRefresh(expectationFulfilledOnTaskCreation: taskCreationExpectation, request: urlTask) + + let myFile = "my-file".data(using: .utf8) + + let tempDownloadLocation = try XCTUnwrap(URL(string: UUID().uuidString)) + mockFileManager.addFile(data: myFile, at: tempDownloadLocation) + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .downloadFileCompletionHandler({ result in + if case .success((let url, _)) = result { + let completionData = self.mockFileManager.contents(at: url) + XCTAssertEqual(completionData, myFile) + } else { + XCTFail() + } + + completionExpectation.fulfill() + }) + ) + + urlTask.response = successfulResponse() + + // Must wait as download finished assumes that the request has been set + wait(for: [taskCreationExpectation], timeout: 1) + sut.handleDownloadFinished(location: tempDownloadLocation) + sut.handleCompletion(error: nil) + + // Then + wait(for: [completionExpectation], timeout: 1) + } + + func testThatDownloadErrorIsPresentInCompletionHandler() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let completionExpectation = expectation(description: "completion called") + let taskCreationExpectation = expectation(description: "task created") + + // When + sut = makeRequestWithTokenRefresh(expectationFulfilledOnTaskCreation: taskCreationExpectation, request: urlTask) + + let error = Files.DownloadError.unsupportedFile + let errorJson = try Files.DownloadErrorSerializer().serialize(error) + let errorJsonData = try SerializeUtil.dumpJSON(errorJson) + + let tempDownloadLocation = try XCTUnwrap(URL(string: UUID().uuidString)) + mockFileManager.addFile(data: errorJsonData, at: tempDownloadLocation) + + urlTask.response = routeErrorResponse() + + // Must wait as download finished assumes that the request has been set + wait(for: [taskCreationExpectation], timeout: 1) + sut.handleDownloadFinished(location: tempDownloadLocation) + sut.handleCompletion(error: nil) + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .downloadFileCompletionHandler({ result in + if case .failure(let networkTaskFailure) = result { + if case .badStatusCode(let completionData, _, _) = networkTaskFailure { + XCTAssertEqual(completionData, errorJsonData) + } + } + completionExpectation.fulfill() + }) + ) + + // Then + wait(for: [completionExpectation], timeout: 1) + } + + func testThatDownloadErrorIsPresentInLateSetCompletionHandler() throws { + // Given + let urlTask = MockNetworkTaskDelegate(request: .example()) + let completionExpectation = expectation(description: "completion called") + let taskCreationExpectation = expectation(description: "task created") + + // When + sut = makeRequestWithTokenRefresh(expectationFulfilledOnTaskCreation: taskCreationExpectation, request: urlTask) + + urlTask.response = successfulResponse() + + let routeResult = Check.EchoResult(result: "test") + let routeJson = try Check.EchoResultSerializer().serialize(routeResult) + let routeJsonData = try SerializeUtil.dumpJSON(routeJson) + + let tempDownloadLocation = try XCTUnwrap(URL(string: UUID().uuidString)) + mockFileManager.addFile(data: routeJsonData, at: tempDownloadLocation) + + // Must wait as download finished assumes that the request has been set + wait(for: [taskCreationExpectation], timeout: 1) + sut.handleDownloadFinished(location: tempDownloadLocation) + sut.handleCompletion(error: nil) + + _ = sut.setCompletionHandler( + queue: nil, + completionHandler: .downloadFileCompletionHandler({ result in + if case .success((let url, _)) = result { + let completionData = self.mockFileManager.contents(at: url) + XCTAssertEqual(completionData, routeJsonData) + } else { + XCTFail() + } + + completionExpectation.fulfill() + }) + ) + + // Then + wait(for: [completionExpectation], timeout: 1) + } + + fileprivate func makeRequestWithTokenRefresh( + expectationFulfilledOnTaskCreation expectation: XCTestExpectation? = nil, + request: NetworkTask = MockNetworkTaskDelegate(request: .example()) + ) -> RequestWithTokenRefresh { + RequestWithTokenRefresh( + requestCreation: { request }, + onTaskCreation: { _ in + expectation?.fulfill() + }, + authStrategy: .accessToken(mockAccessTokenProvider), + filesAccess: mockFilesAccess + ) + } +} + +// MARK: Helpers + +extension URLRequest { + static func example() -> URLRequest { + URLRequest(url: .init(string: "www.example.com")!) + } +} + +class MockAccessTokenProvider: AccessTokenProvider { + var result: DropboxOAuthResult? + + private let queue = DispatchQueue( + label: "com.dropbox.SwiftyDropbox.MockAccessTokenProvider.queue", + qos: .userInitiated, + attributes: .concurrent + ) + + var accessToken: String = "accessToken" + func refreshAccessTokenIfNecessary(completion: @escaping DropboxOAuthCompletion) { + // If the result is a failure, we immediately call the completion handler. + // In test, in that case, there is a race between calling and setting the completion handler. + // In real life, there isn't a race, because some network call is always made: + // oauth failures only come in server reponses, and successes lead to a post-auth call. + + queue.asyncAfter(deadline: .now() + .milliseconds(10)) { + completion(self.result) + } + } +} + +private func successfulResponse() -> HTTPURLResponse { + .init(url: .init(string: "www.example.com")!, statusCode: 200, httpVersion: "1.0", headerFields: [:])! +} + +private func routeErrorResponse() -> HTTPURLResponse { + .init(url: .init(string: "www.example.com")!, statusCode: 409, httpVersion: "1.0", headerFields: [:])! +} + +extension NetworkDataTaskResult { + var innerError: Error? { + if case .failure(let dataTaskError) = self { + if case .failedWithError(let innerError) = dataTaskError { + return innerError + } + } + return nil + } + + var successData: Data? { + if case .success((let data, _)) = self { + return data + } + return nil + } +} + +class MockFileManager { + var files: [String: Data] = [:] + + func addFile(data: Data?, at location: URL) { + files[location.path] = data + } + + func contents(at location: URL) -> Data? { + files[location.path] + } +} + +extension MockFileManager: FileManagerProtocol { + func contents(atPath: String) -> Data? { + files[atPath] + } + + func fileExists(atPath path: String) -> Bool { + files[path] != nil + } + + func createDirectory(at url: URL, withIntermediateDirectories: Bool, attributes: [FileAttributeKey: Any]?) throws { + // no-op + } + + func moveItem(atPath: String, toPath: String) throws { + files[toPath] = files[atPath] + files[atPath] = nil + } + + func moveItem(at atUrl: URL, to toUrl: URL) throws { + try moveItem(atPath: atUrl.path, toPath: toUrl.path) + } + + func removeItem(at url: URL) throws { + files[url.path] = nil + } +} + +extension ClientError: RawRepresentable, Equatable { + public typealias RawValue = String + + public init?(rawValue: String) { + fatalError("unimplemented") + } + + public var rawValue: String { + switch self { + case .oauthError: + return "oauthError" + case .urlSessionError: + return "urlSessionError" + case .fileAccessError: + return "fileAccessError" + case .requestObjectDeallocated: + return "requestObjectDeallocated" + case .unexpectedState: + return "unexpectedState" + case .other: + return "unknown" + } + } +} diff --git a/Source/SwiftyDropboxUnitTests/TestSecureStorageAccess.swift b/Source/SwiftyDropboxUnitTests/TestSecureStorageAccess.swift new file mode 100644 index 000000000..6dd2b5a63 --- /dev/null +++ b/Source/SwiftyDropboxUnitTests/TestSecureStorageAccess.swift @@ -0,0 +1,27 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +@testable import SwiftyDropbox +import XCTest + +final class TestSecureStorageAccess: XCTestCase { + private var appBundlePath: String! + private var extensionBundlePath: String! + + override func setUpWithError() throws { + appBundlePath = "private/var/containers/Bundle/Application/some-uuid/TestSwiftyDropbox_iOS.app" + + extensionBundlePath = "private/var/containers/Bundle/Application/some-uuid/TestSwiftyDropbox_iOS.app/PlugIns/TestSwiftyDropbox_ActionExtension.appex" + } + + func testCanFindAppBundleFromExtension() { + let bundlePath = SecureStorageAccessDefaultImpl.appBundlePath(from: extensionBundlePath) + XCTAssertEqual(bundlePath, appBundlePath) + } + + func testCanFindAppBundleFromApp() { + let bundlePath = SecureStorageAccessDefaultImpl.appBundlePath(from: appBundlePath) + XCTAssertEqual(bundlePath, appBundlePath) + } +} diff --git a/SwiftyDropbox.podspec b/SwiftyDropbox.podspec index f876d1ed6..c9dc79f94 100644 --- a/SwiftyDropbox.podspec +++ b/SwiftyDropbox.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SwiftyDropbox' - s.version = '9.2.0' + s.version = '10.0.0-beta.3' s.summary = 'Dropbox Swift SDK for API v2' s.homepage = 'https://dropbox.com/developers/' s.license = 'MIT' @@ -12,13 +12,11 @@ Pod::Spec.new do |s| s.ios.source_files = 'Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/**/*.{swift,h,m}' s.requires_arc = true - s.swift_version = '5.1' + s.swift_version = '5.6' - s.osx.deployment_target = '10.12' + s.osx.deployment_target = '10.13' s.ios.deployment_target = '11.0' s.osx.frameworks = 'AppKit', 'WebKit', 'SystemConfiguration', 'Foundation' s.ios.frameworks = 'UIKit', 'WebKit', 'SystemConfiguration', 'Foundation' - - s.dependency 'Alamofire', '~> 5.4.3' end diff --git a/SwiftyDropboxObjC.podspec b/SwiftyDropboxObjC.podspec new file mode 100644 index 000000000..6fc4d7854 --- /dev/null +++ b/SwiftyDropboxObjC.podspec @@ -0,0 +1,24 @@ +Pod::Spec.new do |s| + s.name = 'SwiftyDropboxObjC' + s.version = '10.0.0-beta.3' + s.summary = 'Objective-C Wrapper for Dropbox Swift SDK for API v2' + s.homepage = 'https://dropbox.com/developers/' + s.license = 'MIT' + s.author = { 'Stephen Cobbe' => 'scobbe@dropbox.com' } + s.source = { :git => 'https://github.com/dropbox/SwiftyDropbox.git', :tag => s.version } + + s.source_files = 'Source/SwiftyDropboxObjC/Shared/**/*.{swift,h,m}' + s.osx.source_files = 'Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/**/*.{swift,h,m}' + s.ios.source_files = 'Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/**/*.{swift,h,m}' + + s.requires_arc = true + s.swift_version = '5.6' + + s.osx.deployment_target = '10.13' + s.ios.deployment_target = '11.0' + + s.osx.frameworks = 'AppKit', 'WebKit', 'SystemConfiguration', 'Foundation' + s.ios.frameworks = 'UIKit', 'WebKit', 'SystemConfiguration', 'Foundation' + + s.dependency 'SwiftyDropbox', '~> 10.0.0-beta.3' +end diff --git a/TestSwiftyDropbox/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/TestSwiftyDropbox/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/TestSwiftyDropbox/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TestSwiftyDropbox/IntegrationTests/BackgroundSessionTestClasses.swift b/TestSwiftyDropbox/IntegrationTests/BackgroundSessionTestClasses.swift new file mode 100644 index 000000000..24f6faad2 --- /dev/null +++ b/TestSwiftyDropbox/IntegrationTests/BackgroundSessionTestClasses.swift @@ -0,0 +1,34 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation +import SwiftyDropbox + +enum BackgroundTestLogger { + static var cachesDirectory = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first! + static var logsFileURL = cachesDirectory.appendingPathComponent("app_logs.txt") + + static func log(_ message: String) { + NSLog(message) + appendToFile(fileURL: logsFileURL, content: message) + } + + static func appendToFile(fileURL: URL, content c: String) { + let content = c + "\n" + do { + if FileManager.default.fileExists(atPath: fileURL.path) { + let fileHandle = try FileHandle(forWritingTo: fileURL) + fileHandle.seekToEndOfFile() + if let data = content.data(using: .utf8) { + fileHandle.write(data) + } + fileHandle.closeFile() + } else { + try content.write(to: fileURL, atomically: true, encoding: .utf8) + } + } catch { + print("Error: Unable to append content to the file. \(error.localizedDescription)") + } + } +} diff --git a/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.h b/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.h new file mode 100644 index 000000000..087078ef9 --- /dev/null +++ b/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.h @@ -0,0 +1,175 @@ +/// +/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. +/// + +#import +#import + +@class TeamTests; + +@protocol DropboxTesting ++ (NSArray*_Nonnull)scopesForTests; +@property DBXFilesRoutes * _Nullable files; +@end + +@interface DropboxTester : NSObject ++ (NSArray*_Nonnull)scopesForTests; + +- (void)testAllUserAPIEndpoints:(void (^ _Nonnull)(void))nextTest asMember:(BOOL)asMember; +- (void)testFilesEndpoints:(void (^ _Nonnull)(void))nextTest asMember:(BOOL)asMember; + +@property DBXAuthRoutes * _Nullable auth; +@property DBXUsersRoutes * _Nullable users; +@property DBXFilesRoutes * _Nullable files; +@property DBXSharingRoutes * _Nullable sharing; + +@end + +@interface DropboxTeamTester : NSObject ++ (NSArray*_Nonnull)scopesForTests; + +- (void)setupDBXTestDataForTeamTests:(NSString * _Nonnull)teamMemberEmail emailToAddAsTeamMember:(NSString * _Nonnull)emailToAddAsTeamMember accountId:(NSString * _Nonnull)accountId accountId2:(NSString * _Nonnull)accountId2 accountId3:(NSString * _Nonnull)accountId3; + +- (void)testAllTeamMemberFileAcessActions:(void (^ _Nonnull)(void))nextTest; +- (void)testAllTeamMemberManagementActions:(void (^ _Nonnull)(void))nextTest; + +- (void)testTeamMemberFileAcessActions:(void (^ _Nonnull)(TeamTests *_Nonnull))nextTest; +- (void)testTeamMemberManagementActions:(void (^ _Nonnull)(void))nextTest; + +@property DBXTeamRoutes * _Nullable team; +@property DBXFilesRoutes * _Nullable files; + +@end + +@interface AuthTests : NSObject + +- (nonnull instancetype)init:(DropboxTester * _Nonnull)tester; + +- (void)tokenRevoke:(void (^_Nonnull)(void))nextTest; + +@property DropboxTester * _Nonnull tester; + +@end + +@interface FilesTests : NSObject + +- (nonnull instancetype)init:(DropboxTester * _Nonnull)tester; + +- (void)deleteV2:(void (^_Nonnull)(void))nextTest; +- (void)createFolderV2:(void (^_Nonnull)(void))nextTest; +- (void)listFolderError:(void (^_Nonnull)(void))nextTest; +- (void)listFolder:(void (^_Nonnull)(void))nextTest; +- (void)uploadData:(void (^_Nonnull)(void))nextTest; +- (void)uploadDataSession:(void (^_Nonnull)(void))nextTest; +- (void)dCopyV2:(void (^_Nonnull)(void))nextTest; +- (void)dCopyReferenceGet:(void (^_Nonnull)(void))nextTest; +- (void)getMetadata:(void (^_Nonnull)(void))nextTest; +- (void)getMetadataError:(void (^_Nonnull)(void))nextTest; +- (void)getTemporaryLink:(void (^_Nonnull)(void))nextTest; +- (void)listRevisions:(void (^_Nonnull)(void))nextTest; +- (void)moveV2:(void (^_Nonnull)(void))nextTest; +- (void)saveUrl:(void (^_Nonnull)(void))nextTest asMember:(BOOL)asMember; +- (void)downloadToFile:(void (^_Nonnull)(void))nextTest; +- (void)downloadToFileAgain:(void (^_Nonnull)(void))nextTest; +- (void)downloadToFileError:(void (^_Nonnull)(void))nextTest; +- (void)downloadToMemory:(void (^_Nonnull)(void))nextTest; +- (void)uploadFile:(void (^_Nonnull)(void))nextTest; +- (void)listFolderLongpollAndTrigger:(void (^_Nonnull)(void))nextTest asMember:(BOOL)asMember; + +@property DropboxTester * _Nonnull tester; + +@end + +@interface SharingTests : NSObject + +- (nonnull instancetype)init:(DropboxTester * _Nonnull)tester; + +- (void)shareFolder:(void (^_Nonnull)(void))nextTest; +- (void)createSharedLinkWithSettings:(void (^_Nonnull)(void))nextTest; +- (void)getFolderMetadata:(void (^_Nonnull)(void))nextTest; +- (void)addFolderMember:(void (^_Nonnull)(void))nextTest; +- (void)listFolderMembers:(void (^_Nonnull)(void))nextTest; +- (void)listFolders:(void (^_Nonnull)(void))nextTest; +- (void)listSharedLinks:(void (^_Nonnull)(void))nextTest; +- (void)removeFolderMember:(void (^_Nonnull)(void))nextTest; +- (void)revokeSharedLink:(void (^_Nonnull)(void))nextTest; +- (void)unmountFolder:(void (^_Nonnull)(void))nextTest; +- (void)mountFolder:(void (^_Nonnull)(void))nextTest; +- (void)updateFolderPolicy:(void (^_Nonnull)(void))nextTest; +- (void)unshareFolder:(void (^_Nonnull)(void))nextTest; + +@property DropboxTester * _Nonnull tester; +@property NSString * _Nonnull sharedFolderId; +@property NSString * _Nullable sharedLink; + +@end + +@interface UsersTests : NSObject + +- (nonnull instancetype)init:(DropboxTester * _Nonnull)tester; + +- (void)getAccount:(void (^_Nonnull)(void))nextTest; +- (void)getAccountBatch:(void (^_Nonnull)(void))nextTest; +- (void)getCurrentAccount:(void (^_Nonnull)(void))nextTest; +- (void)getSpaceUsage:(void (^_Nonnull)(void))nextTest; + +@property DropboxTester * _Nonnull tester; + +@end + +@interface TeamTests : NSObject + +- (nonnull instancetype)init:(DropboxTeamTester * _Nonnull)tester; + +// TeamMemberFileAccess +- (void)initMembersGetInfoAndMemberId:(void (^_Nonnull)(NSString * _Nullable))nextTest; +- (void)initMembersGetInfo:(void (^_Nonnull)(void))nextTest; +- (void)listMemberDevices:(void (^_Nonnull)(void))nextTest; +- (void)listMembersDevices:(void (^_Nonnull)(void))nextTest; +- (void)linkedAppsListMemberLinkedApps:(void (^_Nonnull)(void))nextTest; +- (void)linkedAppsListMembersLinkedApps:(void (^_Nonnull)(void))nextTest; +- (void)getInfo:(void (^_Nonnull)(void))nextTest; + +// TeamMemberManagement + +- (void)groupsCreate:(void (^_Nonnull)(void))nextTest; +- (void)groupsGetInfo:(void (^_Nonnull)(void))nextTest; +- (void)groupsList:(void (^_Nonnull)(void))nextTest; +- (void)groupsMembersAdd:(void (^_Nonnull)(void))nextTest; +- (void)groupsMembersList:(void (^_Nonnull)(void))nextTest; +- (void)groupsUpdate:(void (^_Nonnull)(void))nextTest; +- (void)groupsDelete:(void (^_Nonnull)(void))nextTest; +- (void)membersAdd:(void (^_Nonnull)(void))nextTest; +- (void)membersGetInfo:(void (^_Nonnull)(void))nextTest; +- (void)membersList:(void (^_Nonnull)(void))nextTest; +- (void)membersSendWelcomeEmail:(void (^_Nonnull)(void))nextTest; +- (void)membersSetAdminPermissions:(void (^_Nonnull)(void))nextTest; +- (void)membersSetProfile:(void (^_Nonnull)(void))nextTest; +- (void)membersRemove:(void (^_Nonnull)(void))nextTest; + +@property DropboxTeamTester * _Nonnull tester; +@property NSString * _Nonnull teamMemberId; +@property NSString * _Nonnull teamMemberId2; + +@end + +@interface TestFormat : NSObject + ++ (void)abort:(NSObject * _Nullable)routeError error:(DBXCallError * _Nullable)error; ++ (void)printErrors:(NSObject * _Nullable)routeError error:(DBXCallError * _Nullable)error; ++ (void)printRouteError:(NSObject * _Nullable)routeError; ++ (void)printError:(DBXCallError * _Nullable)error; ++ (void)printSentProgress:(int64_t)bytesSent + totalBytesSent:(int64_t)totalBytesSent + totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend; ++ (void)printTestBegin:(NSString * _Nonnull)title; ++ (void)printTestEnd; ++ (void)printAllTestsEnd; ++ (void)printSubTestBegin:(NSString * _Nonnull)title; ++ (void)printSubTestEnd:(NSString * _Nonnull)result; ++ (void)printTitle:(NSString * _Nonnull)title; ++ (void)printOffset:(NSString * _Nonnull)str; ++ (void)printSmallDivider; ++ (void)printLargeDivider; + +@end diff --git a/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.m b/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.m new file mode 100644 index 000000000..e4e789bc6 --- /dev/null +++ b/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestClasses.m @@ -0,0 +1,1624 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +#import "ObjCTestClasses.h" +#if TARGET_OS_IPHONE +#import +#elif TARGET_OS_MAC +#import +#endif + +void MyLog(NSString *format, ...) { + va_list args; + va_start(args, format); + NSString *formattedString = [[NSString alloc] initWithFormat:format arguments:args]; + va_end(args); + [[NSFileHandle fileHandleWithStandardOutput] writeData:[formattedString dataUsingEncoding:NSNEXTSTEPStringEncoding]]; +} + +@implementation DropboxTester ++ (NSArray*)scopesForTests { + return [@"account_info.read files.content.read files.content.write files.metadata.read files.metadata.write sharing.write sharing.read" componentsSeparatedByString:@" "]; +} + +- (instancetype)init { + self = [super init]; + if (self) { + self.auth = DBXDropboxClientsManager.authorizedClient.auth; + self.users = DBXDropboxClientsManager.authorizedClient.users; + self.files = DBXDropboxClientsManager.authorizedClient.files; + self.sharing = DBXDropboxClientsManager.authorizedClient.sharing; + } + return self; +} + +// Test user app with 'Full Dropbox' permission +- (void)testAllUserAPIEndpoints:(void (^)(void))nextTest asMember:(BOOL)asMember { + void (^end)(void) = ^{ + if (nextTest) { + nextTest(); + } else { + [TestFormat printAllTestsEnd]; + } + }; + void (^testUsersEndpoints)(void) = ^{ + [self testUsersEndpoints:end]; + }; + void (^testSharingEndpoints)(void) = ^{ + [self testSharingEndpoints:testUsersEndpoints]; + }; + void (^testFilesEndpoints)(void) = ^{ + [self testFilesEndpoints:testSharingEndpoints asMember:asMember]; + }; + void (^start)(void) = ^{ + testFilesEndpoints(); + }; + + start(); +} + +- (void)testFilesEndpoints:(void (^)(void))nextTest asMember:(BOOL)asMember { + FilesTests *filesTests = [[FilesTests alloc] init: self]; + + void (^end)(void) = ^{ + [TestFormat printTestEnd]; + nextTest(); + }; + void (^listFolderLongpollAndTrigger)(void) = ^{ + [filesTests listFolderLongpollAndTrigger:end asMember:asMember]; + }; + void (^uploadFile)(void) = ^{ + [filesTests uploadFile:listFolderLongpollAndTrigger]; + }; + void (^downloadToMemory)(void) = ^{ + [filesTests downloadToMemory:uploadFile]; + }; + void (^downloadToFileAgain)(void) = ^{ + [filesTests downloadToFileAgain:downloadToMemory]; + }; + void (^downloadToFile)(void) = ^{ + [filesTests downloadToFile:downloadToFileAgain]; + }; +// Async nature of this call can interfere with subsequent test runs by finishing after cleanup +// void (^saveUrl)(void) = ^{ +// [filesTests saveUrl:downloadToFile asMember:asMember]; +// }; + void (^move)(void) = ^{ + [filesTests moveV2:downloadToFile]; + }; + void (^listRevisions)(void) = ^{ + [filesTests listRevisions:move]; + }; + void (^getTemporaryLink)(void) = ^{ + [filesTests getTemporaryLink:listRevisions]; + }; + void (^getMetadataError)(void) = ^{ + [filesTests getMetadataError:getTemporaryLink]; + }; + void (^getMetadata)(void) = ^{ + [filesTests getMetadata:getMetadataError]; + }; + void (^dCopyReferenceGet)(void) = ^{ + [filesTests dCopyReferenceGet:getMetadata]; + }; + void (^dCopy)(void) = ^{ + [filesTests dCopyV2:dCopyReferenceGet]; + }; + void (^uploadDataSession)(void) = ^{ + [filesTests uploadDataSession:dCopy]; + }; + void (^uploadData)(void) = ^{ + [filesTests uploadData:uploadDataSession]; + }; + void (^listFolder)(void) = ^{ + [filesTests listFolder:uploadData]; + }; + void (^listFolderError)(void) = ^{ + [filesTests listFolderError:listFolder]; + }; + void (^createFolder)(void) = ^{ + [filesTests createFolderV2:listFolderError]; + }; + void (^delete_)(void) = ^{ + [filesTests deleteV2:createFolder]; + }; + void (^start)(void) = ^{ + delete_(); + }; + + [TestFormat printTestBegin:NSStringFromSelector(_cmd)]; + start(); +} + +- (void)testSharingEndpoints:(void (^)(void))nextTest { + SharingTests *sharingTests = [[SharingTests alloc] init:self]; + + void (^end)(void) = ^{ + [TestFormat printTestEnd]; + nextTest(); + }; + void (^unshareFolder)(void) = ^{ + [sharingTests updateFolderPolicy:end]; + }; + void (^updateFolderPolicy)(void) = ^{ + [sharingTests updateFolderPolicy:unshareFolder]; + }; + void (^mountFolder)(void) = ^{ + [sharingTests mountFolder:updateFolderPolicy]; + }; + void (^unmountFolder)(void) = ^{ + [sharingTests unmountFolder:mountFolder]; + }; + void (^revokeSharedLink)(void) = ^{ + [sharingTests revokeSharedLink:unmountFolder]; + }; + void (^removeFolderMember)(void) = ^{ + [sharingTests removeFolderMember:revokeSharedLink]; + }; + void (^listSharedLinks)(void) = ^{ + [sharingTests listSharedLinks:removeFolderMember]; + }; + void (^listFolders)(void) = ^{ + [sharingTests listFolders:listSharedLinks]; + }; + void (^listFolderMembers)(void) = ^{ + [sharingTests listFolderMembers:listFolders]; + }; + void (^addFolderMember)(void) = ^{ + [sharingTests addFolderMember:listFolderMembers]; + }; + void (^getFolderMetadata)(void) = ^{ + [sharingTests getFolderMetadata:addFolderMember]; + }; + void (^createSharedLinkWithSettings)(void) = ^{ + [sharingTests createSharedLinkWithSettings:getFolderMetadata]; + }; + void (^shareFolder)(void) = ^{ + [sharingTests shareFolder:createSharedLinkWithSettings]; + }; + void (^start)(void) = ^{ + shareFolder(); + }; + + [TestFormat printTestBegin:NSStringFromSelector(_cmd)]; + start(); +} + +- (void)testUsersEndpoints:(void (^)(void))nextTest { + UsersTests *usersTests = [[UsersTests alloc] init:self]; + + void (^end)(void) = ^{ + [TestFormat printTestEnd]; + nextTest(); + }; + void (^getSpaceUsage)(void) = ^{ + [usersTests getSpaceUsage:end]; + }; + void (^getCurrentAccount)(void) = ^{ + [usersTests getCurrentAccount:getSpaceUsage]; + }; + void (^getAccountBatch)(void) = ^{ + [usersTests getAccountBatch:getCurrentAccount]; + }; + void (^getAccount)(void) = ^{ + [usersTests getAccount:getAccountBatch]; + }; + void (^start)(void) = ^{ + getAccount(); + }; + + [TestFormat printTestBegin:NSStringFromSelector(_cmd)]; + start(); +} + +@end + +@implementation DropboxTeamTester ++ (NSArray*)scopesForTests { + NSString *scopesForTeamRoutesTests = @"groups.read groups.write members.delete members.read members.write sessions.list team_data.member team_info.read"; + NSString *scopesForMemberFileAccessUserTests = @"files.content.write files.content.read sharing.write account_info.read"; + return [[NSString stringWithFormat:@"%@ %@", + scopesForTeamRoutesTests, + scopesForMemberFileAccessUserTests] componentsSeparatedByString:@" "]; +} + +- (instancetype)init { + self = [super init]; + if (self) { + self.team = DBXDropboxClientsManager.authorizedTeamClient.team; + self.files = DBXDropboxClientsManager.authorizedClient.files; + } + return self; +} + +- (void)setupDBXTestDataForTeamTests:(NSString *)teamMemberEmail emailToAddAsTeamMember:(NSString *)emailToAddAsTeamMember accountId:(NSString *)accountId accountId2:(NSString *)accountId2 accountId3:(NSString *)accountId3 { + DBXTestData.teamMemberEmail = teamMemberEmail; + DBXTestData.newMemberEmail = emailToAddAsTeamMember; + DBXTestData.accountId3Email = emailToAddAsTeamMember; + + DBXTestData.accountId = accountId; + DBXTestData.accountId2 = accountId2; + DBXTestData.accountId3 = accountId3; +} + +// Test business app with 'Team member file access' permission +- (void)testAllTeamMemberFileAcessActions:(void (^)(void))nextTest { + void (^end)(void) = ^{ + if (nextTest) { + nextTest(); + } else { + [TestFormat printAllTestsEnd]; + } + }; + void (^testPerformActionAsMember)(TeamTests *) = ^(TeamTests *teamTests) { + [teamTests initMembersGetInfoAndMemberId:^(NSString * memberId){ + DropboxTester *tester = [[DropboxTester alloc] init]; + [tester testAllUserAPIEndpoints:end asMember:YES]; + }]; + }; + void (^testTeamMemberFileAcessActions)(void) = ^{ + [self testTeamMemberFileAcessActions:testPerformActionAsMember]; + }; + void (^start)(void) = ^{ + testTeamMemberFileAcessActions(); + }; + + start(); +} + +// Test business app with 'Team member management' permission +- (void)testAllTeamMemberManagementActions:(void (^)(void))nextTest { + void (^end)(void) = ^{ + if (nextTest) { + nextTest(); + } else { + [TestFormat printAllTestsEnd]; + } + }; + void (^testTeamMemberManagementActions)(void) = ^{ + [self testTeamMemberManagementActions:end]; + }; + void (^start)(void) = ^{ + testTeamMemberManagementActions(); + }; + + start(); +} + +- (void)testTeamMemberFileAcessActions:(void (^)(TeamTests *))nextTest { + TeamTests *teamTests = [[TeamTests alloc] init:self]; + + void (^end)(void) = ^{ + [TestFormat printTestEnd]; + nextTest(teamTests); + }; + void (^getInfo)(void) = ^{ + [teamTests getInfo:end]; + }; + void (^linkedAppsListMembersLinkedApps)(void) = ^{ + [teamTests linkedAppsListMembersLinkedApps:getInfo]; + }; + void (^linkedAppsListMemberLinkedApps)(void) = ^{ + [teamTests linkedAppsListMemberLinkedApps:linkedAppsListMembersLinkedApps]; + }; + void (^listMembersDevices)(void) = ^{ + [teamTests listMembersDevices:linkedAppsListMemberLinkedApps]; + }; + void (^listMemberDevices)(void) = ^{ + [teamTests listMemberDevices:listMembersDevices]; + }; + void (^initMembersGetInfo)(void) = ^{ + [teamTests initMembersGetInfo:listMemberDevices]; + }; + void (^start)(void) = ^{ + initMembersGetInfo(); + }; + + [TestFormat printTestBegin:NSStringFromSelector(_cmd)]; + start(); +} + +- (void)testTeamMemberManagementActions:(void (^)(void))nextTest { + TeamTests *teamTests = [[TeamTests alloc] init:self]; + + void (^end)(void) = ^{ + [TestFormat printTestEnd]; + nextTest(); + }; +// Comment this out until we understand the email_address_too_long_to_be_disabled error +// void (^membersRemove)(void) = ^{ +// [teamTests membersRemove:end]; +// }; + void (^membersSetProfile)(void) = ^{ + [teamTests membersSetProfile:end]; + }; + void (^membersSetAdminPermissions)(void) = ^{ + [teamTests membersSetAdminPermissions:membersSetProfile]; + }; + void (^membersSendWelcomeEmail)(void) = ^{ + [teamTests membersSendWelcomeEmail:membersSetAdminPermissions]; + }; + void (^membersList)(void) = ^{ + [teamTests membersList:membersSendWelcomeEmail]; + }; + void (^membersGetInfo)(void) = ^{ + [teamTests membersGetInfo:membersList]; + }; + void (^membersAdd)(void) = ^{ + [teamTests membersAdd:membersGetInfo]; + }; + void (^groupsDelete)(void) = ^{ + [teamTests groupsDelete:membersAdd]; + }; + void (^groupsUpdate)(void) = ^{ + [teamTests groupsUpdate:groupsDelete]; + }; + void (^groupsMembersList)(void) = ^{ + [teamTests groupsMembersList:groupsUpdate]; + }; + void (^groupsMembersAdd)(void) = ^{ + [teamTests groupsMembersAdd:groupsMembersList]; + }; + void (^groupsList)(void) = ^{ + [teamTests groupsList:groupsMembersAdd]; + }; + void (^groupsGetInfo)(void) = ^{ + [teamTests groupsGetInfo:groupsList]; + }; + void (^groupsCreate)(void) = ^{ + [teamTests groupsCreate:groupsGetInfo]; + }; + void (^initMembersGetInfo)(void) = ^{ + [teamTests initMembersGetInfo:groupsCreate]; + }; + void (^start)(void) = ^{ + initMembersGetInfo(); + }; + + [TestFormat printTestBegin:NSStringFromSelector(_cmd)]; + start(); +} + +@end + +/** + Dropbox User API Endpoint Tests + */ + +@implementation AuthTests + +- (instancetype)init:(DropboxTester *)tester { + self = [super init]; + if (self) { + _tester = tester; + } + return self; +} + +- (void)tokenRevoke:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.auth tokenRevoke] responseWithCompletionHandler:^(DBXCallError * _Nullable error) { + if (error) { + [TestFormat abort:nil error:error]; + } else { + [TestFormat printOffset:@"Token successfully revoked"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; +} + +@end + +@implementation FilesTests + +- (nonnull instancetype)init:(DropboxTester * _Nonnull)tester { + self = [super init]; + if (self) { + _tester = tester; + } + return self; +} + +- (void)deleteV2:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files deleteV2WithPath:DBXTestData.baseFolder] responseWithCompletionHandler:^(DBXFilesDeleteResult * _Nullable result, DBXFilesDeleteError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + } else { + DBXRateLimitError *rateLimitError = error.asRateLimitError; + if (rateLimitError) { + sleep(rateLimitError.error.retryAfter.unsignedIntValue); + [self deleteV2:nextTest]; + } else { + [TestFormat printErrors:routeError error:error]; + } + } + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + }]; +} + +- (void)createFolderV2:(void (^)(void))nextTest { + [self createFolderV2:nextTest retryCount:2]; +} + +- (void)createFolderV2:(void (^)(void))nextTest retryCount:(int)retryCount { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files createFolderV2WithPath:DBXTestData.testFolderPath] responseWithCompletionHandler:^(DBXFilesCreateFolderResult * _Nullable result, DBXFilesCreateFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + DBXRateLimitError *rateLimitError = error.asRateLimitError; + if (rateLimitError && retryCount > 0) { + sleep(rateLimitError.error.retryAfter.unsignedIntValue); + [self createFolderV2:nextTest retryCount:retryCount - 1]; + } else { + [TestFormat abort:routeError error:error]; + } + } + }]; +} + + +- (void)listFolderError:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files listFolderWithPath:@"/does/not/exist/folder"] responseWithCompletionHandler:^(DBXFilesListFolderResult * _Nullable result, DBXFilesListFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"Something went wrong... This should have errored.\n"); + [TestFormat abort:routeError error:error]; + } else { + [TestFormat printOffset:@"Intentionally errored.\n"]; + [TestFormat printErrors:routeError error:error]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; +} + +- (void)listFolder:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files listFolderWithPath:DBXTestData.testFolderPath] responseWithCompletionHandler:^(DBXFilesListFolderResult * _Nullable result, DBXFilesListFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)uploadData:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files uploadDataWithPath:DBXTestData.testFilePath input:DBXTestData.fileData] responseWithCompletionHandler:^(DBXFilesFileMetadata * _Nullable result, DBXFilesUploadError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)uploadDataSession:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files uploadSessionStartDataWithInput:DBXTestData.fileData] responseWithCompletionHandler:^(DBXFilesUploadSessionStartResult * _Nullable result, DBXFilesUploadSessionStartError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + NSNumber *offset = [NSNumber numberWithUnsignedInteger:DBXTestData.fileData.length]; + DBXFilesUploadSessionCursor *cursor = [[DBXFilesUploadSessionCursor alloc] initWithSessionId:result.sessionId offset:offset]; + [[self->_tester.files uploadSessionAppendV2DataWithCursor:cursor input:DBXTestData.fileData] responseWithQueue:dispatch_queue_create("uploadDataSession", NULL) completionHandler:^(DBXFilesUploadSessionAppendError * _Nullable routeError, DBXCallError * _Nullable error) { + if (routeError || error) { + [TestFormat abort:routeError error:error]; + } else { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)dCopyV2:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + NSString *copyOutputPath = [NSString + stringWithFormat:@"%@%@%@%@", DBXTestData.testFilePath, @"_duplicate", @"_", DBXTestData.testId]; + [[_tester.files copyV2FromPath:DBXTestData.testFilePath toPath:copyOutputPath] responseWithCompletionHandler:^(DBXFilesRelocationResult * _Nullable result, DBXFilesRelocationError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)dCopyReferenceGet:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files copyReferenceGetWithPath:DBXTestData.testFilePath] responseWithCompletionHandler:^(DBXFilesGetCopyReferenceResult * _Nullable result, DBXFilesGetCopyReferenceError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)getMetadata:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files getMetadataWithPath:DBXTestData.testFilePath] responseWithCompletionHandler:^(DBXFilesMetadata * _Nullable result, DBXFilesGetMetadataError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)getMetadataError:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files getMetadataWithPath:@"/this/path/does/not/exist"] responseWithCompletionHandler:^(DBXFilesMetadata * _Nullable result, DBXFilesGetMetadataError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"Something went wrong... This should have errored.\n"); + [TestFormat abort:routeError error:error]; + } else { + [TestFormat printOffset:@"Intentionally errored.\n"]; + [TestFormat printErrors:routeError error:error]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; +} + +- (void)getTemporaryLink:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files getTemporaryLinkWithPath:DBXTestData.testFilePath] responseWithCompletionHandler:^(DBXFilesGetTemporaryLinkResult * _Nullable result, DBXFilesGetTemporaryLinkError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)listRevisions:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files listRevisionsWithPath:DBXTestData.testFilePath] responseWithCompletionHandler:^(DBXFilesListRevisionsResult * _Nullable result, DBXFilesListRevisionsError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)moveV2:(void (^)(void))nextTest { +// [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; +// NSString *folderPath = [NSString stringWithFormat:@"%@%@%@", DBXTestData.testFolderPath, @"/", @"movedLocation"]; +// [[_tester.files createFolderV2WithPath:folderPath] responseWithQueue:dispatch_queue_create("moveV2", NULL) completionHandler:^(DBXFilesCreateFolderResult * _Nullable result, DBXFilesCreateFolderError * _Nullable routeError, DBXCallError * _Nullable error) { +// if (result) { +// MyLog(@"%@\n", result); +// [TestFormat printOffset:@"Created destination folder"]; +// +// NSString *destPath = +// [NSString stringWithFormat:@"%@%@%@", folderPath, @"/", DBXTestData.testFileName]; +// +// [[self->_tester.files moveV2FromPath:DBXTestData.testFolderPath toPath:destPath] responseWithQueue:dispatch_queue_create("moveV2", NULL) completionHandler:^(DBXFilesRelocationResult * _Nullable result, DBXFilesRelocationError * _Nullable routeError, DBXCallError * _Nullable error) { +// if (result) { +// MyLog(@"%@\n", result); +// [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; +// nextTest(); +// } else { +// [TestFormat abort:routeError error:error]; +// } +// }]; +// } else { +// [TestFormat abort:routeError error:error]; +// } +// }]; + nextTest(); +} + +- (void)saveUrl:(void (^)(void))nextTest asMember:(BOOL)asMember { + if (asMember) { + nextTest(); + return; + } + + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + NSString *folderPath = [NSString stringWithFormat:@"%@%@%@", DBXTestData.testFolderPath, @"/", @"dbx-test.html"]; + [[_tester.files saveUrlWithPath:folderPath url:@"https://www.google.com"] responseWithCompletionHandler:^(DBXFilesSaveUrlResult * _Nullable result, DBXFilesSaveUrlError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)downloadToFile:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files downloadURLWithPath:DBXTestData.testFilePath overwrite:YES destination:DBXTestData.destURL] responseWithCompletionHandler:^(DBXFilesFileMetadata * _Nullable result, NSURL * _Nullable destination, DBXFilesDownloadError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + NSData *data = [[NSFileManager defaultManager] contentsAtPath:[destination path]]; + NSString *dataStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + [TestFormat printOffset:@"File contents:"]; + MyLog(@"%@\n", dataStr); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)downloadToFileAgain:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files downloadURLWithPath:DBXTestData.testFilePath overwrite:YES destination:DBXTestData.destURL] responseWithCompletionHandler:^(DBXFilesFileMetadata * _Nullable result, NSURL * _Nullable destination, DBXFilesDownloadError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + NSData *data = [[NSFileManager defaultManager] contentsAtPath:[destination path]]; + NSString *dataStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + [TestFormat printOffset:@"File contents:"]; + MyLog(@"%@\n", dataStr); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)downloadToFileError:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + NSString *filePath = [NSString stringWithFormat:@"%@%@", DBXTestData.testFilePath, @"_does_not_exist"]; + [[_tester.files downloadURLWithPath:filePath overwrite:YES destination:DBXTestData.destURL] responseWithCompletionHandler:^(DBXFilesFileMetadata * _Nullable result, NSURL * _Nullable destination, DBXFilesDownloadError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"Something went wrong... This should have errored.\n"); + [TestFormat abort:routeError error:error]; + } else { + [TestFormat printOffset:@"Intentionally errored.\n"]; + [TestFormat printErrors:routeError error:error]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; +} + +- (void)downloadToMemory:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.files downloadWithPath:DBXTestData.testFilePath] responseWithCompletionHandler:^(DBXFilesFileMetadata * _Nullable result, NSData * _Nullable data, DBXFilesDownloadError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)uploadFile:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + NSString *outputPath = [NSString stringWithFormat:@"%@%@", DBXTestData.testFilePath, @"_from_file"]; + [[_tester.files uploadURLWithPath:outputPath input:DBXTestData.destURL] responseWithCompletionHandler:^(DBXFilesFileMetadata * _Nullable result, DBXFilesUploadError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)longpollCopy { + [TestFormat printOffset:@"Making change that longpoll will detect (copy file)"]; + NSString *copyOutputPath = + [NSString stringWithFormat:@"%@%@%@", DBXTestData.testFilePath, @"_duplicate2_", DBXTestData.testId]; + + __weak FilesTests *weakSelf = self; + [[self->_tester.files copyV2FromPath:DBXTestData.testFilePath toPath:copyOutputPath] responseWithCompletionHandler:^(DBXFilesRelocationResult * _Nullable result, DBXFilesRelocationError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + } else if ([error asRateLimitError]) { + sleep(error.asRateLimitError.error.retryAfter.unsignedIntValue); + [weakSelf longpollCopy]; + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)listFolderLongpollAndTrigger:(void (^)(void))nextTest asMember:(BOOL)asMember { + if (asMember) { + nextTest(); + return; + } + + void (^listFolderContinue)(NSString *) = ^(NSString *cursor) { + [[self->_tester.files listFolderContinueWithCursor:cursor] responseWithCompletionHandler:^(DBXFilesListFolderResult * _Nullable result, DBXFilesListFolderContinueError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + [TestFormat printOffset:@"Here are the changes:"]; + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; + }; + + __weak FilesTests *weakSelf = self; + void (^listFolderLongpoll)(NSString *) = ^(NSString *cursor) { + [TestFormat printOffset:@"Establishing longpoll"]; + [[self->_tester.files listFolderLongpollWithCursor:cursor] responseWithCompletionHandler:^(DBXFilesListFolderLongpollResult * _Nullable result, DBXFilesListFolderLongpollError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + if (result.changes) { + [TestFormat printOffset:@"Changes found"]; + listFolderContinue(cursor); + } else { + [TestFormat printOffset:@"Improperly set up changes trigger"]; + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; + + [weakSelf longpollCopy]; + }; + + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [TestFormat printOffset:@"Acquring cursor"]; + [[_tester.files listFolderGetLatestCursorWithPath:DBXTestData.testFolderPath] responseWithCompletionHandler:^(DBXFilesListFolderGetLatestCursorResult * _Nullable result, DBXFilesListFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + [TestFormat printOffset:@"Cursor acquired"]; + MyLog(@"%@\n", result); + listFolderLongpoll(result.cursor); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +@end + +@implementation SharingTests + +- (instancetype)init:(DropboxTester *)tester { + self = [super init]; + if (self) { + _tester = tester; + _sharedFolderId = @"placeholder"; + _sharedLink = @"placeholder"; + } + return self; +} + +- (void)shareFolder:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing shareFolderWithPath:DBXTestData.testShareFolderPath] responseWithCompletionHandler:^(DBXSharingShareFolderLaunch * _Nullable result, DBXSharingShareFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + if (result.asAsyncJobId) { + [TestFormat + printOffset:[NSString stringWithFormat:@"Folder not yet shared! Job id: %@. Please adjust test order.", + result.asAsyncJobId]]; + } else if (result.asComplete) { + MyLog(@"%@\n", result.asComplete); + self->_sharedFolderId = result.asComplete.complete.sharedFolderId; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat printOffset:[NSString stringWithFormat:@"Unknown result: %@", result]]; + [TestFormat abort:routeError error:error]; + } + } else { + DBXRateLimitError *rateLimitError = error.asRateLimitError; + if (rateLimitError) { + sleep(rateLimitError.error.retryAfter.unsignedIntValue); + [self shareFolder:nextTest]; + } else { + [TestFormat abort:routeError error:error]; + } + } + }]; +} + +- (void)createSharedLinkWithSettings:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing createSharedLinkWithSettingsWithPath:DBXTestData.testShareFolderPath] responseWithCompletionHandler:^(DBXSharingSharedLinkMetadata * _Nullable result, DBXSharingCreateSharedLinkWithSettingsError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + self->_sharedLink = result.url; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)getFolderMetadata:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing getFolderMetadataWithSharedFolderId:_sharedFolderId] responseWithCompletionHandler:^(DBXSharingSharedFolderMetadata * _Nullable result, DBXSharingSharedFolderAccessError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)addFolderMember:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXSharingMemberSelectorEmail *memberSelector = [[DBXSharingMemberSelectorEmail alloc] init: DBXTestData.accountId3Email]; + DBXSharingAddMember *addFolderMemberArg = [[DBXSharingAddMember alloc] initWithMember:memberSelector accessLevel:[[DBXSharingAccessLevelViewer alloc] init]]; + [[_tester.sharing addFolderMemberWithSharedFolderId:_sharedFolderId members:@[addFolderMemberArg]] responseWithCompletionHandler:^(DBXSharingAddFolderMemberError * _Nullable routeError, DBXCallError * _Nullable error) { + if (routeError || error) { + [TestFormat abort:routeError error:error]; + } else { + [TestFormat printOffset:@"Folder member added"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; +} + +- (void)listFolderMembers:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing listFolderMembersWithSharedFolderId:_sharedFolderId] responseWithCompletionHandler:^(DBXSharingSharedFolderMembers * _Nullable result, DBXSharingSharedFolderAccessError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)listFolders:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing listFoldersWithLimit:[NSNumber numberWithInteger:2] actions:nil] responseWithCompletionHandler:^(DBXSharingListFoldersResult * _Nullable result, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:nil error:error]; + } + }]; +} + +- (void)listSharedLinks:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing listSharedLinks] responseWithCompletionHandler:^(DBXSharingListSharedLinksResult * _Nullable result, DBXSharingListSharedLinksError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)checkJobStatus:(NSString *)asyncJobId retryCount:(int)retryCount nextTest:(void (^)(void))nextTest{ + [[_tester.sharing checkJobStatusWithAsyncJobId:asyncJobId] responseWithCompletionHandler:^(DBXSharingJobStatus * _Nullable result, DBXAsyncPollError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + if ([result asInProgress]) { + [TestFormat + printOffset:[NSString + stringWithFormat:@"Folder member not yet removed! Job id: %@. Please adjust test order.", + asyncJobId]]; + + if (retryCount > 0) { + MyLog(@"Sleeping for 3 seconds, then trying again"); + for (int i = 0; i < 3; i++) { + sleep(1); + MyLog(@"."); + } + MyLog(@"\n"); + [TestFormat printOffset:@"Retrying!"]; + [self checkJobStatus:asyncJobId retryCount:retryCount - 1 nextTest:nextTest]; + } + } else if ([result asComplete]) { + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else if ([result asFailed]) { + [TestFormat abort:routeError error:error]; + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)removeFolderMember:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + + DBXSharingMemberSelectorEmail *memberSelector = [[DBXSharingMemberSelectorEmail alloc] init: DBXTestData.accountId3Email]; + + void (^checkJobStatus)(NSString *) = ^(NSString *asyncJobId) { + [self checkJobStatus:asyncJobId retryCount:5 nextTest:nextTest]; + }; + + [[_tester.sharing removeFolderMemberWithSharedFolderId:_sharedFolderId member:memberSelector leaveACopy:[NSNumber numberWithBool:NO]] responseWithCompletionHandler:^(DBXAsyncLaunchResultBase * _Nullable result, DBXSharingRemoveFolderMemberError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + if ([result asAsyncJobId]) { + [TestFormat printOffset:[NSString stringWithFormat:@"Folder member not yet removed! Job id: %@", + result.asAsyncJobId.asyncJobId]]; + MyLog(@"Sleeping for 5 seconds, then trying again"); + for (int i = 0; i < 5; i++) { + sleep(1); + MyLog(@"."); + } + MyLog(@"\n"); + [TestFormat printOffset:@"Retrying!"]; + checkJobStatus(result.asAsyncJobId.asyncJobId); + } else { + [TestFormat printOffset:[NSString stringWithFormat:@"removeFolderMember result not properly handled."]]; + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)revokeSharedLink:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing revokeSharedLinkWithUrl:_sharedLink] responseWithCompletionHandler:^(DBXSharingRevokeSharedLinkError * _Nullable routeError, DBXCallError * _Nullable error) { + if (routeError || error) { + [TestFormat abort:routeError error:error]; + } else { + [TestFormat printOffset:@"Shared link revoked"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; +} + +- (void)unmountFolder:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing unmountFolderWithSharedFolderId:_sharedFolderId] responseWithCompletionHandler:^(DBXSharingUnmountFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (routeError || error) { + [TestFormat abort:routeError error:error]; + } else { + [TestFormat printOffset:@"Folder unmounted"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + }]; +} + +- (void)mountFolder:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing mountFolderWithSharedFolderId:_sharedFolderId] responseWithCompletionHandler:^(DBXSharingSharedFolderMetadata * _Nullable result, DBXSharingMountFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printOffset:@"Folder mounted"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)updateFolderPolicy:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing updateFolderPolicyWithSharedFolderId:_sharedFolderId] responseWithCompletionHandler:^(DBXSharingSharedFolderMetadata * _Nullable result, DBXSharingUpdateFolderPolicyError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)unshareFolder:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.sharing unshareFolderWithSharedFolderId:_sharedFolderId] responseWithCompletionHandler:^(DBXAsyncLaunchEmptyResult * _Nullable result, DBXSharingUnshareFolderError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +@end + +@implementation UsersTests + +- (instancetype)init:(DropboxTester *)tester { + self = [super init]; + if (self) { + _tester = tester; + } + return self; +} + +- (void)getAccount:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.users getAccountWithAccountId:DBXTestData.accountId] responseWithCompletionHandler:^(DBXUsersBasicAccount * _Nullable result, DBXUsersGetAccountError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)getAccountBatch:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + NSArray *accountIds = @[DBXTestData.accountId, DBXTestData.accountId2]; + [[_tester.users getAccountBatchWithAccountIds:accountIds] responseWithCompletionHandler:^(NSArray * _Nullable result, DBXUsersGetAccountBatchError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)getCurrentAccount:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.users getCurrentAccount] responseWithCompletionHandler:^(DBXUsersFullAccount * _Nullable result, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:nil error:error]; + } + }]; +} + +- (void)getSpaceUsage:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.users getSpaceUsage] responseWithCompletionHandler:^(DBXUsersSpaceUsage * _Nullable result, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:nil error:error]; + } + }]; +} + +@end + +/** + Dropbox TEAM API Endpoint Tests + */ + +@implementation TeamTests + +- (instancetype)init:(DropboxTeamTester *)tester { + self = [super init]; + if (self) { + _tester = tester; + } + return self; +} + +/** + Permission: TEAM member file access + */ +- (void)initMembersGetInfo:(void (^)(void))nextTest { + [self initMembersGetInfoAndMemberId:^(NSString * _Nullable memberId) { + nextTest(); + }]; +} + +- (void)initMembersGetInfoAndMemberId:(void (^)(NSString * _Nullable))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamUserSelectorArgEmail *userSelectArg = [[DBXTeamUserSelectorArgEmail alloc] init:DBXTestData.teamMemberEmail]; + [[_tester.team membersGetInfoWithMembers:@[userSelectArg]] responseWithCompletionHandler:^(NSArray * _Nullable result, DBXTeamMembersGetInfoError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + DBXTeamMembersGetInfoItem *getInfo = result[0]; + if ([getInfo asIdNotFound]) { + [TestFormat abort:routeError error:error]; + } else if ([getInfo asMemberInfo]) { + self->_teamMemberId = getInfo.asMemberInfo.memberInfo.profile.teamMemberId; + DBXDropboxClientsManager.authorizedClient = [DBXDropboxClientsManager.authorizedTeamClient asMember:self->_teamMemberId]; + } + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(self->_teamMemberId); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)listMemberDevices:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.team devicesListMemberDevicesWithTeamMemberId:_teamMemberId] responseWithCompletionHandler:^(DBXTeamListMemberDevicesResult * _Nullable result, DBXTeamListMemberDevicesError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)listMembersDevices:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.team devicesListMembersDevices] responseWithCompletionHandler:^(DBXTeamListMembersDevicesResult * _Nullable result, DBXTeamListMembersDevicesError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)linkedAppsListMemberLinkedApps:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.team linkedAppsListMemberLinkedAppsWithTeamMemberId:_teamMemberId] responseWithCompletionHandler:^(DBXTeamListMemberAppsResult * _Nullable result, DBXTeamListMemberAppsError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)linkedAppsListMembersLinkedApps:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.team linkedAppsListMembersLinkedApps] responseWithCompletionHandler:^(DBXTeamListMembersAppsResult * _Nullable result, DBXTeamListMembersAppsError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)getInfo:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.team getInfo] responseWithCompletionHandler:^(DBXTeamTeamGetInfoResult * _Nullable result, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:nil error:error]; + } + }]; +} + +/** + Permission: TEAM member management + */ + +- (void)groupsCreate:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + NSString *groupName = [[NSString alloc] initWithFormat: @"objc-compatibility-%@", DBXTestData.groupName]; + [[_tester.team groupsCreateWithGroupName:groupName addCreatorAsOwner:[NSNumber numberWithBool:NO] groupExternalId:DBXTestData.groupExternalIdDashObjc groupManagementType:nil] responseWithCompletionHandler:^(DBXTeamGroupFullInfo * _Nullable result, DBXTeamGroupCreateError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)groupsGetInfo:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamGroupsSelector * groupsSelector = [[DBXTeamGroupsSelectorGroupExternalIds alloc] init:@[DBXTestData.groupExternalIdDashObjc]]; + [[_tester.team groupsGetInfoWithGroupsSelector:groupsSelector] responseWithCompletionHandler:^(NSArray * _Nullable result, DBXTeamGroupsGetInfoError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)groupsList:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.team groupsList] responseWithCompletionHandler:^(DBXTeamGroupsListResult * _Nullable result, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:nil error:error]; + } + }]; +} + +- (void)groupsMembersAdd:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamGroupSelectorGroupExternalId *groupSelector = [[DBXTeamGroupSelectorGroupExternalId alloc] init:DBXTestData.groupExternalIdDashObjc]; + DBXTeamUserSelectorArg *userSelectorArg = [[DBXTeamUserSelectorArgTeamMemberId alloc] init:_teamMemberId]; + DBXTeamGroupAccessTypeMember *accessType = [[DBXTeamGroupAccessTypeMember alloc] init]; + DBXTeamMemberAccess *memberAccess = [[DBXTeamMemberAccess alloc] initWithUser:userSelectorArg accessType:accessType]; + + [[_tester.team groupsMembersAddWithGroup:groupSelector members:@[memberAccess]] responseWithCompletionHandler:^(DBXTeamGroupMembersChangeResult * _Nullable result, DBXTeamGroupMembersAddError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)groupsMembersList:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamGroupSelectorGroupExternalId *groupSelector = [[DBXTeamGroupSelectorGroupExternalId alloc] init:DBXTestData.groupExternalIdDashObjc]; + + [[_tester.team groupsMembersListWithGroup:groupSelector] responseWithCompletionHandler:^(DBXTeamGroupsMembersListResult * _Nullable result, DBXTeamGroupSelectorError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)groupsUpdate:(void (^)(void))nextTest { +// [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; +// DBXTeamGroupSelectorGroupExternalId *groupSelector = [[DBXTeamGroupSelectorGroupExternalId alloc] init:DBXTestData.groupExternalIdDashObjc]; +// +// [[_tester.team groupsUpdateWithGroup:groupSelector returnMembers:[NSNumber numberWithBool:YES] newGroupName:@"New Group Name ObjC" newGroupExternalId:nil newGroupManagementType:nil] responseWithCompletionHandler:^(DBXTeamGroupFullInfo * _Nullable result, DBXTeamGroupUpdateError * _Nullable routeError, DBXCallError * _Nullable error) { +// if (result) { +// MyLog(@"%@\n", result); +// [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; +// nextTest(); +// } else { +// [TestFormat abort:routeError error:error]; +// } +// }]; + nextTest(); +} + +- (void)checkGroupDeleteStatus:(NSString *)jobId nextTest:(void (^)(void))nextTest retryCount:(int)retryCount { + [[_tester.team groupsJobStatusGetWithAsyncJobId:jobId] responseWithCompletionHandler:^(DBXAsyncPollEmptyResult * _Nullable result, DBXTeamGroupsPollError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + if (result.asInProgress) { + if (retryCount == 0) { + [TestFormat abort:routeError error:error]; + } + [TestFormat printOffset:@"Waiting for deletion..."]; + sleep(1); + [self checkGroupDeleteStatus:jobId nextTest:nextTest retryCount:retryCount - 1]; + } else { + [TestFormat printOffset:@"Deleted"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)groupsDelete:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + + void (^jobStatus)(NSString *) = ^(NSString *jobId) { + [self checkGroupDeleteStatus:jobId nextTest:nextTest retryCount:3]; + }; + + DBXTeamGroupSelectorGroupExternalId *groupSelector = [[DBXTeamGroupSelectorGroupExternalId alloc] init:DBXTestData.groupExternalIdDashObjc]; + + [[_tester.team groupsDeleteWithGroupSelector:groupSelector] responseWithCompletionHandler:^(DBXAsyncLaunchEmptyResult * _Nullable result, DBXTeamGroupDeleteError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + if ([result asAsyncJobId]) { + [TestFormat printOffset:@"Waiting for deletion..."]; + sleep(1); + jobStatus(result.asAsyncJobId.asyncJobId); + } else if ([result asComplete]) { + [TestFormat printOffset:@"Deleted"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)membersAdd:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + void (^jobStatus)(NSString *) = ^(NSString *jobId) { + [[self->_tester.team membersAddJobStatusGetWithAsyncJobId:jobId] responseWithCompletionHandler:^(DBXTeamMembersAddJobStatus * _Nullable result, DBXAsyncPollError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + if ([result asInProgress]) { + [TestFormat printOffset:@"Took too long to add"]; + [TestFormat abort:routeError error:error]; + } else if ([result asComplete]) { + DBXTeamMemberAddResult *addResult = result.asComplete.complete[0]; + if ([addResult asSuccess]) { + self->_teamMemberId2 = addResult.asSuccess.success.profile.teamMemberId; + } else { + [TestFormat abort:routeError error:error]; + } + [TestFormat printOffset:@"Member added"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; + }; + + DBXTeamMemberAddArg *memberAddArg = [[DBXTeamMemberAddArg alloc] initWithMemberEmail:DBXTestData.newMemberEmail memberGivenName:@"FirstName" memberSurname:@"LastName" memberExternalId:nil memberPersistentId:nil sendWelcomeEmail:[NSNumber numberWithBool:YES] isDirectoryRestricted:nil role:[[DBXTeamAdminTierMemberOnly alloc] init]]; + [[_tester.team membersAddWithNewMembers:@[memberAddArg]] responseWithCompletionHandler:^(DBXTeamMembersAddLaunch * _Nullable result, DBXCallError * _Nullable error) { + if (result) { + if ([result asAsyncJobId]) { + [TestFormat printOffset:@"Result incomplete..."]; + jobStatus(result.asAsyncJobId.asyncJobId); + } else if ([result asComplete]) { + DBXTeamMemberAddResult *addResult = result.asComplete.complete[0]; + if ([addResult asSuccess]) { + self->_teamMemberId2 = addResult.asSuccess.success.profile.teamMemberId; + } else if ([addResult asUserAlreadyOnTeam]) { + [TestFormat printOffset:@"User already on team"]; + } else { + [TestFormat abort:nil error:error]; + } + [TestFormat printOffset:@"Member added"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + } else { + [TestFormat abort:nil error:error]; + } + }]; +} + +- (void)membersGetInfo:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamUserSelectorArgTeamMemberId *userSelectArg = [[DBXTeamUserSelectorArgTeamMemberId alloc] init:_teamMemberId]; + [[_tester.team membersGetInfoWithMembers:@[userSelectArg]] responseWithCompletionHandler:^(NSArray * _Nullable result, DBXTeamMembersGetInfoError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)membersList:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + [[_tester.team membersListWithLimit:[NSNumber numberWithInt:2] includeRemoved:[NSNumber numberWithBool:NO]] responseWithCompletionHandler:^(DBXTeamMembersListResult * _Nullable result, DBXTeamMembersListError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)membersSendWelcomeEmail:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamUserSelectorArgTeamMemberId *userSelectArg = [[DBXTeamUserSelectorArgTeamMemberId alloc] init:_teamMemberId]; + [[_tester.team membersSendWelcomeEmailWithUserSelectorArg:userSelectArg] responseWithCompletionHandler:^(DBXTeamMembersSendWelcomeError * _Nullable routeError, DBXCallError * _Nullable error) { + if (!routeError && !error) { + [TestFormat printOffset:@"Welcome email sent!"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)membersSetAdminPermissions:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamUserSelectorArgEmail *userSelectArg = [[DBXTeamUserSelectorArgEmail alloc] init:DBXTestData.newMemberEmail]; + DBXTeamAdminTierTeamAdmin *role = [[DBXTeamAdminTierTeamAdmin alloc] init]; + [[_tester.team membersSetAdminPermissionsWithUser:userSelectArg newRole:role] responseWithCompletionHandler:^(DBXTeamMembersSetPermissionsResult * _Nullable result, DBXTeamMembersSetPermissionsError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)membersSetProfile:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + DBXTeamUserSelectorArgEmail *userSelectArg = [[DBXTeamUserSelectorArgEmail alloc] init:DBXTestData.newMemberEmail]; + [[_tester.team membersSetProfileWithUser:userSelectArg newEmail:nil newExternalId:nil newGivenName:@"NewFirstName" newSurname:nil newPersistentId:nil newIsDirectoryRestricted:nil] responseWithCompletionHandler:^(DBXTeamTeamMemberInfo * _Nullable result, DBXTeamMembersSetProfileError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +- (void)membersRemove:(void (^)(void))nextTest { + [TestFormat printSubTestBegin:NSStringFromSelector(_cmd)]; + void (^jobStatus)(NSString *) = ^(NSString *jobId) { + [[self->_tester.team membersRemoveJobStatusGetWithAsyncJobId:jobId] responseWithCompletionHandler:^(DBXAsyncPollEmptyResult * _Nullable result, DBXAsyncPollError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + MyLog(@"%@\n", result); + if ([result asInProgress]) { + [TestFormat abort:routeError error:error]; + } else if ([result asComplete]) { + [TestFormat printOffset:@"Member removed"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; + }; + + DBXTeamUserSelectorArgEmail *userSelectArg = [[DBXTeamUserSelectorArgEmail alloc] init:DBXTestData.newMemberEmail]; + [[_tester.team membersRemoveWithUser:userSelectArg] responseWithCompletionHandler:^(DBXAsyncLaunchEmptyResult * _Nullable result, DBXTeamMembersRemoveError * _Nullable routeError, DBXCallError * _Nullable error) { + if (result) { + if ([result asAsyncJobId]) { + [TestFormat printOffset:@"Result incomplete. Waiting to query status..."]; + sleep(2); + jobStatus(result.asAsyncJobId.asyncJobId); + } else if ([result asComplete]) { + [TestFormat printOffset:@"Member removed"]; + [TestFormat printSubTestEnd:NSStringFromSelector(_cmd)]; + nextTest(); + } + } else { + [TestFormat abort:routeError error:error]; + } + }]; +} + +@end + +static int smallDividerSize = 150; + +@implementation TestFormat + ++ (void)abort:(NSObject * _Nullable)routeError error:(DBXCallError * _Nullable)error { + [self printErrors:routeError error:error]; + MyLog(@"Terminating....\n"); + NSException* myException = [NSException + exceptionWithName:@"TestFailure" + reason:[NSString stringWithFormat:@"RouteError: %@\nError: %@", routeError, error] + userInfo:nil]; + @throw myException; +} + ++ (void)printErrors:(NSObject * _Nullable)routeError error:(DBXCallError * _Nullable)error { + [self printRouteError: routeError]; + [self printError: error]; +} + ++ (void)printRouteError:(NSObject * _Nullable)routeError { + MyLog(@"ROUTE ERROR: %@\n", routeError); +} + ++ (void)printError:(DBXCallError *)error { + MyLog(@"ERROR: %@\n", error); +} + ++ (void)printSentProgress:(int64_t)bytesSent + totalBytesSent:(int64_t)totalBytesSent + totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend { + MyLog(@"PROGRESS: bytesSent:%lld totalBytesSent:%lld totalBytesExpectedToSend:%lld\n\n", bytesSent, totalBytesSent, + totalBytesExpectedToSend); +} + ++ (void)printTestBegin:(NSString *)title { + [self printLargeDivider]; + [self printTitle:title]; + [self printLargeDivider]; + [self printOffset:@"Beginning....."]; +} + ++ (void)printTestEnd { + [self printOffset:@"Test Group Completed"]; + [self printLargeDivider]; +} + ++ (void)printAllTestsEnd { + [self printLargeDivider]; + [self printOffset:@"ALL TESTS COMPLETED"]; + [self printLargeDivider]; +} + ++ (void)printSubTestBegin:(NSString *)title { + [self printSmallDivider]; + [self printTitle:title]; + MyLog(@"\n"); +} + ++ (void)printSubTestEnd:(NSString *)result { + MyLog(@"\n"); + [self printTitle:result]; +} + ++ (void)printTitle:(NSString *)title { + MyLog(@" %@\n", title); +} + ++ (void)printOffset:(NSString *)str { + MyLog(@"\n"); + MyLog(@" * %@ *\n", str); + MyLog(@"\n"); +} + ++ (void)printSmallDivider { + NSMutableString *result = [@"" mutableCopy]; + for (int i = 0; i < smallDividerSize; i++) { + [result appendString:@"-"]; + } + MyLog(@"%@\n", result); +} + ++ (void)printLargeDivider { + NSMutableString *result = [@"" mutableCopy]; + for (int i = 0; i < smallDividerSize; i++) { + [result appendString:@"-"]; + } + MyLog(@"%@\n", result); +} + +@end diff --git a/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestData.swift b/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestData.swift new file mode 100644 index 000000000..0481f7b34 --- /dev/null +++ b/TestSwiftyDropbox/IntegrationTests/ObjC/ObjCTestData.swift @@ -0,0 +1,43 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +@objc +open class DBXTestData: NSObject { + @objc static var testId: String { get { TestData.testId } set { TestData.testId = newValue } } + @objc static var baseFolder: String { get { TestData.baseFolder } set { TestData.baseFolder = newValue } } + + @objc static var testFolderName: String { get { TestData.testFolderName } set { TestData.testFolderName = newValue } } + @objc static var testFolderPath: String { get { TestData.testFolderPath } set { TestData.testFolderPath = newValue } } + + @objc static var testShareFolderName: String { get { TestData.testShareFolderName } set { TestData.testShareFolderName = newValue } } + @objc static var testShareFolderPath: String { get { TestData.testShareFolderPath } set { TestData.testShareFolderPath = newValue } } + + @objc static var testFileName: String { get { TestData.testFileName } set { TestData.testFileName = newValue } } + @objc static var testFilePath: String { get { TestData.testFilePath } set { TestData.testFilePath = newValue } } + + @objc static var testData: String { get { TestData.testData } set { TestData.testData = newValue } } + + @objc static var fileData: Data { get { TestData.fileData } set { TestData.fileData = newValue } } + @objc static var fileManager: FileManager { get { TestData.fileManager } set { TestData.fileManager = newValue } } + @objc static var directoryURL: URL { get { TestData.directoryURL } set { TestData.directoryURL = newValue } } + @objc static var destURL: URL { get { TestData.destURL } set { TestData.destURL = newValue } } + + @objc static var accountId: String { get { TestData.accountId } set { TestData.accountId = newValue } } + @objc static var accountId2: String { get { TestData.accountId2 } set { TestData.accountId2 = newValue } } + @objc static var accountId3: String { get { TestData.accountId3 } set { TestData.accountId3 = newValue } } + @objc static var accountId3Email: String { get { TestData.accountId3Email } set { TestData.accountId3Email = newValue } } + + @objc static var testIdTeam: String { get { TestData.testIdTeam } set { TestData.testIdTeam = newValue } } + @objc static var groupName: String { get { TestData.groupName } set { TestData.groupName = newValue } } + @objc static var groupExternalId: String { get { TestData.groupExternalId } set { TestData.groupExternalId = newValue } } + @objc static var groupExternalIdDashObjc: String { TestData.groupExternalId + "-objc" } + + @objc static var teamMemberEmail: String { get { TestData.teamMemberEmail } set { TestData.teamMemberEmail = newValue } } + @objc static var newMemberEmail: String { get { TestData.newMemberEmail } set { TestData.newMemberEmail = newValue } } + + @objc static var fullDropboxAppKey: String { get { TestData.fullDropboxAppKey } set { TestData.fullDropboxAppKey = newValue } } + @objc static var fullDropboxAppSecret: String { get { TestData.fullDropboxAppSecret } set { TestData.fullDropboxAppSecret = newValue } } +} diff --git a/TestSwiftyDropbox/IntegrationTests/TestClasses.swift b/TestSwiftyDropbox/IntegrationTests/TestClasses.swift index 02d4739fc..084aeabaf 100644 --- a/TestSwiftyDropbox/IntegrationTests/TestClasses.swift +++ b/TestSwiftyDropbox/IntegrationTests/TestClasses.swift @@ -2,83 +2,23 @@ /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// +// swiftformat:disable all + import Foundation import SwiftyDropbox -open class DropboxTester { - static let scopes = "account_info.read files.content.read files.content.write files.metadata.read files.metadata.write".components(separatedBy: " ") - - let auth = DropboxClientsManager.authorizedClient!.auth! - let users = DropboxClientsManager.authorizedClient!.users! - let files = DropboxClientsManager.authorizedClient!.files! - let sharing = DropboxClientsManager.authorizedClient!.sharing! +public protocol DropboxTesting { + static var scopes: [String] { get } + var files: FilesRoutes { get } +} - func testBatchUpload() { - TestFormat.printSubTestBegin(NSStringFromSelector(#function)) - // create working folder - let workingDirectoryName = "MyOutputFolder" - let workingDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent(workingDirectoryName) - do { - try FileManager.default.createDirectory(atPath: workingDirectory.path, withIntermediateDirectories: false, attributes: nil) - } catch let error as NSError { - print(error.localizedDescription); - } - - var uploadFilesUrlsToCommitInfo: [URL: Files.CommitInfo] = [:] +open class DropboxTester: DropboxTesting { + public static let scopes = "account_info.read files.content.read files.content.write files.metadata.read files.metadata.write sharing.write".components(separatedBy: " ") - print("\n\nCreating files in: \(workingDirectory.path)\n\n") - // create a bunch of fake files - for i in 0..<10 { - let fileName = "test_file_\(i)" - let fileContent = "\(fileName)'s content. Test content here." - let fileUrl = workingDirectory.appendingPathComponent(fileName) - // set to test large file - let testLargeFile: Bool = true - // don't create a file for the name test_file_5 so we use a custom large file - // there instead - if i != 5 || !testLargeFile { - do { - try fileContent.write(to: fileUrl, atomically: false, encoding: String.Encoding.utf8) - } - catch { - print("Error creating file") - print("Terminating...") - exit(0) - } - } else { - if !FileManager.default.fileExists(atPath: fileUrl.path) { - print("\n\nPlease create a large file named \(fileUrl) to test chunked uploading\n\n") - exit(0) - } - } - let commitInfo = Files.CommitInfo(path: "\(TestData.testFolderPath)/\(fileName)") - uploadFilesUrlsToCommitInfo[fileUrl] = commitInfo - } - - self.files.batchUploadFiles(fileUrlsToCommitInfo: uploadFilesUrlsToCommitInfo, progressBlock: { progress in - print("Progress: \(progress)") - }, responseBlock: { fileUrlsToBatchResultEntries, finishBatchRequestError, fileUrlsToRequestErrors in - if let fileUrlsToBatchResultEntries = fileUrlsToBatchResultEntries { - for (clientSideFileUrl, resultEntry) in fileUrlsToBatchResultEntries { - switch resultEntry { - case .success(let metadata): - let dropboxFilePath = metadata.pathDisplay! - print("File successfully uploaded from \(clientSideFileUrl.absoluteString) on local machine to \(dropboxFilePath) in Dropbox.") - case .failure(let error): - // This particular file was not uploaded successfully, although the other - // files may have been uploaded successfully. Perhaps implement some retry - // logic here based on `uploadError` - print("Error: \(error)") - } - } - } else if let finishBatchRequestError = finishBatchRequestError { - print("Either bug in SDK code, or transient error on Dropbox server: \(finishBatchRequestError)") - } else if fileUrlsToRequestErrors.count > 0 { - print("Other additional errors (e.g. file doesn't exist client-side, etc.).") - print("\(fileUrlsToRequestErrors)") - } - }) - } + public let auth = DropboxClientsManager.authorizedClient!.auth! + public let users = DropboxClientsManager.authorizedClient!.users! + public let files = DropboxClientsManager.authorizedClient!.files! + public let sharing = DropboxClientsManager.authorizedClient!.sharing! // Test user app with 'Full Dropbox' permission func testAllUserEndpoints(asMember: Bool = false, skipRevokeToken: Bool = false, nextTest: (() -> Void)? = nil) { @@ -89,8 +29,11 @@ open class DropboxTester { TestFormat.printAllTestsEnd() } } + let testCustomActions = { + self.testCustomActions(end) + } let testAuthActions = { - self.testAuthActions(end) + self.testAuthActions(testCustomActions) } let testUserActions = { self.testUserActions(skipRevokeToken ? end : testAuthActions) @@ -105,6 +48,23 @@ open class DropboxTester { start() } + func testCustomActions(_ nextTest: @escaping (() -> Void)) { + let tester = CustomTests(tester: self) + + let end = { + TestFormat.printTestEnd() + nextTest() + } + let batchUpload = { + tester.batchUpload(end) + } + let start = { + batchUpload() + } + TestFormat.printTestBegin(#function) + start() + } + func testFilesActions(_ nextTest: @escaping (() -> Void), asMember: Bool = false) { let tester = FilesTests(tester: self) @@ -131,12 +91,13 @@ open class DropboxTester { let downloadToFile = { tester.downloadToFile(downloadAgain) } - let saveUrl = { - // route currently doesn't work with Team app performing 'As Member' - tester.saveUrl(downloadToFile, asMember: asMember) - } + // Async nature of this call can interfere with subsequent test runs by finishing after cleanup +// let saveUrl = { +// // route currently doesn't work with Team app performing 'As Member' +// tester.saveUrl(downloadToFile, asMember: asMember) +// } let listRevisions = { - tester.listRevisions(saveUrl) + tester.listRevisions(downloadToFile) } let getTemporaryLink = { tester.getTemporaryLink(listRevisions) @@ -280,7 +241,9 @@ open class DropboxTester { } open class DropboxTeamTester { - static let scopes = "groups.read groups.write members.delete members.read members.write sessions.list team_data.member team_info.read files.content.write files.content.read sharing.write account_info.read".components(separatedBy: " ") + static let scopes = + "groups.read groups.write members.delete members.read members.write sessions.list team_data.member team_info.read files.content.write files.content.read sharing.write account_info.read" + .components(separatedBy: " ") let team = DropboxClientsManager.authorizedTeamClient!.team! // Test business app with 'Team member file access' permission @@ -293,7 +256,7 @@ open class DropboxTeamTester { } } let testPerformActionAsMember = { - DropboxTester().testAllUserEndpoints(asMember:true, skipRevokeToken: skipRevokeToken, nextTest: end) + DropboxTester().testAllUserEndpoints(asMember: true, skipRevokeToken: skipRevokeToken, nextTest: end) } let start = { self.testTeamMemberFileAcessActionsGroup(testPerformActionAsMember) @@ -359,7 +322,7 @@ open class DropboxTeamTester { TestFormat.printTestEnd() nextTest() } -// Commenting out to make tests green until we understand the email_address_too_long_to_be_disabled error + // Commenting out to make tests green until we understand the email_address_too_long_to_be_disabled error // let membersRemove = { // tester.membersRemove(end) // } @@ -414,12 +377,113 @@ open class DropboxTeamTester { } } +/** + Custom Routes Tests + */ + +open class CustomTests { + let tester: DropboxTester + + public init(tester: DropboxTester) { + self.tester = tester + } + + func batchUpload(_ nextTest: (() -> Void)? = nil) { + TestFormat.printSubTestBegin(NSStringFromSelector(#function)) + // create working folder + let workingDirectoryName = "MyOutputFolder" + let workingDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent(workingDirectoryName) + if !FileManager.default.fileExists(atPath: workingDirectory.path) { + do { + try FileManager.default.createDirectory(atPath: workingDirectory.path, withIntermediateDirectories: false, attributes: nil) + } catch let error as NSError { + print(error.localizedDescription) + } + } + + var uploadFilesUrlsToCommitInfo: [URL: Files.CommitInfo] = [:] + + print("\n\nCreating files in: \(workingDirectory.path)\n\n") + // create a bunch of fake files + for i in 0 ..< 10 { + let fileName = "test_file_\(i)" + let fileContent = "\(fileName)'s content. Test content here." + let fileUrl = workingDirectory.appendingPathComponent(fileName) + // set to test large file + let testLargeFile: Bool = true + // don't create a file for the name test_file_5 so we use a custom large file + // there instead + if i != 5 || !testLargeFile { + do { + try fileContent.write(to: fileUrl, atomically: false, encoding: String.Encoding.utf8) + } catch { + print("Error creating file") + print("Terminating...") + exit(0) + } + } else { + let count = 15_000_000 // 15mb = large file (chunks are 10mb) + var bytes = [Int8](repeating: 0, count: count) + + // Fill bytes with secure random data + let status = SecRandomCopyBytes( + kSecRandomDefault, + count, + &bytes + ) + + if status == errSecSuccess { + let data = Data(bytes: bytes, count: count) + do { + try data.write(to: fileUrl) + } catch { + print("Error writing large file") + print("Terminating...") + exit(0) + } + } else { + print("Error creating large file") + print("Terminating...") + exit(0) + } + } + let commitInfo = Files.CommitInfo(path: "\(TestData.testFolderPath)/\(fileName)") + uploadFilesUrlsToCommitInfo[fileUrl] = commitInfo + } + + tester.files.batchUploadFiles(fileUrlsToCommitInfo: uploadFilesUrlsToCommitInfo, progressBlock: { progress in + print("Batch Upload Progress: \(progress)") + }, responseBlock: { fileUrlsToBatchResultEntries, finishBatchRequestError, fileUrlsToRequestErrors in + if let fileUrlsToBatchResultEntries = fileUrlsToBatchResultEntries { + for (clientSideFileUrl, resultEntry) in fileUrlsToBatchResultEntries { + switch resultEntry { + case .success(let metadata): + let dropboxFilePath = metadata.pathDisplay! + print( + "File successfully uploaded from \(clientSideFileUrl.absoluteString) on local machine to \(dropboxFilePath) in Dropbox. Size: \(metadata.size)" + ) + case .failure(let error): + // This particular file was not uploaded successfully, although the other + // files may have been uploaded successfully. Perhaps implement some retry + // logic here based on `uploadError` + print("Error: \(error)") + } + } + } else if let finishBatchRequestError = finishBatchRequestError { + print("Either bug in SDK code, or transient error on Dropbox server: \(finishBatchRequestError)") + } else if fileUrlsToRequestErrors.count > 0 { + print("Other additional errors (e.g. file doesn't exist client-side, etc.).") + print("\(fileUrlsToRequestErrors)") + } + nextTest?() + }) + } +} /** Dropbox User API Endpoint Tests */ - open class AuthTests { let tester: DropboxTester @@ -442,41 +506,38 @@ open class AuthTests { } open class FilesTests { - let tester: DropboxTester + let tester: DropboxTesting - public init(tester: DropboxTester) { + public init(tester: DropboxTesting) { self.tester = tester } - func deleteV2(_ nextTest: @escaping (() -> Void), retries: Int = 2) { + func deleteV2(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.files.deleteV2(path: TestData.baseFolder).response { response, error in + runRpcRoute(createRequest: self.tester.files.deleteV2(path: TestData.baseFolder)) { response, error in if let result = response { print(result) TestFormat.printSubTestEnd(#function) nextTest() } else if let callError = error { print(callError) - if retries > 0, case .rateLimitError(let rateLimitError, _, _, _) = callError { - sleep(UInt32(truncatingIfNeeded: rateLimitError.retryAfter)) - self.deleteV2(nextTest, retries: retries - 1) - } else { - TestFormat.printSubTestEnd(#function) - nextTest() - } + TestFormat.printSubTestEnd(#function) + nextTest() } } } func createFolderV2(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.files.createFolderV2(path: TestData.testFolderPath).response { response, error in + runRpcRoute(createRequest: self.tester.files.createFolderV2(path: TestData.testFolderPath)) { response, error in if let result = response { print(result) TestFormat.printSubTestEnd(#function) nextTest() } else if let callError = error { - TestFormat.abort(String(describing: callError)) + print(callError) + TestFormat.printSubTestEnd(#function) + nextTest() } } } @@ -531,7 +592,7 @@ open class FilesTests { } } - self.tester.files.uploadSessionStart(input: TestData.fileData).response { response, error in + tester.files.uploadSessionStart(input: TestData.fileData).response { response, error in if let result = response { let sessionId = result.sessionId print(result) @@ -586,7 +647,7 @@ open class FilesTests { func getMetadataInvalid(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.files.getMetadata(path: "/").response { response, error in + tester.files.getMetadata(path: "/").response { _, error in assert(error != nil, "This call should have errored!") TestFormat.printOffset("Error properly detected") TestFormat.printSubTestEnd(#function) @@ -627,15 +688,16 @@ open class FilesTests { print(result) TestFormat.printOffset("Created destination folder") - self.tester.files.moveV2(fromPath: TestData.testFolderPath, toPath: TestData.testFolderPath + "/" + "movedLocation").response { response, error in - if let result = response { - print(result) - TestFormat.printSubTestEnd(#function) - nextTest() - } else if let callError = error { - TestFormat.abort(String(describing: callError)) + self.tester.files.moveV2(fromPath: TestData.testFolderPath, toPath: TestData.testFolderPath + "/" + "movedLocation") + .response { response, error in + if let result = response { + print(result) + TestFormat.printSubTestEnd(#function) + nextTest() + } else if let callError = error { + TestFormat.abort(String(describing: callError)) + } } - } } else if let callError = error { TestFormat.abort(String(describing: callError)) } @@ -660,22 +722,24 @@ open class FilesTests { } } - func downloadToFile(_ nextTest: @escaping (() -> Void)) { + func downloadToFile(path: String = TestData.testFilePath, clientPersistedString: String? = nil, _ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.files.download(path: TestData.testFilePath, overwrite: true, destination: TestData.destination).response { response, error in - if let result = response { - print(result) - TestFormat.printSubTestEnd(#function) - nextTest() - } else if let callError = error { - TestFormat.abort(String(describing: callError)) + tester.files.download(path: path, overwrite: true, destination: TestData.destURL) + .persistingString(string: clientPersistedString) + .response { response, error in + if let result = response { + print(result) + TestFormat.printSubTestEnd(#function) + nextTest() + } else if let callError = error { + TestFormat.abort(String(describing: callError)) + } } - } } func downloadAgain(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.files.download(path: TestData.testFilePath, overwrite: true, destination: TestData.destination).response { response, error in + tester.files.download(path: TestData.testFilePath, overwrite: true, destination: TestData.destURL).response { response, error in if let result = response { print(result) TestFormat.printSubTestEnd(#function) @@ -688,7 +752,7 @@ open class FilesTests { func downloadError(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.files.download(path: TestData.testFilePath + "_does_not_exist", overwrite: false, destination: TestData.destinationException).response { response, error in + tester.files.download(path: TestData.testFilePath + "_does_not_exist", overwrite: false, destination: TestData.destURLException).response { _, error in assert(error != nil, "This call should have errored!") assert(!FileManager.default.fileExists(atPath: TestData.destURLException.path)) TestFormat.printOffset("Error properly detected") @@ -698,7 +762,6 @@ open class FilesTests { } func downloadToMemory(_ nextTest: @escaping (() -> Void)) { - tester.files.download(path: "/test/path/in/Dropbox/account") .response { response, error in if let response = response { @@ -712,8 +775,8 @@ open class FilesTests { } .progress { progressData in print(progressData) - } - + } + TestFormat.printSubTestBegin(#function) tester.files.download(path: TestData.testFilePath).response { response, error in if let result = response { @@ -726,9 +789,9 @@ open class FilesTests { } } - func uploadFile(_ nextTest: @escaping (() -> Void)) { + func uploadFile(path: String = TestData.testFilePath + "_from_file", input: URL = TestData.destURL, _ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.files.upload(path: TestData.testFilePath + "_from_file", input: TestData.destURL).response { response, error in + tester.files.upload(path: path, input: input).response { response, error in if let result = response { print(result) TestFormat.printSubTestEnd(#function) @@ -745,18 +808,6 @@ open class FilesTests { return } - let copy = { - TestFormat.printOffset("Making change that longpoll will detect (copy file)") - let copyOutputPath = TestData.testFilePath + "_duplicate2" + "_" + TestData.testId - self.tester.files.copyV2(fromPath: TestData.testFilePath, toPath: copyOutputPath).response { response, error in - if let result = response { - print(result) - } else if let callError = error { - TestFormat.abort(String(describing: callError)) - } - } - } - let listFolderContinue: ((String) -> Void) = { cursor in self.tester.files.listFolderContinue(cursor: cursor).response { response, error in if let result = response { @@ -775,7 +826,7 @@ open class FilesTests { self.tester.files.listFolderLongpoll(cursor: cursor).response { response, error in if let result = response { print(result) - if (result.changes) { + if result.changes { TestFormat.printOffset("Changes found") listFolderContinue(cursor) } else { @@ -785,7 +836,17 @@ open class FilesTests { TestFormat.abort(String(describing: callError)) } } - copy() + + TestFormat.printOffset("Making change that longpoll will detect (copy file)") + let copyOutputPath = TestData.testFilePath + "_duplicate2" + "_" + TestData.testId + + runRpcRoute(createRequest: self.tester.files.copyV2(fromPath: TestData.testFilePath, toPath: copyOutputPath)) { response, error in + if let result = response { + print(result) + } else { + TestFormat.abort(String(describing: error)) + } + } } TestFormat.printSubTestBegin(#function) @@ -814,9 +875,9 @@ open class SharingTests { self.tester = tester } - func shareFolder(_ nextTest: @escaping (() -> Void), retries: Int = 2) { + func shareFolder(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.sharing.shareFolder(path: TestData.testShareFolderPath).response { response, error in + runRpcRoute(createRequest: self.tester.sharing.shareFolder(path: TestData.testShareFolderPath)) { response, error in if let result = response { switch result { case .asyncJobId(let asyncJobId): @@ -828,12 +889,7 @@ open class SharingTests { nextTest() } } else if let callError = error { - if retries > 0, case .rateLimitError(let rateLimitError, _, _, _) = callError { - sleep(UInt32(truncatingIfNeeded: rateLimitError.retryAfter)) - self.shareFolder(nextTest, retries: retries - 1) - } else { - TestFormat.abort(String(describing: callError)) - } + TestFormat.abort(String(describing: callError)) } } } @@ -938,23 +994,22 @@ open class SharingTests { let memberSelector = Sharing.MemberSelector.email(TestData.accountId3Email) - func checkJobStatusWithDelay(_ asyncJobId: String, retryCount: Int) { - if retryCount >= 5 { + if retryCount >= 10 { TestFormat.abort("Folder member not removed after \(retryCount) retries! Job id: \(asyncJobId)") } TestFormat.printOffset("Folder member not yet removed! Job id: \(asyncJobId)") print("Sleeping for 3 seconds, then trying again", terminator: "") - for _ in 1...3 { + for _ in 1 ... 3 { sleep(1) - print(".", terminator:"") + print(".", terminator: "") } print() TestFormat.printOffset("Retrying!") - self.tester.sharing.checkJobStatus(asyncJobId: asyncJobId).response { response, error in + tester.sharing.checkJobStatus(asyncJobId: asyncJobId).response { response, error in if let result = response { print(result) switch result { @@ -1113,12 +1168,10 @@ open class UserTests { } } - /** Dropbox Team API Endpoint Tests */ - open class TeamTests { let tester: DropboxTeamTester var teamMemberId: String? @@ -1127,10 +1180,9 @@ open class TeamTests { self.tester = tester } - /** - Permission: Team member file access - */ + Permission: Team member file access + */ func initMembersGetInfo(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) @@ -1155,7 +1207,7 @@ open class TeamTests { func listMemberDevices(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.team.devicesListMemberDevices(teamMemberId: self.teamMemberId!).response { response, error in + tester.team.devicesListMemberDevices(teamMemberId: teamMemberId!).response { response, error in if let result = response { print(result) TestFormat.printSubTestEnd(#function) @@ -1181,7 +1233,7 @@ open class TeamTests { func linkedAppsListMemberLinkedApps(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - tester.team.linkedAppsListMemberLinkedApps(teamMemberId: self.teamMemberId!).response { response, error in + tester.team.linkedAppsListMemberLinkedApps(teamMemberId: teamMemberId!).response { response, error in if let result = response { print(result) TestFormat.printSubTestEnd(#function) @@ -1219,9 +1271,8 @@ open class TeamTests { } /** - Permission: Team member management - */ - + Permission: Team member management + */ func groupsCreate(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) @@ -1267,7 +1318,7 @@ open class TeamTests { TestFormat.printSubTestBegin(#function) let groupSelector = Team.GroupSelector.groupExternalId(TestData.groupExternalId) - let userSelectorArg = Team.UserSelectorArg.teamMemberId(self.teamMemberId!) + let userSelectorArg = Team.UserSelectorArg.teamMemberId(teamMemberId!) let accessType = Team.GroupAccessType.member let memberAccess = Team.MemberAccess(user: userSelectorArg, accessType: accessType) let members = [memberAccess] @@ -1301,9 +1352,8 @@ open class TeamTests { func groupsUpdate(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) let groupSelector = Team.GroupSelector.groupExternalId(TestData.groupExternalId) - let newGroupName = "New Group Name" + TestData.testId - tester.team.groupsUpdate(group: groupSelector, newGroupName: newGroupName).response { response, error in + tester.team.groupsUpdate(group: groupSelector, newGroupName: "New Group Name Swift" + TestData.groupExternalId).response { response, error in if let result = response { print(result) TestFormat.printSubTestEnd(#function) @@ -1324,15 +1374,15 @@ open class TeamTests { TestFormat.printOffset("Groups delete incomplete! Job id: \(asyncJobId)") print("Sleeping for 3 seconds, then trying again", terminator: "") - for _ in 1...3 { + for _ in 1 ... 3 { sleep(1) - print(".", terminator:"") + print(".", terminator: "") } print() TestFormat.printOffset("Retrying!") - self.tester.team.groupsJobStatusGet(asyncJobId: asyncJobId).response { response, error in + tester.team.groupsJobStatusGet(asyncJobId: asyncJobId).response { response, error in if let result = response { print(result) switch result { @@ -1350,7 +1400,7 @@ open class TeamTests { } let groupsSelector = Team.GroupSelector.groupExternalId(TestData.groupExternalId) - self.tester.team.groupsDelete(groupSelector: groupsSelector).response { response, error in + tester.team.groupsDelete(groupSelector: groupsSelector).response { response, error in if let result = response { print(result) switch result { @@ -1371,7 +1421,7 @@ open class TeamTests { func membersAdd(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - + let jobStatus: ((String) -> Void) = { jobId in self.tester.team.membersAddJobStatusGet(asyncJobId: jobId).response { response, error in if let result = response { @@ -1390,7 +1440,7 @@ open class TeamTests { TestFormat.printOffset("Member added") TestFormat.printSubTestEnd(#function) nextTest() - case.failed(let message): + case .failed(let message): TestFormat.abort(message) } } else if let callError = error { @@ -1429,7 +1479,7 @@ open class TeamTests { func membersGetInfo(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - let userSelectArg = Team.UserSelectorArg.teamMemberId(self.teamMemberId!) + let userSelectArg = Team.UserSelectorArg.teamMemberId(teamMemberId!) tester.team.membersGetInfo(members: [userSelectArg]).response { response, error in if let result = response { print(result) @@ -1456,7 +1506,7 @@ open class TeamTests { func membersSendWelcomeEmail(_ nextTest: @escaping (() -> Void)) { TestFormat.printSubTestBegin(#function) - let userSelectorArg = Team.UserSelectorArg.teamMemberId(self.teamMemberId!) + let userSelectorArg = Team.UserSelectorArg.teamMemberId(teamMemberId!) tester.team.membersSendWelcomeEmail(userSelectorArg: userSelectorArg).response { response, error in if let _ = response { TestFormat.printOffset("Welcome email sent!") @@ -1525,7 +1575,7 @@ open class TeamTests { } else { userSelectorArg = Team.UserSelectorArg.email(TestData.newMemberEmail) } - + tester.team.membersRemove(user: userSelectorArg).response { response, error in if let result = response { print(result) @@ -1597,7 +1647,7 @@ open class TestFormat { class func printSmallDivider() { var result = "" - for _ in 1...smallDividerSize { + for _ in 1 ... smallDividerSize { result += "-" } print(result) @@ -1605,9 +1655,49 @@ open class TestFormat { class func printLargeDivider() { var result = "" - for _ in 1...largeDividerSize { + for _ in 1 ... largeDividerSize { result += "-" } print(result) } } + +private func runRpcRoute( + createRequest: @autoclosure @escaping () -> RpcRequest, + with resultHandler: @escaping (RSerial.ValueType?, CallError?) -> Void, + retries: Int = 3 +) { + createRequest().response { response, error in + if let error = error, case .rateLimitError(let rateLimitError, _, _, _) = error, retries > 0 { + print(error) + sleep(UInt32(truncatingIfNeeded: rateLimitError.retryAfter)) + runRpcRoute( + createRequest: createRequest(), + with: resultHandler, + retries: retries - 1 + ) + } else { + resultHandler(response, error) + } + } +} + +private func runUploadRoute( + createRequest: @escaping () -> UploadRequest, + with resultHandler: @escaping (RSerial.ValueType?, CallError?) -> Void, + retries: Int = 3 +) { + createRequest().response { response, error in + if let error = error, case .rateLimitError(let rateLimitError, _, _, _) = error, retries > 0 { + print(error) + sleep(UInt32(truncatingIfNeeded: rateLimitError.retryAfter)) + runUploadRoute( + createRequest: createRequest, + with: resultHandler, + retries: retries - 1 + ) + } else { + resultHandler(response, error) + } + } +} diff --git a/TestSwiftyDropbox/IntegrationTests/TestData.swift b/TestSwiftyDropbox/IntegrationTests/TestData.swift index 2cf3e0737..5792dd8e4 100644 --- a/TestSwiftyDropbox/IntegrationTests/TestData.swift +++ b/TestSwiftyDropbox/IntegrationTests/TestData.swift @@ -7,7 +7,7 @@ import SwiftyDropbox open class TestData { // to avoid name collisions in the event of leftover test state from failure - static var testId = String(arc4random_uniform(1000)) + static var testId = String(arc4random_uniform(1_000)) static var baseFolder = "/Testing/SwiftyDropboxTests" @@ -28,13 +28,6 @@ open class TestData { static var destURL = directoryURL.appendingPathComponent(testFileName) static var destURLException = directoryURL.appendingPathComponent(testFileName + "_does_not_exist") - static var destination: (URL, HTTPURLResponse) -> URL = { temporaryURL, response in - return destURL - } - static var destinationException: (URL, HTTPURLResponse) -> URL = { temporaryURL, response in - return destURLException - } - // user-specific information @@ -46,27 +39,28 @@ open class TestData { static var accountId3 = "" // the email address of the account whose account ID is `accoundId3` static var accountId3Email = "" - + // team-specific data - + // to avoid name collisions in the event of leftover test state from failure - static var testIdTeam = String(arc4random_uniform(1000)) - + static var testIdTeam = String(arc4random_uniform(1_000)) + static var groupName = "GroupName" + testIdTeam static var groupExternalId = "group-" + testIdTeam - - + // user-specific information - + // email address of the team user you OAuth link with in order to test static var teamMemberEmail = "" static var newMemberEmail = "" - + // App key and secret - static var fullDropboxAppKey = ""; - static var fullDropboxAppSecret = ""; -} + static var fullDropboxAppKey = "" + static var fullDropboxAppSecret = "" -open class TestTeamData { - + public static let backgroundSessionIdentifier = "" + public static let extensionBackgroundSessionIdentifier = "" + public static let sharedContainerIdentifier = "" } + +open class TestTeamData {} diff --git a/TestSwiftyDropbox/Package.swift b/TestSwiftyDropbox/Package.swift new file mode 100644 index 000000000..9b04cbc5e --- /dev/null +++ b/TestSwiftyDropbox/Package.swift @@ -0,0 +1,14 @@ +// swift-tools-version:5.1 +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +// This only exists so that Xcode doesn't display TestSwiftyDropbox + +import PackageDescription + +let package = Package( + name: "client", + products: [], + targets: [] +) diff --git a/TestSwiftyDropbox/Podfile b/TestSwiftyDropbox/Podfile index f55661c29..44dbb5591 100644 --- a/TestSwiftyDropbox/Podfile +++ b/TestSwiftyDropbox/Podfile @@ -3,15 +3,21 @@ use_frameworks! def shared_iOS_pods platform :ios, '11.0' pod 'SwiftyDropbox', :path => '../' + pod 'SwiftyDropboxObjC', :path => '../' end def shared_macOS_pods - platform :osx, '10.12' + platform :osx, '10.13' pod 'SwiftyDropbox', :path => '../' + pod 'SwiftyDropboxObjC', :path => '../' end target "TestSwiftyDropbox_iOS" do shared_iOS_pods + + target 'TestSwiftyDropbox_ActionExtension' do + inherit! :search_paths + end end target "TestSwiftyDropbox_iOSTests" do diff --git a/TestSwiftyDropbox/Podfile.lock b/TestSwiftyDropbox/Podfile.lock index cd98ea009..e5681ac3a 100644 --- a/TestSwiftyDropbox/Podfile.lock +++ b/TestSwiftyDropbox/Podfile.lock @@ -1,23 +1,22 @@ PODS: - - Alamofire (5.4.3) - - SwiftyDropbox (9.0.0): - - Alamofire (~> 5.4.3) + - SwiftyDropbox (8.3.0) + - SwiftyDropboxObjC (8.3.0): + - SwiftyDropbox (~> 8.3.0) DEPENDENCIES: - SwiftyDropbox (from `../`) - -SPEC REPOS: - trunk: - - Alamofire + - SwiftyDropboxObjC (from `../`) EXTERNAL SOURCES: SwiftyDropbox: :path: "../" + SwiftyDropboxObjC: + :path: "../" SPEC CHECKSUMS: - Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9 - SwiftyDropbox: 3cec2a063c77148398a78aa0e9e89fb48b82a206 + SwiftyDropbox: 5d9002eeb4e759ad494f64bc5c1dcdf791120fa9 + SwiftyDropboxObjC: bd08e3ae640838ba99473ecca80ded1c7d7186db -PODFILE CHECKSUM: 5db844d07d81e771829a61e505709b98d44d5d4a +PODFILE CHECKSUM: 590f63b5f6164d49495c7ce09c32e872551a6db9 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/project.pbxproj b/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/project.pbxproj index 570a54b49..49bf333b2 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/project.pbxproj +++ b/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/project.pbxproj @@ -7,24 +7,48 @@ objects = { /* Begin PBXBuildFile section */ - 1A02B43228C7C8630069333E /* TestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA541E67B7140076A119 /* TestClasses.swift */; }; - 1A02B43328C7C8630069333E /* TestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA551E67B7140076A119 /* TestData.swift */; }; - 1A02B43428C7C8630069333E /* TestAppType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA5C1E67B7E30076A119 /* TestAppType.swift */; }; - 1A02B43528C7C8630069333E /* TestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA541E67B7140076A119 /* TestClasses.swift */; }; - 1A02B43628C7C8630069333E /* TestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA551E67B7140076A119 /* TestData.swift */; }; - 1A02B43728C7C8630069333E /* TestAppType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA5C1E67B7E30076A119 /* TestAppType.swift */; }; - 1A1DC56528C7C68A002AACFC /* TestSwiftyDropboxApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A1DC56028C7C68A002AACFC /* TestSwiftyDropboxApp.swift */; }; - 1A1DC56928C7C68A002AACFC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A1DC56228C7C68A002AACFC /* AppDelegate.swift */; }; - 1A1DC56B28C7C68A002AACFC /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A1DC56328C7C68A002AACFC /* ContentView.swift */; }; - 1A1DC57128C7C69B002AACFC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A1DC56C28C7C69B002AACFC /* AppDelegate.swift */; }; - 1A1DC57528C7C69B002AACFC /* TestSwiftyDropboxApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A1DC56E28C7C69B002AACFC /* TestSwiftyDropboxApp.swift */; }; - 1A1DC57728C7C69B002AACFC /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A1DC56F28C7C69B002AACFC /* ContentView.swift */; }; - 1A3FB80328C7C58400911348 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A3FB7F228C7C58400911348 /* Assets.xcassets */; }; - 1A3FB80428C7C58400911348 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A3FB7F228C7C58400911348 /* Assets.xcassets */; }; + 1A10E2BF29F1FD62001899ED /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A10E2BE29F1FD62001899ED /* UniformTypeIdentifiers.framework */; }; + 1A10E2C429F1FD62001899ED /* ActionRequestHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A10E2C329F1FD62001899ED /* ActionRequestHandler.swift */; }; + 1A10E2CA29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 1A10E2BD29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 1A2038B228E74BAC00FFF227 /* CustomRoutesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A2038B128E74BAC00FFF227 /* CustomRoutesTests.swift */; }; + 1A2038B328E74BAC00FFF227 /* CustomRoutesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A2038B128E74BAC00FFF227 /* CustomRoutesTests.swift */; }; + 1A3EF46629F8998A00440A72 /* DebugBackgroundSessionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F948416429F6BCF400D0EE7B /* DebugBackgroundSessionViewModel.swift */; }; + 1A3EF46829F9E60000440A72 /* TestUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A3EF46729F9E60000440A72 /* TestUtilities.swift */; }; + 1A3EF46929F9E60000440A72 /* TestUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A3EF46729F9E60000440A72 /* TestUtilities.swift */; }; + 1A5E38EF28F62667000DDA19 /* ObjCFilesRoutesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5E38EE28F62667000DDA19 /* ObjCFilesRoutesTests.m */; }; + 1A5E38F028F62667000DDA19 /* ObjCFilesRoutesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5E38EE28F62667000DDA19 /* ObjCFilesRoutesTests.m */; }; + 1A6025702888B08100AFBC0D /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A6025602888B08000AFBC0D /* ContentView.swift */; }; + 1A6025722888B08100AFBC0D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A6025612888B08100AFBC0D /* Assets.xcassets */; }; + 1A6025732888B08100AFBC0D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A6025612888B08100AFBC0D /* Assets.xcassets */; }; + 1A60257B2888B14000AFBC0D /* TestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA541E67B7140076A119 /* TestClasses.swift */; }; + 1A60257C2888B14100AFBC0D /* TestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA541E67B7140076A119 /* TestClasses.swift */; }; + 1A60257D2888B14500AFBC0D /* TestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA551E67B7140076A119 /* TestData.swift */; }; + 1A60257E2888B14500AFBC0D /* TestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA551E67B7140076A119 /* TestData.swift */; }; + 1A60257F2888B14900AFBC0D /* TestAppType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA5C1E67B7E30076A119 /* TestAppType.swift */; }; + 1A6025802888B14900AFBC0D /* TestAppType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA5C1E67B7E30076A119 /* TestAppType.swift */; }; + 1A7A1F74288B505C00E4BD30 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A7A1F73288B505C00E4BD30 /* ContentView.swift */; }; + 1AC07D69294D2ADE00ACB584 /* ObjCTeamRoutesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AC07D68294D2ADE00ACB584 /* ObjCTeamRoutesTests.m */; }; + 1AC07D6A294D2ADE00ACB584 /* ObjCTeamRoutesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AC07D68294D2ADE00ACB584 /* ObjCTeamRoutesTests.m */; }; + 1AC5E4052888B53D00596695 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AC5E4042888B53D00596695 /* AppDelegate.swift */; }; + 1AC5E4072888B54E00596695 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AC5E4062888B54E00596695 /* AppDelegate.swift */; }; + 1AD046BD29F1FF7C007D6AEC /* BackgroundSessionTestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F937A6A728E355DE00A98E99 /* BackgroundSessionTestClasses.swift */; }; + 1AD046BE29F1FF83007D6AEC /* TestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA551E67B7140076A119 /* TestData.swift */; }; + 1AD046BF29F1FFC7007D6AEC /* TestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA541E67B7140076A119 /* TestClasses.swift */; }; + 1AD1DD7F2919D0C800D25C84 /* ObjCTestClasses.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD7D2919D0C800D25C84 /* ObjCTestClasses.m */; }; + 1AD1DD802919D0C800D25C84 /* ObjCTestClasses.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD7D2919D0C800D25C84 /* ObjCTestClasses.m */; }; + 1AD1DD812919D0C800D25C84 /* ObjCTestClasses.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD7D2919D0C800D25C84 /* ObjCTestClasses.m */; }; + 1AD1DD822919D0C800D25C84 /* ObjCTestClasses.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD7D2919D0C800D25C84 /* ObjCTestClasses.m */; }; + 1AD1DD84291AE49600D25C84 /* ObjCTestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD83291AE49600D25C84 /* ObjCTestData.swift */; }; + 1AD1DD85291AE49600D25C84 /* ObjCTestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD83291AE49600D25C84 /* ObjCTestData.swift */; }; + 1AD1DD86291AE49600D25C84 /* ObjCTestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD83291AE49600D25C84 /* ObjCTestData.swift */; }; + 1AD1DD87291AE49600D25C84 /* ObjCTestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1DD83291AE49600D25C84 /* ObjCTestData.swift */; }; + 1AF67B55288B53A30095CFF5 /* TestSwiftyDropboxApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67B54288B53A30095CFF5 /* TestSwiftyDropboxApp.swift */; }; + 1AF67B61288B53BC0095CFF5 /* TestSwiftyDropboxApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AF67B60288B53BC0095CFF5 /* TestSwiftyDropboxApp.swift */; }; 2DE9FA7E576002B002A57FE7 /* Pods_TestSwiftyDropbox_iOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6FD6468D7EB0E2A24938C7F /* Pods_TestSwiftyDropbox_iOSTests.framework */; }; - 48FF0AAB97FEAF3B2FB1E339 /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2D5CA78FD818A73C090448 /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework */; }; - 9CD631B844BE49EA44BA398C /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2B91A094AA6A1438F9D7F42 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework */; }; + 603DC439CD0FA802F1D7B630 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88EF2B15EB3131FE506C1A93 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework */; }; B02891CBF2EAAAB0548D4256 /* Pods_TestSwiftyDropbox_macOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A90894EA379C6DB01C1696D1 /* Pods_TestSwiftyDropbox_macOSTests.framework */; }; + CB3B993CC5E73C2D350EEC80 /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 038223663F154A875A96E29B /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework */; }; + F0BF434DD5644CDB2F929FC5 /* Pods_TestSwiftyDropbox_ActionExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C21AA0BD76A6BCA7BFE63AC4 /* Pods_TestSwiftyDropbox_ActionExtension.framework */; }; F290789A1D8B7D0F00E6DD71 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F29078901D8B7D0F00E6DD71 /* AppDelegate.swift */; }; F290789B1D8B7D0F00E6DD71 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F29078911D8B7D0F00E6DD71 /* Assets.xcassets */; }; F290789C1D8B7D0F00E6DD71 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F29078921D8B7D0F00E6DD71 /* LaunchScreen.storyboard */; }; @@ -42,6 +66,16 @@ F2D0EA5E1E67B7E30076A119 /* TestAppType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D0EA5C1E67B7E30076A119 /* TestAppType.swift */; }; F67BA3E07645BA0BDD67D0C8 /* Pods_TestSwiftyDropbox_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E97640DDC4A490D55BEBB20E /* Pods_TestSwiftyDropbox_iOS.framework */; }; F8E76D64CE9CA1FC6AA2728F /* Pods_TestSwiftyDropbox_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A4138CDE8EA81313D397A3C /* Pods_TestSwiftyDropbox_macOS.framework */; }; + F907ED4729F32CCF0049A603 /* DebugBackgroundSessionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F907ED4629F32CCF0049A603 /* DebugBackgroundSessionView.swift */; }; + F907ED4929F3345B0049A603 /* FileTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F907ED4829F3345B0049A603 /* FileTextView.swift */; }; + F907ED4B29F584550049A603 /* FileBrowserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F907ED4A29F584550049A603 /* FileBrowserView.swift */; }; + F91CEDE92B2A95F5009EED11 /* SwiftyDropboxTestExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F95F4B822B2A7F1800C237FB /* SwiftyDropboxTestExtensions.swift */; }; + F91CEDEA2B2A95F5009EED11 /* SwiftyDropboxTestExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F95F4B822B2A7F1800C237FB /* SwiftyDropboxTestExtensions.swift */; }; + F937A6A828E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F937A6A728E355DE00A98E99 /* BackgroundSessionTestClasses.swift */; }; + F937A6A928E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F937A6A728E355DE00A98E99 /* BackgroundSessionTestClasses.swift */; }; + F937A6AC28E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F937A6A728E355DE00A98E99 /* BackgroundSessionTestClasses.swift */; }; + F937A6AD28E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = F937A6A728E355DE00A98E99 /* BackgroundSessionTestClasses.swift */; }; + F948416529F6BCF400D0EE7B /* DebugBackgroundSessionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F948416429F6BCF400D0EE7B /* DebugBackgroundSessionViewModel.swift */; }; F949339F265D7ABA005DCA3C /* TeamRoutesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F949339E265D7ABA005DCA3C /* TeamRoutesTests.swift */; }; F975E5F0265702F400A17965 /* FilesRoutesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F975E5EF265702F400A17965 /* FilesRoutesTests.swift */; }; F9B7C82A2672DBD00099E24D /* FilesRoutesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F975E5EF265702F400A17965 /* FilesRoutesTests.swift */; }; @@ -51,6 +85,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 1A10E2C829F1FD62001899ED /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E76F577A1BB5C18600FE5EFB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1A10E2BC29F1FD62001899ED; + remoteInfo = TestSwiftyDropbox_ActionExtension; + }; F975E5F2265702F400A17965 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = E76F577A1BB5C18600FE5EFB /* Project object */; @@ -68,6 +109,17 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 1AF11AEF29F06B7500B00C2D /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 1A10E2CA29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; F9C66FBB26698D460042C899 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -82,34 +134,59 @@ /* Begin PBXFileReference section */ 016534E7C4F904F230763D70 /* Pods-TestSwiftyDropbox_macOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_macOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_macOSTests/Pods-TestSwiftyDropbox_macOSTests.debug.xcconfig"; sourceTree = ""; }; + 038223663F154A875A96E29B /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 04C2E59CD70E78BD0ACCDB7A /* Pods-TestSwiftyDropbox_iOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_iOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_iOSTests/Pods-TestSwiftyDropbox_iOSTests.debug.xcconfig"; sourceTree = ""; }; + 12B94D2100E8BD8DEC0F6F91 /* Pods-TestSwiftyDropbox_ActionExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_ActionExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_ActionExtension/Pods-TestSwiftyDropbox_ActionExtension.debug.xcconfig"; sourceTree = ""; }; 16369027F930D25F66DD88AA /* Pods-TestSwiftyDropbox_macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_macOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_macOS/Pods-TestSwiftyDropbox_macOS.debug.xcconfig"; sourceTree = ""; }; - 1A1DC56028C7C68A002AACFC /* TestSwiftyDropboxApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestSwiftyDropboxApp.swift; sourceTree = ""; }; - 1A1DC56128C7C68A002AACFC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 1A1DC56228C7C68A002AACFC /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 1A1DC56328C7C68A002AACFC /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 1A1DC56C28C7C69B002AACFC /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 1A1DC56D28C7C69B002AACFC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 1A1DC56E28C7C69B002AACFC /* TestSwiftyDropboxApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestSwiftyDropboxApp.swift; sourceTree = ""; }; - 1A1DC56F28C7C69B002AACFC /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 1A3FB7F228C7C58400911348 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 1A3FB7F728C7C58400911348 /* TestSwiftyDropbox_SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestSwiftyDropbox_SwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A3FB7FC28C7C58400911348 /* TestSwiftyDropbox_SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestSwiftyDropbox_SwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A3FB7FE28C7C58400911348 /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = ""; }; - 1CC9FC4A825A7CB16211C2DB /* Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig"; sourceTree = ""; }; + 1A09796A2889CB7100697EAF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1A09796B2889CB7C00697EAF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1A10E2BD29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = TestSwiftyDropbox_ActionExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A10E2BE29F1FD62001899ED /* UniformTypeIdentifiers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UniformTypeIdentifiers.framework; path = System/Library/Frameworks/UniformTypeIdentifiers.framework; sourceTree = SDKROOT; }; + 1A10E2C329F1FD62001899ED /* ActionRequestHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionRequestHandler.swift; sourceTree = ""; }; + 1A10E2C729F1FD62001899ED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1A2038B128E74BAC00FFF227 /* CustomRoutesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRoutesTests.swift; sourceTree = ""; }; + 1A3EF46729F9E60000440A72 /* TestUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestUtilities.swift; sourceTree = ""; }; + 1A5E38ED28F62667000DDA19 /* ObjCFilesRoutesTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjCFilesRoutesTests.h; sourceTree = ""; }; + 1A5E38EE28F62667000DDA19 /* ObjCFilesRoutesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ObjCFilesRoutesTests.m; sourceTree = ""; }; + 1A6025602888B08000AFBC0D /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 1A6025612888B08100AFBC0D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 1A6025662888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestSwiftyDropbox_SwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A60256B2888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestSwiftyDropbox_SwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A60256D2888B08100AFBC0D /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = ""; }; + 1A7A1F73288B505C00E4BD30 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 1AC07D67294D2ADE00ACB584 /* ObjCTeamRoutesTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjCTeamRoutesTests.h; sourceTree = ""; }; + 1AC07D68294D2ADE00ACB584 /* ObjCTeamRoutesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ObjCTeamRoutesTests.m; sourceTree = ""; }; + 1AC5E4042888B53D00596695 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 1AC5E4062888B54E00596695 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 1AD046C029F20022007D6AEC /* TestSwiftyDropbox_ActionExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TestSwiftyDropbox_ActionExtension.entitlements; sourceTree = ""; }; + 1AD1DD7D2919D0C800D25C84 /* ObjCTestClasses.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObjCTestClasses.m; sourceTree = ""; }; + 1AD1DD7E2919D0C800D25C84 /* ObjCTestClasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCTestClasses.h; sourceTree = ""; }; + 1AD1DD83291AE49600D25C84 /* ObjCTestData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjCTestData.swift; sourceTree = ""; }; + 1AF11AD829F06B7400B00C2D /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + 1AF11ADA29F06B7400B00C2D /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + 1AF67B54288B53A30095CFF5 /* TestSwiftyDropboxApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestSwiftyDropboxApp.swift; sourceTree = ""; }; + 1AF67B60288B53BC0095CFF5 /* TestSwiftyDropboxApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestSwiftyDropboxApp.swift; sourceTree = ""; }; + 42311085C8AD9EB2BCE1C256 /* Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig"; sourceTree = ""; }; 4FE2FE6D7993D53F7C6A9EA5 /* Pods-TestSwiftyDropbox_iOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_iOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_iOSTests/Pods-TestSwiftyDropbox_iOSTests.release.xcconfig"; sourceTree = ""; }; - 5154D5B64B0EC6E93DE73DDB /* Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig"; sourceTree = ""; }; + 66D121362F15142D3BFD9C3E /* Pods-TestSwiftyDropbox_Share.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_Share.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_Share/Pods-TestSwiftyDropbox_Share.debug.xcconfig"; sourceTree = ""; }; 7A4138CDE8EA81313D397A3C /* Pods_TestSwiftyDropbox_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7E017741F2C531C3E0C021A0 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7EA37FECE65CAC63E487E18E /* Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig"; sourceTree = ""; }; - 8FF688E76F4DBE654FA04599 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig"; sourceTree = ""; }; - 9A2D5CA78FD818A73C090448 /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A2B91A094AA6A1438F9D7F42 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 88EF2B15EB3131FE506C1A93 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8E796B944C9AF544A46A56E7 /* Pods_TestSwiftyDropbox_Share.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_Share.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9094D49EA130075DB471D196 /* Pods-TestSwiftyDropbox_ActionExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_ActionExtension.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_ActionExtension/Pods-TestSwiftyDropbox_ActionExtension.release.xcconfig"; sourceTree = ""; }; + 9A7B7C3BB873F61F36EDDB39 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig"; sourceTree = ""; }; + 9B9D2976D6D9A007609DFCF0 /* Pods-TestSwiftyDropbox_Share.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_Share.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_Share/Pods-TestSwiftyDropbox_Share.release.xcconfig"; sourceTree = ""; }; + A462271017FD01226006D143 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig"; sourceTree = ""; }; A90894EA379C6DB01C1696D1 /* Pods_TestSwiftyDropbox_macOSTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_macOSTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B68A70DCF67194E8A3419097 /* Pods-TestSwiftyDropbox_macOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_macOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_macOSTests/Pods-TestSwiftyDropbox_macOSTests.release.xcconfig"; sourceTree = ""; }; + C21AA0BD76A6BCA7BFE63AC4 /* Pods_TestSwiftyDropbox_ActionExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_ActionExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C687D209074C084E8D170992 /* Pods-TestSwiftyDropbox_WidgetExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_WidgetExtension.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_WidgetExtension/Pods-TestSwiftyDropbox_WidgetExtension.release.xcconfig"; sourceTree = ""; }; C80757739BB3B02BD36ECF4E /* Pods-TestSwiftyDropbox_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_iOS/Pods-TestSwiftyDropbox_iOS.debug.xcconfig"; sourceTree = ""; }; + D8BC52F9CE330AE2E53AF958 /* Pods-TestSwiftyDropbox_WidgetExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_WidgetExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_WidgetExtension/Pods-TestSwiftyDropbox_WidgetExtension.debug.xcconfig"; sourceTree = ""; }; + DAB261051FAB00A616854824 /* Pods_TestSwiftyDropbox_WidgetExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_WidgetExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E76F57821BB5C18600FE5EFB /* TestSwiftyDropbox_iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestSwiftyDropbox_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; E97640DDC4A490D55BEBB20E /* Pods_TestSwiftyDropbox_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E97F1897126186A5EDC8643E /* Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig"; sourceTree = ""; }; F1B156AEF951F10811B955A7 /* Pods-TestSwiftyDropbox_macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestSwiftyDropbox_macOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestSwiftyDropbox_macOS/Pods-TestSwiftyDropbox_macOS.release.xcconfig"; sourceTree = ""; }; F29078901D8B7D0F00E6DD71 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; F29078911D8B7D0F00E6DD71 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -128,7 +205,13 @@ F2D0EA551E67B7140076A119 /* TestData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestData.swift; sourceTree = ""; }; F2D0EA5C1E67B7E30076A119 /* TestAppType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestAppType.swift; sourceTree = ""; }; F6FD6468D7EB0E2A24938C7F /* Pods_TestSwiftyDropbox_iOSTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestSwiftyDropbox_iOSTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F907ED4629F32CCF0049A603 /* DebugBackgroundSessionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugBackgroundSessionView.swift; sourceTree = ""; }; + F907ED4829F3345B0049A603 /* FileTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileTextView.swift; sourceTree = ""; }; + F907ED4A29F584550049A603 /* FileBrowserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileBrowserView.swift; sourceTree = ""; }; + F937A6A728E355DE00A98E99 /* BackgroundSessionTestClasses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundSessionTestClasses.swift; sourceTree = ""; }; + F948416429F6BCF400D0EE7B /* DebugBackgroundSessionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugBackgroundSessionViewModel.swift; sourceTree = ""; }; F949339E265D7ABA005DCA3C /* TeamRoutesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamRoutesTests.swift; sourceTree = ""; }; + F95F4B822B2A7F1800C237FB /* SwiftyDropboxTestExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftyDropboxTestExtensions.swift; sourceTree = ""; }; F975E5ED265702F400A17965 /* TestSwiftyDropbox_iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestSwiftyDropbox_iOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; F975E5EF265702F400A17965 /* FilesRoutesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilesRoutesTests.swift; sourceTree = ""; }; F975E5F1265702F400A17965 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -139,19 +222,28 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 1A3FB7F428C7C58400911348 /* Frameworks */ = { + 1A10E2BA29F1FD62001899ED /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 48FF0AAB97FEAF3B2FB1E339 /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework in Frameworks */, + 1A10E2BF29F1FD62001899ED /* UniformTypeIdentifiers.framework in Frameworks */, + F0BF434DD5644CDB2F929FC5 /* Pods_TestSwiftyDropbox_ActionExtension.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 1A3FB7F928C7C58400911348 /* Frameworks */ = { + 1A6025632888B08100AFBC0D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9CD631B844BE49EA44BA398C /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework in Frameworks */, + CB3B993CC5E73C2D350EEC80 /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1A6025682888B08100AFBC0D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 603DC439CD0FA802F1D7B630 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -190,45 +282,65 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 1A3FB7EF28C7C58300911348 /* Shared */ = { + 1A10E2C029F1FD62001899ED /* TestSwiftyDropbox_ActionExtension */ = { + isa = PBXGroup; + children = ( + 1AD046C029F20022007D6AEC /* TestSwiftyDropbox_ActionExtension.entitlements */, + 1A10E2C329F1FD62001899ED /* ActionRequestHandler.swift */, + 1A10E2C729F1FD62001899ED /* Info.plist */, + ); + path = TestSwiftyDropbox_ActionExtension; + sourceTree = ""; + }; + 1A60257A2888B0E900AFBC0D /* TestSwiftyDropbox_SwiftUI */ = { + isa = PBXGroup; + children = ( + 1AC5E4012888B4CE00596695 /* Shared */, + 1AC5E4032888B50A00596695 /* iOS */, + 1AC5E4022888B4D400596695 /* macOS */, + ); + path = TestSwiftyDropbox_SwiftUI; + sourceTree = ""; + }; + 1AC5E4012888B4CE00596695 /* Shared */ = { isa = PBXGroup; children = ( - 1A3FB7F228C7C58400911348 /* Assets.xcassets */, + 1A6025612888B08100AFBC0D /* Assets.xcassets */, ); path = Shared; sourceTree = ""; }; - 1A3FB7FD28C7C58400911348 /* macOS */ = { + 1AC5E4022888B4D400596695 /* macOS */ = { isa = PBXGroup; children = ( - 1A1DC56E28C7C69B002AACFC /* TestSwiftyDropboxApp.swift */, - 1A1DC56C28C7C69B002AACFC /* AppDelegate.swift */, - 1A1DC56F28C7C69B002AACFC /* ContentView.swift */, - 1A3FB7FE28C7C58400911348 /* macOS.entitlements */, - 1A1DC56D28C7C69B002AACFC /* Info.plist */, + 1AF67B60288B53BC0095CFF5 /* TestSwiftyDropboxApp.swift */, + 1AC5E4062888B54E00596695 /* AppDelegate.swift */, + 1A7A1F73288B505C00E4BD30 /* ContentView.swift */, + 1A60256D2888B08100AFBC0D /* macOS.entitlements */, + 1A09796B2889CB7C00697EAF /* Info.plist */, ); path = macOS; sourceTree = ""; }; - 1ACBA79C28C7C5C70054441F /* TestSwiftyDropbox_SwiftUI */ = { + 1AC5E4032888B50A00596695 /* iOS */ = { isa = PBXGroup; children = ( - 1ACBA79D28C7C5FD0054441F /* iOS */, - 1A3FB7EF28C7C58300911348 /* Shared */, - 1A3FB7FD28C7C58400911348 /* macOS */, + 1AF67B54288B53A30095CFF5 /* TestSwiftyDropboxApp.swift */, + 1AC5E4042888B53D00596695 /* AppDelegate.swift */, + 1A6025602888B08000AFBC0D /* ContentView.swift */, + 1A09796A2889CB7100697EAF /* Info.plist */, ); - path = TestSwiftyDropbox_SwiftUI; + path = iOS; sourceTree = ""; }; - 1ACBA79D28C7C5FD0054441F /* iOS */ = { + 1AD1DD88291AE4A100D25C84 /* ObjC */ = { isa = PBXGroup; children = ( - 1A1DC56028C7C68A002AACFC /* TestSwiftyDropboxApp.swift */, - 1A1DC56228C7C68A002AACFC /* AppDelegate.swift */, - 1A1DC56328C7C68A002AACFC /* ContentView.swift */, - 1A1DC56128C7C68A002AACFC /* Info.plist */, + 1AD1DD7E2919D0C800D25C84 /* ObjCTestClasses.h */, + 1AD1DD7D2919D0C800D25C84 /* ObjCTestClasses.m */, + 1AD1DD83291AE49600D25C84 /* ObjCTestData.swift */, ); - path = iOS; + path = ObjC; sourceTree = ""; }; 7303CE65D832603F59B80A75 /* Pods */ = { @@ -242,10 +354,16 @@ 4FE2FE6D7993D53F7C6A9EA5 /* Pods-TestSwiftyDropbox_iOSTests.release.xcconfig */, 016534E7C4F904F230763D70 /* Pods-TestSwiftyDropbox_macOSTests.debug.xcconfig */, B68A70DCF67194E8A3419097 /* Pods-TestSwiftyDropbox_macOSTests.release.xcconfig */, - 8FF688E76F4DBE654FA04599 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig */, - 7EA37FECE65CAC63E487E18E /* Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig */, - 1CC9FC4A825A7CB16211C2DB /* Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig */, - 5154D5B64B0EC6E93DE73DDB /* Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig */, + A462271017FD01226006D143 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig */, + 9A7B7C3BB873F61F36EDDB39 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig */, + 42311085C8AD9EB2BCE1C256 /* Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig */, + E97F1897126186A5EDC8643E /* Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig */, + D8BC52F9CE330AE2E53AF958 /* Pods-TestSwiftyDropbox_WidgetExtension.debug.xcconfig */, + C687D209074C084E8D170992 /* Pods-TestSwiftyDropbox_WidgetExtension.release.xcconfig */, + 66D121362F15142D3BFD9C3E /* Pods-TestSwiftyDropbox_Share.debug.xcconfig */, + 9B9D2976D6D9A007609DFCF0 /* Pods-TestSwiftyDropbox_Share.release.xcconfig */, + 12B94D2100E8BD8DEC0F6F91 /* Pods-TestSwiftyDropbox_ActionExtension.debug.xcconfig */, + 9094D49EA130075DB471D196 /* Pods-TestSwiftyDropbox_ActionExtension.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -256,7 +374,8 @@ F2D0EA531E67B7140076A119 /* IntegrationTests */, F290788F1D8B7D0F00E6DD71 /* TestSwiftyDropbox_iOS */, F2D0EA451E67B5E00076A119 /* TestSwiftyDropbox_macOS */, - 1ACBA79C28C7C5C70054441F /* TestSwiftyDropbox_SwiftUI */, + 1A60257A2888B0E900AFBC0D /* TestSwiftyDropbox_SwiftUI */, + 1A10E2C029F1FD62001899ED /* TestSwiftyDropbox_ActionExtension */, F9C6701C266A65010042C899 /* TestUtils */, F975E5EE265702F400A17965 /* TestSwiftyDropbox_iOSTests */, F975E60D2657069C00A17965 /* TestSwiftyDropbox_macOSTests */, @@ -273,8 +392,9 @@ F2D0EA441E67B5E00076A119 /* TestSwiftyDropbox_macOS.app */, F975E5ED265702F400A17965 /* TestSwiftyDropbox_iOSTests.xctest */, F975E60C2657069C00A17965 /* TestSwiftyDropbox_macOSTests.xctest */, - 1A3FB7F728C7C58400911348 /* TestSwiftyDropbox_SwiftUI.app */, - 1A3FB7FC28C7C58400911348 /* TestSwiftyDropbox_SwiftUI.app */, + 1A6025662888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI.app */, + 1A60256B2888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI.app */, + 1A10E2BD29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension.appex */, ); name = Products; sourceTree = ""; @@ -287,8 +407,14 @@ 7A4138CDE8EA81313D397A3C /* Pods_TestSwiftyDropbox_macOS.framework */, F6FD6468D7EB0E2A24938C7F /* Pods_TestSwiftyDropbox_iOSTests.framework */, A90894EA379C6DB01C1696D1 /* Pods_TestSwiftyDropbox_macOSTests.framework */, - 9A2D5CA78FD818A73C090448 /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework */, - A2B91A094AA6A1438F9D7F42 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework */, + 038223663F154A875A96E29B /* Pods_TestSwiftyDropbox_SwiftUI__iOS_.framework */, + 88EF2B15EB3131FE506C1A93 /* Pods_TestSwiftyDropbox_SwiftUI__macOS_.framework */, + 1AF11AD829F06B7400B00C2D /* WidgetKit.framework */, + 1AF11ADA29F06B7400B00C2D /* SwiftUI.framework */, + DAB261051FAB00A616854824 /* Pods_TestSwiftyDropbox_WidgetExtension.framework */, + 8E796B944C9AF544A46A56E7 /* Pods_TestSwiftyDropbox_Share.framework */, + 1A10E2BE29F1FD62001899ED /* UniformTypeIdentifiers.framework */, + C21AA0BD76A6BCA7BFE63AC4 /* Pods_TestSwiftyDropbox_ActionExtension.framework */, ); name = Frameworks; sourceTree = ""; @@ -299,6 +425,11 @@ F29078A21D8B7EA500E6DD71 /* TestSwiftyDropbox.entitlements */, F29078901D8B7D0F00E6DD71 /* AppDelegate.swift */, F29078991D8B7D0F00E6DD71 /* ViewController.swift */, + F907ED4629F32CCF0049A603 /* DebugBackgroundSessionView.swift */, + F948416429F6BCF400D0EE7B /* DebugBackgroundSessionViewModel.swift */, + F907ED4829F3345B0049A603 /* FileTextView.swift */, + F907ED4A29F584550049A603 /* FileBrowserView.swift */, + 1A3EF46729F9E60000440A72 /* TestUtilities.swift */, F29078951D8B7D0F00E6DD71 /* Main.storyboard */, F29078921D8B7D0F00E6DD71 /* LaunchScreen.storyboard */, F29078911D8B7D0F00E6DD71 /* Assets.xcassets */, @@ -323,8 +454,10 @@ isa = PBXGroup; children = ( F2D0EA541E67B7140076A119 /* TestClasses.swift */, + F937A6A728E355DE00A98E99 /* BackgroundSessionTestClasses.swift */, F2D0EA551E67B7140076A119 /* TestData.swift */, F2D0EA5C1E67B7E30076A119 /* TestAppType.swift */, + 1AD1DD88291AE4A100D25C84 /* ObjC */, ); path = IntegrationTests; sourceTree = ""; @@ -334,6 +467,12 @@ children = ( F975E5EF265702F400A17965 /* FilesRoutesTests.swift */, F949339E265D7ABA005DCA3C /* TeamRoutesTests.swift */, + 1A2038B128E74BAC00FFF227 /* CustomRoutesTests.swift */, + F95F4B822B2A7F1800C237FB /* SwiftyDropboxTestExtensions.swift */, + 1A5E38ED28F62667000DDA19 /* ObjCFilesRoutesTests.h */, + 1A5E38EE28F62667000DDA19 /* ObjCFilesRoutesTests.m */, + 1AC07D67294D2ADE00ACB584 /* ObjCTeamRoutesTests.h */, + 1AC07D68294D2ADE00ACB584 /* ObjCTeamRoutesTests.m */, F975E5F1265702F400A17965 /* Info.plist */, ); path = TestSwiftyDropbox_iOSTests; @@ -358,15 +497,33 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 1A3FB7F628C7C58400911348 /* TestSwiftyDropbox_SwiftUI (iOS) */ = { + 1A10E2BC29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension */ = { isa = PBXNativeTarget; - buildConfigurationList = 1A3FB80928C7C58400911348 /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (iOS)" */; + buildConfigurationList = 1A10E2CB29F1FD62001899ED /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_ActionExtension" */; buildPhases = ( - 497912BEBAE0B51E63C36561 /* [CP] Check Pods Manifest.lock */, - 1A3FB7F328C7C58400911348 /* Sources */, - 1A3FB7F428C7C58400911348 /* Frameworks */, - 1A3FB7F528C7C58400911348 /* Resources */, - BFC618DEEAD0B0C7B59B2597 /* [CP] Embed Pods Frameworks */, + 2A9FAD64D0EA4093B2CF66B6 /* [CP] Check Pods Manifest.lock */, + 1A10E2B929F1FD62001899ED /* Sources */, + 1A10E2BA29F1FD62001899ED /* Frameworks */, + 1A10E2BB29F1FD62001899ED /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestSwiftyDropbox_ActionExtension; + productName = TestSwiftyDropbox_ActionExtension; + productReference = 1A10E2BD29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; + 1A6025652888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI (iOS) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1A6025782888B08100AFBC0D /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (iOS)" */; + buildPhases = ( + 38FB64B27657CB646D04C244 /* [CP] Check Pods Manifest.lock */, + 1A6025622888B08100AFBC0D /* Sources */, + 1A6025632888B08100AFBC0D /* Frameworks */, + 1A6025642888B08100AFBC0D /* Resources */, + 5DEAFD048C7BA938BB267AC7 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -374,18 +531,18 @@ ); name = "TestSwiftyDropbox_SwiftUI (iOS)"; productName = "TestSwiftyDropbox_SwiftUI (iOS)"; - productReference = 1A3FB7F728C7C58400911348 /* TestSwiftyDropbox_SwiftUI.app */; + productReference = 1A6025662888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI.app */; productType = "com.apple.product-type.application"; }; - 1A3FB7FB28C7C58400911348 /* TestSwiftyDropbox_SwiftUI (macOS) */ = { + 1A60256A2888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI (macOS) */ = { isa = PBXNativeTarget; - buildConfigurationList = 1A3FB80A28C7C58400911348 /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (macOS)" */; + buildConfigurationList = 1A6025792888B08100AFBC0D /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (macOS)" */; buildPhases = ( - 2BA231B0D86E6F74EEF8F821 /* [CP] Check Pods Manifest.lock */, - 1A3FB7F828C7C58400911348 /* Sources */, - 1A3FB7F928C7C58400911348 /* Frameworks */, - 1A3FB7FA28C7C58400911348 /* Resources */, - 6DAD86AE75200B4E1CBE34C1 /* [CP] Embed Pods Frameworks */, + 4662A793B39F2542E716950D /* [CP] Check Pods Manifest.lock */, + 1A6025672888B08100AFBC0D /* Sources */, + 1A6025682888B08100AFBC0D /* Frameworks */, + 1A6025692888B08100AFBC0D /* Resources */, + 897EA01363BA1354AC490898 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -393,7 +550,7 @@ ); name = "TestSwiftyDropbox_SwiftUI (macOS)"; productName = "TestSwiftyDropbox_SwiftUI (macOS)"; - productReference = 1A3FB7FC28C7C58400911348 /* TestSwiftyDropbox_SwiftUI.app */; + productReference = 1A60256B2888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI.app */; productType = "com.apple.product-type.application"; }; E76F57811BB5C18600FE5EFB /* TestSwiftyDropbox_iOS */ = { @@ -406,10 +563,12 @@ E76F57801BB5C18600FE5EFB /* Resources */, CA42C58617FDF7A849EBF8A6 /* [CP] Embed Pods Frameworks */, F9C66FBB26698D460042C899 /* Embed Frameworks */, + 1AF11AEF29F06B7500B00C2D /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + 1A10E2C929F1FD62001899ED /* PBXTargetDependency */, ); name = TestSwiftyDropbox_iOS; productName = TestSwiftyDropbox; @@ -482,24 +641,27 @@ isa = PBXProject; attributes = { LastSwiftMigration = 0730; - LastSwiftUpdateCheck = 1330; - LastUpgradeCheck = 1400; + LastSwiftUpdateCheck = 1420; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = Dropbox; TargetAttributes = { - 1A3FB7F628C7C58400911348 = { + 1A10E2BC29F1FD62001899ED = { + CreatedOnToolsVersion = 14.2; + ProvisioningStyle = Automatic; + }; + 1A6025652888B08100AFBC0D = { CreatedOnToolsVersion = 13.3.1; - LastSwiftMigration = 1330; + LastSwiftMigration = 1400; ProvisioningStyle = Automatic; }; - 1A3FB7FB28C7C58400911348 = { + 1A60256A2888B08100AFBC0D = { CreatedOnToolsVersion = 13.3.1; - LastSwiftMigration = 1330; + LastSwiftMigration = 1400; ProvisioningStyle = Automatic; }; E76F57811BB5C18600FE5EFB = { CreatedOnToolsVersion = 7.0; - DevelopmentTeam = G7HH3F8CAK; - LastSwiftMigration = 1000; + LastSwiftMigration = 1400; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Keychain = { @@ -509,16 +671,18 @@ }; F2D0EA431E67B5E00076A119 = { CreatedOnToolsVersion = 8.2.1; + LastSwiftMigration = 1400; ProvisioningStyle = Automatic; }; F975E5EC265702F400A17965 = { CreatedOnToolsVersion = 12.4; + LastSwiftMigration = 1400; ProvisioningStyle = Automatic; TestTargetID = E76F57811BB5C18600FE5EFB; }; F975E60B2657069C00A17965 = { CreatedOnToolsVersion = 12.4; - LastSwiftMigration = 1240; + LastSwiftMigration = 1400; ProvisioningStyle = Automatic; TestTargetID = F2D0EA431E67B5E00076A119; }; @@ -541,26 +705,34 @@ F2D0EA431E67B5E00076A119 /* TestSwiftyDropbox_macOS */, F975E5EC265702F400A17965 /* TestSwiftyDropbox_iOSTests */, F975E60B2657069C00A17965 /* TestSwiftyDropbox_macOSTests */, - 1A3FB7F628C7C58400911348 /* TestSwiftyDropbox_SwiftUI (iOS) */, - 1A3FB7FB28C7C58400911348 /* TestSwiftyDropbox_SwiftUI (macOS) */, + 1A6025652888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI (iOS) */, + 1A60256A2888B08100AFBC0D /* TestSwiftyDropbox_SwiftUI (macOS) */, + 1A10E2BC29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 1A3FB7F528C7C58400911348 /* Resources */ = { + 1A10E2BB29F1FD62001899ED /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1A6025642888B08100AFBC0D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1A3FB80328C7C58400911348 /* Assets.xcassets in Resources */, + 1A6025722888B08100AFBC0D /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 1A3FB7FA28C7C58400911348 /* Resources */ = { + 1A6025692888B08100AFBC0D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1A3FB80428C7C58400911348 /* Assets.xcassets in Resources */, + 1A6025732888B08100AFBC0D /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -600,6 +772,28 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 2A9FAD64D0EA4093B2CF66B6 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_ActionExtension-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 2B6A97740A1C847E89CAC7B9 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -607,20 +801,20 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_macOSTests/Pods-TestSwiftyDropbox_macOSTests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire-macOS/Alamofire.framework", "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-macOS/SwiftyDropbox.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyDropboxObjC-macOS/SwiftyDropboxObjC.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropbox.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropboxObjC.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_macOSTests/Pods-TestSwiftyDropbox_macOSTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 2BA231B0D86E6F74EEF8F821 /* [CP] Check Pods Manifest.lock */ = { + 36C15CA31BFB1ADDEC1A12EB /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -635,14 +829,14 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_SwiftUI (macOS)-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_macOSTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 36C15CA31BFB1ADDEC1A12EB /* [CP] Check Pods Manifest.lock */ = { + 38FB64B27657CB646D04C244 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -657,7 +851,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_macOSTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_SwiftUI (iOS)-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -686,7 +880,7 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 497912BEBAE0B51E63C36561 /* [CP] Check Pods Manifest.lock */ = { + 4662A793B39F2542E716950D /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -701,7 +895,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_SwiftUI (iOS)-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_SwiftUI (macOS)-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -715,37 +909,37 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_iOSTests/Pods-TestSwiftyDropbox_iOSTests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire-iOS/Alamofire.framework", "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-iOS/SwiftyDropbox.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyDropboxObjC-iOS/SwiftyDropboxObjC.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropbox.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropboxObjC.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_iOSTests/Pods-TestSwiftyDropbox_iOSTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 6DAD86AE75200B4E1CBE34C1 /* [CP] Embed Pods Frameworks */ = { + 5DEAFD048C7BA938BB267AC7 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS)-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire-macOS/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-macOS/SwiftyDropbox.framework", + "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS)-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-iOS/SwiftyDropbox.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyDropboxObjC-iOS/SwiftyDropboxObjC.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropbox.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropboxObjC.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS)-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS)-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 88DD337300C6CBADABAA7C33 /* [CP] Check Pods Manifest.lock */ = { @@ -770,46 +964,46 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - A52DBC70C69718E62328FFEE /* [CP] Check Pods Manifest.lock */ = { + 897EA01363BA1354AC490898 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS)-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-macOS/SwiftyDropbox.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyDropboxObjC-macOS/SwiftyDropboxObjC.framework", ); + name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_macOS-checkManifestLockResult.txt", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropbox.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropboxObjC.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (macOS)/Pods-TestSwiftyDropbox_SwiftUI (macOS)-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - BFC618DEEAD0B0C7B59B2597 /* [CP] Embed Pods Frameworks */ = { + A52DBC70C69718E62328FFEE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS)-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire-iOS/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-iOS/SwiftyDropbox.framework", + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropbox.framework", + "$(DERIVED_FILE_DIR)/Pods-TestSwiftyDropbox_macOS-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_SwiftUI (iOS)/Pods-TestSwiftyDropbox_SwiftUI (iOS)-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; CA42C58617FDF7A849EBF8A6 /* [CP] Embed Pods Frameworks */ = { @@ -819,13 +1013,13 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_iOS/Pods-TestSwiftyDropbox_iOS-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire-iOS/Alamofire.framework", "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-iOS/SwiftyDropbox.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyDropboxObjC-iOS/SwiftyDropboxObjC.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropbox.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropboxObjC.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -839,13 +1033,13 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-TestSwiftyDropbox_macOS/Pods-TestSwiftyDropbox_macOS-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire-macOS/Alamofire.framework", "${BUILT_PRODUCTS_DIR}/SwiftyDropbox-macOS/SwiftyDropbox.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyDropboxObjC-macOS/SwiftyDropboxObjC.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropbox.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyDropboxObjC.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -855,29 +1049,48 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 1A3FB7F328C7C58400911348 /* Sources */ = { + 1A10E2B929F1FD62001899ED /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1A1DC56928C7C68A002AACFC /* AppDelegate.swift in Sources */, - 1A1DC56528C7C68A002AACFC /* TestSwiftyDropboxApp.swift in Sources */, - 1A02B43228C7C8630069333E /* TestClasses.swift in Sources */, - 1A02B43428C7C8630069333E /* TestAppType.swift in Sources */, - 1A02B43328C7C8630069333E /* TestData.swift in Sources */, - 1A1DC56B28C7C68A002AACFC /* ContentView.swift in Sources */, + 1A3EF46629F8998A00440A72 /* DebugBackgroundSessionViewModel.swift in Sources */, + 1AD046BE29F1FF83007D6AEC /* TestData.swift in Sources */, + 1A10E2C429F1FD62001899ED /* ActionRequestHandler.swift in Sources */, + 1AD046BF29F1FFC7007D6AEC /* TestClasses.swift in Sources */, + 1A3EF46929F9E60000440A72 /* TestUtilities.swift in Sources */, + 1AD046BD29F1FF7C007D6AEC /* BackgroundSessionTestClasses.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 1A3FB7F828C7C58400911348 /* Sources */ = { + 1A6025622888B08100AFBC0D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1A1DC57528C7C69B002AACFC /* TestSwiftyDropboxApp.swift in Sources */, - 1A1DC57128C7C69B002AACFC /* AppDelegate.swift in Sources */, - 1A02B43528C7C8630069333E /* TestClasses.swift in Sources */, - 1A02B43728C7C8630069333E /* TestAppType.swift in Sources */, - 1A02B43628C7C8630069333E /* TestData.swift in Sources */, - 1A1DC57728C7C69B002AACFC /* ContentView.swift in Sources */, + 1AC5E4052888B53D00596695 /* AppDelegate.swift in Sources */, + 1A6025702888B08100AFBC0D /* ContentView.swift in Sources */, + 1A60257F2888B14900AFBC0D /* TestAppType.swift in Sources */, + F937A6AC28E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */, + 1AF67B55288B53A30095CFF5 /* TestSwiftyDropboxApp.swift in Sources */, + 1A60257B2888B14000AFBC0D /* TestClasses.swift in Sources */, + 1AD1DD86291AE49600D25C84 /* ObjCTestData.swift in Sources */, + 1AD1DD812919D0C800D25C84 /* ObjCTestClasses.m in Sources */, + 1A60257D2888B14500AFBC0D /* TestData.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1A6025672888B08100AFBC0D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1AC5E4072888B54E00596695 /* AppDelegate.swift in Sources */, + 1A7A1F74288B505C00E4BD30 /* ContentView.swift in Sources */, + 1A6025802888B14900AFBC0D /* TestAppType.swift in Sources */, + F937A6AD28E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */, + 1AF67B61288B53BC0095CFF5 /* TestSwiftyDropboxApp.swift in Sources */, + 1A60257C2888B14100AFBC0D /* TestClasses.swift in Sources */, + 1AD1DD87291AE49600D25C84 /* ObjCTestData.swift in Sources */, + 1AD1DD822919D0C800D25C84 /* ObjCTestClasses.m in Sources */, + 1A60257E2888B14500AFBC0D /* TestData.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -889,7 +1102,15 @@ F290789A1D8B7D0F00E6DD71 /* AppDelegate.swift in Sources */, F2D0EA5D1E67B7E30076A119 /* TestAppType.swift in Sources */, F2D0EA561E67B7140076A119 /* TestClasses.swift in Sources */, + 1AD1DD7F2919D0C800D25C84 /* ObjCTestClasses.m in Sources */, + 1AD1DD84291AE49600D25C84 /* ObjCTestData.swift in Sources */, F2D0EA581E67B7140076A119 /* TestData.swift in Sources */, + F948416529F6BCF400D0EE7B /* DebugBackgroundSessionViewModel.swift in Sources */, + F907ED4729F32CCF0049A603 /* DebugBackgroundSessionView.swift in Sources */, + F907ED4929F3345B0049A603 /* FileTextView.swift in Sources */, + F907ED4B29F584550049A603 /* FileBrowserView.swift in Sources */, + 1A3EF46829F9E60000440A72 /* TestUtilities.swift in Sources */, + F937A6A828E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -901,7 +1122,10 @@ F2D0EA471E67B5E00076A119 /* AppDelegate.swift in Sources */, F2D0EA5E1E67B7E30076A119 /* TestAppType.swift in Sources */, F2D0EA571E67B7140076A119 /* TestClasses.swift in Sources */, + 1AD1DD802919D0C800D25C84 /* ObjCTestClasses.m in Sources */, + 1AD1DD85291AE49600D25C84 /* ObjCTestData.swift in Sources */, F2D0EA591E67B7140076A119 /* TestData.swift in Sources */, + F937A6A928E355DE00A98E99 /* BackgroundSessionTestClasses.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -909,7 +1133,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1AC07D69294D2ADE00ACB584 /* ObjCTeamRoutesTests.m in Sources */, F975E5F0265702F400A17965 /* FilesRoutesTests.swift in Sources */, + 1A2038B228E74BAC00FFF227 /* CustomRoutesTests.swift in Sources */, + F91CEDE92B2A95F5009EED11 /* SwiftyDropboxTestExtensions.swift in Sources */, + 1A5E38EF28F62667000DDA19 /* ObjCFilesRoutesTests.m in Sources */, F949339F265D7ABA005DCA3C /* TeamRoutesTests.swift in Sources */, F9C66FDE266A5EE50042C899 /* TestTokenAuthGenerator.swift in Sources */, ); @@ -919,7 +1147,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1AC07D6A294D2ADE00ACB584 /* ObjCTeamRoutesTests.m in Sources */, F9B7C82E2672DBD40099E24D /* TeamRoutesTests.swift in Sources */, + 1A2038B328E74BAC00FFF227 /* CustomRoutesTests.swift in Sources */, + F91CEDEA2B2A95F5009EED11 /* SwiftyDropboxTestExtensions.swift in Sources */, + 1A5E38F028F62667000DDA19 /* ObjCFilesRoutesTests.m in Sources */, F9B7C82A2672DBD00099E24D /* FilesRoutesTests.swift in Sources */, F9C67018266A64D40042C899 /* TestTokenAuthGenerator.swift in Sources */, ); @@ -928,6 +1160,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 1A10E2C929F1FD62001899ED /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1A10E2BC29F1FD62001899ED /* TestSwiftyDropbox_ActionExtension */; + targetProxy = 1A10E2C829F1FD62001899ED /* PBXContainerItemProxy */; + }; F975E5F3265702F400A17965 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = E76F57811BB5C18600FE5EFB /* TestSwiftyDropbox_iOS */; @@ -960,9 +1197,79 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 1A3FB80528C7C58400911348 /* Debug */ = { + 1A10E2CC29F1FD62001899ED /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 12B94D2100E8BD8DEC0F6F91 /* Pods-TestSwiftyDropbox_ActionExtension.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = TestSwiftyDropbox_ActionExtension/TestSwiftyDropbox_ActionExtension.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = TestSwiftyDropbox_ActionExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = TestSwiftyDropbox_ActionExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Dropbox. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.getdropbox.TestSwiftyDropbox-iOS.ActionExtension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 1A10E2CD29F1FD62001899ED /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9094D49EA130075DB471D196 /* Pods-TestSwiftyDropbox_ActionExtension.release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = TestSwiftyDropbox_ActionExtension/TestSwiftyDropbox_ActionExtension.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = TestSwiftyDropbox_ActionExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = TestSwiftyDropbox_ActionExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Dropbox. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.getdropbox.TestSwiftyDropbox-iOS.ActionExtension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 1A6025742888B08100AFBC0D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8FF688E76F4DBE654FA04599 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig */; + baseConfigurationReference = A462271017FD01226006D143 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -979,7 +1286,6 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "$(SRCROOT)/TestSwiftyDropbox_SwiftUI/iOS/Info.plist"; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -989,7 +1295,7 @@ MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI-Test.TestSwiftyDropbox-SwiftUI"; PRODUCT_NAME = TestSwiftyDropbox_SwiftUI; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -1000,9 +1306,9 @@ }; name = Debug; }; - 1A3FB80628C7C58400911348 /* Release */ = { + 1A6025752888B08100AFBC0D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7EA37FECE65CAC63E487E18E /* Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig */; + baseConfigurationReference = 9A7B7C3BB873F61F36EDDB39 /* Pods-TestSwiftyDropbox_SwiftUI (iOS).release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1019,7 +1325,6 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "$(SRCROOT)/TestSwiftyDropbox_SwiftUI/iOS/Info.plist"; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -1028,7 +1333,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI-Test.TestSwiftyDropbox-SwiftUI"; PRODUCT_NAME = TestSwiftyDropbox_SwiftUI; SDKROOT = iphoneos; SWIFT_EMIT_LOC_STRINGS = YES; @@ -1038,9 +1343,9 @@ }; name = Release; }; - 1A3FB80728C7C58400911348 /* Debug */ = { + 1A6025762888B08100AFBC0D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1CC9FC4A825A7CB16211C2DB /* Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig */; + baseConfigurationReference = 42311085C8AD9EB2BCE1C256 /* Pods-TestSwiftyDropbox_SwiftUI (macOS).debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1065,7 +1370,7 @@ MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI-Test.TestSwiftyDropbox-SwiftUI"; PRODUCT_NAME = TestSwiftyDropbox_SwiftUI; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -1075,9 +1380,9 @@ }; name = Debug; }; - 1A3FB80828C7C58400911348 /* Release */ = { + 1A6025772888B08100AFBC0D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5154D5B64B0EC6E93DE73DDB /* Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig */; + baseConfigurationReference = E97F1897126186A5EDC8643E /* Pods-TestSwiftyDropbox_SwiftUI (macOS).release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1101,7 +1406,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.3; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-SwiftUI-Test.TestSwiftyDropbox-SwiftUI"; PRODUCT_NAME = TestSwiftyDropbox_SwiftUI; SDKROOT = macosx; SWIFT_EMIT_LOC_STRINGS = YES; @@ -1140,6 +1445,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -1156,7 +1462,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1197,6 +1504,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -1207,7 +1515,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -1222,17 +1531,21 @@ baseConfigurationReference = C80757739BB3B02BD36ECF4E /* Pods-TestSwiftyDropbox_iOS.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = TestSwiftyDropbox_iOS/TestSwiftyDropbox.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = G7HH3F8CAK; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = NO; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/TestSwiftyDropbox_iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-iOS-Test"; + PRODUCT_BUNDLE_IDENTIFIER = "com.getdropbox.TestSwiftyDropbox-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1241,15 +1554,19 @@ baseConfigurationReference = FD634227A6DF5488E51AF98C /* Pods-TestSwiftyDropbox_iOS.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = TestSwiftyDropbox_iOS/TestSwiftyDropbox.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = G7HH3F8CAK; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = NO; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/TestSwiftyDropbox_iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-iOS-Test"; + PRODUCT_BUNDLE_IDENTIFIER = "com.getdropbox.TestSwiftyDropbox-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -1259,16 +1576,20 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = NO; INFOPLIST_FILE = TestSwiftyDropbox_macOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-macOS-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1278,15 +1599,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = NO; INFOPLIST_FILE = TestSwiftyDropbox_macOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-macOS-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -1298,12 +1622,18 @@ CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)"; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropbox-iOS/SwiftyDropbox.framework/Headers\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropboxObjC-iOS/SwiftyDropboxObjC.framework/Headers\"", + ); INFOPLIST_FILE = TestSwiftyDropbox_iOSTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -1312,6 +1642,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-iOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestSwiftyDropbox_iOS.app/TestSwiftyDropbox_iOS"; @@ -1326,12 +1657,18 @@ CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)"; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropbox-iOS/SwiftyDropbox.framework/Headers\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropboxObjC-iOS/SwiftyDropboxObjC.framework/Headers\"", + ); INFOPLIST_FILE = TestSwiftyDropbox_iOSTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -1360,9 +1697,14 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; GCC_C_LANGUAGE_STANDARD = gnu11; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropbox-macOS/SwiftyDropbox.framework/Headers\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropboxObjC-macOS/SwiftyDropboxObjC.framework/Headers\"", + ); INFOPLIST_FILE = TestSwiftyDropbox_macOSTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-macOSTests"; @@ -1391,9 +1733,14 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; GCC_C_LANGUAGE_STANDARD = gnu11; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropbox-macOS/SwiftyDropbox.framework/Headers\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyDropboxObjC-macOS/SwiftyDropboxObjC.framework/Headers\"", + ); INFOPLIST_FILE = TestSwiftyDropbox_macOSTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.dropbox.TestSwiftyDropbox-macOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1406,20 +1753,29 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 1A3FB80928C7C58400911348 /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (iOS)" */ = { + 1A10E2CB29F1FD62001899ED /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_ActionExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1A10E2CC29F1FD62001899ED /* Debug */, + 1A10E2CD29F1FD62001899ED /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1A6025782888B08100AFBC0D /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (iOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( - 1A3FB80528C7C58400911348 /* Debug */, - 1A3FB80628C7C58400911348 /* Release */, + 1A6025742888B08100AFBC0D /* Debug */, + 1A6025752888B08100AFBC0D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1A3FB80A28C7C58400911348 /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (macOS)" */ = { + 1A6025792888B08100AFBC0D /* Build configuration list for PBXNativeTarget "TestSwiftyDropbox_SwiftUI (macOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( - 1A3FB80728C7C58400911348 /* Debug */, - 1A3FB80828C7C58400911348 /* Release */, + 1A6025762888B08100AFBC0D /* Debug */, + 1A6025772888B08100AFBC0D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Source/SwiftyDropbox/SwiftyDropbox.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_ActionExtension.xcscheme b/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_ActionExtension.xcscheme new file mode 100644 index 000000000..4b3d8b649 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_ActionExtension.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_iOS.xcscheme b/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_iOS.xcscheme index f42151dab..c3bcda919 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_iOS.xcscheme +++ b/TestSwiftyDropbox/TestSwiftyDropbox.xcodeproj/xcshareddata/xcschemes/TestSwiftyDropbox_iOS.xcscheme @@ -1,6 +1,6 @@ + + + + diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/ActionRequestHandler.swift b/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/ActionRequestHandler.swift new file mode 100644 index 000000000..04a660f57 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/ActionRequestHandler.swift @@ -0,0 +1,140 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +import MobileCoreServices +import SwiftyDropbox +import UIKit +import UniformTypeIdentifiers + +class ActionRequestHandler: NSObject, NSExtensionRequestHandling { + /* + In order to use a background session in an App Extension you need to create an App Group + and add that App Group to the entitlements for both the host app (TestSwiftyDropbox_iOS) + and the extension (TestSwiftDropbox_ActionExtension). + + Additionally, you will need to test on a real device as background session behavior is buggy + and/or broken on simulators. This means you will need to also generate a provisioning profile + for the host app and extension that contains the App Group entitlement. + + Lastly, you will need to pass your Background Session ID and App Group into the SwiftyDropbox + session configuration Below you will see a placeholders for this in TestData.swift + of "" and "". The Background Session ID is of your + choosing and may or may not be the same as the one used in the host app depending on + your use case. + + You can read more about all of this in the following resources: + https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1 + https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1409450-sharedcontaineridentifier + */ + static let useBackgroundSession = false + static let exitAfterUploadStart = false + + var extensionContext: NSExtensionContext? + + func runSwiftyDropboxTests(completion: @escaping () -> Void) { + DropboxClientsManager.loggingClosure = { _, message in + BackgroundTestLogger.log(message) + } + DropboxClientsManager.logBackgroundSession("Starting Dropbox actions in action extension") + + createClientIfNecessary() + + DropboxClientsManager.logBackgroundSession("Running test file actions in action extension") + + let runUpload = { + self.performUpload(then: completion) + } + + let runCreateTestFolder = { + self.createTestFolder(then: runUpload) + } + + let runDeleteTestFolder = { + self.deleteTestFolder(then: runCreateTestFolder) + } + + runDeleteTestFolder() + } + + private func createClientIfNecessary() { + let appKey = TestData.fullDropboxAppKey + + // Since `beginRequest(with:)` can be called multiple times, we need to check for existence before creating a client + if ActionRequestHandler.useBackgroundSession && DropboxClientsManager.authorizedBackgroundClient == nil { + DropboxClientsManager.setupWithAppKey( + appKey, + backgroundSessionIdentifier: TestData.extensionBackgroundSessionIdentifier, + sharedContainerIdentifier: TestData.sharedContainerIdentifier, + requestsToReconnect: { requestResults in + if #available(iOS 16.0, *) { + DebugBackgroundSessionViewModel.processReconnect(requestResults: requestResults) + } + } + ) + + guard DropboxClientsManager.authorizedBackgroundClient != nil else { + DropboxClientsManager.logBackgroundSession("Must log into TestSwiftyDropbox_iOS before using action extension.") + return + } + } else if DropboxClientsManager.authorizedClient == nil { + DropboxClientsManager.setupWithAppKey(appKey) + + guard DropboxClientsManager.authorizedClient != nil else { + DropboxClientsManager.logBackgroundSession("Must log into TestSwiftyDropbox_iOS before using action extension.") + return + } + } + } + + private func createTestFolder(then next: @escaping () -> Void) { + DropboxClientsManager.authorizedClient?.files.createFolderV2(path: TestConstants.dropboxTestFolder) + .response { response, error in + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "createFolderV2", from: response, error: error)) + next() + } + } + + private func deleteTestFolder(then next: @escaping () -> Void) { + DropboxClientsManager.authorizedClient?.files.deleteV2(path: TestConstants.dropboxTestFolder).response { response, error in + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "deleteV2", from: response, error: error)) + next() + } + } + + private func performUpload(then next: @escaping () -> Void) { + var client: DropboxClient? + if ActionRequestHandler.useBackgroundSession { + client = DropboxClientsManager.authorizedBackgroundClient + } else { + client = DropboxClientsManager.authorizedClient + } + + TestUtilities.createFileToUpload(sizeInKBs: 1_000) + let fileName = "/test_action_extension.txt" + let path = TestConstants.dropboxTestFolder + fileName + let input = TestConstants.fileToUpload + + client?.files.upload(path: path, input: input).response { response, error in + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "upload", from: response, error: error)) + next() + } + + if ActionRequestHandler.exitAfterUploadStart { + exit(0) + } + } + + func beginRequest(with context: NSExtensionContext) { + extensionContext = context + + runSwiftyDropboxTests { [weak self] in + self?.completeAndCleanup() + } + } + + func completeAndCleanup() { + extensionContext?.completeRequest(returningItems: nil, completionHandler: nil) + extensionContext = nil + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/Info.plist b/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/Info.plist new file mode 100644 index 000000000..1e79987cb --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/Info.plist @@ -0,0 +1,31 @@ + + + + + NSExtension + + NSExtensionAttributes + + NSExtensionActivationRule + + NSExtensionActivationSupportsWebURLWithMaxCount + 1 + + NSExtensionServiceAllowsFinderPreviewItem + + NSExtensionServiceAllowsTouchBarItem + + NSExtensionServiceFinderPreviewIconName + NSActionTemplate + NSExtensionServiceTouchBarBezelColorName + TouchBarBezel + NSExtensionServiceTouchBarIconName + NSActionTemplate + + NSExtensionPointIdentifier + com.apple.services + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).ActionRequestHandler + + + diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/TestSwiftyDropbox_ActionExtension.entitlements b/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/TestSwiftyDropbox_ActionExtension.entitlements new file mode 100644 index 000000000..8da1139fd --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_ActionExtension/TestSwiftyDropbox_ActionExtension.entitlements @@ -0,0 +1,10 @@ + + + + + keychain-access-groups + + $(AppIdentifierPrefix)group.com.getdropbox.TestSwiftyDropbox + + + diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/AppDelegate.swift b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/AppDelegate.swift index cc6293a04..e0fb07dd0 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/AppDelegate.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/AppDelegate.swift @@ -17,11 +17,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, ObservableObject { return true } - if (TestData.fullDropboxAppKey.range(of:"<") != nil) { + if TestData.fullDropboxAppKey.range(of: "<") != nil { print("\n\n\nMust set test data (in TestData.swift) before launching app.\n\n\nTerminating.....\n\n") - exit(0); + exit(0) } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: DropboxClientsManager.setupWithAppKey(TestData.fullDropboxAppKey) case .fullDropboxScopedForTeamTesting: @@ -31,11 +31,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate, ObservableObject { return true } - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + func application( + _ application: UIApplication, + configurationForConnecting connectingSceneSession: UISceneSession, + options: UIScene.ConnectionOptions + ) -> UISceneConfiguration { let sceneConfig = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role) sceneConfig.delegateClass = SceneDelegate.self return sceneConfig - } + } } class SceneDelegate: NSObject, UIWindowSceneDelegate, ObservableObject { @@ -59,13 +63,11 @@ class SceneDelegate: NSObject, UIWindowSceneDelegate, ObservableObject { } } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: - let _ = DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion) + _ = DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion) case .fullDropboxScopedForTeamTesting: - let _ = DropboxClientsManager.handleRedirectURLTeam(url, completion: oauthCompletion) + _ = DropboxClientsManager.handleRedirectURLTeam(url, completion: oauthCompletion) } - } - } diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/ContentView.swift b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/ContentView.swift index 73141a2d6..0c59d13ee 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/ContentView.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/iOS/ContentView.swift @@ -15,8 +15,6 @@ struct ContentView: View { VStack { Button("Run API Tests", action: runApiTests) .padding() - Button("Run Batch Upload Tests", action: runBatchUploadTests) - .padding() Button("Unlink Dropbox Account", action: unlink) .padding() } @@ -35,18 +33,14 @@ struct ContentView: View { exit(0) } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: - DropboxTester().testAllUserEndpoints(asMember: false, nextTest:unlink) + DropboxTester().testAllUserEndpoints(asMember: false, nextTest: unlink) case .fullDropboxScopedForTeamTesting: DropboxTeamTester().testTeamMemberFileAcessActions(unlink) } } - func runBatchUploadTests() { - DropboxTester().testBatchUpload() - } - func unlink() { DropboxClientsManager.unlinkClients() viewModel.checkIsLinked() @@ -56,17 +50,19 @@ struct ContentView: View { func link() { let scopeRequest: ScopeRequest // note if you add new scopes, you need to relogin to update your token - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: scopeRequest = ScopeRequest(scopeType: .user, scopes: DropboxTester.scopes, includeGrantedScopes: false) case .fullDropboxScopedForTeamTesting: scopeRequest = ScopeRequest(scopeType: .team, scopes: DropboxTeamTester.scopes, includeGrantedScopes: false) } - DropboxClientsManager.authorizeFromControllerV2(UIApplication.shared, - controller: nil, - loadingStatusDelegate: nil, - openURL: {(url: URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) }, - scopeRequest: scopeRequest) + DropboxClientsManager.authorizeFromControllerV2( + UIApplication.shared, + controller: nil, + loadingStatusDelegate: nil, + openURL: { (url: URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) }, + scopeRequest: scopeRequest + ) } } @@ -74,7 +70,7 @@ class ViewModel: ObservableObject { @Published var isLinked: Bool init() { - isLinked = ViewModel.sdkIsLinked() + self.isLinked = ViewModel.sdkIsLinked() } func checkIsLinked() { @@ -82,7 +78,7 @@ class ViewModel: ObservableObject { } private static func sdkIsLinked() -> Bool { - return DropboxClientsManager.authorizedClient != nil || DropboxClientsManager.authorizedTeamClient != nil + DropboxClientsManager.authorizedClient != nil || DropboxClientsManager.authorizedTeamClient != nil } } diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/AppDelegate.swift b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/AppDelegate.swift index 4d721201d..f12022ba1 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/AppDelegate.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/AppDelegate.swift @@ -17,17 +17,23 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject { return } - if (TestData.fullDropboxAppKey.range(of:"<") != nil) { + if TestData.fullDropboxAppKey.range(of: "<") != nil { print("\n\n\nMust set test data (in TestData.swift) before launching app.\n\n\nTerminating.....\n\n") - exit(0); + exit(0) } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: DropboxClientsManager.setupWithAppKeyDesktop(TestData.fullDropboxAppKey) case .fullDropboxScopedForTeamTesting: DropboxClientsManager.setupWithTeamAppKeyDesktop(TestData.fullDropboxAppKey) } - NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(handleGetURLEvent), forEventClass: AEEventClass(kInternetEventClass), andEventID: AEEventID(kAEGetURL)) + NSAppleEventManager.shared() + .setEventHandler( + self, + andSelector: #selector(handleGetURLEvent), + forEventClass: AEEventClass(kInternetEventClass), + andEventID: AEEventID(kAEGetURL) + ) } @objc func handleGetURLEvent(_ event: NSAppleEventDescriptor?, replyEvent: NSAppleEventDescriptor?) { @@ -50,7 +56,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject { } } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion) case .fullDropboxScopedForTeamTesting: diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/ContentView.swift b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/ContentView.swift index 711c6739b..761c92dcb 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/ContentView.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_SwiftUI/macOS/ContentView.swift @@ -32,9 +32,9 @@ struct ContentView: View { exit(0) } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: - DropboxTester().testAllUserEndpoints(asMember: false, nextTest:unlink) + DropboxTester().testAllUserEndpoints(asMember: false, nextTest: unlink) case .fullDropboxScopedForTeamTesting: DropboxTeamTester().testTeamMemberFileAcessActions(unlink) } @@ -49,7 +49,7 @@ struct ContentView: View { func link() { let scopeRequest: ScopeRequest // note if you add new scopes, you need to relogin to update your token - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: scopeRequest = ScopeRequest(scopeType: .user, scopes: DropboxTester.scopes, includeGrantedScopes: false) case .fullDropboxScopedForTeamTesting: @@ -60,7 +60,7 @@ struct ContentView: View { sharedApplication: NSApplication.shared, controller: nil, loadingStatusDelegate: nil, - openURL: {(url: URL) -> Void in NSWorkspace.shared.open(url)}, + openURL: { (url: URL) -> Void in NSWorkspace.shared.open(url) }, scopeRequest: scopeRequest ) } @@ -70,7 +70,7 @@ class ViewModel: ObservableObject { @Published var isLinked: Bool init() { - isLinked = ViewModel.sdkIsLinked() + self.isLinked = ViewModel.sdkIsLinked() } func checkIsLinked() { @@ -78,7 +78,7 @@ class ViewModel: ObservableObject { } private static func sdkIsLinked() -> Bool { - return DropboxClientsManager.authorizedClient != nil || DropboxClientsManager.authorizedTeamClient != nil + DropboxClientsManager.authorizedClient != nil || DropboxClientsManager.authorizedTeamClient != nil } } diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/AppDelegate.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/AppDelegate.swift index 0ec8cf9fa..714ebcdae 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/AppDelegate.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/AppDelegate.swift @@ -2,14 +2,26 @@ /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// -import UIKit +import SwiftUI import SwiftyDropbox +import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - + + func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { + DropboxClientsManager.loggingClosure = { _, message in + BackgroundTestLogger.log(message) + } + + DropboxClientsManager.logBackgroundSession("willFinishLaunchingWithOptions \(launchOptions?.description ?? "none")") + return true + } + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + DropboxClientsManager.logBackgroundSession("didFinishLaunchingWithOptions \(launchOptions?.description ?? "none")") + let processInfo = ProcessInfo.processInfo.environment let inTestScheme = processInfo["FULL_DROPBOX_API_APP_KEY"] != nil @@ -18,13 +30,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return true } - if (TestData.fullDropboxAppKey.range(of:"<") != nil) { + if TestData.fullDropboxAppKey.range(of: "<") != nil { print("\n\n\nMust set test data (in TestData.swift) before launching app.\n\n\nTerminating.....\n\n") - exit(0); + exit(0) } - switch(appPermission) { + + switch appPermission { case .fullDropboxScoped: - DropboxClientsManager.setupWithAppKey(TestData.fullDropboxAppKey) + DropboxClientsManager.setupWithAppKey( + TestData.fullDropboxAppKey, + backgroundSessionIdentifier: TestData.backgroundSessionIdentifier, + sharedContainerIdentifier: TestData.sharedContainerIdentifier, + requestsToReconnect: { requestResults in + self.processRequestResults(requestResults: requestResults) + } + ) case .fullDropboxScopedForTeamTesting: DropboxClientsManager.setupWithTeamAppKey(TestData.fullDropboxAppKey) } @@ -32,7 +52,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return true } - func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { let oauthCompletion: DropboxOAuthCompletion = { if let authResult = $0 { switch authResult { @@ -48,34 +68,72 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } let canHandleUrl: Bool - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: - canHandleUrl = DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion) + canHandleUrl = DropboxClientsManager.handleRedirectURL( + url, + includeBackgroundClient: true, + completion: oauthCompletion + ) case .fullDropboxScopedForTeamTesting: canHandleUrl = DropboxClientsManager.handleRedirectURLTeam(url, completion: oauthCompletion) } return canHandleUrl } + func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) { + DropboxClientsManager.logBackgroundSession("handleEventsForBackgroundURLSession \(identifier)") + + let actionExtensionCreationInfo: BackgroundExtensionSessionCreationInfo = .init(defaultInfo: .init( + backgroundSessionIdentifier: TestData.extensionBackgroundSessionIdentifier, + sharedContainerIdentifier: TestData.sharedContainerIdentifier + )) + + DropboxClientsManager.handleEventsForBackgroundURLSession( + with: identifier, + creationInfos: [actionExtensionCreationInfo], + completionHandler: completionHandler, + requestsToReconnect: { requestResults in + self.processRequestResults(requestResults: requestResults) + } + ) + } + + private func processRequestResults(requestResults: [Result]) { + if #available(iOS 16.0, *) { + DebugBackgroundSessionViewModel.processReconnect(requestResults: requestResults) + } + } + func applicationWillResignActive(_ application: UIApplication) { + DropboxClientsManager.logBackgroundSession("applicationWillResignActive") + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { + DropboxClientsManager.logBackgroundSession("applicationDidEnterBackground") + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { + DropboxClientsManager.logBackgroundSession("applicationWillEnterForeground") + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { + DropboxClientsManager.logBackgroundSession("applicationDidBecomeActive") + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { + DropboxClientsManager.logBackgroundSession("applicationWillTerminate") + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } } diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionView.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionView.swift new file mode 100644 index 000000000..5ff7a36c4 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionView.swift @@ -0,0 +1,119 @@ +// +// Copyright © 2023 Dropbox. All rights reserved. +// + +import SwiftUI +import SwiftyDropbox + +@available(iOS 16.0, *) +struct DebugBackgroundSession: View { + @StateObject var viewModel = DebugBackgroundSessionViewModel() + + let debugLogFileURL: URL? + + var body: some View { + VStack { + ScrollView { + VStack(alignment: .leading, spacing: 16) { + debugActionButtons + debugTextFields + Toggle(isOn: $viewModel.exitOnBackgrounding) { + Text("Exit on next didEnterBackground") + } + Button("View downloaded files", action: { + viewModel.showFileBrowser = true + }).buttonStyle(BlueButton()) + Button("View logs", action: { + viewModel.showLogBrowser = true + }).buttonStyle(BlueButton()) + } + .padding() + } + } + .fullScreenCover(isPresented: $viewModel.showFileBrowser) { + MakeFileBrowserView(localURL: TestConstants.localDownloadFolder) + } + .fullScreenCover(isPresented: $viewModel.showLogBrowser) { + MakeFileTextView(fileURL: debugLogFileURL) + } + .onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in + if viewModel.exitOnBackgrounding { + DropboxClientsManager.logBackgroundSession("simulating a termination by the OS through `exit(0)`") + exit(0) + } + } + } + + var debugActionButtons: some View { + VStack { + HStack { + Button("Start Downloads", action: viewModel.startDownloads) + Button("Create Dropbox Folder", action: viewModel.createDropboxTestFolder) + } + HStack { + Button("Start Uploads", action: viewModel.startUploads) + Button("Delete Dropbox Folder", action: viewModel.deleteDropboxTestFolder) + } + HStack { + Button("Create Local Folder", action: viewModel.createLocalDownloadsFolder) + Button("Delete Local Downloads", action: viewModel.deleteLocalDownloads) + } + } + .buttonStyle(BlueButton()) + } + + var debugTextFields: some View { + VStack { + HStack { + Text("Number of Downloads:") + .frame(maxWidth: .infinity, alignment: .leading) + TextField("Enter number of downloads", value: $viewModel.numberOfDownloads, formatter: NumberFormatter()) + .textFieldStyle(BackgroundDebugTextField()) + } + HStack { + Text("Number of Uploads:") + .frame(maxWidth: .infinity, alignment: .leading) + TextField("Enter number of uploads", value: $viewModel.numberOfUploads, formatter: NumberFormatter()) + .textFieldStyle(BackgroundDebugTextField()) + } + HStack { + Text("KB Size of Upload:") + .frame(maxWidth: .infinity, alignment: .leading) + TextField("Enter a size in KB", text: $viewModel.sizeOfUpload) + .textFieldStyle(BackgroundDebugTextField()) + } + } + } +} + +@available(iOS 16.0, *) +struct BlueButton: ButtonStyle { + func makeBody(configuration: Configuration) -> some View { + configuration.label + .frame(maxWidth: .infinity) + .font(.caption) + .fontWeight(.bold) + .padding() + .background(configuration.isPressed ? .indigo : .blue) + .foregroundStyle(.white) + .clipShape(Capsule()) + } +} + +@available(iOS 16.0, *) +struct BackgroundDebugTextField: TextFieldStyle { + func _body(configuration: TextField) -> some View { + configuration + .keyboardType(.numbersAndPunctuation) + .submitLabel(.done) + .textFieldStyle(RoundedBorderTextFieldStyle()) + .frame(maxWidth: .infinity) + } +} + +@available(iOS 16.0, *) +struct DebugBackgroundSession_Previews: PreviewProvider { + static var previews: some View { + DebugBackgroundSession(debugLogFileURL: nil) + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionViewModel.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionViewModel.swift new file mode 100644 index 000000000..fca79af77 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/DebugBackgroundSessionViewModel.swift @@ -0,0 +1,152 @@ +// +// Copyright © 2023 Dropbox. All rights reserved. +// + +import Foundation +import SwiftUI +import SwiftyDropbox + +@available(iOS 16.0, *) +class DebugBackgroundSessionViewModel: ObservableObject { + @Published var numberOfDownloads: Int = 0 + @Published var numberOfUploads: Int = 0 + @Published var sizeOfUpload: String = "" + @Published var exitOnBackgrounding: Bool = false + @Published var showFileBrowser = false + @Published var showLogBrowser = false + + func startDownloads() { + for i in 0 ..< numberOfDownloads { + let path = TestConstants.dropboxTestFolder + "/test_\(i).txt" + let destinationURL = TestConstants.localDownloadFolder + .appending(component: "test_\(i).txt") + + DropboxClientsManager.authorizedBackgroundClient?.files.download(path: path, destination: destinationURL).response { result, error in + let metadata = result?.0 + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "download", from: metadata, error: error)) + } + } + } + + func startUploads() { + TestUtilities.createFileToUpload(sizeInKBs: Double(sizeOfUpload) ?? 1) + + for i in 0 ..< numberOfUploads { + let path = TestConstants.dropboxTestFolder + "/test_\(i).txt" + Self.upload(path: path, input: TestConstants.fileToUpload) + } + } + + static let separator = "###___###" + + static func upload(path: String, input: URL, after: Double? = nil) { + let work: () -> Void = { + DropboxClientsManager.authorizedBackgroundClient?.files.upload(path: path, input: input) + .persistingString(string: path + Self.separator + input.path) + .response { response, error in + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "upload", from: response, error: error)) + + if case .rateLimitError(let limitError, _, _, _) = error { + self.upload(path: path, input: input, after: Double(limitError.retryAfter)) + } + } + } + + if let after = after { + DispatchQueue.main.asyncAfter(deadline: .now() + after) { + work() + } + } else { + work() + } + } + + func deleteDropboxTestFolder() { + DropboxClientsManager.authorizedClient?.files.deleteV2(path: TestConstants.dropboxTestFolder) + .response { response, error in + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "deleteV2", from: response, error: error)) + } + } + + func createDropboxTestFolder() { + DropboxClientsManager.authorizedClient?.files.createFolderV2(path: TestConstants.dropboxTestFolder) + .response { response, error in + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "createFolderV2", from: response, error: error)) + } + } + + func deleteLocalDownloads() { + do { + DropboxClientsManager.logBackgroundSession("deleteLocalDownloadsFolder at \(TestConstants.localDownloadFolder)") + try FileManager.default.removeItem(at: TestConstants.localDownloadFolder) + } catch { + print("Error deleting folder: \(error)") + } + } + + func createLocalDownloadsFolder() { + do { + DropboxClientsManager.logBackgroundSession("createLocalDownloadsFolder at \(TestConstants.localDownloadFolder)") + try FileManager.default.createDirectory(at: TestConstants.localDownloadFolder, withIntermediateDirectories: true) + } catch { + print("Error creating folder: \(error)") + } + } + + static func processReconnect(requestResults: [Result]) { + let successfulReturnedRequests = requestResults.compactMap { result -> DropboxBaseRequestBox? in + switch result { + case .success(let requestBox): + return requestBox + case .failure(let error): + DropboxClientsManager.logBackgroundSession("attemptReconnect error: \(error)") + return nil + } + } + DropboxClientsManager.logBackgroundSession("attemptReconnect returned requests \(requestResults)") + DropboxClientsManager.logBackgroundSession("attemptReconnect successful returned requests \(successfulReturnedRequests)") + + for request in successfulReturnedRequests { + switch request { + case .download(let downloadRequest): + downloadRequest.response { response, error in + if let result = response { + let writtenContent = String(data: FileManager.default.contents(atPath: result.1.path()) ?? .init(), encoding: .utf8) + DropboxClientsManager.logBackgroundSession("attemptReconnect download complete with content: \(writtenContent ?? "none")") + } else if let callError = error { + DropboxClientsManager.logBackgroundSession("attemptReconnect download errored: \(callError)") + } + } + case .upload(let uploadRequest): + uploadRequest.response { response, error in + if let result = response { + DropboxClientsManager.logBackgroundSession("attemptReconnect upload complete with size: \(result.size)") + } else if let callError = error { + if case .rateLimitError(let limitError, _, _, _) = error { + DropboxClientsManager.logBackgroundSession(DebugBackgroundSessionHelpers.summary(of: "upload", from: response, error: error)) + let persistedString = uploadRequest.clientPersistedString ?? "" + let components = persistedString.components(separatedBy: Self.separator) + let (dbPath, input) = (components[0], components[1]) + + let url = URL(fileURLWithPath: input) + DropboxClientsManager.logBackgroundSession("attemptReconnect upload rate limited: \(dbPath) \(url)") + DropboxClientsManager.logBackgroundSession("attemptReconnect upload rate limited retry") + + self.upload(path: dbPath, input: url, after: Double(limitError.retryAfter)) + } else { + DropboxClientsManager.logBackgroundSession("attemptReconnect upload errored: \(callError)") + } + } + } + default: + DropboxClientsManager.logBackgroundSession("attemptReconnect unexpected reconnected type: \(request)") + } + } + } +} + +enum DebugBackgroundSessionHelpers { + static func summary(of route: String, from response: CustomStringConvertible?, error: CustomStringConvertible?) -> String { + "\(route) response: \(response?.description ?? "nil") error: \(error?.description ?? "nil")" + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileBrowserView.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileBrowserView.swift new file mode 100644 index 000000000..87f2e6297 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileBrowserView.swift @@ -0,0 +1,87 @@ +// +// Copyright © 2023 Dropbox. All rights reserved. +// + +import SwiftUI + +@available(iOS 16.0, *) +func MakeFileBrowserView(localURL: URL?) -> FileBrowserView { + FileBrowserView(viewModel: FileBrowserViewModel(localURL: localURL)) +} + +@available(iOS 16.0, *) +class FileBrowserViewModel: ObservableObject { + let localURL: URL? + @Published var files: [URL] = [] + @Published var showAlert = false + @Published var selectedFileContent: String = "" + + init(localURL: URL?) { + self.localURL = localURL + + let fileManager = FileManager.default + + guard let localURL = localURL else { + return + } + + do { + let fileURLs = try fileManager.contentsOfDirectory(at: localURL, includingPropertiesForKeys: nil) + self.files = fileURLs.sorted(by: { $0.lastPathComponent < $1.lastPathComponent }) + } catch { + print("Error loading files: \(error)") + } + } + + func showFile(fileURL: URL) -> () -> Void { + { + do { + self.selectedFileContent = String(try String(contentsOf: fileURL).prefix(10_000)) + self.showAlert = true + } catch { + print("Error reading file: \(error)") + } + } + } +} + +@available(iOS 16.0, *) +struct FileBrowserView: View { + @Environment(\.dismiss) private var dismiss + @ObservedObject var viewModel: FileBrowserViewModel + + var body: some View { + NavigationView { + VStack { + Text("Files Count: \(viewModel.files.count)") + if viewModel.files.isEmpty { + Text("Folder doesn't exist or is empty") + .foregroundColor(.red) + } else { + List(viewModel.files, id: \.self) { fileURL in + Button(action: viewModel.showFile(fileURL: fileURL)) { + Text(fileURL.lastPathComponent) + } + } + } + } + .alert(isPresented: $viewModel.showAlert) { + Alert(title: Text("File Content"), message: Text(viewModel.selectedFileContent), dismissButton: .default(Text("Close"))) + } + .toolbar { + ToolbarItem(placement: .navigationBarLeading) { + Button("Close") { + dismiss() + } + } + } + } + } +} + +@available(iOS 16.0, *) +struct FileBrowserView_Previews: PreviewProvider { + static var previews: some View { + FileBrowserView(viewModel: FileBrowserViewModel(localURL: nil)) + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileTextView.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileTextView.swift new file mode 100644 index 000000000..83e5d8c46 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/FileTextView.swift @@ -0,0 +1,108 @@ +// +// Copyright © 2023 Dropbox. All rights reserved. +// + +import SwiftUI + +@available(iOS 16.0, *) +func MakeFileTextView(fileURL: URL?) -> FileTextView { + FileTextView(viewModel: FileTextViewModel(fileURL: fileURL)) +} + +@available(iOS 16.0, *) +class FileTextViewModel: ObservableObject { + @Published var fileContent: String = "" + + let fileURL: URL? + let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() + + init(fileURL: URL?) { + self.fileURL = fileURL + } + + func updateFileContent() { + DispatchQueue.global(qos: .userInitiated).async { + if let fileURL = self.fileURL, + let contents = try? String(contentsOf: fileURL).suffix(10_000) { + DispatchQueue.main.async { + self.fileContent = String(contents) + } + } else { + DispatchQueue.main.async { + self.fileContent = "Error: Unable to read file contents." + } + } + } + } + + func flushLogs() { + DispatchQueue.global(qos: .userInitiated).async { + guard let fileURL = self.fileURL else { + return + } + + do { + try "".write(to: fileURL, atomically: true, encoding: .utf8) + DispatchQueue.main.async { + self.fileContent = "" + } + } catch { + DispatchQueue.main.async { + self.fileContent = "Error: Unable to flush logs." + } + } + } + } +} + +@available(iOS 16.0, *) +struct FileTextView: View { + @Environment(\.dismiss) private var dismiss + @ObservedObject var viewModel: FileTextViewModel + + var body: some View { + NavigationView { + VStack { + Button("Flush Logs", action: viewModel.flushLogs) + .buttonStyle(BlueButton()) + .fixedSize() + .padding() + + ScrollViewReader { scrollProxy in + ScrollView { + VStack(alignment: .leading) { + Text(viewModel.fileContent) + .font(.system(size: 9, design: .monospaced)) + Text("").id("bottom") + } + .onReceive(viewModel.timer) { _ in + viewModel.updateFileContent() + } + .onAppear { + viewModel.updateFileContent() + } + .onChange(of: viewModel.fileContent) { _ in + scrollProxy.scrollTo("bottom", anchor: .bottom) + } + } + .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading) + } + }.toolbar { + ToolbarItem(placement: .navigationBarLeading) { + Button("Close") { + dismiss() + } + } + } + } + } +} + +@available(iOS 16.0, *) +struct FileTextView_Previews: PreviewProvider { + static var previews: some View { + FileTextView( + viewModel: FileTextViewModel(fileURL: URL(string: "/some/url")!) + ) + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Info.plist b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Info.plist index f46b8ec18..4e2f4032d 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Info.plist +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Info.plist @@ -2,24 +2,6 @@ - LSApplicationQueriesSchemes - - dbapi-2 - dbapi-8-emm - - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - db-<APP_KEY> - db-<APP_KEY> - db-<APP_KEY> - - - CFBundleDevelopmentRegion en CFBundleExecutable @@ -36,8 +18,26 @@ 1.0 CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + db-<APP_KEY> + db-<APP_KEY> + db-<APP_KEY> + + + CFBundleVersion 1 + LSApplicationQueriesSchemes + + dbapi-2 + dbapi-8-emm + LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Main.storyboard b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Main.storyboard index 1c869270c..f4bf1666d 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Main.storyboard +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -26,43 +26,44 @@ - - - - + + - - + - + + - + diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/TestUtilities.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/TestUtilities.swift new file mode 100644 index 000000000..4bd8868b7 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/TestUtilities.swift @@ -0,0 +1,39 @@ +/// +/// Copyright (c) 2023 Dropbox, Inc. All rights reserved. +/// + +import Foundation + +public enum TestConstants { + public static var sharedContainerDirectory = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: TestData.sharedContainerIdentifier)! + public static var cachesDirectory = sharedContainerDirectory.appendingPathComponent("Caches") + public static var fileToUpload = cachesDirectory.appendingPathComponent("file.txt") + public static var dropboxTestFolder = "/background_session_testing" + public static var localDownloadFolder = cachesDirectory.appendingPathComponent("downloads") +} + +public class TestUtilities { + public static func createFileToUpload(sizeInKBs: Double) { + let sizeInBytes = Int(1_024 * sizeInKBs) + writeFile(ofSize: sizeInBytes, at: TestConstants.fileToUpload) + } + + public static func writeFile(ofSize size: Int, at url: URL) { + let content = "test_content" + let contentData = content.data(using: .utf8)! + let dataSize = contentData.count + + do { + let repeatCount = size / dataSize + let fileContent = String(repeating: content, count: repeatCount) + + try fileContent.write(to: url, atomically: true, encoding: .utf8) + } catch { + print("Error writing file: \(error)") + } + } + + public static func summary(of route: String, from response: CustomStringConvertible?, error: CustomStringConvertible?) -> String { + "\(route) response: \(response?.description ?? "nil") error: \(error?.description ?? "nil")" + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/ViewController.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/ViewController.swift index 20a31a75e..7e3d109d2 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_iOS/ViewController.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOS/ViewController.swift @@ -2,29 +2,32 @@ /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// -import UIKit +import SwiftUI import SwiftyDropbox +import UIKit class ViewController: UIViewController { - @IBOutlet weak var runTestsButton: UIButton! - @IBOutlet weak var codeFlowlinkButton: UIButton! - @IBOutlet weak var unlinkButton: UIButton! - @IBOutlet weak var runBatchUploadTestsButton: UIButton! - + @IBOutlet var runTestsButton: UIButton! + @IBOutlet var codeFlowlinkButton: UIButton! + @IBOutlet var unlinkButton: UIButton! + @IBOutlet var debugBackgroundSessionButton: UIButton! + @IBAction func codeFlowLinkButtonPressed(_ sender: AnyObject) { let scopeRequest: ScopeRequest // note if you add new scopes, you need to relogin to update your token - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: scopeRequest = ScopeRequest(scopeType: .user, scopes: DropboxTester.scopes, includeGrantedScopes: false) case .fullDropboxScopedForTeamTesting: scopeRequest = ScopeRequest(scopeType: .team, scopes: DropboxTeamTester.scopes, includeGrantedScopes: false) } - DropboxClientsManager.authorizeFromControllerV2(UIApplication.shared, - controller: self, - loadingStatusDelegate: nil, - openURL: {(url: URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) }, - scopeRequest: scopeRequest) + DropboxClientsManager.authorizeFromControllerV2( + UIApplication.shared, + controller: self, + loadingStatusDelegate: nil, + openURL: { (url: URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) }, + scopeRequest: scopeRequest + ) } @IBAction func unlinkButtonPressed(_ sender: AnyObject) { @@ -38,17 +41,27 @@ class ViewController: UIViewController { self.checkButtons() exit(0) } - - switch(appPermission) { + + switch appPermission { case .fullDropboxScoped: - DropboxTester().testAllUserEndpoints(asMember: false, nextTest:unlink) + DropboxTester().testAllUserEndpoints(asMember: false, nextTest: unlink) case .fullDropboxScopedForTeamTesting: DropboxTeamTester().testTeamMemberFileAcessActions(unlink) } } - @IBAction func runBatchUploadTestsButtonPressed(_ sender: Any) { - DropboxTester().testBatchUpload() + @IBAction func debugBackgroundSessionButtonPressed(_ sender: Any) { + if #available(iOS 16.0, *) { + presentBackgroundDebugView() + } + } + + @available(iOS 16.0, *) + private func presentBackgroundDebugView() { + let contentView = DebugBackgroundSession(debugLogFileURL: BackgroundTestLogger.logsFileURL) + let hostingController = UIHostingController(rootView: contentView) + + present(hostingController, animated: true, completion: nil) } override func viewDidAppear(_ animated: Bool) { @@ -71,44 +84,44 @@ class ViewController: UIViewController { codeFlowlinkButton.isHidden = true unlinkButton.isHidden = false runTestsButton.isHidden = false - runBatchUploadTestsButton.isHidden = false + debugBackgroundSessionButton.isHidden = false } else { codeFlowlinkButton.isHidden = false unlinkButton.isHidden = true runTestsButton.isHidden = true - runBatchUploadTestsButton.isHidden = true + debugBackgroundSessionButton.isHidden = true } } /** - To run these unit tests, you will need to do the following: + To run these unit tests, you will need to do the following: - Navigate to TestSwifty/ and run `pod install` to install AlamoFire dependencies. + Navigate to TestSwifty/ and run `pod install` to install AlamoFire dependencies. - There are three types of unit tests here: + There are three types of unit tests here: - 1.) Regular Dropbox User API tests (requires app with 'Full Dropbox' permissions) - 2.) Dropbox Business API tests (requires app with 'Team member file access' permissions) - 3.) Dropbox Business API tests (requires app with 'Team member management' permissions) + 1.) Regular Dropbox User API tests (requires app with 'Full Dropbox' permissions) + 2.) Dropbox Business API tests (requires app with 'Team member file access' permissions) + 3.) Dropbox Business API tests (requires app with 'Team member management' permissions) - To run all of these tests, you will need three apps, one for each of the above permission types. + To run all of these tests, you will need three apps, one for each of the above permission types. - You must test these apps one at a time. + You must test these apps one at a time. - Once you have these apps, you will need to do the following: + Once you have these apps, you will need to do the following: - 1.) Fill in user-specific data in `TestData` and `TestTeamData` in TestData.swift - 2.) For each of the above apps, you will need to add a user-specific app key. For each test run, you - will need to call `DropboxClientsManager.setupWithAppKey` (or `DropboxClientsManager.setupWithTeamAppKey`) and supply the - appropriate app key value, in AppDelegate.swift - 3.) Depending on which app you are currently testing, you will need to toggle the `appPermission` variable - in AppDelegate.swift to the appropriate value. - 4.) For each of the above apps, you will need to add a user-specific URL scheme in Info.plist > - URL types > Item 0 (Editor) > URL Schemes > click '+'. URL scheme value should be 'db-' - where '' is value of your particular app's key + 1.) Fill in user-specific data in `TestData` and `TestTeamData` in TestData.swift + 2.) For each of the above apps, you will need to add a user-specific app key. For each test run, you + will need to call `DropboxClientsManager.setupWithAppKey` (or `DropboxClientsManager.setupWithTeamAppKey`) and supply the + appropriate app key value, in AppDelegate.swift + 3.) Depending on which app you are currently testing, you will need to toggle the `appPermission` variable + in AppDelegate.swift to the appropriate value. + 4.) For each of the above apps, you will need to add a user-specific URL scheme in Info.plist > + URL types > Item 0 (Editor) > URL Schemes > click '+'. URL scheme value should be 'db-' + where '' is value of your particular app's key - To create an app or to locate your app's app key, please visit the App Console here: + To create an app or to locate your app's app key, please visit the App Console here: - https://www.dropbox.com/developers/apps - */ + https://www.dropbox.com/developers/apps + */ } diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/CustomRoutesTests.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/CustomRoutesTests.swift new file mode 100644 index 000000000..62d1eee19 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/CustomRoutesTests.swift @@ -0,0 +1,81 @@ +// +// Copyright (c) 2022 Dropbox Inc. All rights reserved. +// + +import Foundation + +import XCTest +#if os(OSX) +@testable import TestSwiftyDropbox_macOS +#elseif os(iOS) +@testable import TestSwiftyDropbox_iOS +#endif + +@testable import SwiftyDropbox + +class CustomRoutesTests: XCTestCase { + private var userClient: UsersRoutes! + private var tester: DropboxTester! + + override func setUp() { + // You need an API app with the "Full Dropbox" permission type and at least the scopes in DropboxTester.scopes + // and no team scopes. + // You can create one for testing here: https://www.dropbox.com/developers/apps/create + // The 'App key' will be on the app's info page. + // Then follow https://dropbox.tech/developers/pkce--what-and-why- to get a refresh token using the PKCE flow + + continueAfterFailure = false + + if DropboxClientsManager.authorizedClient == nil { + setupDropboxClientsManager() + } + + userClient = DropboxClientsManager.authorizedClient!.users! + tester = DropboxTester() + } + + func setupDropboxClientsManager() { + let processInfo = ProcessInfo.processInfo.environment + + guard let apiAppKey = processInfo["FULL_DROPBOX_API_APP_KEY"] else { + return XCTFail("FULL_DROPBOX_API_APP_KEY needs to be set in the test Scheme") + } + guard let refreshToken = processInfo["FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN"] else { + return XCTFail("FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN needs to be set in the test Scheme") + } + + guard let transportClient = TestAuthTokenGenerator.transportClient(with: refreshToken, apiKey: apiAppKey, scopes: DropboxTester.scopes) else { + return XCTFail("Error: Access token creation failed") + } + + #if os(OSX) + DropboxClientsManager.setupWithAppKeyDesktop(apiAppKey, transportClient: transportClient, secureStorageAccess: SecureStorageAccessTestImpl()) + #elseif os(iOS) + DropboxClientsManager.setupWithAppKey(apiAppKey, transportClient: transportClient, secureStorageAccess: SecureStorageAccessTestImpl()) + #endif + } + + override func tearDown() { + print("tearDown: delete folder") + let flag = XCTestExpectation() + + FilesTests(tester: tester).deleteV2 { + flag.fulfill() + } + + _ = XCTWaiter.wait(for: [flag], timeout: 30) // don't need to check result on tear down + } + + func testFileRoutes() { + let flag = XCTestExpectation() + + let nextTest = { + flag.fulfill() + } + + tester.testCustomActions(nextTest) + + let result = XCTWaiter.wait(for: [flag], timeout: 60 * 5) + XCTAssertEqual(result, .completed, "Error: timeout on file routes tests") + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift index 204c21723..95c818f05 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import SwiftyDropbox class FilesRoutesTests: XCTestCase { - private var userClient: UsersRoutes! private var tester: DropboxTester! @@ -29,6 +28,15 @@ class FilesRoutesTests: XCTestCase { continueAfterFailure = false + if DropboxClientsManager.authorizedClient == nil { + setupDropboxClientsManager() + } + + userClient = DropboxClientsManager.authorizedClient!.users! + tester = DropboxTester() + } + + func setupDropboxClientsManager() { let processInfo = ProcessInfo.processInfo.environment guard let apiAppKey = processInfo["FULL_DROPBOX_API_APP_KEY"] else { @@ -43,13 +51,10 @@ class FilesRoutesTests: XCTestCase { } #if os(OSX) - DropboxClientsManager.setupWithAppKeyDesktop(apiAppKey, transportClient: transportClient) + DropboxClientsManager.setupWithAppKeyDesktop(apiAppKey, transportClient: transportClient, secureStorageAccess: SecureStorageAccessTestImpl()) #elseif os(iOS) - DropboxClientsManager.setupWithAppKey(apiAppKey, transportClient: transportClient) + DropboxClientsManager.setupWithAppKey(apiAppKey, transportClient: transportClient, secureStorageAccess: SecureStorageAccessTestImpl()) #endif - - userClient = DropboxClientsManager.authorizedClient!.users! - tester = DropboxTester() } override func tearDown() { @@ -72,7 +77,7 @@ class FilesRoutesTests: XCTestCase { tester.testFilesActions(nextTest, asMember: false) - let result = XCTWaiter.wait(for: [flag], timeout: 60*5) + let result = XCTWaiter.wait(for: [flag], timeout: 60 * 5) XCTAssertEqual(result, .completed, "Error: timeout on file routes tests") } } diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.h b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.h new file mode 100644 index 000000000..196f6fd50 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.h @@ -0,0 +1,17 @@ +// +// ObjCUserRoutesTests.h +// TestSwiftyDropbox +// +// Created by Taylor Case on 10/11/22. +// Copyright © 2022 Dropbox. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ObjCFilesRoutesTests : XCTestCase + +@end + +NS_ASSUME_NONNULL_END diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.m b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.m new file mode 100644 index 000000000..9fb9ae834 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCFilesRoutesTests.m @@ -0,0 +1,103 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +#import "ObjCFilesRoutesTests.h" +#import "ObjCTestClasses.h" + +#if TARGET_OS_IPHONE +#import "TestSwiftyDropbox_iOSTests-Swift.h" +#elif TARGET_OS_MAC +#import "TestSwiftyDropbox_macOSTests-Swift.h" +#endif + + +@implementation ObjCFilesRoutesTests { + NSOperationQueue *_delegateQueue; + DropboxTester *_tester; +} + +- (void)setUp { + self.continueAfterFailure = false; + + if (DBXDropboxClientsManager.authorizedClient == nil) { + [self setupDropboxClientsManager]; + } + + _tester = [[DropboxTester alloc] init]; +} + +- (void)setupDropboxClientsManager { + NSDictionary *processInfo = NSProcessInfo.processInfo.environment; + + NSString *apiAppKey = processInfo[@"FULL_DROPBOX_API_APP_KEY"]; + if (apiAppKey == nil) { + XCTFail(@"FULL_DROPBOX_API_APP_KEY needs to be set in the test Scheme"); + } + NSString *refreshToken = processInfo[@"FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN"]; + if (refreshToken == nil) { + XCTFail(@"FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN needs to be set in the test Scheme"); + } + + DBXDropboxOAuthManager *manager = [[DBXDropboxOAuthManager alloc] initWithAppKey:apiAppKey secureStorageAccess:[[DBXSecureStorageAccessTestImpl alloc] init]]; + DBXDropboxAccessToken *defaultToken = [[DBXDropboxAccessToken alloc] initWithAccessToken:@"" uid:@"test" refreshToken:refreshToken tokenExpirationTimestamp:0]; + + XCTestExpectation *flag = [[XCTestExpectation alloc] initWithDescription:@"setupDropboxClientsManager"]; + + __block DBXDropboxAccessToken * _Nonnull returnAccessToken; + + [manager refreshAccessToken:defaultToken scopes:[DropboxTester scopesForTests] queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) completion:^(DBXDropboxOAuthResult * _Nullable result) { + if (result.token) { + returnAccessToken = result.token; + } else if (result.errorMessage) { + XCTFail(@"Error: failed to refresh access token: %@", result.errorMessage); + } else if (result.wasCancelled) { + XCTFail(@"Error: failed to refresh access token (cancelled)"); + } else { + XCTFail(@"Error: failed to refresh access token (no result)"); + } + + [flag fulfill]; + }]; + + XCTWaiterResult result = [XCTWaiter waitForExpectations:@[flag] timeout:10]; + XCTAssertEqual(result, XCTWaiterResultCompleted); + + DBXAccessTokenProvider *tokenProvider = [manager accessTokenProviderForToken:returnAccessToken]; + DBXDropboxTransportClient *transportClient = [[DBXDropboxTransportClient alloc] initWithAccessTokenProvider:tokenProvider selectUser:nil sessionConfiguration: nil pathRoot:nil]; + +#if TARGET_OS_IPHONE + DBXSecureStorageAccessTestImpl *secureStorageAccess = [[DBXSecureStorageAccessTestImpl alloc] init]; + [DBXDropboxClientsManager setupWithAppKey:apiAppKey transportClient:transportClient backgroundTransportClient:nil secureStorageAccess:secureStorageAccess includeBackgroundClient:NO requestsToReconnect: ^(NSArray *reconnectionResults){}]; +#elif TARGET_OS_MAC + DBXSecureStorageAccessTestImpl *secureStorageAccess = [[DBXSecureStorageAccessTestImpl alloc] init]; + [DBXDropboxClientsManager setupWithAppKeyDesktop:apiAppKey transportClient:transportClient secureStorageAccess:secureStorageAccess]; +#endif +} + + +- (void)tearDown { + NSLog(@"ObjcTests tearDown: delete folder"); + XCTestExpectation *flag = [[XCTestExpectation alloc] initWithDescription:@"tearDown"]; + + [[[FilesTests alloc] init:_tester] deleteV2:^{ + [flag fulfill]; + }]; + + XCTWaiterResult result = [XCTWaiter waitForExpectations:@[flag] timeout:30]; + XCTAssertEqual(result, XCTWaiterResultCompleted); +} + +- (void)testObjcUserRoutes { + NSLog(@"ObjCTests testObjcUserRoutes"); + XCTestExpectation *flag = [[XCTestExpectation alloc] initWithDescription:@"testObjcUserRoutes Expectation"]; + + [_tester testFilesEndpoints:^{ + [flag fulfill]; + } asMember:NO]; + + XCTWaiterResult result = [XCTWaiter waitForExpectations:@[flag] timeout:60*5]; + XCTAssertEqual(result, XCTWaiterResultCompleted); +} + +@end diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.h b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.h new file mode 100644 index 000000000..cb314f072 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.h @@ -0,0 +1,17 @@ +// +// ObjCTeamRoutesTests.h +// TestSwiftyDropbox +// +// Created by Taylor Case on 12/16/22. +// Copyright © 2022 Dropbox. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ObjCTeamRoutesTests : XCTestCase + +@end + +NS_ASSUME_NONNULL_END diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.m b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.m new file mode 100644 index 000000000..def867470 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/ObjCTeamRoutesTests.m @@ -0,0 +1,134 @@ +/// +/// Copyright (c) 2022 Dropbox, Inc. All rights reserved. +/// + +#import "ObjCTeamRoutesTests.h" +#import "ObjCTestClasses.h" + +#if TARGET_OS_IPHONE +#import "TestSwiftyDropbox_iOSTests-Swift.h" +#elif TARGET_OS_MAC +#import "TestSwiftyDropbox_macOSTests-Swift.h" +#endif + +@implementation ObjCTeamRoutesTests { + NSOperationQueue *_delegateQueue; + DropboxTeamTester *_tester; +} + ++ (void)setUp { + [super setUp]; + + [DBXDropboxOAuthManager __test_only_resetForTeamSetup]; + [ObjCTeamRoutesTests setupDropboxClientsManager]; +} + +- (void)setUp { + self.continueAfterFailure = false; + + _tester = [[DropboxTeamTester alloc] init]; + + [self setupTestData]; +} + ++ (void)setupDropboxClientsManager { + NSDictionary *processInfo = NSProcessInfo.processInfo.environment; + + NSString *apiAppKey = processInfo[@"FULL_DROPBOX_API_APP_KEY"]; + if (apiAppKey == nil) { + XCTFail(@"FULL_DROPBOX_API_APP_KEY needs to be set in the test Scheme"); + } + NSString *refreshToken = processInfo[@"FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN"]; + if (refreshToken == nil) { + XCTFail(@"FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN needs to be set in the test Scheme"); + } + + DBXDropboxOAuthManager *manager = [[DBXDropboxOAuthManager alloc] initWithAppKey:apiAppKey secureStorageAccess:[[DBXSecureStorageAccessTestImpl alloc] init]]; + DBXDropboxAccessToken *defaultToken = [[DBXDropboxAccessToken alloc] initWithAccessToken:@"" uid:@"test" refreshToken:refreshToken tokenExpirationTimestamp:0]; + + XCTestExpectation *flag = [[XCTestExpectation alloc] initWithDescription:@"setupDropboxClientsManager"]; + + __block DBXDropboxAccessToken * _Nonnull returnAccessToken; + + [manager refreshAccessToken:defaultToken scopes:[DropboxTeamTester scopesForTests] queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) completion:^(DBXDropboxOAuthResult * _Nullable result) { + if (result.token) { + returnAccessToken = result.token; + } else if (result.errorMessage) { + XCTFail(@"Error: failed to refresh access token: %@", result.errorMessage); + } else if (result.wasCancelled) { + XCTFail(@"Error: failed to refresh access token (cancelled)"); + } else { + XCTFail(@"Error: failed to refresh access token (no result)"); + } + + [flag fulfill]; + }]; + + XCTWaiterResult result = [XCTWaiter waitForExpectations:@[flag] timeout:10]; + XCTAssertEqual(result, XCTWaiterResultCompleted); + + DBXAccessTokenProvider *tokenProvider = [manager accessTokenProviderForToken:returnAccessToken]; + DBXDropboxTransportClient *transportClient = [[DBXDropboxTransportClient alloc] initWithAccessTokenProvider:tokenProvider selectUser:nil sessionConfiguration:nil pathRoot:nil]; + +#if TARGET_OS_IPHONE + DBXSecureStorageAccessTestImpl *secureStorageAccess = [[DBXSecureStorageAccessTestImpl alloc] init]; + [DBXDropboxClientsManager setupWithTeamAppKeyMultiUser:apiAppKey transportClient:transportClient secureStorageAccess:secureStorageAccess tokenUid:@"test"]; + +#elif TARGET_OS_MAC + DBXSecureStorageAccessTestImpl *secureStorageAccess = [[DBXSecureStorageAccessTestImpl alloc] init]; + [DBXDropboxClientsManager setupWithTeamAppKeyMultiUserDesktop:apiAppKey transportClient:transportClient secureStorageAccess:secureStorageAccess tokenUid:@"test"]; +#endif +} + +- (void)setupTestData { + NSDictionary *processInfo = NSProcessInfo.processInfo.environment; + + NSString *teamMemberEmail = processInfo[@"TEAM_MEMBER_EMAIL"]; + if (teamMemberEmail == nil) { + XCTFail(@"TEAM_MEMBER_EMAIL needs to be set in the test Scheme"); + } + NSString *emailToAddAsTeamMember = processInfo[@"EMAIL_TO_ADD_AS_TEAM_MEMBER"]; + if (emailToAddAsTeamMember == nil) { + XCTFail(@"EMAIL_TO_ADD_AS_TEAM_MEMBER needs to be set in the test Scheme"); + } + NSString *accountId = processInfo[@"ACCOUNT_ID"]; + if (accountId == nil) { + XCTFail(@"ACCOUNT_ID needs to be set in the test Scheme"); + } + NSString *accountId2 = processInfo[@"ACCOUNT_ID_2"]; + if (accountId2 == nil) { + XCTFail(@"ACCOUNT_ID_2 needs to be set in the test Scheme"); + } + NSString *accountId3 = processInfo[@"ACCOUNT_ID_3"]; + if (accountId3 == nil) { + XCTFail(@"ACCOUNT_ID_3 needs to be set in the test Scheme"); + } + + [_tester setupDBXTestDataForTeamTests:teamMemberEmail emailToAddAsTeamMember:emailToAddAsTeamMember accountId:accountId accountId2:accountId2 accountId3:accountId3]; +} + +- (void)testObjcTeamMemberManagement { + NSLog(@"ObjCTests testObjcTeamMemberManagement"); + XCTestExpectation *flag = [[XCTestExpectation alloc] initWithDescription:@"testObjcTeamMemberManagement Expectation"]; + + [_tester testTeamMemberManagementActions:^{ + [flag fulfill]; + }]; + + XCTWaiterResult result = [XCTWaiter waitForExpectations:@[flag] timeout:60*5]; + XCTAssertEqual(result, XCTWaiterResultCompleted); +} + +- (void)testObjcTeamMemberFileAccess { + NSLog(@"ObjCTests testObjcTeamRoutes"); + XCTestExpectation *flag = [[XCTestExpectation alloc] initWithDescription:@"testObjcTeamRoutes Expectation"]; + + [_tester testAllTeamMemberFileAcessActions:^{ + [flag fulfill]; + }]; + + XCTWaiterResult result = [XCTWaiter waitForExpectations:@[flag] timeout:60*5]; + XCTAssertEqual(result, XCTWaiterResultCompleted); +} + +@end diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/SwiftyDropboxTestExtensions.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/SwiftyDropboxTestExtensions.swift new file mode 100644 index 000000000..0108341f0 --- /dev/null +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/SwiftyDropboxTestExtensions.swift @@ -0,0 +1,64 @@ +// +// TestSecureStorageAccess.swift +// TestSwiftyDropbox +// +// Created by jlocke on 12/13/23. +// Copyright © 2023 Dropbox. All rights reserved. +// + +import Foundation +import SwiftyDropbox +import SwiftyDropboxObjC + +public extension DBXDropboxOAuthManager { + @objc + static func __test_only_resetForTeamSetup() { + DropboxOAuthManager.sharedOAuthManager = nil + } +} + +@objc +public class DBXSecureStorageAccessTestImpl: DBXSecureStorageAccessImpl { + @objc + public convenience init() { + self.init(swift: SecureStorageAccessTestImpl()) + } + + fileprivate init(swift: SecureStorageAccessTestImpl) { + super.init(swift: swift) + } +} + +public class SecureStorageAccessTestImpl: SecureStorageAccess { + private var accessTokenData: Data? + + public init() {} + + public func checkAccessibilityMigrationOneTime() {} + + public func setAccessTokenData(for userId: String, data: Data) -> Bool { + accessTokenData = data + return true + } + + public func getAllUserIds() -> [String] { + [] + } + + public func getDropboxAccessToken(for key: String) -> DropboxAccessToken? { + guard let accessTokenData = accessTokenData else { + return nil + } + + let jsonDecoder = JSONDecoder() + return try? jsonDecoder.decode(DropboxAccessToken.self, from: accessTokenData) + } + + public func deleteInfo(for key: String) -> Bool { + true + } + + public func deleteInfoForAllKeys() -> Bool { + true + } +} diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/TeamRoutesTests.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/TeamRoutesTests.swift index 1969f4302..c968b7b0c 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/TeamRoutesTests.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/TeamRoutesTests.swift @@ -11,7 +11,6 @@ import XCTest @testable import SwiftyDropbox class TeamRoutesTests: XCTestCase { - private var teamClient: TeamRoutes! private var tester: DropboxTeamTester! @@ -53,9 +52,19 @@ class TeamRoutesTests: XCTestCase { DropboxOAuthManager.sharedOAuthManager = nil #if os(OSX) - DropboxClientsManager.setupWithTeamAppKeyMultiUserDesktop(apiAppKey, transportClient: transportClient, tokenUid: TestUid) + DropboxClientsManager.setupWithTeamAppKeyMultiUserDesktop( + apiAppKey, + transportClient: transportClient, + secureStorageAccess: SecureStorageAccessTestImpl(), + tokenUid: TestUid + ) #elseif os(iOS) - DropboxClientsManager.setupWithTeamAppKeyMultiUser(apiAppKey, transportClient: transportClient, tokenUid: TestUid) + DropboxClientsManager.setupWithTeamAppKeyMultiUser( + apiAppKey, + transportClient: transportClient, + secureStorageAccess: SecureStorageAccessTestImpl(), + tokenUid: TestUid + ) #endif teamClient = DropboxClientsManager.authorizedTeamClient?.team @@ -78,7 +87,7 @@ class TeamRoutesTests: XCTestCase { flag.fulfill() } - let result = XCTWaiter.wait(for: [flag], timeout: 60*5) + let result = XCTWaiter.wait(for: [flag], timeout: 60 * 5) XCTAssertEqual(result, .completed, "Error: timeout on team management routes tests") } @@ -89,7 +98,7 @@ class TeamRoutesTests: XCTestCase { flag.fulfill() } - let result = XCTWaiter.wait(for: [flag], timeout: 60*5) + let result = XCTWaiter.wait(for: [flag], timeout: 60 * 5) XCTAssertEqual(result, .completed, "Error: timeout on team management routes tests") } } diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_macOS/AppDelegate.swift b/TestSwiftyDropbox/TestSwiftyDropbox_macOS/AppDelegate.swift index 7554fac8d..34c8c334b 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_macOS/AppDelegate.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_macOS/AppDelegate.swift @@ -7,7 +7,7 @@ import SwiftyDropbox @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { - var viewController: ViewController? = nil; + var viewController: ViewController? func applicationDidFinishLaunching(_ aNotification: Notification) { let processInfo = ProcessInfo.processInfo.environment @@ -18,20 +18,26 @@ class AppDelegate: NSObject, NSApplicationDelegate { return } - if (TestData.fullDropboxAppKey.range(of:"<") != nil) { + if TestData.fullDropboxAppKey.range(of: "<") != nil { print("\n\n\nMust set test data (in TestData.swift) before launching app.\n\n\nTerminating.....\n\n") - exit(0); + exit(0) } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: DropboxClientsManager.setupWithAppKeyDesktop(TestData.fullDropboxAppKey) case .fullDropboxScopedForTeamTesting: DropboxClientsManager.setupWithTeamAppKeyDesktop(TestData.fullDropboxAppKey) } - NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(handleGetURLEvent), forEventClass: AEEventClass(kInternetEventClass), andEventID: AEEventID(kAEGetURL)) + NSAppleEventManager.shared() + .setEventHandler( + self, + andSelector: #selector(handleGetURLEvent), + forEventClass: AEEventClass(kInternetEventClass), + andEventID: AEEventID(kAEGetURL) + ) viewController = NSApplication.shared.windows[0].contentViewController as? ViewController - self.checkButtons() + checkButtons() } @objc func handleGetURLEvent(_ event: NSAppleEventDescriptor?, replyEvent: NSAppleEventDescriptor?) { @@ -52,9 +58,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { self.checkButtons() } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: - DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion) + DropboxClientsManager.handleRedirectURL(url, includeBackgroundClient: false, completion: oauthCompletion) case .fullDropboxScopedForTeamTesting: DropboxClientsManager.handleRedirectURLTeam(url, completion: oauthCompletion) } @@ -70,4 +76,3 @@ class AppDelegate: NSObject, NSApplicationDelegate { viewController?.checkButtons() } } - diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_macOS/ViewController.swift b/TestSwiftyDropbox/TestSwiftyDropbox_macOS/ViewController.swift index f0ab7c63b..6b19769f6 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_macOS/ViewController.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_macOS/ViewController.swift @@ -6,23 +6,22 @@ import Cocoa import SwiftyDropbox class ViewController: NSViewController { - @IBOutlet weak var oauthCodeFlowLinkButton: NSButton! - @IBOutlet weak var oauthUnlinkButton: NSButton! - @IBOutlet weak var runApiTestsButton: NSButton! - + @IBOutlet var oauthCodeFlowLinkButton: NSButton! + @IBOutlet var oauthUnlinkButton: NSButton! + @IBOutlet var runApiTestsButton: NSButton! + override func viewDidLoad() { super.viewDidLoad() } - - override func viewWillAppear() { - } + + override func viewWillAppear() {} @IBAction func oauthCodeFlowLinkButtonPressed(_ sender: AnyObject) { if DropboxClientsManager.authorizedClient == nil && DropboxClientsManager.authorizedTeamClient == nil { let scopeRequest: ScopeRequest // note if you add new scopes, you need to relogin to update your token - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: scopeRequest = ScopeRequest(scopeType: .user, scopes: DropboxTester.scopes, includeGrantedScopes: false) case .fullDropboxScopedForTeamTesting: @@ -32,7 +31,7 @@ class ViewController: NSViewController { sharedApplication: NSApplication.shared, controller: self, loadingStatusDelegate: nil, - openURL: {(url: URL) -> Void in NSWorkspace.shared.open(url)}, + openURL: { (url: URL) -> Void in NSWorkspace.shared.open(url) }, scopeRequest: scopeRequest ) } @@ -42,7 +41,7 @@ class ViewController: NSViewController { DropboxClientsManager.unlinkClients() checkButtons() } - + @IBAction func runApiTestsButtonPressed(_ sender: AnyObject) { let unlink = { DropboxClientsManager.unlinkClients() @@ -50,9 +49,9 @@ class ViewController: NSViewController { exit(0) } - switch(appPermission) { + switch appPermission { case .fullDropboxScoped: - DropboxTester().testAllUserEndpoints(asMember: false, nextTest:unlink) + DropboxTester().testAllUserEndpoints(asMember: false, nextTest: unlink) case .fullDropboxScopedForTeamTesting: DropboxTeamTester().testTeamMemberFileAcessActions({ DropboxTeamTester().testTeamMemberManagementActions(unlink) @@ -71,24 +70,24 @@ class ViewController: NSViewController { runApiTestsButton.isHidden = true } } - + /** To run these unit tests, you will need to do the following: - + Navigate to TestSwifty/ and run `pod install` to install AlamoFire dependencies. - + There are three types of unit tests here: - + 1.) Regular Dropbox User API tests (requires app with 'Full Dropbox' permissions) 2.) Dropbox Business API tests (requires app with 'Team member file access' permissions) 3.) Dropbox Business API tests (requires app with 'Team member management' permissions) - + To run all of these tests, you will need three apps, one for each of the above permission types. - + You must test these apps one at a time. - + Once you have these apps, you will need to do the following: - + 1.) Fill in user-specific data in `TestData` and `TestTeamData` in TestData.swift 2.) For each of the above apps, you will need to add a user-specific app key. For each test run, you will need to call `DropboxClientsManager.setupWithAppKey` (or `DropboxClientsManager.setupWithTeamAppKey`) and supply the @@ -98,11 +97,11 @@ class ViewController: NSViewController { 4.) For each of the above apps, you will need to add a user-specific URL scheme in Info.plist > URL types > Item 0 (Editor) > URL Schemes > click '+'. URL scheme value should be 'db-' where '' is value of your particular app's key - + To create an app or to locate your app's app key, please visit the App Console here: - + https://www.dropbox.com/developers/apps */ - + // Test user app with 'Full Dropbox' permission } diff --git a/TestSwiftyDropbox/TestUtils/TestTokenAuthGenerator.swift b/TestSwiftyDropbox/TestUtils/TestTokenAuthGenerator.swift index 30637af12..4271c057b 100644 --- a/TestSwiftyDropbox/TestUtils/TestTokenAuthGenerator.swift +++ b/TestSwiftyDropbox/TestUtils/TestTokenAuthGenerator.swift @@ -1,10 +1,10 @@ -import XCTest @testable import SwiftyDropbox +import XCTest let TestUid = "test" // non-empty string needed here as subsequent tokens will share the uid and macOS keychain drops the attribute if empty enum TestAuthTokenGenerator { static func transportClient(with refreshToken: String, apiKey: String, scopes: [String]) -> DropboxTransportClient? { - let manager = SwiftyDropbox.DropboxOAuthManager(appKey: apiKey) + let manager = SwiftyDropbox.DropboxOAuthManager(appKey: apiKey, secureStorageAccess: SecureStorageAccessTestImpl()) let defaultToken = DropboxAccessToken( accessToken: "", @@ -20,7 +20,8 @@ enum TestAuthTokenGenerator { manager.refreshAccessToken( defaultToken, scopes: scopes, - queue: DispatchQueue.global(qos: .userInitiated)) { result in + queue: DispatchQueue.global(qos: .userInitiated) + ) { result in switch result { case .success(let authToken)?: @@ -42,6 +43,6 @@ enum TestAuthTokenGenerator { XCTFail("AccessToken creation failed") fatalError("AccessToken creation failed") } - return DropboxTransportClient(accessTokenProvider: manager.accessTokenProviderForToken(accessToken)) + return DropboxTransportClientImpl(accessTokenProvider: manager.accessTokenProviderForToken(accessToken)) } } diff --git a/generate_base_client.py b/generate_base_client.py index a15e2609e..dec78b4df 100755 --- a/generate_base_client.py +++ b/generate_base_client.py @@ -38,12 +38,23 @@ type=str, help='Path to generation output.', ) +_cmdline_parser.add_argument( + '-objc', + action='store_true', + help='Generate objective-c routes', +) _cmdline_parser.add_argument( '-r', '--route-whitelist-filter', type=str, help='Path to route whitelist filter used by Stone. See stone -r for detailed instructions.', ) +_cmdline_parser.add_argument( + '-rop', + '--relative-objc-path', + type=str, + help='A custom output path for Objective-C compatible files relative to the standard Swift files', +) def main(): """The entry point for the program.""" @@ -65,20 +76,31 @@ def main(): stone_path = args.stone dropbox_default_output_path = 'Source/SwiftyDropbox/Shared/Generated' + dropbox_objc_output_path = 'Source/SwiftyDropboxObjC/Shared/Generated' dropbox_pkg_path = args.output_path if args.output_path else dropbox_default_output_path + dropbox_objc_pkg_path = args.output_path if args.output_path else dropbox_objc_output_path # we run stone generation relative to the stone module, # so we make our output path absolute here so it's relative to where we are called if not os.path.isabs(dropbox_pkg_path): dropbox_pkg_path = os.path.abspath(dropbox_pkg_path) + if not os.path.isabs(dropbox_objc_pkg_path): + dropbox_objc_pkg_path = os.path.abspath(dropbox_objc_pkg_path) + # clear out all old files - if os.path.exists(dropbox_pkg_path): - shutil.rmtree(dropbox_pkg_path) - os.makedirs(dropbox_pkg_path) + if args.objc: + if os.path.exists(dropbox_objc_pkg_path): + shutil.rmtree(dropbox_objc_pkg_path) + os.makedirs(dropbox_objc_pkg_path) + else: + if os.path.exists(dropbox_pkg_path): + shutil.rmtree(dropbox_pkg_path) + os.makedirs(dropbox_pkg_path) if verbose: print('Dropbox package path: %s' % dropbox_pkg_path) + print('Dropbox objc package path: %s' % dropbox_objc_pkg_path) print('Generating Swift types') stone_cmd_prefix = [ @@ -93,6 +115,10 @@ def main(): stone_cmd_prefix += ['-r', args.route_whitelist_filter] types_cmd = stone_cmd_prefix + ['swift_types', dropbox_pkg_path] + specs + if args.objc: + types_cmd = types_cmd + ['--', '-objc'] + if args.relative_objc_path is not None: + types_cmd = types_cmd + ['-rop', args.relative_objc_path] o = subprocess.check_output( (types_cmd), @@ -106,25 +132,46 @@ def main(): if verbose: print('Generating Swift user and team clients') + route_attrs = ['-a', 'scope'] + swift_client = ['swift_client', dropbox_pkg_path] + + base_args = ['-b', 'team', '--', '-w', 'user', '-m', 'Base', '-c', 'DropboxBase', + '-t', 'DropboxTransportClient', '-y', client_args, '-z', style_to_request] + team_args = ['-w', 'team', '--', '-w', 'team', '-m', 'BaseTeam', '-c', 'DropboxTeamBase', + '-t', 'DropboxTransportClient', '-y', client_args, '-z', style_to_request] + app_args = ['--', '-w', 'app', '-m', 'BaseApp', '-c', 'DropboxAppBase', + '-t', 'DropboxTransportClient', '-y', client_args, '-z', style_to_request] + + if args.objc: + base_args.append('-objc') + team_args.append('-objc') + app_args.append('-objc') + + if args.relative_objc_path is not None: + base_args = base_args + ['-rop', args.relative_objc_path] + team_args = team_args + ['-rop', args.relative_objc_path] + app_args = app_args + ['-rop', args.relative_objc_path] + + o = subprocess.check_output( + (stone_cmd_prefix + route_attrs + swift_client + specs + base_args), + cwd=stone_path) + if o: + print('Output:', o) o = subprocess.check_output( - (stone_cmd_prefix + ['swift_client', dropbox_pkg_path] + - specs + ['-b', 'team', '--', '-m', 'Base', '-c', 'DropboxBase', - '-t', 'DropboxTransportClient', '-y', client_args, '-z', style_to_request]), + (stone_cmd_prefix + route_attrs + swift_client + specs + team_args), cwd=stone_path) if o: print('Output:', o) + o = subprocess.check_output( - (stone_cmd_prefix + ['swift_client', dropbox_pkg_path] + - specs + ['-w', 'team', '--', '-m', 'BaseTeam', '-c', 'DropboxTeamBase', - '-t', 'DropboxTransportClient', '-y', client_args, '-z', style_to_request]), + (stone_cmd_prefix + route_attrs + swift_client + specs + app_args), cwd=stone_path) if o: print('Output:', o) def _get_client_args(): input_doc = "The file to upload, as an {} object." - dest_doc = ('A closure used to compute the destination, ' - + 'given the temporary file location and the response.') + dest_doc = ('The location to write the download to.') overwrite_doc = ('A boolean to set behavior in the event of a naming conflict. `True` will ' + 'overwrite conflicting file at destination. `False` will take no action (but ' @@ -138,7 +185,7 @@ def _get_client_args(): ], 'download': [ ('download_file', [('overwrite', 'overwrite', 'Bool = false', overwrite_doc), - ('destination', 'destination', '@escaping (URL, HTTPURLResponse) -> URL', dest_doc)]), + ('destination', 'destination', 'URL', dest_doc)]), ('download_memory', []), ], } diff --git a/spec b/spec index 3d1080a02..c83644049 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit 3d1080a021a67c335c52361d8f61ec558bb80606 +Subproject commit c8364404953d875801d496a81f786c5545f78223 diff --git a/stone b/stone index 02feff367..475348110 160000 --- a/stone +++ b/stone @@ -1 +1 @@ -Subproject commit 02feff367ba4b5dcae8ee7f430c6f745aeb6a705 +Subproject commit 475348110f0bc3820032c7b966f5affb56f28ae3 diff --git a/update_version.sh b/update_version.sh index 8dc16b8d6..88549caa7 100755 --- a/update_version.sh +++ b/update_version.sh @@ -13,10 +13,14 @@ arg_version_regex="^[0-9]+\.[0-9]+\.[0-9]+$" version_regex="[0-9]+\.[0-9]+\.[0-9]+" podspec=./SwiftyDropbox.podspec +objc_podspec=./SwiftyDropboxObjC.podspec readme=./README.md user_agent=Source/SwiftyDropbox/Shared/Handwritten/SDKConstants.swift ios_version=Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/Info.plist mac_version=Source/SwiftyDropbox/Platform/SwiftyDropbox_macOS/Info.plist +ios_objc_version=Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_iOS/Info.plist +mac_objc_version=Source/SwiftyDropboxObjC/Platform/SwiftyDropbox_macOS/Info.plist + if ! [[ $1 =~ $arg_version_regex ]]; then echo "\"$1\" version string must have format x.x.x" @@ -35,6 +39,14 @@ cat $podspec | grep $1 echo '--------------------' echo +echo "Replacing ObjC podspec version number..." +sed -i '' -E "s/s.version = '$version_regex'/s.version = '$1'/" $objc_podspec +sed -i '' -E "s/s.dependency 'SwiftyDropbox', '~> $version_regex'/s.dependency 'SwiftyDropbox', '~> $1'/" $objc_podspec +echo '--------------------' +cat $objc_podspec | grep $1 +echo '--------------------' +echo + echo "Replacing README version number..." sed -i '' -E "s/~> $version_regex/~> $1/" $readme echo '--------------------' @@ -62,6 +74,21 @@ echo '--------------------' cat $mac_version | grep $1 echo '--------------------' echo + +echo "Replacing iOS objc xcodeproj version number..." +sed -i '' -E "s/$version_regex/$1/" $ios_objc_version +echo '--------------------' +cat $ios_objc_version | grep $1 +echo '--------------------' +echo + +echo "Replacing macOS objc xcodeproj version number..." +sed -i '' -E "s/$version_regex/$1/" $mac_objc_version +echo '--------------------' +cat $mac_objc_version | grep $1 +echo '--------------------' +echo + echo echo "Committing changes and tagging commit." git commit -am "$1 release."